@goondocks/myco 0.27.18 → 0.27.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui/assets/{index-Dri_UAax.js → index-GRKrkWAI.js} +2 -2
- package/dist/ui/index.html +1 -1
- package/package.json +6 -6
- package/skills/myco/SKILL.md +29 -18
- package/skills/myco/references/cli-usage.md +43 -88
- package/skills/myco/references/reconfiguration.md +47 -59
- package/skills/myco/references/vault-status.md +21 -40
- package/skills/myco/references/wisdom.md +2 -2
|
@@ -8,7 +8,7 @@ Error generating stack: `+e.message+`
|
|
|
8
8
|
`+e.stack}}var he=Object.prototype.hasOwnProperty,ge=t.unstable_scheduleCallback,_e=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ye=t.unstable_requestPaint,be=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,Se=t.unstable_ImmediatePriority,Ce=t.unstable_UserBlockingPriority,we=t.unstable_NormalPriority,Te=t.unstable_LowPriority,Ee=t.unstable_IdlePriority,De=t.log,Oe=t.unstable_setDisableYieldValue,ke=null,Ae=null;function je(e){if(typeof De==`function`&&Oe(e),Ae&&typeof Ae.setStrictMode==`function`)try{Ae.setStrictMode(ke,e)}catch{}}var Me=Math.clz32?Math.clz32:Fe,Ne=Math.log,Pe=Math.LN2;function Fe(e){return e>>>=0,e===0?32:31-(Ne(e)/Pe|0)|0}var Ie=256,Le=262144,Re=4194304;function ze(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 Be(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=ze(n))):i=ze(o):i=ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ze(n))):i=ze(o)):i=ze(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 Ve(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function He(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 W(){var e=Re;return Re<<=1,!(Re&62914560)&&(Re=4194304),e}function G(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ue(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function We(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-Me(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&&Ge(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ge(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Me(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ke(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Me(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function qe(e,t){var n=t&-t;return n=n&42?1:Je(n),(n&(e.suspendedLanes|t))===0?n:0}function Je(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 Ye(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Xe(){var e=L.p;return e===0?(e=window.event,e===void 0?32:vp(e.type)):e}function Ze(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var Qe=Math.random().toString(36).slice(2),$e=`__reactFiber$`+Qe,et=`__reactProps$`+Qe,tt=`__reactContainer$`+Qe,nt=`__reactEvents$`+Qe,rt=`__reactListeners$`+Qe,it=`__reactHandles$`+Qe,at=`__reactResources$`+Qe,ot=`__reactMarker$`+Qe;function st(e){delete e[$e],delete e[et],delete e[nt],delete e[rt],delete e[it]}function ct(e){var t=e[$e];if(t)return t;for(var n=e.parentNode;n;){if(t=n[tt]||n[$e]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=hf(e);e!==null;){if(n=e[$e])return n;e=hf(e)}return t}e=n,n=e.parentNode}return null}function lt(e){if(e=e[$e]||e[tt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ut(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function dt(e){var t=e[at];return t||=e[at]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ft(e){e[ot]=!0}var pt=new Set,mt={};function ht(e,t){gt(e,t),gt(e+`Capture`,t)}function gt(e,t){for(mt[e]=t,e=0;e<t.length;e++)pt.add(t[e])}var _t=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]*$`),vt={},yt={};function bt(e){return he.call(yt,e)?!0:he.call(vt,e)?!1:_t.test(e)?yt[e]=!0:(vt[e]=!0,!1)}function xt(e,t,n){if(bt(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 St(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 Ct(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 wt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Tt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Et(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 Dt(e){if(!e._valueTracker){var t=Tt(e)?`checked`:`value`;e._valueTracker=Et(e,t,``+e[t])}}function Ot(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Tt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function kt(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 At=/[\n"\\]/g;function jt(e){return e.replace(At,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Mt(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=``+wt(t)):e.value!==``+wt(t)&&(e.value=``+wt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Pt(e,o,wt(n)):Pt(e,o,wt(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=``+wt(s):e.removeAttribute(`name`)}function Nt(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)){Dt(e);return}n=n==null?``:``+wt(n),t=t==null?n:``+wt(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),Dt(e)}function Pt(e,t,n){t===`number`&&kt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Ft(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=``+wt(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 It(e,t,n){if(t!=null&&(t=``+wt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+wt(n)}function Lt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=wt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Dt(e)}function Rt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var zt=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 Bt(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||zt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Vt(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&&Bt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Bt(e,o,t[o])}function Ht(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 Ut=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`]]),Wt=/^[\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 Gt(e){return Wt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Kt(){}var qt=null;function Jt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yt=null,Xt=null;function Zt(e){var t=lt(e);if(t&&(e=t.stateNode)){var n=e[et]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Mt(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="`+jt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[et]||null;if(!a)throw Error(i(90));Mt(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&&Ot(r)}break a;case`textarea`:It(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Ft(e,!!n.multiple,t,!1)}}}var Qt=!1;function $t(e,t,n){if(Qt)return e(t,n);Qt=!0;try{return e(t)}finally{if(Qt=!1,(Yt!==null||Xt!==null)&&(xu(),Yt&&(t=Yt,e=Xt,Xt=Yt=null,Zt(t),e)))for(t=0;t<e.length;t++)Zt(e[t])}}function en(e,t){var n=e.stateNode;if(n===null)return null;var r=n[et]||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 tn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),nn=!1;if(tn)try{var rn={};Object.defineProperty(rn,`passive`,{get:function(){nn=!0}}),window.addEventListener(`test`,rn,rn),window.removeEventListener(`test`,rn,rn)}catch{nn=!1}var an=null,on=null,sn=null;function cn(){if(sn)return sn;var e,t=on,n=t.length,r,i=`value`in an?an.value:an.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 sn=i.slice(e,1<r?1-r:void 0)}function ln(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 un(){return!0}function dn(){return!1}function fn(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)?un:dn,this.isPropagationStopped=dn,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=un)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var pn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mn=fn(pn),hn=m({},pn,{view:0,detail:0}),gn=fn(hn),_n,vn,yn,bn=m({},hn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jn,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!==yn&&(yn&&e.type===`mousemove`?(_n=e.screenX-yn.screenX,vn=e.screenY-yn.screenY):vn=_n=0,yn=e),_n)},movementY:function(e){return`movementY`in e?e.movementY:vn}}),xn=fn(bn),Sn=fn(m({},bn,{dataTransfer:0})),Cn=fn(m({},hn,{relatedTarget:0})),wn=fn(m({},pn,{animationName:0,elapsedTime:0,pseudoElement:0})),Tn=fn(m({},pn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),En=fn(m({},pn,{data:0})),Dn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},On={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`},kn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function An(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kn[e])?!!t[e]:!1}function jn(){return An}var Mn=fn(m({},hn,{key:function(e){if(e.key){var t=Dn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=ln(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?On[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jn,charCode:function(e){return e.type===`keypress`?ln(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?ln(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Nn=fn(m({},bn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Pn=fn(m({},hn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jn})),Fn=fn(m({},pn,{propertyName:0,elapsedTime:0,pseudoElement:0})),In=fn(m({},bn,{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})),Ln=fn(m({},pn,{newState:0,oldState:0})),Rn=[9,13,27,32],zn=tn&&`CompositionEvent`in window,Bn=null;tn&&`documentMode`in document&&(Bn=document.documentMode);var Vn=tn&&`TextEvent`in window&&!Bn,Hn=tn&&(!zn||Bn&&8<Bn&&11>=Bn),Un=` `,Wn=!1;function Gn(e,t){switch(e){case`keyup`:return Rn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Kn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var qn=!1;function Jn(e,t){switch(e){case`compositionend`:return Kn(t);case`keypress`:return t.which===32?(Wn=!0,Un):null;case`textInput`:return e=t.data,e===Un&&Wn?null:e;default:return null}}function Yn(e,t){if(qn)return e===`compositionend`||!zn&&Gn(e,t)?(e=cn(),sn=on=an=null,qn=!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 Hn&&t.locale!==`ko`?null:t.data;default:return null}}var Xn={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 Zn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Xn[e.type]:t===`textarea`}function Qn(e,t,n,r){Yt?Xt?Xt.push(r):Xt=[r]:Yt=r,t=kd(t,`onChange`),0<t.length&&(n=new mn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var $n=null,er=null;function tr(e){xd(e,0)}function nr(e){if(Ot(ut(e)))return e}function rr(e,t){if(e===`change`)return t}var ir=!1;if(tn){var ar;if(tn){var or=`oninput`in document;if(!or){var sr=document.createElement(`div`);sr.setAttribute(`oninput`,`return;`),or=typeof sr.oninput==`function`}ar=or}else ar=!1;ir=ar&&(!document.documentMode||9<document.documentMode)}function cr(){$n&&($n.detachEvent(`onpropertychange`,lr),er=$n=null)}function lr(e){if(e.propertyName===`value`&&nr(er)){var t=[];Qn(t,er,e,Jt(e)),$t(tr,t)}}function ur(e,t,n){e===`focusin`?(cr(),$n=t,er=n,$n.attachEvent(`onpropertychange`,lr)):e===`focusout`&&cr()}function dr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return nr(er)}function fr(e,t){if(e===`click`)return nr(t)}function pr(e,t){if(e===`input`||e===`change`)return nr(t)}function mr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var hr=typeof Object.is==`function`?Object.is:mr;function gr(e,t){if(hr(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(!he.call(t,i)||!hr(e[i],t[i]))return!1}return!0}function _r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function vr(e,t){var n=_r(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=_r(n)}}function yr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function br(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=kt(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=kt(e.document)}return t}function xr(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 Sr=tn&&`documentMode`in document&&11>=document.documentMode,Cr=null,wr=null,Tr=null,Er=!1;function Dr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Er||Cr==null||Cr!==kt(r)||(r=Cr,`selectionStart`in r&&xr(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}),Tr&&gr(Tr,r)||(Tr=r,r=kd(wr,`onSelect`),0<r.length&&(t=new mn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Cr)))}function Or(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var kr={animationend:Or(`Animation`,`AnimationEnd`),animationiteration:Or(`Animation`,`AnimationIteration`),animationstart:Or(`Animation`,`AnimationStart`),transitionrun:Or(`Transition`,`TransitionRun`),transitionstart:Or(`Transition`,`TransitionStart`),transitioncancel:Or(`Transition`,`TransitionCancel`),transitionend:Or(`Transition`,`TransitionEnd`)},Ar={},jr={};tn&&(jr=document.createElement(`div`).style,`AnimationEvent`in window||(delete kr.animationend.animation,delete kr.animationiteration.animation,delete kr.animationstart.animation),`TransitionEvent`in window||delete kr.transitionend.transition);function Mr(e){if(Ar[e])return Ar[e];if(!kr[e])return e;var t=kr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jr)return Ar[e]=t[n];return e}var Nr=Mr(`animationend`),Pr=Mr(`animationiteration`),Fr=Mr(`animationstart`),Ir=Mr(`transitionrun`),Lr=Mr(`transitionstart`),Rr=Mr(`transitioncancel`),zr=Mr(`transitionend`),Br=new Map,Vr=`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(` `);Vr.push(`scrollEnd`);function Hr(e,t){Br.set(e,t),ht(t,[e])}var Ur=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)},Wr=[],Gr=0,Kr=0;function qr(){for(var e=Gr,t=Kr=Gr=0;t<e;){var n=Wr[t];Wr[t++]=null;var r=Wr[t];Wr[t++]=null;var i=Wr[t];Wr[t++]=null;var a=Wr[t];if(Wr[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&&Zr(n,i,a)}}function Jr(e,t,n,r){Wr[Gr++]=e,Wr[Gr++]=t,Wr[Gr++]=n,Wr[Gr++]=r,Kr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yr(e,t,n,r){return Jr(e,t,n,r),Qr(e)}function Xr(e,t){return Jr(e,null,null,t),Qr(e)}function Zr(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-Me(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Qr(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 $r={};function ei(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 ti(e,t,n,r){return new ei(e,t,n,r)}function ni(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ri(e,t){var n=e.alternate;return n===null?(n=ti(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 ii(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 ai(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ni(e)&&(s=1);else if(typeof e==`string`)s=qf(e,n,te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ti(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return oi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ti(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ti(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ti(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=ti(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function oi(e,t,n,r){return e=ti(7,e,r,t),e.lanes=n,e}function si(e,t,n){return e=ti(6,e,null,t),e.lanes=n,e}function ci(e){var t=ti(18,null,null,0);return t.stateNode=e,t}function li(e,t,n){return t=ti(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ui=new WeakMap;function di(e,t){if(typeof e==`object`&&e){var n=ui.get(e);return n===void 0?(t={value:e,source:t,stack:me(t)},ui.set(e,t),t):n}return{value:e,source:t,stack:me(t)}}var fi=[],pi=0,mi=null,hi=0,gi=[],_i=0,vi=null,yi=1,bi=``;function xi(e,t){fi[pi++]=hi,fi[pi++]=mi,mi=e,hi=t}function Si(e,t,n){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,vi=e;var r=yi;e=bi;var i=32-Me(r)-1;r&=~(1<<i),n+=1;var a=32-Me(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,yi=1<<32-Me(t)+i|n<<i|r,bi=a+e}else yi=1<<a|n<<i|r,bi=e}function Ci(e){e.return!==null&&(xi(e,1),Si(e,1,0))}function wi(e){for(;e===mi;)mi=fi[--pi],fi[pi]=null,hi=fi[--pi],fi[pi]=null;for(;e===vi;)vi=gi[--_i],gi[_i]=null,bi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null}function Ti(e,t){gi[_i++]=yi,gi[_i++]=bi,gi[_i++]=vi,yi=t.id,bi=t.overflow,vi=e}var Ei=null,Di=null,Oi=!1,ki=null,Ai=!1,ji=Error(i(519));function Mi(e){throw Ri(di(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ji}function Ni(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[$e]=e,t[et]=r,n){case`dialog`:Sd(`cancel`,t),Sd(`close`,t);break;case`iframe`:case`object`:case`embed`:Sd(`load`,t);break;case`video`:case`audio`:for(n=0;n<yd.length;n++)Sd(yd[n],t);break;case`source`:Sd(`error`,t);break;case`img`:case`image`:case`link`:Sd(`error`,t),Sd(`load`,t);break;case`details`:Sd(`toggle`,t);break;case`input`:Sd(`invalid`,t),Nt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Sd(`invalid`,t);break;case`textarea`:Sd(`invalid`,t),Lt(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||Fd(t.textContent,n)?(r.popover!=null&&(Sd(`beforetoggle`,t),Sd(`toggle`,t)),r.onScroll!=null&&Sd(`scroll`,t),r.onScrollEnd!=null&&Sd(`scrollend`,t),r.onClick!=null&&(t.onclick=Kt),t=!0):t=!1,t||Mi(e,!0)}function Pi(e){for(Ei=e.return;Ei;)switch(Ei.tag){case 5:case 31:case 13:Ai=!1;return;case 27:case 3:Ai=!0;return;default:Ei=Ei.return}}function Fi(e){if(e!==Ei)return!1;if(!Oi)return Pi(e),Oi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||qd(e.type,e.memoizedProps)),n=!n),n&&Di&&Mi(e),Pi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=mf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Di=mf(e)}else t===27?(t=Di,tf(e.type)?(e=pf,pf=null,Di=e):Di=t):Di=Ei?ff(e.stateNode.nextSibling):null;return!0}function Ii(){Di=Ei=null,Oi=!1}function Li(){var e=ki;return e!==null&&(Ql===null?Ql=e:Ql.push.apply(Ql,e),ki=null),e}function Ri(e){ki===null?ki=[e]:ki.push(e)}var zi=B(null),Bi=null,Vi=null;function Hi(e,t,n){H(zi,t._currentValue),t._currentValue=n}function Ui(e){e._currentValue=zi.current,V(zi)}function Wi(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 Gi(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),Wi(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),Wi(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 Ki(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;hr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===re.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[np]:e.push(np))}a=a.return}e!==null&&Gi(t,e,n,r),t.flags|=262144}function qi(e){for(e=e.firstContext;e!==null;){if(!hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ji(e){Bi=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Yi(e){return Zi(Bi,e)}function Xi(e,t){return Bi===null&&Ji(e),Zi(e,t)}function Zi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Vi===null){if(e===null)throw Error(i(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return n}var Qi=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()})}},$i=t.unstable_scheduleCallback,ea=t.unstable_NormalPriority,ta={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function na(){return{controller:new Qi,data:new Map,refCount:0}}function ra(e){e.refCount--,e.refCount===0&&$i(ea,function(){e.controller.abort()})}var ia=null,aa=0,oa=0,sa=null;function ca(e,t){if(ia===null){var n=ia=[];aa=0,oa=pd(),sa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return aa++,t.then(la,la),t}function la(){if(--aa===0&&ia!==null){sa!==null&&(sa.status=`fulfilled`);var e=ia;ia=null,oa=0,sa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ua(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 da=I.S;I.S=function(e,t){tu=be(),typeof t==`object`&&t&&typeof t.then==`function`&&ca(e,t),da!==null&&da(e,t)};var fa=B(null);function pa(){var e=fa.current;return e===null?Il.pooledCache:e}function ma(e,t){t===null?H(fa,fa.current):H(fa,t.pool)}function ha(){var e=pa();return e===null?null:{parent:ta._currentValue,pool:e}}var ga=Error(i(460)),_a=Error(i(474)),va=Error(i(542)),ya={then:function(){}};function ba(e){return e=e.status,e===`fulfilled`||e===`rejected`}function xa(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kt,Kt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ta(e),e;default:if(typeof t.status==`string`)t.then(Kt,Kt);else{if(e=Il,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,Ta(e),e}throw Ca=t,ga}}function Sa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ca=e,ga):e}}var Ca=null;function wa(){if(Ca===null)throw Error(i(459));var e=Ca;return Ca=null,e}function Ta(e){if(e===ga||e===va)throw Error(i(483))}var Ea=null,Da=0;function Oa(e){var t=Da;return Da+=1,Ea===null&&(Ea=[]),xa(Ea,e,t)}function ka(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Aa(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 ja(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=ri(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=si(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&&Sa(i)===t.type)?(t=a(t,n.props),ka(t,n),t.return=e,t):(t=ai(n.type,n.key,n.props,null,e.mode,r),ka(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=li(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=oi(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=si(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=ai(t.type,t.key,t.props,null,e.mode,n),ka(n,t),n.return=e,n;case v:return t=li(t,e.mode,n),t.return=e,t;case O:return t=Sa(t),f(e,t,n)}if(F(t)||M(t))return t=oi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Oa(t),n);if(t.$$typeof===C)return f(e,Xi(e,t),n);Aa(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=Sa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Oa(n),r);if(n.$$typeof===C)return p(e,t,Xi(e,n),r);Aa(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=Sa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Oa(r),i);if(r.$$typeof===C)return m(e,t,n,Xi(t,r),i);Aa(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),Oi&&xi(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 Oi&&xi(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)}),Oi&&xi(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),Oi&&xi(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 Oi&&xi(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)}),Oi&&xi(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&&Sa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ka(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=oi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ai(o.type,o.key,o.props,null,e.mode,c),ka(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=li(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Sa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(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,Oa(o),c);if(o.$$typeof===C)return b(e,r,Xi(e,o),c);Aa(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=si(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Da=0;var i=b(e,t,n,r);return Ea=null,i}catch(t){if(t===ga||t===va)throw t;var a=ti(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ma=ja(!0),Na=ja(!1),Pa=!1;function Fa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ia(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 La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Fl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Qr(e),Zr(e,null,n),t}return Jr(e,r,t,n),Qr(e)}function za(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,Ke(e,n)}}function Ba(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 Va=!1;function Ha(){if(Va){var e=sa;if(e!==null)throw e}}function Ua(e,t,n,r){Va=!1;var i=e.updateQueue;Pa=!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?(Rl&f)===f:(r&f)===f){f!==0&&f===oa&&(Va=!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:Pa=!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),Kl|=o,e.lanes=o,e.memoizedState=d}}function Wa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ga(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Wa(n[e],t)}var Ka=B(null),qa=B(0);function Ja(e,t){e=Wl,H(qa,e),H(Ka,t),Wl=e|t.baseLanes}function Ya(){H(qa,Wl),H(Ka,Ka.current)}function Xa(){Wl=qa.current,V(Ka),V(qa)}var Za=B(null),Qa=null;function $a(e){var t=e.alternate;H(io,io.current&1),H(Za,e),Qa===null&&(t===null||Ka.current!==null||t.memoizedState!==null)&&(Qa=e)}function eo(e){H(io,io.current),H(Za,e),Qa===null&&(Qa=e)}function to(e){e.tag===22?(H(io,io.current),H(Za,e),Qa===null&&(Qa=e)):no(e)}function no(){H(io,io.current),H(Za,Za.current)}function ro(e){V(Za),Qa===e&&(Qa=null),V(io)}var io=B(0);function ao(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||lf(n)||uf(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 K=0,oo=null,so=null,co=null,lo=!1,uo=!1,fo=!1,po=0,mo=0,ho=null,go=0;function _o(){throw Error(i(321))}function vo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hr(e[n],t[n]))return!1;return!0}function yo(e,t,n,r,i,a){return K=a,oo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Is:Ls,fo=!1,a=n(r,i),fo=!1,uo&&(a=xo(t,n,r,i)),bo(e),a}function bo(e){I.H=Fs;var t=so!==null&&so.next!==null;if(K=0,co=so=oo=null,lo=!1,mo=0,ho=null,t)throw Error(i(300));e===null||ec||(e=e.dependencies,e!==null&&qi(e)&&(ec=!0))}function xo(e,t,n,r){oo=e;var a=0;do{if(uo&&(ho=null),mo=0,uo=!1,25<=a)throw Error(i(301));if(a+=1,co=so=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=Rs,o=t(n,r)}while(uo);return o}function So(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?ko(t):t,e=e.useState()[0],(so===null?null:so.memoizedState)!==e&&(oo.flags|=1024),t}function Co(){var e=po!==0;return po=0,e}function wo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function To(e){if(lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}lo=!1}K=0,co=so=oo=null,uo=!1,mo=po=0,ho=null}function Eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return co===null?oo.memoizedState=co=e:co=co.next=e,co}function Do(){if(so===null){var e=oo.alternate;e=e===null?null:e.memoizedState}else e=so.next;var t=co===null?oo.memoizedState:co.next;if(t!==null)co=t,so=e;else{if(e===null)throw oo.alternate===null?Error(i(467)):Error(i(310));so=e,e={memoizedState:so.memoizedState,baseState:so.baseState,baseQueue:so.baseQueue,queue:so.queue,next:null},co===null?oo.memoizedState=co=e:co=co.next=e}return co}function Oo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ko(e){var t=mo;return mo+=1,ho===null&&(ho=[]),e=xa(ho,e,t),t=oo,(co===null?t.memoizedState:co.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Is:Ls),e}function Ao(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ko(e);if(e.$$typeof===C)return Yi(e)}throw Error(i(438,String(e)))}function jo(e){var t=null,n=oo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=oo.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=Oo(),oo.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]=A;return t.index++,n}function Mo(e,t){return typeof t==`function`?t(e):t}function No(e){return Po(Do(),so,e)}function Po(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?(K&f)===f:(Rl&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===oa&&(d=!0);else if((K&p)===p){u=u.next,p===oa&&(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,oo.lanes|=p,Kl|=p;f=u.action,fo&&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,oo.lanes|=f,Kl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!hr(o,e.memoizedState)&&(ec=!0,d&&(n=sa,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 Fo(e){var t=Do(),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);hr(o,t.memoizedState)||(ec=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Io(e,t,n){var r=oo,a=Do(),o=Oi;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!hr((so||a).memoizedState,n);if(s&&(a.memoizedState=n,ec=!0),a=a.queue,ss(zo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||co!==null&&co.memoizedState.tag&1){if(r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,a,n,t),null),Il===null)throw Error(i(349));o||K&127||Lo(r,t,n)}return n}function Lo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=oo.updateQueue,t===null?(t=Oo(),oo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Ro(e,t,n,r){t.value=n,t.getSnapshot=r,Bo(t)&&Vo(e)}function zo(e,t,n){return n(function(){Bo(t)&&Vo(e)})}function Bo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hr(e,n)}catch{return!0}}function Vo(e){var t=Xr(e,2);t!==null&&gu(t,e,2)}function Ho(e){var t=Eo();if(typeof e==`function`){var n=e;if(e=n(),fo){je(!0);try{n()}finally{je(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:e},t}function Uo(e,t,n,r){return e.baseState=n,Po(e,so,typeof r==`function`?r:Mo)}function Wo(e,t,n,r,a){if(Ms(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)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Go(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Go(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Ko(e,t,s)}catch(n){Jo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Ko(e,t,a)}catch(n){Jo(e,t,n)}}function Ko(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){qo(e,t,n)},function(n){return Jo(e,t,n)}):qo(e,t,n)}function qo(e,t,n){t.status=`fulfilled`,t.value=n,Yo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Go(e,n)))}function Jo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Yo(t),t=t.next;while(t!==r)}e.action=null}function Yo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xo(e,t){return t}function Zo(e,t){if(Oi){var n=Il.formState;if(n!==null){a:{var r=oo;if(Oi){if(Di){b:{for(var i=Di,a=Ai;i.nodeType!==8;){if(!a){i=null;break b}if(i=ff(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Di=ff(i.nextSibling),r=i.data===`F!`;break a}}Mi(r)}r=!1}r&&(t=n[0])}}return n=Eo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xo,lastRenderedState:t},n.queue=r,n=ks.bind(null,oo,r),r.dispatch=n,r=Ho(!1),a=js.bind(null,oo,!1,r.queue),r=Eo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Wo.bind(null,oo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Qo(e){return $o(Do(),so,e)}function $o(e,t,n){if(t=Po(e,t,Xo)[0],e=No(Mo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ko(t)}catch(e){throw e===ga?va:e}else r=t;t=Do();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(oo.flags|=2048,ns(9,{destroy:void 0},es.bind(null,i,n),null)),[r,a,e]}function es(e,t){e.action=t}function ts(e){var t=Do(),n=so;if(n!==null)return $o(t,n,e);Do(),t=t.memoizedState,n=Do();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ns(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=oo.updateQueue,t===null&&(t=Oo(),oo.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 rs(){return Do().memoizedState}function is(e,t,n,r){var i=Eo();oo.flags|=e,i.memoizedState=ns(1|t,{destroy:void 0},n,r===void 0?null:r)}function as(e,t,n,r){var i=Do();r=r===void 0?null:r;var a=i.memoizedState.inst;so!==null&&r!==null&&vo(r,so.memoizedState.deps)?i.memoizedState=ns(t,a,n,r):(oo.flags|=e,i.memoizedState=ns(1|t,a,n,r))}function os(e,t){is(8390656,8,e,t)}function ss(e,t){as(2048,8,e,t)}function cs(e){oo.flags|=4;var t=oo.updateQueue;if(t===null)t=Oo(),oo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ls(e){var t=Do().memoizedState;return cs({ref:t,nextImpl:e}),function(){if(Fl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function us(e,t){return as(4,2,e,t)}function ds(e,t){return as(4,4,e,t)}function fs(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 ps(e,t,n){n=n==null?null:n.concat([e]),as(4,4,fs.bind(null,t,e),n)}function ms(){}function hs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&vo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function gs(e,t){var n=Do();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&vo(t,r[1]))return r[0];if(r=e(),fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r}function _s(e,t,n){return n===void 0||K&1073741824&&!(Rl&261930)?e.memoizedState=t:(e.memoizedState=n,e=hu(),oo.lanes|=e,Kl|=e,n)}function vs(e,t,n,r){return hr(n,t)?n:Ka.current===null?!(K&42)||K&1073741824&&!(Rl&261930)?(ec=!0,e.memoizedState=n):(e=hu(),oo.lanes|=e,Kl|=e,t):(e=_s(e,n,r),hr(e,t)||(ec=!0),e)}function ys(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,js(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?As(e,t,ua(c,r),mu(e)):As(e,t,r,mu(e))}catch(n){As(e,t,{then:function(){},status:`rejected`,reason:n},mu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function bs(){}function xs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ss(e).queue;ys(e,a,t,R,n===null?bs:function(){return Cs(e),n(r)})}function Ss(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Cs(e){var t=Ss(e);t.next===null&&(t=e.alternate.memoizedState),As(e,t.next.queue,{},mu())}function ws(){return Yi(np)}function Ts(){return Do().memoizedState}function Es(){return Do().memoizedState}function Ds(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=mu();e=La(n);var r=Ra(t,e,n);r!==null&&(gu(r,t,n),za(r,t,n)),t={cache:na()},e.payload=t;return}t=t.return}}function Os(e,t,n){var r=mu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ms(e)?Ns(t,n):(n=Yr(e,t,n,r),n!==null&&(gu(n,e,r),Ps(n,t,r)))}function ks(e,t,n){As(e,t,n,mu())}function As(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ms(e))Ns(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,hr(s,o))return Jr(e,t,i,0),Il===null&&qr(),!1}catch{}if(n=Yr(e,t,i,r),n!==null)return gu(n,e,r),Ps(n,t,r),!0}return!1}function js(e,t,n,r){if(r={lane:2,revertLane:pd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ms(e)){if(t)throw Error(i(479))}else t=Yr(e,n,r,2),t!==null&&gu(t,e,2)}function Ms(e){var t=e.alternate;return e===oo||t!==null&&t===oo}function Ns(e,t){uo=lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ps(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ke(e,n)}}var Fs={readContext:Yi,use:Ao,useCallback:_o,useContext:_o,useEffect:_o,useImperativeHandle:_o,useLayoutEffect:_o,useInsertionEffect:_o,useMemo:_o,useReducer:_o,useRef:_o,useState:_o,useDebugValue:_o,useDeferredValue:_o,useTransition:_o,useSyncExternalStore:_o,useId:_o,useHostTransitionStatus:_o,useFormState:_o,useActionState:_o,useOptimistic:_o,useMemoCache:_o,useCacheRefresh:_o};Fs.useEffectEvent=_o;var Is={readContext:Yi,use:Ao,useCallback:function(e,t){return Eo().memoizedState=[e,t===void 0?null:t],e},useContext:Yi,useEffect:os,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),is(4194308,4,fs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return is(4194308,4,e,t)},useInsertionEffect:function(e,t){is(4,2,e,t)},useMemo:function(e,t){var n=Eo();t=t===void 0?null:t;var r=e();if(fo){je(!0);try{e()}finally{je(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Eo();if(n!==void 0){var i=n(t);if(fo){je(!0);try{n(t)}finally{je(!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=Os.bind(null,oo,e),[r.memoizedState,e]},useRef:function(e){var t=Eo();return e={current:e},t.memoizedState=e},useState:function(e){e=Ho(e);var t=e.queue,n=ks.bind(null,oo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ms,useDeferredValue:function(e,t){return _s(Eo(),e,t)},useTransition:function(){var e=Ho(!1);return e=ys.bind(null,oo,e.queue,!0,!1),Eo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=oo,a=Eo();if(Oi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Il===null)throw Error(i(349));Rl&127||Lo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,os(zo.bind(null,r,o,e),[e]),r.flags|=2048,ns(9,{destroy:void 0},Ro.bind(null,r,o,n,t),null),n},useId:function(){var e=Eo(),t=Il.identifierPrefix;if(Oi){var n=bi,r=yi;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=po++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=go++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ws,useFormState:Zo,useActionState:Zo,useOptimistic:function(e){var t=Eo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=js.bind(null,oo,!0,n),n.dispatch=t,[e,t]},useMemoCache:jo,useCacheRefresh:function(){return Eo().memoizedState=Ds.bind(null,oo)},useEffectEvent:function(e){var t=Eo(),n={impl:e};return t.memoizedState=n,function(){if(Fl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Ls={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:No,useRef:rs,useState:function(){return No(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){return vs(Do(),so.memoizedState,e,t)},useTransition:function(){var e=No(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:Qo,useActionState:Qo,useOptimistic:function(e,t){return Uo(Do(),so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Ls.useEffectEvent=ls;var Rs={readContext:Yi,use:Ao,useCallback:hs,useContext:Yi,useEffect:ss,useImperativeHandle:ps,useInsertionEffect:us,useLayoutEffect:ds,useMemo:gs,useReducer:Fo,useRef:rs,useState:function(){return Fo(Mo)},useDebugValue:ms,useDeferredValue:function(e,t){var n=Do();return so===null?_s(n,e,t):vs(n,so.memoizedState,e,t)},useTransition:function(){var e=Fo(Mo)[0],t=Do().memoizedState;return[typeof e==`boolean`?e:ko(e),t]},useSyncExternalStore:Io,useId:Ts,useHostTransitionStatus:ws,useFormState:ts,useActionState:ts,useOptimistic:function(e,t){var n=Do();return so===null?(n.baseState=e,[e,n.queue.dispatch]):Uo(n,so,e,t)},useMemoCache:jo,useCacheRefresh:Es};Rs.useEffectEvent=ls;function zs(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 Bs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=mu(),i=La(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ra(e,i,r),t!==null&&(gu(t,e,r),za(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=mu(),r=La(n);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,n),t!==null&&(gu(t,e,n),za(t,e,n))}};function Vs(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?!gr(n,r)||!gr(i,a):!0}function Hs(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&&Bs.enqueueReplaceState(t,t.state,null)}function Us(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 Ws(e){Ur(e)}function Gs(e){console.error(e)}function Ks(e){Ur(e)}function qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Js(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 Ys(e,t,n){return n=La(n),n.tag=3,n.payload={element:null},n.callback=function(){qs(e,t)},n}function Xs(e){return e=La(e),e.tag=3,e}function Zs(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(){Js(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Js(t,n,r),typeof i!=`function`&&(iu===null?iu=new Set([this]):iu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Qs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ki(t,n,a,!0),n=Za.current,n!==null){switch(n.tag){case 31:case 13:return Qa===null?Ou():n.alternate===null&&Gl===0&&(Gl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===ya?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===ya?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(Oi)return t=Za.current,t===null?(r!==ji&&(t=Error(i(423),{cause:r}),Ri(di(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=di(r,n),a=Ys(e.stateNode,r,a),Ba(e,a),Gl!==4&&(Gl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ji&&(e=Error(i(422),{cause:r}),Ri(di(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=di(o,n),Zl===null?Zl=[o]:Zl.push(o),Gl!==4&&(Gl=2),t===null)return!0;r=di(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Ys(n.stateNode,r,e),Ba(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`&&(iu===null||!iu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Xs(a),Zs(a,e,n,r),Ba(n,a),!1}n=n.return}while(n!==null);return!1}var $s=Error(i(461)),ec=!1;function tc(e,t,n,r){t.child=e===null?Na(t,null,n,r):Ma(t,e.child,n,r)}function nc(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 Ji(t),r=yo(e,t,n,o,a,i),s=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&s&&Ci(t),t.flags|=1,tc(e,t,r,i),t.child)}function rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ni(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ic(e,t,a,r,i)):(e=ai(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Dc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?gr:n,n(o,r)&&e.ref===t.ref)return Ec(e,t,i)}return t.flags|=1,e=ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function ic(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(gr(a,r)&&e.ref===t.ref)if(ec=!1,t.pendingProps=r=a,Dc(e,i))e.flags&131072&&(ec=!0);else return t.lanes=e.lanes,Ec(e,t,i)}return fc(e,t,n,r,i)}function ac(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 sc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,a===null?null:a.cachePool),a===null?Ya():Ja(t,a),to(t);else return r=t.lanes=536870912,sc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ma(t,null),Ya(),no(t)):(ma(t,a.cachePool),Ja(t,a),no(t),t.memoizedState=null);return tc(e,t,i,n),t.child}function oc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function sc(e,t,n,r,i){var a=pa();return a=a===null?null:{parent:ta._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ma(t,null),Ya(),to(t),e!==null&&Ki(e,t,r,!0),t.childLanes=i,null}function cc(e,t){return t=xc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lc(e,t,n){return Ma(t,e.child,null,n),e=cc(t,t.pendingProps),e.flags|=2,ro(t),t.memoizedState=null,e}function uc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Oi){if(r.mode===`hidden`)return e=cc(t,r),t.lanes=536870912,oc(null,e);if(eo(t),(e=Di)?(e=cf(e,Ai),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return t.lanes=536870912,null}return cc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(eo(t),a)if(t.flags&256)t.flags&=-257,t=lc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(ec||Ki(e,t,n,!1),a=(n&e.childLanes)!==0,ec||a){if(r=Il,r!==null&&(s=qe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Xr(e,s),gu(r,e,s),$s;Ou(),t=lc(e,t,n)}else e=o.treeContext,Di=ff(s.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=cc(t,r),t.flags|=4096;return t}return e=ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function dc(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 fc(e,t,n,r,i){return Ji(t),n=yo(e,t,n,r,void 0,i),r=Co(),e!==null&&!ec?(wo(e,t,i),Ec(e,t,i)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,i),t.child)}function pc(e,t,n,r,i,a){return Ji(t),t.updateQueue=null,n=xo(t,r,n,i),bo(e),r=Co(),e!==null&&!ec?(wo(e,t,a),Ec(e,t,a)):(Oi&&r&&Ci(t),t.flags|=1,tc(e,t,n,a),t.child)}function mc(e,t,n,r,i){if(Ji(t),t.stateNode===null){var a=$r,o=n.contextType;typeof o==`object`&&o&&(a=Yi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Bs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Fa(t),o=n.contextType,a.context=typeof o==`object`&&o?Yi(o):$r,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(zs(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&&Bs.enqueueReplaceState(a,a.state,null),Ua(t,r,a,i),Ha(),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=Us(n,s);a.props=c;var l=a.context,u=n.contextType;o=$r,typeof u==`object`&&u&&(o=Yi(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)&&Hs(t,a,r,o),Pa=!1;var f=t.memoizedState;a.state=f,Ua(t,r,a,i),Ha(),l=t.memoizedState,s||f!==l||Pa?(typeof d==`function`&&(zs(t,n,d,r),l=t.memoizedState),(c=Pa||Vs(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,Ia(e,t),o=t.memoizedProps,u=Us(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=$r,typeof l==`object`&&l&&(c=Yi(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)&&Hs(t,a,r,c),Pa=!1,f=t.memoizedState,a.state=f,Ua(t,r,a,i),Ha();var p=t.memoizedState;o!==d||f!==p||Pa||e!==null&&e.dependencies!==null&&qi(e.dependencies)?(typeof s==`function`&&(zs(t,n,s,r),p=t.memoizedState),(u=Pa||Vs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&qi(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,dc(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=Ma(t,e.child,null,i),t.child=Ma(t,null,n,i)):tc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ec(e,t,i),e}function hc(e,t,n,r){return Ii(),t.flags|=256,tc(e,t,n,r),t.child}var gc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _c(e){return{baseLanes:e,cachePool:ha()}}function vc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Yl),e}function yc(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:(io.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Oi){if(a?$a(t):no(t),(e=Di)?(e=cf(e,Ai),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:vi===null?null:{id:yi,overflow:bi},retryLane:536870912,hydrationErrors:null},n=ci(e),n.return=t,t.child=n,Ei=t,Di=null)):e=null,e===null)throw Mi(t);return uf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(no(t),a=t.mode,c=xc({mode:`hidden`,children:c},a),r=oi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(null,r)):($a(t),bc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?($a(t),t.flags&=-257,t=Sc(e,t,n)):t.memoizedState===null?(no(t),c=r.fallback,a=t.mode,r=xc({mode:`visible`,children:r.children},a),c=oi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ma(t,e.child,null,n),r=t.child,r.memoizedState=_c(n),r.childLanes=vc(e,s,n),t.memoizedState=gc,t=oc(null,r)):(no(t),t.child=e.child,t.flags|=128,t=null);else if($a(t),uf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ri({value:r,source:null,stack:null}),t=Sc(e,t,n)}else if(ec||Ki(e,t,n,!1),s=(n&e.childLanes)!==0,ec||s){if(s=Il,s!==null&&(r=qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Xr(e,r),gu(s,e,r),$s;lf(c)||Ou(),t=Sc(e,t,n)}else lf(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Di=ff(c.nextSibling),Ei=t,Oi=!0,ki=null,Ai=!1,e!==null&&Ti(t,e),t=bc(t,r.children),t.flags|=4096);return t}return a?(no(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ri(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=oi(c,a,n,null),c.flags|=2):c=ri(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,oc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=_c(n):(a=c.cachePool,a===null?a=ha():(l=ta._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=vc(e,s,n),t.memoizedState=gc,oc(e.child,r)):($a(t),n=e.child,e=n.sibling,n=ri(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 bc(e,t){return t=xc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function xc(e,t){return e=ti(22,e,null,t),e.lanes=0,e}function Sc(e,t,n){return Ma(t,e.child,null,n),e=bc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Cc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Wi(e.return,t,n)}function wc(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 Tc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=io.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,H(io,o),tc(e,t,r,n),r=Oi?hi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Cc(e,n,t);else if(e.tag===19)Cc(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&&ao(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),wc(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&&ao(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}wc(t,!0,n,null,a,r);break;case`together`:wc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ec(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Kl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ki(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=ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Dc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&qi(e))):!0}function Oc(e,t,n){switch(t.tag){case 3:ie(t,t.stateNode.containerInfo),Hi(t,ta,e.memoizedState.cache),Ii();break;case 27:case 5:oe(t);break;case 4:ie(t,t.stateNode.containerInfo);break;case 10:Hi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?($a(t),e=Ec(e,t,n),e===null?null:e.sibling):yc(e,t,n):($a(t),t.flags|=128,null);$a(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ki(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Tc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),H(io,io.current),r)break;return null;case 22:return t.lanes=0,ac(e,t,n,t.pendingProps);case 24:Hi(t,ta,e.memoizedState.cache)}return Ec(e,t,n)}function kc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ec=!0;else{if(!Dc(e,n)&&!(t.flags&128))return ec=!1,Oc(e,t,n);ec=!!(e.flags&131072)}else ec=!1,Oi&&t.flags&1048576&&Si(t,hi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Sa(t.elementType),t.type=e,typeof e==`function`)ni(e)?(r=Us(e,r),t.tag=1,t=mc(null,t,e,r,n)):(t.tag=0,t=fc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=nc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=rc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return fc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Us(r,t.pendingProps),mc(e,t,r,a,n);case 3:a:{if(ie(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ia(e,t),Ua(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Hi(t,ta,r),r!==o.cache&&Gi(t,[ta],n,!0),Ha(),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=hc(e,t,r,n);break a}else if(r!==a){a=di(Error(i(424)),t),Ri(a),t=hc(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(Di=ff(e.firstChild),Ei=t,Oi=!0,ki=null,Ai=!0,n=Na(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ii(),r===a){t=Ec(e,t,n);break a}tc(e,t,r,n)}t=t.child}return t;case 26:return dc(e,t),e===null?(n=Nf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Oi||(n=t.type,e=t.pendingProps,r=Wd(U.current).createElement(n),r[$e]=t,r[et]=e,Rd(r,n,e),ft(r),t.stateNode=r):t.memoizedState=Nf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return oe(t),e===null&&Oi&&(r=t.stateNode=gf(t.type,t.pendingProps,U.current),Ei=t,Ai=!0,a=Di,tf(t.type)?(pf=a,Di=ff(r.firstChild)):Di=a),tc(e,t,t.pendingProps.children,n),dc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Oi&&((a=r=Di)&&(r=of(r,t.type,t.pendingProps,Ai),r===null?a=!1:(t.stateNode=r,Ei=t,Di=ff(r.firstChild),Ai=!1,a=!0)),a||Mi(t)),oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,qd(a,o)?r=null:s!==null&&qd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=yo(e,t,So,null,null,n),np._currentValue=a),dc(e,t),tc(e,t,r,n),t.child;case 6:return e===null&&Oi&&((e=n=Di)&&(n=sf(n,t.pendingProps,Ai),n===null?e=!1:(t.stateNode=n,Ei=t,Di=null,e=!0)),e||Mi(t)),null;case 13:return yc(e,t,n);case 4:return ie(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ma(t,null,r,n):tc(e,t,r,n),t.child;case 11:return nc(e,t,t.type,t.pendingProps,n);case 7:return tc(e,t,t.pendingProps,n),t.child;case 8:return tc(e,t,t.pendingProps.children,n),t.child;case 12:return tc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Hi(t,t.type,r.value),tc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ji(t),a=Yi(a),r=r(a),t.flags|=1,tc(e,t,r,n),t.child;case 14:return rc(e,t,t.type,t.pendingProps,n);case 15:return ic(e,t,t.type,t.pendingProps,n);case 19:return Tc(e,t,n);case 31:return uc(e,t,n);case 22:return ac(e,t,n,t.pendingProps);case 24:return Ji(t),r=Yi(ta),e===null?(a=pa(),a===null&&(a=Il,o=na(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Fa(t),Hi(t,ta,a)):((e.lanes&n)!==0&&(Ia(e,t),Ua(t,null,null,n),Ha()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Hi(t,ta,r),r!==a.cache&&Gi(t,[ta],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Hi(t,ta,r))),tc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ac(e){e.flags|=4}function jc(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 Ca=ya,_a}else e.flags&=-16777217}function Mc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Jf(t))if(Tu())e.flags|=8192;else throw Ca=ya,_a}function Nc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:W(),e.lanes|=t,Xl|=t)}function Pc(e,t){if(!Oi)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 Fc(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 Ic(e,t,n){var r=t.pendingProps;switch(wi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fc(t),null;case 1:return Fc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ui(ta),ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Fi(t)?Ac(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Li())),Fc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ac(t),o===null?(Fc(t),jc(t,a,null,r,n)):(Fc(t),Mc(t,o))):o?o===e.memoizedState?(Fc(t),t.flags&=-16777217):(Ac(t),Fc(t),Mc(t,o)):(e=e.memoizedProps,e!==r&&Ac(t),Fc(t),jc(t,a,e,r,n)),null;case 27:if(se(t),n=U.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}e=te.current,Fi(t)?Ni(t,e):(e=gf(a,r,n),t.stateNode=e,Ac(t))}return Fc(t),null;case 5:if(se(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Fc(t),null}if(o=te.current,Fi(t))Ni(t,o);else{var s=Wd(U.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[$e]=t,o[et]=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(Rd(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&&Ac(t)}}return Fc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=U.current,Fi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ei,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[$e]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Fd(e.nodeValue,n)),e||Mi(t,!0)}else e=Wd(e).createTextNode(r),e[$e]=t,t.stateNode=e}return Fc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Fi(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[$e]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),e=!1}else n=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ro(t),t):(ro(t),null);if(t.flags&128)throw Error(i(558))}return Fc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Fi(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[$e]=t}else Ii(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Fc(t),a=!1}else a=Li(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ro(t),t):(ro(t),null)}return ro(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),Nc(t,t.updateQueue),Fc(t),null);case 4:return ae(),e===null&&Td(t.stateNode.containerInfo),Fc(t),null;case 10:return Ui(t.type),Fc(t),null;case 19:if(V(io),r=t.memoizedState,r===null)return Fc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Pc(r,!1);else{if(Gl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ao(e),o!==null){for(t.flags|=128,Pc(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ii(n,e),n=n.sibling;return H(io,io.current&1|2),Oi&&xi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&be()>nu&&(t.flags|=128,a=!0,Pc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ao(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),Pc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Oi)return Fc(t),null}else 2*be()-r.renderingStartTime>nu&&n!==536870912&&(t.flags|=128,a=!0,Pc(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?(Fc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=be(),e.sibling=null,n=io.current,H(io,a?n&1|2:n&1),Oi&&xi(t,r.treeForkCount),e);case 22:case 23:return ro(t),Xa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Fc(t),t.subtreeFlags&6&&(t.flags|=8192)):Fc(t),n=t.updateQueue,n!==null&&Nc(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&&V(fa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ui(ta),Fc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Lc(e,t){switch(wi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ui(ta),ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return se(t),null;case 31:if(t.memoizedState!==null){if(ro(t),t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ro(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ii()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return V(io),null;case 4:return ae(),null;case 10:return Ui(t.type),null;case 22:case 23:return ro(t),Xa(),e!==null&&V(fa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ui(ta),null;case 25:return null;default:return null}}function Rc(e,t){switch(wi(t),t.tag){case 3:Ui(ta),ae();break;case 26:case 27:case 5:se(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&ro(t);break;case 13:ro(t);break;case 19:V(io);break;case 10:Ui(t.type);break;case 22:case 23:ro(t),Xa(),e!==null&&V(fa);break;case 24:Ui(ta)}}function zc(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 Bc(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 Vc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ga(t,n)}catch(t){Ku(e,e.return,t)}}}function Hc(e,t,n){n.props=Us(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ku(e,t,n)}}function Uc(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 Wc(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 Gc(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 Kc(e,t,n){try{var r=e.stateNode;zd(r,e.type,n,t),r[et]=t}catch(t){Ku(e,e.return,t)}}function qc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&tf(e.type)||e.tag===4}function Jc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||qc(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&&tf(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 Yc(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=Kt));else if(r!==4&&(r===27&&tf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(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&&tf(e.type)&&(n=e.stateNode),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){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Rd(t,r,n),t[$e]=e,t[et]=n}catch(t){Ku(e,e.return,t)}}var Qc=!1,$c=!1,el=!1,tl=typeof WeakSet==`function`?WeakSet:Set,nl=null;function rl(e,t){if(e=e.containerInfo,Hd=dp,e=br(e),xr(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(Ud={focusedElem:e,selectionRange:n},dp=!1,nl=t;nl!==null;)if(t=nl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,nl=e;else for(;nl!==null;){switch(t=nl,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=Us(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)af(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:af(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,nl=e;break}nl=t.return}}function il(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&zc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ku(n,n.return,e)}else{var i=Us(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ku(n,n.return,e)}}r&64&&Vc(n),r&512&&Uc(n,n.return);break;case 3:if(vl(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{Ga(e,t)}catch(e){Ku(n,n.return,e)}}break;case 27:t===null&&r&4&&Zc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Gc(n),r&512&&Uc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Xu.bind(null,n),df(e,n))));break;case 22:if(r=n.memoizedState!==null||Qc,!r){t=t!==null&&t.memoizedState!==null||$c,i=Qc;var a=$c;Qc=r,($c=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Qc=i,$c=a}break;case 30:break;default:vl(e,n)}}function al(e){var t=e.alternate;t!==null&&(e.alternate=null,al(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&st(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 ol=null,sl=!1;function q(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount==`function`)try{Ae.onCommitFiberUnmount(ke,n)}catch{}switch(n.tag){case 26:$c||Wc(n,t),q(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:$c||Wc(n,t);var r=ol,i=sl;tf(n.type)&&(ol=n.stateNode,sl=!1),q(e,t,n),_f(n.stateNode),ol=r,sl=i;break;case 5:$c||Wc(n,t);case 6:if(r=ol,i=sl,ol=null,q(e,t,n),ol=r,sl=i,ol!==null)if(sl)try{(ol.nodeType===9?ol.body:ol.nodeName===`HTML`?ol.ownerDocument.body:ol).removeChild(n.stateNode)}catch(e){Ku(n,t,e)}else try{ol.removeChild(n.stateNode)}catch(e){Ku(n,t,e)}break;case 18:ol!==null&&(sl?(e=ol,nf(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Lp(e)):nf(ol,n.stateNode));break;case 4:r=ol,i=sl,ol=n.stateNode.containerInfo,sl=!0,q(e,t,n),ol=r,sl=i;break;case 0:case 11:case 14:case 15:Bc(2,n,t),$c||Bc(4,n,t),q(e,t,n);break;case 1:$c||(Wc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Hc(n,t,r)),q(e,t,n);break;case 21:q(e,t,n);break;case 22:$c=(r=$c)||n.memoizedState!==null,q(e,t,n),$c=r;break;default:q(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Lp(e)}catch(e){Ku(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Lp(e)}catch(e){Ku(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new tl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new tl),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Zu.bind(null,e,t);t.then(r,r)}})}function pl(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(tf(c.type)){ol=c.stateNode,sl=!1;break a}break;case 5:ol=c.stateNode,sl=!1;break a;case 3:case 4:ol=c.stateNode.containerInfo,sl=!0;break a}c=c.return}if(ol===null)throw Error(i(160));cl(o,s,a),ol=null,sl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(Bc(3,e,e.return),zc(3,e),Bc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),r&64&&Qc&&(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=ml;if(pl(t,e),gl(e),r&512&&($c||n===null||Wc(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[ot]||o[$e]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Rd(o,r,n),o[$e]=e,ft(o),r=o;break a;case`link`:var s=Gf(`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),Rd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Gf(`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),Rd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[$e]=e,ft(o),r=o}e.stateNode=r}else Kf(a,e.type,e.stateNode);else e.stateNode=Bf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Kc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Kf(a,e.type,e.stateNode):Bf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),n!==null&&r&4&&Kc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&($c||n===null||Wc(n,n.return)),e.flags&32){a=e.stateNode;try{Rt(a,``)}catch(t){Ku(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Kc(e,a,n===null?a:n.memoizedProps)),r&1024&&(el=!0);break;case 6:if(pl(t,e),gl(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(Wf=null,a=ml,ml=bf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Lp(t.containerInfo)}catch(t){Ku(e,e.return,t)}el&&(el=!1,_l(e));break;case 4:r=ml,ml=bf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eu=be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Qc,d=$c;if(Qc=u||a,$c=d||l,pl(t,e),$c=d,Qc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Qc||$c||yl(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?rf(m,!0):rf(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,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(qc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Xc(e,Jc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Rt(o,``),n.flags&=-33),Xc(e,Jc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Yc(e,Jc(e),s);break;default:throw Error(i(161))}}catch(t){Ku(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)il(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Bc(4,t,t.return),yl(t);break;case 1:Wc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Hc(t,t.return,n),yl(t);break;case 27:_f(t.stateNode);case 26:case 5:Wc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(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:bl(i,a,n),zc(4,a);break;case 1:if(bl(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++)Wa(c[i],s)}catch(e){Ku(r,r.return,e)}}n&&o&64&&Vc(a),Uc(a,a.return);break;case 27:Zc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Gc(a),Uc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Uc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(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&&ra(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ra(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&zc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(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&&ra(e)));break;case 12:if(i&2048){Cl(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 Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(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:Tl(a,o,s,c,i),zc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(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:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Yf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=bf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(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 jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];nl=r,J(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&Bc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}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];nl=r,J(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Bc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function J(e,t){for(;nl!==null;){var n=nl;switch(n.tag){case 0:case 11:case 15:Bc(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:ra(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,nl=r;else a:for(n=e;nl!==null;){r=nl;var i=r.sibling,a=r.return;if(al(r),r===n){nl=null;break a}if(i!==null){i.return=a,nl=i;break a}nl=a}}}var Pl={getCacheForType:function(e){var t=Yi(ta),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Yi(ta).controller.signal}},Y=typeof WeakMap==`function`?WeakMap:Map,Fl=0,Il=null,Ll=null,Rl=0,zl=0,Bl=null,Vl=!1,Hl=!1,Ul=!1,Wl=0,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=null,Ql=null,$l=!1,eu=0,tu=0,nu=1/0,ru=null,iu=null,au=0,ou=null,su=null,cu=0,lu=0,uu=null,du=null,fu=0,pu=null;function mu(){return Fl&2&&Rl!==0?Rl&-Rl:I.T===null?Xe():pd()}function hu(){if(Yl===0)if(!(Rl&536870912)||Oi){var e=Le;Le<<=1,!(Le&3932160)&&(Le=262144),Yl=e}else Yl=536870912;return e=Za.current,e!==null&&(e.flags|=32),Yl}function gu(e,t,n){(e===Il&&(zl===2||zl===9)||e.cancelPendingCommit!==null)&&(Cu(e,0),bu(e,Rl,Yl,!1)),Ue(e,n),(!(Fl&2)||e!==Il)&&(e===Il&&(!(Fl&2)&&(ql|=n),Gl===4&&bu(e,Rl,Yl,!1)),ad(e))}function _u(e,t,n){if(Fl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Ve(e,t),a=r?ju(e,t):ku(e,t,!0),o=r;do{if(a===0){Hl&&!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=Zl;var l=c.current.memoizedState.isDehydrated;if(l&&(Cu(c,s).flags|=256),s=ku(c,s,!1),s!==2){if(Ul&&!l){c.errorRecoveryDisabledLanes|=o,ql|=o,a=4;break a}o=Ql,Ql=a,o!==null&&(Ql===null?Ql=o:Ql.push.apply(Ql,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,Yl,!Vl);break a;case 2:Ql=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=eu+300-be(),10<a)){if(bu(r,t,Yl,!Vl),Be(r,0,!0)!==0)break a;cu=t,r.timeoutHandle=Xd(vu.bind(null,r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,o,`Throttled`,-0,0),a);break a}vu(r,n,Ql,ru,$l,t,Yl,ql,Xl,Vl,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:Kt},kl(t,a,d);var m=(a&62914560)===a?eu-be():(a&4194048)===a?tu-be():0;if(m=Zf(d,m),m!==null){cu=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(!hr(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&=~Jl,t&=~ql,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Me(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ge(e,n,t)}function xu(){return Fl&6?!0:(od(0,!1),!1)}function Su(){if(Ll!==null){if(zl===0)var e=Ll.return;else e=Ll,Vi=Bi=null,To(e),Ea=null,Da=0,e=Ll;for(;e!==null;)Rc(e.alternate,e),e=e.return;Ll=null}}function Cu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Zd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),cu=0,Su(),Il=e,Ll=n=ri(e.current,null),Rl=t,zl=0,Bl=null,Vl=!1,Hl=Ve(e,t),Ul=!1,Xl=Yl=Jl=ql=Kl=Gl=0,Ql=Zl=null,$l=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Me(r),a=1<<i;t|=e[i],r&=~a}return Wl=t,qr(),n}function wu(e,t){oo=null,I.H=Fs,t===ga||t===va?(t=wa(),zl=3):t===_a?(t=wa(),zl=4):zl=t===$s?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Bl=t,Ll===null&&(Gl=1,qs(e,di(t,e.current)))}function Tu(){var e=Za.current;return e===null?!0:(Rl&4194048)===Rl?Qa===null:(Rl&62914560)===Rl||Rl&536870912?e===Qa:!1}function Eu(){var e=I.H;return I.H=Fs,e===null?Fs:e}function Du(){var e=I.A;return I.A=Pl,e}function Ou(){Gl=4,Vl||(Rl&4194048)!==Rl&&Za.current!==null||(Hl=!0),!(Kl&134217727)&&!(ql&134217727)||Il===null||bu(Il,Rl,Yl,!1)}function ku(e,t,n){var r=Fl;Fl|=2;var i=Eu(),a=Du();(Il!==e||Rl!==t)&&(ru=null,Cu(e,t)),t=!1;var o=Gl;a:do try{if(zl!==0&&Ll!==null){var s=Ll,c=Bl;switch(zl){case 8:Su(),o=6;break a;case 3:case 2:case 9:case 6:Za.current===null&&(t=!0);var l=zl;if(zl=0,Bl=null,Fu(e,s,c,l),n&&Hl){o=0;break a}break;default:l=zl,zl=0,Bl=null,Fu(e,s,c,l)}}Au(),o=Gl;break}catch(t){wu(e,t)}while(1);return t&&e.shellSuspendCounter++,Vi=Bi=null,Fl=r,I.H=i,I.A=a,Ll===null&&(Il=null,Rl=0,qr()),o}function Au(){for(;Ll!==null;)Nu(Ll)}function ju(e,t){var n=Fl;Fl|=2;var r=Eu(),a=Du();Il!==e||Rl!==t?(ru=null,nu=be()+500,Cu(e,t)):Hl=Ve(e,t);a:do try{if(zl!==0&&Ll!==null){t=Ll;var o=Bl;b:switch(zl){case 1:zl=0,Bl=null,Fu(e,t,o,1);break;case 2:case 9:if(ba(o)){zl=0,Bl=null,Pu(t);break}t=function(){zl!==2&&zl!==9||Il!==e||(zl=7),ad(e)},o.then(t,t);break a;case 3:zl=7;break a;case 4:zl=5;break a;case 7:ba(o)?(zl=0,Bl=null,Pu(t)):(zl=0,Bl=null,Fu(e,t,o,7));break;case 5:var s=null;switch(Ll.tag){case 26:s=Ll.memoizedState;case 5:case 27:var c=Ll;if(s?Jf(s):c.stateNode.complete){zl=0,Bl=null;var l=c.sibling;if(l!==null)Ll=l;else{var u=c.return;u===null?Ll=null:(Ll=u,Iu(u))}break b}}zl=0,Bl=null,Fu(e,t,o,5);break;case 6:zl=0,Bl=null,Fu(e,t,o,6);break;case 8:Su(),Gl=6;break a;default:throw Error(i(462))}}Mu();break}catch(t){wu(e,t)}while(1);return Vi=Bi=null,I.H=r,I.A=a,Fl=n,Ll===null?(Il=null,Rl=0,qr(),Gl):0}function Mu(){for(;Ll!==null&&!ve();)Nu(Ll)}function Nu(e){var t=kc(e.alternate,e,Wl);e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Pu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=pc(n,t,t.pendingProps,t.type,void 0,Rl);break;case 11:t=pc(n,t,t.pendingProps,t.type.render,t.ref,Rl);break;case 5:To(t);default:Rc(n,t),t=Ll=ii(t,Wl),t=kc(n,t,Wl)}e.memoizedProps=e.pendingProps,t===null?Iu(e):Ll=t}function Fu(e,t,n,r){Vi=Bi=null,To(t),Ea=null,Da=0;var i=t.return;try{if(Qs(e,i,t,n,Rl)){Gl=1,qs(e,di(n,e.current)),Ll=null;return}}catch(t){if(i!==null)throw Ll=i,t;Gl=1,qs(e,di(n,e.current)),Ll=null;return}t.flags&32768?(Oi||r===1?e=!0:Hl||Rl&536870912?e=!1:(Vl=e=!0,(r===2||r===9||r===3||r===6)&&(r=Za.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,Vl);return}e=t.return;var n=Ic(t.alternate,t,Wl);if(n!==null){Ll=n;return}if(t=t.sibling,t!==null){Ll=t;return}Ll=t=e}while(t!==null);Gl===0&&(Gl=5)}function Lu(e,t){do{var n=Lc(e.alternate,e);if(n!==null){n.flags&=32767,Ll=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Ll=e;return}Ll=e=n}while(e!==null);Gl=6,Ll=null}function Ru(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(au!==0);if(Fl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Kr,We(e,n,o,s,c,l),e===Il&&(Ll=Il=null,Rl=0),su=t,ou=e,cu=n,lu=o,uu=a,du=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Qu(we,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=Fl,Fl|=4;try{rl(e,t,n)}finally{Fl=s,L.p=a,I.T=r}}au=1,zu(),Bu(),Vu()}}function zu(){if(au===1){au=0;var e=ou,t=su,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Fl;Fl|=4;try{hl(t,e);var a=Ud,o=br(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&yr(s.ownerDocument.documentElement,s)){if(c!==null&&xr(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 _=vr(s,h),v=vr(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}}dp=!!Hd,Ud=Hd=null}finally{Fl=i,L.p=r,I.T=n}}e.current=t,au=2}}function Bu(){if(au===2){au=0;var e=ou,t=su,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=Fl;Fl|=4;try{il(e,t.alternate,t)}finally{Fl=i,L.p=r,I.T=n}}au=3}}function Vu(){if(au===4||au===3){au=0,ye();var e=ou,t=su,n=cu,r=du;t.subtreeFlags&10256||t.flags&10256?au=5:(au=0,su=ou=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(iu=null),Ye(n),t=t.stateNode,Ae&&typeof Ae.onCommitFiberRoot==`function`)try{Ae.onCommitFiberRoot(ke,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.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{I.T=t,L.p=i}}cu&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,ra(t)))}function Uu(){return zu(),Bu(),Vu(),Wu()}function Wu(){if(au!==5)return!1;var e=ou,t=lu;lu=0;var n=Ye(cu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=uu,uu=null;var o=ou,s=cu;if(au=0,su=ou=null,cu=0,Fl&6)throw Error(i(331));var c=Fl;if(Fl|=4,Ml(o.current),wl(o,o.current,s,n),Fl=c,od(0,!1),Ae&&typeof Ae.onPostCommitFiberRoot==`function`)try{Ae.onPostCommitFiberRoot(ke,o)}catch{}return!0}finally{L.p=a,I.T=r,Hu(e,t)}}function Gu(e,t,n){t=di(n,t),t=Ys(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(Ue(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`&&(iu===null||!iu.has(r))){e=di(n,e),n=Xs(2),r=Ra(t,n,2),r!==null&&(Zs(n,r,t,e),Ue(r,2),ad(r));break}}t=t.return}}function qu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Y;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)||(Ul=!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,Il===e&&(Rl&n)===n&&(Gl===4||Gl===3&&(Rl&62914560)===Rl&&300>be()-eu?!(Fl&2)&&Cu(e,0):Jl|=n,Xl===Rl&&(Xl=0)),ad(e)}function Yu(e,t){t===0&&(t=W()),e=Xr(e,t),e!==null&&(Ue(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 ge(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-Me(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=Rl,a=Be(r,r===Il?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Ve(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&&Yd()&&(e=id);for(var t=be(),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}au!==0&&au!==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-Me(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=He(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Il,n=Rl,n=Be(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(zl===2||zl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_e(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Ve(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&_e(r),Ye(n)){case 2:case 8:n=Ce;break;case 32:n=we;break;case 268435456:n=Ee;break;default:n=we}return r=ud.bind(null,e),n=ge(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&_e(r),e.callbackPriority=2,e.callbackNode=null,2}function ud(e,t){if(au!==0&&au!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=Rl;return r=Be(e,e===Il?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(_u(e,r,t),ld(e,be()),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(){$d(function(){Fl&6?ge(Se,sd):cd()})}function pd(){if(id===0){var e=oa;e===0&&(e=Ie,Ie<<=1,!(Ie&261888)&&(Ie=256)),id=e}return id}function md(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Gt(``+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[et]||null).action),o=r.submitter;o&&(t=(t=o[et]||null)?md(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new mn(`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);xs(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),xs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var _d=0;_d<Vr.length;_d++){var vd=Vr[_d];Hr(vd.toLowerCase(),`on`+(vd[0].toUpperCase()+vd.slice(1)))}Hr(Nr,`onAnimationEnd`),Hr(Pr,`onAnimationIteration`),Hr(Fr,`onAnimationStart`),Hr(`dblclick`,`onDoubleClick`),Hr(`focusin`,`onFocus`),Hr(`focusout`,`onBlur`),Hr(Ir,`onTransitionRun`),Hr(Lr,`onTransitionStart`),Hr(Rr,`onTransitionCancel`),Hr(zr,`onTransitionEnd`),gt(`onMouseEnter`,[`mouseout`,`mouseover`]),gt(`onMouseLeave`,[`mouseout`,`mouseover`]),gt(`onPointerEnter`,[`pointerout`,`pointerover`]),gt(`onPointerLeave`,[`pointerout`,`pointerover`]),ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),ht(`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){Ur(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){Ur(e)}i.currentTarget=null,a=c}}}}function Sd(e,t){var n=t[nt];n===void 0&&(n=t[nt]=new Set);var r=e+`__bubble`;n.has(r)||(Ed(t,e,2,!1),n.add(r))}function Cd(e,t,n){var r=0;t&&(r|=4),Ed(n,e,r,t)}var wd=`_reactListening`+Math.random().toString(36).slice(2);function Td(e){if(!e[wd]){e[wd]=!0,pt.forEach(function(t){t!==`selectionchange`&&(bd.has(t)||Cd(t,!1,e),Cd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[wd]||(t[wd]=!0,Cd(`selectionchange`,!1,t))}}function Ed(e,t,n,r){switch(vp(t)){case 2:var i=fp;break;case 8:i=pp;break;default:i=mp}n=i.bind(null,t,n,e),i=void 0,!nn||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 Dd(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=ct(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}$t(function(){var r=a,i=Jt(n),s=[];a:{var c=Br.get(e);if(c!==void 0){var l=mn,u=e;switch(e){case`keypress`:if(ln(n)===0)break a;case`keydown`:case`keyup`:l=Mn;break;case`focusin`:u=`focus`,l=Cn;break;case`focusout`:u=`blur`,l=Cn;break;case`beforeblur`:case`afterblur`:l=Cn;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=xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Sn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Pn;break;case Nr:case Pr:case Fr:l=wn;break;case zr:l=Fn;break;case`scroll`:case`scrollend`:l=gn;break;case`wheel`:l=In;break;case`copy`:case`cut`:case`paste`:l=Tn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Nn;break;case`toggle`:case`beforetoggle`:l=Ln}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=en(m,p),g!=null&&d.push(Od(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!==qt&&(u=n.relatedTarget||n.fromElement)&&(ct(u)||u[tt]))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?ct(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=xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Nn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ut(l),h=u==null?c:ut(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ct(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=Ad,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&&jd(s,c,l,d,!1),u!==null&&f!==null&&jd(s,f,u,d,!0)}}a:{if(c=r?ut(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=rr;else if(Zn(c))if(ir)v=pr;else{v=dr;var y=ur}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Ht(r.elementType)&&(v=rr):v=fr;if(v&&=v(e,r)){Qn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Pt(c,`number`,c.value)}switch(y=r?ut(r):window,e){case`focusin`:(Zn(y)||y.contentEditable===`true`)&&(Cr=y,wr=r,Tr=null);break;case`focusout`:Tr=wr=Cr=null;break;case`mousedown`:Er=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Er=!1,Dr(s,n,i);break;case`selectionchange`:if(Sr)break;case`keydown`:case`keyup`:Dr(s,n,i)}var b;if(zn)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 qn?Gn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Hn&&n.locale!==`ko`&&(qn||x!==`onCompositionStart`?x===`onCompositionEnd`&&qn&&(b=cn()):(an=i,on=`value`in an?an.value:an.textContent,qn=!0)),y=kd(r,x),0<y.length&&(x=new En(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Kn(n),b!==null&&(x.data=b)))),(b=Vn?Jn(e,n):Yn(e,n))&&(x=kd(r,`onBeforeInput`),0<x.length&&(y=new En(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),gd(s,e,r,n,i)}xd(s,t)})}function Od(e,t,n){return{instance:e,listener:t,currentTarget:n}}function kd(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=en(e,n),i!=null&&r.unshift(Od(e,i,a)),i=en(e,t),i!=null&&r.push(Od(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ad(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function jd(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=en(n,a),l!=null&&o.unshift(Od(n,l,c))):i||(l=en(n,a),l!=null&&o.push(Od(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Md=/\r\n?/g,Nd=/\u0000|\uFFFD/g;function Pd(e){return(typeof e==`string`?e:``+e).replace(Md,`
|
|
9
9
|
`).replace(Nd,``)}function Fd(e,t){return t=Pd(t),Pd(e)===t}function Id(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Rt(e,``+r);break;case`className`:St(e,`class`,r);break;case`tabIndex`:St(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:St(e,n,r);break;case`style`:Vt(e,r,o);break;case`data`:if(t!==`object`){St(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=Gt(``+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`&&Id(e,t,`name`,a.name,a,null),Id(e,t,`formEncType`,a.formEncType,a,null),Id(e,t,`formMethod`,a.formMethod,a,null),Id(e,t,`formTarget`,a.formTarget,a,null)):(Id(e,t,`encType`,a.encType,a,null),Id(e,t,`method`,a.method,a,null),Id(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Gt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`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=Gt(``+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`:Sd(`beforetoggle`,e),Sd(`toggle`,e),xt(e,`popover`,r);break;case`xlinkActuate`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Ct(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Ct(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:xt(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=Ut.get(n)||n,xt(e,n,r))}}function Ld(e,t,n,r,a,o){switch(n){case`style`:Vt(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`?Rt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Rt(e,``+r);break;case`onScroll`:r!=null&&Sd(`scroll`,e);break;case`onScrollEnd`:r!=null&&Sd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Kt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!mt.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[et]||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,``):xt(e,n,r)}}}function Rd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Sd(`error`,e),Sd(`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:Id(e,t,o,s,n,null)}}a&&Id(e,t,`srcSet`,n.srcSet,n,null),r&&Id(e,t,`src`,n.src,n,null);return;case`input`:Sd(`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:Id(e,t,r,d,n,null)}}Nt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Sd(`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:Id(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Ft(e,!!r,n,!0):Ft(e,!!r,t,!1);return;case`textarea`:for(s in Sd(`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:Id(e,t,s,c,n,null)}Lt(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:Id(e,t,l,r,n,null)}return;case`dialog`:Sd(`beforetoggle`,e),Sd(`toggle`,e),Sd(`cancel`,e),Sd(`close`,e);break;case`iframe`:case`object`:Sd(`load`,e);break;case`video`:case`audio`:for(r=0;r<yd.length;r++)Sd(yd[r],e);break;case`image`:Sd(`error`,e),Sd(`load`,e);break;case`details`:Sd(`toggle`,e);break;case`embed`:case`source`:case`link`:Sd(`error`,e),Sd(`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:Id(e,t,u,r,n,null)}return;default:if(Ht(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Ld(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Id(e,t,c,r,n,null))}function zd(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)||Id(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&&Id(e,t,p,m,r,f)}}Mt(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)||Id(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&&Id(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Ft(e,!!n,n?[]:``,!1):Ft(e,!!n,t,!0)):Ft(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:Id(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&&Id(e,t,s,a,r,o)}It(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:Id(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:Id(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)&&Id(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:Id(e,t,u,p,r,m)}return;default:if(Ht(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Ld(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||Ld(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Id(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||Id(e,t,f,p,r,m)}function Bd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Vd(){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&&Bd(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&&Bd(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 Hd=null,Ud=null;function Wd(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Kd(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 qd(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 Jd=null;function Yd(){var e=window.event;return e&&e.type===`popstate`?e===Jd?!1:(Jd=e,!0):(Jd=null,!1)}var Xd=typeof setTimeout==`function`?setTimeout:void 0,Zd=typeof clearTimeout==`function`?clearTimeout:void 0,Qd=typeof Promise==`function`?Promise:void 0,$d=typeof queueMicrotask==`function`?queueMicrotask:Qd===void 0?Xd:function(e){return Qd.resolve(null).then(e).catch(ef)};function ef(e){setTimeout(function(){throw e})}function tf(e){return e===`head`}function nf(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),Lp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_f(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_f(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[ot]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_f(e.ownerDocument.body);n=i}while(n);Lp(t)}function rf(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 af(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`:af(n),st(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function of(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[ot])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=ff(e.nextSibling),e===null)break}return null}function sf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ff(e.nextSibling),e===null))return null;return e}function cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ff(e.nextSibling),e===null))return null;return e}function lf(e){return e.data===`$?`||e.data===`$~`}function uf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function df(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 ff(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 pf=null;function mf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ff(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function hf(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 gf(e,t,n){switch(t=Wd(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 _f(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);st(e)}var vf=new Map,yf=new Set;function bf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var xf=L.d;L.d={f:Sf,r:Cf,D:Ef,C:Df,L:Of,m:kf,X:jf,S:Af,M:Mf};function Sf(){var e=xf.f(),t=xu();return e||t}function Cf(e){var t=lt(e);t!==null&&t.tag===5&&t.type===`form`?Cs(t):xf.r(e)}var wf=typeof document>`u`?null:document;function Tf(e,t,n){var r=wf;if(r&&typeof t==`string`&&t){var i=jt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),yf.has(i)||(yf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Rd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function Ef(e){xf.D(e),Tf(`dns-prefetch`,e,null)}function Df(e,t){xf.C(e,t),Tf(`preconnect`,e,t)}function Of(e,t,n){xf.L(e,t,n);var r=wf;if(r&&e&&t){var i=`link[rel="preload"][as="`+jt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+jt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+jt(n.imageSizes)+`"]`)):i+=`[href="`+jt(e)+`"]`;var a=i;switch(t){case`style`:a=Pf(e);break;case`script`:a=Rf(e)}vf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Ff(a))||t===`script`&&r.querySelector(zf(a))||(t=r.createElement(`link`),Rd(t,`link`,e),ft(t),r.head.appendChild(t)))}}function kf(e,t){xf.m(e,t);var n=wf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+jt(r)+`"][href="`+jt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rf(e)}if(!vf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),vf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zf(a)))return}r=n.createElement(`link`),Rd(r,`link`,e),ft(r),n.head.appendChild(r)}}}function Af(e,t,n){xf.S(e,t,n);var r=wf;if(r&&e){var i=dt(r).hoistableStyles,a=Pf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Ff(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vf.get(a))&&Hf(e,n);var c=o=r.createElement(`link`);ft(c),Rd(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,Vf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jf(e,t){xf.X(e,t);var n=wf;if(n&&e){var r=dt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),ft(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mf(e,t){xf.M(e,t);var n=wf;if(n&&e){var r=dt(n).hoistableScripts,i=Rf(e),a=r.get(i);a||(a=n.querySelector(zf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=vf.get(i))&&Uf(e,t),a=n.createElement(`script`),ft(a),Rd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nf(e,t,n,r){var a=(a=U.current)?bf(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=Pf(n.href),n=dt(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=Pf(n.href);var o=dt(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(Ff(e)))&&!o._p&&(s.instance=o,s.state.loading=5),vf.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},vf.set(e,n),o||Lf(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=Rf(n),n=dt(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 Pf(e){return`href="`+jt(e)+`"`}function Ff(e){return`link[rel="stylesheet"][`+e+`]`}function If(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function Lf(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}),Rd(t,`link`,n),ft(t),e.head.appendChild(t))}function Rf(e){return`[src="`+jt(e)+`"]`}function zf(e){return`script[async]`+e}function Bf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+jt(n.href)+`"]`);if(r)return t.instance=r,ft(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`),ft(r),Rd(r,`style`,a),Vf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pf(n.href);var o=e.querySelector(Ff(a));if(o)return t.state.loading|=4,t.instance=o,ft(o),o;r=If(n),(a=vf.get(a))&&Hf(r,a),o=(e.ownerDocument||e).createElement(`link`),ft(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Rd(o,`link`,r),t.state.loading|=4,Vf(o,n.precedence,e),t.instance=o;case`script`:return o=Rf(n.src),(a=e.querySelector(zf(o)))?(t.instance=a,ft(a),a):(r=n,(a=vf.get(o))&&(r=m({},n),Uf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ft(a),Rd(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,Vf(r,n.precedence,e));return t.instance}function Vf(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 Hf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Uf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wf=null;function Gf(e,t,n){if(Wf===null){var r=new Map,i=Wf=new Map;i.set(n,r)}else i=Wf,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[ot]||a[$e]||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 Kf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qf(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 Jf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Yf(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=Pf(r.href),a=t.querySelector(Ff(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Qf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ft(a);return}a=t.ownerDocument||t,r=If(r),(i=vf.get(i))&&Hf(r,i),a=a.createElement(`link`),ft(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Rd(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=Qf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Xf=0;function Zf(e,t){return e.stylesheets&&e.count===0&&ep(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Xf===0&&(Xf=62500*Vd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ep(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Xf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Qf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ep(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var $f=null;function ep(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,$f=new Map,t.forEach(tp,e),$f=null,Qf.call(e))}function tp(e,t){if(!(t.state.loading&4)){var n=$f.get(e);if(n)var r=n.get(null);else{n=new Map,$f.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=Qf.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 np={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function rp(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=G(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G(0),this.hiddenUpdates=G(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 ip(e,t,n,r,i,a,o,s,c,l,u,d){return e=new rp(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ti(3,null,null,t),e.current=a,a.stateNode=e,t=na(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Fa(a),e}function ap(e){return e?(e=$r,e):$r}function op(e,t,n,r,i,a){i=ap(i),r.context===null?r.context=i:r.pendingContext=i,r=La(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ra(e,r,t),n!==null&&(gu(n,e,t),za(n,e,t))}function sp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function cp(e,t){sp(e,t),(e=e.alternate)&&sp(e,t)}function lp(e){if(e.tag===13||e.tag===31){var t=Xr(e,67108864);t!==null&&gu(t,e,67108864),cp(e,67108864)}}function up(e){if(e.tag===13||e.tag===31){var t=mu();t=Je(t);var n=Xr(e,t);n!==null&&gu(n,e,t),cp(e,t)}}var dp=!0;function fp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,mp(e,t,n,r)}finally{L.p=a,I.T=i}}function pp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,mp(e,t,n,r)}finally{L.p=a,I.T=i}}function mp(e,t,n,r){if(dp){var i=hp(r);if(i===null)Dd(e,t,r,gp,n),Dp(e,r);else if(kp(i,e,t,n,r))r.stopPropagation();else if(Dp(e,r),t&4&&-1<Ep.indexOf(e)){for(;i!==null;){var a=lt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ze(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Me(o);s.entanglements[1]|=c,o&=~c}ad(a),!(Fl&6)&&(nu=be()+500,od(0,!1))}}break;case 31:case 13:s=Xr(a,2),s!==null&&gu(s,a,2),xu(),cp(a,2)}if(a=hp(r),a===null&&Dd(e,t,r,gp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Dd(e,t,r,null,n)}}function hp(e){return e=Jt(e),_p(e)}var gp=null;function _p(e){if(gp=null,e=ct(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 gp=e,null}function vp(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(xe()){case Se:return 2;case Ce:return 8;case we:case Te:return 32;case Ee:return 268435456;default:return 32}default:return 32}}var yp=!1,bp=null,xp=null,Sp=null,Cp=new Map,wp=new Map,Tp=[],Ep=`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 Dp(e,t){switch(e){case`focusin`:case`focusout`:bp=null;break;case`dragenter`:case`dragleave`:xp=null;break;case`mouseover`:case`mouseout`:Sp=null;break;case`pointerover`:case`pointerout`:Cp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:wp.delete(t.pointerId)}}function Op(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=lt(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function kp(e,t,n,r,i){switch(t){case`focusin`:return bp=Op(bp,e,t,n,r,i),!0;case`dragenter`:return xp=Op(xp,e,t,n,r,i),!0;case`mouseover`:return Sp=Op(Sp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Cp.set(a,Op(Cp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,wp.set(a,Op(wp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ap(e){var t=ct(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,Ze(e.priority,function(){up(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ze(e.priority,function(){up(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 jp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);qt=r,n.target.dispatchEvent(r),qt=null}else return t=lt(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function Mp(e,t,n){jp(e)&&n.delete(t)}function Np(){yp=!1,bp!==null&&jp(bp)&&(bp=null),xp!==null&&jp(xp)&&(xp=null),Sp!==null&&jp(Sp)&&(Sp=null),Cp.forEach(Mp),wp.forEach(Mp)}function Pp(e,n){e.blockedOn===n&&(e.blockedOn=null,yp||(yp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Np)))}var Fp=null;function Ip(e){Fp!==e&&(Fp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fp===e&&(Fp=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(_p(r||n)===null)continue;break}var a=lt(n);a!==null&&(e.splice(t,3),t-=3,xs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Lp(e){function t(t){return Pp(t,e)}bp!==null&&Pp(bp,e),xp!==null&&Pp(xp,e),Sp!==null&&Pp(Sp,e),Cp.forEach(t),wp.forEach(t);for(var n=0;n<Tp.length;n++){var r=Tp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Tp.length&&(n=Tp[0],n.blockedOn===null);)Ap(n),n.blockedOn===null&&Tp.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[et]||null;if(typeof a==`function`)o||Ip(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[et]||null)s=o.formAction;else if(_p(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Ip(n)}}}function Rp(){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 zp(e){this._internalRoot=e}Bp.prototype.render=zp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;op(n,mu(),e,t,null,null)},Bp.prototype.unmount=zp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;op(e.current,2,null,e,null,null),xu(),t[tt]=null}};function Bp(e){this._internalRoot=e}Bp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xe();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Tp.length&&t!==0&&t<Tp[n].priority;n++);Tp.splice(n,0,e),n===0&&Ap(e)}};var Vp=n.version;if(Vp!==`19.2.6`)throw Error(i(527,Vp,`19.2.6`));L.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 Hp={bundleType:0,version:`19.2.6`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.6`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Up=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Up.isDisabled&&Up.supportsFiber)try{ke=Up.inject(Hp),Ae=Up}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Ws,s=Gs,c=Ks;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=ip(e,1,!1,null,null,n,r,null,o,s,c,Rp),e[tt]=t.current,Td(e),new zp(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=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(){}},y=new class extends v{#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`}},b={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},x=new class{#e=b;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 S(e){setTimeout(e,0)}var C=typeof window>`u`||`Deno`in globalThis;function w(){}function T(e,t){return typeof e==`function`?e(t):e}function E(e){return typeof e==`number`&&e>=0&&e!==1/0}function D(e,t){return Math.max(e+(t||0)-Date.now(),0)}function O(e,t){return typeof e==`function`?e(t):e}function k(e,t){return typeof e==`function`?e(t):e}function A(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==M(o,t.options))return!1}else if(!P(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 j(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(N(t.options.mutationKey)!==N(a))return!1}else if(!P(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function M(e,t){return(t?.queryKeyHashFn||N)(e)}function N(e){return JSON.stringify(e,(e,t)=>ee(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function P(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>P(e[n],t[n])):!1}var F=Object.prototype.hasOwnProperty;function I(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=R(e)&&R(t);if(!r&&!(ee(e)&&ee(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:F.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=I(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function L(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 R(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ee(e){if(!z(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!z(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function z(e){return Object.prototype.toString.call(e)===`[object Object]`}function B(e){return new Promise(t=>{x.setTimeout(t,e)})}function V(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:I(e,t)}function H(e){return e}function te(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function ne(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var U=Symbol();function re(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===U?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function ie(e,t){return typeof e==`function`?e(...t):!!e}function ae(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 oe=(()=>{let e=()=>C;return{isServer(){return e()},setIsServer(t){e=t}}})();function se(){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}var ce=S;function le(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=ce,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 ue=le(),de=new class extends v{#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 fe(e){return Math.min(1e3*2**e,3e4)}function pe(e){return(e??`online`)===`online`?de.isOnline():!0}var me=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function he(e){let t=!1,n=0,r,i=se(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new me(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>y.isFocused()&&(e.networkMode===`always`||de.isOnline())&&e.canRun(),u=()=>pe(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??(oe.isServer()?0:3),o=e.retryDelay??fe,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),B(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 ge=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),E(this.gcTime)&&(this.#e=x.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(oe.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e!==void 0&&(x.clearTimeout(this.#e),this.#e=void 0)}};function _e(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=>{ae(e,()=>t.signal,()=>n=!0)},u=re(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?ne:te;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ye:ve,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:ve(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 ve(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 ye(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var be=class extends ge{#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=Ce(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=Ce(this.options);e.data!==void 0&&(this.setState(Se(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=V(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(w).catch(w):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=>k(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===U||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>O(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:!D(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=re(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`?_e(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=he({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof me&&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 me){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,...xe(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Se(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),ue.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function xe(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pe(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Se(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Ce(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 we=class extends v{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=se(),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),Ee(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return De(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return De(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 k(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&&!L(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Oe(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(t.enabled,this.#t)||O(this.options.staleTime,this.#t)!==O(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||k(this.options.enabled,this.#t)!==k(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 Ae(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(w)),t}#g(){this.#b();let e=O(this.options.staleTime,this.#t);if(oe.isServer()||this.#r.isStale||!E(e))return;let t=D(this.#r.dataUpdatedAt,e)+1;this.#d=x.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,!(oe.isServer()||k(this.options.enabled,this.#t)===!1||!E(this.#p)||this.#p===0)&&(this.#f=x.setInterval(()=>{(this.options.refetchIntervalInBackground||y.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(x.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(x.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&&Ee(e,t),o=i&&Oe(e,n,t,r);(a||o)&&(l={...l,...xe(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=V(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=V(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:ke(e,t),refetch:this.refetch,promise:this.#o,isEnabled:k(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=se())},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),!L(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){ue.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Te(e,t){return k(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&k(t.retryOnMount,e)===!1)}function Ee(e,t){return Te(e,t)||e.state.data!==void 0&&De(e,t,t.refetchOnMount)}function De(e,t,n){if(k(t.enabled,e)!==!1&&O(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ke(e,t)}return!1}function Oe(e,t,n,r){return(e!==t||k(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ke(e,n)}function ke(e,t){return k(t.enabled,e)!==!1&&e.isStaleByTime(O(t.staleTime,e))}function Ae(e,t){return!L(e.getCurrentResult(),t)}var je=class extends ge{#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||Me(),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=he({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),ue.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Me(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Ne=class extends v{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 je({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=Pe(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=Pe(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=Pe(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=Pe(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.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=>j(t,e))}findAll(e={}){return this.getAll().filter(t=>j(e,t))}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ue.batch(()=>Promise.all(e.map(e=>e.continue().catch(w))))}};function Pe(e){return e.options.scope?.id}var Fe=class extends v{#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),L(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&N(t.mutationKey)!==N(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??Me();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){ue.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 Ie(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}function Le(e,t,n){let r=e.slice(0);return r[t]=n,r}var Re=class extends v{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,ue.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!L(e,n)});!o&&!s||(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(Ie(e,n).forEach(e=>{e.destroy()}),Ie(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){return t.map((n,r)=>{let i=e[r];return n.defaultedQueryOptions.notifyOnChangeProps?i:n.observer.trackResult(i,e=>{t.forEach(t=>{t.observer.trackProp(e)})})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(!this.#a||this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=I(this.#a,t(e))),this.#a}return e}#f(){return this.#r?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new we(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=Le(this.#t,n,t),this.#h())}#h(){if(this.hasListeners()){let e=this.#u(this.#t,this.#l),t=this.#f(),n=this.#a,r=t?n:this.#d(e,this.#r?.combine);(t||n!==r)&&ue.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},ze=class extends v{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??M(r,t),a=this.get(i);return a||(a=new be({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(){ue.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=>A(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>A(e,t)):t}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Be=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ze,this.#t=e.mutationCache||new Ne,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=y.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=de.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(O(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=T(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ue.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;ue.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ue.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=ue.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(w).catch(w)}invalidateQueries(e,t={}){return ue.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=ue.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(w)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(w)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(O(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(w).catch(w)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(w).catch(w)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return de.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(N(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{P(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(N(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{P(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||=M(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===U&&(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()}},Ve=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})),He=o(((e,t)=>{t.exports=Ve()})),W=l(d(),1),G=He(),Ue=W.createContext(void 0),We=e=>{let t=W.useContext(Ue);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Ge=({client:e,children:t})=>(W.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,G.jsx)(Ue.Provider,{value:e,children:t})),Ke=W.createContext(!1),qe=()=>W.useContext(Ke);Ke.Provider;function Je(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Ye=W.createContext(Je()),Xe=()=>W.useContext(Ye),Ze=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?ie(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Qe=e=>{W.useEffect(()=>{e.clearReset()},[e])},$e=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||ie(n,[e.error,r])),et=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))}},tt=(e,t)=>e.isLoading&&e.isFetching&&!t,nt=(e,t)=>e?.suspense&&t.isPending,rt=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function it({queries:e,...t},n){let r=We(n),i=qe(),a=Xe(),o=W.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:`optimistic`,t}),[e,r,i]);o.forEach(e=>{et(e),Ze(e,a,r.getQueryCache().get(e.queryHash))}),Qe(a);let[s]=W.useState(()=>new Re(r,o,t)),[c,l,u]=s.getOptimisticResult(o,t.combine),d=!i&&t.subscribed!==!1;W.useSyncExternalStore(W.useCallback(e=>d?s.subscribe(ue.batchCalls(e)):w,[s,d]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),W.useEffect(()=>{s.setQueries(o,t)},[o,t,s]);let f=c.some((e,t)=>nt(o[t],e))?c.flatMap((e,t)=>{let n=o[t];return n&&nt(n,e)?rt(n,new we(r,n),a):[]}):[];if(f.length>0)throw Promise.all(f);let p=c.find((e,t)=>{let n=o[t];return n&&$e({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(p?.error)throw p.error;return l(u())}function at(e,t,n){let r=qe(),i=Xe(),a=We(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,et(o),Ze(o,i,s),Qe(i);let c=!a.getQueryCache().get(o.queryHash),[l]=W.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(W.useSyncExternalStore(W.useCallback(e=>{let t=d?l.subscribe(ue.batchCalls(e)):w;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),W.useEffect(()=>{l.setOptions(o)},[o,l]),nt(o,u))throw rt(o,l,i);if($e({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!oe.isServer()&&tt(u,r)&&(c?rt(o,l,i):s?.promise)?.catch(w).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function ot(e,t){return at(e,we,t)}function st(e,t){let n=We(t),[r]=W.useState(()=>new Fe(n,e));W.useEffect(()=>{r.setOptions(e)},[r,e]);let i=W.useSyncExternalStore(W.useCallback(e=>r.subscribe(ue.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=W.useCallback((e,t)=>{r.mutate(e,t).catch(w)},[r]);if(i.error&&ie(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var ct=`modulepreload`,lt=function(e){return`/`+e},ut={},dt=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=lt(t,n),t in ut)return;ut[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:ct,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ft=`popstate`;function pt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function mt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return yt(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:bt(t)}return St(t,n,null,e)}function ht(e,t){if(e===!1||e==null)throw Error(t)}function gt(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function _t(){return Math.random().toString(36).substring(2,10)}function vt(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function yt(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?xt(t):t,state:n,key:t&&t.key||r||_t(),mask:i}}function bt({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function xt(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function St(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=pt(e)?e:yt(h.location,e,t);n&&n(r,e),l=u()+1;let d=vt(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=pt(e)?e:yt(h.location,e,t);n&&n(r,e),l=u();let i=vt(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Ct(e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(ft,d),c=e,()=>{i.removeEventListener(ft,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Ct(e,t=!1){let n=`http://localhost`;typeof window<`u`&&(n=window.location.origin===`null`?window.location.href:window.location.origin),ht(n,`No window.location.(origin|href) available to create URL`);let r=typeof e==`string`?e:bt(e);return r=r.replace(/ $/,`%20`),!t&&r.startsWith(`//`)&&(r=n+r),new URL(r,n)}function wt(e,t,n=`/`){return Tt(e,t,n,!1)}function Tt(e,t,n,r,i){let a=Wt((typeof t==`string`?xt(t):t).pathname||`/`,n);if(a==null)return null;let o=i??Dt(e),s=null,c=Ut(a);for(let e=0;s==null&&e<o.length;++e)s=Bt(o[e],c,r);return s}function Et(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function Dt(e){let t=Ot(e);return At(t),t}function Ot(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;ht(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=$t([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(ht(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),Ot(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Rt(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of kt(e.path))a(e,t,!0,n)}),t}function kt(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=kt(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function At(e){e.sort((e,t)=>e.score===t.score?zt(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var jt=/^:[\w-]+$/,Mt=3,Nt=2,Pt=1,Ft=10,It=-2,Lt=e=>e===`*`;function Rt(e,t){let n=e.split(`/`),r=n.length;return n.some(Lt)&&(r+=It),t&&(r+=Nt),n.filter(e=>!Lt(e)).reduce((e,t)=>e+(jt.test(t)?Mt:t===``?Pt:Ft),r)}function zt(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Bt(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=Vt({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=Vt({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:$t([a,u.pathname]),pathnameBase:tn($t([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=$t([a,u.pathnameBase]))}return o}function Vt(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ht(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Ht(e,t=!1,n=!0){gt(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function Ut(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return gt(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Wt(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var Gt=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Kt(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?xt(e):e,a;return n?(n=Qt(n),a=n.startsWith(`/`)?qt(n.substring(1),`/`):qt(n,t)):a=t,{pathname:a,search:nn(r),hash:rn(i)}}function qt(e,t){let n=en(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Jt(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Yt(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Xt(e){let t=Yt(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Zt(e,t,n,r=!1){let i;typeof e==`string`?i=xt(e):(i={...e},ht(!i.pathname||!i.pathname.includes(`?`),Jt(`?`,`pathname`,`search`,i)),ht(!i.pathname||!i.pathname.includes(`#`),Jt(`#`,`pathname`,`hash`,i)),ht(!i.search||!i.search.includes(`#`),Jt(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Kt(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Qt=e=>e.replace(/\/\/+/g,`/`),$t=e=>Qt(e.join(`/`)),en=e=>e.replace(/\/+$/,``),tn=e=>en(e).replace(/^\/*/,`/`),nn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,rn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,an=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function on(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function sn(e){return $t(e.map(e=>e.route.path).filter(Boolean))||`/`}var cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ln(e,t){let n=e;if(typeof n!=`string`||!Gt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(cn)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=Wt(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{gt(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var un=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(un);var dn=[`GET`,...un];new Set(dn);var fn=W.createContext(null);fn.displayName=`DataRouter`;var pn=W.createContext(null);pn.displayName=`DataRouterState`;var mn=W.createContext(!1);function hn(){return W.useContext(mn)}var gn=W.createContext({isTransitioning:!1});gn.displayName=`ViewTransition`;var _n=W.createContext(new Map);_n.displayName=`Fetchers`;var vn=W.createContext(null);vn.displayName=`Await`;var yn=W.createContext(null);yn.displayName=`Navigation`;var bn=W.createContext(null);bn.displayName=`Location`;var xn=W.createContext({outlet:null,matches:[],isDataRoute:!1});xn.displayName=`Route`;var Sn=W.createContext(null);Sn.displayName=`RouteError`;var Cn=`REACT_ROUTER_ERROR`,wn=`REDIRECT`,Tn=`ROUTE_ERROR_RESPONSE`;function En(e){if(e.startsWith(`${Cn}:${wn}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Dn(e){if(e.startsWith(`${Cn}:${Tn}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new an(t.status,t.statusText,t.data)}catch{}}function On(e,{relative:t}={}){ht(kn(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=W.useContext(yn),{hash:i,pathname:a,search:o}=Rn(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:$t([n,a])),r.createHref({pathname:s,search:o,hash:i})}function kn(){return W.useContext(bn)!=null}function An(){return ht(kn(),`useLocation() may be used only in the context of a <Router> component.`),W.useContext(bn).location}var jn=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Mn(e){W.useContext(yn).static||W.useLayoutEffect(e)}function Nn(){let{isDataRoute:e}=W.useContext(xn);return e?rr():Pn()}function Pn(){ht(kn(),`useNavigate() may be used only in the context of a <Router> component.`);let e=W.useContext(fn),{basename:t,navigator:n}=W.useContext(yn),{matches:r}=W.useContext(xn),{pathname:i}=An(),a=JSON.stringify(Xt(r)),o=W.useRef(!1);return Mn(()=>{o.current=!0}),W.useCallback((r,s={})=>{if(gt(o.current,jn),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Zt(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:$t([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var Fn=W.createContext(null);function In(e){let t=W.useContext(xn).outlet;return W.useMemo(()=>t&&W.createElement(Fn.Provider,{value:e},t),[t,e])}function Ln(){let{matches:e}=W.useContext(xn);return e[e.length-1]?.params??{}}function Rn(e,{relative:t}={}){let{matches:n}=W.useContext(xn),{pathname:r}=An(),i=JSON.stringify(Xt(n));return W.useMemo(()=>Zt(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function zn(e,t){return Bn(e,t)}function Bn(e,t,n){ht(kn(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=W.useContext(yn),{matches:i}=W.useContext(xn),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ar(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
10
|
|
|
11
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=An(),d;if(t){let e=typeof t==`string`?xt(t):t;ht(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):wt(e,{pathname:p});gt(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),gt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=qn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:$t([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:$t([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?W.createElement(bn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Vn(){let e=nr(),t=on(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=W.createElement(W.Fragment,null,W.createElement(`p`,null,`💿 Hey developer 👋`),W.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,W.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,W.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),W.createElement(W.Fragment,null,W.createElement(`h2`,null,`Unexpected Application Error!`),W.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?W.createElement(`pre`,{style:i},n):null,o)}var Hn=W.createElement(Vn,null),Un=class extends W.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Dn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:W.createElement(xn.Provider,{value:this.props.routeContext},W.createElement(Sn.Provider,{value:e,children:this.props.component}));return this.context?W.createElement(Gn,{error:e},t):t}};Un.contextType=mn;var Wn=new WeakMap;function Gn({children:e,error:t}){let{basename:n}=W.useContext(yn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=En(t.digest);if(e){let r=Wn.get(t);if(r)throw r;let i=ln(e.location,n);if(cn&&!Wn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Wn.set(t,n),n}return W.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Kn({routeContext:e,match:t,children:n}){let r=W.useContext(fn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),W.createElement(xn.Provider,{value:e},n)}function qn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);ht(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:sn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Hn,o&&(s<0&&c===0?(ar(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?W.createElement(n.route.Component,null):n.route.element?n.route.element:e,W.createElement(Kn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?W.createElement(Un,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yn(e){let t=W.useContext(fn);return ht(t,Jn(e)),t}function Xn(e){let t=W.useContext(pn);return ht(t,Jn(e)),t}function Zn(e){let t=W.useContext(xn);return ht(t,Jn(e)),t}function Qn(e){let t=Zn(e),n=t.matches[t.matches.length-1];return ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $n(){return Qn(`useRouteId`)}function er(){let e=Xn(`useNavigation`);return W.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function tr(){let{matches:e,loaderData:t}=Xn(`useMatches`);return W.useMemo(()=>e.map(e=>Et(e,t)),[e,t])}function nr(){let e=W.useContext(Sn),t=Xn(`useRouteError`),n=Qn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rr(){let{router:e}=Yn(`useNavigate`),t=Qn(`useNavigate`),n=W.useRef(!1);return Mn(()=>{n.current=!0}),W.useCallback(async(r,i={})=>{gt(n.current,jn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ir={};function ar(e,t,n){!t&&!ir[e]&&(ir[e]=!0,gt(!1,n))}W.memo(or);function or({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Bn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function sr({to:e,replace:t,state:n,relative:r}){ht(kn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=W.useContext(yn);gt(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=W.useContext(xn),{pathname:o}=An(),s=Nn(),c=Zt(e,Xt(a),o,r===`path`),l=JSON.stringify(c);return W.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function cr(e){return In(e.context)}function lr(e){ht(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ur({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){ht(!kn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=W.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=xt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=W.useMemo(()=>{let e=Wt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return gt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:W.createElement(yn.Provider,{value:c},W.createElement(bn.Provider,{children:t,value:h}))}function dr({children:e,location:t}){return zn(fr(e),t)}W.Component;function fr(e,t=[]){let n=[];return W.Children.forEach(e,(e,r)=>{if(!W.isValidElement(e))return;let i=[...t,r];if(e.type===W.Fragment){n.push.apply(n,fr(e.props.children,i));return}ht(e.type===lr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=fr(e.props.children,i)),n.push(a)}),n}var pr=`get`,mr=`application/x-www-form-urlencoded`;function hr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function gr(e){return hr(e)&&e.tagName.toLowerCase()===`button`}function _r(e){return hr(e)&&e.tagName.toLowerCase()===`form`}function vr(e){return hr(e)&&e.tagName.toLowerCase()===`input`}function yr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function br(e,t){return e.button===0&&(!t||t===`_self`)&&!yr(e)}function xr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Sr(e,t){let n=xr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Cr=null;function wr(){if(Cr===null)try{new FormData(document.createElement(`form`),0),Cr=!1}catch{Cr=!0}return Cr}var Tr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Er(e){return e!=null&&!Tr.has(e)?(gt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mr}"`),null):e}function Dr(e,t){let n,r,i,a,o;if(_r(e)){let o=e.getAttribute(`action`);r=o?Wt(o,t):null,n=e.getAttribute(`method`)||pr,i=Er(e.getAttribute(`enctype`))||mr,a=new FormData(e)}else if(gr(e)||vr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Wt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||pr,i=Er(e.getAttribute(`formenctype`))||Er(o.getAttribute(`enctype`))||mr,a=new FormData(o,e),!wr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(hr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=pr,r=null,i=mr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Or={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},kr=/[&><\u2028\u2029]/g;function Ar(e){return e.replace(kr,e=>Or[e])}function jr(e,t){if(e===!1||e==null)throw Error(t)}function Mr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Wt(i.pathname,t)===`/`?i.pathname=`${en(t)}/_root.${r}`:i.pathname=`${en(i.pathname)}.${r}`,i}async function Nr(e,t){if(e.id in t)return t[e.id];try{let n=await dt(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pr(e){return e!=null&&typeof e.page==`string`}function Fr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ir(e,t,n){return Vr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Nr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Fr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Lr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Rr(e,t,{includeHydrateFallback:n}={}){return zr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function zr(e){return[...new Set(e)]}function Br(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Vr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Pr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Br(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Hr(){let e=W.useContext(fn);return jr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ur(){let e=W.useContext(pn);return jr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Wr=W.createContext(void 0);Wr.displayName=`FrameworkContext`;function Gr(){let e=W.useContext(Wr);return jr(e,`You must render this element inside a <HydratedRouter> element`),e}function Kr(e,t){let n=W.useContext(Wr),[r,i]=W.useState(!1),[a,o]=W.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=W.useRef(null);W.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),W.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:qr(s,p),onBlur:qr(c,m),onMouseEnter:qr(l,p),onMouseLeave:qr(u,m),onTouchStart:qr(d,p)}]:[a,f,{}]:[!1,f,{}]}function qr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Jr({page:e,...t}){let n=hn(),{router:r}=Hr(),i=W.useMemo(()=>wt(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?W.createElement(Xr,{page:e,matches:i,...t}):W.createElement(Zr,{page:e,matches:i,...t}):null}function Yr(e){let{manifest:t,routeModules:n}=Gr(),[r,i]=W.useState([]);return W.useEffect(()=>{let r=!1;return Ir(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Xr({page:e,matches:t,...n}){let r=An(),{future:i}=Gr(),{basename:a}=Hr(),o=W.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Mr(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return W.createElement(W.Fragment,null,o.map(e=>W.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Zr({page:e,matches:t,...n}){let r=An(),{future:i,manifest:a,routeModules:o}=Gr(),{basename:s}=Hr(),{loaderData:c,matches:l}=Ur(),u=W.useMemo(()=>Lr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=W.useMemo(()=>Lr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=W.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Mr(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=W.useMemo(()=>Rr(d,a),[d,a]),m=Yr(d);return W.createElement(W.Fragment,null,f.map(e=>W.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>W.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>W.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Qr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}W.Component;var $r=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{$r&&(window.__reactRouterVersion=`7.15.1`)}catch{}function ei({basename:e,children:t,useTransitions:n,window:r}){let i=W.useRef();i.current??=mt({window:r,v5Compat:!0});let a=i.current,[o,s]=W.useState({action:a.action,location:a.location}),c=W.useCallback(e=>{n===!1?s(e):W.startTransition(()=>s(e))},[n]);return W.useLayoutEffect(()=>a.listen(c),[a,c]),W.createElement(ur,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function ti({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=W.useState({action:n.action,location:n.location}),o=W.useCallback(e=>{r===!1?a(e):W.startTransition(()=>a(e))},[r]);return W.useLayoutEffect(()=>n.listen(o),[n,o]),W.createElement(ur,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}ti.displayName=`unstable_HistoryRouter`;var ni=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ri=W.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=W.useContext(yn),v=typeof l==`string`&&ni.test(l),y=ln(l,h);l=y.to;let b=On(l,{relative:r}),x=An(),S=null;if(o){let e=Zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:$t([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Kr(n,p),E=ui(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=W.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Qr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?W.createElement(W.Fragment,null,k,W.createElement(Jr,{page:b})):k});ri.displayName=`Link`;var ii=W.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Rn(a,{relative:c.relative}),d=An(),f=W.useContext(pn),{navigator:p,basename:m}=W.useContext(yn),h=f!=null&&xi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Wt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return W.createElement(ri,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ii.displayName=`NavLink`;var ai=W.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=pr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=W.useContext(yn),g=mi(),_=hi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&ni.test(s);return W.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?W.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ai.displayName=`Form`;function oi({getKey:e,storageKey:t,...n}){let r=W.useContext(Wr),{basename:i}=W.useContext(yn),a=An(),o=tr();yi({getKey:e,storageKey:t});let s=W.useMemo(()=>{if(!r||!e)return null;let t=vi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return W.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ar(JSON.stringify(t||gi))}, ${Ar(JSON.stringify(s))})`}})}oi.displayName=`ScrollRestoration`;function si(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ci(e){let t=W.useContext(fn);return ht(t,si(e)),t}function li(e){let t=W.useContext(pn);return ht(t,si(e)),t}function ui(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Nn(),d=An(),f=Rn(e,{relative:o});return W.useCallback(p=>{if(br(p,t)){p.preventDefault();let t=n===void 0?bt(d)===bt(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?W.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function di(e){gt(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=W.useRef(xr(e)),n=W.useRef(!1),r=An(),i=W.useMemo(()=>Sr(r.search,n.current?null:t.current),[r.search]),a=Nn();return[i,W.useCallback((e,t)=>{let r=xr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var fi=0,pi=()=>`__${String(++fi)}__`;function mi(){let{router:e}=ci(`useSubmit`),{basename:t}=W.useContext(yn),n=$n(),r=e.fetch,i=e.navigate;return W.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Dr(e,t);a.navigate===!1?await r(a.fetcherKey||pi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function hi(e,{relative:t}={}){let{basename:n}=W.useContext(yn),r=W.useContext(xn);ht(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Rn(e||`.`,{relative:t})},o=An();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:$t([n,a.pathname])),bt(a)}var gi=`react-router-scroll-positions`,_i={};function vi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Wt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function yi({getKey:e,storageKey:t}={}){let{router:n}=ci(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=li(`useScrollRestoration`),{basename:a}=W.useContext(yn),o=An(),s=tr(),c=er();W.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),bi(W.useCallback(()=>{if(c.state===`idle`){let t=vi(o,s,a,e);_i[t]=window.scrollY}try{sessionStorage.setItem(t||gi,JSON.stringify(_i))}catch(e){gt(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(W.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||gi);e&&(_i=JSON.parse(e))}catch{}},[t]),W.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(_i,()=>window.scrollY,e?(t,n)=>vi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),W.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{gt(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function bi(e,t){let{capture:n}=t||{};W.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function xi(e,{relative:t}={}){let n=W.useContext(gn);ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ci(`useViewTransitionState`),i=Rn(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Wt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vt(i.pathname,o)!=null||Vt(i.pathname,a)!=null}var Si=l(_(),1),Ci=6e4,wi=3e5,Ti=200,Ei={active:1,idle:2,deep_sleep:5,hidden:10},Di=[`mousemove`,`mousedown`,`keydown`,`scroll`,`touchstart`],Oi=(0,W.createContext)(void 0);function ki({children:e}){let[t,n]=(0,W.useState)(`active`),r=(0,W.useRef)(null),i=(0,W.useRef)(null),a=(0,W.useRef)(Date.now()),o=(0,W.useCallback)(()=>{r.current&&=(clearTimeout(r.current),null),i.current&&=(clearTimeout(i.current),null)},[]),s=(0,W.useCallback)(()=>{o(),r.current=setTimeout(()=>{n(`idle`),i.current=setTimeout(()=>{n(`deep_sleep`)},wi-Ci)},Ci)},[o]),c=(0,W.useCallback)(()=>{let e=Date.now();e-a.current<Ti||(a.current=e,n(`active`),s())},[s]),l=(0,W.useCallback)(()=>{document.hidden?(o(),n(`hidden`)):(n(`active`),a.current=Date.now(),s())},[o,s]);return(0,W.useEffect)(()=>{s();for(let e of Di)document.addEventListener(e,c,{passive:!0});return document.addEventListener(`visibilitychange`,l),()=>{o();for(let e of Di)document.removeEventListener(e,c);document.removeEventListener(`visibilitychange`,l)}},[c,l,s,o]),(0,G.jsx)(Oi.Provider,{value:{powerState:t},children:e})}function Ai(){let e=(0,W.useContext)(Oi);if(!e)throw Error(`usePowerState must be used within a PowerProvider`);return e.powerState}function ji(){return``}function Mi(e){return e.startsWith(`/`)?e:`/${e}`}var Ni=`myco.lastSelectedProject`,Pi=null;function Fi(e){Pi=e}function Ii(){return Pi}function Li(){let e=Ii();return e?{"x-myco-grove-id":e.grove.id,"x-myco-project-id":e.project.project_id}:{}}function Ri(e,t,n){if(!t||!n)return null;let r=e.find(e=>e.slug===t||e.id===t);if(!r)return null;let i=r.projects.find(e=>e.slug===n||e.project_id===n);return i?{grove:r,project:i}:null}function zi(e){let t=e.find(e=>e.is_default&&e.projects.length>0)??e.find(e=>e.projects.length>0);return t?{grove:t,project:t.projects[0]}:null}function Bi(e,t=``){let n=t&&t!==`/`?`/${t.replace(/^\/+/,``)}`:``;return`/g/${e.grove.slug}/p/${e.project.slug}${n}`}function Vi(e){let t=e.match(/^\/g\/[^/]+\/p\/[^/]+(?<suffix>\/.*)?$/)?.groups?.suffix??`/`;return/^\/sessions\/[^/]+/.test(t)?`/sessions`:t}function Hi(e){return e?`${e.grove.id}:${e.project.project_id}`:`none`}function Ui(){try{let e=window.localStorage.getItem(Ni);if(!e)return null;let t=JSON.parse(e);return typeof t.groveId!=`string`||typeof t.projectId!=`string`?null:{groveId:t.groveId,projectId:t.projectId}}catch{return null}}function Wi(e){try{window.localStorage.setItem(Ni,JSON.stringify({groveId:e.grove.id,projectId:e.project.project_id}))}catch{}}function Gi(e){let t=Ui();if(!t)return null;let n=e.find(e=>e.id===t.groveId),r=n?.projects.find(e=>e.project_id===t.projectId);return n&&r?{grove:n,project:r}:null}function Ki(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`M`:(t.length===1?t[0].slice(0,2):`${t[0][0]}${t[1][0]}`).toUpperCase()}function qi(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return`hsl(${t%360} 58% 48%)`}var Ji=`/api`,Yi=[`/groves`,`/version`,`/logs`,`/logs/search`,`/logs/stream`],Xi=`0.27.18`,Zi=!1;function Qi(e){if(Zi)return;let t=e.headers.get(`X-Myco-Api-Version`);t&&t!==Xi&&(Zi=!0,console.warn(`[myco] UI version ${Xi} is talking to daemon ${t} — reload to pick up the new UI build.`))}async function $i(e,t){let n=t?.method?.toUpperCase(),r=n===`POST`||n===`PUT`,i=aa(e,t?.headers,r),a=await fetch(Mi(`${Ji}${e}`),{...t,headers:i});if(Qi(a),!a.ok){let e=await a.json().catch(()=>({}));throw ra(a.status,e),new ma(a.status,e)}return a.json()}var ea=`myco:auth-reload-ts`,ta=1e4,na=()=>{window.location.reload()};function ra(e,t){if(e===401&&(typeof t==`object`&&t&&`error`in t?t.error:null)===`unauthorized_context_switch`&&!(typeof window>`u`||window.sessionStorage===void 0)){try{let e=Number(window.sessionStorage.getItem(ea)??`0`);if(Number.isFinite(e)&&Date.now()-e<ta)return;window.sessionStorage.setItem(ea,String(Date.now()))}catch{return}na()}}function ia(){if(typeof window>`u`)return;let e=window.__MYCO_AUTH__;return typeof e==`string`&&e.length>0?e:void 0}function aa(e,t,n){let r=new Headers;if(!oa(e)){for(let[e,t]of Object.entries(Li()))r.set(e,t);let e=ia();e&&r.set(`x-myco-auth`,e)}return n&&r.set(`Content-Type`,`application/json`),t&&new Headers(t).forEach((e,t)=>r.set(t,e)),Array.from(r.keys()).length>0?r:void 0}function oa(e){return Yi.some(t=>e===t||e.startsWith(`${t}/`))}async function sa(e,t){return $i(e,{method:`POST`,body:t?JSON.stringify(t):void 0})}async function ca(e,t){return $i(e,{method:`PUT`,body:JSON.stringify(t)})}async function la(e){return $i(e,{method:`DELETE`})}function ua(e){return $i(`/config/merged`,{signal:e})}function da(e){return $i(`/config/local`,{signal:e})}function fa(e,t,n){let r={scope:e,patch:t};return n&&n.length>0&&(r.clear=n),ca(`/config/scoped`,r)}function pa(e){return ca(`/config/scoped`,{scope:`local`,patch:{},clear:e})}var ma=class extends Error{status;body;constructor(e,t){let n=typeof t==`object`&&t&&`error`in t?String(t.error):null;super(n?`${n} (API ${e})`:`API error ${e}`),this.status=e,this.body=t}};function ha(e){return Array.isArray(e)?e:e?e.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(e=>e.length>0):[]}function ga(e,t){let n=ha(t),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r)){let t=Number(e);if(!Number.isInteger(t))return;r=r[t];continue}if(typeof r!=`object`)return;r=r[e]}return r}function _a(e,t,n){let r=ha(t);if(r.length===0)return;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e],n=i[t];(typeof n!=`object`||!n||Array.isArray(n))&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}var va=(0,W.createContext)(null);function ya({selection:e,children:t}){let n=We(),r=Hi(e),[i,a]=(0,W.useState)(null);return(0,W.useLayoutEffect)(()=>{Fi(e),Wi(e),n.removeQueries({predicate:e=>e.queryKey[0]!==`groves`}),a(r)},[r,n]),i===r?(0,G.jsx)(va.Provider,{value:e,children:t}):(0,G.jsx)(`div`,{className:`flex h-64 items-center justify-center text-sm text-on-surface-variant`,children:`Switching project...`})}function ba({children:e}){return(0,W.useLayoutEffect)(()=>{Fi(null)},[]),(0,G.jsx)(G.Fragment,{children:e})}function xa(){return(0,W.useContext)(va)}function Sa(e=``){let t=xa();return t?Bi(t,e):e||`/`}function Ca(){let e=xa();return(0,W.useCallback)((t=``)=>e?Bi(e,t):t||`/`,[e])}function wa(e,t){if(!e)return t;let[n,...r]=t;return[n,{projectSelection:Hi(e)},...r]}function Ta(e){return wa(xa(),e)}var Ea=[`grove-config`];function Da(e){return[...Ea,e??`none`]}function Oa(){let e=xa()?.grove.id??null;return ot({queryKey:Da(e),queryFn:({signal:e})=>$i(`/grove-config`,{signal:e}),enabled:e!==null})}function ka(){let e=We(),t=xa()?.grove.id??null;return st({mutationFn:e=>ca(`/grove-config`,{patch:e}),onSuccess:()=>{e.invalidateQueries({queryKey:Da(t)}),e.invalidateQueries({queryKey:[`config`,`merged`]})}})}var Aa=[`config`,`merged`],ja=[`config`,`local`],Ma=[`notifications`];function Na(){let e=We(),t=ka(),n=ot({queryKey:Aa,queryFn:({signal:e})=>ua(e)}),r=ot({queryKey:ja,queryFn:({signal:e})=>da(e)}),i=(0,W.useRef)(n.data);i.current=n.data;let a=(0,W.useRef)(r.data);a.current=r.data;let o=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:Ma})},[e]),s=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:ja}),e.invalidateQueries({queryKey:Aa}),o()},[o,e]),c=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:Aa}),o()},[o,e]),l=(0,W.useCallback)(e=>e===`local`?s():c(),[s,c]),u=(0,W.useCallback)(async(e,n,r)=>{let i={};_a(i,e,n),r===`grove`?(await t.mutateAsync(i),o()):(await fa(r,i),l(r))},[l,o,t]),d=(0,W.useCallback)(async(e,n,r)=>{let i={};for(let{path:t,value:n}of e)_a(i,t,n);n===`grove`?(await t.mutateAsync(i),o()):(await fa(n,i,r),l(n))},[l,o,t]),f=(0,W.useCallback)(async e=>{await pa([e]),s()},[s]),p=(0,W.useCallback)(async e=>{e.length!==0&&(await pa(e),s())},[s]),m=(0,W.useCallback)(async e=>{let t=ga(i.current??{},e),n={};_a(n,e,t),await fa(`project`,n),await pa([e]),s()},[s]),h=(0,W.useCallback)(e=>ga(a.current??{},e)!==void 0,[]);return{effective:n.data,local:r.data??{},isLoading:n.isLoading||r.isLoading,isLocalOverride:h,setField:u,setFields:d,resetField:f,resetFields:p,promoteField:m}}var Pa=`myco-appearance`,Fa={compact:.85,normal:1,comfy:1.15},Ia={default:{heading:`'Newsreader', Georgia, serif`,ui:`'Inter', system-ui, sans-serif`,data:`'JetBrains Mono', 'Fira Code', monospace`},"geist-mono":{heading:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`,ui:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`,data:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`},system:{heading:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`,ui:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`,data:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`},"sf-mono":{heading:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`,ui:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`,data:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`},"fira-code":{heading:`'Fira Code', 'Fira Mono', ui-monospace, monospace`,ui:`'Fira Code', 'Fira Mono', ui-monospace, monospace`,data:`'Fira Code', 'Fira Mono', ui-monospace, monospace`},"jetbrains-mono":{heading:`'JetBrains Mono', ui-monospace, monospace`,ui:`'JetBrains Mono', ui-monospace, monospace`,data:`'JetBrains Mono', ui-monospace, monospace`}},La=`(prefers-color-scheme: light)`;function Ra(e){let t=document.documentElement;t.setAttribute(`data-theme`,e.theme);let n=e.mode===`system`?window.matchMedia(La).matches?`light`:`dark`:e.mode;t.classList.toggle(`light`,n===`light`);let r=Ia[e.font];t.style.setProperty(`--font-heading`,r.heading),t.style.setProperty(`--font-ui`,r.ui),t.style.setProperty(`--font-data`,r.data);let i=Fa[e.density];t.style.setProperty(`--density`,String(i)),t.style.fontSize=`calc(14px * ${i})`;let a=document.querySelector(`link[rel="icon"]`);if(a){let t=`/favicon-${e.theme}.svg`;a.href.endsWith(t)||(a.href=t)}}function za(e){try{localStorage.setItem(Pa,JSON.stringify(e))}catch{}}function Ba(){let e=null;try{e=localStorage.getItem(Pa)}catch{return}if(e)try{Ra(JSON.parse(e))}catch{try{localStorage.removeItem(Pa)}catch{}}}var Va=(0,W.createContext)(null),Ha={theme:`sage`,mode:`dark`,font:`default`,density:`normal`},Ua=`(prefers-color-scheme: light)`;function Wa({children:e}){let{effective:t,local:n,setField:r,resetField:i,promoteField:a}=Na(),o=(0,W.useMemo)(()=>t?.appearance??Ha,[t?.appearance]),s=(0,W.useMemo)(()=>n.appearance??{},[n.appearance]);(0,W.useEffect)(()=>{t?.appearance&&(Ra(o),za(o))},[o,t?.appearance]),(0,W.useEffect)(()=>{if(o.mode!==`system`)return;let e=window.matchMedia(Ua),t=()=>Ra(o);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[o]);let c=(0,W.useCallback)((e,t,n)=>r(`appearance.${e}`,t,n),[r]),l=(0,W.useCallback)(e=>i(`appearance.${e}`),[i]),u=(0,W.useCallback)(()=>a(`appearance`),[a]),d=(0,W.useCallback)(()=>i(`appearance`),[i]),f=(0,W.useMemo)(()=>({effective:o,local:s,set:c,resetKey:l,saveAllAsProject:u,resetAll:d}),[o,s,c,l,u,d]);return(0,G.jsx)(Va.Provider,{value:f,children:e})}function Ga(){let e=(0,W.useContext)(Va);if(!e)throw Error(`useAppearance must be used inside AppearanceProvider`);return e}var Ka={enabled:`cortex.enabled`,instructions:{injectOnSessionStart:`cortex.instructions.inject_on_session_start`},digest:{tier:`cortex.digest.tier`,injectOnSessionStart:`cortex.digest.inject_on_session_start`},spores:{injectOnPromptSubmit:`cortex.spores.inject_on_prompt_submit`,maxPerPrompt:`cortex.spores.max_per_prompt`},canopy:{injectOnPreToolUse:`cortex.canopy.inject_on_pre_tool_use`,minFileBytes:`cortex.canopy.min_file_bytes`,refresh:{backgroundEnabled:`cortex.canopy.refresh.background_enabled`,backgroundPeriodMinutes:`cortex.canopy.refresh.background_period_minutes`},exclude:{defaultPatterns:`cortex.canopy.exclude.default_patterns`,patterns:`cortex.canopy.exclude.patterns`}}},qa={scheduledTasksEnabled:`agent.scheduled_tasks_enabled`,eventTasksEnabled:`agent.event_tasks_enabled`,summaryBatchInterval:`agent.summary_batch_interval`},Ja=`config-field-`,Ya={appearance:`config-section-appearance`,cortexInstructions:`config-section-cortex-instructions`,cortexBuilder:`config-section-cortex-builder`,cortexDigest:`config-section-cortex-digest`,settingsAgent:`config-section-settings-agent`,settingsEmbedding:`config-section-settings-embedding`,settingsNotifications:`config-section-settings-notifications`,settingsPlanCapture:`config-section-settings-plan-capture`,settingsProject:`config-section-settings-project`,agentOperations:`config-section-agent-operations`,operationsMaintenance:`config-section-operations-maintenance`,operationsBackup:`config-section-operations-backup`};Ya.appearance,Ya.settingsAgent,Ya.settingsEmbedding,Ya.cortexDigest,Ya.cortexInstructions,Ya.cortexInstructions,Ya.cortexInstructions,Ya.cortexInstructions,Ya.settingsNotifications,Ya.settingsPlanCapture,Ya.agentOperations,Ka.digest.tier,Ka.digest.injectOnSessionStart,Ka.instructions.injectOnSessionStart,Ka.spores.injectOnPromptSubmit,Ka.spores.maxPerPrompt,Ka.canopy.injectOnPreToolUse,Ka.canopy.minFileBytes,qa.scheduledTasksEnabled,qa.eventTasksEnabled,qa.summaryBatchInterval;function Xa(e){return`${Ja}${e.replace(/[^a-zA-Z0-9]+/g,`-`)}`}var Za=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qa=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),$a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),eo=e=>{let t=$a(e);return t.charAt(0).toUpperCase()+t.slice(1)},to={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`},no=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ro=(0,W.createContext)({}),io=()=>(0,W.useContext)(ro),ao=(0,W.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=``}=io()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...to,width:t??l??to.width,height:t??l??to.height,stroke:e??f,strokeWidth:m,className:Za(`lucide`,p,i),...!a&&!no(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(ao,{ref:i,iconNode:t,className:Za(`lucide-${Qa(eo(e))}`,`lucide-${e}`,n),...r}));return n.displayName=eo(e),n},oo=K(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),so=K(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),co=K(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),lo=K(`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`}]]),uo=K(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),fo=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),po=K(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),mo=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ho=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),go=K(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),_o=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vo=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),yo=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),bo=K(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),xo=K(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),So=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Co=K(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),wo=K(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),To=K(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Eo=K(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Do=K(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Oo=K(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),ko=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ao=K(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),jo=K(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Mo=K(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),No=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Po=K(`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`}]]),Fo=K(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Io=K(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Lo=K(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Ro=K(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),zo=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Bo=K(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),Vo=K(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Ho=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Uo=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Wo=K(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Go=K(`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`}]]),Ko=K(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),qo=K(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Jo=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Yo=K(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Xo=K(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Zo=K(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Qo=K(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),$o=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),es=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ts=K(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),ns=K(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),rs=K(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),is=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),as=K(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),os=K(`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`}]]),ss=K(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),cs=K(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),ls=K(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),us=K(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ds=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),fs=K(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ps=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ms=K(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),hs=K(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),gs=K(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),_s=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),vs=K(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ys=K(`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`}]]),bs=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xs=K(`shield-alert`,[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ss=K(`shield`,[[`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`}]]),Cs=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),ws=K(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ts=K(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Es=K(`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`}]]),Ds=K(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Os=K(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ks=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),As=K(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),js=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ms=K(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ns=K(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ps=K(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Fs=K(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Is=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ls=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Rs=6e4,zs=3e4;function Bs(e,t,n){if(t===`heartbeat`){let t=e*Ei[n];return n===`hidden`?Math.min(t,Rs):n===`deep_sleep`?Math.min(t,zs):t}return n===`deep_sleep`||n===`hidden`?!1:e*Ei[n]}function Vs(e){let t=Ai(),{pollCategory:n,refetchInterval:r,contextFree:i=!1,...a}=e,o=Ta(a.queryKey??[]),s=r===!1?!1:Bs(r,n,t);return ot({...a,queryKey:i?a.queryKey:o,refetchInterval:s})}var Hs={HEALTH:5e3,STATS:1e4,LOGS:3e3,PROGRESS:1e3,UPDATE:3e5,RUNS_ACTIVE:3e3,RUN_DETAIL:5e3,SESSIONS:8e3,SESSION_DETAIL:8e3,SPORES:3e4,CANOPY_ENTRIES:6e4,GIT_IDENTITY:5e3},Us=1e4,Ws=3e4,Gs=[`debug`,`info`,`warn`,`error`],Ks={debug:0,info:1,warn:2,error:3},qs=[`stable`,`beta`],Js=1e3;function Ys(e){switch(e){case`info`:return`default`;case`warn`:return`warning`;case`error`:return`destructive`;default:return`secondary`}}function Xs(e){switch(e){case`info`:return`bg-primary`;case`debug`:return`bg-outline`;case`warn`:return`bg-secondary`;case`error`:return`bg-tertiary`;default:return`bg-outline`}}function Zs(){return Vs({queryKey:[`daemon-stats`],queryFn:({signal:e})=>$i(`/stats`,{signal:e}),refetchInterval:Hs.STATS,pollCategory:`standard`})}var Qs=500,$s=3e4;function ec(){let[e,t]=(0,W.useState)(!1),n=(0,W.useRef)(null);return{restart:(0,W.useCallback)(async(e=!1)=>{t(!0);try{let r=await sa(`/restart`,{force:e});if(r.status===`busy`)return t(!1),r;let i=Date.now()+$s;n.current=new AbortController,await new Promise((e,t)=>{let r=async()=>{if(Date.now()>i){t(Error(`Restart timeout`));return}try{if((await fetch(Mi(`/health`),{signal:n.current.signal})).ok){e();return}setTimeout(r,Qs)}catch{setTimeout(r,Qs)}};setTimeout(r,Qs)}),window.location.reload()}catch(e){throw t(!1),e}},[]),isRestarting:e}}function tc(){return ot({queryKey:[`groves`],queryFn:({signal:e})=>$i(`/groves`,{signal:e}),staleTime:5e3})}function nc(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=nc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function rc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=nc(e))&&(r&&(r+=` `),r+=t);return r}var ic=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ac=rc,oc=(e,t)=>n=>{if(t?.variants==null)return ac(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ic(t)||ic(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ac(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},sc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},cc=(e,t)=>({classGroupId:e,validator:t}),lc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),uc=`-`,dc=[],fc=`arbitrary..`,pc=e=>{let t=gc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return hc(e);let n=e.split(uc);return mc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?sc(i,t):t:i||dc}return n[e]||dc}}},mc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=mc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(uc):e.slice(t).join(uc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},hc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?fc+r:void 0})(),gc=e=>{let{theme:t,classGroups:n}=e;return _c(n,t)},_c=(e,t)=>{let n=lc();for(let r in e){let i=e[r];vc(i,n,r,t)}return n},vc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];yc(i,t,n,r)}},yc=(e,t,n,r)=>{if(typeof e==`string`){bc(e,t,n);return}if(typeof e==`function`){xc(e,t,n,r);return}Sc(e,t,n,r)},bc=(e,t,n)=>{let r=e===``?t:Cc(t,e);r.classGroupId=n},xc=(e,t,n,r)=>{if(wc(e)){vc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(cc(n,e))},Sc=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];vc(o,Cc(t,a),n,r)}},Cc=(e,t)=>{let n=e,r=t.split(uc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=lc(),n.nextPart.set(t,i)),n=i}return n},wc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Tc=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ec=`!`,Dc=`:`,Oc=[],kc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ac=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Dc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ec)?(c=s.slice(0,-1),l=!0):s.startsWith(Ec)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return kc(t,l,c,u)};if(t){let e=t+Dc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):kc(Oc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},jc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Mc=e=>({cache:Tc(e.cacheSize),parseClassName:Ac(e),sortModifiers:jc(e),postfixLookupClassGroupIds:Nc(e),...pc(e)}),Nc=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Pc=/\s+/,Fc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Pc),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ec:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ic=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Lc(n))&&(i&&(i+=` `),i+=r);return i},Lc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Lc(e[r]))&&(n&&(n+=` `),n+=t);return n},Rc=(e,...t)=>{let n,r,i,a,o=o=>(n=Mc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Fc(e,n);return i(e,a),a};return a=o,(...e)=>a(Ic(...e))},zc=[],Bc=e=>{let t=t=>t[e]||zc;return t.isThemeGetter=!0,t},Vc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Uc=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yc=e=>Uc.test(e),Xc=e=>!!e&&!Number.isNaN(Number(e)),Zc=e=>!!e&&Number.isInteger(Number(e)),Qc=e=>e.endsWith(`%`)&&Xc(e.slice(0,-1)),$c=e=>Wc.test(e),el=()=>!0,tl=e=>Gc.test(e)&&!Kc.test(e),nl=()=>!1,rl=e=>qc.test(e),il=e=>Jc.test(e),al=e=>!q(e)&&!hl(e),ol=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),sl=e=>Cl(e,Dl,nl),q=e=>Vc.test(e),cl=e=>Cl(e,Ol,tl),ll=e=>Cl(e,kl,Xc),ul=e=>Cl(e,jl,el),dl=e=>Cl(e,Al,nl),fl=e=>Cl(e,Tl,nl),pl=e=>Cl(e,El,il),ml=e=>Cl(e,Ml,rl),hl=e=>Hc.test(e),gl=e=>wl(e,Ol),_l=e=>wl(e,Al),vl=e=>wl(e,Tl),yl=e=>wl(e,Dl),bl=e=>wl(e,El),xl=e=>wl(e,Ml,!0),Sl=e=>wl(e,jl,!0),Cl=(e,t,n)=>{let r=Vc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wl=(e,t,n=!1)=>{let r=Hc.exec(e);return r?r[1]?t(r[1]):n:!1},Tl=e=>e===`position`||e===`percentage`,El=e=>e===`image`||e===`url`,Dl=e=>e===`length`||e===`size`||e===`bg-size`,Ol=e=>e===`length`,kl=e=>e===`number`,Al=e=>e===`family-name`,jl=e=>e===`number`||e===`weight`,Ml=e=>e===`shadow`,Nl=Rc(()=>{let e=Bc(`color`),t=Bc(`font`),n=Bc(`text`),r=Bc(`font-weight`),i=Bc(`tracking`),a=Bc(`leading`),o=Bc(`breakpoint`),s=Bc(`container`),c=Bc(`spacing`),l=Bc(`radius`),u=Bc(`shadow`),d=Bc(`inset-shadow`),f=Bc(`text-shadow`),p=Bc(`drop-shadow`),m=Bc(`blur`),h=Bc(`perspective`),g=Bc(`aspect`),_=Bc(`ease`),v=Bc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),hl,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[hl,q,c],T=()=>[Yc,`full`,`auto`,...w()],E=()=>[Zc,`none`,`subgrid`,hl,q],D=()=>[`auto`,{span:[`full`,Zc,hl,q]},Zc,hl,q],O=()=>[Zc,`auto`,hl,q],k=()=>[`auto`,`min`,`max`,`fr`,hl,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Yc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Yc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Yc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,hl,q],L=()=>[...b(),vl,fl,{position:[hl,q]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,yl,sl,{size:[hl,q]}],z=()=>[Qc,gl,cl],B=()=>[``,`none`,`full`,l,hl,q],V=()=>[``,Xc,gl,cl],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[Xc,Qc,vl,fl],U=()=>[``,`none`,m,hl,q],re=()=>[`none`,Xc,hl,q],ie=()=>[`none`,Xc,hl,q],ae=()=>[Xc,hl,q],oe=()=>[Yc,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$c],breakpoint:[$c],color:[el],container:[$c],"drop-shadow":[$c],ease:[`in`,`out`,`in-out`],font:[al],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$c],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$c],shadow:[$c],spacing:[`px`,Xc],text:[$c],"text-shadow":[$c],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Yc,q,hl,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,hl,q]}],"container-named":[ol],columns:[{columns:[Xc,q,hl,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Zc,`auto`,hl,q]}],basis:[{basis:[Yc,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Xc,Yc,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,Xc,hl,q]}],shrink:[{shrink:[``,Xc,hl,q]}],order:[{order:[Zc,`first`,`last`,`none`,hl,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,gl,cl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Sl,ul]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qc,q]}],"font-family":[{font:[_l,dl,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,hl,q]}],"line-clamp":[{"line-clamp":[Xc,`none`,hl,ll]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,hl,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,hl,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[Xc,`from-font`,`auto`,hl,cl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Xc,`auto`,hl,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Zc,hl,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,hl,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,hl,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Zc,hl,q],radial:[``,hl,q],conic:[Zc,hl,q]},bl,pl]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Xc,hl,q]}],"outline-w":[{outline:[``,Xc,gl,cl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,xl,ml]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,xl,ml]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Xc,cl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,xl,ml]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Xc,hl,q]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Xc]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[hl,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Xc]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,hl,q]}],filter:[{filter:[``,`none`,hl,q]}],blur:[{blur:U()}],brightness:[{brightness:[Xc,hl,q]}],contrast:[{contrast:[Xc,hl,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xl,ml]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Xc,hl,q]}],"hue-rotate":[{"hue-rotate":[Xc,hl,q]}],invert:[{invert:[``,Xc,hl,q]}],saturate:[{saturate:[Xc,hl,q]}],sepia:[{sepia:[``,Xc,hl,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,hl,q]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[Xc,hl,q]}],"backdrop-contrast":[{"backdrop-contrast":[Xc,hl,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Xc,hl,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xc,hl,q]}],"backdrop-invert":[{"backdrop-invert":[``,Xc,hl,q]}],"backdrop-opacity":[{"backdrop-opacity":[Xc,hl,q]}],"backdrop-saturate":[{"backdrop-saturate":[Xc,hl,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Xc,hl,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,hl,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Xc,`initial`,hl,q]}],ease:[{ease:[`linear`,`initial`,_,hl,q]}],delay:[{delay:[Xc,hl,q]}],animate:[{animate:[`none`,v,hl,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,hl,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[hl,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Zc,hl,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,hl,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,hl,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Xc,gl,cl,ll]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return Nl(rc(e))}var Pl=oc(`inline-flex items-center justify-center whitespace-nowrap rounded-md font-sans text-sm font-medium transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-xs hover:shadow-[0_0_0_1px_rgba(171,207,184,0.4)]`,destructive:`bg-gradient-to-br from-tertiary to-tertiary-container text-on-surface shadow-xs hover:shadow-[0_0_0_1px_rgba(255,180,161,0.4)]`,outline:`border border-[var(--ghost-border)] bg-transparent shadow-xs hover:bg-surface-container-high hover:text-on-surface`,secondary:`border border-outline-variant/20 bg-transparent hover:bg-surface-container-high text-on-surface`,ghost:`hover:bg-surface-container-high text-on-surface-variant hover:text-on-surface`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Y=(0,W.forwardRef)(({className:e,variant:t,size:n,...r},i)=>(0,G.jsx)(`button`,{className:J(Pl({variant:t,size:n,className:e})),ref:i,...r}));Y.displayName=`Button`,typeof window<`u`&&window.document&&window.document.createElement;function Fl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Il(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ll(...e){return t=>{let n=!1,r=e.map(e=>{let r=Il(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Il(e[t],null)}}}}function Rl(...e){return W.useCallback(Ll(...e),e)}function zl(e,t){let n=W.createContext(t),r=e=>{let{children:t,...r}=e,i=W.useMemo(()=>r,Object.values(r));return(0,G.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=W.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Bl(e,t=[]){let n=[];function r(t,r){let i=W.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=W.useMemo(()=>o,Object.values(o));return(0,G.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=W.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>W.createContext(e));return function(n){let r=n?.[e]||t;return W.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Vl(i,...t)]}function Vl(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Hl=globalThis?.document?W.useLayoutEffect:()=>{},Ul=W.useId||(()=>void 0),Wl=0;function Gl(e){let[t,n]=W.useState(Ul());return Hl(()=>{e||n(e=>e??String(Wl++))},[e]),e||(t?`radix-${t}`:``)}var Kl=W.useInsertionEffect||Hl;function ql({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Jl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=W.useRef(e!==void 0);W.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,W.useCallback(t=>{if(s){let n=Yl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Jl({defaultProp:e,onChange:t}){let[n,r]=W.useState(e),i=W.useRef(n),a=W.useRef(t);return Kl(()=>{a.current=t},[t]),W.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Yl(e){return typeof e==`function`}var Xl=l(h(),1);function Zl(e){let t=Ql(e),n=W.forwardRef((e,n)=>{let{children:r,...i}=e,a=W.Children.toArray(r),o=a.find(eu);if(o){let e=o.props.children,r=a.map(t=>t===o?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return(0,G.jsx)(t,{...i,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return(0,G.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ql(e){let t=W.forwardRef((e,t)=>{let{children:n,...r}=e;if(W.isValidElement(n)){let e=nu(n),i=tu(r,n.props);return n.type!==W.Fragment&&(i.ref=t?Ll(t,e):e),W.cloneElement(n,i)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $l=Symbol(`radix.slottable`);function eu(e){return W.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$l}function tu(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function nu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ru=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zl(`Primitive.${t}`),r=W.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,G.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iu(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}function au(e){let t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...e)=>t.current?.(...e),[])}function ou(e,t=globalThis?.document){let n=au(e);W.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var su=`DismissableLayer`,cu=`dismissableLayer.update`,lu=`dismissableLayer.pointerDownOutside`,uu=`dismissableLayer.focusOutside`,du,fu=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=W.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=W.useContext(fu),[u,d]=W.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=W.useState({}),m=Rl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=gu(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=_u(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return ou(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),W.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(du=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vu(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=du)}},[u,f,n,l]),W.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vu())},[u,l]),W.useEffect(()=>{let e=()=>p({});return document.addEventListener(cu,e),()=>document.removeEventListener(cu,e)},[]),(0,G.jsx)(ru.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Fl(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Fl(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Fl(e.onPointerDownCapture,x.onPointerDownCapture)})});pu.displayName=su;var mu=`DismissableLayerBranch`,hu=W.forwardRef((e,t)=>{let n=W.useContext(fu),r=W.useRef(null),i=Rl(t,r);return W.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,G.jsx)(ru.div,{...e,ref:i})});hu.displayName=mu;function gu(e,t=globalThis?.document){let n=au(e),r=W.useRef(!1),i=W.useRef(()=>{});return W.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){yu(lu,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _u(e,t=globalThis?.document){let n=au(e),r=W.useRef(!1);return W.useEffect(()=>{let e=e=>{e.target&&!r.current&&yu(uu,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vu(){let e=new CustomEvent(cu);document.dispatchEvent(e)}function yu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?iu(i,a):i.dispatchEvent(a)}var bu=`focusScope.autoFocusOnMount`,xu=`focusScope.autoFocusOnUnmount`,Su={bubbles:!1,cancelable:!0},Cu=`FocusScope`,wu=W.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=W.useState(null),l=au(i),u=au(a),d=W.useRef(null),f=Rl(t,e=>c(e)),p=W.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;W.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ju(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ju(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ju(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),W.useEffect(()=>{if(s){Mu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(bu,Su);s.addEventListener(bu,l),s.dispatchEvent(t),t.defaultPrevented||(Tu(Fu(Du(s)),{select:!0}),document.activeElement===e&&ju(s))}return()=>{s.removeEventListener(bu,l),setTimeout(()=>{let t=new CustomEvent(xu,Su);s.addEventListener(xu,u),s.dispatchEvent(t),t.defaultPrevented||ju(e??document.body,{select:!0}),s.removeEventListener(xu,u),Mu.remove(p)},0)}}},[s,l,u,p]);let m=W.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Eu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ju(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ju(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,G.jsx)(ru.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});wu.displayName=Cu;function Tu(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ju(r,{select:t}),document.activeElement!==n)return}function Eu(e){let t=Du(e);return[Ou(t,e),Ou(t.reverse(),e)]}function Du(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ou(e,t){for(let n of e)if(!ku(n,{upTo:t}))return n}function ku(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Au(e){return e instanceof HTMLInputElement&&`select`in e}function ju(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Au(e)&&t&&e.select()}}var Mu=Nu();function Nu(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Pu(e,t),e.unshift(t)},remove(t){e=Pu(e,t),e[0]?.resume()}}}function Pu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fu(e){return e.filter(e=>e.tagName!==`A`)}var Iu=`Portal`,Lu=W.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=W.useState(!1);Hl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Xl.createPortal((0,G.jsx)(ru.div,{...r,ref:t}),o):null});Lu.displayName=Iu;function Ru(e,t){return W.useReducer((e,n)=>t[e][n]??e,e)}var zu=e=>{let{present:t,children:n}=e,r=Bu(t),i=typeof n==`function`?n({present:r.isPresent}):W.Children.only(n),a=Rl(r.ref,Hu(i));return typeof n==`function`||r.isPresent?W.cloneElement(i,{ref:a}):null};zu.displayName=`Presence`;function Bu(e){let[t,n]=W.useState(),r=W.useRef(null),i=W.useRef(e),a=W.useRef(`none`),[o,s]=Ru(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return W.useEffect(()=>{let e=Vu(r.current);a.current=o===`mounted`?e:`none`},[o]),Hl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Vu(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Hl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Vu(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Vu(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:W.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Vu(e){return e?.animationName||`none`}function Hu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uu=0;function Wu(){W.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Gu()),document.body.insertAdjacentElement(`beforeend`,e[1]??Gu()),Uu++,()=>{Uu===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Uu--}},[])}function Gu(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ku.apply(this,arguments)};function qu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ju(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Yu=`right-scroll-bar-position`,Xu=`width-before-scroll-bar`,Zu=`with-scroll-bars-hidden`,Qu=`--removed-body-scroll-bar-size`;function $u(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ed(e,t){var n=(0,W.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var td=typeof window<`u`?W.useLayoutEffect:W.useEffect,nd=new WeakMap;function rd(e,t){var n=ed(t||null,function(t){return e.forEach(function(e){return $u(e,t)})});return td(function(){var t=nd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$u(e,null)}),i.forEach(function(e){r.has(e)||$u(e,a)})}nd.set(n,e)},[e]),n}function id(e){return e}function ad(e,t){t===void 0&&(t=id);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function od(e){e===void 0&&(e={});var t=ad(null);return t.options=Ku({async:!0,ssr:!1},e),t}var sd=function(e){var t=e.sideCar,n=qu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return W.createElement(r,Ku({},n))};sd.isSideCarExport=!0;function cd(e,t){return e.useMedium(t),sd}var ld=od(),ud=function(){},dd=W.forwardRef(function(e,t){var n=W.useRef(null),r=W.useState({onScrollCapture:ud,onWheelCapture:ud,onTouchMoveCapture:ud}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=qu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=rd([n,t]),C=Ku(Ku({},b),i);return W.createElement(W.Fragment,null,u&&W.createElement(x,{sideCar:ld,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?W.cloneElement(W.Children.only(s),Ku(Ku({},C),{ref:S})):W.createElement(v,Ku({},C,{className:c,ref:S}),s))});dd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},dd.classNames={fullWidth:Xu,zeroRight:Yu};var fd,pd=function(){if(fd)return fd;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function md(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pd();return t&&e.setAttribute(`nonce`,t),e}function hd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gd(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _d=function(){var e=0,t=null;return{add:function(n){e==0&&(t=md())&&(hd(t,n),gd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vd=function(){var e=_d();return function(t,n){W.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yd=function(){var e=vd();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},bd={left:0,top:0,right:0,gap:0},xd=function(e){return parseInt(e||``,10)||0},Sd=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[xd(n),xd(r),xd(i)]},Cd=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return bd;var t=Sd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wd=yd(),Td=`data-scroll-locked`,Ed=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=An(),d;if(t){let e=typeof t==`string`?xt(t):t;ht(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):wt(e,{pathname:p});gt(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),gt(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=qn(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:$t([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:$t([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?W.createElement(bn.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Vn(){let e=nr(),t=on(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=W.createElement(W.Fragment,null,W.createElement(`p`,null,`💿 Hey developer 👋`),W.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,W.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,W.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),W.createElement(W.Fragment,null,W.createElement(`h2`,null,`Unexpected Application Error!`),W.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?W.createElement(`pre`,{style:i},n):null,o)}var Hn=W.createElement(Vn,null),Un=class extends W.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Dn(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:W.createElement(xn.Provider,{value:this.props.routeContext},W.createElement(Sn.Provider,{value:e,children:this.props.component}));return this.context?W.createElement(Gn,{error:e},t):t}};Un.contextType=mn;var Wn=new WeakMap;function Gn({children:e,error:t}){let{basename:n}=W.useContext(yn);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=En(t.digest);if(e){let r=Wn.get(t);if(r)throw r;let i=ln(e.location,n);if(cn&&!Wn.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Wn.set(t,n),n}return W.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function Kn({routeContext:e,match:t,children:n}){let r=W.useContext(fn);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),W.createElement(xn.Provider,{value:e},n)}function qn(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);ht(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:sn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Hn,o&&(s<0&&c===0?(ar(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?W.createElement(n.route.Component,null):n.route.element?n.route.element:e,W.createElement(Kn,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?W.createElement(Un,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Yn(e){let t=W.useContext(fn);return ht(t,Jn(e)),t}function Xn(e){let t=W.useContext(pn);return ht(t,Jn(e)),t}function Zn(e){let t=W.useContext(xn);return ht(t,Jn(e)),t}function Qn(e){let t=Zn(e),n=t.matches[t.matches.length-1];return ht(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function $n(){return Qn(`useRouteId`)}function er(){let e=Xn(`useNavigation`);return W.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function tr(){let{matches:e,loaderData:t}=Xn(`useMatches`);return W.useMemo(()=>e.map(e=>Et(e,t)),[e,t])}function nr(){let e=W.useContext(Sn),t=Xn(`useRouteError`),n=Qn(`useRouteError`);return e===void 0?t.errors?.[n]:e}function rr(){let{router:e}=Yn(`useNavigate`),t=Qn(`useNavigate`),n=W.useRef(!1);return Mn(()=>{n.current=!0}),W.useCallback(async(r,i={})=>{gt(n.current,jn),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ir={};function ar(e,t,n){!t&&!ir[e]&&(ir[e]=!0,gt(!1,n))}W.memo(or);function or({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Bn(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function sr({to:e,replace:t,state:n,relative:r}){ht(kn(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=W.useContext(yn);gt(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=W.useContext(xn),{pathname:o}=An(),s=Nn(),c=Zt(e,Xt(a),o,r===`path`),l=JSON.stringify(c);return W.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function cr(e){return In(e.context)}function lr(e){ht(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function ur({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){ht(!kn(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=W.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=xt(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=W.useMemo(()=>{let e=Wt(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return gt(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:W.createElement(yn.Provider,{value:c},W.createElement(bn.Provider,{children:t,value:h}))}function dr({children:e,location:t}){return zn(fr(e),t)}W.Component;function fr(e,t=[]){let n=[];return W.Children.forEach(e,(e,r)=>{if(!W.isValidElement(e))return;let i=[...t,r];if(e.type===W.Fragment){n.push.apply(n,fr(e.props.children,i));return}ht(e.type===lr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ht(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=fr(e.props.children,i)),n.push(a)}),n}var pr=`get`,mr=`application/x-www-form-urlencoded`;function hr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function gr(e){return hr(e)&&e.tagName.toLowerCase()===`button`}function _r(e){return hr(e)&&e.tagName.toLowerCase()===`form`}function vr(e){return hr(e)&&e.tagName.toLowerCase()===`input`}function yr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function br(e,t){return e.button===0&&(!t||t===`_self`)&&!yr(e)}function xr(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Sr(e,t){let n=xr(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Cr=null;function wr(){if(Cr===null)try{new FormData(document.createElement(`form`),0),Cr=!1}catch{Cr=!0}return Cr}var Tr=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Er(e){return e!=null&&!Tr.has(e)?(gt(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mr}"`),null):e}function Dr(e,t){let n,r,i,a,o;if(_r(e)){let o=e.getAttribute(`action`);r=o?Wt(o,t):null,n=e.getAttribute(`method`)||pr,i=Er(e.getAttribute(`enctype`))||mr,a=new FormData(e)}else if(gr(e)||vr(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Wt(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||pr,i=Er(e.getAttribute(`formenctype`))||Er(o.getAttribute(`enctype`))||mr,a=new FormData(o,e),!wr()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(hr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=pr,r=null,i=mr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Or={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},kr=/[&><\u2028\u2029]/g;function Ar(e){return e.replace(kr,e=>Or[e])}function jr(e,t){if(e===!1||e==null)throw Error(t)}function Mr(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&Wt(i.pathname,t)===`/`?i.pathname=`${en(t)}/_root.${r}`:i.pathname=`${en(i.pathname)}.${r}`,i}async function Nr(e,t){if(e.id in t)return t[e.id];try{let n=await dt(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Pr(e){return e!=null&&typeof e.page==`string`}function Fr(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Ir(e,t,n){return Vr((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Nr(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Fr).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function Lr(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Rr(e,t,{includeHydrateFallback:n}={}){return zr(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function zr(e){return[...new Set(e)]}function Br(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Vr(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Pr(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Br(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Hr(){let e=W.useContext(fn);return jr(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Ur(){let e=W.useContext(pn);return jr(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Wr=W.createContext(void 0);Wr.displayName=`FrameworkContext`;function Gr(){let e=W.useContext(Wr);return jr(e,`You must render this element inside a <HydratedRouter> element`),e}function Kr(e,t){let n=W.useContext(Wr),[r,i]=W.useState(!1),[a,o]=W.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=W.useRef(null);W.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),W.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:qr(s,p),onBlur:qr(c,m),onMouseEnter:qr(l,p),onMouseLeave:qr(u,m),onTouchStart:qr(d,p)}]:[a,f,{}]:[!1,f,{}]}function qr(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Jr({page:e,...t}){let n=hn(),{router:r}=Hr(),i=W.useMemo(()=>wt(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?W.createElement(Xr,{page:e,matches:i,...t}):W.createElement(Zr,{page:e,matches:i,...t}):null}function Yr(e){let{manifest:t,routeModules:n}=Gr(),[r,i]=W.useState([]);return W.useEffect(()=>{let r=!1;return Ir(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Xr({page:e,matches:t,...n}){let r=An(),{future:i}=Gr(),{basename:a}=Hr(),o=W.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=Mr(e,a,i.unstable_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.unstable_trailingSlashAwareDataRequests,e,r,t]);return W.createElement(W.Fragment,null,o.map(e=>W.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Zr({page:e,matches:t,...n}){let r=An(),{future:i,manifest:a,routeModules:o}=Gr(),{basename:s}=Hr(),{loaderData:c,matches:l}=Ur(),u=W.useMemo(()=>Lr(e,t,l,a,r,`data`),[e,t,l,a,r]),d=W.useMemo(()=>Lr(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=W.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=Mr(e,s,i.unstable_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.unstable_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=W.useMemo(()=>Rr(d,a),[d,a]),m=Yr(d);return W.createElement(W.Fragment,null,f.map(e=>W.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>W.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>W.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Qr(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}W.Component;var $r=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{$r&&(window.__reactRouterVersion=`7.15.1`)}catch{}function ei({basename:e,children:t,useTransitions:n,window:r}){let i=W.useRef();i.current??=mt({window:r,v5Compat:!0});let a=i.current,[o,s]=W.useState({action:a.action,location:a.location}),c=W.useCallback(e=>{n===!1?s(e):W.startTransition(()=>s(e))},[n]);return W.useLayoutEffect(()=>a.listen(c),[a,c]),W.createElement(ur,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function ti({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=W.useState({action:n.action,location:n.location}),o=W.useCallback(e=>{r===!1?a(e):W.startTransition(()=>a(e))},[r]);return W.useLayoutEffect(()=>n.listen(o),[n,o]),W.createElement(ur,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}ti.displayName=`unstable_HistoryRouter`;var ni=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ri=W.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=W.useContext(yn),v=typeof l==`string`&&ni.test(l),y=ln(l,h);l=y.to;let b=On(l,{relative:r}),x=An(),S=null;if(o){let e=Zt(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:$t([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=Kr(n,p),E=ui(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=W.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Qr(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?W.createElement(W.Fragment,null,k,W.createElement(Jr,{page:b})):k});ri.displayName=`Link`;var ii=W.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Rn(a,{relative:c.relative}),d=An(),f=W.useContext(pn),{navigator:p,basename:m}=W.useContext(yn),h=f!=null&&xi(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Wt(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return W.createElement(ri,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});ii.displayName=`NavLink`;var ai=W.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=pr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=W.useContext(yn),g=mi(),_=hi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&ni.test(s);return W.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?W.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});ai.displayName=`Form`;function oi({getKey:e,storageKey:t,...n}){let r=W.useContext(Wr),{basename:i}=W.useContext(yn),a=An(),o=tr();yi({getKey:e,storageKey:t});let s=W.useMemo(()=>{if(!r||!e)return null;let t=vi(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return W.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${Ar(JSON.stringify(t||gi))}, ${Ar(JSON.stringify(s))})`}})}oi.displayName=`ScrollRestoration`;function si(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ci(e){let t=W.useContext(fn);return ht(t,si(e)),t}function li(e){let t=W.useContext(pn);return ht(t,si(e)),t}function ui(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Nn(),d=An(),f=Rn(e,{relative:o});return W.useCallback(p=>{if(br(p,t)){p.preventDefault();let t=n===void 0?bt(d)===bt(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?W.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function di(e){gt(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=W.useRef(xr(e)),n=W.useRef(!1),r=An(),i=W.useMemo(()=>Sr(r.search,n.current?null:t.current),[r.search]),a=Nn();return[i,W.useCallback((e,t)=>{let r=xr(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var fi=0,pi=()=>`__${String(++fi)}__`;function mi(){let{router:e}=ci(`useSubmit`),{basename:t}=W.useContext(yn),n=$n(),r=e.fetch,i=e.navigate;return W.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Dr(e,t);a.navigate===!1?await r(a.fetcherKey||pi(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function hi(e,{relative:t}={}){let{basename:n}=W.useContext(yn),r=W.useContext(xn);ht(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Rn(e||`.`,{relative:t})},o=An();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:$t([n,a.pathname])),bt(a)}var gi=`react-router-scroll-positions`,_i={};function vi(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:Wt(e.pathname,n)||e.pathname},t)),i??=e.key,i}function yi({getKey:e,storageKey:t}={}){let{router:n}=ci(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=li(`useScrollRestoration`),{basename:a}=W.useContext(yn),o=An(),s=tr(),c=er();W.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),bi(W.useCallback(()=>{if(c.state===`idle`){let t=vi(o,s,a,e);_i[t]=window.scrollY}try{sessionStorage.setItem(t||gi,JSON.stringify(_i))}catch(e){gt(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(W.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||gi);e&&(_i=JSON.parse(e))}catch{}},[t]),W.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(_i,()=>window.scrollY,e?(t,n)=>vi(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),W.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{gt(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function bi(e,t){let{capture:n}=t||{};W.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function xi(e,{relative:t}={}){let n=W.useContext(gn);ht(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ci(`useViewTransitionState`),i=Rn(e,{relative:t});if(!n.isTransitioning)return!1;let a=Wt(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Wt(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Vt(i.pathname,o)!=null||Vt(i.pathname,a)!=null}var Si=l(_(),1),Ci=6e4,wi=3e5,Ti=200,Ei={active:1,idle:2,deep_sleep:5,hidden:10},Di=[`mousemove`,`mousedown`,`keydown`,`scroll`,`touchstart`],Oi=(0,W.createContext)(void 0);function ki({children:e}){let[t,n]=(0,W.useState)(`active`),r=(0,W.useRef)(null),i=(0,W.useRef)(null),a=(0,W.useRef)(Date.now()),o=(0,W.useCallback)(()=>{r.current&&=(clearTimeout(r.current),null),i.current&&=(clearTimeout(i.current),null)},[]),s=(0,W.useCallback)(()=>{o(),r.current=setTimeout(()=>{n(`idle`),i.current=setTimeout(()=>{n(`deep_sleep`)},wi-Ci)},Ci)},[o]),c=(0,W.useCallback)(()=>{let e=Date.now();e-a.current<Ti||(a.current=e,n(`active`),s())},[s]),l=(0,W.useCallback)(()=>{document.hidden?(o(),n(`hidden`)):(n(`active`),a.current=Date.now(),s())},[o,s]);return(0,W.useEffect)(()=>{s();for(let e of Di)document.addEventListener(e,c,{passive:!0});return document.addEventListener(`visibilitychange`,l),()=>{o();for(let e of Di)document.removeEventListener(e,c);document.removeEventListener(`visibilitychange`,l)}},[c,l,s,o]),(0,G.jsx)(Oi.Provider,{value:{powerState:t},children:e})}function Ai(){let e=(0,W.useContext)(Oi);if(!e)throw Error(`usePowerState must be used within a PowerProvider`);return e.powerState}function ji(){return``}function Mi(e){return e.startsWith(`/`)?e:`/${e}`}var Ni=`myco.lastSelectedProject`,Pi=null;function Fi(e){Pi=e}function Ii(){return Pi}function Li(){let e=Ii();return e?{"x-myco-grove-id":e.grove.id,"x-myco-project-id":e.project.project_id}:{}}function Ri(e,t,n){if(!t||!n)return null;let r=e.find(e=>e.slug===t||e.id===t);if(!r)return null;let i=r.projects.find(e=>e.slug===n||e.project_id===n);return i?{grove:r,project:i}:null}function zi(e){let t=e.find(e=>e.is_default&&e.projects.length>0)??e.find(e=>e.projects.length>0);return t?{grove:t,project:t.projects[0]}:null}function Bi(e,t=``){let n=t&&t!==`/`?`/${t.replace(/^\/+/,``)}`:``;return`/g/${e.grove.slug}/p/${e.project.slug}${n}`}function Vi(e){let t=e.match(/^\/g\/[^/]+\/p\/[^/]+(?<suffix>\/.*)?$/)?.groups?.suffix??`/`;return/^\/sessions\/[^/]+/.test(t)?`/sessions`:t}function Hi(e){return e?`${e.grove.id}:${e.project.project_id}`:`none`}function Ui(){try{let e=window.localStorage.getItem(Ni);if(!e)return null;let t=JSON.parse(e);return typeof t.groveId!=`string`||typeof t.projectId!=`string`?null:{groveId:t.groveId,projectId:t.projectId}}catch{return null}}function Wi(e){try{window.localStorage.setItem(Ni,JSON.stringify({groveId:e.grove.id,projectId:e.project.project_id}))}catch{}}function Gi(e){let t=Ui();if(!t)return null;let n=e.find(e=>e.id===t.groveId),r=n?.projects.find(e=>e.project_id===t.projectId);return n&&r?{grove:n,project:r}:null}function Ki(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?`M`:(t.length===1?t[0].slice(0,2):`${t[0][0]}${t[1][0]}`).toUpperCase()}function qi(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*31+e.charCodeAt(n)>>>0;return`hsl(${t%360} 58% 48%)`}var Ji=`/api`,Yi=[`/groves`,`/version`,`/logs`,`/logs/search`,`/logs/stream`],Xi=`0.27.19`,Zi=!1;function Qi(e){if(Zi)return;let t=e.headers.get(`X-Myco-Api-Version`);t&&t!==Xi&&(Zi=!0,console.warn(`[myco] UI version ${Xi} is talking to daemon ${t} — reload to pick up the new UI build.`))}async function $i(e,t){let n=t?.method?.toUpperCase(),r=n===`POST`||n===`PUT`,i=aa(e,t?.headers,r),a=await fetch(Mi(`${Ji}${e}`),{...t,headers:i});if(Qi(a),!a.ok){let e=await a.json().catch(()=>({}));throw ra(a.status,e),new ma(a.status,e)}return a.json()}var ea=`myco:auth-reload-ts`,ta=1e4,na=()=>{window.location.reload()};function ra(e,t){if(e===401&&(typeof t==`object`&&t&&`error`in t?t.error:null)===`unauthorized_context_switch`&&!(typeof window>`u`||window.sessionStorage===void 0)){try{let e=Number(window.sessionStorage.getItem(ea)??`0`);if(Number.isFinite(e)&&Date.now()-e<ta)return;window.sessionStorage.setItem(ea,String(Date.now()))}catch{return}na()}}function ia(){if(typeof window>`u`)return;let e=window.__MYCO_AUTH__;return typeof e==`string`&&e.length>0?e:void 0}function aa(e,t,n){let r=new Headers;if(!oa(e)){for(let[e,t]of Object.entries(Li()))r.set(e,t);let e=ia();e&&r.set(`x-myco-auth`,e)}return n&&r.set(`Content-Type`,`application/json`),t&&new Headers(t).forEach((e,t)=>r.set(t,e)),Array.from(r.keys()).length>0?r:void 0}function oa(e){return Yi.some(t=>e===t||e.startsWith(`${t}/`))}async function sa(e,t){return $i(e,{method:`POST`,body:t?JSON.stringify(t):void 0})}async function ca(e,t){return $i(e,{method:`PUT`,body:JSON.stringify(t)})}async function la(e){return $i(e,{method:`DELETE`})}function ua(e){return $i(`/config/merged`,{signal:e})}function da(e){return $i(`/config/local`,{signal:e})}function fa(e,t,n){let r={scope:e,patch:t};return n&&n.length>0&&(r.clear=n),ca(`/config/scoped`,r)}function pa(e){return ca(`/config/scoped`,{scope:`local`,patch:{},clear:e})}var ma=class extends Error{status;body;constructor(e,t){let n=typeof t==`object`&&t&&`error`in t?String(t.error):null;super(n?`${n} (API ${e})`:`API error ${e}`),this.status=e,this.body=t}};function ha(e){return Array.isArray(e)?e:e?e.replace(/\[(\d+)\]/g,`.$1`).split(`.`).filter(e=>e.length>0):[]}function ga(e,t){let n=ha(t),r=e;for(let e of n){if(r==null)return;if(Array.isArray(r)){let t=Number(e);if(!Number.isInteger(t))return;r=r[t];continue}if(typeof r!=`object`)return;r=r[e]}return r}function _a(e,t,n){let r=ha(t);if(r.length===0)return;let i=e;for(let e=0;e<r.length-1;e+=1){let t=r[e],n=i[t];(typeof n!=`object`||!n||Array.isArray(n))&&(i[t]={}),i=i[t]}i[r[r.length-1]]=n}var va=(0,W.createContext)(null);function ya({selection:e,children:t}){let n=We(),r=Hi(e),[i,a]=(0,W.useState)(null);return(0,W.useLayoutEffect)(()=>{Fi(e),Wi(e),n.removeQueries({predicate:e=>e.queryKey[0]!==`groves`}),a(r)},[r,n]),i===r?(0,G.jsx)(va.Provider,{value:e,children:t}):(0,G.jsx)(`div`,{className:`flex h-64 items-center justify-center text-sm text-on-surface-variant`,children:`Switching project...`})}function ba({children:e}){return(0,W.useLayoutEffect)(()=>{Fi(null)},[]),(0,G.jsx)(G.Fragment,{children:e})}function xa(){return(0,W.useContext)(va)}function Sa(e=``){let t=xa();return t?Bi(t,e):e||`/`}function Ca(){let e=xa();return(0,W.useCallback)((t=``)=>e?Bi(e,t):t||`/`,[e])}function wa(e,t){if(!e)return t;let[n,...r]=t;return[n,{projectSelection:Hi(e)},...r]}function Ta(e){return wa(xa(),e)}var Ea=[`grove-config`];function Da(e){return[...Ea,e??`none`]}function Oa(){let e=xa()?.grove.id??null;return ot({queryKey:Da(e),queryFn:({signal:e})=>$i(`/grove-config`,{signal:e}),enabled:e!==null})}function ka(){let e=We(),t=xa()?.grove.id??null;return st({mutationFn:e=>ca(`/grove-config`,{patch:e}),onSuccess:()=>{e.invalidateQueries({queryKey:Da(t)}),e.invalidateQueries({queryKey:[`config`,`merged`]})}})}var Aa=[`config`,`merged`],ja=[`config`,`local`],Ma=[`notifications`];function Na(){let e=We(),t=ka(),n=ot({queryKey:Aa,queryFn:({signal:e})=>ua(e)}),r=ot({queryKey:ja,queryFn:({signal:e})=>da(e)}),i=(0,W.useRef)(n.data);i.current=n.data;let a=(0,W.useRef)(r.data);a.current=r.data;let o=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:Ma})},[e]),s=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:ja}),e.invalidateQueries({queryKey:Aa}),o()},[o,e]),c=(0,W.useCallback)(()=>{e.invalidateQueries({queryKey:Aa}),o()},[o,e]),l=(0,W.useCallback)(e=>e===`local`?s():c(),[s,c]),u=(0,W.useCallback)(async(e,n,r)=>{let i={};_a(i,e,n),r===`grove`?(await t.mutateAsync(i),o()):(await fa(r,i),l(r))},[l,o,t]),d=(0,W.useCallback)(async(e,n,r)=>{let i={};for(let{path:t,value:n}of e)_a(i,t,n);n===`grove`?(await t.mutateAsync(i),o()):(await fa(n,i,r),l(n))},[l,o,t]),f=(0,W.useCallback)(async e=>{await pa([e]),s()},[s]),p=(0,W.useCallback)(async e=>{e.length!==0&&(await pa(e),s())},[s]),m=(0,W.useCallback)(async e=>{let t=ga(i.current??{},e),n={};_a(n,e,t),await fa(`project`,n),await pa([e]),s()},[s]),h=(0,W.useCallback)(e=>ga(a.current??{},e)!==void 0,[]);return{effective:n.data,local:r.data??{},isLoading:n.isLoading||r.isLoading,isLocalOverride:h,setField:u,setFields:d,resetField:f,resetFields:p,promoteField:m}}var Pa=`myco-appearance`,Fa={compact:.85,normal:1,comfy:1.15},Ia={default:{heading:`'Newsreader', Georgia, serif`,ui:`'Inter', system-ui, sans-serif`,data:`'JetBrains Mono', 'Fira Code', monospace`},"geist-mono":{heading:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`,ui:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`,data:`'Geist Mono', 'SF Mono', 'Fira Code', monospace`},system:{heading:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`,ui:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`,data:`ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace`},"sf-mono":{heading:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`,ui:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`,data:`'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace`},"fira-code":{heading:`'Fira Code', 'Fira Mono', ui-monospace, monospace`,ui:`'Fira Code', 'Fira Mono', ui-monospace, monospace`,data:`'Fira Code', 'Fira Mono', ui-monospace, monospace`},"jetbrains-mono":{heading:`'JetBrains Mono', ui-monospace, monospace`,ui:`'JetBrains Mono', ui-monospace, monospace`,data:`'JetBrains Mono', ui-monospace, monospace`}},La=`(prefers-color-scheme: light)`;function Ra(e){let t=document.documentElement;t.setAttribute(`data-theme`,e.theme);let n=e.mode===`system`?window.matchMedia(La).matches?`light`:`dark`:e.mode;t.classList.toggle(`light`,n===`light`);let r=Ia[e.font];t.style.setProperty(`--font-heading`,r.heading),t.style.setProperty(`--font-ui`,r.ui),t.style.setProperty(`--font-data`,r.data);let i=Fa[e.density];t.style.setProperty(`--density`,String(i)),t.style.fontSize=`calc(14px * ${i})`;let a=document.querySelector(`link[rel="icon"]`);if(a){let t=`/favicon-${e.theme}.svg`;a.href.endsWith(t)||(a.href=t)}}function za(e){try{localStorage.setItem(Pa,JSON.stringify(e))}catch{}}function Ba(){let e=null;try{e=localStorage.getItem(Pa)}catch{return}if(e)try{Ra(JSON.parse(e))}catch{try{localStorage.removeItem(Pa)}catch{}}}var Va=(0,W.createContext)(null),Ha={theme:`sage`,mode:`dark`,font:`default`,density:`normal`},Ua=`(prefers-color-scheme: light)`;function Wa({children:e}){let{effective:t,local:n,setField:r,resetField:i,promoteField:a}=Na(),o=(0,W.useMemo)(()=>t?.appearance??Ha,[t?.appearance]),s=(0,W.useMemo)(()=>n.appearance??{},[n.appearance]);(0,W.useEffect)(()=>{t?.appearance&&(Ra(o),za(o))},[o,t?.appearance]),(0,W.useEffect)(()=>{if(o.mode!==`system`)return;let e=window.matchMedia(Ua),t=()=>Ra(o);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[o]);let c=(0,W.useCallback)((e,t,n)=>r(`appearance.${e}`,t,n),[r]),l=(0,W.useCallback)(e=>i(`appearance.${e}`),[i]),u=(0,W.useCallback)(()=>a(`appearance`),[a]),d=(0,W.useCallback)(()=>i(`appearance`),[i]),f=(0,W.useMemo)(()=>({effective:o,local:s,set:c,resetKey:l,saveAllAsProject:u,resetAll:d}),[o,s,c,l,u,d]);return(0,G.jsx)(Va.Provider,{value:f,children:e})}function Ga(){let e=(0,W.useContext)(Va);if(!e)throw Error(`useAppearance must be used inside AppearanceProvider`);return e}var Ka={enabled:`cortex.enabled`,instructions:{injectOnSessionStart:`cortex.instructions.inject_on_session_start`},digest:{tier:`cortex.digest.tier`,injectOnSessionStart:`cortex.digest.inject_on_session_start`},spores:{injectOnPromptSubmit:`cortex.spores.inject_on_prompt_submit`,maxPerPrompt:`cortex.spores.max_per_prompt`},canopy:{injectOnPreToolUse:`cortex.canopy.inject_on_pre_tool_use`,minFileBytes:`cortex.canopy.min_file_bytes`,refresh:{backgroundEnabled:`cortex.canopy.refresh.background_enabled`,backgroundPeriodMinutes:`cortex.canopy.refresh.background_period_minutes`},exclude:{defaultPatterns:`cortex.canopy.exclude.default_patterns`,patterns:`cortex.canopy.exclude.patterns`}}},qa={scheduledTasksEnabled:`agent.scheduled_tasks_enabled`,eventTasksEnabled:`agent.event_tasks_enabled`,summaryBatchInterval:`agent.summary_batch_interval`},Ja=`config-field-`,Ya={appearance:`config-section-appearance`,cortexInstructions:`config-section-cortex-instructions`,cortexBuilder:`config-section-cortex-builder`,cortexDigest:`config-section-cortex-digest`,settingsAgent:`config-section-settings-agent`,settingsEmbedding:`config-section-settings-embedding`,settingsNotifications:`config-section-settings-notifications`,settingsPlanCapture:`config-section-settings-plan-capture`,settingsProject:`config-section-settings-project`,agentOperations:`config-section-agent-operations`,operationsMaintenance:`config-section-operations-maintenance`,operationsBackup:`config-section-operations-backup`};Ya.appearance,Ya.settingsAgent,Ya.settingsEmbedding,Ya.cortexDigest,Ya.cortexInstructions,Ya.cortexInstructions,Ya.cortexInstructions,Ya.cortexInstructions,Ya.settingsNotifications,Ya.settingsPlanCapture,Ya.agentOperations,Ka.digest.tier,Ka.digest.injectOnSessionStart,Ka.instructions.injectOnSessionStart,Ka.spores.injectOnPromptSubmit,Ka.spores.maxPerPrompt,Ka.canopy.injectOnPreToolUse,Ka.canopy.minFileBytes,qa.scheduledTasksEnabled,qa.eventTasksEnabled,qa.summaryBatchInterval;function Xa(e){return`${Ja}${e.replace(/[^a-zA-Z0-9]+/g,`-`)}`}var Za=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Qa=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),$a=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),eo=e=>{let t=$a(e);return t.charAt(0).toUpperCase()+t.slice(1)},to={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`},no=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ro=(0,W.createContext)({}),io=()=>(0,W.useContext)(ro),ao=(0,W.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=``}=io()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,W.createElement)(`svg`,{ref:c,...to,width:t??l??to.width,height:t??l??to.height,stroke:e??f,strokeWidth:m,className:Za(`lucide`,p,i),...!a&&!no(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,W.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),K=(e,t)=>{let n=(0,W.forwardRef)(({className:n,...r},i)=>(0,W.createElement)(ao,{ref:i,iconNode:t,className:Za(`lucide-${Qa(eo(e))}`,`lucide-${e}`,n),...r}));return n.displayName=eo(e),n},oo=K(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),so=K(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),co=K(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),lo=K(`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`}]]),uo=K(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),fo=K(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),po=K(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),mo=K(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ho=K(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),go=K(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),_o=K(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),vo=K(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),yo=K(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),bo=K(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),xo=K(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),So=K(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Co=K(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),wo=K(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),To=K(`clipboard-list`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]),Eo=K(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Do=K(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Oo=K(`command`,[[`path`,{d:`M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3`,key:`11bfej`}]]),ko=K(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ao=K(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),jo=K(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Mo=K(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),No=K(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Po=K(`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`}]]),Fo=K(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Io=K(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Lo=K(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Ro=K(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),zo=K(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Bo=K(`file-x`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`m14.5 12.5-5 5`,key:`b62r18`}],[`path`,{d:`m9.5 12.5 5 5`,key:`1rk7el`}]]),Vo=K(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),Ho=K(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Uo=K(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Wo=K(`folder-tree`,[[`path`,{d:`M20 10a1 1 0 0 0 1-1V6a1 1 0 0 0-1-1h-2.5a1 1 0 0 1-.8-.4l-.9-1.2A1 1 0 0 0 15 3h-2a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`hod4my`}],[`path`,{d:`M20 21a1 1 0 0 0 1-1v-3a1 1 0 0 0-1-1h-2.9a1 1 0 0 1-.88-.55l-.42-.85a1 1 0 0 0-.92-.6H13a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1Z`,key:`w4yl2u`}],[`path`,{d:`M3 5a2 2 0 0 0 2 2h3`,key:`f2jnh7`}],[`path`,{d:`M3 3v13a2 2 0 0 0 2 2h3`,key:`k8epm1`}]]),Go=K(`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`}]]),Ko=K(`git-compare`,[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M13 6h3a2 2 0 0 1 2 2v7`,key:`1yeb86`}],[`path`,{d:`M11 18H8a2 2 0 0 1-2-2V9`,key:`19pyzm`}]]),qo=K(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Jo=K(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Yo=K(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]),Xo=K(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),Zo=K(`layout-dashboard`,[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]),Qo=K(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),$o=K(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),es=K(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),ts=K(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),ns=K(`map`,[[`path`,{d:`M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z`,key:`169xi5`}],[`path`,{d:`M15 5.764v15`,key:`1pn4in`}],[`path`,{d:`M9 3.236v15`,key:`1uimfh`}]]),rs=K(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),is=K(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),as=K(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),os=K(`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`}]]),ss=K(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),cs=K(`panels-top-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M9 21V9`,key:`1oto5p`}]]),ls=K(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),us=K(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ds=K(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),fs=K(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ps=K(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),ms=K(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),hs=K(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),gs=K(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]),_s=K(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),vs=K(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),ys=K(`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`}]]),bs=K(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),xs=K(`shield-alert`,[[`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:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Ss=K(`shield`,[[`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`}]]),Cs=K(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),ws=K(`sprout`,[[`path`,{d:`M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3`,key:`139s4v`}],[`path`,{d:`M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4`,key:`1dlkgp`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),Ts=K(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Es=K(`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`}]]),Ds=K(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Os=K(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),ks=K(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),As=K(`trees`,[[`path`,{d:`M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z`,key:`1l6gj6`}],[`path`,{d:`M7 16v6`,key:`1a82de`}],[`path`,{d:`M13 19v3`,key:`13sx9i`}],[`path`,{d:`M12 19h8.3a1 1 0 0 0 .7-1.7L18 14h.3a1 1 0 0 0 .7-1.7L16 9h.2a1 1 0 0 0 .8-1.7L13 3l-1.4 1.5`,key:`1sj9kv`}]]),js=K(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Ms=K(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ns=K(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Ps=K(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Fs=K(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Is=K(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ls=K(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]),Rs=6e4,zs=3e4;function Bs(e,t,n){if(t===`heartbeat`){let t=e*Ei[n];return n===`hidden`?Math.min(t,Rs):n===`deep_sleep`?Math.min(t,zs):t}return n===`deep_sleep`||n===`hidden`?!1:e*Ei[n]}function Vs(e){let t=Ai(),{pollCategory:n,refetchInterval:r,contextFree:i=!1,...a}=e,o=Ta(a.queryKey??[]),s=r===!1?!1:Bs(r,n,t);return ot({...a,queryKey:i?a.queryKey:o,refetchInterval:s})}var Hs={HEALTH:5e3,STATS:1e4,LOGS:3e3,PROGRESS:1e3,UPDATE:3e5,RUNS_ACTIVE:3e3,RUN_DETAIL:5e3,SESSIONS:8e3,SESSION_DETAIL:8e3,SPORES:3e4,CANOPY_ENTRIES:6e4,GIT_IDENTITY:5e3},Us=1e4,Ws=3e4,Gs=[`debug`,`info`,`warn`,`error`],Ks={debug:0,info:1,warn:2,error:3},qs=[`stable`,`beta`],Js=1e3;function Ys(e){switch(e){case`info`:return`default`;case`warn`:return`warning`;case`error`:return`destructive`;default:return`secondary`}}function Xs(e){switch(e){case`info`:return`bg-primary`;case`debug`:return`bg-outline`;case`warn`:return`bg-secondary`;case`error`:return`bg-tertiary`;default:return`bg-outline`}}function Zs(){return Vs({queryKey:[`daemon-stats`],queryFn:({signal:e})=>$i(`/stats`,{signal:e}),refetchInterval:Hs.STATS,pollCategory:`standard`})}var Qs=500,$s=3e4;function ec(){let[e,t]=(0,W.useState)(!1),n=(0,W.useRef)(null);return{restart:(0,W.useCallback)(async(e=!1)=>{t(!0);try{let r=await sa(`/restart`,{force:e});if(r.status===`busy`)return t(!1),r;let i=Date.now()+$s;n.current=new AbortController,await new Promise((e,t)=>{let r=async()=>{if(Date.now()>i){t(Error(`Restart timeout`));return}try{if((await fetch(Mi(`/health`),{signal:n.current.signal})).ok){e();return}setTimeout(r,Qs)}catch{setTimeout(r,Qs)}};setTimeout(r,Qs)}),window.location.reload()}catch(e){throw t(!1),e}},[]),isRestarting:e}}function tc(){return ot({queryKey:[`groves`],queryFn:({signal:e})=>$i(`/groves`,{signal:e}),staleTime:5e3})}function nc(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=nc(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function rc(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=nc(e))&&(r&&(r+=` `),r+=t);return r}var ic=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ac=rc,oc=(e,t)=>n=>{if(t?.variants==null)return ac(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=ic(t)||ic(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ac(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},sc=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},cc=(e,t)=>({classGroupId:e,validator:t}),lc=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),uc=`-`,dc=[],fc=`arbitrary..`,pc=e=>{let t=gc(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return hc(e);let n=e.split(uc);return mc(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?sc(i,t):t:i||dc}return n[e]||dc}}},mc=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=mc(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(uc):e.slice(t).join(uc),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},hc=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?fc+r:void 0})(),gc=e=>{let{theme:t,classGroups:n}=e;return _c(n,t)},_c=(e,t)=>{let n=lc();for(let r in e){let i=e[r];vc(i,n,r,t)}return n},vc=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];yc(i,t,n,r)}},yc=(e,t,n,r)=>{if(typeof e==`string`){bc(e,t,n);return}if(typeof e==`function`){xc(e,t,n,r);return}Sc(e,t,n,r)},bc=(e,t,n)=>{let r=e===``?t:Cc(t,e);r.classGroupId=n},xc=(e,t,n,r)=>{if(wc(e)){vc(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(cc(n,e))},Sc=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];vc(o,Cc(t,a),n,r)}},Cc=(e,t)=>{let n=e,r=t.split(uc),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=lc(),n.nextPart.set(t,i)),n=i}return n},wc=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Tc=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ec=`!`,Dc=`:`,Oc=[],kc=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Ac=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Dc){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Ec)?(c=s.slice(0,-1),l=!0):s.startsWith(Ec)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return kc(t,l,c,u)};if(t){let e=t+Dc,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):kc(Oc,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},jc=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Mc=e=>({cache:Tc(e.cacheSize),parseClassName:Ac(e),sortModifiers:jc(e),postfixLookupClassGroupIds:Nc(e),...pc(e)}),Nc=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Pc=/\s+/,Fc=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Pc),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ec:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Ic=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Lc(n))&&(i&&(i+=` `),i+=r);return i},Lc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Lc(e[r]))&&(n&&(n+=` `),n+=t);return n},Rc=(e,...t)=>{let n,r,i,a,o=o=>(n=Mc(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=Fc(e,n);return i(e,a),a};return a=o,(...e)=>a(Ic(...e))},zc=[],Bc=e=>{let t=t=>t[e]||zc;return t.isThemeGetter=!0,t},Vc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Hc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Uc=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Wc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Gc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Kc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,qc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Yc=e=>Uc.test(e),Xc=e=>!!e&&!Number.isNaN(Number(e)),Zc=e=>!!e&&Number.isInteger(Number(e)),Qc=e=>e.endsWith(`%`)&&Xc(e.slice(0,-1)),$c=e=>Wc.test(e),el=()=>!0,tl=e=>Gc.test(e)&&!Kc.test(e),nl=()=>!1,rl=e=>qc.test(e),il=e=>Jc.test(e),al=e=>!q(e)&&!hl(e),ol=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),sl=e=>Cl(e,Dl,nl),q=e=>Vc.test(e),cl=e=>Cl(e,Ol,tl),ll=e=>Cl(e,kl,Xc),ul=e=>Cl(e,jl,el),dl=e=>Cl(e,Al,nl),fl=e=>Cl(e,Tl,nl),pl=e=>Cl(e,El,il),ml=e=>Cl(e,Ml,rl),hl=e=>Hc.test(e),gl=e=>wl(e,Ol),_l=e=>wl(e,Al),vl=e=>wl(e,Tl),yl=e=>wl(e,Dl),bl=e=>wl(e,El),xl=e=>wl(e,Ml,!0),Sl=e=>wl(e,jl,!0),Cl=(e,t,n)=>{let r=Vc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},wl=(e,t,n=!1)=>{let r=Hc.exec(e);return r?r[1]?t(r[1]):n:!1},Tl=e=>e===`position`||e===`percentage`,El=e=>e===`image`||e===`url`,Dl=e=>e===`length`||e===`size`||e===`bg-size`,Ol=e=>e===`length`,kl=e=>e===`number`,Al=e=>e===`family-name`,jl=e=>e===`number`||e===`weight`,Ml=e=>e===`shadow`,Nl=Rc(()=>{let e=Bc(`color`),t=Bc(`font`),n=Bc(`text`),r=Bc(`font-weight`),i=Bc(`tracking`),a=Bc(`leading`),o=Bc(`breakpoint`),s=Bc(`container`),c=Bc(`spacing`),l=Bc(`radius`),u=Bc(`shadow`),d=Bc(`inset-shadow`),f=Bc(`text-shadow`),p=Bc(`drop-shadow`),m=Bc(`blur`),h=Bc(`perspective`),g=Bc(`aspect`),_=Bc(`ease`),v=Bc(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),hl,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[hl,q,c],T=()=>[Yc,`full`,`auto`,...w()],E=()=>[Zc,`none`,`subgrid`,hl,q],D=()=>[`auto`,{span:[`full`,Zc,hl,q]},Zc,hl,q],O=()=>[Zc,`auto`,hl,q],k=()=>[`auto`,`min`,`max`,`fr`,hl,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Yc,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Yc,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Yc,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,hl,q],L=()=>[...b(),vl,fl,{position:[hl,q]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,yl,sl,{size:[hl,q]}],z=()=>[Qc,gl,cl],B=()=>[``,`none`,`full`,l,hl,q],V=()=>[``,Xc,gl,cl],H=()=>[`solid`,`dashed`,`dotted`,`double`],te=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ne=()=>[Xc,Qc,vl,fl],U=()=>[``,`none`,m,hl,q],re=()=>[`none`,Xc,hl,q],ie=()=>[`none`,Xc,hl,q],ae=()=>[Xc,hl,q],oe=()=>[Yc,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[$c],breakpoint:[$c],color:[el],container:[$c],"drop-shadow":[$c],ease:[`in`,`out`,`in-out`],font:[al],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[$c],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[$c],shadow:[$c],spacing:[`px`,Xc],text:[$c],"text-shadow":[$c],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Yc,q,hl,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,hl,q]}],"container-named":[ol],columns:[{columns:[Xc,q,hl,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Zc,`auto`,hl,q]}],basis:[{basis:[Yc,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Xc,Yc,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,Xc,hl,q]}],shrink:[{shrink:[``,Xc,hl,q]}],order:[{order:[Zc,`first`,`last`,`none`,hl,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,gl,cl]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Sl,ul]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Qc,q]}],"font-family":[{font:[_l,dl,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,hl,q]}],"line-clamp":[{"line-clamp":[Xc,`none`,hl,ll]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,hl,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,hl,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[Xc,`from-font`,`auto`,hl,cl]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Xc,`auto`,hl,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Zc,hl,q]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,hl,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,hl,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Zc,hl,q],radial:[``,hl,q],conic:[Zc,hl,q]},bl,pl]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Xc,hl,q]}],"outline-w":[{outline:[``,Xc,gl,cl]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,xl,ml]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,xl,ml]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Xc,cl]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,xl,ml]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Xc,hl,q]}],"mix-blend":[{"mix-blend":[...te(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":te()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Xc]}],"mask-image-linear-from-pos":[{"mask-linear-from":ne()}],"mask-image-linear-to-pos":[{"mask-linear-to":ne()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ne()}],"mask-image-t-to-pos":[{"mask-t-to":ne()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ne()}],"mask-image-r-to-pos":[{"mask-r-to":ne()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ne()}],"mask-image-b-to-pos":[{"mask-b-to":ne()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ne()}],"mask-image-l-to-pos":[{"mask-l-to":ne()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ne()}],"mask-image-x-to-pos":[{"mask-x-to":ne()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ne()}],"mask-image-y-to-pos":[{"mask-y-to":ne()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[hl,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":ne()}],"mask-image-radial-to-pos":[{"mask-radial-to":ne()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Xc]}],"mask-image-conic-from-pos":[{"mask-conic-from":ne()}],"mask-image-conic-to-pos":[{"mask-conic-to":ne()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,hl,q]}],filter:[{filter:[``,`none`,hl,q]}],blur:[{blur:U()}],brightness:[{brightness:[Xc,hl,q]}],contrast:[{contrast:[Xc,hl,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,xl,ml]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Xc,hl,q]}],"hue-rotate":[{"hue-rotate":[Xc,hl,q]}],invert:[{invert:[``,Xc,hl,q]}],saturate:[{saturate:[Xc,hl,q]}],sepia:[{sepia:[``,Xc,hl,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,hl,q]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[Xc,hl,q]}],"backdrop-contrast":[{"backdrop-contrast":[Xc,hl,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Xc,hl,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xc,hl,q]}],"backdrop-invert":[{"backdrop-invert":[``,Xc,hl,q]}],"backdrop-opacity":[{"backdrop-opacity":[Xc,hl,q]}],"backdrop-saturate":[{"backdrop-saturate":[Xc,hl,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Xc,hl,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,hl,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Xc,`initial`,hl,q]}],ease:[{ease:[`linear`,`initial`,_,hl,q]}],delay:[{delay:[Xc,hl,q]}],animate:[{animate:[`none`,v,hl,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,hl,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:re()}],"rotate-x":[{"rotate-x":re()}],"rotate-y":[{"rotate-y":re()}],"rotate-z":[{"rotate-z":re()}],scale:[{scale:ie()}],"scale-x":[{"scale-x":ie()}],"scale-y":[{"scale-y":ie()}],"scale-z":[{"scale-z":ie()}],"scale-3d":[`scale-3d`],skew:[{skew:ae()}],"skew-x":[{"skew-x":ae()}],"skew-y":[{"skew-y":ae()}],transform:[{transform:[hl,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":[`translate-none`],zoom:[{zoom:[Zc,hl,q]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,hl,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,hl,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Xc,gl,cl,ll]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function J(...e){return Nl(rc(e))}var Pl=oc(`inline-flex items-center justify-center whitespace-nowrap rounded-md font-sans text-sm font-medium transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 focus-visible:ring-offset-surface disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`bg-gradient-to-br from-primary to-primary-container text-on-primary shadow-xs hover:shadow-[0_0_0_1px_rgba(171,207,184,0.4)]`,destructive:`bg-gradient-to-br from-tertiary to-tertiary-container text-on-surface shadow-xs hover:shadow-[0_0_0_1px_rgba(255,180,161,0.4)]`,outline:`border border-[var(--ghost-border)] bg-transparent shadow-xs hover:bg-surface-container-high hover:text-on-surface`,secondary:`border border-outline-variant/20 bg-transparent hover:bg-surface-container-high text-on-surface`,ghost:`hover:bg-surface-container-high text-on-surface-variant hover:text-on-surface`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Y=(0,W.forwardRef)(({className:e,variant:t,size:n,...r},i)=>(0,G.jsx)(`button`,{className:J(Pl({variant:t,size:n,className:e})),ref:i,...r}));Y.displayName=`Button`,typeof window<`u`&&window.document&&window.document.createElement;function Fl(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function Il(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ll(...e){return t=>{let n=!1,r=e.map(e=>{let r=Il(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Il(e[t],null)}}}}function Rl(...e){return W.useCallback(Ll(...e),e)}function zl(e,t){let n=W.createContext(t),r=e=>{let{children:t,...r}=e,i=W.useMemo(()=>r,Object.values(r));return(0,G.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=W.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function Bl(e,t=[]){let n=[];function r(t,r){let i=W.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=W.useMemo(()=>o,Object.values(o));return(0,G.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=W.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>W.createContext(e));return function(n){let r=n?.[e]||t;return W.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,Vl(i,...t)]}function Vl(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return W.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var Hl=globalThis?.document?W.useLayoutEffect:()=>{},Ul=W.useId||(()=>void 0),Wl=0;function Gl(e){let[t,n]=W.useState(Ul());return Hl(()=>{e||n(e=>e??String(Wl++))},[e]),e||(t?`radix-${t}`:``)}var Kl=W.useInsertionEffect||Hl;function ql({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=Jl({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=W.useRef(e!==void 0);W.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,W.useCallback(t=>{if(s){let n=Yl(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function Jl({defaultProp:e,onChange:t}){let[n,r]=W.useState(e),i=W.useRef(n),a=W.useRef(t);return Kl(()=>{a.current=t},[t]),W.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Yl(e){return typeof e==`function`}var Xl=l(h(),1);function Zl(e){let t=Ql(e),n=W.forwardRef((e,n)=>{let{children:r,...i}=e,a=W.Children.toArray(r),o=a.find(eu);if(o){let e=o.props.children,r=a.map(t=>t===o?W.Children.count(e)>1?W.Children.only(null):W.isValidElement(e)?e.props.children:null:t);return(0,G.jsx)(t,{...i,ref:n,children:W.isValidElement(e)?W.cloneElement(e,void 0,r):null})}return(0,G.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Ql(e){let t=W.forwardRef((e,t)=>{let{children:n,...r}=e;if(W.isValidElement(n)){let e=nu(n),i=tu(r,n.props);return n.type!==W.Fragment&&(i.ref=t?Ll(t,e):e),W.cloneElement(n,i)}return W.Children.count(n)>1?W.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var $l=Symbol(`radix.slottable`);function eu(e){return W.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===$l}function tu(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function nu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ru=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Zl(`Primitive.${t}`),r=W.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,G.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function iu(e,t){e&&Xl.flushSync(()=>e.dispatchEvent(t))}function au(e){let t=W.useRef(e);return W.useEffect(()=>{t.current=e}),W.useMemo(()=>(...e)=>t.current?.(...e),[])}function ou(e,t=globalThis?.document){let n=au(e);W.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var su=`DismissableLayer`,cu=`dismissableLayer.update`,lu=`dismissableLayer.pointerDownOutside`,uu=`dismissableLayer.focusOutside`,du,fu=W.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),pu=W.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=W.useContext(fu),[u,d]=W.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=W.useState({}),m=Rl(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=gu(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=_u(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return ou(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),W.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(du=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),vu(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=du)}},[u,f,n,l]),W.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),vu())},[u,l]),W.useEffect(()=>{let e=()=>p({});return document.addEventListener(cu,e),()=>document.removeEventListener(cu,e)},[]),(0,G.jsx)(ru.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:Fl(e.onFocusCapture,S.onFocusCapture),onBlurCapture:Fl(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:Fl(e.onPointerDownCapture,x.onPointerDownCapture)})});pu.displayName=su;var mu=`DismissableLayerBranch`,hu=W.forwardRef((e,t)=>{let n=W.useContext(fu),r=W.useRef(null),i=Rl(t,r);return W.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,G.jsx)(ru.div,{...e,ref:i})});hu.displayName=mu;function gu(e,t=globalThis?.document){let n=au(e),r=W.useRef(!1),i=W.useRef(()=>{});return W.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){yu(lu,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function _u(e,t=globalThis?.document){let n=au(e),r=W.useRef(!1);return W.useEffect(()=>{let e=e=>{e.target&&!r.current&&yu(uu,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function vu(){let e=new CustomEvent(cu);document.dispatchEvent(e)}function yu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?iu(i,a):i.dispatchEvent(a)}var bu=`focusScope.autoFocusOnMount`,xu=`focusScope.autoFocusOnUnmount`,Su={bubbles:!1,cancelable:!0},Cu=`FocusScope`,wu=W.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=W.useState(null),l=au(i),u=au(a),d=W.useRef(null),f=Rl(t,e=>c(e)),p=W.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;W.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ju(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ju(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ju(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),W.useEffect(()=>{if(s){Mu.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(bu,Su);s.addEventListener(bu,l),s.dispatchEvent(t),t.defaultPrevented||(Tu(Fu(Du(s)),{select:!0}),document.activeElement===e&&ju(s))}return()=>{s.removeEventListener(bu,l),setTimeout(()=>{let t=new CustomEvent(xu,Su);s.addEventListener(xu,u),s.dispatchEvent(t),t.defaultPrevented||ju(e??document.body,{select:!0}),s.removeEventListener(xu,u),Mu.remove(p)},0)}}},[s,l,u,p]);let m=W.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Eu(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ju(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ju(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,G.jsx)(ru.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});wu.displayName=Cu;function Tu(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ju(r,{select:t}),document.activeElement!==n)return}function Eu(e){let t=Du(e);return[Ou(t,e),Ou(t.reverse(),e)]}function Du(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Ou(e,t){for(let n of e)if(!ku(n,{upTo:t}))return n}function ku(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Au(e){return e instanceof HTMLInputElement&&`select`in e}function ju(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Au(e)&&t&&e.select()}}var Mu=Nu();function Nu(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Pu(e,t),e.unshift(t)},remove(t){e=Pu(e,t),e[0]?.resume()}}}function Pu(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Fu(e){return e.filter(e=>e.tagName!==`A`)}var Iu=`Portal`,Lu=W.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=W.useState(!1);Hl(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Xl.createPortal((0,G.jsx)(ru.div,{...r,ref:t}),o):null});Lu.displayName=Iu;function Ru(e,t){return W.useReducer((e,n)=>t[e][n]??e,e)}var zu=e=>{let{present:t,children:n}=e,r=Bu(t),i=typeof n==`function`?n({present:r.isPresent}):W.Children.only(n),a=Rl(r.ref,Hu(i));return typeof n==`function`||r.isPresent?W.cloneElement(i,{ref:a}):null};zu.displayName=`Presence`;function Bu(e){let[t,n]=W.useState(),r=W.useRef(null),i=W.useRef(e),a=W.useRef(`none`),[o,s]=Ru(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return W.useEffect(()=>{let e=Vu(r.current);a.current=o===`mounted`?e:`none`},[o]),Hl(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=Vu(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),Hl(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=Vu(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=Vu(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:W.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function Vu(e){return e?.animationName||`none`}function Hu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Uu=0;function Wu(){W.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Gu()),document.body.insertAdjacentElement(`beforeend`,e[1]??Gu()),Uu++,()=>{Uu===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Uu--}},[])}function Gu(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var Ku=function(){return Ku=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ku.apply(this,arguments)};function qu(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Ju(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var Yu=`right-scroll-bar-position`,Xu=`width-before-scroll-bar`,Zu=`with-scroll-bars-hidden`,Qu=`--removed-body-scroll-bar-size`;function $u(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function ed(e,t){var n=(0,W.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var td=typeof window<`u`?W.useLayoutEffect:W.useEffect,nd=new WeakMap;function rd(e,t){var n=ed(t||null,function(t){return e.forEach(function(e){return $u(e,t)})});return td(function(){var t=nd.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||$u(e,null)}),i.forEach(function(e){r.has(e)||$u(e,a)})}nd.set(n,e)},[e]),n}function id(e){return e}function ad(e,t){t===void 0&&(t=id);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function od(e){e===void 0&&(e={});var t=ad(null);return t.options=Ku({async:!0,ssr:!1},e),t}var sd=function(e){var t=e.sideCar,n=qu(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return W.createElement(r,Ku({},n))};sd.isSideCarExport=!0;function cd(e,t){return e.useMedium(t),sd}var ld=od(),ud=function(){},dd=W.forwardRef(function(e,t){var n=W.useRef(null),r=W.useState({onScrollCapture:ud,onWheelCapture:ud,onTouchMoveCapture:ud}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=qu(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=rd([n,t]),C=Ku(Ku({},b),i);return W.createElement(W.Fragment,null,u&&W.createElement(x,{sideCar:ld,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?W.cloneElement(W.Children.only(s),Ku(Ku({},C),{ref:S})):W.createElement(v,Ku({},C,{className:c,ref:S}),s))});dd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},dd.classNames={fullWidth:Xu,zeroRight:Yu};var fd,pd=function(){if(fd)return fd;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function md(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=pd();return t&&e.setAttribute(`nonce`,t),e}function hd(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function gd(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var _d=function(){var e=0,t=null;return{add:function(n){e==0&&(t=md())&&(hd(t,n),gd(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vd=function(){var e=_d();return function(t,n){W.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yd=function(){var e=vd();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},bd={left:0,top:0,right:0,gap:0},xd=function(e){return parseInt(e||``,10)||0},Sd=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[xd(n),xd(r),xd(i)]},Cd=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return bd;var t=Sd(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},wd=yd(),Td=`data-scroll-locked`,Ed=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
12
12
|
.${Zu} {
|
|
13
13
|
overflow: hidden ${r};
|
|
14
14
|
padding-right: ${s}px ${r};
|
|
@@ -81,7 +81,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
81
81
|
`,...a.current()});return/^[\t ]/.test(l)&&(l=gE(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}SE.peek=CE;function SE(e){return e.value||``}function CE(){return`<`}wE.peek=TE;function wE(e,t,n,r){let i=pE(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function TE(){return`!`}EE.peek=DE;function EE(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function DE(){return`!`}OE.peek=kE;function OE(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e),i;if(e.atBreak)for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function kE(){return"`"}function AE(e,t){let n=rb(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type===`text`&&(n===e.url||`mailto:`+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}jE.peek=ME;function jE(e,t,n,r){let i=pE(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(AE(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function ME(e,t,n){return AE(e,n)?`<`:`[`}NE.peek=PE;function NE(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function PE(){return`[`}function FE(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function IE(e){let t=FE(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function LE(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function RE(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function zE(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?LE(n):FE(n),s=e.ordered?o===`.`?`)`:`.`:IE(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),RE(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function BE(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function VE(e,t,n,r){let i=BE(n),a=n.bulletCurrent||FE(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function HE(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var UE=XC([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function WE(e,t,n,r){return(e.children.some(function(e){return UE(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function GE(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}KE.peek=qE;function KE(e,t,n,r){let i=GE(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=_E(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=gE(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=_E(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+gE(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function qE(e,t,n){return n.options.strong||`*`}function JE(e,t,n,r){return n.safe(e.value,r)}function YE(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function XE(e,t,n){let r=(RE(n)+(n.options.ruleSpaces?` `:``)).repeat(YE(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ZE={blockquote:rE,break:sE,code:dE,definition:mE,emphasis:vE,hardBreak:sE,heading:xE,html:SE,image:wE,imageReference:EE,inlineCode:OE,link:jE,linkReference:NE,list:zE,listItem:VE,paragraph:HE,root:WE,strong:KE,text:JE,thematicBreak:XE};function QE(){return{enter:{table:$E,tableData:rD,tableHeader:rD,tableRow:tD},exit:{codeText:iD,table:eD,tableData:nD,tableHeader:nD,tableRow:nD}}}function $E(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function eD(e){this.exit(e),this.data.inTable=void 0}function tD(e){this.enter({type:`tableRow`,children:[]},e)}function nD(e){this.exit(e)}function rD(e){this.enter({type:`tableCell`,children:[]},e)}function iD(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,aD));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function aD(e,t){return t===`|`?t:e}function oD(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
82
82
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
83
83
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return eE(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=ZE.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function sD(){return{exit:{taskListCheckValueChecked:lD,taskListCheckValueUnchecked:lD,paragraph:uD}}}function cD(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:dD}}}function lD(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function uD(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function dD(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=ZE.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function fD(){return[vT(),HT(),qT(),QE(),sD()]}function pD(e){return{extensions:[yT(),UT(e),JT(),oD(e),cD()]}}var mD={tokenize:OD,partial:!0},hD={tokenize:kD,partial:!0},gD={tokenize:AD,partial:!0},_D={tokenize:jD,partial:!0},vD={tokenize:MD,partial:!0},yD={name:`wwwAutolink`,tokenize:ED,previous:ND},bD={name:`protocolAutolink`,tokenize:DD,previous:PD},xD={name:`emailAutolink`,tokenize:TD,previous:FD},SD={};function CD(){return{text:SD}}for(var wD=48;wD<123;)SD[wD]=xD,wD++,wD===58?wD=65:wD===91&&(wD=97);SD[43]=xD,SD[45]=xD,SD[46]=xD,SD[95]=xD,SD[72]=[xD,bD],SD[104]=[xD,bD],SD[87]=[xD,yD],SD[119]=[xD,yD];function TD(e,t,n){let r=this,i,a;return o;function o(t){return!ID(t)||!FD.call(r,r.previous)||LD(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return ID(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(vD,u,l)(t):t===45||t===95||vb(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&_b(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function ED(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!ND.call(r,r.previous)||LD(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(mD,e.attempt(hD,e.attempt(gD,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function DD(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&PD.call(r,r.previous)&&!LD(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(_b(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||bb(t)||Tb(t)||Ob(t)||Db(t)?n(t):e.attempt(hD,e.attempt(gD,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function OD(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function kD(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(_D,c,s)(t):t===null||Tb(t)||Ob(t)||t!==45&&Db(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function AD(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(_D,t,a)(o):o===null||Tb(o)||Ob(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function jD(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Tb(o)||Ob(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Tb(e)||Ob(e)?t(e):r(e)}function a(e){return _b(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):_b(t)?(e.consume(t),o):n(t)}}function MD(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return vb(e)?n(e):t(e)}}function ND(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Tb(e)}function PD(e){return!_b(e)}function FD(e){return!(e===47||ID(e))}function ID(e){return e===43||e===45||e===46||e===95||vb(e)}function LD(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var RD={tokenize:KD,partial:!0};function zD(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:UD,continuation:{tokenize:WD},exit:GD}},text:{91:{name:`gfmFootnoteCall`,tokenize:HD},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:BD,resolveTo:VD}}}}function BD(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=gb(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function VD(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function HD(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Tb(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(gb(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Tb(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function UD(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Tb(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=gb(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Tb(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),jb(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function WD(e,t,n){return e.check(Kb,t,e.attempt(RD,t,n))}function GD(e){e.exit(`gfmFootnoteDefinition`)}function KD(e,t,n){let r=this;return jb(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function qD(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&lb(o,o.length,0,zb(s,e.slice(r+1,n),t)),lb(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),lb(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=Rb(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=Rb(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var JD=class{constructor(){this.map=[]}add(e,t,n){YD(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function YD(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function XD(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ZD(){return{flow:{null:{name:`table`,tokenize:QD,resolveAll:$D}}}}function QD(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):wb(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Eb(t)?jb(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Tb(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Eb(t)?jb(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Eb(t)?jb(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||wb(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Eb(t)?jb(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||wb(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||wb(n)?(e.exit(`tableRow`),t(n)):Eb(n)?jb(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||Tb(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function $D(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new JD;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(tO(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=eO(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=eO(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=eO(f,t,o,i,n,d)):(o[0]=o[1],d=eO(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&tO(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=XD(t.events,n))}return e}function eO(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},nO(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=nO(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=nO(t.events,n[2]),a=nO(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},nO(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function tO(e,t,n,r,i){let a=[],o=nO(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function nO(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var rO={name:`tasklistCheck`,tokenize:aO};function iO(){return{text:{91:rO}}}function aO(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Tb(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return wb(r)?t(r):Eb(r)?e.check({tokenize:oO},t,n)(r):n(r)}}function oO(e,t,n){return jb(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function sO(e){return fb([CD(),zD(),qD(e),ZD(),iO()])}var cO={};function lO(e){let t=this,n=e||cO,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(sO(n)),a.push(fD()),o.push(pD(n))}function uO({content:e,className:t,compact:n=!1}){return(0,G.jsx)(`div`,{className:J(n?`prose-myco-compact`:`prose-myco`,t),children:(0,G.jsx)(aT,{remarkPlugins:[lO],children:e})})}var dO={info:`bg-primary`,success:`bg-green-500`,warning:`bg-secondary`,error:`bg-tertiary`},fO={info:Jo,success:So,warning:js,error:yo},pO={unread:`New`,read:`Earlier`},mO=`notification-panel`;function hO(e){let t=Math.floor(Date.now()/1e3)-e;if(t<60)return`just now`;let n=Math.floor(t/60);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`}function gO({title:e,count:t}){return(0,G.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,G.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-[0.18em] text-on-surface-variant`,children:e}),(0,G.jsx)(`span`,{className:`text-[11px] text-on-surface-variant/70`,children:t})]})}function _O({notification:e,onOpen:t,onDismiss:n}){let r=fO[e.level],i=e.status===`unread`;return(0,G.jsx)(`div`,{onClick:()=>t(e),className:J(`group cursor-pointer rounded-lg border border-transparent px-4 py-3 transition-colors hover:border-outline-variant/20 hover:bg-surface-container-high/70`,i&&`border-primary/10 bg-primary/[0.04]`),children:(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsxs)(`div`,{className:`relative mt-0.5 shrink-0`,children:[(0,G.jsx)(`div`,{className:`flex h-8 w-8 items-center justify-center rounded-full bg-surface-container-high text-on-surface-variant`,children:(0,G.jsx)(r,{className:`h-4 w-4`})}),i&&(0,G.jsx)(`span`,{className:J(`absolute -top-0.5 -right-0.5 h-2.5 w-2.5 rounded-full ring-2 ring-surface-container`,dO[e.level])})]}),(0,G.jsx)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(`span`,{className:J(`text-sm font-medium`,i?`text-on-surface`:`text-on-surface-variant`),children:e.title}),(0,G.jsx)(`span`,{className:`rounded-full bg-surface-container-high px-2 py-0.5 text-[10px] uppercase tracking-wider text-on-surface-variant`,children:e.domain})]}),e.message&&(0,G.jsx)(uO,{content:e.message,compact:!0,className:`line-clamp-3 text-xs leading-5 text-on-surface-variant`})]}),(0,G.jsxs)(`div`,{className:`flex shrink-0 items-start gap-2`,children:[(0,G.jsx)(`span`,{className:`pt-0.5 text-[10px] font-mono text-on-surface-variant/70`,children:hO(e.created_at)}),(0,G.jsx)(`button`,{onClick:t=>n(t,e),className:`rounded p-0.5 text-on-surface-variant/40 opacity-0 transition hover:text-on-surface-variant group-hover:opacity-100`,"aria-label":`Dismiss`,children:(0,G.jsx)(Is,{className:`h-3.5 w-3.5`})})]})]})})]})})}function vO({open:e,onClose:t}){let{data:n,refetch:r}=dv({limit:50,enabled:e,pollCategory:`realtime`,refetchInterval:Hs.LOGS}),i=pv(),a=hv(),o=mv(),s=Nn();(0,W.useEffect)(()=>{e&&r()},[e,r]),(0,W.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]);let c=(0,W.useCallback)(e=>{e.status===`unread`&&i.mutate({id:e.id,status:`read`}),e.link&&(s(e.link,{state:{source:mO,triggeredAt:Date.now()}}),t())},[i,s,t]),l=(0,W.useCallback)((e,t)=>{e.stopPropagation(),i.mutate({id:t.id,status:`dismissed`})},[i]),u=(n?.items??[]).filter(e=>e.status!==`dismissed`),d=n?.unread_count??0,f=u.filter(e=>e.status===`unread`),p=u.filter(e=>e.status!==`unread`);return(0,G.jsxs)(G.Fragment,{children:[e&&(0,G.jsx)(`div`,{className:`fixed inset-0 z-40 bg-surface-dim/40 backdrop-blur-xs transition-opacity`,onClick:t,"aria-hidden":`true`}),(0,G.jsxs)(`aside`,{className:J(`fixed top-0 right-0 bottom-0 z-50 flex w-96 max-w-[calc(100vw-3rem)] flex-col border-l border-outline-variant/20 bg-surface-container shadow-2xl transition-transform duration-200 ease-out`,e?`translate-x-0`:`translate-x-full`),children:[(0,G.jsxs)(`div`,{className:`border-b border-outline-variant/20 px-4 py-4`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(lo,{className:`h-4 w-4 shrink-0 text-primary`}),(0,G.jsx)(`h2`,{className:`min-w-0 text-sm font-medium text-on-surface`,children:`Notifications`}),d>0&&(0,G.jsx)(`span`,{className:`inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-primary/15 px-1.5 text-xs font-medium text-primary`,children:d})]})}),(0,G.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`h-7 shrink-0 px-2`,children:(0,G.jsx)(Is,{className:`h-4 w-4`})})]}),(d>0||u.length>0)&&(0,G.jsxs)(`div`,{className:`mt-3 flex items-center justify-end gap-1 border-t border-outline-variant/10 pt-3`,children:[d>0&&(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:e=>{e.stopPropagation(),a.mutate(void 0)},title:`Mark all as read`,className:`h-7 gap-1 px-2 text-xs text-on-surface-variant`,children:[(0,G.jsx)(ts,{className:`h-3.5 w-3.5`}),`Mark all read`]}),u.length>0&&(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:e=>{e.stopPropagation(),o.mutate(void 0)},title:`Clear all notifications`,className:`h-7 gap-1 px-2 text-xs text-on-surface-variant`,children:[(0,G.jsx)(ks,{className:`h-3.5 w-3.5`}),`Clear`]})]})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:u.length===0?(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 px-6 text-center`,children:[(0,G.jsx)(lo,{className:`h-5 w-5 text-on-surface-variant/50`}),(0,G.jsx)(`div`,{className:`text-sm text-on-surface-variant`,children:`No notifications yet`}),(0,G.jsx)(`div`,{className:`text-xs text-on-surface-variant/70`,children:`New events will appear here whether they display as banners or summary-only items.`})]}):(0,G.jsxs)(`div`,{className:`space-y-4 px-3 py-3`,children:[f.length>0&&(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(gO,{title:pO.unread,count:f.length}),(0,G.jsx)(`div`,{className:`space-y-2`,children:f.map(e=>(0,G.jsx)(_O,{notification:e,onOpen:c,onDismiss:l},e.id))})]}),p.length>0&&(0,G.jsxs)(`section`,{className:`space-y-2`,children:[(0,G.jsx)(gO,{title:pO.read,count:p.length}),(0,G.jsx)(`div`,{className:`space-y-2`,children:p.map(e=>(0,G.jsx)(_O,{notification:e,onOpen:c,onDismiss:l},e.id))})]})]})})]})]})}function yO(){let{effective:e}=Na(),t=e?.notifications?.system_notifications??!1,{data:n,refetch:r}=dv({status:`unread`,mode:`banner`,limit:5,enabled:t,pollCategory:`heartbeat`,refetchInterval:Hs.PROGRESS,includeDaemon:!0}),i=(0,W.useRef)(new Set);return(0,W.useEffect)(()=>{t&&`Notification`in window&&Notification.permission===`default`&&Notification.requestPermission()},[t]),(0,W.useEffect)(()=>{if(!t||!(`Notification`in window)||Notification.permission!==`granted`||document.hasFocus())return;let e=n?.items??[];for(let t of e)i.current.has(t.id)||(i.current.add(t.id),bO(t))},[t,n]),(0,W.useEffect)(()=>{if(!t)return;let e=()=>{(document.hidden||!document.hasFocus())&&r()};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`blur`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`blur`,e)}},[t,r]),null}function bO(e){try{new window.Notification(e.title,{body:e.message??void 0,tag:e.id,icon:`/favicon.svg`})}catch{}}var xO=[`sage`,`moss`,`terracotta`,`dusk`,`plum`,`slate`],SO=[`light`,`dark`,`system`],CO=[`default`,`geist-mono`,`system`,`sf-mono`,`fira-code`,`jetbrains-mono`],wO=[`compact`,`normal`,`comfy`],TO={personal:`Personal`,project:`Project`,grove:`Grove`,"all-groves":`All Groves`,machine:`Machine`},EO={personal:`This setting is overridden on this machine`,project:`This setting is using the shared project value`,grove:`This setting applies to every project in this Grove`,"all-groves":`This view aggregates every Grove on this machine`,machine:`This setting applies to every Grove on this machine`},DO={personal:`border-sage/40 bg-sage/5 text-sage`,project:`border-[var(--ghost-border)] bg-surface-container/40 text-on-surface-variant`,grove:`border-ochre/40 bg-ochre/5 text-ochre`,"all-groves":`border-terracotta/40 bg-terracotta/5 text-terracotta`,machine:`border-terracotta/40 bg-terracotta/5 text-terracotta`};function OO({scope:e}){let t=TO[e];return(0,G.jsxs)(`span`,{title:EO[e],className:`inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] uppercase tracking-wider ${DO[e]}`,children:[(0,G.jsx)(`span`,{className:`inline-block h-1.5 w-1.5 rounded-full ${e===`personal`?`bg-sage`:`bg-outline-variant/80`}`,"aria-hidden":!0}),t]})}function kO(e){let[t,n]=(0,W.useState)(!1),r=(0,W.useRef)(null);if((0,W.useEffect)(()=>{if(!t)return;let e=e=>{r.current?.contains(e.target)||n(!1)},i=e=>{e.key===`Escape`&&n(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,i)}},[t]),e.mode===`local-default`){let{onPromote:i,onReset:a}=e;return(0,G.jsxs)(`span`,{ref:r,className:`relative inline-block`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-haspopup":`menu`,"aria-expanded":t,title:`This setting is overridden on this machine`,className:`cursor-pointer transition-colors hover:bg-sage/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40 rounded-sm`,children:(0,G.jsx)(OO,{scope:`personal`})}),t&&(0,G.jsxs)(`div`,{role:`menu`,className:`absolute left-0 top-full z-10 mt-1 w-44 rounded-md border border-[var(--ghost-border)] bg-surface-container-high p-1 text-xs shadow-lg`,children:[(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{i(),n(!1)},className:`block w-full rounded px-2 py-1 text-left hover:bg-surface-container-highest focus-visible:outline-none focus-visible:bg-surface-container-highest`,children:`Save to project`}),(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(),n(!1)},className:`block w-full rounded px-2 py-1 text-left hover:bg-surface-container-highest focus-visible:outline-none focus-visible:bg-surface-container-highest`,children:`Reset to project`})]})]})}let{hasLocalOverride:i,defaultScopeBadge:a,onSavePersonal:o,onReset:s}=e,c=i?`personal`:a;return(0,G.jsxs)(`span`,{ref:r,className:`relative inline-block`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-haspopup":`menu`,"aria-expanded":t,title:i?`This setting is overridden on this machine`:EO[a],className:`cursor-pointer transition-colors hover:bg-sage/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40 rounded-sm`,children:(0,G.jsx)(OO,{scope:c})}),t&&(0,G.jsx)(`div`,{role:`menu`,className:`absolute left-0 top-full z-10 mt-1 w-44 rounded-md border border-[var(--ghost-border)] bg-surface-container-high p-1 text-xs shadow-lg`,children:i?(0,G.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{s(),n(!1)},className:`block w-full rounded px-2 py-1 text-left hover:bg-surface-container-highest focus-visible:outline-none focus-visible:bg-surface-container-highest`,children:[`Reset to `,TO[a]]}):(0,G.jsx)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{o(),n(!1)},className:`block w-full rounded px-2 py-1 text-left hover:bg-surface-container-highest focus-visible:outline-none focus-visible:bg-surface-container-highest`,children:`Save Personal`})})]})}var AO={sage:{label:`Sage`,swatch:`#abcfb8`},moss:{label:`Moss`,swatch:`#9ca884`},terracotta:{label:`Terracotta`,swatch:`#d28a73`},dusk:{label:`Dusk`,swatch:`#8faed1`},plum:{label:`Plum`,swatch:`#b59ec8`},slate:{label:`Slate`,swatch:`#a6b0b8`}},jO={light:{icon:Es,label:`Light`},dark:{icon:os,label:`Dark`},system:{icon:as,label:`System`}},MO={default:`Default`,"geist-mono":`Geist`,system:`System`,"sf-mono":`SF Mono`,"fira-code":`Fira Code`,"jetbrains-mono":`JetBrains`},NO=`myco-ui-appearance-expanded`;function PO(){let e=typeof window<`u`?localStorage.getItem(NO):null;return e===null?!0:e===`true`}function FO({collapsed:e}){let{effective:t,local:n,set:r,resetKey:i,saveAllAsProject:a,resetAll:o}=Ga(),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(PO);(0,W.useEffect)(()=>{localStorage.setItem(NO,String(l))},[l]);let d=e=>n[e]!==void 0,f=(e,t)=>{r(e,t,`local`).catch(e=>console.error(`[appearance] write failed`,e))};if(e)return null;let p=(e,n,a)=>(0,G.jsxs)(`div`,{id:Xa(`appearance.${n}`),"data-config-field":`appearance.${n}`,className:`rounded-md transition-all duration-300`,children:[(0,G.jsxs)(`div`,{className:`flex items-center text-xs text-on-surface-variant`,children:[e,d(n)?(0,G.jsx)(kO,{mode:`local-default`,onPromote:()=>r(n,t[n],`project`).catch(e=>console.error(`[appearance] promote failed`,e)),onReset:()=>i(n).catch(e=>console.error(`[appearance] reset failed`,e))}):(0,G.jsx)(OO,{scope:`project`})]}),a]});return(0,G.jsxs)(`div`,{id:Ya.appearance,className:`rounded-md border border-[var(--ghost-border)] p-3 ${l?`space-y-3`:``}`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>u(e=>!e),className:`-m-1 flex flex-1 items-center gap-1.5 rounded p-1 text-left hover:bg-surface-container-high`,"aria-expanded":l,"aria-label":l?`Collapse appearance section`:`Expand appearance section`,children:[(0,G.jsx)(ho,{className:`h-3 w-3 text-on-surface-variant transition-transform ${l?``:`-rotate-90`}`}),(0,G.jsx)(`h3`,{className:`text-[10px] uppercase tracking-[0.22em] text-on-surface-variant`,children:`Appearance`})]}),l&&(0,G.jsx)(`button`,{type:`button`,onClick:()=>c(e=>!e),className:`rounded p-1 hover:bg-surface-container-high`,"aria-label":`Appearance menu`,children:(0,G.jsx)(No,{className:`h-3.5 w-3.5`})})]}),l&&s&&(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 text-sm`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>{a(),c(!1)},className:`rounded px-2 py-1 text-left hover:bg-surface-container-high`,children:`Save current as project defaults`}),(0,G.jsx)(`button`,{type:`button`,onClick:()=>{o(),c(!1)},className:`rounded px-2 py-1 text-left hover:bg-surface-container-high`,children:`Reset all to project defaults`})]}),l&&(0,G.jsxs)(G.Fragment,{children:[p(`Color theme`,`theme`,(0,G.jsx)(`div`,{className:`mt-2 grid grid-cols-6 gap-1.5`,children:xO.map(e=>{let n=AO[e];return(0,G.jsx)(`button`,{type:`button`,onClick:()=>f(`theme`,e),title:n.label,"aria-label":n.label,className:`relative aspect-square rounded-md border ${t.theme===e?`border-primary`:`border-[var(--ghost-border)]`}`,style:{backgroundColor:n.swatch},children:t.theme===e&&(0,G.jsx)(mo,{className:`absolute inset-0 m-auto h-3 w-3 text-on-surface`})},e)})})),p(`Mode`,`mode`,(0,G.jsx)(`div`,{className:`mt-2 grid grid-cols-3 gap-1.5`,children:SO.map(e=>{let{icon:n,label:r}=jO[e];return(0,G.jsxs)(`button`,{type:`button`,onClick:()=>f(`mode`,e),className:`flex items-center justify-center gap-1 rounded-md border py-1 text-xs ${t.mode===e?`border-primary text-on-surface`:`border-[var(--ghost-border)] text-on-surface-variant`}`,"aria-label":r,children:[(0,G.jsx)(n,{className:`h-3 w-3`}),` `,r]},e)})})),p(`Font`,`font`,(0,G.jsx)(`select`,{value:t.font,onChange:e=>f(`font`,e.target.value),className:`mt-2 h-8 w-full rounded-md border border-[var(--ghost-border)] bg-[var(--surface-container-lowest)] px-2 text-xs`,children:CO.map(e=>(0,G.jsx)(`option`,{value:e,children:MO[e]},e))})),p(`Density`,`density`,(0,G.jsx)(`div`,{className:`mt-2 grid grid-cols-3 gap-1.5`,children:wO.map(e=>(0,G.jsx)(`button`,{type:`button`,onClick:()=>f(`density`,e),className:`rounded-md border py-1 text-xs capitalize ${t.density===e?`border-primary text-on-surface`:`border-[var(--ghost-border)] text-on-surface-variant`}`,children:e},e))}))]})]})}function IO(){return Vs({queryKey:[`git-identity`],queryFn:({signal:e})=>$i(`/git/status`,{signal:e}),refetchInterval:Hs.GIT_IDENTITY,pollCategory:`standard`})}function LO(e){if(!e)return`?`;let t=e.trim();if(!t)return`?`;let n=t.split(/\s+/),r=n[0]??``;if(n.length===1)return r.slice(0,2).toUpperCase();let i=n[n.length-1]??``;return((r[0]??``)+(i[0]??``)).toUpperCase()}function RO({data:e,isPending:t,isError:n,className:r}){if(t||n||!e)return(0,G.jsxs)(`button`,{type:`button`,disabled:!0,"data-testid":`git-identity-pill`,className:J(`inline-flex items-center gap-2 rounded-md border border-outline-variant/30 bg-surface-container px-2 py-1 text-on-surface-variant`,r),title:n?`Failed to load git state`:`Loading git state`,children:[(0,G.jsx)(Go,{className:`h-3 w-3`}),(0,G.jsx)(`span`,{className:`font-mono text-xs`,children:`—`})]});let i=LO(e.author);return(0,G.jsxs)(`button`,{type:`button`,title:`${e.author} <${e.author_email}> · ${e.branch}${e.dirty?` (dirty)`:``}`,"data-testid":`git-identity-pill`,className:J(`inline-flex items-center gap-2 rounded-md border border-outline-variant/30 bg-surface-container px-2 py-1 hover:bg-surface-container-high transition-colors`,r),children:[(0,G.jsx)(Go,{className:`h-3 w-3 text-on-surface-variant`}),(0,G.jsxs)(`div`,{className:`flex flex-col items-start leading-tight`,children:[(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface`,children:e.branch}),(0,G.jsxs)(`span`,{className:`font-mono text-[10px] text-on-surface-variant inline-flex items-center gap-1`,children:[e.dirty&&(0,G.jsx)(`span`,{title:`working tree dirty`,className:`text-secondary`,children:`●`}),e.ahead>0&&(0,G.jsxs)(`span`,{title:`ahead of upstream`,children:[`↑`,e.ahead]}),e.behind>0&&(0,G.jsxs)(`span`,{title:`behind upstream`,children:[`↓`,e.behind]}),(0,G.jsx)(`span`,{children:e.author})]})]}),(0,G.jsx)(`span`,{className:`ml-1 inline-flex h-6 w-6 items-center justify-center rounded-full bg-primary/20 font-sans text-[10px] font-semibold text-primary`,children:i})]})}var zO={sage:`bg-primary`,ochre:`bg-secondary`,terracotta:`bg-tertiary`,outline:`bg-outline-variant`};function BO({tone:e,pulse:t=!1,sizePx:n=6,className:r}){return(0,G.jsx)(`span`,{"data-testid":`status-dot`,"data-tone":e,"data-pulsing":t?`true`:`false`,className:J(`inline-block rounded-full`,zO[e],t&&`animate-pulse`,r),style:{width:n,height:n},"aria-hidden":!0})}function VO(e){return e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`:`${Math.floor(e/86400)}d ${Math.floor(e%86400/3600)}h`}function HO({uptimeSeconds:e,version:t,className:n}){return(0,G.jsxs)(`div`,{className:J(`inline-flex items-center gap-2 rounded-md border border-outline-variant/30 bg-surface-container px-2 py-1`,n),title:t?`Daemon uptime · ${t}`:`Daemon uptime`,"aria-live":`polite`,children:[(0,G.jsx)(BO,{tone:`sage`}),(0,G.jsx)(`span`,{className:`font-sans text-[10px] uppercase tracking-wider text-on-surface-variant`,children:`daemon`}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface`,children:e===void 0?`—`:VO(e)}),t&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{"aria-hidden":!0,className:`text-on-surface-variant`,children:`·`}),(0,G.jsxs)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:[`v`,t]})]})]})}function UO({className:e}){let{data:t}=Zs();return(0,G.jsx)(HO,{uptimeSeconds:t?.daemon.uptime_seconds,version:t?.daemon.version,className:e})}function WO(e,t){return!t||t<=0?0:Math.floor(e/t*100)}function GO({describedCount:e,entriesCount:t,className:n}){let r=e!==void 0&&t!==void 0,i=r?WO(e,t):null,a=r&&i<100;return(0,G.jsxs)(`div`,{className:J(`inline-flex items-center gap-2 rounded-md border border-outline-variant/30 bg-surface-container px-2 py-1`,n),title:`Cortex (Canopy) describe coverage`,children:[(0,G.jsx)(BO,{tone:a?`ochre`:`sage`,pulse:a}),(0,G.jsx)(`span`,{className:`font-sans text-[10px] uppercase tracking-wider text-on-surface-variant`,children:`cortex`}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface`,children:i===null?`—`:`${i}%`})]})}function KO({className:e}){let{data:t}=Zs();return(0,G.jsx)(GO,{describedCount:t?.canopy.described_count,entriesCount:t?.canopy.entries_count,className:e})}var qO={"/":`Dashboard`,"/sessions":`Sessions`,"/cortex":`Cortex`,"/mycelium":`Mycelium`,"/skills":`Skills`,"/agent":`Agent`,"/settings":`Settings`,"/logs":`Logs`,"/machine":`Machine`,"/groves":`Groves`};function JO(e){let t=e,n=e.match(/^\/g\/[^/]+\/p\/[^/]+(\/.*)?$/);if(n)t=n[1]||`/`;else{let n=e.match(/^\/g\/[^/]+(\/.*)?$/);n&&(t=n[1]||`/`)}if(t===`/`)return[`Dashboard`];let r=t.split(`/`).filter(Boolean);return[qO[`/${r[0]}`]??r[0]]}function YO({onOpenSearch:e,onOpenNotifications:t,unreadCount:n,className:r}){let i=JO(An().pathname),a=IO();return(0,G.jsxs)(`header`,{className:J(`sticky top-0 z-20 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container/90 backdrop-blur px-4`,r),children:[(0,G.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`flex items-center gap-1 font-sans text-xs text-on-surface-variant`,children:i.map((e,t)=>(0,G.jsxs)(`span`,{className:J(t===i.length-1&&`text-on-surface`),children:[t>0&&(0,G.jsx)(`span`,{className:`mx-1`,children:`/`}),e]},t))}),(0,G.jsxs)(`button`,{type:`button`,onClick:e,"aria-label":`Search`,className:`ml-auto inline-flex h-7 items-center gap-2 rounded-md border border-outline-variant/30 bg-surface-container px-2 text-on-surface-variant hover:bg-surface-container-high transition-colors`,children:[(0,G.jsx)(_s,{className:`h-3 w-3`}),(0,G.jsx)(`span`,{className:`font-sans text-xs`,children:`Search`}),(0,G.jsxs)(`kbd`,{className:`inline-flex items-center gap-0.5 font-mono text-[10px] text-on-surface-variant/70`,children:[(0,G.jsx)(Oo,{className:`h-2.5 w-2.5`}),`K`]})]}),(0,G.jsx)(UO,{}),(0,G.jsx)(KO,{}),(0,G.jsx)(RO,{data:a.data,isPending:a.isPending,isError:a.isError}),(0,G.jsxs)(`button`,{type:`button`,onClick:t,"aria-label":`Notifications`,className:`relative rounded-md p-1.5 text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface transition-colors`,children:[(0,G.jsx)(lo,{className:`h-4 w-4`}),n>0&&(0,G.jsx)(`span`,{className:`absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary`})]})]})}var XO=[`Project`,`Observability`,`Grove management`,`Settings`],ZO=[{to:`/`,label:`Dashboard`,icon:Zo,scope:`project`,category:`Project`},{to:`/sessions`,label:`Sessions`,icon:is,scope:`project`,category:`Project`},{to:`/agent`,label:`Agent`,icon:fo,scope:`project`,category:`Project`},{to:`/cortex`,label:`Cortex`,icon:po,scope:`project`,category:`Project`},{to:`/mycelium`,label:`Mycelium`,icon:ss,scope:`project`,category:`Project`},{to:`/skills`,label:`Skills`,icon:Cs,scope:`project`,category:`Project`},{to:`/g/:groveSlug/operations`,label:`Operations`,icon:oo,scope:`grove`,category:`Observability`},{to:`/logs`,label:`Logs`,icon:gs,scope:`machine`,category:`Observability`},{to:`/g/:groveSlug/dashboard`,label:`Grove`,icon:As,scope:`grove`,category:`Grove management`},{to:`/groves`,label:`Groves`,icon:Wo,scope:`machine`,category:`Grove management`},{to:`/g/:groveSlug/team`,label:`Team`,icon:Ns,scope:`grove`,category:`Grove management`},{to:`/settings`,label:`Settings`,icon:bs,scope:`machine`,category:`Settings`}],QO=`myco-ui-sidebar-collapsed`,$O=768,ek=80,tk=2e3,nk=[`ring-2`,`ring-primary/40`,`bg-primary/5`];function rk(){let[e,t]=(0,W.useState)(()=>localStorage.getItem(QO)===`true`);return{collapsed:e,toggle:(0,W.useCallback)(()=>{t(e=>{let t=!e;return localStorage.setItem(QO,String(t)),t})},[])}}function ik(){let[e,t]=(0,W.useState)(!1),[n,r]=(0,W.useState)(()=>typeof window<`u`&&window.innerWidth<$O);return(0,W.useEffect)(()=>{let e=window.matchMedia(`(max-width: ${$O-1}px)`),n=e=>{r(e.matches),e.matches||t(!1)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),(0,W.useEffect)(()=>{t(!1)},[An().pathname]),(0,W.useEffect)(()=>{if(e)return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=``}},[e]),{open:e,isMobile:n,toggle:(0,W.useCallback)(()=>t(e=>!e),[]),close:(0,W.useCallback)(()=>t(!1),[])}}function ak({collapsed:e=!1}){let{restart:t,isRestarting:n}=ec();return(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(),disabled:n,title:e?n?`Restarting...`:`Restart Daemon`:void 0,className:J(`text-on-surface-variant hover:text-on-surface`,e?`w-8 p-0 justify-center`:`w-full justify-start gap-2`),children:[(0,G.jsx)(ms,{className:J(`h-4 w-4`,n&&`animate-spin`)}),!e&&(0,G.jsx)(`span`,{children:n?`Restarting...`:`Restart Daemon`})]})}function ok({collapsed:e}){let{data:t}=Zs(),n=t?.daemon.runtime;if(!n||n.source===`stable`)return null;let r=n.source===`dev`,i=r?`DEV`:`BETA`,a=r?`Daemon is running from a dev binary (make dev-link / npm link).`:`Daemon is running from the managed beta runtime under ~/.myco/runtime/.`,o=r?`bg-tertiary/20 text-tertiary border-tertiary/40`:`bg-secondary/20 text-secondary border-secondary/40`;return e?(0,G.jsx)(`div`,{className:J(`mx-auto flex h-5 w-8 items-center justify-center rounded border text-[10px] font-bold tracking-wider`,o),title:a,children:i}):(0,G.jsxs)(`div`,{className:J(`mx-2 flex items-center justify-center rounded border px-2 py-1 text-[11px] font-semibold tracking-wider`,o),title:a,children:[i,` runtime`]})}function sk({collapsed:e,onSearchOpen:t,onNotificationsOpen:n,unreadCount:r,onCollapseToggle:i,showCollapseToggle:a}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(sv,{collapsed:e}),(0,G.jsxs)(`div`,{className:`px-2 pt-2 pb-1 space-y-0.5`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:t,title:e?`Search (⌘K)`:void 0,className:J(`flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface`,e?`justify-center px-2 py-2`:`gap-3 px-3 py-2`),children:[(0,G.jsx)(_s,{className:`h-4 w-4 shrink-0`}),!e&&(0,G.jsx)(`span`,{className:`flex-1 text-left`,children:`Search`}),!e&&(0,G.jsxs)(`kbd`,{className:`text-xs text-on-surface-variant/60 font-mono`,children:[`⌘`,`K`]})]}),(0,G.jsxs)(`button`,{type:`button`,onClick:n,title:e?`Notifications`:void 0,className:J(`flex w-full items-center rounded-md text-sm text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface`,e?`justify-center px-2 py-2`:`gap-3 px-3 py-2`),children:[(0,G.jsx)(lo,{className:`h-4 w-4 shrink-0`}),!e&&(0,G.jsx)(`span`,{className:`flex-1 text-left`,children:`Notifications`}),r>0&&(0,G.jsx)(`span`,{className:J(`h-2 w-2 rounded-full bg-primary shrink-0`,!e&&`ml-auto`)})]})]}),(0,G.jsx)(`nav`,{className:`flex-1 space-y-1 px-2 py-2`,"aria-label":`Main navigation`,children:XO.map(t=>{let n=ZO.filter(e=>e.category===t);return n.length===0?null:(0,G.jsx)(ck,{label:t,collapsed:e,children:n.map(t=>(0,G.jsx)(uk,{item:t,collapsed:e},t.to))},t)})}),(0,G.jsxs)(`div`,{className:J(`py-3 space-y-2 mt-auto`,e?`px-1 flex flex-col items-center`:`px-2`),children:[(0,G.jsx)(ok,{collapsed:e}),!e&&(0,G.jsx)(FO,{collapsed:e}),(0,G.jsx)(ak,{collapsed:e})]}),a&&i&&(0,G.jsx)(`div`,{className:J(`px-2 py-2`,e&&`flex justify-center`),children:(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:i,className:J(`text-on-surface-variant hover:text-on-surface`,e?`w-8 p-0 justify-center`:`w-full justify-start gap-2`),title:e?`Expand sidebar`:`Collapse sidebar`,children:[e?(0,G.jsx)(_o,{className:`h-4 w-4`}):(0,G.jsx)(go,{className:`h-4 w-4`}),!e&&(0,G.jsx)(`span`,{children:`Collapse`})]})})]})}function ck({label:e,collapsed:t,children:n}){return(0,G.jsxs)(`div`,{role:`group`,"aria-label":e,className:J(`space-y-0.5`,t&&`border-t border-[var(--ghost-border)] pt-3 mt-3 first:border-t-0 first:pt-0 first:mt-0`),children:[!t&&(0,G.jsx)(`div`,{className:`px-3 pt-4 pb-1 text-[10px] uppercase tracking-wider text-on-surface-variant`,children:e}),n]})}function lk(e,t,n,r){if(e.scope===`project`)return n;if(e.scope===`machine`)return e.to;if(!e.to.includes(`:groveSlug`))return n;let i=t?.grove??Gi(r)?.grove??zi(r)?.grove??r[0];return i?e.to.replace(`:groveSlug`,i.slug):`/`}function uk({item:e,collapsed:t}){return(0,G.jsxs)(ii,{to:lk(e,xa(),Sa(e.to),tc().data?.groves??[]),end:e.to===`/`,title:t?e.label:void 0,className:({isActive:e})=>J(`flex items-center rounded-md text-sm font-medium transition-colors`,t?`justify-center px-2 py-2`:`gap-3 px-3 py-2`,e?`bg-primary/10 text-primary`:`text-on-surface-variant hover:bg-surface-container-high hover:text-on-surface`),children:[(0,G.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),!t&&e.label]})}function dk(e){let t=xa();(0,W.useEffect)(()=>{let n=t?.project.name??e??null;document.title=n?`${t?`${Ki(t.project.name)} `:``}${n} - Myco`:`Myco`},[t,e])}function fk(){let{collapsed:e,toggle:t}=rk(),{data:n}=Zs(),r=xa()?.project.name??n?.context.project.name??n?.vault.name;dk(r);let[i,a]=(0,W.useState)(!1),[o,s]=(0,W.useState)(!1),{data:c}=uv(),l=c?.count??0,u=ik();(0,W.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key===`k`&&(e.preventDefault(),a(e=>!e))};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[]),(0,W.useEffect)(()=>{if(!u.open)return;let e=e=>{e.key===`Escape`&&(e.preventDefault(),u.close())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[u.open,u.close]);let d=(0,W.useCallback)(()=>a(!0),[]),f=(0,W.useCallback)(()=>s(!0),[]),p=(0,W.useCallback)(()=>s(!1),[]);return(0,W.useEffect)(()=>{let e=new URLSearchParams(location.search),t=e.get(`configField`)??void 0,n=e.get(`configSection`)??void 0;if(!t&&!n)return;let r=window.setTimeout(()=>{let e=pk(t,n);e&&(e.scrollIntoView({behavior:`smooth`,block:`center`}),e.classList.add(...nk),window.setTimeout(()=>{e.classList.remove(...nk)},tk))},ek);return()=>window.clearTimeout(r)},[location.key,location.search]),(0,G.jsxs)(`div`,{className:`flex h-screen bg-background`,children:[(0,G.jsx)(ov,{open:i,onOpenChange:a}),(0,G.jsx)(Cv,{panelOpen:o}),(0,G.jsx)(vO,{open:o,onClose:p}),(0,G.jsx)(yO,{}),u.isMobile&&(0,G.jsxs)(`div`,{className:`fixed top-0 left-0 right-0 z-40 flex h-12 items-center gap-3 border-b border-outline-variant/20 bg-surface-container px-3`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:u.toggle,className:`rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface`,"aria-label":u.open?`Close navigation`:`Open navigation`,children:u.open?(0,G.jsx)(Is,{className:`h-5 w-5`}):(0,G.jsx)(rs,{className:`h-5 w-5`})}),(0,G.jsx)(`span`,{className:`font-serif text-base text-primary tracking-wider`,children:`myco`}),r&&(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline uppercase tracking-widest`,children:r}),(0,G.jsxs)(`div`,{className:`ml-auto flex items-center gap-1`,children:[(0,G.jsxs)(`button`,{type:`button`,onClick:f,className:`relative rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface`,"aria-label":`Notifications`,children:[(0,G.jsx)(lo,{className:`h-4 w-4`}),l>0&&(0,G.jsx)(`span`,{className:`absolute top-0.5 right-0.5 h-2 w-2 rounded-full bg-primary`})]}),(0,G.jsx)(`button`,{type:`button`,onClick:d,className:`rounded-md p-1.5 text-on-surface-variant transition-colors hover:bg-surface-container-high hover:text-on-surface`,"aria-label":`Search`,children:(0,G.jsx)(_s,{className:`h-4 w-4`})})]})]}),u.isMobile&&u.open&&(0,G.jsx)(`div`,{className:`fixed inset-0 z-40 bg-surface-dim/60 backdrop-blur-xs transition-opacity`,onClick:u.close,"aria-hidden":`true`}),u.isMobile&&(0,G.jsx)(`aside`,{className:J(`fixed top-12 left-0 bottom-0 z-50 w-64 flex flex-col bg-surface-container transition-transform duration-200 ease-out`,u.open?`translate-x-0`:`-translate-x-full`),children:(0,G.jsx)(sk,{collapsed:!1,onSearchOpen:d,onNotificationsOpen:f,unreadCount:l,showCollapseToggle:!1})}),!u.isMobile&&(0,G.jsx)(`aside`,{className:J(`flex flex-col bg-surface-container transition-[width] duration-200`,e?`w-14`:`w-56`),children:(0,G.jsx)(sk,{collapsed:e,onSearchOpen:d,onNotificationsOpen:f,unreadCount:l,onCollapseToggle:t,showCollapseToggle:!0})}),(0,G.jsxs)(`main`,{className:J(`flex-1 overflow-auto bg-surface`,u.isMobile&&`pt-12`),"aria-label":`Page content`,children:[!u.isMobile&&(0,G.jsx)(YO,{onOpenSearch:d,onOpenNotifications:f,unreadCount:l}),(0,G.jsx)(cr,{})]})]})}function pk(e,t){if(e){let t=e;for(;t.length>0;){let e=document.getElementById(Xa(t));if(e instanceof HTMLElement)return e;let n=t.lastIndexOf(`.`);if(n===-1)break;t=t.slice(0,n)}}if(t){let e=document.getElementById(t);if(e instanceof HTMLElement)return e}return null}var mk=0,hk=[],gk=new Set;function _k(){for(let e of gk)e(hk)}function vk(e){let t=++mk,n={...e,id:t};hk=[...hk,n],_k();let r=e.ttlMs??5e3;r>0&&setTimeout(()=>{hk=hk.filter(e=>e.id!==t),_k()},r)}function yk(){let[e,t]=(0,W.useState)(hk);return(0,W.useEffect)(()=>(gk.add(t),()=>{gk.delete(t)}),[]),e.length===0?null:(0,G.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`pointer-events-none fixed bottom-4 right-4 z-[60] flex w-full max-w-sm flex-col gap-2`,children:e.map(e=>(0,G.jsxs)(`div`,{className:J(`pointer-events-auto rounded-md border bg-surface-container-highest px-4 py-3 shadow-lg`,e.level===`success`&&`border-primary/30`,e.level===`error`&&`border-tertiary/40`,e.level===`info`&&`border-outline-variant/30`),children:[(0,G.jsx)(`div`,{className:`text-sm font-medium text-on-surface`,children:e.title}),e.detail&&(0,G.jsx)(`div`,{className:`mt-1 break-all font-mono text-xs text-on-surface-variant`,children:e.detail})]},e.id))})}var bk=Hs.SESSIONS,xk=Hs.SESSION_DETAIL,Sk=Hs.SESSION_DETAIL,Ck=3e4,wk=6e4,Tk=1e4,Ek=Hs.SESSION_DETAIL;function Dk(e){let t=new URLSearchParams;e?.status&&t.set(`status`,e.status),e?.agent&&t.set(`agent`,e.agent),e?.search&&t.set(`search`,e.search),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset));let n=t.toString(),r=n?`/sessions?${n}`:`/sessions`;return Vs({queryKey:[`sessions`,e],queryFn:({signal:e})=>$i(r,{signal:e}),pollCategory:`standard`,refetchInterval:bk})}function Ok(e){return Vs({queryKey:[`session`,e],queryFn:({signal:t})=>$i(`/sessions/${e}`,{signal:t}),enabled:e!==void 0,pollCategory:`standard`,refetchInterval:xk})}function kk(e,t=[`human`]){let n=t===`all`?``:`?origins=${t.join(`,`)}`;return Vs({queryKey:[`session-batches`,e,t===`all`?`all`:[...t].sort().join(`,`)],queryFn:({signal:t})=>$i(`/sessions/${e}/batches${n}`,{signal:t}),enabled:e!==void 0,pollCategory:`standard`,refetchInterval:Sk})}function Ak(e){return ot({queryKey:Ta([`batch-activities`,e]),queryFn:({signal:t})=>$i(`/batches/${e}/activities`,{signal:t}),enabled:e!==void 0,staleTime:Ck})}function jk(e){return ot({queryKey:Ta([`session-attachments`,e]),queryFn:({signal:t})=>$i(`/sessions/${e}/attachments`,{signal:t}),enabled:e!==void 0,staleTime:wk})}function Mk(){let e=We();return st({mutationFn:e=>la(`/sessions/${e}`),onSuccess:()=>{e.invalidateQueries({queryKey:[`sessions`]})}})}function Nk(){let e=We();return st({mutationFn:e=>sa(`/sessions/${e}/complete`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`session`,n]}),e.invalidateQueries({queryKey:[`sessions`]})}})}function Pk(e){return ot({queryKey:Ta([`session-impact`,e]),queryFn:({signal:t})=>$i(`/sessions/${e}/impact`,{signal:t}),enabled:e!==null,staleTime:Tk})}function Fk(e){return Vs({queryKey:[`session-plans`,e],queryFn:async({signal:t})=>(await $i(`/sessions/${e}/plans`,{signal:t})).plans,enabled:!!e,pollCategory:`standard`,refetchInterval:Ek})}function Ik(e){let t=We();return st({mutationFn:e=>la(`/plans/${e}`),onSuccess:()=>{t.invalidateQueries({queryKey:[`session-plans`,e]})}})}var Lk=Hs.RUNS_ACTIVE,Rk=Hs.RUN_DETAIL,zk=Hs.STATS,Bk=new Set([`completed`,`failed`,`skipped`]),Vk=Hs.STATS,Hk=6e4,Uk=50;function Wk(e){let t=e?.limit??Uk,n=new URLSearchParams;n.set(`limit`,String(t)),e?.offset!==void 0&&n.set(`offset`,String(e.offset)),e?.search&&n.set(`search`,e.search),e?.status&&n.set(`status`,e.status),e?.task&&n.set(`task`,e.task);let r=n.toString();return Vs({queryKey:[`agent-runs`,e],queryFn:({signal:e})=>$i(`/agent/runs?${r}`,{signal:e}),pollCategory:`standard`,refetchInterval:Lk})}function Gk(e){return ot({queryKey:Ta([`agent-run`,e]),queryFn:({signal:t})=>$i(`/agent/runs/${e}`,{signal:t}),enabled:e!==void 0,refetchInterval:e=>{let t=e.state.data?.run?.status;return t&&Bk.has(t)?!1:Rk}})}function Kk(e,t){let n=t?Bk.has(t):!1;return Vs({queryKey:[`agent-reports`,e],queryFn:({signal:t})=>$i(`/agent/runs/${e}/reports`,{signal:t}),enabled:e!==void 0,pollCategory:`standard`,refetchInterval:n?0:zk})}function qk(e,t){let n=t?Bk.has(t):!1;return Vs({queryKey:[`agent-turns`,e],queryFn:({signal:t})=>$i(`/agent/runs/${e}/turns`,{signal:t}),enabled:e!==void 0,pollCategory:`standard`,refetchInterval:n?0:Vk})}function Jk(){return ot({queryKey:Ta([`agent-tasks`]),queryFn:({signal:e})=>$i(`/agent/tasks`,{signal:e}),staleTime:Hk})}function Yk(e){return ot({queryKey:Ta([`agent-task`,e]),queryFn:({signal:t})=>$i(`/agent/tasks/${e}`,{signal:t}),enabled:e!==void 0,staleTime:Hk})}function Xk(){let e=We();return st({mutationFn:({taskId:e,name:t})=>sa(`/agent/tasks/${e}/copy`,t?{name:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`agent-tasks`]})}})}function Zk(){let e=We();return st({mutationFn:e=>la(`/agent/tasks/${e}`),onSuccess:()=>{e.invalidateQueries({queryKey:[`agent-tasks`]})}})}function Qk(e){return ot({queryKey:Ta([`agent-task-yaml`,e]),queryFn:({signal:t})=>$i(`/agent/tasks/${e}/yaml`,{signal:t}),enabled:e!==void 0,staleTime:Hk})}function $k(){let e=We();return st({mutationFn:({taskId:e,yaml:t})=>ca(`/agent/tasks/${e}`,{yaml:t}),onSuccess:()=>{e.invalidateQueries({queryKey:[`agent-tasks`]}),e.invalidateQueries({queryKey:[`agent-task`]}),e.invalidateQueries({queryKey:[`agent-task-yaml`]})}})}function eA(){let e=We();return st({mutationFn:e=>sa(`/agent/run`,e),onSuccess:()=>{e.invalidateQueries({queryKey:[`agent-runs`]})}})}function tA(){let e=We();return st({mutationFn:({runId:e,mode:t})=>sa(`/agent/runs/${e}/resume`,t?{mode:t}:{}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`agent-runs`]}),e.invalidateQueries({queryKey:[`agent-run`,n.runId]})}})}function nA(e){return Vs({queryKey:[`agent-run-write-intents`,e],queryFn:({signal:t})=>$i(`/agent/runs/${e}/write-intents`,{signal:t}),enabled:e!==null,pollCategory:`standard`,refetchInterval:!1})}function rA(e){return Vs({queryKey:[`agent-run-audit`,e],queryFn:({signal:t})=>$i(`/agent/runs/${e}/audit`,{signal:t}),enabled:e!==null,pollCategory:`standard`,refetchInterval:!1})}function iA(e,t){let n=new URLSearchParams;n.set(`agentId`,e),n.set(`tier`,String(t));let r=n.toString();return Vs({queryKey:[`digest-revisions`,e,t],queryFn:({signal:e})=>$i(`/digest/revisions?${r}`,{signal:e}),enabled:!!e&&Number.isFinite(t),pollCategory:`standard`,refetchInterval:!1})}function aA(){let e=We();return st({mutationFn:({revisionId:e,runId:t})=>sa(`/digest/revisions/${e}/restore`,t?{runId:t}:{}),onSuccess:()=>{e.invalidateQueries({queryKey:[`digest-revisions`]})}})}function oA(e){return{id:e.id,agent_id:e.agent_id,task:e.task,instruction:e.instruction,status:e.status,harness:e.harness,provider:e.provider,model:e.model,session_ref:e.session_ref,started_at:e.started_at,completed_at:e.completed_at,tokens_used:e.tokens_used,cost_usd:e.cost_usd,usage_data:e.usage_data,error:e.error,dry_run:e.dry_run??!1,reasoning_level:e.reasoning_level??null,execution_overrides:e.execution_overrides??null,write_intents:e.write_intents,duration_ms:e.duration_ms}}function sA(e){let t=xa(),n=it({queries:e.map(e=>({queryKey:wa(t,[`agent-run`,e]),queryFn:({signal:t})=>$i(`/agent/runs/${e}`,{signal:t}),enabled:!!e}))}),r=[],i=[],a=!1;for(let e of n){e.isLoading&&(a=!0),e.error&&i.push(e.error);let t=e.data?.run;t&&r.push(oA(t))}return{runs:r,isLoading:a,errors:i,isError:i.length>0}}function cA(e){let t=new URLSearchParams;e?.status&&t.set(`status`,e.status),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset));let n=t.toString(),r=n?`/skill-candidates?${n}`:`/skill-candidates`;return ot({queryKey:Ta([`skill-candidates`,e]),queryFn:({signal:e})=>$i(r,{signal:e})})}function lA(){let e=We();return st({mutationFn:({id:e,...t})=>ca(`/skill-candidates/${e}`,t),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-candidates`]})}})}function uA(e){let t=new URLSearchParams;e?.status&&t.set(`status`,e.status),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset));let n=t.toString(),r=n?`/skill-records?${n}`:`/skill-records`;return ot({queryKey:Ta([`skill-records`,e]),queryFn:({signal:e})=>$i(r,{signal:e})})}function dA(e){return ot({queryKey:Ta([`skill-record`,e]),queryFn:({signal:t})=>$i(`/skill-records/${e}`,{signal:t}),enabled:!!e})}function fA(){let e=We();return st({mutationFn:e=>la(`/skill-records/${encodeURIComponent(e)}`),onSuccess:()=>{e.invalidateQueries({queryKey:[`skill-records`]}),e.invalidateQueries({queryKey:[`skill-record`]})}})}var pA=6e4,mA=36e5,hA=3e4;function gA(e,t,n=``){return e?.myco_tool_calls?e.myco_tool_calls.find(e=>e.tool_name===t&&e.op===n)?.count??0:0}async function _A(e,t){try{return await $i(e,{signal:t})}catch(e){if(e instanceof ma&&e.status===404)return null;throw e}}function vA(e){return ot({queryKey:Ta([`session-canopy`,e]),queryFn:({signal:t})=>_A(`/sessions/${e}/canopy`,t),enabled:e!==void 0,staleTime:pA,retry:(e,t)=>t instanceof ma&&t.status===404?!1:e<2})}function yA(e){let t=new URLSearchParams;e.limit!==void 0&&t.set(`limit`,String(e.limit)),e.offset!==void 0&&t.set(`offset`,String(e.offset)),e.language!==void 0&&t.set(`language`,e.language),e.described!==void 0&&t.set(`described`,String(e.described)),e.embedded!==void 0&&t.set(`embedded`,String(e.embedded)),e.path_prefix!==void 0&&t.set(`path_prefix`,e.path_prefix),e.q!==void 0&&e.q!==``&&t.set(`q`,e.q),e.sort_by!==void 0&&t.set(`sort_by`,e.sort_by),e.sort_dir!==void 0&&t.set(`sort_dir`,e.sort_dir);let n=t.toString();return n?`?${n}`:``}function bA(e){return ot({queryKey:Ta([`canopy-entries`,e.limit??null,e.offset??null,e.language??null,e.described??null,e.embedded??null,e.path_prefix??null,e.q??null,e.sort_by??null,e.sort_dir??null]),queryFn:({signal:t})=>$i(`/canopy/entries${yA(e)}`,{signal:t}),staleTime:hA,refetchInterval:Hs.CANOPY_ENTRIES})}function xA(e){return ot({queryKey:Ta([`canopy-entry`,e]),queryFn:({signal:t})=>_A(`/canopy/entries/${encodeURIComponent(e??``)}`,t),enabled:typeof e==`string`&&e.length>0,staleTime:hA,retry:(e,t)=>t instanceof ma&&t.status===404?!1:e<2})}function SA(){let e=We();return st({mutationFn:async e=>sa(`/canopy/entries/${encodeURIComponent(e)}/reembed`),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`canopy-entries`]}),e.invalidateQueries({queryKey:[`canopy-entry`,n]})}})}function CA(){let e=We();return st({mutationFn:async e=>sa(`/canopy/entries/${encodeURIComponent(e)}/redescribe`,{}),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:[`canopy-entries`]}),e.invalidateQueries({queryKey:[`canopy-entry`,n]})}})}var wA=3e4;function TA(){return ot({queryKey:Ta([`canopy-map`]),queryFn:({signal:e})=>$i(`/canopy/map`,{signal:e}),staleTime:wA})}function EA(){let e=We();return st({mutationFn:async e=>sa(`/canopy/map/regenerate`,{force_cold_start:e.force_cold_start===!0}),onSuccess:()=>{e.invalidateQueries({queryKey:[`canopy-map`]})}})}function DA(e,t){return ot({queryKey:Ta([`canopy-tool-call-blob`,e,t]),queryFn:({signal:n})=>_A(`/sessions/${e}/canopy/tool-calls/${t}/blob`,n),enabled:e!==void 0&&t!==void 0,staleTime:mA,retry:(e,t)=>t instanceof ma&&t.status===404?!1:e<2})}function OA({isLoading:e,error:t,loadingText:n=`Loading...`,children:r}){return e?(0,G.jsxs)(`div`,{className:`flex h-64 items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(es,{className:`h-5 w-5 animate-spin`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:n})]}):t?(0,G.jsxs)(`div`,{className:`flex h-64 flex-col items-center justify-center gap-2 text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to connect to daemon`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:t.message})]}):(0,G.jsx)(G.Fragment,{children:r})}var kA={default:`w-full`,narrow:`mx-auto w-full max-w-3xl`},AA=(0,W.forwardRef)(({variant:e=`default`,className:t,children:n,...r},i)=>(0,G.jsx)(`div`,{ref:i,className:J(`flex flex-col gap-6 p-6`,kA[e],t),...r,children:n}));AA.displayName=`PageContainer`;var jA=oc(`rounded-xl bg-surface-container-low border border-outline-variant`,{variants:{accent:{sage:`border-t-2 border-t-sage`,ochre:`border-t-2 border-t-ochre`,terra:`border-t-2 border-t-terracotta`,outline:`border-t-2 border-t-outline-variant`},padded:{true:`p-4`,false:``}},defaultVariants:{accent:`sage`,padded:!1}}),MA=(0,W.forwardRef)(({className:e,accent:t,padded:n,...r},i)=>(0,G.jsx)(`div`,{ref:i,className:J(jA({accent:t,padded:n}),e),...r}));MA.displayName=`AccentSurface`;var NA=oc(`inline-flex items-center myco-eyebrow`,{variants:{tone:{default:`text-outline`,sage:`text-sage`,ochre:`text-ochre`,terra:`text-terracotta`,outline:`text-outline`},size:{sm:`myco-eyebrow-sm`,md:`myco-eyebrow`}},defaultVariants:{tone:`default`,size:`md`}}),PA=(0,W.forwardRef)(({className:e,tone:t,size:n,...r},i)=>(0,G.jsx)(`span`,{ref:i,className:J(NA({tone:t,size:n}),e),...r}));PA.displayName=`Eyebrow`;var FA=(0,W.forwardRef)(({tone:e=`sage`,eyebrow:t,title:n,actions:r,footer:i,padded:a=!0,className:o,children:s,...c},l)=>{let u=t!=null||n!=null||r!=null;return(0,G.jsxs)(MA,{ref:l,accent:e,className:J(`flex flex-col`,o),...c,children:[u&&(0,G.jsxs)(`header`,{className:J(`flex items-start justify-between gap-3`,a?`px-5 pt-4`:`px-5 py-4`),children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0`,children:[t!=null&&(0,G.jsx)(PA,{tone:e,children:t}),n!=null&&(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:n})]}),r!=null&&(0,G.jsx)(`div`,{className:`flex items-center gap-2 shrink-0`,children:r})]}),s!=null&&(0,G.jsx)(`div`,{className:J(a?`px-5 py-4`:``),children:s}),i!=null&&(0,G.jsx)(`footer`,{className:`border-t border-[var(--ghost-border)] px-5 py-3`,children:i})]})});FA.displayName=`Panel`;function IA({data:e,widthPx:t=56,heightPx:n=16,barClassName:r=`fill-primary/60`,ariaLabel:i=`Activity sparkline`,className:a}){let o=e.length;if(o===0)return(0,G.jsx)(`svg`,{role:`img`,"aria-label":i,width:t,height:n,className:J(`inline-block`,a)});let s=Math.max(...e,1),c=Math.max(1,(t-1*(o-1))/o);return(0,G.jsx)(`svg`,{role:`img`,"aria-label":i,width:t,height:n,className:J(`inline-block`,a),children:e.map((e,t)=>{let i=s===0?0:Math.round(e/s*n);return(0,G.jsx)(`rect`,{x:t*(c+1),y:n-i,width:c,height:i,className:r,rx:.5},t)})})}var LA=oc(`flex flex-col gap-1 rounded-md bg-surface-container-lowest border border-[var(--ghost-border)] px-4 py-3`,{variants:{tone:{default:``,sage:`border-t-2 border-t-sage`,ochre:`border-t-2 border-t-ochre`,terra:`border-t-2 border-t-terracotta`}},defaultVariants:{tone:`default`}}),RA=(0,W.forwardRef)(({label:e,value:t,sub:n,tone:r,mono:i=!1,sparklineData:a,className:o,...s},c)=>(0,G.jsxs)(`div`,{ref:c,className:J(LA({tone:r}),o),...s,children:[(0,G.jsx)(PA,{size:`sm`,children:e}),(0,G.jsxs)(`div`,{className:J(`flex items-end justify-between gap-2`),children:[(0,G.jsx)(`div`,{className:J(i?`font-mono text-base leading-tight text-on-surface`:`myco-display-md text-on-surface`),children:t}),a&&a.length>=2&&(0,G.jsx)(IA,{data:a,widthPx:80,heightPx:20,className:`opacity-60 shrink-0`})]}),n!=null&&(0,G.jsx)(`div`,{className:`font-mono text-[10px] text-outline`,children:n})]}));RA.displayName=`MetricCard`;var zA=3600,BA=86400,VA=1e3;function HA(e){return e<60?`${Math.floor(e)}s`:e<3600?`${Math.floor(e/60)}m`:e<86400?`${Math.floor(e/zA)}h ${Math.floor(e%zA/60)}m`:`${Math.floor(e/BA)}d ${Math.floor(e%BA/zA)}h`}function UA(e){let t=(Date.now()-new Date(e).getTime())/VA;return t<60?`just now`:t<3600?`${Math.floor(t/60)}m ago`:t<86400?`${Math.floor(t/zA)}h ago`:`${Math.floor(t/BA)}d ago`}function WA(e){return UA(new Date(e*VA).toISOString())}function GA(e){return new Date(e*VA).toLocaleString()}function KA(e,t){return e?e.length>t?e.slice(0,t)+`…`:e:``}function qA(e){return e?e.slice(0,8):``}function JA(e){return e.split(`/`).pop()||e}function YA(e){return e.charAt(0).toUpperCase()+e.slice(1)}function XA(e,t){if(e===null||t===null)return`—`;let n=(t-e)*VA;return n<VA?`${n}ms`:n<60*VA?`${(n/VA).toFixed(1)}s`:`${Math.floor(n/(60*VA))}m ${Math.floor(n%(60*VA)/VA)}s`}function ZA(e){return e===null?`—`:e<VA?`${e}ms`:`${(e/VA).toFixed(1)}s`}function QA(e){return e===null?`—`:WA(e)}var $A=1024,ej=[`KB`,`MB`,`GB`,`TB`];function tj(e){if(e<$A)return`${e} B`;let t=e/$A,n=0;for(;t>=$A&&n<ej.length-1;)t/=$A,n++;let r=t>=100?0:1;return`${t.toFixed(r)} ${ej[n]}`}var nj=6,rj=6,ij=6,aj=6;function oj(e){return e===`running`?`sage`:e===`failed`||e===`error`?`terracotta`:e===`completed`||e===`succeeded`?`outline`:`ochre`}function sj(){let{data:e,isLoading:t,isError:n,error:r}=Zs(),{data:i}=Dk({status:`active`,limit:nj}),{data:a}=Wk({limit:rj}),{data:o}=uA({limit:ij}),{data:s}=bA({limit:aj,sort_by:`llm_updated_at`,sort_dir:`desc`});return(0,G.jsx)(OA,{isLoading:t,error:n?r instanceof Error?r:Error(`Unable to reach daemon`):null,loadingText:`Connecting to daemon...`,children:e&&(0,G.jsxs)(AA,{className:`gap-8`,children:[(0,G.jsx)(cj,{stats:e,activeSessionCount:i?.total??0,inFlightRunCount:(a?.runs??[]).filter(e=>e.status===`running`).length}),(0,G.jsx)(uj,{stats:e}),(0,G.jsx)(mj,{sessions:i?.sessions??[],totalSporeCount:e.vault.spore_count,totalActiveCount:i?.total??0}),(0,G.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-2 gap-6`,children:[(0,G.jsx)(gj,{runs:a?.runs??[]}),(0,G.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,G.jsx)(vj,{skills:o?.records??[]}),(0,G.jsx)(yj,{entries:s?.rows??[]})]})]})]})})}function cj({stats:e,activeSessionCount:t,inFlightRunCount:n}){let r=e.context.project.name||JA(e.context.project.root),i=lj(t,n,e.embedding.queue_depth);return(0,G.jsx)(`header`,{className:`flex items-start justify-between gap-4 flex-wrap`,children:(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0`,children:[(0,G.jsx)(PA,{children:r}),(0,G.jsx)(`h1`,{className:`myco-display-lg text-on-surface m-0`,children:`Dashboard`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant m-0`,children:i})]})})}function lj(e,t,n){let r=[];return e>0&&r.push(`${e} ${e===1?`active session`:`active sessions`}`),t>0&&r.push(`${t} ${t===1?`run`:`runs`} running`),n>0&&r.push(`${n} in the embed queue`),r.length===0?`Quiet right now — nothing running.`:r.join(` · `)}function uj({stats:e}){return(0,G.jsxs)(`section`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,G.jsx)(fj,{stats:e}),(0,G.jsx)(pj,{stats:e})]})}function dj({accent:e,Icon:t,eyebrow:n,name:r,sub:i,children:a}){let o=e===`sage`?`text-sage`:e===`ochre`?`text-ochre`:`text-terracotta`,s=e===`sage`?`sage`:e===`ochre`?`ochre`:`default`;return(0,G.jsxs)(MA,{accent:e,className:`p-5 flex flex-col gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-1 min-w-0`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(t,{className:J(`h-3.5 w-3.5`,o)}),(0,G.jsx)(PA,{tone:s,children:n})]}),(0,G.jsx)(`div`,{className:`myco-display-md text-on-surface truncate`,title:r,children:r}),(0,G.jsx)(`div`,{className:`font-mono text-[10px] text-outline truncate`,title:i,children:i})]}),(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:a})]})}function fj({stats:e}){return(0,G.jsxs)(dj,{accent:`sage`,Icon:cs,eyebrow:`Project`,name:e.context.project.name||JA(e.context.project.root),sub:e.context.project.root,children:[(0,G.jsx)(RA,{label:`Sessions`,value:e.vault.session_count.toLocaleString(),tone:`sage`}),(0,G.jsx)(RA,{label:`Spores`,value:e.vault.spore_count.toLocaleString()}),(0,G.jsx)(RA,{label:`Plans`,value:e.vault.plan_count.toLocaleString()}),(0,G.jsx)(RA,{label:`Canopy`,value:`${e.canopy.described_count}/${e.canopy.entries_count}`,sub:`described`,mono:!0})]})}function pj({stats:e}){let t=e.context.grove,n=t.name??`Local only`,r=t.slug?`${t.mode??`local`} · ${t.connection_state}`:`no grove bound`,i=e.embedding.total_embeddable,a=e.embedding.embedded_count,o=e.embedding.queue_depth;return(0,G.jsxs)(dj,{accent:`ochre`,Icon:As,eyebrow:`Grove`,name:n,sub:r,children:[(0,G.jsx)(RA,{label:`Embeddings`,value:i>0?`${a}/${i}`:`—`,sub:i>0?`embedded`:`no items`,mono:!0,tone:`ochre`}),(0,G.jsx)(RA,{label:`Embed queue`,value:o.toLocaleString(),sub:o>0?`pending`:`idle`})]})}function mj({sessions:e,totalSporeCount:t,totalActiveCount:n}){let r=Nn(),i=Ca(),a=n===0?`No active sessions`:`${n} ${n===1?`active session`:`active sessions`}`;return(0,G.jsxs)(FA,{tone:`sage`,eyebrow:`Active sessions · ${n}`,title:a,children:[e.length===0?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant m-0`,children:`Sessions appear here when a symbiont starts a new conversation.`}):(0,G.jsx)(`div`,{className:`space-y-2`,children:e.map((e,t)=>(0,G.jsx)(hj,{session:e,accent:[`sage`,`ochre`,`terra`][t%3],onClick:()=>r(i(`/sessions/${e.id}`))},e.id))}),(0,G.jsxs)(`div`,{className:`mt-4 flex items-center justify-between border-t border-[var(--ghost-border)] pt-3 text-xs font-mono text-outline`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`span`,{className:`text-on-surface tabular-nums`,children:t.toLocaleString()}),` spores total`]}),(0,G.jsxs)(`button`,{type:`button`,onClick:()=>r(i(`/sessions`)),className:`inline-flex items-center gap-1 text-sage hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40 rounded`,children:[`View session archive`,(0,G.jsx)(co,{className:`h-3 w-3`})]})]})]})}function hj({session:e,accent:t,onClick:n}){return(0,G.jsxs)(`button`,{type:`button`,onClick:n,className:J(`w-full text-left rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-4 py-3 transition-colors`,`hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,t===`sage`&&`border-l-2 border-l-sage`,t===`ochre`&&`border-l-2 border-l-ochre`,t===`terra`&&`border-l-2 border-l-terracotta`),children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(BO,{tone:e.status===`active`?`sage`:`ochre`,pulse:e.status===`active`}),(0,G.jsx)(`span`,{className:`font-serif italic text-sm text-on-surface truncate flex-1 min-w-0`,children:e.title||`Untitled session`}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline whitespace-nowrap`,children:WA(e.started_at)})]}),(0,G.jsxs)(`div`,{className:`mt-1 font-mono text-[11px] text-on-surface-variant flex items-center gap-3 flex-wrap`,children:[(0,G.jsx)(`span`,{children:e.agent}),e.branch&&(0,G.jsxs)(`span`,{children:[`· `,e.branch]}),(0,G.jsxs)(`span`,{children:[`· `,e.prompt_count,`p · `,e.tool_count,`t`]}),e.activity_buckets&&e.activity_buckets.length>1&&(0,G.jsx)(`span`,{className:`ml-auto`,children:(0,G.jsx)(IA,{data:e.activity_buckets,widthPx:64,heightPx:14})})]})]})}function gj({runs:e}){let t=Nn(),n=Ca(),r=[...e].sort((e,t)=>e.status===`running`&&t.status!==`running`?-1:e.status!==`running`&&t.status===`running`?1:(t.started_at??0)-(e.started_at??0));return(0,G.jsx)(FA,{accent:`terra`,eyebrow:`Agent runs`,title:`Recent`,actions:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(n(`/agent`)),className:`inline-flex items-center gap-1 text-xs font-sans text-on-surface-variant hover:text-on-surface`,children:[`All runs `,(0,G.jsx)(co,{className:`h-3 w-3`})]}),children:r.length===0?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant m-0`,children:`No agent runs yet for this project.`}):(0,G.jsx)(`ul`,{className:`m-0 p-0 list-none flex flex-col gap-2`,children:r.map(e=>(0,G.jsx)(_j,{run:e,onClick:()=>t(n(`/agent?runId=${e.id}`))},e.id))})})}function _j({run:e,onClick:t}){let n=oj(e.status),r=e.task??`untitled task`,i=e.tokens_used??0;return(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,onClick:t,className:`w-full text-left rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2 transition-colors hover:bg-surface-container focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(BO,{tone:n,pulse:e.status===`running`}),(0,G.jsx)(`span`,{className:`font-sans text-sm text-on-surface truncate flex-1 min-w-0`,children:r}),e.dry_run&&(0,G.jsx)(`span`,{className:`font-mono text-[9px] uppercase tracking-wider text-ochre bg-ochre/10 px-1.5 rounded`,children:`dry`}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline whitespace-nowrap`,children:e.status})]}),(0,G.jsxs)(`div`,{className:`mt-1 font-mono text-[10px] text-outline flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(`span`,{children:e.id.slice(0,8)}),e.started_at&&(0,G.jsxs)(`span`,{children:[`· `,WA(e.started_at)]}),i>0&&(0,G.jsxs)(`span`,{children:[`· `,i.toLocaleString(),` tok`]}),e.model&&(0,G.jsxs)(`span`,{children:[`· `,e.model]})]})]})})}function vj({skills:e}){let t=Nn(),n=Ca(),r=[...e].sort((e,t)=>t.updated_at-e.updated_at);return(0,G.jsx)(FA,{accent:`sage`,eyebrow:`Skills`,title:`Recently evolved`,actions:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(n(`/skills`)),className:`inline-flex items-center gap-1 text-xs font-sans text-on-surface-variant hover:text-on-surface`,children:[`Curate `,(0,G.jsx)(co,{className:`h-3 w-3`})]}),children:r.length===0?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant m-0`,children:`No skills yet. The agent surfaces candidates as you work.`}):(0,G.jsx)(`ul`,{className:`m-0 p-0 list-none grid grid-cols-1 sm:grid-cols-2 gap-2`,children:r.map(e=>(0,G.jsxs)(`li`,{className:`rounded-md border border-[var(--ghost-border)] bg-surface-container-lowest px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,G.jsx)(Cs,{className:`h-3 w-3 text-sage shrink-0`}),(0,G.jsx)(`span`,{className:`font-sans text-xs font-medium text-on-surface truncate`,title:e.display_name,children:e.display_name||e.name}),(0,G.jsxs)(`span`,{className:`ml-auto font-mono text-[9px] uppercase tracking-wider text-ochre bg-ochre/10 px-1.5 rounded shrink-0`,children:[`gen `,e.generation]})]}),(0,G.jsx)(`div`,{className:`mt-1 font-mono text-[10px] text-outline`,children:WA(e.updated_at)})]},e.id))})})}function yj({entries:e}){let t=Nn(),n=Ca();return(0,G.jsx)(FA,{accent:`ochre`,eyebrow:`Canopy`,title:`Recent entries`,actions:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>t(n(`/cortex?tab=canopy`)),className:`inline-flex items-center gap-1 text-xs font-sans text-on-surface-variant hover:text-on-surface`,children:[`Open Cortex `,(0,G.jsx)(co,{className:`h-3 w-3`})]}),children:e.length===0?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant m-0`,children:`Canopy hasn't summarized any files yet.`}):(0,G.jsx)(`ul`,{className:`m-0 p-0 list-none flex flex-col gap-1.5`,children:e.map(e=>(0,G.jsxs)(`li`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(Lo,{className:`h-3 w-3 text-outline shrink-0`}),(0,G.jsx)(`span`,{className:`font-mono truncate flex-1 min-w-0 text-on-surface`,title:e.path,children:e.path}),e.language&&(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline whitespace-nowrap`,children:e.language}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline whitespace-nowrap`,children:e.llm_updated_at?WA(e.llm_updated_at):WA(e.mechanical_updated_at)})]},e.path))})})}function bj(e){let[t,n]=(0,W.useState)(()=>typeof window>`u`?!1:window.matchMedia(e).matches);return(0,W.useEffect)(()=>{if(typeof window>`u`)return;let t=window.matchMedia(e),r=e=>n(e.matches);return n(t.matches),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var xj=`(min-width: 768px)`,Sj=240,Cj=360;function wj({master:e,detail:t,hasSelection:n,onCloseMobileDetail:r,railMinWidthPx:i=Sj,railMaxWidthPx:a=Cj,className:o,masterAriaLabel:s=`List`,detailAriaLabel:c=`Details`}){return bj(xj)?(0,G.jsxs)(`div`,{className:J(`flex h-full w-full`,o),children:[(0,G.jsx)(`aside`,{"aria-label":s,className:`flex-shrink-0 overflow-y-auto border-r border-outline-variant/20`,style:{minWidth:i,maxWidth:a,width:`clamp(${i}px, 30vw, ${a}px)`},children:e}),(0,G.jsx)(`section`,{"aria-label":c,className:`flex-1 overflow-y-auto p-6`,children:t})]}):n?(0,G.jsxs)(`section`,{role:`region`,"aria-label":c,className:J(`flex h-full w-full flex-col`,o),children:[r&&(0,G.jsxs)(`button`,{type:`button`,onClick:r,className:`sticky top-0 z-10 flex items-center gap-1 border-b border-outline-variant/20 bg-surface-container px-3 py-2 text-sm text-on-surface-variant hover:bg-surface-container-high`,children:[(0,G.jsx)(go,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{children:`Back`})]}),(0,G.jsx)(`div`,{className:`flex-1 overflow-y-auto p-6`,children:t})]}):(0,G.jsx)(`section`,{role:`region`,"aria-label":s,className:J(`h-full w-full overflow-y-auto`,o),children:e})}function Tj({message:e,className:t}){return(0,G.jsx)(`div`,{className:J(`flex h-full w-full items-center justify-center text-on-surface-variant`,t),children:(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:e})})}function Ej({searchPlaceholder:e=`Search...`,searchValue:t,onSearchChange:n,filters:r=[],filterValues:i={},onFilterChange:a,inputRef:o,count:s,className:c}){return(0,G.jsxs)(`div`,{className:J(`flex items-center gap-3 px-4 py-2.5 rounded-md bg-surface-container-low border border-[var(--ghost-border)]`,c),children:[(0,G.jsx)(_s,{className:`h-4 w-4 text-on-surface-variant shrink-0`}),(0,G.jsx)(cp,{ref:o,placeholder:e,value:t,onChange:e=>n(e.target.value),className:`bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1 min-w-[200px]`,"aria-label":e}),r.map(e=>(0,G.jsx)(`div`,{className:`w-44 shrink-0`,children:(0,G.jsxs)(w_,{value:i[e.key]??`all`,onValueChange:t=>a?.(e.key,t),children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{placeholder:e.label})}),(0,G.jsx)(D_,{children:e.options.map(e=>(0,G.jsx)(O_,{value:e.value,children:e.label},e.value))})]})},e.key)),s!=null&&(0,G.jsx)(`span`,{className:`myco-eyebrow-sm shrink-0`,children:s})]})}var Dj=oc(`rounded-md transition-colors`,{variants:{level:{lowest:`bg-surface-container-lowest`,low:`bg-surface-container-low`,default:`bg-surface-container`,high:`bg-surface-container-high`,highest:`bg-surface-container-highest`,bright:`bg-surface-bright`},interactive:{true:`cursor-pointer hover-lift hover:brightness-[1.08]`,false:``},ghostBorder:{true:`border border-[var(--ghost-border)]`,false:``},glass:{true:`backdrop-blur-xl bg-surface-variant/60`,false:``},glow:{true:`shadow-[inset_0_0_12px_rgba(171,207,184,0.2)]`,false:``},accent:{none:``,sage:`border-t-2 border-t-sage`,ochre:`border-t-2 border-t-ochre`,terra:`border-t-2 border-t-terracotta`,outline:`border-t-2 border-t-outline-variant`}},defaultVariants:{level:`low`,interactive:!1,ghostBorder:!1,glass:!1,glow:!1,accent:`none`}}),Q=(0,W.forwardRef)(({className:e,level:t,interactive:n,ghostBorder:r,glass:i,glow:a,accent:o,...s},c)=>(0,G.jsx)(`div`,{ref:c,className:J(Dj({level:t,interactive:n,ghostBorder:r,glass:i,glow:a,accent:o}),e),...s}));Q.displayName=`Surface`;var Oj={sage:`bg-sage/[0.08] shadow-[inset_2px_0_0_var(--sage)]`,ochre:`bg-ochre/[0.08] shadow-[inset_2px_0_0_var(--ochre)]`,terra:`bg-terracotta/[0.08] shadow-[inset_2px_0_0_var(--terracotta)]`},kj={sage:`bg-surface-container/60 ring-1 ring-inset ring-sage/30`,ochre:`bg-surface-container/60 ring-1 ring-inset ring-ochre/30`,terra:`bg-surface-container/60 ring-1 ring-inset ring-terracotta/30`},Aj=(0,W.forwardRef)(({accent:e=`sage`,isActive:t=!1,isCursor:n=!1,interactive:r,onClick:i,className:a,children:o,onKeyDown:s,...c},l)=>{let u=r??typeof i==`function`;function d(e){u&&i&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i()),s?.(e)}return(0,G.jsx)(`div`,{ref:l,onClick:u?i:void 0,onKeyDown:u?d:s,tabIndex:u?0:void 0,role:u?`row`:void 0,"aria-selected":u?t:void 0,"data-active":t||void 0,"data-cursor":n||void 0,className:J(`relative border-b border-[var(--ghost-border)] last:border-b-0 px-4 py-3 transition-colors duration-100`,u&&`cursor-pointer hover:bg-surface-container focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sage/40`,t&&Oj[e],n&&!t&&kj[e],a),...c,children:o})});Aj.displayName=`Row`;function jj({open:e,onOpenChange:t,title:n,description:r,icon:i,meta:a,impact:o,confirmLabel:s=`Confirm`,variant:c=`destructive`,onConfirm:l,isPending:u=!1,errorMessage:d=null}){return(0,G.jsx)($f,{open:e,onOpenChange:t,children:(0,G.jsxs)(rp,{className:`sm:max-w-md border border-outline-variant/20 [&>button:last-child]:hidden`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3`,children:[i&&(0,G.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-tertiary/15`,children:i}),(0,G.jsx)(op,{children:n})]}),(0,G.jsx)(sp,{children:r})]}),a&&a.length>0&&(0,G.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg border border-outline-variant/20 px-4 py-3`,children:[(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface-variant bg-surface-container px-1.5 py-0.5 rounded shrink-0`,children:a[0]?.value}),a.length>1&&(0,G.jsx)(`span`,{className:`text-sm font-medium text-on-surface truncate`,children:a[1]?.value})]}),o&&o.length>0&&(0,G.jsx)(`div`,{className:`grid grid-cols-2 gap-2`,children:o.map(e=>(0,G.jsxs)(`div`,{className:`rounded-md border border-outline-variant/20 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`font-sans text-[10px] font-medium uppercase tracking-wider text-on-surface-variant`,children:e.label}),(0,G.jsx)(`div`,{className:`font-sans text-base font-medium text-on-surface`,children:e.value})]},e.label))}),d&&(0,G.jsx)(`p`,{className:`text-sm text-tertiary`,"data-testid":`confirm-dialog-error`,role:`alert`,children:d}),(0,G.jsxs)(ap,{children:[(0,G.jsx)(Y,{variant:`secondary`,size:`sm`,onClick:()=>t(!1),disabled:u,children:`Cancel`}),(0,G.jsxs)(Y,{variant:c,size:`sm`,onClick:l,disabled:u,className:`gap-2`,children:[u&&(0,G.jsx)(es,{className:`h-4 w-4 animate-spin`}),s]})]})]})})}function Mj({total:e,offset:t,limit:n,onPageChange:r}){if(Math.ceil(e/n)<=1)return null;let i=t>0,a=t+n<e,o=t+1,s=Math.min(t+n,e);return(0,G.jsxs)(`div`,{className:`flex items-center justify-center gap-3 pt-1`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,disabled:!i,onClick:()=>r(Math.max(0,t-n)),className:`gap-1 text-on-surface-variant`,children:[(0,G.jsx)(go,{className:`h-4 w-4`}),`Prev`]}),(0,G.jsxs)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:[o,`–`,s,` of `,e]}),(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,disabled:!a,onClick:()=>r(t+n),className:`gap-1 text-on-surface-variant`,children:[`Next`,(0,G.jsx)(_o,{className:`h-4 w-4`})]})]})}var Nj=3e5;function Pj(){return ot({queryKey:Ta([`symbionts`]),queryFn:({signal:e})=>$i(`/symbionts`,{signal:e}),staleTime:Nj})}function Fj(e,t,n){let r=e.find(e=>e.name===t);return r?.resumeCommand?r.resumeCommand.replace(`{sessionId}`,n):null}var Ij={released:`released`,merged_unreleased:`merged`,not_on_release_line:`feature`,unknown:`unknown`,unreconciled:`unreconciled`},Lj={released:`bg-primary/15 text-primary`,merged_unreleased:`bg-secondary/15 text-secondary`,not_on_release_line:`border border-[var(--ghost-border)] text-on-surface-variant`,unknown:`bg-surface-container-high text-on-surface-variant`,unreconciled:`border border-[var(--ghost-border)] text-on-surface-variant/70`},Rj={released:`bg-primary`,merged_unreleased:`bg-secondary`,not_on_release_line:`bg-on-surface-variant/50`,unknown:`bg-on-surface-variant/40`,unreconciled:`bg-on-surface-variant/25`},zj={released:`border-primary`,merged_unreleased:`border-secondary`,not_on_release_line:`border-on-surface-variant/50`,unknown:`border-on-surface-variant/40`,unreconciled:`border-on-surface-variant/25`};function Bj(e){let t=[Ij[e.state]??e.state];return e.confidence&&t.push(`confidence: ${e.confidence}`),e.basis_kind&&t.push(`basis: ${e.basis_kind}`),e.basis_ref&&t.push(`ref: ${e.basis_ref}`),e.reason&&t.push(e.reason),t.join(` — `)}function Vj({annotation:e,className:t}){if(!e)return null;let n=Ij[e.state]??e.state;return(0,G.jsxs)(`span`,{className:J(`inline-flex items-center gap-1 rounded-xs px-1.5 py-0.5 font-sans text-[10px] font-medium uppercase tracking-wider`,Lj[e.state]??Lj.unknown,t),title:Bj(e),children:[(0,G.jsx)(`span`,{children:n}),e.confidence?(0,G.jsx)(`span`,{className:`font-mono normal-case opacity-70`,children:e.confidence}):null]})}function Hj({annotation:e,className:t}){if(!e)return null;let n=Rj[e.state]??Rj.unknown,r=zj[e.state]??zj.unknown,i=e.confidence??null,a;return a=i===`high`?n:i===`medium`?J(n,`opacity-60 border`,r):i===`low`?J(`bg-transparent border-2`,r):J(n,`opacity-50`),(0,G.jsx)(`span`,{className:J(`inline-block h-2.5 w-2.5 rounded-full shrink-0`,a,t),title:Bj(e),"aria-label":`Release: ${Bj(e)}`,role:`img`})}var Uj=[`ACTIVE`,`TODAY`,`YESTERDAY`,`EARLIER`];function Wj(e,t){let{isActive:n,startedAtEpochSec:r,nowEpochSec:i}=t,a=i??Math.floor(Date.now()/1e3),o=new Date(a*1e3),s=new Date(o.getFullYear(),o.getMonth(),o.getDate()).getTime()/1e3,c=s-1440*60,l={ACTIVE:[],TODAY:[],YESTERDAY:[],EARLIER:[]};for(let t of e){if(n(t)){l.ACTIVE.push(t);continue}let e=r(t);if(e==null){l.EARLIER.push(t);continue}e>=s?l.TODAY.push(t):e>=c?l.YESTERDAY.push(t):l.EARLIER.push(t)}let u=[];for(let e of Uj)l[e].length>0&&u.push({label:e,rows:l[e]});return u}function Gj(e){return!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function Kj({items:e,getId:t,selectedId:n,onActivate:r,filterInputRef:i,enabled:a=!0}){let o=(0,W.useRef)(t);o.current=t;let[s,c]=(0,W.useState)(()=>{if(!n)return 0;let r=e.findIndex(e=>t(e)===n);return r>=0?r:0}),l=(0,W.useRef)([]),u=(0,W.useRef)(n);return(0,W.useEffect)(()=>{if(u.current===n||(u.current=n,!n))return;let t=e.findIndex(e=>o.current(e)===n);t>=0&&c(t)},[n,e]),(0,W.useEffect)(()=>{s>=e.length&&c(Math.max(0,e.length-1)),l.current.length>e.length&&(l.current.length=e.length)},[e.length,s]),(0,W.useEffect)(()=>{let e=l.current[s];e&&typeof e.scrollIntoView==`function`&&e.scrollIntoView({block:`nearest`})},[s]),{cursorIndex:s,setRowRef:(0,W.useCallback)(e=>t=>{l.current[e]=t},[]),containerProps:{tabIndex:0,onKeyDown:(0,W.useCallback)(n=>{if(a){if(n.key===`/`&&Gj(n)&&i?.current){n.preventDefault(),i.current.focus();return}if(Gj(n)){if(n.key===`j`||n.key===`ArrowDown`){n.preventDefault(),c(t=>Math.min(e.length-1,t+1));return}if(n.key===`k`||n.key===`ArrowUp`){n.preventDefault(),c(e=>Math.max(0,e-1));return}if(n.key===`Enter`){n.preventDefault();let i=e[s];i&&r(t(i))}}}},[a,e,s,r,t,i])}}}var qj=5;function Jj(e){return e===`active`?`sage`:e===`completed`?`outline`:`ochre`}var Yj=(0,W.forwardRef)(function({session:e,symbiontDisplayName:t,isSelected:n,isCursor:r,onClick:i,onDelete:a},o){let s=e.title||qA(e.id);return(0,G.jsxs)(Aj,{ref:o,isActive:n,isCursor:r,accent:`sage`,onClick:i,"aria-label":`Session: ${s}`,"data-selected":n||void 0,className:`group`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0 flex-1`,children:[(0,G.jsx)(BO,{tone:Jj(e.status),pulse:e.status===`active`,className:`mt-1.5 shrink-0`}),(0,G.jsx)(`h3`,{className:`font-serif italic text-sm text-on-surface truncate leading-snug`,children:s})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,G.jsx)(Hj,{annotation:e.release_state}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-on-surface-variant whitespace-nowrap`,children:WA(e.started_at)}),(0,G.jsx)(IA,{data:e.activity_buckets,widthPx:48,heightPx:14}),(0,G.jsx)(`button`,{onClick:e=>{e.stopPropagation(),a()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:`opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1 rounded hover:bg-terracotta/10 hover:text-terracotta transition-all focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-terracotta/40`,"aria-label":`Delete session ${s}`,title:`Delete session`,children:(0,G.jsx)(ks,{className:`h-3.5 w-3.5`})})]})]}),(0,G.jsxs)(`div`,{className:`mt-1.5 ml-5 font-mono text-[11px] text-on-surface-variant truncate`,children:[e.agent,` · `,t,` · `,e.prompt_count,`p · `,e.tool_count,`t`]}),e.branch&&(0,G.jsxs)(`div`,{className:`mt-0.5 ml-5 inline-flex items-center gap-1 font-mono text-[10px] italic text-on-surface-variant`,children:[(0,G.jsx)(Go,{className:`h-2.5 w-2.5`}),e.branch]})]})});function Xj(){return(0,G.jsxs)(`div`,{className:`border-b border-[var(--ghost-border)] last:border-b-0 px-4 py-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-2 min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{className:`mt-1.5 h-1.5 w-1.5 rounded-full bg-surface-container-high animate-pulse shrink-0`}),(0,G.jsx)(`div`,{className:`h-3 w-48 rounded bg-surface-container-high animate-pulse`})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,G.jsx)(`div`,{className:`h-3 w-10 rounded bg-surface-container-high animate-pulse`}),(0,G.jsx)(`div`,{className:`h-3 w-12 rounded bg-surface-container-high animate-pulse`})]})]}),(0,G.jsx)(`div`,{className:`mt-1.5 ml-5 h-2.5 w-40 rounded bg-surface-container-high animate-pulse`})]})}function Zj({selectedId:e,search:t,statusFilter:n,agentFilter:r,offset:i,onOffsetChange:a,filterInputRef:o}){let s=Nn(),[c,l]=(0,W.useState)(null),u=Mk(),{data:d}=Pk(c?.id??null),{data:f}=Pj(),p=(0,W.useMemo)(()=>{let e=new Map;for(let t of f?.symbionts??[])e.set(t.name,t.displayName);return t=>t?e.get(t)??t:`unknown`},[f]),{data:m,isLoading:h,isError:g,error:_}=Dk({limit:50,offset:i,status:n,agent:r,search:t});function v(){c&&u.mutate(c.id,{onSuccess:()=>l(null)})}let y=m?.sessions??[],b=m?.total??0,x=(0,W.useRef)(!1);(0,W.useEffect)(()=>{x.current||!e&&!h&&y.length>0&&(x.current=!0,s(`/sessions/${y[0].id}`,{replace:!0}))},[e,h,y,s]);let S=Kj({items:y,getId:e=>e.id,selectedId:e,onActivate:e=>s(`/sessions/${e}`),filterInputRef:o}),C=y.filter(e=>e.status===`active`).length,w=y.reduce((e,t)=>e+(t.prompt_count??0),0),T=(0,G.jsxs)(`div`,{className:`px-4 py-3 border-b border-[var(--ghost-border)]`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 mb-2`,children:[(0,G.jsx)(`h2`,{className:`myco-eyebrow-sm`,children:`Sessions`}),(0,G.jsx)(`span`,{className:`myco-display-sm text-on-surface`,children:`Archive`})]}),(0,G.jsxs)(`div`,{className:`font-mono text-[11px] text-on-surface-variant inline-flex items-center gap-1.5`,children:[(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{className:`text-on-surface font-semibold`,children:b.toLocaleString()}),` TOTAL`]}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{className:`text-on-surface font-semibold`,children:C.toLocaleString()}),` ACTIVE`]}),(0,G.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,G.jsxs)(`span`,{children:[(0,G.jsx)(`strong`,{className:`text-on-surface font-semibold`,children:w.toLocaleString()}),` PROMPTS`]})]})]});return g?(0,G.jsxs)(`div`,{children:[T,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-terracotta mt-4`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load sessions`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:_ instanceof Error?_.message:`Unknown error`})]})]}):(0,G.jsxs)(`div`,{children:[T,h?(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden mt-4`,children:(0,G.jsx)(`div`,{role:`list`,"aria-label":`Session archive loading`,children:Array.from({length:qj}).map((e,t)=>(0,G.jsx)(Xj,{},t))})}):y.length===0?(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant mt-4`,children:[(0,G.jsx)(is,{className:`h-8 w-8 opacity-30`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:b===0&&!t&&!n&&!r?`No sessions yet`:`No matching sessions`}),b===0&&!t&&!n&&!r&&(0,G.jsx)(`span`,{className:`font-sans text-xs`,children:`Sessions appear here as you work with your agent`})]}):(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden mt-4`,children:(0,G.jsx)(`div`,{...S.containerProps,role:`list`,"aria-label":`Session archive`,className:`outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-sage/40`,children:(()=>{let t=Wj(y,{isActive:e=>e.status===`active`,startedAtEpochSec:e=>e.started_at}),n=0;return t.map(t=>(0,G.jsxs)(`div`,{children:[(0,G.jsxs)(`div`,{role:`separator`,className:`flex items-center justify-between px-4 py-2 border-b border-[var(--ghost-border)] bg-surface-container/40`,children:[(0,G.jsx)(`span`,{className:`myco-eyebrow-sm`,children:t.label}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline`,children:t.rows.length})]}),t.rows.map(t=>{let r=n++;return(0,G.jsx)(Yj,{ref:S.setRowRef(r),session:t,symbiontDisplayName:p(t.agent),isSelected:e===t.id,isCursor:S.cursorIndex===r,onClick:()=>s(`/sessions/${t.id}`),onDelete:()=>l(t)},t.id)})]},t.label))})()})}),(0,G.jsx)(Mj,{total:b,offset:i,limit:50,onPageChange:a}),(0,G.jsx)(jj,{open:c!==null,onOpenChange:e=>{e||l(null)},title:`Delete Session`,description:`This will permanently remove this session and all related data. This action cannot be undone.`,icon:(0,G.jsx)(ks,{className:`h-4 w-4 text-terracotta`}),meta:c?[{label:`ID`,value:qA(c.id)},{label:`Title`,value:c.title||qA(c.id)}]:[],impact:d?[{label:`Prompts`,value:d.promptCount},{label:`Spores`,value:d.sporeCount},{label:`Attachments`,value:d.attachmentCount},{label:`Graph Edges`,value:d.graphEdgeCount}]:[],confirmLabel:`Delete Session`,variant:`destructive`,onConfirm:v,isPending:u.isPending})]})}function Qj({children:e,className:t}){return(0,G.jsx)(`div`,{className:J(`font-sans text-xs font-medium uppercase tracking-widest text-on-surface-variant`,t),children:e})}function $j({images:e,index:t,onClose:n,onNavigate:r}){let i=e[t],a=t>0,o=t<e.length-1;(0,W.useEffect)(()=>{let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[]);let s=(0,W.useCallback)(e=>{e.key===`Escape`&&n(),e.key===`ArrowLeft`&&a&&r(t-1),e.key===`ArrowRight`&&o&&r(t+1)},[n,r,t,a,o]);return(0,W.useEffect)(()=>(document.addEventListener(`keydown`,s),()=>document.removeEventListener(`keydown`,s)),[s]),i?(0,G.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-surface-dim/90 backdrop-blur-xs`,onClick:n,children:[(0,G.jsx)(`button`,{onClick:n,className:`absolute top-4 right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10`,children:(0,G.jsx)(Is,{className:`h-5 w-5`})}),e.length>1&&(0,G.jsxs)(`span`,{className:`absolute top-4 left-1/2 -translate-x-1/2 font-mono text-xs text-on-surface/60 z-10`,children:[t+1,` / `,e.length]}),a&&(0,G.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r(t-1)},className:`absolute left-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10`,children:(0,G.jsx)(go,{className:`h-6 w-6`})}),o&&(0,G.jsx)(`button`,{onClick:e=>{e.stopPropagation(),r(t+1)},className:`absolute right-4 rounded-full bg-surface-container-high/80 p-2 text-on-surface hover:bg-surface-container-highest transition-colors z-10`,children:(0,G.jsx)(_o,{className:`h-6 w-6`})}),(0,G.jsx)(`img`,{src:i.src,alt:i.alt,className:`max-h-[90vh] max-w-[90vw] rounded-lg shadow-ambient object-contain`,onClick:e=>e.stopPropagation()})]}):null}var eM=new Set([`Read`,`read`]);function tM(e){return e.canopy_injection_tokens===null?!1:eM.has(e.tool_name)}function nM({sessionId:e,toolCallId:t}){let{data:n,isLoading:r,isError:i,error:a}=DA(e,t);return r?(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`h-3 w-3/4 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-3 w-2/3 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-3 w-1/2 animate-pulse rounded bg-surface-container-high`})]}):i||n===null?(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(Bo,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:a instanceof Error?a.message:`No injection blob available for this tool call.`})]}):(0,G.jsx)(`pre`,{className:`font-mono text-xs whitespace-pre-wrap break-words bg-surface-container-lowest rounded-md p-3 text-on-surface overflow-x-auto`,"data-testid":`canopy-blob-text`,children:n.blob})}function rM({sessionId:e,activity:t}){let[n,r]=(0,W.useState)(!1);if(!tM(t))return null;let i=t.canopy_injection_tokens;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:e=>{e.stopPropagation(),r(!0)},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&e.stopPropagation()},className:J(`inline-flex items-center gap-1 px-1.5 py-0.5 rounded`,`font-mono text-[10px] text-sage`,`bg-sage/10 hover:bg-sage/20 transition-colors cursor-pointer`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sage/40`),title:`Canopy injected ${i} tokens of file anatomy. Click to view the blob sent to the agent.`,"aria-label":`Canopy injection: ${i} tokens`,"data-testid":`canopy-tool-call-indicator`,children:[(0,G.jsx)(ws,{className:`h-3 w-3`,"aria-hidden":`true`}),(0,G.jsxs)(`span`,{children:[i,` tok`]}),(0,G.jsx)(co,{className:`h-2.5 w-2.5 opacity-60`,"aria-hidden":`true`})]}),(0,G.jsx)($f,{open:n,onOpenChange:r,children:(0,G.jsxs)(rp,{className:`max-w-2xl`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsx)(op,{children:`Canopy injection blob`}),(0,G.jsx)(sp,{children:`The verbatim file-anatomy snippet Cortex sent the agent before this Read. Transparency is the default — what you see here is exactly what the model saw.`})]}),(0,G.jsx)(nM,{sessionId:e,toolCallId:t.id})]})})]})}var iM=3;function aM({activity:e}){let[t,n]=(0,W.useState)(!1),r=e.success===1,i=!!(e.tool_input||e.tool_output_summary||e.error_message);return(0,G.jsxs)(`div`,{className:J(`border-l-2 transition-colors`,t?`border-l-primary/30`:`border-transparent hover:border-l-primary/20`),children:[(0,G.jsxs)(`div`,{role:`button`,tabIndex:0,className:`w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-container/30 transition-all`,onClick:()=>n(e=>!e),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n(e=>!e))},"aria-expanded":t,children:[t?(0,G.jsx)(ho,{className:`h-3.5 w-3.5 shrink-0 text-on-surface-variant`}):(0,G.jsx)(_o,{className:`h-3.5 w-3.5 shrink-0 text-on-surface-variant`}),(0,G.jsx)(`span`,{className:`font-mono text-xs font-medium text-on-surface`,children:e.tool_name}),e.file_path&&(0,G.jsx)(`span`,{className:`truncate font-sans text-xs text-on-surface-variant flex-1`,children:e.file_path}),(0,G.jsx)(`span`,{className:`shrink-0 ml-auto`}),(0,G.jsx)(rM,{sessionId:e.session_id,activity:e}),(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-on-surface-variant`,children:ZA(e.duration_ms)}),r?(0,G.jsx)(So,{className:`h-3.5 w-3.5 shrink-0 text-primary`}):(0,G.jsx)(wo,{className:`h-3.5 w-3.5 shrink-0 text-tertiary`})]}),(0,G.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-150 ease-out`,style:{gridTemplateRows:t?`1fr`:`0fr`},children:(0,G.jsx)(`div`,{className:`overflow-hidden`,children:(0,G.jsxs)(`div`,{className:`px-8 pb-3 space-y-2`,children:[!i&&(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant/60 italic py-1`,children:`No input/output details captured`}),e.tool_input&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-sans text-xs font-medium text-on-surface-variant mb-1`,children:`Input`}),(0,G.jsx)(`pre`,{className:`font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface`,children:e.tool_input})]}),e.tool_output_summary&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-sans text-xs font-medium text-on-surface-variant mb-1`,children:`Output`}),(0,G.jsx)(`pre`,{className:`font-mono text-xs bg-surface-container-lowest rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all text-on-surface`,children:e.tool_output_summary})]}),e.error_message&&(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`font-sans text-xs font-medium text-tertiary mb-1`,children:`Error`}),(0,G.jsx)(`pre`,{className:`font-mono text-xs bg-tertiary/10 text-tertiary rounded-md p-2 overflow-x-auto whitespace-pre-wrap break-all`,children:e.error_message})]})]})})})]})}function oM({batchId:e,activityCount:t}){let[n,r]=(0,W.useState)(!1),{data:i,isLoading:a}=Ak(n?e:void 0);if(t===0)return null;let o=i??[];return(0,G.jsxs)(`div`,{className:`border-t border-[var(--ghost-border)]`,children:[(0,G.jsxs)(`button`,{type:`button`,className:J(`w-full flex items-center gap-2 px-4 py-2 text-left transition-colors`,`hover:bg-surface-container/30`),onClick:()=>r(e=>!e),children:[n?(0,G.jsx)(ho,{className:`h-3.5 w-3.5 shrink-0 text-on-surface-variant`}):(0,G.jsx)(_o,{className:`h-3.5 w-3.5 shrink-0 text-on-surface-variant`}),(0,G.jsx)(`span`,{className:`font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,children:`Tool Calls`}),(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-on-surface-variant/60`,children:t})]}),(0,G.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-200 ease-out`,style:{gridTemplateRows:n?`1fr`:`0fr`},children:(0,G.jsxs)(`div`,{className:`overflow-hidden`,children:[a&&(0,G.jsx)(`div`,{className:`px-3 py-2 space-y-1`,children:Array.from({length:Math.min(t,iM)}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-3 animate-pulse rounded bg-surface-container-high w-full`},t))}),!a&&o.length>0&&(0,G.jsx)(`div`,{className:`space-y-0`,children:o.map(e=>(0,G.jsx)(aM,{activity:e},e.id))})]})})]})}var sM=`h-7 w-7`;function cM(e){return new Date(e*1e3).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function lM(e){return e?e.length>120?e.slice(0,120)+`…`:e:`(no prompt)`}function uM({child:e}){return(0,G.jsxs)(`div`,{className:`mt-3 border-l-2 border-primary/30 pl-4 pb-3 mx-4`,children:[(0,G.jsx)(`div`,{className:`font-sans text-[10px] font-medium uppercase tracking-widest text-primary/70 mb-1`,children:e.kind===`interrupt`?`⚠ interrupt`:`↳ steering`}),(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 mb-1`,children:[(0,G.jsx)(`span`,{className:`font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0`,children:`Prompt`}),e.started_at&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-on-surface-variant`,children:cM(e.started_at)})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface whitespace-pre-wrap`,children:e.user_prompt??`(no prompt)`}),e.activity_count>0&&(0,G.jsx)(oM,{batchId:e.id,activityCount:e.activity_count})]})}function dM({batch:e,batchAttachments:t,steeringChildren:n,defaultOpen:r=!1,promptIndex:i,isLast:a}){let[o,s]=(0,W.useState)(r),[c,l]=(0,W.useState)(null);return(0,G.jsxs)(`div`,{className:`relative flex gap-2`,children:[(0,G.jsxs)(`div`,{className:`relative flex flex-col items-center shrink-0`,style:{width:`28px`},children:[i>0&&(0,G.jsx)(`div`,{className:`absolute top-0 w-px bg-outline-variant/40`,style:{height:`14px`}}),(0,G.jsx)(`div`,{className:J(sM,`rounded-full flex items-center justify-center shrink-0 text-[10px] font-mono font-bold transition-colors z-10`,o?`bg-primary text-on-primary`:`bg-surface-container-high text-on-surface-variant border border-outline-variant/40`),children:i+1}),!a&&(0,G.jsx)(`div`,{className:`flex-1 w-px bg-outline-variant/40`})]}),(0,G.jsxs)(Q,{level:`low`,className:J(`flex-1 overflow-hidden rounded-md max-w-full border border-outline-variant/10 mb-2`,e.kind===`recovered`&&`opacity-60 border-dashed`),children:[(0,G.jsxs)(`button`,{type:`button`,className:J(`flex w-full items-start gap-3 px-4 py-3 text-left transition-colors overflow-hidden`,`hover:bg-surface-container/40`,o&&`bg-surface-container/20`),onClick:()=>s(e=>!e),"aria-expanded":o,children:[o?(0,G.jsx)(ho,{className:`mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform`}):(0,G.jsx)(_o,{className:`mt-0.5 h-4 w-4 shrink-0 text-on-surface-variant transition-transform`}),(0,G.jsxs)(`div`,{className:`flex-1 min-w-0 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2 mb-0.5`,children:[(0,G.jsx)(`span`,{className:`font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant shrink-0`,children:e.kind===`recovered`?`Recovered`:`Prompt`}),e.activity_count>0&&(0,G.jsxs)(`span`,{className:`font-mono text-[10px] text-on-surface-variant/70 shrink-0`,children:[e.activity_count,` tool call`,e.activity_count===1?``:`s`]}),e.started_at&&(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-on-surface-variant`,children:cM(e.started_at)})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface truncate`,children:o?e.user_prompt??`(no prompt)`:lM(e.user_prompt)})]})]}),(0,G.jsx)(`div`,{className:`grid transition-[grid-template-rows] duration-200 ease-out`,style:{gridTemplateRows:o?`1fr`:`0fr`},children:(0,G.jsxs)(`div`,{className:`overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`px-4 pt-0 pb-3 overflow-hidden`,children:[e.user_prompt&&e.user_prompt.length>120&&(0,G.jsx)(uO,{content:e.user_prompt}),t.length>0&&(0,G.jsx)(`div`,{className:`mt-3 flex flex-wrap gap-3`,children:t.map((e,t)=>(0,G.jsx)(`button`,{type:`button`,className:`rounded-md overflow-hidden hover:ring-2 hover:ring-primary/40 transition-all`,onClick:()=>l(t),children:(0,G.jsx)(`img`,{src:Mi(`/api/attachments/${e.file_path}`),alt:e.description??e.file_path??``,className:`max-w-[200px] max-h-[140px] object-cover rounded-md`,loading:`lazy`})},e.id))}),c!==null&&(0,G.jsx)($j,{images:t.map(e=>({src:Mi(`/api/attachments/${e.file_path}`),alt:e.description??e.file_path??``})),index:c,onNavigate:l,onClose:()=>l(null)})]}),e.activity_count>0&&(0,G.jsx)(oM,{batchId:e.id,activityCount:e.activity_count}),n.map(e=>(0,G.jsx)(uM,{child:e},e.id)),e.response_summary&&(0,G.jsx)(`div`,{className:`border-t border-[var(--ghost-border)] overflow-hidden`,children:(0,G.jsxs)(`div`,{className:`flex gap-3 px-4 py-3`,children:[(0,G.jsx)(`div`,{className:`w-0.5 shrink-0 rounded-full bg-primary/30`}),(0,G.jsxs)(`div`,{className:`flex-1 min-w-0 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-1.5 mb-1.5`,children:[(0,G.jsx)(fo,{className:`h-3 w-3 text-primary/60`}),(0,G.jsx)(`span`,{className:`font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,children:`Response`})]}),(0,G.jsx)(uO,{content:e.response_summary})]})]})})]})})]})]})}var fM=3;function pM(e){let t=new Map,n=[];for(let r of e)if(r.parent_prompt_batch_id==null)n.push(r);else{let e=t.get(r.parent_prompt_batch_id)??[];e.push(r),t.set(r.parent_prompt_batch_id,e)}return n.map(e=>({parent:e,children:(t.get(e.id)??[]).sort((e,t)=>(e.started_at??0)-(t.started_at??0))}))}var mM=[`human`],hM=[`human`,`system`,`agent_dispatch`,`hook_injected`];function gM({sessionId:e}){let[t,n]=(0,W.useState)(!1),{data:r,isLoading:i}=kk(e,t?hM:mM),{data:a}=jk(e),o=a??[],{byBatchId:s,byTurnNumber:c}=(0,W.useMemo)(()=>{let e=new Map,t=new Map;for(let n of o){if(n.prompt_batch_id!=null){let t=e.get(n.prompt_batch_id)??[];t.push(n),e.set(n.prompt_batch_id,t)}if(n.turn_number!=null){let e=t.get(n.turn_number)??[];e.push(n),t.set(n.turn_number,e)}}return{byBatchId:e,byTurnNumber:t}},[o]),l=(0,W.useMemo)(()=>pM([...r??[]].sort((e,t)=>(e.started_at??0)-(t.started_at??0))),[r]);return i?(0,G.jsx)(`div`,{className:`space-y-3 pl-11`,children:Array.from({length:fM}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-16 animate-pulse rounded-md bg-surface-container-low`},t))}):l.length===0?(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(is,{className:`h-8 w-8 opacity-30`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`No prompts recorded`})]}):(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`div`,{className:`mb-3 flex items-center justify-end pl-11 text-xs text-on-surface-variant`,children:(0,G.jsxs)(`label`,{className:`inline-flex cursor-pointer items-center gap-2 select-none`,children:[(0,G.jsx)(`input`,{type:`checkbox`,className:`h-3 w-3 cursor-pointer accent-primary`,checked:t,onChange:e=>n(e.target.checked)}),(0,G.jsx)(`span`,{children:`Show system & sub-agent prompts`})]})}),l.map(({parent:e,children:t},n)=>(0,G.jsx)(dM,{batch:e,batchAttachments:s.get(e.id)??(e.prompt_number===null?[]:c.get(e.prompt_number)??[]),steeringChildren:t,defaultOpen:n===l.length-1,promptIndex:n,isLast:n===l.length-1},e.id))]})}var _M=`▲`,vM=`▼`;function yM(e){let t=(e.match(/- \[x\]/gi)??[]).length;return{total:t+(e.match(/- \[ \]/g)??[]).length,checked:t}}var bM={active:`bg-green-500/10 text-green-500`,completed:`bg-blue-500/10 text-blue-500`},xM=`bg-muted text-muted-foreground`;function SM({status:e}){return(0,G.jsx)(`span`,{className:J(`inline-flex items-center rounded px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide`,bM[e]??xM),children:e})}function CM({plan:e,initialExpanded:t=!1,isDeleting:n=!1,onDelete:r}){let[i,a]=(0,W.useState)(t),o=(0,W.useMemo)(()=>e.content?yM(e.content):null,[e.content]),s=o!==null&&o.total>0,c=s?Math.round(o.checked/o.total*100):0,l=!!e.content,u=()=>{l&&a(e=>!e)};return(0,G.jsxs)(`div`,{className:`rounded-lg border border-border bg-muted/50 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:J(`flex items-start gap-3 p-4`,l&&`cursor-pointer hover:bg-muted/70 transition-colors`),onClick:l?u:void 0,onKeyDown:l?e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),u())}:void 0,role:l?`button`:void 0,tabIndex:l?0:void 0,"aria-expanded":l?i:void 0,children:[(0,G.jsxs)(`div`,{className:`flex-1 min-w-0 space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,G.jsx)(SM,{status:e.status}),e.title&&(0,G.jsx)(`span`,{className:`font-sans text-sm font-medium text-on-surface truncate`,children:e.title})]}),e.source_path&&(0,G.jsx)(`p`,{className:`font-mono text-xs text-muted-foreground truncate`,title:e.source_path,children:e.source_path}),(0,G.jsxs)(`div`,{className:`flex gap-3 font-sans text-xs text-muted-foreground`,children:[(0,G.jsxs)(`span`,{children:[`Created `,WA(e.created_at)]}),e.updated_at&&e.updated_at!==e.created_at&&(0,G.jsxs)(`span`,{title:GA(e.updated_at),children:[`Updated `,WA(e.updated_at)]})]}),s&&(0,G.jsxs)(`div`,{className:`space-y-1 pt-0.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between font-sans text-xs text-muted-foreground`,children:[(0,G.jsxs)(`span`,{children:[o.checked,`/`,o.total,` items`]}),(0,G.jsxs)(`span`,{children:[c,`%`]})]}),(0,G.jsx)(`div`,{className:`h-1.5 rounded-full bg-border overflow-hidden`,children:(0,G.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-all`,style:{width:`${c}%`}})})]})]}),(l||r)&&(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[r&&(0,G.jsx)(`button`,{onClick:t=>{t.stopPropagation(),r(e.id)},className:`text-xs text-muted-foreground hover:text-destructive transition-colors cursor-pointer disabled:opacity-50`,disabled:n,"aria-label":`Delete plan`,children:n?`Deleting...`:`Delete`}),l&&(0,G.jsx)(`span`,{className:`mt-0.5 text-xs text-muted-foreground`,"aria-hidden":`true`,children:i?_M:vM})]})]}),i&&e.content&&(0,G.jsx)(`div`,{className:`border-t border-border px-4 py-3`,children:(0,G.jsx)(uO,{content:e.content,className:`text-sm`})})]})}function wM({sessionId:e,expandedPlanId:t}){let{data:n,isLoading:r,isError:i}=Fk(e),a=Ik(e),[o,s]=(0,W.useState)(null);async function c(){if(o)try{await a.mutateAsync(o.id),s(null)}catch{s(null)}}return r?(0,G.jsx)(`div`,{className:`flex h-32 items-center justify-center`,children:(0,G.jsx)(`span`,{className:`font-sans text-sm text-muted-foreground`,children:`Loading plans...`})}):i?(0,G.jsx)(`div`,{className:`flex h-32 items-center justify-center`,children:(0,G.jsx)(`span`,{className:`font-sans text-sm text-muted-foreground`,children:`Failed to load plans.`})}):!n||n.length===0?(0,G.jsx)(`div`,{className:`flex h-32 items-center justify-center rounded-lg border border-border bg-muted/30`,children:(0,G.jsx)(`span`,{className:`font-sans text-sm text-muted-foreground`,children:`No plans captured for this session`})}):(0,G.jsxs)(`div`,{className:`space-y-3`,children:[a.isError&&(0,G.jsx)(`div`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 font-sans text-sm text-destructive`,children:`Failed to delete plan.`}),n.map(e=>(0,G.jsx)(CM,{plan:e,initialExpanded:e.status===`in_progress`||String(e.id)===t,isDeleting:a.isPending&&o?.id===e.id,onDelete:()=>s(e)},e.id)),(0,G.jsx)(jj,{open:o!==null,onOpenChange:e=>{e||s(null)},title:`Delete Plan`,description:`This will permanently remove this captured plan from the session.`,icon:(0,G.jsx)(ks,{className:`h-4 w-4 text-tertiary`}),meta:o?[{label:`Status`,value:o.status},{label:`Title`,value:o.title||o.source_path||o.id}]:[],confirmLabel:`Delete Plan`,variant:`destructive`,onConfirm:c,isPending:a.isPending})]})}var TM=15e3,EM=3e4,DM=3e4,OM=6e4;function kM(e){let t=new URLSearchParams;e?.type&&t.set(`type`,e.type),e?.status&&t.set(`status`,e.status),e?.search&&t.set(`search`,e.search),e?.limit!==void 0&&t.set(`limit`,String(e.limit)),e?.offset!==void 0&&t.set(`offset`,String(e.offset)),e?.session_id&&t.set(`session_id`,e.session_id);let n=t.toString(),r=n?`/spores?${n}`:`/spores`;return ot({queryKey:Ta([`spores`,e]),queryFn:({signal:e})=>$i(r,{signal:e}),staleTime:TM,refetchInterval:Hs.SPORES})}function AM(e){return ot({queryKey:Ta([`spore`,e]),queryFn:({signal:t})=>$i(`/spores/${e}`,{signal:t}),enabled:e!==void 0,staleTime:EM})}function jM(e,t=1,n=!0){return ot({queryKey:Ta([`graph`,e,t]),queryFn:({signal:n})=>$i(`/graph/${e}?depth=${t}`,{signal:n}),enabled:n&&e!==void 0,staleTime:DM})}function MM(e=!0){return ot({queryKey:Ta([`full-graph`]),queryFn:({signal:e})=>$i(`/graph`,{signal:e}),enabled:e,staleTime:DM})}function NM(){return ot({queryKey:Ta([`graph-seeds`]),queryFn:({signal:e})=>$i(`/graph/seeds`,{signal:e}),staleTime:DM})}function PM(e){let t=e?`/digest?agent_id=${encodeURIComponent(e)}`:`/digest`;return ot({queryKey:Ta([`digest`,e]),queryFn:({signal:e})=>$i(t,{signal:e}),staleTime:OM})}var FM=200,IM={decision:`default`,discovery:`default`,wisdom:`default`,architecture:`default`,trade_off:`secondary`,"cross-cutting":`secondary`,pattern:`secondary`,gotcha:`destructive`,bug_fix:`destructive`},LM={active:`default`,superseded:`outline`,consolidated:`outline`,archived:`outline`};function RM({spore:e}){let[t,n]=(0,W.useState)(!1),r=IM[e.observation_type]??`secondary`,i=LM[e.status]??`outline`,a=e.content.split(`
|
|
84
|
-
`).find(e=>e.trim().length>0)?.replace(/^#+\s*/,``)??``;return(0,G.jsxs)(Q,{level:`low`,className:J(`rounded-md border border-outline-variant/20 transition-colors`,e.status===`superseded`&&`opacity-70`),role:`listitem`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,className:`w-full px-4 py-3 text-left hover:bg-surface-container-high/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[t?(0,G.jsx)(ho,{className:`h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant`}):(0,G.jsx)(_o,{className:`h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-1`,children:[(0,G.jsx)(X,{variant:r,children:e.observation_type}),(0,G.jsx)(X,{variant:i,children:e.status})]}),(0,G.jsx)(`p`,{className:J(`font-sans text-sm text-on-surface truncate`,e.status===`superseded`&&`line-through`),children:a})]})]})}),t&&(0,G.jsxs)(`div`,{className:`border-t border-outline-variant/20 px-4 py-3 space-y-3`,children:[(0,G.jsx)(uO,{content:e.content}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{title:GA(e.created_at),children:[`Created `,WA(e.created_at)]}),(0,G.jsxs)(`span`,{title:GA(e.updated_at),children:[`Last updated `,WA(e.updated_at)]})]})]})]})}function zM({sessionId:e,className:t}){let{data:n,isPending:r,isError:i}=kM({session_id:e,limit:FM});return r?(0,G.jsx)(`div`,{className:J(`space-y-3 p-4`,t),children:Array.from({length:3}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-20 animate-pulse rounded-md bg-surface-container-high`},t))}):i||!n?(0,G.jsx)(`div`,{className:J(`p-4 text-sm text-tertiary`,t),role:`alert`,children:`Failed to load spores for this session.`}):n.spores.length===0?(0,G.jsxs)(`div`,{className:J(`p-8 text-center text-on-surface-variant`,t),children:[(0,G.jsx)(`p`,{className:`font-sans text-sm italic`,children:`No spores derived from this session yet.`}),(0,G.jsx)(`p`,{className:`mt-2 font-mono text-xs`,children:`Spores get captured automatically as the agent learns from your prompts.`})]}):(0,G.jsx)(`div`,{className:J(`space-y-3 p-4`,t),role:`list`,children:n.spores.map(e=>(0,G.jsx)(RM,{spore:e},e.id))})}var BM=`/cortex?tab=canopy`,VM=1e3,HM=1e6;function UM(e){let t=e<0?`-`:``,n=Math.abs(e);return n>=HM?`${t}${(n/HM).toFixed(1)}M`:n>=VM*10?`${t}${Math.round(n/VM)}k`:n>=VM?`${t}${(n/VM).toFixed(1)}k`:`${t}${n.toLocaleString()}`}function WM(e){return e===null?`—`:e.toLocaleString()}function GM({label:e,value:t,hint:n}){return(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0`,title:n,children:[(0,G.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline`,children:e}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface`,children:t})]})}function KM({sessionId:e,fixture:t,className:n}){let[r,i]=(0,W.useState)(!1),a=t!==void 0,{data:o,isLoading:s}=vA(a?void 0:e),c=a?t:o??null;if(!a&&s)return null;let l=c?.canopy_tokens_saved??0,u=c?.canopy_injections_offered??null,d=c?.canopy_skips_after_injection??null,f=c?.canopy_reads_after_injection??null,p=c?.canopy_redundant_reads??null,m=c?.canopy_injection_total_tokens??null,h=gA(c,`myco_cortex`,`canopy_map`),g=u!==null&&u>0&&d!==null?`${d}/${u} skipped`:null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:J(`rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 border-t-sage`,`transition-[border-color,background-color] duration-200`,`hover:border-outline-variant/25 hover:bg-surface-container/80 cursor-pointer text-left`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sage/40`,n),"data-testid":`canopy-efficiency-tile`,"aria-label":`${UM(l)} tokens saved by Canopy. Click for breakdown.`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline mb-2`,children:`Reads saved`}),(0,G.jsx)(`div`,{className:`flex items-end justify-between gap-2`,children:(0,G.jsx)(`p`,{className:J(`font-serif text-2xl font-bold`,l>=0?`text-sage`:`text-terracotta`),children:UM(l)})}),g&&(0,G.jsx)(`p`,{className:`font-mono text-[10px] text-outline mt-1`,children:g}),(0,G.jsxs)(`p`,{className:`font-mono text-[10px] text-outline mt-1`,"data-testid":`canopy-map-calls`,children:[`Map calls: `,h]})]}),(0,G.jsx)($f,{open:r,onOpenChange:i,children:(0,G.jsxs)(rp,{className:`max-w-md`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsx)(op,{children:`Canopy: Reads saved this session`}),(0,G.jsx)(sp,{children:`Direct token savings from files the agent skipped Reading after Canopy injected file anatomy via PreToolUse.`})]}),(0,G.jsxs)(`div`,{className:`mb-4`,children:[(0,G.jsx)(`p`,{className:J(`font-serif text-3xl font-bold tracking-tight`,l>=0?`text-sage`:`text-terracotta`),"aria-label":`${UM(l)} net tokens saved on Reads`,children:UM(l)}),(0,G.jsxs)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline mt-1`,children:[`net tokens `,l>=0?`saved on reads`:`spent on injections`]})]}),(0,G.jsxs)(`div`,{className:`space-y-0`,children:[(0,G.jsx)(GM,{label:`Injections offered`,value:WM(u),hint:`PreToolUse Read events where Canopy injected anatomy.`}),(0,G.jsx)(GM,{label:`Skipped after injection`,value:WM(d),hint:`Files the agent did not Read after seeing the injected blob.`}),(0,G.jsx)(GM,{label:`Read anyway`,value:WM(f),hint:`Files the agent Read in full after the injection.`}),(0,G.jsx)(GM,{label:`Injection cost`,value:m===null?`—`:`${UM(m)} tok`,hint:`Sum of tokens spent on Canopy injections this session.`}),p!==null&&p>0&&(0,G.jsx)(GM,{label:`Redundant reads`,value:WM(p),hint:`Files Read more than once in this session (informational).`}),(0,G.jsx)(GM,{label:`Map calls`,value:h.toLocaleString(),hint:`Times the agent called canopy_map() during this session.`})]}),(0,G.jsx)(ri,{to:BM,onClick:()=>i(!1),className:`inline-block mt-4 font-mono text-xs text-sage hover:underline`,children:`Learn more about Canopy →`})]})})]})}function qM(e){return e===`active`?`active`:e===`completed`?`completed`:`error`}var JM={active:`bg-primary`,completed:`bg-secondary`,error:`bg-tertiary`},YM={active:`bg-primary/15 text-primary`,completed:`bg-surface-container-high text-on-surface-variant`,error:`bg-tertiary/15 text-tertiary`};function XM({status:e}){return(0,G.jsx)(`span`,{className:J(`inline-block h-2 w-2 rounded-full shrink-0`,JM[qM(e)])})}function ZM({status:e}){let t=qM(e),n=e.charAt(0).toUpperCase()+e.slice(1);return(0,G.jsxs)(`span`,{className:J(`inline-flex items-center gap-1.5 rounded-xs px-2 py-0.5 font-sans text-xs font-medium`,YM[t]),children:[(0,G.jsx)(XM,{status:e}),n]})}function QM(e){return e===null?`—`:UA(new Date(e*1e3).toISOString())}var $M=1500;function eN({label:e,value:t,mono:n=!0,copyable:r=!1,code:i=!1}){let[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),$M)},[t]),c=i?(0,G.jsx)(`code`,{className:`text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5`,children:t}):(0,G.jsx)(`span`,{className:J(`text-xs text-on-surface`,n&&`font-mono`),children:t});return(0,G.jsxs)(`div`,{className:`flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0`,children:[(0,G.jsx)(`span`,{className:`shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant`,children:e}),r?(0,G.jsxs)(`button`,{onClick:s,title:`Click to copy`,className:`flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer`,children:[c,a&&(0,G.jsx)(mo,{className:`h-3 w-3 text-primary shrink-0`})]}):(0,G.jsx)(`span`,{className:`min-w-0`,children:c})]})}function tN({label:e,value:t,activeTab:n,onClick:r}){return(0,G.jsx)(`button`,{onClick:()=>r(t),className:J(`px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer`,n===t?`border-b-2 border-primary text-on-surface`:`text-muted-foreground hover:text-on-surface`),children:e})}function nN({id:e}){let t=Nn(),{data:n,isLoading:r,isError:i,error:a}=Ok(e),{data:o}=Pj(),s=eA(),c=Nk(),[l,u]=(0,W.useState)(`idle`),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`tab`);return e===`plans`?`plans`:e===`spores`?`spores`:`conversation`}),[h]=(0,W.useState)(()=>new URLSearchParams(window.location.search).get(`plan`)),g=Mk(),{data:_}=Pk(d?e:null),{data:v}=Fk(e);if(r)return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`flex h-64 items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(es,{className:`h-5 w-5 animate-spin`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Loading session...`})]})]});if(i||!n)return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session not found`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:a instanceof Error?a.message:`Unknown error`})]})]});let y=o?Fj(o.symbionts,n.agent,e):null;return(0,G.jsxs)(`div`,{className:`space-y-6 overflow-hidden`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,G.jsx)(`h1`,{className:`myco-display-lg text-on-surface m-0`,children:n.title??qA(n.id)}),(0,G.jsx)(ZM,{status:n.status}),(0,G.jsx)(Vj,{annotation:n.release_state}),n.agent&&(0,G.jsx)(X,{variant:`outline`,className:`font-mono text-[10px] px-1.5 py-0`,children:n.agent}),(0,G.jsxs)(Y,{variant:`secondary`,size:`sm`,className:`ml-auto gap-2`,disabled:l===`running`,onClick:async()=>{u(`running`);try{await s.mutateAsync({task:`title-summary`,instruction:`Process session ${e} only`}),u(`done`)}catch{u(`error`)}},children:[l===`running`?(0,G.jsx)(es,{className:`h-4 w-4 animate-spin`}):(0,G.jsx)(Cs,{className:`h-4 w-4`}),l===`done`?`Summary Requested`:`Generate Summary`]}),(()=>{let t=n.status!==`active`,r=c.isSuccess?`Session Completed`:t?`Already Completed`:`Complete Session`;return(0,G.jsxs)(Y,{variant:`secondary`,size:`sm`,className:`gap-2`,disabled:c.isPending||t,title:t?`Session is already completed`:`Mark this session completed and regenerate its summary`,onClick:()=>c.mutate(e),children:[c.isPending?(0,G.jsx)(es,{className:`h-4 w-4 animate-spin`}):(0,G.jsx)(So,{className:`h-4 w-4`}),r]})})(),(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10`,onClick:()=>f(!0),children:[(0,G.jsx)(ks,{className:`h-4 w-4`}),`Delete`]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant`,children:[n.user&&(0,G.jsxs)(`span`,{children:[`User: `,(0,G.jsx)(`span`,{className:`text-on-surface`,children:n.user})]}),n.branch&&(0,G.jsxs)(`span`,{children:[`Branch: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:n.branch})]}),(0,G.jsxs)(`span`,{children:[`Started `,QM(n.started_at)]}),n.ended_at&&(0,G.jsxs)(`span`,{children:[`Duration: `,XA(n.started_at,n.ended_at)]})]})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,G.jsx)(RA,{label:`Prompts`,value:String(n.prompt_count),tone:`sage`}),(0,G.jsx)(RA,{label:`Tool Calls`,value:String(n.tool_count),tone:`sage`}),(0,G.jsx)(RA,{label:`Plans`,value:String(v?.length??0)}),(0,G.jsx)(KM,{sessionId:e})]}),(0,G.jsxs)(Q,{level:`low`,className:`p-4 overflow-hidden`,children:[(0,G.jsx)(Qj,{className:`mb-3`,children:`Metadata`}),(0,G.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-6`,children:[(0,G.jsx)(eN,{label:`Session ID`,value:e,copyable:!0}),y&&(0,G.jsx)(eN,{label:`Resume`,value:y,copyable:!0,code:!0}),n.parent_session_id&&(0,G.jsx)(eN,{label:`Parent`,value:n.parent_session_id}),n.parent_session_reason&&(0,G.jsx)(eN,{label:`Reason`,value:n.parent_session_reason,mono:!1}),n.project_root&&(0,G.jsx)(eN,{label:`Project`,value:n.project_root})]})]}),n.summary&&(0,G.jsxs)(Q,{level:`low`,className:`p-4 overflow-hidden`,children:[(0,G.jsx)(Qj,{className:`mb-2`,children:`Summary`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words`,children:n.summary})]}),(0,G.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`flex gap-0 border-b border-border mb-4`,children:[(0,G.jsx)(tN,{label:`Conversation`,value:`conversation`,activeTab:p,onClick:m}),(0,G.jsx)(tN,{label:`Plans`,value:`plans`,activeTab:p,onClick:m}),(0,G.jsx)(tN,{label:`Spores`,value:`spores`,activeTab:p,onClick:m})]}),p===`conversation`&&(0,G.jsx)(gM,{sessionId:e}),p===`plans`&&(0,G.jsx)(wM,{sessionId:e,expandedPlanId:h}),p===`spores`&&(0,G.jsx)(zM,{sessionId:e})]}),(0,G.jsx)(jj,{open:d,onOpenChange:f,title:`Delete Session`,description:`This will permanently remove this session and all related data. This action cannot be undone.`,icon:(0,G.jsx)(ks,{className:`h-4 w-4 text-tertiary`}),meta:n?[{label:`ID`,value:qA(n.id)},{label:`Title`,value:n.title||qA(n.id)}]:[],impact:_?[{label:`Prompts`,value:_.promptCount},{label:`Spores`,value:_.sporeCount},{label:`Attachments`,value:_.attachmentCount},{label:`Graph Edges`,value:_.graphEdgeCount}]:[],confirmLabel:`Delete Session`,variant:`destructive`,onConfirm:()=>{g.mutate(n.id,{onSuccess:()=>{f(!1),t(`/sessions`)}})},isPending:g.isPending})]})}var rN=300;function iN(e,t=rN){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function aN({initialFilters:e}){let[t,n]=(0,W.useState)(``),r=iN(t),[i,a]=(0,W.useState)(e),[o,s]=(0,W.useState)(0),c=(0,W.useCallback)((e,t)=>{a(n=>({...n,[e]:t})),s(0)},[]),l=(0,W.useCallback)(e=>{n(e),s(0)},[]),u=(0,W.useCallback)(e=>{let t=i[e];return t&&t!==`all`?t:void 0},[i]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:i,offset:o,setOffset:s,handleSearchChange:l,handleFilterChange:c,activeFilter:u}}var oN={key:`status`,label:`Status`,options:[{value:`all`,label:`All statuses`},{value:`active`,label:`Active`},{value:`completed`,label:`Completed`}]};function sN(){let{id:e}=Ln(),t=Nn(),n=(0,W.useRef)(null),{searchInput:r,debouncedSearch:i,filterValues:a,offset:o,setOffset:s,handleSearchChange:c,handleFilterChange:l,activeFilter:u}=aN({initialFilters:{status:`all`,agent:`all`}}),{data:d}=Pj(),f=(0,W.useMemo)(()=>[oN,{key:`agent`,label:`Symbiont`,options:[{value:`all`,label:`All symbionts`},...(d?.symbionts??[]).filter(e=>e.enabled).map(e=>({value:e.name,label:e.displayName}))]}],[d]),p=u(`status`),m=u(`agent`);return(0,G.jsxs)(`div`,{className:`flex flex-col h-full gap-4 p-4`,children:[(0,G.jsx)(Ej,{searchPlaceholder:`Search sessions...`,searchValue:r,onSearchChange:c,filters:f,filterValues:a,onFilterChange:l,inputRef:n}),(0,G.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,G.jsx)(wj,{hasSelection:!!e,onCloseMobileDetail:()=>t(`..`),masterAriaLabel:`Sessions`,detailAriaLabel:`Session details`,master:(0,G.jsx)(Zj,{selectedId:e,search:i,statusFilter:p,agentFilter:m,offset:o,onOffsetChange:s,filterInputRef:n}),detail:e?(0,G.jsx)(nN,{id:e}):(0,G.jsx)(Tj,{message:`Select a session to see its details.`})})})]})}function cN({title:e,subtitle:t,actions:n,className:r}){return(0,G.jsx)(`div`,{className:J(`pb-6`,r),children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`font-serif text-2xl font-normal text-on-surface tracking-wide`,children:e}),t&&(0,G.jsx)(`p`,{className:`mt-1 font-sans text-sm text-on-surface-variant`,children:t})]}),n&&(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:n})]})})}function lN({checked:e,onCheckedChange:t,disabled:n}){return(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 shrink-0 rounded-full transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 ${n?`cursor-not-allowed opacity-50`:`cursor-pointer`} ${e?`bg-primary`:`bg-surface-container-high`}`,children:(0,G.jsx)(`span`,{className:`pointer-events-none block h-5 w-5 rounded-full bg-on-surface shadow-lg ring-0 transition-transform ${e?`translate-x-5`:`translate-x-0`}`})})}var uN=(0,W.createContext)(null);function dN({children:e}){let[t,n]=(0,W.useState)(()=>new Set),r=(0,W.useCallback)(e=>{n(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),i=(0,W.useCallback)(()=>n(new Set),[]),a=(0,W.useMemo)(()=>({dirty:t,markDirty:r,clear:i}),[t,r,i]);return(0,G.jsx)(uN.Provider,{value:a,children:e})}function fN(){let e=(0,W.useContext)(uN);if(!e)throw Error(`useRestartGate must be inside RestartGateProvider`);return e}function pN(){return(0,W.useContext)(uN)?.markDirty??(()=>{})}function mN(){let{dirty:e,clear:t}=fN(),{restart:n,isRestarting:r}=ec();if(e.size===0)return null;let i=async()=>{try{await n(),t()}catch{}};return(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4 rounded-md border border-ochre/40 bg-ochre/5 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Restart required`}),(0,G.jsxs)(`p`,{className:`font-sans text-xs text-on-surface-variant truncate`,children:[`Changed: `,[...e].join(`, `)]})]}),(0,G.jsxs)(Y,{onClick:i,size:`sm`,disabled:r,children:[r?(0,G.jsx)(es,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):(0,G.jsx)(ps,{className:`mr-1.5 h-3.5 w-3.5`}),`Restart daemon`]})]})}function hN({id:e,label:t,scope:n,scopeIndicator:r,hint:i,helper:a,error:o,children:s}){return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:e,className:`font-sans text-sm font-medium text-on-surface`,children:t}),i&&(0,G.jsxs)(`span`,{className:`font-sans text-xs text-on-surface-variant font-normal`,children:[`(`,i,`)`]}),r??(n?(0,G.jsx)(OO,{scope:n}):null)]}),s,a&&(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:a}),o&&(0,G.jsxs)(`p`,{className:`flex items-center gap-1 font-sans text-xs text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-3 w-3`}),`Save failed: `,o]})]})}function gN(e,t,n){return e||(t===`local`?`personal`:t===`grove`||n===`grove`?`grove`:`project`)}function _N({path:e,label:t,hint:n,defaultScope:r=`local`,lockScope:i,allowPersonal:a=!0,requiresRestart:o,commitOn:s=`change`,parse:c,scopeBadgeOverride:l,children:u}){let{effective:d,local:f,setField:p,resetField:m,promoteField:h}=Na(),g=pN(),_=ga(d??{},e),v=!i&&ga(f??{},e)!==void 0,y=i??r,b=(0,W.useRef)(_);b.current=_;let[x,S]=(0,W.useState)(_),C=(0,W.useRef)(!1);(0,W.useEffect)(()=>{C.current||S(_)},[_]);let[w,T]=(0,W.useState)(null),E=(0,W.useCallback)(t=>{let n=c?c(t):t;n!==b.current&&(T(null),p(e,n,y).then(()=>{o&&g(e)}).catch(t=>{S(b.current),T(t instanceof Error?t.message:String(t)),console.error(`[scoped-field] write failed for ${e}`,t)}))},[e,y,c,o,p,g]),D=(0,W.useCallback)(e=>{C.current=!0,S(e),s===`change`&&(E(e),C.current=!1)},[E,s]),O=(0,W.useCallback)(()=>{s===`blur`&&x!==void 0&&E(x),C.current=!1},[E,s,x]),k=gN(l,i,r),A;!i&&a&&(r===`local`?v&&(A=(0,G.jsx)(kO,{mode:`local-default`,onPromote:()=>h(e).catch(e=>console.error(`[scoped-field] promote failed`,e)),onReset:()=>m(e).catch(e=>console.error(`[scoped-field] reset failed`,e))})):A=(0,G.jsx)(kO,{mode:`shared-default`,hasLocalOverride:v,defaultScopeBadge:k===`personal`?`project`:k,onSavePersonal:()=>p(e,b.current,`local`).catch(e=>console.error(`[scoped-field] save-personal failed`,e)),onReset:()=>m(e).catch(e=>console.error(`[scoped-field] reset failed`,e))}));let j=a&&r!==`local`&&!i?void 0:k;return(0,G.jsx)(`div`,{id:Xa(e),"data-config-field":e,className:`rounded-md transition-all duration-300`,children:(0,G.jsx)(hN,{label:t,hint:n,scope:A?void 0:j,scopeIndicator:A,error:w??void 0,children:u({value:x,onChange:D,onBlur:O})})})}var vN=200,yN={1500:`T1500 — Compact`,5e3:`T5000 — Standard`,1e4:`T10000 — Full`};function bN(e){return yN[e]??`T${e}`}function xN({tier:e}){let[t,n]=(0,W.useState)(!1),r=e.content.length>vN,i=r&&!t?e.content.slice(0,vN)+`…`:e.content;return(0,G.jsxs)(Q,{level:`low`,className:`p-5 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,G.jsx)(`span`,{className:`font-mono text-sm text-on-surface font-medium`,children:bN(e.tier)}),(0,G.jsxs)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:[`Generated `,WA(e.generated_at)]})]}),(0,G.jsx)(uO,{content:i}),r&&(0,G.jsx)(Y,{variant:`ghost`,size:`sm`,className:`h-7 gap-1 text-xs text-on-surface-variant`,onClick:()=>n(!t),children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(vo,{className:`h-3 w-3`}),`Show less`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ho,{className:`h-3 w-3`}),`Show more (`,e.content.length-vN,` more chars)`]})})]})}function SN(){return(0,G.jsxs)(Q,{level:`low`,className:`p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`div`,{className:`h-4 w-24 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-20 animate-pulse rounded bg-surface-container`})]}),(0,G.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[(0,G.jsx)(`div`,{className:`h-3 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-4/5 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-3/5 animate-pulse rounded bg-surface-container`})]})]})}function CN({agentId:e}){let{data:t,isLoading:n,isError:r,error:i}=PM(e),a=t?.tiers??[];return n?(0,G.jsx)(`div`,{className:`space-y-4`,children:[1,2,3].map(e=>(0,G.jsx)(SN,{},e))}):r?(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-destructive`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load digest`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:i instanceof Error?i.message:`Unknown error`})]}):a.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(Ho,{className:`h-8 w-8 opacity-30`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`No digest generated yet`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-center max-w-xs`,children:`Run the agent with the digest-only task to synthesize your vault knowledge into context extracts.`})]}):(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[a.length,` tier`,a.length===1?``:`s`,` — pre-computed context extracts at different token budgets.`]}),a.map(e=>(0,G.jsx)(xN,{tier:e},e.tier))]})}var wN=6,TN=[{value:`all`,label:`All`},{value:`yes`,label:`Yes`},{value:`no`,label:`No`}],EN=[{value:`all`,label:`All`},{value:`typescript`,label:`TypeScript`},{value:`javascript`,label:`JavaScript`},{value:`tsx`,label:`TSX`},{value:`jsx`,label:`JSX`},{value:`python`,label:`Python`},{value:`rust`,label:`Rust`},{value:`go`,label:`Go`},{value:`json`,label:`JSON`},{value:`yaml`,label:`YAML`},{value:`markdown`,label:`Markdown`},{value:`shell`,label:`Shell`},{value:`sql`,label:`SQL`}],DN=[{id:`path`,label:`Path`},{id:`language`,label:`Language`},{id:`embedded`,label:`Embedded`},{id:`llm_updated_at`,label:`Last Described`},{id:`token_estimate`,label:`Tokens`}];function ON(e){if(e===`yes`)return!0;if(e===`no`)return!1}function kN(e){return(0,G.jsx)(X,{variant:e?`default`:`secondary`,children:e?`Yes`:`No`})}function AN({label:e,value:t,options:n,onValueChange:r,triggerClassName:i=`w-32`}){return(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(`span`,{className:`font-sans text-xs uppercase tracking-wider`,children:e}),(0,G.jsx)(`div`,{className:`${i} shrink-0`,children:(0,G.jsxs)(w_,{value:t,onValueChange:r,children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{})}),(0,G.jsx)(D_,{children:n.map(e=>(0,G.jsx)(O_,{value:e.value,children:e.label},e.value))})]})})]})}function jN({children:e,className:t,sortKey:n,activeSort:r,activeDir:i,onSort:a}){let o=n!==void 0&&a!==void 0,s=o&&r===n;return o?(0,G.jsx)(`th`,{className:J(`px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,t),"aria-sort":s?i===`desc`?`descending`:`ascending`:`none`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>a(n),className:J(`flex items-center gap-1 uppercase tracking-widest text-[10px] font-medium transition-colors`,s?`text-on-surface`:`text-on-surface-variant hover:text-on-surface`),"aria-label":`Sort by ${String(e)}`,children:[(0,G.jsx)(`span`,{children:e}),s?i===`desc`?(0,G.jsx)(ho,{className:`h-3 w-3`}):(0,G.jsx)(vo,{className:`h-3 w-3`}):(0,G.jsx)(ho,{className:`h-3 w-3 opacity-30`})]})}):(0,G.jsx)(`th`,{className:J(`px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,t),children:e})}function MN(){return(0,G.jsxs)(`tr`,{className:`border-b border-[var(--ghost-border)]`,children:[(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-64 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-16 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-10 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-10 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-20 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-12 rounded bg-surface-container-high animate-pulse`})})]})}function NN({entry:e,selected:t,onClick:n}){return(0,G.jsxs)(`tr`,{className:J(`border-b border-[var(--ghost-border)] last:border-0 cursor-pointer transition-all duration-150`,`hover:bg-surface-container/60 hover:shadow-[inset_3px_0_0_var(--primary)]`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40`,t&&`bg-primary/5 shadow-[inset_3px_0_0_var(--primary)]`),onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},tabIndex:0,role:`row`,"aria-selected":t,"aria-label":`Canopy entry: ${e.path}`,"data-testid":`canopy-entry-row-${e.path}`,children:[(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface block truncate`,title:e.path,children:e.path})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:e.language??`—`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:kN(e.llm_description!==null)}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:kN(e.embedded===1)}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:QA(e.llm_updated_at)})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:e.token_estimate.toLocaleString()})})]})}function PN({selectedPath:e,onSelectPath:t}){let{searchInput:n,debouncedSearch:r,filterValues:i,offset:a,setOffset:o,handleSearchChange:s,handleFilterChange:c,activeFilter:l}=aN({initialFilters:{language:`all`,described:`all`}}),[u,d]=(0,W.useState)(`llm_updated_at`),[f,p]=(0,W.useState)(`desc`),m=e=>{e===u?p(e=>e===`asc`?`desc`:`asc`):(d(e),p(`asc`))},{data:h,isLoading:g,isError:_,error:v}=bA((0,W.useMemo)(()=>({limit:50,offset:a,language:l(`language`),described:ON(l(`described`)),q:r,sort_by:u,sort_dir:f}),[a,l,r,u,f])),y=h?.rows??[],b=h?.total??0,x=(0,G.jsxs)(Q,{level:`bright`,className:`flex flex-wrap items-center gap-3 px-4 py-2 rounded-md`,children:[(0,G.jsx)(_s,{className:`h-3.5 w-3.5 text-on-surface-variant shrink-0`}),(0,G.jsx)(cp,{placeholder:`Search files (path or description)…`,value:n,onChange:e=>s(e.target.value),className:`bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1 min-w-[180px]`,"aria-label":`Search files`}),(0,G.jsx)(AN,{label:`Language`,value:i.language??`all`,options:EN,onValueChange:e=>c(`language`,e)}),(0,G.jsx)(AN,{label:`Described`,value:i.described??`all`,options:TN,onValueChange:e=>c(`described`,e)})]}),S=(0,G.jsx)(`thead`,{children:(0,G.jsx)(`tr`,{className:`border-b border-[var(--ghost-border)] bg-surface-container/50`,children:DN.map((e,t)=>{let n=[(0,G.jsx)(jN,{sortKey:e.id,activeSort:u,activeDir:f,onSort:m,children:e.label},e.id)];return e.id===`language`&&n.push((0,G.jsx)(jN,{children:`Described`},`described`)),n})})});return _?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[x,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load canopy entries`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:v instanceof Error?v.message:`Unknown error`})]})]}):(0,G.jsxs)(`div`,{className:`space-y-3`,children:[x,g?(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden`,children:(0,G.jsxs)(`table`,{className:`w-full`,children:[S,(0,G.jsx)(`tbody`,{children:Array.from({length:wN}).map((e,t)=>(0,G.jsx)(MN,{},t))})]})}):y.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant`,"data-testid":`canopy-entries-empty`,children:[(0,G.jsx)(Ro,{className:`h-10 w-10 opacity-20`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:b===0?`No canopy entries match the current filters.`:`No matching entries on this page.`})]}):(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden`,children:(0,G.jsxs)(`table`,{className:`w-full`,"aria-label":`Canopy entries`,children:[S,(0,G.jsx)(`tbody`,{children:y.map(n=>(0,G.jsx)(NN,{entry:n,selected:n.path===e,onClick:()=>t(n.path)},n.path))})]})}),(0,G.jsx)(Mj,{total:b,offset:a,limit:50,onPageChange:o})]})}function FN({open:e,onClose:t,widthPx:n=480,children:r,ariaLabel:i=`Detail panel`,className:a,testIdRoot:o}){return(0,W.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,G.jsxs)(Q,{glass:!0,role:`dialog`,"aria-label":i,className:J(`fixed top-3 right-3 bottom-3 z-30 flex flex-col shadow-lg border border-outline-variant/15 rounded-md max-w-[calc(100vw-1.5rem)]`,a),style:{width:n},"data-testid":o?`${o}-panel`:void 0,children:[(0,G.jsx)(`div`,{className:`flex justify-end px-3 pt-3`,children:(0,G.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close detail`,"data-testid":o?`${o}-close`:void 0,className:`shrink-0 rounded-md p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors`,children:(0,G.jsx)(Is,{className:`h-4 w-4`})})}),(0,G.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 pb-5 pt-2`,children:r})]}):null}function IN(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function LN(e){return e.length>12?`${e.slice(0,12)}…`:e}function RN({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[140px_1fr] gap-3 items-baseline`,children:[(0,G.jsx)(`span`,{className:`font-sans text-xs uppercase tracking-wide text-on-surface-variant`,children:e}),(0,G.jsx)(`div`,{className:`font-mono text-xs text-on-surface min-w-0 break-all`,children:t})]})}function zN({text:e}){let[t,n]=(0,W.useState)(!1),r=(0,W.useCallback)(async()=>{navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1500))},[e]);return(0,G.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>void r(),className:`gap-1 px-2 h-6 text-xs text-on-surface-variant`,children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(mo,{className:`h-3 w-3`}),`Copied`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ko,{className:`h-3 w-3`}),`Copy`]})})}function BN(){return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(`div`,{className:`h-7 w-48 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-20 animate-pulse rounded-md bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:6}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-4 w-full animate-pulse rounded bg-surface-container-high`},t))})]})}function VN({path:e,onBack:t,onClose:n}){let{data:r,isPending:i,isError:a,error:o}=xA(e),s=SA(),c=CA(),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),_=(0,W.useMemo)(()=>IN(r?.exports_json??null),[r?.exports_json]),v=(0,W.useMemo)(()=>IN(r?.imports_json??null),[r?.imports_json]),y=(0,W.useCallback)(()=>{u(null),f(!1),s.mutate(e,{onSuccess:()=>{f(!0),window.setTimeout(()=>f(!1),2500)},onError:e=>{u(e instanceof Error?e.message:`Re-embed failed`)}})},[e,s]),b=(0,W.useCallback)(()=>{m(null),g(!1),c.mutate(e,{onSuccess:()=>{g(!0),window.setTimeout(()=>g(!1),2500)},onError:e=>{m(e instanceof Error?e.message:`Re-describe failed`)}})},[e,c]);if(i)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsx)(BN,{})});if(a)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,"data-testid":`canopy-entry-detail-error`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load entry`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:o instanceof Error?o.message:`Unknown error`})]})]})});if(!r)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant`,"data-testid":`canopy-entry-detail-empty`,children:[(0,G.jsx)(yo,{className:`h-5 w-5 opacity-50`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`No entry found at this path.`})]})]})});let x=r.embedded===1;return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,"data-testid":`canopy-entry-detail`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant -ml-2`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsx)(`h2`,{className:`font-mono text-sm text-on-surface break-all`,title:r.path,children:r.path}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[r.language?(0,G.jsx)(X,{variant:`outline`,children:r.language}):null,(0,G.jsx)(X,{variant:x?`default`:`secondary`,children:x?`Embedded`:`Not embedded`}),(0,G.jsx)(X,{variant:r.llm_description?`default`:`secondary`,children:r.llm_description?`Described`:`No description`})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:b,disabled:c.isPending,className:`gap-2`,"data-testid":`canopy-entry-redescribe`,"aria-label":`Re-run the Myco agent's description for this file.`,title:`Re-run the Myco agent's description for this file.`,children:[(0,G.jsx)(Cs,{className:c.isPending?`h-3.5 w-3.5 animate-pulse`:`h-3.5 w-3.5`}),c.isPending?`Describing...`:`Re-describe`]}),(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:y,disabled:s.isPending,className:`gap-2`,"data-testid":`canopy-entry-reembed`,children:[(0,G.jsx)(ps,{className:s.isPending?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),s.isPending?`Queuing...`:`Re-embed`]})]}),h?(0,G.jsx)(`span`,{className:`font-sans text-xs text-primary`,role:`status`,children:`Queued for re-describe`}):null,p?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:p}):null,d?(0,G.jsx)(`span`,{className:`font-sans text-xs text-primary`,role:`status`,children:`Queued for re-embed`}):null,l?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:l}):null]})]}),r.llm_description?(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-primary/15 p-4`,children:[(0,G.jsx)(Qj,{children:`Description`}),(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface leading-relaxed`,children:r.llm_description})]}):(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4`,children:[(0,G.jsx)(Qj,{children:`Description`}),(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface-variant`,children:`The Myco agent hasn't described this file yet.`})]}),(0,G.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Exports`}),_.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`No exports detected.`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:_.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-xs text-on-surface break-all`,children:e},e))})]}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Imports`}),v.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`No imports detected.`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:v.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-xs text-on-surface break-all`,children:e},e))})]})]}),r.top_comment?(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Top Comment`}),(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-on-surface`,children:r.top_comment})]}):null,(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-3`,children:[(0,G.jsx)(Qj,{children:`Metadata`}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(RN,{label:`Tokens`,children:r.token_estimate.toLocaleString()}),(0,G.jsx)(RN,{label:`Lines`,children:r.line_count.toLocaleString()}),(0,G.jsxs)(RN,{label:`Size`,children:[r.size_bytes.toLocaleString(),` B`]}),(0,G.jsx)(RN,{label:`Hash`,children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsx)(`code`,{title:r.content_hash,children:LN(r.content_hash)}),(0,G.jsx)(zN,{text:r.content_hash})]})}),(0,G.jsx)(RN,{label:`Indexed`,children:GA(r.mechanical_updated_at)}),(0,G.jsx)(RN,{label:`Described`,children:r.llm_updated_at===null?`—`:GA(r.llm_updated_at)})]})]})]})})}function HN({defaultPath:e}={}){let[t,n]=(0,W.useState)(e);return(0,G.jsxs)(`div`,{className:`relative space-y-6`,children:[(0,G.jsx)(PN,{selectedPath:t,onSelectPath:n}),t?(0,G.jsx)(VN,{path:t,onClose:()=>n(void 0)}):null]})}var UN={canopy_disabled:{title:`Canopy injection is turned off.`,detail:(0,G.jsxs)(G.Fragment,{children:[`Enable canopy injection on the`,` `,(0,G.jsx)(ri,{to:`/cortex?tab=canopy`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`Cortex → Canopy`}),` `,`page before regenerating the map.`]})},no_described_entries:{title:`No described files yet.`,detail:(0,G.jsxs)(G.Fragment,{children:[`The map is built from per-file descriptions written by the`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),`, which is opt-in. Enable its schedule (or run it once) so files get described, then regenerate the map.`]})},inputs_unchanged:{title:`The map is already current.`,detail:(0,G.jsx)(G.Fragment,{children:`No described files have changed since the last run. Use Rebuild to regenerate from scratch.`})},no_project_root:{title:`Project root unavailable.`,detail:(0,G.jsx)(G.Fragment,{children:`The daemon can’t resolve a project directory for this vault.`})}};function WN(){let e=TA(),t=EA(),[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(null),c=(0,W.useCallback)(e=>{r(null),a(null),s(e),t.mutate({force_cold_start:e===`rebuild`},{onSettled:()=>s(null),onSuccess:e=>{`skipped`in e&&e.skipped&&a(e.reason)},onError:e=>{r(e instanceof Error?e.message:`Regenerate failed`)}})},[t]),l=i?UN[i]??null:null,u=t.isPending,d=e.data,f=d?.is_empty===!0||!d?.content,p=d?.generated_at!==void 0&&d.generated_at!==null?GA(d.generated_at):`—`,m=d?.token_estimate!==void 0&&d.token_estimate!==null?d.token_estimate.toLocaleString():`—`;return(0,G.jsxs)(`div`,{className:`space-y-6`,"data-testid":`project-map-panel`,children:[(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/15 p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(ns,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`The Canopy Map is a guided tour of your project's architecture.`}),(0,G.jsxs)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:[`The Myco agent regenerates it as the codebase shifts, so connected agents can pull a current overview before exploring with Glob or Grep. Use `,(0,G.jsx)(`strong`,{children:`Rebuild`}),` to start over from scratch instead of refreshing the existing draft.`]})]})]})}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[(0,G.jsx)(Qj,{children:`Canopy Map`}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{"data-testid":`project-map-generated-at`,children:[`Last generated: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:p})]}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{"data-testid":`project-map-tokens`,children:[`Tokens: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:m})]}),f?(0,G.jsx)(X,{variant:`secondary`,className:`ml-1`,children:`No map yet`}):null]})]}),f?null:(0,G.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Y,{variant:`default`,size:`sm`,onClick:()=>c(`refresh`),disabled:u,className:`gap-2`,"data-testid":`canopy-map-refresh`,children:[(0,G.jsx)(ps,{className:o===`refresh`?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),o===`refresh`?`Refreshing…`:`Refresh`]}),(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:()=>c(`rebuild`),disabled:u,className:`gap-2`,"data-testid":`canopy-map-rebuild`,children:[(0,G.jsx)(ms,{className:o===`rebuild`?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),o===`rebuild`?`Rebuilding…`:`Rebuild`]})]}),n?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:n}):null]})]}),i?(0,G.jsxs)(`div`,{className:`mt-4 flex items-start gap-2 rounded-md border border-primary/20 bg-primary/5 p-3 text-xs text-on-surface`,role:`status`,"data-testid":`canopy-map-skip-notice`,children:[(0,G.jsx)(Jo,{className:`mt-0.5 h-3.5 w-3.5 flex-shrink-0 text-primary`}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans font-medium`,children:l?.title??`Regenerate skipped.`}),(0,G.jsx)(`p`,{className:`font-sans text-on-surface-variant`,children:l?.detail??(0,G.jsxs)(G.Fragment,{children:[`Reason: `,(0,G.jsx)(`code`,{className:`font-mono`,children:i})]})})]})]}):null]}),e.isPending?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6`,children:(0,G.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,G.jsx)(`div`,{className:`h-5 w-1/3 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-full animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-5/6 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-2/3 animate-pulse rounded bg-surface-container-high`})]})}):e.isError?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-tertiary/20 p-6`,children:(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 text-tertiary`,"data-testid":`project-map-error`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load Canopy Map.`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:e.error instanceof Error?e.error.message:`Unknown error`})]})}):f?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/20 p-8`,children:(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 text-center`,"data-testid":`project-map-empty`,children:[(0,G.jsx)(ns,{className:`h-6 w-6 text-primary`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface`,children:d?.message??`No Canopy Map yet.`}),(0,G.jsxs)(`p`,{className:`max-w-md font-sans text-xs text-on-surface-variant`,children:[`Generate the first map to give connected agents a high-level tour of your codebase. Future runs refresh incrementally; use`,` `,(0,G.jsx)(`strong`,{children:`Rebuild`}),` to start over.`]}),(0,G.jsxs)(`p`,{className:`max-w-md font-sans text-xs text-on-surface-variant`,children:[`The map needs at least one described file to build from. Enable the`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`(opt-in by default) so files get described in the background.`]}),(0,G.jsxs)(Y,{variant:`default`,size:`sm`,onClick:()=>c(`rebuild`),disabled:u,className:`gap-2 mt-1`,"data-testid":`canopy-map-generate`,children:[(0,G.jsx)(ps,{className:u?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),u?`Generating…`:`Generate Map`]}),n?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:n}):null,i?(0,G.jsxs)(`div`,{className:`max-w-md space-y-1 text-xs text-on-surface-variant`,children:[(0,G.jsx)(`p`,{className:`font-sans font-medium text-on-surface`,children:l?.title??`Regenerate skipped.`}),(0,G.jsx)(`p`,{className:`font-sans`,children:l?.detail??(0,G.jsxs)(G.Fragment,{children:[`Reason: `,(0,G.jsx)(`code`,{className:`font-mono`,children:i})]})})]}):null]})}):(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6`,children:(0,G.jsx)(`div`,{"data-testid":`project-map-content`,children:(0,G.jsx)(uO,{content:d.content})})})]})}var GN={2:`grid-cols-1 md:grid-cols-2`,3:`grid-cols-1 md:grid-cols-3`,4:`grid-cols-1 md:grid-cols-2 lg:grid-cols-4`};function KN(e,t){return e||(t<=2?2:t===3?3:4)}function qN({tabs:e,activeTab:t,onTabChange:n,columns:r,className:i}){return(0,G.jsx)(`div`,{role:`tablist`,className:J(`grid divide-y md:divide-y-0 md:divide-x divide-[var(--ghost-border)] border border-[var(--ghost-border)] rounded-md overflow-hidden bg-surface-container-low`,GN[KN(r,e.length)],i),children:e.map(e=>{let r=e.id===t;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:J(`relative flex flex-col items-start gap-1 px-4 py-3 text-left transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,r?`bg-surface-container text-on-surface`:`text-on-surface-variant hover:bg-surface-container/60 hover:text-on-surface`),children:[r&&(0,G.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-0 top-0 h-[2px] bg-sage`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.Icon&&(0,G.jsx)(e.Icon,{size:14,className:r?`text-sage`:`text-outline`}),(0,G.jsx)(`span`,{className:`myco-display-xs`,children:e.label})]}),e.description&&(0,G.jsx)(`span`,{className:`myco-eyebrow-sm`,children:e.description})]},e.id)})})}function JN({tabs:e,activeTab:t,onTabChange:n,className:r}){return(0,G.jsx)(`div`,{role:`tablist`,className:J(`inline-flex items-center gap-1 p-1 rounded-md bg-surface-container-low border border-[var(--ghost-border)]`,r),children:e.map(e=>{let r=e.id===t;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:J(`inline-flex items-center gap-1.5 px-3 py-1 rounded text-sm font-sans transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,r?`bg-surface-container text-on-surface shadow-[inset_0_-2px_0_var(--sage)]`:`text-on-surface-variant hover:text-on-surface`),children:[(0,G.jsx)(`span`,{children:e.label}),e.count!=null&&(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline`,children:e.count})]},e.id)})})}var YN=[{id:`overview`,label:`Overview`},{id:`entries`,label:`Entries`},{id:`map`,label:`Map`}],XN=new Set(YN.map(e=>e.id)),ZN=`section`,QN=[{id:`instructions`,label:`Instructions`,description:`session-start`},{id:`builder`,label:`Builder`,description:`prompt forge`},{id:`digest`,label:`Digest`,description:`context tiers`},{id:`canopy`,label:`Canopy`,description:`code index`}],$N=new Set(QN.map(e=>e.id)),eP=new Set([`completed`,`failed`,`skipped`]),tP=12,nP=140,rP=[{value:`1500`,label:`1.5K - Executive briefing`},{value:`5000`,label:`5K - Deep onboarding`},{value:`10000`,label:`10K - Full institutional`}];function iP(e){let t=new URLSearchParams(e).get(`tab`);return t&&$N.has(t)?t:`instructions`}function aP(e){let t=new URLSearchParams(e).get(ZN);return t&&XN.has(t)?t:`overview`}function oP(e){return e?new Date(e*1e3).toLocaleString():`Not generated yet`}function sP(e){switch(e){case`event-tasks-disabled`:return`event-driven tasks are disabled`;case`provider-not-configured`:return`no provider is configured for Cortex instructions`;case`agent-module-unavailable`:return`the agent harness is unavailable`;default:return e??`unknown reason`}}function cP(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e.match(RegExp(`## ${n}\\n([\\s\\S]*?)\\n\\n## `));if(!r?.[1])return null;try{return JSON.parse(r[1])}catch{return null}}function lP(e){if(!e)return{goal:``,targetSymbiontName:null,targetSymbiontDisplayName:null,inlineInstructions:null};let t=e.match(/^Goal:\n([\s\S]*?)\n\n## Target symbiont\n/),n=cP(e,`Target symbiont`),r=cP(e,`Delivery contract`);return{goal:t?.[1]?.trim()??``,targetSymbiontName:n?.name??null,targetSymbiontDisplayName:n?.displayName??null,inlineInstructions:typeof r?.inline_instructions==`boolean`?r.inline_instructions:null}}function uP(e){switch(e){case`completed`:return`default`;case`failed`:return`destructive`;case`running`:return`warning`;default:return`secondary`}}function dP(e){return e===null?null:e?`Instructions included in prompt`:`Uses session-start instructions`}function fP(){return ot({queryKey:[`cortex-instructions`],queryFn:({signal:e})=>$i(`/cortex/instructions`,{signal:e}),staleTime:6e4})}function pP(e){return ot({queryKey:[`cortex-prompt-builder`,e],queryFn:({signal:t})=>$i(`/cortex/prompt-builder/${e}`,{signal:t}),enabled:!!e,staleTime:0,refetchInterval:e=>{let t=e.state.data?.status;return t&&eP.has(t)?!1:Hs.PROGRESS}})}function mP(){let e=An(),t=Nn(),n=iP(e.search),r=aP(e.search),i=(0,W.useCallback)(n=>{if(!$N.has(n))return;let r=new URLSearchParams(e.search);n===`instructions`?r.delete(`tab`):r.set(`tab`,n),n!==`canopy`&&r.delete(ZN);let i=r.toString();t({pathname:e.pathname,search:i?`?${i}`:``},{replace:!0})},[e.pathname,e.search,t]),a=(0,W.useCallback)(n=>{if(!XN.has(n))return;let r=new URLSearchParams(e.search);r.set(`tab`,`canopy`),n===`overview`?r.delete(ZN):r.set(ZN,n);let i=r.toString();t({pathname:e.pathname,search:i?`?${i}`:``},{replace:!0})},[e.pathname,e.search,t]);return(0,G.jsxs)(AA,{children:[(0,G.jsx)(cN,{title:`Cortex`,subtitle:`Manage session-start context, prompt building, and digest access for connected symbionts.`}),(0,G.jsx)(qN,{tabs:QN.map(e=>({id:e.id,label:e.label,description:e.description})),activeTab:n,onTabChange:i,columns:4}),n===`digest`?(0,G.jsx)(yP,{}):n===`builder`?(0,G.jsx)(_P,{}):n===`canopy`?(0,G.jsx)(hP,{section:r,onSectionChange:a,searchParams:e.search}):(0,G.jsx)(gP,{})]})}function hP({section:e,onSectionChange:t,searchParams:n}){return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(JN,{tabs:YN.map(e=>({id:e.id,label:e.label})),activeTab:e,onTabChange:t}),e===`entries`?(()=>{let e=new URLSearchParams(n).get(`path`)??void 0;return(0,G.jsx)(HN,{defaultPath:e},e??`no-path`)})():e===`map`?(0,G.jsx)(WN,{}):(0,G.jsx)(xP,{})]})}function gP(){let{effective:e,isLoading:t}=Na(),n=fP(),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!1),[s,c]=(0,W.useState)(null),l=(0,W.useCallback)(async()=>{i(!0);try{c(await sa(`/cortex/instructions/refresh`,{})),await n.refetch()}finally{i(!1)}},[n]);if(t||!e)return(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading...`});let u=n.data;return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(Q,{level:`low`,accent:`sage`,className:`rounded-lg border border-outline-variant p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-sage/10 p-2 text-sage`,children:(0,G.jsx)(po,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{tone:`sage`,children:`Cortex · instructions`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Session-start instructions for Myco-enabled symbionts`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Review the stored instructions, control whether they inject alongside the digest, and refresh the stored guidance when project context changes.`})]})]})}),(0,G.jsxs)(Q,{id:Ya.cortexInstructions,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{children:`Settings`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Instructions Settings`})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.instructions.injectOnSessionStart,label:`Inject session-start instructions`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.digest.injectOnSessionStart,label:`Inject preferred digest`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!1,onCheckedChange:t})})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.spores.injectOnPromptSubmit,label:`Prompt-time spore retrieval`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.spores.maxPerPrompt,label:`Max spores per prompt`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:0,max:10,value:String(e??3),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{children:`Artifact`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Current Instructions`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Stored Markdown generated by the Myco agent for session-start injection.`}),s?(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface-variant`,children:s.started?`Refresh started${s.runId?` — run ${s.runId}`:``}. The stored artifact updates when that run completes.`:`Refresh did not start${s.reason?` — ${sP(s.reason)}`:``}.`}):null]}),(0,G.jsx)(Y,{onClick:()=>void l(),disabled:r,children:r?`Starting...`:`Refresh`})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(X,{variant:u?.enabled?`default`:`secondary`,children:u?.enabled?`Session start enabled`:`Session start disabled`}),(0,G.jsx)(X,{variant:`secondary`,children:u?.stored?`Stored artifact`:`No stored artifact`}),(0,G.jsxs)(X,{variant:`secondary`,children:[`Generated: `,oP(u?.generatedAt??null)]})]}),(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5`,children:n.isLoading?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading instructions...`}):u?.content?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?`Collapse`:`Expand`})}),(0,G.jsx)(`div`,{className:a?`max-h-[70vh] overflow-auto pr-2`:`max-h-[28rem] overflow-auto pr-2`,children:(0,G.jsx)(uO,{content:u.content})})]}):(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`No Cortex instructions are stored yet. Refresh to generate them.`})})]})]})}function _P(){let e=Wk({task:`cortex-prompt-builder`,limit:tP}),{data:t}=Pj(),n=(0,W.useMemo)(()=>(t?.symbionts??[]).filter(e=>e.enabled),[t]),[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(n[0]?.name??``),[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),p=pP(s?.runId??null),m=pP(l),h=(0,W.useMemo)(()=>(e.data?.runs??[]).map(e=>({run:e,parsed:lP(e.instruction)})),[e.data?.runs]),g=(0,W.useMemo)(()=>h.find(({run:e})=>e.id===l)??null,[h,l]);(0,W.useEffect)(()=>{if(n.length===0){a&&o(``);return}n.some(e=>e.name===a)||o(n[0]?.name??``)},[n,a]);let _=(0,W.useCallback)(async()=>{f(!0);try{c(await sa(`/cortex/prompt-builder`,{goal:r,...a?{symbiont:a}:{}})),e.refetch()}finally{f(!1)}},[e,r,a]),v=r.trim().length>0;return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(Q,{id:Ya.cortexBuilder,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(Cs,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Prompt Builder`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Tell Myco what you want to build and which enabled symbiont you are targeting. Cortex runs a task through the Myco agent harness and returns a high-signal prompt you can paste into that agent.`})]})]}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`font-sans text-sm font-medium text-on-surface`,children:`What do you want to build?`}),(0,G.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:`Build a migration workflow for ...`,rows:5,className:`w-full rounded-md bg-surface-container-lowest px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-hidden focus:ring-2 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 resize-y`})]}),(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Target symbiont`}),(0,G.jsxs)(w_,{value:a,onValueChange:o,children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{placeholder:`Choose a symbiont`})}),(0,G.jsx)(D_,{children:n.map(e=>(0,G.jsx)(O_,{value:e.name,children:e.displayName},e.name))})]}),(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`This list comes from the symbionts enabled for this project.`})]}),(0,G.jsx)(Y,{onClick:()=>void _(),disabled:!v||d,children:d?`Starting...`:`Build Prompt`})]})]}),s?(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(p.data?.status??`running`),children:p.data?.status??`running`}),dP(s.inlineInstructions)?(0,G.jsx)(X,{variant:`secondary`,children:dP(s.inlineInstructions)}):null,s.targetSymbiont?(0,G.jsx)(X,{variant:`secondary`,children:s.targetSymbiont.displayName}):null]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:p.data?.status&&eP.has(p.data.status)?`Run ${s.runId??`pending`} finished.`:`Run ${s.runId??`pending`} is in progress. Cortex checks for the prompt automatically.`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s.runId?(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>u(s.runId),children:`View Details`}):null,(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{p.refetch(),e.refetch()},disabled:p.isFetching||e.isFetching,children:p.isFetching||e.isFetching?`Refreshing...`:`Refresh`})]})]})]}):null,(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Qj,{children:`Recent Builds`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Each run captures the original build request, the generated prompt, and a direct link to the underlying agent run.`})]}),(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),disabled:e.isFetching,children:e.isFetching?`Refreshing...`:`Refresh`})]}),e.isLoading?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading recent builds...`}):h.length===0?(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5`,children:(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`No builder runs yet. Start one above and Cortex will keep the prompt artifact here.`})}):(0,G.jsx)(`div`,{className:`space-y-3`,children:h.map(({run:e,parsed:t})=>(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-4 space-y-3`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(e.status),children:e.status}),dP(t.inlineInstructions)?(0,G.jsx)(X,{variant:`secondary`,children:dP(t.inlineInstructions)}):null,t.targetSymbiontDisplayName?(0,G.jsx)(X,{variant:`secondary`,children:t.targetSymbiontDisplayName}):null]}),(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:KA(t.goal||`Untitled build request`,nP)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 font-sans text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{children:[`Started `,QA(e.started_at)]}),(0,G.jsxs)(`span`,{children:[`Run `,qA(e.id)]}),e.completed_at?(0,G.jsxs)(`span`,{children:[`Duration `,XA(e.started_at,e.completed_at)]}):null]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>u(e.id),children:`View Details`}),(0,G.jsx)(`a`,{href:`/agent?run=${e.id}`,className:`inline-flex h-8 items-center justify-center rounded-md border border-[var(--ghost-border)] px-3 font-sans text-xs font-medium text-on-surface transition-all hover:bg-surface-container-high`,children:`Open Run`})]})]})},e.id))})]}),(0,G.jsx)($f,{open:l!==null,onOpenChange:e=>{e||u(null)},children:(0,G.jsxs)(rp,{className:`max-w-4xl max-h-[90vh] overflow-y-auto`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsx)(op,{children:`Prompt Build Details`}),(0,G.jsx)(sp,{children:`Review the generated prompt, task reports, and jump to the full agent run when you need deeper diagnostics.`})]}),l?(0,G.jsx)(vP,{runId:l,runInstruction:g?.run.instruction??null,result:m.data,isLoading:m.isLoading,isFetching:m.isFetching,onRefresh:()=>void m.refetch()}):null]})})]})}function vP({runId:e,runInstruction:t,result:n,isLoading:r,isFetching:i,onRefresh:a}){let o=(0,W.useMemo)(()=>lP(t),[t]),[s,c]=(0,W.useState)(!1),l=(0,W.useCallback)(async()=>{n?.prompt&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(n.prompt),c(!0),window.setTimeout(()=>c(!1),1500))},[n?.prompt]);return r&&!n?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading build details...`}):(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(n?.status),children:n?.status??`loading`}),(0,G.jsxs)(X,{variant:`secondary`,children:[`Run `,qA(e)]}),o.targetSymbiontDisplayName?(0,G.jsx)(X,{variant:`secondary`,children:o.targetSymbiontDisplayName}):null]}),o.goal?(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:o.goal}):null,dP(o.inlineInstructions)?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:o.inlineInstructions?`This build embeds the current Cortex instructions directly into the generated prompt.`:`This build expects the target symbiont to receive Cortex instructions at session start.`}):null]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?.prompt?(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void l(),children:s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(mo,{className:`mr-1.5 h-3.5 w-3.5`}),`Copied`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ko,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Prompt`]})}):null,(0,G.jsx)(`a`,{href:`/agent?run=${e}`,className:`inline-flex h-8 items-center justify-center rounded-md border border-[var(--ghost-border)] px-3 font-sans text-xs font-medium text-on-surface transition-all hover:bg-surface-container-high`,children:`Open Full Run`}),(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:a,disabled:i,children:i?`Refreshing...`:`Refresh`})]})]}),(0,G.jsxs)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5 space-y-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Generated Prompt`}),n?.prompt?(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-sm text-on-surface`,children:n.prompt}):(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:n?.status===`failed`?n.error||`The prompt builder run failed before producing a prompt.`:`Waiting for the Myco agent to produce the prompt...`})]}),n?.reports?.length?(0,G.jsxs)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5 space-y-3`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Task Reports`}),(0,G.jsx)(`div`,{className:`space-y-2`,children:n.reports.map(e=>(0,G.jsxs)(`div`,{className:`rounded-md border border-outline-variant/20 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:e.action}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:GA(e.created_at)})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:e.summary})]},e.id))})]}):null]})}function yP(){return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(Q,{id:Ya.cortexDigest,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(jo,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Digest`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Choose which digest tier Cortex should use when digest injection is enabled, and review the maintained extracts below for on-demand retrieval.`})]})]}),(0,G.jsx)(_N,{path:Ka.digest.tier,label:`Preferred digest tier`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsxs)(w_,{value:String(e??5e3),onValueChange:e=>t(Number(e)),children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{})}),(0,G.jsx)(D_,{children:rP.map(e=>(0,G.jsx)(O_,{value:e.value,children:e.label},e.value))})]})})]}),(0,G.jsx)(CN,{})]})}function bP({patterns:e,onChange:t}){let[n,r]=(0,W.useState)(``),i=(0,W.useCallback)(()=>{let i=n.trim();if(!(!i||i.startsWith(`#`))){if(e.includes(i)){r(``);return}t([...e,i]),r(``)}},[n,e,t]),a=(0,W.useCallback)(n=>{t(e.filter((e,t)=>t!==n))},[e,t]);return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`rounded-md border border-outline-variant/30 bg-surface-container-low px-3 py-2 min-h-[44px]`,children:e.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs italic text-on-surface-variant`,children:`No custom patterns yet — the Myco baseline above already covers common noise.`}):(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map((e,t)=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-surface-container px-2 py-0.5 font-mono text-xs text-on-surface`,children:[e,(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(t),"aria-label":`Remove pattern ${e}`,className:`rounded text-on-surface-variant hover:text-on-surface focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary/40`,children:`×`})]},`${e}-${t}`))})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(cp,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},placeholder:`e.g. fixtures/large/** or **/*.snap`,className:`font-mono text-xs`}),(0,G.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:i,disabled:n.trim().length===0,children:`Add`})]}),(0,G.jsxs)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:[`Press Enter or click Add. Glob syntax: `,(0,G.jsx)(`code`,{className:`font-mono`,children:`**`}),` `,`any depth, `,(0,G.jsx)(`code`,{className:`font-mono`,children:`*`}),` any chars in one segment.`]})]})}function xP(){let{effective:e,isLoading:t}=Na(),{data:n}=Jk(),r=n?.tasks.find(e=>e.name===`canopy-describe`),i=(e?.agent?.tasks?.[`canopy-describe`])?.schedule?.enabled??r?.schedule?.enabled??!1;return t||!e?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading...`}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/15 p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(As,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Canopy is your project's live code index.`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`It tracks what every file does so connected agents can answer codebase questions and skip redundant Reads. The Myco agent describes files in the background — opt-in, configurable below.`})]})]})}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-collection`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Collection`}),(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[`The scanner automatically skips anything matched by this project's`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.gitignore`}),` `,`files (root and nested), the Myco baseline below, and directories that Myco and your installed symbionts manage (`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.myco/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.agents/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.claude/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.cursor/`}),`, etc.). Add your own patterns at the bottom to exclude additional paths.`]})]}),(0,G.jsx)(_N,{path:Ka.canopy.exclude.defaultPatterns,label:`Myco baseline (read-only)`,defaultScope:`project`,children:({value:e})=>(0,G.jsxs)(`div`,{className:`rounded-md border border-outline-variant/20 bg-surface-container-low/50 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e??[]).map(e=>(0,G.jsx)(`code`,{className:`inline-block rounded bg-surface-container px-2 py-0.5 font-mono text-xs text-on-surface-variant`,children:e},e))}),(0,G.jsx)(`p`,{className:`pt-2 font-sans text-xs text-on-surface-variant`,children:`Maintained by Myco. Filesystem and toolchain noise that shouldn't be indexed regardless of project setup.`})]})}),(0,G.jsx)(_N,{path:Ka.canopy.exclude.patterns,label:`Your patterns`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(bP,{patterns:e??[],onChange:t})}),(0,G.jsxs)(`div`,{className:`space-y-1 pt-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-xs uppercase tracking-wide text-on-surface-variant`,children:`Background refresh`}),(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[`Session start and the Write/Edit tool already keep the index fresh during sessions. The background sweep is the safety net for changes made outside sessions (`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`git pull`}),`, edits via non-Myco tools).`]})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.canopy.refresh.backgroundEnabled,label:`Periodic background scan`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.canopy.refresh.backgroundPeriodMinutes,label:`Period (minutes)`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:1,value:String(e??60),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-injection`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsx)(Qj,{children:`Injection`}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.canopy.injectOnPreToolUse,label:`Inject canopy on Read`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.canopy.minFileBytes,label:`Minimum file size (bytes)`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:0,value:String(e??800),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-llm`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(Qj,{children:`Intelligence`}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-sans text-xs font-medium `+(i?`border-primary/30 bg-primary/10 text-primary`:`border-outline-variant/40 bg-surface-container text-on-surface-variant`),children:[(0,G.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full `+(i?`bg-primary`:`bg-on-surface-variant/60`),"aria-hidden":!0}),i?`Descriptions on`:`Descriptions off`]})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`One-sentence summaries the Myco agent writes for each file. They power semantic search across your codebase, ride along with Canopy injection on Read, and feed the Canopy Map — the highest-leverage piece of Canopy once it’s on.`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:i?(0,G.jsxs)(G.Fragment,{children:[`The`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`is enabled and filling in descriptions on schedule. Visit the task page to change the model, schedule, or token budget.`]}):(0,G.jsxs)(G.Fragment,{children:[`The`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`ships `,(0,G.jsx)(`strong`,{children:`opt-in`}),` — its schedule is off by default so new projects don’t spend tokens unprompted. Enable it on the task page (where you can also pick a model and schedule) to start filling in descriptions; the Canopy Map needs at least one described file before it can build.`]})})]})]})}function SP(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 CP(e){if(Array.isArray(e))return e}function wP(e){if(Array.isArray(e))return SP(e)}function TP(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function EP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,LP(r.key),r)}}function DP(e,t,n){return t&&EP(e.prototype,t),Object.defineProperty(e,`prototype`,{writable:!1}),e}function OP(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=zP(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
84
|
+
`).find(e=>e.trim().length>0)?.replace(/^#+\s*/,``)??``;return(0,G.jsxs)(Q,{level:`low`,className:J(`rounded-md border border-outline-variant/20 transition-colors`,e.status===`superseded`&&`opacity-70`),role:`listitem`,children:[(0,G.jsx)(`button`,{type:`button`,onClick:()=>n(e=>!e),"aria-expanded":t,className:`w-full px-4 py-3 text-left hover:bg-surface-container-high/50 focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40`,children:(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[t?(0,G.jsx)(ho,{className:`h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant`}):(0,G.jsx)(_o,{className:`h-4 w-4 mt-0.5 shrink-0 text-on-surface-variant`}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 mb-1`,children:[(0,G.jsx)(X,{variant:r,children:e.observation_type}),(0,G.jsx)(X,{variant:i,children:e.status})]}),(0,G.jsx)(`p`,{className:J(`font-sans text-sm text-on-surface truncate`,e.status===`superseded`&&`line-through`),children:a})]})]})}),t&&(0,G.jsxs)(`div`,{className:`border-t border-outline-variant/20 px-4 py-3 space-y-3`,children:[(0,G.jsx)(uO,{content:e.content}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-x-4 gap-y-1 font-mono text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{title:GA(e.created_at),children:[`Created `,WA(e.created_at)]}),(0,G.jsxs)(`span`,{title:GA(e.updated_at),children:[`Last updated `,WA(e.updated_at)]})]})]})]})}function zM({sessionId:e,className:t}){let{data:n,isPending:r,isError:i}=kM({session_id:e,limit:FM});return r?(0,G.jsx)(`div`,{className:J(`space-y-3 p-4`,t),children:Array.from({length:3}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-20 animate-pulse rounded-md bg-surface-container-high`},t))}):i||!n?(0,G.jsx)(`div`,{className:J(`p-4 text-sm text-tertiary`,t),role:`alert`,children:`Failed to load spores for this session.`}):n.spores.length===0?(0,G.jsxs)(`div`,{className:J(`p-8 text-center text-on-surface-variant`,t),children:[(0,G.jsx)(`p`,{className:`font-sans text-sm italic`,children:`No spores derived from this session yet.`}),(0,G.jsx)(`p`,{className:`mt-2 font-mono text-xs`,children:`Spores get captured automatically as the agent learns from your prompts.`})]}):(0,G.jsx)(`div`,{className:J(`space-y-3 p-4`,t),role:`list`,children:n.spores.map(e=>(0,G.jsx)(RM,{spore:e},e.id))})}var BM=`/cortex?tab=canopy`,VM=1e3,HM=1e6;function UM(e){let t=e<0?`-`:``,n=Math.abs(e);return n>=HM?`${t}${(n/HM).toFixed(1)}M`:n>=VM*10?`${t}${Math.round(n/VM)}k`:n>=VM?`${t}${(n/VM).toFixed(1)}k`:`${t}${n.toLocaleString()}`}function WM(e){return e===null?`—`:e.toLocaleString()}function GM({label:e,value:t,hint:n}){return(0,G.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0`,title:n,children:[(0,G.jsx)(`span`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline`,children:e}),(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface`,children:t})]})}function KM({sessionId:e,fixture:t,className:n}){let[r,i]=(0,W.useState)(!1),a=t!==void 0,{data:o,isLoading:s}=vA(a?void 0:e),c=a?t:o??null;if(!a&&s)return null;let l=c?.canopy_tokens_saved??0,u=c?.canopy_injections_offered??null,d=c?.canopy_skips_after_injection??null,f=c?.canopy_reads_after_injection??null,p=c?.canopy_redundant_reads??null,m=c?.canopy_injection_total_tokens??null,h=gA(c,`myco_cortex`,`canopy_map`),g=u!==null&&u>0&&d!==null?`${d}/${u} skipped`:null;return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:J(`rounded-lg border border-outline-variant/10 bg-surface-container/60 p-4 border-t-2 border-t-sage`,`transition-[border-color,background-color] duration-200`,`hover:border-outline-variant/25 hover:bg-surface-container/80 cursor-pointer text-left`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-sage/40`,n),"data-testid":`canopy-efficiency-tile`,"aria-label":`${UM(l)} tokens saved by Canopy. Click for breakdown.`,children:[(0,G.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline mb-2`,children:`Reads saved`}),(0,G.jsx)(`div`,{className:`flex items-end justify-between gap-2`,children:(0,G.jsx)(`p`,{className:J(`font-serif text-2xl font-bold`,l>=0?`text-sage`:`text-terracotta`),children:UM(l)})}),g&&(0,G.jsx)(`p`,{className:`font-mono text-[10px] text-outline mt-1`,children:g}),(0,G.jsxs)(`p`,{className:`font-mono text-[10px] text-outline mt-1`,"data-testid":`canopy-map-calls`,children:[`Map calls: `,h]})]}),(0,G.jsx)($f,{open:r,onOpenChange:i,children:(0,G.jsxs)(rp,{className:`max-w-md`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsx)(op,{children:`Canopy: Reads saved this session`}),(0,G.jsx)(sp,{children:`Direct token savings from files the agent skipped Reading after Canopy injected file anatomy via PreToolUse.`})]}),(0,G.jsxs)(`div`,{className:`mb-4`,children:[(0,G.jsx)(`p`,{className:J(`font-serif text-3xl font-bold tracking-tight`,l>=0?`text-sage`:`text-terracotta`),"aria-label":`${UM(l)} net tokens saved on Reads`,children:UM(l)}),(0,G.jsxs)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-outline mt-1`,children:[`net tokens `,l>=0?`saved on reads`:`spent on injections`]})]}),(0,G.jsxs)(`div`,{className:`space-y-0`,children:[(0,G.jsx)(GM,{label:`Injections offered`,value:WM(u),hint:`PreToolUse Read events where Canopy injected anatomy.`}),(0,G.jsx)(GM,{label:`Skipped after injection`,value:WM(d),hint:`Files the agent did not Read after seeing the injected blob.`}),(0,G.jsx)(GM,{label:`Read anyway`,value:WM(f),hint:`Files the agent Read in full after the injection.`}),(0,G.jsx)(GM,{label:`Injection cost`,value:m===null?`—`:`${UM(m)} tok`,hint:`Sum of tokens spent on Canopy injections this session.`}),p!==null&&p>0&&(0,G.jsx)(GM,{label:`Redundant reads`,value:WM(p),hint:`Files Read more than once in this session (informational).`}),(0,G.jsx)(GM,{label:`Map calls`,value:h.toLocaleString(),hint:`Times the agent called canopy_map() during this session.`})]}),(0,G.jsx)(ri,{to:BM,onClick:()=>i(!1),className:`inline-block mt-4 font-mono text-xs text-sage hover:underline`,children:`Learn more about Canopy →`})]})})]})}function qM(e){return e===`active`?`active`:e===`completed`?`completed`:`error`}var JM={active:`bg-primary`,completed:`bg-secondary`,error:`bg-tertiary`},YM={active:`bg-primary/15 text-primary`,completed:`bg-surface-container-high text-on-surface-variant`,error:`bg-tertiary/15 text-tertiary`};function XM({status:e}){return(0,G.jsx)(`span`,{className:J(`inline-block h-2 w-2 rounded-full shrink-0`,JM[qM(e)])})}function ZM({status:e}){let t=qM(e),n=e.charAt(0).toUpperCase()+e.slice(1);return(0,G.jsxs)(`span`,{className:J(`inline-flex items-center gap-1.5 rounded-xs px-2 py-0.5 font-sans text-xs font-medium`,YM[t]),children:[(0,G.jsx)(XM,{status:e}),n]})}function QM(e){return e===null?`—`:UA(new Date(e*1e3).toISOString())}var $M=1500;function eN({label:e,value:t,mono:n=!0,copyable:r=!1,code:i=!1}){let[a,o]=(0,W.useState)(!1),s=(0,W.useCallback)(()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),$M)},[t]),c=i?(0,G.jsx)(`code`,{className:`text-xs font-mono text-primary bg-surface-container-lowest rounded px-1.5 py-0.5`,children:t}):(0,G.jsx)(`span`,{className:J(`text-xs text-on-surface`,n&&`font-mono`),children:t});return(0,G.jsxs)(`div`,{className:`flex items-baseline gap-3 py-1.5 border-b border-[var(--ghost-border)] last:border-0`,children:[(0,G.jsx)(`span`,{className:`shrink-0 w-20 font-sans text-xs font-medium text-on-surface-variant`,children:e}),r?(0,G.jsxs)(`button`,{onClick:s,title:`Click to copy`,className:`flex items-center gap-1.5 min-w-0 hover:text-primary transition-colors cursor-pointer`,children:[c,a&&(0,G.jsx)(mo,{className:`h-3 w-3 text-primary shrink-0`})]}):(0,G.jsx)(`span`,{className:`min-w-0`,children:c})]})}function tN({label:e,value:t,activeTab:n,onClick:r}){return(0,G.jsx)(`button`,{onClick:()=>r(t),className:J(`px-4 py-2 font-sans text-sm font-medium transition-colors cursor-pointer`,n===t?`border-b-2 border-primary text-on-surface`:`text-muted-foreground hover:text-on-surface`),children:e})}function nN({id:e}){let t=Nn(),{data:n,isLoading:r,isError:i,error:a}=Ok(e),{data:o}=Pj(),s=eA(),c=Nk(),[l,u]=(0,W.useState)(`idle`),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(()=>{let e=new URLSearchParams(window.location.search).get(`tab`);return e===`plans`?`plans`:e===`spores`?`spores`:`conversation`}),[h]=(0,W.useState)(()=>new URLSearchParams(window.location.search).get(`plan`)),g=Mk(),{data:_}=Pk(d?e:null),{data:v}=Fk(e);if(r)return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`flex h-64 items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(es,{className:`h-5 w-5 animate-spin`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Loading session...`})]})]});if(i||!n)return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session not found`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:a instanceof Error?a.message:`Unknown error`})]})]});let y=o?Fj(o.symbionts,n.agent,e):null;return(0,G.jsxs)(`div`,{className:`space-y-6 overflow-hidden`,children:[(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:()=>t(`/sessions`),className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Session Archive`})]}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-3 flex-wrap`,children:[(0,G.jsx)(`h1`,{className:`myco-display-lg text-on-surface m-0`,children:n.title??qA(n.id)}),(0,G.jsx)(ZM,{status:n.status}),(0,G.jsx)(Vj,{annotation:n.release_state}),n.agent&&(0,G.jsx)(X,{variant:`outline`,className:`font-mono text-[10px] px-1.5 py-0`,children:n.agent}),(0,G.jsxs)(Y,{variant:`secondary`,size:`sm`,className:`ml-auto gap-2`,disabled:l===`running`,onClick:async()=>{u(`running`);try{await s.mutateAsync({task:`title-summary`,instruction:`Process session ${e} only`}),u(`done`)}catch{u(`error`)}},children:[l===`running`?(0,G.jsx)(es,{className:`h-4 w-4 animate-spin`}):(0,G.jsx)(Cs,{className:`h-4 w-4`}),l===`done`?`Summary Requested`:`Generate Summary`]}),(()=>{let t=n.status!==`active`,r=c.isSuccess?`Session Completed`:t?`Already Completed`:`Complete Session`;return(0,G.jsxs)(Y,{variant:`secondary`,size:`sm`,className:`gap-2`,disabled:c.isPending||t,title:t?`Session is already completed`:`Mark this session completed and regenerate its summary`,onClick:()=>c.mutate(e),children:[c.isPending?(0,G.jsx)(es,{className:`h-4 w-4 animate-spin`}):(0,G.jsx)(So,{className:`h-4 w-4`}),r]})})(),(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`gap-2 text-tertiary hover:text-tertiary hover:bg-tertiary/10`,onClick:()=>f(!0),children:[(0,G.jsx)(ks,{className:`h-4 w-4`}),`Delete`]})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-4 font-sans text-sm text-on-surface-variant`,children:[n.user&&(0,G.jsxs)(`span`,{children:[`User: `,(0,G.jsx)(`span`,{className:`text-on-surface`,children:n.user})]}),n.branch&&(0,G.jsxs)(`span`,{children:[`Branch: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:n.branch})]}),(0,G.jsxs)(`span`,{children:[`Started `,QM(n.started_at)]}),n.ended_at&&(0,G.jsxs)(`span`,{children:[`Duration: `,XA(n.started_at,n.ended_at)]})]})]}),(0,G.jsxs)(`div`,{className:`grid grid-cols-2 md:grid-cols-4 gap-4`,children:[(0,G.jsx)(RA,{label:`Prompts`,value:String(n.prompt_count),tone:`sage`}),(0,G.jsx)(RA,{label:`Tool Calls`,value:String(n.tool_count),tone:`sage`}),(0,G.jsx)(RA,{label:`Plans`,value:String(v?.length??0)}),(0,G.jsx)(KM,{sessionId:e})]}),(0,G.jsxs)(Q,{level:`low`,className:`p-4 overflow-hidden`,children:[(0,G.jsx)(Qj,{className:`mb-3`,children:`Metadata`}),(0,G.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-x-6`,children:[(0,G.jsx)(eN,{label:`Session ID`,value:e,copyable:!0}),y&&(0,G.jsx)(eN,{label:`Resume`,value:y,copyable:!0,code:!0}),n.parent_session_id&&(0,G.jsx)(eN,{label:`Parent`,value:n.parent_session_id}),n.parent_session_reason&&(0,G.jsx)(eN,{label:`Reason`,value:n.parent_session_reason,mono:!1}),n.project_root&&(0,G.jsx)(eN,{label:`Project`,value:n.project_root})]})]}),n.summary&&(0,G.jsxs)(Q,{level:`low`,className:`p-4 overflow-hidden`,children:[(0,G.jsx)(Qj,{className:`mb-2`,children:`Summary`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant whitespace-pre-wrap break-words`,children:n.summary})]}),(0,G.jsxs)(`div`,{className:`min-w-0 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`flex gap-0 border-b border-border mb-4`,children:[(0,G.jsx)(tN,{label:`Conversation`,value:`conversation`,activeTab:p,onClick:m}),(0,G.jsx)(tN,{label:`Plans`,value:`plans`,activeTab:p,onClick:m}),(0,G.jsx)(tN,{label:`Spores`,value:`spores`,activeTab:p,onClick:m})]}),p===`conversation`&&(0,G.jsx)(gM,{sessionId:e}),p===`plans`&&(0,G.jsx)(wM,{sessionId:e,expandedPlanId:h}),p===`spores`&&(0,G.jsx)(zM,{sessionId:e})]}),(0,G.jsx)(jj,{open:d,onOpenChange:f,title:`Delete Session`,description:`This will permanently remove this session and all related data. This action cannot be undone.`,icon:(0,G.jsx)(ks,{className:`h-4 w-4 text-tertiary`}),meta:n?[{label:`ID`,value:qA(n.id)},{label:`Title`,value:n.title||qA(n.id)}]:[],impact:_?[{label:`Prompts`,value:_.promptCount},{label:`Spores`,value:_.sporeCount},{label:`Attachments`,value:_.attachmentCount},{label:`Graph Edges`,value:_.graphEdgeCount}]:[],confirmLabel:`Delete Session`,variant:`destructive`,onConfirm:()=>{g.mutate(n.id,{onSuccess:()=>{f(!1),t(`/sessions`)}})},isPending:g.isPending})]})}var rN=300;function iN(e,t=rN){let[n,r]=(0,W.useState)(e);return(0,W.useEffect)(()=>{let n=setTimeout(()=>r(e),t);return()=>clearTimeout(n)},[e,t]),n}function aN({initialFilters:e}){let[t,n]=(0,W.useState)(``),r=iN(t),[i,a]=(0,W.useState)(e),[o,s]=(0,W.useState)(0),c=(0,W.useCallback)((e,t)=>{a(n=>({...n,[e]:t})),s(0)},[]),l=(0,W.useCallback)(e=>{n(e),s(0)},[]),u=(0,W.useCallback)(e=>{let t=i[e];return t&&t!==`all`?t:void 0},[i]);return{searchInput:t,debouncedSearch:r.length>0?r:void 0,filterValues:i,offset:o,setOffset:s,handleSearchChange:l,handleFilterChange:c,activeFilter:u}}var oN={key:`status`,label:`Status`,options:[{value:`all`,label:`All statuses`},{value:`active`,label:`Active`},{value:`completed`,label:`Completed`}]};function sN(){let{id:e}=Ln(),t=Nn(),n=(0,W.useRef)(null),{searchInput:r,debouncedSearch:i,filterValues:a,offset:o,setOffset:s,handleSearchChange:c,handleFilterChange:l,activeFilter:u}=aN({initialFilters:{status:`all`,agent:`all`}}),{data:d}=Pj(),f=(0,W.useMemo)(()=>[oN,{key:`agent`,label:`Symbiont`,options:[{value:`all`,label:`All symbionts`},...(d?.symbionts??[]).filter(e=>e.enabled).map(e=>({value:e.name,label:e.displayName}))]}],[d]),p=u(`status`),m=u(`agent`);return(0,G.jsxs)(`div`,{className:`flex flex-col h-full gap-4 p-4`,children:[(0,G.jsx)(Ej,{searchPlaceholder:`Search sessions...`,searchValue:r,onSearchChange:c,filters:f,filterValues:a,onFilterChange:l,inputRef:n}),(0,G.jsx)(`div`,{className:`flex-1 min-h-0`,children:(0,G.jsx)(wj,{hasSelection:!!e,onCloseMobileDetail:()=>t(`..`),masterAriaLabel:`Sessions`,detailAriaLabel:`Session details`,master:(0,G.jsx)(Zj,{selectedId:e,search:i,statusFilter:p,agentFilter:m,offset:o,onOffsetChange:s,filterInputRef:n}),detail:e?(0,G.jsx)(nN,{id:e}):(0,G.jsx)(Tj,{message:`Select a session to see its details.`})})})]})}function cN({title:e,subtitle:t,actions:n,className:r}){return(0,G.jsx)(`div`,{className:J(`pb-6`,r),children:(0,G.jsxs)(`div`,{className:`flex items-start justify-between`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(`h1`,{className:`font-serif text-2xl font-normal text-on-surface tracking-wide`,children:e}),t&&(0,G.jsx)(`p`,{className:`mt-1 font-sans text-sm text-on-surface-variant`,children:t})]}),n&&(0,G.jsx)(`div`,{className:`flex items-center gap-2`,children:n})]})})}function lN({checked:e,onCheckedChange:t,disabled:n}){return(0,G.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":e,disabled:n,onClick:()=>t(!e),className:`relative inline-flex h-6 w-11 shrink-0 rounded-full transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2 ${n?`cursor-not-allowed opacity-50`:`cursor-pointer`} ${e?`bg-primary`:`bg-surface-container-high`}`,children:(0,G.jsx)(`span`,{className:`pointer-events-none block h-5 w-5 rounded-full bg-on-surface shadow-lg ring-0 transition-transform ${e?`translate-x-5`:`translate-x-0`}`})})}var uN=(0,W.createContext)(null);function dN({children:e}){let[t,n]=(0,W.useState)(()=>new Set),r=(0,W.useCallback)(e=>{n(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})},[]),i=(0,W.useCallback)(()=>n(new Set),[]),a=(0,W.useMemo)(()=>({dirty:t,markDirty:r,clear:i}),[t,r,i]);return(0,G.jsx)(uN.Provider,{value:a,children:e})}function fN(){let e=(0,W.useContext)(uN);if(!e)throw Error(`useRestartGate must be inside RestartGateProvider`);return e}function pN(){return(0,W.useContext)(uN)?.markDirty??(()=>{})}function mN(){let{dirty:e,clear:t}=fN(),{restart:n,isRestarting:r}=ec();if(e.size===0)return null;let i=async()=>{try{await n(),t()}catch{}};return(0,G.jsxs)(`div`,{className:`mb-4 flex items-center justify-between gap-4 rounded-md border border-ochre/40 bg-ochre/5 p-3`,children:[(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Restart required`}),(0,G.jsxs)(`p`,{className:`font-sans text-xs text-on-surface-variant truncate`,children:[`Changed: `,[...e].join(`, `)]})]}),(0,G.jsxs)(Y,{onClick:i,size:`sm`,disabled:r,children:[r?(0,G.jsx)(es,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):(0,G.jsx)(ps,{className:`mr-1.5 h-3.5 w-3.5`}),`Restart daemon`]})]})}function hN({id:e,label:t,scope:n,scopeIndicator:r,hint:i,helper:a,error:o,children:s}){return(0,G.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(`label`,{htmlFor:e,className:`font-sans text-sm font-medium text-on-surface`,children:t}),i&&(0,G.jsxs)(`span`,{className:`font-sans text-xs text-on-surface-variant font-normal`,children:[`(`,i,`)`]}),r??(n?(0,G.jsx)(OO,{scope:n}):null)]}),s,a&&(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:a}),o&&(0,G.jsxs)(`p`,{className:`flex items-center gap-1 font-sans text-xs text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-3 w-3`}),`Save failed: `,o]})]})}function gN(e,t,n){return e||(t===`local`?`personal`:t===`grove`||n===`grove`?`grove`:`project`)}function _N({path:e,label:t,hint:n,defaultScope:r=`local`,lockScope:i,allowPersonal:a=!0,requiresRestart:o,commitOn:s=`change`,parse:c,scopeBadgeOverride:l,children:u}){let{effective:d,local:f,setField:p,resetField:m,promoteField:h}=Na(),g=pN(),_=ga(d??{},e),v=!i&&ga(f??{},e)!==void 0,y=i??r,b=(0,W.useRef)(_);b.current=_;let[x,S]=(0,W.useState)(_),C=(0,W.useRef)(!1);(0,W.useEffect)(()=>{C.current||S(_)},[_]);let[w,T]=(0,W.useState)(null),E=(0,W.useCallback)(t=>{let n=c?c(t):t;n!==b.current&&(T(null),p(e,n,y).then(()=>{o&&g(e)}).catch(t=>{S(b.current),T(t instanceof Error?t.message:String(t)),console.error(`[scoped-field] write failed for ${e}`,t)}))},[e,y,c,o,p,g]),D=(0,W.useCallback)(e=>{C.current=!0,S(e),s===`change`&&(E(e),C.current=!1)},[E,s]),O=(0,W.useCallback)(()=>{s===`blur`&&x!==void 0&&E(x),C.current=!1},[E,s,x]),k=gN(l,i,r),A;!i&&a&&(r===`local`?v&&(A=(0,G.jsx)(kO,{mode:`local-default`,onPromote:()=>h(e).catch(e=>console.error(`[scoped-field] promote failed`,e)),onReset:()=>m(e).catch(e=>console.error(`[scoped-field] reset failed`,e))})):A=(0,G.jsx)(kO,{mode:`shared-default`,hasLocalOverride:v,defaultScopeBadge:k===`personal`?`project`:k,onSavePersonal:()=>p(e,b.current,`local`).catch(e=>console.error(`[scoped-field] save-personal failed`,e)),onReset:()=>m(e).catch(e=>console.error(`[scoped-field] reset failed`,e))}));let j=a&&r!==`local`&&!i?void 0:k;return(0,G.jsx)(`div`,{id:Xa(e),"data-config-field":e,className:`rounded-md transition-all duration-300`,children:(0,G.jsx)(hN,{label:t,hint:n,scope:A?void 0:j,scopeIndicator:A,error:w??void 0,children:u({value:x,onChange:D,onBlur:O})})})}var vN=200,yN={1500:`T1500 — Compact`,5e3:`T5000 — Standard`,1e4:`T10000 — Full`};function bN(e){return yN[e]??`T${e}`}function xN({tier:e}){let[t,n]=(0,W.useState)(!1),r=e.content.length>vN,i=r&&!t?e.content.slice(0,vN)+`…`:e.content;return(0,G.jsxs)(Q,{level:`low`,className:`p-5 space-y-3`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between gap-3 flex-wrap`,children:[(0,G.jsx)(`span`,{className:`font-mono text-sm text-on-surface font-medium`,children:bN(e.tier)}),(0,G.jsxs)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:[`Generated `,WA(e.generated_at)]})]}),(0,G.jsx)(uO,{content:i}),r&&(0,G.jsx)(Y,{variant:`ghost`,size:`sm`,className:`h-7 gap-1 text-xs text-on-surface-variant`,onClick:()=>n(!t),children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(vo,{className:`h-3 w-3`}),`Show less`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ho,{className:`h-3 w-3`}),`Show more (`,e.content.length-vN,` more chars)`]})})]})}function SN(){return(0,G.jsxs)(Q,{level:`low`,className:`p-5`,children:[(0,G.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,G.jsx)(`div`,{className:`h-4 w-24 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-20 animate-pulse rounded bg-surface-container`})]}),(0,G.jsxs)(`div`,{className:`space-y-2 mt-3`,children:[(0,G.jsx)(`div`,{className:`h-3 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-4/5 animate-pulse rounded bg-surface-container`}),(0,G.jsx)(`div`,{className:`h-3 w-3/5 animate-pulse rounded bg-surface-container`})]})]})}function CN({agentId:e}){let{data:t,isLoading:n,isError:r,error:i}=PM(e),a=t?.tiers??[];return n?(0,G.jsx)(`div`,{className:`space-y-4`,children:[1,2,3].map(e=>(0,G.jsx)(SN,{},e))}):r?(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-destructive`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load digest`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:i instanceof Error?i.message:`Unknown error`})]}):a.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(Ho,{className:`h-8 w-8 opacity-30`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`No digest generated yet`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-center max-w-xs`,children:`Run the agent with the digest-only task to synthesize your vault knowledge into context extracts.`})]}):(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[a.length,` tier`,a.length===1?``:`s`,` — pre-computed context extracts at different token budgets.`]}),a.map(e=>(0,G.jsx)(xN,{tier:e},e.tier))]})}var wN=6,TN=[{value:`all`,label:`All`},{value:`yes`,label:`Yes`},{value:`no`,label:`No`}],EN=[{value:`all`,label:`All`},{value:`typescript`,label:`TypeScript`},{value:`javascript`,label:`JavaScript`},{value:`tsx`,label:`TSX`},{value:`jsx`,label:`JSX`},{value:`python`,label:`Python`},{value:`rust`,label:`Rust`},{value:`go`,label:`Go`},{value:`json`,label:`JSON`},{value:`yaml`,label:`YAML`},{value:`markdown`,label:`Markdown`},{value:`shell`,label:`Shell`},{value:`sql`,label:`SQL`}],DN=[{id:`path`,label:`Path`},{id:`language`,label:`Language`},{id:`embedded`,label:`Embedded`},{id:`llm_updated_at`,label:`Last Described`},{id:`token_estimate`,label:`Tokens`}];function ON(e){if(e===`yes`)return!0;if(e===`no`)return!1}function kN(e){return(0,G.jsx)(X,{variant:e?`default`:`secondary`,children:e?`Yes`:`No`})}function AN({label:e,value:t,options:n,onValueChange:r,triggerClassName:i=`w-32`}){return(0,G.jsxs)(`label`,{className:`flex items-center gap-2 text-on-surface-variant`,children:[(0,G.jsx)(`span`,{className:`font-sans text-xs uppercase tracking-wider`,children:e}),(0,G.jsx)(`div`,{className:`${i} shrink-0`,children:(0,G.jsxs)(w_,{value:t,onValueChange:r,children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{})}),(0,G.jsx)(D_,{children:n.map(e=>(0,G.jsx)(O_,{value:e.value,children:e.label},e.value))})]})})]})}function jN({children:e,className:t,sortKey:n,activeSort:r,activeDir:i,onSort:a}){let o=n!==void 0&&a!==void 0,s=o&&r===n;return o?(0,G.jsx)(`th`,{className:J(`px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,t),"aria-sort":s?i===`desc`?`descending`:`ascending`:`none`,children:(0,G.jsxs)(`button`,{type:`button`,onClick:()=>a(n),className:J(`flex items-center gap-1 uppercase tracking-widest text-[10px] font-medium transition-colors`,s?`text-on-surface`:`text-on-surface-variant hover:text-on-surface`),"aria-label":`Sort by ${String(e)}`,children:[(0,G.jsx)(`span`,{children:e}),s?i===`desc`?(0,G.jsx)(ho,{className:`h-3 w-3`}):(0,G.jsx)(vo,{className:`h-3 w-3`}):(0,G.jsx)(ho,{className:`h-3 w-3 opacity-30`})]})}):(0,G.jsx)(`th`,{className:J(`px-4 py-3 text-left font-sans text-[10px] font-medium uppercase tracking-widest text-on-surface-variant`,t),children:e})}function MN(){return(0,G.jsxs)(`tr`,{className:`border-b border-[var(--ghost-border)]`,children:[(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-64 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-16 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-10 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-10 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-20 rounded bg-surface-container-high animate-pulse`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`div`,{className:`h-3 w-12 rounded bg-surface-container-high animate-pulse`})})]})}function NN({entry:e,selected:t,onClick:n}){return(0,G.jsxs)(`tr`,{className:J(`border-b border-[var(--ghost-border)] last:border-0 cursor-pointer transition-all duration-150`,`hover:bg-surface-container/60 hover:shadow-[inset_3px_0_0_var(--primary)]`,`focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary/40`,t&&`bg-primary/5 shadow-[inset_3px_0_0_var(--primary)]`),onClick:n,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),n())},tabIndex:0,role:`row`,"aria-selected":t,"aria-label":`Canopy entry: ${e.path}`,"data-testid":`canopy-entry-row-${e.path}`,children:[(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface block truncate`,title:e.path,children:e.path})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:e.language??`—`})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:kN(e.llm_description!==null)}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:kN(e.embedded===1)}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:QA(e.llm_updated_at)})}),(0,G.jsx)(`td`,{className:`px-4 py-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-xs text-on-surface-variant`,children:e.token_estimate.toLocaleString()})})]})}function PN({selectedPath:e,onSelectPath:t}){let{searchInput:n,debouncedSearch:r,filterValues:i,offset:a,setOffset:o,handleSearchChange:s,handleFilterChange:c,activeFilter:l}=aN({initialFilters:{language:`all`,described:`all`}}),[u,d]=(0,W.useState)(`llm_updated_at`),[f,p]=(0,W.useState)(`desc`),m=e=>{e===u?p(e=>e===`asc`?`desc`:`asc`):(d(e),p(`asc`))},{data:h,isLoading:g,isError:_,error:v}=bA((0,W.useMemo)(()=>({limit:50,offset:a,language:l(`language`),described:ON(l(`described`)),q:r,sort_by:u,sort_dir:f}),[a,l,r,u,f])),y=h?.rows??[],b=h?.total??0,x=(0,G.jsxs)(Q,{level:`bright`,className:`flex flex-wrap items-center gap-3 px-4 py-2 rounded-md`,children:[(0,G.jsx)(_s,{className:`h-3.5 w-3.5 text-on-surface-variant shrink-0`}),(0,G.jsx)(cp,{placeholder:`Search files (path or description)…`,value:n,onChange:e=>s(e.target.value),className:`bg-transparent border-none shadow-none focus-visible:ring-0 px-0 h-auto py-0 font-sans text-sm flex-1 min-w-[180px]`,"aria-label":`Search files`}),(0,G.jsx)(AN,{label:`Language`,value:i.language??`all`,options:EN,onValueChange:e=>c(`language`,e)}),(0,G.jsx)(AN,{label:`Described`,value:i.described??`all`,options:TN,onValueChange:e=>c(`described`,e)})]}),S=(0,G.jsx)(`thead`,{children:(0,G.jsx)(`tr`,{className:`border-b border-[var(--ghost-border)] bg-surface-container/50`,children:DN.map((e,t)=>{let n=[(0,G.jsx)(jN,{sortKey:e.id,activeSort:u,activeDir:f,onSort:m,children:e.label},e.id)];return e.id===`language`&&n.push((0,G.jsx)(jN,{children:`Described`},`described`)),n})})});return _?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[x,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load canopy entries`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:v instanceof Error?v.message:`Unknown error`})]})]}):(0,G.jsxs)(`div`,{className:`space-y-3`,children:[x,g?(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden`,children:(0,G.jsxs)(`table`,{className:`w-full`,children:[S,(0,G.jsx)(`tbody`,{children:Array.from({length:wN}).map((e,t)=>(0,G.jsx)(MN,{},t))})]})}):y.length===0?(0,G.jsxs)(`div`,{className:`flex h-48 flex-col items-center justify-center gap-3 text-on-surface-variant`,"data-testid":`canopy-entries-empty`,children:[(0,G.jsx)(Ro,{className:`h-10 w-10 opacity-20`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:b===0?`No canopy entries match the current filters.`:`No matching entries on this page.`})]}):(0,G.jsx)(Q,{level:`low`,className:`rounded-md overflow-hidden`,children:(0,G.jsxs)(`table`,{className:`w-full`,"aria-label":`Canopy entries`,children:[S,(0,G.jsx)(`tbody`,{children:y.map(n=>(0,G.jsx)(NN,{entry:n,selected:n.path===e,onClick:()=>t(n.path)},n.path))})]})}),(0,G.jsx)(Mj,{total:b,offset:a,limit:50,onPageChange:o})]})}function FN({open:e,onClose:t,widthPx:n=480,children:r,ariaLabel:i=`Detail panel`,className:a,testIdRoot:o}){return(0,W.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),t())};return document.addEventListener(`keydown`,n),()=>document.removeEventListener(`keydown`,n)},[e,t]),e?(0,G.jsxs)(Q,{glass:!0,role:`dialog`,"aria-label":i,className:J(`fixed top-3 right-3 bottom-3 z-30 flex flex-col shadow-lg border border-outline-variant/15 rounded-md max-w-[calc(100vw-1.5rem)]`,a),style:{width:n},"data-testid":o?`${o}-panel`:void 0,children:[(0,G.jsx)(`div`,{className:`flex justify-end px-3 pt-3`,children:(0,G.jsx)(`button`,{type:`button`,onClick:t,"aria-label":`Close detail`,"data-testid":o?`${o}-close`:void 0,className:`shrink-0 rounded-md p-1 text-on-surface-variant hover:text-on-surface hover:bg-surface-container-high transition-colors`,children:(0,G.jsx)(Is,{className:`h-4 w-4`})})}),(0,G.jsx)(`div`,{className:`flex-1 overflow-y-auto px-5 pb-5 pt-2`,children:r})]}):null}function IN(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}}function LN(e){return e.length>12?`${e.slice(0,12)}…`:e}function RN({label:e,children:t}){return(0,G.jsxs)(`div`,{className:`grid grid-cols-[140px_1fr] gap-3 items-baseline`,children:[(0,G.jsx)(`span`,{className:`font-sans text-xs uppercase tracking-wide text-on-surface-variant`,children:e}),(0,G.jsx)(`div`,{className:`font-mono text-xs text-on-surface min-w-0 break-all`,children:t})]})}function zN({text:e}){let[t,n]=(0,W.useState)(!1),r=(0,W.useCallback)(async()=>{navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(e),n(!0),window.setTimeout(()=>n(!1),1500))},[e]);return(0,G.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:()=>void r(),className:`gap-1 px-2 h-6 text-xs text-on-surface-variant`,children:t?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(mo,{className:`h-3 w-3`}),`Copied`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ko,{className:`h-3 w-3`}),`Copy`]})})}function BN(){return(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsx)(`div`,{className:`h-7 w-48 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-20 animate-pulse rounded-md bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:6}).map((e,t)=>(0,G.jsx)(`div`,{className:`h-4 w-full animate-pulse rounded bg-surface-container-high`},t))})]})}function VN({path:e,onBack:t,onClose:n}){let{data:r,isPending:i,isError:a,error:o}=xA(e),s=SA(),c=CA(),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),[p,m]=(0,W.useState)(null),[h,g]=(0,W.useState)(!1),_=(0,W.useMemo)(()=>IN(r?.exports_json??null),[r?.exports_json]),v=(0,W.useMemo)(()=>IN(r?.imports_json??null),[r?.imports_json]),y=(0,W.useCallback)(()=>{u(null),f(!1),s.mutate(e,{onSuccess:()=>{f(!0),window.setTimeout(()=>f(!1),2500)},onError:e=>{u(e instanceof Error?e.message:`Re-embed failed`)}})},[e,s]),b=(0,W.useCallback)(()=>{m(null),g(!1),c.mutate(e,{onSuccess:()=>{g(!0),window.setTimeout(()=>g(!1),2500)},onError:e=>{m(e instanceof Error?e.message:`Re-describe failed`)}})},[e,c]);if(i)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsx)(BN,{})});if(a)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-tertiary`,"data-testid":`canopy-entry-detail-error`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load entry`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:o instanceof Error?o.message:`Unknown error`})]})]})});if(!r)return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-3`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsxs)(`div`,{className:`flex h-40 flex-col items-center justify-center gap-2 text-on-surface-variant`,"data-testid":`canopy-entry-detail-empty`,children:[(0,G.jsx)(yo,{className:`h-5 w-5 opacity-50`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`No entry found at this path.`})]})]})});let x=r.embedded===1;return(0,G.jsx)(FN,{open:!0,onClose:n,ariaLabel:`Canopy entry detail`,testIdRoot:`canopy-entry-detail`,children:(0,G.jsxs)(`div`,{className:`space-y-4`,"data-testid":`canopy-entry-detail`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[t?(0,G.jsxs)(Y,{variant:`ghost`,size:`sm`,onClick:t,className:`gap-2 text-on-surface-variant -ml-2`,children:[(0,G.jsx)(so,{className:`h-4 w-4`}),`Back to list`]}):null,(0,G.jsx)(`h2`,{className:`font-mono text-sm text-on-surface break-all`,title:r.path,children:r.path}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[r.language?(0,G.jsx)(X,{variant:`outline`,children:r.language}):null,(0,G.jsx)(X,{variant:x?`default`:`secondary`,children:x?`Embedded`:`Not embedded`}),(0,G.jsx)(X,{variant:r.llm_description?`default`:`secondary`,children:r.llm_description?`Described`:`No description`})]})]}),(0,G.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:b,disabled:c.isPending,className:`gap-2`,"data-testid":`canopy-entry-redescribe`,"aria-label":`Re-run the Myco agent's description for this file.`,title:`Re-run the Myco agent's description for this file.`,children:[(0,G.jsx)(Cs,{className:c.isPending?`h-3.5 w-3.5 animate-pulse`:`h-3.5 w-3.5`}),c.isPending?`Describing...`:`Re-describe`]}),(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:y,disabled:s.isPending,className:`gap-2`,"data-testid":`canopy-entry-reembed`,children:[(0,G.jsx)(ps,{className:s.isPending?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),s.isPending?`Queuing...`:`Re-embed`]})]}),h?(0,G.jsx)(`span`,{className:`font-sans text-xs text-primary`,role:`status`,children:`Queued for re-describe`}):null,p?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:p}):null,d?(0,G.jsx)(`span`,{className:`font-sans text-xs text-primary`,role:`status`,children:`Queued for re-embed`}):null,l?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:l}):null]})]}),r.llm_description?(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-primary/15 p-4`,children:[(0,G.jsx)(Qj,{children:`Description`}),(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface leading-relaxed`,children:r.llm_description})]}):(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4`,children:[(0,G.jsx)(Qj,{children:`Description`}),(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface-variant`,children:`The Myco agent hasn't described this file yet.`})]}),(0,G.jsxs)(`div`,{className:`grid gap-3 lg:grid-cols-2`,children:[(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Exports`}),_.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`No exports detected.`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:_.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-xs text-on-surface break-all`,children:e},e))})]}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Imports`}),v.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`No imports detected.`}):(0,G.jsx)(`ul`,{className:`space-y-1`,children:v.map(e=>(0,G.jsx)(`li`,{className:`font-mono text-xs text-on-surface break-all`,children:e},e))})]})]}),r.top_comment?(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-2`,children:[(0,G.jsx)(Qj,{children:`Top Comment`}),(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-on-surface`,children:r.top_comment})]}):null,(0,G.jsxs)(Q,{level:`low`,className:`rounded-md border border-outline-variant/20 p-4 space-y-3`,children:[(0,G.jsx)(Qj,{children:`Metadata`}),(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(RN,{label:`Tokens`,children:r.token_estimate.toLocaleString()}),(0,G.jsx)(RN,{label:`Lines`,children:r.line_count.toLocaleString()}),(0,G.jsxs)(RN,{label:`Size`,children:[r.size_bytes.toLocaleString(),` B`]}),(0,G.jsx)(RN,{label:`Hash`,children:(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,G.jsx)(`code`,{title:r.content_hash,children:LN(r.content_hash)}),(0,G.jsx)(zN,{text:r.content_hash})]})}),(0,G.jsx)(RN,{label:`Indexed`,children:GA(r.mechanical_updated_at)}),(0,G.jsx)(RN,{label:`Described`,children:r.llm_updated_at===null?`—`:GA(r.llm_updated_at)})]})]})]})})}function HN({defaultPath:e}={}){let[t,n]=(0,W.useState)(e);return(0,G.jsxs)(`div`,{className:`relative space-y-6`,children:[(0,G.jsx)(PN,{selectedPath:t,onSelectPath:n}),t?(0,G.jsx)(VN,{path:t,onClose:()=>n(void 0)}):null]})}var UN={canopy_disabled:{title:`Canopy injection is turned off.`,detail:(0,G.jsxs)(G.Fragment,{children:[`Enable canopy injection on the`,` `,(0,G.jsx)(ri,{to:`/cortex?tab=canopy`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`Cortex → Canopy`}),` `,`page before regenerating the map.`]})},no_described_entries:{title:`No described files yet.`,detail:(0,G.jsxs)(G.Fragment,{children:[`The map is built from per-file descriptions written by the`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),`, which is opt-in. Enable its schedule (or run it once) so files get described, then regenerate the map.`]})},inputs_unchanged:{title:`The map is already current.`,detail:(0,G.jsx)(G.Fragment,{children:`No described files have changed since the last run. Use Rebuild to regenerate from scratch.`})},no_project_root:{title:`Project root unavailable.`,detail:(0,G.jsx)(G.Fragment,{children:`The daemon can’t resolve a project directory for this vault.`})}};function WN(){let e=TA(),t=EA(),[n,r]=(0,W.useState)(null),[i,a]=(0,W.useState)(null),[o,s]=(0,W.useState)(null),c=(0,W.useCallback)(e=>{r(null),a(null),s(e),t.mutate({force_cold_start:e===`rebuild`},{onSettled:()=>s(null),onSuccess:e=>{`skipped`in e&&e.skipped&&a(e.reason)},onError:e=>{r(e instanceof Error?e.message:`Regenerate failed`)}})},[t]),l=i?UN[i]??null:null,u=t.isPending,d=e.data,f=d?.is_empty===!0||!d?.content,p=d?.generated_at!==void 0&&d.generated_at!==null?GA(d.generated_at):`—`,m=d?.token_estimate!==void 0&&d.token_estimate!==null?d.token_estimate.toLocaleString():`—`;return(0,G.jsxs)(`div`,{className:`space-y-6`,"data-testid":`project-map-panel`,children:[(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/15 p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(ns,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`The Canopy Map is a guided tour of your project's architecture.`}),(0,G.jsxs)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:[`The Myco agent regenerates it as the codebase shifts, so connected agents can pull a current overview before exploring with Glob or Grep. Use `,(0,G.jsx)(`strong`,{children:`Rebuild`}),` to start over from scratch instead of refreshing the existing draft.`]})]})]})}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2 min-w-0`,children:[(0,G.jsx)(Qj,{children:`Canopy Map`}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{"data-testid":`project-map-generated-at`,children:[`Last generated: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:p})]}),(0,G.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,G.jsxs)(`span`,{"data-testid":`project-map-tokens`,children:[`Tokens: `,(0,G.jsx)(`span`,{className:`font-mono text-on-surface`,children:m})]}),f?(0,G.jsx)(X,{variant:`secondary`,className:`ml-1`,children:`No map yet`}):null]})]}),f?null:(0,G.jsxs)(`div`,{className:`flex flex-col items-end gap-2`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(Y,{variant:`default`,size:`sm`,onClick:()=>c(`refresh`),disabled:u,className:`gap-2`,"data-testid":`canopy-map-refresh`,children:[(0,G.jsx)(ps,{className:o===`refresh`?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),o===`refresh`?`Refreshing…`:`Refresh`]}),(0,G.jsxs)(Y,{variant:`outline`,size:`sm`,onClick:()=>c(`rebuild`),disabled:u,className:`gap-2`,"data-testid":`canopy-map-rebuild`,children:[(0,G.jsx)(ms,{className:o===`rebuild`?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),o===`rebuild`?`Rebuilding…`:`Rebuild`]})]}),n?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:n}):null]})]}),i?(0,G.jsxs)(`div`,{className:`mt-4 flex items-start gap-2 rounded-md border border-primary/20 bg-primary/5 p-3 text-xs text-on-surface`,role:`status`,"data-testid":`canopy-map-skip-notice`,children:[(0,G.jsx)(Jo,{className:`mt-0.5 h-3.5 w-3.5 flex-shrink-0 text-primary`}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans font-medium`,children:l?.title??`Regenerate skipped.`}),(0,G.jsx)(`p`,{className:`font-sans text-on-surface-variant`,children:l?.detail??(0,G.jsxs)(G.Fragment,{children:[`Reason: `,(0,G.jsx)(`code`,{className:`font-mono`,children:i})]})})]})]}):null]}),e.isPending?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6`,children:(0,G.jsxs)(`div`,{className:`space-y-2`,"aria-busy":`true`,children:[(0,G.jsx)(`div`,{className:`h-5 w-1/3 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-full animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-5/6 animate-pulse rounded bg-surface-container-high`}),(0,G.jsx)(`div`,{className:`h-4 w-2/3 animate-pulse rounded bg-surface-container-high`})]})}):e.isError?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-tertiary/20 p-6`,children:(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-2 text-tertiary`,"data-testid":`project-map-error`,children:[(0,G.jsx)(yo,{className:`h-5 w-5`}),(0,G.jsx)(`span`,{className:`font-sans text-sm`,children:`Failed to load Canopy Map.`}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:e.error instanceof Error?e.error.message:`Unknown error`})]})}):f?(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/20 p-8`,children:(0,G.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 text-center`,"data-testid":`project-map-empty`,children:[(0,G.jsx)(ns,{className:`h-6 w-6 text-primary`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface`,children:d?.message??`No Canopy Map yet.`}),(0,G.jsxs)(`p`,{className:`max-w-md font-sans text-xs text-on-surface-variant`,children:[`Generate the first map to give connected agents a high-level tour of your codebase. Future runs refresh incrementally; use`,` `,(0,G.jsx)(`strong`,{children:`Rebuild`}),` to start over.`]}),(0,G.jsxs)(`p`,{className:`max-w-md font-sans text-xs text-on-surface-variant`,children:[`The map needs at least one described file to build from. Enable the`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`(opt-in by default) so files get described in the background.`]}),(0,G.jsxs)(Y,{variant:`default`,size:`sm`,onClick:()=>c(`rebuild`),disabled:u,className:`gap-2 mt-1`,"data-testid":`canopy-map-generate`,children:[(0,G.jsx)(ps,{className:u?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),u?`Generating…`:`Generate Map`]}),n?(0,G.jsx)(`span`,{className:`font-sans text-xs text-tertiary`,role:`alert`,children:n}):null,i?(0,G.jsxs)(`div`,{className:`max-w-md space-y-1 text-xs text-on-surface-variant`,children:[(0,G.jsx)(`p`,{className:`font-sans font-medium text-on-surface`,children:l?.title??`Regenerate skipped.`}),(0,G.jsx)(`p`,{className:`font-sans`,children:l?.detail??(0,G.jsxs)(G.Fragment,{children:[`Reason: `,(0,G.jsx)(`code`,{className:`font-mono`,children:i})]})})]}):null]})}):(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6`,children:(0,G.jsx)(`div`,{"data-testid":`project-map-content`,children:(0,G.jsx)(uO,{content:d.content})})})]})}var GN={2:`grid-cols-1 md:grid-cols-2`,3:`grid-cols-1 md:grid-cols-3`,4:`grid-cols-1 md:grid-cols-2 lg:grid-cols-4`};function KN(e,t){return e||(t<=2?2:t===3?3:4)}function qN({tabs:e,activeTab:t,onTabChange:n,columns:r,className:i}){return(0,G.jsx)(`div`,{role:`tablist`,className:J(`grid divide-y md:divide-y-0 md:divide-x divide-[var(--ghost-border)] border border-[var(--ghost-border)] rounded-md overflow-hidden bg-surface-container-low`,GN[KN(r,e.length)],i),children:e.map(e=>{let r=e.id===t;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:J(`relative flex flex-col items-start gap-1 px-4 py-3 text-left transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,r?`bg-surface-container text-on-surface`:`text-on-surface-variant hover:bg-surface-container/60 hover:text-on-surface`),children:[r&&(0,G.jsx)(`span`,{"aria-hidden":!0,className:`absolute inset-x-0 top-0 h-[2px] bg-sage`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.Icon&&(0,G.jsx)(e.Icon,{size:14,className:r?`text-sage`:`text-outline`}),(0,G.jsx)(`span`,{className:`myco-display-xs`,children:e.label})]}),e.description&&(0,G.jsx)(`span`,{className:`myco-eyebrow-sm`,children:e.description})]},e.id)})})}function JN({tabs:e,activeTab:t,onTabChange:n,className:r}){return(0,G.jsx)(`div`,{role:`tablist`,className:J(`inline-flex items-center gap-1 p-1 rounded-md bg-surface-container-low border border-[var(--ghost-border)]`,r),children:e.map(e=>{let r=e.id===t;return(0,G.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":r,onClick:()=>n(e.id),className:J(`inline-flex items-center gap-1.5 px-3 py-1 rounded text-sm font-sans transition-colors`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-sage/40`,r?`bg-surface-container text-on-surface shadow-[inset_0_-2px_0_var(--sage)]`:`text-on-surface-variant hover:text-on-surface`),children:[(0,G.jsx)(`span`,{children:e.label}),e.count!=null&&(0,G.jsx)(`span`,{className:`font-mono text-[10px] text-outline`,children:e.count})]},e.id)})})}var YN=[{id:`overview`,label:`Overview`},{id:`entries`,label:`Entries`},{id:`map`,label:`Map`}],XN=new Set(YN.map(e=>e.id)),ZN=`section`,QN=[{id:`instructions`,label:`Instructions`,description:`session-start`},{id:`builder`,label:`Builder`,description:`prompt forge`},{id:`digest`,label:`Digest`,description:`context tiers`},{id:`canopy`,label:`Canopy`,description:`code index`}],$N=new Set(QN.map(e=>e.id)),eP=new Set([`completed`,`failed`,`skipped`]),tP=12,nP=140,rP=[{value:`1500`,label:`1.5K - Executive briefing`},{value:`5000`,label:`5K - Deep onboarding`},{value:`10000`,label:`10K - Full institutional`}];function iP(e){let t=new URLSearchParams(e).get(`tab`);return t&&$N.has(t)?t:`instructions`}function aP(e){let t=new URLSearchParams(e).get(ZN);return t&&XN.has(t)?t:`overview`}function oP(e){return e?new Date(e*1e3).toLocaleString():`Not generated yet`}function sP(e){switch(e){case`event-tasks-disabled`:return`event-driven tasks are disabled`;case`provider-not-configured`:return`no provider is configured for Cortex instructions`;case`agent-module-unavailable`:return`the agent harness is unavailable`;default:return e??`unknown reason`}}function cP(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=e.match(RegExp(`## ${n}\\n([\\s\\S]*?)\\n\\n## `));if(!r?.[1])return null;try{return JSON.parse(r[1])}catch{return null}}function lP(e){if(!e)return{goal:``,targetSymbiontName:null,targetSymbiontDisplayName:null,inlineInstructions:null};let t=e.match(/^Goal:\n([\s\S]*?)\n\n## Target symbiont\n/),n=cP(e,`Target symbiont`),r=cP(e,`Delivery contract`);return{goal:t?.[1]?.trim()??``,targetSymbiontName:n?.name??null,targetSymbiontDisplayName:n?.displayName??null,inlineInstructions:typeof r?.inline_instructions==`boolean`?r.inline_instructions:null}}function uP(e){switch(e){case`completed`:return`default`;case`failed`:return`destructive`;case`running`:return`warning`;default:return`secondary`}}function dP(e){return e===null?null:e?`Instructions included in prompt`:`Uses session-start instructions`}function fP(){return ot({queryKey:[`cortex-instructions`],queryFn:({signal:e})=>$i(`/cortex/instructions`,{signal:e}),staleTime:6e4})}function pP(e){return ot({queryKey:[`cortex-prompt-builder`,e],queryFn:({signal:t})=>$i(`/cortex/prompt-builder/${e}`,{signal:t}),enabled:!!e,staleTime:0,refetchInterval:e=>{let t=e.state.data?.status;return t&&eP.has(t)?!1:Hs.PROGRESS}})}function mP(){let e=An(),t=Nn(),n=iP(e.search),r=aP(e.search),i=(0,W.useCallback)(n=>{if(!$N.has(n))return;let r=new URLSearchParams(e.search);n===`instructions`?r.delete(`tab`):r.set(`tab`,n),n!==`canopy`&&r.delete(ZN);let i=r.toString();t({pathname:e.pathname,search:i?`?${i}`:``},{replace:!0})},[e.pathname,e.search,t]),a=(0,W.useCallback)(n=>{if(!XN.has(n))return;let r=new URLSearchParams(e.search);r.set(`tab`,`canopy`),n===`overview`?r.delete(ZN):r.set(ZN,n);let i=r.toString();t({pathname:e.pathname,search:i?`?${i}`:``},{replace:!0})},[e.pathname,e.search,t]);return(0,G.jsxs)(AA,{children:[(0,G.jsx)(cN,{title:`Cortex`,subtitle:`Manage session-start context, prompt building, and digest access for connected symbionts.`}),(0,G.jsx)(qN,{tabs:QN.map(e=>({id:e.id,label:e.label,description:e.description})),activeTab:n,onTabChange:i,columns:4}),n===`digest`?(0,G.jsx)(yP,{}):n===`builder`?(0,G.jsx)(_P,{}):n===`canopy`?(0,G.jsx)(hP,{section:r,onSectionChange:a,searchParams:e.search}):(0,G.jsx)(gP,{})]})}function hP({section:e,onSectionChange:t,searchParams:n}){return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(JN,{tabs:YN.map(e=>({id:e.id,label:e.label})),activeTab:e,onTabChange:t}),e===`entries`?(()=>{let e=new URLSearchParams(n).get(`path`)??void 0;return(0,G.jsx)(HN,{defaultPath:e},e??`no-path`)})():e===`map`?(0,G.jsx)(WN,{}):(0,G.jsx)(xP,{})]})}function gP(){let{effective:e,isLoading:t}=Na(),n=fP(),[r,i]=(0,W.useState)(!1),[a,o]=(0,W.useState)(!0),[s,c]=(0,W.useState)(null),l=(0,W.useCallback)(async()=>{i(!0);try{c(await sa(`/cortex/instructions/refresh`,{})),await n.refetch()}finally{i(!1)}},[n]);if(t||!e)return(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading...`});let u=n.data;return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(Q,{level:`low`,accent:`sage`,className:`rounded-lg border border-outline-variant p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-sage/10 p-2 text-sage`,children:(0,G.jsx)(po,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{tone:`sage`,children:`Cortex · instructions`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Session-start instructions for Myco-enabled symbionts`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Review the stored instructions, control whether they inject alongside the digest, and refresh the stored guidance when project context changes.`})]})]})}),(0,G.jsxs)(Q,{id:Ya.cortexInstructions,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{children:`Settings`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Instructions Settings`})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.instructions.injectOnSessionStart,label:`Inject session-start instructions`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.digest.injectOnSessionStart,label:`Inject preferred digest`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!1,onCheckedChange:t})})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.spores.injectOnPromptSubmit,label:`Prompt-time spore retrieval`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.spores.maxPerPrompt,label:`Max spores per prompt`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:0,max:10,value:String(e??3),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(PA,{children:`Artifact`}),(0,G.jsx)(`h3`,{className:`myco-display-sm text-on-surface m-0`,children:`Current Instructions`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Stored Markdown generated by the Myco agent for session-start injection.`}),s?(0,G.jsx)(`p`,{className:`mt-2 font-sans text-sm text-on-surface-variant`,children:s.started?`Refresh started${s.runId?` — run ${s.runId}`:``}. The stored artifact updates when that run completes.`:`Refresh did not start${s.reason?` — ${sP(s.reason)}`:``}.`}):null]}),(0,G.jsx)(Y,{onClick:()=>void l(),disabled:r,children:r?`Starting...`:`Refresh`})]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,G.jsx)(X,{variant:u?.enabled?`default`:`secondary`,children:u?.enabled?`Session start enabled`:`Session start disabled`}),(0,G.jsx)(X,{variant:`secondary`,children:u?.stored?`Stored artifact`:`No stored artifact`}),(0,G.jsxs)(X,{variant:`secondary`,children:[`Generated: `,oP(u?.generatedAt??null)]})]}),(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5`,children:n.isLoading?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading instructions...`}):u?.content?(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>o(e=>!e),children:a?`Collapse`:`Expand`})}),(0,G.jsx)(`div`,{className:a?`max-h-[70vh] overflow-auto pr-2`:`max-h-[28rem] overflow-auto pr-2`,children:(0,G.jsx)(uO,{content:u.content})})]}):(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`No Cortex instructions are stored yet. Refresh to generate them.`})})]})]})}function _P(){let e=Wk({task:`cortex-prompt-builder`,limit:tP}),{data:t}=Pj(),n=(0,W.useMemo)(()=>(t?.symbionts??[]).filter(e=>e.enabled),[t]),[r,i]=(0,W.useState)(``),[a,o]=(0,W.useState)(n[0]?.name??``),[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),[d,f]=(0,W.useState)(!1),p=pP(s?.runId??null),m=pP(l),h=(0,W.useMemo)(()=>(e.data?.runs??[]).map(e=>({run:e,parsed:lP(e.instruction)})),[e.data?.runs]),g=(0,W.useMemo)(()=>h.find(({run:e})=>e.id===l)??null,[h,l]);(0,W.useEffect)(()=>{if(n.length===0){a&&o(``);return}n.some(e=>e.name===a)||o(n[0]?.name??``)},[n,a]);let _=(0,W.useCallback)(async()=>{f(!0);try{c(await sa(`/cortex/prompt-builder`,{goal:r,...a?{symbiont:a}:{}})),e.refetch()}finally{f(!1)}},[e,r,a]),v=r.trim().length>0;return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(Q,{id:Ya.cortexBuilder,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(Cs,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Prompt Builder`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Tell Myco what you want to build and which enabled symbiont you are targeting. Cortex runs a task through the Myco agent harness and returns a high-signal prompt you can paste into that agent.`})]})]}),(0,G.jsxs)(`div`,{className:`space-y-3`,children:[(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`font-sans text-sm font-medium text-on-surface`,children:`What do you want to build?`}),(0,G.jsx)(`textarea`,{value:r,onChange:e=>i(e.target.value),placeholder:`Build a migration workflow for ...`,rows:5,className:`w-full rounded-md bg-surface-container-lowest px-3 py-2 font-sans text-sm text-on-surface placeholder:text-on-surface-variant/50 focus:outline-hidden focus:ring-2 focus:ring-primary/40 disabled:cursor-not-allowed disabled:opacity-50 resize-y`})]}),(0,G.jsxs)(`label`,{className:`block space-y-2`,children:[(0,G.jsx)(`span`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Target symbiont`}),(0,G.jsxs)(w_,{value:a,onValueChange:o,children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{placeholder:`Choose a symbiont`})}),(0,G.jsx)(D_,{children:n.map(e=>(0,G.jsx)(O_,{value:e.name,children:e.displayName},e.name))})]}),(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:`This list comes from the symbionts enabled for this project.`})]}),(0,G.jsx)(Y,{onClick:()=>void _(),disabled:!v||d,children:d?`Starting...`:`Build Prompt`})]})]}),s?(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(p.data?.status??`running`),children:p.data?.status??`running`}),dP(s.inlineInstructions)?(0,G.jsx)(X,{variant:`secondary`,children:dP(s.inlineInstructions)}):null,s.targetSymbiont?(0,G.jsx)(X,{variant:`secondary`,children:s.targetSymbiont.displayName}):null]}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:p.data?.status&&eP.has(p.data.status)?`Run ${s.runId??`pending`} finished.`:`Run ${s.runId??`pending`} is in progress. Cortex checks for the prompt automatically.`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s.runId?(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>u(s.runId),children:`View Details`}):null,(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>{p.refetch(),e.refetch()},disabled:p.isFetching||e.isFetching,children:p.isFetching||e.isFetching?`Refreshing...`:`Refresh`})]})]})]}):null,(0,G.jsxs)(Q,{level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{children:[(0,G.jsx)(Qj,{children:`Recent Builds`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Each run captures the original build request, the generated prompt, and a direct link to the underlying agent run.`})]}),(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void e.refetch(),disabled:e.isFetching,children:e.isFetching?`Refreshing...`:`Refresh`})]}),e.isLoading?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading recent builds...`}):h.length===0?(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5`,children:(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`No builder runs yet. Start one above and Cortex will keep the prompt artifact here.`})}):(0,G.jsx)(`div`,{className:`space-y-3`,children:h.map(({run:e,parsed:t})=>(0,G.jsx)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-4 space-y-3`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(e.status),children:e.status}),dP(t.inlineInstructions)?(0,G.jsx)(X,{variant:`secondary`,children:dP(t.inlineInstructions)}):null,t.targetSymbiontDisplayName?(0,G.jsx)(X,{variant:`secondary`,children:t.targetSymbiontDisplayName}):null]}),(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:KA(t.goal||`Untitled build request`,nP)}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 font-sans text-xs text-on-surface-variant`,children:[(0,G.jsxs)(`span`,{children:[`Started `,QA(e.started_at)]}),(0,G.jsxs)(`span`,{children:[`Run `,qA(e.id)]}),e.completed_at?(0,G.jsxs)(`span`,{children:[`Duration `,XA(e.started_at,e.completed_at)]}):null]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>u(e.id),children:`View Details`}),(0,G.jsx)(`a`,{href:`/agent?run=${e.id}`,className:`inline-flex h-8 items-center justify-center rounded-md border border-[var(--ghost-border)] px-3 font-sans text-xs font-medium text-on-surface transition-all hover:bg-surface-container-high`,children:`Open Run`})]})]})},e.id))})]}),(0,G.jsx)($f,{open:l!==null,onOpenChange:e=>{e||u(null)},children:(0,G.jsxs)(rp,{className:`max-w-4xl max-h-[90vh] overflow-y-auto`,children:[(0,G.jsxs)(ip,{children:[(0,G.jsx)(op,{children:`Prompt Build Details`}),(0,G.jsx)(sp,{children:`Review the generated prompt, task reports, and jump to the full agent run when you need deeper diagnostics.`})]}),l?(0,G.jsx)(vP,{runId:l,runInstruction:g?.run.instruction??null,result:m.data,isLoading:m.isLoading,isFetching:m.isFetching,onRefresh:()=>void m.refetch()}):null]})})]})}function vP({runId:e,runInstruction:t,result:n,isLoading:r,isFetching:i,onRefresh:a}){let o=(0,W.useMemo)(()=>lP(t),[t]),[s,c]=(0,W.useState)(!1),l=(0,W.useCallback)(async()=>{n?.prompt&&navigator.clipboard?.writeText&&(await navigator.clipboard.writeText(n.prompt),c(!0),window.setTimeout(()=>c(!1),1500))},[n?.prompt]);return r&&!n?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading build details...`}):(0,G.jsxs)(`div`,{className:`space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(X,{variant:uP(n?.status),children:n?.status??`loading`}),(0,G.jsxs)(X,{variant:`secondary`,children:[`Run `,qA(e)]}),o.targetSymbiontDisplayName?(0,G.jsx)(X,{variant:`secondary`,children:o.targetSymbiontDisplayName}):null]}),o.goal?(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:o.goal}):null,dP(o.inlineInstructions)?(0,G.jsx)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:o.inlineInstructions?`This build embeds the current Cortex instructions directly into the generated prompt.`:`This build expects the target symbiont to receive Cortex instructions at session start.`}):null]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?.prompt?(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void l(),children:s?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(mo,{className:`mr-1.5 h-3.5 w-3.5`}),`Copied`]}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ko,{className:`mr-1.5 h-3.5 w-3.5`}),`Copy Prompt`]})}):null,(0,G.jsx)(`a`,{href:`/agent?run=${e}`,className:`inline-flex h-8 items-center justify-center rounded-md border border-[var(--ghost-border)] px-3 font-sans text-xs font-medium text-on-surface transition-all hover:bg-surface-container-high`,children:`Open Full Run`}),(0,G.jsx)(Y,{variant:`outline`,size:`sm`,onClick:a,disabled:i,children:i?`Refreshing...`:`Refresh`})]})]}),(0,G.jsxs)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5 space-y-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Generated Prompt`}),n?.prompt?(0,G.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-sm text-on-surface`,children:n.prompt}):(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:n?.status===`failed`?n.error||`The prompt builder run failed before producing a prompt.`:`Waiting for the Myco agent to produce the prompt...`})]}),n?.reports?.length?(0,G.jsxs)(Q,{level:`default`,className:`rounded-lg border border-outline-variant/20 p-5 space-y-3`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Task Reports`}),(0,G.jsx)(`div`,{className:`space-y-2`,children:n.reports.map(e=>(0,G.jsxs)(`div`,{className:`rounded-md border border-outline-variant/20 px-3 py-2`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:e.action}),(0,G.jsx)(`span`,{className:`font-sans text-xs text-on-surface-variant`,children:GA(e.created_at)})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:e.summary})]},e.id))})]}):null]})}function yP(){return(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsxs)(Q,{id:Ya.cortexDigest,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(jo,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Digest`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`Choose which digest tier Cortex should use when digest injection is enabled, and review the maintained extracts below for on-demand retrieval.`})]})]}),(0,G.jsx)(_N,{path:Ka.digest.tier,label:`Preferred digest tier`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsxs)(w_,{value:String(e??5e3),onValueChange:e=>t(Number(e)),children:[(0,G.jsx)(E_,{children:(0,G.jsx)(T_,{})}),(0,G.jsx)(D_,{children:rP.map(e=>(0,G.jsx)(O_,{value:e.value,children:e.label},e.value))})]})})]}),(0,G.jsx)(CN,{})]})}function bP({patterns:e,onChange:t}){let[n,r]=(0,W.useState)(``),i=(0,W.useCallback)(()=>{let i=n.trim();if(!(!i||i.startsWith(`#`))){if(e.includes(i)){r(``);return}t([...e,i]),r(``)}},[n,e,t]),a=(0,W.useCallback)(n=>{t(e.filter((e,t)=>t!==n))},[e,t]);return(0,G.jsxs)(`div`,{className:`space-y-2`,children:[(0,G.jsx)(`div`,{className:`rounded-md border border-outline-variant/30 bg-surface-container-low px-3 py-2 min-h-[44px]`,children:e.length===0?(0,G.jsx)(`p`,{className:`font-sans text-xs italic text-on-surface-variant`,children:`No custom patterns yet — the Myco baseline above already covers common noise.`}):(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map((e,t)=>(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded bg-surface-container px-2 py-0.5 font-mono text-xs text-on-surface`,children:[e,(0,G.jsx)(`button`,{type:`button`,onClick:()=>a(t),"aria-label":`Remove pattern ${e}`,className:`rounded text-on-surface-variant hover:text-on-surface focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-primary/40`,children:`×`})]},`${e}-${t}`))})}),(0,G.jsxs)(`div`,{className:`flex gap-2`,children:[(0,G.jsx)(cp,{value:n,onChange:e=>r(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},placeholder:`e.g. fixtures/large/** or **/*.snap`,className:`font-mono text-xs`}),(0,G.jsx)(Y,{type:`button`,variant:`outline`,size:`sm`,onClick:i,disabled:n.trim().length===0,children:`Add`})]}),(0,G.jsxs)(`p`,{className:`font-sans text-xs text-on-surface-variant`,children:[`Press Enter or click Add. Glob syntax: `,(0,G.jsx)(`code`,{className:`font-mono`,children:`**`}),` `,`any depth, `,(0,G.jsx)(`code`,{className:`font-mono`,children:`*`}),` any chars in one segment.`]})]})}function xP(){let{effective:e,isLoading:t}=Na(),{data:n}=Jk(),r=n?.tasks.find(e=>e.name===`canopy-describe`),i=(e?.agent?.tasks?.[`canopy-describe`])?.schedule?.enabled??r?.schedule?.enabled??!1;return t||!e?(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`Loading...`}):(0,G.jsxs)(`div`,{className:`space-y-6`,children:[(0,G.jsx)(Q,{level:`low`,className:`rounded-lg border border-primary/15 p-5`,children:(0,G.jsxs)(`div`,{className:`flex flex-wrap items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`rounded-md bg-primary/10 p-2 text-primary`,children:(0,G.jsx)(As,{className:`h-4 w-4`})}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`p`,{className:`font-sans text-sm font-medium text-on-surface`,children:`Canopy is your project's live code index.`}),(0,G.jsx)(`p`,{className:`max-w-3xl font-sans text-sm text-on-surface-variant`,children:`It tracks what every file does so connected agents can answer codebase questions and skip redundant Reads. The Myco agent describes files in the background — opt-in, configurable below.`})]})]})}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-collection`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(Qj,{children:`Collection`}),(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[`The scanner automatically skips anything matched by this project's`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.gitignore`}),` `,`files (root and nested), the Myco baseline below, and directories that Myco and your installed symbionts manage (`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.myco/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.agents/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.claude/`}),`,`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`.cursor/`}),`, etc.). Add your own patterns at the bottom to exclude additional paths.`]})]}),(0,G.jsx)(_N,{path:Ka.canopy.exclude.defaultPatterns,label:`Myco baseline (read-only)`,defaultScope:`project`,children:({value:e})=>(0,G.jsxs)(`div`,{className:`rounded-md border border-outline-variant/20 bg-surface-container-low/50 px-3 py-2`,children:[(0,G.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:(e??[]).map(e=>(0,G.jsx)(`code`,{className:`inline-block rounded bg-surface-container px-2 py-0.5 font-mono text-xs text-on-surface-variant`,children:e},e))}),(0,G.jsx)(`p`,{className:`pt-2 font-sans text-xs text-on-surface-variant`,children:`Maintained by Myco. Filesystem and toolchain noise that shouldn't be indexed regardless of project setup.`})]})}),(0,G.jsx)(_N,{path:Ka.canopy.exclude.patterns,label:`Your patterns`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(bP,{patterns:e??[],onChange:t})}),(0,G.jsxs)(`div`,{className:`space-y-1 pt-2`,children:[(0,G.jsx)(`p`,{className:`font-sans text-xs uppercase tracking-wide text-on-surface-variant`,children:`Background refresh`}),(0,G.jsxs)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:[`Session start and the Write/Edit tool already keep the index fresh during sessions. The background sweep is the safety net for changes made outside sessions (`,` `,(0,G.jsx)(`code`,{className:`font-mono text-xs`,children:`git pull`}),`, edits via non-Myco tools).`]})]}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.canopy.refresh.backgroundEnabled,label:`Periodic background scan`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.canopy.refresh.backgroundPeriodMinutes,label:`Period (minutes)`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:1,value:String(e??60),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-injection`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-5`,children:[(0,G.jsx)(Qj,{children:`Injection`}),(0,G.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,G.jsx)(_N,{path:Ka.canopy.injectOnPreToolUse,label:`Inject canopy on Read`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(lN,{checked:e??!0,onCheckedChange:t})}),(0,G.jsx)(_N,{path:Ka.canopy.minFileBytes,label:`Minimum file size (bytes)`,defaultScope:`project`,children:({value:e,onChange:t})=>(0,G.jsx)(cp,{type:`number`,min:0,value:String(e??800),onChange:e=>t(Number(e.target.value))})})]})]}),(0,G.jsxs)(Q,{id:`config-section-cortex-canopy-llm`,level:`low`,className:`rounded-lg border border-outline-variant/20 p-6 space-y-4`,children:[(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,G.jsx)(Qj,{children:`Intelligence`}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-0.5 font-sans text-xs font-medium `+(i?`border-primary/30 bg-primary/10 text-primary`:`border-outline-variant/40 bg-surface-container text-on-surface-variant`),children:[(0,G.jsx)(`span`,{className:`h-1.5 w-1.5 rounded-full `+(i?`bg-primary`:`bg-on-surface-variant/60`),"aria-hidden":!0}),i?`Descriptions on`:`Descriptions off`]})]}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:`One-sentence summaries the Myco agent writes for each file. They power semantic search across your codebase, ride along with Canopy injection on Read, and feed the Canopy Map — the highest-leverage piece of Canopy once it’s on.`}),(0,G.jsx)(`p`,{className:`font-sans text-sm text-on-surface-variant`,children:i?(0,G.jsxs)(G.Fragment,{children:[`The`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`is enabled and filling in descriptions on schedule. Visit the task page to change the model, schedule, or token budget.`]}):(0,G.jsxs)(G.Fragment,{children:[`The`,` `,(0,G.jsx)(ri,{to:`/agent?tab=tasks&task=canopy-describe`,className:`text-primary underline underline-offset-2 hover:text-primary/80`,children:`canopy-describe task`}),` `,`ships `,(0,G.jsx)(`strong`,{children:`opt-in`}),` — its schedule is off by default so new projects don’t spend tokens unprompted. Enable it on the task page (where you can also pick a model and schedule) to start filling in descriptions; the Canopy Map needs at least one described file before it can build.`]})})]})]})}function SP(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 CP(e){if(Array.isArray(e))return e}function wP(e){if(Array.isArray(e))return SP(e)}function TP(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function EP(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,LP(r.key),r)}}function DP(e,t,n){return t&&EP(e.prototype,t),Object.defineProperty(e,`prototype`,{writable:!1}),e}function OP(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=zP(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
85
85
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function kP(e,t,n){return(t=LP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function AP(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function jP(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 MP(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
86
86
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NP(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
87
87
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PP(e,t){return CP(e)||jP(e,t)||zP(e,t)||MP()}function FP(e){return wP(e)||AP(e)||zP(e)||NP()}function IP(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}function LP(e){var t=IP(e,`string`);return typeof t==`symbol`?t:t+``}function RP(e){"@babel/helpers - typeof";return RP=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},RP(e)}function zP(e,t){if(e){if(typeof e==`string`)return SP(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)?SP(e,t):void 0}}var BP=typeof window>`u`?null:window,VP=BP?BP.navigator:null;BP&&BP.document;var HP=RP(``),UP=RP({}),WP=RP(function(){}),GP=typeof HTMLElement>`u`?`undefined`:RP(HTMLElement),KP=function(e){return e&&e.instanceString&&JP(e.instanceString)?e.instanceString():null},qP=function(e){return e!=null&&RP(e)==HP},JP=function(e){return e!=null&&RP(e)===WP},YP=function(e){return!eF(e)&&(Array.isArray?Array.isArray(e):e!=null&&e instanceof Array)},XP=function(e){return e!=null&&RP(e)===UP&&!YP(e)&&e.constructor===Object},ZP=function(e){return e!=null&&RP(e)===UP},$=function(e){return e!=null&&RP(e)===RP(1)&&!isNaN(e)},QP=function(e){return $(e)&&Math.floor(e)===e},$P=function(e){if(GP!==`undefined`)return e!=null&&e instanceof HTMLElement},eF=function(e){return tF(e)||nF(e)},tF=function(e){return KP(e)===`collection`&&e._private.single},nF=function(e){return KP(e)===`collection`&&!e._private.single},rF=function(e){return KP(e)===`core`},iF=function(e){return KP(e)===`stylesheet`},aF=function(e){return KP(e)===`event`},oF=function(e){return e==null?!0:!!(e===``||e.match(/^\s+$/))},sF=function(e){return typeof HTMLElement>`u`?!1:e instanceof HTMLElement},cF=function(e){return XP(e)&&$(e.x1)&&$(e.x2)&&$(e.y1)&&$(e.y2)},lF=function(e){return ZP(e)&&JP(e.then)},uF=function(){return VP&&VP.userAgent.match(/msie|trident|edge/i)},dF=function(e,t){t||=function(){if(arguments.length===1)return arguments[0];if(arguments.length===0)return`undefined`;for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);return e.join(`$`)};var n=function(){var r=this,i=arguments,a,o=t.apply(r,i),s=n.cache;return(a=s[o])||(a=s[o]=e.apply(r,i)),a};return n.cache={},n},fF=dF(function(e){return e.replace(/([A-Z])/g,function(e){return`-`+e.toLowerCase()})}),pF=dF(function(e){return e.replace(/(-\w)/g,function(e){return e[1].toUpperCase()})}),mF=dF(function(e,t){return e+t[0].toUpperCase()+t.substring(1)},function(e,t){return e+`$`+t}),hF=function(e){return oF(e)?e:e.charAt(0).toUpperCase()+e.substring(1)},gF=function(e,t){return e.slice(-1*t.length)===t},_F=`(?:[-+]?(?:(?:\\d+|\\d*\\.\\d+)(?:[Ee][+-]?\\d+)?))`,vF=`rgb[a]?\\((`+_F+`[%]?)\\s*,\\s*(`+_F+`[%]?)\\s*,\\s*(`+_F+`[%]?)(?:\\s*,\\s*(`+_F+`))?\\)`,yF=`rgb[a]?\\((?:`+_F+`[%]?)\\s*,\\s*(?:`+_F+`[%]?)\\s*,\\s*(?:`+_F+`[%]?)(?:\\s*,\\s*(?:`+_F+`))?\\)`,bF=`hsl[a]?\\((`+_F+`)\\s*,\\s*(`+_F+`[%])\\s*,\\s*(`+_F+`[%])(?:\\s*,\\s*(`+_F+`))?\\)`,xF=`hsl[a]?\\((?:`+_F+`)\\s*,\\s*(?:`+_F+`[%])\\s*,\\s*(?:`+_F+`[%])(?:\\s*,\\s*(?:`+_F+`))?\\)`,SF=`\\#[0-9a-fA-F]{3}`,CF=`\\#[0-9a-fA-F]{6}`,wF=function(e,t){return e<t?-1:+(e>t)},TF=function(e,t){return-1*wF(e,t)},EF=Object.assign==null?function(e){for(var t=arguments,n=1;n<t.length;n++){var r=t[n];if(r!=null)for(var i=Object.keys(r),a=0;a<i.length;a++){var o=i[a];e[o]=r[o]}}return e}:Object.assign.bind(Object),DF=function(e){if(!(!(e.length===4||e.length===7)||e[0]!==`#`)){var t=e.length===4,n,r,i,a=16;return t?(n=parseInt(e[1]+e[1],a),r=parseInt(e[2]+e[2],a),i=parseInt(e[3]+e[3],a)):(n=parseInt(e[1]+e[2],a),r=parseInt(e[3]+e[4],a),i=parseInt(e[5]+e[6],a)),[n,r,i]}},OF=function(e){var t,n,r,i,a,o,s,c;function l(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}var u=RegExp(`^`+bF+`$`).exec(e);if(u){if(n=parseInt(u[1]),n<0?n=(360- -1*n%360)%360:n>360&&(n%=360),n/=360,r=parseFloat(u[2]),r<0||r>100||(r/=100,i=parseFloat(u[3]),i<0||i>100)||(i/=100,a=u[4],a!==void 0&&(a=parseFloat(a),a<0||a>1)))return;if(r===0)o=s=c=Math.round(i*255);else{var d=i<.5?i*(1+r):i+r-i*r,f=2*i-d;o=Math.round(255*l(f,d,n+1/3)),s=Math.round(255*l(f,d,n)),c=Math.round(255*l(f,d,n-1/3))}t=[o,s,c,a]}return t},kF=function(e){var t,n=RegExp(`^`+vF+`$`).exec(e);if(n){t=[];for(var r=[],i=1;i<=3;i++){var a=n[i];if(a[a.length-1]===`%`&&(r[i]=!0),a=parseFloat(a),r[i]&&(a=a/100*255),a<0||a>255)return;t.push(Math.floor(a))}var o=r[1]||r[2]||r[3],s=r[1]&&r[2]&&r[3];if(o&&!s)return;var c=n[4];if(c!==void 0){if(c=parseFloat(c),c<0||c>1)return;t.push(c)}}return t},AF=function(e){return MF[e.toLowerCase()]},jF=function(e){return(YP(e)?e:null)||AF(e)||DF(e)||kF(e)||OF(e)},MF={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},NF=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(XP(a))throw Error(`Tried to set map with object key`);i<n.length-1?(t[a]??(t[a]={}),t=t[a]):t[a]=e.value}},PF=function(e){for(var t=e.map,n=e.keys,r=n.length,i=0;i<r;i++){var a=n[i];if(XP(a))throw Error(`Tried to get map with object key`);if(t=t[a],t==null)return t}return t},FF=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function IF(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,`default`)?e.default:e}var LF,RF;function zF(){if(RF)return LF;RF=1;function e(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}return LF=e,LF}var BF,VF;function HF(){return VF?BF:(VF=1,BF=typeof FF==`object`&&FF&&FF.Object===Object&&FF,BF)}var UF,WF;function GF(){if(WF)return UF;WF=1;var e=HF(),t=typeof self==`object`&&self&&self.Object===Object&&self;return UF=e||t||Function(`return this`)(),UF}var KF,qF;function JF(){if(qF)return KF;qF=1;var e=GF();return KF=function(){return e.Date.now()},KF}var YF,XF;function ZF(){if(XF)return YF;XF=1;var e=/\s/;function t(t){for(var n=t.length;n--&&e.test(t.charAt(n)););return n}return YF=t,YF}var QF,$F;function eI(){if($F)return QF;$F=1;var e=ZF(),t=/^\s+/;function n(n){return n&&n.slice(0,e(n)+1).replace(t,``)}return QF=n,QF}var tI,nI;function rI(){return nI?tI:(nI=1,tI=GF().Symbol,tI)}var iI,aI;function oI(){if(aI)return iI;aI=1;var e=rI(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,i=e?e.toStringTag:void 0;function a(e){var t=n.call(e,i),a=e[i];try{e[i]=void 0;var o=!0}catch{}var s=r.call(e);return o&&(t?e[i]=a:delete e[i]),s}return iI=a,iI}var sI,cI;function lI(){if(cI)return sI;cI=1;var e=Object.prototype.toString;function t(t){return e.call(t)}return sI=t,sI}var uI,dI;function fI(){if(dI)return uI;dI=1;var e=rI(),t=oI(),n=lI(),r=`[object Null]`,i=`[object Undefined]`,a=e?e.toStringTag:void 0;function o(e){return e==null?e===void 0?i:r:a&&a in Object(e)?t(e):n(e)}return uI=o,uI}var pI,mI;function hI(){if(mI)return pI;mI=1;function e(e){return typeof e==`object`&&!!e}return pI=e,pI}var gI,_I;function vI(){if(_I)return gI;_I=1;var e=fI(),t=hI(),n=`[object Symbol]`;function r(r){return typeof r==`symbol`||t(r)&&e(r)==n}return gI=r,gI}var yI,bI;function xI(){if(bI)return yI;bI=1;var e=eI(),t=zF(),n=vI(),r=NaN,i=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,o=/^0o[0-7]+$/i,s=parseInt;function c(c){if(typeof c==`number`)return c;if(n(c))return r;if(t(c)){var l=typeof c.valueOf==`function`?c.valueOf():c;c=t(l)?l+``:l}if(typeof c!=`string`)return c===0?c:+c;c=e(c);var u=a.test(c);return u||o.test(c)?s(c.slice(2),u?2:8):i.test(c)?r:+c}return yI=c,yI}var SI,CI;function wI(){if(CI)return SI;CI=1;var e=zF(),t=JF(),n=xI(),r=`Expected a function`,i=Math.max,a=Math.min;function o(o,s,c){var l,u,d,f,p,m,h=0,g=!1,_=!1,v=!0;if(typeof o!=`function`)throw TypeError(r);s=n(s)||0,e(c)&&(g=!!c.leading,_=`maxWait`in c,d=_?i(n(c.maxWait)||0,s):d,v=`trailing`in c?!!c.trailing:v);function y(e){var t=l,n=u;return l=u=void 0,h=e,f=o.apply(n,t),f}function b(e){return h=e,p=setTimeout(C,s),g?y(e):f}function x(e){var t=e-m,n=e-h,r=s-t;return _?a(r,d-n):r}function S(e){var t=e-m,n=e-h;return m===void 0||t>=s||t<0||_&&n>=d}function C(){var e=t();if(S(e))return w(e);p=setTimeout(C,x(e))}function w(e){return p=void 0,v&&l?y(e):(l=u=void 0,f)}function T(){p!==void 0&&clearTimeout(p),h=0,l=m=u=p=void 0}function E(){return p===void 0?f:w(t())}function D(){var e=t(),n=S(e);if(l=arguments,u=this,m=e,n){if(p===void 0)return b(m);if(_)return clearTimeout(p),p=setTimeout(C,s),y(m)}return p===void 0&&(p=setTimeout(C,s)),f}return D.cancel=T,D.flush=E,D}return SI=o,SI}var TI=IF(wI()),EI=BP?BP.performance:null,DI=EI&&EI.now?function(){return EI.now()}:function(){return Date.now()},OI=function(){if(BP){if(BP.requestAnimationFrame)return function(e){BP.requestAnimationFrame(e)};if(BP.mozRequestAnimationFrame)return function(e){BP.mozRequestAnimationFrame(e)};if(BP.webkitRequestAnimationFrame)return function(e){BP.webkitRequestAnimationFrame(e)};if(BP.msRequestAnimationFrame)return function(e){BP.msRequestAnimationFrame(e)}}return function(e){e&&setTimeout(function(){e(DI())},1e3/60)}}(),kI=function(e){return OI(e)},AI=DI,jI=9261,MI=65599,NI=5381,PI=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:jI,n;n=e.next(),!n.done;)t=t*MI+n.value|0;return t},FI=function(e){return(arguments.length>1&&arguments[1]!==void 0?arguments[1]:jI)*MI+e|0},II=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:NI;return(t<<5)+t+e|0},LI=function(e,t){return e*2097152+t},RI=function(e){return e[0]*2097152+e[1]},zI=function(e,t){return[FI(e[0],t[0]),II(e[1],t[1])]},BI=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return PI({next:function(){return r<i?n.value=e[r++]:n.done=!0,n}},t)},VI=function(e,t){var n={value:0,done:!1},r=0,i=e.length;return PI({next:function(){return r<i?n.value=e.charCodeAt(r++):n.done=!0,n}},t)},HI=function(){return UI(arguments)},UI=function(e){for(var t,n=0;n<e.length;n++){var r=e[n];t=n===0?VI(r):VI(r,t)}return t};function WI(e,t,n,r,i){var a=i*Math.PI/180;return{x:Math.cos(a)*(e-n)-Math.sin(a)*(t-r)+n,y:Math.sin(a)*(e-n)+Math.cos(a)*(t-r)+r}}var GI=function(e,t,n,r,i,a){return{x:(e-n)*i+n,y:(t-r)*a+r}};function KI(e,t,n){if(n===0)return e;var r=(t.x1+t.x2)/2,i=(t.y1+t.y2)/2,a=t.w/t.h,o=1/a,s=WI(e.x,e.y,r,i,n),c=GI(s.x,s.y,r,i,a,o);return{x:c.x,y:c.y}}var qI=!0,JI=console.warn!=null,YI=console.trace!=null,XI=2**53-1||9007199254740991,ZI=function(){return!0},QI=function(){return!1},$I=function(){return 0},eL=function(){},tL=function(e){throw Error(e)},nL=function(e){if(e!==void 0)qI=!!e;else return qI},rL=function(e){nL()&&(JI?console.warn(e):(console.log(e),YI&&console.trace()))},iL=function(e){return EF({},e)},aL=function(e){return e==null?e:YP(e)?e.slice():XP(e)?iL(e):e},oL=function(e){return e.slice()},sL=function(e,t){for(t=e=``;e++<36;t+=e*51&52?(e^15?8^Math.random()*(e^20?16:4):4).toString(16):`-`);return t},cL={},lL=function(){return cL},uL=function(e){var t=Object.keys(e);return function(n){for(var r={},i=0;i<t.length;i++){var a=t[i],o=n?.[a];r[a]=o===void 0?e[a]:o}return r}},dL=function(e,t,n){for(var r=e.length-1;r>=0;r--)e[r]===t&&e.splice(r,1)},fL=function(e){e.splice(0,e.length)},pL=function(e,t){for(var n=0;n<t.length;n++){var r=t[n];e.push(r)}},mL=function(e,t,n){return n&&(t=mF(n,t)),e[t]},hL=function(e,t,n,r){n&&(t=mF(n,t)),e[t]=r},gL=typeof Map<`u`?Map:function(){function e(){TP(this,e),this._obj={}}return DP(e,[{key:`set`,value:function(e,t){return this._obj[e]=t,this}},{key:`delete`,value:function(e){return this._obj[e]=void 0,this}},{key:`clear`,value:function(){this._obj={}}},{key:`has`,value:function(e){return this._obj[e]!==void 0}},{key:`get`,value:function(e){return this._obj[e]}}])}(),_L=`undefined`,vL=function(){function e(t){if(TP(this,e),this._obj=Object.create(null),this.size=0,t!=null)for(var n=t.instanceString!=null&&t.instanceString()===this.instanceString()?t.toArray():t,r=0;r<n.length;r++)this.add(n[r])}return DP(e,[{key:`instanceString`,value:function(){return`set`}},{key:`add`,value:function(e){var t=this._obj;t[e]!==1&&(t[e]=1,this.size++)}},{key:`delete`,value:function(e){var t=this._obj;t[e]===1&&(t[e]=0,this.size--)}},{key:`clear`,value:function(){this._obj=Object.create(null)}},{key:`has`,value:function(e){return this._obj[e]===1}},{key:`toArray`,value:function(){var e=this;return Object.keys(this._obj).filter(function(t){return e.has(t)})}},{key:`forEach`,value:function(e,t){return this.toArray().forEach(e,t)}}])}(),yL=(typeof Set>`u`?`undefined`:RP(Set))===_L?vL:Set,bL=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(e===void 0||t===void 0||!rF(e)){tL(`An element must have a core reference and parameters set`);return}var r=t.group;if(r??=t.data&&t.data.source!=null&&t.data.target!=null?`edges`:`nodes`,r!==`nodes`&&r!==`edges`){tL("An element must be of type `nodes` or `edges`; you specified `"+r+"`");return}this.length=1,this[0]=this;var i=this._private={cy:e,single:!0,data:t.data||{},position:t.position||{x:0,y:0},autoWidth:void 0,autoHeight:void 0,autoPadding:void 0,compoundBoundsClean:!1,listeners:[],group:r,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:!0,selected:!!t.selected,selectable:t.selectable===void 0?!0:!!t.selectable,locked:!!t.locked,grabbed:!1,grabbable:t.grabbable===void 0?!0:!!t.grabbable,pannable:t.pannable===void 0?r===`edges`:!!t.pannable,active:!1,classes:new yL,animation:{current:[],queue:[]},rscratch:{},scratch:t.scratch||{},edges:[],children:[],parent:t.parent&&t.parent.isNode()?t.parent:null,traversalCache:{},backgrounding:!1,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x??(i.position.x=0),i.position.y??(i.position.y=0),t.renderedPosition){var a=t.renderedPosition,o=e.pan(),s=e.zoom();i.position={x:(a.x-o.x)/s,y:(a.y-o.y)/s}}var c=[];YP(t.classes)?c=t.classes:qP(t.classes)&&(c=t.classes.split(/\s+/));for(var l=0,u=c.length;l<u;l++){var d=c[l];!d||d===``||i.classes.add(d)}this.createEmitter(),(n===void 0||n)&&this.restore();var f=t.style||t.css;f&&(rL("Setting a `style` bypass at element creation should be done only when absolutely necessary. Try to use the stylesheet instead."),this.style(f))},xL=function(e){return e={bfs:e.bfs||!e.dfs,dfs:e.dfs||!e.bfs},function(t,n,r){var i;XP(t)&&!eF(t)&&(i=t,t=i.roots||i.root,n=i.visit,r=i.directed),r=arguments.length===2&&!JP(n)?n:r,n=JP(n)?n:function(){};for(var a=this._private.cy,o=t=qP(t)?this.filter(t):t,s=[],c=[],l={},u={},d={},f=0,p,m=this.byGroup(),h=m.nodes,g=m.edges,_=0;_<o.length;_++){var v=o[_],y=v.id();v.isNode()&&(s.unshift(v),e.bfs&&(d[y]=!0,c.push(v)),u[y]=0)}for(var b=function(){var t=e.bfs?s.shift():s.pop(),i=t.id();if(e.dfs){if(d[i])return 0;d[i]=!0,c.push(t)}var a=u[i],o=l[i],m=o==null?null:o.source(),_=o==null?null:o.target(),v=o==null?void 0:t.same(m)?_[0]:m[0],y=n(t,o,v,f++,a);if(y===!0)return p=t,1;if(y===!1)return 1;for(var b=t.connectedEdges().filter(function(e){return(!r||e.source().same(t))&&g.has(e)}),x=0;x<b.length;x++){var S=b[x],C=S.connectedNodes().filter(function(e){return!e.same(t)&&h.has(e)}),w=C.id();C.length!==0&&!d[w]&&(C=C[0],s.push(C),e.bfs&&(d[w]=!0,c.push(C)),l[w]=S,u[w]=u[i]+1)}},x;s.length!==0&&(x=b(),!(x!==0&&x===1)););for(var S=a.collection(),C=0;C<c.length;C++){var w=c[C],T=l[w.id()];T!=null&&S.push(T),S.push(w)}return{path:a.collection(S),found:a.collection(p)}}},SL={breadthFirstSearch:xL({bfs:!0}),depthFirstSearch:xL({dfs:!0})};SL.bfs=SL.breadthFirstSearch,SL.dfs=SL.depthFirstSearch;var CL={exports:{}},wL=CL.exports,TL;function EL(){return TL?CL.exports:(TL=1,(function(e,t){(function(){var t,n,r=Math.floor,i,a,o,s,c,l,u=Math.min,d,f,p,m,h;n=function(e,t){return e<t?-1:+(e>t)},l=function(e,t,i,a,o){var s;if(i??=0,o??=n,i<0)throw Error(`lo must be non-negative`);for(a??=e.length;i<a;)s=r((i+a)/2),o(t,e[s])<0?a=s:i=s+1;return[].splice.apply(e,[i,i-i].concat(t)),t},o=function(e,t,r){return r??=n,e.push(t),m(e,0,e.length-1,r)},a=function(e,t){var r,i;return t??=n,r=e.pop(),e.length?(i=e[0],e[0]=r,h(e,0,t)):i=r,i},c=function(e,t,r){var i;return r??=n,i=e[0],e[0]=t,h(e,0,r),i},s=function(e,t,r){var i;return r??=n,e.length&&r(e[0],t)<0&&(i=[e[0],t],t=i[0],e[0]=i[1],h(e,0,r)),t},i=function(e,t){var i,a,o,s,c,l;for(t??=n,s=(function(){l=[];for(var t=0,n=r(e.length/2);0<=n?t<n:t>n;0<=n?t++:t--)l.push(t);return l}).apply(this).reverse(),c=[],a=0,o=s.length;a<o;a++)i=s[a],c.push(h(e,i,t));return c},p=function(e,t,r){var i;if(r??=n,i=e.indexOf(t),i!==-1)return m(e,0,i,r),h(e,i,r)},d=function(e,t,r){var a,o,c,l,u;if(r??=n,o=e.slice(0,t),!o.length)return o;for(i(o,r),u=e.slice(t),c=0,l=u.length;c<l;c++)a=u[c],s(o,a,r);return o.sort(r).reverse()},f=function(e,t,r){var o,s,c,d,f,p,m,h,g;if(r??=n,t*10<=e.length){if(c=e.slice(0,t).sort(r),!c.length)return c;for(s=c[c.length-1],m=e.slice(t),d=0,p=m.length;d<p;d++)o=m[d],r(o,s)<0&&(l(c,o,0,null,r),c.pop(),s=c[c.length-1]);return c}for(i(e,r),g=[],f=0,h=u(t,e.length);0<=h?f<h:f>h;0<=h?++f:--f)g.push(a(e,r));return g},m=function(e,t,r,i){var a,o,s;for(i??=n,a=e[r];r>t;){if(s=r-1>>1,o=e[s],i(a,o)<0){e[r]=o,r=s;continue}break}return e[r]=a},h=function(e,t,r){var i,a,o,s,c;for(r??=n,a=e.length,c=t,o=e[t],i=2*t+1;i<a;)s=i+1,s<a&&!(r(e[i],e[s])<0)&&(i=s),e[t]=e[i],t=i,i=2*t+1;return e[t]=o,m(e,c,t,r)},t=(function(){e.push=o,e.pop=a,e.replace=c,e.pushpop=s,e.heapify=i,e.updateItem=p,e.nlargest=d,e.nsmallest=f;function e(e){this.cmp=e??n,this.nodes=[]}return e.prototype.push=function(e){return o(this.nodes,e,this.cmp)},e.prototype.pop=function(){return a(this.nodes,this.cmp)},e.prototype.peek=function(){return this.nodes[0]},e.prototype.contains=function(e){return this.nodes.indexOf(e)!==-1},e.prototype.replace=function(e){return c(this.nodes,e,this.cmp)},e.prototype.pushpop=function(e){return s(this.nodes,e,this.cmp)},e.prototype.heapify=function(){return i(this.nodes,this.cmp)},e.prototype.updateItem=function(e){return p(this.nodes,e,this.cmp)},e.prototype.clear=function(){return this.nodes=[]},e.prototype.empty=function(){return this.nodes.length===0},e.prototype.size=function(){return this.nodes.length},e.prototype.clone=function(){var t=new e;return t.nodes=this.nodes.slice(0),t},e.prototype.toArray=function(){return this.nodes.slice(0)},e.prototype.insert=e.prototype.push,e.prototype.top=e.prototype.peek,e.prototype.front=e.prototype.peek,e.prototype.has=e.prototype.contains,e.prototype.copy=e.prototype.clone,e})(),(function(t,n){return e.exports=n()})(this,function(){return t})}).call(wL)})(CL),CL.exports)}var DL,OL;function kL(){return OL?DL:(OL=1,DL=EL(),DL)}var AL=IF(kL()),jL=uL({root:null,weight:function(e){return 1},directed:!1}),ML={dijkstra:function(e){if(!XP(e)){var t=arguments;e={root:t[0],weight:t[1],directed:t[2]}}var n=jL(e),r=n.root,i=n.weight,a=n.directed,o=this,s=i,c=qP(r)?this.filter(r)[0]:r[0],l={},u={},d={},f=this.byGroup(),p=f.nodes,m=f.edges;m.unmergeBy(function(e){return e.isLoop()});for(var h=function(e){return l[e.id()]},g=function(e,t){l[e.id()]=t,_.updateItem(e)},_=new AL(function(e,t){return h(e)-h(t)}),v=0;v<p.length;v++){var y=p[v];l[y.id()]=y.same(c)?0:1/0,_.push(y)}for(var b=function(e,t){for(var n=(a?e.edgesTo(t):e.edgesWith(t)).intersect(m),r=1/0,i,o=0;o<n.length;o++){var c=n[o],l=s(c);(l<r||!i)&&(r=l,i=c)}return{edge:i,dist:r}};_.size()>0;){var x=_.pop(),S=h(x),C=x.id();if(d[C]=S,S!==1/0)for(var w=x.neighborhood().intersect(p),T=0;T<w.length;T++){var E=w[T],D=E.id(),O=b(x,E),k=S+O.dist;k<h(E)&&(g(E,k),u[D]={node:x,edge:O.edge})}}return{distanceTo:function(e){return d[(qP(e)?p.filter(e)[0]:e[0]).id()]},pathTo:function(e){var t=qP(e)?p.filter(e)[0]:e[0],n=[],r=t,i=r.id();if(t.length>0)for(n.unshift(t);u[i];){var a=u[i];n.unshift(a.edge),n.unshift(a.node),r=a.node,i=r.id()}return o.spawn(n)}}}},NL={kruskal:function(e){e||=function(e){return 1};for(var t=this.byGroup(),n=t.nodes,r=t.edges,i=n.length,a=Array(i),o=n,s=function(e){for(var t=0;t<a.length;t++)if(a[t].has(e))return t},c=0;c<i;c++)a[c]=this.spawn(n[c]);for(var l=r.sort(function(t,n){return e(t)-e(n)}),u=0;u<l.length;u++){var d=l[u],f=d.source()[0],p=d.target()[0],m=s(f),h=s(p),g=a[m],_=a[h];m!==h&&(o.merge(d),g.merge(_),a.splice(h,1))}return o}},PL=uL({root:null,goal:null,weight:function(e){return 1},heuristic:function(e){return 0},directed:!1}),FL={aStar:function(e){var t=this.cy(),n=PL(e),r=n.root,i=n.goal,a=n.heuristic,o=n.directed,s=n.weight;r=t.collection(r)[0],i=t.collection(i)[0];var c=r.id(),l=i.id(),u={},d={},f={},p=new AL(function(e,t){return d[e.id()]-d[t.id()]}),m=new yL,h={},g={},_=function(e,t){p.push(e),m.add(t)},v,y,b=function(){v=p.pop(),y=v.id(),m.delete(y)},x=function(e){return m.has(e)};_(r,c),u[c]=0,d[c]=a(r);for(var S=0;p.size()>0;){if(b(),S++,y===l){for(var C=[],w=i,T=l,E=g[T];C.unshift(w),E!=null&&C.unshift(E),w=h[T],w!=null;)T=w.id(),E=g[T];return{found:!0,distance:u[y],path:this.spawn(C),steps:S}}f[y]=!0;for(var D=v._private.edges,O=0;O<D.length;O++){var k=D[O];if(this.hasElementWithId(k.id())&&!(o&&k.data(`source`)!==y)){var A=k.source(),j=k.target(),M=A.id()===y?j:A,N=M.id();if(this.hasElementWithId(N)&&!f[N]){var P=u[y]+s(k);if(!x(N)){u[N]=P,d[N]=P+a(M),_(M,N),h[N]=v,g[N]=k;continue}P<u[N]&&(u[N]=P,d[N]=P+a(M),h[N]=v,g[N]=k)}}}}return{found:!1,distance:void 0,path:void 0,steps:S}}},IL=uL({weight:function(e){return 1},directed:!1}),LL={floydWarshall:function(e){for(var t=this.cy(),n=IL(e),r=n.weight,i=n.directed,a=r,o=this.byGroup(),s=o.nodes,c=o.edges,l=s.length,u=l*l,d=function(e){return s.indexOf(e)},f=function(e){return s[e]},p=Array(u),m=0;m<u;m++){var h=m%l;(m-h)/l===h?p[m]=0:p[m]=1/0}for(var g=Array(u),_=Array(u),v=0;v<c.length;v++){var y=c[v],b=y.source()[0],x=y.target()[0];if(b!==x){var S=d(b),C=d(x),w=S*l+C,T=a(y);if(p[w]>T&&(p[w]=T,g[w]=C,_[w]=y),!i){var E=C*l+S;!i&&p[E]>T&&(p[E]=T,g[E]=S,_[E]=y)}}}for(var D=0;D<l;D++)for(var O=0;O<l;O++)for(var k=O*l+D,A=0;A<l;A++){var j=O*l+A,M=D*l+A;p[k]+p[M]<p[j]&&(p[j]=p[k]+p[M],g[j]=g[k])}var N=function(e){return(qP(e)?t.filter(e):e)[0]},P=function(e){return d(N(e))};return{distance:function(e,t){var n=P(e),r=P(t);return p[n*l+r]},path:function(e,n){var r=P(e),i=P(n),a=f(r);if(r===i)return a.collection();if(g[r*l+i]==null)return t.collection();var o=t.collection(),s=r,c;for(o.merge(a);r!==i;)s=r,r=g[r*l+i],c=_[s*l+r],o.merge(c),o.merge(f(r));return o}}}},RL=uL({weight:function(e){return 1},directed:!1,root:null}),zL={bellmanFord:function(e){var t=this,n=RL(e),r=n.weight,i=n.directed,a=n.root,o=r,s=this,c=this.cy(),l=this.byGroup(),u=l.edges,d=l.nodes,f=d.length,p=new gL,m=!1,h=[];a=c.collection(a)[0],u.unmergeBy(function(e){return e.isLoop()});for(var g=u.length,_=function(e){var t=p.get(e.id());return t||(t={},p.set(e.id(),t)),t},v=function(e){return(qP(e)?c.$(e):e)[0]},y=function(e){return _(v(e)).dist},b=function(e){for(var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:a,r=v(e),i=[],o=r;;){if(o==null)return t.spawn();var c=_(o),l=c.edge,u=c.pred;if(i.unshift(o[0]),o.same(n)&&i.length>0)break;l!=null&&i.unshift(l),o=u}return s.spawn(i)},x=0;x<f;x++){var S=d[x],C=_(S);S.same(a)?C.dist=0:C.dist=1/0,C.pred=null,C.edge=null}for(var w=!1,T=function(e,t,n,r,i,a){var o=r.dist+a;o<i.dist&&!n.same(r.edge)&&(i.dist=o,i.pred=e,i.edge=n,w=!0)},E=1;E<f;E++){w=!1;for(var D=0;D<g;D++){var O=u[D],k=O.source(),A=O.target(),j=o(O),M=_(k),N=_(A);T(k,A,O,M,N,j),i||T(A,k,O,N,M,j)}if(!w)break}if(w)for(var P=[],F=0;F<g;F++){var I=u[F],L=I.source(),R=I.target(),ee=o(I),z=_(L).dist,B=_(R).dist;if(z+ee<B||!i&&B+ee<z)if(m||=(rL(`Graph contains a negative weight cycle for Bellman-Ford`),!0),e.findNegativeWeightCycles!==!1){var V=[];z+ee<B&&V.push(L),!i&&B+ee<z&&V.push(R);for(var H=V.length,te=0;te<H;te++){var ne=V[te],U=[ne];U.push(_(ne).edge);for(var re=_(ne).pred;U.indexOf(re)===-1;)U.push(re),U.push(_(re).edge),re=_(re).pred;U=U.slice(U.indexOf(re));for(var ie=U[0].id(),ae=0,oe=2;oe<U.length;oe+=2)U[oe].id()<ie&&(ie=U[oe].id(),ae=oe);U=U.slice(ae).concat(U.slice(0,ae)),U.push(U[0]);var se=U.map(function(e){return e.id()}).join(`,`);P.indexOf(se)===-1&&(h.push(s.spawn(U)),P.push(se))}}else break}return{distanceTo:y,pathTo:b,hasNegativeWeightCycle:m,negativeWeightCycles:h}}},BL=Math.sqrt(2),VL=function(e,t,n){n.length===0&&tL(`Karger-Stein must be run on a connected (sub)graph`);for(var r=n[e],i=r[1],a=r[2],o=t[i],s=t[a],c=n,l=c.length-1;l>=0;l--){var u=c[l],d=u[1],f=u[2];(t[d]===o&&t[f]===s||t[d]===s&&t[f]===o)&&c.splice(l,1)}for(var p=0;p<c.length;p++){var m=c[p];m[1]===s?(c[p]=m.slice(),c[p][1]=o):m[2]===s&&(c[p]=m.slice(),c[p][2]=o)}for(var h=0;h<t.length;h++)t[h]===s&&(t[h]=o);return c},HL=function(e,t,n,r){for(;n>r;)t=VL(Math.floor(Math.random()*t.length),e,t),n--;return t},UL={kargerStein:function(){var e=this,t=this.byGroup(),n=t.nodes,r=t.edges;r.unmergeBy(function(e){return e.isLoop()});var i=n.length,a=r.length,o=Math.ceil((Math.log(i)/Math.LN2)**2),s=Math.floor(i/BL);if(i<2){tL(`At least 2 nodes are required for Karger-Stein algorithm`);return}for(var c=[],l=0;l<a;l++){var u=r[l];c.push([l,n.indexOf(u.source()),n.indexOf(u.target())])}for(var d=1/0,f=[],p=Array(i),m=Array(i),h=Array(i),g=function(e,t){for(var n=0;n<i;n++)t[n]=e[n]},_=0;_<=o;_++){for(var v=0;v<i;v++)m[v]=v;var y=HL(m,c.slice(),i,s),b=y.slice();g(m,h);var x=HL(m,y,s,2),S=HL(h,b,s,2);x.length<=S.length&&x.length<d?(d=x.length,f=x,g(m,p)):S.length<=x.length&&S.length<d&&(d=S.length,f=S,g(h,p))}for(var C=this.spawn(f.map(function(e){return r[e[0]]})),w=this.spawn(),T=this.spawn(),E=p[0],D=0;D<p.length;D++){var O=p[D],k=n[D];O===E?w.merge(k):T.merge(k)}var A=function(t){var n=e.spawn();return t.forEach(function(t){n.merge(t),t.connectedEdges().forEach(function(t){e.contains(t)&&!C.contains(t)&&n.merge(t)})}),n};return{cut:C,components:[A(w),A(T)],partition1:w,partition2:T}}},WL=function(e){return{x:e.x,y:e.y}},GL=function(e,t,n){return{x:e.x*t+n.x,y:e.y*t+n.y}},KL=function(e,t,n){return{x:(e.x-n.x)/t,y:(e.y-n.y)/t}},qL=function(e){return{x:e[0],y:e[1]}},JL=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.min(a,r))}return r},YL=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=-1/0,i=t;i<n;i++){var a=e[i];isFinite(a)&&(r=Math.max(a,r))}return r},XL=function(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=0,i=0,a=t;a<n;a++){var o=e[a];isFinite(o)&&(r+=o,i++)}return r/i},ZL=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.length,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;r?e=e.slice(t,n):(n<e.length&&e.splice(n,e.length-n),t>0&&e.splice(0,t));for(var o=0,s=e.length-1;s>=0;s--){var c=e[s];a?isFinite(c)||(e[s]=-1/0,o++):e.splice(s,1)}i&&e.sort(function(e,t){return e-t});var l=e.length,u=Math.floor(l/2);return l%2==0?(e[u-1+o]+e[u+o])/2:e[u+1+o]},QL=function(e){return Math.PI*e/180},$L=function(e,t){return Math.atan2(t,e)-Math.PI/2},eR=Math.log2||function(e){return Math.log(e)/Math.log(2)},tR=function(e){return e>0?1:e<0?-1:0},nR=function(e,t){return Math.sqrt(rR(e,t))},rR=function(e,t){var n=t.x-e.x,r=t.y-e.y;return n*n+r*r},iR=function(e){for(var t=e.length,n=0,r=0;r<t;r++)n+=e[r];for(var i=0;i<t;i++)e[i]=e[i]/n;return e},aR=function(e,t,n,r){return(1-r)*(1-r)*e+2*(1-r)*r*t+r*r*n},oR=function(e,t,n,r){return{x:aR(e.x,t.x,n.x,r),y:aR(e.y,t.y,n.y,r)}},sR=function(e,t,n,r){var i={x:t.x-e.x,y:t.y-e.y},a=nR(e,t),o={x:i.x/a,y:i.y/a};return n??=0,r??=n*a,{x:e.x+o.x*r,y:e.y+o.y*r}},cR=function(e,t,n){return Math.max(e,Math.min(n,t))},lR=function(e){if(e==null)return{x1:1/0,y1:1/0,x2:-1/0,y2:-1/0,w:0,h:0};if(e.x1!=null&&e.y1!=null){if(e.x2!=null&&e.y2!=null&&e.x2>=e.x1&&e.y2>=e.y1)return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,w:e.x2-e.x1,h:e.y2-e.y1};if(e.w!=null&&e.h!=null&&e.w>=0&&e.h>=0)return{x1:e.x1,y1:e.y1,x2:e.x1+e.w,y2:e.y1+e.h,w:e.w,h:e.h}}},uR=function(e){return{x1:e.x1,x2:e.x2,w:e.w,y1:e.y1,y2:e.y2,h:e.h}},dR=function(e){e.x1=1/0,e.y1=1/0,e.x2=-1/0,e.y2=-1/0,e.w=0,e.h=0},fR=function(e,t){e.x1=Math.min(e.x1,t.x1),e.x2=Math.max(e.x2,t.x2),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,t.y1),e.y2=Math.max(e.y2,t.y2),e.h=e.y2-e.y1},pR=function(e,t,n){e.x1=Math.min(e.x1,t),e.x2=Math.max(e.x2,t),e.w=e.x2-e.x1,e.y1=Math.min(e.y1,n),e.y2=Math.max(e.y2,n),e.h=e.y2-e.y1},mR=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return e.x1-=t,e.x2+=t,e.y1-=t,e.y2+=t,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},hR=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[0],n,r,i,a;if(t.length===1)n=r=i=a=t[0];else if(t.length===2)n=i=t[0],a=r=t[1];else if(t.length===4){var o=PP(t,4);n=o[0],r=o[1],i=o[2],a=o[3]}return e.x1-=a,e.x2+=r,e.y1-=n,e.y2+=i,e.w=e.x2-e.x1,e.h=e.y2-e.y1,e},gR=function(e,t){e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1},_R=function(e,t){return!(e.x1>t.x2||t.x1>e.x2||e.x2<t.x1||t.x2<e.x1||e.y2<t.y1||t.y2<e.y1||e.y1>t.y2||t.y1>e.y2)},vR=function(e,t,n){return e.x1<=t&&t<=e.x2&&e.y1<=n&&n<=e.y2},yR=function(e,t){return vR(e,t.x,t.y)},bR=function(e,t){return vR(e,t.x1,t.y1)&&vR(e,t.x2,t.y2)},xR=Math.hypot??function(e,t){return Math.sqrt(e*e+t*t)};function SR(e,t){if(e.length<3)throw Error(`Need at least 3 vertices`);var n=function(e,t){return{x:e.x+t.x,y:e.y+t.y}},r=function(e,t){return{x:e.x-t.x,y:e.y-t.y}},i=function(e,t){return{x:e.x*t,y:e.y*t}},a=function(e,t){return e.x*t.y-e.y*t.x},o=function(e){var t=xR(e.x,e.y);return t===0?{x:0,y:0}:{x:e.x/t,y:e.y/t}},s=function(e){for(var t=0,n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length];t+=r.x*i.y-i.x*r.y}return t/2},c=function(e,t,o,s){var c=r(t,e),l=r(s,o),u=a(c,l);return Math.abs(u)<1e-9?n(e,i(c,.5)):n(e,i(c,a(r(o,e),l)/u))},l=e.map(function(e){return{x:e.x,y:e.y}});s(l)<0&&l.reverse();for(var u=l.length,d=[],f=0;f<u;f++){var p=l[f],m=l[(f+1)%u],h=r(m,p),g=o({x:h.y,y:-h.x});d.push(g)}for(var _=d.map(function(e,r){return{p1:n(l[r],i(e,t)),p2:n(l[(r+1)%u],i(e,t))}}),v=[],y=0;y<u;y++){var b=_[(y-1+u)%u],x=_[y],S=c(b.p1,b.p2,x.p1,x.p2);v.push(S)}return v}function CR(e,t,n,r,i,a){var o=SR(VR(e,t,n,r,i),a),s=lR();return o.forEach(function(e){return pR(s,e.x,e.y)}),s}var wR=function(e,t,n,r,i,a,o){var s=arguments.length>7&&arguments[7]!==void 0?arguments[7]:`auto`,c=s===`auto`?JR(i,a):s,l=i/2,u=a/2;c=Math.min(c,l,u);var d=c!==l,f=c!==u,p;if(d){var m=n-l+c-o,h=r-u-o;if(p=BR(e,t,n,r,m,h,n+l-c+o,h,!1),p.length>0)return p}if(f){var g=n+l+o;if(p=BR(e,t,n,r,g,r-u+c-o,g,r+u-c+o,!1),p.length>0)return p}if(d){var _=n-l+c-o,v=r+u+o;if(p=BR(e,t,n,r,_,v,n+l-c+o,v,!1),p.length>0)return p}if(f){var y=n-l-o;if(p=BR(e,t,n,r,y,r-u+c-o,y,r+u-c+o,!1),p.length>0)return p}var b,x=n-l+c,S=r-u+c;if(b=RR(e,t,n,r,x,S,c+o),b.length>0&&b[0]<=x&&b[1]<=S)return[b[0],b[1]];var C=n+l-c,w=r-u+c;if(b=RR(e,t,n,r,C,w,c+o),b.length>0&&b[0]>=C&&b[1]<=w)return[b[0],b[1]];var T=n+l-c,E=r+u-c;if(b=RR(e,t,n,r,T,E,c+o),b.length>0&&b[0]>=T&&b[1]>=E)return[b[0],b[1]];var D=n-l+c,O=r+u-c;return b=RR(e,t,n,r,D,O,c+o),b.length>0&&b[0]<=D&&b[1]>=O?[b[0],b[1]]:[]},TR=function(e,t,n,r,i,a,o){var s=o,c=Math.min(n,i),l=Math.max(n,i),u=Math.min(r,a),d=Math.max(r,a);return c-s<=e&&e<=l+s&&u-s<=t&&t<=d+s},ER=function(e,t,n,r,i,a,o,s,c){var l={x1:Math.min(n,o,i)-c,x2:Math.max(n,o,i)+c,y1:Math.min(r,s,a)-c,y2:Math.max(r,s,a)+c};return!(e<l.x1||e>l.x2||t<l.y1||t>l.y2)},DR=function(e,t,n,r){n-=r;var i=t*t-4*e*n;if(i<0)return[];var a=Math.sqrt(i),o=2*e;return[(-t+a)/o,(-t-a)/o]},OR=function(e,t,n,r,i){e===0&&(e=1e-5),t/=e,n/=e,r/=e;var a,o=(3*n-t*t)/9,s=-(27*r)+t*(9*n-t*t*2),c,l,u,d,f;if(s/=54,a=o*o*o+s*s,i[1]=0,d=t/3,a>0){l=s+Math.sqrt(a),l=l<0?-((-l)**(1/3)):l**(1/3),u=s-Math.sqrt(a),u=u<0?-((-u)**(1/3)):u**(1/3),i[0]=-d+l+u,d+=(l+u)/2,i[4]=i[2]=-d,d=Math.sqrt(3)*(-u+l)/2,i[3]=d,i[5]=-d;return}if(i[5]=i[3]=0,a===0){f=s<0?-((-s)**(1/3)):s**(1/3),i[0]=-d+2*f,i[4]=i[2]=-(f+d);return}o=-o,c=o*o*o,c=Math.acos(s/Math.sqrt(c)),f=2*Math.sqrt(o),i[0]=-d+f*Math.cos(c/3),i[2]=-d+f*Math.cos((c+2*Math.PI)/3),i[4]=-d+f*Math.cos((c+4*Math.PI)/3)},kR=function(e,t,n,r,i,a,o,s){var c=1*n*n-4*n*i+2*n*o+4*i*i-4*i*o+o*o+r*r-4*r*a+2*r*s+4*a*a-4*a*s+s*s,l=9*n*i-3*n*n-3*n*o-6*i*i+3*i*o+9*r*a-3*r*r-3*r*s-6*a*a+3*a*s,u=3*n*n-6*n*i+n*o-n*e+2*i*i+2*i*e-o*e+3*r*r-6*r*a+r*s-r*t+2*a*a+2*a*t-s*t,d=1*n*i-n*n+n*e-i*e+r*a-r*r+r*t-a*t,f=[];OR(c,l,u,d,f);for(var p=1e-7,m=[],h=0;h<6;h+=2)Math.abs(f[h+1])<p&&f[h]>=0&&f[h]<=1&&m.push(f[h]);m.push(1),m.push(0);for(var g=-1,_,v,y,b=0;b<m.length;b++)_=(1-m[b])**2*n+2*(1-m[b])*m[b]*i+m[b]*m[b]*o,v=(1-m[b])**2*r+2*(1-m[b])*m[b]*a+m[b]*m[b]*s,y=(_-e)**2+(v-t)**2,g>=0?y<g&&(g=y):g=y;return g},AR=function(e,t,n,r,i,a){var o=[e-n,t-r],s=[i-n,a-r],c=s[0]*s[0]+s[1]*s[1],l=o[0]*o[0]+o[1]*o[1],u=o[0]*s[0]+o[1]*s[1],d=u*u/c;return u<0?l:d>c?(e-i)*(e-i)+(t-a)*(t-a):l-d},jR=function(e,t,n){for(var r,i,a,o,s,c=0,l=0;l<n.length/2;l++)if(r=n[l*2],i=n[l*2+1],l+1<n.length/2?(a=n[(l+1)*2],o=n[(l+1)*2+1]):(a=n[(l+1-n.length/2)*2],o=n[(l+1-n.length/2)*2+1]),!(r==e&&a==e))if(r>=e&&e>=a||r<=e&&e<=a)s=(e-r)/(a-r)*(o-i)+i,s>t&&c++;else continue;return c%2!=0},MR=function(e,t,n,r,i,a,o,s,c){var l=Array(n.length),u;s[0]==null?u=s:(u=Math.atan(s[1]/s[0]),s[0]<0?u+=Math.PI/2:u=-u-Math.PI/2);for(var d=Math.cos(-u),f=Math.sin(-u),p=0;p<l.length/2;p++)l[p*2]=a/2*(n[p*2]*d-n[p*2+1]*f),l[p*2+1]=o/2*(n[p*2+1]*d+n[p*2]*f),l[p*2]+=r,l[p*2+1]+=i;return jR(e,t,c>0?PR(FR(l,-c)):l)},NR=function(e,t,n,r,i,a,o,s){for(var c=Array(n.length*2),l=0;l<s.length;l++){var u=s[l];if(c[l*4+0]=u.startX,c[l*4+1]=u.startY,c[l*4+2]=u.stopX,c[l*4+3]=u.stopY,(u.cx-e)**2+(u.cy-t)**2<=u.radius**2)return!0}return jR(e,t,c)},PR=function(e){for(var t=Array(e.length/2),n,r,i,a,o,s,c,l,u=0;u<e.length/4;u++){n=e[u*4],r=e[u*4+1],i=e[u*4+2],a=e[u*4+3],u<e.length/4-1?(o=e[(u+1)*4],s=e[(u+1)*4+1],c=e[(u+1)*4+2],l=e[(u+1)*4+3]):(o=e[0],s=e[1],c=e[2],l=e[3]);var d=BR(n,r,i,a,o,s,c,l,!0);t[u*2]=d[0],t[u*2+1]=d[1]}return t},FR=function(e,t){for(var n=Array(e.length*2),r,i,a,o,s=0;s<e.length/2;s++){r=e[s*2],i=e[s*2+1],s<e.length/2-1?(a=e[(s+1)*2],o=e[(s+1)*2+1]):(a=e[0],o=e[1]);var c=o-i,l=-(a-r),u=Math.sqrt(c*c+l*l),d=c/u,f=l/u;n[s*4]=r+d*t,n[s*4+1]=i+f*t,n[s*4+2]=a+d*t,n[s*4+3]=o+f*t}return n},IR=function(e,t,n,r,i,a){var o=n-e,s=r-t;o/=i,s/=a;var c=Math.sqrt(o*o+s*s),l=c-1;if(l<0)return[];var u=l/c;return[(n-e)*u+e,(r-t)*u+t]},LR=function(e,t,n,r,i,a,o){return e-=i,t-=a,e/=n/2+o,t/=r/2+o,e*e+t*t<=1},RR=function(e,t,n,r,i,a,o){var s=[n-e,r-t],c=[e-i,t-a],l=s[0]*s[0]+s[1]*s[1],u=2*(c[0]*s[0]+c[1]*s[1]),d=c[0]*c[0]+c[1]*c[1]-o*o,f=u*u-4*l*d;if(f<0)return[];var p=(-u+Math.sqrt(f))/(2*l),m=(-u-Math.sqrt(f))/(2*l),h=Math.min(p,m),g=Math.max(p,m),_=[];if(h>=0&&h<=1&&_.push(h),g>=0&&g<=1&&_.push(g),_.length===0)return[];var v=_[0]*s[0]+e,y=_[0]*s[1]+t;return _.length>1?_[0]==_[1]?[v,y]:[v,y,_[1]*s[0]+e,_[1]*s[1]+t]:[v,y]},zR=function(e,t,n){return t<=e&&e<=n||n<=e&&e<=t?e:e<=t&&t<=n||n<=t&&t<=e?t:n},BR=function(e,t,n,r,i,a,o,s,c){var l=e-i,u=n-e,d=o-i,f=t-a,p=r-t,m=s-a,h=d*f-m*l,g=u*f-p*l,_=m*u-d*p;if(_!==0){var v=h/_,y=g/_,b=.001,x=0-b,S=1+b;return x<=v&&v<=S&&x<=y&&y<=S||c?[e+v*u,t+v*p]:[]}else if(h===0||g===0)return zR(e,n,o)===o?[o,s]:zR(e,n,i)===i?[i,a]:zR(i,o,n)===n?[n,r]:[];else return[]},VR=function(e,t,n,r,i){var a=[],o=r/2,s=i/2,c=t,l=n;a.push({x:c+o*e[0],y:l+s*e[1]});for(var u=1;u<e.length/2;u++)a.push({x:c+o*e[u*2],y:l+s*e[u*2+1]});return a},HR=function(e,t,n,r,i,a,o,s){var c=[],l,u=Array(n.length),d=!0;a??(d=!1);var f;if(d){for(var p=0;p<u.length/2;p++)u[p*2]=n[p*2]*a+r,u[p*2+1]=n[p*2+1]*o+i;f=s>0?PR(FR(u,-s)):u}else f=n;for(var m,h,g,_,v=0;v<f.length/2;v++)m=f[v*2],h=f[v*2+1],v<f.length/2-1?(g=f[(v+1)*2],_=f[(v+1)*2+1]):(g=f[0],_=f[1]),l=BR(e,t,r,i,m,h,g,_),l.length!==0&&c.push(l[0],l[1]);return c},UR=function(e,t,n,r,i,a,o,s,c){var l=[],u,d=Array(n.length*2);c.forEach(function(n,a){a===0?(d[d.length-2]=n.startX,d[d.length-1]=n.startY):(d[a*4-2]=n.startX,d[a*4-1]=n.startY),d[a*4]=n.stopX,d[a*4+1]=n.stopY,u=RR(e,t,r,i,n.cx,n.cy,n.radius),u.length!==0&&l.push(u[0],u[1])});for(var f=0;f<d.length/4;f++)u=BR(e,t,r,i,d[f*4],d[f*4+1],d[f*4+2],d[f*4+3],!1),u.length!==0&&l.push(u[0],u[1]);if(l.length>2){for(var p=[l[0],l[1]],m=(p[0]-e)**2+(p[1]-t)**2,h=1;h<l.length/2;h++){var g=(l[h*2]-e)**2+(l[h*2+1]-t)**2;g<=m&&(p[0]=l[h*2],p[1]=l[h*2+1],m=g)}return p}return l},WR=function(e,t,n){var r=[e[0]-t[0],e[1]-t[1]],i=Math.sqrt(r[0]*r[0]+r[1]*r[1]),a=(i-n)/i;return a<0&&(a=1e-5),[t[0]+a*r[0],t[1]+a*r[1]]},GR=function(e,t){var n=qR(e,t);return n=KR(n),n},KR=function(e){for(var t,n,r=e.length/2,i=1/0,a=1/0,o=-1/0,s=-1/0,c=0;c<r;c++)t=e[2*c],n=e[2*c+1],i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);for(var l=2/(o-i),u=2/(s-a),d=0;d<r;d++)t=e[2*d]=e[2*d]*l,n=e[2*d+1]=e[2*d+1]*u,i=Math.min(i,t),o=Math.max(o,t),a=Math.min(a,n),s=Math.max(s,n);if(a<-1)for(var f=0;f<r;f++)n=e[2*f+1]=e[2*f+1]+(-1-a);return e},qR=function(e,t){var n=1/e*2*Math.PI,r=e%2==0?Math.PI/2+n/2:Math.PI/2;r+=t;for(var i=Array(e*2),a,o=0;o<e;o++)a=o*n+r,i[2*o]=Math.cos(a),i[2*o+1]=Math.sin(-a);return i},JR=function(e,t){return Math.min(e/4,t/4,8)},YR=function(e,t){return Math.min(e/10,t/10,8)},XR=function(){return 8},ZR=function(e,t,n){return[e-2*t+n,2*(t-e),e]},QR=function(e,t){return{heightOffset:Math.min(15,.05*t),widthOffset:Math.min(100,.25*e),ctrlPtOffsetPct:.05}};function $R(e,t){function n(e){for(var t=[],n=0;n<e.length;n++){var r=e[n],i=e[(n+1)%e.length],a={x:i.x-r.x,y:i.y-r.y},o={x:-a.y,y:a.x},s=Math.sqrt(o.x*o.x+o.y*o.y);t.push({x:o.x/s,y:o.y/s})}return t}function r(e,t){var n=1/0,r=-1/0,i=OP(e),a;try{for(i.s();!(a=i.n()).done;){var o=a.value,s=o.x*t.x+o.y*t.y;n=Math.min(n,s),r=Math.max(r,s)}}catch(e){i.e(e)}finally{i.f()}return{min:n,max:r}}function i(e,t){return!(e.max<t.min||t.max<e.min)}var a=OP([].concat(FP(n(e)),FP(n(t)))),o;try{for(a.s();!(o=a.n()).done;){var s=o.value;if(!i(r(e,s),r(t,s)))return!1}}catch(e){a.e(e)}finally{a.f()}return!0}var ez=uL({dampingFactor:.8,precision:1e-6,iterations:200,weight:function(e){return 1}}),tz={pageRank:function(e){for(var t=ez(e),n=t.dampingFactor,r=t.precision,i=t.iterations,a=t.weight,o=this._private.cy,s=this.byGroup(),c=s.nodes,l=s.edges,u=c.length,d=u*u,f=l.length,p=Array(d),m=Array(u),h=(1-n)/u,g=0;g<u;g++){for(var _=0;_<u;_++){var v=g*u+_;p[v]=0}m[g]=0}for(var y=0;y<f;y++){var b=l[y],x=b.data(`source`),S=b.data(`target`);if(x!==S){var C=c.indexOfId(x),w=c.indexOfId(S),T=a(b),E=w*u+C;p[E]+=T,m[C]+=T}}for(var D=1/u+h,O=0;O<u;O++)if(m[O]===0)for(var k=0;k<u;k++){var A=k*u+O;p[A]=D}else for(var j=0;j<u;j++){var M=j*u+O;p[M]=p[M]/m[O]+h}for(var N=Array(u),P=Array(u),F,I=0;I<u;I++)N[I]=1;for(var L=0;L<i;L++){for(var R=0;R<u;R++)P[R]=0;for(var ee=0;ee<u;ee++)for(var z=0;z<u;z++){var B=ee*u+z;P[ee]+=p[B]*N[z]}iR(P),F=N,N=P,P=F;for(var V=0,H=0;H<u;H++){var te=F[H]-N[H];V+=te*te}if(V<r)break}return{rank:function(e){return e=o.collection(e)[0],N[c.indexOf(e)]}}}},nz=uL({root:null,weight:function(e){return 1},directed:!1,alpha:0}),rz={degreeCentralityNormalized:function(e){e=nz(e);var t=this.cy(),n=this.nodes(),r=n.length;if(e.directed){for(var i={},a={},o=0,s=0,c=0;c<r;c++){var l=n[c],u=l.id();e.root=l;var d=this.degreeCentrality(e);o<d.indegree&&(o=d.indegree),s<d.outdegree&&(s=d.outdegree),i[u]=d.indegree,a[u]=d.outdegree}return{indegree:function(e){return o==0?0:(qP(e)&&(e=t.filter(e)),i[e.id()]/o)},outdegree:function(e){return s===0?0:(qP(e)&&(e=t.filter(e)),a[e.id()]/s)}}}else{for(var f={},p=0,m=0;m<r;m++){var h=n[m];e.root=h;var g=this.degreeCentrality(e);p<g.degree&&(p=g.degree),f[h.id()]=g.degree}return{degree:function(e){return p===0?0:(qP(e)&&(e=t.filter(e)),f[e.id()]/p)}}}},degreeCentrality:function(e){e=nz(e);var t=this.cy(),n=this,r=e,i=r.root,a=r.weight,o=r.directed,s=r.alpha;if(i=t.collection(i)[0],o){for(var c=i.connectedEdges(),l=c.filter(function(e){return e.target().same(i)&&n.has(e)}),u=c.filter(function(e){return e.source().same(i)&&n.has(e)}),d=l.length,f=u.length,p=0,m=0,h=0;h<l.length;h++)p+=a(l[h]);for(var g=0;g<u.length;g++)m+=a(u[g]);return{indegree:d**(1-s)*p**+s,outdegree:f**(1-s)*m**+s}}else{for(var _=i.connectedEdges().intersection(n),v=_.length,y=0,b=0;b<_.length;b++)y+=a(_[b]);return{degree:v**(1-s)*y**+s}}}};rz.dc=rz.degreeCentrality,rz.dcn=rz.degreeCentralityNormalised=rz.degreeCentralityNormalized;var iz=uL({harmonic:!0,weight:function(){return 1},directed:!1,root:null}),az={closenessCentralityNormalized:function(e){for(var t=iz(e),n=t.harmonic,r=t.weight,i=t.directed,a=this.cy(),o={},s=0,c=this.nodes(),l=this.floydWarshall({weight:r,directed:i}),u=0;u<c.length;u++){for(var d=0,f=c[u],p=0;p<c.length;p++)if(u!==p){var m=l.distance(f,c[p]);n?d+=1/m:d+=m}n||(d=1/d),s<d&&(s=d),o[f.id()]=d}return{closeness:function(e){return s==0?0:(e=qP(e)?a.filter(e)[0].id():e.id(),o[e]/s)}}},closenessCentrality:function(e){var t=iz(e),n=t.root,r=t.weight,i=t.directed,a=t.harmonic;n=this.filter(n)[0];for(var o=this.dijkstra({root:n,weight:r,directed:i}),s=0,c=this.nodes(),l=0;l<c.length;l++){var u=c[l];if(!u.same(n)){var d=o.distanceTo(u);a?s+=1/d:s+=d}}return a?s:1/s}};az.cc=az.closenessCentrality,az.ccn=az.closenessCentralityNormalised=az.closenessCentralityNormalized;var oz=uL({weight:null,directed:!1}),sz={betweennessCentrality:function(e){for(var t=oz(e),n=t.directed,r=t.weight,i=r!=null,a=this.cy(),o=this.nodes(),s={},c={},l=0,u={set:function(e,t){c[e]=t,t>l&&(l=t)},get:function(e){return c[e]}},d=0;d<o.length;d++){var f=o[d],p=f.id();n?s[p]=f.outgoers().nodes():s[p]=f.openNeighborhood().nodes(),u.set(p,0)}for(var m=function(){for(var e=o[h].id(),t=[],n={},c={},l={},d=new AL(function(e,t){return l[e]-l[t]}),f=0;f<o.length;f++){var p=o[f].id();n[p]=[],c[p]=0,l[p]=1/0}for(c[e]=1,l[e]=0,d.push(e);!d.empty();){var m=d.pop();if(t.push(m),i)for(var g=0;g<s[m].length;g++){var _=s[m][g],v=a.getElementById(m),y=void 0;y=v.edgesTo(_).length>0?v.edgesTo(_)[0]:_.edgesTo(v)[0];var b=r(y);_=_.id(),l[_]>l[m]+b&&(l[_]=l[m]+b,d.nodes.indexOf(_)<0?d.push(_):d.updateItem(_),c[_]=0,n[_]=[]),l[_]==l[m]+b&&(c[_]=c[_]+c[m],n[_].push(m))}else for(var x=0;x<s[m].length;x++){var S=s[m][x].id();l[S]==1/0&&(d.push(S),l[S]=l[m]+1),l[S]==l[m]+1&&(c[S]=c[S]+c[m],n[S].push(m))}}for(var C={},w=0;w<o.length;w++)C[o[w].id()]=0;for(;t.length>0;){for(var T=t.pop(),E=0;E<n[T].length;E++){var D=n[T][E];C[D]=C[D]+c[D]/c[T]*(1+C[T])}T!=o[h].id()&&u.set(T,u.get(T)+C[T])}},h=0;h<o.length;h++)m();var g={betweenness:function(e){var t=a.collection(e).id();return u.get(t)},betweennessNormalized:function(e){if(l==0)return 0;var t=a.collection(e).id();return u.get(t)/l}};return g.betweennessNormalised=g.betweennessNormalized,g}};sz.bc=sz.betweennessCentrality;var cz=uL({expandFactor:2,inflateFactor:2,multFactor:1,maxIterations:20,attributes:[function(e){return 1}]}),lz=function(e){return cz(e)},uz=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r](e);return n},dz=function(e,t,n){for(var r=0;r<t;r++)e[r*t+r]=n},fz=function(e,t){for(var n,r=0;r<t;r++){n=0;for(var i=0;i<t;i++)n+=e[i*t+r];for(var a=0;a<t;a++)e[a*t+r]=e[a*t+r]/n}},pz=function(e,t,n){for(var r=Array(n*n),i=0;i<n;i++){for(var a=0;a<n;a++)r[i*n+a]=0;for(var o=0;o<n;o++)for(var s=0;s<n;s++)r[i*n+s]+=e[i*n+o]*t[o*n+s]}return r},mz=function(e,t,n){for(var r=e.slice(0),i=1;i<n;i++)e=pz(e,r,t);return e},hz=function(e,t,n){for(var r=Array(t*t),i=0;i<t*t;i++)r[i]=e[i]**+n;return fz(r,t),r},gz=function(e,t,n,r){for(var i=0;i<n;i++)if(Math.round(e[i]*10**r)/10**r!=Math.round(t[i]*10**r)/10**r)return!1;return!0},_z=function(e,t,n,r){for(var i=[],a=0;a<t;a++){for(var o=[],s=0;s<t;s++)Math.round(e[a*t+s]*1e3)/1e3>0&&o.push(n[s]);o.length!==0&&i.push(r.collection(o))}return i},vz=function(e,t){for(var n=0;n<e.length;n++)if(!t[n]||e[n].id()!==t[n].id())return!1;return!0},yz=function(e){for(var t=0;t<e.length;t++)for(var n=0;n<e.length;n++)t!=n&&vz(e[t],e[n])&&e.splice(n,1);return e},bz=function(e){for(var t=this.nodes(),n=this.edges(),r=this.cy(),i=lz(e),a={},o=0;o<t.length;o++)a[t[o].id()]=o;for(var s=t.length,c=s*s,l=Array(c),u,d=0;d<c;d++)l[d]=0;for(var f=0;f<n.length;f++){var p=n[f],m=a[p.source().id()],h=a[p.target().id()],g=uz(p,i.attributes);l[m*s+h]+=g,l[h*s+m]+=g}dz(l,s,i.multFactor),fz(l,s);for(var _=!0,v=0;_&&v<i.maxIterations;)_=!1,u=mz(l,s,i.expandFactor),l=hz(u,s,i.inflateFactor),gz(l,u,c,4)||(_=!0),v++;var y=_z(l,s,t,r);return y=yz(y),y},xz={markovClustering:bz,mcl:bz},Sz=function(e){return e},Cz=function(e,t){return Math.abs(t-e)},wz=function(e,t,n){return e+Cz(t,n)},Tz=function(e,t,n){return e+(n-t)**2},Ez=function(e){return Math.sqrt(e)},Dz=function(e,t,n){return Math.max(e,Cz(t,n))},Oz=function(e,t,n,r,i){for(var a=arguments.length>5&&arguments[5]!==void 0?arguments[5]:Sz,o=r,s,c,l=0;l<e;l++)s=t(l),c=n(l),o=i(o,s,c);return a(o)},kz={euclidean:function(e,t,n){return e>=2?Oz(e,t,n,0,Tz,Ez):Oz(e,t,n,0,wz)},squaredEuclidean:function(e,t,n){return Oz(e,t,n,0,Tz)},manhattan:function(e,t,n){return Oz(e,t,n,0,wz)},max:function(e,t,n){return Oz(e,t,n,-1/0,Dz)}};kz[`squared-euclidean`]=kz.squaredEuclidean,kz.squaredeuclidean=kz.squaredEuclidean;function Az(e,t,n,r,i,a){var o=JP(e)?e:kz[e]||kz.euclidean;return t===0&&JP(e)?o(i,a):o(t,n,r,i,a)}var jz=uL({k:2,m:2,sensitivityThreshold:1e-4,distance:`euclidean`,maxIterations:10,attributes:[],testMode:!1,testCentroids:null}),Mz=function(e){return jz(e)},Nz=function(e,t,n,r,i){var a=i===`kMedoids`?function(e){return r[e](n)}:function(e){return n[e]},o=function(e){return r[e](t)},s=n,c=t;return Az(e,r.length,a,o,s,c)},Pz=function(e,t,n){for(var r=n.length,i=Array(r),a=Array(r),o=Array(t),s=null,c=0;c<r;c++)i[c]=e.min(n[c]).value,a[c]=e.max(n[c]).value;for(var l=0;l<t;l++){s=[];for(var u=0;u<r;u++)s[u]=Math.random()*(a[u]-i[u])+i[u];o[l]=s}return o},Fz=function(e,t,n,r,i){for(var a=1/0,o=0,s=0;s<t.length;s++){var c=Nz(n,e,t[s],r,i);c<a&&(a=c,o=s)}return o},Iz=function(e,t,n){for(var r=[],i=null,a=0;a<t.length;a++)i=t[a],n[i.id()]===e&&r.push(i);return r},Lz=function(e,t,n){return Math.abs(t-e)<=n},Rz=function(e,t,n){for(var r=0;r<e.length;r++)for(var i=0;i<e[r].length;i++)if(Math.abs(e[r][i]-t[r][i])>n)return!1;return!0},zz=function(e,t,n){for(var r=0;r<n;r++)if(e===t[r])return!0;return!1},Bz=function(e,t){var n=Array(t);if(e.length<50)for(var r=0;r<t;r++){for(var i=e[Math.floor(Math.random()*e.length)];zz(i,n,r);)i=e[Math.floor(Math.random()*e.length)];n[r]=i}else for(var a=0;a<t;a++)n[a]=e[Math.floor(Math.random()*e.length)];return n},Vz=function(e,t,n){for(var r=0,i=0;i<t.length;i++)r+=Nz(`manhattan`,t[i],e,n,`kMedoids`);return r},Hz=function(e){var t=this.cy(),n=this.nodes(),r=null,i=Mz(e),a=Array(i.k),o={},s;i.testMode?typeof i.testCentroids==`number`?(i.testCentroids,s=Pz(n,i.k,i.attributes)):s=RP(i.testCentroids)===`object`?i.testCentroids:Pz(n,i.k,i.attributes):s=Pz(n,i.k,i.attributes);for(var c=!0,l=0;c&&l<i.maxIterations;){for(var u=0;u<n.length;u++)r=n[u],o[r.id()]=Fz(r,s,i.distance,i.attributes,`kMeans`);c=!1;for(var d=0;d<i.k;d++){var f=Iz(d,n,o);if(f.length!==0){for(var p=i.attributes.length,m=s[d],h=Array(p),g=Array(p),_=0;_<p;_++){g[_]=0;for(var v=0;v<f.length;v++)r=f[v],g[_]+=i.attributes[_](r);h[_]=g[_]/f.length,Lz(h[_],m[_],i.sensitivityThreshold)||(c=!0)}s[d]=h,a[d]=t.collection(f)}}l++}return a},Uz=function(e){var t=this.cy(),n=this.nodes(),r=null,i=Mz(e),a=Array(i.k),o,s={},c,l=Array(i.k);i.testMode?typeof i.testCentroids==`number`||(o=RP(i.testCentroids)===`object`?i.testCentroids:Bz(n,i.k)):o=Bz(n,i.k);for(var u=!0,d=0;u&&d<i.maxIterations;){for(var f=0;f<n.length;f++)r=n[f],s[r.id()]=Fz(r,o,i.distance,i.attributes,`kMedoids`);u=!1;for(var p=0;p<o.length;p++){var m=Iz(p,n,s);if(m.length!==0){l[p]=Vz(o[p],m,i.attributes);for(var h=0;h<m.length;h++)c=Vz(m[h],m,i.attributes),c<l[p]&&(l[p]=c,o[p]=m[h],u=!0);a[p]=t.collection(m)}}d++}return a},Wz=function(e,t,n,r,i){for(var a,o,s=0;s<t.length;s++)for(var c=0;c<e.length;c++)r[s][c]=n[s][c]**+i.m;for(var l=0;l<e.length;l++)for(var u=0;u<i.attributes.length;u++){a=0,o=0;for(var d=0;d<t.length;d++)a+=r[d][l]*i.attributes[u](t[d]),o+=r[d][l];e[l][u]=a/o}},Gz=function(e,t,n,r,i){for(var a=0;a<e.length;a++)t[a]=e[a].slice();for(var o,s,c,l=2/(i.m-1),u=0;u<n.length;u++)for(var d=0;d<r.length;d++){o=0;for(var f=0;f<n.length;f++)s=Nz(i.distance,r[d],n[u],i.attributes,`cmeans`),c=Nz(i.distance,r[d],n[f],i.attributes,`cmeans`),o+=(s/c)**+l;e[d][u]=1/o}},Kz=function(e,t,n,r){for(var i=Array(n.k),a=0;a<i.length;a++)i[a]=[];for(var o,s,c=0;c<t.length;c++){o=-1/0,s=-1;for(var l=0;l<t[0].length;l++)t[c][l]>o&&(o=t[c][l],s=l);i[s].push(e[c])}for(var u=0;u<i.length;u++)i[u]=r.collection(i[u]);return i},qz=function(e){for(var t=this.cy(),n=this.nodes(),r=Mz(e),i,a,o,s=Array(n.length),c,l=0;l<n.length;l++)s[l]=Array(r.k);o=Array(n.length);for(var u=0;u<n.length;u++)o[u]=Array(r.k);for(var d=0;d<n.length;d++){for(var f=0,p=0;p<r.k;p++)o[d][p]=Math.random(),f+=o[d][p];for(var m=0;m<r.k;m++)o[d][m]=o[d][m]/f}a=Array(r.k);for(var h=0;h<r.k;h++)a[h]=Array(r.attributes.length);c=Array(n.length);for(var g=0;g<n.length;g++)c[g]=Array(r.k);for(var _=!0,v=0;_&&v<r.maxIterations;)_=!1,Wz(a,n,o,c,r),Gz(o,s,a,n,r),Rz(o,s,r.sensitivityThreshold)||(_=!0),v++;return i=Kz(n,o,r,t),{clusters:i,degreeOfMembership:o}},Jz={kMeans:Hz,kMedoids:Uz,fuzzyCMeans:qz,fcm:qz},Yz=uL({distance:`euclidean`,linkage:`min`,mode:`threshold`,threshold:1/0,addDendrogram:!1,dendrogramDepth:0,attributes:[]}),Xz={single:`min`,complete:`max`},Zz=function(e){var t=Yz(e),n=Xz[t.linkage];return n!=null&&(t.linkage=n),t},Qz=function(e,t,n,r,i){for(var a=0,o=1/0,s,c=i.attributes,l=function(e,t){return Az(i.distance,c.length,function(t){return c[t](e)},function(e){return c[e](t)},e,t)},u=0;u<e.length;u++){var d=e[u].key,f=n[d][r[d]];f<o&&(a=d,o=f)}if(i.mode===`threshold`&&o>=i.threshold||i.mode===`dendrogram`&&e.length===1)return!1;var p=t[a],m=t[r[a]],h=i.mode===`dendrogram`?{left:p,right:m,key:p.key}:{value:p.value.concat(m.value),key:p.key};e[p.index]=h,e.splice(m.index,1),t[p.key]=h;for(var g=0;g<e.length;g++){var _=e[g];p.key===_.key?s=1/0:i.linkage===`min`?(s=n[p.key][_.key],n[p.key][_.key]>n[m.key][_.key]&&(s=n[m.key][_.key])):i.linkage===`max`?(s=n[p.key][_.key],n[p.key][_.key]<n[m.key][_.key]&&(s=n[m.key][_.key])):s=i.linkage===`mean`?(n[p.key][_.key]*p.size+n[m.key][_.key]*m.size)/(p.size+m.size):i.mode===`dendrogram`?l(_.value,p.value):l(_.value[0],p.value[0]),n[p.key][_.key]=n[_.key][p.key]=s}for(var v=0;v<e.length;v++){var y=e[v].key;if(r[y]===p.key||r[y]===m.key){for(var b=y,x=0;x<e.length;x++){var S=e[x].key;n[y][S]<n[y][b]&&(b=S)}r[y]=b}e[v].index=v}return p.key=m.key=p.index=m.index=null,!0},$z=function(e,t,n){e&&(e.value?t.push(e.value):(e.left&&$z(e.left,t),e.right&&$z(e.right,t)))},eB=function(e,t){if(!e)return``;if(e.left&&e.right){var n=eB(e.left,t),r=eB(e.right,t),i=t.add({group:`nodes`,data:{id:n+`,`+r}});return t.add({group:`edges`,data:{source:n,target:i.id()}}),t.add({group:`edges`,data:{source:r,target:i.id()}}),i.id()}else if(e.value)return e.value.id()},tB=function(e,t,n){if(!e)return[];var r=[],i=[],a=[];return t===0?(e.left&&$z(e.left,r),e.right&&$z(e.right,i),a=r.concat(i),[n.collection(a)]):t===1?e.value?[n.collection(e.value)]:(e.left&&$z(e.left,r),e.right&&$z(e.right,i),[n.collection(r),n.collection(i)]):e.value?[n.collection(e.value)]:(e.left&&(r=tB(e.left,t-1,n)),e.right&&(i=tB(e.right,t-1,n)),r.concat(i))},nB=function(e){for(var t=this.cy(),n=this.nodes(),r=Zz(e),i=r.attributes,a=function(e,t){return Az(r.distance,i.length,function(t){return i[t](e)},function(e){return i[e](t)},e,t)},o=[],s=[],c=[],l=[],u=0;u<n.length;u++){var d={value:r.mode===`dendrogram`?n[u]:[n[u]],key:u,index:u};o[u]=d,l[u]=d,s[u]=[],c[u]=0}for(var f=0;f<o.length;f++)for(var p=0;p<=f;p++){var m=void 0;m=r.mode===`dendrogram`?f===p?1/0:a(o[f].value,o[p].value):f===p?1/0:a(o[f].value[0],o[p].value[0]),s[f][p]=m,s[p][f]=m,m<s[f][c[f]]&&(c[f]=p)}for(var h=Qz(o,l,s,c,r);h;)h=Qz(o,l,s,c,r);var g;return r.mode===`dendrogram`?(g=tB(o[0],r.dendrogramDepth,t),r.addDendrogram&&eB(o[0],t)):(g=Array(o.length),o.forEach(function(e,n){e.key=e.index=null,g[n]=t.collection(e.value)})),g},rB={hierarchicalClustering:nB,hca:nB},iB=uL({distance:`euclidean`,preference:`median`,damping:.8,maxIterations:1e3,minIterations:100,attributes:[]}),aB=function(e){var t=e.damping,n=e.preference;.5<=t&&t<1||tL(`Damping must range on [0.5, 1). Got: ${t}`);var r=[`median`,`mean`,`min`,`max`];return r.some(function(e){return e===n})||$(n)||tL(`Preference must be one of [${r.map(function(e){return`'${e}'`}).join(`, `)}] or a number. Got: ${n}`),iB(e)},oB=function(e,t,n,r){var i=function(e,t){return r[t](e)};return-Az(e,r.length,function(e){return i(t,e)},function(e){return i(n,e)},t,n)},sB=function(e,t){var n=null;return n=t===`median`?ZL(e):t===`mean`?XL(e):t===`min`?JL(e):t===`max`?YL(e):t,n},cB=function(e,t,n){for(var r=[],i=0;i<e;i++)t[i*e+i]+n[i*e+i]>0&&r.push(i);return r},lB=function(e,t,n){for(var r=[],i=0;i<e;i++){for(var a=-1,o=-1/0,s=0;s<n.length;s++){var c=n[s];t[i*e+c]>o&&(a=c,o=t[i*e+c])}a>0&&r.push(a)}for(var l=0;l<n.length;l++)r[n[l]]=n[l];return r},uB=function(e,t,n){for(var r=lB(e,t,n),i=0;i<n.length;i++){for(var a=[],o=0;o<r.length;o++)r[o]===n[i]&&a.push(o);for(var s=-1,c=-1/0,l=0;l<a.length;l++){for(var u=0,d=0;d<a.length;d++)u+=t[a[d]*e+a[l]];u>c&&(s=l,c=u)}n[i]=a[s]}return r=lB(e,t,n),r},dB=function(e){for(var t=this.cy(),n=this.nodes(),r=aB(e),i={},a=0;a<n.length;a++)i[n[a].id()]=a;for(var o=n.length,s=o*o,c=Array(s),l,u,d,f=0;f<s;f++)c[f]=-1/0;for(var p=0;p<o;p++)for(var m=0;m<o;m++)p!==m&&(c[p*o+m]=oB(r.distance,n[p],n[m],r.attributes));l=sB(c,r.preference);for(var h=0;h<o;h++)c[h*o+h]=l;u=Array(s);for(var g=0;g<s;g++)u[g]=0;d=Array(s);for(var _=0;_<s;_++)d[_]=0;for(var v=Array(o),y=Array(o),b=Array(o),x=0;x<o;x++)v[x]=0,y[x]=0,b[x]=0;for(var S=Array(o*r.minIterations),C=0;C<S.length;C++)S[C]=0;var w;for(w=0;w<r.maxIterations;w++){for(var T=0;T<o;T++){for(var E=-1/0,D=-1/0,O=-1,k=0,A=0;A<o;A++)v[A]=u[T*o+A],k=d[T*o+A]+c[T*o+A],k>=E?(D=E,E=k,O=A):k>D&&(D=k);for(var j=0;j<o;j++)u[T*o+j]=(1-r.damping)*(c[T*o+j]-E)+r.damping*v[j];u[T*o+O]=(1-r.damping)*(c[T*o+O]-D)+r.damping*v[O]}for(var M=0;M<o;M++){for(var N=0,P=0;P<o;P++)v[P]=d[P*o+M],y[P]=Math.max(0,u[P*o+M]),N+=y[P];N-=y[M],y[M]=u[M*o+M],N+=y[M];for(var F=0;F<o;F++)d[F*o+M]=(1-r.damping)*Math.min(0,N-y[F])+r.damping*v[F];d[M*o+M]=(1-r.damping)*(N-y[M])+r.damping*v[M]}for(var I=0,L=0;L<o;L++){var R=+(d[L*o+L]+u[L*o+L]>0);S[w%r.minIterations*o+L]=R,I+=R}if(I>0&&(w>=r.minIterations-1||w==r.maxIterations-1)){for(var ee=0,z=0;z<o;z++){b[z]=0;for(var B=0;B<r.minIterations;B++)b[z]+=S[B*o+z];(b[z]===0||b[z]===r.minIterations)&&ee++}if(ee===o)break}}for(var V=cB(o,u,d),H=uB(o,c,V),te={},ne=0;ne<V.length;ne++)te[V[ne]]=[];for(var U=0;U<n.length;U++){var re=H[i[n[U].id()]];re!=null&&te[re].push(n[U])}for(var ie=Array(V.length),ae=0;ae<V.length;ae++)ie[ae]=t.collection(te[V[ae]]);return ie},fB={affinityPropagation:dB,ap:dB},pB=uL({root:void 0,directed:!1}),mB={hierholzer:function(e){if(!XP(e)){var t=arguments;e={root:t[0],directed:t[1]}}var n=pB(e),r=n.root,i=n.directed,a=this,o=!1,s,c,l;r&&(l=qP(r)?this.filter(r)[0].id():r[0].id());var u={},d={};i?a.forEach(function(e){var t=e.id();if(e.isNode()){var n=e.indegree(!0),r=e.outdegree(!0),i=n-r,a=r-n;i==1?s?o=!0:s=t:a==1?c?o=!0:c=t:(a>1||i>1)&&(o=!0),u[t]=[],e.outgoers().forEach(function(e){e.isEdge()&&u[t].push(e.id())})}else d[t]=[void 0,e.target().id()]}):a.forEach(function(e){var t=e.id();e.isNode()?(e.degree(!0)%2&&(s?c?o=!0:c=t:s=t),u[t]=[],e.connectedEdges().forEach(function(e){return u[t].push(e.id())})):d[t]=[e.source().id(),e.target().id()]});var f={found:!1,trail:void 0};if(o)return f;if(c&&s)if(i){if(l&&c!=l)return f;l=c}else if(l&&c!=l&&s!=l)return f;else l||=c;else l||=a[0].id();var p=function(e){for(var t=e,n=[e],r,a,o;u[t].length;)r=u[t].shift(),a=d[r][0],o=d[r][1],t==o?!i&&t!=a&&(u[a]=u[a].filter(function(e){return e!=r}),t=a):(u[o]=u[o].filter(function(e){return e!=r}),t=o),n.unshift(r),n.unshift(t);return n},m=[],h=[];for(h=p(l);h.length!=1;)u[h[0]].length==0?(m.unshift(a.getElementById(h.shift())),m.unshift(a.getElementById(h.shift()))):h=p(h.shift()).concat(h);for(var g in m.unshift(a.getElementById(h.shift())),u)if(u[g].length)return f;return f.found=!0,f.trail=this.spawn(m,!0),f}},hB=function(){var e=this,t={},n=0,r=0,i=[],a=[],o={},s=function(n,r){for(var o=a.length-1,s=[],c=e.spawn();a[o].x!=n||a[o].y!=r;)s.push(a.pop().edge),o--;s.push(a.pop().edge),s.forEach(function(n){var r=n.connectedNodes().intersection(e);c.merge(n),r.forEach(function(n){var r=n.id(),i=n.connectedEdges().intersection(e);c.merge(n),t[r].cutVertex?c.merge(i.filter(function(e){return e.isLoop()})):c.merge(i)})}),i.push(c)},c=function(l,u,d){l===d&&(r+=1),t[u]={id:n,low:n++,cutVertex:!1};var f=e.getElementById(u).connectedEdges().intersection(e);if(f.size()===0)i.push(e.spawn(e.getElementById(u)));else{var p,m,h,g;f.forEach(function(e){p=e.source().id(),m=e.target().id(),h=p===u?m:p,h!==d&&(g=e.id(),o[g]||(o[g]=!0,a.push({x:u,y:h,edge:e})),h in t?t[u].low=Math.min(t[u].low,t[h].id):(c(l,h,u),t[u].low=Math.min(t[u].low,t[h].low),t[u].id<=t[h].low&&(t[u].cutVertex=!0,s(u,h))))})}};e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||(r=0,c(n,n),t[n].cutVertex=r>1)}});var l=Object.keys(t).filter(function(e){return t[e].cutVertex}).map(function(t){return e.getElementById(t)});return{cut:e.spawn(l),components:i}},gB={hopcroftTarjanBiconnected:hB,htbc:hB,htb:hB,hopcroftTarjanBiconnectedComponents:hB},_B=function(){var e=this,t={},n=0,r=[],i=[],a=e.spawn(e),o=function(s){if(i.push(s),t[s]={index:n,low:n++,explored:!1},e.getElementById(s).connectedEdges().intersection(e).forEach(function(e){var n=e.target().id();n!==s&&(n in t||o(n),t[n].explored||(t[s].low=Math.min(t[s].low,t[n].low)))}),t[s].index===t[s].low){for(var c=e.spawn();;){var l=i.pop();if(c.merge(e.getElementById(l)),t[l].low=t[s].index,t[l].explored=!0,l===s)break}var u=c.edgesWith(c),d=c.merge(u);r.push(d),a=a.difference(d)}};return e.forEach(function(e){if(e.isNode()){var n=e.id();n in t||o(n)}}),{cut:a,components:r}},vB={tarjanStronglyConnected:_B,tsc:_B,tscc:_B,tarjanStronglyConnectedComponents:_B},yB={};[SL,ML,NL,FL,LL,zL,UL,tz,rz,az,sz,xz,Jz,rB,fB,mB,gB,vB].forEach(function(e){EF(yB,e)});var bB=0,xB=1,SB=2,CB=function(e){if(!(this instanceof CB))return new CB(e);this.id=`Thenable/1.0.7`,this.state=bB,this.fulfillValue=void 0,this.rejectReason=void 0,this.onFulfilled=[],this.onRejected=[],this.proxy={then:this.then.bind(this)},typeof e==`function`&&e.call(this,this.fulfill.bind(this),this.reject.bind(this))};CB.prototype={fulfill:function(e){return wB(this,xB,`fulfillValue`,e)},reject:function(e){return wB(this,SB,`rejectReason`,e)},then:function(e,t){var n=this,r=new CB;return n.onFulfilled.push(DB(e,r,`fulfill`)),n.onRejected.push(DB(t,r,`reject`)),TB(n),r.proxy}};var wB=function(e,t,n,r){return e.state===bB&&(e.state=t,e[n]=r,TB(e)),e},TB=function(e){e.state===xB?EB(e,`onFulfilled`,e.fulfillValue):e.state===SB&&EB(e,`onRejected`,e.rejectReason)},EB=function(e,t,n){if(e[t].length!==0){var r=e[t];e[t]=[];var i=function(){for(var e=0;e<r.length;e++)r[e](n)};typeof setImmediate==`function`?setImmediate(i):setTimeout(i,0)}},DB=function(e,t,n){return function(r){if(typeof e!=`function`)t[n].call(t,r);else{var i;try{i=e(r)}catch(e){t.reject(e);return}OB(t,i)}}},OB=function(e,t){if(e===t||e.proxy===t){e.reject(TypeError(`cannot resolve promise with itself`));return}var n;if(RP(t)===`object`&&t!==null||typeof t==`function`)try{n=t.then}catch(t){e.reject(t);return}if(typeof n==`function`){var r=!1;try{n.call(t,function(n){r||(r=!0,n===t?e.reject(TypeError(`circular thenable chain`)):OB(e,n))},function(t){r||(r=!0,e.reject(t))})}catch(t){r||e.reject(t)}return}e.fulfill(t)};CB.all=function(e){return new CB(function(t,n){for(var r=Array(e.length),i=0,a=function(n,a){r[n]=a,i++,i===e.length&&t(r)},o=0;o<e.length;o++)(function(t){var r=e[t];r!=null&&r.then!=null?r.then(function(e){a(t,e)},function(e){n(e)}):a(t,r)})(o)})},CB.resolve=function(e){return new CB(function(t,n){t(e)})},CB.reject=function(e){return new CB(function(t,n){n(e)})};var kB=typeof Promise<`u`?Promise:CB,AB=function(e,t,n){var r=rF(e),i=!r,a=this._private=EF({duration:1e3},t,n);if(a.target=e,a.style=a.style||a.css,a.started=!1,a.playing=!1,a.hooked=!1,a.applying=!1,a.progress=0,a.completes=[],a.frames=[],a.complete&&JP(a.complete)&&a.completes.push(a.complete),i){var o=e.position();a.startPosition=a.startPosition||{x:o.x,y:o.y},a.startStyle=a.startStyle||e.cy().style().getAnimationStartStyle(e,a.style)}if(r){var s=e.pan();a.startPan={x:s.x,y:s.y},a.startZoom=e.zoom()}this.length=1,this[0]=this},jB=AB.prototype;EF(jB,{instanceString:function(){return`animation`},hook:function(){var e=this._private;if(!e.hooked){var t,n=e.target._private.animation;t=e.queue?n.queue:n.current,t.push(this),eF(e.target)&&e.target.cy().addToAnimationPool(e.target),e.hooked=!0}return this},play:function(){var e=this._private;return e.progress===1&&(e.progress=0),e.playing=!0,e.started=!1,e.stopped=!1,this.hook(),this},playing:function(){return this._private.playing},apply:function(){var e=this._private;return e.applying=!0,e.started=!1,e.stopped=!1,this.hook(),this},applying:function(){return this._private.applying},pause:function(){var e=this._private;return e.playing=!1,e.started=!1,this},stop:function(){var e=this._private;return e.playing=!1,e.started=!1,e.stopped=!0,this},rewind:function(){return this.progress(0)},fastforward:function(){return this.progress(1)},time:function(e){var t=this._private;return e===void 0?t.progress*t.duration:this.progress(e/t.duration)},progress:function(e){var t=this._private,n=t.playing;return e===void 0?t.progress:(n&&this.pause(),t.progress=e,t.started=!1,n&&this.play(),this)},completed:function(){return this._private.progress===1},reverse:function(){var e=this._private,t=e.playing;t&&this.pause(),e.progress=1-e.progress,e.started=!1;var n=function(t,n){var r=e[t];r!=null&&(e[t]=e[n],e[n]=r)};if(n(`zoom`,`startZoom`),n(`pan`,`startPan`),n(`position`,`startPosition`),e.style)for(var r=0;r<e.style.length;r++){var i=e.style[r],a=i.name,o=e.startStyle[a];e.startStyle[a]=i,e.style[r]=o}return t&&this.play(),this},promise:function(e){var t=this._private,n;switch(e){case`frame`:n=t.frames;break;default:case`complete`:case`completed`:n=t.completes}return new kB(function(e,t){n.push(function(){e()})})}}),jB.complete=jB.completed,jB.run=jB.play,jB.running=jB.playing;var MB={animated:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return!1;var n=t[0];if(n)return n._private.animation.current.length>0}},clearQueue:function(){return function(){var e=this,t=e.length===void 0?[e]:e;if(!(this._private.cy||this).styleEnabled())return this;for(var n=0;n<t.length;n++){var r=t[n];r._private.animation.queue=[]}return this}},delay:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animate({delay:e,duration:e,complete:t}):this}},delayAnimation:function(){return function(e,t){return(this._private.cy||this).styleEnabled()?this.animation({delay:e,duration:e,complete:t}):this}},animation:function(){return function(e,t){var n=this,r=n.length!==void 0,i=r?n:[n],a=this._private.cy||this,o=!r,s=!o;if(!a.styleEnabled())return this;var c=a.style();if(e=EF({},e,t),Object.keys(e).length===0)return new AB(i[0],e);switch(e.duration===void 0&&(e.duration=400),e.duration){case`slow`:e.duration=600;break;case`fast`:e.duration=200;break}if(s&&(e.style=c.getPropsList(e.style||e.css),e.css=void 0),s&&e.renderedPosition!=null){var l=e.renderedPosition,u=a.pan(),d=a.zoom();e.position=KL(l,d,u)}if(o&&e.panBy!=null){var f=e.panBy,p=a.pan();e.pan={x:p.x+f.x,y:p.y+f.y}}var m=e.center||e.centre;if(o&&m!=null){var h=a.getCenterPan(m.eles,e.zoom);h!=null&&(e.pan=h)}if(o&&e.fit!=null){var g=e.fit,_=a.getFitViewport(g.eles||g.boundingBox,g.padding);_!=null&&(e.pan=_.pan,e.zoom=_.zoom)}if(o&&XP(e.zoom)){var v=a.getZoomedViewport(e.zoom);v==null?e.zoom=null:(v.zoomed&&(e.zoom=v.zoom),v.panned&&(e.pan=v.pan))}return new AB(i[0],e)}},animate:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n;if(!(this._private.cy||this).styleEnabled())return this;t&&(e=EF({},e,t));for(var i=0;i<r.length;i++){var a=r[i],o=a.animated()&&(e.queue===void 0||e.queue);a.animation(e,o?{queue:!0}:void 0).play()}return this}},stop:function(){return function(e,t){var n=this,r=n.length===void 0?[n]:n,i=this._private.cy||this;if(!i.styleEnabled())return this;for(var a=0;a<r.length;a++){for(var o=r[a]._private,s=o.animation.current,c=0;c<s.length;c++){var l=s[c]._private;t&&(l.duration=0)}e&&(o.animation.queue=[]),t||(o.animation.current=[])}return i.notify(`draw`),this}}},NB,PB;function FB(){return PB?NB:(PB=1,NB=Array.isArray,NB)}var IB,LB;function RB(){if(LB)return IB;LB=1;var e=FB(),t=vI(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(i,a){if(e(i))return!1;var o=typeof i;return o==`number`||o==`symbol`||o==`boolean`||i==null||t(i)?!0:r.test(i)||!n.test(i)||a!=null&&i in Object(a)}return IB=i,IB}var zB,BB;function VB(){if(BB)return zB;BB=1;var e=fI(),t=zF(),n=`[object AsyncFunction]`,r=`[object Function]`,i=`[object GeneratorFunction]`,a=`[object Proxy]`;function o(o){if(!t(o))return!1;var s=e(o);return s==r||s==i||s==n||s==a}return zB=o,zB}var HB,UB;function WB(){return UB?HB:(UB=1,HB=GF()[`__core-js_shared__`],HB)}var GB,KB;function qB(){if(KB)return GB;KB=1;var e=WB(),t=function(){var t=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||``);return t?`Symbol(src)_1.`+t:``}();function n(e){return!!t&&t in e}return GB=n,GB}var JB,YB;function XB(){if(YB)return JB;YB=1;var e=Function.prototype.toString;function t(t){if(t!=null){try{return e.call(t)}catch{}try{return t+``}catch{}}return``}return JB=t,JB}var ZB,QB;function $B(){if(QB)return ZB;QB=1;var e=VB(),t=qB(),n=zF(),r=XB(),i=/[\\^$.*+?()[\]{}|]/g,a=/^\[object .+?Constructor\]$/,o=Function.prototype,s=Object.prototype,c=o.toString,l=s.hasOwnProperty,u=RegExp(`^`+c.call(l).replace(i,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function d(i){return!n(i)||t(i)?!1:(e(i)?u:a).test(r(i))}return ZB=d,ZB}var eV,tV;function nV(){if(tV)return eV;tV=1;function e(e,t){return e?.[t]}return eV=e,eV}var rV,iV;function aV(){if(iV)return rV;iV=1;var e=$B(),t=nV();function n(n,r){var i=t(n,r);return e(i)?i:void 0}return rV=n,rV}var oV,sV;function cV(){return sV?oV:(sV=1,oV=aV()(Object,`create`),oV)}var lV,uV;function dV(){if(uV)return lV;uV=1;var e=cV();function t(){this.__data__=e?e(null):{},this.size=0}return lV=t,lV}var fV,pV;function mV(){if(pV)return fV;pV=1;function e(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}return fV=e,fV}var hV,gV;function _V(){if(gV)return hV;gV=1;var e=cV(),t=`__lodash_hash_undefined__`,n=Object.prototype.hasOwnProperty;function r(r){var i=this.__data__;if(e){var a=i[r];return a===t?void 0:a}return n.call(i,r)?i[r]:void 0}return hV=r,hV}var vV,yV;function bV(){if(yV)return vV;yV=1;var e=cV(),t=Object.prototype.hasOwnProperty;function n(n){var r=this.__data__;return e?r[n]!==void 0:t.call(r,n)}return vV=n,vV}var xV,SV;function CV(){if(SV)return xV;SV=1;var e=cV(),t=`__lodash_hash_undefined__`;function n(n,r){var i=this.__data__;return this.size+=+!this.has(n),i[n]=e&&r===void 0?t:r,this}return xV=n,xV}var wV,TV;function EV(){if(TV)return wV;TV=1;var e=dV(),t=mV(),n=_V(),r=bV(),i=CV();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,wV=a,wV}var DV,OV;function kV(){if(OV)return DV;OV=1;function e(){this.__data__=[],this.size=0}return DV=e,DV}var AV,jV;function MV(){if(jV)return AV;jV=1;function e(e,t){return e===t||e!==e&&t!==t}return AV=e,AV}var NV,PV;function FV(){if(PV)return NV;PV=1;var e=MV();function t(t,n){for(var r=t.length;r--;)if(e(t[r][0],n))return r;return-1}return NV=t,NV}var IV,LV;function RV(){if(LV)return IV;LV=1;var e=FV(),t=Array.prototype.splice;function n(n){var r=this.__data__,i=e(r,n);return i<0?!1:(i==r.length-1?r.pop():t.call(r,i,1),--this.size,!0)}return IV=n,IV}var zV,BV;function VV(){if(BV)return zV;BV=1;var e=FV();function t(t){var n=this.__data__,r=e(n,t);return r<0?void 0:n[r][1]}return zV=t,zV}var HV,UV;function WV(){if(UV)return HV;UV=1;var e=FV();function t(t){return e(this.__data__,t)>-1}return HV=t,HV}var GV,KV;function qV(){if(KV)return GV;KV=1;var e=FV();function t(t,n){var r=this.__data__,i=e(r,t);return i<0?(++this.size,r.push([t,n])):r[i][1]=n,this}return GV=t,GV}var JV,YV;function XV(){if(YV)return JV;YV=1;var e=kV(),t=RV(),n=VV(),r=WV(),i=qV();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,JV=a,JV}var ZV,QV;function $V(){return QV?ZV:(QV=1,ZV=aV()(GF(),`Map`),ZV)}var eH,tH;function nH(){if(tH)return eH;tH=1;var e=EV(),t=XV(),n=$V();function r(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return eH=r,eH}var rH,iH;function aH(){if(iH)return rH;iH=1;function e(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}return rH=e,rH}var oH,sH;function cH(){if(sH)return oH;sH=1;var e=aH();function t(t,n){var r=t.__data__;return e(n)?r[typeof n==`string`?`string`:`hash`]:r.map}return oH=t,oH}var lH,uH;function dH(){if(uH)return lH;uH=1;var e=cH();function t(t){var n=e(this,t).delete(t);return this.size-=+!!n,n}return lH=t,lH}var fH,pH;function mH(){if(pH)return fH;pH=1;var e=cH();function t(t){return e(this,t).get(t)}return fH=t,fH}var hH,gH;function _H(){if(gH)return hH;gH=1;var e=cH();function t(t){return e(this,t).has(t)}return hH=t,hH}var vH,yH;function bH(){if(yH)return vH;yH=1;var e=cH();function t(t,n){var r=e(this,t),i=r.size;return r.set(t,n),this.size+=r.size==i?0:1,this}return vH=t,vH}var xH,SH;function CH(){if(SH)return xH;SH=1;var e=nH(),t=dH(),n=mH(),r=_H(),i=bH();function a(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}return a.prototype.clear=e,a.prototype.delete=t,a.prototype.get=n,a.prototype.has=r,a.prototype.set=i,xH=a,xH}var wH,TH;function EH(){if(TH)return wH;TH=1;var e=CH(),t=`Expected a function`;function n(r,i){if(typeof r!=`function`||i!=null&&typeof i!=`function`)throw TypeError(t);var a=function(){var e=arguments,t=i?i.apply(this,e):e[0],n=a.cache;if(n.has(t))return n.get(t);var o=r.apply(this,e);return a.cache=n.set(t,o)||n,o};return a.cache=new(n.Cache||e),a}return n.Cache=e,wH=n,wH}var DH,OH;function kH(){if(OH)return DH;OH=1;var e=EH(),t=500;function n(n){var r=e(n,function(e){return i.size===t&&i.clear(),e}),i=r.cache;return r}return DH=n,DH}var AH,jH;function MH(){if(jH)return AH;jH=1;var e=kH(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g;return AH=e(function(e){var r=[];return e.charCodeAt(0)===46&&r.push(``),e.replace(t,function(e,t,i,a){r.push(i?a.replace(n,`$1`):t||e)}),r}),AH}var NH,PH;function FH(){if(PH)return NH;PH=1;function e(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}return NH=e,NH}var IH,LH;function RH(){if(LH)return IH;LH=1;var e=rI(),t=FH(),n=FB(),r=vI(),i=e?e.prototype:void 0,a=i?i.toString:void 0;function o(e){if(typeof e==`string`)return e;if(n(e))return t(e,o)+``;if(r(e))return a?a.call(e):``;var i=e+``;return i==`0`&&1/e==-1/0?`-0`:i}return IH=o,IH}var zH,BH;function VH(){if(BH)return zH;BH=1;var e=RH();function t(t){return t==null?``:e(t)}return zH=t,zH}var HH,UH;function WH(){if(UH)return HH;UH=1;var e=FB(),t=RB(),n=MH(),r=VH();function i(i,a){return e(i)?i:t(i,a)?[i]:n(r(i))}return HH=i,HH}var GH,KH;function qH(){if(KH)return GH;KH=1;var e=vI();function t(t){if(typeof t==`string`||e(t))return t;var n=t+``;return n==`0`&&1/t==-1/0?`-0`:n}return GH=t,GH}var JH,YH;function XH(){if(YH)return JH;YH=1;var e=WH(),t=qH();function n(n,r){r=e(r,n);for(var i=0,a=r.length;n!=null&&i<a;)n=n[t(r[i++])];return i&&i==a?n:void 0}return JH=n,JH}var ZH,QH;function $H(){if(QH)return ZH;QH=1;var e=XH();function t(t,n,r){var i=t==null?void 0:e(t,n);return i===void 0?r:i}return ZH=t,ZH}var eU=IF($H()),tU,nU;function rU(){if(nU)return tU;nU=1;var e=aV();return tU=function(){try{var t=e(Object,`defineProperty`);return t({},``,{}),t}catch{}}(),tU}var iU,aU;function oU(){if(aU)return iU;aU=1;var e=rU();function t(t,n,r){n==`__proto__`&&e?e(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r}return iU=t,iU}var sU,cU;function lU(){if(cU)return sU;cU=1;var e=oU(),t=MV(),n=Object.prototype.hasOwnProperty;function r(r,i,a){var o=r[i];(!(n.call(r,i)&&t(o,a))||a===void 0&&!(i in r))&&e(r,i,a)}return sU=r,sU}var uU,dU;function fU(){if(dU)return uU;dU=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(n,r){var i=typeof n;return r??=e,!!r&&(i==`number`||i!=`symbol`&&t.test(n))&&n>-1&&n%1==0&&n<r}return uU=n,uU}var pU,mU;function hU(){if(mU)return pU;mU=1;var e=lU(),t=WH(),n=fU(),r=zF(),i=qH();function a(a,o,s,c){if(!r(a))return a;o=t(o,a);for(var l=-1,u=o.length,d=u-1,f=a;f!=null&&++l<u;){var p=i(o[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return a;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=r(h)?h:n(o[l+1])?[]:{})}e(f,p,m),f=f[p]}return a}return pU=a,pU}var gU,_U;function vU(){if(_U)return gU;_U=1;var e=hU();function t(t,n,r){return t==null?t:e(t,n,r)}return gU=t,gU}var yU=IF(vU()),bU,xU;function SU(){if(xU)return bU;xU=1;function e(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}return bU=e,bU}var CU,wU;function TU(){if(wU)return CU;wU=1;var e=FH(),t=SU(),n=FB(),r=vI(),i=MH(),a=qH(),o=VH();function s(s){return n(s)?e(s,a):r(s)?[s]:t(i(o(s)))}return CU=s,CU}var EU=IF(TU()),DU={data:function(e){return e=EF({},{field:`data`,bindingEvent:`data`,allowBinding:!1,allowSetting:!1,allowGetting:!1,settingEvent:`data`,settingTriggersEvent:!1,triggerFnName:`trigger`,immutableKeys:{},updateStyle:!1,beforeGet:function(e){},beforeSet:function(e,t){},onSet:function(e){},canSet:function(e){return!0}},e),function(t,n){var r=e,i=this,a=i.length!==void 0,o=a?i:[i],s=a?i[0]:i;if(qP(t)){var c=t.indexOf(`.`)!==-1&&EU(t);if(r.allowGetting&&n===void 0){var l;return s&&(r.beforeGet(s),l=c&&s._private[r.field][t]===void 0?eU(s._private[r.field],c):s._private[r.field][t]),l}else if(r.allowSetting&&n!==void 0&&!r.immutableKeys[t]){var u=kP({},t,n);r.beforeSet(i,u);for(var d=0,f=o.length;d<f;d++){var p=o[d];r.canSet(p)&&(c&&s._private[r.field][t]===void 0?yU(p._private[r.field],c,n):p._private[r.field][t]=n)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}}else if(r.allowSetting&&XP(t)){var m=t,h,g,_=Object.keys(m);r.beforeSet(i,m);for(var v=0;v<_.length;v++)if(h=_[v],g=m[h],!r.immutableKeys[h])for(var y=0;y<o.length;y++){var b=o[y];r.canSet(b)&&(b._private[r.field][h]=g)}r.updateStyle&&i.updateStyle(),r.onSet(i),r.settingTriggersEvent&&i[r.triggerFnName](r.settingEvent)}else if(r.allowBinding&&JP(t)){var x=t;i.on(r.bindingEvent,x)}else if(r.allowGetting&&t===void 0){var S;return s&&(r.beforeGet(s),S=s._private[r.field]),S}return i}},removeData:function(e){return e=EF({},{field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!1,immutableKeys:{}},e),function(t){var n=e,r=this,i=r.length===void 0?[r]:r;if(qP(t)){for(var a=t.split(/\s+/),o=a.length,s=0;s<o;s++){var c=a[s];if(!oF(c)&&!n.immutableKeys[c])for(var l=0,u=i.length;l<u;l++)i[l]._private[n.field][c]=void 0}n.triggerEvent&&r[n.triggerFnName](n.event)}else if(t===void 0){for(var d=0,f=i.length;d<f;d++)for(var p=i[d]._private[n.field],m=Object.keys(p),h=0;h<m.length;h++){var g=m[h];n.immutableKeys[g]||(p[g]=void 0)}n.triggerEvent&&r[n.triggerFnName](n.event)}return r}}},OU={eventAliasesOn:function(e){var t=e;t.addListener=t.listen=t.bind=t.on,t.unlisten=t.unbind=t.off=t.removeListener,t.trigger=t.emit,t.pon=t.promiseOn=function(e,t){var n=this,r=Array.prototype.slice.call(arguments,0);return new kB(function(e,t){var i=r.concat([function(t){n.off.apply(n,a),e(t)}]),a=i.concat([]);n.on.apply(n,i)})}}},kU={};[MB,DU,OU].forEach(function(e){EF(kU,e)});var AU={animate:kU.animate(),animation:kU.animation(),animated:kU.animated(),clearQueue:kU.clearQueue(),delay:kU.delay(),delayAnimation:kU.delayAnimation(),stop:kU.stop()},jU={classes:function(e){var t=this;if(e===void 0){var n=[];return t[0]._private.classes.forEach(function(e){return n.push(e)}),n}else YP(e)||(e=(e||``).match(/\S+/g)||[]);for(var r=[],i=new yL(e),a=0;a<t.length;a++){for(var o=t[a],s=o._private,c=s.classes,l=!1,u=0;u<e.length;u++){var d=e[u];if(!c.has(d)){l=!0;break}}l||=c.size!==e.length,l&&(s.classes=i,r.push(o))}return r.length>0&&this.spawn(r).updateStyle().emit(`class`),t},addClass:function(e){return this.toggleClass(e,!0)},hasClass:function(e){var t=this[0];return t!=null&&t._private.classes.has(e)},toggleClass:function(e,t){YP(e)||(e=e.match(/\S+/g)||[]);for(var n=this,r=t===void 0,i=[],a=0,o=n.length;a<o;a++)for(var s=n[a],c=s._private.classes,l=!1,u=0;u<e.length;u++){var d=e[u],f=c.has(d),p=!1;t||r&&!f?(c.add(d),p=!0):(!t||r&&f)&&(c.delete(d),p=!0),!l&&p&&(i.push(s),l=!0)}return i.length>0&&this.spawn(i).updateStyle().emit(`class`),n},removeClass:function(e){return this.toggleClass(e,!1)},flashClass:function(e,t){var n=this;if(t==null)t=250;else if(t===0)return n;return n.addClass(e),setTimeout(function(){n.removeClass(e)},t),n}};jU.className=jU.classNames=jU.classes;var MU={metaChar:`[\\!\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\\`\\{\\|\\}\\~]`,comparatorOp:`=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=`,boolOp:`\\?|\\!|\\^`,string:`"(?:\\\\"|[^"])*"|'(?:\\\\'|[^'])*'`,number:_F,meta:`degree|indegree|outdegree`,separator:`\\s*,\\s*`,descendant:`\\s+`,child:`\\s+>\\s+`,subject:`\\$`,group:`node|edge|\\*`,directedEdge:`\\s+->\\s+`,undirectedEdge:`\\s+<->\\s+`};MU.variable=`(?:[\\w-.]|(?:\\\\`+MU.metaChar+`))+`,MU.className=`(?:[\\w-]|(?:\\\\`+MU.metaChar+`))+`,MU.value=MU.string+`|`+MU.number,MU.id=MU.variable,(function(){var e=MU.comparatorOp.split(`|`),t,n;for(n=0;n<e.length;n++)t=e[n],MU.comparatorOp+=`|@`+t;for(e=MU.comparatorOp.split(`|`),n=0;n<e.length;n++)t=e[n],!(t.indexOf(`!`)>=0)&&t!==`=`&&(MU.comparatorOp+=`|\\!`+t)})();var NU=function(){return{checks:[]}},PU={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20},FU=[{selector:`:selected`,matches:function(e){return e.selected()}},{selector:`:unselected`,matches:function(e){return!e.selected()}},{selector:`:selectable`,matches:function(e){return e.selectable()}},{selector:`:unselectable`,matches:function(e){return!e.selectable()}},{selector:`:locked`,matches:function(e){return e.locked()}},{selector:`:unlocked`,matches:function(e){return!e.locked()}},{selector:`:visible`,matches:function(e){return e.visible()}},{selector:`:hidden`,matches:function(e){return!e.visible()}},{selector:`:transparent`,matches:function(e){return e.transparent()}},{selector:`:grabbed`,matches:function(e){return e.grabbed()}},{selector:`:free`,matches:function(e){return!e.grabbed()}},{selector:`:removed`,matches:function(e){return e.removed()}},{selector:`:inside`,matches:function(e){return!e.removed()}},{selector:`:grabbable`,matches:function(e){return e.grabbable()}},{selector:`:ungrabbable`,matches:function(e){return!e.grabbable()}},{selector:`:animated`,matches:function(e){return e.animated()}},{selector:`:unanimated`,matches:function(e){return!e.animated()}},{selector:`:parent`,matches:function(e){return e.isParent()}},{selector:`:childless`,matches:function(e){return e.isChildless()}},{selector:`:child`,matches:function(e){return e.isChild()}},{selector:`:orphan`,matches:function(e){return e.isOrphan()}},{selector:`:nonorphan`,matches:function(e){return e.isChild()}},{selector:`:compound`,matches:function(e){return e.isNode()?e.isParent():e.source().isParent()||e.target().isParent()}},{selector:`:loop`,matches:function(e){return e.isLoop()}},{selector:`:simple`,matches:function(e){return e.isSimple()}},{selector:`:active`,matches:function(e){return e.active()}},{selector:`:inactive`,matches:function(e){return!e.active()}},{selector:`:backgrounding`,matches:function(e){return e.backgrounding()}},{selector:`:nonbackgrounding`,matches:function(e){return!e.backgrounding()}}].sort(function(e,t){return TF(e.selector,t.selector)}),IU=function(){for(var e={},t,n=0;n<FU.length;n++)t=FU[n],e[t.selector]=t.matches;return e}(),LU=function(e,t){return IU[e](t)},RU=`(`+FU.map(function(e){return e.selector}).join(`|`)+`)`,zU=function(e){return e.replace(RegExp(`\\\\(`+MU.metaChar+`)`,`g`),function(e,t){return t})},BU=function(e,t,n){e[e.length-1]=n},VU=[{name:`group`,query:!0,regex:`(`+MU.group+`)`,populate:function(e,t,n){var r=PP(n,1)[0];t.checks.push({type:PU.GROUP,value:r===`*`?r:r+`s`})}},{name:`state`,query:!0,regex:RU,populate:function(e,t,n){var r=PP(n,1)[0];t.checks.push({type:PU.STATE,value:r})}},{name:`id`,query:!0,regex:`\\#(`+MU.id+`)`,populate:function(e,t,n){var r=PP(n,1)[0];t.checks.push({type:PU.ID,value:zU(r)})}},{name:`className`,query:!0,regex:`\\.(`+MU.className+`)`,populate:function(e,t,n){var r=PP(n,1)[0];t.checks.push({type:PU.CLASS,value:zU(r)})}},{name:`dataExists`,query:!0,regex:`\\[\\s*(`+MU.variable+`)\\s*\\]`,populate:function(e,t,n){var r=PP(n,1)[0];t.checks.push({type:PU.DATA_EXIST,field:zU(r)})}},{name:`dataCompare`,query:!0,regex:`\\[\\s*(`+MU.variable+`)\\s*(`+MU.comparatorOp+`)\\s*(`+MU.value+`)\\s*\\]`,populate:function(e,t,n){var r=PP(n,3),i=r[0],a=r[1],o=r[2];o=RegExp(`^`+MU.string+`$`).exec(o)==null?parseFloat(o):o.substring(1,o.length-1),t.checks.push({type:PU.DATA_COMPARE,field:zU(i),operator:a,value:o})}},{name:`dataBool`,query:!0,regex:`\\[\\s*(`+MU.boolOp+`)\\s*(`+MU.variable+`)\\s*\\]`,populate:function(e,t,n){var r=PP(n,2),i=r[0],a=r[1];t.checks.push({type:PU.DATA_BOOL,field:zU(a),operator:i})}},{name:`metaCompare`,query:!0,regex:`\\[\\[\\s*(`+MU.meta+`)\\s*(`+MU.comparatorOp+`)\\s*(`+MU.number+`)\\s*\\]\\]`,populate:function(e,t,n){var r=PP(n,3),i=r[0],a=r[1],o=r[2];t.checks.push({type:PU.META_COMPARE,field:zU(i),operator:a,value:parseFloat(o)})}},{name:`nextQuery`,separator:!0,regex:MU.separator,populate:function(e,t){var n=e.currentSubject,r=e.edgeCount,i=e.compoundCount,a=e[e.length-1];return n!=null&&(a.subject=n,e.currentSubject=null),a.edgeCount=r,a.compoundCount=i,e.edgeCount=0,e.compoundCount=0,e[e.length++]=NU()}},{name:`directedEdge`,separator:!0,regex:MU.directedEdge,populate:function(e,t){if(e.currentSubject==null){var n=NU(),r=t,i=NU();return n.checks.push({type:PU.DIRECTED_EDGE,source:r,target:i}),BU(e,t,n),e.edgeCount++,i}else{var a=NU(),o=t,s=NU();return a.checks.push({type:PU.NODE_SOURCE,source:o,target:s}),BU(e,t,a),e.edgeCount++,s}}},{name:`undirectedEdge`,separator:!0,regex:MU.undirectedEdge,populate:function(e,t){if(e.currentSubject==null){var n=NU(),r=t,i=NU();return n.checks.push({type:PU.UNDIRECTED_EDGE,nodes:[r,i]}),BU(e,t,n),e.edgeCount++,i}else{var a=NU(),o=t,s=NU();return a.checks.push({type:PU.NODE_NEIGHBOR,node:o,neighbor:s}),BU(e,t,a),s}}},{name:`child`,separator:!0,regex:MU.child,populate:function(e,t){if(e.currentSubject==null){var n=NU(),r=NU(),i=e[e.length-1];return n.checks.push({type:PU.CHILD,parent:i,child:r}),BU(e,t,n),e.compoundCount++,r}else if(e.currentSubject===t){var a=NU(),o=e[e.length-1],s=NU(),c=NU(),l=NU(),u=NU();return a.checks.push({type:PU.COMPOUND_SPLIT,left:o,right:s,subject:c}),c.checks=t.checks,t.checks=[{type:PU.TRUE}],u.checks.push({type:PU.TRUE}),s.checks.push({type:PU.PARENT,parent:u,child:l}),BU(e,o,a),e.currentSubject=c,e.compoundCount++,l}else{var d=NU(),f=NU(),p=[{type:PU.PARENT,parent:d,child:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}}},{name:`descendant`,separator:!0,regex:MU.descendant,populate:function(e,t){if(e.currentSubject==null){var n=NU(),r=NU(),i=e[e.length-1];return n.checks.push({type:PU.DESCENDANT,ancestor:i,descendant:r}),BU(e,t,n),e.compoundCount++,r}else if(e.currentSubject===t){var a=NU(),o=e[e.length-1],s=NU(),c=NU(),l=NU(),u=NU();return a.checks.push({type:PU.COMPOUND_SPLIT,left:o,right:s,subject:c}),c.checks=t.checks,t.checks=[{type:PU.TRUE}],u.checks.push({type:PU.TRUE}),s.checks.push({type:PU.ANCESTOR,ancestor:u,descendant:l}),BU(e,o,a),e.currentSubject=c,e.compoundCount++,l}else{var d=NU(),f=NU(),p=[{type:PU.ANCESTOR,ancestor:d,descendant:f}];return d.checks=t.checks,t.checks=p,e.compoundCount++,f}}},{name:`subject`,modifier:!0,regex:MU.subject,populate:function(e,t){if(e.currentSubject!=null&&e.currentSubject!==t)return rL("Redefinition of subject in selector `"+e.toString()+"`"),!1;e.currentSubject=t;var n=e[e.length-1].checks[0],r=n==null?null:n.type;r===PU.DIRECTED_EDGE?n.type=PU.NODE_TARGET:r===PU.UNDIRECTED_EDGE&&(n.type=PU.NODE_NEIGHBOR,n.node=n.nodes[1],n.neighbor=n.nodes[0],n.nodes=null)}}];VU.forEach(function(e){return e.regexObj=RegExp(`^`+e.regex)});var HU=function(e){for(var t,n,r,i=0;i<VU.length;i++){var a=VU[i],o=a.name,s=e.match(a.regexObj);if(s!=null){n=s,t=a,r=o;var c=s[0];e=e.substring(c.length);break}}return{expr:t,match:n,name:r,remaining:e}},UU=function(e){var t=e.match(/^\s+/);if(t){var n=t[0];e=e.substring(n.length)}return e},WU={parse:function(e){var t=this,n=t.inputText=e,r=t[0]=NU();for(t.length=1,n=UU(n);;){var i=HU(n);if(i.expr==null)return rL("The selector `"+e+"`is invalid"),!1;var a=i.match.slice(1),o=i.expr.populate(t,r,a);if(o===!1)return!1;if(o!=null&&(r=o),n=i.remaining,n.match(/^\s*$/))break}var s=t[t.length-1];t.currentSubject!=null&&(s.subject=t.currentSubject),s.edgeCount=t.edgeCount,s.compoundCount=t.compoundCount;for(var c=0;c<t.length;c++){var l=t[c];if(l.compoundCount>0&&l.edgeCount>0)return rL("The selector `"+e+"` is invalid because it uses both a compound selector and an edge selector"),!1;if(l.edgeCount>1)return rL("The selector `"+e+"` is invalid because it uses multiple edge selectors"),!1;l.edgeCount===1&&rL("The selector `"+e+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}return!0},toString:function(){if(this.toStringCache!=null)return this.toStringCache;for(var e=function(e){return e??``},t=function(t){return qP(t)?`"`+t+`"`:e(t)},n=function(e){return` `+e+` `},r=function(r,a){var o=r.type,s=r.value;switch(o){case PU.GROUP:var c=e(s);return c.substring(0,c.length-1);case PU.DATA_COMPARE:var l=r.field,u=r.operator;return`[`+l+n(e(u))+t(s)+`]`;case PU.DATA_BOOL:var d=r.operator,f=r.field;return`[`+e(d)+f+`]`;case PU.DATA_EXIST:return`[`+r.field+`]`;case PU.META_COMPARE:var p=r.operator;return`[[`+r.field+n(e(p))+t(s)+`]]`;case PU.STATE:return s;case PU.ID:return`#`+s;case PU.CLASS:return`.`+s;case PU.PARENT:case PU.CHILD:return i(r.parent,a)+n(`>`)+i(r.child,a);case PU.ANCESTOR:case PU.DESCENDANT:return i(r.ancestor,a)+` `+i(r.descendant,a);case PU.COMPOUND_SPLIT:var m=i(r.left,a),h=i(r.subject,a),g=i(r.right,a);return m+(m.length>0?` `:``)+h+g;case PU.TRUE:return``}},i=function(e,t){return e.checks.reduce(function(n,i,a){return n+(t===e&&a===0?`$`:``)+r(i,t)},``)},a=``,o=0;o<this.length;o++){var s=this[o];a+=i(s,s.subject),this.length>1&&o<this.length-1&&(a+=`, `)}return this.toStringCache=a,a}},GU=function(e,t,n){var r,i=qP(e),a=$(e),o=qP(n),s,c,l=!1,u=!1,d=!1;switch(t.indexOf(`!`)>=0&&(t=t.replace(`!`,``),u=!0),t.indexOf(`@`)>=0&&(t=t.replace(`@`,``),l=!0),(i||o||l)&&(s=!i&&!a?``:``+e,c=``+n),l&&(e=s=s.toLowerCase(),n=c=c.toLowerCase()),t){case`*=`:r=s.indexOf(c)>=0;break;case`$=`:r=s.indexOf(c,s.length-c.length)>=0;break;case`^=`:r=s.indexOf(c)===0;break;case`=`:r=e===n;break;case`>`:d=!0,r=e>n;break;case`>=`:d=!0,r=e>=n;break;case`<`:d=!0,r=e<n;break;case`<=`:d=!0,r=e<=n;break;default:r=!1;break}return u&&(e!=null||!d)&&(r=!r),r},KU=function(e,t){switch(t){case`?`:return!!e;case`!`:return!e;case`^`:return e===void 0}},qU=function(e){return e!==void 0},JU=function(e,t){return e.data(t)},YU=function(e,t){return e[t]()},XU=[],ZU=function(e,t){return e.checks.every(function(e){return XU[e.type](e,t)})};XU[PU.GROUP]=function(e,t){var n=e.value;return n===`*`||n===t.group()},XU[PU.STATE]=function(e,t){var n=e.value;return LU(n,t)},XU[PU.ID]=function(e,t){var n=e.value;return t.id()===n},XU[PU.CLASS]=function(e,t){var n=e.value;return t.hasClass(n)},XU[PU.META_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return GU(YU(t,n),r,i)},XU[PU.DATA_COMPARE]=function(e,t){var n=e.field,r=e.operator,i=e.value;return GU(JU(t,n),r,i)},XU[PU.DATA_BOOL]=function(e,t){var n=e.field,r=e.operator;return KU(JU(t,n),r)},XU[PU.DATA_EXIST]=function(e,t){var n=e.field;return e.operator,qU(JU(t,n))},XU[PU.UNDIRECTED_EDGE]=function(e,t){var n=e.nodes[0],r=e.nodes[1],i=t.source(),a=t.target();return ZU(n,i)&&ZU(r,a)||ZU(r,i)&&ZU(n,a)},XU[PU.NODE_NEIGHBOR]=function(e,t){return ZU(e.node,t)&&t.neighborhood().some(function(t){return t.isNode()&&ZU(e.neighbor,t)})},XU[PU.DIRECTED_EDGE]=function(e,t){return ZU(e.source,t.source())&&ZU(e.target,t.target())},XU[PU.NODE_SOURCE]=function(e,t){return ZU(e.source,t)&&t.outgoers().some(function(t){return t.isNode()&&ZU(e.target,t)})},XU[PU.NODE_TARGET]=function(e,t){return ZU(e.target,t)&&t.incomers().some(function(t){return t.isNode()&&ZU(e.source,t)})},XU[PU.CHILD]=function(e,t){return ZU(e.child,t)&&ZU(e.parent,t.parent())},XU[PU.PARENT]=function(e,t){return ZU(e.parent,t)&&t.children().some(function(t){return ZU(e.child,t)})},XU[PU.DESCENDANT]=function(e,t){return ZU(e.descendant,t)&&t.ancestors().some(function(t){return ZU(e.ancestor,t)})},XU[PU.ANCESTOR]=function(e,t){return ZU(e.ancestor,t)&&t.descendants().some(function(t){return ZU(e.descendant,t)})},XU[PU.COMPOUND_SPLIT]=function(e,t){return ZU(e.subject,t)&&ZU(e.left,t)&&ZU(e.right,t)},XU[PU.TRUE]=function(){return!0},XU[PU.COLLECTION]=function(e,t){return e.value.has(t)},XU[PU.FILTER]=function(e,t){var n=e.value;return n(t)};var QU={matches:function(e){for(var t=this,n=0;n<t.length;n++){var r=t[n];if(ZU(r,e))return!0}return!1},filter:function(e){var t=this;if(t.length===1&&t[0].checks.length===1&&t[0].checks[0].type===PU.ID)return e.getElementById(t[0].checks[0].value).collection();var n=function(e){for(var n=0;n<t.length;n++){var r=t[n];if(ZU(r,e))return!0}return!1};return t.text()??(n=function(){return!0}),e.filter(n)}},$U=function(e){this.inputText=e,this.currentSubject=null,this.compoundCount=0,this.edgeCount=0,this.length=0,e==null||qP(e)&&e.match(/^\s*$/)||(eF(e)?this.addQuery({checks:[{type:PU.COLLECTION,value:e.collection()}]}):JP(e)?this.addQuery({checks:[{type:PU.FILTER,value:e}]}):qP(e)?this.parse(e)||(this.invalid=!0):tL(`A selector must be created from a string; found `))},eW=$U.prototype;[WU,QU].forEach(function(e){return EF(eW,e)}),eW.text=function(){return this.inputText},eW.size=function(){return this.length},eW.eq=function(e){return this[e]},eW.sameText=function(e){return!this.invalid&&!e.invalid&&this.text()===e.text()},eW.addQuery=function(e){this[this.length++]=e},eW.selector=eW.toString;var tW={allAre:function(e){var t=new $U(e);return this.every(function(e){return t.matches(e)})},is:function(e){var t=new $U(e);return this.some(function(e){return t.matches(e)})},some:function(e,t){for(var n=0;n<this.length;n++)if(t?e.apply(t,[this[n],n,this]):e(this[n],n,this))return!0;return!1},every:function(e,t){for(var n=0;n<this.length;n++)if(!(t?e.apply(t,[this[n],n,this]):e(this[n],n,this)))return!1;return!0},same:function(e){if(this===e)return!0;e=this.cy().collection(e);var t=this.length;return t===e.length?t===1?this[0]===e[0]:this.every(function(t){return e.hasElementWithId(t.id())}):!1},anySame:function(e){return e=this.cy().collection(e),this.some(function(t){return e.hasElementWithId(t.id())})},allAreNeighbors:function(e){e=this.cy().collection(e);var t=this.neighborhood();return e.every(function(e){return t.hasElementWithId(e.id())})},contains:function(e){e=this.cy().collection(e);var t=this;return e.every(function(e){return t.hasElementWithId(e.id())})}};tW.allAreNeighbours=tW.allAreNeighbors,tW.has=tW.contains,tW.equal=tW.equals=tW.same;var nW=function(e,t){return function(n,r,i,a){var o=n,s=this,c;if(o==null?c=``:eF(o)&&o.length===1&&(c=o.id()),s.length===1&&c){var l=s[0]._private,u=l.traversalCache=l.traversalCache||{},d=u[t]=u[t]||[],f=VI(c);return d[f]||(d[f]=e.call(s,n,r,i,a))}else return e.call(s,n,r,i,a)}},rW={parent:function(e){var t=[];if(this.length===1){var n=this[0]._private.parent;if(n)return n}for(var r=0;r<this.length;r++){var i=this[r]._private.parent;i&&t.push(i)}return this.spawn(t,!0).filter(e)},parents:function(e){for(var t=[],n=this.parent();n.nonempty();){for(var r=0;r<n.length;r++){var i=n[r];t.push(i)}n=n.parent()}return this.spawn(t,!0).filter(e)},commonAncestors:function(e){for(var t,n=0;n<this.length;n++){var r=this[n].parents();t||=r,t=t.intersect(r)}return t.filter(e)},orphans:function(e){return this.stdFilter(function(e){return e.isOrphan()}).filter(e)},nonorphans:function(e){return this.stdFilter(function(e){return e.isChild()}).filter(e)},children:nW(function(e){for(var t=[],n=0;n<this.length;n++)for(var r=this[n]._private.children,i=0;i<r.length;i++)t.push(r[i]);return this.spawn(t,!0).filter(e)},`children`),siblings:function(e){return this.parent().children().not(this).filter(e)},isParent:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length!==0},isChildless:function(){var e=this[0];if(e)return e.isNode()&&e._private.children.length===0},isChild:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent!=null},isOrphan:function(){var e=this[0];if(e)return e.isNode()&&e._private.parent==null},descendants:function(e){var t=[];function n(e){for(var r=0;r<e.length;r++){var i=e[r];t.push(i),i.children().nonempty()&&n(i.children())}}return n(this.children()),this.spawn(t,!0).filter(e)}};function iW(e,t,n,r){for(var i=[],a=new yL,o=e.cy().hasCompoundNodes(),s=0;s<e.length;s++){var c=e[s];n?i.push(c):o&&r(i,a,c)}for(;i.length>0;){var l=i.shift();t(l),a.add(l.id()),o&&r(i,a,l)}return e}function aW(e,t,n){if(n.isParent())for(var r=n._private.children,i=0;i<r.length;i++){var a=r[i];t.has(a.id())||e.push(a)}}rW.forEachDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return iW(this,e,t,aW)};function oW(e,t,n){if(n.isChild()){var r=n._private.parent;t.has(r.id())||e.push(r)}}rW.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return iW(this,e,t,oW)};function sW(e,t,n){oW(e,t,n),aW(e,t,n)}rW.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return iW(this,e,t,sW)},rW.ancestors=rW.parents;var cW=lW={data:kU.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),removeData:kU.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,immutableKeys:{id:!0,source:!0,target:!0,parent:!0},updateStyle:!0}),scratch:kU.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:kU.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),rscratch:kU.data({field:`rscratch`,allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!0}),removeRscratch:kU.removeData({field:`rscratch`,triggerEvent:!1}),id:function(){var e=this[0];if(e)return e._private.data.id}},lW;cW.attr=cW.data,cW.removeAttr=cW.removeData;var uW=lW,dW={};function fW(e){return function(t){var n=this;if(t===void 0&&(t=!0),n.length!==0)if(n.isNode()&&!n.removed()){for(var r=0,i=n[0],a=i._private.edges,o=0;o<a.length;o++){var s=a[o];!t&&s.isLoop()||(r+=e(i,s))}return r}else return}}EF(dW,{degree:fW(function(e,t){return t.source().same(t.target())?2:1}),indegree:fW(function(e,t){return+!!t.target().same(e)}),outdegree:fW(function(e,t){return+!!t.source().same(e)})});function pW(e,t){return function(n){for(var r,i=this.nodes(),a=0;a<i.length;a++){var o=i[a][e](n);o!==void 0&&(r===void 0||t(o,r))&&(r=o)}return r}}EF(dW,{minDegree:pW(`degree`,function(e,t){return e<t}),maxDegree:pW(`degree`,function(e,t){return e>t}),minIndegree:pW(`indegree`,function(e,t){return e<t}),maxIndegree:pW(`indegree`,function(e,t){return e>t}),minOutdegree:pW(`outdegree`,function(e,t){return e<t}),maxOutdegree:pW(`outdegree`,function(e,t){return e>t})}),EF(dW,{totalDegree:function(e){for(var t=0,n=this.nodes(),r=0;r<n.length;r++)t+=n[r].degree(e);return t}});var mW,hW,gW=function(e,t,n){for(var r=0;r<e.length;r++){var i=e[r];if(!i.locked()){var a=i._private.position,o={x:t.x==null?0:t.x-a.x,y:t.y==null?0:t.y-a.y};i.isParent()&&!(o.x===0&&o.y===0)&&i.children().shift(o,n),i.dirtyBoundingBoxCache()}}},_W={field:`position`,bindingEvent:`position`,allowBinding:!0,allowSetting:!0,settingEvent:`position`,settingTriggersEvent:!0,triggerFnName:`emitAndNotify`,allowGetting:!0,validKeys:[`x`,`y`],beforeGet:function(e){e.updateCompoundBounds()},beforeSet:function(e,t){gW(e,t,!1)},onSet:function(e){e.dirtyCompoundBoundsCache()},canSet:function(e){return!e.locked()}};mW=hW={position:kU.data(_W),silentPosition:kU.data(EF({},_W,{allowBinding:!1,allowSetting:!0,settingTriggersEvent:!1,allowGetting:!1,beforeSet:function(e,t){gW(e,t,!0)},onSet:function(e){e.dirtyCompoundBoundsCache()}})),positions:function(e,t){if(XP(e))t?this.silentPosition(e):this.position(e);else if(JP(e)){var n=e,r=this.cy();r.startBatch();for(var i=0;i<this.length;i++){var a=this[i],o=void 0;(o=n(a,i))&&(t?a.silentPosition(o):a.position(o))}r.endBatch()}return this},silentPositions:function(e){return this.positions(e,!0)},shift:function(e,t,n){var r;if(XP(e)?(r={x:$(e.x)?e.x:0,y:$(e.y)?e.y:0},n=t):qP(e)&&$(t)&&(r={x:0,y:0},r[e]=t),r!=null){var i=this.cy();i.startBatch();for(var a=0;a<this.length;a++){var o=this[a];if(!(i.hasCompoundNodes()&&o.isChild()&&o.ancestors().anySame(this))){var s=o.position(),c={x:s.x+r.x,y:s.y+r.y};n?o.silentPosition(c):o.position(c)}}i.endBatch()}return this},silentShift:function(e,t){return XP(e)?this.shift(e,!0):qP(e)&&$(t)&&this.shift(e,t,!0),this},renderedPosition:function(e,t){var n=this[0],r=this.cy(),i=r.zoom(),a=r.pan(),o=XP(e)?e:void 0,s=o!==void 0||t!==void 0&&qP(e);if(n&&n.isNode())if(s)for(var c=0;c<this.length;c++){var l=this[c];t===void 0?o!==void 0&&l.position(KL(o,i,a)):l.position(e,(t-a[e])/i)}else return o=GL(n.position(),i,a),e===void 0?o:o[e];else if(!s)return;return this},relativePosition:function(e,t){var n=this[0],r=this.cy(),i=XP(e)?e:void 0,a=i!==void 0||t!==void 0&&qP(e),o=r.hasCompoundNodes();if(n&&n.isNode())if(a)for(var s=0;s<this.length;s++){var c=this[s],l=o?c.parent():null,u=l&&l.length>0,d=u;u&&(l=l[0]);var f=d?l.position():{x:0,y:0};t===void 0?i!==void 0&&c.position({x:i.x+f.x,y:i.y+f.y}):c.position(e,t+f[e])}else{var p=n.position(),m=o?n.parent():null,h=m&&m.length>0,g=h;h&&(m=m[0]);var _=g?m.position():{x:0,y:0};return i={x:p.x-_.x,y:p.y-_.y},e===void 0?i:i[e]}else if(!a)return;return this}},mW.modelPosition=mW.point=mW.position,mW.modelPositions=mW.points=mW.positions,mW.renderedPoint=mW.renderedPosition,mW.relativePoint=mW.relativePosition;var vW=hW,yW=bW={},bW;bW.renderedBoundingBox=function(e){var t=this.boundingBox(e),n=this.cy(),r=n.zoom(),i=n.pan(),a=t.x1*r+i.x,o=t.x2*r+i.x,s=t.y1*r+i.y,c=t.y2*r+i.y;return{x1:a,x2:o,y1:s,y2:c,w:o-a,h:c-s}},bW.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();return!t.styleEnabled()||!t.hasCompoundNodes()||this.forEachUp(function(t){if(t.isParent()){var n=t._private;n.compoundBoundsClean=!1,n.bbCache=null,e||t.emitAndNotify(`bounds`)}}),this},bW.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()||!e&&t.batching())return this;function n(e){if(!e.isParent())return;var t=e._private,n=e.children(),r=e.pstyle(`compound-sizing-wrt-labels`).value===`include`,i={width:{val:e.pstyle(`min-width`).pfValue,left:e.pstyle(`min-width-bias-left`),right:e.pstyle(`min-width-bias-right`)},height:{val:e.pstyle(`min-height`).pfValue,top:e.pstyle(`min-height-bias-top`),bottom:e.pstyle(`min-height-bias-bottom`)}},a=n.boundingBox({includeLabels:r,includeOverlays:!1,useCache:!1}),o=t.position;(a.w===0||a.h===0)&&(a={w:e.pstyle(`width`).pfValue,h:e.pstyle(`height`).pfValue},a.x1=o.x-a.w/2,a.x2=o.x+a.w/2,a.y1=o.y-a.h/2,a.y2=o.y+a.h/2);function s(e,t,n){var r=0,i=0,a=t+n;return e>0&&a>0&&(r=t/a*e,i=n/a*e),{biasDiff:r,biasComplementDiff:i}}function c(e,t,n,r){if(n.units===`%`)switch(r){case`width`:return e>0?n.pfValue*e:0;case`height`:return t>0?n.pfValue*t:0;case`average`:return e>0&&t>0?n.pfValue*(e+t)/2:0;case`min`:return e>0&&t>0?e>t?n.pfValue*t:n.pfValue*e:0;case`max`:return e>0&&t>0?e>t?n.pfValue*e:n.pfValue*t:0;default:return 0}else if(n.units===`px`)return n.pfValue;else return 0}var l=i.width.left.value;i.width.left.units===`px`&&i.width.val>0&&(l=l*100/i.width.val);var u=i.width.right.value;i.width.right.units===`px`&&i.width.val>0&&(u=u*100/i.width.val);var d=i.height.top.value;i.height.top.units===`px`&&i.height.val>0&&(d=d*100/i.height.val);var f=i.height.bottom.value;i.height.bottom.units===`px`&&i.height.val>0&&(f=f*100/i.height.val);var p=s(i.width.val-a.w,l,u),m=p.biasDiff,h=p.biasComplementDiff,g=s(i.height.val-a.h,d,f),_=g.biasDiff,v=g.biasComplementDiff;t.autoPadding=c(a.w,a.h,e.pstyle(`padding`),e.pstyle(`padding-relative-to`).value),t.autoWidth=Math.max(a.w,i.width.val),o.x=(-m+a.x1+a.x2+h)/2,t.autoHeight=Math.max(a.h,i.height.val),o.y=(-_+a.y1+a.y2+v)/2}for(var r=0;r<this.length;r++){var i=this[r],a=i._private;(!a.compoundBoundsClean||e)&&(n(i),t.batching()||(a.compoundBoundsClean=!0))}return this};var xW=function(e){return e===1/0||e===-1/0?0:e},SW=function(e,t,n,r,i){r-t===0||i-n===0||t==null||n==null||r==null||i==null||(e.x1=t<e.x1?t:e.x1,e.x2=r>e.x2?r:e.x2,e.y1=n<e.y1?n:e.y1,e.y2=i>e.y2?i:e.y2,e.w=e.x2-e.x1,e.h=e.y2-e.y1)},CW=function(e,t){return t==null?e:SW(e,t.x1,t.y1,t.x2,t.y2)},wW=function(e,t,n){return mL(e,t,n)},TW=function(e,t,n){if(!t.cy().headless()){var r=t._private,i=r.rstyle,a=i.arrowWidth/2,o=t.pstyle(n+`-arrow-shape`).value,s,c;if(o!==`none`){n===`source`?(s=i.srcX,c=i.srcY):n===`target`?(s=i.tgtX,c=i.tgtY):(s=i.midX,c=i.midY);var l=r.arrowBounds=r.arrowBounds||{},u=l[n]=l[n]||{};u.x1=s-a,u.y1=c-a,u.x2=s+a,u.y2=c+a,u.w=u.x2-u.x1,u.h=u.y2-u.y1,mR(u,1),SW(e,u.x1,u.y1,u.x2,u.y2)}}},EW=function(e,t,n){if(!t.cy().headless()){var r=n?n+`-`:``,i=t._private,a=i.rstyle;if(t.pstyle(r+`label`).strValue){var o=t.pstyle(`text-halign`),s=t.pstyle(`text-valign`),c=wW(a,`labelWidth`,n),l=wW(a,`labelHeight`,n),u=wW(a,`labelX`,n),d=wW(a,`labelY`,n),f=t.pstyle(r+`text-margin-x`).pfValue,p=t.pstyle(r+`text-margin-y`).pfValue,m=t.isEdge(),h=t.pstyle(r+`text-rotation`),g=t.pstyle(`text-outline-width`).pfValue,_=t.pstyle(`text-border-width`).pfValue/2,v=t.pstyle(`text-background-padding`).pfValue,y=2,b=l,x=c,S=x/2,C=b/2,w,T,E,D;if(m)w=u-S,T=u+S,E=d-C,D=d+C;else{switch(o.value){case`left`:w=u-x,T=u;break;case`center`:w=u-S,T=u+S;break;case`right`:w=u,T=u+x;break}switch(s.value){case`top`:E=d-b,D=d;break;case`center`:E=d-C,D=d+C;break;case`bottom`:E=d,D=d+b;break}}var O=f-Math.max(g,_)-v-y,k=f+Math.max(g,_)+v+y,A=p-Math.max(g,_)-v-y,j=p+Math.max(g,_)+v+y;w+=O,T+=k,E+=A,D+=j;var M=n||`main`,N=i.labelBounds,P=N[M]=N[M]||{};P.x1=w,P.y1=E,P.x2=T,P.y2=D,P.w=T-w,P.h=D-E,P.leftPad=O,P.rightPad=k,P.topPad=A,P.botPad=j;var F=m&&h.strValue===`autorotate`,I=h.pfValue!=null&&h.pfValue!==0;if(F||I){var L=F?wW(i.rstyle,`labelAngle`,n):h.pfValue,R=Math.cos(L),ee=Math.sin(L),z=(w+T)/2,B=(E+D)/2;if(!m){switch(o.value){case`left`:z=T;break;case`right`:z=w;break}switch(s.value){case`top`:B=D;break;case`bottom`:B=E;break}}var V=function(e,t){return e-=z,t-=B,{x:e*R-t*ee+z,y:e*ee+t*R+B}},H=V(w,E),te=V(w,D),ne=V(T,E),U=V(T,D);w=Math.min(H.x,te.x,ne.x,U.x),T=Math.max(H.x,te.x,ne.x,U.x),E=Math.min(H.y,te.y,ne.y,U.y),D=Math.max(H.y,te.y,ne.y,U.y)}var re=M+`Rot`,ie=N[re]=N[re]||{};ie.x1=w,ie.y1=E,ie.x2=T,ie.y2=D,ie.w=T-w,ie.h=D-E,SW(e,w,E,T,D),SW(i.labelBounds.all,w,E,T,D)}return e}},DW=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`outline-opacity`).value,r=t.pstyle(`outline-width`).value+t.pstyle(`outline-offset`).value;OW(e,t,n,r,`outside`,r/2)}},OW=function(e,t,n,r,i,a){if(!(n===0||r<=0||i===`inside`)){var o=t.cy().renderer(),s=o.nodeShapes[o.getNodeShape(t)];if(s){var c=t.position(),l=c.x,u=c.y,d=t.width(),f=t.height();s.hasMiterBounds?(i===`center`&&(r/=2),CW(e,s.miterBounds(l,u,d,f,r))):a!=null&&a>0&&hR(e,[a,a,a,a])}}},kW=function(e,t){if(!t.cy().headless()){var n=t.pstyle(`border-opacity`).value,r=t.pstyle(`border-width`).pfValue,i=t.pstyle(`border-position`).value;OW(e,t,n,r,i)}},AW=function(e,t){var n=e._private.cy,r=n.styleEnabled(),i=n.headless(),a=lR(),o=e._private,s=e.isNode(),c=e.isEdge(),l,u,d,f,p,m,h=o.rstyle,g=s&&r?e.pstyle(`bounds-expansion`).pfValue:[0],_=function(e){return e.pstyle(`display`).value!==`none`},v=!r||_(e)&&(!c||_(e.source())&&_(e.target()));if(v){var y=0,b=0;r&&t.includeOverlays&&(y=e.pstyle(`overlay-opacity`).value,y!==0&&(b=e.pstyle(`overlay-padding`).value));var x=0,S=0;r&&t.includeUnderlays&&(x=e.pstyle(`underlay-opacity`).value,x!==0&&(S=e.pstyle(`underlay-padding`).value));var C=Math.max(b,S),w=0,T=0;if(r&&(w=e.pstyle(`width`).pfValue,T=w/2),s&&t.includeNodes){var E=e.position();p=E.x,m=E.y;var D=e.outerWidth()/2,O=e.outerHeight()/2;l=p-D,u=p+D,d=m-O,f=m+O,SW(a,l,d,u,f),r&&DW(a,e),r&&t.includeOutlines&&!i&&DW(a,e),r&&kW(a,e)}else if(c&&t.includeEdges)if(r&&!i){var k=e.pstyle(`curve-style`).strValue;if(l=Math.min(h.srcX,h.midX,h.tgtX),u=Math.max(h.srcX,h.midX,h.tgtX),d=Math.min(h.srcY,h.midY,h.tgtY),f=Math.max(h.srcY,h.midY,h.tgtY),l-=T,u+=T,d-=T,f+=T,SW(a,l,d,u,f),k===`haystack`){var A=h.haystackPts;if(A&&A.length===2){if(l=A[0].x,d=A[0].y,u=A[1].x,f=A[1].y,l>u){var j=l;l=u,u=j}if(d>f){var M=d;d=f,f=M}SW(a,l-T,d-T,u+T,f+T)}}else if(k===`bezier`||k===`unbundled-bezier`||gF(k,`segments`)||gF(k,`taxi`)){var N;switch(k){case`bezier`:case`unbundled-bezier`:N=h.bezierPts;break;case`segments`:case`taxi`:case`round-segments`:case`round-taxi`:N=h.linePts;break}if(N!=null)for(var P=0;P<N.length;P++){var F=N[P];l=F.x-T,u=F.x+T,d=F.y-T,f=F.y+T,SW(a,l,d,u,f)}}}else{var I=e.source().position(),L=e.target().position();if(l=I.x,u=L.x,d=I.y,f=L.y,l>u){var R=l;l=u,u=R}if(d>f){var ee=d;d=f,f=ee}l-=T,u+=T,d-=T,f+=T,SW(a,l,d,u,f)}if(r&&t.includeEdges&&c&&(TW(a,e,`mid-source`),TW(a,e,`mid-target`),TW(a,e,`source`),TW(a,e,`target`)),r&&e.pstyle(`ghost`).value===`yes`){var z=e.pstyle(`ghost-offset-x`).pfValue,B=e.pstyle(`ghost-offset-y`).pfValue;SW(a,a.x1+z,a.y1+B,a.x2+z,a.y2+B)}var V=o.bodyBounds=o.bodyBounds||{};gR(V,a),hR(V,g),mR(V,1),r&&(l=a.x1,u=a.x2,d=a.y1,f=a.y2,SW(a,l-C,d-C,u+C,f+C));var H=o.overlayBounds=o.overlayBounds||{};gR(H,a),hR(H,g),mR(H,1);var te=o.labelBounds=o.labelBounds||{};te.all==null?te.all=lR():dR(te.all),r&&t.includeLabels&&(t.includeMainLabels&&EW(a,e,null),c&&(t.includeSourceLabels&&EW(a,e,`source`),t.includeTargetLabels&&EW(a,e,`target`)))}return a.x1=xW(a.x1),a.y1=xW(a.y1),a.x2=xW(a.x2),a.y2=xW(a.y2),a.w=xW(a.x2-a.x1),a.h=xW(a.y2-a.y1),a.w>0&&a.h>0&&v&&(hR(a,g),mR(a,1)),a},jW=function(e){var t=0,n=function(e){return+!!e<<t++},r=0;return r+=n(e.incudeNodes),r+=n(e.includeEdges),r+=n(e.includeLabels),r+=n(e.includeMainLabels),r+=n(e.includeSourceLabels),r+=n(e.includeTargetLabels),r+=n(e.includeOverlays),r+=n(e.includeOutlines),r},MW=function(e){var t=function(e){return Math.round(e)};if(e.isEdge()){var n=e.source().position(),r=e.target().position();return BI([t(n.x),t(n.y),t(r.x),t(r.y)])}else{var i=e.position();return BI([t(i.x),t(i.y)])}},NW=function(e,t){var n=e._private,r,i=e.isEdge(),a=(t==null?FW:jW(t))===FW;if(n.bbCache==null?(r=AW(e,PW),n.bbCache=r,n.bbCachePosKey=MW(e)):r=n.bbCache,!a){var o=e.isNode();r=lR(),(t.includeNodes&&o||t.includeEdges&&!o)&&(t.includeOverlays?CW(r,n.overlayBounds):CW(r,n.bodyBounds)),t.includeLabels&&(t.includeMainLabels&&(!i||t.includeSourceLabels&&t.includeTargetLabels)?CW(r,n.labelBounds.all):(t.includeMainLabels&&CW(r,n.labelBounds.mainRot),t.includeSourceLabels&&CW(r,n.labelBounds.sourceRot),t.includeTargetLabels&&CW(r,n.labelBounds.targetRot))),r.w=r.x2-r.x1,r.h=r.y2-r.y1}return r},PW={includeNodes:!0,includeEdges:!0,includeLabels:!0,includeMainLabels:!0,includeSourceLabels:!0,includeTargetLabels:!0,includeOverlays:!0,includeUnderlays:!0,includeOutlines:!0,useCache:!0},FW=jW(PW),IW=uL(PW);bW.boundingBox=function(e){var t,n=e===void 0||e.useCache===void 0||e.useCache===!0,r=dF(function(e){var t=e._private;return t.bbCache==null||t.styleDirty||t.bbCachePosKey!==MW(e)},function(e){return e.id()});if(n&&this.length===1&&!r(this[0]))e=e===void 0?PW:IW(e),t=NW(this[0],e);else{t=lR(),e||=PW;var i=IW(e),a=this,o=a.cy().styleEnabled();this.edges().forEach(r),this.nodes().forEach(r),o&&this.recalculateRenderedStyle(n),this.updateCompoundBounds(!n);for(var s=0;s<a.length;s++){var c=a[s];r(c)&&c.dirtyBoundingBoxCache(),CW(t,NW(c,i))}}return t.x1=xW(t.x1),t.y1=xW(t.y1),t.x2=xW(t.x2),t.y2=xW(t.y2),t.w=xW(t.x2-t.x1),t.h=xW(t.y2-t.y1),t},bW.dirtyBoundingBoxCache=function(){for(var e=0;e<this.length;e++){var t=this[e]._private;t.bbCache=null,t.bbCachePosKey=null,t.bodyBounds=null,t.overlayBounds=null,t.labelBounds.all=null,t.labelBounds.source=null,t.labelBounds.target=null,t.labelBounds.main=null,t.labelBounds.sourceRot=null,t.labelBounds.targetRot=null,t.labelBounds.mainRot=null,t.arrowBounds.source=null,t.arrowBounds.target=null,t.arrowBounds[`mid-source`]=null,t.arrowBounds[`mid-target`]=null}return this.emitAndNotify(`bounds`),this},bW.boundingBoxAt=function(e){var t=this.nodes(),n=this.cy(),r=n.hasCompoundNodes(),i=n.collection();if(r&&(i=t.filter(function(e){return e.isParent()}),t=t.not(i)),XP(e)){var a=e;e=function(){return a}}var o=function(t,n){return t._private.bbAtOldPos=e(t,n)},s=function(e){return e._private.bbAtOldPos};n.startBatch(),t.forEach(o).silentPositions(e),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0));var c=uR(this.boundingBox({useCache:!1}));return t.silentPositions(s),r&&(i.dirtyCompoundBoundsCache(),i.dirtyBoundingBoxCache(),i.updateCompoundBounds(!0)),n.endBatch(),c},yW.boundingbox=yW.bb=yW.boundingBox,yW.renderedBoundingbox=yW.renderedBoundingBox;var LW=bW,RW=zW={},zW,BW=function(e){e.uppercaseName=hF(e.name),e.autoName=`auto`+e.uppercaseName,e.labelName=`label`+e.uppercaseName,e.outerName=`outer`+e.uppercaseName,e.uppercaseOuterName=hF(e.outerName),RW[e.name]=function(){var t=this[0],n=t._private,r=n.cy._private.styleEnabled;if(t)if(r){if(t.isParent())return t.updateCompoundBounds(),n[e.autoName]||0;var i=t.pstyle(e.name);switch(i.strValue){case`label`:return t.recalculateRenderedStyle(),n.rstyle[e.labelName]||0;default:return i.pfValue}}else return 1},RW[`outer`+e.uppercaseName]=function(){var t=this[0],n=t._private.cy._private.styleEnabled;if(t)if(n){var r=t[e.name](),i=t.pstyle(`border-position`).value,a=i===`center`?t.pstyle(`border-width`).pfValue:i===`outside`?2*t.pstyle(`border-width`).pfValue:0,o=2*t.padding();return r+a+o}else return 1},RW[`rendered`+e.uppercaseName]=function(){var t=this[0];if(t)return t[e.name]()*this.cy().zoom()},RW[`rendered`+e.uppercaseOuterName]=function(){var t=this[0];if(t)return t[e.outerName]()*this.cy().zoom()}};BW({name:`width`}),BW({name:`height`}),zW.padding=function(){var e=this[0],t=e._private;return e.isParent()?(e.updateCompoundBounds(),t.autoPadding===void 0?e.pstyle(`padding`).pfValue:t.autoPadding):e.pstyle(`padding`).pfValue},zW.paddedHeight=function(){var e=this[0];return e.height()+2*e.padding()},zW.paddedWidth=function(){var e=this[0];return e.width()+2*e.padding()};var VW=zW,HW=function(e,t){if(e.isEdge()&&e.takesUpSpace())return t(e)},UW=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy();return GL(t(e),n.zoom(),n.pan())}},WW=function(e,t){if(e.isEdge()&&e.takesUpSpace()){var n=e.cy(),r=n.pan(),i=n.zoom();return t(e).map(function(e){return GL(e,i,r)})}},GW={controlPoints:{get:function(e){return e.renderer().getControlPoints(e)},mult:!0},segmentPoints:{get:function(e){return e.renderer().getSegmentPoints(e)},mult:!0},sourceEndpoint:{get:function(e){return e.renderer().getSourceEndpoint(e)}},targetEndpoint:{get:function(e){return e.renderer().getTargetEndpoint(e)}},midpoint:{get:function(e){return e.renderer().getEdgeMidpoint(e)}}},KW=function(e){return`rendered`+e[0].toUpperCase()+e.substr(1)},qW=EF({},vW,LW,VW,Object.keys(GW).reduce(function(e,t){var n=GW[t],r=KW(t);return e[t]=function(){return HW(this,n.get)},n.mult?e[r]=function(){return WW(this,n.get)}:e[r]=function(){return UW(this,n.get)},e},{})),JW=function(e,t){this.recycle(e,t)};function YW(){return!1}function XW(){return!0}JW.prototype={instanceString:function(){return`event`},recycle:function(e,t){if(this.isImmediatePropagationStopped=this.isPropagationStopped=this.isDefaultPrevented=YW,e!=null&&e.preventDefault?(this.type=e.type,this.isDefaultPrevented=e.defaultPrevented?XW:YW):e!=null&&e.type?t=e:this.type=e,t!=null&&(this.originalEvent=t.originalEvent,this.type=t.type==null?this.type:t.type,this.cy=t.cy,this.target=t.target,this.position=t.position,this.renderedPosition=t.renderedPosition,this.namespace=t.namespace,this.layout=t.layout),this.cy!=null&&this.position!=null&&this.renderedPosition==null){var n=this.position,r=this.cy.zoom(),i=this.cy.pan();this.renderedPosition={x:n.x*r+i.x,y:n.y*r+i.y}}this.timeStamp=e&&e.timeStamp||Date.now()},preventDefault:function(){this.isDefaultPrevented=XW;var e=this.originalEvent;e&&e.preventDefault&&e.preventDefault()},stopPropagation:function(){this.isPropagationStopped=XW;var e=this.originalEvent;e&&e.stopPropagation&&e.stopPropagation()},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=XW,this.stopPropagation()},isDefaultPrevented:YW,isPropagationStopped:YW,isImmediatePropagationStopped:YW};var ZW=/^([^.]+)(\.(?:[^.]+))?$/,QW=`.*`,$W={qualifierCompare:function(e,t){return e===t},eventMatches:function(){return!0},addEventFields:function(){},callbackContext:function(e){return e},beforeEmit:function(){},afterEmit:function(){},bubble:function(){return!1},parent:function(){return null},context:null},eG=Object.keys($W),tG={};function nG(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:tG,t=arguments.length>1?arguments[1]:void 0,n=0;n<eG.length;n++){var r=eG[n];this[r]=e[r]||$W[r]}this.context=t||this.context,this.listeners=[],this.emitting=0}var rG=nG.prototype,iG=function(e,t,n,r,i,a,o){JP(r)&&(i=r,r=null),o&&(a=a==null?o:EF({},a,o));for(var s=YP(n)?n:n.split(/\s+/),c=0;c<s.length;c++){var l=s[c];if(!oF(l)){var u=l.match(ZW);if(u){var d=u[1];if(t(e,l,d,u[2]?u[2]:null,r,i,a)===!1)break}}}},aG=function(e,t){return e.addEventFields(e.context,t),new JW(t.type,t)},oG=function(e,t,n){if(aF(n)){t(e,n);return}else if(XP(n)){t(e,aG(e,n));return}for(var r=YP(n)?n:n.split(/\s+/),i=0;i<r.length;i++){var a=r[i];if(!oF(a)){var o=a.match(ZW);if(o){var s=o[1];t(e,aG(e,{type:s,namespace:o[2]?o[2]:null,target:e.context}))}}}};rG.on=rG.addListener=function(e,t,n,r,i){return iG(this,function(e,t,n,r,i,a,o){JP(a)&&e.listeners.push({event:t,callback:a,type:n,namespace:r,qualifier:i,conf:o})},e,t,n,r,i),this},rG.one=function(e,t,n,r){return this.on(e,t,n,r,{one:!0})},rG.removeListener=rG.off=function(e,t,n,r){var i=this;this.emitting!==0&&(this.listeners=oL(this.listeners));for(var a=this.listeners,o=function(o){var s=a[o];iG(i,function(t,n,r,i,c,l){if((s.type===r||e===`*`)&&(!i&&s.namespace!==`.*`||s.namespace===i)&&(!c||t.qualifierCompare(s.qualifier,c))&&(!l||s.callback===l))return a.splice(o,1),!1},e,t,n,r)},s=a.length-1;s>=0;s--)o(s);return this},rG.removeAllListeners=function(){return this.removeListener(`*`)},rG.emit=rG.trigger=function(e,t,n){var r=this.listeners,i=r.length;return this.emitting++,YP(t)||(t=[t]),oG(this,function(e,a){n!=null&&(r=[{event:a.event,type:a.type,namespace:a.namespace,callback:n}],i=r.length);for(var o=function(){var n=r[s];if(n.type===a.type&&(!n.namespace||n.namespace===a.namespace||n.namespace===QW)&&e.eventMatches(e.context,n,a)){var i=[a];t!=null&&pL(i,t),e.beforeEmit(e.context,n,a),n.conf&&n.conf.one&&(e.listeners=e.listeners.filter(function(e){return e!==n}));var o=e.callbackContext(e.context,n,a),c=n.callback.apply(o,i);e.afterEmit(e.context,n,a),c===!1&&(a.stopPropagation(),a.preventDefault())}},s=0;s<i;s++)o();e.bubble(e.context)&&!a.isPropagationStopped()&&e.parent(e.context).emit(a,t)},e),this.emitting--,this};var sG={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null?!0:e!==n.target&&tF(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e.cy(),t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target},beforeEmit:function(e,t){t.conf&&t.conf.once&&t.conf.onceCollection.removeListener(t.event,t.qualifier,t.callback)},bubble:function(){return!0},parent:function(e){return e.isChild()?e.parent():e.cy()}},cG=function(e){return qP(e)?new $U(e):e},lG={createEmitter:function(){for(var e=0;e<this.length;e++){var t=this[e],n=t._private;n.emitter||=new nG(sG,t)}return this},emitter:function(){return this._private.emitter},on:function(e,t,n){for(var r=cG(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n);return this},removeListener:function(e,t,n){for(var r=cG(t),i=0;i<this.length;i++)this[i].emitter().removeListener(e,r,n);return this},removeAllListeners:function(){for(var e=0;e<this.length;e++)this[e].emitter().removeAllListeners();return this},one:function(e,t,n){for(var r=cG(t),i=0;i<this.length;i++)this[i].emitter().one(e,r,n);return this},once:function(e,t,n){for(var r=cG(t),i=0;i<this.length;i++)this[i].emitter().on(e,r,n,{once:!0,onceCollection:this})},emit:function(e,t){for(var n=0;n<this.length;n++)this[n].emitter().emit(e,t);return this},emitAndNotify:function(e,t){if(this.length!==0)return this.cy().notify(e,this),this.emit(e,t),this}};kU.eventAliasesOn(lG);var uG={nodes:function(e){return this.filter(function(e){return e.isNode()}).filter(e)},edges:function(e){return this.filter(function(e){return e.isEdge()}).filter(e)},byGroup:function(){for(var e=this.spawn(),t=this.spawn(),n=0;n<this.length;n++){var r=this[n];r.isNode()?e.push(r):t.push(r)}return{nodes:e,edges:t}},filter:function(e,t){if(e===void 0)return this;if(qP(e)||eF(e))return new $U(e).filter(this);if(JP(e)){for(var n=this.spawn(),r=this,i=0;i<r.length;i++){var a=r[i];(t?e.apply(t,[a,i,r]):e(a,i,r))&&n.push(a)}return n}return this.spawn()},not:function(e){if(e){qP(e)&&(e=this.filter(e));for(var t=this.spawn(),n=0;n<this.length;n++){var r=this[n];e.has(r)||t.push(r)}return t}else return this},absoluteComplement:function(){return this.cy().mutableElements().not(this)},intersect:function(e){if(qP(e)){var t=e;return this.filter(t)}for(var n=this.spawn(),r=this,i=e,a=this.length<e.length,o=a?r:i,s=a?i:r,c=0;c<o.length;c++){var l=o[c];s.has(l)&&n.push(l)}return n},xor:function(e){var t=this._private.cy;qP(e)&&(e=t.$(e));var n=this.spawn(),r=this,i=e,a=function(e,t){for(var r=0;r<e.length;r++){var i=e[r],a=i._private.data.id;t.hasElementWithId(a)||n.push(i)}};return a(r,i),a(i,r),n},diff:function(e){var t=this._private.cy;qP(e)&&(e=t.$(e));var n=this.spawn(),r=this.spawn(),i=this.spawn(),a=this,o=e,s=function(e,t,n){for(var r=0;r<e.length;r++){var a=e[r],o=a._private.data.id;t.hasElementWithId(o)?i.merge(a):n.push(a)}};return s(a,o,n),s(o,a,r),{left:n,right:r,both:i}},add:function(e){var t=this._private.cy;if(!e)return this;if(qP(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=this.spawnSelf(),i=0;i<e.length;i++){var a=e[i];this.has(a)||r.push(a)}return r},merge:function(e){var t=this._private,n=t.cy;if(!e)return this;if(e&&qP(e)){var r=e;e=n.mutableElements().filter(r)}for(var i=t.map,a=0;a<e.length;a++){var o=e[a],s=o._private.data.id;if(!i.has(s)){var c=this.length++;this[c]=o,i.set(s,{ele:o,index:c})}}return this},unmergeAt:function(e){var t=this[e].id(),n=this._private.map;this[e]=void 0,n.delete(t);var r=e===this.length-1;if(this.length>1&&!r){var i=this.length-1,a=this[i],o=a._private.data.id;this[i]=void 0,this[e]=a,n.set(o,{ele:a,index:e})}return this.length--,this},unmergeOne:function(e){e=e[0];var t=this._private,n=e._private.data.id,r=t.map.get(n);if(!r)return this;var i=r.index;return this.unmergeAt(i),this},unmerge:function(e){var t=this._private.cy;if(!e)return this;if(e&&qP(e)){var n=e;e=t.mutableElements().filter(n)}for(var r=0;r<e.length;r++)this.unmergeOne(e[r]);return this},unmergeBy:function(e){for(var t=this.length-1;t>=0;t--){var n=this[t];e(n)&&this.unmergeAt(t)}return this},map:function(e,t){for(var n=[],r=this,i=0;i<r.length;i++){var a=r[i],o=t?e.apply(t,[a,i,r]):e(a,i,r);n.push(o)}return n},reduce:function(e,t){for(var n=t,r=this,i=0;i<r.length;i++)n=e(n,r[i],i,r);return n},max:function(e,t){for(var n=-1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s>n&&(n=s,r=o)}return{value:n,ele:r}},min:function(e,t){for(var n=1/0,r,i=this,a=0;a<i.length;a++){var o=i[a],s=t?e.apply(t,[o,a,i]):e(o,a,i);s<n&&(n=s,r=o)}return{value:n,ele:r}}},dG=uG;dG.u=dG[`|`]=dG[`+`]=dG.union=dG.or=dG.add,dG[`\\`]=dG[`!`]=dG[`-`]=dG.difference=dG.relativeComplement=dG.subtract=dG.not,dG.n=dG[`&`]=dG[`.`]=dG.and=dG.intersection=dG.intersect,dG[`^`]=dG[`(+)`]=dG[`(-)`]=dG.symmetricDifference=dG.symdiff=dG.xor,dG.fnFilter=dG.filterFn=dG.stdFilter=dG.filter,dG.complement=dG.abscomp=dG.absoluteComplement;var fG={isNode:function(){return this.group()===`nodes`},isEdge:function(){return this.group()===`edges`},isLoop:function(){return this.isEdge()&&this.source()[0]===this.target()[0]},isSimple:function(){return this.isEdge()&&this.source()[0]!==this.target()[0]},group:function(){var e=this[0];if(e)return e._private.group}},pG=function(e,t){var n=e.cy().hasCompoundNodes();function r(e){var t=e.pstyle(`z-compound-depth`);return t.value===`auto`?n?e.zDepth():0:t.value===`bottom`?-1:t.value===`top`?XI:0}var i=r(e)-r(t);if(i!==0)return i;function a(e){return e.pstyle(`z-index-compare`).value===`auto`?+!!e.isNode():0}var o=a(e)-a(t);if(o!==0)return o;var s=e.pstyle(`z-index`).value-t.pstyle(`z-index`).value;return s===0?e.poolIndex()-t.poolIndex():s},mG={forEach:function(e,t){if(JP(e))for(var n=this.length,r=0;r<n;r++){var i=this[r];if((t?e.apply(t,[i,r,this]):e(i,r,this))===!1)break}return this},toArray:function(){for(var e=[],t=0;t<this.length;t++)e.push(this[t]);return e},slice:function(e,t){var n=[],r=this.length;t??=r,e??=0,e<0&&(e=r+e),t<0&&(t=r+t);for(var i=e;i>=0&&i<t&&i<r;i++)n.push(this[i]);return this.spawn(n)},size:function(){return this.length},eq:function(e){return this[e]||this.spawn()},first:function(){return this[0]||this.spawn()},last:function(){return this[this.length-1]||this.spawn()},empty:function(){return this.length===0},nonempty:function(){return!this.empty()},sort:function(e){if(!JP(e))return this;var t=this.toArray().sort(e);return this.spawn(t)},sortByZIndex:function(){return this.sort(pG)},zDepth:function(){var e=this[0];if(e){var t=e._private;if(t.group===`nodes`){var n=t.data.parent?e.parents().size():0;return e.isParent()?n:XI-1}else{var r=t.source,i=t.target,a=r.zDepth(),o=i.zDepth();return Math.max(a,o,0)}}}};mG.each=mG.forEach,(function(){var e=`undefined`;(typeof Symbol>`u`?`undefined`:RP(Symbol))!=e&&RP(Symbol.iterator)!=e&&(mG[Symbol.iterator]=function(){var e=this,t={value:void 0,done:!1},n=0,r=this.length;return kP({next:function(){return n<r?t.value=e[n++]:(t.value=void 0,t.done=!0),t}},Symbol.iterator,function(){return this})})})();var hG=uL({nodeDimensionsIncludeLabels:!1}),gG={layoutDimensions:function(e){e=hG(e);var t;if(!this.takesUpSpace())t={w:0,h:0};else if(e.nodeDimensionsIncludeLabels){var n=this.boundingBox();t={w:n.w,h:n.h}}else t={w:this.outerWidth(),h:this.outerHeight()};return(t.w===0||t.h===0)&&(t.w=t.h=1),t},layoutPositions:function(e,t,n){var r=this.nodes().filter(function(e){return!e.isParent()}),i=this.cy(),a=t.eles,o=function(e){return e.id()},s=dF(n,o);e.emit({type:`layoutstart`,layout:e}),e.animations=[];var c=function(e,t,n){var r={x:t.x1+t.w/2,y:t.y1+t.h/2},i={x:(n.x-r.x)*e,y:(n.y-r.y)*e};return{x:r.x+i.x,y:r.y+i.y}},l=t.spacingFactor&&t.spacingFactor!==1,u=function(){if(!l)return null;for(var e=lR(),t=0;t<r.length;t++){var n=r[t],i=s(n,t);pR(e,i.x,i.y)}return e}(),d=dF(function(e,n){var r=s(e,n);return l&&(r=c(Math.abs(t.spacingFactor),u,r)),t.transform!=null&&(r=t.transform(e,r)),r},o);if(t.animate){for(var f=0;f<r.length;f++){var p=r[f],m=d(p,f);if(t.animateFilter==null||t.animateFilter(p,f)){var h=p.animation({position:m,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(h)}else p.position(m)}if(t.fit){var g=i.animation({fit:{boundingBox:a.boundingBoxAt(d),padding:t.padding},duration:t.animationDuration,easing:t.animationEasing});e.animations.push(g)}else if(t.zoom!==void 0&&t.pan!==void 0){var _=i.animation({zoom:t.zoom,pan:t.pan,duration:t.animationDuration,easing:t.animationEasing});e.animations.push(_)}e.animations.forEach(function(e){return e.play()}),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),kB.all(e.animations.map(function(e){return e.promise()})).then(function(){e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e})})}else r.positions(d),t.fit&&i.fit(t.eles,t.padding),t.zoom!=null&&i.zoom(t.zoom),t.pan&&i.pan(t.pan),e.one(`layoutready`,t.ready),e.emit({type:`layoutready`,layout:e}),e.one(`layoutstop`,t.stop),e.emit({type:`layoutstop`,layout:e});return this},layout:function(e){return this.cy().makeLayout(EF({},e,{eles:this}))}};gG.createLayout=gG.makeLayout=gG.layout;function _G(e,t,n){var r=n._private,i=r.styleCache=r.styleCache||[],a;return(a=i[e])??(a=i[e]=t(n)),a}function vG(e,t){return e=VI(e),function(n){return _G(e,t,n)}}function yG(e,t){e=VI(e);var n=function(e){return t.call(e)};return function(){var t=this[0];if(t)return _G(e,n,t)}}var bG={recalculateRenderedStyle:function(e){var t=this.cy(),n=t.renderer(),r=t.styleEnabled();return n&&r&&n.recalculateRenderedStyle(this,e),this},dirtyStyleCache:function(){var e=this.cy(),t=function(e){return e._private.styleCache=null};if(e.hasCompoundNodes()){var n=this.spawnSelf().merge(this.descendants()).merge(this.parents());n.merge(n.connectedEdges()),n.forEach(t)}else this.forEach(function(e){t(e),e.connectedEdges().forEach(t)});return this},updateStyle:function(e){var t=this._private.cy;if(!t.styleEnabled())return this;if(t.batching())return t._private.batchStyleEles.merge(this),this;var n=t.hasCompoundNodes(),r=this;e=!!(e||e===void 0),n&&(r=this.spawnSelf().merge(this.descendants()).merge(this.parents()));var i=r;return e?i.emitAndNotify(`style`):i.emit(`style`),r.forEach(function(e){return e._private.styleDirty=!0}),this},cleanStyle:function(){var e=this.cy();if(e.styleEnabled())for(var t=0;t<this.length;t++){var n=this[t];n._private.styleDirty&&(n._private.styleDirty=!1,e.style().apply(n))}},parsedStyle:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this[0],r=n.cy();if(r.styleEnabled()&&n)return n._private.styleDirty&&(n._private.styleDirty=!1,r.style().apply(n)),n._private.style[e]??(t?r.style().getDefaultProperty(e):null)},numericStyle:function(e){var t=this[0];if(t.cy().styleEnabled()&&t){var n=t.pstyle(e);return n.pfValue===void 0?n.value:n.pfValue}},numericStyleUnits:function(e){var t=this[0];if(t.cy().styleEnabled()&&t)return t.pstyle(e).units},renderedStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=this[0];if(n)return t.style().getRenderedStyle(n,e)},style:function(e,t){var n=this.cy();if(!n.styleEnabled())return this;var r=!1,i=n.style();if(XP(e)){var a=e;i.applyBypass(this,a,r),this.emitAndNotify(`style`)}else if(qP(e))if(t===void 0){var o=this[0];return o?i.getStylePropertyValue(o,e):void 0}else i.applyBypass(this,e,t,r),this.emitAndNotify(`style`);else if(e===void 0){var s=this[0];return s?i.getRawStyle(s):void 0}return this},removeStyle:function(e){var t=this.cy();if(!t.styleEnabled())return this;var n=!1,r=t.style(),i=this;if(e===void 0)for(var a=0;a<i.length;a++){var o=i[a];r.removeAllBypasses(o,n)}else{e=e.split(/\s+/);for(var s=0;s<i.length;s++){var c=i[s];r.removeBypasses(c,e,n)}}return this.emitAndNotify(`style`),this},show:function(){return this.css(`display`,`element`),this},hide:function(){return this.css(`display`,`none`),this},effectiveOpacity:function(){var e=this.cy();if(!e.styleEnabled())return 1;var t=e.hasCompoundNodes(),n=this[0];if(n){var r=n._private,i=n.pstyle(`opacity`).value;if(!t)return i;var a=r.data.parent?n.parents():null;if(a)for(var o=0;o<a.length;o++)i=a[o].pstyle(`opacity`).value*i;return i}},transparent:function(){if(!this.cy().styleEnabled())return!1;var e=this[0],t=e.cy().hasCompoundNodes();if(e)return t?e.effectiveOpacity()===0:e.pstyle(`opacity`).value===0},backgrounding:function(){return this.cy().styleEnabled()?!!this[0]._private.backgrounding:!1}};function xG(e,t){var n=e._private.data.parent?e.parents():null;if(n)for(var r=0;r<n.length;r++){var i=n[r];if(!t(i))return!1}return!0}function SG(e){var t=e.ok,n=e.edgeOkViaNode||e.ok,r=e.parentOk||e.ok;return function(){var e=this.cy();if(!e.styleEnabled())return!0;var i=this[0],a=e.hasCompoundNodes();if(i){var o=i._private;if(!t(i))return!1;if(i.isNode())return!a||xG(i,r);var s=o.source,c=o.target;return n(s)&&(!a||xG(s,n))&&(s===c||n(c)&&(!a||xG(c,n)))}}}var CG=vG(`eleTakesUpSpace`,function(e){return e.pstyle(`display`).value===`element`&&e.width()!==0&&(e.isNode()?e.height()!==0:!0)});bG.takesUpSpace=yG(`takesUpSpace`,SG({ok:CG})),bG.interactive=yG(`interactive`,SG({ok:vG(`eleInteractive`,function(e){return e.pstyle(`events`).value===`yes`&&e.pstyle(`visibility`).value===`visible`&&CG(e)}),parentOk:vG(`parentInteractive`,function(e){return e.pstyle(`visibility`).value===`visible`&&CG(e)}),edgeOkViaNode:CG})),bG.noninteractive=function(){var e=this[0];if(e)return!e.interactive()},bG.visible=yG(`visible`,SG({ok:vG(`eleVisible`,function(e){return e.pstyle(`visibility`).value===`visible`&&e.pstyle(`opacity`).pfValue!==0&&CG(e)}),edgeOkViaNode:CG})),bG.hidden=function(){var e=this[0];if(e)return!e.visible()},bG.isBundledBezier=yG(`isBundledBezier`,function(){return this.cy().styleEnabled()?!this.removed()&&this.pstyle(`curve-style`).value===`bezier`&&this.takesUpSpace():!1}),bG.bypass=bG.css=bG.style,bG.renderedCss=bG.renderedStyle,bG.removeBypass=bG.removeCss=bG.removeStyle,bG.pstyle=bG.parsedStyle;var wG={};function TG(e){return function(){var t=arguments,n=[];if(t.length===2){var r=t[0],i=t[1];this.on(e.event,r,i)}else if(t.length===1&&JP(t[0])){var a=t[0];this.on(e.event,a)}else if(t.length===0||t.length===1&&YP(t[0])){for(var o=t.length===1?t[0]:null,s=0;s<this.length;s++){var c=this[s],l=!e.ableField||c._private[e.ableField],u=c._private[e.field]!=e.value;if(e.overrideAble){var d=e.overrideAble(c);if(d!==void 0&&(l=d,!d))return this}l&&(c._private[e.field]=e.value,u&&n.push(c))}var f=this.spawn(n);f.updateStyle(),f.emit(e.event),o&&f.emit(o)}return this}}function EG(e){wG[e.field]=function(){var t=this[0];if(t){if(e.overrideField){var n=e.overrideField(t);if(n!==void 0)return n}return t._private[e.field]}},wG[e.on]=TG({event:e.on,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!0}),wG[e.off]=TG({event:e.off,field:e.field,ableField:e.ableField,overrideAble:e.overrideAble,value:!1})}EG({field:`locked`,overrideField:function(e){return e.cy().autolock()?!0:void 0},on:`lock`,off:`unlock`}),EG({field:`grabbable`,overrideField:function(e){return e.cy().autoungrabify()||e.pannable()?!1:void 0},on:`grabify`,off:`ungrabify`}),EG({field:`selected`,ableField:`selectable`,overrideAble:function(e){return e.cy().autounselectify()?!1:void 0},on:`select`,off:`unselect`}),EG({field:`selectable`,overrideField:function(e){return e.cy().autounselectify()?!1:void 0},on:`selectify`,off:`unselectify`}),wG.deselect=wG.unselect,wG.grabbed=function(){var e=this[0];if(e)return e._private.grabbed},EG({field:`active`,on:`activate`,off:`unactivate`}),EG({field:`pannable`,on:`panify`,off:`unpanify`}),wG.inactive=function(){var e=this[0];if(e)return!e._private.active};var DG={},OG=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode()){for(var o=!1,s=a.connectedEdges(),c=0;c<s.length;c++){var l=s[c],u=l.source(),d=l.target();if(e.noIncomingEdges&&d===a&&u!==a||e.noOutgoingEdges&&u===a&&d!==a){o=!0;break}}o||r.push(a)}}return this.spawn(r,!0).filter(t)}},kG=function(e){return function(t){for(var n=this,r=[],i=0;i<n.length;i++){var a=n[i];if(a.isNode())for(var o=a.connectedEdges(),s=0;s<o.length;s++){var c=o[s],l=c.source(),u=c.target();e.outgoing&&l===a?(r.push(c),r.push(u)):e.incoming&&u===a&&(r.push(c),r.push(l))}}return this.spawn(r,!0).filter(t)}},AG=function(e){return function(t){for(var n=this,r=[],i={};;){var a=e.outgoing?n.outgoers():n.incomers();if(a.length===0)break;for(var o=!1,s=0;s<a.length;s++){var c=a[s],l=c.id();i[l]||(i[l]=!0,r.push(c),o=!0)}if(!o)break;n=a}return this.spawn(r,!0).filter(t)}};DG.clearTraversalCache=function(){for(var e=0;e<this.length;e++)this[e]._private.traversalCache=null},EF(DG,{roots:OG({noIncomingEdges:!0}),leaves:OG({noOutgoingEdges:!0}),outgoers:nW(kG({outgoing:!0}),`outgoers`),successors:AG({outgoing:!0}),incomers:nW(kG({incoming:!0}),`incomers`),predecessors:AG({})}),EF(DG,{neighborhood:nW(function(e){for(var t=[],n=this.nodes(),r=0;r<n.length;r++)for(var i=n[r],a=i.connectedEdges(),o=0;o<a.length;o++){var s=a[o],c=s.source(),l=s.target(),u=i===c?l:c;u.length>0&&t.push(u[0]),t.push(s[0])}return this.spawn(t,!0).filter(e)},`neighborhood`),closedNeighborhood:function(e){return this.neighborhood().add(this).filter(e)},openNeighborhood:function(e){return this.neighborhood(e)}}),DG.neighbourhood=DG.neighborhood,DG.closedNeighbourhood=DG.closedNeighborhood,DG.openNeighbourhood=DG.openNeighborhood,EF(DG,{source:nW(function(e){var t=this[0],n;return t&&(n=t._private.source||t.cy().collection()),n&&e?n.filter(e):n},`source`),target:nW(function(e){var t=this[0],n;return t&&(n=t._private.target||t.cy().collection()),n&&e?n.filter(e):n},`target`),sources:jG({attr:`source`}),targets:jG({attr:`target`})});function jG(e){return function(t){for(var n=[],r=0;r<this.length;r++){var i=this[r]._private[e.attr];i&&n.push(i)}return this.spawn(n,!0).filter(t)}}EF(DG,{edgesWith:nW(MG(),`edgesWith`),edgesTo:nW(MG({thisIsSrc:!0}),`edgesTo`)});function MG(e){return function(t){var n=[],r=this._private.cy,i=e||{};qP(t)&&(t=r.$(t));for(var a=0;a<t.length;a++)for(var o=t[a]._private.edges,s=0;s<o.length;s++){var c=o[s],l=c._private.data,u=this.hasElementWithId(l.source)&&t.hasElementWithId(l.target),d=t.hasElementWithId(l.source)&&this.hasElementWithId(l.target);(u||d)&&((i.thisIsSrc||i.thisIsTgt)&&(i.thisIsSrc&&!u||i.thisIsTgt&&!d)||n.push(c))}return this.spawn(n,!0)}}EF(DG,{connectedEdges:nW(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];if(i.isNode())for(var a=i._private.edges,o=0;o<a.length;o++){var s=a[o];t.push(s)}}return this.spawn(t,!0).filter(e)},`connectedEdges`),connectedNodes:nW(function(e){for(var t=[],n=this,r=0;r<n.length;r++){var i=n[r];i.isEdge()&&(t.push(i.source()[0]),t.push(i.target()[0]))}return this.spawn(t,!0).filter(e)},`connectedNodes`),parallelEdges:nW(NG(),`parallelEdges`),codirectedEdges:nW(NG({codirected:!0}),`codirectedEdges`)});function NG(e){return e=EF({},{codirected:!1},e),function(t){for(var n=[],r=this.edges(),i=e,a=0;a<r.length;a++)for(var o=r[a]._private,s=o.source,c=s._private.data.id,l=o.data.target,u=s._private.edges,d=0;d<u.length;d++){var f=u[d],p=f._private.data,m=p.target,h=p.source,g=m===l&&h===c,_=c===m&&l===h;(i.codirected&&g||!i.codirected&&(g||_))&&n.push(f)}return this.spawn(n,!0).filter(t)}}EF(DG,{components:function(e){var t=this,n=t.cy(),r=n.collection(),i=e==null?t.nodes():e.nodes(),a=[];e!=null&&i.empty()&&(i=e.sources());var o=function(e,t){r.merge(e),i.unmerge(e),t.merge(e)};if(i.empty())return t.spawn();var s=function(){var e=n.collection();a.push(e);var r=i[0];o(r,e),t.bfs({directed:!1,roots:r,visit:function(t){return o(t,e)}}),e.forEach(function(n){n.connectedEdges().forEach(function(n){t.has(n)&&e.has(n.source())&&e.has(n.target())&&e.merge(n)})})};do s();while(i.length>0);return a},component:function(){var e=this[0];return e.cy().mutableElements().components(e)[0]}}),DG.componentsOf=DG.components;var PG=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(e===void 0){tL(`A collection must have a reference to the core`);return}var i=new gL,a=!1;if(!t)t=[];else if(t.length>0&&XP(t[0])&&!tF(t[0])){a=!0;for(var o=[],s=new yL,c=0,l=t.length;c<l;c++){var u=t[c];u.data??={};var d=u.data;if(d.id==null)d.id=sL();else if(e.hasElementWithId(d.id)||s.has(d.id))continue;var f=new bL(e,u,!1);o.push(f),s.add(d.id)}t=o}this.length=0;for(var p=0,m=t.length;p<m;p++){var h=t[p][0];if(h!=null){var g=h._private.data.id;(!n||!i.has(g))&&(n&&i.set(g,{index:this.length,ele:h}),this[this.length]=h,this.length++)}}this._private={eles:this,cy:e,get map(){return this.lazyMap??this.rebuildMap(),this.lazyMap},set map(e){this.lazyMap=e},rebuildMap:function(){for(var e=this.lazyMap=new gL,t=this.eles,n=0;n<t.length;n++){var r=t[n];e.set(r.id(),{index:n,ele:r})}}},n&&(this._private.map=i),a&&!r&&this.restore()},FG=bL.prototype=PG.prototype=Object.create(Array.prototype);FG.instanceString=function(){return`collection`},FG.spawn=function(e,t){return new PG(this.cy(),e,t)},FG.spawnSelf=function(){return this.spawn(this)},FG.cy=function(){return this._private.cy},FG.renderer=function(){return this._private.cy.renderer()},FG.element=function(){return this[0]},FG.collection=function(){return nF(this)?this:new PG(this._private.cy,[this])},FG.unique=function(){return new PG(this._private.cy,this,!0)},FG.hasElementWithId=function(e){return e=``+e,this._private.map.has(e)},FG.getElementById=function(e){e=``+e;var t=this._private.cy,n=this._private.map.get(e);return n?n.ele:new PG(t)},FG.$id=FG.getElementById,FG.poolIndex=function(){var e=this._private.cy._private.elements,t=this[0]._private.data.id;return e._private.map.get(t).index},FG.indexOf=function(e){var t=e[0]._private.data.id;return this._private.map.get(t).index},FG.indexOfId=function(e){return e=``+e,this._private.map.get(e).index},FG.json=function(e){var t=this.element(),n=this.cy();if(t==null&&e)return this;if(t!=null){var r=t._private;if(XP(e)){if(n.startBatch(),e.data){t.data(e.data);var i=r.data;if(t.isEdge()){var a=!1,o={},s=e.data.source,c=e.data.target;s!=null&&s!=i.source&&(o.source=``+s,a=!0),c!=null&&c!=i.target&&(o.target=``+c,a=!0),a&&(t=t.move(o))}else{var l=`parent`in e.data,u=e.data.parent;l&&(u!=null||i.parent!=null)&&u!=i.parent&&(u===void 0&&(u=null),u!=null&&(u=``+u),t=t.move({parent:u}))}}e.position&&t.position(e.position);var d=function(n,i,a){var o=e[n];o!=null&&o!==r[n]&&(o?t[i]():t[a]())};return d(`removed`,`remove`,`restore`),d(`selected`,`select`,`unselect`),d(`selectable`,`selectify`,`unselectify`),d(`locked`,`lock`,`unlock`),d(`grabbable`,`grabify`,`ungrabify`),d(`pannable`,`panify`,`unpanify`),e.classes!=null&&t.classes(e.classes),n.endBatch(),this}else if(e===void 0){var f={data:aL(r.data),position:aL(r.position),group:r.group,removed:r.removed,selected:r.selected,selectable:r.selectable,locked:r.locked,grabbable:r.grabbable,pannable:r.pannable,classes:null};f.classes=``;var p=0;return r.classes.forEach(function(e){return f.classes+=p++===0?e:` `+e}),f}}},FG.jsons=function(){for(var e=[],t=0;t<this.length;t++){var n=this[t].json();e.push(n)}return e},FG.clone=function(){for(var e=this.cy(),t=[],n=0;n<this.length;n++){var r=new bL(e,this[n].json(),!1);t.push(r)}return new PG(e,t)},FG.copy=FG.clone,FG.restore=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=n.cy(),i=r._private,a=[],o=[],s,c=0,l=n.length;c<l;c++){var u=n[c];t&&!u.removed()||(u.isNode()?a.push(u):o.push(u))}s=a.concat(o);var d,f=function(){s.splice(d,1),d--};for(d=0;d<s.length;d++){var p=s[d],m=p._private,h=m.data;if(p.clearTraversalCache(),!(!t&&!m.removed)){if(h.id===void 0)h.id=sL();else if($(h.id))h.id=``+h.id;else if(oF(h.id)||!qP(h.id)){tL("Can not create element with invalid string ID `"+h.id+"`"),f();continue}else if(r.hasElementWithId(h.id)){tL("Can not create second element with ID `"+h.id+"`"),f();continue}}var g=h.id;if(p.isNode()){var _=m.position;_.x??=0,_.y??=0}if(p.isEdge()){for(var v=p,y=[`source`,`target`],b=y.length,x=!1,S=0;S<b;S++){var C=y[S],w=h[C];$(w)&&(w=h[C]=``+h[C]),w==null||w===``?(tL("Can not create edge `"+g+"` with unspecified "+C),x=!0):r.hasElementWithId(w)||(tL("Can not create edge `"+g+"` with nonexistent "+C+" `"+w+"`"),x=!0)}if(x){f();continue}var T=r.getElementById(h.source),E=r.getElementById(h.target);T.same(E)?T._private.edges.push(v):(T._private.edges.push(v),E._private.edges.push(v)),v._private.source=T,v._private.target=E}m.map=new gL,m.map.set(g,{ele:p,index:0}),m.removed=!1,t&&r.addToPool(p)}for(var D=0;D<a.length;D++){var O=a[D],k=O._private.data;$(k.parent)&&(k.parent=``+k.parent);var A=k.parent;if(A!=null||O._private.parent){var j=O._private.parent?r.collection().merge(O._private.parent):r.getElementById(A);if(j.empty())k.parent=void 0;else if(j[0].removed())rL(`Node added with missing parent, reference to parent removed`),k.parent=void 0,O._private.parent=null;else{for(var M=!1,N=j;!N.empty();){if(O.same(N)){M=!0,k.parent=void 0;break}N=N.parent()}M||(j[0]._private.children.push(O),O._private.parent=j[0],i.hasCompoundNodes=!0)}}}if(s.length>0){for(var P=s.length===n.length?n:new PG(r,s),F=0;F<P.length;F++){var I=P[F];I.isNode()||(I.parallelEdges().clearTraversalCache(),I.source().clearTraversalCache(),I.target().clearTraversalCache())}(i.hasCompoundNodes?r.collection().merge(P).merge(P.connectedNodes()).merge(P.parent()):P).dirtyCompoundBoundsCache().dirtyBoundingBoxCache().updateStyle(e),e?P.emitAndNotify(`add`):t&&P.emit(`add`)}return n},FG.removed=function(){var e=this[0];return e&&e._private.removed},FG.inside=function(){var e=this[0];return e&&!e._private.removed},FG.remove=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=this,r=[],i={},a=n._private.cy;function o(e){for(var t=e._private.edges,n=0;n<t.length;n++)c(t[n])}function s(e){for(var t=e._private.children,n=0;n<t.length;n++)c(t[n])}function c(e){var n=i[e.id()];t&&e.removed()||n||(i[e.id()]=!0,e.isNode()?(r.push(e),o(e),s(e)):r.unshift(e))}for(var l=0,u=n.length;l<u;l++){var d=n[l];c(d)}function f(e,t){var n=e._private.edges;dL(n,t),e.clearTraversalCache()}function p(e){e.clearTraversalCache()}var m=[];m.ids={};function h(e,t){t=t[0],e=e[0];var n=e._private.children,r=e.id();dL(n,t),t._private.parent=null,m.ids[r]||(m.ids[r]=!0,m.push(e))}n.dirtyCompoundBoundsCache(),t&&a.removeFromPool(r);for(var g=0;g<r.length;g++){var _=r[g];if(_.isEdge()){var v=_.source()[0],y=_.target()[0];f(v,_),f(y,_);for(var b=_.parallelEdges(),x=0;x<b.length;x++){var S=b[x];p(S),S.isBundledBezier()&&S.dirtyBoundingBoxCache()}}else{var C=_.parent();C.length!==0&&h(C,_)}t&&(_._private.removed=!0)}var w=a._private.elements;a._private.hasCompoundNodes=!1;for(var T=0;T<w.length;T++)if(w[T].isParent()){a._private.hasCompoundNodes=!0;break}var E=new PG(this.cy(),r);E.size()>0&&(e?E.emitAndNotify(`remove`):t&&E.emit(`remove`));for(var D=0;D<m.length;D++){var O=m[D];(!t||!O.removed())&&O.updateStyle()}return E},FG.move=function(e){var t=this._private.cy,n=this,r=!1,i=!1,a=function(e){return e==null?e:``+e};if(e.source!==void 0||e.target!==void 0){var o=a(e.source),s=a(e.target),c=o!=null&&t.hasElementWithId(o),l=s!=null&&t.hasElementWithId(s);(c||l)&&(t.batch(function(){n.remove(r,i),n.emitAndNotify(`moveout`);for(var e=0;e<n.length;e++){var t=n[e],a=t._private.data;t.isEdge()&&(c&&(a.source=o),l&&(a.target=s))}n.restore(r,i)}),n.emitAndNotify(`move`))}else if(e.parent!==void 0){var u=a(e.parent);if(u===null||t.hasElementWithId(u)){var d=u===null?void 0:u;t.batch(function(){var e=n.remove(r,i);e.emitAndNotify(`moveout`);for(var t=0;t<n.length;t++){var a=n[t],o=a._private.data;a.isNode()&&(o.parent=d)}e.restore(r,i)}),n.emitAndNotify(`move`)}}return this},[yB,AU,jU,tW,rW,uW,dW,qW,lG,uG,fG,mG,gG,bG,wG,DG].forEach(function(e){EF(FG,e)});var IG={add:function(e){var t,n=this;if(eF(e)){var r=e;if(r._private.cy===n)t=r.restore();else{for(var i=[],a=0;a<r.length;a++){var o=r[a];i.push(o.json())}t=new PG(n,i)}}else if(YP(e))t=new PG(n,e);else if(XP(e)&&(YP(e.nodes)||YP(e.edges))){for(var s=e,c=[],l=[`nodes`,`edges`],u=0,d=l.length;u<d;u++){var f=l[u],p=s[f];if(YP(p))for(var m=0,h=p.length;m<h;m++){var g=EF({group:f},p[m]);c.push(g)}}t=new PG(n,c)}else t=new bL(n,e).collection();return t},remove:function(e){if(!eF(e)&&qP(e)){var t=e;e=this.$(t)}return e.remove()}};function LG(e,t,n,r){var i=4,a=.001,o=1e-7,s=10,c=11,l=1/(c-1),u=typeof Float32Array<`u`;if(arguments.length!==4)return!1;for(var d=0;d<4;++d)if(typeof arguments[d]!=`number`||isNaN(arguments[d])||!isFinite(arguments[d]))return!1;e=Math.min(e,1),n=Math.min(n,1),e=Math.max(e,0),n=Math.max(n,0);var f=u?new Float32Array(c):Array(c);function p(e,t){return 1-3*t+3*e}function m(e,t){return 3*t-6*e}function h(e){return 3*e}function g(e,t,n){return((p(t,n)*e+m(t,n))*e+h(t))*e}function _(e,t,n){return 3*p(t,n)*e*e+2*m(t,n)*e+h(t)}function v(t,r){for(var a=0;a<i;++a){var o=_(r,e,n);if(o===0)return r;var s=g(r,e,n)-t;r-=s/o}return r}function y(){for(var t=0;t<c;++t)f[t]=g(t*l,e,n)}function b(t,r,i){var a,c,l=0;do c=r+(i-r)/2,a=g(c,e,n)-t,a>0?i=c:r=c;while(Math.abs(a)>o&&++l<s);return c}function x(t){for(var r=0,i=1,o=c-1;i!==o&&f[i]<=t;++i)r+=l;--i;var s=(t-f[i])/(f[i+1]-f[i]),u=r+s*l,d=_(u,e,n);return d>=a?v(t,u):d===0?u:b(t,r,r+l)}var S=!1;function C(){S=!0,(e!==t||n!==r)&&y()}var w=function(i){return S||C(),e===t&&n===r?i:i===0?0:i===1?1:g(x(i),t,r)};w.getControlPoints=function(){return[{x:e,y:t},{x:n,y:r}]};var T=`generateBezier(`+[e,t,n,r]+`)`;return w.toString=function(){return T},w}var RG=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,n,r){var i={x:t.x+r.dx*n,v:t.v+r.dv*n,tension:t.tension,friction:t.friction};return{dx:i.v,dv:e(i)}}function n(n,r){var i={dx:n.v,dv:e(n)},a=t(n,r*.5,i),o=t(n,r*.5,a),s=t(n,r,o),c=1/6*(i.dx+2*(a.dx+o.dx)+s.dx),l=1/6*(i.dv+2*(a.dv+o.dv)+s.dv);return n.x+=c*r,n.v+=l*r,n}return function e(t,r,i){var a={x:-1,v:0,tension:null,friction:null},o=[0],s=0,c=1/1e4,l=16/1e3,u,d,f;for(t=parseFloat(t)||500,r=parseFloat(r)||20,i||=null,a.tension=t,a.friction=r,u=i!==null,u?(s=e(t,r),d=s/i*l):d=l;f=n(f||a,d),o.push(1+f.x),s+=16,Math.abs(f.x)>c&&Math.abs(f.v)>c;);return u?function(e){return o[e*(o.length-1)|0]}:s}}(),zG=function(e,t,n,r){var i=LG(e,t,n,r);return function(e,t,n){return e+(t-e)*i(n)}},BG={linear:function(e,t,n){return e+(t-e)*n},ease:zG(.25,.1,.25,1),"ease-in":zG(.42,0,1,1),"ease-out":zG(0,0,.58,1),"ease-in-out":zG(.42,0,.58,1),"ease-in-sine":zG(.47,0,.745,.715),"ease-out-sine":zG(.39,.575,.565,1),"ease-in-out-sine":zG(.445,.05,.55,.95),"ease-in-quad":zG(.55,.085,.68,.53),"ease-out-quad":zG(.25,.46,.45,.94),"ease-in-out-quad":zG(.455,.03,.515,.955),"ease-in-cubic":zG(.55,.055,.675,.19),"ease-out-cubic":zG(.215,.61,.355,1),"ease-in-out-cubic":zG(.645,.045,.355,1),"ease-in-quart":zG(.895,.03,.685,.22),"ease-out-quart":zG(.165,.84,.44,1),"ease-in-out-quart":zG(.77,0,.175,1),"ease-in-quint":zG(.755,.05,.855,.06),"ease-out-quint":zG(.23,1,.32,1),"ease-in-out-quint":zG(.86,0,.07,1),"ease-in-expo":zG(.95,.05,.795,.035),"ease-out-expo":zG(.19,1,.22,1),"ease-in-out-expo":zG(1,0,0,1),"ease-in-circ":zG(.6,.04,.98,.335),"ease-out-circ":zG(.075,.82,.165,1),"ease-in-out-circ":zG(.785,.135,.15,.86),spring:function(e,t,n){if(n===0)return BG.linear;var r=RG(e,t,n);return function(e,t,n){return e+(t-e)*r(n)}},"cubic-bezier":zG};function VG(e,t,n,r,i){if(r===1||t===n)return n;var a=i(t,n,r);return e==null?a:((e.roundValue||e.color)&&(a=Math.round(a)),e.min!==void 0&&(a=Math.max(a,e.min)),e.max!==void 0&&(a=Math.min(a,e.max)),a)}function HG(e,t){return e.pfValue!=null||e.value!=null?e.pfValue!=null&&(t==null||t.type.units!==`%`)?e.pfValue:e.value:e}function UG(e,t,n,r,i){var a=i==null?null:i.type;n<0?n=0:n>1&&(n=1);var o=HG(e,i),s=HG(t,i);if($(o)&&$(s))return VG(a,o,s,n,r);if(YP(o)&&YP(s)){for(var c=[],l=0;l<s.length;l++){var u=o[l],d=s[l];if(u!=null&&d!=null){var f=VG(a,u,d,n,r);c.push(f)}else c.push(d)}return c}}function WG(e,t,n,r){var i=!r,a=e._private,o=t._private,s=o.easing,c=o.startTime,l=(r?e:e.cy()).style();if(!o.easingImpl)if(s==null)o.easingImpl=BG.linear;else{var u=qP(s)?l.parse(`transition-timing-function`,s).value:s,d,f;qP(u)?(d=u,f=[]):(d=u[1],f=u.slice(2).map(function(e){return+e})),f.length>0?(d===`spring`&&f.push(o.duration),o.easingImpl=BG[d].apply(null,f)):o.easingImpl=BG[d]}var p=o.easingImpl,m=o.duration===0?1:(n-c)/o.duration;if(o.applying&&(m=o.progress),m<0?m=0:m>1&&(m=1),o.delay==null){var h=o.startPosition,g=o.position;if(g&&i&&!e.locked()){var _={};GG(h.x,g.x)&&(_.x=UG(h.x,g.x,m,p)),GG(h.y,g.y)&&(_.y=UG(h.y,g.y,m,p)),e.position(_)}var v=o.startPan,y=o.pan,b=a.pan,x=y!=null&&r;x&&(GG(v.x,y.x)&&(b.x=UG(v.x,y.x,m,p)),GG(v.y,y.y)&&(b.y=UG(v.y,y.y,m,p)),e.emit(`pan`));var S=o.startZoom,C=o.zoom,w=C!=null&&r;w&&(GG(S,C)&&(a.zoom=cR(a.minZoom,UG(S,C,m,p),a.maxZoom)),e.emit(`zoom`)),(x||w)&&e.emit(`viewport`);var T=o.style;if(T&&T.length>0&&i){for(var E=0;E<T.length;E++){var D=T[E],O=D.name,k=D,A=o.startStyle[O],j=l.properties[A.name],M=UG(A,k,m,p,j);l.overrideBypass(e,O,M)}e.emit(`style`)}}return o.progress=m,m}function GG(e,t){return e==null||t==null?!1:$(e)&&$(t)?!0:!!(e&&t)}function KG(e,t,n,r){var i=t._private;i.started=!0,i.startTime=n-i.progress*i.duration}function qG(e,t){var n=t._private.aniEles,r=[];function i(t,n){var i=t._private,a=i.animation.current,o=i.animation.queue,s=!1;if(a.length===0){var c=o.shift();c&&a.push(c)}for(var l=function(e){for(var t=e.length-1;t>=0;t--){var n=e[t];n()}e.splice(0,e.length)},u=a.length-1;u>=0;u--){var d=a[u],f=d._private;if(f.stopped){a.splice(u,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.frames);continue}!f.playing&&!f.applying||(f.playing&&f.applying&&(f.applying=!1),f.started||KG(t,d,e),WG(t,d,e,n),f.applying&&=!1,l(f.frames),f.step!=null&&f.step(e),d.completed()&&(a.splice(u,1),f.hooked=!1,f.playing=!1,f.started=!1,l(f.completes)),s=!0)}return!n&&a.length===0&&o.length===0&&r.push(t),s}for(var a=!1,o=0;o<n.length;o++){var s=n[o],c=i(s);a||=c}var l=i(t,!0);(a||l)&&(n.length>0?t.notify(`draw`,n):t.notify(`draw`)),n.unmerge(r),t.emit(`step`)}var JG={animate:kU.animate(),animation:kU.animation(),animated:kU.animated(),clearQueue:kU.clearQueue(),delay:kU.delay(),delayAnimation:kU.delayAnimation(),stop:kU.stop(),addToAnimationPool:function(e){var t=this;t.styleEnabled()&&t._private.aniEles.merge(e)},stopAnimationLoop:function(){this._private.animationsRunning=!1},startAnimationLoop:function(){var e=this;if(e._private.animationsRunning=!0,!e.styleEnabled())return;function t(){e._private.animationsRunning&&kI(function(n){qG(n,e),t()})}var n=e.renderer();n&&n.beforeRender?n.beforeRender(function(t,n){qG(n,e)},n.beforeRenderPriorities.animations):t()}},YG={qualifierCompare:function(e,t){return e==null||t==null?e==null&&t==null:e.sameText(t)},eventMatches:function(e,t,n){var r=t.qualifier;return r==null?!0:e!==n.target&&tF(n.target)&&r.matches(n.target)},addEventFields:function(e,t){t.cy=e,t.target=e},callbackContext:function(e,t,n){return t.qualifier==null?e:n.target}},XG=function(e){return qP(e)?new $U(e):e},ZG={createEmitter:function(){var e=this._private;return e.emitter||=new nG(YG,this),this},emitter:function(){return this._private.emitter},on:function(e,t,n){return this.emitter().on(e,XG(t),n),this},removeListener:function(e,t,n){return this.emitter().removeListener(e,XG(t),n),this},removeAllListeners:function(){return this.emitter().removeAllListeners(),this},one:function(e,t,n){return this.emitter().one(e,XG(t),n),this},once:function(e,t,n){return this.emitter().one(e,XG(t),n),this},emit:function(e,t){return this.emitter().emit(e,t),this},emitAndNotify:function(e,t){return this.emit(e),this.notify(e,t),this}};kU.eventAliasesOn(ZG);var QG={png:function(e){var t=this._private.renderer;return e||={},t.png(e)},jpg:function(e){var t=this._private.renderer;return e||={},e.bg=e.bg||`#fff`,t.jpg(e)}};QG.jpeg=QG.jpg;var $G={layout:function(e){var t=this;if(e==null){tL(`Layout options must be specified to make a layout`);return}if(e.name==null){tL("A `name` must be specified to make a layout");return}var n=e.name,r=t.extension(`layout`,n);if(r==null){tL("No such layout `"+n+"` found. Did you forget to import it and `cytoscape.use()` it?");return}return new r(EF({},e,{cy:t,eles:qP(e.eles)?t.$(e.eles):e.eles==null?t.$():e.eles}))}};$G.createLayout=$G.makeLayout=$G.layout;var eK={notify:function(e,t){var n=this._private;if(this.batching()){n.batchNotifications=n.batchNotifications||{};var r=n.batchNotifications[e]=n.batchNotifications[e]||this.collection();t!=null&&r.merge(t);return}if(n.notificationsEnabled){var i=this.renderer();this.destroyed()||!i||i.notify(e,t)}},notifications:function(e){var t=this._private;return e===void 0?t.notificationsEnabled:(t.notificationsEnabled=!!e,this)},noNotifications:function(e){this.notifications(!1),e(),this.notifications(!0)},batching:function(){return this._private.batchCount>0},startBatch:function(){var e=this._private;return e.batchCount??=0,e.batchCount===0&&(e.batchStyleEles=this.collection(),e.batchNotifications={}),e.batchCount++,this},endBatch:function(){var e=this._private;if(e.batchCount===0)return this;if(e.batchCount--,e.batchCount===0){e.batchStyleEles.updateStyle();var t=this.renderer();Object.keys(e.batchNotifications).forEach(function(n){var r=e.batchNotifications[n];r.empty()?t.notify(n):t.notify(n,r)})}return this},batch:function(e){return this.startBatch(),e(),this.endBatch(),this},batchData:function(e){var t=this;return this.batch(function(){for(var n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],a=e[i];t.getElementById(i).data(a)}})}},tK=uL({hideEdgesOnViewport:!1,textureOnViewport:!1,motionBlur:!1,motionBlurOpacity:.05,pixelRatio:void 0,desktopTapThreshold:4,touchTapThreshold:8,wheelSensitivity:1,debug:!1,showFps:!1,webgl:!1,webglDebug:!1,webglDebugShowAtlases:!1,webglTexSize:2048,webglTexRows:36,webglTexRowsNodes:18,webglBatchSize:2048,webglTexPerBatch:14,webglBgColor:[255,255,255]}),nK={renderTo:function(e,t,n,r){return this._private.renderer.renderTo(e,t,n,r),this},renderer:function(){return this._private.renderer},forceRender:function(){return this.notify(`draw`),this},resize:function(){return this.invalidateSize(),this.emitAndNotify(`resize`),this},initRenderer:function(e){var t=this,n=t.extension(`renderer`,e.name);if(n==null){tL(`Can not initialise: No such renderer \`${e.name}\` found. Did you forget to import it and \`cytoscape.use()\` it?`);return}e.wheelSensitivity!==void 0&&rL(`You have set a custom wheel sensitivity. This will make your app zoom unnaturally when using mainstream mice. You should change this value from the default only if you can guarantee that all your users will use the same hardware and OS configuration as your current machine.`);var r=tK(e);r.cy=t,t._private.renderer=new n(r),this.notify(`init`)},destroyRenderer:function(){var e=this;e.notify(`destroy`);var t=e.container();if(t)for(t._cyreg=null;t.childNodes.length>0;)t.removeChild(t.childNodes[0]);e._private.renderer=null,e.mutableElements().forEach(function(e){var t=e._private;t.rscratch={},t.rstyle={},t.animation.current=[],t.animation.queue=[]})},onRender:function(e){return this.on(`render`,e)},offRender:function(e){return this.off(`render`,e)}};nK.invalidateDimensions=nK.resize;var rK={collection:function(e,t){return qP(e)?this.$(e):eF(e)?e.collection():YP(e)?(t||={},new PG(this,e,t.unique,t.removed)):new PG(this)},nodes:function(e){var t=this.$(function(e){return e.isNode()});return e?t.filter(e):t},edges:function(e){var t=this.$(function(e){return e.isEdge()});return e?t.filter(e):t},$:function(e){var t=this._private.elements;return e?t.filter(e):t.spawnSelf()},mutableElements:function(){return this._private.elements}};rK.elements=rK.filter=rK.$;var iK={},aK=`t`,oK=`f`;iK.apply=function(e){for(var t=this,n=t._private.cy.collection(),r=0;r<e.length;r++){var i=e[r],a=t.getContextMeta(i);if(!a.empty){var o=t.getContextStyle(a),s=t.applyContextStyle(a,o,i);i._private.appliedInitStyle?t.updateTransitions(i,s.diffProps):i._private.appliedInitStyle=!0,t.updateStyleHints(i)&&n.push(i)}}return n},iK.getPropertiesDiff=function(e,t){var n=this,r=n._private.propDiffs=n._private.propDiffs||{},i=e+`-`+t,a=r[i];if(a)return a;for(var o=[],s={},c=0;c<n.length;c++){var l=n[c],u=e[c]===aK,d=t[c]===aK,f=u!==d,p=l.mappedProperties.length>0;if(f||d&&p){var m=void 0;f&&p||f?m=l.properties:p&&(m=l.mappedProperties);for(var h=0;h<m.length;h++){for(var g=m[h],_=g.name,v=!1,y=c+1;y<n.length;y++){var b=n[y];if(t[y]===aK&&(v=b.properties[g.name]!=null,v))break}!s[_]&&!v&&(s[_]=!0,o.push(_))}}}return r[i]=o,o},iK.getContextMeta=function(e){for(var t=this,n=``,r,i=e._private.styleCxtKey||``,a=0;a<t.length;a++){var o=t[a];o.selector&&o.selector.matches(e)?n+=aK:n+=oK}return r=t.getPropertiesDiff(i,n),e._private.styleCxtKey=n,{key:n,diffPropNames:r,empty:r.length===0}},iK.getContextStyle=function(e){var t=e.key,n=this,r=this._private.contextStyles=this._private.contextStyles||{};if(r[t])return r[t];for(var i={_private:{key:t}},a=0;a<n.length;a++){var o=n[a];if(t[a]===aK)for(var s=0;s<o.properties.length;s++){var c=o.properties[s];i[c.name]=c}}return r[t]=i,i},iK.applyContextStyle=function(e,t,n){for(var r=this,i=e.diffPropNames,a={},o=r.types,s=0;s<i.length;s++){var c=i[s],l=t[c],u=n.pstyle(c);if(!l)if(u)l=u.bypass?{name:c,deleteBypassed:!0}:{name:c,delete:!0};else continue;if(u!==l){if(l.mapped===o.fn&&u!=null&&u.mapping!=null&&u.mapping.value===l.value){var d=u.mapping;if((d.fnValue=l.value(n))===d.prevFnValue)continue}var f=a[c]={prev:u};r.applyParsedProperty(n,l),f.next=n.pstyle(c),f.next&&f.next.bypass&&(f.next=f.next.bypassed)}}return{diffProps:a}},iK.updateStyleHints=function(e){var t=e._private,n=this,r=n.propertyGroupNames,i=n.propertyGroupKeys,a=function(e,t,r){return n.getPropertiesHash(e,t,r)},o=t.styleKey;if(e.removed())return!1;var s=t.group===`nodes`,c=e._private.style;r=Object.keys(c);for(var l=0;l<i.length;l++){var u=i[l];t.styleKeys[u]=[jI,NI]}for(var d=function(e,n){return t.styleKeys[n][0]=FI(e,t.styleKeys[n][0])},f=function(e,n){return t.styleKeys[n][1]=II(e,t.styleKeys[n][1])},p=function(e,t){d(e,t),f(e,t)},m=function(e,t){for(var n=0;n<e.length;n++){var r=e.charCodeAt(n);d(r,t),f(r,t)}},h=2e9,g=function(e){return-128<e&&e<128&&Math.floor(e)!==e?h-(e*1024|0):e},_=0;_<r.length;_++){var v=r[_],y=c[v];if(y!=null){var b=this.properties[v],x=b.type,S=b.groupKey,C=void 0;b.hashOverride==null?y.pfValue!=null&&(C=y.pfValue):C=b.hashOverride(e,y);var w=b.enums==null?y.value:null,T=C!=null,E=T||w!=null,D=y.units;x.number&&E&&!x.multiple?(p(g(T?C:w),S),!T&&D!=null&&m(D,S)):m(y.strValue,S)}}for(var O=[jI,NI],k=0;k<i.length;k++){var A=i[k],j=t.styleKeys[A];O[0]=FI(j[0],O[0]),O[1]=II(j[1],O[1])}t.styleKey=LI(O[0],O[1]);var M=t.styleKeys;t.labelDimsKey=RI(M.labelDimensions);var N=a(e,[`label`],M.labelDimensions);if(t.labelKey=RI(N),t.labelStyleKey=RI(zI(M.commonLabel,N)),!s){var P=a(e,[`source-label`],M.labelDimensions);t.sourceLabelKey=RI(P),t.sourceLabelStyleKey=RI(zI(M.commonLabel,P));var F=a(e,[`target-label`],M.labelDimensions);t.targetLabelKey=RI(F),t.targetLabelStyleKey=RI(zI(M.commonLabel,F))}if(s){var I=t.styleKeys,L=I.nodeBody,R=I.nodeBorder,ee=I.nodeOutline,z=I.backgroundImage,B=I.compound,V=I.pie,H=I.stripe;t.nodeKey=RI([L,R,ee,z,B,V,H].filter(function(e){return e!=null}).reduce(zI,[jI,NI])),t.hasPie=V!=null&&V[0]!==jI&&V[1]!==NI,t.hasStripe=H!=null&&H[0]!==jI&&H[1]!==NI}return o!==t.styleKey},iK.clearStyleHints=function(e){var t=e._private;t.styleCxtKey=``,t.styleKeys={},t.styleKey=null,t.labelKey=null,t.labelStyleKey=null,t.sourceLabelKey=null,t.sourceLabelStyleKey=null,t.targetLabelKey=null,t.targetLabelStyleKey=null,t.nodeKey=null,t.hasPie=null,t.hasStripe=null},iK.applyParsedProperty=function(e,t){var n=this,r=t,i=e._private.style,a,o=n.types,s=n.properties[r.name].type,c=r.bypass,l=i[r.name],u=l&&l.bypass,d=e._private,f=`mapping`,p=function(e){return e==null?null:e.pfValue==null?e.value:e.pfValue},m=function(){var t=p(l),i=p(r);n.checkTriggers(e,r.name,t,i)};if(t.name===`curve-style`&&e.isEdge()&&(t.value!==`bezier`&&e.isLoop()||t.value===`haystack`&&(e.source().isParent()||e.target().isParent()))&&(r=t=this.parse(t.name,`bezier`,c)),r.delete)return i[r.name]=void 0,m(),!0;if(r.deleteBypassed)return l?l.bypass?(l.bypassed=void 0,m(),!0):!1:(m(),!0);if(r.deleteBypass)return l?l.bypass?(i[r.name]=l.bypassed,m(),!0):!1:(m(),!0);var h=function(){rL("Do not assign mappings to elements without corresponding data (i.e. ele `"+e.id()+"` has no mapping for property `"+r.name+"` with data field `"+r.field+"`); try a `["+r.field+"]` selector to limit scope to elements with `"+r.field+"` defined")};switch(r.mapped){case o.mapData:for(var g=r.field.split(`.`),_=d.data,v=0;v<g.length&&_;v++){var y=g[v];_=_[y]}if(_==null)return h(),!1;var b;if($(_)){var x=r.fieldMax-r.fieldMin;b=x===0?0:(_-r.fieldMin)/x}else return rL("Do not use continuous mappers without specifying numeric data (i.e. `"+r.field+`: `+_+"` for `"+e.id()+"` is non-numeric)"),!1;if(b<0?b=0:b>1&&(b=1),s.color){var S=r.valueMin[0],C=r.valueMax[0],w=r.valueMin[1],T=r.valueMax[1],E=r.valueMin[2],D=r.valueMax[2],O=r.valueMin[3]==null?1:r.valueMin[3],k=r.valueMax[3]==null?1:r.valueMax[3],A=[Math.round(S+(C-S)*b),Math.round(w+(T-w)*b),Math.round(E+(D-E)*b),Math.round(O+(k-O)*b)];a={bypass:r.bypass,name:r.name,value:A,strValue:`rgb(`+A[0]+`, `+A[1]+`, `+A[2]+`)`}}else if(s.number){var j=r.valueMin+(r.valueMax-r.valueMin)*b;a=this.parse(r.name,j,r.bypass,f)}else return!1;if(!a)return h(),!1;a.mapping=r,r=a;break;case o.data:for(var M=r.field.split(`.`),N=d.data,P=0;P<M.length&&N;P++){var F=M[P];N=N[F]}if(N!=null&&(a=this.parse(r.name,N,r.bypass,f)),!a)return h(),!1;a.mapping=r,r=a;break;case o.fn:var I=r.value,L=r.fnValue==null?I(e):r.fnValue;if(r.prevFnValue=L,L==null)return rL("Custom function mappers may not return null (i.e. `"+r.name+"` for ele `"+e.id()+"` is null)"),!1;if(a=this.parse(r.name,L,r.bypass,f),!a)return rL("Custom function mappers may not return invalid values for the property type (i.e. `"+r.name+"` for ele `"+e.id()+"` is invalid)"),!1;a.mapping=aL(r),r=a;break;case void 0:break;default:return!1}return c?(u?r.bypassed=l.bypassed:r.bypassed=l,i[r.name]=r):u?l.bypassed=r:i[r.name]=r,m(),!0},iK.cleanElements=function(e,t){for(var n=0;n<e.length;n++){var r=e[n];if(this.clearStyleHints(r),r.dirtyCompoundBoundsCache(),r.dirtyBoundingBoxCache(),!t)r._private.style={};else for(var i=r._private.style,a=Object.keys(i),o=0;o<a.length;o++){var s=a[o],c=i[s];c!=null&&(c.bypass?c.bypassed=null:i[s]=null)}}},iK.update=function(){this._private.cy.mutableElements().updateStyle()},iK.updateTransitions=function(e,t){var n=this,r=e._private,i=e.pstyle(`transition-property`).value,a=e.pstyle(`transition-duration`).pfValue,o=e.pstyle(`transition-delay`).pfValue;if(i.length>0&&a>0){for(var s={},c=!1,l=0;l<i.length;l++){var u=i[l],d=e.pstyle(u),f=t[u];if(f){var p=f.prev,m=f.next==null?d:f.next,h=!1,g=void 0,_=1e-6;p&&($(p.pfValue)&&$(m.pfValue)?(h=m.pfValue-p.pfValue,g=p.pfValue+_*h):$(p.value)&&$(m.value)?(h=m.value-p.value,g=p.value+_*h):YP(p.value)&&YP(m.value)&&(h=p.value[0]!==m.value[0]||p.value[1]!==m.value[1]||p.value[2]!==m.value[2],g=p.strValue),h&&(s[u]=m.strValue,this.applyBypass(e,u,g),c=!0))}}if(!c)return;r.transitioning=!0,new kB(function(t){o>0?e.delayAnimation(o).play().promise().then(t):t()}).then(function(){return e.animation({style:s,duration:a,easing:e.pstyle(`transition-timing-function`).value,queue:!1}).play().promise()}).then(function(){n.removeBypasses(e,i),e.emitAndNotify(`style`),r.transitioning=!1})}else r.transitioning&&=(this.removeBypasses(e,i),e.emitAndNotify(`style`),!1)},iK.checkTrigger=function(e,t,n,r,i,a){var o=this.properties[t],s=i(o);e.removed()||s!=null&&s(n,r,e)&&a(o)},iK.checkZOrderTrigger=function(e,t,n,r){var i=this;this.checkTrigger(e,t,n,r,function(e){return e.triggersZOrder},function(){i._private.cy.notify(`zorder`,e)})},iK.checkBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBounds},function(t){e.dirtyCompoundBoundsCache(),e.dirtyBoundingBoxCache()})},iK.checkConnectedEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfConnectedEdges},function(t){e.connectedEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},iK.checkParallelEdgesBoundsTrigger=function(e,t,n,r){this.checkTrigger(e,t,n,r,function(e){return e.triggersBoundsOfParallelEdges},function(t){e.parallelEdges().forEach(function(e){e.dirtyBoundingBoxCache()})})},iK.checkTriggers=function(e,t,n,r){e.dirtyStyleCache(),this.checkZOrderTrigger(e,t,n,r),this.checkBoundsTrigger(e,t,n,r),this.checkConnectedEdgesBoundsTrigger(e,t,n,r),this.checkParallelEdgesBoundsTrigger(e,t,n,r)};var sK={};sK.applyBypass=function(e,t,n,r){var i=this,a=[],o=!0;if(t===`*`||t===`**`){if(n!==void 0)for(var s=0;s<i.properties.length;s++){var c=i.properties[s].name,l=this.parse(c,n,!0);l&&a.push(l)}}else if(qP(t)){var u=this.parse(t,n,!0);u&&a.push(u)}else if(XP(t)){var d=t;r=n;for(var f=Object.keys(d),p=0;p<f.length;p++){var m=f[p],h=d[m];if(h===void 0&&(h=d[pF(m)]),h!==void 0){var g=this.parse(m,h,!0);g&&a.push(g)}}}else return!1;if(a.length===0)return!1;for(var _=!1,v=0;v<e.length;v++){for(var y=e[v],b={},x=void 0,S=0;S<a.length;S++){var C=a[S];if(r){var w=y.pstyle(C.name);x=b[C.name]={prev:w}}_=this.applyParsedProperty(y,aL(C))||_,r&&(x.next=y.pstyle(C.name))}_&&this.updateStyleHints(y),r&&this.updateTransitions(y,b,o)}return _},sK.overrideBypass=function(e,t,n){t=fF(t);for(var r=0;r<e.length;r++){var i=e[r],a=i._private.style[t],o=this.properties[t].type,s=o.color,c=o.mutiple,l=a?a.pfValue==null?a.value:a.pfValue:null;!a||!a.bypass?this.applyBypass(i,t,n):(a.value=n,a.pfValue!=null&&(a.pfValue=n),s?a.strValue=`rgb(`+n.join(`,`)+`)`:c?a.strValue=n.join(` `):a.strValue=``+n,this.updateStyleHints(i)),this.checkTriggers(i,t,l,n)}},sK.removeAllBypasses=function(e,t){return this.removeBypasses(e,this.propertyNames,t)},sK.removeBypasses=function(e,t,n){for(var r=!0,i=0;i<e.length;i++){for(var a=e[i],o={},s=0;s<t.length;s++){var c=t[s],l=this.properties[c],u=a.pstyle(l.name);if(!(!u||!u.bypass)){var d=this.parse(c,``,!0),f=o[l.name]={prev:u};this.applyParsedProperty(a,d),f.next=a.pstyle(l.name)}}this.updateStyleHints(a),n&&this.updateTransitions(a,o,r)}};var cK={};cK.getEmSizeInPixels=function(){var e=this.containerCss(`font-size`);return e==null?1:parseFloat(e)},cK.containerCss=function(e){var t=this._private.cy,n=t.container(),r=t.window();if(r&&n&&r.getComputedStyle)return r.getComputedStyle(n).getPropertyValue(e)};var lK={};lK.getRenderedStyle=function(e,t){return t?this.getStylePropertyValue(e,t,!0):this.getRawStyle(e,!0)},lK.getRawStyle=function(e,t){var n=this;if(e=e[0],e){for(var r={},i=0;i<n.properties.length;i++){var a=n.properties[i],o=n.getStylePropertyValue(e,a.name,t);o!=null&&(r[a.name]=o,r[pF(a.name)]=o)}return r}},lK.getIndexedStyle=function(e,t,n,r){return e.pstyle(t)[n][r]??e.cy().style().getDefaultProperty(t)[n][0]},lK.getStylePropertyValue=function(e,t,n){var r=this;if(e=e[0],e){var i=r.properties[t];i.alias&&(i=i.pointsTo);var a=i.type,o=e.pstyle(i.name);if(o){var s=o.value,c=o.units,l=o.strValue;if(n&&a.number&&s!=null&&$(s)){var u=e.cy().zoom(),d=function(e){return e*u},f=function(e,t){return d(e)+t},p=YP(s);return(p?c.every(function(e){return e!=null}):c!=null)?p?s.map(function(e,t){return f(e,c[t])}).join(` `):f(s,c):p?s.map(function(e){return qP(e)?e:``+d(e)}).join(` `):``+d(s)}else if(l!=null)return l}return null}},lK.getAnimationStartStyle=function(e,t){for(var n={},r=0;r<t.length;r++){var i=t[r].name,a=e.pstyle(i);a!==void 0&&(a=XP(a)?this.parse(i,a.strValue):this.parse(i,a)),a&&(n[i]=a)}return n},lK.getPropsList=function(e){var t=this,n=[],r=e,i=t.properties;if(r)for(var a=Object.keys(r),o=0;o<a.length;o++){var s=a[o],c=r[s],l=i[s]||i[fF(s)],u=this.parse(l.name,c);u&&n.push(u)}return n},lK.getNonDefaultPropertiesHash=function(e,t,n){var r=n.slice(),i,a,o,s,c,l;for(c=0;c<t.length;c++)if(i=t[c],a=e.pstyle(i,!1),a!=null)if(a.pfValue!=null)r[0]=FI(s,r[0]),r[1]=II(s,r[1]);else for(o=a.strValue,l=0;l<o.length;l++)s=o.charCodeAt(l),r[0]=FI(s,r[0]),r[1]=II(s,r[1]);return r},lK.getPropertiesHash=lK.getNonDefaultPropertiesHash;var uK={};uK.appendFromJson=function(e){for(var t=this,n=0;n<e.length;n++){var r=e[n],i=r.selector,a=r.style||r.css,o=Object.keys(a);t.selector(i);for(var s=0;s<o.length;s++){var c=o[s],l=a[c];t.css(c,l)}}return t},uK.fromJson=function(e){var t=this;return t.resetToDefault(),t.appendFromJson(e),t},uK.json=function(){for(var e=[],t=this.defaultLength;t<this.length;t++){for(var n=this[t],r=n.selector,i=n.properties,a={},o=0;o<i.length;o++){var s=i[o];a[s.name]=s.strValue}e.push({selector:r?r.toString():`core`,style:a})}return e};var dK={};dK.appendFromString=function(e){var t=this,n=this,r=``+e,i,a,o;r=r.replace(/[/][*](\s|.)+?[*][/]/g,``);function s(){r=r.length>i.length?r.substr(i.length):``}function c(){a=a.length>o.length?a.substr(o.length):``}for(;!r.match(/^\s*$/);){var l=r.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!l){rL(`Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: `+r);break}i=l[0];var u=l[1];if(u!==`core`&&new $U(u).invalid){rL(`Skipping parsing of block: Invalid selector found in string stylesheet: `+u),s();continue}var d=l[2],f=!1;a=d;for(var p=[];!a.match(/^\s*$/);){var m=a.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!m){rL(`Skipping parsing of block: Invalid formatting of style property and value definitions found in:`+d),f=!0;break}o=m[0];var h=m[1],g=m[2];if(!t.properties[h]){rL(`Skipping property: Invalid property name in: `+o),c();continue}if(!n.parse(h,g)){rL(`Skipping property: Invalid property definition in: `+o),c();continue}p.push({name:h,val:g}),c()}if(f){s();break}n.selector(u);for(var _=0;_<p.length;_++){var v=p[_];n.css(v.name,v.val)}s()}return n},dK.fromString=function(e){var t=this;return t.resetToDefault(),t.appendFromString(e),t};var fK={};(function(){var e=_F,t=yF,n=xF,r=SF,i=CF,a=function(e){return`^`+e+`\\s*\\(\\s*([\\w\\.]+)\\s*\\)$`},o=function(a){var o=e+`|\\w+|`+t+`|`+n+`|`+r+`|`+i;return`^`+a+`\\s*\\(([\\w\\.]+)\\s*\\,\\s*(`+e+`)\\s*\\,\\s*(`+e+`)\\s*,\\s*(`+o+`)\\s*\\,\\s*(`+o+`)\\)$`},s=[`^url\\s*\\(\\s*['"]?(.+?)['"]?\\s*\\)$`,`^(none)$`,`^(.+)$`];fK.types={time:{number:!0,min:0,units:`s|ms`,implicitUnits:`ms`},percent:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`},percentages:{number:!0,min:0,max:100,units:`%`,implicitUnits:`%`,multiple:!0},zeroOneNumber:{number:!0,min:0,max:1,unitless:!0},zeroOneNumbers:{number:!0,min:0,max:1,unitless:!0,multiple:!0},nOneOneNumber:{number:!0,min:-1,max:1,unitless:!0},nonNegativeInt:{number:!0,min:0,integer:!0,unitless:!0},nonNegativeNumber:{number:!0,min:0,unitless:!0},position:{enums:[`parent`,`origin`]},nodeSize:{number:!0,min:0,enums:[`label`]},number:{number:!0,unitless:!0},numbers:{number:!0,unitless:!0,multiple:!0},positiveNumber:{number:!0,unitless:!0,min:0,strictMin:!0},size:{number:!0,min:0},bidirectionalSize:{number:!0},bidirectionalSizeMaybePercent:{number:!0,allowPercent:!0},bidirectionalSizes:{number:!0,multiple:!0},sizeMaybePercent:{number:!0,min:0,allowPercent:!0},axisDirection:{enums:[`horizontal`,`leftward`,`rightward`,`vertical`,`upward`,`downward`,`auto`]},axisDirectionExplicit:{enums:[`leftward`,`rightward`,`upward`,`downward`]},axisDirectionPrimary:{enums:[`horizontal`,`vertical`]},paddingRelativeTo:{enums:[`width`,`height`,`average`,`min`,`max`]},bgWH:{number:!0,min:0,allowPercent:!0,enums:[`auto`],multiple:!0},bgPos:{number:!0,allowPercent:!0,multiple:!0},bgRelativeTo:{enums:[`inner`,`include-padding`],multiple:!0},bgRepeat:{enums:[`repeat`,`repeat-x`,`repeat-y`,`no-repeat`],multiple:!0},bgFit:{enums:[`none`,`contain`,`cover`],multiple:!0},bgCrossOrigin:{enums:[`anonymous`,`use-credentials`,`null`],multiple:!0},bgClip:{enums:[`none`,`node`],multiple:!0},bgContainment:{enums:[`inside`,`over`],multiple:!0},boxSelection:{enums:[`contain`,`overlap`,`none`]},color:{color:!0},colors:{color:!0,multiple:!0},fill:{enums:[`solid`,`linear-gradient`,`radial-gradient`]},bool:{enums:[`yes`,`no`]},bools:{enums:[`yes`,`no`],multiple:!0},lineStyle:{enums:[`solid`,`dotted`,`dashed`]},lineCap:{enums:[`butt`,`round`,`square`]},linePosition:{enums:[`center`,`inside`,`outside`]},lineJoin:{enums:[`round`,`bevel`,`miter`]},borderStyle:{enums:[`solid`,`dotted`,`dashed`,`double`]},curveStyle:{enums:[`bezier`,`unbundled-bezier`,`haystack`,`segments`,`straight`,`straight-triangle`,`taxi`,`round-segments`,`round-taxi`]},radiusType:{enums:[`arc-radius`,`influence-radius`],multiple:!0},fontFamily:{regex:`^([\\w- \\"]+(?:\\s*,\\s*[\\w- \\"]+)*)$`},fontStyle:{enums:[`italic`,`normal`,`oblique`]},fontWeight:{enums:[`normal`,`bold`,`bolder`,`lighter`,`100`,`200`,`300`,`400`,`500`,`600`,`800`,`900`,100,200,300,400,500,600,700,800,900]},textDecoration:{enums:[`none`,`underline`,`overline`,`line-through`]},textTransform:{enums:[`none`,`uppercase`,`lowercase`]},textWrap:{enums:[`none`,`wrap`,`ellipsis`]},textOverflowWrap:{enums:[`whitespace`,`anywhere`]},textBackgroundShape:{enums:[`rectangle`,`roundrectangle`,`round-rectangle`,`circle`]},nodeShape:{enums:`rectangle.roundrectangle.round-rectangle.cutrectangle.cut-rectangle.bottomroundrectangle.bottom-round-rectangle.barrel.ellipse.triangle.round-triangle.square.pentagon.round-pentagon.hexagon.round-hexagon.concavehexagon.concave-hexagon.heptagon.round-heptagon.octagon.round-octagon.tag.round-tag.star.diamond.round-diamond.vee.rhomboid.right-rhomboid.polygon`.split(`.`)},overlayShape:{enums:[`roundrectangle`,`round-rectangle`,`ellipse`]},cornerRadius:{number:!0,min:0,units:`px|em`,implicitUnits:`px`,enums:[`auto`]},compoundIncludeLabels:{enums:[`include`,`exclude`]},arrowShape:{enums:[`tee`,`triangle`,`triangle-tee`,`circle-triangle`,`triangle-cross`,`triangle-backcurve`,`vee`,`square`,`circle`,`diamond`,`chevron`,`none`]},arrowFill:{enums:[`filled`,`hollow`]},arrowWidth:{number:!0,units:`%|px|em`,implicitUnits:`px`,enums:[`match-line`]},display:{enums:[`element`,`none`]},visibility:{enums:[`hidden`,`visible`]},zCompoundDepth:{enums:[`bottom`,`orphan`,`auto`,`top`]},zIndexCompare:{enums:[`auto`,`manual`]},valign:{enums:[`top`,`center`,`bottom`]},halign:{enums:[`left`,`center`,`right`]},justification:{enums:[`left`,`center`,`right`,`auto`]},text:{string:!0},data:{mapping:!0,regex:a(`data`)},layoutData:{mapping:!0,regex:a(`layoutData`)},scratch:{mapping:!0,regex:a(`scratch`)},mapData:{mapping:!0,regex:o(`mapData`)},mapLayoutData:{mapping:!0,regex:o(`mapLayoutData`)},mapScratch:{mapping:!0,regex:o(`mapScratch`)},fn:{mapping:!0,fn:!0},url:{regexes:s,singleRegexMatchValue:!0},urls:{regexes:s,singleRegexMatchValue:!0,multiple:!0},propList:{propList:!0},angle:{number:!0,units:`deg|rad`,implicitUnits:`rad`},textRotation:{number:!0,units:`deg|rad`,implicitUnits:`rad`,enums:[`none`,`autorotate`]},polygonPointList:{number:!0,multiple:!0,evenMultiple:!0,min:-1,max:1,unitless:!0},edgeDistances:{enums:[`intersection`,`node-position`,`endpoints`]},edgeEndpoint:{number:!0,multiple:!0,units:`%|px|em|deg|rad`,implicitUnits:`px`,enums:[`inside-to-node`,`outside-to-node`,`outside-to-node-or-label`,`outside-to-line`,`outside-to-line-or-label`],singleEnum:!0,validate:function(e,t){switch(e.length){case 2:return t[0]!==`deg`&&t[0]!==`rad`&&t[1]!==`deg`&&t[1]!==`rad`;case 1:return qP(e[0])||t[0]===`deg`||t[0]===`rad`;default:return!1}}},easing:{regexes:[`^(spring)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`,`^(cubic-bezier)\\s*\\(\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*,\\s*(`+e+`)\\s*\\)$`],enums:`linear.ease.ease-in.ease-out.ease-in-out.ease-in-sine.ease-out-sine.ease-in-out-sine.ease-in-quad.ease-out-quad.ease-in-out-quad.ease-in-cubic.ease-out-cubic.ease-in-out-cubic.ease-in-quart.ease-out-quart.ease-in-out-quart.ease-in-quint.ease-out-quint.ease-in-out-quint.ease-in-expo.ease-out-expo.ease-in-out-expo.ease-in-circ.ease-out-circ.ease-in-out-circ`.split(`.`)},gradientDirection:{enums:[`to-bottom`,`to-top`,`to-left`,`to-right`,`to-bottom-right`,`to-bottom-left`,`to-top-right`,`to-top-left`,`to-right-bottom`,`to-left-bottom`,`to-right-top`,`to-left-top`]},boundsExpansion:{number:!0,multiple:!0,min:0,validate:function(e){var t=e.length;return t===1||t===2||t===4}}};var c={zeroNonZero:function(e,t){return(e==null||t==null)&&e!==t||e==0&&t!=0?!0:e!=0&&t==0},any:function(e,t){return e!=t},emptyNonEmpty:function(e,t){var n=oF(e),r=oF(t);return n&&!r||!n&&r}},l=fK.types,u=[{name:`label`,type:l.text,triggersBounds:c.any,triggersZOrder:c.emptyNonEmpty},{name:`text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any}],d=[{name:`source-label`,type:l.text,triggersBounds:c.any},{name:`source-text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`source-text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`source-text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`source-text-offset`,type:l.size,triggersBounds:c.any}],f=[{name:`target-label`,type:l.text,triggersBounds:c.any},{name:`target-text-rotation`,type:l.textRotation,triggersBounds:c.any},{name:`target-text-margin-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`target-text-margin-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`target-text-offset`,type:l.size,triggersBounds:c.any}],p=[{name:`font-family`,type:l.fontFamily,triggersBounds:c.any},{name:`font-style`,type:l.fontStyle,triggersBounds:c.any},{name:`font-weight`,type:l.fontWeight,triggersBounds:c.any},{name:`font-size`,type:l.size,triggersBounds:c.any},{name:`text-transform`,type:l.textTransform,triggersBounds:c.any},{name:`text-wrap`,type:l.textWrap,triggersBounds:c.any},{name:`text-overflow-wrap`,type:l.textOverflowWrap,triggersBounds:c.any},{name:`text-max-width`,type:l.size,triggersBounds:c.any},{name:`text-outline-width`,type:l.size,triggersBounds:c.any},{name:`line-height`,type:l.positiveNumber,triggersBounds:c.any}],m=[{name:`text-valign`,type:l.valign,triggersBounds:c.any},{name:`text-halign`,type:l.halign,triggersBounds:c.any},{name:`color`,type:l.color},{name:`text-outline-color`,type:l.color},{name:`text-outline-opacity`,type:l.zeroOneNumber},{name:`text-background-color`,type:l.color},{name:`text-background-opacity`,type:l.zeroOneNumber},{name:`text-background-padding`,type:l.size,triggersBounds:c.any},{name:`text-border-opacity`,type:l.zeroOneNumber},{name:`text-border-color`,type:l.color},{name:`text-border-width`,type:l.size,triggersBounds:c.any},{name:`text-border-style`,type:l.borderStyle,triggersBounds:c.any},{name:`text-background-shape`,type:l.textBackgroundShape,triggersBounds:c.any},{name:`text-justification`,type:l.justification},{name:`box-select-labels`,type:l.bool,triggersBounds:c.any}],h=[{name:`events`,type:l.bool,triggersZOrder:c.any},{name:`text-events`,type:l.bool,triggersZOrder:c.any},{name:`box-selection`,type:l.boxSelection,triggersZOrder:c.any}],g=[{name:`display`,type:l.display,triggersZOrder:c.any,triggersBounds:c.any,triggersBoundsOfConnectedEdges:c.any,triggersBoundsOfParallelEdges:function(e,t,n){return e===t?!1:n.pstyle(`curve-style`).value===`bezier`}},{name:`visibility`,type:l.visibility,triggersZOrder:c.any},{name:`opacity`,type:l.zeroOneNumber,triggersZOrder:c.zeroNonZero},{name:`text-opacity`,type:l.zeroOneNumber},{name:`min-zoomed-font-size`,type:l.size},{name:`z-compound-depth`,type:l.zCompoundDepth,triggersZOrder:c.any},{name:`z-index-compare`,type:l.zIndexCompare,triggersZOrder:c.any},{name:`z-index`,type:l.number,triggersZOrder:c.any}],_=[{name:`overlay-padding`,type:l.size,triggersBounds:c.any},{name:`overlay-color`,type:l.color},{name:`overlay-opacity`,type:l.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:`overlay-shape`,type:l.overlayShape,triggersBounds:c.any},{name:`overlay-corner-radius`,type:l.cornerRadius}],v=[{name:`underlay-padding`,type:l.size,triggersBounds:c.any},{name:`underlay-color`,type:l.color},{name:`underlay-opacity`,type:l.zeroOneNumber,triggersBounds:c.zeroNonZero},{name:`underlay-shape`,type:l.overlayShape,triggersBounds:c.any},{name:`underlay-corner-radius`,type:l.cornerRadius}],y=[{name:`transition-property`,type:l.propList},{name:`transition-duration`,type:l.time},{name:`transition-delay`,type:l.time},{name:`transition-timing-function`,type:l.easing}],b=function(e,t){return t.value===`label`?-e.poolIndex():t.pfValue},x=[{name:`height`,type:l.nodeSize,triggersBounds:c.any,hashOverride:b},{name:`width`,type:l.nodeSize,triggersBounds:c.any,hashOverride:b},{name:`shape`,type:l.nodeShape,triggersBounds:c.any},{name:`shape-polygon-points`,type:l.polygonPointList,triggersBounds:c.any},{name:`corner-radius`,type:l.cornerRadius},{name:`background-color`,type:l.color},{name:`background-fill`,type:l.fill},{name:`background-opacity`,type:l.zeroOneNumber},{name:`background-blacken`,type:l.nOneOneNumber},{name:`background-gradient-stop-colors`,type:l.colors},{name:`background-gradient-stop-positions`,type:l.percentages},{name:`background-gradient-direction`,type:l.gradientDirection},{name:`padding`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`padding-relative-to`,type:l.paddingRelativeTo,triggersBounds:c.any},{name:`bounds-expansion`,type:l.boundsExpansion,triggersBounds:c.any}],S=[{name:`border-color`,type:l.color},{name:`border-opacity`,type:l.zeroOneNumber},{name:`border-width`,type:l.size,triggersBounds:c.any},{name:`border-style`,type:l.borderStyle},{name:`border-cap`,type:l.lineCap},{name:`border-join`,type:l.lineJoin},{name:`border-dash-pattern`,type:l.numbers},{name:`border-dash-offset`,type:l.number},{name:`border-position`,type:l.linePosition}],C=[{name:`outline-color`,type:l.color},{name:`outline-opacity`,type:l.zeroOneNumber},{name:`outline-width`,type:l.size,triggersBounds:c.any},{name:`outline-style`,type:l.borderStyle},{name:`outline-offset`,type:l.size,triggersBounds:c.any}],w=[{name:`background-image`,type:l.urls},{name:`background-image-crossorigin`,type:l.bgCrossOrigin},{name:`background-image-opacity`,type:l.zeroOneNumbers},{name:`background-image-containment`,type:l.bgContainment},{name:`background-image-smoothing`,type:l.bools},{name:`background-position-x`,type:l.bgPos},{name:`background-position-y`,type:l.bgPos},{name:`background-width-relative-to`,type:l.bgRelativeTo},{name:`background-height-relative-to`,type:l.bgRelativeTo},{name:`background-repeat`,type:l.bgRepeat},{name:`background-fit`,type:l.bgFit},{name:`background-clip`,type:l.bgClip},{name:`background-width`,type:l.bgWH},{name:`background-height`,type:l.bgWH},{name:`background-offset-x`,type:l.bgPos},{name:`background-offset-y`,type:l.bgPos}],T=[{name:`position`,type:l.position,triggersBounds:c.any},{name:`compound-sizing-wrt-labels`,type:l.compoundIncludeLabels,triggersBounds:c.any},{name:`min-width`,type:l.size,triggersBounds:c.any},{name:`min-width-bias-left`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-width-bias-right`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-height`,type:l.size,triggersBounds:c.any},{name:`min-height-bias-top`,type:l.sizeMaybePercent,triggersBounds:c.any},{name:`min-height-bias-bottom`,type:l.sizeMaybePercent,triggersBounds:c.any}],E=[{name:`line-style`,type:l.lineStyle},{name:`line-color`,type:l.color},{name:`line-fill`,type:l.fill},{name:`line-cap`,type:l.lineCap},{name:`line-opacity`,type:l.zeroOneNumber},{name:`line-dash-pattern`,type:l.numbers},{name:`line-dash-offset`,type:l.number},{name:`line-outline-width`,type:l.size},{name:`line-outline-color`,type:l.color},{name:`line-gradient-stop-colors`,type:l.colors},{name:`line-gradient-stop-positions`,type:l.percentages},{name:`curve-style`,type:l.curveStyle,triggersBounds:c.any,triggersBoundsOfParallelEdges:function(e,t){return e===t?!1:e===`bezier`||t===`bezier`}},{name:`haystack-radius`,type:l.zeroOneNumber,triggersBounds:c.any},{name:`source-endpoint`,type:l.edgeEndpoint,triggersBounds:c.any},{name:`target-endpoint`,type:l.edgeEndpoint,triggersBounds:c.any},{name:`control-point-step-size`,type:l.size,triggersBounds:c.any},{name:`control-point-distances`,type:l.bidirectionalSizes,triggersBounds:c.any},{name:`control-point-weights`,type:l.numbers,triggersBounds:c.any},{name:`segment-distances`,type:l.bidirectionalSizes,triggersBounds:c.any},{name:`segment-weights`,type:l.numbers,triggersBounds:c.any},{name:`segment-radii`,type:l.numbers,triggersBounds:c.any},{name:`radius-type`,type:l.radiusType,triggersBounds:c.any},{name:`taxi-turn`,type:l.bidirectionalSizeMaybePercent,triggersBounds:c.any},{name:`taxi-turn-min-distance`,type:l.size,triggersBounds:c.any},{name:`taxi-direction`,type:l.axisDirection,triggersBounds:c.any},{name:`taxi-radius`,type:l.number,triggersBounds:c.any},{name:`edge-distances`,type:l.edgeDistances,triggersBounds:c.any},{name:`arrow-scale`,type:l.positiveNumber,triggersBounds:c.any},{name:`loop-direction`,type:l.angle,triggersBounds:c.any},{name:`loop-sweep`,type:l.angle,triggersBounds:c.any},{name:`source-distance-from-node`,type:l.size,triggersBounds:c.any},{name:`target-distance-from-node`,type:l.size,triggersBounds:c.any}],D=[{name:`ghost`,type:l.bool,triggersBounds:c.any},{name:`ghost-offset-x`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`ghost-offset-y`,type:l.bidirectionalSize,triggersBounds:c.any},{name:`ghost-opacity`,type:l.zeroOneNumber}],O=[{name:`selection-box-color`,type:l.color},{name:`selection-box-opacity`,type:l.zeroOneNumber},{name:`selection-box-border-color`,type:l.color},{name:`selection-box-border-width`,type:l.size},{name:`active-bg-color`,type:l.color},{name:`active-bg-opacity`,type:l.zeroOneNumber},{name:`active-bg-size`,type:l.size},{name:`outside-texture-bg-color`,type:l.color},{name:`outside-texture-bg-opacity`,type:l.zeroOneNumber}],k=[];fK.pieBackgroundN=16,k.push({name:`pie-size`,type:l.sizeMaybePercent}),k.push({name:`pie-hole`,type:l.sizeMaybePercent}),k.push({name:`pie-start-angle`,type:l.angle});for(var A=1;A<=fK.pieBackgroundN;A++)k.push({name:`pie-`+A+`-background-color`,type:l.color}),k.push({name:`pie-`+A+`-background-size`,type:l.percent}),k.push({name:`pie-`+A+`-background-opacity`,type:l.zeroOneNumber});var j=[];fK.stripeBackgroundN=16,j.push({name:`stripe-size`,type:l.sizeMaybePercent}),j.push({name:`stripe-direction`,type:l.axisDirectionPrimary});for(var M=1;M<=fK.stripeBackgroundN;M++)j.push({name:`stripe-`+M+`-background-color`,type:l.color}),j.push({name:`stripe-`+M+`-background-size`,type:l.percent}),j.push({name:`stripe-`+M+`-background-opacity`,type:l.zeroOneNumber});var N=[],P=fK.arrowPrefixes=[`source`,`mid-source`,`target`,`mid-target`];[{name:`arrow-shape`,type:l.arrowShape,triggersBounds:c.any},{name:`arrow-color`,type:l.color},{name:`arrow-fill`,type:l.arrowFill},{name:`arrow-width`,type:l.arrowWidth}].forEach(function(e){P.forEach(function(t){var n=t+`-`+e.name,r=e.type,i=e.triggersBounds;N.push({name:n,type:r,triggersBounds:i})})},{});var F=fK.properties=[].concat(h,y,g,_,v,D,m,p,u,d,f,x,S,C,w,k,j,T,E,N,O),I=fK.propertyGroups={behavior:h,transition:y,visibility:g,overlay:_,underlay:v,ghost:D,commonLabel:m,labelDimensions:p,mainLabel:u,sourceLabel:d,targetLabel:f,nodeBody:x,nodeBorder:S,nodeOutline:C,backgroundImage:w,pie:k,stripe:j,compound:T,edgeLine:E,edgeArrow:N,core:O},L=fK.propertyGroupNames={};(fK.propertyGroupKeys=Object.keys(I)).forEach(function(e){L[e]=I[e].map(function(e){return e.name}),I[e].forEach(function(t){return t.groupKey=e})});var R=fK.aliases=[{name:`content`,pointsTo:`label`},{name:`control-point-distance`,pointsTo:`control-point-distances`},{name:`control-point-weight`,pointsTo:`control-point-weights`},{name:`segment-distance`,pointsTo:`segment-distances`},{name:`segment-weight`,pointsTo:`segment-weights`},{name:`segment-radius`,pointsTo:`segment-radii`},{name:`edge-text-rotation`,pointsTo:`text-rotation`},{name:`padding-left`,pointsTo:`padding`},{name:`padding-right`,pointsTo:`padding`},{name:`padding-top`,pointsTo:`padding`},{name:`padding-bottom`,pointsTo:`padding`}];fK.propertyNames=F.map(function(e){return e.name});for(var ee=0;ee<F.length;ee++){var z=F[ee];F[z.name]=z}for(var B=0;B<R.length;B++){var V=R[B],H=F[V.pointsTo],te={name:V.name,alias:!0,pointsTo:H};F.push(te),F[V.name]=te}})(),fK.getDefaultProperty=function(e){return this.getDefaultProperties()[e]},fK.getDefaultProperties=function(){var e=this._private;if(e.defaultProperties!=null)return e.defaultProperties;for(var t=EF({"selection-box-color":`#ddd`,"selection-box-opacity":.65,"selection-box-border-color":`#aaa`,"selection-box-border-width":1,"active-bg-color":`black`,"active-bg-opacity":.15,"active-bg-size":30,"outside-texture-bg-color":`#000`,"outside-texture-bg-opacity":.125,events:`yes`,"text-events":`no`,"text-valign":`top`,"text-halign":`center`,"text-justification":`auto`,"line-height":1,color:`#000`,"box-selection":`contain`,"text-outline-color":`#000`,"text-outline-width":0,"text-outline-opacity":1,"text-opacity":1,"text-decoration":`none`,"text-transform":`none`,"text-wrap":`none`,"text-overflow-wrap":`whitespace`,"text-max-width":9999,"text-background-color":`#000`,"text-background-opacity":0,"text-background-shape":`rectangle`,"text-background-padding":0,"text-border-opacity":0,"text-border-width":0,"text-border-style":`solid`,"text-border-color":`#000`,"font-family":`Helvetica Neue, Helvetica, sans-serif`,"font-style":`normal`,"font-weight":`normal`,"font-size":16,"min-zoomed-font-size":0,"text-rotation":`none`,"source-text-rotation":`none`,"target-text-rotation":`none`,visibility:`visible`,display:`element`,opacity:1,"z-compound-depth":`auto`,"z-index-compare":`auto`,"z-index":0,label:``,"text-margin-x":0,"text-margin-y":0,"source-label":``,"source-text-offset":0,"source-text-margin-x":0,"source-text-margin-y":0,"target-label":``,"target-text-offset":0,"target-text-margin-x":0,"target-text-margin-y":0,"overlay-opacity":0,"overlay-color":`#000`,"overlay-padding":10,"overlay-shape":`round-rectangle`,"overlay-corner-radius":`auto`,"underlay-opacity":0,"underlay-color":`#000`,"underlay-padding":10,"underlay-shape":`round-rectangle`,"underlay-corner-radius":`auto`,"transition-property":`none`,"transition-duration":0,"transition-delay":0,"transition-timing-function":`linear`,"box-select-labels":`no`,"background-blacken":0,"background-color":`#999`,"background-fill":`solid`,"background-opacity":1,"background-image":`none`,"background-image-crossorigin":`anonymous`,"background-image-opacity":1,"background-image-containment":`inside`,"background-image-smoothing":`yes`,"background-position-x":`50%`,"background-position-y":`50%`,"background-offset-x":0,"background-offset-y":0,"background-width-relative-to":`include-padding`,"background-height-relative-to":`include-padding`,"background-repeat":`no-repeat`,"background-fit":`none`,"background-clip":`node`,"background-width":`auto`,"background-height":`auto`,"border-color":`#000`,"border-opacity":1,"border-width":0,"border-style":`solid`,"border-dash-pattern":[4,2],"border-dash-offset":0,"border-cap":`butt`,"border-join":`miter`,"border-position":`center`,"outline-color":`#999`,"outline-opacity":1,"outline-width":0,"outline-offset":0,"outline-style":`solid`,height:30,width:30,shape:`ellipse`,"shape-polygon-points":`-1, -1, 1, -1, 1, 1, -1, 1`,"corner-radius":`auto`,"bounds-expansion":0,"background-gradient-direction":`to-bottom`,"background-gradient-stop-colors":`#999`,"background-gradient-stop-positions":`0%`,ghost:`no`,"ghost-offset-y":0,"ghost-offset-x":0,"ghost-opacity":0,padding:0,"padding-relative-to":`width`,position:`origin`,"compound-sizing-wrt-labels":`include`,"min-width":0,"min-width-bias-left":0,"min-width-bias-right":0,"min-height":0,"min-height-bias-top":0,"min-height-bias-bottom":0},{"pie-size":`100%`,"pie-hole":0,"pie-start-angle":`0deg`},[{name:`pie-{{i}}-background-color`,value:`black`},{name:`pie-{{i}}-background-size`,value:`0%`},{name:`pie-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=fK.pieBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"stripe-size":`100%`,"stripe-direction":`horizontal`},[{name:`stripe-{{i}}-background-color`,value:`black`},{name:`stripe-{{i}}-background-size`,value:`0%`},{name:`stripe-{{i}}-background-opacity`,value:1}].reduce(function(e,t){for(var n=1;n<=fK.stripeBackgroundN;n++){var r=t.name.replace(`{{i}}`,n);e[r]=t.value}return e},{}),{"line-style":`solid`,"line-color":`#999`,"line-fill":`solid`,"line-cap":`butt`,"line-opacity":1,"line-outline-width":0,"line-outline-color":`#000`,"line-gradient-stop-colors":`#999`,"line-gradient-stop-positions":`0%`,"control-point-step-size":40,"control-point-weights":.5,"segment-weights":.5,"segment-distances":20,"segment-radii":15,"radius-type":`arc-radius`,"taxi-turn":`50%`,"taxi-radius":15,"taxi-turn-min-distance":10,"taxi-direction":`auto`,"edge-distances":`intersection`,"curve-style":`haystack`,"haystack-radius":0,"arrow-scale":1,"loop-direction":`-45deg`,"loop-sweep":`-90deg`,"source-distance-from-node":0,"target-distance-from-node":0,"source-endpoint":`outside-to-node`,"target-endpoint":`outside-to-node`,"line-dash-pattern":[6,3],"line-dash-offset":0},[{name:`arrow-shape`,value:`none`},{name:`arrow-color`,value:`#999`},{name:`arrow-fill`,value:`filled`},{name:`arrow-width`,value:1}].reduce(function(e,t){return fK.arrowPrefixes.forEach(function(n){var r=n+`-`+t.name;e[r]=t.value}),e},{})),n={},r=0;r<this.properties.length;r++){var i=this.properties[r];if(!i.pointsTo){var a=i.name,o=t[a];n[a]=this.parse(a,o)}}return e.defaultProperties=n,e.defaultProperties},fK.addDefaultStylesheet=function(){this.selector(`:parent`).css({shape:`rectangle`,padding:10,"background-color":`#eee`,"border-color":`#ccc`,"border-width":1}).selector(`edge`).css({width:3}).selector(`:loop`).css({"curve-style":`bezier`}).selector(`edge:compound`).css({"curve-style":`bezier`,"source-endpoint":`outside-to-line`,"target-endpoint":`outside-to-line`}).selector(`:selected`).css({"background-color":`#0169D9`,"line-color":`#0169D9`,"source-arrow-color":`#0169D9`,"target-arrow-color":`#0169D9`,"mid-source-arrow-color":`#0169D9`,"mid-target-arrow-color":`#0169D9`}).selector(`:parent:selected`).css({"background-color":`#CCE1F9`,"border-color":`#aec8e5`}).selector(`:active`).css({"overlay-color":`black`,"overlay-padding":10,"overlay-opacity":.25}),this.defaultLength=this.length};var pK={};pK.parse=function(e,t,n,r){var i=this;if(JP(t))return i.parseImplWarn(e,t,n,r);var a=r===`mapping`||r===!0||r===!1||r==null?`dontcare`:r,o=n?`t`:`f`,s=HI(e,``+t,o,a),c=i.propCache=i.propCache||[],l;return(l=c[s])||(l=c[s]=i.parseImplWarn(e,t,n,r)),(n||r===`mapping`)&&(l=aL(l),l&&(l.value=aL(l.value))),l},pK.parseImplWarn=function(e,t,n,r){var i=this.parseImpl(e,t,n,r);return!i&&t!=null&&rL(`The style property \`${e}: ${t}\` is invalid`),i&&(i.name===`width`||i.name===`height`)&&t===`label`&&rL("The style value of `label` is deprecated for `"+i.name+"`"),i},pK.parseImpl=function(e,t,n,r){var i=this;e=fF(e);var a=i.properties[e],o=t,s=i.types;if(!a||t===void 0)return null;a.alias&&(a=a.pointsTo,e=a.name);var c=qP(t);c&&(t=t.trim());var l=a.type;if(!l)return null;if(n&&(t===``||t===null))return{name:e,value:t,bypass:!0,deleteBypass:!0};if(JP(t))return{name:e,value:t,strValue:`fn`,mapped:s.fn,bypass:n};var u,d;if(!(!c||r||t.length<7||t[1]!==`a`)){if(t.length>=7&&t[0]===`d`&&(u=new RegExp(s.data.regex).exec(t))){if(n)return!1;var f=s.data;return{name:e,value:u,strValue:``+t,mapped:f,field:u[1],bypass:n}}else if(t.length>=10&&t[0]===`m`&&(d=new RegExp(s.mapData.regex).exec(t))){if(n||l.multiple)return!1;var p=s.mapData;if(!(l.color||l.number))return!1;var m=this.parse(e,d[4]);if(!m||m.mapped)return!1;var h=this.parse(e,d[5]);if(!h||h.mapped)return!1;if(m.pfValue===h.pfValue||m.strValue===h.strValue)return rL("`"+e+`: `+t+"` is not a valid mapper because the output range is zero; converting to `"+e+`: `+m.strValue+"`"),this.parse(e,m.strValue);if(l.color){var g=m.value,_=h.value;if(g[0]===_[0]&&g[1]===_[1]&&g[2]===_[2]&&(g[3]===_[3]||(g[3]==null||g[3]===1)&&(_[3]==null||_[3]===1)))return!1}return{name:e,value:d,strValue:``+t,mapped:p,field:d[1],fieldMin:parseFloat(d[2]),fieldMax:parseFloat(d[3]),valueMin:m.value,valueMax:h.value,bypass:n}}}if(l.multiple&&r!==`multiple`){var v=c?t.split(/\s+/):YP(t)?t:[t];if(l.evenMultiple&&v.length%2!=0)return null;for(var y=[],b=[],x=[],S=``,C=!1,w=0;w<v.length;w++){var T=i.parse(e,v[w],n,`multiple`);C||=qP(T.value),y.push(T.value),x.push(T.pfValue==null?T.value:T.pfValue),b.push(T.units),S+=(w>0?` `:``)+T.strValue}return l.validate&&!l.validate(y,b)?null:l.singleEnum&&C?y.length===1&&qP(y[0])?{name:e,value:y[0],strValue:y[0],bypass:n}:null:{name:e,value:y,pfValue:x,strValue:S,bypass:n,units:b}}var E=function(){for(var r=0;r<l.enums.length;r++)if(l.enums[r]===t)return{name:e,value:t,strValue:``+t,bypass:n};return null};if(l.number){var D,O=`px`;if(l.units&&(D=l.units),l.implicitUnits&&(O=l.implicitUnits),!l.unitless)if(c){var k=`px|em`+(l.allowPercent?`|\\%`:``);D&&(k=D);var A=t.match(`^(`+_F+`)(`+k+`)?$`);A&&(t=A[1],D=A[2]||O)}else (!D||l.implicitUnits)&&(D=O);if(t=parseFloat(t),isNaN(t)&&l.enums===void 0)return null;if(isNaN(t)&&l.enums!==void 0)return t=o,E();if(l.integer&&!QP(t)||l.min!==void 0&&(t<l.min||l.strictMin&&t===l.min)||l.max!==void 0&&(t>l.max||l.strictMax&&t===l.max))return null;var j={name:e,value:t,strValue:``+t+(D||``),units:D,bypass:n};return l.unitless||D!==`px`&&D!==`em`?j.pfValue=t:j.pfValue=D===`px`||!D?t:this.getEmSizeInPixels()*t,(D===`ms`||D===`s`)&&(j.pfValue=D===`ms`?t:1e3*t),(D===`deg`||D===`rad`)&&(j.pfValue=D===`rad`?t:QL(t)),D===`%`&&(j.pfValue=t/100),j}else if(l.propList){var M=[],N=``+t;if(N!==`none`){for(var P=N.split(/\s*,\s*|\s+/),F=0;F<P.length;F++){var I=P[F].trim();i.properties[I]?M.push(I):rL("`"+I+"` is not a valid property name")}if(M.length===0)return null}return{name:e,value:M,strValue:M.length===0?`none`:M.join(` `),bypass:n}}else if(l.color){var L=jF(t);return L?{name:e,value:L,pfValue:L,strValue:`rgb(`+L[0]+`,`+L[1]+`,`+L[2]+`)`,bypass:n}:null}else if(l.regex||l.regexes){if(l.enums){var R=E();if(R)return R}for(var ee=l.regexes?l.regexes:[l.regex],z=0;z<ee.length;z++){var B=new RegExp(ee[z]).exec(t);if(B)return{name:e,value:l.singleRegexMatchValue?B[1]:B,strValue:``+t,bypass:n}}return null}else if(l.string)return{name:e,value:``+t,strValue:``+t,bypass:n};else if(l.enums)return E();else return null};var mK=function(e){if(!(this instanceof mK))return new mK(e);if(!rF(e)){tL(`A style must have a core reference`);return}this._private={cy:e,coreStyle:{}},this.length=0,this.resetToDefault()},hK=mK.prototype;hK.instanceString=function(){return`style`},hK.clear=function(){for(var e=this._private,t=e.cy.elements(),n=0;n<this.length;n++)this[n]=void 0;return this.length=0,e.contextStyles={},e.propDiffs={},this.cleanElements(t,!0),t.forEach(function(e){var t=e[0]._private;t.styleDirty=!0,t.appliedInitStyle=!1}),this},hK.resetToDefault=function(){return this.clear(),this.addDefaultStylesheet(),this},hK.core=function(e){return this._private.coreStyle[e]||this.getDefaultProperty(e)},hK.selector=function(e){var t=e===`core`?null:new $U(e),n=this.length++;return this[n]={selector:t,properties:[],mappedProperties:[],index:n},this},hK.css=function(){var e=this,t=arguments;if(t.length===1)for(var n=t[0],r=0;r<e.properties.length;r++){var i=e.properties[r],a=n[i.name];a===void 0&&(a=n[pF(i.name)]),a!==void 0&&this.cssRule(i.name,a)}else t.length===2&&this.cssRule(t[0],t[1]);return this},hK.style=hK.css,hK.cssRule=function(e,t){var n=this.parse(e,t);if(n){var r=this.length-1;this[r].properties.push(n),this[r].properties[n.name]=n,n.name.match(/pie-(\d+)-background-size/)&&n.value&&(this._private.hasPie=!0),n.name.match(/stripe-(\d+)-background-size/)&&n.value&&(this._private.hasStripe=!0),n.mapped&&this[r].mappedProperties.push(n),this[r].selector||(this._private.coreStyle[n.name]=n)}return this},hK.append=function(e){return iF(e)?e.appendToStyle(this):YP(e)?this.appendFromJson(e):qP(e)&&this.appendFromString(e),this},mK.fromJson=function(e,t){var n=new mK(e);return n.fromJson(t),n},mK.fromString=function(e,t){return new mK(e).fromString(t)},[iK,sK,cK,lK,uK,dK,fK,pK].forEach(function(e){EF(hK,e)}),mK.types=hK.types,mK.properties=hK.properties,mK.propertyGroups=hK.propertyGroups,mK.propertyGroupNames=hK.propertyGroupNames,mK.propertyGroupKeys=hK.propertyGroupKeys;var gK={style:function(e){return e&&this.setStyle(e).update(),this._private.style},setStyle:function(e){var t=this._private;return iF(e)?t.style=e.generateStyle(this):YP(e)?t.style=mK.fromJson(this,e):qP(e)?t.style=mK.fromString(this,e):t.style=mK(this),t.style},updateStyle:function(){this.mutableElements().updateStyle()}},_K=`single`,vK={autolock:function(e){if(e!==void 0)this._private.autolock=!!e;else return this._private.autolock;return this},autoungrabify:function(e){if(e!==void 0)this._private.autoungrabify=!!e;else return this._private.autoungrabify;return this},autounselectify:function(e){if(e!==void 0)this._private.autounselectify=!!e;else return this._private.autounselectify;return this},selectionType:function(e){var t=this._private;if(t.selectionType??=_K,e!==void 0)(e===`additive`||e===`single`)&&(t.selectionType=e);else return t.selectionType;return this},panningEnabled:function(e){if(e!==void 0)this._private.panningEnabled=!!e;else return this._private.panningEnabled;return this},userPanningEnabled:function(e){if(e!==void 0)this._private.userPanningEnabled=!!e;else return this._private.userPanningEnabled;return this},zoomingEnabled:function(e){if(e!==void 0)this._private.zoomingEnabled=!!e;else return this._private.zoomingEnabled;return this},userZoomingEnabled:function(e){if(e!==void 0)this._private.userZoomingEnabled=!!e;else return this._private.userZoomingEnabled;return this},boxSelectionEnabled:function(e){if(e!==void 0)this._private.boxSelectionEnabled=!!e;else return this._private.boxSelectionEnabled;return this},pan:function(){var e=arguments,t=this._private.pan,n,r,i,a,o;switch(e.length){case 0:return t;case 1:if(qP(e[0]))return n=e[0],t[n];if(XP(e[0])){if(!this._private.panningEnabled)return this;i=e[0],a=i.x,o=i.y,$(a)&&(t.x=a),$(o)&&(t.y=o),this.emit(`pan viewport`)}break;case 2:if(!this._private.panningEnabled)return this;n=e[0],r=e[1],(n===`x`||n===`y`)&&$(r)&&(t[n]=r),this.emit(`pan viewport`);break}return this.notify(`viewport`),this},panBy:function(e,t){var n=arguments,r=this._private.pan,i,a,o,s,c;if(!this._private.panningEnabled)return this;switch(n.length){case 1:XP(e)&&(o=n[0],s=o.x,c=o.y,$(s)&&(r.x+=s),$(c)&&(r.y+=c),this.emit(`pan viewport`));break;case 2:i=e,a=t,(i===`x`||i===`y`)&&$(a)&&(r[i]+=a),this.emit(`pan viewport`);break}return this.notify(`viewport`),this},gc:function(){this.notify(`gc`)},fit:function(e,t){var n=this.getFitViewport(e,t);if(n){var r=this._private;r.zoom=n.zoom,r.pan=n.pan,this.emit(`pan zoom viewport`),this.notify(`viewport`)}return this},getFitViewport:function(e,t){if($(e)&&t===void 0&&(t=e,e=void 0),!(!this._private.panningEnabled||!this._private.zoomingEnabled)){var n;if(qP(e)){var r=e;e=this.$(r)}else if(cF(e)){var i=e;n={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2},n.w=n.x2-n.x1,n.h=n.y2-n.y1}else eF(e)||(e=this.mutableElements());if(!(eF(e)&&e.empty())){n||=e.boundingBox();var a=this.width(),o=this.height(),s;if(t=$(t)?t:0,!isNaN(a)&&!isNaN(o)&&a>0&&o>0&&!isNaN(n.w)&&!isNaN(n.h)&&n.w>0&&n.h>0){s=Math.min((a-2*t)/n.w,(o-2*t)/n.h),s=s>this._private.maxZoom?this._private.maxZoom:s,s=s<this._private.minZoom?this._private.minZoom:s;var c={x:(a-s*(n.x1+n.x2))/2,y:(o-s*(n.y1+n.y2))/2};return{zoom:s,pan:c}}}}},zoomRange:function(e,t){var n=this._private;if(t==null){var r=e;e=r.min,t=r.max}return $(e)&&$(t)&&e<=t?(n.minZoom=e,n.maxZoom=t):$(e)&&t===void 0&&e<=n.maxZoom?n.minZoom=e:$(t)&&e===void 0&&t>=n.minZoom&&(n.maxZoom=t),this},minZoom:function(e){return e===void 0?this._private.minZoom:this.zoomRange({min:e})},maxZoom:function(e){return e===void 0?this._private.maxZoom:this.zoomRange({max:e})},getZoomedViewport:function(e){var t=this._private,n=t.pan,r=t.zoom,i,a,o=!1;if(t.zoomingEnabled||(o=!0),$(e)?a=e:XP(e)&&(a=e.level,e.position==null?e.renderedPosition!=null&&(i=e.renderedPosition):i=GL(e.position,r,n),i!=null&&!t.panningEnabled&&(o=!0)),a=a>t.maxZoom?t.maxZoom:a,a=a<t.minZoom?t.minZoom:a,o||!$(a)||a===r||i!=null&&(!$(i.x)||!$(i.y)))return null;if(i!=null){var s=n,c=r,l=a;return{zoomed:!0,panned:!0,zoom:l,pan:{x:-l/c*(i.x-s.x)+i.x,y:-l/c*(i.y-s.y)+i.y}}}else return{zoomed:!0,panned:!1,zoom:a,pan:n}},zoom:function(e){if(e===void 0)return this._private.zoom;var t=this.getZoomedViewport(e),n=this._private;return t==null||!t.zoomed?this:(n.zoom=t.zoom,t.panned&&(n.pan.x=t.pan.x,n.pan.y=t.pan.y),this.emit(`zoom`+(t.panned?` pan`:``)+` viewport`),this.notify(`viewport`),this)},viewport:function(e){var t=this._private,n=!0,r=!0,i=[],a=!1,o=!1;if(!e||($(e.zoom)||(n=!1),XP(e.pan)||(r=!1),!n&&!r))return this;if(n){var s=e.zoom;s<t.minZoom||s>t.maxZoom||!t.zoomingEnabled?a=!0:(t.zoom=s,i.push(`zoom`))}if(r&&(!a||!e.cancelOnFailedZoom)&&t.panningEnabled){var c=e.pan;$(c.x)&&(t.pan.x=c.x,o=!1),$(c.y)&&(t.pan.y=c.y,o=!1),o||i.push(`pan`)}return i.length>0&&(i.push(`viewport`),this.emit(i.join(` `)),this.notify(`viewport`)),this},center:function(e){var t=this.getCenterPan(e);return t&&(this._private.pan=t,this.emit(`pan viewport`),this.notify(`viewport`)),this},getCenterPan:function(e,t){if(this._private.panningEnabled){if(qP(e)){var n=e;e=this.mutableElements().filter(n)}else eF(e)||(e=this.mutableElements());if(e.length!==0){var r=e.boundingBox(),i=this.width(),a=this.height();return t=t===void 0?this._private.zoom:t,{x:(i-t*(r.x1+r.x2))/2,y:(a-t*(r.y1+r.y2))/2}}}},reset:function(){return!this._private.panningEnabled||!this._private.zoomingEnabled||this.viewport({pan:{x:0,y:0},zoom:1}),this},invalidateSize:function(){this._private.sizeCache=null},size:function(){var e=this._private,t=e.container,n=this;return e.sizeCache=e.sizeCache||(t?function(){var e=n.window().getComputedStyle(t),r=function(t){return parseFloat(e.getPropertyValue(t))};return{width:t.clientWidth-r(`padding-left`)-r(`padding-right`),height:t.clientHeight-r(`padding-top`)-r(`padding-bottom`)}}():{width:1,height:1})},width:function(){return this.size().width},height:function(){return this.size().height},extent:function(){var e=this._private.pan,t=this._private.zoom,n=this.renderedExtent(),r={x1:(n.x1-e.x)/t,x2:(n.x2-e.x)/t,y1:(n.y1-e.y)/t,y2:(n.y2-e.y)/t};return r.w=r.x2-r.x1,r.h=r.y2-r.y1,r},renderedExtent:function(){var e=this.width(),t=this.height();return{x1:0,y1:0,x2:e,y2:t,w:e,h:t}},multiClickDebounceTime:function(e){if(e)this._private.multiClickDebounceTime=e;else return this._private.multiClickDebounceTime;return this}};vK.centre=vK.center,vK.autolockNodes=vK.autolock,vK.autoungrabifyNodes=vK.autoungrabify;var yK={data:kU.data({field:`data`,bindingEvent:`data`,allowBinding:!0,allowSetting:!0,settingEvent:`data`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeData:kU.removeData({field:`data`,event:`data`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0}),scratch:kU.data({field:`scratch`,bindingEvent:`scratch`,allowBinding:!0,allowSetting:!0,settingEvent:`scratch`,settingTriggersEvent:!0,triggerFnName:`trigger`,allowGetting:!0,updateStyle:!0}),removeScratch:kU.removeData({field:`scratch`,event:`scratch`,triggerFnName:`trigger`,triggerEvent:!0,updateStyle:!0})};yK.attr=yK.data,yK.removeAttr=yK.removeData;var bK=function(e){var t=this;e=EF({},e);var n=e.container;n&&!$P(n)&&$P(n[0])&&(n=n[0]);var r=n?n._cyreg:null;r||={},r&&r.cy&&(r.cy.destroy(),r={});var i=r.readies=r.readies||[];n&&(n._cyreg=r),r.cy=t;var a=BP!==void 0&&n!==void 0&&!e.headless,o=e;o.layout=EF({name:a?`grid`:`null`},o.layout),o.renderer=EF({name:a?`canvas`:`null`},o.renderer);var s=function(e,t,n){return t===void 0?n===void 0?e:n:t},c=this._private={container:n,ready:!1,options:o,elements:new PG(this),listeners:[],aniEles:new PG(this),data:o.data||{},scratch:{},layout:null,renderer:null,destroyed:!1,notificationsEnabled:!0,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:s(!0,o.zoomingEnabled),userZoomingEnabled:s(!0,o.userZoomingEnabled),panningEnabled:s(!0,o.panningEnabled),userPanningEnabled:s(!0,o.userPanningEnabled),boxSelectionEnabled:s(!0,o.boxSelectionEnabled),autolock:s(!1,o.autolock,o.autolockNodes),autoungrabify:s(!1,o.autoungrabify,o.autoungrabifyNodes),autounselectify:s(!1,o.autounselectify),styleEnabled:o.styleEnabled===void 0?a:o.styleEnabled,zoom:$(o.zoom)?o.zoom:1,pan:{x:XP(o.pan)&&$(o.pan.x)?o.pan.x:0,y:XP(o.pan)&&$(o.pan.y)?o.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:!1,multiClickDebounceTime:s(250,o.multiClickDebounceTime)};this.createEmitter(),this.selectionType(o.selectionType),this.zoomRange({min:o.minZoom,max:o.maxZoom});var l=function(e,t){if(e.some(lF))return kB.all(e).then(t);t(e)};c.styleEnabled&&t.setStyle([]);var u=EF({},o,o.renderer);t.initRenderer(u);var d=function(e,n,r){t.notifications(!1);var i=t.mutableElements();i.length>0&&i.remove(),e!=null&&(XP(e)||YP(e))&&t.add(e),t.one(`layoutready`,function(e){t.notifications(!0),t.emit(e),t.one(`load`,n),t.emitAndNotify(`load`)}).one(`layoutstop`,function(){t.one(`done`,r),t.emit(`done`)});var a=EF({},t._private.options.layout);a.eles=t.elements(),t.layout(a).run()};l([o.style,o.elements],function(e){var n=e[0],a=e[1];c.styleEnabled&&t.style().append(n),d(a,function(){t.startAnimationLoop(),c.ready=!0,JP(o.ready)&&t.on(`ready`,o.ready);for(var e=0;e<i.length;e++){var n=i[e];t.on(`ready`,n)}r&&(r.readies=[]),t.emit(`ready`)},o.done)})},xK=bK.prototype;EF(xK,{instanceString:function(){return`core`},isReady:function(){return this._private.ready},destroyed:function(){return this._private.destroyed},ready:function(e){return this.isReady()?this.emitter().emit(`ready`,[],e):this.on(`ready`,e),this},destroy:function(){var e=this;if(!e.destroyed())return e.stopAnimationLoop(),e.destroyRenderer(),this.emit(`destroy`),e._private.destroyed=!0,e},hasElementWithId:function(e){return this._private.elements.hasElementWithId(e)},getElementById:function(e){return this._private.elements.getElementById(e)},hasCompoundNodes:function(){return this._private.hasCompoundNodes},headless:function(){return this._private.renderer.isHeadless()},styleEnabled:function(){return this._private.styleEnabled},addToPool:function(e){return this._private.elements.merge(e),this},removeFromPool:function(e){return this._private.elements.unmerge(e),this},container:function(){return this._private.container||null},window:function(){if(this._private.container==null)return BP;var e=this._private.container.ownerDocument;return e===void 0||e==null?BP:e.defaultView||BP},mount:function(e){if(e!=null){var t=this,n=t._private,r=n.options;return!$P(e)&&$P(e[0])&&(e=e[0]),t.stopAnimationLoop(),t.destroyRenderer(),n.container=e,n.styleEnabled=!0,t.invalidateSize(),t.initRenderer(EF({},r,r.renderer,{name:r.renderer.name===`null`?`canvas`:r.renderer.name})),t.startAnimationLoop(),t.style(r.style),t.emit(`mount`),t}},unmount:function(){var e=this;return e.stopAnimationLoop(),e.destroyRenderer(),e.initRenderer({name:`null`}),e.emit(`unmount`),e},options:function(){return aL(this._private.options)},json:function(e){var t=this,n=t._private,r=t.mutableElements(),i=function(e){return t.getElementById(e.id())};if(XP(e)){if(t.startBatch(),e.elements){var a={},o=function(e,n){for(var r=[],i=[],o=0;o<e.length;o++){var s=e[o];if(!s.data.id){rL(`cy.json() cannot handle elements without an ID attribute`);continue}var c=``+s.data.id,l=t.getElementById(c);a[c]=!0,l.length===0?(n&&(s.group=n),r.push(s)):i.push({ele:l,json:s})}t.add(r);for(var u=0;u<i.length;u++){var d=i[u],f=d.ele,p=d.json;f.json(p)}};if(YP(e.elements))o(e.elements);else for(var s=[`nodes`,`edges`],c=0;c<s.length;c++){var l=s[c],u=e.elements[l];YP(u)&&o(u,l)}var d=t.collection();r.filter(function(e){return!a[e.id()]}).forEach(function(e){e.isParent()?d.merge(e):e.remove()}),d.forEach(function(e){return e.children().move({parent:null})}),d.forEach(function(e){return i(e).remove()})}e.style&&t.style(e.style),e.zoom!=null&&e.zoom!==n.zoom&&t.zoom(e.zoom),e.pan&&(e.pan.x!==n.pan.x||e.pan.y!==n.pan.y)&&t.pan(e.pan),e.data&&t.data(e.data);for(var f=[`minZoom`,`maxZoom`,`zoomingEnabled`,`userZoomingEnabled`,`panningEnabled`,`userPanningEnabled`,`boxSelectionEnabled`,`autolock`,`autoungrabify`,`autounselectify`,`multiClickDebounceTime`],p=0;p<f.length;p++){var m=f[p];e[m]!=null&&t[m](e[m])}return t.endBatch(),this}else{var h=!!e,g={};h?g.elements=this.elements().map(function(e){return e.json()}):(g.elements={},r.forEach(function(e){var t=e.group();g.elements[t]||(g.elements[t]=[]),g.elements[t].push(e.json())})),this._private.styleEnabled&&(g.style=t.style().json()),g.data=aL(t.data());var _=n.options;return g.zoomingEnabled=n.zoomingEnabled,g.userZoomingEnabled=n.userZoomingEnabled,g.zoom=n.zoom,g.minZoom=n.minZoom,g.maxZoom=n.maxZoom,g.panningEnabled=n.panningEnabled,g.userPanningEnabled=n.userPanningEnabled,g.pan=aL(n.pan),g.boxSelectionEnabled=n.boxSelectionEnabled,g.renderer=aL(_.renderer),g.hideEdgesOnViewport=_.hideEdgesOnViewport,g.textureOnViewport=_.textureOnViewport,g.wheelSensitivity=_.wheelSensitivity,g.motionBlur=_.motionBlur,g.multiClickDebounceTime=_.multiClickDebounceTime,g}}}),xK.$id=xK.getElementById,[IG,JG,ZG,QG,$G,eK,nK,rK,gK,vK,yK].forEach(function(e){EF(xK,e)});var SK={fit:!0,directed:!1,direction:`downward`,padding:30,circle:!1,grid:!1,spacingFactor:1.75,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,roots:void 0,depthSort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}},CK={maximal:!1,acyclic:!1},wK=function(e){return e.scratch(`breadthfirst`)},TK=function(e,t){return e.scratch(`breadthfirst`,t)};function EK(e){this.options=EF({},SK,CK,e)}EK.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=n.nodes().filter(function(e){return e.isChildless()}),i=n,a=e.directed,o=e.acyclic||e.maximal||e.maximalAdjustments>0,s=!!e.boundingBox,c=lR(s?e.boundingBox:structuredClone(t.extent())),l;if(eF(e.roots))l=e.roots;else if(YP(e.roots)){for(var u=[],d=0;d<e.roots.length;d++){var f=e.roots[d],p=t.getElementById(f);u.push(p)}l=t.collection(u)}else if(qP(e.roots))l=t.$(e.roots);else if(a)l=r.roots();else{var m=n.components();l=t.collection();for(var h=function(){var e=m[g],t=e.maxDegree(!1),n=e.filter(function(e){return e.degree(!1)===t});l=l.add(n)},g=0;g<m.length;g++)h()}var _=[],v={},y=function(e,t){_[t]??(_[t]=[]);var n=_[t].length;_[t].push(e),TK(e,{index:n,depth:t})},b=function(e,t){var n=wK(e),r=n.depth,i=n.index;_[r][i]=null,e.isChildless()&&y(e,t)};i.bfs({roots:l,directed:e.directed,visit:function(e,t,n,r,i){var a=e[0],o=a.id();a.isChildless()&&y(a,i),v[o]=!0}});for(var x=[],S=0;S<r.length;S++){var C=r[S];v[C.id()]||x.push(C)}var w=function(e){for(var t=_[e],n=0;n<t.length;n++){var r=t[n];if(r==null){t.splice(n,1),n--;continue}TK(r,{depth:e,index:n})}},T=function(t,r){for(var i=wK(t),a=t.incomers().filter(function(e){return e.isNode()&&n.has(e)}),o=-1,s=t.id(),c=0;c<a.length;c++){var l=a[c],u=wK(l);o=Math.max(o,u.depth)}if(i.depth<=o){if(!e.acyclic&&r[s])return null;var d=o+1;return b(t,d),r[s]=d,!0}return!1};if(a&&o){var E=[],D={},O=function(e){return E.push(e)},k=function(){return E.shift()};for(r.forEach(function(e){return E.push(e)});E.length>0;){var A=k(),j=T(A,D);if(j)A.outgoers().filter(function(e){return e.isNode()&&n.has(e)}).forEach(O);else if(j===null){rL("Detected double maximal shift for node `"+A.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var M=0;if(e.avoidOverlap)for(var N=0;N<r.length;N++){var P=r[N].layoutDimensions(e),F=P.w,I=P.h;M=Math.max(M,F,I)}var L={},R=function(e){if(L[e.id()])return L[e.id()];for(var t=wK(e).depth,n=e.neighborhood(),i=0,a=0,o=0;o<n.length;o++){var s=n[o];if(!(s.isEdge()||s.isParent()||!r.has(s))){var c=wK(s);if(c!=null){var l=c.index,u=c.depth;if(!(l==null||u==null)){var d=_[u].length;u<t&&(i+=l/d,a++)}}}}return a=Math.max(1,a),i/=a,a===0&&(i=0),L[e.id()]=i,i},ee=function(e,t){var n=R(e)-R(t);return n===0?wF(e.id(),t.id()):n};e.depthSort!==void 0&&(ee=e.depthSort);for(var z=_.length,B=0;B<z;B++)_[B].sort(ee),w(B);for(var V=[],H=0;H<x.length;H++)V.push(x[H]);V.length&&(_.unshift(V),z=_.length,function(){for(var e=0;e<z;e++)w(e)}());for(var te=0,ne=0;ne<z;ne++)te=Math.max(_[ne].length,te);var U={x:c.x1+c.w/2,y:c.y1+c.h/2},re=r.reduce(function(t,n){return function(e){return{w:t.w===-1?e.w:(t.w+e.w)/2,h:t.h===-1?e.h:(t.h+e.h)/2}}(n.boundingBox({includeLabels:e.nodeDimensionsIncludeLabels}))},{w:-1,h:-1}),ie=Math.max(z===1?0:s?(c.h-e.padding*2-re.h)/(z-1):(c.h-e.padding*2-re.h)/(z+1),M),ae=_.reduce(function(e,t){return Math.max(e,t.length)},0),oe=function(t){var n=wK(t),r=n.depth,i=n.index;if(e.circle){var a=Math.min(c.w/2/z,c.h/2/z);a=Math.max(a,M);var o=a*r+a-(z>0&&_[0].length<=3?a/2:0),l=2*Math.PI/_[r].length*i;return r===0&&_[0].length===1&&(o=1),{x:U.x+o*Math.cos(l),y:U.y+o*Math.sin(l)}}else{var u=_[r].length,d=Math.max(u===1?0:s?(c.w-e.padding*2-re.w)/((e.grid?ae:u)-1):(c.w-e.padding*2-re.w)/((e.grid?ae:u)+1),M);return{x:U.x+(i+1-(u+1)/2)*d,y:U.y+(r+1-(z+1)/2)*ie}}},se={downward:0,leftward:90,upward:180,rightward:-90};return Object.keys(se).indexOf(e.direction)===-1&&tL(`Invalid direction '${e.direction}' specified for breadthfirst layout. Valid values are: ${Object.keys(se).join(`, `)}`),n.nodes().layoutPositions(this,e,function(t){return KI(oe(t),c,se[e.direction])}),this};var DK={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,radius:void 0,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function OK(e){this.options=EF({},DK,e)}OK.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,a=r.nodes().not(`:parent`);t.sort&&(a=a.sort(t.sort));for(var o=lR(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},c=(t.sweep===void 0?2*Math.PI-2*Math.PI/a.length:t.sweep)/Math.max(1,a.length-1),l,u=0,d=0;d<a.length;d++){var f=a[d].layoutDimensions(t),p=f.w,m=f.h;u=Math.max(u,p,m)}if(l=$(t.radius)?t.radius:a.length<=1?0:Math.min(o.h,o.w)/2-u,a.length>1&&t.avoidOverlap){u*=1.75;var h=Math.cos(c)-Math.cos(0),g=Math.sin(c)-Math.sin(0),_=Math.sqrt(u*u/(h*h+g*g));l=Math.max(_,l)}return r.nodes().layoutPositions(this,t,function(e,n){var r=t.startAngle+n*c*(i?1:-1),a=l*Math.cos(r),o=l*Math.sin(r);return{x:s.x+a,y:s.y+o}}),this};var kK={fit:!0,padding:30,startAngle:3/2*Math.PI,sweep:void 0,clockwise:!0,equidistant:!1,minNodeSpacing:10,boundingBox:void 0,avoidOverlap:!0,nodeDimensionsIncludeLabels:!1,height:void 0,width:void 0,spacingFactor:void 0,concentric:function(e){return e.degree()},levelWidth:function(e){return e.maxDegree()/4},animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function AK(e){this.options=EF({},kK,e)}AK.prototype.run=function(){for(var e=this.options,t=e,n=t.counterclockwise===void 0?t.clockwise:!t.counterclockwise,r=e.cy,i=t.eles,a=i.nodes().not(`:parent`),o=lR(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()}),s={x:o.x1+o.w/2,y:o.y1+o.h/2},c=[],l=0,u=0;u<a.length;u++){var d=a[u],f=void 0;f=t.concentric(d),c.push({value:f,node:d}),d._private.scratch.concentric=f}a.updateStyle();for(var p=0;p<a.length;p++){var m=a[p].layoutDimensions(t);l=Math.max(l,m.w,m.h)}c.sort(function(e,t){return t.value-e.value});for(var h=t.levelWidth(a),g=[[]],_=g[0],v=0;v<c.length;v++){var y=c[v];_.length>0&&Math.abs(_[0].value-y.value)>=h&&(_=[],g.push(_)),_.push(y)}var b=l+t.minNodeSpacing;if(!t.avoidOverlap){var x=g.length>0&&g[0].length>1,S=(Math.min(o.w,o.h)/2-b)/(g.length+x?1:0);b=Math.min(b,S)}for(var C=0,w=0;w<g.length;w++){var T=g[w],E=T.dTheta=(t.sweep===void 0?2*Math.PI-2*Math.PI/T.length:t.sweep)/Math.max(1,T.length-1);if(T.length>1&&t.avoidOverlap){var D=Math.cos(E)-Math.cos(0),O=Math.sin(E)-Math.sin(0),k=Math.sqrt(b*b/(D*D+O*O));C=Math.max(k,C)}T.r=C,C+=b}if(t.equidistant){for(var A=0,j=0,M=0;M<g.length;M++){var N=g[M].r-j;A=Math.max(A,N)}j=0;for(var P=0;P<g.length;P++){var F=g[P];P===0&&(j=F.r),F.r=j,j+=A}}for(var I={},L=0;L<g.length;L++)for(var R=g[L],ee=R.dTheta,z=R.r,B=0;B<R.length;B++){var V=R[B],H=t.startAngle+(n?1:-1)*ee*B,te={x:s.x+z*Math.cos(H),y:s.y+z*Math.sin(H)};I[V.node.id()]=te}return i.nodes().layoutPositions(this,t,function(e){return I[e.id()]}),this};var jK,MK={ready:function(){},stop:function(){},animate:!0,animationEasing:void 0,animationDuration:void 0,animateFilter:function(e,t){return!0},animationThreshold:250,refresh:20,fit:!0,padding:30,boundingBox:void 0,nodeDimensionsIncludeLabels:!1,randomize:!1,componentSpacing:40,nodeRepulsion:function(e){return 2048},nodeOverlap:4,idealEdgeLength:function(e){return 32},edgeElasticity:function(e){return 32},nestingFactor:1.2,gravity:1,numIter:1e3,initialTemp:1e3,coolingFactor:.99,minTemp:1};function NK(e){this.options=EF({},MK,e),this.options.layout=this;var t=this.options.eles.nodes(),n=this.options.eles.edges().filter(function(e){var n=e.source().data(`id`),r=e.target().data(`id`),i=t.some(function(e){return e.data(`id`)===n}),a=t.some(function(e){return e.data(`id`)===r});return!i||!a});this.options.eles=this.options.eles.not(n)}NK.prototype.run=function(){var e=this.options,t=e.cy,n=this;n.stopped=!1,(e.animate===!0||e.animate===!1)&&n.emit({type:`layoutstart`,layout:n}),jK=!0===e.debug;var r=PK(t,n,e);jK&&LK(r),e.randomize&&RK(r);var i=AI(),a=function(){BK(r,t,e),!0===e.fit&&t.fit(e.padding)},o=function(t){return!(n.stopped||t>=e.numIter||(VK(r,e),r.temperature*=e.coolingFactor,r.temperature<e.minTemp))},s=function(){if(e.animate===!0||e.animate===!1)a(),n.one(`layoutstop`,e.stop),n.emit({type:`layoutstop`,layout:n});else{var t=e.eles.nodes(),i=zK(r,e,t);t.layoutPositions(n,e,i)}},c=0,l=!0;if(e.animate===!0){var u=function(){for(var t=0;l&&t<e.refresh;)l=o(c),c++,t++;l?(AI()-i>=e.animationThreshold&&a(),kI(u)):($K(r,e),s())};u()}else{for(;l;)l=o(c),c++;$K(r,e),s()}return this},NK.prototype.stop=function(){return this.stopped=!0,this.thread&&this.thread.stop(),this.emit(`layoutstop`),this},NK.prototype.destroy=function(){return this.thread&&this.thread.stop(),this};var PK=function(e,t,n){for(var r=n.eles.edges(),i=n.eles.nodes(),a=lR(n.boundingBox?n.boundingBox:{x1:0,y1:0,w:e.width(),h:e.height()}),o={isCompound:e.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:r.size(),temperature:n.initialTemp,clientWidth:a.w,clientHeight:a.h,boundingBox:a},s=n.eles.components(),c={},l=0;l<s.length;l++)for(var u=s[l],d=0;d<u.length;d++){var f=u[d];c[f.id()]=l}for(var l=0;l<o.nodeSize;l++){var p=i[l],m=p.layoutDimensions(n),h={};h.isLocked=p.locked(),h.id=p.data(`id`),h.parentId=p.data(`parent`),h.cmptId=c[p.id()],h.children=[],h.positionX=p.position(`x`),h.positionY=p.position(`y`),h.offsetX=0,h.offsetY=0,h.height=m.w,h.width=m.h,h.maxX=h.positionX+h.width/2,h.minX=h.positionX-h.width/2,h.maxY=h.positionY+h.height/2,h.minY=h.positionY-h.height/2,h.padLeft=parseFloat(p.style(`padding`)),h.padRight=parseFloat(p.style(`padding`)),h.padTop=parseFloat(p.style(`padding`)),h.padBottom=parseFloat(p.style(`padding`)),h.nodeRepulsion=JP(n.nodeRepulsion)?n.nodeRepulsion(p):n.nodeRepulsion,o.layoutNodes.push(h),o.idToIndex[h.id]=l}for(var g=[],_=0,v=-1,y=[],l=0;l<o.nodeSize;l++){var p=o.layoutNodes[l],b=p.parentId;b==null?(g[++v]=p.id,y.push(p.id)):o.layoutNodes[o.idToIndex[b]].children.push(p.id)}for(o.graphSet.push(y);_<=v;){var x=g[_++],S=o.idToIndex[x],f=o.layoutNodes[S],C=f.children;if(C.length>0){o.graphSet.push(C);for(var l=0;l<C.length;l++)g[++v]=C[l]}}for(var l=0;l<o.graphSet.length;l++)for(var w=o.graphSet[l],d=0;d<w.length;d++){var T=o.idToIndex[w[d]];o.indexToGraph[T]=l}for(var l=0;l<o.edgeSize;l++){var E=r[l],D={};D.id=E.data(`id`),D.sourceId=E.data(`source`),D.targetId=E.data(`target`);var O=JP(n.idealEdgeLength)?n.idealEdgeLength(E):n.idealEdgeLength,k=JP(n.edgeElasticity)?n.edgeElasticity(E):n.edgeElasticity,A=o.idToIndex[D.sourceId],j=o.idToIndex[D.targetId];if(o.indexToGraph[A]!=o.indexToGraph[j]){for(var M=FK(D.sourceId,D.targetId,o),N=o.graphSet[M],P=0,h=o.layoutNodes[A];N.indexOf(h.id)===-1;)h=o.layoutNodes[o.idToIndex[h.parentId]],P++;for(h=o.layoutNodes[j];N.indexOf(h.id)===-1;)h=o.layoutNodes[o.idToIndex[h.parentId]],P++;O*=P*n.nestingFactor}D.idealLength=O,D.elasticity=k,o.layoutEdges.push(D)}return o},FK=function(e,t,n){var r=IK(e,t,0,n);return 2>r.count?0:r.graph},IK=function(e,t,n,r){var i=r.graphSet[n];if(-1<i.indexOf(e)&&-1<i.indexOf(t))return{count:2,graph:n};for(var a=0,o=0;o<i.length;o++){var s=i[o],c=r.idToIndex[s],l=r.layoutNodes[c].children;if(l.length!==0){var u=r.indexToGraph[r.idToIndex[l[0]]],d=IK(e,t,u,r);if(d.count!==0)if(d.count===1){if(a++,a===2)break}else return d}}return{count:a,graph:n}},LK,RK=function(e,t){for(var n=e.clientWidth,r=e.clientHeight,i=0;i<e.nodeSize;i++){var a=e.layoutNodes[i];a.children.length===0&&!a.isLocked&&(a.positionX=Math.random()*n,a.positionY=Math.random()*r)}},zK=function(e,t,n){var r=e.boundingBox,i={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0};return t.boundingBox&&(n.forEach(function(t){var n=e.layoutNodes[e.idToIndex[t.data(`id`)]];i.x1=Math.min(i.x1,n.positionX),i.x2=Math.max(i.x2,n.positionX),i.y1=Math.min(i.y1,n.positionY),i.y2=Math.max(i.y2,n.positionY)}),i.w=i.x2-i.x1,i.h=i.y2-i.y1),function(n,a){var o=e.layoutNodes[e.idToIndex[n.data(`id`)]];if(t.boundingBox){var s=i.w===0?.5:(o.positionX-i.x1)/i.w,c=i.h===0?.5:(o.positionY-i.y1)/i.h;return{x:r.x1+s*r.w,y:r.y1+c*r.h}}else return{x:o.positionX,y:o.positionY}}},BK=function(e,t,n){var r=n.layout,i=n.eles.nodes(),a=zK(e,n,i);i.positions(a),!0!==e.ready&&(e.ready=!0,r.one(`layoutready`,n.ready),r.emit({type:`layoutready`,layout:this}))},VK=function(e,t,n){HK(e,t),qK(e),JK(e,t),YK(e),XK(e)},HK=function(e,t){for(var n=0;n<e.graphSet.length;n++)for(var r=e.graphSet[n],i=r.length,a=0;a<i;a++)for(var o=e.layoutNodes[e.idToIndex[r[a]]],s=a+1;s<i;s++){var c=e.layoutNodes[e.idToIndex[r[s]]];WK(o,c,e,t)}},UK=function(e){return-1+2*e*Math.random()},WK=function(e,t,n,r){if(!(e.cmptId!==t.cmptId&&!n.isCompound)){var i=t.positionX-e.positionX,a=t.positionY-e.positionY,o=1;i===0&&a===0&&(i=UK(o),a=UK(o));var s=GK(e,t,i,a);if(s>0)var c=r.nodeOverlap*s,l=Math.sqrt(i*i+a*a),u=c*i/l,d=c*a/l;else var f=KK(e,i,a),p=KK(t,-1*i,-1*a),m=p.x-f.x,h=p.y-f.y,g=m*m+h*h,l=Math.sqrt(g),c=(e.nodeRepulsion+t.nodeRepulsion)/g,u=c*m/l,d=c*h/l;e.isLocked||(e.offsetX-=u,e.offsetY-=d),t.isLocked||(t.offsetX+=u,t.offsetY+=d)}},GK=function(e,t,n,r){if(n>0)var i=e.maxX-t.minX;else var i=t.maxX-e.minX;if(r>0)var a=e.maxY-t.minY;else var a=t.maxY-e.minY;return i>=0&&a>=0?Math.sqrt(i*i+a*a):0},KK=function(e,t,n){var r=e.positionX,i=e.positionY,a=e.height||1,o=e.width||1,s=n/t,c=a/o,l={};return t===0&&0<n||t===0&&0>n?(l.x=r,l.y=i+a/2,l):0<t&&-1*c<=s&&s<=c?(l.x=r+o/2,l.y=i+o*n/2/t,l):0>t&&-1*c<=s&&s<=c?(l.x=r-o/2,l.y=i-o*n/2/t,l):0<n&&(s<=-1*c||s>=c)?(l.x=r+a*t/2/n,l.y=i+a/2,l):0>n&&(s<=-1*c||s>=c)?(l.x=r-a*t/2/n,l.y=i-a/2,l):l},qK=function(e,t){for(var n=0;n<e.edgeSize;n++){var r=e.layoutEdges[n],i=e.idToIndex[r.sourceId],a=e.layoutNodes[i],o=e.idToIndex[r.targetId],s=e.layoutNodes[o],c=s.positionX-a.positionX,l=s.positionY-a.positionY;if(!(c===0&&l===0)){var u=KK(a,c,l),d=KK(s,-1*c,-1*l),f=d.x-u.x,p=d.y-u.y,m=Math.sqrt(f*f+p*p),h=(r.idealLength-m)**2/r.elasticity;if(m!==0)var g=h*f/m,_=h*p/m;else var g=0,_=0;a.isLocked||(a.offsetX+=g,a.offsetY+=_),s.isLocked||(s.offsetX-=g,s.offsetY-=_)}}},JK=function(e,t){if(t.gravity!==0)for(var n=1,r=0;r<e.graphSet.length;r++){var i=e.graphSet[r],a=i.length;if(r===0)var o=e.clientHeight/2,s=e.clientWidth/2;else var c=e.layoutNodes[e.idToIndex[i[0]]],l=e.layoutNodes[e.idToIndex[c.parentId]],o=l.positionX,s=l.positionY;for(var u=0;u<a;u++){var d=e.layoutNodes[e.idToIndex[i[u]]];if(!d.isLocked){var f=o-d.positionX,p=s-d.positionY,m=Math.sqrt(f*f+p*p);if(m>n){var h=t.gravity*f/m,g=t.gravity*p/m;d.offsetX+=h,d.offsetY+=g}}}}},YK=function(e,t){var n=[],r=0,i=-1;for(n.push.apply(n,e.graphSet[0]),i+=e.graphSet[0].length;r<=i;){var a=n[r++],o=e.idToIndex[a],s=e.layoutNodes[o],c=s.children;if(0<c.length&&!s.isLocked){for(var l=s.offsetX,u=s.offsetY,d=0;d<c.length;d++){var f=e.layoutNodes[e.idToIndex[c[d]]];f.offsetX+=l,f.offsetY+=u,n[++i]=c[d]}s.offsetX=0,s.offsetY=0}}},XK=function(e,t){for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&(r.maxX=void 0,r.minX=void 0,r.maxY=void 0,r.minY=void 0)}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];if(!(0<r.children.length||r.isLocked)){var i=ZK(r.offsetX,r.offsetY,e.temperature);r.positionX+=i.x,r.positionY+=i.y,r.offsetX=0,r.offsetY=0,r.minX=r.positionX-r.width,r.maxX=r.positionX+r.width,r.minY=r.positionY-r.height,r.maxY=r.positionY+r.height,QK(r,e)}}for(var n=0;n<e.nodeSize;n++){var r=e.layoutNodes[n];0<r.children.length&&!r.isLocked&&(r.positionX=(r.maxX+r.minX)/2,r.positionY=(r.maxY+r.minY)/2,r.width=r.maxX-r.minX,r.height=r.maxY-r.minY)}},ZK=function(e,t,n){var r=Math.sqrt(e*e+t*t);if(r>n)var i={x:n*e/r,y:n*t/r};else var i={x:e,y:t};return i},QK=function(e,t){var n=e.parentId;if(n!=null){var r=t.layoutNodes[t.idToIndex[n]],i=!1;if((r.maxX==null||e.maxX+r.padRight>r.maxX)&&(r.maxX=e.maxX+r.padRight,i=!0),(r.minX==null||e.minX-r.padLeft<r.minX)&&(r.minX=e.minX-r.padLeft,i=!0),(r.maxY==null||e.maxY+r.padBottom>r.maxY)&&(r.maxY=e.maxY+r.padBottom,i=!0),(r.minY==null||e.minY-r.padTop<r.minY)&&(r.minY=e.minY-r.padTop,i=!0),i)return QK(r,t)}},$K=function(e,t){for(var n=e.layoutNodes,r=[],i=0;i<n.length;i++){var a=n[i],o=a.cmptId;(r[o]=r[o]||[]).push(a)}for(var s=0,i=0;i<r.length;i++){var c=r[i];if(c){c.x1=1/0,c.x2=-1/0,c.y1=1/0,c.y2=-1/0;for(var l=0;l<c.length;l++){var u=c[l];c.x1=Math.min(c.x1,u.positionX-u.width/2),c.x2=Math.max(c.x2,u.positionX+u.width/2),c.y1=Math.min(c.y1,u.positionY-u.height/2),c.y2=Math.max(c.y2,u.positionY+u.height/2)}c.w=c.x2-c.x1,c.h=c.y2-c.y1,s+=c.w*c.h}}r.sort(function(e,t){return t.w*t.h-e.w*e.h});for(var d=0,f=0,p=0,m=0,h=Math.sqrt(s)*e.clientWidth/e.clientHeight,i=0;i<r.length;i++){var c=r[i];if(c){for(var l=0;l<c.length;l++){var u=c[l];u.isLocked||(u.positionX+=d-c.x1,u.positionY+=f-c.y1)}d+=c.w+t.componentSpacing,p+=c.w+t.componentSpacing,m=Math.max(m,c.h),p>h&&(f+=m+t.componentSpacing,d=0,p=0,m=0)}}},eq={fit:!0,padding:30,boundingBox:void 0,avoidOverlap:!0,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:!1,spacingFactor:void 0,condense:!1,rows:void 0,cols:void 0,position:function(e){},sort:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function tq(e){this.options=EF({},eq,e)}tq.prototype.run=function(){var e=this.options,t=e,n=e.cy,r=t.eles,i=r.nodes().not(`:parent`);t.sort&&(i=i.sort(t.sort));var a=lR(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:n.width(),h:n.height()});if(a.h===0||a.w===0)r.nodes().layoutPositions(this,t,function(e){return{x:a.x1,y:a.y1}});else{var o=i.size(),s=Math.sqrt(o*a.h/a.w),c=Math.round(s),l=Math.round(a.w/a.h*s),u=function(e){if(e==null)return Math.min(c,l);Math.min(c,l)==c?c=e:l=e},d=function(e){if(e==null)return Math.max(c,l);Math.max(c,l)==c?c=e:l=e},f=t.rows,p=t.cols==null?t.columns:t.cols;if(f!=null&&p!=null)c=f,l=p;else if(f!=null&&p==null)c=f,l=Math.ceil(o/c);else if(f==null&&p!=null)l=p,c=Math.ceil(o/l);else if(l*c>o){var m=u(),h=d();(m-1)*h>=o?u(m-1):(h-1)*m>=o&&d(h-1)}else for(;l*c<o;){var g=u(),_=d();(_+1)*g>=o?d(_+1):u(g+1)}var v=a.w/l,y=a.h/c;if(t.condense&&(v=0,y=0),t.avoidOverlap)for(var b=0;b<i.length;b++){var x=i[b],S=x._private.position;(S.x==null||S.y==null)&&(S.x=0,S.y=0);var C=x.layoutDimensions(t),w=t.avoidOverlapPadding,T=C.w+w,E=C.h+w;v=Math.max(v,T),y=Math.max(y,E)}for(var D={},O=function(e,t){return!!D[`c-`+e+`-`+t]},k=function(e,t){D[`c-`+e+`-`+t]=!0},A=0,j=0,M=function(){j++,j>=l&&(j=0,A++)},N={},P=0;P<i.length;P++){var F=i[P],I=t.position(F);if(I&&(I.row!==void 0||I.col!==void 0)){var L={row:I.row,col:I.col};if(L.col===void 0)for(L.col=0;O(L.row,L.col);)L.col++;else if(L.row===void 0)for(L.row=0;O(L.row,L.col);)L.row++;N[F.id()]=L,k(L.row,L.col)}}i.layoutPositions(this,t,function(e,t){var n,r;if(e.locked()||e.isParent())return!1;var i=N[e.id()];if(i)n=i.col*v+v/2+a.x1,r=i.row*y+y/2+a.y1;else{for(;O(A,j);)M();n=j*v+v/2+a.x1,r=A*y+y/2+a.y1,k(A,j),M()}return{x:n,y:r}})}return this};var nq={ready:function(){},stop:function(){}};function rq(e){this.options=EF({},nq,e)}rq.prototype.run=function(){var e=this.options,t=e.eles,n=this;return e.cy,n.emit(`layoutstart`),t.nodes().positions(function(){return{x:0,y:0}}),n.one(`layoutready`,e.ready),n.emit(`layoutready`),n.one(`layoutstop`,e.stop),n.emit(`layoutstop`),this},rq.prototype.stop=function(){return this};var iq={positions:void 0,zoom:void 0,pan:void 0,fit:!0,padding:30,spacingFactor:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function aq(e){this.options=EF({},iq,e)}aq.prototype.run=function(){var e=this.options,t=e.eles.nodes(),n=JP(e.positions);function r(t){return e.positions==null?WL(t.position()):n?e.positions(t):e.positions[t._private.data.id]??null}return t.layoutPositions(this,e,function(e,t){var n=r(e);return e.locked()||n==null?!1:n}),this};var oq={fit:!0,padding:30,boundingBox:void 0,animate:!1,animationDuration:500,animationEasing:void 0,animateFilter:function(e,t){return!0},ready:void 0,stop:void 0,transform:function(e,t){return t}};function sq(e){this.options=EF({},oq,e)}sq.prototype.run=function(){var e=this.options,t=e.cy,n=e.eles,r=lR(e.boundingBox?e.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});return n.nodes().layoutPositions(this,e,function(e,t){return{x:r.x1+Math.round(Math.random()*r.w),y:r.y1+Math.round(Math.random()*r.h)}}),this};var cq=[{name:`breadthfirst`,impl:EK},{name:`circle`,impl:OK},{name:`concentric`,impl:AK},{name:`cose`,impl:NK},{name:`grid`,impl:tq},{name:`null`,impl:rq},{name:`preset`,impl:aq},{name:`random`,impl:sq}];function lq(e){this.options=e,this.notifications=0}var uq=function(){},dq=function(){throw Error(`A headless instance can not render images`)};lq.prototype={recalculateRenderedStyle:uq,notify:function(){this.notifications++},init:uq,isHeadless:function(){return!0},png:dq,jpg:dq};var fq={};fq.arrowShapeWidth=.3,fq.registerArrowShapes=function(){var e=this.arrowShapes={},t=this,n=function(e,t,n,r,i,a,o){var s=i.x-n/2-o,c=i.x+n/2+o,l=i.y-n/2-o,u=i.y+n/2+o;return s<=e&&e<=c&&l<=t&&t<=u},r=function(e,t,n,r,i){var a=e*Math.cos(r)-t*Math.sin(r),o=e*Math.sin(r)+t*Math.cos(r),s=a*n,c=o*n;return{x:s+i.x,y:c+i.y}},i=function(e,t,n,i){for(var a=[],o=0;o<e.length;o+=2){var s=e[o],c=e[o+1];a.push(r(s,c,t,n,i))}return a},a=function(e){for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r.x,r.y)}return t},o=function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).pfValue*2},s=function(r,s){qP(s)&&(s=e[s]),e[r]=EF({name:r,points:[-.15,-.3,.15,-.3,.15,.3,-.15,.3],collide:function(e,t,n,r,o,s){return jR(e,t,a(i(this.points,n+2*s,r,o)))},roughCollide:n,draw:function(e,n,r,a){var o=i(this.points,n,r,a);t.arrowShapeImpl(`polygon`)(e,o)},spacing:function(e){return 0},gap:o},s)};s(`none`,{collide:QI,roughCollide:QI,draw:eL,spacing:$I,gap:$I}),s(`triangle`,{points:[-.15,-.3,0,0,.15,-.3]}),s(`arrow`,`triangle`),s(`triangle-backcurve`,{points:e.triangle.points,controlPoint:[0,-.15],roughCollide:n,draw:function(e,n,a,o,s){var c=i(this.points,n,a,o),l=this.controlPoint,u=r(l[0],l[1],n,a,o);t.arrowShapeImpl(this.name)(e,c,u)},gap:function(e){return o(e)*.8}}),s(`triangle-tee`,{points:[0,0,.15,-.3,-.15,-.3,0,0],pointsTee:[-.15,-.4,-.15,-.5,.15,-.5,.15,-.4],collide:function(e,t,n,r,o,s,c){var l=a(i(this.points,n+2*c,r,o)),u=a(i(this.pointsTee,n+2*c,r,o));return jR(e,t,l)||jR(e,t,u)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),c=i(this.pointsTee,n,r,a);t.arrowShapeImpl(this.name)(e,s,c)}}),s(`circle-triangle`,{radius:.15,pointsTr:[0,-.15,.15,-.45,-.15,-.45,0,-.15],collide:function(e,t,n,r,o,s,c){var l=o,u=(l.x-e)**2+(l.y-t)**2<=((n+2*c)*this.radius)**2;return jR(e,t,a(i(this.points,n+2*c,r,o)))||u},draw:function(e,n,r,a,o){var s=i(this.pointsTr,n,r,a);t.arrowShapeImpl(this.name)(e,s,a.x,a.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`triangle-cross`,{points:[0,0,.15,-.3,-.15,-.3,0,0],baseCrossLinePts:[-.15,-.4,-.15,-.4,.15,-.4,.15,-.4],crossLinePts:function(e,t){var n=this.baseCrossLinePts.slice(),r=t/e,i=3,a=5;return n[i]=n[i]-r,n[a]=n[a]-r,n},collide:function(e,t,n,r,o,s,c){var l=a(i(this.points,n+2*c,r,o)),u=a(i(this.crossLinePts(n,s),n+2*c,r,o));return jR(e,t,l)||jR(e,t,u)},draw:function(e,n,r,a,o){var s=i(this.points,n,r,a),c=i(this.crossLinePts(n,o),n,r,a);t.arrowShapeImpl(this.name)(e,s,c)}}),s(`vee`,{points:[-.15,-.3,0,0,.15,-.3,0,-.15],gap:function(e){return o(e)*.525}}),s(`circle`,{radius:.15,collide:function(e,t,n,r,i,a,o){var s=i;return(s.x-e)**2+(s.y-t)**2<=((n+2*o)*this.radius)**2},draw:function(e,n,r,i,a){t.arrowShapeImpl(this.name)(e,i.x,i.y,this.radius*n)},spacing:function(e){return t.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.radius}}),s(`tee`,{points:[-.15,0,-.15,-.1,.15,-.1,.15,0],spacing:function(e){return 1},gap:function(e){return 1}}),s(`square`,{points:[-.15,0,.15,0,.15,-.3,-.15,-.3]}),s(`diamond`,{points:[-.15,-.15,0,-.3,.15,-.15,0,0],gap:function(e){return e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}}),s(`chevron`,{points:[0,0,-.15,-.15,-.1,-.2,0,-.1,.1,-.2,.15,-.15],gap:function(e){return .95*e.pstyle(`width`).pfValue*e.pstyle(`arrow-scale`).value}})};var pq={};pq.projectIntoViewport=function(e,t){var n=this.cy,r=this.findContainerClientCoords(),i=r[0],a=r[1],o=r[4],s=n.pan(),c=n.zoom();return[((e-i)/o-s.x)/c,((t-a)/o-s.y)/c]},pq.findContainerClientCoords=function(){if(this.containerBB)return this.containerBB;var e=this.container,t=e.getBoundingClientRect(),n=this.cy.window().getComputedStyle(e),r=function(e){return parseFloat(n.getPropertyValue(e))},i={left:r(`padding-left`),right:r(`padding-right`),top:r(`padding-top`),bottom:r(`padding-bottom`)},a={left:r(`border-left-width`),right:r(`border-right-width`),top:r(`border-top-width`),bottom:r(`border-bottom-width`)},o=e.clientWidth,s=e.clientHeight,c=i.left+i.right,l=i.top+i.bottom,u=a.left+a.right,d=t.width/(o+u),f=o-c,p=s-l,m=t.left+i.left+a.left,h=t.top+i.top+a.top;return this.containerBB=[m,h,f,p,d]},pq.invalidateContainerClientCoordsCache=function(){this.containerBB=null},pq.findNearestElement=function(e,t,n,r){return this.findNearestElements(e,t,n,r)[0]},pq.findNearestElements=function(e,t,n,r){var i=this,a=this,o=a.getCachedZSortedEles(),s=[],c=a.cy.zoom(),l=a.cy.hasCompoundNodes(),u=(r?24:8)/c,d=(r?8:2)/c,f=(r?8:2)/c,p=1/0,m,h;n&&(o=o.interactive);function g(e,t){if(e.isNode()){if(h)return;h=e,s.push(e)}if(e.isEdge()&&(t==null||t<p))if(m){if(m.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value&&m.pstyle(`z-compound-depth`).value===e.pstyle(`z-compound-depth`).value){for(var n=0;n<s.length;n++)if(s[n].isEdge()){s[n]=e,m=e,p=t??p;break}}}else s.push(e),m=e,p=t??p}function _(n){var r=n.outerWidth()+2*d,o=n.outerHeight()+2*d,s=r/2,c=o/2,l=n.position(),u=n.pstyle(`corner-radius`).value===`auto`?`auto`:n.pstyle(`corner-radius`).pfValue,f=n._private.rscratch;if(l.x-s<=e&&e<=l.x+s&&l.y-c<=t&&t<=l.y+c&&a.nodeShapes[i.getNodeShape(n)].checkPoint(e,t,0,r,o,l.x,l.y,u,f))return g(n,0),!0}function v(n){var r=n._private,o=r.rscratch,c=n.pstyle(`width`).pfValue,d=n.pstyle(`arrow-scale`).value,f=c/2+u,p=f*f,m=f*2,h=r.source,v=r.target,y;if(o.edgeType===`segments`||o.edgeType===`straight`||o.edgeType===`haystack`){for(var b=o.allpts,x=0;x+3<b.length;x+=2)if(TR(e,t,b[x],b[x+1],b[x+2],b[x+3],m)&&p>(y=AR(e,t,b[x],b[x+1],b[x+2],b[x+3])))return g(n,y),!0}else if(o.edgeType===`bezier`||o.edgeType===`multibezier`||o.edgeType===`self`||o.edgeType===`compound`){for(var b=o.allpts,x=0;x+5<o.allpts.length;x+=4)if(ER(e,t,b[x],b[x+1],b[x+2],b[x+3],b[x+4],b[x+5],m)&&p>(y=kR(e,t,b[x],b[x+1],b[x+2],b[x+3],b[x+4],b[x+5])))return g(n,y),!0}for(var h=h||r.source,v=v||r.target,S=i.getArrowWidth(c,d),C=[{name:`source`,x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:`target`,x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:`mid-source`,x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:`mid-target`,x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}],x=0;x<C.length;x++){var w=C[x],T=a.arrowShapes[n.pstyle(w.name+`-arrow-shape`).value],E=n.pstyle(`width`).pfValue;if(T.roughCollide(e,t,S,w.angle,{x:w.x,y:w.y},E,u)&&T.collide(e,t,S,w.angle,{x:w.x,y:w.y},E,u))return g(n),!0}l&&s.length>0&&(_(h),_(v))}function y(e,t,n){return mL(e,t,n)}function b(n,r){var i=n._private,a=f,o=r?r+`-`:``;n.boundingBox();var s=i.labelBounds[r||`main`],c=n.pstyle(o+`label`).value;if(!(n.pstyle(`text-events`).strValue!==`yes`||!c)){var l=y(i.rscratch,`labelX`,r),u=y(i.rscratch,`labelY`,r),d=y(i.rscratch,`labelAngle`,r),p=n.pstyle(o+`text-margin-x`).pfValue,m=n.pstyle(o+`text-margin-y`).pfValue,h=s.x1-a-p,_=s.x2+a-p,v=s.y1-a-m,b=s.y2+a-m;if(d){var x=Math.cos(d),S=Math.sin(d),C=function(e,t){return e-=l,t-=u,{x:e*x-t*S+l,y:e*S+t*x+u}},w=C(h,v),T=C(h,b),E=C(_,v),D=C(_,b);if(jR(e,t,[w.x+p,w.y+m,E.x+p,E.y+m,D.x+p,D.y+m,T.x+p,T.y+m]))return g(n),!0}else if(vR(s,e,t))return g(n),!0}}for(var x=o.length-1;x>=0;x--){var S=o[x];S.isNode()?_(S)||b(S):v(S)||b(S)||b(S,`source`)||b(S,`target`)}return s},pq.getAllInBox=function(e,t,n,r){var i=this.getCachedZSortedEles().interactive,a=2/this.cy.zoom(),o=[],s=Math.min(e,n),c=Math.max(e,n),l=Math.min(t,r),u=Math.max(t,r);e=s,n=c,t=l,r=u;var d=lR({x1:e,y1:t,x2:n,y2:r}),f=[{x:d.x1,y:d.y1},{x:d.x2,y:d.y1},{x:d.x2,y:d.y2},{x:d.x1,y:d.y2}],p=[[f[0],f[1]],[f[1],f[2]],[f[2],f[3]],[f[3],f[0]]];function m(e,t,n){return mL(e,t,n)}function h(e,t){var n=e._private,r=a,i=``;e.boundingBox();var o=n.labelBounds.main;if(!o)return null;var s=m(n.rscratch,`labelX`,t),c=m(n.rscratch,`labelY`,t),l=m(n.rscratch,`labelAngle`,t),u=e.pstyle(i+`text-margin-x`).pfValue,d=e.pstyle(i+`text-margin-y`).pfValue,f=o.x1-r-u,p=o.x2+r-u,h=o.y1-r-d,g=o.y2+r-d;if(l){var _=Math.cos(l),v=Math.sin(l),y=function(e,t){return e-=s,t-=c,{x:e*_-t*v+s,y:e*v+t*_+c}};return[y(f,h),y(p,h),y(p,g),y(f,g)]}else return[{x:f,y:h},{x:p,y:h},{x:p,y:g},{x:f,y:g}]}function g(e,t,n,r){function i(e,t,n){return(n.y-e.y)*(t.x-e.x)>(t.y-e.y)*(n.x-e.x)}return i(e,n,r)!==i(t,n,r)&&i(e,t,n)!==i(e,t,r)}for(var _=0;_<i.length;_++){var v=i[_];if(v.isNode()){var y=v,b=y.pstyle(`text-events`).strValue===`yes`,x=y.pstyle(`box-selection`).strValue,S=y.pstyle(`box-select-labels`).strValue===`yes`;if(x===`none`)continue;var C=(x===`overlap`||S)&&b,w=y.boundingBox({includeNodes:!0,includeEdges:!1,includeLabels:C});if(x===`contain`){var T=!1;if(S&&b){var E=h(y);E&&$R(E,f)&&(o.push(y),T=!0)}!T&&bR(d,w)&&o.push(y)}else if(x===`overlap`&&_R(d,w)){var D=y.boundingBox({includeNodes:!0,includeEdges:!0,includeLabels:!1,includeMainLabels:!1,includeSourceLabels:!1,includeTargetLabels:!1});if($R([{x:D.x1,y:D.y1},{x:D.x2,y:D.y1},{x:D.x2,y:D.y2},{x:D.x1,y:D.y2}],f))o.push(y);else{var O=h(y);O&&$R(O,f)&&o.push(y)}}}else{var k=v,A=k._private,j=A.rscratch,M=k.pstyle(`box-selection`).strValue;if(M===`none`)continue;if(M===`contain`){if(j.startX!=null&&j.startY!=null&&!vR(d,j.startX,j.startY)||j.endX!=null&&j.endY!=null&&!vR(d,j.endX,j.endY))continue;if(j.edgeType===`bezier`||j.edgeType===`multibezier`||j.edgeType===`self`||j.edgeType===`compound`||j.edgeType===`segments`||j.edgeType===`haystack`){for(var N=A.rstyle.bezierPts||A.rstyle.linePts||A.rstyle.haystackPts,P=!0,F=0;F<N.length;F++)if(!yR(d,N[F])){P=!1;break}P&&o.push(k)}else j.edgeType===`straight`&&o.push(k)}else if(M===`overlap`){var I=!1;if(j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(vR(d,j.startX,j.startY)||vR(d,j.endX,j.endY)))o.push(k),I=!0;else if(!I&&j.edgeType===`haystack`){for(var L=A.rstyle.haystackPts,R=0;R<L.length;R++)if(yR(d,L[R])){o.push(k),I=!0;break}}if(!I){var ee=A.rstyle.bezierPts||A.rstyle.linePts||A.rstyle.haystackPts;if((!ee||ee.length<2)&&j.edgeType===`straight`&&j.startX!=null&&j.startY!=null&&j.endX!=null&&j.endY!=null&&(ee=[{x:j.startX,y:j.startY},{x:j.endX,y:j.endY}]),!ee||ee.length<2)continue;for(var z=0;z<ee.length-1;z++){for(var B=ee[z],V=ee[z+1],H=0;H<p.length;H++){var te=PP(p[H],2),ne=te[0],U=te[1];if(g(B,V,ne,U)){o.push(k),I=!0;break}}if(I)break}}}}}return o};var mq={};mq.calculateArrowAngles=function(e){var t=e._private.rscratch,n=t.edgeType===`haystack`,r=t.edgeType===`bezier`,i=t.edgeType===`multibezier`,a=t.edgeType===`segments`,o=t.edgeType===`compound`,s=t.edgeType===`self`,c,l,u,d,f,p,m,h;if(n?(u=t.haystackPts[0],d=t.haystackPts[1],f=t.haystackPts[2],p=t.haystackPts[3]):(u=t.arrowStartX,d=t.arrowStartY,f=t.arrowEndX,p=t.arrowEndY),m=t.midX,h=t.midY,a)c=u-t.segpts[0],l=d-t.segpts[1];else if(i||o||s||r){var g=t.allpts,_=aR(g[0],g[2],g[4],.1),v=aR(g[1],g[3],g[5],.1);c=u-_,l=d-v}else c=u-m,l=d-h;t.srcArrowAngle=$L(c,l);var m=t.midX,h=t.midY;if(n&&(m=(u+f)/2,h=(d+p)/2),c=f-u,l=p-d,a){var g=t.allpts;if(g.length/2%2==0){var y=g.length/2,b=y-2;c=g[y]-g[b],l=g[y+1]-g[b+1]}else if(t.isRound)c=t.midVector[1],l=-t.midVector[0];else{var y=g.length/2-1,b=y-2;c=g[y]-g[b],l=g[y+1]-g[b+1]}}else if(i||o||s){var g=t.allpts,x=t.ctrlpts,S,C,w,T;if(x.length/2%2==0){var E=g.length/2-1,D=E+2,O=D+2;S=aR(g[E],g[D],g[O],0),C=aR(g[E+1],g[D+1],g[O+1],0),w=aR(g[E],g[D],g[O],1e-4),T=aR(g[E+1],g[D+1],g[O+1],1e-4)}else{var D=g.length/2-1,E=D-2,O=D+2;S=aR(g[E],g[D],g[O],.4999),C=aR(g[E+1],g[D+1],g[O+1],.4999),w=aR(g[E],g[D],g[O],.5),T=aR(g[E+1],g[D+1],g[O+1],.5)}c=w-S,l=T-C}if(t.midtgtArrowAngle=$L(c,l),t.midDispX=c,t.midDispY=l,c*=-1,l*=-1,a){var g=t.allpts;if(g.length/2%2!=0&&!t.isRound){var y=g.length/2-1,k=y+2;c=-(g[k]-g[y]),l=-(g[k+1]-g[y+1])}}if(t.midsrcArrowAngle=$L(c,l),a)c=f-t.segpts[t.segpts.length-2],l=p-t.segpts[t.segpts.length-1];else if(i||o||s||r){var g=t.allpts,A=g.length,_=aR(g[A-6],g[A-4],g[A-2],.9),v=aR(g[A-5],g[A-3],g[A-1],.9);c=f-_,l=p-v}else c=f-m,l=p-h;t.tgtArrowAngle=$L(c,l)},mq.getArrowWidth=mq.getArrowHeight=function(e,t){var n=this.arrowWidthCache=this.arrowWidthCache||{},r=n[e+`, `+t];return r||(r=Math.max((e*13.37)**.9,29)*t,n[e+`, `+t]=r,r)};var hq,gq,_q={},vq={},yq,bq,xq,Sq,Cq,wq,Tq,Eq,Dq,Oq,kq,Aq,jq,Mq,Nq,Pq=function(e,t,n){n.x=t.x-e.x,n.y=t.y-e.y,n.len=Math.sqrt(n.x*n.x+n.y*n.y),n.nx=n.x/n.len,n.ny=n.y/n.len,n.ang=Math.atan2(n.ny,n.nx)},Fq=function(e,t){t.x=e.x*-1,t.y=e.y*-1,t.nx=e.nx*-1,t.ny=e.ny*-1,t.ang=e.ang>0?-(Math.PI-e.ang):Math.PI+e.ang},Iq=function(e,t,n,r,i){if(e===Nq?Fq(vq,_q):Pq(t,e,_q),Pq(t,n,vq),yq=_q.nx*vq.ny-_q.ny*vq.nx,bq=_q.nx*vq.nx-_q.ny*-vq.ny,Cq=Math.asin(Math.max(-1,Math.min(1,yq))),Math.abs(Cq)<1e-6){hq=t.x,gq=t.y,Tq=Dq=0;return}xq=1,Sq=!1,bq<0?Cq<0?Cq=Math.PI+Cq:(Cq=Math.PI-Cq,xq=-1,Sq=!0):Cq>0&&(xq=-1,Sq=!0),Dq=t.radius===void 0?r:t.radius,wq=Cq/2,Oq=Math.min(_q.len/2,vq.len/2),i?(Eq=Math.abs(Math.cos(wq)*Dq/Math.sin(wq)),Eq>Oq?(Eq=Oq,Tq=Math.abs(Eq*Math.sin(wq)/Math.cos(wq))):Tq=Dq):(Eq=Math.min(Oq,Dq),Tq=Math.abs(Eq*Math.sin(wq)/Math.cos(wq))),jq=t.x+vq.nx*Eq,Mq=t.y+vq.ny*Eq,hq=jq-vq.ny*Tq*xq,gq=Mq+vq.nx*Tq*xq,kq=t.x+_q.nx*Eq,Aq=t.y+_q.ny*Eq,Nq=t};function Lq(e,t){t.radius===0?e.lineTo(t.cx,t.cy):e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Rq(e,t,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return r===0||t.radius===0?{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:void 0,endAngle:void 0,counterClockwise:void 0}:(Iq(e,t,n,r,i),{cx:hq,cy:gq,radius:Tq,startX:kq,startY:Aq,stopX:jq,stopY:Mq,startAngle:_q.ang+Math.PI/2*xq,endAngle:vq.ang-Math.PI/2*xq,counterClockwise:Sq})}var zq=.01,Bq=Math.sqrt(2*zq),Vq={};Vq.findMidptPtsEtc=function(e,t){var n=t.posPts,r=t.intersectionPts,i=t.vectorNormInverse,a,o=e.pstyle(`source-endpoint`),s=e.pstyle(`target-endpoint`),c=o.units!=null&&s.units!=null,l=function(e,t,n,r){var i=r-t,a=n-e,o=Math.sqrt(a*a+i*i);return{x:-i/o,y:a/o}};switch(e.pstyle(`edge-distances`).value){case`node-position`:a=n;break;case`intersection`:a=r;break;case`endpoints`:if(c){var u=PP(this.manualEndptToPx(e.source()[0],o),2),d=u[0],f=u[1],p=PP(this.manualEndptToPx(e.target()[0],s),2),m=p[0],h=p[1],g={x1:d,y1:f,x2:m,y2:h};i=l(d,f,m,h),a=g}else rL(`Edge ${e.id()} has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default).`),a=r;break}return{midptPts:a,vectorNormInverse:i}},Vq.findHaystackPoints=function(e){for(var t=0;t<e.length;t++){var n=e[t],r=n._private,i=r.rscratch;if(!i.haystack){var a=Math.random()*2*Math.PI;i.source={x:Math.cos(a),y:Math.sin(a)},a=Math.random()*2*Math.PI,i.target={x:Math.cos(a),y:Math.sin(a)}}var o=r.source,s=r.target,c=o.position(),l=s.position(),u=o.width(),d=s.width(),f=o.height(),p=s.height(),m=n.pstyle(`haystack-radius`).value/2;i.haystackPts=i.allpts=[i.source.x*u*m+c.x,i.source.y*f*m+c.y,i.target.x*d*m+l.x,i.target.y*p*m+l.y],i.midX=(i.allpts[0]+i.allpts[2])/2,i.midY=(i.allpts[1]+i.allpts[3])/2,i.edgeType=`haystack`,i.haystack=!0,this.storeEdgeProjections(n),this.calculateArrowAngles(n),this.recalculateEdgeLabelProjections(n),this.calculateLabelAngles(n)}},Vq.findSegmentsPoints=function(e,t){var n=e._private.rscratch,r=e.pstyle(`segment-weights`),i=e.pstyle(`segment-distances`),a=e.pstyle(`segment-radii`),o=e.pstyle(`radius-type`),s=Math.min(r.pfValue.length,i.pfValue.length),c=a.pfValue[a.pfValue.length-1],l=o.pfValue[o.pfValue.length-1];n.edgeType=`segments`,n.segpts=[],n.radii=[],n.isArcRadius=[];for(var u=0;u<s;u++){var d=r.pfValue[u],f=i.pfValue[u],p=1-d,m=d,h=this.findMidptPtsEtc(e,t),g=h.midptPts,_=h.vectorNormInverse,v={x:g.x1*p+g.x2*m,y:g.y1*p+g.y2*m};n.segpts.push(v.x+_.x*f,v.y+_.y*f),n.radii.push(a.pfValue[u]===void 0?c:a.pfValue[u]),n.isArcRadius.push((o.pfValue[u]===void 0?l:o.pfValue[u])===`arc-radius`)}},Vq.findLoopPoints=function(e,t,n,r){var i=e._private.rscratch,a=t.dirCounts,o=t.srcPos,s=e.pstyle(`control-point-distances`),c=s?s.pfValue[0]:void 0,l=e.pstyle(`loop-direction`).pfValue,u=e.pstyle(`loop-sweep`).pfValue,d=e.pstyle(`control-point-step-size`).pfValue;i.edgeType=`self`;var f=n,p=d;r&&(f=0,p=c);var m=l-Math.PI/2,h=m-u/2,g=m+u/2,_=String(l+`_`+u);f=a[_]===void 0?a[_]=0:++a[_],i.ctrlpts=[o.x+Math.cos(h)*1.4*p*(f/3+1),o.y+Math.sin(h)*1.4*p*(f/3+1),o.x+Math.cos(g)*1.4*p*(f/3+1),o.y+Math.sin(g)*1.4*p*(f/3+1)]},Vq.findCompoundLoopPoints=function(e,t,n,r){var i=e._private.rscratch;i.edgeType=`compound`;var a=t.srcPos,o=t.tgtPos,s=t.srcW,c=t.srcH,l=t.tgtW,u=t.tgtH,d=e.pstyle(`control-point-step-size`).pfValue,f=e.pstyle(`control-point-distances`),p=f?f.pfValue[0]:void 0,m=n,h=d;r&&(m=0,h=p);var g=50,_={x:a.x-s/2,y:a.y-c/2},v={x:o.x-l/2,y:o.y-u/2},y={x:Math.min(_.x,v.x),y:Math.min(_.y,v.y)},b=.5,x=Math.max(b,Math.log(s*zq)),S=Math.max(b,Math.log(l*zq));i.ctrlpts=[y.x,y.y-(1+g**1.12/100)*h*(m/3+1)*x,y.x-(1+g**1.12/100)*h*(m/3+1)*S,y.y]},Vq.findStraightEdgePoints=function(e){e._private.rscratch.edgeType=`straight`},Vq.findBezierPoints=function(e,t,n,r,i){var a=e._private.rscratch,o=e.pstyle(`control-point-step-size`).pfValue,s=e.pstyle(`control-point-distances`),c=e.pstyle(`control-point-weights`),l=s&&c?Math.min(s.value.length,c.value.length):1,u=s?s.pfValue[0]:void 0,d=c.value[0],f=r;a.edgeType=f?`multibezier`:`bezier`,a.ctrlpts=[];for(var p=0;p<l;p++){var m=(.5-t.eles.length/2+n)*o*(i?-1:1),h=void 0,g=tR(m);f&&(u=s?s.pfValue[p]:o,d=c.value[p]),h=r?u:u===void 0?void 0:g*u;var _=h===void 0?m:h,v=1-d,y=d,b=this.findMidptPtsEtc(e,t),x=b.midptPts,S=b.vectorNormInverse,C={x:x.x1*v+x.x2*y,y:x.y1*v+x.y2*y};a.ctrlpts.push(C.x+S.x*_,C.y+S.y*_)}},Vq.findTaxiPoints=function(e,t){var n=e._private.rscratch;n.edgeType=`segments`;var r=`vertical`,i=`horizontal`,a=`leftward`,o=`rightward`,s=`downward`,c=`upward`,l=`auto`,u=t.posPts,d=t.srcW,f=t.srcH,p=t.tgtW,m=t.tgtH,h=e.pstyle(`edge-distances`).value!==`node-position`,g=e.pstyle(`taxi-direction`).value,_=g,v=e.pstyle(`taxi-turn`),y=v.units===`%`,b=v.pfValue,x=b<0,S=e.pstyle(`taxi-turn-min-distance`).pfValue,C=h?(d+p)/2:0,w=h?(f+m)/2:0,T=u.x2-u.x1,E=u.y2-u.y1,D=function(e,t){return e>0?Math.max(e-t,0):Math.min(e+t,0)},O=D(T,C),k=D(E,w),A=!1;_===l?g=Math.abs(O)>Math.abs(k)?i:r:_===c||_===s?(g=r,A=!0):(_===a||_===o)&&(g=i,A=!0);var j=g===r,M=j?k:O,N=j?E:T,P=tR(N),F=!1;!(A&&(y||x))&&(_===s&&N<0||_===c&&N>0||_===a&&N>0||_===o&&N<0)&&(P*=-1,M=P*Math.abs(M),F=!0);var I=y?(b<0?1+b:b)*M:(b<0?M:0)+b*P,L=function(e){return Math.abs(e)<S||Math.abs(e)>=Math.abs(M)},R=L(I),ee=L(Math.abs(M)-Math.abs(I));if((R||ee)&&!F)if(j){var z=Math.abs(N)<=f/2,B=Math.abs(T)<=p/2;if(z){var V=(u.x1+u.x2)/2;n.segpts=[V,u.y1,V,u.y2]}else if(B){var H=(u.y1+u.y2)/2;n.segpts=[u.x1,H,u.x2,H]}else n.segpts=[u.x1,u.y2]}else{var te=Math.abs(N)<=d/2,ne=Math.abs(E)<=m/2;if(te){var U=(u.y1+u.y2)/2;n.segpts=[u.x1,U,u.x2,U]}else if(ne){var re=(u.x1+u.x2)/2;n.segpts=[re,u.y1,re,u.y2]}else n.segpts=[u.x2,u.y1]}else if(j){var ie=u.y1+I+(h?f/2*P:0);n.segpts=[u.x1,ie,u.x2,ie]}else{var ae=u.x1+I+(h?d/2*P:0);n.segpts=[ae,u.y1,ae,u.y2]}if(n.isRound){var oe=e.pstyle(`taxi-radius`).value,se=e.pstyle(`radius-type`).value[0]===`arc-radius`;n.radii=Array(n.segpts.length/2).fill(oe),n.isArcRadius=Array(n.segpts.length/2).fill(se)}},Vq.tryToCorrectInvalidPoints=function(e,t){var n=e._private.rscratch;if(n.edgeType===`bezier`){var r=t.srcPos,i=t.tgtPos,a=t.srcW,o=t.srcH,s=t.tgtW,c=t.tgtH,l=t.srcShape,u=t.tgtShape,d=t.srcCornerRadius,f=t.tgtCornerRadius,p=t.srcRs,m=t.tgtRs,h=!$(n.startX)||!$(n.startY),g=!$(n.arrowStartX)||!$(n.arrowStartY),_=!$(n.endX)||!$(n.endY),v=!$(n.arrowEndX)||!$(n.arrowEndY),y=3*(this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth),b=nR({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.startX,y:n.startY}),x=b<y,S=nR({x:n.ctrlpts[0],y:n.ctrlpts[1]},{x:n.endX,y:n.endY}),C=S<y,w=!1;if(h||g||x){w=!0;var T={x:n.ctrlpts[0]-r.x,y:n.ctrlpts[1]-r.y},E=Math.sqrt(T.x*T.x+T.y*T.y),D={x:T.x/E,y:T.y/E},O=Math.max(a,o),k={x:n.ctrlpts[0]+D.x*2*O,y:n.ctrlpts[1]+D.y*2*O},A=l.intersectLine(r.x,r.y,a,o,k.x,k.y,0,d,p);x?(n.ctrlpts[0]=n.ctrlpts[0]+D.x*(y-b),n.ctrlpts[1]=n.ctrlpts[1]+D.y*(y-b)):(n.ctrlpts[0]=A[0]+D.x*y,n.ctrlpts[1]=A[1]+D.y*y)}if(_||v||C){w=!0;var j={x:n.ctrlpts[0]-i.x,y:n.ctrlpts[1]-i.y},M=Math.sqrt(j.x*j.x+j.y*j.y),N={x:j.x/M,y:j.y/M},P=Math.max(a,o),F={x:n.ctrlpts[0]+N.x*2*P,y:n.ctrlpts[1]+N.y*2*P},I=u.intersectLine(i.x,i.y,s,c,F.x,F.y,0,f,m);C?(n.ctrlpts[0]=n.ctrlpts[0]+N.x*(y-S),n.ctrlpts[1]=n.ctrlpts[1]+N.y*(y-S)):(n.ctrlpts[0]=I[0]+N.x*y,n.ctrlpts[1]=I[1]+N.y*y)}w&&this.findEndpoints(e)}},Vq.storeAllpts=function(e){var t=e._private.rscratch;if(t.edgeType===`multibezier`||t.edgeType===`bezier`||t.edgeType===`self`||t.edgeType===`compound`){t.allpts=[],t.allpts.push(t.startX,t.startY);for(var n=0;n+1<t.ctrlpts.length;n+=2)t.allpts.push(t.ctrlpts[n],t.ctrlpts[n+1]),n+3<t.ctrlpts.length&&t.allpts.push((t.ctrlpts[n]+t.ctrlpts[n+2])/2,(t.ctrlpts[n+1]+t.ctrlpts[n+3])/2);t.allpts.push(t.endX,t.endY);var r,i;t.ctrlpts.length/2%2==0?(r=t.allpts.length/2-1,t.midX=t.allpts[r],t.midY=t.allpts[r+1]):(r=t.allpts.length/2-3,i=.5,t.midX=aR(t.allpts[r],t.allpts[r+2],t.allpts[r+4],i),t.midY=aR(t.allpts[r+1],t.allpts[r+3],t.allpts[r+5],i))}else if(t.edgeType===`straight`)t.allpts=[t.startX,t.startY,t.endX,t.endY],t.midX=(t.startX+t.endX+t.arrowStartX+t.arrowEndX)/4,t.midY=(t.startY+t.endY+t.arrowStartY+t.arrowEndY)/4;else if(t.edgeType===`segments`){if(t.allpts=[],t.allpts.push(t.startX,t.startY),t.allpts.push.apply(t.allpts,t.segpts),t.allpts.push(t.endX,t.endY),t.isRound){t.roundCorners=[];for(var a=2;a+3<t.allpts.length;a+=2){var o=t.radii[a/2-1],s=t.isArcRadius[a/2-1];t.roundCorners.push(Rq({x:t.allpts[a-2],y:t.allpts[a-1]},{x:t.allpts[a],y:t.allpts[a+1],radius:o},{x:t.allpts[a+2],y:t.allpts[a+3]},o,s))}}if(t.segpts.length%4==0){var c=t.segpts.length/2,l=c-2;t.midX=(t.segpts[l]+t.segpts[c])/2,t.midY=(t.segpts[l+1]+t.segpts[c+1])/2}else{var u=t.segpts.length/2-1;if(!t.isRound)t.midX=t.segpts[u],t.midY=t.segpts[u+1];else{var d={x:t.segpts[u],y:t.segpts[u+1]},f=t.roundCorners[u/2];if(f.radius===0){var p={x:t.segpts[u+2],y:t.segpts[u+3]};t.midX=d.x,t.midY=d.y,t.midVector=[d.y-p.y,p.x-d.x]}else{var m=[d.x-f.cx,d.y-f.cy],h=f.radius/Math.sqrt(m[0]**2+m[1]**2);m=m.map(function(e){return e*h}),t.midX=f.cx+m[0],t.midY=f.cy+m[1],t.midVector=m}}}}},Vq.checkForInvalidEdgeWarning=function(e){var t=e[0]._private.rscratch;t.nodesOverlap||$(t.startX)&&$(t.startY)&&$(t.endX)&&$(t.endY)?t.loggedErr=!1:t.loggedErr||(t.loggedErr=!0,rL("Edge `"+e.id()+"` has invalid endpoints and so it is impossible to draw. Adjust your edge style (e.g. control points) accordingly or use an alternative edge type. This is expected behaviour when the source node and the target node overlap."))},Vq.findEdgeControlPoints=function(e){var t=this;if(!(!e||e.length===0)){for(var n=this,r=n.cy.hasCompoundNodes(),i=new gL,a=function(e,t){return[].concat(FP(e),[+!!t]).join(`-`)},o=[],s=[],c=0;c<e.length;c++){var l=e[c],u=l._private,d=l.pstyle(`curve-style`).value;if(!(l.removed()||!l.takesUpSpace())){if(d===`haystack`){s.push(l);continue}var f=d===`unbundled-bezier`||gF(d,`segments`)||d===`straight`||d===`straight-triangle`||gF(d,`taxi`),p=d===`unbundled-bezier`||d===`bezier`,m=u.source,h=u.target,g=[m.poolIndex(),h.poolIndex()].sort(),_=a(g,f),v=i.get(_);v??(v={eles:[]},o.push({pairId:g,edgeIsUnbundled:f}),i.set(_,v)),v.eles.push(l),f&&(v.hasUnbundled=!0),p&&(v.hasBezier=!0)}}for(var y=function(){var e=o[b],s=e.pairId,c=e.edgeIsUnbundled,l=a(s,c),u=i.get(l),d;if(!u.hasUnbundled){var f=u.eles[0].parallelEdges().filter(function(e){return e.isBundledBezier()});fL(u.eles),f.forEach(function(e){return u.eles.push(e)}),u.eles.sort(function(e,t){return e.poolIndex()-t.poolIndex()})}var p=u.eles[0],m=p.source(),h=p.target();if(m.poolIndex()>h.poolIndex()){var g=m;m=h,h=g}var _=u.srcPos=m.position(),v=u.tgtPos=h.position(),y=u.srcW=m.outerWidth(),x=u.srcH=m.outerHeight(),S=u.tgtW=h.outerWidth(),C=u.tgtH=h.outerHeight(),w=u.srcShape=n.nodeShapes[t.getNodeShape(m)],T=u.tgtShape=n.nodeShapes[t.getNodeShape(h)],E=u.srcCornerRadius=m.pstyle(`corner-radius`).value===`auto`?`auto`:m.pstyle(`corner-radius`).pfValue,D=u.tgtCornerRadius=h.pstyle(`corner-radius`).value===`auto`?`auto`:h.pstyle(`corner-radius`).pfValue,O=u.tgtRs=h._private.rscratch,k=u.srcRs=m._private.rscratch;u.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var A=0;A<u.eles.length;A++){var j=u.eles[A],M=j[0]._private.rscratch,N=j.pstyle(`curve-style`).value,P=N===`unbundled-bezier`||gF(N,`segments`)||gF(N,`taxi`),F=!m.same(j.source());if(!u.calculatedIntersection&&m!==h&&(u.hasBezier||u.hasUnbundled)){u.calculatedIntersection=!0;var I=w.intersectLine(_.x,_.y,y,x,v.x,v.y,0,E,k),L=u.srcIntn=I,R=T.intersectLine(v.x,v.y,S,C,_.x,_.y,0,D,O),ee=u.tgtIntn=R,z=u.intersectionPts={x1:I[0],x2:R[0],y1:I[1],y2:R[1]},B=u.posPts={x1:_.x,x2:v.x,y1:_.y,y2:v.y},V=R[1]-I[1],H=R[0]-I[0],te=Math.sqrt(H*H+V*V);$(te)&&te>=Bq||(te=Math.sqrt(Math.max(H*H,zq)+Math.max(V*V,zq)));var ne=u.vector={x:H,y:V},U=u.vectorNorm={x:ne.x/te,y:ne.y/te},re={x:-U.y,y:U.x};u.nodesOverlap=!$(te)||T.checkPoint(I[0],I[1],0,S,C,v.x,v.y,D,O)||w.checkPoint(R[0],R[1],0,y,x,_.x,_.y,E,k),u.vectorNormInverse=re,d={nodesOverlap:u.nodesOverlap,dirCounts:u.dirCounts,calculatedIntersection:!0,hasBezier:u.hasBezier,hasUnbundled:u.hasUnbundled,eles:u.eles,srcPos:v,srcRs:O,tgtPos:_,tgtRs:k,srcW:S,srcH:C,tgtW:y,tgtH:x,srcIntn:ee,tgtIntn:L,srcShape:T,tgtShape:w,posPts:{x1:B.x2,y1:B.y2,x2:B.x1,y2:B.y1},intersectionPts:{x1:z.x2,y1:z.y2,x2:z.x1,y2:z.y1},vector:{x:-ne.x,y:-ne.y},vectorNorm:{x:-U.x,y:-U.y},vectorNormInverse:{x:-re.x,y:-re.y}}}var ie=F?d:u;M.nodesOverlap=ie.nodesOverlap,M.srcIntn=ie.srcIntn,M.tgtIntn=ie.tgtIntn,M.isRound=N.startsWith(`round`),r&&(m.isParent()||m.isChild()||h.isParent()||h.isChild())&&(m.parents().anySame(h)||h.parents().anySame(m)||m.same(h)&&m.isParent())?t.findCompoundLoopPoints(j,ie,A,P):m===h?t.findLoopPoints(j,ie,A,P):N.endsWith(`segments`)?t.findSegmentsPoints(j,ie):N.endsWith(`taxi`)?t.findTaxiPoints(j,ie):N===`straight`||!P&&u.eles.length%2==1&&A===Math.floor(u.eles.length/2)?t.findStraightEdgePoints(j):t.findBezierPoints(j,ie,A,P,F),t.findEndpoints(j),t.tryToCorrectInvalidPoints(j,ie),t.checkForInvalidEdgeWarning(j),t.storeAllpts(j),t.storeEdgeProjections(j),t.calculateArrowAngles(j),t.recalculateEdgeLabelProjections(j),t.calculateLabelAngles(j)}},b=0;b<o.length;b++)y();this.findHaystackPoints(s)}};function Hq(e){var t=[];if(e!=null){for(var n=0;n<e.length;n+=2){var r=e[n],i=e[n+1];t.push({x:r,y:i})}return t}}Vq.getSegmentPoints=function(e){var t=e[0]._private.rscratch;if(this.recalculateRenderedStyle(e),t.edgeType===`segments`)return Hq(t.segpts)},Vq.getControlPoints=function(e){var t=e[0]._private.rscratch;this.recalculateRenderedStyle(e);var n=t.edgeType;if(n===`bezier`||n===`multibezier`||n===`self`||n===`compound`)return Hq(t.ctrlpts)},Vq.getEdgeMidpoint=function(e){var t=e[0]._private.rscratch;return this.recalculateRenderedStyle(e),{x:t.midX,y:t.midY}};var Uq={};Uq.manualEndptToPx=function(e,t){var n=this,r=e.position(),i=e.outerWidth(),a=e.outerHeight(),o=e._private.rscratch;if(t.value.length===2){var s=[t.pfValue[0],t.pfValue[1]];return t.units[0]===`%`&&(s[0]*=i),t.units[1]===`%`&&(s[1]*=a),s[0]+=r.x,s[1]+=r.y,s}else{var c=t.pfValue[0];c=-Math.PI/2+c;var l=2*Math.max(i,a),u=[r.x+Math.cos(c)*l,r.y+Math.sin(c)*l];return n.nodeShapes[this.getNodeShape(e)].intersectLine(r.x,r.y,i,a,u[0],u[1],0,e.pstyle(`corner-radius`).value===`auto`?`auto`:e.pstyle(`corner-radius`).pfValue,o)}},Uq.findEndpoints=function(e){var t,n,r=this,i,a=e.source()[0],o=e.target()[0],s=a.position(),c=o.position(),l=e.pstyle(`target-arrow-shape`).value,u=e.pstyle(`source-arrow-shape`).value,d=e.pstyle(`target-distance-from-node`).pfValue,f=e.pstyle(`source-distance-from-node`).pfValue,p=a._private.rscratch,m=o._private.rscratch,h=e.pstyle(`curve-style`).value,g=e._private.rscratch,_=g.edgeType,v=gF(h,`taxi`),y=_===`self`||_===`compound`,b=_===`bezier`||_===`multibezier`||y,x=_!==`bezier`,S=_===`straight`||_===`segments`,C=_===`segments`,w=b||x||S,T=y||v,E=e.pstyle(`source-endpoint`),D=T?`outside-to-node`:E.value,O=a.pstyle(`corner-radius`).value===`auto`?`auto`:a.pstyle(`corner-radius`).pfValue,k=e.pstyle(`target-endpoint`),A=T?`outside-to-node`:k.value,j=o.pstyle(`corner-radius`).value===`auto`?`auto`:o.pstyle(`corner-radius`).pfValue;g.srcManEndpt=E,g.tgtManEndpt=k;var M,N,P,F,I=((k==null||(t=k.pfValue)==null?void 0:t.length)===2?k.pfValue:null)??[0,0],L=((E==null||(n=E.pfValue)==null?void 0:n.length)===2?E.pfValue:null)??[0,0];if(b){var R=[g.ctrlpts[0],g.ctrlpts[1]];M=x?[g.ctrlpts[g.ctrlpts.length-2],g.ctrlpts[g.ctrlpts.length-1]]:R,N=R}else if(S){var ee=C?g.segpts.slice(0,2):[c.x+I[0],c.y+I[1]];M=C?g.segpts.slice(g.segpts.length-2):[s.x+L[0],s.y+L[1]],N=ee}if(A===`inside-to-node`)i=[c.x,c.y];else if(k.units)i=this.manualEndptToPx(o,k);else if(A===`outside-to-line`)i=g.tgtIntn;else if(A===`outside-to-node`||A===`outside-to-node-or-label`?P=M:(A===`outside-to-line`||A===`outside-to-line-or-label`)&&(P=[s.x,s.y]),i=r.nodeShapes[this.getNodeShape(o)].intersectLine(c.x,c.y,o.outerWidth(),o.outerHeight(),P[0],P[1],0,j,m),A===`outside-to-node-or-label`||A===`outside-to-line-or-label`){var z=o._private.rscratch,B=z.labelWidth,V=z.labelHeight,H=z.labelX,te=z.labelY,ne=B/2,U=V/2,re=o.pstyle(`text-valign`).value;re===`top`?te-=U:re===`bottom`&&(te+=U);var ie=o.pstyle(`text-halign`).value;ie===`left`?H-=ne:ie===`right`&&(H+=ne);var ae=HR(P[0],P[1],[H-ne,te-U,H+ne,te-U,H+ne,te+U,H-ne,te+U],c.x,c.y);if(ae.length>0){var oe=s,se=rR(oe,qL(i)),ce=rR(oe,qL(ae)),le=se;ce<se&&(i=ae,le=ce),ae.length>2&&rR(oe,{x:ae[2],y:ae[3]})<le&&(i=[ae[2],ae[3]])}}var ue=WR(i,M,r.arrowShapes[l].spacing(e)+d),de=WR(i,M,r.arrowShapes[l].gap(e)+d);if(g.endX=de[0],g.endY=de[1],g.arrowEndX=ue[0],g.arrowEndY=ue[1],D===`inside-to-node`)i=[s.x,s.y];else if(E.units)i=this.manualEndptToPx(a,E);else if(D===`outside-to-line`)i=g.srcIntn;else if(D===`outside-to-node`||D===`outside-to-node-or-label`?F=N:(D===`outside-to-line`||D===`outside-to-line-or-label`)&&(F=[c.x,c.y]),i=r.nodeShapes[this.getNodeShape(a)].intersectLine(s.x,s.y,a.outerWidth(),a.outerHeight(),F[0],F[1],0,O,p),D===`outside-to-node-or-label`||D===`outside-to-line-or-label`){var fe=a._private.rscratch,pe=fe.labelWidth,me=fe.labelHeight,he=fe.labelX,ge=fe.labelY,_e=pe/2,ve=me/2,ye=a.pstyle(`text-valign`).value;ye===`top`?ge-=ve:ye===`bottom`&&(ge+=ve);var be=a.pstyle(`text-halign`).value;be===`left`?he-=_e:be===`right`&&(he+=_e);var xe=HR(F[0],F[1],[he-_e,ge-ve,he+_e,ge-ve,he+_e,ge+ve,he-_e,ge+ve],s.x,s.y);if(xe.length>0){var Se=c,Ce=rR(Se,qL(i)),we=rR(Se,qL(xe)),Te=Ce;we<Ce&&(i=[xe[0],xe[1]],Te=we),xe.length>2&&rR(Se,{x:xe[2],y:xe[3]})<Te&&(i=[xe[2],xe[3]])}}var Ee=WR(i,N,r.arrowShapes[u].spacing(e)+f),De=WR(i,N,r.arrowShapes[u].gap(e)+f);g.startX=De[0],g.startY=De[1],g.arrowStartX=Ee[0],g.arrowStartY=Ee[1],w&&(!$(g.startX)||!$(g.startY)||!$(g.endX)||!$(g.endY)?g.badLine=!0:g.badLine=!1)},Uq.getSourceEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[0],y:t.haystackPts[1]};default:return{x:t.arrowStartX,y:t.arrowStartY}}},Uq.getTargetEndpoint=function(e){var t=e[0]._private.rscratch;switch(this.recalculateRenderedStyle(e),t.edgeType){case`haystack`:return{x:t.haystackPts[2],y:t.haystackPts[3]};default:return{x:t.arrowEndX,y:t.arrowEndY}}};var Wq={};function Gq(e,t,n){for(var r=function(e,t,n,r){return aR(e,t,n,r)},i=t._private.rstyle.bezierPts,a=0;a<e.bezierProjPcts.length;a++){var o=e.bezierProjPcts[a];i.push({x:r(n[0],n[2],n[4],o),y:r(n[1],n[3],n[5],o)})}}Wq.storeEdgeProjections=function(e){var t=e._private,n=t.rscratch,r=n.edgeType;if(t.rstyle.bezierPts=null,t.rstyle.linePts=null,t.rstyle.haystackPts=null,r===`multibezier`||r===`bezier`||r===`self`||r===`compound`){t.rstyle.bezierPts=[];for(var i=0;i+5<n.allpts.length;i+=4)Gq(this,e,n.allpts.slice(i,i+6))}else if(r===`segments`)for(var a=t.rstyle.linePts=[],i=0;i+1<n.allpts.length;i+=2)a.push({x:n.allpts[i],y:n.allpts[i+1]});else if(r===`haystack`){var o=n.haystackPts;t.rstyle.haystackPts=[{x:o[0],y:o[1]},{x:o[2],y:o[3]}]}t.rstyle.arrowWidth=this.getArrowWidth(e.pstyle(`width`).pfValue,e.pstyle(`arrow-scale`).value)*this.arrowShapeWidth},Wq.recalculateEdgeProjections=function(e){this.findEdgeControlPoints(e)};var Kq={};Kq.recalculateNodeLabelProjection=function(e){var t=e.pstyle(`label`).strValue;if(!oF(t)){var n,r,i=e._private,a=e.width(),o=e.height(),s=e.padding(),c=e.position(),l=e.pstyle(`text-halign`).strValue,u=e.pstyle(`text-valign`).strValue,d=i.rscratch,f=i.rstyle;switch(l){case`left`:n=c.x-a/2-s;break;case`right`:n=c.x+a/2+s;break;default:n=c.x}switch(u){case`top`:r=c.y-o/2-s;break;case`bottom`:r=c.y+o/2+s;break;default:r=c.y}d.labelX=n,d.labelY=r,f.labelX=n,f.labelY=r,this.calculateLabelAngles(e),this.applyLabelDimensions(e)}};var qq=function(e,t){var n=Math.atan(t/e);return e===0&&n<0&&(n*=-1),n},Jq=function(e,t){return qq(t.x-e.x,t.y-e.y)},Yq=function(e,t,n,r){var i=cR(0,r-.001,1),a=cR(0,r+.001,1);return Jq(oR(e,t,n,i),oR(e,t,n,a))};Kq.recalculateEdgeLabelProjections=function(e){var t,n=e._private,r=n.rscratch,i=this,a={mid:e.pstyle(`label`).strValue,source:e.pstyle(`source-label`).strValue,target:e.pstyle(`target-label`).strValue};if(a.mid||a.source||a.target){t={x:r.midX,y:r.midY};var o=function(e,t,r){hL(n.rscratch,e,t,r),hL(n.rstyle,e,t,r)};o(`labelX`,null,t.x),o(`labelY`,null,t.y),o(`labelAutoAngle`,null,qq(r.midDispX,r.midDispY));var s=function(){if(s.cache)return s.cache;for(var e=[],t=0;t+5<r.allpts.length;t+=4){var a={x:r.allpts[t],y:r.allpts[t+1]},o={x:r.allpts[t+2],y:r.allpts[t+3]},c={x:r.allpts[t+4],y:r.allpts[t+5]};e.push({p0:a,p1:o,p2:c,startDist:0,length:0,segments:[]})}var l=n.rstyle.bezierPts,u=i.bezierProjPcts.length;function d(e,t,n,r,i){var a=nR(t,n),o=e.segments[e.segments.length-1],s={p0:t,p1:n,t0:r,t1:i,startDist:o?o.startDist+o.length:0,length:a};e.segments.push(s),e.length+=a}for(var f=0;f<e.length;f++){var p=e[f],m=e[f-1];m&&(p.startDist=m.startDist+m.length),d(p,p.p0,l[f*u],0,i.bezierProjPcts[0]);for(var h=0;h<u-1;h++)d(p,l[f*u+h],l[f*u+h+1],i.bezierProjPcts[h],i.bezierProjPcts[h+1]);d(p,l[f*u+u-1],p.p2,i.bezierProjPcts[u-1],1)}return s.cache=e},c=function(n){var i,c=n===`source`;if(a[n]){var l=e.pstyle(n+`-text-offset`).pfValue;switch(r.edgeType){case`self`:case`compound`:case`bezier`:case`multibezier`:for(var u=s(),d,f=0,p=0,m=0;m<u.length;m++){for(var h=u[c?m:u.length-1-m],g=0;g<h.segments.length;g++){var _=h.segments[c?g:h.segments.length-1-g],v=m===u.length-1&&g===h.segments.length-1;if(f=p,p+=_.length,p>=l||v){d={cp:h,segment:_};break}}if(d)break}var y=d.cp,b=d.segment,x=(l-f)/b.length,S=b.t1-b.t0,C=c?b.t0+S*x:b.t1-S*x;C=cR(0,C,1),t=oR(y.p0,y.p1,y.p2,C),i=Yq(y.p0,y.p1,y.p2,C);break;case`straight`:case`segments`:case`haystack`:for(var w=0,T,E,D,O,k=r.allpts.length,A=0;A+3<k&&(c?(D={x:r.allpts[A],y:r.allpts[A+1]},O={x:r.allpts[A+2],y:r.allpts[A+3]}):(D={x:r.allpts[k-2-A],y:r.allpts[k-1-A]},O={x:r.allpts[k-4-A],y:r.allpts[k-3-A]}),T=nR(D,O),E=w,w+=T,!(w>=l));A+=2);var j=(l-E)/T;j=cR(0,j,1),t=sR(D,O,j),i=Jq(D,O);break}o(`labelX`,n,t.x),o(`labelY`,n,t.y),o(`labelAutoAngle`,n,i)}};c(`source`),c(`target`),this.applyLabelDimensions(e)}},Kq.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e),e.isEdge()&&(this.applyPrefixedLabelDimensions(e,`source`),this.applyPrefixedLabelDimensions(e,`target`))},Kq.applyPrefixedLabelDimensions=function(e,t){var n=e._private,r=this.getLabelText(e,t),i=VI(r,e._private.labelDimsKey);if(mL(n.rscratch,`prefixedLabelDimsKey`,t)!==i){hL(n.rscratch,`prefixedLabelDimsKey`,t,i);var a=this.calculateLabelDimensions(e,r),o=e.pstyle(`line-height`).pfValue,s=e.pstyle(`text-wrap`).strValue,c=mL(n.rscratch,`labelWrapCachedLines`,t)||[],l=s===`wrap`?Math.max(c.length,1):1,u=a.height/l,d=u*o,f=a.width,p=a.height+(l-1)*(o-1)*u;hL(n.rstyle,`labelWidth`,t,f),hL(n.rscratch,`labelWidth`,t,f),hL(n.rstyle,`labelHeight`,t,p),hL(n.rscratch,`labelHeight`,t,p),hL(n.rscratch,`labelLineHeight`,t,d)}},Kq.getLabelText=function(e,t){var n=e._private,r=t?t+`-`:``,i=e.pstyle(r+`label`).strValue,a=e.pstyle(`text-transform`).value,o=function(e,r){return r?(hL(n.rscratch,e,t,r),r):mL(n.rscratch,e,t)};if(!i)return``;a==`none`||(a==`uppercase`?i=i.toUpperCase():a==`lowercase`&&(i=i.toLowerCase()));var s=e.pstyle(`text-wrap`).value;if(s===`wrap`){var c=o(`labelKey`);if(c!=null&&o(`labelWrapKey`)===c)return o(`labelWrapCachedText`);for(var l=``,u=i.split(`
|