@a-t-h-i/bot-lobby 0.6.41 → 0.6.43

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.
@@ -15,7 +15,7 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
15
15
  `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?je(n):``}function Pe(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je(`Lazy`);case 13:return e.child!==t&&t!==null?je(`Suspense Fallback`):je(`Suspense`);case 19:return je(`SuspenseList`);case 0:case 15:return Ne(e.type,!1);case 11:return Ne(e.type.render,!1);case 1:return Ne(e.type,!0);case 31:return je(`Activity`);case 30:return je(`ViewTransition`);default:return``}}function Fe(e){try{var t=``,n=null;do t+=Pe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
16
16
  Error generating stack: `+e.message+`
17
17
  `+e.stack}}var Ie=Object.prototype.hasOwnProperty,Le=t.unstable_scheduleCallback,Re=t.unstable_cancelCallback,ze=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function Qe(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var $e=Math.clz32?Math.clz32:nt,et=Math.log,tt=Math.LN2;function nt(e){return e>>>=0,e===0?32:31-(et(e)/tt|0)|0}var rt=256,it=262144,at=4194304;function ot(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&-e;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 st(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=ot(n))):i=ot(o):i=ot(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ot(n))):i=ot(o)):i=ot(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 ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function lt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-$e(n),i=1<<r;t|=e[r],n&=~i}return t}function ut(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 dt(){var e=at;return at<<=1,!(at&62914560)&&(at=4194304),e}function ft(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function pt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mt(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-$e(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&&ht(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function ht(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-$e(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function gt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-$e(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function _t(e,t){var n=t&-t;return n=n&42?1:vt(n),(n&(e.suspendedLanes|t))===0?n:0}function vt(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 yt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function bt(){var e=F.p;return e===0?(e=window.event,e===void 0?32:Mh(e.type)):e}function xt(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var St=Math.random().toString(36).slice(2),Ct=`__reactFiber$`+St,wt=`__reactProps$`+St,Tt=`__reactContainer$`+St,Et=`__reactEvents$`+St,Dt=`__reactListeners$`+St,Ot=`__reactHandles$`+St,kt=`__reactResources$`+St,At=`__reactMarker$`+St,jt=`__reactLoad$`+St;function Mt(e){delete e[Ct],delete e[wt],delete e[Dt],delete e[Ot]}function Nt(e){var t;if(t=e[Ct])return t;for(var n=e.parentNode;n;){if(t=n[Tt]||n[Ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=xm(e);e!==null;){if(n=e[Ct])return n;e=xm(e)}return t}e=n,n=e.parentNode}return null}function Pt(e){if(e=e[Ct]||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 Ft(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function It(e){var t=e[kt];return t||=e[kt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Lt(e){e[At]=!0}function Rt(e){e[jt]=void 0}var zt=new Set,Bt={};function Vt(e,t){Ht(e,t),Ht(e+`Capture`,t)}function Ht(e,t){for(Bt[e]=t,e=0;e<t.length;e++)zt.add(t[e])}var Ut=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]*$`),Wt={},Gt={};function Kt(e){return Ie.call(Gt,e)?!0:Ie.call(Wt,e)?!1:Ut.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var qt=!1;function Jt(){var e=qt;return qt=!1,e}function Yt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Xt(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 Zt(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 Qt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function $t(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function en(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 tn(e){if(!e._valueTracker){var t=$t(e)?`checked`:`value`;e._valueTracker=en(e,t,``+e[t])}}function nn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=$t(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var rn=/[\n"\\]/g;function an(e){return e.replace(rn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function on(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=``+Qt(t)):e.value!==``+Qt(t)&&(e.value=``+Qt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):cn(e,Qt(n)):o===`number`&&e.value==t?cn(e,Qt(e.value)):cn(e,Qt(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=``+Qt(s):e.removeAttribute(`name`)}function sn(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)){tn(e);return}n=n==null?``:``+Qt(n),t=t==null?n:``+Qt(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),tn(e)}function cn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function I(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=``+Qt(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 ln(e,t,n){if(t!=null&&(t=``+Qt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Qt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(me(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Qt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),tn(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=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 pn(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||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(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]=``,qt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(pn(e,a,r),qt=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(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 gn=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`],[`maskType`,`mask-type`],[`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`]]),_n=/^[\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 vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Pt(e);if(t&&(e=t.stateNode)){var n=e[wt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(on(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="`+an(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[wt]||null;if(!a)throw Error(i(90));on(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&&nn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&I(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Jd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[wt]||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 On=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.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 Nn=i.slice(e,1<r?1-r:void 0)}function Fn(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 In(){return!0}function Ln(){return!1}function Rn(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)?In:Ln,this.isPropagationStopped=Ln,this}return T(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=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=T({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=T({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,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!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(T({},Kn,{dataTransfer:0})),Yn=Rn(T({},Vn,{relatedTarget:0})),Xn=Rn(T({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(T({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(T({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={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`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(T({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(T({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(T({},zn,{submitter:0})),sr=Rn(T({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(T({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(T({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=Rn(T({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!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 hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={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 wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=ip(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Qf(e,0)}function kr(e){if(nn(Ft(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(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(!Ie.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(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=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(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=Wr(e.document)}return t}function Yr(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 Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(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}),$r&&Ur($r,r)||($r=r,r=ip(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Vt(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=kd.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ld;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=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)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[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&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(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-$e(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Rd)throw Rd=0,zd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(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 Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(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&1206910976,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&=1206910978;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 Li(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=nh(e,n,xe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case ae:return e=Ni(31,n,t,a),e.elementType=ae,e.lanes=o,e;case k:return Ri(n.children,a,o,t);case A:s=8,a|=24;break;case ee:return e=Ni(12,n,t,a|2),e.elementType=ee,e.lanes=o,e;case ne:return e=Ni(13,n,t,a),e.elementType=ne,e.lanes=o,e;case N:return e=Ni(19,n,t,a),e.elementType=N,e.lanes=o,e;case oe:case ce:return e=a|32,e=Ni(30,n,t,e),e.elementType=ce,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case M:s=10;break a;case j:s=9;break a;case te:s=11;break a;case re:s=14;break a;case ie:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Fe(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Fe(t)}}var Wi=[],Gi=0,Ki=null,qi=0,Ji=[],Yi=0,Xi=null,Zi=1,Qi=``;function $i(e,t){Wi[Gi++]=qi,Wi[Gi++]=Ki,Ki=e,qi=t}function ea(e,t,n){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Xi=e;var r=Zi;e=Qi;var i=32-$e(r)-1;r&=~(1<<i),n+=1;var a=32-$e(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Zi=1<<32-$e(t)+i|n<<i|r,Qi=a+e}else Zi=1<<a|n<<i|r,Qi=e}function ta(e){e.return!==null&&($i(e,1),ea(e,1,0))}function na(e){for(;e===Ki;)Ki=Wi[--Gi],Wi[Gi]=null,qi=Wi[--Gi],Wi[Gi]=null;for(;e===Xi;)Xi=Ji[--Yi],Ji[Yi]=null,Qi=Ji[--Yi],Ji[Yi]=null,Zi=Ji[--Yi],Ji[Yi]=null}function ra(e,t){Ji[Yi++]=Zi,Ji[Yi++]=Qi,Ji[Yi++]=Xi,Zi=t.id,Qi=t.overflow,Xi=e}var ia=null,aa=null,oa=!1,sa=null,ca=!1,la=Error(i(519));function ua(e){throw ga(Ui(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),la}function da(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ct]=e,t[wt]=r,n){case`dialog`:V(`cancel`,t),V(`close`,t);break;case`iframe`:case`object`:case`embed`:V(`load`,t);break;case`video`:case`audio`:for(n=0;n<Xf.length;n++)V(Xf[n],t);break;case`source`:V(`error`,t);break;case`img`:case`image`:case`link`:V(`error`,t),V(`load`,t);break;case`details`:V(`toggle`,t);break;case`input`:V(`invalid`,t),sn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:V(`invalid`,t);break;case`textarea`:V(`invalid`,t),un(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||lp(t.textContent,n)?(r.popover!=null&&(V(`beforetoggle`,t),V(`toggle`,t)),r.onScroll!=null&&V(`scroll`,t),r.onScrollEnd!=null&&V(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ua(e,!0)}function fa(e){for(ia=e.return;ia;)switch(ia.tag){case 5:case 31:case 13:ca=!1;return;case 27:case 3:ca=!0;return;default:ia=ia.return}}function pa(e){if(e!==ia)return!1;if(!oa)return fa(e),oa=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Sp(e.type,e.memoizedProps)),n=!n),n&&aa&&ua(e),fa(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=bm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));aa=bm(e)}else t===27?(t=aa,jp(e.type)?(e=ym,ym=null,aa=e):aa=t):aa=ia?vm(e.stateNode.nextSibling):null;return!0}function ma(){aa=ia=null,oa=!1}function ha(){var e=sa;return e!==null&&(xd===null?xd=e:xd.push.apply(xd,e),sa=null),e}function ga(e){sa===null?sa=[e]:sa.push(e)}var _a=ve(null),va=null,ya=null;function ba(e,t,n){be(_a,t._currentValue),t._currentValue=n}function xa(e){e._currentValue=_a.current,ye(_a)}function Sa(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 Ca(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),Sa(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),Sa(s,n,e),s=null}else a.tag===13&&a.memoizedState!==null&&a.memoizedState.dehydrated===null?(a.lanes|=n,s=a.alternate,s!==null&&(s.lanes|=n),Sa(a.return,n,e),s=a.child,s=s===null?null:s.sibling):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 wa(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===we.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[gh]:e.push(gh))}a=a.return}return e!==null&&Ca(t,e,n,r),t.flags|=262144,e!==null}function Ta(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ea(e){va=e,ya=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Da(e){return ka(va,e)}function Oa(e,t){return va===null&&Ea(e),ka(e,t)}function ka(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ya===null){if(e===null)throw Error(i(308));ya=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ya=ya.next=t;return n}var Aa=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()})}},ja=t.unstable_scheduleCallback,Ma=t.unstable_NormalPriority,Na={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Pa(){return{controller:new Aa,data:new Map,refCount:0}}function Fa(e){e.refCount--,e.refCount===0&&ja(Ma,function(){e.controller.abort()})}function Ia(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var La=null;function Ra(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var za=null,Ba=0,Va=0,Ha=null;function Ua(e,t){if(za===null){var n=za=[];Ba=0,Va=Wf(),Ha={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ba++,t.then(Wa,Wa),t}function Wa(){if(--Ba===0&&(La=null,za!==null)){Ha!==null&&(Ha.status=`fulfilled`);var e=za;za=null,Va=0,Ha=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ga(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 Ka=P.S;P.S=function(e,t){if(wd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Ua(e,t),La!==null)for(var n=Af;n!==null;)Ia(n,La),n=n.next;if(n=e.types,n!==null){for(var r=Af;r!==null;)Ia(r,n),r=r.next;if(Va!==0){r=La,r===null&&(r=La=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ka!==null&&Ka(e,t)};var qa=ve(null);function Ja(){var e=qa.current;return e===null?od.pooledCache:e}function Ya(e,t){t===null?be(qa,qa.current):be(qa,t.pool)}function Xa(){var e=Ja();return e===null?null:{parent:Na._currentValue,pool:e}}var Za=Error(i(460)),Qa=Error(i(474)),$a=Error(i(542)),eo={then:function(){}};function to(e){return e=e.status,e===`fulfilled`||e===`rejected`}function no(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,oo(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=od,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,oo(e),e}throw io=t,Za}}function ro(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(io=e,Za):e}}var io=null;function ao(){if(io===null)throw Error(i(459));var e=io;return io=null,e}function oo(e){if(e===Za||e===$a)throw Error(i(483))}var so=null,co=0;function lo(e){var t=co;return co+=1,so===null&&(so=[]),no(so,e,t)}function uo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function fo(e,t){throw t.$$typeof===E?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function po(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=Fi(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|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(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===k?(e=d(e,t,n.props.children,r,n.key),uo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ie&&ro(i)===t.type)?(t=a(t,n.props),uo(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),uo(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=Vi(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=Ri(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=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Li(t.type,t.key,t.props,null,e.mode,n),uo(n,t),n.return=e,n;case O:return t=Vi(t,e.mode,n),t.return=e,t;case ie:return t=ro(t),f(e,t,n)}if(me(t)||de(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,lo(t),n);if(t.$$typeof===M)return f(e,Oa(e,t),n);fo(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 D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case ie:return n=ro(n),p(e,t,n,r)}if(me(n)||de(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,lo(n),r);if(n.$$typeof===M)return p(e,t,Oa(e,n),r);fo(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 D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ie:return r=ro(r),m(e,t,n,r,i)}if(me(r)||de(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,lo(r),i);if(r.$$typeof===M)return m(e,t,n,Oa(t,r),i);fo(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),oa&&$i(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 oa&&$i(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(_.key===null?h:_.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)}),oa&&$i(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),oa&&$i(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 oa&&$i(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(_.key===null?g:_.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)}),oa&&$i(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),uo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ie&&ro(l)===r.type){n(e,r.sibling),c=a(r,o.props),uo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ri(o.props.children,e.mode,c,o.key),uo(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),uo(c,o),c.return=e,e=c)}return s(e);case O: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}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case ie:return o=ro(o),_(e,r,o,c)}if(me(o))return h(e,r,o,c);if(de(o)){if(l=de(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,lo(o),c);if(o.$$typeof===M)return _(e,r,Oa(e,o),c);fo(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=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{co=0;var i=_(e,t,n,r);return so=null,i}catch(t){if(t===Za||t===$a)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var mo=po(!0),ho=po(!1),go=!1;function _o(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vo(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 yo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function bo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ad&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function xo(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,gt(e,n)}}function So(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 Co=!1;function wo(){if(Co){var e=Ha;if(e!==null)throw e}}function To(e,t,n,r){Co=!1;var i=e.updateQueue;go=!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?(sd&f)===f:(r&f)===f){f!==0&&f===Va&&(Co=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:go=!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),hd|=o,e.lanes=o,e.memoizedState=d}}function Eo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Do(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Eo(n[e],t)}var Oo=ve(null),ko=ve(0);function Ao(e,t){e=pd,be(ko,e),be(Oo,t),pd=e|t.baseLanes}function jo(){be(ko,pd),be(Oo,Oo.current)}function Mo(){pd=ko.current,ye(Oo),ye(ko)}var No=ve(null),Po=null;function Fo(e){var t=e.alternate;be(Bo,Bo.current&1),be(No,e),Po===null&&(t===null||Oo.current!==null||t.memoizedState!==null)&&(Po=e)}function Io(e){be(Bo,Bo.current),be(No,e),Po===null&&(Po=e)}function Lo(e){e.tag===22?(be(Bo,Bo.current),be(No,e),Po===null&&(Po=e)):Ro()}function Ro(){be(Bo,Bo.current),be(No,No.current)}function zo(e){ye(No),Po===e&&(Po=null),ye(Bo)}var Bo=ve(0);function Vo(e,t){be(No,No.current),be(Bo,t)}function Ho(e){ye(Bo),ye(No),Po===e&&(Po=null)}function Uo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||hm(n)||gm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){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 Wo=0,L=null,Go=null,Ko=null,qo=!1,Jo=!1,Yo=!1,Xo=0,Zo=0,Qo=null,$o=0;function es(){throw Error(i(321))}function ts(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 ns(e,t,n,r,i,a){return Wo=a,L=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?yc:bc,Yo=!1,a=n(r,i),Yo=!1,Jo&&(a=is(t,n,r,i)),rs(e),a}function rs(e){P.H=vc;var t=Go!==null&&Go.next!==null;if(Wo=0,Ko=Go=L=null,qo=!1,Zo=0,Qo=null,t)throw Error(i(300));e===null||Lc||(e=e.dependencies,e!==null&&Ta(e)&&(Lc=!0))}function is(e,t,n,r){L=e;var a=0;do{if(Jo&&(Qo=null),Zo=0,Jo=!1,25<=a)throw Error(i(301));if(a+=1,Ko=Go=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=xc,o=t(n,r)}while(Jo);return o}function as(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?fs(t):t,e=e.useState()[0],(Go===null?null:Go.memoizedState)!==e&&(L.flags|=1024),t}function os(){var e=Xo!==0;return Xo=0,e}function ss(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function cs(e){if(qo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}qo=!1}Wo=0,Ko=Go=L=null,Jo=!1,Zo=Xo=0,Qo=null}function ls(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ko===null?L.memoizedState=Ko=e:Ko=Ko.next=e,Ko}function us(){if(Go===null){var e=L.alternate;e=e===null?null:e.memoizedState}else e=Go.next;var t=Ko===null?L.memoizedState:Ko.next;if(t!==null)Ko=t,Go=e;else{if(e===null)throw L.alternate===null?Error(i(467)):Error(i(310));Go=e,e={memoizedState:Go.memoizedState,baseState:Go.baseState,baseQueue:Go.baseQueue,queue:Go.queue,next:null},Ko===null?L.memoizedState=Ko=e:Ko=Ko.next=e}return Ko}function ds(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function fs(e){var t=Zo;return Zo+=1,Qo===null&&(Qo=[]),e=no(Qo,e,t),t=L,(Ko===null?t.memoizedState:Ko.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?yc:bc),e}function ps(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return fs(e);if(e.$$typeof===le)return;if(e.$$typeof===M)return Da(e)}throw Error(i(438,String(e)))}function ms(e){var t=null,n=L.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=L.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=ds(),L.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]=se;return t.index++,n}function hs(e,t){return typeof t==`function`?t(e):t}function gs(e){return _s(us(),Go,e)}function _s(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?(Wo&f)===f:(sd&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===Va&&(d=!0);else if((Wo&p)===p){u=u.next,p===Va&&(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,L.lanes|=p,hd|=p;f=u.action,Yo&&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,L.lanes|=f,hd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Lc=!0,d&&(n=Ha,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 vs(e){var t=us(),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)||(Lc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ys(e,t,n){var r=L,a=us(),o=oa;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Hr((Go||a).memoizedState,n);if(s&&(a.memoizedState=n,Lc=!0),a=a.queue,Ws(Ss.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Ko!==null&&!!(Ko.memoizedState.tag&1),zs(e?9:8,{destroy:void 0},xs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,od===null)throw Error(i(349));o||Wo&127||bs(r,t,n)}return n}function bs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=L.updateQueue,t===null?(t=ds(),L.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function xs(e,t,n,r){t.value=n,t.getSnapshot=r,Cs(t)&&ws(e)}function Ss(e,t,n){return n(function(){Cs(t)&&ws(e)})}function Cs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function ws(e){var t=Oi(e,2);t!==null&&Ud(t,e,2)}function Ts(e){var t=ls();if(typeof e==`function`){var n=e;if(e=n(),Yo){Qe(!0);try{n()}finally{Qe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:e},t}function Es(e,t,n,r){return e.baseState=n,_s(e,Go,typeof r==`function`?r:hs)}function Ds(e,t,n,r,a){if(hc(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)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Os(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Os(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};o.types=a===null?null:a.types,P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),ks(e,t,s)}catch(n){js(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),ks(e,t,a)}catch(n){js(e,t,n)}}function ks(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){As(e,t,n)},function(n){return js(e,t,n)}):As(e,t,n)}function As(e,t,n){t.status=`fulfilled`,t.value=n,Ms(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Os(e,n)))}function js(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ms(t),t=t.next;while(t!==r)}e.action=null}function Ms(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ns(e,t){return t}function Ps(e,t){if(oa){var n=od.formState;if(n!==null){a:{var r=L;if(oa){if(aa){b:{for(var i=aa,a=ca;i.nodeType!==8;){if(!a){i=null;break b}if(i=vm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){aa=vm(i.nextSibling),r=i.data===`F!`;break a}}ua(r)}r=!1}r&&(t=n[0])}}return n=ls(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ns,lastRenderedState:t},n.queue=r,n=fc.bind(null,L,r),r.dispatch=n,r=Ts(!1),a=mc.bind(null,L,!1,r.queue),r=ls(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ds.bind(null,L,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Fs(e){return Is(us(),Go,e)}function Is(e,t,n){if(t=_s(e,t,Ns)[0],e=gs(hs)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=fs(t)}catch(e){throw e===Za?$a:e}else r=t;t=us();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(L.flags|=2048,zs(9,{destroy:void 0},Ls.bind(null,i,n),null)),[r,a,e]}function Ls(e,t){e.action=t}function Rs(e){var t=us(),n=Go;if(n!==null)return Is(t,n,e);us(),t=t.memoizedState,n=us();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function zs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=L.updateQueue,t===null&&(t=ds(),L.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 Bs(){return us().memoizedState}function Vs(e,t,n,r){var i=ls();L.flags|=e,i.memoizedState=zs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Hs(e,t,n,r){var i=us();r=r===void 0?null:r;var a=i.memoizedState.inst;Go!==null&&r!==null&&ts(r,Go.memoizedState.deps)?i.memoizedState=zs(t,a,n,r):(L.flags|=e,i.memoizedState=zs(1|t,a,n,r))}function Us(e,t){Vs(8390656,8,e,t)}function Ws(e,t){Hs(2048,8,e,t)}function Gs(e){L.flags|=4;var t=L.updateQueue;if(t===null)t=ds(),L.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ks(e){var t=us().memoizedState;return Gs({ref:t,nextImpl:e}),function(){if(ad&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function qs(e,t){return Hs(4,2,e,t)}function Js(e,t){return Hs(4,4,e,t)}function Ys(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 Xs(e,t,n){n=n==null?null:n.concat([e]),Hs(4,4,Ys.bind(null,t,e),n)}function Zs(){}function Qs(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&ts(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function $s(e,t){var n=us();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&ts(t,r[1]))return r[0];if(r=e(),Yo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r}function ec(e,t,n){return n===void 0||Wo&1073741824&&!(sd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Vd(),L.lanes|=e,hd|=e,n)}function tc(e,t,n,r){return Hr(n,t)?n:Oo.current===null?!(Wo&106)||Wo&1073741824&&!(sd&261930)?(Lc=!0,e.memoizedState=n):(e=Vd(),L.lanes|=e,hd|=e,t):(e=ec(e,n,r),Hr(e,t)||(Lc=!0),e)}function nc(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};s.types=o===null?null:o.types,P.T=s,mc(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?pc(e,t,Ga(c,r),Bd(e)):pc(e,t,r,Bd(e))}catch(n){pc(e,t,{then:function(){},status:`rejected`,reason:n},Bd())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function rc(){}function ic(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=ac(e).queue;nc(e,a,t,he,n===null?rc:function(){return oc(e),n(r)})}function ac(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:he,baseState:he,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:he},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:hs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function oc(e){var t=ac(e);t.next===null&&(t=e.alternate.memoizedState),pc(e,t.next.queue,{},Bd())}function sc(){return Da(gh)}function cc(){return us().memoizedState}function lc(){return us().memoizedState}function uc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Bd();e=yo(n);var r=bo(t,e,n);r!==null&&(Ud(r,t,n),xo(r,t,n)),t={cache:Pa()},e.payload=t;return}t=t.return}}function dc(e,t,n){var r=Bd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},hc(e)?gc(t,n):(n=Di(e,t,n,r),n!==null&&(Ud(n,e,r),_c(n,t,r)))}function fc(e,t,n){pc(e,t,n,Bd())}function pc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(hc(e))gc(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 Ei(e,t,i,0),od===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return Ud(n,e,r),_c(n,t,r),!0}return!1}function mc(e,t,n,r){if(r={lane:2,revertLane:Wf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},hc(e)){if(t)throw Error(i(479))}else t=Di(e,n,r,2),t!==null&&Ud(t,e,2)}function hc(e){var t=e.alternate;return e===L||t!==null&&t===L}function gc(e,t){Jo=qo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function _c(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,gt(e,n)}}var vc={readContext:Da,use:ps,useCallback:es,useContext:es,useEffect:es,useImperativeHandle:es,useLayoutEffect:es,useInsertionEffect:es,useMemo:es,useReducer:es,useRef:es,useState:es,useDebugValue:es,useDeferredValue:es,useTransition:es,useSyncExternalStore:es,useId:es,useHostTransitionStatus:es,useFormState:es,useActionState:es,useOptimistic:es,useMemoCache:es,useCacheRefresh:es,useEffectEvent:es},yc={readContext:Da,use:ps,useCallback:function(e,t){return ls().memoizedState=[e,t===void 0?null:t],e},useContext:Da,useEffect:Us,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Vs(4194308,4,Ys.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Vs(4194308,4,e,t)},useInsertionEffect:function(e,t){Vs(4,2,e,t)},useMemo:function(e,t){var n=ls();t=t===void 0?null:t;var r=e();if(Yo){Qe(!0);try{e()}finally{Qe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ls();if(n!==void 0){var i=n(t);if(Yo){Qe(!0);try{n(t)}finally{Qe(!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=dc.bind(null,L,e),[r.memoizedState,e]},useRef:function(e){var t=ls();return e={current:e},t.memoizedState=e},useState:function(e){e=Ts(e);var t=e.queue,n=fc.bind(null,L,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Zs,useDeferredValue:function(e,t){return ec(ls(),e,t)},useTransition:function(){var e=Ts(!1);return e=nc.bind(null,L,e.queue,!0,!1),ls().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=L,a=ls();if(oa){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),od===null)throw Error(i(349));sd&127||bs(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Us(Ss.bind(null,r,o,e),[e]),r.flags|=2048,zs(9,{destroy:void 0},xs.bind(null,r,o,n,t),null),n},useId:function(){var e=ls(),t=od.identifierPrefix;if(oa){var n=Qi,r=Zi;n=(r&~(1<<32-$e(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Xo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=$o++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:sc,useFormState:Ps,useActionState:Ps,useOptimistic:function(e){var t=ls();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=mc.bind(null,L,!0,n),n.dispatch=t,[e,t]},useMemoCache:ms,useCacheRefresh:function(){return ls().memoizedState=uc.bind(null,L)},useEffectEvent:function(e){var t=ls(),n={impl:e};return t.memoizedState=n,function(){if(ad&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},bc={readContext:Da,use:ps,useCallback:Qs,useContext:Da,useEffect:Ws,useImperativeHandle:Xs,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:$s,useReducer:gs,useRef:Bs,useState:function(){return gs(hs)},useDebugValue:Zs,useDeferredValue:function(e,t){return tc(us(),Go.memoizedState,e,t)},useTransition:function(){var e=gs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:cc,useHostTransitionStatus:sc,useFormState:Fs,useActionState:Fs,useOptimistic:function(e,t){return Es(us(),Go,e,t)},useMemoCache:ms,useCacheRefresh:lc,useEffectEvent:Ks},xc={readContext:Da,use:ps,useCallback:Qs,useContext:Da,useEffect:Ws,useImperativeHandle:Xs,useInsertionEffect:qs,useLayoutEffect:Js,useMemo:$s,useReducer:vs,useRef:Bs,useState:function(){return vs(hs)},useDebugValue:Zs,useDeferredValue:function(e,t){var n=us();return Go===null?ec(n,e,t):tc(n,Go.memoizedState,e,t)},useTransition:function(){var e=vs(hs)[0],t=us().memoizedState;return[typeof e==`boolean`?e:fs(e),t]},useSyncExternalStore:ys,useId:cc,useHostTransitionStatus:sc,useFormState:Rs,useActionState:Rs,useOptimistic:function(e,t){var n=us();return Go===null?(n.baseState=e,[e,n.queue.dispatch]):Es(n,Go,e,t)},useMemoCache:ms,useCacheRefresh:lc,useEffectEvent:Ks};function Sc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Cc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=yo(r);i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Ud(t,e,r),xo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Bd(),i=yo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bo(e,i,r),t!==null&&(Ud(t,e,r),xo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Bd(),r=yo(n);r.tag=2,t!=null&&(r.callback=t),t=bo(e,r,n),t!==null&&(Ud(t,e,n),xo(t,e,n))}};function wc(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?!Ur(n,r)||!Ur(i,a):!0}function Tc(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&&Cc.enqueueReplaceState(t,t.state,null)}function Ec(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=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Dc(e){xi(e)}function Oc(e){console.error(e)}function kc(e){xi(e)}function Ac(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function jc(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 Mc(e,t,n){return n=yo(n),n.tag=3,n.payload={element:null},n.callback=function(){Ac(e,t)},n}function Nc(e){return e=yo(e),e.tag=3,e}function Pc(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(){jc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){jc(t,n,r),typeof i!=`function`&&(Dd===null?Dd=new Set([this]):Dd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Fc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&wa(t,n,a,!0),n=No.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Po===null?tf():n.alternate===null&&md===0&&(md=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===eo?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),wf(e,r,a)),!1;case 22:return n.flags|=65536,r===eo?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)),wf(e,r,a)),!1}throw Error(i(435,n.tag))}return wf(e,r,a),tf(),!1}if(oa)return t=No.current,t===null?(r!==la&&(t=Error(i(423),{cause:r}),ga(Ui(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ui(r,n),a=Mc(e.stateNode,r,a),So(e,a),md!==4&&(md=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==la&&(e=Error(i(422),{cause:r}),ga(Ui(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ui(o,n),bd===null?bd=[o]:bd.push(o),md!==4&&(md=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Mc(n.stateNode,r,e),So(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`&&(Dd===null||!Dd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Nc(a),Pc(a,e,n,r),So(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ic=Error(i(461)),Lc=!1;function Rc(e,t,n,r){t.child=e===null?ho(t,null,n,r):mo(t,e.child,n,r)}function zc(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 Ea(t),r=ns(e,t,n,o,a,i),s=os(),e!==null&&!Lc?(ss(e,t,i),pl(e,t,i)):(oa&&s&&ta(t),t.flags|=1,Rc(e,t,r,i),t.child)}function Bc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Vc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!ml(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return pl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function Vc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Lc=!1,t.pendingProps=r=a,ml(e,i))e.flags&131072&&(Lc=!0);else return t.lanes=e.lanes,pl(e,t,i)}}return Yc(e,t,n,r,i)}function Hc(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 Wc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ya(t,a===null?null:a.cachePool),a===null?jo():Ao(t,a),Lo(t);else return r=t.lanes=536870912,Wc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Ya(t,null),jo(),Ro()):(Ya(t,a.cachePool),Ao(t,a),Ro(),t.memoizedState=null);return Rc(e,t,i,n),t.child}function Uc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Wc(e,t,n,r,i){var a=Ja();return a=a===null?null:{parent:Na._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Ya(t,null),jo(),Lo(t),e!==null&&wa(e,t,r,!0),t.childLanes=i,null}function Gc(e,t){return t=il({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Kc(e,t,n){return mo(t,e.child,null,n),e=Gc(t,t.pendingProps),e.flags|=2,zo(t),t.memoizedState=null,e}function qc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(oa){if(r.mode===`hidden`)return e=Gc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Uc(null,e);if(Io(t),(e=aa)?(e=mm(e,ca),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=536870912,null}return Gc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Io(t),a){if(t.flags&256)t.flags&=-257,t=Kc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Lc||wa(e,t,n,!1),a=(n&e.childLanes)!==0,Lc||a){if(Oo.current===null){if(r=od,r!==null&&(s=_t(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),Ud(r,e,s),Ic;tf()}t=Kc(e,t,n)}else e=o.treeContext,aa=vm(s.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=Gc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Jc(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 Yc(e,t,n,r,i){return Ea(t),n=ns(e,t,n,r,void 0,i),r=os(),e!==null&&!Lc?(ss(e,t,i),pl(e,t,i)):(oa&&r&&ta(t),t.flags|=1,Rc(e,t,n,i),t.child)}function Xc(e,t,n,r,i,a){return Ea(t),t.updateQueue=null,n=is(t,r,n,i),rs(e),r=os(),e!==null&&!Lc?(ss(e,t,a),pl(e,t,a)):(oa&&r&&ta(t),t.flags|=1,Rc(e,t,n,a),t.child)}function Zc(e,t,n,r,i){if(Ea(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Da(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Cc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},_o(t),o=n.contextType,a.context=typeof o==`object`&&o?Da(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Sc(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&&Cc.enqueueReplaceState(a,a.state,null),To(t,r,a,i),wo(),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=Ec(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Da(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)&&Tc(t,a,r,o),go=!1;var f=t.memoizedState;a.state=f,To(t,r,a,i),wo(),l=t.memoizedState,s||f!==l||go?(typeof d==`function`&&(Sc(t,n,d,r),l=t.memoizedState),(c=go||wc(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,vo(e,t),o=t.memoizedProps,u=Ec(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Da(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)&&Tc(t,a,r,c),go=!1,f=t.memoizedState,a.state=f,To(t,r,a,i),wo();var p=t.memoizedState;o!==d||f!==p||go||e!==null&&e.dependencies!==null&&Ta(e.dependencies)?(typeof s==`function`&&(Sc(t,n,s,r),p=t.memoizedState),(u=go||wc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ta(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,Jc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=mo(t,e.child,null,i),t.child=mo(t,null,n,i)):Rc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=pl(e,t,i),e}function Qc(e,t,n,r){return ma(),t.flags|=256,Rc(e,t,n,r),t.child}var $c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function el(e){return{baseLanes:e,cachePool:Xa()}}function tl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=vd),e}function nl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Bo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(oa){if(i?Fo(t):Ro(),(e=aa)?(e=mm(e,ca),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Xi===null?null:{id:Zi,overflow:Qi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ia=t,aa=null)):e=null,e===null)throw ua(t);return t.lanes=gm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ro(),i=t.mode,a=il({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=el(n),r.childLanes=tl(e,o,n),t.memoizedState=$c,Uc(null,r)):(Fo(t),rl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return ol(e,t,a,o,r,c,s,n)}return i?(Ro(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Uc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=el(n):(a=i.cachePool,a===null?a=Xa():(s=Na._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=tl(e,o,n),t.memoizedState=$c,Uc(e.child,r)):(Fo(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function rl(e,t){return t=il({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function il(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function al(e,t,n){return mo(t,e.child,null,n),e=rl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ol(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Fo(t),t.flags&=-257,al(e,t,c)):t.memoizedState===null?(Ro(),o=a.fallback,s=t.mode,a=il({mode:`visible`,children:a.children},s),o=Ri(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,mo(t,e.child,null,c),a=t.child,a.memoizedState=el(c),a.childLanes=tl(e,r,c),t.memoizedState=$c,Uc(null,a)):(Ro(),t.child=e.child,t.flags|=128,null);if(Fo(t),gm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(a=Error(i(419)),a.stack=``,a.digest=r,ga({value:a,source:null,stack:null})),al(e,t,c)}if(Lc||wa(e,t,c,!1),r=(c&e.childLanes)!==0,Lc||r){if(Oo.current!==null)return al(e,t,c);if(r=od,r!==null&&(a=_t(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Oi(e,a),Ud(r,e,a),Ic;return hm(o)||tf(),al(e,t,c)}return hm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,aa=vm(o.nextSibling),ia=t,oa=!0,sa=null,ca=!1,e!==null&&ra(t,e),t=rl(t,a.children),t.flags|=134221824,t)}function sl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Sa(e.return,t,n)}function cl(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Uo(n)===null&&(t=e),e=e.sibling}return t}function ll(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 ul(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function dl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Bo.current;if(t.flags&128)return Vo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Vo(t,o),i===`backwards`&&e!==null?(ul(e),Rc(e,t,r,n),ul(e)):Rc(e,t,r,n),r=oa?qi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&sl(e,n,t);else if(e.tag===19)sl(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`backwards`:n=cl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,ul(t)),ll(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Uo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}ll(t,!0,n,null,a,r);break;case`together`:ll(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=cl(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),ll(t,!1,i,n,a,r)}return t.child}function fl(e,t,n){var r=t.pendingProps;return ba(t,t.type,r.value),Rc(e,t,r.children,n),t.child}function pl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),hd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(wa(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=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ml(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ta(e)))}function hl(e,t,n){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),ba(t,Na,e.memoizedState.cache),ma();break;case 27:case 5:De(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:ba(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Io(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Fo(t),t.flags|=128,null;r=wa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?nl(e,t,n):(Fo(t),e=pl(e,t,n),e===null?null:e.sibling)}Fo(t);break;case 19:if(t.flags&128)return dl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(wa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return dl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Vo(t,Bo.current),r)break;return null;case 22:return t.lanes=0,Hc(e,t,n,t.pendingProps);case 24:ba(t,Na,e.memoizedState.cache)}return pl(e,t,n)}function gl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Lc=!0;else{if(!ml(e,n)&&!(t.flags&128))return Lc=!1,hl(e,t,n);Lc=!!(e.flags&131072)}}else Lc=!1,oa&&t.flags&1048576&&ea(t,qi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ro(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=Ec(e,r),t.tag=1,t=Zc(null,t,e,r,n)):(t.tag=0,t=Yc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===te){t.tag=11,t=zc(null,t,e,r,n);break a}if(a===re){t.tag=14,t=Bc(null,t,e,r,n);break a}if(a===M){t.tag=10,t.type=e,t=fl(null,t,n);break a}}throw t=pe(e)||e,Error(i(306,t,``))}}return t;case 0:return Yc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ec(r,t.pendingProps),Zc(e,t,r,a,n);case 3:a:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,vo(e,t),To(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ba(t,Na,r),r!==o.cache&&Ca(t,[Na],n,!0),wo(),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=Qc(e,t,r,n);break a}if(r!==a){a=Ui(Error(i(424)),t),ga(a),t=Qc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(aa=vm(e.firstChild),ia=t,oa=!0,sa=null,ca=!0,n=ho(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ma(),r===a){t=pl(e,t,n);break a}Rc(e,t,r,n)}t=t.child}return t;case 26:return Jc(e,t),e===null?(n=Hm(t.type,null,t.pendingProps,null))?t.memoizedState=n:oa||(t.stateNode=xp(t.type,t.pendingProps,Ce.current,t)):t.memoizedState=Hm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return De(t),e===null&&oa&&(r=t.stateNode=wm(t.type,t.pendingProps,Ce.current),ia=t,ca=!0,a=aa,jp(t.type)?(ym=a,aa=vm(r.firstChild)):aa=a),Rc(e,t,t.pendingProps.children,n),Jc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&oa&&((a=r=aa)&&(r=fm(r,t.type,t.pendingProps,ca),r===null?a=!1:(t.stateNode=r,ia=t,aa=vm(r.firstChild),ca=!1,a=!0)),a||ua(t)),De(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Sp(a,o)?r=null:s!==null&&Sp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=ns(e,t,as,null,null,n),gh._currentValue=a),Jc(e,t),Rc(e,t,r,n),t.child;case 6:return e===null&&oa&&((e=n=aa)&&(n=pm(n,t.pendingProps,ca),n===null?e=!1:(t.stateNode=n,ia=t,aa=null,e=!0)),e||ua(t)),null;case 13:return nl(e,t,n);case 4:return Te(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=mo(t,null,r,n):Rc(e,t,r,n),t.child;case 11:return zc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Jc(e,t),Rc(e,t,r,n),t.child;case 8:return Rc(e,t,t.pendingProps.children,n),t.child;case 12:return Rc(e,t,t.pendingProps.children,n),t.child;case 10:return fl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Ea(t),a=Da(a),r=r(a),t.flags|=1,Rc(e,t,r,n),t.child;case 14:return Bc(e,t,t.type,t.pendingProps,n);case 15:return Vc(e,t,t.type,t.pendingProps,n);case 19:return dl(e,t,n);case 31:return qc(e,t,n);case 22:return Hc(e,t,n,t.pendingProps);case 24:return Ea(t),r=Da(Na),e===null?(a=Ja(),a===null&&(a=od,o=Pa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},_o(t),ba(t,Na,a)):((e.lanes&n)!==0&&(vo(e,t),To(t,null,null,n),wo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ba(t,Na,r),r!==a.cache&&Ca(t,[Na],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ba(t,Na,r))),Rc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:oa&&ta(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Jc(e,t),Rc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function _l(e){e.flags|=4}function vl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?rh(t,r):rh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Qd())e.flags|=8192;else throw io=eo,Qa}}else e.flags&=-16777217}function yl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ih(t)){if(Qd())e.flags|=8192;else throw io=eo,Qa}}function bl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:dt(),e.lanes|=t,yd|=t)}function xl(e,t){if(!oa)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,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;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function Sl(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&1206910976,r|=i.flags&1206910976,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 Cl(e,t,n){var r=t.pendingProps;switch(na(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sl(t),null;case 1:return Sl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),xa(Na),Ee(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(pa(t)?_l(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ha())),Sl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(_l(t),o===null?(Sl(t),vl(t,a,null,r,n)):(Sl(t),yl(t,o))):o?o===e.memoizedState?(Sl(t),t.flags&=-16777217):(_l(t),Sl(t),yl(t,o)):(e=e.memoizedProps,e!==r&&_l(t),Sl(t),vl(t,a,e,r,n)),null;case 27:if(Oe(t),n=Ce.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sl(t),t.subtreeFlags&=-33554433,null}e=xe.current,pa(t)?da(t,e):(e=wm(a,r,n),t.stateNode=e,_l(t))}return Sl(t),t.subtreeFlags&=-33554433,null;case 5:if(Oe(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Sl(t),t.subtreeFlags&=-33554433,null}if(o=xe.current,pa(t))da(t,o);else{var s=yp(Ce.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[Ct]=t,o[wt]=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(fp(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&&_l(t)}}return Sl(t),t.subtreeFlags&=-33554433,vl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&_l(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=Ce.current,pa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=ia,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||ua(t,!0)}else e=yp(e).createTextNode(r),e[Ct]=t,t.stateNode=e}return Sl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=pa(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[Ct]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),e=!1}else n=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(zo(t),t):(zo(t),null);if(t.flags&128)throw Error(i(558))}return Sl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=pa(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[Ct]=t}else ma(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Sl(t),a=!1}else a=ha(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(zo(t),t):(zo(t),null)}return zo(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),bl(t,t.updateQueue),Sl(t),null);case 4:return Ee(),e===null&&tp(t.stateNode.containerInfo),t.flags|=67108864,Sl(t),null;case 10:return xa(t.type),Sl(t),null;case 19:if(Ho(t),r=t.memoizedState,r===null)return Sl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)xl(r,!1);else{if(md!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Uo(e),o!==null){for(t.flags|=128,xl(r,!1),e=o.updateQueue,t.updateQueue=e,bl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return Vo(t,Bo.current&1|2),oa&&$i(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>Td&&(t.flags|=128,a=!0,xl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,bl(t,e),xl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!oa)return Sl(t),null}else 2*Ve()-r.renderingStartTime>Td&&n!==536870912&&(t.flags|=128,a=!0,xl(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)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Bo.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||oa?Vo(t,o):(n=o,be(No,t),be(Bo,n),Po===null&&(Po=t)),oa&&$i(t,r.treeForkCount),e}return Sl(t),null;case 22:case 23:return zo(t),Mo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Sl(t),t.subtreeFlags&6&&(t.flags|=8192)):Sl(t),n=t.updateQueue,n!==null&&bl(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&&ye(qa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),xa(Na),Sl(t),null;case 25:return null;case 30:return t.flags|=33554432,Sl(t),null}throw Error(i(156,t.tag))}function wl(e,t){switch(na(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xa(Na),Ee(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Oe(t),null;case 31:if(t.memoizedState!==null){if(zo(t),t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ma()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ho(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ee(),null;case 10:return xa(t.type),null;case 22:case 23:return zo(t),Mo(),e!==null&&ye(qa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return xa(Na),null;case 25:return null;default:return null}}function Tl(e,t){switch(na(t),t.tag){case 3:xa(Na),Ee();break;case 26:case 27:case 5:Oe(t);break;case 4:Ee();break;case 31:t.memoizedState!==null&&zo(t);break;case 13:zo(t);break;case 19:Ho(t);break;case 10:xa(t.type);break;case 22:case 23:zo(t),Mo(),e!==null&&ye(qa);break;case 24:xa(Na)}}function El(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){Cf(t,t.return,e)}}function Dl(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){Cf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Cf(t,t.return,e)}}function Ol(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Do(t,n)}catch(t){Cf(e,e.return,t)}}}function kl(e,t,n){n.props=Ec(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Cf(e,t,n)}}function Al(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:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Up(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Wp(e);f(e.child,!1,sm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Cf(e,t,n)}}function jl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Cf(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){Cf(e,t,n)}else n.current=null}}function Ml(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)lm(e.stateNode,t[n])}function Nl(e){for(var t=e.return;t!==null&&(Il(t)&&lm(e.stateNode,t.stateNode),!Fl(t));)t=t.return}function Pl(e){for(var t=e.return;t!==null&&(Il(t)&&um(e.stateNode,t.stateNode),!Fl(t));)t=t.return}function Fl(e){return e.tag===5||e.tag===3||e.tag===27}function Il(e){return e&&e.tag===7&&e.stateNode!==null}function Ll(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){Cf(e,e.return,t)}}function Rl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[wt]=t}catch(t){Cf(e,e.return,t)}}function zl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jp(e.type)||e.tag===4}function Bl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||zl(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&&jp(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 Vl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Ml(e,r),qt=!0;else if(i!==4&&(i===27&&(Ml(e,r),r=null,jp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Vl(e,t,n,r),e=e.sibling;e!==null;)Vl(e,t,n,r),e=e.sibling}function Hl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Ml(e,r),qt=!0;else if(i!==4&&(i===27&&(Ml(e,r),r=null,jp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Hl(e,t,n,r),e=e.sibling;e!==null;)Hl(e,t,n,r),e=e.sibling}function Ul(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);fp(t,r,n),t[Ct]=e,t[wt]=n}catch(t){Cf(e,e.return,t)}}var Wl=!1,Gl=null;function Kl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Wl=!0)}var ql=null;function Jl(){var e=ql;return ql=null,e}var Yl=0;function Xl(e,t,n,r,i){return Yl=0,Zl(e.child,t,n,r,i)}function Zl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Lp(o);r.push(s),s.view&&(a=!0)}else a||Lp(o).view&&(a=!0);Wl=!0,Pp(o,Yl===0?t:t+`_`+Yl,n),Yl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Zl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Ql(e,t){for(;e!==null;)e.tag===5?Fp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Ql(e.child,t)),e=e.sibling}function $l(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&($l(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(i(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Xl(e,n,t,null,!1)||Ql(e.child,!1))}e=e.sibling}}function eu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?$l(e):Xl(e,i,a,null,!1)?($l(e),n.paired||t||Hd(e,r.onEnter)):Ql(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e,t),e=e.sibling;else $l(e)}function tu(e){if(Gl!==null&&Gl.size!==0){var t=Gl;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Xl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Hd(e,n.onShare)):Ql(e.child,!1)),t.delete(r),t.size===0)break}}}tu(e)}e=e.sibling}}}function nu(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Gl===null?void 0:Gl.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Xl(e,n,i,null,!1)?r===void 0?Hd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Gl.delete(n),Hd(e,t.onShare)):Ql(e.child,!1)),Gl!==null&&tu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)nu(e),e=e.sibling;else Gl!==null&&tu(e)}function ru(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Xl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ru(e);e=e.sibling}}function iu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Ql(e.child,!1))}iu(e)}e=e.sibling}}function au(e){if(e.tag===30)e.stateNode.paired=null,Ql(e.child,!1),iu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)au(e),e=e.sibling;else iu(e)}function ou(e){for(e=e.child;e!==null;)e.tag===30?Ql(e.child,!1):e.subtreeFlags&33554432&&ou(e),e=e.sibling}function su(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Yl<a.length){var l=a[Yl],u=Lp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&Pp(c,Yl===0?n:n+`_`+Yl,i),s&&e.flags&4||(ql===null&&(ql=[]),ql.push(c,Yl===0?r:r+`_`+Yl,t.memoizedProps)),Yl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:su(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function cu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Rp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Yl=0,i=su(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Hd(e,n.onUpdate))}else e.subtreeFlags&33554432&&cu(e,t);e=e.sibling}}var lu=!1,uu=!1,du=!1,fu=!1,pu=typeof WeakSet==`function`?WeakSet:Set,mu=null,hu=!1,gu=!1,_u=!1,vu=!1;function yu(e,t,n){if(e=e.containerInfo,_p=Th,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(vp={focusedElem:e,selectionRange:r},Th=!1,n=(n&335544064)===n,mu=t,t=n?9270:1024;mu!==null;){if(e=mu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&nu(r[a]);if(e.alternate===null&&e.flags&2)n&&Kl(e),R(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&nu(r),R(n);continue}if(r!==null&&r.memoizedState!==null){n&&Kl(e),R(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,mu=r):(n&&ru(e),R(n))}}Gl=null}function R(e){for(;mu!==null;){var t=mu,n=e,r=t.alternate,a=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(a&1024&&r!==null){n=void 0,a=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Ec(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Cf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)dm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:dm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=bi(a.default,a.update),a!==`none`&&Xl(r,n,a,r.memoizedState=[],!0));break;default:if(a&1024)throw Error(i(163))}if(r=t.sibling,r!==null){r.return=t.return,mu=r;break}mu=t.return}}function bu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Bu(e,n),r&4&&El(5,n);break;case 1:if(Bu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Cf(n,n.return,e)}else{var i=Ec(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Cf(n,n.return,e)}}}r&64&&Ol(n),r&512&&Al(n,n.return);break;case 3:if(Bu(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{Do(e,t)}catch(e){Cf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ul(n);case 26:case 5:Bu(e,n),t===null&&r&4&&Ll(n),r&512&&Al(n,n.return);break;case 12:Bu(e,n);break;case 31:Bu(e,n),r&4&&ku(e,n);break;case 13:Bu(e,n),r&4&&Au(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Df.bind(null,n),_m(e,n))));break;case 22:if(r=n.memoizedState!==null||lu,!r){var a=t!==null&&t.memoizedState!==null||uu;t=lu,i=uu,lu=r,(uu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Hu(e,n,r)):Bu(e,n),lu=t,uu=i}break;case 30:Bu(e,n),r&512&&Al(n,n.return);break;case 7:r&512&&Al(n,n.return);default:Bu(e,n)}}function xu(e,t){for(e=e.child;e!==null;)Su(e,t),e=e.sibling}function Su(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Cf(e,e.return,t)}Cu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,qt=!0}catch(t){Cf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Np(s,!0):Np(e.stateNode,!1)}catch(t){Cf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&xu(e,t);break;default:xu(e,t)}}function Cu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Su(n,r);break a;case 22:n.memoizedState===null&&Cu(n,r);break a;default:Cu(n,r)}}e=e.sibling}}function wu(e){var t=e.alternate;t!==null&&(e.alternate=null,wu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Mt(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 Tu=null,Eu=!1;function Du(e,t,n){for(n=n.child;n!==null;)Ou(e,t,n),n=n.sibling}function Ou(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:uu||jl(n,t),Du(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!uu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:uu||jl(n,t),Pl(n);var r=Tu,i=Eu;jp(n.type)&&(Tu=n.stateNode,Eu=!1),Du(e,t,n),Tm(n.stateNode,n.type,n.memoizedProps),Tu=r,Eu=i;break;case 5:uu||jl(n,t),Pl(n);case 6:if(n.tag===6&&Pl(n),r=Tu,i=Eu,Tu=null,Du(e,t,n),Tu=r,Eu=i,Tu!==null){if(Eu)try{(Tu.nodeType===9?Tu.body:Tu.nodeName===`HTML`?Tu.ownerDocument.body:Tu).removeChild(n.stateNode),qt=!0}catch(e){Cf(n,t,e)}else try{Tu.removeChild(n.stateNode),qt=!0}catch(e){Cf(n,t,e)}}break;case 18:Tu!==null&&(Eu?(e=Tu,Mp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Zh(e)):Mp(Tu,n.stateNode));break;case 4:r=Tu,i=Eu,Tu=n.stateNode.containerInfo,Eu=!0,Du(e,t,n),Tu=r,Eu=i;break;case 0:case 11:case 14:case 15:Dl(2,n,t),uu||Dl(4,n,t),Du(e,t,n);break;case 1:uu||(jl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&kl(n,t,r)),Du(e,t,n);break;case 21:Du(e,t,n);break;case 22:uu=(r=uu)||n.memoizedState!==null,Du(e,t,n),uu=r;break;case 30:jl(n,t),Du(e,t,n);break;case 7:uu||jl(n,t),Du(e,t,n);break;default:Du(e,t,n)}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zh(e)}catch(e){Cf(t,t.return,e)}}}function Au(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zh(e)}catch(e){Cf(t,t.return,e)}}function ju(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new pu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new pu),t;default:throw Error(i(435,e.tag))}}function Mu(e,t){var n=ju(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Of.bind(null,e,t);t.then(r,r)}})}function Nu(e,t,n){var r=t.deletions;if(r!==null)for(var a=0;a<r.length;a++){var o=r[a],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(jp(l.type)){Tu=l.stateNode,Eu=!1;break a}break;case 5:Tu=l.stateNode,Eu=!1;break a;case 3:case 4:Tu=l.stateNode.containerInfo,Eu=!0;break a}l=l.return}if(Tu===null)throw Error(i(160));Ou(s,c,o),Tu=null,Eu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Fu(t,e,n),t=t.sibling}var Pu=null;function Fu(e,t,n){var r=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(a&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Nu(t,e,n),Iu(e),a&4&&(Dl(3,e,e.return),El(3,e),Dl(5,e,e.return));break;case 1:Nu(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),a&64&&lu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Pu,Nu(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),a&4){if(a=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(lu)e.stateNode=xp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,a=o.ownerDocument||o;b:switch(t){case`title`:r=a.getElementsByTagName(`title`)[0],(!r||r[At]||r[Ct]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),fp(r,t,n),r[Ct]=e,Lt(r),t=r;break a;case`link`:if(o=eh(`link`,`href`,a).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=eh(`meta`,`content`,a).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=a.createElement(t),fp(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[Ct]=e,Lt(r),t=r}e.stateNode=t}}else lu||th(o,e.type,e.stateNode)}else e.stateNode=Ym(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Rl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||uu||t.parentNode.removeChild(t)):a.count--,n===null?lu||th(o,e.type,e.stateNode):Ym(o,n,e.memoizedProps))}break;case 27:Nu(t,e,n),Iu(e),a&512&&(uu||r===null||jl(r,r.return)),r!==null&&a&4&&Rl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=du,du=!1,Nu(t,e,n),du=o,Iu(e),a&512&&(uu||r===null||jl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),qt=!0}catch(t){Cf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Rl(e,t,r===null?t:r.memoizedProps)),a&1024&&(fu=!0);break;case 6:if(Nu(t,e,n),Iu(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,qt=!0}catch(t){Cf(e,e.return,t)}}break;case 3:if(qt=!1,$m=null,o=Pu,Pu=km(t.containerInfo),Nu(t,e,n),Pu=o,Iu(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Zh(t.containerInfo)}catch(t){Cf(e,e.return,t)}fu&&(fu=!1,Lu(e)),qt=!1;break;case 4:a=du,du=lu,r=Jt(),o=Pu,Pu=km(e.stateNode.containerInfo),Nu(t,e,n),Iu(e),Pu=o,qt&&gu&&(_u=!0),qt=r,du=a;break;case 12:Nu(t,e,n),Iu(e);break;case 31:Nu(t,e,n),Iu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mu(e,t)));break;case 13:Nu(t,e,n),Iu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Cd=Ve()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=lu,l=uu,u=du;lu=c||o,du=u||o,uu=l||s,Nu(t,e,n),uu=l,du=u,lu=c,Iu(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||lu||uu||(t=s||uu,n=lu,r=uu,lu=o||lu,uu=t,Vu(e,2),lu=n,uu=r),!o&&du||xu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Mu(e,n))));break;case 19:Nu(t,e,n),Iu(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Mu(e,t)));break;case 30:a&512&&(uu||r===null||jl(r,r.return)),a=Jt(),o=gu,s=(n&335544064)===n,c=e.memoizedProps,gu=s&&bi(c.default,c.update)!==`none`,Nu(t,e,n),Iu(e),s&&r!==null&&qt&&(e.flags|=4),gu=o,qt=a;break;case 21:break;case 7:a&512&&(uu||r===null||jl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Nu(t,e,n),Iu(e)}}function Iu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(zl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Il(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Fl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Hl(e,Bl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Hl(e,Bl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Vl(e,Bl(e),u,s);break;default:throw Error(i(161))}}catch(t){Cf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Th=!0,t.reset(),Th=!1),e=e.sibling}}function Ru(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)zu(t,e),t=t.sibling;else cu(t,!1)}function zu(e,t){var n=e.alternate;if(n===null)eu(e,!1);else switch(e.tag){case 3:if(vu=hu=!1,Jl(),Ru(t,e),!hu&&!_u){if(e=ql,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Fp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),vu=!0}ql=null;break;case 5:Ru(t,e);break;case 4:r=hu,hu=!1,Ru(t,e),hu&&(_u=!0),hu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ru(t,e):eu(e,!1));break;case 30:r=hu,i=Jl(),hu=!1,Ru(t,e),hu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Yl=0,t=su(e,n,t,o,s,a,!0),Yl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Hd(e,e.memoizedProps.onUpdate),ql=i):i!==null&&(i.push.apply(i,ql),ql=i),hu=e.flags&32?!0:r;break;default:Ru(t,e)}}function Bu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)bu(e,t.alternate,t),t=t.sibling}function Vu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Dl(4,n,n.return),Vu(n,r);break;case 1:jl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&kl(n,n.return,i),Vu(n,r);break;case 27:r&2&&Tm(n.stateNode,n.type,n.memoizedProps);case 5:jl(n,n.return),n.tag!==5&&n.tag!==27||Pl(n),Vu(n,r);break;case 6:Pl(n);break;case 26:jl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||uu||i.parentNode.removeChild(i),Vu(n,r);break;case 22:n.memoizedState===null&&Vu(n,r);break;case 30:jl(n,n.return),Vu(n,r);break;case 7:jl(n,n.return);default:Vu(n,r)}e=e.sibling}}function Hu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Hu(i,a,n),El(4,a);break;case 1:if(Hu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Cf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Eo(l[i],c)}catch(e){Cf(r,r.return,e)}}s&&o&64&&Ol(a),Al(a,a.return);break;case 27:n&2&&Ul(a);case 5:a.tag!==5&&a.tag!==27||Nl(a),Hu(i,a,n),s&&r===null&&o&4&&Ll(a),Al(a,a.return);break;case 6:Nl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||lu||th(km(c.ownerDocument),a.type,c),Hu(i,a,n),s&&r===null&&o&4&&Ll(a),Al(a,a.return);break;case 12:Hu(i,a,n);break;case 31:Hu(i,a,n),s&&o&4&&ku(i,a);break;case 13:Hu(i,a,n),s&&o&4&&Au(i,a);break;case 22:a.memoizedState===null&&Hu(i,a,n),Al(a,a.return);break;case 30:Hu(i,a,n),Al(a,a.return);break;case 7:Al(a,a.return);default:Hu(i,a,n)}t=t.sibling}}function Uu(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&&Fa(n))}function Wu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Fa(e))}function Gu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ku(e,t,n,r),t=t.sibling;else i&&ou(t)}function Ku(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&au(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Gu(e,t,n,r),a&2048&&El(9,t);break;case 1:Gu(e,t,n,r);break;case 3:Gu(e,t,n,r),i&&vu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Fa(a)));break;case 12:if(a&2048){Gu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Cf(t,t.return,e)}}else Gu(e,t,n,r);break;case 31:Gu(e,t,n,r);break;case 13:Gu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&au(t),o._visibility&2?Gu(e,t,n,r):(o._visibility|=2,qu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&au(s),o._visibility&2?Gu(e,t,n,r):Ju(e,t)),a&2048&&Uu(s,t);break;case 24:Gu(e,t,n,r),a&2048&&Wu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Ql(a.child,!0),Ql(t.child,!0))),Gu(e,t,n,r);break;default:Gu(e,t,n,r)}}function qu(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!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:qu(a,o,s,c,i),El(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,qu(a,o,s,c,i)):u._visibility&2?qu(a,o,s,c,i):Ju(a,o),i&&l&2048&&Uu(o.alternate,o);break;case 24:qu(a,o,s,c,i),i&&l&2048&&Wu(o.alternate,o);break;default:qu(a,o,s,c,i)}t=t.sibling}}function Ju(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:Ju(n,r),i&2048&&Uu(r.alternate,r);break;case 24:Ju(n,r),i&2048&&Wu(r.alternate,r);break;default:Ju(n,r)}t=t.sibling}}var Yu=8192;function Xu(e,t,n){if(e.subtreeFlags&Yu)for(e=e.child;e!==null;)Zu(e,t,n),e=e.sibling}function Zu(e,t,n){switch(e.tag){case 26:Xu(e,t,n),e.flags&Yu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&oh(n,e)):sh(n,Pu,e.memoizedState,e.memoizedProps));break;case 5:Xu(e,t,n),e.flags&Yu&&(e=e.stateNode,(t&335544128)===t&&oh(n,e));break;case 3:case 4:var r=Pu;Pu=km(e.stateNode.containerInfo),Xu(e,t,n),Pu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Yu,Yu=16777216,Xu(e,t,n),Yu=r):Xu(e,t,n));break;case 30:if((e.flags&Yu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Gl===null&&(Gl=new Map),Gl.set(r,i)}Xu(e,t,n);break;default:Xu(e,t,n)}}function Qu(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 $u(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,nd(r,e)}Qu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ed(e),e=e.sibling}function ed(e){switch(e.tag){case 0:case 11:case 15:$u(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:$u(e);break;case 12:$u(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,td(e)):$u(e);break;default:$u(e)}}function td(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];mu=r,nd(r,e)}Qu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),td(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,td(t));break;default:td(t)}e=e.sibling}}function nd(e,t){for(;mu!==null;){var n=mu;switch(n.tag){case 0:case 11:case 15:Dl(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:Fa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,mu=r;else a:for(n=e;mu!==null;){r=mu;var i=r.sibling,a=r.return;if(wu(r),r===n){mu=null;break a}if(i!==null){i.return=a,mu=i;break a}mu=a}}}var rd={getCacheForType:function(e){var t=Da(Na),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Da(Na).controller.signal}},id=typeof WeakMap==`function`?WeakMap:Map,ad=0,od=null,z=null,sd=0,cd=0,ld=null,ud=!1,dd=!1,fd=!1,pd=0,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=null,xd=null,Sd=!1,Cd=0,wd=0,Td=1/0,Ed=null,Dd=null,Od=0,kd=null,Ad=null,jd=0,Md=0,Nd=null,Pd=null,Fd=null,Id=null,Ld=null,Rd=0,zd=null;function Bd(){return ad&2&&sd!==0?sd&-sd:P.T===null?bt():Wf()}function Vd(){if(vd===0){if(!(sd&536870912)||oa){var e=it;it<<=1,!(it&3932160)&&(it=262144),vd=e}else vd=536870912}return e=No.current,e!==null&&(e.flags|=32),vd}function Hd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Up(vi(e.memoizedProps,n))),Id===null&&(Id=[]),Id.push(t.bind(null,r))}}function Ud(e,t,n){(e===od&&(cd===2||cd===9)||e.cancelPendingCommit!==null)&&(Xd(e,0),qd(e,sd,vd,!1)),pt(e,n),(!(ad&2)||e!==od)&&(e===od&&(!(ad&2)&&(gd|=n),md===4&&qd(e,sd,vd,!1)),If(e))}function Wd(e,t,n){if(ad&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),a=r?af(e,t):nf(e,t,!0),o=r;do{if(a===0){dd&&!r&&qd(e,t,0,!1);break}if(n=e.current.alternate,o&&!Kd(n)){a=nf(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=bd;var l=c.current.memoizedState.isDehydrated;if(l&&(Xd(c,s).flags|=256),s=nf(c,s,!1),s!==2&&s!==6){if(fd&&!l){c.errorRecoveryDisabledLanes|=o,gd|=o,a=4;break a}o=xd,xd=a,o!==null&&(xd===null?xd=o:xd.push.apply(xd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Xd(e,0),qd(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&&(t&62914560)!==t)break;case 6:qd(r,t,vd,!ud);break a;case 2:xd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=Cd+300-Ve(),10<a)){if(qd(r,t,vd,!ud),st(r,0,!0)!==0)break a;jd=t,r.timeoutHandle=Tp(Gd.bind(null,r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,`Throttled`,-0,0),a);break a}Gd(r,n,xd,Ed,Sd,t,vd,gd,yd,ud,o,null,-0,0)}break}while(1);If(e)}function Gd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Gl=null,Zu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=dh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Cd-Ve():(a&4194048)===a?wd-Ve():0,m=lh(d,m),m!==null)){jd=a,e.cancelPendingCommit=m(ff.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),qd(e,a,o,!l);return}ff(e,t,a,n,r,i,o,s,c,l,u,d)}function Kd(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 qd(e,t,n,r){t=lt(e,t),t&=~_d,t&=~gd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-$e(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&ht(e,n,t)}function Jd(){return ad&6?!0:(Lf(0,!1),!1)}function Yd(){if(z!==null){if(cd===0)var e=z.return;else e=z,ya=va=null,cs(e),so=null,co=0,e=z;for(;e!==null;)Tl(e.alternate,e),e=e.return;z=null}}function Xd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ep(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),jd=0,Yd(),od=e,z=n=Fi(e.current,null),sd=t,cd=0,ld=null,ud=!1,dd=ct(e,t),fd=!1,yd=vd=_d=gd=hd=md=0,xd=bd=null,Sd=!1,pd=lt(e,t),Ti(),n}function Zd(e,t){L=null,P.H=vc,t===Za||t===$a?(t=ao(),cd=3):t===Qa?(t=ao(),cd=4):cd=t===Ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ld=t,z===null&&(md=1,Ac(e,Ui(t,e.current)))}function Qd(){var e=No.current;return e===null?!0:(sd&4194048)===sd?Po===null:(sd&62914560)===sd||sd&536870912?e===Po:!1}function $d(){var e=P.H;return P.H=vc,e===null?vc:e}function ef(){var e=P.A;return P.A=rd,e}function tf(){md=4,ud||(sd&4194048)!==sd&&No.current!==null||(dd=!0),!(hd&134217727)&&!(gd&134217727)||od===null||qd(od,sd,vd,!1)}function nf(e,t,n){var r=ad;ad|=2;var i=$d(),a=ef();(od!==e||sd!==t)&&(Ed=null,Xd(e,t)),t=!1;var o=md;a:do try{if(cd!==0&&z!==null){var s=z,c=ld;switch(cd){case 8:Yd(),o=6;break a;case 3:case 2:case 9:case 6:No.current===null&&(t=!0);var l=cd;if(cd=0,ld=null,lf(e,s,c,l),n&&dd){o=0;break a}break;default:l=cd,cd=0,ld=null,lf(e,s,c,l)}}rf(),o=md;break}catch(t){Zd(e,t)}while(1);return t&&e.shellSuspendCounter++,ya=va=null,ad=r,P.H=i,P.A=a,z===null&&(od=null,sd=0,Ti()),o}function rf(){for(;z!==null;)sf(z)}function af(e,t){var n=ad;ad|=2;var r=$d(),a=ef();od!==e||sd!==t?(Ed=null,Td=Ve()+500,Xd(e,t)):dd=ct(e,t);a:do try{if(cd!==0&&z!==null){t=z;var o=ld;b:switch(cd){case 1:cd=0,ld=null,lf(e,t,o,1);break;case 2:case 9:if(to(o)){cd=0,ld=null,cf(t);break}t=function(){cd!==2&&cd!==9||od!==e||(cd=7),If(e)},o.then(t,t);break a;case 3:cd=7;break a;case 4:cd=5;break a;case 7:to(o)?(cd=0,ld=null,cf(t)):(cd=0,ld=null,lf(e,t,o,7));break;case 5:var s=null;switch(z.tag){case 26:s=z.memoizedState;case 5:case 27:var c=z;if(s?ih(s):c.stateNode.complete){cd=0,ld=null;var l=c.sibling;if(l!==null)z=l;else{var u=c.return;u===null?z=null:(z=u,uf(u))}break b}}cd=0,ld=null,lf(e,t,o,5);break;case 6:cd=0,ld=null,lf(e,t,o,6);break;case 8:Yd(),md=6;break a;default:throw Error(i(462))}}of();break}catch(t){Zd(e,t)}while(1);return ya=va=null,P.H=r,P.A=a,ad=n,z===null?(od=null,sd=0,Ti(),md):0}function of(){for(;z!==null&&!ze();)sf(z)}function sf(e){var t=gl(e.alternate,e,pd);e.memoizedProps=e.pendingProps,t===null?uf(e):z=t}function cf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Xc(n,t,t.pendingProps,t.type,void 0,sd);break;case 11:t=Xc(n,t,t.pendingProps,t.type.render,t.ref,sd);break;case 5:cs(t);var r=t;r===ia&&(oa?(fa(r),r.tag===5&&r.stateNode!=null&&(aa=r.stateNode)):(fa(r),oa=!0));default:Tl(n,t),t=z=Ii(t,pd),t=gl(n,t,pd)}e.memoizedProps=e.pendingProps,t===null?uf(e):z=t}function lf(e,t,n,r){ya=va=null,cs(t),so=null,co=0;var i=t.return;try{if(Fc(e,i,t,n,sd)){md=1,Ac(e,Ui(n,e.current)),z=null;return}}catch(t){if(i!==null)throw z=i,t;md=1,Ac(e,Ui(n,e.current)),z=null;return}t.flags&32768?(oa||r===1?e=!0:dd||sd&536870912?e=!1:(ud=e=!0,(r===2||r===9||r===3||r===6)&&(r=No.current,r!==null&&r.tag===13&&(r.flags|=16384))),df(t,e)):uf(t)}function uf(e){var t=e;do{if(t.flags&32768){df(t,ud);return}e=t.return;var n=Cl(t.alternate,t,pd);if(n!==null){z=n;return}if(t=t.sibling,t!==null){z=t;return}z=t=e}while(t!==null);md===0&&(md=5)}function df(e,t){do{var n=wl(e.alternate,e);if(n!==null){n.flags&=32767,z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){z=e;return}z=e=n}while(e!==null);md=6,z=null}function ff(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do bf();while(Od!==0);if(ad&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===od&&(z=od=null,sd=0),Ad=t,kd=e,jd=n,Nd=a,Pd=r,pf(e,t,n,s,c,l,f)}}function pf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Md=s,s|=wi,mt(e,n,s,r,i,a),Id=null,(n&335544064)===n?(Ld=Ra(e),r=10262):(Ld=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,kf(Ge,function(){return xf(),null})):(e.callbackNode=null,e.callbackPriority=0),Wl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,a=ad,ad|=4;try{yu(e,t,n)}finally{ad=a,F.p=i,P.T=r}}Od=1,Wl?Fd=Vp(o,e.containerInfo,Ld,gf,_f,hf,vf,xf,mf,null,null):(gf(),_f(),vf())}function mf(e){if(Od!==0){var t=kd.onRecoverableError;t(e,{componentStack:null})}}function hf(){Od===3&&(Od=0,zu(Ad,kd),Od=4)}function gf(){if(Od===1){Od=0;var e=kd,t=Ad,n=jd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=P.T,P.T=null;var i=F.p;F.p=2;var a=ad;ad|=4;try{gu=_u=!1,Fu(t,e,n),n=vp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(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 _=Kr(s,h),v=Kr(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}}Th=!!_p,vp=_p=null}finally{ad=a,F.p=i,P.T=r}}e.current=t,Od=2}}function _f(){if(Od===2){Od=0;var e=kd,t=Ad,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=ad;ad|=4;try{bu(e,t.alternate,t)}finally{ad=i,F.p=r,P.T=n}}Od=3}}function vf(){if(Od===4||Od===3){Od=0;var e=Fd;Fd=null,Be();var t=kd,n=Ad,r=jd,i=Pd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?Od=5:(Od=0,Ad=kd=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Dd=null),yt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=P.T,a=F.p,F.p=2,P.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{P.T=n,F.p=a}}if(i=Id,o=Ld,Ld=null,i!==null&&(Id=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);jd&3&&bf(),If(t),a=t.pendingLanes,r&261930&&a&42?t===zd?Rd++:(Rd=0,zd=t):(Rd=0,zd=null),Lf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Fa(t)))}function bf(){return Fd!==null&&(Fd.skipTransition(),Fd=null),gf(),_f(),vf(),xf()}function xf(){if(Od!==5)return!1;var e=kd,t=Md;Md=0;var n=yt(jd),r=P.T,a=F.p;try{F.p=32>n?32:n,P.T=null,n=Nd,Nd=null;var o=kd,s=jd;if(Od=0,Ad=kd=null,jd=0,ad&6)throw Error(i(331));var c=ad;if(ad|=4,ed(o.current),Ku(o,o.current,s,n),ad=c,Lf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{F.p=a,P.T=r,yf(e,t)}}function Sf(e,t,n){t=Ui(n,t),t=Mc(e.stateNode,t,2),e=bo(e,t,2),e!==null&&(pt(e,2),If(e))}function Cf(e,t,n){if(e.tag===3)Sf(e,e,n);else for(;t!==null;){if(t.tag===3){Sf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Dd===null||!Dd.has(r))){e=Ui(n,e),n=Nc(2),r=bo(t,n,2),r!==null&&(Pc(n,r,t,e),pt(r,2),If(r));break}}t=t.return}}function wf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new id;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)||(fd=!0,i.add(n),e=Tf.bind(null,e,t,n),t.then(e,e))}function Tf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,od===e&&(sd&n)===n&&(md===4||md===3&&(sd&62914560)===sd&&300>Ve()-Cd?ad&2?_d|=n:Xd(e,0):_d|=n,yd===sd&&(yd=0)),If(e)}function Ef(e,t){t===0&&(t=dt()),e=Oi(e,t),e!==null&&(pt(e,t),If(e))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ef(e,n)}function Of(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),Ef(e,n)}function kf(e,t){return Le(e,t)}var Af=null,jf=null,Mf=!1,Nf=!1,Pf=!1,Ff=0;function If(e){e!==jf&&e.next===null&&(jf===null?Af=jf=e:jf=jf.next=e),Nf=!0,Mf||(Mf=!0,Uf())}function Lf(e,t){if(!Pf&&Nf){Pf=!0;do for(var n=!1,r=Af;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-$e(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Hf(r,a))}else a=sd,a=st(r,r===od?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Hf(r,a))}r=r.next}while(n);Pf=!1}}function Rf(){zf()}function zf(){Nf=Mf=!1;var e=0;Ff!==0&&wp()&&(e=Ff);for(var t=Ve(),n=null,r=Af;r!==null;){var i=r.next,a=Bf(r,t);a===0?(r.next=null,n===null?Af=i:n.next=i,i===null&&(jf=n)):(n=r,(e!==0||a&3)&&(Nf=!0)),r=i}Od!==0&&Od!==5||Lf(e,!1),Ff!==0&&(Ff=0)}function Bf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-$e(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=ut(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=od,n=sd,n=st(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(cd===2||cd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Re(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Re(r),yt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=Vf.bind(null,e),n=Le(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Re(r),e.callbackPriority=2,e.callbackNode=null,2}function Vf(e,t){if(Od!==0&&Od!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(bf()&&e.callbackNode!==n)return null;var r=sd;return r=st(e,e===od?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Wd(e,r,t),Bf(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?Vf.bind(null,e):null)}function Hf(e,t){if(bf())return null;Wd(e,t,!0)}function Uf(){kp(function(){ad&6?Le(Ue,Rf):zf()})}function Wf(){if(Ff===0){var e=Va;e===0&&(e=rt,rt<<=1,!(rt&261888)&&(rt=256)),Ff=e}return Ff}function B(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Gf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=B((i[wt]||null).action),o=r.submitter;o&&(t=(t=o[wt]||null)?B(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Ff!==0){var e=new FormData(i,o);ic(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),ic(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var qf=0;qf<hi.length;qf++){var Yf=hi[qf];gi(Yf.toLowerCase(),`on`+(Yf[0].toUpperCase()+Yf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ht(`onMouseEnter`,[`mouseout`,`mouseover`]),Ht(`onMouseLeave`,[`mouseout`,`mouseover`]),Ht(`onPointerEnter`,[`pointerout`,`pointerover`]),Ht(`onPointerLeave`,[`pointerout`,`pointerover`]),Vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Xf=`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(` `),Zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Xf));function Qf(e,t){t=!!(t&4);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){xi(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){xi(e)}i.currentTarget=null,a=c}}}}function V(e,t){var n=t[Et];n===void 0&&(n=t[Et]=new Set);var r=e+`__bubble`;n.has(r)||(np(t,e,2,!1),n.add(r))}function $f(e,t,n){var r=0;t&&(r|=4),np(n,e,r,t)}var ep=`_reactListening`+Math.random().toString(36).slice(2);function tp(e){if(!e[ep]){e[ep]=!0,zt.forEach(function(t){t!==`selectionchange`&&(Zf.has(t)||$f(t,!1,e),$f(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ep]||(t[ep]=!0,$f(`selectionchange`,!1,t))}}function np(e,t,n,r){switch(Mh(t)){case 2:var i=Eh;break;case 8:i=Dh;break;default:i=Oh}n=i.bind(null,t,n,e),i=void 0,!kn||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 rp(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=Nt(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}En(function(){var r=a,i=xn(n),s=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;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=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),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=Dn(m,p),g!=null&&d.push(H(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(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Nt(u)||u[Tt]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Nt(l):null,l!==null&&(f=o(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Ft(c),h=l==null?u:Ft(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Nt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ap):null,c!==null&&op(s,u,c,d,!1),l!==null&&f!==null&&op(s,f,l,d,!0)))}a:{if(c=r?Ft(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Ft(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(s,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(s,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=ip(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Gf(s,e,r,n,i)}Qf(s,t)})}function H(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ip(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=Dn(e,n),i!=null&&r.unshift(H(e,i,a)),i=Dn(e,t),i!=null&&r.push(H(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ap(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function op(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=Dn(n,a),l!=null&&o.unshift(H(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(H(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var U=/\r\n?/g,sp=/\u0000|\uFFFD/g;function cp(e){return(typeof e==`string`?e:``+e).replace(U,`
18
- `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Xt(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=vn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;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));o?.__html!==n&&(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=vn(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`credentialless`: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`:V(`beforetoggle`,e),V(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Yt(e,n,r);else return}qt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}qt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}qt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`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:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:V(`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:up(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`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:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&I(e,!!r,n,!0):I(e,!!r,t,!1);return;case`textarea`:for(s in V(`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:up(e,t,s,c,n,null)}un(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:up(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)V(Xf[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`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:up(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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)||up(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`:m!==f&&(qt=!0),o=m;break;case`name`:m!==f&&(qt=!0),a=m;break;case`checked`:m!==f&&(qt=!0),u=m;break;case`defaultChecked`:m!==f&&(qt=!0),d=m;break;case`value`:m!==f&&(qt=!0),s=m;break;case`defaultValue`:m!==f&&(qt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}on(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)||up(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`:o!==l&&(qt=!0),p=o;break;case`defaultValue`:o!==l&&(qt=!0),c=o;break;case`multiple`:o!==l&&(qt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?I(e,!!n,n?[]:``,!1):I(e,!!n,t,!0)):I(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:up(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`:a!==o&&(qt=!0),p=a;break;case`defaultValue`:a!==o&&(qt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}ln(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:up(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`:p!==m&&(qt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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:up(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function W(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 bp(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 xp(e,t,n,r){return n=yp(n).createElement(e),n[Ct]=r,n[wt]=t,fp(n,e,t),Lt(n),n}function Sp(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 Cp=null;function wp(){var e=window.event;return e&&e.type===`popstate`?e!==Cp&&(Cp=e,!0):(Cp=null,!1)}var Tp=typeof setTimeout==`function`?setTimeout:void 0,Ep=typeof clearTimeout==`function`?clearTimeout:void 0,Dp=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Tp,kp=typeof queueMicrotask==`function`?queueMicrotask:Dp===void 0?Tp:function(e){return Dp.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(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),Zh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Em(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Em(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Em(e.ownerDocument.body)}n=i}while(n);Zh(t)}function Np(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 Pp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Fp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Ip(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(zp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=ah(f),u>ch){s.length=o;break}f=new Promise(Bp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Yp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),Sm(e,t))}Wp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0);for(var n=t=0;n<tm.length;n++){var r=tm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):tm[t++]=r}tm.length=t}};function em(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var tm=[],nm=!1;function rm(e,t,n){tm.push({fragmentInstance:e,observer:t,instance:n}),nm||(nm=!0,Cm(function(){nm=!1;var e=tm;tm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,im,e,void 0,void 0),e};function im(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Wp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Zp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||am(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function am(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(f(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function om(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Zp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),om(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),om(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function sm(e,t){return e=v(e),cm(e,t),!1}function cm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<tm.length;i++){var a=tm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(tm[r++]=a)}tm.length=r,n.observe(e)}),cm(e,t))}function um(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?rm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dm(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`:dm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function fm(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[At])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=vm(e.nextSibling),e===null)break}return null}function pm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vm(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vm(e.nextSibling),e===null))return null;return e}function hm(e){return e.data===`$?`||e.data===`$~`}function gm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _m(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 vm(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 ym=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xm(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 Sm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Cm(e){Op(function(){Op(function(t){return e(t)})})}function wm(e,t,n){switch(t=yp(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 Tm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function Em(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Dm=new Map,Om=new Set;function km(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Am=F.d;F.d={f:jm,r:Mm,D:Fm,C:Im,L:Lm,m:Rm,X:Bm,S:zm,M:Vm};function jm(){var e=Am.f(),t=Jd();return e||t}function Mm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?oc(t):Am.r(e)}var Nm=typeof document>`u`?null:document;function Pm(e,t,n){var r=Nm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Om.has(i)||(Om.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Fm(e){Am.D(e),Pm(`dns-prefetch`,e,null)}function Im(e,t){Am.C(e,t),Pm(`preconnect`,e,t)}function Lm(e,t,n){Am.L(e,t,n);var r=Nm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Um(e);break;case`script`:a=qm(e)}if(!(Dm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Dm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wm(a))||t===`script`&&r.querySelector(Jm(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Rm(e,t){Am.m(e,t);var n=Nm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qm(e)}if(!Dm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Dm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jm(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function zm(e,t,n){Am.S(e,t,n);var r=Nm;if(r&&e){var i=It(r).hoistableStyles,a=Um(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Dm.get(a))&&Zm(e,n);var c=o=r.createElement(`link`);Lt(c),fp(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,Xm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bm(e,t){Am.X(e,t);var n=Nm;if(n&&e){var r=It(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=T({src:e,async:!0},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Lt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t){Am.M(e,t);var n=Nm;if(n&&e){var r=It(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Lt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t,n,r){var a=(a=Ce.current)?km(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`?(n=Um(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Um(n.href);var o=It(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(Wm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Dm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Dm.set(e,o)),Km(a,e,o,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`?(n=qm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Um(e){return`href="`+an(e)+`"`}function Wm(e){return`link[rel="stylesheet"][`+e+`]`}function Gm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Km(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),fp(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function qm(e){return`[src="`+an(e)+`"]`}function Jm(e){return`script[async]`+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),fp(r,`style`,a),Xm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Um(n.href);var o=e.querySelector(Wm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Gm(n),(a=Dm.get(a))&&Zm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Xm(o,n.precedence,e),t.instance=o;case`script`:return o=qm(n.src),(a=e.querySelector(Jm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Dm.get(o))&&(r=T({},n),Qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),fp(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,Xm(r,n.precedence,e));return t.instance}function Xm(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 Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $m=null;function eh(e,t,n){if($m===null){var r=new Map,i=$m=new Map;i.set(n,r)}else i=$m,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[At]||a[Ct]||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 th(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function nh(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 rh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ih(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ah(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function oh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ah(t),e.suspenseyImages.push(t)),e=fh.bind(e),t.decode().then(e,e))}function sh(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=Um(r.href),a=t.querySelector(Wm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Gm(r),(i=Dm.get(i))&&Zm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=dh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ch=0;function lh(e,t){return e.stylesheets&&e.count===0&&mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ch===0&&(ch=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ch?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function uh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)mh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function dh(){this.count--,uh(this)}function fh(){this.imgCount--,uh(this)}var ph=null;function mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ph=new Map,t.forEach(hh,e),ph=null,dh.call(e))}function hh(e,t){if(!(t.state.loading&4)){var n=ph.get(e);if(n)var r=n.get(null);else{n=new Map,ph.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=dh.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 gh={$$typeof:M,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function _h(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=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function vh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _h(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function yh(e){return e?(e=ji,e):ji}function bh(e,t,n,r,i,a){i=yh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Ud(n,e,t),xo(n,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sh(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function Ch(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Ud(t,e,67108864),Sh(e,67108864)}}function wh(e){if(e.tag===13||e.tag===31){var t=Bd();t=vt(t);var n=Oi(e,t);n!==null&&Ud(n,e,t),Sh(e,t)}}var Th=!0;function Eh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,Oh(e,t,n,r)}finally{F.p=a,P.T=i}}function Dh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,Oh(e,t,n,r)}finally{F.p=a,P.T=i}}function Oh(e,t,n,r){if(Th){var i=kh(r);if(i===null)rp(e,t,r,Ah,n),Vh(e,r);else if(Uh(i,e,t,n,r))r.stopPropagation();else if(Vh(e,r),t&4&&-1<Bh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}If(a),!(ad&6)&&(Td=Ve()+500,Lf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Ud(s,a,2),Jd(),Sh(a,2)}if(a=kh(r),a===null&&rp(e,t,r,Ah,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rp(e,t,r,null,n)}}function kh(e){return e=xn(e),jh(e)}var Ah=null;function jh(e){if(Ah=null,e=Nt(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 Ah=e,null}function Mh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Nh=!1,Ph=null,Fh=null,Ih=null,Lh=new Map,Rh=new Map,zh=[],Bh=`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 Vh(e,t){switch(e){case`focusin`:case`focusout`:Ph=null;break;case`dragenter`:case`dragleave`:Fh=null;break;case`mouseover`:case`mouseout`:Ih=null;break;case`pointerover`:case`pointerout`:Lh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Rh.delete(t.pointerId)}}function Hh(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=Pt(t),t!==null&&Ch(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Uh(e,t,n,r,i){switch(t){case`focusin`:return Ph=Hh(Ph,e,t,n,r,i),!0;case`dragenter`:return Fh=Hh(Fh,e,t,n,r,i),!0;case`mouseover`:return Ih=Hh(Ih,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Lh.set(a,Hh(Lh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Rh.set(a,Hh(Rh.get(a)||null,e,t,n,r,i)),!0}return!1}function Wh(e){var t=Nt(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,xt(e.priority,function(){wh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){wh(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 Gh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&Ch(t),e.blockedOn=n,!1;t.shift()}return!0}function Kh(e,t,n){Gh(e)&&n.delete(t)}function qh(){Nh=!1,Ph!==null&&Gh(Ph)&&(Ph=null),Fh!==null&&Gh(Fh)&&(Fh=null),Ih!==null&&Gh(Ih)&&(Ih=null),Lh.forEach(Kh),Rh.forEach(Kh)}function Jh(e,n){e.blockedOn===n&&(e.blockedOn=null,Nh||(Nh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qh)))}var Yh=null;function Xh(e){Yh!==e&&(Yh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yh===e&&(Yh=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(jh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ic(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Zh(e){function t(t){return Jh(t,e)}Ph!==null&&Jh(Ph,e),Fh!==null&&Jh(Fh,e),Ih!==null&&Jh(Ih,e),Lh.forEach(t),Rh.forEach(t);for(var n=0;n<zh.length;n++){var r=zh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zh.length&&(n=zh[0],n.blockedOn===null);)Wh(n),n.blockedOn===null&&zh.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[wt]||null;if(typeof a==`function`)o||Xh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(jh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Xh(n)}}}function Qh(){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 $h(e){this._internalRoot=e}eg.prototype.render=$h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;bh(n,Bd(),e,t,null,null)},eg.prototype.unmount=$h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bh(e.current,2,null,e,null,null),Jd(),t[Tt]=null}};function eg(e){this._internalRoot=e}eg.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zh.length&&t!==0&&t<zh[n].priority;n++);zh.splice(n,0,e),n===0&&Wh(e)}};var tg=n.version;if(tg!==`19.3.0`)throw Error(i(527,tg,`19.3.0`));F.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:d(e),e=e===null?null:e.stateNode,e};var ng={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var rg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rg.isDisabled&&rg.supportsFiber)try{Xe=rg.inject(ng),Ze=rg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Dc,s=Oc,c=kc;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=vh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[Tt]=t.current,tp(e),new $h(t)}})),Xf=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=Yf()}))(),Zf={info:3600,success:3e3,warning:5e3,error:6e3},Qf,V=[],$f=0,ep=new Set;function tp(){for(let e of[...ep])e()}function np(e,t,n){let r=t.trim();if(!r)return;let i=Qf?.message===r?Qf:V.find(e=>e.message===r);if(i){if(n?.action&&!i.action){let e={...i,action:n.action};i===Qf?Qf=e:V=V.map(t=>t===i?e:t),tp()}return}let a={id:++$f,kind:e,message:r,duration:n?.duration??Zf[e],...n?.action?{action:n.action}:{}};Qf?V=[...V,a].slice(-3):Qf=a,tp()}function rp(e){Qf?.id===e&&(Qf=V[0],V=V.slice(1),tp())}var H=Object.assign((e,t)=>np(`info`,e,t),{success:(e,t)=>np(`success`,e,t),error:(e,t)=>np(`error`,e,t),warning:(e,t)=>np(`warning`,e,t),info:(e,t)=>np(`info`,e,t)});function ip(e){return ep.add(e),()=>{ep.delete(e)}}function ap(){return{item:(0,m.useSyncExternalStore)(ip,()=>Qf,()=>void 0),waiting:(0,m.useSyncExternalStore)(ip,()=>V.length,()=>0)}}function op(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function U(e,t,n={}){try{let r=await Te(e,t),i=r.notice;return i&&H(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){H.error(op(e));return}}var sp=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function cp(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:sp(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var lp=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},up=e=>{let t=lp(e);return t.charAt(0).toUpperCase()+t.slice(1)},dp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),fp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function pp(e){return e!=null}function mp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??fp.width,a=e.size??e.height??fp.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?dp(...c):dp(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??fp[`stroke-width`])*Number(e.size??e.width??fp.width)/Number(t.size??t.width??fp.width):t.strokeWidth??fp[`stroke-width`];return[`svg`,{...Object.entries(fp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&pp(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&pp(t.width)&&{[r(`width`)]:t.width},...`height`in t&&pp(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function hp(e,t={}){return mp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var gp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_p=(0,m.createContext)({}),vp=()=>(0,m.useContext)(_p),yp=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=vp()??{},b=!!c||gp(d),[x,S,C=[]]=hp(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:dp(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function W(e,t=[],n=[]){let r=typeof e==`string`?cp(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(yp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=up(r.name)),i}var bp={name:`activity`,size:24,node:[[`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`}]]};bp.node;var xp=W(bp),Sp={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};Sp.node;var Cp=W(Sp),wp={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};wp.node;var Tp=W(wp),Ep={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};Ep.node;var Dp=W(Ep),Op={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Op.node;var kp=W(Op),Ap={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};Ap.node;var jp=W(Ap),Mp={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Mp.node;var Np=W(Mp),Pp={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Pp.node;var Fp=W(Pp),Ip={name:`bot`,size:24,node:[[`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`}]]};Ip.node;var Lp=W(Ip),Rp={name:`brain`,size:24,node:[[`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`}]]};Rp.node;var zp=W(Rp),Bp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Bp.node;var Vp=W(Bp),Hp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Hp.node;var Up=W(Hp),Wp={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Wp.node;var Gp=W(Wp),Kp={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Kp.node;var qp=W(Kp),Jp={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Jp.node;var Yp=W(Jp),Xp={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Xp.node;var Zp=W(Xp),Qp={name:`chevrons-up`,size:24,node:[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]};Qp.node;var $p=W(Qp),em={name:`circle-alert`,size:24,node:[[`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`}]],aliases:[`alert-circle`]};em.node;var tm=W(em),nm={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};nm.node;var rm=W(nm),im={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};im.node;var am=W(im),om={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};om.node;var sm=W(om),cm={name:`circle-question-mark`,size:24,node:[[`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`}]],aliases:[`help-circle`,`circle-help`]};cm.node;var lm=W(cm),um={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};um.node;var dm=W(um),fm={name:`circle-x`,size:24,node:[[`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`}]],aliases:[`x-circle`]};fm.node;var pm=W(fm),mm={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};mm.node;var hm=W(mm),gm={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};gm.node;var _m=W(gm),vm={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};vm.node;var ym=W(vm),bm={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};bm.node;var xm=W(bm),Sm={name:`copy`,size:24,node:[[`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`}]]};Sm.node;var Cm=W(Sm),wm={name:`download`,size:24,node:[[`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`}]]};wm.node;var Tm=W(wm),Em={name:`external-link`,size:24,node:[[`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`}]]};Em.node;var Dm=W(Em),Om={name:`eye`,size:24,node:[[`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`}]]};Om.node;var km=W(Om),Am={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Am.node;var jm=W(Am),Mm={name:`file-plus`,size:24,node:[[`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:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Mm.node;var Nm=W(Mm),Pm={name:`file-text`,size:24,node:[[`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`}]]};Pm.node;var Fm=W(Pm),Im={name:`folder-open`,size:24,node:[[`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`}]]};Im.node;var Lm=W(Im),Rm={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Rm.node;var zm=W(Rm),Bm={name:`git-branch`,size:24,node:[[`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`}]]};Bm.node;var Vm=W(Bm),Hm={name:`git-pull-request`,size:24,node:[[`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`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Hm.node;var Um=W(Hm),Wm={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Wm.node;var Gm=W(Wm),Km={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Km.node;var qm=W(Km),Jm={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Jm.node;var Ym=W(Jm),Xm={name:`layers`,size:24,node:[[`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`}]],aliases:[`layers-3`]};Xm.node;var Zm=W(Xm),Qm={name:`list-checks`,size:24,node:[[`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`}]]};Qm.node;var $m=W(Qm),eh={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};eh.node;var th=W(eh),nh={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};nh.node;var rh=W(nh),ih={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};ih.node;var ah=W(ih),oh={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};oh.node;var sh=W(oh),ch={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`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`}]],aliases:[`message-circle-question`]};ch.node;var lh=W(ch),uh={name:`message-square-plus`,size:24,node:[[`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`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};uh.node;var dh=W(uh),fh={name:`message-square`,size:24,node:[[`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`}]]};fh.node;var ph=W(fh),mh={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};mh.node;var hh=W(mh),gh={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};gh.node;var _h=W(gh),vh={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};vh.node;var yh=W(vh),bh={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};bh.node;var xh=W(bh),Sh={name:`monitor`,size:24,node:[[`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`}]]};Sh.node;var Ch=W(Sh),wh={name:`moon`,size:24,node:[[`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`}]]};wh.node;var Th=W(wh),Eh={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};Eh.node;var Dh=W(Eh),Oh={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Oh.node;var kh=W(Oh),Ah={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Ah.node;var jh=W(Ah),Mh={name:`pause`,size:24,node:[[`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`}]]};Mh.node;var Nh=W(Mh),Ph={name:`pen-tool`,size:24,node:[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};Ph.node;var Fh=W(Ph),Ih={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Ih.node;var Lh=W(Ih),Rh={name:`pencil-off`,size:24,node:[[`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`,key:`bjo8r8`}],[`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`,key:`16h5ne`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Rh.node;var zh=W(Rh),Bh={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Bh.node;var Vh=W(Bh),Hh={name:`play`,size:24,node:[[`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`}]]};Hh.node;var Uh=W(Hh),Wh={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Wh.node;var Gh=W(Wh),Kh={name:`refresh-cw`,size:24,node:[[`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`}]]};Kh.node;var qh=W(Kh),Jh={name:`rotate-ccw-clock`,size:24,node:[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Jh.node;var Yh=W(Jh),Xh={name:`rotate-ccw`,size:24,node:[[`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`}]]};Xh.node;var Zh=W(Xh),Qh={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Qh.node;var $h=W(Qh),eg={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};eg.node;var tg=W(eg),ng={name:`save`,size:24,node:[[`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`}]]};ng.node;var rg=W(ng),ig={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ig.node;var ag=W(ig),og={name:`settings`,size:24,node:[[`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`}]]};og.node;var sg=W(og),cg={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};cg.node;var lg=W(cg),ug={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};ug.node;var dg=W(ug),fg={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};fg.node;var pg=W(fg),mg={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};mg.node;var hg=W(mg),gg={name:`sun`,size:24,node:[[`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`}]]};gg.node;var _g=W(gg),vg={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};vg.node;var yg=W(vg),bg={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};bg.node;var xg=W(bg),Sg={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};Sg.node;var Cg=W(Sg),wg={name:`triangle-alert`,size:24,node:[[`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`}]],aliases:[`alert-triangle`]};wg.node;var Tg=W(wg),Eg={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Eg.node;var Dg=W(Eg),Og={name:`upload`,size:24,node:[[`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`}]]};Og.node;var kg=W(Og),Ag={name:`users`,size:24,node:[[`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`}]]};Ag.node;var jg=W(Ag),Mg={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};Mg.node;var Ng=W(Mg),Pg={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};Pg.node;var Fg=W(Pg),Ig={name:`wifi-off`,size:24,node:[[`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`}]]};Ig.node;var Lg=W(Ig),Rg={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Rg.node;var zg=W(Rg),Bg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Bg.node;var Vg=W(Bg),Hg={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Hg.node;var Ug=W(Hg);function Wg(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=Wg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Gg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wg(e))&&(r&&(r+=` `),r+=t);return r}var Kg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qg=Gg,Jg=(e,t)=>n=>{if(t?.variants==null)return qg(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=Kg(t)||Kg(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 qg(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)},Yg=(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},Xg=(e,t)=>({classGroupId:e,validator:t}),Zg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Qg=`-`,$g=[],e_=`arbitrary..`,t_=e=>{let t=i_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return r_(e);let n=e.split(Qg);return n_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Yg(i,t):t:i||$g}return n[e]||$g}}},n_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=n_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Qg):e.slice(t).join(Qg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},r_=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?e_+r:void 0})(),i_=e=>{let{theme:t,classGroups:n}=e;return a_(n,t)},a_=(e,t)=>{let n=Zg();for(let r in e){let i=e[r];o_(i,n,r,t)}return n},o_=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];s_(i,t,n,r)}},s_=(e,t,n,r)=>{if(typeof e==`string`){c_(e,t,n);return}if(typeof e==`function`){l_(e,t,n,r);return}u_(e,t,n,r)},c_=(e,t,n)=>{let r=e===``?t:d_(t,e);r.classGroupId=n},l_=(e,t,n,r)=>{if(f_(e)){o_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xg(n,e))},u_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];o_(o,d_(t,a),n,r)}},d_=(e,t)=>{let n=e,r=t.split(Qg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Zg(),n.nextPart.set(t,i)),n=i}return n},f_=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,p_=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)}}},m_=`!`,h_=`:`,g_=[],__=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),v_=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===h_){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(m_)?(c=s.slice(0,-1),l=!0):s.startsWith(m_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return __(t,l,c,u)};if(t){let e=t+h_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):__(g_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},y_=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}},b_=e=>({cache:p_(e.cacheSize),parseClassName:v_(e),sortModifiers:y_(e),postfixLookupClassGroupIds:x_(e),...t_(e)}),x_=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},S_=/\s+/,C_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(S_),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?_+m_:_,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},w_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=T_(n))&&(i&&(i+=` `),i+=r);return i},T_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=T_(e[r]))&&(n&&(n+=` `),n+=t);return n},E_=(e,...t)=>{let n,r,i,a,o=o=>(n=b_(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=C_(e,n);return i(e,a),a};return a=o,(...e)=>a(w_(...e))},D_=[],O_=e=>{let t=t=>t[e]||D_;return t.isThemeGetter=!0,t.themeKey=e,t},k_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,M_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N_=/\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$/,P_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,F_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L_=e=>j_.test(e),R_=e=>!!e&&!Number.isNaN(Number(e)),z_=e=>!!e&&Number.isInteger(Number(e)),B_=e=>e.endsWith(`%`)&&R_(e.slice(0,-1)),V_=e=>M_.test(e),H_=()=>!0,U_=e=>N_.test(e)&&!P_.test(e),W_=()=>!1,G_=e=>F_.test(e),K_=e=>I_.test(e),q_=e=>!G(e)&&!K(e),J_=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)),Y_=e=>uv(e,mv,W_),G=e=>k_.test(e),X_=e=>uv(e,hv,U_),Z_=e=>uv(e,gv,R_),Q_=e=>uv(e,vv,H_),$_=e=>uv(e,_v,W_),ev=e=>uv(e,fv,W_),tv=e=>uv(e,pv,K_),nv=e=>uv(e,yv,G_),K=e=>A_.test(e),rv=e=>dv(e,hv),iv=e=>dv(e,_v),av=e=>dv(e,fv),ov=e=>dv(e,mv),sv=e=>dv(e,pv),cv=e=>dv(e,yv,!0),lv=e=>dv(e,vv,!0),uv=(e,t,n)=>{let r=k_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dv=(e,t,n=!1)=>{let r=A_.exec(e);return r?r[1]?t(r[1]):n:!1},fv=e=>e===`position`||e===`percentage`,pv=e=>e===`image`||e===`url`,mv=e=>e===`length`||e===`size`||e===`bg-size`,hv=e=>e===`length`,gv=e=>e===`number`,_v=e=>e===`family-name`,vv=e=>e===`number`||e===`weight`,yv=e=>e===`shadow`,bv=E_(()=>{let e=O_(`color`),t=O_(`font`),n=O_(`text`),r=O_(`font-weight`),i=O_(`tracking`),a=O_(`leading`),o=O_(`breakpoint`),s=O_(`container`),c=O_(`spacing`),l=O_(`radius`),u=O_(`shadow`),d=O_(`inset-shadow`),f=O_(`text-shadow`),p=O_(`drop-shadow`),m=O_(`blur`),h=O_(`perspective`),g=O_(`aspect`),_=O_(`ease`),v=O_(`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(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[L_,`full`,`auto`,...w()],E=()=>[z_,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,z_,K,G]},z_,K,G],O=()=>[z_,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[L_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,L_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[L_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,K,G],re=()=>[...b(),av,ev,{position:[K,G]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,ov,Y_,{size:[K,G]}],oe=()=>[B_,rv,X_],se=()=>[``,`none`,`full`,l,K,G],ce=()=>[``,R_,rv,X_],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[R_,B_,av,ev],fe=()=>[``,`none`,m,K,G],pe=()=>[`none`,R_,K,G],me=()=>[`none`,R_,K,G],P=()=>[R_,K,G],F=()=>[L_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[V_],breakpoint:[V_],color:[H_],container:[V_],"drop-shadow":[V_],ease:[`in`,`out`,`in-out`],font:[q_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[V_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[V_],shadow:[V_],spacing:[`px`,R_],text:[V_],"text-shadow":[V_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,L_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[J_],columns:[{columns:[R_,`auto`,G,K,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:[z_,`auto`,K,G]}],basis:[{basis:[L_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[R_,L_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,R_,K,G]}],shrink:[{shrink:[``,R_,K,G]}],order:[{order:[z_,`first`,`last`,`none`,K,G]}],"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":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],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:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,rv,X_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,lv,Q_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,B_,G]}],"font-family":[{font:[iv,$_,t]}],"font-features":[{"font-features":[G]}],"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,K,G]}],"line-clamp":[{"line-clamp":[R_,`none`,K,Z_]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[R_,`from-font`,`auto`,K,X_]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[R_,`auto`,K,G]}],"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:[z_,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],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`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},z_,K,G],radial:[``,K,G],conic:[``,z_,K,G]},sv,tv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[R_,K,G]}],"outline-w":[{outline:[``,R_,rv,X_]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,cv,nv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,cv,nv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[R_,X_]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,cv,nv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[R_,K,G]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"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":[R_]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[R_]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:fe()}],brightness:[{brightness:[R_,K,G]}],contrast:[{contrast:[R_,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cv,nv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,R_,K,G]}],"hue-rotate":[{"hue-rotate":[R_,K,G]}],invert:[{invert:[``,R_,K,G]}],saturate:[{saturate:[R_,K,G]}],sepia:[{sepia:[``,R_,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[R_,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[R_,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,R_,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R_,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,R_,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[R_,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[R_,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,R_,K,G]}],"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`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[R_,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[R_,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:P()}],"skew-x":[{"skew-x":P()}],"skew-y":[{"skew-y":P()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":[`translate-none`],zoom:[{zoom:[z_,K,G]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"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`,K,G]}],"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":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"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`,K,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[R_,rv,X_,Z_]}],stroke:[{stroke:[`none`,...N()]}],"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":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`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-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`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-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`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-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`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-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`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 q(...e){return bv(Gg(e))}var xv=Object.defineProperty,Sv=(e,t)=>xv(e,`name`,{value:t,configurable:!0});function Cv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Sv(Cv,`setRef`);function wv(...e){return t=>{let n=!1,r=e.map(e=>{let r=Cv(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():Cv(e[t],null)}}}}Sv(wv,`composeRefs`);function Tv(...e){return m.useCallback(wv(...e),e)}Sv(Tv,`useComposedRefs`);var Ev=Object.defineProperty,Dv=(e,t)=>Ev(e,`name`,{value:t,configurable:!0});function Ov(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Lv(r)&&typeof Vv==`function`&&(r=Vv(r._payload)),m.Children.forEach(r,e=>{if(Fv(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Lv(n)&&typeof Vv==`function`&&(n=Vv(n._payload)),a=Mv(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?Pv(a):void 0,l=Tv(n,c);if(!a){if(r||r===0)throw Error(o?Bv(e):zv(e));return r}let u=Nv(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Dv(Ov,`createSlot`);var kv=Ov(`Slot`),Av=Symbol.for(`radix.slottable`);function jv(e){let t=Dv(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Av,t}Dv(jv,`createSlottable`);var Mv=Dv((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Nv(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}}Dv(Nv,`mergeProps`);function Pv(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)}Dv(Pv,`getElementRef`);function Fv(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Av}Dv(Fv,`isSlottable`);var Iv=Symbol.for(`react.lazy`);function Lv(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Iv&&`_payload`in e&&Rv(e._payload)}Dv(Lv,`isLazyComponent`);function Rv(e){return typeof e==`object`&&!!e&&`then`in e}Dv(Rv,`isPromiseLike`);var zv=Dv(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bv=Dv(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vv=m.use,Hv=l(Jf(),1),Uv=Object.defineProperty,Wv=(e,t)=>Uv(e,`name`,{value:t,configurable:!0}),Gv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ov(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&Hv.flushSync(()=>e.dispatchEvent(t))}Wv(Kv,`dispatchDiscreteCustomEvent`);var qv=Object.defineProperty,Jv=(e,t)=>qv(e,`name`,{value:t,configurable:!0}),Yv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Xv=m.forwardRef(Jv(function(e,t){return(0,R.jsx)(Gv.span,{...e,ref:t,style:{...Yv,...e.style}})},`VisuallyHidden`)),Zv=Object.defineProperty,Qv=(e,t)=>Zv(e,`name`,{value:t,configurable:!0});function $v(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Qv(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Qv(i,`useContext`),[r,i]}Qv($v,`createContext`);function ey(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Qv(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Qv(s,`useContext`),[o,s]}Qv(r,`createContext`);let i=Qv(()=>{let t=n.map(e=>m.createContext(e));return Qv(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ty(i,...t)]}Qv(ey,`createContextScope`);function ty(...e){let t=e[0];if(e.length===1)return t;let n=Qv(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Qv(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Qv(ty,`composeContextScopes`);var ny=Object.defineProperty,ry=(e,t)=>ny(e,`name`,{value:t,configurable:!0});function iy(e){let t=e+`CollectionProvider`,[n,r]=ey(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ry(e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Ov(s),l=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Tv(t,a(s,n).collectionRef);return(0,R.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ov(u),p=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),s=Tv(t,o),c=a(u,n);return m.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ry(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},h,r]}ry(iy,`createCollection`);var ay=new WeakMap,oy=class e extends Map{static{ry(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ay.set(this,!0)}set(e,t){return ay.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=ly(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=sy(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=sy(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return sy(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function sy(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=cy(e,t);return n===-1?void 0:e[n]}ry(sy,`at`);function cy(e,t){let n=e.length,r=ly(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ry(cy,`toSafeIndex`);function ly(e){return e!==e||e===0?0:Math.trunc(e)}ry(ly,`toSafeInteger`);function uy(e){let t=e+`CollectionProvider`,[n,r]=ey(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new oy,setItemMap:ry(()=>void 0,`setItemMap`)}),o=ry(({state:e,...t})=>e?(0,R.jsx)(c,{...t,state:e}):(0,R.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ry(e=>{let t=g();return(0,R.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ry(e=>{let{scope:t,children:n,state:r}=e,a=m.useRef(null),[o,s]=m.useState(null),c=Tv(a,s),[l,u]=r;return m.useEffect(()=>{if(!o)return;let e=my(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,R.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Ov(l),d=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Tv(t,a(l,n).collectionRef);return(0,R.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Ov(f),h=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),[s,c]=m.useState(null),l=Tv(t,o,c),{setItemMap:u}=a(f,n),d=m.useRef(i);dy(d.current,i)||(d.current=i);let h=d.current;return m.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(py):(t.set(s,{...e,element:s}),t.toSorted(py)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new oy(e)))}},[s,h,u]),(0,R.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=f;function g(){return m.useState(new oy)}ry(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ry(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}ry(uy,`createCollection`);function dy(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ry(dy,`shallowEqual`);function fy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ry(fy,`isElementPreceding`);function py(e,t){return!e[1].element||!t[1].element?0:fy(e[1].element,t[1].element)?-1:1}ry(py,`sortByDocumentPosition`);function my(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ry(my,`getChildListObserver`);var hy=Object.defineProperty,gy=(e,t)=>hy(e,`name`,{value:t,configurable:!0}),_y=!!(typeof window<`u`&&window.document&&window.document.createElement);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return gy(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}gy(J,`composeEventHandlers`);function vy(e){if(!_y)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}gy(vy,`getOwnerWindow`);function yy(e){if(!_y)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}gy(yy,`getOwnerDocument`);function by(e,t=!1){let{activeElement:n}=yy(e);if(!n?.nodeName)return null;if(xy(n)&&n.contentDocument)return by(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=yy(n).getElementById(e);if(t)return t}}return n}gy(by,`getActiveElement`);function xy(e){return e.tagName===`IFRAME`}gy(xy,`isFrame`);var Sy=globalThis?.document?m.useLayoutEffect:()=>{},Cy=Object.defineProperty,wy=(e,t)=>Cy(e,`name`,{value:t,configurable:!0}),Ty=m.useEffectEvent,Ey=m.useInsertionEffect;function Dy(e){if(typeof Ty==`function`)return Ty(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ey==`function`?Ey(()=>{t.current=e}):Sy(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}wy(Dy,`useEffectEvent`);var Oy=Object.defineProperty,ky=(e,t)=>Oy(e,`name`,{value:t,configurable:!0}),Ay=m.useInsertionEffect||Sy;function jy({prop:e,defaultProp:t,onChange:n=ky(()=>{},`onChange`),caller:r}){let[i,a,o]=My({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Ny(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ky(jy,`useControllableState`);function My({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Ay(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ky(My,`useUncontrolledState`);function Ny(e){return typeof e==`function`}ky(Ny,`isFunction`);var Py=Symbol(`RADIX:SYNC_STATE`);function Fy(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Dy(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Py)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Py,state:i})},[i,d.state,c]),[g,f]}ky(Fy,`useControllableStateReducer`);var Iy=Object.defineProperty,Ly=(e,t)=>Iy(e,`name`,{value:t,configurable:!0});function Ry(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}Ly(Ry,`useStateMachine`);var zy=Ly(e=>{let{present:t,children:n}=e,r=By(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=Hy(r.ref,Wy(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function By(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=Ry(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??Uy(r.current),o.current=void 0):a.current=`none`},[s]),Sy(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Uy(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Sy(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ly(a=>{let o=Uy(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ly(e=>{e.target===t&&(a.current=Uy(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Uy(t)}else r.current=null;n(e)},[])}}Ly(By,`usePresence`);function Vy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ly(Vy,`setRef`);function Hy(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vy(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vy(n[e],null)}}},[])}Ly(Hy,`useStableComposedRefs`);function Uy(e){return e?.animationName||`none`}Ly(Uy,`getAnimationName`);function Wy(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)}Ly(Wy,`getElementRef`);var Gy=Object.defineProperty,Ky=(e,t)=>Gy(e,`name`,{value:t,configurable:!0}),qy=m.useId||(()=>void 0),Jy=0;function Yy(e){let[t,n]=m.useState(qy());return Sy(()=>{e||n(e=>e??String(Jy++))},[e]),e||(t?`radix-${t}`:``)}Ky(Yy,`useId`);var Xy=Object.defineProperty,Zy=(e,t)=>Xy(e,`name`,{value:t,configurable:!0}),Qy=m.createContext(void 0);function $y(e){let t=m.useContext(Qy);return e||t||`ltr`}Zy($y,`useDirection`);var eb=Object.defineProperty,tb=(e,t)=>eb(e,`name`,{value:t,configurable:!0});function nb(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}tb(nb,`useCallbackRef`);var rb=Object.defineProperty,ib=(e,t)=>rb(e,`name`,{value:t,configurable:!0}),ab=`dismissableLayer.update`,ob=`dismissableLayer.pointerDownOutside`,sb=`dismissableLayer.focusOutside`,cb,lb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ub=m.forwardRef(ib(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(lb),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=Tv(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=pb(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=mb(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=nb(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cb=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hb(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=cb))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hb())},[d,u]),m.useEffect(()=>{let e=ib(()=>h({}),`handleUpdate`);return document.addEventListener(ab,e),()=>document.removeEventListener(ab,e)},[]),(0,R.jsx)(Gv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function db(){let e=m.useContext(lb),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ib(db,`useDismissableLayerSurface`);var fb=ib(()=>!0,`IS_TRUE`);function pb(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=fb}=t,s=nb(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}ib(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}ib(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}ib(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}ib(p,`handleInteractionBubble`);let m=ib(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||gb(ob,s,p,{discrete:!0})};if(ib(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:ib(()=>c.current=!0,`onPointerDownCapture`)}}ib(pb,`usePointerDownOutside`);function mb(e,t=globalThis?.document){let n=nb(e),r=m.useRef(!1);return m.useEffect(()=>{let e=ib(e=>{e.target&&!r.current&&gb(sb,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:ib(()=>r.current=!0,`onFocusCapture`),onBlurCapture:ib(()=>r.current=!1,`onBlurCapture`)}}ib(mb,`useFocusOutside`);function hb(){let e=new CustomEvent(ab);document.dispatchEvent(e)}ib(hb,`dispatchUpdate`);function gb(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?Kv(i,a):i.dispatchEvent(a)}ib(gb,`handleAndDispatchCustomEvent`);var _b=Object.defineProperty,vb=(e,t)=>_b(e,`name`,{value:t,configurable:!0}),yb=`focusScope.autoFocusOnMount`,bb=`focusScope.autoFocusOnUnmount`,xb={bubbles:!1,cancelable:!0},Sb=m.forwardRef(vb(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=nb(i),u=nb(a),d=m.useRef(null),f=Tv(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:kb(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||kb(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&kb(s)};vb(e,`handleFocusIn`),vb(t,`handleFocusOut`),vb(n,`handleMutations`),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]),m.useEffect(()=>{if(s){Ab.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(yb,xb);s.addEventListener(yb,l),s.dispatchEvent(t),t.defaultPrevented||(Cb(Nb(Tb(s)),{select:!0}),document.activeElement===e&&kb(s))}return()=>{s.removeEventListener(yb,l),setTimeout(()=>{let t=new CustomEvent(bb,xb);s.addEventListener(bb,u),s.dispatchEvent(t),t.defaultPrevented||kb(e??document.body,{select:!0}),s.removeEventListener(bb,u),Ab.remove(p)},0)}}},[s,l,u,p]);let h=m.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]=wb(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&kb(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&kb(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Gv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Cb(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(kb(r,{select:t}),document.activeElement!==n)return}vb(Cb,`focusFirst`);function wb(e){let t=Tb(e);return[Eb(t,e),Eb(t.reverse(),e)]}vb(wb,`getTabbableEdges`);function Tb(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vb(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}vb(Tb,`getTabbableCandidates`);function Eb(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Db(r,{upTo:t})))return r}vb(Eb,`findVisible`);function Db(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}vb(Db,`isHidden`);function Ob(e){return e instanceof HTMLInputElement&&`select`in e}vb(Ob,`isSelectableInput`);function kb(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ob(e)&&t&&e.select()}}vb(kb,`focus`);var Ab=jb();function jb(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Mb(e,t),e.unshift(t)},remove(t){e=Mb(e,t),e[0]?.resume()}}}vb(jb,`createFocusScopesStack`);function Mb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}vb(Mb,`arrayRemove`);function Nb(e){return e.filter(e=>e.tagName!==`A`)}vb(Nb,`removeLinks`);var Pb=Object.defineProperty,Fb=m.forwardRef(((e,t)=>Pb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Sy(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Hv.createPortal((0,R.jsx)(Gv.div,{...r,ref:t}),o):null},`Portal`)),Ib=Object.defineProperty,Lb=(e,t)=>Ib(e,`name`,{value:t,configurable:!0}),Rb=0,zb=null;function Bb(e){return Vb(),e.children}Lb(Bb,`FocusGuards`);function Vb(){m.useEffect(()=>{zb||={start:Hb(),end:Hb()};let{start:e,end:t}=zb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Rb++,()=>{Rb===1&&(zb?.start.remove(),zb?.end.remove(),zb=null),Rb=Math.max(0,Rb-1)}},[])}Lb(Vb,`useFocusGuards`);function Hb(){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}Lb(Hb,`createFocusGuard`);var Ub=function(){return Ub=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},Ub.apply(this,arguments)};function Wb(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 Gb(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 Kb=`right-scroll-bar-position`,qb=`width-before-scroll-bar`,Jb=`with-scroll-bars-hidden`,Yb=`--removed-body-scroll-bar-size`;function Xb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zb(e,t){var n=(0,m.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 Qb=typeof window<`u`?m.useLayoutEffect:m.useEffect,$b=new WeakMap;function ex(e,t){var n=Zb(t||null,function(t){return e.forEach(function(e){return Xb(e,t)})});return Qb(function(){var t=$b.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xb(e,null)}),i.forEach(function(e){r.has(e)||Xb(e,a)})}$b.set(n,e)},[e]),n}function tx(e){return e}function nx(e,t){t===void 0&&(t=tx);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 rx(e){e===void 0&&(e={});var t=nx(null);return t.options=Ub({async:!0,ssr:!1},e),t}var ix=function(e){var t=e.sideCar,n=Wb(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 m.createElement(r,Ub({},n))};ix.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),ix}var ox=rx(),sx=function(){},cx=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:sx,onWheelCapture:sx,onTouchMoveCapture:sx}),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,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wb(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=ex([n,t]),w=Ub(Ub({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:ox,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),Ub(Ub({},w),{ref:C})):m.createElement(y,Ub({},w,{className:c,ref:C}),s))});cx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cx.classNames={fullWidth:qb,zeroRight:Kb};var lx=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ux(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lx();return t&&e.setAttribute(`nonce`,t),e}function dx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var px=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ux())&&(dx(t,n),fx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mx=function(){var e=px();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hx=function(){var e=mx();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gx={left:0,top:0,right:0,gap:0},_x=function(e){return parseInt(e||``,10)||0},vx=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[_x(n),_x(r),_x(i)]},yx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gx;var t=vx(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])}},bx=hx(),xx=`data-scroll-locked`,Sx=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
18
+ `).replace(sp,``)}function lp(e,t){return t=cp(t),cp(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Xt(e,`class`,r);break;case`tabIndex`:Xt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Xt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Xt(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=vn(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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&up(e,t,`name`,a.name,a,null),up(e,t,`formEncType`,a.formEncType,a,null),up(e,t,`formMethod`,a.formMethod,a,null),up(e,t,`formTarget`,a.formTarget,a,null)):(up(e,t,`encType`,a.encType,a,null),up(e,t,`method`,a.method,a,null),up(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;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));o?.__html!==n&&(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=vn(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`credentialless`: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`:V(`beforetoggle`,e),V(`toggle`,e),Yt(e,`popover`,r);break;case`xlinkActuate`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Zt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Zt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Yt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Yt(e,n,r);else return}qt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:mn(e,r,o);return;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));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&V(`scroll`,e);return;case`onScrollEnd`:r!=null&&V(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Bt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),o=n.slice(2,a?n.length-7:void 0),t=e[wt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,a),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,a);break a}qt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Yt(e,n,r)}return}qt=!0}function fp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:V(`error`,e),V(`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:up(e,t,o,s,n,null)}}a&&up(e,t,`srcSet`,n.srcSet,n,null),r&&up(e,t,`src`,n.src,n,null);return;case`input`:V(`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:up(e,t,r,d,n,null)}}sn(e,o,c,l,u,s,a,!1);return;case`select`:for(a in V(`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:up(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&I(e,!!r,n,!0):I(e,!!r,t,!1);return;case`textarea`:for(s in V(`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:up(e,t,s,c,n,null)}un(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:up(e,t,l,r,n,null)}return;case`dialog`:V(`beforetoggle`,e),V(`toggle`,e),V(`cancel`,e),V(`close`,e);break;case`iframe`:case`object`:V(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)V(Xf[r],e);break;case`image`:V(`error`,e),V(`load`,e);break;case`details`:V(`toggle`,e);break;case`embed`:case`source`:case`link`:V(`error`,e),V(`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:up(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&dp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&up(e,t,c,r,n,null))}var pp={};function mp(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)||up(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`:m!==f&&(qt=!0),o=m;break;case`name`:m!==f&&(qt=!0),a=m;break;case`checked`:m!==f&&(qt=!0),u=m;break;case`defaultChecked`:m!==f&&(qt=!0),d=m;break;case`value`:m!==f&&(qt=!0),s=m;break;case`defaultValue`:m!==f&&(qt=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&up(e,t,p,m,r,f)}}on(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)||up(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`:o!==l&&(qt=!0),p=o;break;case`defaultValue`:o!==l&&(qt=!0),c=o;break;case`multiple`:o!==l&&(qt=!0),s=o;default:o!==l&&up(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?I(e,!!n,n?[]:``,!1):I(e,!!n,t,!0)):I(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:up(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`:a!==o&&(qt=!0),p=a;break;case`defaultValue`:a!==o&&(qt=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&up(e,t,s,a,r,o)}ln(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:up(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`:p!==m&&(qt=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:up(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)&&up(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:up(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&dp(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||dp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&up(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||up(e,t,f,p,r,m)}function hp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function gp(){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&&hp(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&&hp(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 _p=null,vp=null;function yp(e){return e.nodeType===9?e:e.ownerDocument}function W(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 bp(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 xp(e,t,n,r){return n=yp(n).createElement(e),n[Ct]=r,n[wt]=t,fp(n,e,t),Lt(n),n}function Sp(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 Cp=null;function wp(){var e=window.event;return e&&e.type===`popstate`?e!==Cp&&(Cp=e,!0):(Cp=null,!1)}var Tp=typeof setTimeout==`function`?setTimeout:void 0,Ep=typeof clearTimeout==`function`?clearTimeout:void 0,Dp=typeof Promise==`function`?Promise:void 0,Op=typeof requestAnimationFrame==`function`?requestAnimationFrame:Tp,kp=typeof queueMicrotask==`function`?queueMicrotask:Dp===void 0?Tp:function(e){return Dp.resolve(null).then(e).catch(Ap)};function Ap(e){setTimeout(function(){throw e})}function jp(e){return e===`head`}function Mp(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),Zh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Em(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Em(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[At]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Em(e.ownerDocument.body)}n=i}while(n);Zh(t)}function Np(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 Pp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Fp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Ip(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Lp(e){return Ip(e.getBoundingClientRect(),getComputedStyle(e),e)}function Rp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Ip(t,n,e)}function zp(e){return e.documentElement.clientHeight}function Bp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Vp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(zp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=ah(f),u>ch){s.length=o;break}f=new Promise(Bp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function Hp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Hp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Hp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},Hp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Up(e){return{name:e,group:new Hp(`group`,e),imagePair:new Hp(`image-pair`,e),old:new Hp(`old`,e),new:new Hp(`new`,e)}}function Wp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Wp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Yp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=qp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Gp,e,s,r)}this._eventListeners=a}};function Gp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Wp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Yp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=qp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,Kp,e,n,i),r.splice(t,1),a!==null&&a()}};function Kp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function qp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Jp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Yp(e,t,n,r){if(e.length===0)return-1;r=Jp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Jp(a.optionsOrUseCapture)===r)return i}return-1}Wp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,qp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Wp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),Sm(e,t))}Wp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Zp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Xp(t[n],e);n--);};function Zp(e,t){return t.push(e),!1}Wp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,Qp,e,void 0,void 0))};function Qp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Wp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,$p,e,void 0,void 0)};function $p(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Wp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0);for(var n=t=0;n<tm.length;n++){var r=tm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):tm[t++]=r}tm.length=t}};function em(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var tm=[],nm=!1;function rm(e,t,n){tm.push({fragmentInstance:e,observer:t,instance:n}),nm||(nm=!0,Cm(function(){nm=!1;var e=tm;tm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Wp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,im,e,void 0,void 0),e};function im(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Wp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Wp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Zp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||am(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function am(e,t,n,r,i){var a=Nt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(f(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(f(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function om(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Wp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Zp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),om(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var a=t[r];a.tag===6?(a=v(a),om(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function sm(e,t){return e=v(e),cm(e,t),!1}function cm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function lm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<tm.length;i++){var a=tm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(tm[r++]=a)}tm.length=r,n.observe(e)}),cm(e,t))}function um(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,qp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?rm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dm(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`:dm(n),Mt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function fm(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[At])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=vm(e.nextSibling),e===null)break}return null}function pm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=vm(e.nextSibling),e===null))return null;return e}function mm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=vm(e.nextSibling),e===null))return null;return e}function hm(e){return e.data===`$?`||e.data===`$~`}function gm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function _m(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 vm(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 ym=null;function bm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return vm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function xm(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 Sm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Cm(e){Op(function(){Op(function(t){return e(t)})})}function wm(e,t,n){switch(t=yp(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 Tm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&up(e,t,r,null,pp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Mt(e)}function Em(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Mt(e)}var Dm=new Map,Om=new Set;function km(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Am=F.d;F.d={f:jm,r:Mm,D:Fm,C:Im,L:Lm,m:Rm,X:Bm,S:zm,M:Vm};function jm(){var e=Am.f(),t=Jd();return e||t}function Mm(e){var t=Pt(e);t!==null&&t.tag===5&&t.type===`form`?oc(t):Am.r(e)}var Nm=typeof document>`u`?null:document;function Pm(e,t,n){var r=Nm;if(r&&typeof t==`string`&&t){var i=an(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Om.has(i)||(Om.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Lt(t),r.head.appendChild(t)))}}function Fm(e){Am.D(e),Pm(`dns-prefetch`,e,null)}function Im(e,t){Am.C(e,t),Pm(`preconnect`,e,t)}function Lm(e,t,n){Am.L(e,t,n);var r=Nm;if(r&&e&&t){var i=`link[rel="preload"][as="`+an(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+an(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+an(n.imageSizes)+`"]`)):i+=`[href="`+an(e)+`"]`;var a=i;switch(t){case`style`:a=Um(e);break;case`script`:a=qm(e)}if(!(Dm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Dm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Wm(a))||t===`script`&&r.querySelector(Jm(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[jt]=!0,o.onload=o.onerror=function(){Rt(o)}),Lt(o),r.head.appendChild(o)}}}function Rm(e,t){Am.m(e,t);var n=Nm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+an(r)+`"][href="`+an(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=qm(e)}if(!Dm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Dm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Jm(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Lt(r),n.head.appendChild(r)}}}function zm(e,t,n){Am.S(e,t,n);var r=Nm;if(r&&e){var i=It(r).hoistableStyles,a=Um(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Wm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Dm.get(a))&&Zm(e,n);var c=o=r.createElement(`link`);Lt(c),fp(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,Xm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Bm(e,t){Am.X(e,t);var n=Nm;if(n&&e){var r=It(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=T({src:e,async:!0},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Lt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Vm(e,t){Am.M(e,t);var n=Nm;if(n&&e){var r=It(n).hoistableScripts,i=qm(e),a=r.get(i);a||(a=n.querySelector(Jm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Dm.get(i))&&Qm(e,t),a=n.createElement(`script`),Lt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Hm(e,t,n,r){var a=(a=Ce.current)?km(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`?(n=Um(n.href),t=It(a).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,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=Um(n.href);var o=It(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(Wm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Dm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Dm.set(e,o)),Km(a,e,o,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`?(n=qm(n),t=It(a).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Um(e){return`href="`+an(e)+`"`}function Wm(e){return`link[rel="stylesheet"][`+e+`]`}function Gm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Km(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[jt]){r.loading=1;return}}else t=e.createElement(`link`),t[jt]=!0,t.onload=t.onerror=Rt.bind(null,t),fp(t,`link`,n),Lt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function qm(e){return`[src="`+an(e)+`"]`}function Jm(e){return`script[async]`+e}function Ym(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+an(n.href)+`"]`);if(r)return t.instance=r,Lt(r),r;var a=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Lt(r),fp(r,`style`,a),Xm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Um(n.href);var o=e.querySelector(Wm(a));if(o)return t.state.loading|=4,t.instance=o,Lt(o),o;r=Gm(n),(a=Dm.get(a))&&Zm(r,a),o=(e.ownerDocument||e).createElement(`link`),Lt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),fp(o,`link`,r),t.state.loading|=4,Xm(o,n.precedence,e),t.instance=o;case`script`:return o=qm(n.src),(a=e.querySelector(Jm(o)))?(t.instance=a,Lt(a),a):(r=n,(a=Dm.get(o))&&(r=T({},n),Qm(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Lt(a),fp(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,Xm(r,n.precedence,e));return t.instance}function Xm(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 Zm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var $m=null;function eh(e,t,n){if($m===null){var r=new Map,i=$m=new Map;i.set(n,r)}else i=$m,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[At]||a[Ct]||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 th(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function nh(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 rh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ih(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function ah(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function oh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=ah(t),e.suspenseyImages.push(t)),e=fh.bind(e),t.decode().then(e,e))}function sh(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=Um(r.href),a=t.querySelector(Wm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=dh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Lt(a);return}a=t.ownerDocument||t,r=Gm(r),(i=Dm.get(i))&&Zm(r,i),a=a.createElement(`link`),Lt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),fp(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=dh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ch=0;function lh(e,t){return e.stylesheets&&e.count===0&&mh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ch===0&&(ch=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&mh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ch?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function uh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)mh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function dh(){this.count--,uh(this)}function fh(){this.imgCount--,uh(this)}var ph=null;function mh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ph=new Map,t.forEach(hh,e),ph=null,dh.call(e))}function hh(e,t){if(!(t.state.loading&4)){var n=ph.get(e);if(n)var r=n.get(null);else{n=new Map,ph.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=dh.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 gh={$$typeof:M,Provider:null,Consumer:null,_currentValue:he,_currentValue2:he,_threadCount:0};function _h(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=ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ft(0),this.hiddenUpdates=ft(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function vh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new _h(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Pa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},_o(a),e}function yh(e){return e?(e=ji,e):ji}function bh(e,t,n,r,i,a){i=yh(i),r.context===null?r.context=i:r.pendingContext=i,r=yo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=bo(e,r,t),n!==null&&(Ud(n,e,t),xo(n,e,t))}function xh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Sh(e,t){xh(e,t),(e=e.alternate)&&xh(e,t)}function Ch(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&Ud(t,e,67108864),Sh(e,67108864)}}function wh(e){if(e.tag===13||e.tag===31){var t=Bd();t=vt(t);var n=Oi(e,t);n!==null&&Ud(n,e,t),Sh(e,t)}}var Th=!0;function Eh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,Oh(e,t,n,r)}finally{F.p=a,P.T=i}}function Dh(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,Oh(e,t,n,r)}finally{F.p=a,P.T=i}}function Oh(e,t,n,r){if(Th){var i=kh(r);if(i===null)rp(e,t,r,Ah,n),Vh(e,r);else if(Uh(i,e,t,n,r))r.stopPropagation();else if(Vh(e,r),t&4&&-1<Bh.indexOf(e)){for(;i!==null;){var a=Pt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ot(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-$e(o);s.entanglements[1]|=c,o&=~c}If(a),!(ad&6)&&(Td=Ve()+500,Lf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&Ud(s,a,2),Jd(),Sh(a,2)}if(a=kh(r),a===null&&rp(e,t,r,Ah,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else rp(e,t,r,null,n)}}function kh(e){return e=xn(e),jh(e)}var Ah=null;function jh(e){if(Ah=null,e=Nt(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 Ah=e,null}function Mh(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`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Nh=!1,Ph=null,Fh=null,Ih=null,Lh=new Map,Rh=new Map,zh=[],Bh=`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 Vh(e,t){switch(e){case`focusin`:case`focusout`:Ph=null;break;case`dragenter`:case`dragleave`:Fh=null;break;case`mouseover`:case`mouseout`:Ih=null;break;case`pointerover`:case`pointerout`:Lh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Rh.delete(t.pointerId)}}function Hh(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=Pt(t),t!==null&&Ch(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Uh(e,t,n,r,i){switch(t){case`focusin`:return Ph=Hh(Ph,e,t,n,r,i),!0;case`dragenter`:return Fh=Hh(Fh,e,t,n,r,i),!0;case`mouseover`:return Ih=Hh(Ih,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Lh.set(a,Hh(Lh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Rh.set(a,Hh(Rh.get(a)||null,e,t,n,r,i)),!0}return!1}function Wh(e){var t=Nt(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,xt(e.priority,function(){wh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,xt(e.priority,function(){wh(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 Gh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=kh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Pt(n),t!==null&&Ch(t),e.blockedOn=n,!1;t.shift()}return!0}function Kh(e,t,n){Gh(e)&&n.delete(t)}function qh(){Nh=!1,Ph!==null&&Gh(Ph)&&(Ph=null),Fh!==null&&Gh(Fh)&&(Fh=null),Ih!==null&&Gh(Ih)&&(Ih=null),Lh.forEach(Kh),Rh.forEach(Kh)}function Jh(e,n){e.blockedOn===n&&(e.blockedOn=null,Nh||(Nh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,qh)))}var Yh=null;function Xh(e){Yh!==e&&(Yh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Yh===e&&(Yh=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(jh(r||n)===null)continue;break}var a=Pt(n);a!==null&&(e.splice(t,3),t-=3,ic(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Zh(e){function t(t){return Jh(t,e)}Ph!==null&&Jh(Ph,e),Fh!==null&&Jh(Fh,e),Ih!==null&&Jh(Ih,e),Lh.forEach(t),Rh.forEach(t);for(var n=0;n<zh.length;n++){var r=zh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<zh.length&&(n=zh[0],n.blockedOn===null);)Wh(n),n.blockedOn===null&&zh.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[wt]||null;if(typeof a==`function`)o||Xh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[wt]||null)s=o.formAction;else if(jh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Xh(n)}}}function Qh(){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 $h(e){this._internalRoot=e}eg.prototype.render=$h.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;bh(n,Bd(),e,t,null,null)},eg.prototype.unmount=$h.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bh(e.current,2,null,e,null,null),Jd(),t[Tt]=null}};function eg(e){this._internalRoot=e}eg.prototype.unstable_scheduleHydration=function(e){if(e){var t=bt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<zh.length&&t!==0&&t<zh[n].priority;n++);zh.splice(n,0,e),n===0&&Wh(e)}};var tg=n.version;if(tg!==`19.3.0`)throw Error(i(527,tg,`19.3.0`));F.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:d(e),e=e===null?null:e.stateNode,e};var ng={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var rg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rg.isDisabled&&rg.supportsFiber)try{Xe=rg.inject(ng),Ze=rg}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Dc,s=Oc,c=kc;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=vh(e,1,!1,null,null,n,r,null,o,s,c,Qh),e[Tt]=t.current,tp(e),new $h(t)}})),Xf=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=Yf()}))(),Zf={info:3600,success:3e3,warning:5e3,error:6e3},Qf,V=[],$f=0,ep=new Set;function tp(){for(let e of[...ep])e()}function np(e,t,n){let r=t.trim();if(!r)return;let i=Qf?.message===r?Qf:V.find(e=>e.message===r);if(i){if(n?.action&&!i.action){let e={...i,action:n.action};i===Qf?Qf=e:V=V.map(t=>t===i?e:t),tp()}return}let a={id:++$f,kind:e,message:r,duration:n?.duration??Zf[e],...n?.action?{action:n.action}:{}};Qf?V=[...V,a].slice(-3):Qf=a,tp()}function rp(e){Qf?.id===e&&(Qf=V[0],V=V.slice(1),tp())}var H=Object.assign((e,t)=>np(`info`,e,t),{success:(e,t)=>np(`success`,e,t),error:(e,t)=>np(`error`,e,t),warning:(e,t)=>np(`warning`,e,t),info:(e,t)=>np(`info`,e,t)});function ip(e){return ep.add(e),()=>{ep.delete(e)}}function ap(){return{item:(0,m.useSyncExternalStore)(ip,()=>Qf,()=>void 0),waiting:(0,m.useSyncExternalStore)(ip,()=>V.length,()=>0)}}function op(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function U(e,t,n={}){try{let r=await Te(e,t),i=r.notice;return i&&H(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){H.error(op(e));return}}var sp=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function cp(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:sp(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var lp=e=>{let t=``,n=!1;for(let r of e){if(r===`-`||r===`_`||r<=` `){n=t.length>0;continue}t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1}return t},up=e=>{let t=lp(e);return t.charAt(0).toUpperCase()+t.slice(1)},dp=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),fp={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function pp(e){return e!=null}function mp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??fp.width,a=e.size??e.height??fp.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],l=t.includeDefaultClasses===!1?dp(...c):dp(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??fp[`stroke-width`])*Number(e.size??e.width??fp.width)/Number(t.size??t.width??fp.width):t.strokeWidth??fp[`stroke-width`];return[`svg`,{...Object.entries(fp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&pp(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&pp(t.width)&&{[r(`width`)]:t.width},...`height`in t&&pp(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:u,...l&&{[r(`class`)]:l},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function hp(e,t={}){return mp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var gp=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},_p=(0,m.createContext)({}),vp=()=>(0,m.useContext)(_p),yp=(0,m.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:i,absoluteStrokeWidth:a,nonScalingStroke:o,className:s=``,children:c,iconNode:l=[],icon:u={node:l,aliases:[],size:24},...d},f)=>{let{size:p=24,strokeWidth:h=2,absoluteStrokeWidth:g=!1,nonScalingStroke:_=!1,color:v=`currentColor`,className:y=``}=vp()??{},b=!!c||gp(d),[x,S,C=[]]=hp(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:dp(y,s),hasA11yProp:b,attributes:d});return(0,m.createElement)(x,{ref:f,...S},[...C.map(([e,t])=>(0,m.createElement)(e,t)),...Array.isArray(c)?c:[c]])});function W(e,t=[],n=[]){let r=typeof e==`string`?cp(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(yp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=up(r.name)),i}var bp={name:`archive-restore`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]};bp.node;var xp=W(bp),Sp={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};Sp.node;var Cp=W(Sp),wp={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};wp.node;var Tp=W(wp),Ep={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Ep.node;var Dp=W(Ep),Op={name:`arrow-right-to-line`,size:24,node:[[`path`,{d:`M17 12H3`,key:`8awo09`}],[`path`,{d:`m11 18 6-6-6-6`,key:`8c2y43`}],[`path`,{d:`M21 5v14`,key:`nzette`}]]};Op.node;var kp=W(Op),Ap={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};Ap.node;var jp=W(Ap),Mp={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Mp.node;var Np=W(Mp),Pp={name:`bot`,size:24,node:[[`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`}]]};Pp.node;var Fp=W(Pp),Ip={name:`brain`,size:24,node:[[`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`}]]};Ip.node;var Lp=W(Ip),Rp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Rp.node;var zp=W(Rp),Bp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Bp.node;var Vp=W(Bp),Hp={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};Hp.node;var Up=W(Hp),Wp={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Wp.node;var Gp=W(Wp),Kp={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Kp.node;var qp=W(Kp),Jp={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Jp.node;var Yp=W(Jp),Xp={name:`chevrons-up`,size:24,node:[[`path`,{d:`m17 11-5-5-5 5`,key:`e8nh98`}],[`path`,{d:`m17 18-5-5-5 5`,key:`2avn1x`}]]};Xp.node;var Zp=W(Xp),Qp={name:`circle-alert`,size:24,node:[[`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`}]],aliases:[`alert-circle`]};Qp.node;var $p=W(Qp),em={name:`circle-check`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 9-5.5 5.5L8 12`,key:`xofnsj`}]],aliases:[`check-circle-2`]};em.node;var tm=W(em),nm={name:`circle-dashed`,size:24,node:[[`path`,{d:`M10.1 2.182a10 10 0 0 1 3.8 0`,key:`5ilxe3`}],[`path`,{d:`M13.9 21.818a10 10 0 0 1-3.8 0`,key:`11zvb9`}],[`path`,{d:`M17.609 3.721a10 10 0 0 1 2.69 2.7`,key:`1iw5b2`}],[`path`,{d:`M2.182 13.9a10 10 0 0 1 0-3.8`,key:`c0bmvh`}],[`path`,{d:`M20.279 17.609a10 10 0 0 1-2.7 2.69`,key:`1ruxm7`}],[`path`,{d:`M21.818 10.1a10 10 0 0 1 0 3.8`,key:`qkgqxc`}],[`path`,{d:`M3.721 6.391a10 10 0 0 1 2.7-2.69`,key:`1mcia2`}],[`path`,{d:`M6.391 20.279a10 10 0 0 1-2.69-2.7`,key:`1fvljs`}]]};nm.node;var rm=W(nm),im={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};im.node;var am=W(im),om={name:`circle-question-mark`,size:24,node:[[`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`}]],aliases:[`help-circle`,`circle-help`]};om.node;var sm=W(om),cm={name:`circle-stop`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]],aliases:[`stop-circle`]};cm.node;var lm=W(cm),um={name:`circle-x`,size:24,node:[[`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`}]],aliases:[`x-circle`]};um.node;var dm=W(um),fm={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};fm.node;var pm=W(fm),mm={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};mm.node;var hm=W(mm),gm={name:`code-xml`,size:24,node:[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]],aliases:[`code-2`]};gm.node;var _m=W(gm),vm={name:`compass`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z`,key:`9ktpf1`}]]};vm.node;var ym=W(vm),bm={name:`copy`,size:24,node:[[`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`}]]};bm.node;var xm=W(bm),Sm={name:`download`,size:24,node:[[`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`}]]};Sm.node;var Cm=W(Sm),wm={name:`external-link`,size:24,node:[[`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`}]]};wm.node;var Tm=W(wm),Em={name:`eye`,size:24,node:[[`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`}]]};Em.node;var Dm=W(Em),Om={name:`file-pen`,size:24,node:[[`path`,{d:`M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34`,key:`o6klzx`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z`,key:`zhnas1`}]],aliases:[`file-edit`]};Om.node;var km=W(Om),Am={name:`file-plus`,size:24,node:[[`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:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]};Am.node;var jm=W(Am),Mm={name:`file-text`,size:24,node:[[`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`}]]};Mm.node;var Nm=W(Mm),Pm={name:`folder-open`,size:24,node:[[`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`}]]};Pm.node;var Fm=W(Pm),Im={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Im.node;var Lm=W(Im),Rm={name:`git-pull-request`,size:24,node:[[`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`}],[`line`,{x1:`6`,x2:`6`,y1:`9`,y2:`21`,key:`rroup`}]]};Rm.node;var zm=W(Rm),Bm={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Bm.node;var Vm=W(Bm),Hm={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Hm.node;var Um=W(Hm),Wm={name:`keyboard`,size:24,node:[[`path`,{d:`M10 8h.01`,key:`1r9ogq`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M14 8h.01`,key:`1primd`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}],[`path`,{d:`M18 8h.01`,key:`emo2bl`}],[`path`,{d:`M6 8h.01`,key:`x9i8wu`}],[`path`,{d:`M7 16h10`,key:`wp8him`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`rect`,{width:`20`,height:`16`,x:`2`,y:`4`,rx:`2`,key:`18n3k1`}]]};Wm.node;var Gm=W(Wm),Km={name:`layers`,size:24,node:[[`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`}]],aliases:[`layers-3`]};Km.node;var qm=W(Km),Jm={name:`list-checks`,size:24,node:[[`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`}]]};Jm.node;var Ym=W(Jm),Xm={name:`list-plus`,size:24,node:[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]};Xm.node;var Zm=W(Xm),Qm={name:`loader`,size:24,node:[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]};Qm.node;var $m=W(Qm),eh={name:`maximize-2`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]};eh.node;var th=W(eh),nh={name:`maximize`,size:24,node:[[`path`,{d:`M8 3H5a2 2 0 0 0-2 2v3`,key:`1dcmit`}],[`path`,{d:`M21 8V5a2 2 0 0 0-2-2h-3`,key:`1e4gt3`}],[`path`,{d:`M3 16v3a2 2 0 0 0 2 2h3`,key:`wsl5sc`}],[`path`,{d:`M16 21h3a2 2 0 0 0 2-2v-3`,key:`18trek`}]]};nh.node;var rh=W(nh),ih={name:`menu`,size:24,node:[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]};ih.node;var ah=W(ih),oh={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`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`}]],aliases:[`message-circle-question`]};oh.node;var sh=W(oh),ch={name:`message-square-plus`,size:24,node:[[`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`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};ch.node;var lh=W(ch),uh={name:`message-square`,size:24,node:[[`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`}]]};uh.node;var dh=W(uh),fh={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};fh.node;var ph=W(fh),mh={name:`minimize-2`,size:24,node:[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]};mh.node;var hh=W(mh),gh={name:`minimize`,size:24,node:[[`path`,{d:`M8 3v3a2 2 0 0 1-2 2H3`,key:`hohbtr`}],[`path`,{d:`M21 8h-3a2 2 0 0 1-2-2V3`,key:`5jw1f3`}],[`path`,{d:`M3 16h3a2 2 0 0 1 2 2v3`,key:`198tvr`}],[`path`,{d:`M16 21v-3a2 2 0 0 1 2-2h3`,key:`ph8mxp`}]]};gh.node;var _h=W(gh),vh={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};vh.node;var yh=W(vh),bh={name:`monitor`,size:24,node:[[`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`}]]};bh.node;var xh=W(bh),Sh={name:`moon`,size:24,node:[[`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`}]]};Sh.node;var Ch=W(Sh),wh={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};wh.node;var Th=W(wh),Eh={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Eh.node;var Dh=W(Eh),Oh={name:`paperclip`,size:24,node:[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]};Oh.node;var kh=W(Oh),Ah={name:`pause`,size:24,node:[[`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`}]]};Ah.node;var jh=W(Ah),Mh={name:`pen-tool`,size:24,node:[[`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`,key:`nt11vn`}],[`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`,key:`15qc1e`}],[`path`,{d:`m2.3 2.3 7.286 7.286`,key:`1wuzzi`}],[`circle`,{cx:`11`,cy:`11`,r:`2`,key:`xmgehs`}]]};Mh.node;var Nh=W(Mh),Ph={name:`pencil-line`,size:24,node:[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]};Ph.node;var Fh=W(Ph),Ih={name:`pencil-off`,size:24,node:[[`path`,{d:`m10 10-6.157 6.162a2 2 0 0 0-.5.833l-1.322 4.36a.5.5 0 0 0 .622.624l4.358-1.323a2 2 0 0 0 .83-.5L14 13.982`,key:`bjo8r8`}],[`path`,{d:`m12.829 7.172 4.359-4.346a1 1 0 1 1 3.986 3.986l-4.353 4.353`,key:`16h5ne`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};Ih.node;var Lh=W(Ih),Rh={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};Rh.node;var zh=W(Rh),Bh={name:`play`,size:24,node:[[`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`}]]};Bh.node;var Vh=W(Bh),Hh={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};Hh.node;var Uh=W(Hh),Wh={name:`refresh-cw`,size:24,node:[[`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`}]]};Wh.node;var Gh=W(Wh),Kh={name:`rotate-ccw-clock`,size:24,node:[[`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`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Kh.node;var qh=W(Kh),Jh={name:`rotate-ccw`,size:24,node:[[`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`}]]};Jh.node;var Yh=W(Jh),Xh={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Xh.node;var Zh=W(Xh),Qh={name:`route`,size:24,node:[[`circle`,{cx:`6`,cy:`19`,r:`3`,key:`1kj8tv`}],[`path`,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,key:`1d8sl`}],[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}]]};Qh.node;var $h=W(Qh),eg={name:`save`,size:24,node:[[`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`}]]};eg.node;var tg=W(eg),ng={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};ng.node;var rg=W(ng),ig={name:`settings-2`,size:24,node:[[`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`}]]};ig.node;var ag=W(ig),og={name:`settings`,size:24,node:[[`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`}]]};og.node;var sg=W(og),cg={name:`shield-check`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]};cg.node;var lg=W(cg),ug={name:`square-arrow-out-up-right`,size:24,node:[[`path`,{d:`M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6`,key:`y09zxi`}],[`path`,{d:`m21 3-9 9`,key:`mpx6sq`}],[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}]],aliases:[`arrow-up-right-from-square`]};ug.node;var dg=W(ug),fg={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};fg.node;var pg=W(fg),mg={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};mg.node;var hg=W(mg),gg={name:`sun`,size:24,node:[[`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`}]]};gg.node;var _g=W(gg),vg={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};vg.node;var yg=W(vg),bg={name:`telescope`,size:24,node:[[`path`,{d:`m10.065 12.493-6.18 1.318a.934.934 0 0 1-1.108-.702l-.537-2.15a1.07 1.07 0 0 1 .691-1.265l13.504-4.44`,key:`k4qptu`}],[`path`,{d:`m13.56 11.747 4.332-.924`,key:`19l80z`}],[`path`,{d:`m16 21-3.105-6.21`,key:`7oh9d`}],[`path`,{d:`M16.485 5.94a2 2 0 0 1 1.455-2.425l1.09-.272a1 1 0 0 1 1.212.727l1.515 6.06a1 1 0 0 1-.727 1.213l-1.09.272a2 2 0 0 1-2.425-1.455z`,key:`m7xp4m`}],[`path`,{d:`m6.158 8.633 1.114 4.456`,key:`74o979`}],[`path`,{d:`m8 21 3.105-6.21`,key:`1fvxut`}],[`circle`,{cx:`12`,cy:`13`,r:`2`,key:`1c1ljs`}]]};bg.node;var xg=W(bg),Sg={name:`trash`,size:24,node:[[`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`}]],aliases:[`trash-2`]};Sg.node;var Cg=W(Sg),wg={name:`triangle-alert`,size:24,node:[[`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`}]],aliases:[`alert-triangle`]};wg.node;var Tg=W(wg),Eg={name:`undo-2`,size:24,node:[[`path`,{d:`M9 14 4 9l5-5`,key:`102s5s`}],[`path`,{d:`M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11`,key:`f3b9sd`}]]};Eg.node;var Dg=W(Eg),Og={name:`upload`,size:24,node:[[`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`}]]};Og.node;var kg=W(Og),Ag={name:`users`,size:24,node:[[`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`}]]};Ag.node;var jg=W(Ag),Mg={name:`volume-2`,size:24,node:[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]};Mg.node;var Ng=W(Mg),Pg={name:`volume-x`,size:24,node:[[`path`,{d:`M11 4.702a.7.7 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.7.7 0 0 0 11 19.298z`,key:`1p7khw`}],[`path`,{d:`m16.5 14.5 5-5`,key:`cul3yw`}],[`path`,{d:`m16.5 9.5 5 5`,key:`1akey5`}]]};Pg.node;var Fg=W(Pg),Ig={name:`wifi-off`,size:24,node:[[`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`}]]};Ig.node;var Lg=W(Ig),Rg={name:`workflow`,size:24,node:[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]};Rg.node;var zg=W(Rg),Bg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};Bg.node;var Vg=W(Bg),Hg={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]};Hg.node;var Ug=W(Hg);function Wg(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=Wg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Gg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wg(e))&&(r&&(r+=` `),r+=t);return r}var Kg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,qg=Gg,Jg=(e,t)=>n=>{if(t?.variants==null)return qg(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=Kg(t)||Kg(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 qg(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)},Yg=(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},Xg=(e,t)=>({classGroupId:e,validator:t}),Zg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Qg=`-`,$g=[],e_=`arbitrary..`,t_=e=>{let t=i_(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return r_(e);let n=e.split(Qg);return n_(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Yg(i,t):t:i||$g}return n[e]||$g}}},n_=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=n_(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Qg):e.slice(t).join(Qg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},r_=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?e_+r:void 0})(),i_=e=>{let{theme:t,classGroups:n}=e;return a_(n,t)},a_=(e,t)=>{let n=Zg();for(let r in e){let i=e[r];o_(i,n,r,t)}return n},o_=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];s_(i,t,n,r)}},s_=(e,t,n,r)=>{if(typeof e==`string`){c_(e,t,n);return}if(typeof e==`function`){l_(e,t,n,r);return}u_(e,t,n,r)},c_=(e,t,n)=>{let r=e===``?t:d_(t,e);r.classGroupId=n},l_=(e,t,n,r)=>{if(f_(e)){o_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Xg(n,e))},u_=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];o_(o,d_(t,a),n,r)}},d_=(e,t)=>{let n=e,r=t.split(Qg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Zg(),n.nextPart.set(t,i)),n=i}return n},f_=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,p_=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)}}},m_=`!`,h_=`:`,g_=[],__=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),v_=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===h_){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(m_)?(c=s.slice(0,-1),l=!0):s.startsWith(m_)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return __(t,l,c,u)};if(t){let e=t+h_,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):__(g_,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},y_=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}},b_=e=>({cache:p_(e.cacheSize),parseClassName:v_(e),sortModifiers:y_(e),postfixLookupClassGroupIds:x_(e),...t_(e)}),x_=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},S_=/\s+/,C_=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(S_),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?_+m_:_,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},w_=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=T_(n))&&(i&&(i+=` `),i+=r);return i},T_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=T_(e[r]))&&(n&&(n+=` `),n+=t);return n},E_=(e,...t)=>{let n,r,i,a,o=o=>(n=b_(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=C_(e,n);return i(e,a),a};return a=o,(...e)=>a(w_(...e))},D_=[],O_=e=>{let t=t=>t[e]||D_;return t.isThemeGetter=!0,t.themeKey=e,t},k_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,A_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,M_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,N_=/\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$/,P_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,F_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,I_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,L_=e=>j_.test(e),R_=e=>!!e&&!Number.isNaN(Number(e)),z_=e=>!!e&&Number.isInteger(Number(e)),B_=e=>e.endsWith(`%`)&&R_(e.slice(0,-1)),V_=e=>M_.test(e),H_=()=>!0,U_=e=>N_.test(e)&&!P_.test(e),W_=()=>!1,G_=e=>F_.test(e),K_=e=>I_.test(e),q_=e=>!G(e)&&!K(e),J_=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)),Y_=e=>uv(e,mv,W_),G=e=>k_.test(e),X_=e=>uv(e,hv,U_),Z_=e=>uv(e,gv,R_),Q_=e=>uv(e,vv,H_),$_=e=>uv(e,_v,W_),ev=e=>uv(e,fv,W_),tv=e=>uv(e,pv,K_),nv=e=>uv(e,yv,G_),K=e=>A_.test(e),rv=e=>dv(e,hv),iv=e=>dv(e,_v),av=e=>dv(e,fv),ov=e=>dv(e,mv),sv=e=>dv(e,pv),cv=e=>dv(e,yv,!0),lv=e=>dv(e,vv,!0),uv=(e,t,n)=>{let r=k_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},dv=(e,t,n=!1)=>{let r=A_.exec(e);return r?r[1]?t(r[1]):n:!1},fv=e=>e===`position`||e===`percentage`,pv=e=>e===`image`||e===`url`,mv=e=>e===`length`||e===`size`||e===`bg-size`,hv=e=>e===`length`,gv=e=>e===`number`,_v=e=>e===`family-name`,vv=e=>e===`number`||e===`weight`,yv=e=>e===`shadow`,bv=E_(()=>{let e=O_(`color`),t=O_(`font`),n=O_(`text`),r=O_(`font-weight`),i=O_(`tracking`),a=O_(`leading`),o=O_(`breakpoint`),s=O_(`container`),c=O_(`spacing`),l=O_(`radius`),u=O_(`shadow`),d=O_(`inset-shadow`),f=O_(`text-shadow`),p=O_(`drop-shadow`),m=O_(`blur`),h=O_(`perspective`),g=O_(`aspect`),_=O_(`ease`),v=O_(`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(),K,G],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[K,G,c],T=()=>[L_,`full`,`auto`,...w()],E=()=>[z_,`none`,`subgrid`,K,G],D=()=>[`auto`,{span:[`full`,z_,K,G]},z_,K,G],O=()=>[z_,`auto`,K,G],k=()=>[`auto`,`min`,`max`,`fr`,K,G],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[L_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[s,L_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[L_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,K,G],re=()=>[...b(),av,ev,{position:[K,G]}],ie=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ae=()=>[`auto`,`cover`,`contain`,ov,Y_,{size:[K,G]}],oe=()=>[B_,rv,X_],se=()=>[``,`none`,`full`,l,K,G],ce=()=>[``,R_,rv,X_],le=()=>[`solid`,`dashed`,`dotted`,`double`],ue=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],de=()=>[R_,B_,av,ev],fe=()=>[``,`none`,m,K,G],pe=()=>[`none`,R_,K,G],me=()=>[`none`,R_,K,G],P=()=>[R_,K,G],F=()=>[L_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[V_],breakpoint:[V_],color:[H_],container:[V_],"drop-shadow":[V_],ease:[`in`,`out`,`in-out`],font:[q_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[V_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[V_],shadow:[V_],spacing:[`px`,R_],text:[V_],"text-shadow":[V_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,L_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[J_],columns:[{columns:[R_,`auto`,G,K,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:[z_,`auto`,K,G]}],basis:[{basis:[L_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[R_,L_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,R_,K,G]}],shrink:[{shrink:[``,R_,K,G]}],order:[{order:[z_,`first`,`last`,`none`,K,G]}],"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":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],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:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...M()]}],"font-size":[{text:[`base`,n,rv,X_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,lv,Q_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,B_,G]}],"font-family":[{font:[iv,$_,t]}],"font-features":[{"font-features":[G]}],"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,K,G]}],"line-clamp":[{"line-clamp":[R_,`none`,K,Z_]}],leading:[{leading:[`none`,a,...w()]}],"list-image":[{"list-image":[`none`,K,G]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,K,G]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...le(),`wavy`]}],"text-decoration-thickness":[{decoration:[R_,`from-font`,`auto`,K,X_]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[R_,`auto`,K,G]}],"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:[z_,K,G]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,K,G]}],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`,K,G]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:re()}],"bg-repeat":[{bg:ie()}],"bg-size":[{bg:ae()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},z_,K,G],radial:[``,K,G],conic:[``,z_,K,G]},sv,tv]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:oe()}],"gradient-via-pos":[{via:oe()}],"gradient-to-pos":[{to:oe()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ce()}],"border-w-x":[{"border-x":ce()}],"border-w-y":[{"border-y":ce()}],"border-w-s":[{"border-s":ce()}],"border-w-e":[{"border-e":ce()}],"border-w-bs":[{"border-bs":ce()}],"border-w-be":[{"border-be":ce()}],"border-w-t":[{"border-t":ce()}],"border-w-r":[{"border-r":ce()}],"border-w-b":[{"border-b":ce()}],"border-w-l":[{"border-l":ce()}],"divide-x":[{"divide-x":ce()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":ce()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...le(),`hidden`,`none`]}],"divide-style":[{divide:[...le(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...le(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[R_,K,G]}],"outline-w":[{outline:[``,R_,rv,X_]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`inner`,`none`,u,cv,nv]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,cv,nv]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:ce()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[R_,X_]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":ce()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,cv,nv]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[R_,K,G]}],"mix-blend":[{"mix-blend":[...ue(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ue()}],"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":[R_]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"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":[R_]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:re()}],"mask-repeat":[{mask:ie()}],"mask-size":[{mask:ae()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:fe()}],brightness:[{brightness:[R_,K,G]}],contrast:[{contrast:[R_,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,cv,nv]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,R_,K,G]}],"hue-rotate":[{"hue-rotate":[R_,K,G]}],invert:[{invert:[``,R_,K,G]}],saturate:[{saturate:[R_,K,G]}],sepia:[{sepia:[``,R_,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":fe()}],"backdrop-brightness":[{"backdrop-brightness":[R_,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[R_,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,R_,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[R_,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,R_,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[R_,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[R_,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,R_,K,G]}],"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`,K,G]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[R_,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[R_,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:me()}],"scale-x":[{"scale-x":me()}],"scale-y":[{"scale-y":me()}],"scale-z":[{"scale-z":me()}],"scale-3d":[`scale-3d`],skew:[{skew:P()}],"skew-x":[{"skew-x":P()}],"skew-y":[{"skew-y":P()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:F()}],"translate-x":[{"translate-x":F()}],"translate-y":[{"translate-y":F()}],"translate-z":[{"translate-z":F()}],"translate-none":[`translate-none`],zoom:[{zoom:[z_,K,G]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"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`,K,G]}],"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":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"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`,K,G]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[R_,rv,X_,Z_]}],stroke:[{stroke:[`none`,...N()]}],"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":[`start`,`end`,`right`,`left`],"inset-y":[`inset-bs`,`inset-be`,`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`ps`,`pe`,`pr`,`pl`],py:[`pbs`,`pbe`,`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`ms`,`me`,`mr`,`ml`],my:[`mbs`,`mbe`,`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-s`,`border-w-e`,`border-w-r`,`border-w-l`],"border-w-y":[`border-w-bs`,`border-w-be`,`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-s`,`border-color-e`,`border-color-r`,`border-color-l`],"border-color-y":[`border-color-bs`,`border-color-be`,`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-ms`,`scroll-me`,`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mbs`,`scroll-mbe`,`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-ps`,`scroll-pe`,`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pbs`,`scroll-pbe`,`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 q(...e){return bv(Gg(e))}var xv=Object.defineProperty,Sv=(e,t)=>xv(e,`name`,{value:t,configurable:!0});function Cv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Sv(Cv,`setRef`);function wv(...e){return t=>{let n=!1,r=e.map(e=>{let r=Cv(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():Cv(e[t],null)}}}}Sv(wv,`composeRefs`);function Tv(...e){return m.useCallback(wv(...e),e)}Sv(Tv,`useComposedRefs`);var Ev=Object.defineProperty,Dv=(e,t)=>Ev(e,`name`,{value:t,configurable:!0});function Ov(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Lv(r)&&typeof Vv==`function`&&(r=Vv(r._payload)),m.Children.forEach(r,e=>{if(Fv(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Lv(n)&&typeof Vv==`function`&&(n=Vv(n._payload)),a=Mv(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=m.cloneElement(a,void 0,s):!o&&m.Children.count(r)===1&&m.isValidElement(r)&&(a=r);let c=a?Pv(a):void 0,l=Tv(n,c);if(!a){if(r||r===0)throw Error(o?Bv(e):zv(e));return r}let u=Nv(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}Dv(Ov,`createSlot`);var kv=Ov(`Slot`),Av=Symbol.for(`radix.slottable`);function jv(e){let t=Dv(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Av,t}Dv(jv,`createSlottable`);var Mv=Dv((e,t)=>{if(`child`in e.props){let t=e.props.child;return m.isValidElement(t)?m.cloneElement(t,void 0,e.props.children(t.props.children)):null}return m.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Nv(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}}Dv(Nv,`mergeProps`);function Pv(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)}Dv(Pv,`getElementRef`);function Fv(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Av}Dv(Fv,`isSlottable`);var Iv=Symbol.for(`react.lazy`);function Lv(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Iv&&`_payload`in e&&Rv(e._payload)}Dv(Lv,`isLazyComponent`);function Rv(e){return typeof e==`object`&&!!e&&`then`in e}Dv(Rv,`isPromiseLike`);var zv=Dv(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Bv=Dv(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Vv=m.use,Hv=l(Jf(),1),Uv=Object.defineProperty,Wv=(e,t)=>Uv(e,`name`,{value:t,configurable:!0}),Gv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Ov(`Primitive.${t}`),r=m.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,R.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Kv(e,t){e&&Hv.flushSync(()=>e.dispatchEvent(t))}Wv(Kv,`dispatchDiscreteCustomEvent`);var qv=Object.defineProperty,Jv=(e,t)=>qv(e,`name`,{value:t,configurable:!0}),Yv=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Xv=m.forwardRef(Jv(function(e,t){return(0,R.jsx)(Gv.span,{...e,ref:t,style:{...Yv,...e.style}})},`VisuallyHidden`)),Zv=Object.defineProperty,Qv=(e,t)=>Zv(e,`name`,{value:t,configurable:!0});function $v(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Qv(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,R.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=m.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return Qv(i,`useContext`),[r,i]}Qv($v,`createContext`);function ey(e,t=[]){let n=[];function r(t,r){let i=m.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=Qv(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,R.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=m.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return Qv(s,`useContext`),[o,s]}Qv(r,`createContext`);let i=Qv(()=>{let t=n.map(e=>m.createContext(e));return Qv(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ty(i,...t)]}Qv(ey,`createContextScope`);function ty(...e){let t=e[0];if(e.length===1)return t;let n=Qv(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Qv(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}Qv(ty,`composeContextScopes`);var ny=Object.defineProperty,ry=(e,t)=>ny(e,`name`,{value:t,configurable:!0});function iy(e){let t=e+`CollectionProvider`,[n,r]=ey(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=ry(e=>{let{scope:t,children:n}=e,r=m.useRef(null),a=m.useRef(new Map).current;return(0,R.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Ov(s),l=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Tv(t,a(s,n).collectionRef);return(0,R.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Ov(u),p=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),s=Tv(t,o),c=a(u,n);return m.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,R.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function h(t){let n=a(e+`CollectionConsumer`,t);return m.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return ry(h,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},h,r]}ry(iy,`createCollection`);var ay=new WeakMap,oy=class e extends Map{static{ry(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],ay.set(this,!0)}set(e,t){return ay.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=ly(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=sy(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=sy(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return sy(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function sy(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=cy(e,t);return n===-1?void 0:e[n]}ry(sy,`at`);function cy(e,t){let n=e.length,r=ly(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}ry(cy,`toSafeIndex`);function ly(e){return e!==e||e===0?0:Math.trunc(e)}ry(ly,`toSafeInteger`);function uy(e){let t=e+`CollectionProvider`,[n,r]=ey(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new oy,setItemMap:ry(()=>void 0,`setItemMap`)}),o=ry(({state:e,...t})=>e?(0,R.jsx)(c,{...t,state:e}):(0,R.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=ry(e=>{let t=g();return(0,R.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=ry(e=>{let{scope:t,children:n,state:r}=e,a=m.useRef(null),[o,s]=m.useState(null),c=Tv(a,s),[l,u]=r;return m.useEffect(()=>{if(!o)return;let e=my(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,R.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Ov(l),d=m.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=Tv(t,a(l,n).collectionRef);return(0,R.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Ov(f),h=m.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=m.useRef(null),[s,c]=m.useState(null),l=Tv(t,o,c),{setItemMap:u}=a(f,n),d=m.useRef(i);dy(d.current,i)||(d.current=i);let h=d.current;return m.useEffect(()=>{let e=h;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(py):(t.set(s,{...e,element:s}),t.toSorted(py)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new oy(e)))}},[s,h,u]),(0,R.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});h.displayName=f;function g(){return m.useState(new oy)}ry(g,`useInitCollection`);function _(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return ry(_,`useCollection`),[{Provider:o,Slot:d,ItemSlot:h},{createCollectionScope:r,useCollection:_,useInitCollection:g}]}ry(uy,`createCollection`);function dy(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}ry(dy,`shallowEqual`);function fy(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}ry(fy,`isElementPreceding`);function py(e,t){return!e[1].element||!t[1].element?0:fy(e[1].element,t[1].element)?-1:1}ry(py,`sortByDocumentPosition`);function my(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}ry(my,`getChildListObserver`);var hy=Object.defineProperty,gy=(e,t)=>hy(e,`name`,{value:t,configurable:!0}),_y=!!(typeof window<`u`&&window.document&&window.document.createElement);function J(e,t,{checkForDefaultPrevented:n=!0}={}){return gy(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}gy(J,`composeEventHandlers`);function vy(e){if(!_y)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}gy(vy,`getOwnerWindow`);function yy(e){if(!_y)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}gy(yy,`getOwnerDocument`);function by(e,t=!1){let{activeElement:n}=yy(e);if(!n?.nodeName)return null;if(xy(n)&&n.contentDocument)return by(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=yy(n).getElementById(e);if(t)return t}}return n}gy(by,`getActiveElement`);function xy(e){return e.tagName===`IFRAME`}gy(xy,`isFrame`);var Sy=globalThis?.document?m.useLayoutEffect:()=>{},Cy=Object.defineProperty,wy=(e,t)=>Cy(e,`name`,{value:t,configurable:!0}),Ty=m.useEffectEvent,Ey=m.useInsertionEffect;function Dy(e){if(typeof Ty==`function`)return Ty(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Ey==`function`?Ey(()=>{t.current=e}):Sy(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}wy(Dy,`useEffectEvent`);var Oy=Object.defineProperty,ky=(e,t)=>Oy(e,`name`,{value:t,configurable:!0}),Ay=m.useInsertionEffect||Sy;function jy({prop:e,defaultProp:t,onChange:n=ky(()=>{},`onChange`),caller:r}){let[i,a,o]=My({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Ny(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}ky(jy,`useControllableState`);function My({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Ay(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}ky(My,`useUncontrolledState`);function Ny(e){return typeof e==`function`}ky(Ny,`isFunction`);var Py=Symbol(`RADIX:SYNC_STATE`);function Fy(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Dy(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Py)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,h=m.useRef(p);m.useEffect(()=>{h.current!==p&&(h.current=p,c||l(p))},[p,h,c]);let g=m.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return m.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Py,state:i})},[i,d.state,c]),[g,f]}ky(Fy,`useControllableStateReducer`);var Iy=Object.defineProperty,Ly=(e,t)=>Iy(e,`name`,{value:t,configurable:!0});function Ry(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}Ly(Ry,`useStateMachine`);var zy=Ly(e=>{let{present:t,children:n}=e,r=By(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=Hy(r.ref,Wy(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function By(e){let[t,n]=m.useState(),r=m.useRef(null),i=m.useRef(e),a=m.useRef(`none`),o=m.useRef(void 0),[s,c]=Ry(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return m.useEffect(()=>{s===`mounted`?(a.current=o.current??Uy(r.current),o.current=void 0):a.current=`none`},[s]),Sy(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Uy(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Sy(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Ly(a=>{let o=Uy(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Ly(e=>{e.target===t&&(a.current=Uy(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:m.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Uy(t)}else r.current=null;n(e)},[])}}Ly(By,`usePresence`);function Vy(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Ly(Vy,`setRef`);function Hy(...e){let t=m.useRef(e);return t.current=e,m.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Vy(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Vy(n[e],null)}}},[])}Ly(Hy,`useStableComposedRefs`);function Uy(e){return e?.animationName||`none`}Ly(Uy,`getAnimationName`);function Wy(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)}Ly(Wy,`getElementRef`);var Gy=Object.defineProperty,Ky=(e,t)=>Gy(e,`name`,{value:t,configurable:!0}),qy=m.useId||(()=>void 0),Jy=0;function Yy(e){let[t,n]=m.useState(qy());return Sy(()=>{e||n(e=>e??String(Jy++))},[e]),e||(t?`radix-${t}`:``)}Ky(Yy,`useId`);var Xy=Object.defineProperty,Zy=(e,t)=>Xy(e,`name`,{value:t,configurable:!0}),Qy=m.createContext(void 0);function $y(e){let t=m.useContext(Qy);return e||t||`ltr`}Zy($y,`useDirection`);var eb=Object.defineProperty,tb=(e,t)=>eb(e,`name`,{value:t,configurable:!0});function nb(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}tb(nb,`useCallbackRef`);var rb=Object.defineProperty,ib=(e,t)=>rb(e,`name`,{value:t,configurable:!0}),ab=`dismissableLayer.update`,ob=`dismissableLayer.pointerDownOutside`,sb=`dismissableLayer.focusOutside`,cb,lb=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),ub=m.forwardRef(ib(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=m.useContext(lb),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=Tv(t,f),_=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?_.indexOf(v):-1,b=d?_.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=m.useRef(!1),w=pb(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:m.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=mb(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===_.length-1:!1,D=nb(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cb=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hb(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=cb))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hb())},[d,u]),m.useEffect(()=>{let e=ib(()=>h({}),`handleUpdate`);return document.addEventListener(ab,e),()=>document.removeEventListener(ab,e)},[]),(0,R.jsx)(Gv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:J(e.onFocusCapture,T.onFocusCapture),onBlurCapture:J(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:J(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function db(){let e=m.useContext(lb),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ib(db,`useDismissableLayerSurface`);var fb=ib(()=>!0,`IS_TRUE`);function pb(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=fb}=t,s=nb(e),c=m.useRef(!1),l=m.useRef(!1),u=m.useRef(new Map),d=m.useRef(()=>{});return m.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}ib(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}ib(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}ib(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}ib(p,`handleInteractionBubble`);let m=ib(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||gb(ob,s,p,{discrete:!0})};if(ib(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:ib(()=>c.current=!0,`onPointerDownCapture`)}}ib(pb,`usePointerDownOutside`);function mb(e,t=globalThis?.document){let n=nb(e),r=m.useRef(!1);return m.useEffect(()=>{let e=ib(e=>{e.target&&!r.current&&gb(sb,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:ib(()=>r.current=!0,`onFocusCapture`),onBlurCapture:ib(()=>r.current=!1,`onBlurCapture`)}}ib(mb,`useFocusOutside`);function hb(){let e=new CustomEvent(ab);document.dispatchEvent(e)}ib(hb,`dispatchUpdate`);function gb(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?Kv(i,a):i.dispatchEvent(a)}ib(gb,`handleAndDispatchCustomEvent`);var _b=Object.defineProperty,vb=(e,t)=>_b(e,`name`,{value:t,configurable:!0}),yb=`focusScope.autoFocusOnMount`,bb=`focusScope.autoFocusOnUnmount`,xb={bubbles:!1,cancelable:!0},Sb=m.forwardRef(vb(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=nb(i),u=nb(a),d=m.useRef(null),f=Tv(t,c),p=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:kb(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||kb(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&kb(s)};vb(e,`handleFocusIn`),vb(t,`handleFocusOut`),vb(n,`handleMutations`),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]),m.useEffect(()=>{if(s){Ab.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(yb,xb);s.addEventListener(yb,l),s.dispatchEvent(t),t.defaultPrevented||(Cb(Nb(Tb(s)),{select:!0}),document.activeElement===e&&kb(s))}return()=>{s.removeEventListener(yb,l),setTimeout(()=>{let t=new CustomEvent(bb,xb);s.addEventListener(bb,u),s.dispatchEvent(t),t.defaultPrevented||kb(e??document.body,{select:!0}),s.removeEventListener(bb,u),Ab.remove(p)},0)}}},[s,l,u,p]);let h=m.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]=wb(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&kb(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&kb(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,R.jsx)(Gv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Cb(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(kb(r,{select:t}),document.activeElement!==n)return}vb(Cb,`focusFirst`);function wb(e){let t=Tb(e);return[Eb(t,e),Eb(t.reverse(),e)]}vb(wb,`getTabbableEdges`);function Tb(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vb(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},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}vb(Tb,`getTabbableCandidates`);function Eb(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Db(r,{upTo:t})))return r}vb(Eb,`findVisible`);function Db(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}vb(Db,`isHidden`);function Ob(e){return e instanceof HTMLInputElement&&`select`in e}vb(Ob,`isSelectableInput`);function kb(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Ob(e)&&t&&e.select()}}vb(kb,`focus`);var Ab=jb();function jb(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Mb(e,t),e.unshift(t)},remove(t){e=Mb(e,t),e[0]?.resume()}}}vb(jb,`createFocusScopesStack`);function Mb(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}vb(Mb,`arrayRemove`);function Nb(e){return e.filter(e=>e.tagName!==`A`)}vb(Nb,`removeLinks`);var Pb=Object.defineProperty,Fb=m.forwardRef(((e,t)=>Pb(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Sy(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Hv.createPortal((0,R.jsx)(Gv.div,{...r,ref:t}),o):null},`Portal`)),Ib=Object.defineProperty,Lb=(e,t)=>Ib(e,`name`,{value:t,configurable:!0}),Rb=0,zb=null;function Bb(e){return Vb(),e.children}Lb(Bb,`FocusGuards`);function Vb(){m.useEffect(()=>{zb||={start:Hb(),end:Hb()};let{start:e,end:t}=zb;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Rb++,()=>{Rb===1&&(zb?.start.remove(),zb?.end.remove(),zb=null),Rb=Math.max(0,Rb-1)}},[])}Lb(Vb,`useFocusGuards`);function Hb(){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}Lb(Hb,`createFocusGuard`);var Ub=function(){return Ub=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},Ub.apply(this,arguments)};function Wb(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 Gb(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 Kb=`right-scroll-bar-position`,qb=`width-before-scroll-bar`,Jb=`with-scroll-bars-hidden`,Yb=`--removed-body-scroll-bar-size`;function Xb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zb(e,t){var n=(0,m.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 Qb=typeof window<`u`?m.useLayoutEffect:m.useEffect,$b=new WeakMap;function ex(e,t){var n=Zb(t||null,function(t){return e.forEach(function(e){return Xb(e,t)})});return Qb(function(){var t=$b.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xb(e,null)}),i.forEach(function(e){r.has(e)||Xb(e,a)})}$b.set(n,e)},[e]),n}function tx(e){return e}function nx(e,t){t===void 0&&(t=tx);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 rx(e){e===void 0&&(e={});var t=nx(null);return t.options=Ub({async:!0,ssr:!1},e),t}var ix=function(e){var t=e.sideCar,n=Wb(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 m.createElement(r,Ub({},n))};ix.isSideCarExport=!0;function ax(e,t){return e.useMedium(t),ix}var ox=rx(),sx=function(){},cx=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:sx,onWheelCapture:sx,onTouchMoveCapture:sx}),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,h=e.noIsolation,g=e.inert,_=e.allowPinchZoom,v=e.as,y=v===void 0?`div`:v,b=e.gapMode,x=Wb(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=ex([n,t]),w=Ub(Ub({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:ox,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),Ub(Ub({},w),{ref:C})):m.createElement(y,Ub({},w,{className:c,ref:C}),s))});cx.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cx.classNames={fullWidth:qb,zeroRight:Kb};var lx=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ux(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lx();return t&&e.setAttribute(`nonce`,t),e}function dx(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fx(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var px=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ux())&&(dx(t,n),fx(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mx=function(){var e=px();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hx=function(){var e=mx();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gx={left:0,top:0,right:0,gap:0},_x=function(e){return parseInt(e||``,10)||0},vx=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[_x(n),_x(r),_x(i)]},yx=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gx;var t=vx(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])}},bx=hx(),xx=`data-scroll-locked`,Sx=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
19
19
  .${Jb} {
20
20
  overflow: hidden ${r};
21
21
  padding-right: ${s}px ${r};
@@ -55,7 +55,7 @@ Error generating stack: `+e.message+`
55
55
  `},Cx=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},wx=function(){m.useEffect(function(){return document.body.setAttribute(xx,(Cx()+1).toString()),function(){var e=Cx()-1;e<=0?document.body.removeAttribute(xx):document.body.setAttribute(xx,e.toString())}},[])},Tx=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;wx();var a=m.useMemo(function(){return yx(i)},[i]);return m.createElement(bx,{styles:Sx(a,!t,i,n?``:`!important`)})},Ex=!1;if(typeof window<`u`)try{var Dx=Object.defineProperty({},"passive",{get:function(){return Ex=!0,!0}});window.addEventListener(`test`,Dx,Dx),window.removeEventListener(`test`,Dx,Dx)}catch{Ex=!1}var Ox=Ex?{passive:!1}:!1,kx=function(e){return e.tagName===`TEXTAREA`},Ax=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!kx(e)&&n[t]===`visible`)},jx=function(e){return Ax(e,`overflowY`)},Mx=function(e){return Ax(e,`overflowX`)},Nx=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ix(e,r)){var i=Lx(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Px=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},Fx=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ix=function(e,t){return e===`v`?jx(t):Mx(t)},Lx=function(e,t){return e===`v`?Px(t):Fx(t)},Rx=function(e,t){return e===`h`&&t===`rtl`?-1:1},zx=function(e,t,n,r,i){var a=Rx(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Lx(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ix(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},Bx=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Vx=function(e){return[e.deltaX,e.deltaY]},Hx=function(e){return e&&`current`in e?e.current:e},Ux=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Wx=function(e){return`
56
56
  .block-interactivity-${e} {pointer-events: none;}
57
57
  .allow-interactivity-${e} {pointer-events: all;}
58
- `},Gx=0,Kx=[];function qx(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Gx++)[0],a=m.useState(hx)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Gb([e.lockRef.current],(e.shards||[]).map(Hx),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Nx(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nx(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zx(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(Kx.length&&Kx[Kx.length-1]===a){var r=`deltaY`in n?Vx(n):Bx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ux(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hx).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Jx(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=Bx(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,Vx(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Bx(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return Kx.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ox),document.addEventListener(`touchmove`,c,Ox),document.addEventListener(`touchstart`,u,Ox),function(){Kx=Kx.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ox),document.removeEventListener(`touchmove`,c,Ox),document.removeEventListener(`touchstart`,u,Ox)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Wx(i)}):null,p?m.createElement(Tx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yx=ax(ox,qx),Xx=m.forwardRef(function(e,t){return m.createElement(cx,Ub({},e,{ref:t,sideCar:Yx}))});Xx.classNames=cx.classNames;var Zx=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qx=new WeakMap,$x=new WeakMap,eS={},tS=0,nS=function(e){return e&&(e.host||nS(e.parentNode))},rS=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nS(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},iS=function(e,t,n,r){var i=rS(t,Array.isArray(e)?e:[e]);eS[n]||(eS[n]=new WeakMap);var a=eS[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Qx.get(e)||0)+1,l=(a.get(e)||0)+1;Qx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$x.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tS++,function(){o.forEach(function(e){var t=Qx.get(e)-1,i=a.get(e)-1;Qx.set(e,t),a.set(e,i),t||($x.has(e)||e.removeAttribute(r),$x.delete(e)),i||e.removeAttribute(n)}),tS--,tS||(Qx=new WeakMap,Qx=new WeakMap,$x=new WeakMap,eS={})}},aS=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zx(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),iS(r,i,n,`aria-hidden`)):function(){return null}},oS=Object.defineProperty,sS=(e,t)=>oS(e,`name`,{value:t,configurable:!0}),cS=`Dialog`,[lS,uS]=ey(cS),[dS,fS]=lS(cS),pS=sS(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:cS}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,R.jsx)(dS,{scope:t,triggerRef:s,contentRef:c,contentId:Yy(),titleId:Yy(),descriptionId:Yy(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),mS=`DialogTrigger`,hS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(mS,n),a=Tv(t,i.triggerRef);return(0,R.jsx)(Gv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":FS(i.open),...r,ref:a,onClick:J(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),gS=`DialogPortal`,[_S,vS]=lS(gS,{forceMount:void 0}),yS=sS(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fS(gS,t);return(0,R.jsx)(_S,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),bS=`DialogOverlay`,xS=m.forwardRef(sS(function(e,t){let n=vS(bS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fS(bS,e.__scopeDialog);return a.modal?(0,R.jsx)(zy,{present:r||a.open,children:(0,R.jsx)(CS,{...i,ref:t})}):null},`DialogOverlay`)),SS=Ov(`DialogOverlay.RemoveScroll`),CS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(bS,n),a=Tv(t,db());return(0,R.jsx)(Xx,{as:SS,allowPinchZoom:!0,shards:[i.contentRef],children:(0,R.jsx)(Gv.div,{"data-state":FS(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),wS=`DialogContent`,TS=m.forwardRef(sS(function(e,t){let n=vS(wS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fS(wS,e.__scopeDialog);return(0,R.jsx)(zy,{present:r||a.open,children:a.modal?(0,R.jsx)(ES,{...i,ref:t}):(0,R.jsx)(DS,{...i,ref:t})})},`DialogContent`)),ES=m.forwardRef(sS(function(e,t){let n=fS(wS,e.__scopeDialog),r=m.useRef(null),i=Tv(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return aS(e)},[]),(0,R.jsx)(OS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),DS=m.forwardRef(sS(function(e,t){let n=fS(wS,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,R.jsx)(OS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),OS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=fS(wS,n);return Vb(),(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(ub,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":FS(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),kS=`DialogTitle`,AS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(kS,n),{setTitleCount:a}=i;return Sy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Gv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),jS=`DialogDescription`,MS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(jS,n),{setDescriptionCount:a}=i;return Sy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Gv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),NS=`DialogClose`,PS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(NS,n);return(0,R.jsx)(Gv.button,{type:`button`,...r,ref:t,onClick:J(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function FS(e){return e?`open`:`closed`}sS(FS,`getState`);var IS=Object.defineProperty,LS=(e,t)=>IS(e,`name`,{value:t,configurable:!0}),[RS,zS]=ey(`AlertDialog`,[uS]),BS=uS(),VS=LS(e=>{let{__scopeAlertDialog:t,...n}=e,r=BS(t);return(0,R.jsx)(pS,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(hS,{...i,...r,ref:t})},`AlertDialogTrigger`));var HS=LS(e=>{let{__scopeAlertDialog:t,...n}=e,r=BS(t);return(0,R.jsx)(yS,{...r,...n})},`AlertDialogPortal`),US=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(xS,{...i,...r,ref:t})},`AlertDialogOverlay`)),[WS,GS]=RS(`AlertDialogContent`),KS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=BS(n),o=Tv(t,m.useRef(null)),s=m.useRef(null);return(0,R.jsx)(WS,{scope:n,cancelRef:s,children:(0,R.jsx)(TS,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:J(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),qS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(AS,{...i,...r,ref:t})},`AlertDialogTitle`)),JS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(MS,{...i,...r,ref:t})},`AlertDialogDescription`)),YS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(PS,{...i,...r,ref:t})},`AlertDialogAction`)),XS=`AlertDialogCancel`,ZS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=GS(XS,n),a=BS(n),o=Tv(t,i);return(0,R.jsx)(PS,{...a,...r,ref:o})},`AlertDialogCancel`)),QS=VS,$S=HS,eC=US,tC=KS,nC=YS,rC=ZS,iC=qS,aC=JS,oC=Object.defineProperty,sC=(e,t)=>oC(e,`name`,{value:t,configurable:!0});function cC(e){let[t,n]=m.useState(void 0);return Sy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}sC(cC,`useSize`);var lC=Object.defineProperty,uC=(e,t)=>lC(e,`name`,{value:t,configurable:!0}),dC=`Checkbox`,[fC,pC]=ey(dC),[mC,hC]=fC(dC);function gC(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=jy({prop:n,defaultProp:i??!1,onChange:c,caller:dC}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!TC(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,R.jsx)(mC,{scope:t,...C,children:wC(d)?d(C):r})}uC(gC,`CheckboxProvider`);var _C=`CheckboxTrigger`,vC=m.forwardRef(uC(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=hC(_C,e),_=Tv(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=uC(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,R.jsx)(Gv.button,{type:`button`,role:`checkbox`,"aria-checked":TC(c)?`mixed`:c,"aria-required":l,"data-state":EC(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:J(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:J(n,e=>{p(),d(e=>TC(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),yC=m.forwardRef(uC(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,R.jsx)(gC,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(vC,{...d,ref:t,__scopeCheckbox:n}),e&&(0,R.jsx)(CC,{__scopeCheckbox:n})]})})},`Checkbox`)),bC=`CheckboxIndicator`,xC=m.forwardRef(uC(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=hC(bC,n);return(0,R.jsx)(zy,{present:r||TC(a.checked)||a.checked===!0,children:(0,R.jsx)(Gv.span,{"data-state":EC(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),SC=`CheckboxBubbleInput`,CC=m.forwardRef(uC(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=hC(SC,e),_=Tv(r,g),v=cC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=TC(s),n.call(e,!TC(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!TC(s)&&s);return(0,R.jsx)(Gv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function wC(e){return typeof e==`function`}uC(wC,`isFunction`);function TC(e){return e===`indeterminate`}uC(TC,`isIndeterminate`);function EC(e){return TC(e)?`indeterminate`:e?`checked`:`unchecked`}uC(EC,`getState`);var DC=[`top`,`right`,`bottom`,`left`],OC=Math.min,kC=Math.max,AC=Math.round,jC=Math.floor,MC=e=>({x:e,y:e}),NC={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function PC(e,t,n){return kC(e,OC(t,n))}function FC(e,t){return typeof e==`function`?e(t):e}function IC(e){return e.split(`-`)[0]}function LC(e){return e.split(`-`)[1]}function RC(e){return e===`x`?`y`:`x`}function zC(e){return e===`y`?`height`:`width`}function BC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function VC(e){return RC(BC(e))}function HC(e,t,n){n===void 0&&(n=!1);let r=LC(e),i=VC(e),a=zC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ZC(o)),[o,ZC(o)]}function UC(e){let t=ZC(e);return[WC(e),t,WC(t)]}function WC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var GC=[`left`,`right`],KC=[`right`,`left`],qC=[`top`,`bottom`],JC=[`bottom`,`top`];function YC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?KC:GC:t?GC:KC;case`left`:case`right`:return t?qC:JC;default:return[]}}function XC(e,t,n,r){let i=LC(e),a=YC(IC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(WC)))),a}function ZC(e){let t=IC(e);return NC[t]+e.slice(t.length)}function QC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function $C(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:QC(e)}function ew(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tw(e,t,n){let{reference:r,floating:i}=e,a=BC(t),o=VC(t),s=zC(o),c=IC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=LC(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nw(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=FC(t,e),p=$C(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ew(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ew(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var rw=50,iw=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nw},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tw(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<rw&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=tw(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},aw=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=FC(e,t)||{};if(l==null)return{};let d=$C(u),f={x:n,y:r},p=VC(i),m=zC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=OC(d[_],T),D=OC(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=PC(E,k,O),ee=!c.arrow&&LC(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=ee?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:A,centerOffset:k-A-j,...ee&&{alignmentOffset:j}},reset:ee}}}),ow=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=FC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=IC(r),_=BC(o),v=IC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ZC(o)]:UC(o)),x=p!==`none`;!d&&x&&b.push(...XC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=HC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===BC(t)||T.every(e=>BC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=BC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function sw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cw(e){return DC.some(t=>e[t]>=0)}var lw=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=FC(e,t);switch(i){case`referenceHidden`:{let e=sw(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cw(e)}}}case`escaped`:{let e=sw(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cw(e)}}}default:return{}}}}},uw=new Set([`left`,`top`]);async function dw(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=IC(n),s=LC(n),c=BC(n)===`y`,l=uw.has(o)?-1:1,u=a&&c?-1:1,d=FC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fw=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await dw(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pw=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=FC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=BC(i),p=RC(f),m=u[p],h=u[f],g=(e,t)=>PC(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},mw=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=FC(e,t),u={x:n,y:r},d=BC(i),f=RC(d),p=u[f],m=u[d],h=FC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=uw.has(IC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hw=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=FC(e,t),c=await i.detectOverflow(t,s),l=IC(n),u=LC(n),d=BC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=OC(p-c[m],g),y=OC(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*kC(c.left,c.right):S=p-2*kC(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gw(){return typeof window<`u`}function _w(e){return bw(e)?(e.nodeName||``).toLowerCase():`#document`}function vw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yw(e){return((bw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bw(e){return gw()?e instanceof Node||e instanceof vw(e).Node:!1}function xw(e){return gw()?e instanceof Element||e instanceof vw(e).Element:!1}function Sw(e){return gw()?e instanceof HTMLElement||e instanceof vw(e).HTMLElement:!1}function Cw(e){return!gw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof vw(e).ShadowRoot}function ww(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Fw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Tw(e){return/^(table|td|th)$/.test(_w(e))}function Ew(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Dw=/transform|translate|scale|rotate|perspective|filter/,Ow=/paint|layout|strict|content/,kw=e=>!!e&&e!==`none`,Aw;function jw(e){let t=xw(e)?Fw(e):e;return kw(t.transform)||kw(t.translate)||kw(t.scale)||kw(t.rotate)||kw(t.perspective)||!Nw()&&(kw(t.backdropFilter)||kw(t.filter))||Dw.test(t.willChange||``)||Ow.test(t.contain||``)}function Mw(e){let t=Lw(e);for(;Sw(t)&&!Pw(t);){if(jw(t))return t;if(Ew(t))return null;t=Lw(t)}return null}function Nw(){return Aw??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Aw}function Pw(e){return/^(html|body|#document)$/.test(_w(e))}function Fw(e){return vw(e).getComputedStyle(e)}function Iw(e){return xw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lw(e){if(_w(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Cw(e)&&e.host||yw(e);return Cw(t)?t.host:t}function Rw(e){let t=Lw(e);return Pw(t)?(e.ownerDocument||e).body:Sw(t)&&ww(t)?t:Rw(t)}function zw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Rw(e),i=r===e.ownerDocument?.body,a=vw(r);if(i){let e=Bw(a);return t.concat(a,a.visualViewport||[],ww(r)?r:[],e&&n?zw(e):[])}return t.concat(r,zw(r,[],n))}function Bw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vw(e){let t=Fw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Sw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=AC(n)!==a||AC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hw(e){return xw(e)?e:e.contextElement}function Uw(e){let t=Hw(e);if(!Sw(t))return MC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Vw(t),o=(a?AC(n.width):n.width)/r,s=(a?AC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ww=MC(0);function Gw(e){let t=vw(e);return!Nw()||!t.visualViewport?Ww:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vw(e)}function qw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Hw(e),o=MC(1);t&&(r?xw(r)&&(o=Uw(r)):o=Uw(e));let s=Kw(a,n,r)?Gw(a):MC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=vw(a),t=xw(r)?vw(r):r,n=e,i=Bw(n);for(;i&&t!==n;){let e=Uw(i),t=i.getBoundingClientRect(),r=Fw(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=vw(i),i=Bw(n)}}return ew({width:u,height:d,x:c,y:l})}function Jw(e,t){let n=Iw(e).scrollLeft;return t?t.left+n:qw(yw(e)).left+n}function Yw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Jw(e,n),y:n.top+t.scrollTop}}function Xw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yw(r),s=t?Ew(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=MC(1),u=MC(0),d=Sw(r);if((d||!a)&&((_w(r)!==`body`||ww(o))&&(c=Iw(r)),d)){let e=qw(r);l=Uw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Yw(o,c):MC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Zw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Qw(e){let t=Iw(e),n=e.ownerDocument.body,r=kC(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=kC(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Jw(e),o=-t.scrollTop;return Fw(n).direction===`rtl`&&(a+=kC(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $w=25;function eT(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=vw(e),a=yw(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Nw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Jw(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=$w&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tT(e,t){let n=qw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Uw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nT(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=eT(e,n,t);else if(t===`document`)r=Qw(yw(e));else if(xw(t))r=tT(t,n);else{let n=Gw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ew(r)}function rT(e,t){let n=t.get(e);if(n)return n;let r=zw(e,[],!1).filter(e=>xw(e)&&_w(e)!==`body`),i=null,a=Fw(e).position===`fixed`,o=a?Lw(e):e;for(;xw(o)&&!Pw(o);){let e=Fw(o),t=jw(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Lw(o)}return t.set(e,r),r}function iT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ew(t)?[]:rT(t,this._c):[].concat(n),r],o=nT(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=nT(t,a[e],i);s=kC(n.top,s),c=OC(n.right,c),l=OC(n.bottom,l),u=kC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function aT(e){let{width:t,height:n}=Vw(e);return{width:t,height:n}}function oT(e,t,n){let r=Sw(t),i=yw(t),a=n===`fixed`,o=qw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=MC(0);if((r||!a)&&((_w(t)!==`body`||ww(i))&&(s=Iw(t)),r)){let e=qw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Jw(i));let l=i&&!r&&!a?Yw(i,s):MC(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function sT(e){return Fw(e).position===`static`}function cT(e,t){if(!Sw(e)||Fw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return yw(e)===n&&(n=n.ownerDocument.body),n}function lT(e,t){let n=vw(e);if(Ew(e))return n;if(!Sw(e)){let t=Lw(e);for(;t&&!Pw(t);){if(xw(t)&&!sT(t))return t;t=Lw(t)}return n}let r=cT(e,t);for(;r&&Tw(r)&&sT(r);)r=cT(r,t);return r&&Pw(r)&&sT(r)&&!jw(r)?n:r||Mw(e)||n}var uT=async function(e){let t=this.getOffsetParent||lT,n=this.getDimensions,r=await n(e.floating);return{reference:oT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dT(e){return Fw(e).direction===`rtl`}var fT={convertOffsetParentRelativeRectToViewportRelativeRect:Xw,getDocumentElement:yw,getClippingRect:iT,getOffsetParent:lT,getElementRects:uT,getClientRects:Zw,getDimensions:aT,getScale:Uw,isElement:xw,isRTL:dT};function pT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mT(e,t,n){let r=null,i,a=yw(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=jC(d),h=jC(a.clientWidth-(u+f)),g=jC(a.clientHeight-(d+p)),_=jC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:kC(0,OC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!pT(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=vw(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hT(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Hw(e),u=i||a?[...l?zw(l):[],...t?zw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?mT(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?qw(e):null;c&&g();function g(){let t=qw(e);h&&!pT(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gT=fw,_T=pw,vT=ow,yT=hw,bT=lw,xT=aw,ST=mw,CT=(e,t,n)=>{let r=new Map,i=n??{},a={...fT,...i.platform,_c:r};return iw(e,t,{...i,platform:a})},wT=typeof document<`u`?m.useLayoutEffect:function(){};function TT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!TT(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!TT(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ET(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function DT(e,t){let n=ET(e);return Math.round(t*n)/n}function OT(e){let t=m.useRef(e);return wT(()=>{t.current=e}),t}function kT(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);TT(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=OT(c),O=OT(i),k=OT(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),CT(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};ee.current&&!TT(T.current,t)&&(T.current=t,Hv.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);wT(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=m.useRef(!1);wT(()=>(ee.current=!0,()=>{ee.current=!1}),[]),wT(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=m.useMemo(()=>({reference:x,floating:S}),[x,S]),te=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=DT(M.floating,u.x),r=DT(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ET(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:j,elements:M,floatingStyles:te}),[u,A,j,M,te])}var AT=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:xT({element:r.current,padding:i}).fn(n):r?xT({element:r,padding:i}).fn(n):{}}}},jT=(e,t)=>{let n=gT(e);return{name:n.name,fn:n.fn,options:[e,t]}},MT=(e,t)=>{let n=_T(e);return{name:n.name,fn:n.fn,options:[e,t]}},NT=(e,t)=>({fn:ST(e).fn,options:[e,t]}),PT=(e,t)=>{let n=vT(e);return{name:n.name,fn:n.fn,options:[e,t]}},FT=(e,t)=>{let n=yT(e);return{name:n.name,fn:n.fn,options:[e,t]}},IT=(e,t)=>{let n=bT(e);return{name:n.name,fn:n.fn,options:[e,t]}},LT=(e,t)=>{let n=AT(e);return{name:n.name,fn:n.fn,options:[e,t]}},RT=Object.defineProperty,zT=m.forwardRef(((e,t)=>RT(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Gv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),BT=Object.defineProperty,VT=(e,t)=>BT(e,`name`,{value:t,configurable:!0}),HT=`Popper`,[UT,WT]=ey(HT),[GT,KT]=UT(HT),qT=VT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,R.jsx)(GT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),JT=`PopperAnchor`,YT=m.forwardRef(VT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=KT(JT,n),o=m.useRef(null),s=a.onAnchorChange,c=Tv(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&aE(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Gv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),XT=`PopperContent`,[ZT,QT]=UT(XT),$T=m.forwardRef(VT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=KT(XT,n),[v,y]=m.useState(null),b=Tv(t,y),[x,S]=m.useState(null),C=cC(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(rE),altBoundary:k},{refs:ee,floatingStyles:j,placement:M,isPositioned:te,middlewareData:ne}=kT({strategy:`fixed`,placement:E,whileElementsMounted:VT((...e)=>hT(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[jT({mainAxis:i+T,alignmentAxis:o}),c&&MT({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?NT():void 0,...A}),c&&PT({...A}),FT({...A,apply:VT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&LT({element:x,padding:s}),iE({arrowWidth:w,arrowHeight:T}),f&&IT({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),N=_.setPlacementState;Sy(()=>(N(M),()=>{N(void 0)}),[M,N]);let[re,ie]=aE(M),ae=nb(h);Sy(()=>{te&&ae?.()},[te,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=m.useState();return Sy(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:te?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(ZT,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:S,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,R.jsx)(Gv.div,{"data-side":re,"data-align":ie,...g,ref:b,style:{...g.style,animation:te?g.style?.animation:`none`}})})})},`PopperContent`)),eE=`PopperArrow`,tE={top:`bottom`,right:`left`,bottom:`top`,left:`right`},nE=m.forwardRef(VT(function(e,t){let{__scopePopper:n,...r}=e,i=QT(eE,n),a=tE[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(zT,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function rE(e){return e!==null}VT(rE,`isNotNull`);var iE=VT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=aE(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function aE(e){let[t,n=`center`]=e.split(`-`);return[t,n]}VT(aE,`getSideAndAlignFromPlacement`);var oE=qT,sE=YT,cE=$T,lE=nE,uE=Object.defineProperty,dE=(e,t)=>uE(e,`name`,{value:t,configurable:!0}),fE=!1;function pE(){let[e,t]=m.useState(fE);return m.useEffect(()=>{fE||(fE=!0,t(!0))},[]),e}dE(pE,`useIsHydrated`);var mE=m.useSyncExternalStore;function hE(){return()=>{}}dE(hE,`subscribe`);function gE(){return mE(hE,()=>!0,()=>!1)}dE(gE,`useIsHydratedModern`);var _E=typeof mE==`function`?gE:pE,vE=Object.defineProperty,yE=(e,t)=>vE(e,`name`,{value:t,configurable:!0}),bE=`rovingFocusGroup.onEntryFocus`,xE={bubbles:!1,cancelable:!0},SE=`RovingFocusGroup`,[CE,wE,TE]=iy(SE),[EE,DE]=ey(SE,[TE]),[OE,kE]=EE(SE),AE=m.forwardRef(yE(function(e,t){return(0,R.jsx)(CE.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(CE.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(jE,{...e,ref:t})})})},`RovingFocusGroup`)),jE=m.forwardRef(yE(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=Tv(t,f),h=$y(a),[g,_]=jy({prop:o,defaultProp:s??null,onChange:c,caller:SE}),[v,y]=m.useState(!1),b=nb(l),x=wE(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(bE,b),()=>e.removeEventListener(bE,b)},[b]),(0,R.jsx)(OE,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(Gv.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:J(e.onMouseDown,()=>{S.current=!0}),onFocus:J(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(bE,xE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);LE([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:J(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),ME=`RovingFocusGroupItem`,NE=m.forwardRef(yE(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Yy(),l=a||c,u=kE(ME,n),d=u.currentTabStopId===l,f=wE(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u,_=_E();return Sy(()=>{if(_&&r)return p(),()=>h()},[_,r,p,h]),m.useEffect(()=>{if(!_&&r)return p(),()=>h()},[_,r,p,h]),(0,R.jsx)(CE.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Gv.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:J(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:J(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=IE(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?RE(n,r+1):n.slice(r+1)}setTimeout(()=>LE(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),PE={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function FE(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}yE(FE,`getDirectionAwareKey`);function IE(e,t,n){let r=FE(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return PE[r]}yE(IE,`getFocusIntent`);function LE(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}yE(LE,`focusFirst`);function RE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}yE(RE,`wrapArray`);var zE=AE,BE=NE,VE=Object.defineProperty,HE=(e,t)=>VE(e,`name`,{value:t,configurable:!0});function UE(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}HE(UE,`usePrevious`);var WE=Object.defineProperty,GE=(e,t)=>WE(e,`name`,{value:t,configurable:!0});function KE(e,[t,n]){return Math.min(n,Math.max(t,e))}GE(KE,`clamp`);var qE=Object.defineProperty,JE=(e,t)=>qE(e,`name`,{value:t,configurable:!0}),YE=`Popover`,[XE,ZE]=ey(YE,[WT]),QE=WT(),[$E,eD]=XE(YE),tD=JE(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=QE(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:YE});return(0,R.jsx)(oE,{...s,children:(0,R.jsx)($E,{scope:t,contentId:Yy(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),nD=`PopoverTrigger`,rD=m.forwardRef(JE(function(e,t){let{__scopePopover:n,...r}=e,i=eD(nD,n),a=QE(n),o=Tv(t,i.triggerRef),s=(0,R.jsx)(Gv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":mD(i.open),...r,ref:o,onClick:J(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(sE,{asChild:!0,...a,children:s})},`PopoverTrigger`)),iD=`PopoverPortal`,[aD,oD]=XE(iD,{forceMount:void 0}),sD=JE(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=eD(iD,t);return(0,R.jsx)(aD,{scope:t,forceMount:n,children:(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),cD=`PopoverContent`,lD=m.forwardRef(JE(function(e,t){let n=oD(cD,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=eD(cD,e.__scopePopover);return(0,R.jsx)(zy,{present:r||a.open,children:a.modal?(0,R.jsx)(dD,{...i,ref:t}):(0,R.jsx)(fD,{...i,ref:t})})},`PopoverContent`)),uD=Ov(`PopoverContent.RemoveScroll`),dD=m.forwardRef(JE(function(e,t){let n=eD(cD,e.__scopePopover),r=m.useRef(null),i=Tv(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return aS(e)},[]),(0,R.jsx)(Xx,{as:uD,allowPinchZoom:!0,children:(0,R.jsx)(pD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),fD=m.forwardRef(JE(function(e,t){let n=eD(cD,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,R.jsx)(pD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),pD=m.forwardRef(JE(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=eD(cD,n),p=QE(n);return Vb(),(0,R.jsx)(Sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(cE,{"data-state":mD(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function mD(e){return e?`open`:`closed`}JE(mD,`getState`);var hD=tD,gD=rD,_D=sD,vD=lD,yD=Object.defineProperty,bD=(e,t)=>yD(e,`name`,{value:t,configurable:!0}),xD=[` `,`Enter`,`ArrowUp`,`ArrowDown`],SD=[` `,`Enter`],CD=`Select`,[wD,TD,ED]=iy(CD),[DD,OD]=ey(CD,[ED,WT]),kD=WT(),[AD,jD]=DD(CD),[MD,ND]=DD(CD);function PD(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:g}=e,_=kD(t),[v,y]=m.useState(null),[b,x]=m.useState(null),[S,C]=m.useState(!1),w=$y(l),[T,E]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:CD}),[D,O]=jy({prop:o,defaultProp:s,onChange:c,caller:CD}),k=m.useRef(null),A=m.useRef(D);m.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=bD(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,O]);let ee=!v||!!h||!!v.closest(`form`),[j,M]=m.useState(new Set),te=Yy(),ne=Array.from(j).map(e=>e.props.value).join(`;`),N=m.useCallback(e=>{M(t=>new Set(t).add(e))},[]),re=m.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:te,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:j,nativeSelectKey:ne,isFormControl:ee};return(0,R.jsx)(oE,{..._,children:(0,R.jsx)(AD,{scope:t,...ie,children:(0,R.jsx)(wD.Provider,{scope:t,children:(0,R.jsx)(MD,{scope:t,onNativeOptionAdd:N,onNativeOptionRemove:re,children:xO(g)?g(ie):n})})})})}bD(PD,`SelectProvider`);var FD=bD(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,R.jsx)(PD,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[n,e?(0,R.jsx)(bO,{__scopeSelect:t}):null]})})},`Select`),ID=`SelectTrigger`,LD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kD(n),o=jD(ID,n),s=o.disabled||r,c=Tv(t,o.onTriggerChange),l=TD(n),u=m.useRef(`touch`),[d,f,p]=CO(e=>{let t=l().filter(e=>!e.disabled),n=wO(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=bD(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,R.jsx)(sE,{asChild:!0,...a,children:(0,R.jsx)(Gv.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":SO(o.value)?``:void 0,...i,ref:c,onClick:J(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:J(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:J(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&xD.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),RD=`SelectValue`,zD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jD(RD,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Tv(t,c.onValueNodeChange);Sy(()=>{l(u)},[l,u]);let f=SO(c.value);return(0,R.jsx)(Gv.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,R.jsx)(m.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),BD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(Gv.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[VD,HD]=DD(`SelectPortal`,{forceMount:void 0}),UD=bD(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,R.jsx)(VD,{scope:e.__scopeSelect,forceMount:n,children:(0,R.jsx)(Fb,{asChild:!0,...r})})},`SelectPortal`),WD=`SelectContent`,GD=m.forwardRef(bD(function(e,t){let n=HD(WD,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jD(WD,e.__scopeSelect),[o,s]=m.useState();return Sy(()=>{s(new DocumentFragment)},[]),(0,R.jsx)(zy,{present:r||a.open,children:({present:e})=>e?(0,R.jsx)(ZD,{...i,ref:t}):(0,R.jsx)(KD,{...i,fragment:o})})},`SelectContent`)),KD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Hv.createPortal((0,R.jsx)(JD,{scope:n,children:(0,R.jsx)(wD.Slot,{scope:n,children:(0,R.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),qD=10,[JD,YD]=DD(WD),XD=Ov(`SelectContent.RemoveScroll`),ZD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=jD(WD,n),[b,x]=m.useState(null),[S,C]=m.useState(null),w=Tv(t,x),[T,E]=m.useState(null),[D,O]=m.useState(null),k=TD(n),[A,ee]=m.useState(!1),j=m.useRef(!1);m.useEffect(()=>{if(b)return aS(b)},[b]),Vb();let M=m.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),te=m.useCallback(()=>M([T,b]),[M,T,b]);m.useEffect(()=>{A&&te()},[A,te]);let{onOpenChange:ne,triggerPointerDownPosRef:N}=y;m.useEffect(()=>{if(b){let e={x:0,y:0},t=bD(t=>{e={x:Math.abs(Math.round(t.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(N.current?.y??0))}},`handlePointerMove`),n=bD(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ne(!1),document.removeEventListener(`pointermove`,t),N.current=null},`handlePointerUp`);return N.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,ne,N]),m.useEffect(()=>{let e=bD(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[re,ie]=CO(e=>{let t=k().filter(e=>!e.disabled),n=wO(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(j.current=!0))},[y.value]),oe=m.useCallback(()=>b?.focus(),[b]),se=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ce=r===`popper`?$D:QD,le=ce===$D?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return(0,R.jsx)(JD,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:te,selectedItemText:D,position:r,isPositioned:A,searchRef:re,children:(0,R.jsx)(Xx,{as:XD,allowPinchZoom:!0,children:(0,R.jsx)(Sb,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:J(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,R.jsx)(ce,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...le,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:J(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),QD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=jD(WD,n),o=YD(WD,n),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Tv(t,u),f=TD(n),p=m.useRef(!1),h=m.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=m.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qD,d=KE(a,[qD,Math.max(qD,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qD,d=KE(a,[qD,Math.max(qD,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-qD*2,u=g.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+h+u+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-qD,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+h+k,ee=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+g.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${qD}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,g,_,v,a.dir,r]);Sy(()=>b(),[b]);let[x,S]=m.useState();Sy(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=m.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]);return(0,R.jsx)(eO,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,R.jsx)(Gv.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),$D=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=qD,...a}=e,o=kD(n);return(0,R.jsx)(cE,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[eO,tO]=DD(WD,{}),nO=`SelectViewport`,rO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=YD(nO,n),o=tO(nO,n),s=Tv(t,a.onViewportChange),c=m.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(wD.Slot,{scope:n,children:(0,R.jsx)(Gv.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:J(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-qD*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[iO,aO]=DD(`SelectGroup`),oO=`SelectItem`,[sO,cO]=DD(oO),lO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jD(oO,n),c=YD(oO,n),l=s.value===r,[u,d]=m.useState(a??``),[f,p]=m.useState(!1),h=Tv(t,nb(e=>c.itemRefCallback?.(e,r,i))),g=Yy(),_=m.useRef(`touch`),v=bD(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,R.jsx)(sO,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:m.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(wD.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(Gv.div,{role:`option`,"aria-labelledby":g,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:J(o.onFocus,()=>p(!0)),onBlur:J(o.onBlur,()=>p(!1)),onClick:J(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:J(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:J(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:J(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:J(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(SD.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),uO=`SelectItemText`,dO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=jD(uO,n),s=YD(uO,n),c=cO(uO,n),l=ND(uO,n),[u,d]=m.useState(null),f=nb(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Tv(t,d,c.onItemTextChange,f),h=u?.textContent,g=m.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return Sy(()=>(_(g),()=>v(g)),[_,v,g]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gv.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!SO(o.value)?Hv.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),fO=`SelectItemIndicator`,pO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,...r}=e;return cO(fO,n).isSelected?(0,R.jsx)(Gv.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),mO=`SelectScrollUpButton`,hO=m.forwardRef(bD(function(e,t){let n=YD(mO,e.__scopeSelect),r=tO(mO,e.__scopeSelect),[i,a]=m.useState(!1),o=Tv(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};bD(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(vO,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),gO=`SelectScrollDownButton`,_O=m.forwardRef(bD(function(e,t){let n=YD(gO,e.__scopeSelect),r=tO(gO,e.__scopeSelect),[i,a]=m.useState(!1),o=Tv(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};bD(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(vO,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),vO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=YD(`SelectScrollButton`,n),o=m.useRef(null),s=TD(n),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Sy(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(Gv.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:J(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:J(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:J(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),yO=`SelectBubbleInput`,bO=m.forwardRef(bD(function({__scopeSelect:e,...t},n){let r=jD(yO,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=m.useRef(null),h=Tv(n,p),g=i??``,_=UE(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return m.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,R.jsxs)(Gv.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Yv,...t.style},ref:h,defaultValue:g,children:[SO(i)&&!v?(0,R.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function xO(e){return typeof e==`function`}bD(xO,`isFunction`);function SO(e){return e===``||e===void 0}bD(SO,`shouldShowPlaceholder`);function CO(e){let t=nb(e),n=m.useRef(``),r=m.useRef(0),i=m.useCallback(e=>{let i=n.current+e;t(i),bD((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=m.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}bD(CO,`useTypeaheadSearch`);function wO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=TO(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}bD(wO,`findNextItem`);function TO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}bD(TO,`wrapArray`);var EO=Object.defineProperty,DO=(e,t)=>EO(e,`name`,{value:t,configurable:!0}),OO=`Switch`,[kO,AO]=ey(OO),[jO,MO]=kO(OO);function NO(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=jy({prop:n,defaultProp:i??!1,onChange:c,caller:OO}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,R.jsx)(jO,{scope:t,...S,children:VO(d)?d(S):r})}DO(NO,`SwitchProvider`);var PO=`SwitchTrigger`,FO=m.forwardRef(DO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=MO(PO,e),_=Tv(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=DO(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,R.jsx)(Gv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":HO(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:J(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),IO=m.forwardRef(DO(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,R.jsx)(NO,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(FO,{...d,ref:t,__scopeSwitch:n}),e&&(0,R.jsx)(BO,{__scopeSwitch:n})]})})},`Switch`)),LO=`SwitchThumb`,RO=m.forwardRef(DO(function(e,t){let{__scopeSwitch:n,...r}=e,i=MO(LO,n);return(0,R.jsx)(Gv.span,{"data-state":HO(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),zO=`SwitchBubbleInput`,BO=m.forwardRef(DO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=MO(zO,e),_=Tv(r,g),v=cC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,R.jsx)(Gv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function VO(e){return typeof e==`function`}DO(VO,`isFunction`);function HO(e){return e?`checked`:`unchecked`}DO(HO,`getState`);var UO=Object.defineProperty,WO=(e,t)=>UO(e,`name`,{value:t,configurable:!0}),GO=`Tabs`,[KO,qO]=ey(GO,[DE]),JO=DE(),[YO,XO]=KO(GO),ZO=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=$y(s),[d,f]=jy({prop:r,onChange:i,defaultProp:a??``,caller:GO});return(0,R.jsx)(YO,{scope:n,baseId:Yy(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,R.jsx)(Gv.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),QO=`TabsList`,$O=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=XO(QO,n),o=JO(n);return(0,R.jsx)(zE,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,R.jsx)(Gv.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),ek=`TabsTrigger`,tk=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=XO(ek,n),s=JO(n),c=ik(o.baseId,r),l=ak(o.baseId,r),u=r===o.value;return(0,R.jsx)(BE,{asChild:!0,...s,focusable:!i,active:u,children:(0,R.jsx)(Gv.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:J(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:J(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:J(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),nk=`TabsContent`,rk=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=XO(nk,n),c=ik(s.baseId,r),l=ak(s.baseId,r),u=r===s.value,d=m.useRef(u);return m.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(zy,{present:i||u,children:({present:n})=>(0,R.jsx)(Gv.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ik(e,t){return`${e}-trigger-${t}`}WO(ik,`makeTriggerId`);function ak(e,t){return`${e}-content-${t}`}WO(ak,`makeContentId`);var ok=ZO,sk=$O,ck=tk,lk=rk,uk=Object.defineProperty,dk=(e,t)=>uk(e,`name`,{value:t,configurable:!0}),[fk,pk]=ey(`Tooltip`,[WT]),mk=WT(),hk=`TooltipProvider`,gk=700,_k=`tooltip.open`,[vk,yk]=fk(hk),bk=dk(e=>{let{__scopeTooltip:t,delayDuration:n=gk,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(vk,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xk=`Tooltip`,[Sk,Ck]=fk(xk),wk=dk(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=yk(xk,e.__scopeTooltip),l=mk(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=Yy(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=jy({prop:r,defaultProp:i??!1,onChange:dk(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_k))):c.onClose(),a?.(e)},`onChange`),caller:xk}),S=m.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);m.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=f??h;return(0,R.jsx)(oE,{...l,children:(0,R.jsx)(Sk,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:m.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Tk=`TooltipTrigger`,Ek=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,...r}=e,i=Ck(Tk,n),a=yk(Tk,n),o=mk(n),s=Tv(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(sE,{asChild:!0,...o,children:(0,R.jsx)(Gv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:J(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:J(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:J(e.onBlur,i.onClose),onClick:J(e.onClick,i.onClose)})})},`TooltipTrigger`)),Dk=`TooltipPortal`,[Ok,kk]=fk(Dk,{forceMount:void 0}),Ak=dk(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ck(Dk,t);return(0,R.jsx)(Ok,{scope:t,forceMount:n,children:(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jk=`TooltipContent`,Mk=m.forwardRef(dk(function(e,t){let n=kk(jk,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ck(jk,e.__scopeTooltip);return(0,R.jsx)(zy,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Fk,{side:i,...a,ref:t}):(0,R.jsx)(Nk,{side:i,...a,ref:t})})},`TooltipContent`)),Nk=m.forwardRef(dk(function(e,t){let n=Ck(jk,e.__scopeTooltip),r=yk(jk,e.__scopeTooltip),i=m.useRef(null),a=Tv(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Rk(r,Lk(r,n.getBoundingClientRect())),a=zk(t.getBoundingClientRect()),o=Vk([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=dk(e=>p(e,u),`handleTriggerLeave`),t=dk(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=dk(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Bk(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(Fk,{...e,ref:a})},`TooltipContentHoverable`)),Pk=jv(`TooltipContent`),Fk=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Ck(jk,n),u=mk(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(_k,d),()=>document.removeEventListener(_k,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=dk(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Sy(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(cE,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(Pk,{children:r}),i?(0,R.jsx)(Xv,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Ik=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,...r}=e,i=mk(n);return(0,R.jsx)(lE,{...i,...r,ref:t})},`TooltipArrow`));function Lk(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}dk(Lk,`getExitSideFromRect`);function Rk(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}dk(Rk,`getPaddedExitPoints`);function zk(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}dk(zk,`getPointsFromRect`);function Bk(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}dk(Bk,`isPointInPolygon`);function Vk(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Hk(t)}dk(Vk,`getHull`);function Hk(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}dk(Hk,`getHullPresorted`);var Uk=bk,Wk=wk,Gk=Ek,Kk=Ak,qk=Mk,Jk=Ik,Yk=Jg(`group/button motion-reduce:transition-none motion-reduce:active:translate-none inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-[0.8125rem] font-medium whitespace-nowrap transition-[transform,background-color,box-shadow,color,border-color,filter] duration-150 active:not-aria-[haspopup]:translate-y-px ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-raised btn-soft text-foreground`,outline:`btn-raised bg-card text-foreground`,secondary:`btn-raised bg-card text-secondary-foreground`,ghost:`btn-ghost text-foreground`,destructive:`btn-tint text-background [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?kv:`button`;return(0,R.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:q(Yk({variant:t,size:n,className:e})),...i})}var Xk=q(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[5px] border border-border bg-background px-1 font-sans text-[0.7rem] leading-none font-medium text-muted-foreground shadow-[inset_0_-1px_0_var(--border)] select-none`,`in-data-[slot=tooltip-content]:border-background/25 in-data-[slot=tooltip-content]:bg-transparent in-data-[slot=tooltip-content]:text-background in-data-[slot=tooltip-content]:shadow-none`,`in-data-[variant=default]:border-primary-foreground/35 in-data-[variant=default]:bg-primary-foreground/10 in-data-[variant=default]:text-primary-foreground in-data-[variant=default]:shadow-none`,`in-data-[variant=destructive]:border-background/40 in-data-[variant=destructive]:bg-background/10 in-data-[variant=destructive]:text-background in-data-[variant=destructive]:shadow-none`,`[&_svg:not([class*='size-'])]:size-3`);function Zk({className:e,...t}){return(0,R.jsx)(`kbd`,{"data-slot":`kbd`,className:q(Xk,e),...t})}function Qk({className:e,...t}){return(0,R.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var $k=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),eA={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},tA={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function nA(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return $k&&eA[t]?eA[t]:tA[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function rA({chord:e,className:t}){let n=nA(e);return(0,R.jsx)(Qk,{className:t,children:n.map((e,t)=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,R.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,R.jsx)(Zk,{children:e})]},t))})}function iA({chord:e,children:t,className:n}){return(0,R.jsxs)(`span`,{className:q(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,R.jsx)(rA,{chord:e}),t]})}function aA(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>fe.subscribe(t),[]),e}function oA(){return aA(),fe.status()}function sA(e){return aA(),fe.get(e)}function cA(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function lA(){return cA(`(max-width: 767.98px) and (orientation: landscape) and (max-height: 500px)`)}var uA={keyboardOpen:!1,keyboardInset:0},dA=`(max-width: 767.98px)`,fA=100,pA=new Set([`button`,`checkbox`,`color`,`date`,`datetime-local`,`file`,`hidden`,`image`,`month`,`radio`,`range`,`reset`,`submit`,`time`,`week`]);function mA(e){return typeof HTMLTextAreaElement<`u`&&e instanceof HTMLTextAreaElement}function hA(e){return typeof HTMLInputElement<`u`&&e instanceof HTMLInputElement}function gA(e){if(!(typeof HTMLElement<`u`&&e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.closest(`[contenteditable]`);return t!==null&&t.getAttribute(`contenteditable`)!==`false`}function _A(e){return mA(e)?!e.disabled&&!e.readOnly:hA(e)?!e.disabled&&!e.readOnly&&!pA.has(e.type):gA(e)}function vA(e,t){return Number.isFinite(e)&&e>0?e:t}function yA(){return vA(window.innerHeight,0)}function bA(e){let t=yA();return vA(e?.height??t,t)}function xA(e){return Math.max(yA(),bA(e))}function SA(e){return e?.matches??window.innerWidth<768}function CA(e,t,n){if(!e)return Math.max(0,n-t);let r=yA()||n,i=Number.isFinite(e.offsetTop)?Math.max(0,e.offsetTop):0;return Math.max(0,r-t-i)}function wA(e,t){return e.keyboardOpen===t.keyboardOpen&&e.keyboardInset===t.keyboardInset}function TA(e,t){e(e=>wA(e,t)?e:t)}function EA(){return{media:typeof window.matchMedia==`function`?window.matchMedia(dA):null,viewport:window.visualViewport??null}}function DA(e){return{phone:SA(e.media),baseline:xA(e.viewport),resetting:!1}}function OA(e,t,n){return!t.phone||t.resetting||!_A(document.activeElement)||t.baseline-n<fA?uA:{keyboardOpen:!0,keyboardInset:CA(e.viewport,n,t.baseline)}}function kA(e,t,n){let r=bA(e.viewport),i=SA(e.media);if(i!==t.phone){t.phone=i,t.baseline=xA(e.viewport),t.resetting=!0,TA(n,uA);return}if(!i||t.resetting){t.baseline=xA(e.viewport),t.resetting=!1,TA(n,uA);return}t.baseline=Math.max(t.baseline,xA(e.viewport)),TA(n,OA(e,t,r))}function AA(e,t,n){t.baseline=xA(e.viewport),t.resetting=!0,TA(n,uA)}function jA(e){e.current!==void 0&&(typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame(e.current):window.clearTimeout(e.current),e.current=void 0)}function MA(e,t){jA(t),t.current=typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(e):window.setTimeout(e,0)}function NA(e,t,n){return e?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{}}function PA(e,t,n,r){return[NA(window,`focusin`,t),NA(window,`focusout`,t),NA(window,`resize`,t),NA(window,`orientationchange`,n),NA(e.media,`change`,r),NA(e.viewport,`resize`,t),NA(e.viewport,`scroll`,t)]}function FA(e,t,n,r){e.current=void 0,kA(t,n,r)}function IA(e,t,n,r){AA(e,t,n),r()}function LA(e,t,n,r){t.phone=SA(e.media),AA(e,t,n),r()}function RA(e,t){jA(e),t.forEach(e=>e())}function zA(e){let t=EA(),n=DA(t),r={},i=()=>FA(r,t,n,e),a=()=>MA(i,r),o=PA(t,a,()=>IA(t,n,e,a),()=>LA(t,n,e,a));return a(),()=>RA(r,o)}function BA(){let[e,t]=(0,m.useState)(uA);return(0,m.useEffect)(()=>zA(t),[]),e}function VA(e,t,n){if(!e||typeof window>`u`)return;let r=window.visualViewport,i=r?.height??Math.max(0,window.innerHeight-(t?n:0));return{wrapper:{top:`${Math.max(0,r?.offsetTop??0)}px`,bottom:`auto`,height:`${i}px`},content:{width:`calc(100vw - 24px)`,maxWidth:`calc(100vw - 24px)`,maxHeight:`${Math.max(0,i-32)}px`}}}function HA({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=xf(),u=cA(`(max-width: 767.98px)`),{keyboardOpen:d,keyboardInset:f}=BA(),p=VA(u,d,f);return(0,R.jsx)(pS,{open:e,onOpenChange:t,children:(0,R.jsx)(Du,{children:e?(0,R.jsxs)(yS,{forceMount:!0,children:[(0,R.jsx)(xS,{asChild:!0,forceMount:!0,children:(0,R.jsx)(B.div,{className:`fixed inset-0 z-50 bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,R.jsx)(`div`,{className:q(`pointer-events-none fixed inset-0 z-50 grid place-items-center`,u?`p-3`:`p-4`),style:p?.wrapper,children:(0,R.jsx)(TS,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,R.jsxs)(B.div,{className:q(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-xl outline-none`,a),style:{...o,...p?.content??{}},initial:{opacity:0,scale:l?1:.92,y:l?0:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:l?1:.96,y:l?0:8,transition:{duration:.12,ease:`easeIn`}},transition:{type:`spring`,stiffness:460,damping:32,mass:.9},children:[(0,R.jsx)(AS,{className:`sr-only`,children:n}),r?(0,R.jsx)(MS,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var UA=[],WA=0,GA=new Set;function KA(){for(let e of[...GA])e()}function qA(e){return GA.add(e),()=>{GA.delete(e)}}function JA(){let e;for(let t of UA)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var YA={question:30,confirm:20,help:10,sheet:5};function XA(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return UA=[...UA,{id:n,priority:t,order:++WA}],KA(),()=>{UA=UA.filter(e=>e.id!==n),KA()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(qA,JA,()=>void 0);return e&&r===n}function ZA(){return UA.length>0}function QA(){return(0,m.useSyncExternalStore)(qA,()=>UA.length>0,()=>!1)}var $A=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],ej=`already answered in another window`,tj=`Attached files:`,nj=new Set($A);function rj(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(n===`sessions`)return{kind:`sessions`,...t[1]?{key:t[1]}:{}};if(nj.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function ij(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function aj(e){window.location.hash!==e&&(window.location.hash=e)}function oj(){let[e,t]=(0,m.useState)(()=>rj(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=rj(window.location.hash);e?t(e):(window.history.replaceState(null,``,`#/lobby`),t({kind:`tab`,tab:`lobby`,rest:[]}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function sj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty`,className:q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function cj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var lj=Jg(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function uj({className:e,variant:t=`default`,...n}){return(0,R.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(lj({variant:t,className:e})),...n})}function dj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function fj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function pj({className:e,...t}){return(0,R.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}var mj=Jg([`relative w-full text-sm border has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] grid-cols-[0_1fr] grid gap-y-0.5 items-center [&>svg:not([class*=size-])]:size-4`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5`,`rounded-lg`,`px-3`,`py-2.5`,`has-[>svg]:gap-x-2.5`],{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/30 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/30 bg-info/4 [&>svg]:text-info`,success:`border-success/30 bg-success/4 [&>svg]:text-success`,warning:`border-warning/30 bg-warning/4 [&>svg]:text-warning`,invert:`border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70`}},defaultVariants:{variant:`default`}});function hj({className:e,variant:t,...n}){return(0,R.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:q(mj({variant:t}),e),...n})}function gj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-description`,className:q(`text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed`,e),...t})}function _j({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-action`,className:q(`flex gap-1.5 max-sm:col-start-2 max-sm:mt-2 max-sm:justify-start sm:col-start-3 sm:row-start-1 sm:justify-end sm:self-center`,e),...t})}function vj({label:e=`Connecting…`}){return(0,R.jsxs)(`div`,{className:`flex min-h-48 min-w-0 w-full max-w-full flex-1 items-center justify-center gap-2 overflow-y-auto px-4 py-8 text-sm text-muted-foreground max-md:min-h-32 max-md:text-center`,children:[(0,R.jsx)(pj,{}),(0,R.jsx)(`span`,{children:e})]})}function yj({message:e,onRetry:t}){return(0,R.jsxs)(sj,{className:`m-4 min-h-0 min-w-0 flex-1 overflow-y-auto max-md:m-2 max-md:max-h-full max-md:px-2`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsxs)(dj,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Tg,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,R.jsx)(fj,{children:e??`The request failed. Try again.`})]}),t?(0,R.jsxs)(Y,{variant:`outline`,onClick:t,children:[(0,R.jsx)($h,{"aria-hidden":`true`}),`Try again`]}):null]})}function bj({onRetry:e}){return(0,R.jsxs)(hj,{variant:`destructive`,role:`status`,className:`mx-3 mb-1 max-h-32 w-auto min-w-0 overflow-y-auto max-sm:mx-2 max-md:items-start`,children:[(0,R.jsx)(Lg,{className:`size-4`,"aria-hidden":`true`}),(0,R.jsx)(gj,{children:`Lost pi — reconnecting every 2 s. Your planning session and tasks carry on when it is back.`}),e?(0,R.jsx)(_j,{children:(0,R.jsx)(Y,{variant:`link`,className:`h-8 px-1 text-destructive max-md:h-auto max-md:min-h-11`,onClick:e,children:`Retry now`})}):null]})}function xj(e,t,n,r=!0){aA();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[fe.status().connection,...n.map(e=>fe.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),Te(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function Sj({delayDuration:e=400,...t}){return(0,R.jsx)(Uk,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Cj({...e}){return(0,R.jsx)(Wk,{"data-slot":`tooltip`,...e})}function wj({...e}){return(0,R.jsx)(Gk,{"data-slot":`tooltip-trigger`,...e})}function Tj({className:e,sideOffset:t=6,children:n,...r}){return(0,R.jsx)(Kk,{children:(0,R.jsxs)(qk,{"data-slot":`tooltip-content`,sideOffset:t,className:q(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,R.jsx)(Jk,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function Ej(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function Dj(e,t,n){let r=Ej(e);if(r.length===0)return!1;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1,a=r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))];return!a||a===t?!1:(a.focus({preventScroll:!1}),!0)}function Oj(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function kj(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function Aj(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var jj=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function Mj(e){return[...e.querySelectorAll(jj)].filter(e=>e.offsetParent!==null)}function Nj(e,t,n){let r=Mj(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function Pj(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function Fj(e){return e.querySelector(`[aria-current='true']`)??Mj(e)[0]}function Ij(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?Fj(t):void 0)??Mj(e)[0]??e).focus(),!0}function Lj(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var Rj={active:!1},zj=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function Bj(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!zj.has(t)}function Vj(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function Hj(){return ZA()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function Uj(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||Vj(t,e)&&(Oj(t.target)||(r||!Hj())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var Wj={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function X({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,className:c,disabled:l,...u}){let d=(0,m.useRef)(null),f=Bj(r);Uj(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,R.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`&&!s,g=s?n===`primary`?`default`:`ghost`:`outline`,_=q(!s&&`px-2.5`,s?`max-md:size-11`:`max-md:min-h-11 max-md:min-w-11 max-md:h-auto max-md:whitespace-normal`,h&&`obsidian-discover-button`,Wj[n],c),v=s?`icon`:`default`,y=s?p:h?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`obsidian-discover-button__fill`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`obsidian-discover-button__icon`,children:p}),(0,R.jsxs)(`span`,{className:`obsidian-discover-button__text`,children:[o??e,r?(0,R.jsx)(rA,{chord:r,className:`kbd-hint ml-1 max-md:hidden`}):null]})]}):(0,R.jsxs)(R.Fragment,{children:[p,(0,R.jsx)(`span`,{children:o??e}),r?(0,R.jsx)(rA,{chord:r,className:`kbd-hint ml-1 max-md:hidden`}):null]}),b=i?(0,R.jsx)(Y,{asChild:!0,ref:d,variant:g,size:v,"data-tone":n,className:_,children:(0,R.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:y})}):(0,R.jsx)(Y,{ref:d,type:`button`,variant:g,size:v,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:_,...u,children:y});return s?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:b}),(0,R.jsxs)(Tj,{children:[e,(0,R.jsx)(rA,{chord:r??(i?`Enter`:`Enter / Space`),className:`max-md:hidden`})]})]}):b}function Gj({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,R.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:q(`sticky -top-5 z-10 -mx-5 -mt-5 flex min-h-12 flex-wrap items-center gap-1 border-b border-border bg-[var(--workspace-card)] px-4 py-2 [&>[data-tone=danger]:not(:first-child)]:ml-auto max-md:static max-md:z-auto max-md:mx-0 max-md:mt-0 max-md:min-h-11 max-md:gap-2 max-md:border-b-0 max-md:bg-transparent max-md:px-0 max-md:py-1 max-md:backdrop-blur-none`,t),children:e})}function Kj({...e}){return(0,R.jsx)(pS,{"data-slot":`sheet`,...e})}function qj({...e}){return(0,R.jsx)(PS,{"data-slot":`sheet-close`,...e})}function Jj({...e}){return(0,R.jsx)(yS,{"data-slot":`sheet-portal`,...e})}function Yj({className:e,...t}){return(0,R.jsx)(xS,{"data-slot":`sheet-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Xj({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,R.jsxs)(Jj,{forceMount:i,children:[a?null:(0,R.jsx)(Yj,{}),(0,R.jsxs)(TS,{forceMount:i,hidden:a,"data-slot":`sheet-content`,"data-side":n,className:q(`glass-pop fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=right]:rounded-l-xl data-[side=left]:rounded-r-xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...o,children:[t,r&&(0,R.jsx)(PS,{"data-slot":`sheet-close`,asChild:!0,children:(0,R.jsxs)(Y,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,R.jsx)(Vg,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function Zj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function Qj({className:e,...t}){return(0,R.jsx)(AS,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function $j({className:e,...t}){return(0,R.jsx)(MS,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function eM(){return cA(`(min-width: 1024px)`)}function tM({className:e,...t}){return(0,R.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function nM({open:e,onClose:t,describe:n,children:r}){let i=XA(e,YA.sheet),a=cA(`(max-width: 767.98px)`),o=(0,m.useRef)(!1);return i&&(o.current=!0),e||(o.current=!1),(0,R.jsx)(Kj,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,R.jsxs)(Xj,{forceMount:e&&o.current?!0:void 0,hidden:!i,showCloseButton:!1,side:a?`bottom`:`right`,className:q(`gap-0`,a?`data-[side=bottom]:inset-0 data-[side=bottom]:h-full data-[side=bottom]:max-w-none data-[side=bottom]:rounded-none`:`data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,R.jsxs)(Zj,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,R.jsx)(Qj,{className:`text-sm`,children:`Detail`}),(0,R.jsx)($j,{className:`sr-only`,children:n}),(0,R.jsx)(qj,{asChild:!0,children:(0,R.jsxs)(Y,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:q(`gap-2`,a&&`h-11 px-3 text-sm`),children:[(0,R.jsx)(Vg,{"aria-hidden":`true`}),`Close`,a?null:(0,R.jsx)(rA,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function rM({list:e,detail:t,open:n,detailClassName:r,listPane:i,detailPane:a,onListKey:o,onDetailKey:s}){let c=n&&t!==null;return(0,R.jsxs)(`div`,{className:q(`grid min-h-0 min-w-0 flex-1`,c?`grid-rows-[minmax(0,1fr)_minmax(0,2fr)]`:`grid-rows-1`),children:[(0,R.jsx)(tM,{"data-pane":`list`,ref:i,onKeyDown:o,className:q(`min-w-0 overflow-x-hidden overflow-y-auto`,c?`border-b border-border`:`pb-dock`),children:e}),c?(0,R.jsx)(tM,{"data-pane":`detail`,ref:a,"aria-label":`Detail`,tabIndex:0,onKeyDown:s,className:q(`min-w-0 overflow-x-hidden overflow-y-auto px-5 pt-5 pb-dock`,r),children:t}):null]})}function iM({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o,inlineDetail:s,detailClassName:c}){let l=(0,m.useRef)(null),u=(0,m.useRef)(null);function d(t){let n=l.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||ZA()||t.altKey||t.ctrlKey||t.metaKey||Oj(t.target)||t.target instanceof HTMLInputElement)return;let r=kj(t.key,!1);r?(t.preventDefault(),Nj(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),Nj(n,t.target,t.key===`Home`?`first`:`last`)):(e||s)&&Aj(t.key)===1&&u.current&&(t.preventDefault(),u.current.focus())}function f(e){e.defaultPrevented||e.nativeEvent.isComposing||ZA()||e.altKey||e.ctrlKey||e.metaKey||Oj(e.target)||Aj(e.key)===-1&&l.current&&(e.preventDefault(),Fj(l.current)?.focus())}return!e&&s?(0,R.jsx)(rM,{list:t,detail:n,open:r,detailClassName:c,listPane:l,detailPane:u,onListKey:d,onDetailKey:f}):e?(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)] gap-3 p-3`,children:[(0,R.jsx)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:(0,R.jsx)(tM,{"data-pane":`list`,ref:l,onKeyDown:d,className:`h-full overflow-y-auto pb-dock`,children:t})}),(0,R.jsx)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:(0,R.jsx)(tM,{"data-pane":`detail`,ref:u,tabIndex:0,"aria-label":`Detail`,onKeyDown:f,className:q(`h-full overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,c),children:n??(0,R.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,R.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,R.jsx)(kh,{className:`size-5`})}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,R.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(rA,{chord:`ArrowUp`}),(0,R.jsx)(rA,{chord:`ArrowDown`}),`move`]}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(rA,{chord:`ArrowRight`}),`open`]})]})]})})})})]}):(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,R.jsx)(tM,{"data-pane":`list`,ref:l,onKeyDown:d,className:`max-md:shrink-0`,children:t}),(0,R.jsx)(nM,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function aM({title:e,count:t,children:n}){return(0,R.jsxs)(`div`,{className:`sticky top-0 z-10 flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-[var(--workspace-card)] px-4 py-2 max-md:static max-md:z-auto max-md:bg-transparent max-md:px-3 max-md:py-2 max-md:backdrop-blur-none`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,R.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function oM(){return(0,R.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function sM({className:e,...t}){return(0,R.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background px-3.5 py-2.5 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...t})}function cM(e){return e<10?`0${e}`:String(e)}function lM(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${cM(t.getHours())}:${cM(t.getMinutes())}`}function uM(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function dM(e){let t=uM(e);return t===`now`?`just now`:`${t} ago`}function fM({...e}){return(0,R.jsx)(QS,{"data-slot":`alert-dialog`,...e})}function pM({...e}){return(0,R.jsx)($S,{"data-slot":`alert-dialog-portal`,...e})}function mM({className:e,...t}){return(0,R.jsx)(eC,{"data-slot":`alert-dialog-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function hM({className:e,...t}){return(0,R.jsxs)(pM,{children:[(0,R.jsx)(mM,{}),(0,R.jsx)(tC,{"data-slot":`alert-dialog-content`,className:q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 glass-pop rounded-xl p-5 text-sm duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function gM({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function _M({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function vM({className:e,...t}){return(0,R.jsx)(iC,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function yM({className:e,...t}){return(0,R.jsx)(aC,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function bM({className:e,variant:t=`default`,...n}){return(0,R.jsx)(Y,{variant:t,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,R.jsx)(nC,{"data-slot":`alert-dialog-action`,...n})})}function xM({className:e,...t}){return(0,R.jsx)(Y,{variant:`outline`,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,R.jsx)(rC,{"data-slot":`alert-dialog-cancel`,...t})})}function SM({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d}){let[f,p]=(0,m.useState)(!1),h=XA(f,YA.confirm),g=l===`destructive`;return Uj(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,R.jsxs)(fM,{open:f&&h,onOpenChange:p,children:[(0,R.jsx)(X,{label:e,icon:s,tone:g?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:{},...t?{text:t}:{},onClick:()=>p(!0)}),(0,R.jsxs)(hM,{children:[(0,R.jsxs)(gM,{children:[(0,R.jsx)(vM,{children:r}),(0,R.jsx)(yM,{children:i})]}),(0,R.jsxs)(_M,{children:[(0,R.jsxs)(xM,{className:`max-md:min-h-11 max-md:whitespace-normal`,children:[`Keep it`,(0,R.jsx)(rA,{chord:`Esc`,className:`kbd-hint ml-1 max-md:hidden`})]}),(0,R.jsxs)(bM,{variant:g?`destructive`:`default`,className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:o,children:[a,(0,R.jsx)(rA,{chord:`Y`,className:`kbd-hint ml-1 max-md:hidden`})]})]})]})]})}function CM(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var wM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EM={};function DM(e,t){return((t||EM).jsx?TM:wM).test(e)}var OM=/[ \t\n\f\r]/g;function kM(e){return typeof e==`object`?e.type===`text`&&AM(e.value):AM(e)}function AM(e){return e.replace(OM,``)===``}var jM=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};jM.prototype.normal={},jM.prototype.property={},jM.prototype.space=void 0;function MM(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new jM(n,r,t)}function NM(e){return e.toLowerCase()}var PM=class{constructor(e,t){this.attribute=t,this.property=e}};PM.prototype.attribute=``,PM.prototype.booleanish=!1,PM.prototype.boolean=!1,PM.prototype.commaOrSpaceSeparated=!1,PM.prototype.commaSeparated=!1,PM.prototype.defined=!1,PM.prototype.mustUseProperty=!1,PM.prototype.number=!1,PM.prototype.overloadedBoolean=!1,PM.prototype.property=``,PM.prototype.spaceSeparated=!1,PM.prototype.space=void 0;var FM=s({boolean:()=>Z,booleanish:()=>LM,commaOrSpaceSeparated:()=>VM,commaSeparated:()=>BM,number:()=>Q,overloadedBoolean:()=>RM,spaceSeparated:()=>zM}),IM=0,Z=HM(),LM=HM(),RM=HM(),Q=HM(),zM=HM(),BM=HM(),VM=HM();function HM(){return 2**++IM}var UM=Object.keys(FM),WM=class extends PM{constructor(e,t,n,r){let i=-1;if(super(e,t),GM(this,`space`,r),typeof n==`number`)for(;++i<UM.length;){let e=UM[i];GM(this,UM[i],(n&FM[e])===FM[e])}}};WM.prototype.defined=!0;function GM(e,t,n){n&&(e[t]=n)}function KM(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new WM(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[NM(r)]=r,n[NM(a.attribute)]=r}return new jM(t,n,e.space)}var qM=KM({properties:{ariaActiveDescendant:null,ariaAtomic:LM,ariaAutoComplete:null,ariaBusy:LM,ariaChecked:LM,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:zM,ariaCurrent:null,ariaDescribedBy:zM,ariaDetails:null,ariaDisabled:LM,ariaDropEffect:zM,ariaErrorMessage:null,ariaExpanded:LM,ariaFlowTo:zM,ariaGrabbed:LM,ariaHasPopup:null,ariaHidden:LM,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zM,ariaLevel:Q,ariaLive:null,ariaModal:LM,ariaMultiLine:LM,ariaMultiSelectable:LM,ariaOrientation:null,ariaOwns:zM,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:LM,ariaReadOnly:LM,ariaRelevant:null,ariaRequired:LM,ariaRoleDescription:zM,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:LM,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function JM(e,t){return t in e?e[t]:t}function YM(e,t){return JM(e,t.toLowerCase())}var XM=KM({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:BM,acceptCharset:zM,accessKey:zM,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:zM,autoFocus:Z,autoPlay:Z,blocking:zM,capture:null,charSet:null,checked:Z,cite:null,className:zM,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:LM,controls:Z,controlsList:zM,coords:Q|BM,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:RM,draggable:LM,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:zM,height:Q,hidden:RM,high:Q,href:null,hrefLang:null,htmlFor:zM,httpEquiv:zM,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:zM,itemRef:zM,itemScope:Z,itemType:zM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:zM,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:zM,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:zM,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:LM,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:LM,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zM,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:LM,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:BM,part:zM,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:YM}),ZM=KM({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:VM,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:zM,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:BM,g2:BM,glyphName:BM,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:VM,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:VM,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:VM,rev:VM,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:VM,requiredFeatures:VM,requiredFonts:VM,requiredFormats:VM,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:VM,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:VM,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:VM,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:JM}),QM=KM({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),$M=KM({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:YM}),eN=KM({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),tN={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},nN=/[A-Z]/g,rN=/-[a-z]/g,iN=/^data[-\w.:]+$/i;function aN(e,t){let n=NM(t),r=t,i=PM;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&iN.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(rN,sN);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!rN.test(e)){let n=e.replace(nN,oN);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=WM}return new i(r,t)}function oN(e){return`-`+e.toLowerCase()}function sN(e){return e.charAt(1).toUpperCase()}var cN=MM([qM,XM,QM,$M,eN],`html`),lN=MM([qM,ZM,QM,$M,eN],`svg`);function uN(e){return e.join(` `).trim()}var dN=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
58
+ `},Gx=0,Kx=[];function qx(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Gx++)[0],a=m.useState(hx)[0],o=m.useRef(e);m.useEffect(function(){o.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Gb([e.lockRef.current],(e.shards||[]).map(Hx),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=m.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Bx(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Nx(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nx(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return zx(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(Kx.length&&Kx[Kx.length-1]===a){var r=`deltaY`in n?Vx(n):Bx(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ux(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hx).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=m.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Jx(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=m.useCallback(function(e){n.current=Bx(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,Vx(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Bx(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return Kx.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ox),document.addEventListener(`touchmove`,c,Ox),document.addEventListener(`touchstart`,u,Ox),function(){Kx=Kx.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ox),document.removeEventListener(`touchmove`,c,Ox),document.removeEventListener(`touchstart`,u,Ox)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Wx(i)}):null,p?m.createElement(Tx,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jx(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yx=ax(ox,qx),Xx=m.forwardRef(function(e,t){return m.createElement(cx,Ub({},e,{ref:t,sideCar:Yx}))});Xx.classNames=cx.classNames;var Zx=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qx=new WeakMap,$x=new WeakMap,eS={},tS=0,nS=function(e){return e&&(e.host||nS(e.parentNode))},rS=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nS(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},iS=function(e,t,n,r){var i=rS(t,Array.isArray(e)?e:[e]);eS[n]||(eS[n]=new WeakMap);var a=eS[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(Qx.get(e)||0)+1,l=(a.get(e)||0)+1;Qx.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$x.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),tS++,function(){o.forEach(function(e){var t=Qx.get(e)-1,i=a.get(e)-1;Qx.set(e,t),a.set(e,i),t||($x.has(e)||e.removeAttribute(r),$x.delete(e)),i||e.removeAttribute(n)}),tS--,tS||(Qx=new WeakMap,Qx=new WeakMap,$x=new WeakMap,eS={})}},aS=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zx(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),iS(r,i,n,`aria-hidden`)):function(){return null}},oS=Object.defineProperty,sS=(e,t)=>oS(e,`name`,{value:t,configurable:!0}),cS=`Dialog`,[lS,uS]=ey(cS),[dS,fS]=lS(cS),pS=sS(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=m.useRef(null),c=m.useRef(null),[l,u]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:cS}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,R.jsx)(dS,{scope:t,triggerRef:s,contentRef:c,contentId:Yy(),titleId:Yy(),descriptionId:Yy(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),mS=`DialogTrigger`,hS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(mS,n),a=Tv(t,i.triggerRef);return(0,R.jsx)(Gv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":FS(i.open),...r,ref:a,onClick:J(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),gS=`DialogPortal`,[_S,vS]=lS(gS,{forceMount:void 0}),yS=sS(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fS(gS,t);return(0,R.jsx)(_S,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),bS=`DialogOverlay`,xS=m.forwardRef(sS(function(e,t){let n=vS(bS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fS(bS,e.__scopeDialog);return a.modal?(0,R.jsx)(zy,{present:r||a.open,children:(0,R.jsx)(CS,{...i,ref:t})}):null},`DialogOverlay`)),SS=Ov(`DialogOverlay.RemoveScroll`),CS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(bS,n),a=Tv(t,db());return(0,R.jsx)(Xx,{as:SS,allowPinchZoom:!0,shards:[i.contentRef],children:(0,R.jsx)(Gv.div,{"data-state":FS(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),wS=`DialogContent`,TS=m.forwardRef(sS(function(e,t){let n=vS(wS,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fS(wS,e.__scopeDialog);return(0,R.jsx)(zy,{present:r||a.open,children:a.modal?(0,R.jsx)(ES,{...i,ref:t}):(0,R.jsx)(DS,{...i,ref:t})})},`DialogContent`)),ES=m.forwardRef(sS(function(e,t){let n=fS(wS,e.__scopeDialog),r=m.useRef(null),i=Tv(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return aS(e)},[]),(0,R.jsx)(OS,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),DS=m.forwardRef(sS(function(e,t){let n=fS(wS,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,R.jsx)(OS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),OS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=fS(wS,n);return Vb(),(0,R.jsx)(R.Fragment,{children:(0,R.jsx)(Sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(ub,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":FS(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),kS=`DialogTitle`,AS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(kS,n),{setTitleCount:a}=i;return Sy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Gv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),jS=`DialogDescription`,MS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(jS,n),{setDescriptionCount:a}=i;return Sy(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,R.jsx)(Gv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),NS=`DialogClose`,PS=m.forwardRef(sS(function(e,t){let{__scopeDialog:n,...r}=e,i=fS(NS,n);return(0,R.jsx)(Gv.button,{type:`button`,...r,ref:t,onClick:J(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function FS(e){return e?`open`:`closed`}sS(FS,`getState`);var IS=Object.defineProperty,LS=(e,t)=>IS(e,`name`,{value:t,configurable:!0}),[RS,zS]=ey(`AlertDialog`,[uS]),BS=uS(),VS=LS(e=>{let{__scopeAlertDialog:t,...n}=e,r=BS(t);return(0,R.jsx)(pS,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(hS,{...i,...r,ref:t})},`AlertDialogTrigger`));var HS=LS(e=>{let{__scopeAlertDialog:t,...n}=e,r=BS(t);return(0,R.jsx)(yS,{...r,...n})},`AlertDialogPortal`),US=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(xS,{...i,...r,ref:t})},`AlertDialogOverlay`)),[WS,GS]=RS(`AlertDialogContent`),KS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=BS(n),o=Tv(t,m.useRef(null)),s=m.useRef(null);return(0,R.jsx)(WS,{scope:n,cancelRef:s,children:(0,R.jsx)(TS,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:J(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),qS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(AS,{...i,...r,ref:t})},`AlertDialogTitle`)),JS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(MS,{...i,...r,ref:t})},`AlertDialogDescription`)),YS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=BS(n);return(0,R.jsx)(PS,{...i,...r,ref:t})},`AlertDialogAction`)),XS=`AlertDialogCancel`,ZS=m.forwardRef(LS(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=GS(XS,n),a=BS(n),o=Tv(t,i);return(0,R.jsx)(PS,{...a,...r,ref:o})},`AlertDialogCancel`)),QS=VS,$S=HS,eC=US,tC=KS,nC=YS,rC=ZS,iC=qS,aC=JS,oC=Object.defineProperty,sC=(e,t)=>oC(e,`name`,{value:t,configurable:!0});function cC(e){let[t,n]=m.useState(void 0);return Sy(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}sC(cC,`useSize`);var lC=Object.defineProperty,uC=(e,t)=>lC(e,`name`,{value:t,configurable:!0}),dC=`Checkbox`,[fC,pC]=ey(dC),[mC,hC]=fC(dC);function gC(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=jy({prop:n,defaultProp:i??!1,onChange:c,caller:dC}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S=!h||!!o||!!h.closest(`form`),C={checked:f,disabled:a,setChecked:p,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:!TC(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,R.jsx)(mC,{scope:t,...C,children:wC(d)?d(C):r})}uC(gC,`CheckboxProvider`);var _C=`CheckboxTrigger`,vC=m.forwardRef(uC(function({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i){let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=hC(_C,e),_=Tv(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=uC(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,R.jsx)(Gv.button,{type:`button`,role:`checkbox`,"aria-checked":TC(c)?`mixed`:c,"aria-required":l,"data-state":EC(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:J(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:J(n,e=>{p(),d(e=>TC(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),yC=m.forwardRef(uC(function(e,t){let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,R.jsx)(gC,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(vC,{...d,ref:t,__scopeCheckbox:n}),e&&(0,R.jsx)(CC,{__scopeCheckbox:n})]})})},`Checkbox`)),bC=`CheckboxIndicator`,xC=m.forwardRef(uC(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=hC(bC,n);return(0,R.jsx)(zy,{present:r||TC(a.checked)||a.checked===!0,children:(0,R.jsx)(Gv.span,{"data-state":EC(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),SC=`CheckboxBubbleInput`,CC=m.forwardRef(uC(function({__scopeCheckbox:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=hC(SC,e),_=Tv(r,g),v=cC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});e.indeterminate=TC(s),n.call(e,!TC(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!TC(s)&&s);return(0,R.jsx)(Gv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function wC(e){return typeof e==`function`}uC(wC,`isFunction`);function TC(e){return e===`indeterminate`}uC(TC,`isIndeterminate`);function EC(e){return TC(e)?`indeterminate`:e?`checked`:`unchecked`}uC(EC,`getState`);var DC=[`top`,`right`,`bottom`,`left`],OC=Math.min,kC=Math.max,AC=Math.round,jC=Math.floor,MC=e=>({x:e,y:e}),NC={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function PC(e,t,n){return kC(e,OC(t,n))}function FC(e,t){return typeof e==`function`?e(t):e}function IC(e){return e.split(`-`)[0]}function LC(e){return e.split(`-`)[1]}function RC(e){return e===`x`?`y`:`x`}function zC(e){return e===`y`?`height`:`width`}function BC(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function VC(e){return RC(BC(e))}function HC(e,t,n){n===void 0&&(n=!1);let r=LC(e),i=VC(e),a=zC(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ZC(o)),[o,ZC(o)]}function UC(e){let t=ZC(e);return[WC(e),t,WC(t)]}function WC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var GC=[`left`,`right`],KC=[`right`,`left`],qC=[`top`,`bottom`],JC=[`bottom`,`top`];function YC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?KC:GC:t?GC:KC;case`left`:case`right`:return t?qC:JC;default:return[]}}function XC(e,t,n,r){let i=LC(e),a=YC(IC(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(WC)))),a}function ZC(e){let t=IC(e);return NC[t]+e.slice(t.length)}function QC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function $C(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:QC(e)}function ew(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function tw(e,t,n){let{reference:r,floating:i}=e,a=BC(t),o=VC(t),s=zC(o),c=IC(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=LC(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nw(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=FC(t,e),p=$C(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ew(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=ew(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var rw=50,iw=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nw},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tw(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<rw&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=tw(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},aw=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=FC(e,t)||{};if(l==null)return{};let d=$C(u),f={x:n,y:r},p=VC(i),m=zC(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=OC(d[_],T),D=OC(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=PC(E,k,O),ee=!c.arrow&&LC(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,j=ee?k<E?k-E:k-O:0;return{[p]:f[p]+j,data:{[p]:A,centerOffset:k-A-j,...ee&&{alignmentOffset:j}},reset:ee}}}),ow=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=FC(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=IC(r),_=BC(o),v=IC(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ZC(o)]:UC(o)),x=p!==`none`;!d&&x&&b.push(...XC(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=HC(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===BC(t)||T.every(e=>BC(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=BC(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function sw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cw(e){return DC.some(t=>e[t]>=0)}var lw=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=FC(e,t);switch(i){case`referenceHidden`:{let e=sw(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cw(e)}}}case`escaped`:{let e=sw(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cw(e)}}}default:return{}}}}},uw=new Set([`left`,`top`]);async function dw(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=IC(n),s=LC(n),c=BC(n)===`y`,l=uw.has(o)?-1:1,u=a&&c?-1:1,d=FC(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var fw=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await dw(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},pw=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=FC(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=BC(i),p=RC(f),m=u[p],h=u[f],g=(e,t)=>PC(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},mw=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=FC(e,t),u={x:n,y:r},d=BC(i),f=RC(d),p=u[f],m=u[d],h=FC(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=uw.has(IC(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},hw=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=FC(e,t),c=await i.detectOverflow(t,s),l=IC(n),u=LC(n),d=BC(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=OC(p-c[m],g),y=OC(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*kC(c.left,c.right):S=p-2*kC(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function gw(){return typeof window<`u`}function _w(e){return bw(e)?(e.nodeName||``).toLowerCase():`#document`}function vw(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yw(e){return((bw(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bw(e){return gw()?e instanceof Node||e instanceof vw(e).Node:!1}function xw(e){return gw()?e instanceof Element||e instanceof vw(e).Element:!1}function Sw(e){return gw()?e instanceof HTMLElement||e instanceof vw(e).HTMLElement:!1}function Cw(e){return!gw()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof vw(e).ShadowRoot}function ww(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Fw(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Tw(e){return/^(table|td|th)$/.test(_w(e))}function Ew(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Dw=/transform|translate|scale|rotate|perspective|filter/,Ow=/paint|layout|strict|content/,kw=e=>!!e&&e!==`none`,Aw;function jw(e){let t=xw(e)?Fw(e):e;return kw(t.transform)||kw(t.translate)||kw(t.scale)||kw(t.rotate)||kw(t.perspective)||!Nw()&&(kw(t.backdropFilter)||kw(t.filter))||Dw.test(t.willChange||``)||Ow.test(t.contain||``)}function Mw(e){let t=Lw(e);for(;Sw(t)&&!Pw(t);){if(jw(t))return t;if(Ew(t))return null;t=Lw(t)}return null}function Nw(){return Aw??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Aw}function Pw(e){return/^(html|body|#document)$/.test(_w(e))}function Fw(e){return vw(e).getComputedStyle(e)}function Iw(e){return xw(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Lw(e){if(_w(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Cw(e)&&e.host||yw(e);return Cw(t)?t.host:t}function Rw(e){let t=Lw(e);return Pw(t)?(e.ownerDocument||e).body:Sw(t)&&ww(t)?t:Rw(t)}function zw(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Rw(e),i=r===e.ownerDocument?.body,a=vw(r);if(i){let e=Bw(a);return t.concat(a,a.visualViewport||[],ww(r)?r:[],e&&n?zw(e):[])}return t.concat(r,zw(r,[],n))}function Bw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Vw(e){let t=Fw(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Sw(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=AC(n)!==a||AC(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Hw(e){return xw(e)?e:e.contextElement}function Uw(e){let t=Hw(e);if(!Sw(t))return MC(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Vw(t),o=(a?AC(n.width):n.width)/r,s=(a?AC(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ww=MC(0);function Gw(e){let t=vw(e);return!Nw()||!t.visualViewport?Ww:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vw(e)}function qw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Hw(e),o=MC(1);t&&(r?xw(r)&&(o=Uw(r)):o=Uw(e));let s=Kw(a,n,r)?Gw(a):MC(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=vw(a),t=xw(r)?vw(r):r,n=e,i=Bw(n);for(;i&&t!==n;){let e=Uw(i),t=i.getBoundingClientRect(),r=Fw(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=vw(i),i=Bw(n)}}return ew({width:u,height:d,x:c,y:l})}function Jw(e,t){let n=Iw(e).scrollLeft;return t?t.left+n:qw(yw(e)).left+n}function Yw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Jw(e,n),y:n.top+t.scrollTop}}function Xw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yw(r),s=t?Ew(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=MC(1),u=MC(0),d=Sw(r);if((d||!a)&&((_w(r)!==`body`||ww(o))&&(c=Iw(r)),d)){let e=qw(r);l=Uw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Yw(o,c):MC(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Zw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Qw(e){let t=Iw(e),n=e.ownerDocument.body,r=kC(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=kC(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Jw(e),o=-t.scrollTop;return Fw(n).direction===`rtl`&&(a+=kC(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $w=25;function eT(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=vw(e),a=yw(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Nw()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Jw(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=$w&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tT(e,t){let n=qw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Uw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nT(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=eT(e,n,t);else if(t===`document`)r=Qw(yw(e));else if(xw(t))r=tT(t,n);else{let n=Gw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ew(r)}function rT(e,t){let n=t.get(e);if(n)return n;let r=zw(e,[],!1).filter(e=>xw(e)&&_w(e)!==`body`),i=null,a=Fw(e).position===`fixed`,o=a?Lw(e):e;for(;xw(o)&&!Pw(o);){let e=Fw(o),t=jw(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Lw(o)}return t.set(e,r),r}function iT(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Ew(t)?[]:rT(t,this._c):[].concat(n),r],o=nT(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=nT(t,a[e],i);s=kC(n.top,s),c=OC(n.right,c),l=OC(n.bottom,l),u=kC(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function aT(e){let{width:t,height:n}=Vw(e);return{width:t,height:n}}function oT(e,t,n){let r=Sw(t),i=yw(t),a=n===`fixed`,o=qw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=MC(0);if((r||!a)&&((_w(t)!==`body`||ww(i))&&(s=Iw(t)),r)){let e=qw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Jw(i));let l=i&&!r&&!a?Yw(i,s):MC(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function sT(e){return Fw(e).position===`static`}function cT(e,t){if(!Sw(e)||Fw(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return yw(e)===n&&(n=n.ownerDocument.body),n}function lT(e,t){let n=vw(e);if(Ew(e))return n;if(!Sw(e)){let t=Lw(e);for(;t&&!Pw(t);){if(xw(t)&&!sT(t))return t;t=Lw(t)}return n}let r=cT(e,t);for(;r&&Tw(r)&&sT(r);)r=cT(r,t);return r&&Pw(r)&&sT(r)&&!jw(r)?n:r||Mw(e)||n}var uT=async function(e){let t=this.getOffsetParent||lT,n=this.getDimensions,r=await n(e.floating);return{reference:oT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dT(e){return Fw(e).direction===`rtl`}var fT={convertOffsetParentRelativeRectToViewportRelativeRect:Xw,getDocumentElement:yw,getClippingRect:iT,getOffsetParent:lT,getElementRects:uT,getClientRects:Zw,getDimensions:aT,getScale:Uw,isElement:xw,isRTL:dT};function pT(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mT(e,t,n){let r=null,i,a=yw(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=jC(d),h=jC(a.clientWidth-(u+f)),g=jC(a.clientHeight-(d+p)),_=jC(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:kC(0,OC(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!pT(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=vw(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hT(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Hw(e),u=i||a?[...l?zw(l):[],...t?zw(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?mT(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?qw(e):null;c&&g();function g(){let t=qw(e);h&&!pT(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gT=fw,_T=pw,vT=ow,yT=hw,bT=lw,xT=aw,ST=mw,CT=(e,t,n)=>{let r=new Map,i=n??{},a={...fT,...i.platform,_c:r};return iw(e,t,{...i,platform:a})},wT=typeof document<`u`?m.useLayoutEffect:function(){};function TT(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!TT(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!TT(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ET(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function DT(e,t){let n=ET(e);return Math.round(t*n)/n}function OT(e){let t=m.useRef(e);return wT(()=>{t.current=e}),t}function kT(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=m.useState(r);TT(f,r)||p(r);let[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=m.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||h,S=o||_,C=m.useRef(null),w=m.useRef(null),T=m.useRef(u),E=c!=null,D=OT(c),O=OT(i),k=OT(l),A=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),CT(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};ee.current&&!TT(T.current,t)&&(T.current=t,Hv.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);wT(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=m.useRef(!1);wT(()=>(ee.current=!0,()=>{ee.current=!1}),[]),wT(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let j=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=m.useMemo(()=>({reference:x,floating:S}),[x,S]),te=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=DT(M.floating,u.x),r=DT(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ET(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:A,refs:j,elements:M,floatingStyles:te}),[u,A,j,M,te])}var AT=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:xT({element:r.current,padding:i}).fn(n):r?xT({element:r,padding:i}).fn(n):{}}}},jT=(e,t)=>{let n=gT(e);return{name:n.name,fn:n.fn,options:[e,t]}},MT=(e,t)=>{let n=_T(e);return{name:n.name,fn:n.fn,options:[e,t]}},NT=(e,t)=>({fn:ST(e).fn,options:[e,t]}),PT=(e,t)=>{let n=vT(e);return{name:n.name,fn:n.fn,options:[e,t]}},FT=(e,t)=>{let n=yT(e);return{name:n.name,fn:n.fn,options:[e,t]}},IT=(e,t)=>{let n=bT(e);return{name:n.name,fn:n.fn,options:[e,t]}},LT=(e,t)=>{let n=AT(e);return{name:n.name,fn:n.fn,options:[e,t]}},RT=Object.defineProperty,zT=m.forwardRef(((e,t)=>RT(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,R.jsx)(Gv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,R.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),BT=Object.defineProperty,VT=(e,t)=>BT(e,`name`,{value:t,configurable:!0}),HT=`Popper`,[UT,WT]=ey(HT),[GT,KT]=UT(HT),qT=VT(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,R.jsx)(GT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),JT=`PopperAnchor`,YT=m.forwardRef(VT(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=KT(JT,n),o=m.useRef(null),s=a.onAnchorChange,c=Tv(t,m.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=m.useRef(null);m.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&aE(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,R.jsx)(Gv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),XT=`PopperContent`,[ZT,QT]=UT(XT),$T=m.forwardRef(VT(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:h,...g}=e,_=KT(XT,n),[v,y]=m.useState(null),b=Tv(t,y),[x,S]=m.useState(null),C=cC(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(rE),altBoundary:k},{refs:ee,floatingStyles:j,placement:M,isPositioned:te,middlewareData:ne}=kT({strategy:`fixed`,placement:E,whileElementsMounted:VT((...e)=>hT(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[jT({mainAxis:i+T,alignmentAxis:o}),c&&MT({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?NT():void 0,...A}),c&&PT({...A}),FT({...A,apply:VT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),x&&LT({element:x,padding:s}),iE({arrowWidth:w,arrowHeight:T}),f&&IT({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),N=_.setPlacementState;Sy(()=>(N(M),()=>{N(void 0)}),[M,N]);let[re,ie]=aE(M),ae=nb(h);Sy(()=>{te&&ae?.()},[te,ae]);let oe=ne.arrow?.x,se=ne.arrow?.y,ce=ne.arrow?.centerOffset!==0,[le,ue]=m.useState();return Sy(()=>{v&&ue(window.getComputedStyle(v).zIndex)},[v]),(0,R.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:te?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:le,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,R.jsx)(ZT,{scope:n,placedSide:re,placedAlign:ie,onArrowChange:S,arrowX:oe,arrowY:se,shouldHideArrow:ce,children:(0,R.jsx)(Gv.div,{"data-side":re,"data-align":ie,...g,ref:b,style:{...g.style,animation:te?g.style?.animation:`none`}})})})},`PopperContent`)),eE=`PopperArrow`,tE={top:`bottom`,right:`left`,bottom:`top`,left:`right`},nE=m.forwardRef(VT(function(e,t){let{__scopePopper:n,...r}=e,i=QT(eE,n),a=tE[i.placedSide];return(0,R.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,R.jsx)(zT,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function rE(e){return e!==null}VT(rE,`isNotNull`);var iE=VT(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=aE(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function aE(e){let[t,n=`center`]=e.split(`-`);return[t,n]}VT(aE,`getSideAndAlignFromPlacement`);var oE=qT,sE=YT,cE=$T,lE=nE,uE=Object.defineProperty,dE=(e,t)=>uE(e,`name`,{value:t,configurable:!0}),fE=!1;function pE(){let[e,t]=m.useState(fE);return m.useEffect(()=>{fE||(fE=!0,t(!0))},[]),e}dE(pE,`useIsHydrated`);var mE=m.useSyncExternalStore;function hE(){return()=>{}}dE(hE,`subscribe`);function gE(){return mE(hE,()=>!0,()=>!1)}dE(gE,`useIsHydratedModern`);var _E=typeof mE==`function`?gE:pE,vE=Object.defineProperty,yE=(e,t)=>vE(e,`name`,{value:t,configurable:!0}),bE=`rovingFocusGroup.onEntryFocus`,xE={bubbles:!1,cancelable:!0},SE=`RovingFocusGroup`,[CE,wE,TE]=iy(SE),[EE,DE]=ey(SE,[TE]),[OE,kE]=EE(SE),AE=m.forwardRef(yE(function(e,t){return(0,R.jsx)(CE.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(CE.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,R.jsx)(jE,{...e,ref:t})})})},`RovingFocusGroup`)),jE=m.forwardRef(yE(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=m.useRef(null),p=Tv(t,f),h=$y(a),[g,_]=jy({prop:o,defaultProp:s??null,onChange:c,caller:SE}),[v,y]=m.useState(!1),b=nb(l),x=wE(n),S=m.useRef(!1),[C,w]=m.useState(0);return m.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(bE,b),()=>e.removeEventListener(bE,b)},[b]),(0,R.jsx)(OE,{scope:n,orientation:r,dir:h,loop:i,currentTabStopId:g,onItemFocus:m.useCallback(e=>_(e),[_]),onItemShiftTab:m.useCallback(()=>y(!0),[]),onFocusableItemAdd:m.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:m.useCallback(()=>w(e=>e-1),[]),children:(0,R.jsx)(Gv.div,{tabIndex:v||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:J(e.onMouseDown,()=>{S.current=!0}),onFocus:J(e.onFocus,e=>{let t=!S.current;if(e.target===e.currentTarget&&t&&!v){let t=new CustomEvent(bE,xE);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=x().filter(e=>e.focusable);LE([e.find(e=>e.active),e.find(e=>e.id===g),...e].filter(Boolean).map(e=>e.ref.current),u)}}S.current=!1}),onBlur:J(e.onBlur,()=>y(!1))})})},`RovingFocusGroupImpl`)),ME=`RovingFocusGroupItem`,NE=m.forwardRef(yE(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=Yy(),l=a||c,u=kE(ME,n),d=u.currentTabStopId===l,f=wE(n),{onFocusableItemAdd:p,onFocusableItemRemove:h,currentTabStopId:g}=u,_=_E();return Sy(()=>{if(_&&r)return p(),()=>h()},[_,r,p,h]),m.useEffect(()=>{if(!_&&r)return p(),()=>h()},[_,r,p,h]),(0,R.jsx)(CE.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,R.jsx)(Gv.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:J(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:J(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:J(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=IE(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?RE(n,r+1):n.slice(r+1)}setTimeout(()=>LE(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),PE={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function FE(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}yE(FE,`getDirectionAwareKey`);function IE(e,t,n){let r=FE(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return PE[r]}yE(IE,`getFocusIntent`);function LE(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}yE(LE,`focusFirst`);function RE(e,t){return e.map((n,r)=>e[(t+r)%e.length])}yE(RE,`wrapArray`);var zE=AE,BE=NE,VE=Object.defineProperty,HE=(e,t)=>VE(e,`name`,{value:t,configurable:!0});function UE(e){let t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}HE(UE,`usePrevious`);var WE=Object.defineProperty,GE=(e,t)=>WE(e,`name`,{value:t,configurable:!0});function KE(e,[t,n]){return Math.min(n,Math.max(t,e))}GE(KE,`clamp`);var qE=Object.defineProperty,JE=(e,t)=>qE(e,`name`,{value:t,configurable:!0}),YE=`Popover`,[XE,ZE]=ey(YE,[WT]),QE=WT(),[$E,eD]=XE(YE),tD=JE(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=QE(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:YE});return(0,R.jsx)(oE,{...s,children:(0,R.jsx)($E,{scope:t,contentId:Yy(),triggerRef:c,open:d,onOpenChange:f,onOpenToggle:m.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:l,onCustomAnchorAdd:m.useCallback(()=>u(!0),[]),onCustomAnchorRemove:m.useCallback(()=>u(!1),[]),modal:o,children:n})})},`Popover`),nD=`PopoverTrigger`,rD=m.forwardRef(JE(function(e,t){let{__scopePopover:n,...r}=e,i=eD(nD,n),a=QE(n),o=Tv(t,i.triggerRef),s=(0,R.jsx)(Gv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":mD(i.open),...r,ref:o,onClick:J(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,R.jsx)(sE,{asChild:!0,...a,children:s})},`PopoverTrigger`)),iD=`PopoverPortal`,[aD,oD]=XE(iD,{forceMount:void 0}),sD=JE(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=eD(iD,t);return(0,R.jsx)(aD,{scope:t,forceMount:n,children:(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),cD=`PopoverContent`,lD=m.forwardRef(JE(function(e,t){let n=oD(cD,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=eD(cD,e.__scopePopover);return(0,R.jsx)(zy,{present:r||a.open,children:a.modal?(0,R.jsx)(dD,{...i,ref:t}):(0,R.jsx)(fD,{...i,ref:t})})},`PopoverContent`)),uD=Ov(`PopoverContent.RemoveScroll`),dD=m.forwardRef(JE(function(e,t){let n=eD(cD,e.__scopePopover),r=m.useRef(null),i=Tv(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return aS(e)},[]),(0,R.jsx)(Xx,{as:uD,allowPinchZoom:!0,children:(0,R.jsx)(pD,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:J(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:J(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;a.current=r},{checkForDefaultPrevented:!1}),onFocusOutside:J(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),fD=m.forwardRef(JE(function(e,t){let n=eD(cD,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,R.jsx)(pD,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`PopoverContentNonModal`)),pD=m.forwardRef(JE(function(e,t){let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:u,...d}=e,f=eD(cD,n),p=QE(n);return Vb(),(0,R.jsx)(Sb,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,R.jsx)(cE,{"data-state":mD(f.open),role:`dialog`,id:f.contentId,...p,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-popover-content-available-width":`var(--radix-popper-available-width)`,"--radix-popover-content-available-height":`var(--radix-popper-available-height)`,"--radix-popover-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-popover-trigger-height":`var(--radix-popper-anchor-height)`}})})})},`PopoverContentImpl`));function mD(e){return e?`open`:`closed`}JE(mD,`getState`);var hD=tD,gD=rD,_D=sD,vD=lD,yD=Object.defineProperty,bD=(e,t)=>yD(e,`name`,{value:t,configurable:!0}),xD=[` `,`Enter`,`ArrowUp`,`ArrowDown`],SD=[` `,`Enter`],CD=`Select`,[wD,TD,ED]=iy(CD),[DD,OD]=ey(CD,[ED,WT]),kD=WT(),[AD,jD]=DD(CD),[MD,ND]=DD(CD);function PD(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:h,internal_do_not_use_render:g}=e,_=kD(t),[v,y]=m.useState(null),[b,x]=m.useState(null),[S,C]=m.useState(!1),w=$y(l),[T,E]=jy({prop:r,defaultProp:i??!1,onChange:a,caller:CD}),[D,O]=jy({prop:o,defaultProp:s,onChange:c,caller:CD}),k=m.useRef(null),A=m.useRef(D);m.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=bD(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,O]);let ee=!v||!!h||!!v.closest(`form`),[j,M]=m.useState(new Set),te=Yy(),ne=Array.from(j).map(e=>e.props.value).join(`;`),N=m.useCallback(e=>{M(t=>new Set(t).add(e))},[]),re=m.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),ie={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:te,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:j,nativeSelectKey:ne,isFormControl:ee};return(0,R.jsx)(oE,{..._,children:(0,R.jsx)(AD,{scope:t,...ie,children:(0,R.jsx)(wD.Provider,{scope:t,children:(0,R.jsx)(MD,{scope:t,onNativeOptionAdd:N,onNativeOptionRemove:re,children:xO(g)?g(ie):n})})})})}bD(PD,`SelectProvider`);var FD=bD(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,R.jsx)(PD,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[n,e?(0,R.jsx)(bO,{__scopeSelect:t}):null]})})},`Select`),ID=`SelectTrigger`,LD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=kD(n),o=jD(ID,n),s=o.disabled||r,c=Tv(t,o.onTriggerChange),l=TD(n),u=m.useRef(`touch`),[d,f,p]=CO(e=>{let t=l().filter(e=>!e.disabled),n=wO(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),h=bD(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,R.jsx)(sE,{asChild:!0,...a,children:(0,R.jsx)(Gv.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":SO(o.value)?``:void 0,...i,ref:c,onClick:J(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&h(e)}),onPointerDown:J(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(h(e),e.preventDefault())}),onKeyDown:J(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&xD.includes(e.key)&&(h(),e.preventDefault())})})})},`SelectTrigger`)),RD=`SelectValue`,zD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=jD(RD,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Tv(t,c.onValueNodeChange);Sy(()=>{l(u)},[l,u]);let f=SO(c.value);return(0,R.jsx)(Gv.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,R.jsx)(m.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),BD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,R.jsx)(Gv.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[VD,HD]=DD(`SelectPortal`,{forceMount:void 0}),UD=bD(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,R.jsx)(VD,{scope:e.__scopeSelect,forceMount:n,children:(0,R.jsx)(Fb,{asChild:!0,...r})})},`SelectPortal`),WD=`SelectContent`,GD=m.forwardRef(bD(function(e,t){let n=HD(WD,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=jD(WD,e.__scopeSelect),[o,s]=m.useState();return Sy(()=>{s(new DocumentFragment)},[]),(0,R.jsx)(zy,{present:r||a.open,children:({present:e})=>e?(0,R.jsx)(ZD,{...i,ref:t}):(0,R.jsx)(KD,{...i,fragment:o})})},`SelectContent`)),KD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Hv.createPortal((0,R.jsx)(JD,{scope:n,children:(0,R.jsx)(wD.Slot,{scope:n,children:(0,R.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),qD=10,[JD,YD]=DD(WD),XD=Ov(`SelectContent.RemoveScroll`),ZD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:_,...v}=e,y=jD(WD,n),[b,x]=m.useState(null),[S,C]=m.useState(null),w=Tv(t,x),[T,E]=m.useState(null),[D,O]=m.useState(null),k=TD(n),[A,ee]=m.useState(!1),j=m.useRef(!1);m.useEffect(()=>{if(b)return aS(b)},[b]),Vb();let M=m.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),te=m.useCallback(()=>M([T,b]),[M,T,b]);m.useEffect(()=>{A&&te()},[A,te]);let{onOpenChange:ne,triggerPointerDownPosRef:N}=y;m.useEffect(()=>{if(b){let e={x:0,y:0},t=bD(t=>{e={x:Math.abs(Math.round(t.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(N.current?.y??0))}},`handlePointerMove`),n=bD(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ne(!1),document.removeEventListener(`pointermove`,t),N.current=null},`handlePointerUp`);return N.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,ne,N]),m.useEffect(()=>{let e=bD(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[re,ie]=CO(e=>{let t=k().filter(e=>!e.disabled),n=wO(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ae=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(j.current=!0))},[y.value]),oe=m.useCallback(()=>b?.focus(),[b]),se=m.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),ce=r===`popper`?$D:QD,le=ce===$D?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:_}:{};return(0,R.jsx)(JD,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ae,selectedItem:T,onItemLeave:oe,itemTextRefCallback:se,focusSelectedItem:te,selectedItemText:D,position:r,isPositioned:A,searchRef:re,children:(0,R.jsx)(Xx,{as:XD,allowPinchZoom:!0,children:(0,R.jsx)(Sb,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:J(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,R.jsx)(ce,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...le,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:J(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&ie(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),QD=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=jD(WD,n),o=YD(WD,n),[s,c]=m.useState(null),[l,u]=m.useState(null),d=Tv(t,u),f=TD(n),p=m.useRef(!1),h=m.useRef(!0),{viewport:g,selectedItem:_,selectedItemText:v,focusSelectedItem:y}=o,b=m.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&g&&_&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qD,d=KE(a,[qD,Math.max(qD,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-qD,d=KE(a,[qD,Math.max(qD,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-qD*2,u=g.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),h=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+h+u+b+y,S=Math.min(_.offsetHeight*5,x),C=window.getComputedStyle(g),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-qD,D=c-E,O=_.offsetHeight/2,k=_.offsetTop+O,A=m+h+k,ee=x-A;if(A<=E){let e=o.length>0&&_===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-g.offsetTop-g.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&_===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+g.offsetTop+(e?w:0)+O)+ee;s.style.height=t+`px`,g.scrollTop=A-E+g.offsetTop}s.style.margin=`${qD}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,g,_,v,a.dir,r]);Sy(()=>b(),[b]);let[x,S]=m.useState();Sy(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=m.useCallback(e=>{e&&h.current===!0&&(b(),y?.(),h.current=!1)},[b,y]);return(0,R.jsx)(eO,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,R.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,R.jsx)(Gv.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),$D=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=qD,...a}=e,o=kD(n);return(0,R.jsx)(cE,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[eO,tO]=DD(WD,{}),nO=`SelectViewport`,rO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=YD(nO,n),o=tO(nO,n),s=Tv(t,a.onViewportChange),c=m.useRef(0);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,R.jsx)(wD.Slot,{scope:n,children:(0,R.jsx)(Gv.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:J(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-qD*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[iO,aO]=DD(`SelectGroup`),oO=`SelectItem`,[sO,cO]=DD(oO),lO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=jD(oO,n),c=YD(oO,n),l=s.value===r,[u,d]=m.useState(a??``),[f,p]=m.useState(!1),h=Tv(t,nb(e=>c.itemRefCallback?.(e,r,i))),g=Yy(),_=m.useRef(`touch`),v=bD(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,R.jsx)(sO,{scope:n,value:r,disabled:i,textId:g,isSelected:l,onItemTextChange:m.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,R.jsx)(wD.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,R.jsx)(Gv.div,{role:`option`,"aria-labelledby":g,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:h,onFocus:J(o.onFocus,()=>p(!0)),onBlur:J(o.onBlur,()=>p(!1)),onClick:J(o.onClick,()=>{_.current!==`mouse`&&v()}),onPointerUp:J(o.onPointerUp,()=>{_.current===`mouse`&&v()}),onPointerDown:J(o.onPointerDown,e=>{_.current=e.pointerType}),onPointerMove:J(o.onPointerMove,e=>{_.current=e.pointerType,i?c.onItemLeave?.():_.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:J(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:J(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(SD.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),uO=`SelectItemText`,dO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=jD(uO,n),s=YD(uO,n),c=cO(uO,n),l=ND(uO,n),[u,d]=m.useState(null),f=nb(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Tv(t,d,c.onItemTextChange,f),h=u?.textContent,g=m.useMemo(()=>(0,R.jsx)(`option`,{value:c.value,disabled:c.disabled,children:h},c.value),[c.disabled,c.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=l;return Sy(()=>(_(g),()=>v(g)),[_,v,g]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Gv.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!SO(o.value)?Hv.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),fO=`SelectItemIndicator`,pO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,...r}=e;return cO(fO,n).isSelected?(0,R.jsx)(Gv.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),mO=`SelectScrollUpButton`,hO=m.forwardRef(bD(function(e,t){let n=YD(mO,e.__scopeSelect),r=tO(mO,e.__scopeSelect),[i,a]=m.useState(!1),o=Tv(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};bD(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(vO,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),gO=`SelectScrollDownButton`,_O=m.forwardRef(bD(function(e,t){let n=YD(gO,e.__scopeSelect),r=tO(gO,e.__scopeSelect),[i,a]=m.useState(!1),o=Tv(t,r.onScrollButtonChange);return Sy(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};bD(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,R.jsx)(vO,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),vO=m.forwardRef(bD(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=YD(`SelectScrollButton`,n),o=m.useRef(null),s=TD(n),c=m.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return m.useEffect(()=>()=>c(),[c]),Sy(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,R.jsx)(Gv.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:J(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:J(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:J(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),yO=`SelectBubbleInput`,bO=m.forwardRef(bD(function({__scopeSelect:e,...t},n){let r=jD(yO,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=m.useRef(null),h=Tv(n,p),g=i??``,_=UE(g),v=Array.from(d).some(e=>(e.props.value??``)===``);return m.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(_!==g&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,g),e.dispatchEvent(t)}},[_,g]),(0,R.jsxs)(Gv.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Yv,...t.style},ref:h,defaultValue:g,children:[SO(i)&&!v?(0,R.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function xO(e){return typeof e==`function`}bD(xO,`isFunction`);function SO(e){return e===``||e===void 0}bD(SO,`shouldShowPlaceholder`);function CO(e){let t=nb(e),n=m.useRef(``),r=m.useRef(0),i=m.useCallback(e=>{let i=n.current+e;t(i),bD((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=m.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}bD(CO,`useTypeaheadSearch`);function wO(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=TO(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}bD(wO,`findNextItem`);function TO(e,t){return e.map((n,r)=>e[(t+r)%e.length])}bD(TO,`wrapArray`);var EO=Object.defineProperty,DO=(e,t)=>EO(e,`name`,{value:t,configurable:!0}),OO=`Switch`,[kO,AO]=ey(OO),[jO,MO]=kO(OO);function NO(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=jy({prop:n,defaultProp:i??!1,onChange:c,caller:OO}),[h,g]=m.useState(null),[_,v]=m.useState(null),y=m.useRef(!1),[b,x]=m.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:h,setControl:g,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!h||!!o||!!h.closest(`form`),bubbleInput:_,setBubbleInput:v};return(0,R.jsx)(jO,{scope:t,...S,children:VO(d)?d(S):r})}DO(NO,`SwitchProvider`);var PO=`SwitchTrigger`,FO=m.forwardRef(DO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:h,bubbleInput:g}=MO(PO,e),_=Tv(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=DO(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,R.jsx)(Gv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":HO(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:J(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),IO=m.forwardRef(DO(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,R.jsx)(NO,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(FO,{...d,ref:t,__scopeSwitch:n}),e&&(0,R.jsx)(BO,{__scopeSwitch:n})]})})},`Switch`)),LO=`SwitchThumb`,RO=m.forwardRef(DO(function(e,t){let{__scopeSwitch:n,...r}=e,i=MO(LO,n);return(0,R.jsx)(Gv.span,{"data-state":HO(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),zO=`SwitchBubbleInput`,BO=m.forwardRef(DO(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:h,setBubbleInput:g}=MO(zO,e),_=Tv(r,g),v=cC(i),y=m.useRef(!1),b=m.useRef(s),x=m.useRef(o);m.useEffect(()=>{let e=h;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(s);return(0,R.jsx)(Gv.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:_,onClick:J(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function VO(e){return typeof e==`function`}DO(VO,`isFunction`);function HO(e){return e?`checked`:`unchecked`}DO(HO,`getState`);var UO=Object.defineProperty,WO=(e,t)=>UO(e,`name`,{value:t,configurable:!0}),GO=`Tabs`,[KO,qO]=ey(GO,[DE]),JO=DE(),[YO,XO]=KO(GO),ZO=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,u=$y(s),[d,f]=jy({prop:r,onChange:i,defaultProp:a??``,caller:GO});return(0,R.jsx)(YO,{scope:n,baseId:Yy(),value:d,onValueChange:f,orientation:o,dir:u,activationMode:c,children:(0,R.jsx)(Gv.div,{dir:u,"data-orientation":o,...l,ref:t})})},`Tabs`)),QO=`TabsList`,$O=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,loop:r=!0,...i}=e,a=XO(QO,n),o=JO(n);return(0,R.jsx)(zE,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,R.jsx)(Gv.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})},`TabsList`)),ek=`TabsTrigger`,tk=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=XO(ek,n),s=JO(n),c=ik(o.baseId,r),l=ak(o.baseId,r),u=r===o.value;return(0,R.jsx)(BE,{asChild:!0,...s,focusable:!i,active:u,children:(0,R.jsx)(Gv.button,{type:`button`,role:`tab`,"aria-selected":u,"aria-controls":l,"data-state":u?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:J(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:J(e.onKeyDown,e=>{i||e.target!==e.currentTarget||[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:J(e.onFocus,()=>{let e=o.activationMode!==`manual`;!u&&!i&&e&&o.onValueChange(r)})})})},`TabsTrigger`)),nk=`TabsContent`,rk=m.forwardRef(WO(function(e,t){let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=XO(nk,n),c=ik(s.baseId,r),l=ak(s.baseId,r),u=r===s.value,d=m.useRef(u);return m.useEffect(()=>{let e=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,R.jsx)(zy,{present:i||u,children:({present:n})=>(0,R.jsx)(Gv.div,{"data-state":u?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:l,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:d.current?`0s`:void 0},children:n&&a})})},`TabsContent`));function ik(e,t){return`${e}-trigger-${t}`}WO(ik,`makeTriggerId`);function ak(e,t){return`${e}-content-${t}`}WO(ak,`makeContentId`);var ok=ZO,sk=$O,ck=tk,lk=rk,uk=Object.defineProperty,dk=(e,t)=>uk(e,`name`,{value:t,configurable:!0}),[fk,pk]=ey(`Tooltip`,[WT]),mk=WT(),hk=`TooltipProvider`,gk=700,_k=`tooltip.open`,[vk,yk]=fk(hk),bk=dk(e=>{let{__scopeTooltip:t,delayDuration:n=gk,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=m.useRef(!0),s=m.useRef(!1),c=m.useRef(0);return m.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,R.jsx)(vk,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:m.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:m.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),xk=`Tooltip`,[Sk,Ck]=fk(xk),wk=dk(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=yk(xk,e.__scopeTooltip),l=mk(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=Yy(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=jy({prop:r,defaultProp:i??!1,onChange:dk(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(_k))):c.onClose(),a?.(e)},`onChange`),caller:xk}),S=m.useMemo(()=>b?y.current?`delayed-open`:`instant-open`:`closed`,[b]),C=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,x(!0)},[x]),w=m.useCallback(()=>{window.clearTimeout(g.current),g.current=0,x(!1)},[x]),T=m.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,x(!0),g.current=0},v)},[v,x]);m.useEffect(()=>()=>{g.current&&=(window.clearTimeout(g.current),0)},[]);let E=f??h;return(0,R.jsx)(oE,{...l,children:(0,R.jsx)(Sk,{scope:t,contentId:E,setContentId:p,open:b,stateAttribute:S,trigger:u,onTriggerChange:d,onTriggerEnter:m.useCallback(()=>{c.isOpenDelayedRef.current?T():C()},[c.isOpenDelayedRef,T,C]),onTriggerLeave:m.useCallback(()=>{_?w():(window.clearTimeout(g.current),g.current=0)},[w,_]),onOpen:C,onClose:w,disableHoverableContent:_,children:n})})},`Tooltip`),Tk=`TooltipTrigger`,Ek=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,...r}=e,i=Ck(Tk,n),a=yk(Tk,n),o=mk(n),s=Tv(t,m.useRef(null),i.onTriggerChange),c=m.useRef(!1),l=m.useRef(!1),u=m.useCallback(()=>c.current=!1,[]);return m.useEffect(()=>()=>document.removeEventListener(`pointerup`,u),[u]),(0,R.jsx)(sE,{asChild:!0,...o,children:(0,R.jsx)(Gv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:J(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:J(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:J(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:J(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:J(e.onBlur,i.onClose),onClick:J(e.onClick,i.onClose)})})},`TooltipTrigger`)),Dk=`TooltipPortal`,[Ok,kk]=fk(Dk,{forceMount:void 0}),Ak=dk(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ck(Dk,t);return(0,R.jsx)(Ok,{scope:t,forceMount:n,children:(0,R.jsx)(zy,{present:n||a.open,children:(0,R.jsx)(Fb,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),jk=`TooltipContent`,Mk=m.forwardRef(dk(function(e,t){let n=kk(jk,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ck(jk,e.__scopeTooltip);return(0,R.jsx)(zy,{present:r||o.open,children:o.disableHoverableContent?(0,R.jsx)(Fk,{side:i,...a,ref:t}):(0,R.jsx)(Nk,{side:i,...a,ref:t})})},`TooltipContent`)),Nk=m.forwardRef(dk(function(e,t){let n=Ck(jk,e.__scopeTooltip),r=yk(jk,e.__scopeTooltip),i=m.useRef(null),a=Tv(t,i),[o,s]=m.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:d}=r,f=m.useCallback(()=>{s(null),d(!1)},[d]),p=m.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Rk(r,Lk(r,n.getBoundingClientRect())),a=zk(t.getBoundingClientRect()),o=Vk([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=dk(e=>p(e,u),`handleTriggerLeave`),t=dk(e=>p(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,p,f]),m.useEffect(()=>{if(o){let e=dk(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!Bk(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,R.jsx)(Fk,{...e,ref:a})},`TooltipContentHoverable`)),Pk=jv(`TooltipContent`),Fk=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Ck(jk,n),u=mk(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(_k,d),()=>document.removeEventListener(_k,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=dk(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&d()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,d]);let{setContentId:f}=l;return Sy(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,R.jsx)(ub,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,R.jsxs)(cE,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,R.jsx)(Pk,{children:r}),i?(0,R.jsx)(Xv,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),Ik=m.forwardRef(dk(function(e,t){let{__scopeTooltip:n,...r}=e,i=mk(n);return(0,R.jsx)(lE,{...i,...r,ref:t})},`TooltipArrow`));function Lk(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}dk(Lk,`getExitSideFromRect`);function Rk(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}dk(Rk,`getPaddedExitPoints`);function zk(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}dk(zk,`getPointsFromRect`);function Bk(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}dk(Bk,`isPointInPolygon`);function Vk(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),Hk(t)}dk(Vk,`getHull`);function Hk(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}dk(Hk,`getHullPresorted`);var Uk=bk,Wk=wk,Gk=Ek,Kk=Ak,qk=Mk,Jk=Ik,Yk=Jg(`group/button motion-reduce:transition-none motion-reduce:active:translate-none inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-[0.8125rem] font-medium whitespace-nowrap transition-[transform,background-color,box-shadow,color,border-color,filter] duration-150 active:not-aria-[haspopup]:translate-y-px ease-snap outline-none select-none focus-visible:outline-2 focus-visible:outline-solid focus-visible:outline-offset-2 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`btn-tint text-primary-foreground [--tint:var(--primary)] disabled:text-muted-foreground`,soft:`btn-raised btn-soft text-foreground`,outline:`btn-raised bg-card text-foreground`,secondary:`btn-raised bg-card text-secondary-foreground`,ghost:`btn-ghost text-foreground`,destructive:`btn-tint text-background [--tint:var(--destructive)] focus-visible:outline-destructive disabled:text-muted-foreground`,link:`text-link underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-3`,xs:`h-7 gap-1 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1.5 px-2.5 text-xs [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-2 px-4`,icon:`size-8`,"icon-xs":`size-7 [&_svg:not([class*='size-'])]:size-3.5`,"icon-sm":`size-7`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function Y({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?kv:`button`;return(0,R.jsx)(a,{"aria-keyshortcuts":r?void 0:`Enter Space`,"aria-description":r?`When focused, press Enter to activate.`:`When focused, press Enter or Space to activate.`,"aria-describedby":`focused-action-help`,"data-slot":`button`,"data-variant":t,"data-size":n,className:q(Yk({variant:t,size:n,className:e})),...i})}var Xk=q(`pointer-events-none inline-flex h-[1.125rem] min-w-[1.125rem] w-fit items-center justify-center gap-1 rounded-[5px] border border-border bg-background px-1 font-sans text-[0.7rem] leading-none font-medium text-muted-foreground shadow-[inset_0_-1px_0_var(--border)] select-none`,`in-data-[slot=tooltip-content]:border-background/25 in-data-[slot=tooltip-content]:bg-transparent in-data-[slot=tooltip-content]:text-background in-data-[slot=tooltip-content]:shadow-none`,`in-data-[variant=default]:border-primary-foreground/35 in-data-[variant=default]:bg-primary-foreground/10 in-data-[variant=default]:text-primary-foreground in-data-[variant=default]:shadow-none`,`in-data-[variant=destructive]:border-background/40 in-data-[variant=destructive]:bg-background/10 in-data-[variant=destructive]:text-background in-data-[variant=destructive]:shadow-none`,`[&_svg:not([class*='size-'])]:size-3`);function Zk({className:e,...t}){return(0,R.jsx)(`kbd`,{"data-slot":`kbd`,className:q(Xk,e),...t})}function Qk({className:e,...t}){return(0,R.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var $k=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),eA={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},tA={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function nA(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return $k&&eA[t]?eA[t]:tA[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function rA({chord:e,className:t}){let n=nA(e);return(0,R.jsx)(Qk,{className:t,children:n.map((e,t)=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,R.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,R.jsx)(Zk,{children:e})]},t))})}function iA({chord:e,children:t,className:n}){return(0,R.jsxs)(`span`,{className:q(`kbd-hint inline-flex shrink-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,n),children:[(0,R.jsx)(rA,{chord:e}),t]})}function aA(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>fe.subscribe(t),[]),e}function oA(){return aA(),fe.status()}function sA(e){return aA(),fe.get(e)}function cA(e){let t=(0,m.useCallback)(t=>{let n=window.matchMedia(e);return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},[e]),n=(0,m.useCallback)(()=>window.matchMedia(e).matches,[e]);return(0,m.useSyncExternalStore)(t,n)}function lA(){return cA(`(max-width: 767.98px) and (orientation: landscape) and (max-height: 500px)`)}var uA={keyboardOpen:!1,keyboardInset:0},dA=`(max-width: 767.98px)`,fA=100,pA=new Set([`button`,`checkbox`,`color`,`date`,`datetime-local`,`file`,`hidden`,`image`,`month`,`radio`,`range`,`reset`,`submit`,`time`,`week`]);function mA(e){return typeof HTMLTextAreaElement<`u`&&e instanceof HTMLTextAreaElement}function hA(e){return typeof HTMLInputElement<`u`&&e instanceof HTMLInputElement}function gA(e){if(!(typeof HTMLElement<`u`&&e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.closest(`[contenteditable]`);return t!==null&&t.getAttribute(`contenteditable`)!==`false`}function _A(e){return mA(e)?!e.disabled&&!e.readOnly:hA(e)?!e.disabled&&!e.readOnly&&!pA.has(e.type):gA(e)}function vA(e,t){return Number.isFinite(e)&&e>0?e:t}function yA(){return vA(window.innerHeight,0)}function bA(e){let t=yA();return vA(e?.height??t,t)}function xA(e){return Math.max(yA(),bA(e))}function SA(e){return e?.matches??window.innerWidth<768}function CA(e,t,n){if(!e)return Math.max(0,n-t);let r=yA()||n,i=Number.isFinite(e.offsetTop)?Math.max(0,e.offsetTop):0;return Math.max(0,r-t-i)}function wA(e,t){return e.keyboardOpen===t.keyboardOpen&&e.keyboardInset===t.keyboardInset}function TA(e,t){e(e=>wA(e,t)?e:t)}function EA(){return{media:typeof window.matchMedia==`function`?window.matchMedia(dA):null,viewport:window.visualViewport??null}}function DA(e){return{phone:SA(e.media),baseline:xA(e.viewport),resetting:!1}}function OA(e,t,n){return!t.phone||t.resetting||!_A(document.activeElement)||t.baseline-n<fA?uA:{keyboardOpen:!0,keyboardInset:CA(e.viewport,n,t.baseline)}}function kA(e,t,n){let r=bA(e.viewport),i=SA(e.media);if(i!==t.phone){t.phone=i,t.baseline=xA(e.viewport),t.resetting=!0,TA(n,uA);return}if(!i||t.resetting){t.baseline=xA(e.viewport),t.resetting=!1,TA(n,uA);return}t.baseline=Math.max(t.baseline,xA(e.viewport)),TA(n,OA(e,t,r))}function AA(e,t,n){t.baseline=xA(e.viewport),t.resetting=!0,TA(n,uA)}function jA(e){e.current!==void 0&&(typeof window.cancelAnimationFrame==`function`?window.cancelAnimationFrame(e.current):window.clearTimeout(e.current),e.current=void 0)}function MA(e,t){jA(t),t.current=typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(e):window.setTimeout(e,0)}function NA(e,t,n){return e?(e.addEventListener(t,n),()=>e.removeEventListener(t,n)):()=>{}}function PA(e,t,n,r){return[NA(window,`focusin`,t),NA(window,`focusout`,t),NA(window,`resize`,t),NA(window,`orientationchange`,n),NA(e.media,`change`,r),NA(e.viewport,`resize`,t),NA(e.viewport,`scroll`,t)]}function FA(e,t,n,r){e.current=void 0,kA(t,n,r)}function IA(e,t,n,r){AA(e,t,n),r()}function LA(e,t,n,r){t.phone=SA(e.media),AA(e,t,n),r()}function RA(e,t){jA(e),t.forEach(e=>e())}function zA(e){let t=EA(),n=DA(t),r={},i=()=>FA(r,t,n,e),a=()=>MA(i,r),o=PA(t,a,()=>IA(t,n,e,a),()=>LA(t,n,e,a));return a(),()=>RA(r,o)}function BA(){let[e,t]=(0,m.useState)(uA);return(0,m.useEffect)(()=>zA(t),[]),e}function VA(e,t,n){if(!e||typeof window>`u`)return;let r=window.visualViewport,i=r?.height??Math.max(0,window.innerHeight-(t?n:0));return{wrapper:{top:`${Math.max(0,r?.offsetTop??0)}px`,bottom:`auto`,height:`${i}px`},content:{width:`calc(100vw - 24px)`,maxWidth:`calc(100vw - 24px)`,maxHeight:`${Math.max(0,i-32)}px`}}}function HA({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=xf(),u=cA(`(max-width: 767.98px)`),{keyboardOpen:d,keyboardInset:f}=BA(),p=VA(u,d,f);return(0,R.jsx)(pS,{open:e,onOpenChange:t,children:(0,R.jsx)(Du,{children:e?(0,R.jsxs)(yS,{forceMount:!0,children:[(0,R.jsx)(xS,{asChild:!0,forceMount:!0,children:(0,R.jsx)(B.div,{className:`fixed inset-0 z-50 bg-scrim backdrop-blur-sm`,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.16,ease:`easeOut`}})}),(0,R.jsx)(`div`,{className:q(`pointer-events-none fixed inset-0 z-50 grid place-items-center`,u?`p-3`:`p-4`),style:p?.wrapper,children:(0,R.jsx)(TS,{asChild:!0,forceMount:!0,onCloseAutoFocus:s,onInteractOutside:e=>{i||e.preventDefault()},onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[data-nav], [data-autofocus], textarea`);t&&(e.preventDefault(),t.focus())},...r?{}:{"aria-describedby":void 0},children:(0,R.jsxs)(B.div,{className:q(`glass-pop pointer-events-auto flex max-h-[min(86svh,48rem)] w-full max-w-2xl flex-col overflow-hidden rounded-xl outline-none`,a),style:{...o,...p?.content??{}},initial:{opacity:0,scale:l?1:.92,y:l?0:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:l?1:.96,y:l?0:8,transition:{duration:.12,ease:`easeIn`}},transition:{type:`spring`,stiffness:460,damping:32,mass:.9},children:[(0,R.jsx)(AS,{className:`sr-only`,children:n}),r?(0,R.jsx)(MS,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var UA=[],WA=0,GA=new Set;function KA(){for(let e of[...GA])e()}function qA(e){return GA.add(e),()=>{GA.delete(e)}}function JA(){let e;for(let t of UA)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var YA={question:30,confirm:20,help:10,sheet:5};function XA(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return UA=[...UA,{id:n,priority:t,order:++WA}],KA(),()=>{UA=UA.filter(e=>e.id!==n),KA()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(qA,JA,()=>void 0);return e&&r===n}function ZA(){return UA.length>0}function QA(){return(0,m.useSyncExternalStore)(qA,()=>UA.length>0,()=>!1)}var $A=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],ej=`already answered in another window`,tj=`Attached files:`,nj=new Set($A);function rj(e){let t=e.replace(/^#\/?/,``).split(`/`).filter(Boolean),n=t[0];if(!n||n===`lobby`)return{kind:`tab`,tab:`lobby`,rest:t.slice(1)};if(n===`settings`)return{kind:`settings`};if(n===`sessions`)return{kind:`sessions`,...t[1]?{key:t[1]}:{}};if(nj.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function ij(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function aj(e){window.location.hash!==e&&(window.location.hash=e)}function oj(){let[e,t]=(0,m.useState)(()=>rj(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=rj(window.location.hash);e?t(e):(window.history.replaceState(null,``,`#/lobby`),t({kind:`tab`,tab:`lobby`,rest:[]}))};return e(),window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]),e}function sj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty`,className:q(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 p-6 text-center text-balance`,e),...t})}function cj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var lj=Jg(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`flex size-10 shrink-0 items-center justify-center rounded-xl bg-muted text-muted-foreground [&_svg:not([class*='size-'])]:size-5`}},defaultVariants:{variant:`default`}});function uj({className:e,variant:t=`default`,...n}){return(0,R.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(lj({variant:t,className:e})),...n})}function dj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function fj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`empty-description`,className:q(`text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}function pj({className:e,...t}){return(0,R.jsx)(`span`,{"data-slot":`spinner`,role:`status`,"aria-label":`Loading`,className:q(`inline-flex size-4 shrink-0 items-end justify-between text-primary`,e),...t,children:[0,1,2].map(e=>(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`block aspect-square h-[28%] shrink-0 rounded-full bg-current motion-safe:animate-[hop_0.9s_ease-in-out_infinite]`,style:{animationDelay:`${e*.14}s`}},e))})}var mj=Jg([`relative w-full text-sm border has-[>svg]:grid-cols-[calc(var(--spacing)*3)_1fr] grid-cols-[0_1fr] grid gap-y-0.5 items-center [&>svg:not([class*=size-])]:size-4`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_[data-slot=alert-action]]:sm:row-end-3`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:items-start`,`has-[>[data-slot=alert-title]+[data-slot=alert-description]]:[&_svg]:translate-y-0.5`,`rounded-lg`,`px-3`,`py-2.5`,`has-[>svg]:gap-x-2.5`],{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`border-destructive/30 bg-destructive/4 [&>svg]:text-destructive`,info:`border-info/30 bg-info/4 [&>svg]:text-info`,success:`border-success/30 bg-success/4 [&>svg]:text-success`,warning:`border-warning/30 bg-warning/4 [&>svg]:text-warning`,invert:`border-invert bg-invert text-invert-foreground [&_[data-slot=alert-description]]:text-invert-foreground/70`}},defaultVariants:{variant:`default`}});function hj({className:e,variant:t,...n}){return(0,R.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:q(mj({variant:t}),e),...n})}function gj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-description`,className:q(`text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed`,e),...t})}function _j({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-action`,className:q(`flex gap-1.5 max-sm:col-start-2 max-sm:mt-2 max-sm:justify-start sm:col-start-3 sm:row-start-1 sm:justify-end sm:self-center`,e),...t})}function vj({label:e=`Connecting…`}){return(0,R.jsxs)(`div`,{className:`flex min-h-48 min-w-0 w-full max-w-full flex-1 items-center justify-center gap-2 overflow-y-auto px-4 py-8 text-sm text-muted-foreground max-md:min-h-32 max-md:text-center`,children:[(0,R.jsx)(pj,{}),(0,R.jsx)(`span`,{children:e})]})}function yj({message:e,onRetry:t}){return(0,R.jsxs)(sj,{className:`m-4 min-h-0 min-w-0 flex-1 overflow-y-auto max-md:m-2 max-md:max-h-full max-md:px-2`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsxs)(dj,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Tg,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,R.jsx)(fj,{children:e??`The request failed. Try again.`})]}),t?(0,R.jsxs)(Y,{variant:`outline`,onClick:t,children:[(0,R.jsx)(Zh,{"aria-hidden":`true`}),`Try again`]}):null]})}function bj({onRetry:e}){return(0,R.jsxs)(hj,{variant:`destructive`,role:`status`,className:`mx-3 mb-1 max-h-32 w-auto min-w-0 overflow-y-auto max-sm:mx-2 max-md:items-start`,children:[(0,R.jsx)(Lg,{className:`size-4`,"aria-hidden":`true`}),(0,R.jsx)(gj,{children:`Lost pi — reconnecting every 2 s. Your planning session and tasks carry on when it is back.`}),e?(0,R.jsx)(_j,{children:(0,R.jsx)(Y,{variant:`link`,className:`h-8 px-1 text-destructive max-md:h-auto max-md:min-h-11`,onClick:e,children:`Retry now`})}):null]})}function xj(e,t,n,r=!0){aA();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[fe.status().connection,...n.map(e=>fe.get(e).version)].join(`,`),l=JSON.stringify(t);(0,m.useEffect)(()=>{if(!r)return;let t=!0,n=performance.now();return a(e=>({...e,loading:!0})),Te(e,JSON.parse(l)).then(e=>t&&a({data:e,loading:!1,at:n}),e=>t&&a(t=>({...t,error:e instanceof Error?e.message:String(e),loading:!1}))),()=>{t=!1}},[e,l,c,o,r]);let u=(0,m.useCallback)(()=>s(e=>e+1),[]);return{data:i.data,error:i.error,loading:i.loading,requestedAt:i.at,reload:u}}function Sj({delayDuration:e=400,...t}){return(0,R.jsx)(Uk,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function Cj({...e}){return(0,R.jsx)(Wk,{"data-slot":`tooltip`,...e})}function wj({...e}){return(0,R.jsx)(Gk,{"data-slot":`tooltip-trigger`,...e})}function Tj({className:e,sideOffset:t=6,children:n,...r}){return(0,R.jsx)(Kk,{children:(0,R.jsxs)(qk,{"data-slot":`tooltip-content`,sideOffset:t,className:q(`z-50 inline-flex w-fit max-w-xs origin-(--radix-tooltip-content-transform-origin) items-center gap-1.5 rounded-md bg-foreground px-2.5 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-lg data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[n,(0,R.jsx)(Jk,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function Ej(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function Dj(e,t,n){let r=Ej(e);if(r.length===0)return!1;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1,a=r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))];return!a||a===t?!1:(a.focus({preventScroll:!1}),!0)}function Oj(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function kj(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function Aj(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var jj=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function Mj(e){return[...e.querySelectorAll(jj)].filter(e=>e.offsetParent!==null)}function Nj(e,t,n){let r=Mj(e);if(r.length===0)return;let i=t?r.findIndex(e=>e===t||e.contains(t)):-1;r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?n>0?-1:r.length:i)+n))]?.focus()}function Pj(e,t=document.querySelector(`[data-pane='list']`)){if(!t)return;let n=[...t.querySelectorAll(`button[data-row]`)].filter(e=>e.offsetParent!==null),r=n.findIndex(e=>e.getAttribute(`aria-current`)===`true`),i=Math.max(0,Math.min(n.length-1,r<0?e>0?0:n.length-1:r+e));n[i]?.click(),n[i]?.focus({preventScroll:!0}),n[i]?.scrollIntoView({block:`nearest`})}function Fj(e){return e.querySelector(`[aria-current='true']`)??Mj(e)[0]}function Ij(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?Fj(t):void 0)??Mj(e)[0]??e).focus(),!0}function Lj(){let e=document.querySelector(`[role='tab'][aria-selected='true']`);if(e)return e.focus({preventScroll:!0}),!0;let t=document.getElementById(`main`);return t?.focus({preventScroll:!0}),!!t}var Rj={active:!1},zj=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function Bj(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!zj.has(t)}function Vj(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function Hj(){return ZA()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function Uj(e,t,{enabled:n=!0,inDialog:r=!1}={}){let i=(0,m.useRef)(t);i.current=t,(0,m.useEffect)(()=>{if(!n||!e)return;let t=t=>{t.defaultPrevented||t.isComposing||t.repeat||t.altKey||t.ctrlKey||t.metaKey||t.shiftKey||Vj(t,e)&&(Oj(t.target)||(r||!Hj())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var Wj={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function X({label:e,icon:t,tone:n=`neutral`,shortcut:r,href:i,pressed:a,text:o,iconOnly:s,className:c,disabled:l,...u}){let d=(0,m.useRef)(null),f=Bj(r);Uj(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,R.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`&&!s,g=s?n===`primary`?`default`:`ghost`:`outline`,_=q(!s&&`px-2.5`,s?`max-md:size-11`:`max-md:min-h-11 max-md:min-w-11 max-md:h-auto max-md:whitespace-normal`,h&&`obsidian-discover-button`,Wj[n],c),v=s?`icon`:`default`,y=s?p:h?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`obsidian-discover-button__fill`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`obsidian-discover-button__icon`,children:p}),(0,R.jsxs)(`span`,{className:`obsidian-discover-button__text`,children:[o??e,r?(0,R.jsx)(rA,{chord:r,className:`kbd-hint ml-1 max-md:hidden`}):null]})]}):(0,R.jsxs)(R.Fragment,{children:[p,(0,R.jsx)(`span`,{children:o??e}),r?(0,R.jsx)(rA,{chord:r,className:`kbd-hint ml-1 max-md:hidden`}):null]}),b=i?(0,R.jsx)(Y,{asChild:!0,ref:d,variant:g,size:v,"data-tone":n,className:_,children:(0,R.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:y})}):(0,R.jsx)(Y,{ref:d,type:`button`,variant:g,size:v,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:_,...u,children:y});return s?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:b}),(0,R.jsxs)(Tj,{children:[e,(0,R.jsx)(rA,{chord:r??(i?`Enter`:`Enter / Space`),className:`max-md:hidden`})]})]}):b}function Gj({children:e,className:t}){function n(e){let t=e.key===`ArrowRight`?1:e.key===`ArrowLeft`?-1:0;if(!t)return;let n=[...e.currentTarget.querySelectorAll(`button:not([disabled]), a[href]`)],r=n.indexOf(e.target);r<0||(e.preventDefault(),e.stopPropagation(),n[Math.max(0,Math.min(n.length-1,r+t))]?.focus())}return(0,R.jsx)(`div`,{role:`toolbar`,"aria-label":`Actions`,onKeyDown:n,className:q(`sticky -top-5 z-10 -mx-5 -mt-5 flex min-h-12 flex-wrap items-center gap-1 border-b border-border bg-[var(--workspace-card)] px-4 py-2 [&>[data-tone=danger]:not(:first-child)]:ml-auto max-md:static max-md:z-auto max-md:mx-0 max-md:mt-0 max-md:min-h-11 max-md:gap-2 max-md:border-b-0 max-md:bg-transparent max-md:px-0 max-md:py-1 max-md:backdrop-blur-none`,t),children:e})}function Kj({...e}){return(0,R.jsx)(pS,{"data-slot":`sheet`,...e})}function qj({...e}){return(0,R.jsx)(PS,{"data-slot":`sheet-close`,...e})}function Jj({...e}){return(0,R.jsx)(yS,{"data-slot":`sheet-portal`,...e})}function Yj({className:e,...t}){return(0,R.jsx)(xS,{"data-slot":`sheet-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Xj({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,R.jsxs)(Jj,{forceMount:i,children:[a?null:(0,R.jsx)(Yj,{}),(0,R.jsxs)(TS,{forceMount:i,hidden:a,"data-slot":`sheet-content`,"data-side":n,className:q(`glass-pop fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm transition duration-200 ease-in-out data-[side=right]:rounded-l-xl data-[side=left]:rounded-r-xl data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,e),...o,children:[t,r&&(0,R.jsx)(PS,{"data-slot":`sheet-close`,asChild:!0,children:(0,R.jsxs)(Y,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,R.jsx)(Vg,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function Zj({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function Qj({className:e,...t}){return(0,R.jsx)(AS,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function $j({className:e,...t}){return(0,R.jsx)(MS,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function eM(){return cA(`(min-width: 1024px)`)}function tM({className:e,...t}){return(0,R.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function nM({open:e,onClose:t,describe:n,children:r}){let i=XA(e,YA.sheet),a=cA(`(max-width: 767.98px)`),o=(0,m.useRef)(!1);return i&&(o.current=!0),e||(o.current=!1),(0,R.jsx)(Kj,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,R.jsxs)(Xj,{forceMount:e&&o.current?!0:void 0,hidden:!i,showCloseButton:!1,side:a?`bottom`:`right`,className:q(`gap-0`,a?`data-[side=bottom]:inset-0 data-[side=bottom]:h-full data-[side=bottom]:max-w-none data-[side=bottom]:rounded-none`:`data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,R.jsxs)(Zj,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,R.jsx)(Qj,{className:`text-sm`,children:`Detail`}),(0,R.jsx)($j,{className:`sr-only`,children:n}),(0,R.jsx)(qj,{asChild:!0,children:(0,R.jsxs)(Y,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:q(`gap-2`,a&&`h-11 px-3 text-sm`),children:[(0,R.jsx)(Vg,{"aria-hidden":`true`}),`Close`,a?null:(0,R.jsx)(rA,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,R.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function rM({list:e,detail:t,open:n,detailClassName:r,listPane:i,detailPane:a,onListKey:o,onDetailKey:s}){let c=n&&t!==null;return(0,R.jsxs)(`div`,{className:q(`grid min-h-0 min-w-0 flex-1`,c?`grid-rows-[minmax(0,1fr)_minmax(0,2fr)]`:`grid-rows-1`),children:[(0,R.jsx)(tM,{"data-pane":`list`,ref:i,onKeyDown:o,className:q(`min-w-0 overflow-x-hidden overflow-y-auto`,c?`border-b border-border`:`pb-dock`),children:e}),c?(0,R.jsx)(tM,{"data-pane":`detail`,ref:a,"aria-label":`Detail`,tabIndex:0,onKeyDown:s,className:q(`min-w-0 overflow-x-hidden overflow-y-auto px-5 pt-5 pb-dock`,r),children:t}):null]})}function iM({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o,inlineDetail:s,detailClassName:c}){let l=(0,m.useRef)(null),u=(0,m.useRef)(null);function d(t){let n=l.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||ZA()||t.altKey||t.ctrlKey||t.metaKey||Oj(t.target)||t.target instanceof HTMLInputElement)return;let r=kj(t.key,!1);r?(t.preventDefault(),Nj(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),Nj(n,t.target,t.key===`Home`?`first`:`last`)):(e||s)&&Aj(t.key)===1&&u.current&&(t.preventDefault(),u.current.focus())}function f(e){e.defaultPrevented||e.nativeEvent.isComposing||ZA()||e.altKey||e.ctrlKey||e.metaKey||Oj(e.target)||Aj(e.key)===-1&&l.current&&(e.preventDefault(),Fj(l.current)?.focus())}return!e&&s?(0,R.jsx)(rM,{list:t,detail:n,open:r,detailClassName:c,listPane:l,detailPane:u,onListKey:d,onDetailKey:f}):e?(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)] gap-3 p-3`,children:[(0,R.jsx)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:(0,R.jsx)(tM,{"data-pane":`list`,ref:l,onKeyDown:d,className:`h-full overflow-y-auto pb-dock`,children:t})}),(0,R.jsx)(`div`,{className:`workspace-pane min-h-0 min-w-0 overflow-hidden rounded-xl border shadow-xs`,children:(0,R.jsx)(tM,{"data-pane":`detail`,ref:u,tabIndex:0,"aria-label":`Detail`,onKeyDown:f,className:q(`h-full overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,c),children:n??(0,R.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,R.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,R.jsx)(Dh,{className:`size-5`})}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,R.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(rA,{chord:`ArrowUp`}),(0,R.jsx)(rA,{chord:`ArrowDown`}),`move`]}),(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,R.jsx)(rA,{chord:`ArrowRight`}),`open`]})]})]})})})})]}):(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,R.jsx)(tM,{"data-pane":`list`,ref:l,onKeyDown:d,className:`max-md:shrink-0`,children:t}),(0,R.jsx)(nM,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function aM({title:e,count:t,children:n}){return(0,R.jsxs)(`div`,{className:`sticky top-0 z-10 flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-b border-border bg-[var(--workspace-card)] px-4 py-2 max-md:static max-md:z-auto max-md:bg-transparent max-md:px-3 max-md:py-2 max-md:backdrop-blur-none`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,R.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function oM(){return(0,R.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function sM({className:e,...t}){return(0,R.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-background px-3.5 py-2.5 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...t})}function cM(e){return e<10?`0${e}`:String(e)}function lM(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${cM(t.getHours())}:${cM(t.getMinutes())}`}function uM(e){if(!Number.isFinite(e)||e<5e3)return`now`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);if(n<60)return`${n}m`;let r=Math.floor(n/60);return r<48?`${r}h`:`${Math.floor(r/24)}d`}function dM(e){let t=uM(e);return t===`now`?`just now`:`${t} ago`}function fM({...e}){return(0,R.jsx)(QS,{"data-slot":`alert-dialog`,...e})}function pM({...e}){return(0,R.jsx)($S,{"data-slot":`alert-dialog-portal`,...e})}function mM({className:e,...t}){return(0,R.jsx)(eC,{"data-slot":`alert-dialog-overlay`,className:q(`fixed inset-0 z-50 bg-scrim backdrop-blur-sm duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function hM({className:e,...t}){return(0,R.jsxs)(pM,{children:[(0,R.jsx)(mM,{}),(0,R.jsx)(tC,{"data-slot":`alert-dialog-content`,className:q(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 glass-pop rounded-xl p-5 text-sm duration-150 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...t})]})}function gM({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function _M({className:e,...t}){return(0,R.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function vM({className:e,...t}){return(0,R.jsx)(iC,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function yM({className:e,...t}){return(0,R.jsx)(aC,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function bM({className:e,variant:t=`default`,...n}){return(0,R.jsx)(Y,{variant:t,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,R.jsx)(nC,{"data-slot":`alert-dialog-action`,...n})})}function xM({className:e,...t}){return(0,R.jsx)(Y,{variant:`outline`,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,R.jsx)(rC,{"data-slot":`alert-dialog-cancel`,...t})})}function SM({label:e,text:t,shortcut:n,title:r,description:i,confirmLabel:a,onConfirm:o,icon:s,disabled:c,variant:l=`outline`,iconOnly:u,compact:d}){let[f,p]=(0,m.useState)(!1),h=XA(f,YA.confirm),g=l===`destructive`;return Uj(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,R.jsxs)(fM,{open:f&&h,onOpenChange:p,children:[(0,R.jsx)(X,{label:e,icon:s,tone:g?`danger`:`neutral`,disabled:c,shortcut:n,iconOnly:u,...d?{"data-compact":!0,className:`size-8`}:{},...t?{text:t}:{},onClick:()=>p(!0)}),(0,R.jsxs)(hM,{children:[(0,R.jsxs)(gM,{children:[(0,R.jsx)(vM,{children:r}),(0,R.jsx)(yM,{children:i})]}),(0,R.jsxs)(_M,{children:[(0,R.jsxs)(xM,{className:`max-md:min-h-11 max-md:whitespace-normal`,children:[`Keep it`,(0,R.jsx)(rA,{chord:`Esc`,className:`kbd-hint ml-1 max-md:hidden`})]}),(0,R.jsxs)(bM,{variant:g?`destructive`:`default`,className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:o,children:[a,(0,R.jsx)(rA,{chord:`Y`,className:`kbd-hint ml-1 max-md:hidden`})]})]})]})]})}function CM(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var wM=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,TM=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,EM={};function DM(e,t){return((t||EM).jsx?TM:wM).test(e)}var OM=/[ \t\n\f\r]/g;function kM(e){return typeof e==`object`?e.type===`text`&&AM(e.value):AM(e)}function AM(e){return e.replace(OM,``)===``}var jM=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};jM.prototype.normal={},jM.prototype.property={},jM.prototype.space=void 0;function MM(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new jM(n,r,t)}function NM(e){return e.toLowerCase()}var PM=class{constructor(e,t){this.attribute=t,this.property=e}};PM.prototype.attribute=``,PM.prototype.booleanish=!1,PM.prototype.boolean=!1,PM.prototype.commaOrSpaceSeparated=!1,PM.prototype.commaSeparated=!1,PM.prototype.defined=!1,PM.prototype.mustUseProperty=!1,PM.prototype.number=!1,PM.prototype.overloadedBoolean=!1,PM.prototype.property=``,PM.prototype.spaceSeparated=!1,PM.prototype.space=void 0;var FM=s({boolean:()=>Z,booleanish:()=>LM,commaOrSpaceSeparated:()=>VM,commaSeparated:()=>BM,number:()=>Q,overloadedBoolean:()=>RM,spaceSeparated:()=>zM}),IM=0,Z=HM(),LM=HM(),RM=HM(),Q=HM(),zM=HM(),BM=HM(),VM=HM();function HM(){return 2**++IM}var UM=Object.keys(FM),WM=class extends PM{constructor(e,t,n,r){let i=-1;if(super(e,t),GM(this,`space`,r),typeof n==`number`)for(;++i<UM.length;){let e=UM[i];GM(this,UM[i],(n&FM[e])===FM[e])}}};WM.prototype.defined=!0;function GM(e,t,n){n&&(e[t]=n)}function KM(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new WM(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[NM(r)]=r,n[NM(a.attribute)]=r}return new jM(t,n,e.space)}var qM=KM({properties:{ariaActiveDescendant:null,ariaAtomic:LM,ariaAutoComplete:null,ariaBusy:LM,ariaChecked:LM,ariaColCount:Q,ariaColIndex:Q,ariaColSpan:Q,ariaControls:zM,ariaCurrent:null,ariaDescribedBy:zM,ariaDetails:null,ariaDisabled:LM,ariaDropEffect:zM,ariaErrorMessage:null,ariaExpanded:LM,ariaFlowTo:zM,ariaGrabbed:LM,ariaHasPopup:null,ariaHidden:LM,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zM,ariaLevel:Q,ariaLive:null,ariaModal:LM,ariaMultiLine:LM,ariaMultiSelectable:LM,ariaOrientation:null,ariaOwns:zM,ariaPlaceholder:null,ariaPosInSet:Q,ariaPressed:LM,ariaReadOnly:LM,ariaRelevant:null,ariaRequired:LM,ariaRoleDescription:zM,ariaRowCount:Q,ariaRowIndex:Q,ariaRowSpan:Q,ariaSelected:LM,ariaSetSize:Q,ariaSort:null,ariaValueMax:Q,ariaValueMin:Q,ariaValueNow:Q,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function JM(e,t){return t in e?e[t]:t}function YM(e,t){return JM(e,t.toLowerCase())}var XM=KM({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:BM,acceptCharset:zM,accessKey:zM,action:null,allow:null,allowFullScreen:Z,allowPaymentRequest:Z,allowUserMedia:Z,alpha:Z,alt:null,as:null,async:Z,autoCapitalize:null,autoComplete:zM,autoFocus:Z,autoPlay:Z,blocking:zM,capture:null,charSet:null,checked:Z,cite:null,className:zM,closedBy:null,colorSpace:null,cols:Q,colSpan:Q,command:null,commandFor:null,content:null,contentEditable:LM,controls:Z,controlsList:zM,coords:Q|BM,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Z,defer:Z,dir:null,dirName:null,disabled:Z,download:RM,draggable:LM,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Z,formTarget:null,headers:zM,height:Q,hidden:RM,high:Q,href:null,hrefLang:null,htmlFor:zM,httpEquiv:zM,id:null,imageSizes:null,imageSrcSet:null,inert:Z,inputMode:null,integrity:null,is:null,isMap:Z,itemId:null,itemProp:zM,itemRef:zM,itemScope:Z,itemType:zM,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Z,low:Q,manifest:null,max:null,maxLength:Q,media:null,method:null,min:null,minLength:Q,multiple:Z,muted:Z,name:null,nonce:null,noModule:Z,noValidate:Z,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Z,optimum:Q,pattern:null,ping:zM,placeholder:null,playsInline:Z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Z,referrerPolicy:null,rel:zM,required:Z,reversed:Z,rows:Q,rowSpan:Q,sandbox:zM,scope:null,scoped:Z,seamless:Z,selected:Z,shadowRootClonable:Z,shadowRootCustomElementRegistry:Z,shadowRootDelegatesFocus:Z,shadowRootMode:null,shadowRootSerializable:Z,shape:null,size:Q,sizes:null,slot:null,span:Q,spellCheck:LM,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Q,step:null,style:null,tabIndex:Q,target:null,title:null,translate:null,type:null,typeMustMatch:Z,useMap:null,value:LM,width:Q,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zM,axis:null,background:null,bgColor:null,border:Q,borderColor:null,bottomMargin:Q,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Z,declare:Z,event:null,face:null,frame:null,frameBorder:null,hSpace:Q,leftMargin:Q,link:null,longDesc:null,lowSrc:null,marginHeight:Q,marginWidth:Q,noResize:Z,noHref:Z,noShade:Z,noWrap:Z,object:null,profile:null,prompt:null,rev:null,rightMargin:Q,rules:null,scheme:null,scrolling:LM,standby:null,summary:null,text:null,topMargin:Q,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Q,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Z,disablePictureInPicture:Z,disableRemotePlayback:Z,exportParts:BM,part:zM,prefix:null,property:null,results:Q,security:null,unselectable:null},space:`html`,transform:YM}),ZM=KM({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,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`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,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`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,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`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:VM,accentHeight:Q,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Q,amplitude:Q,arabicForm:null,ascent:Q,attributeName:null,attributeType:null,azimuth:Q,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Q,by:null,calcMode:null,capHeight:Q,className:zM,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Q,diffuseConstant:Q,direction:null,display:null,dur:null,divisor:Q,dominantBaseline:null,download:Z,dx:null,dy:null,edgeMode:null,editable:null,elevation:Q,enableBackground:null,end:null,event:null,exponent:Q,externalResourcesRequired:null,fill:null,fillOpacity:Q,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:BM,g2:BM,glyphName:BM,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Q,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Q,horizOriginX:Q,horizOriginY:Q,id:null,ideographic:Q,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Q,k:Q,k1:Q,k2:Q,k3:Q,k4:Q,kernelMatrix:VM,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Q,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Q,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Q,overlineThickness:Q,paintOrder:null,panose1:null,path:null,pathLength:Q,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zM,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Q,pointsAtY:Q,pointsAtZ:Q,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:VM,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:VM,rev:VM,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:VM,requiredFeatures:VM,requiredFonts:VM,requiredFormats:VM,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Q,specularExponent:Q,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Q,strikethroughThickness:Q,string:null,stroke:null,strokeDashArray:VM,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Q,strokeOpacity:Q,strokeWidth:null,style:null,surfaceScale:Q,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:VM,tabIndex:Q,tableValues:null,target:null,targetX:Q,targetY:Q,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:VM,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Q,underlineThickness:Q,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Q,values:null,vAlphabetic:Q,vMathematical:Q,vectorEffect:null,vHanging:Q,vIdeographic:Q,version:null,vertAdvY:Q,vertOriginX:Q,vertOriginY:Q,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Q,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:JM}),QM=KM({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),$M=KM({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:YM}),eN=KM({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),tN={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},nN=/[A-Z]/g,rN=/-[a-z]/g,iN=/^data[-\w.:]+$/i;function aN(e,t){let n=NM(t),r=t,i=PM;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&iN.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(rN,sN);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!rN.test(e)){let n=e.replace(nN,oN);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=WM}return new i(r,t)}function oN(e){return`-`+e.toLowerCase()}function sN(e){return e.charAt(1).toUpperCase()}var cN=MM([qM,XM,QM,$M,eN],`html`),lN=MM([qM,ZM,QM,$M,eN],`svg`);function uN(e){return e.join(` `).trim()}var dN=o(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
59
59
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),fN=o((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(dN());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),pN=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),mN=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(fN()),r=pN();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),hN=_N(`end`),gN=_N(`start`);function _N(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function vN(e){let t=gN(e),n=hN(e);if(t&&n)return{start:t,end:n}}function yN(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?xN(e.position):`start`in e||`end`in e?xN(e):`line`in e||`column`in e?bN(e):``}function bN(e){return SN(e&&e.line)+`:`+SN(e&&e.column)}function xN(e){return bN(e&&e.start)+`-`+bN(e&&e.end)}function SN(e){return e&&typeof e==`number`?e:1}var CN=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=yN(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};CN.prototype.file=``,CN.prototype.name=``,CN.prototype.reason=``,CN.prototype.message=``,CN.prototype.stack=``,CN.prototype.column=void 0,CN.prototype.line=void 0,CN.prototype.ancestors=void 0,CN.prototype.cause=void 0,CN.prototype.fatal=void 0,CN.prototype.place=void 0,CN.prototype.ruleId=void 0,CN.prototype.source=void 0;var wN=l(mN(),1),TN={}.hasOwnProperty,EN=new Map,DN=/[A-Z]/g,ON=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),kN=new Set([`td`,`th`]),AN=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function jN(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=HN(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=VN(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?lN:cN,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=MN(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function MN(e,t,n){if(t.type===`element`)return NN(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return PN(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return IN(e,t,n);if(t.type===`mdxjsEsm`)return FN(e,t);if(t.type===`root`)return LN(e,t,n);if(t.type===`text`)return RN(e,t)}function NN(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=lN,e.schema=i),e.ancestors.push(t);let a=JN(e,t.tagName,!1),o=UN(e,t),s=GN(e,t);return ON.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!kM(e)})),zN(e,o,a,t),BN(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function PN(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}YN(e,t.position)}function FN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);YN(e,t.position)}function IN(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=lN,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:JN(e,t.name,!0),o=WN(e,t),s=GN(e,t);return zN(e,o,a,t),BN(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function LN(e,t,n){let r={};return BN(r,GN(e,t)),e.create(t,e.Fragment,r,n)}function RN(e,t){return t.value}function zN(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function BN(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function VN(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function HN(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=gN(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function UN(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&TN.call(t.properties,i)){let a=KN(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&kN.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function WN(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else YN(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else YN(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function GN(e,t){let n=[],r=-1,i=e.passKeys?new Map:EN;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=MN(e,a,o);s!==void 0&&n.push(s)}return n}function KN(e,t,n){let r=aN(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?CM(n):uN(n)),r.property===`style`){let t=typeof n==`object`?n:qN(e,String(n));return e.stylePropertyNameCase===`css`&&(t=XN(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?tN[r.property]||r.property:r.attribute,n]}}function qN(e,t){try{return(0,wN.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new CN("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=AN+`#cannot-parse-style-attribute`,r}}function JN(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=DM(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=DM(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return TN.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);YN(e)}function YN(e,t){let n=new CN("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=AN+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function XN(e){let t={},n;for(n in e)TN.call(e,n)&&(t[ZN(n)]=e[n]);return t}function ZN(e){let t=e.replace(DN,QN);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function QN(e){return`-`+e.toLowerCase()}var $N={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},eP={};function tP(e,t){let n=t||eP;return nP(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function nP(e,t,n){if(iP(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return rP(e.children,t,n)}return Array.isArray(e)?rP(e,t,n):``}function rP(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=nP(e[i],t,n);return r.join(``)}function iP(e){return!!(e&&typeof e==`object`)}var aP=document.createElement(`i`);function oP(e){let t=`&`+e+`;`;aP.innerHTML=t;let n=aP.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function sP(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function cP(e,t){return e.length>0?(sP(e,e.length,0,t),e):t}var lP={}.hasOwnProperty;function uP(e){let t={},n=-1;for(;++n<e.length;)dP(t,e[n]);return t}function dP(e,t){let n;for(n in t){let r=(lP.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){lP.call(r,a)||(r[a]=[]);let e=i[a];fP(r[a],Array.isArray(e)?e:e?[e]:[])}}}function fP(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);sP(e,0,0,r)}function pP(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function mP(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var hP=EP(/[A-Za-z]/),gP=EP(/[\dA-Za-z]/),_P=EP(/[#-'*+\--9=?A-Z^-~]/);function vP(e){return e!==null&&(e<32||e===127)}var yP=EP(/\d/),bP=EP(/[\dA-Fa-f]/),xP=EP(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function SP(e){return e!==null&&(e<0||e===32)}function CP(e){return e===-2||e===-1||e===32}var wP=EP(/\p{P}|\p{S}/u),TP=EP(/\s/);function EP(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function DP(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&gP(e.charCodeAt(n+1))&&gP(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function OP(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return CP(r)?(e.enter(n),s(r)):t(r)}function s(r){return CP(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function kP(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&CP(t)?(e.enter(r),c(t)):l(t)}function c(t){return CP(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var AP={tokenize:jP};function jP(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),OP(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return $(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var MP=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){NP(this,e,t,n,!1)}addBefore(e,t,n){NP(this,e,t,n,!0)}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,this.index.clear()}};function NP(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var PP={tokenize:IP},FP={tokenize:LP};function IP(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new MP;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(FP,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(FP,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return $(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new MP;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function LP(e,t,n){return OP(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function RP(e){if(e===null||SP(e)||TP(e))return 1;if(wP(e))return 2}function zP(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var BP={name:`attention`,resolveAll:VP,tokenize:HP};function VP(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};UP(o,-a),UP(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=cP(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=cP(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=cP(r,zP(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=cP(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=cP(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),sP(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function HP(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=RP(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=RP(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function UP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var WP={name:`autolink`,tokenize:GP};function GP(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return hP(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||gP(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||gP(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||vP(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):_P(t)?(e.consume(t),l):n(t)}function u(e){return gP(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||gP(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var KP={partial:!0,tokenize:qP};function qP(e,t,n){return r;function r(t){return CP(t)?OP(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||$(e)?t(e):n(e)}}var JP={continuation:{tokenize:XP},exit:ZP,name:`blockQuote`,tokenize:YP};function YP(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return CP(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function XP(e,t,n){let r=this;return i;function i(t){return CP(t)?OP(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(JP,t,n)(r)}}function ZP(e){e.exit(`blockQuote`)}var QP={name:`characterEscape`,tokenize:$P};function $P(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return xP(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var eF={name:`characterReference`,tokenize:tF};function tF(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=gP,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=bP,u):(e.enter(`characterReferenceValue`),a=7,o=yP,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===gP&&!oP(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var nF={partial:!0,tokenize:rF};function rF(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var iF={concrete:!0,name:`codeFenced`,tokenize:aF};function aF(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),CP(t)?OP(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||$(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(nF,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):CP(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),OP(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||$(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&CP(t)?OP(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(nF,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),CP(t)?OP(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),CP(t)?OP(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var oF={name:`codeIndented`,tokenize:cF},sF={partial:!0,tokenize:lF};function cF(e,t,n){return r;function r(t){return e.enter(`codeIndented`),kP(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):$(t)?e.attempt(sF,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||$(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function lF(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):$(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):kP(e,t,a,`linePrefix`,4,4)(o)}function a(e){return $(e)?i(e):n(e)}}var uF={name:`codeText`,previous:fF,resolve:dF,tokenize:pF};function dF(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fF(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pF(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||$(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var mF=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&hF(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),hF(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hF(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);hF(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);hF(this.left,t.reverse())}}}};function hF(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gF(e){let t={},n=-1,r,i,a,o,s,c,l,u=new mF(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_F(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return sP(e,0,1/0,u.slice(0)),!l}function _F(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var vF={resolve:bF,tokenize:xF},yF={partial:!0,tokenize:SF};function bF(e){return gF(e),e}function xF(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):$(t)?e.check(yF,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function SF(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),OP(e,a,`linePrefix`)}function a(i){if(i===null||$(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function CF(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||vP(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||$(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||SP(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||vP(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function wF(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):$(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!CP(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function TF(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),OP(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function EF(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):CP(i)?OP(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var DF={name:`definition`,tokenize:kF},OF={partial:!0,tokenize:AF};function kF(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return wF.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=mP(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return SP(t)?EF(e,l)(t):l(t)}function l(t){return CF(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(OF,d,d)(t)}function d(t){return CP(t)?OP(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function AF(e,t,n){return r;function r(t){return SP(t)?EF(e,i)(t):n(t)}function i(t){return TF(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return CP(t)?OP(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var jF={name:`hardBreakEscape`,tokenize:MF};function MF(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var NF={name:`headingAtx`,resolve:PF,tokenize:FF};function PF(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};sP(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function FF(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||SP(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):CP(n)?OP(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||SP(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var IF=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),LF=[`pre`,`script`,`style`,`textarea`],RF={concrete:!0,name:`htmlFlow`,resolveTo:BF,tokenize:VF},zF={partial:!0,tokenize:HF};function BF(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function VF(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):hP(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):hP(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return hP(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||SP(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&LF.includes(l)?(i=1,r.interrupt?t(s):O(s)):IF.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||gP(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return CP(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||hP(t)?(e.consume(t),b):CP(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||gP(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):CP(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):CP(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||SP(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||CP(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):CP(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),ne):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(zF,ie,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(nF,A,ie)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),N):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return LF.includes(n)?(e.consume(t),re):O(t)}return hP(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||$(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function HF(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(KP,t,n)}}var UF={name:`htmlText`,tokenize:WF};function WF(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):hP(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):hP(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):$(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):$(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):$(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return hP(t)?(e.consume(t),S):n(t)}function S(t){return t===45||gP(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,M(t)):CP(t)?(e.consume(t),C):j(t)}function w(t){return t===45||gP(t)?(e.consume(t),w):t===47||t===62||SP(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||hP(t)?(e.consume(t),E):$(t)?(o=T,M(t)):CP(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||gP(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,M(t)):CP(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):$(t)?(o=O,M(t)):CP(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):$(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||SP(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||SP(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return CP(t)?OP(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var GF={name:`labelEnd`,resolveAll:YF,resolveTo:XF,tokenize:ZF},KF={tokenize:QF},qF={tokenize:$F},JF={tokenize:eI};function YF(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&sP(e,0,e.length,n),e}function XF(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=cP(o,e.slice(i+1,i+r+3)),o=cP(o,[[`enter`,l,t]]),o=cP(o,zP(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=cP(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=cP(o,e.slice(a+1)),o=cP(o,[[`exit`,s,t]]),sP(e,i,e.length,o),e}function ZF(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(mP(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(KF,u,o?u:d)(t):t===91?e.attempt(qF,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(JF,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function QF(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return SP(t)?EF(e,a)(t):a(t)}function a(t){return t===41?u(t):CF(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return SP(t)?EF(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?TF(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return SP(t)?EF(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function $F(e,t,n){let r=this;return i;function i(t){return wF.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(mP(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function eI(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var tI={name:`labelStartImage`,resolveAll:GF.resolveAll,tokenize:nI};function nI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var rI={name:`labelStartLink`,resolveAll:GF.resolveAll,tokenize:iI};function iI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var aI={name:`lineEnding`,tokenize:oI};function oI(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),OP(e,t,`linePrefix`)}}var sI={name:`thematicBreak`,tokenize:cI};function cI(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),CP(t)?OP(e,s,`whitespace`)(t):s(t))}}var lI={continuation:{tokenize:pI},exit:hI,name:`list`,tokenize:fI},uI={partial:!0,tokenize:gI},dI={partial:!0,tokenize:mI};function fI(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:yP(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(sI,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return yP(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(KP,r.interrupt?n:u,e.attempt(uI,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return CP(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function pI(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(KP,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,OP(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!CP(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(dI,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,OP(e,e.attempt(lI,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function mI(e,t,n){let r=this;return OP(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function hI(e){e.exit(this.containerState.type)}function gI(e,t,n){let r=this;return OP(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!CP(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var _I={name:`setextUnderline`,resolveTo:vI,tokenize:yI};function vI(e,t){let n=new MP,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function yI(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),CP(t)?OP(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var bI={tokenize:xI};function xI(e){let t=this,n=e.attempt(KP,r,e.attempt(this.parser.constructs.flowInitial,i,OP(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vF,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var SI={resolveAll:EI()},CI=TI(`string`),wI=TI(`text`);function TI(e){return{resolveAll:EI(e===`text`?DI:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function EI(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function DI(e,t){let n=new MP,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var OI=s({attentionMarkers:()=>II,contentInitial:()=>AI,disable:()=>LI,document:()=>kI,flow:()=>MI,flowInitial:()=>jI,insideSpan:()=>FI,string:()=>NI,text:()=>PI}),kI={42:lI,43:lI,45:lI,48:lI,49:lI,50:lI,51:lI,52:lI,53:lI,54:lI,55:lI,56:lI,57:lI,62:JP},AI={91:DF},jI={[-2]:oF,[-1]:oF,32:oF},MI={35:NF,42:sI,45:[_I,sI],60:RF,61:_I,95:sI,96:iF,126:iF},NI={38:eF,92:QP},PI={[-5]:aI,[-4]:aI,[-3]:aI,33:tI,38:eF,42:BP,60:[WP,UF],91:rI,92:[jF,QP],93:GF,95:BP,96:uF},FI={null:[BP,SI]},II={null:[42,95]},LI={null:[]};function RI(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=cP(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=zP(a,l.events,l),l.events):[]}function f(e,t){return BI(p(e),t)}function p(e){return zI(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){$(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&sP(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function zI(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function BI(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
60
60
  `;break;case-3:o=`\r
61
61
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function VI(e){let t={constructs:uP([OI,...(e||{}).extensions||[]]),content:n(AP),defined:[],document:n(PP),flow:n(bI),lazy:{},string:n(CI),text:n(wI)};return t;function n(e){return n;function n(n){return RI(t,e,n)}}}function HI(e){for(;!gF(e););return e}var UI=/[\0\t\n\r]/g;function WI(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){UI.lastIndex=c;let n=UI.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var GI=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function KI(e){return e.replace(GI,qI)}function qI(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return pP(n.slice(t?2:1),t?16:10)}return oP(n)||e}var JI={}.hasOwnProperty;function YI(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),XI(n)(HI(VI(n).document().write(WI()(e,t,!0))))}function XI(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ye),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(he),blockQuote:a(fe),characterEscape:T,characterReference:T,codeFenced:a(pe),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(pe,o),codeText:a(me,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(P),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(F),hardBreakEscape:a(ge),hardBreakTrailing:a(ge),htmlFlow:a(_e,o),htmlFlowData:T,htmlText:a(_e,o),htmlTextData:T,image:a(ve),label:o,link:a(ye),listItem:a(xe),listItemValue:f,listOrdered:a(be,d),listUnordered:a(be),paragraph:a(Se),reference:ae,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(he),strong:a(Ce),thematicBreak:a(Te)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ee),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(k),htmlFlowData:E,htmlText:c(A),htmlTextData:E,image:c(M),label:ne,labelText:te,lineEnding:D,link:c(j),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:oe,resourceDestinationString:N,resourceTitleString:re,resource:ie,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};QI(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];JI.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||eL).call(a,void 0,e[0])}for(r.position={start:ZI(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ZI(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ZI(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||eL).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+yN({start:e.start,end:e.end})+`): it’s not open`);n.position.end=ZI(e.end)}function u(){return tP(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=mP(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:ZI(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ZI(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ZI(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=KI(t),n.identifier=mP(t).toLowerCase()}function ne(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function N(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=mP(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=pP(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=oP(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=ZI(e.end)}function ue(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[]}}function pe(){return{type:`code`,lang:null,meta:null,value:``}}function me(){return{type:`inlineCode`,value:``}}function P(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function F(){return{type:`emphasis`,children:[]}}function he(){return{type:`heading`,depth:0,children:[]}}function ge(){return{type:`break`}}function _e(){return{type:`html`,value:``}}function ve(){return{type:`image`,title:null,url:``,alt:null}}function ye(){return{type:`link`,title:null,url:``,children:[]}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Se(){return{type:`paragraph`,children:[]}}function Ce(){return{type:`strong`,children:[]}}function we(){return{type:`text`,value:``}}function Te(){return{type:`thematicBreak`}}}function ZI(e){return{line:e.line,column:e.column,offset:e.offset}}function QI(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?QI(e,r):$I(e,r)}}function $I(e,t){let n;for(n in t)if(JI.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function eL(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+yN({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+yN({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+yN({start:t.start,end:t.end})+`) is still open`)}function tL(e){let t=this;t.parser=n;function n(n){return YI(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function nL(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function rL(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -88,22 +88,23 @@ Error generating stack: `+e.message+`
88
88
  `)),n=[]),n.push(i);return t.push(n.join(`
89
89
  `)),t}function bH(e,t,n=!1){let r=t?.start?.offset,i=t?.end?.offset;if(r===void 0||i===void 0)return;let a=e.slice(r,i);if(!n){let e=a.match(/^`+/)?.[0];return e&&a.endsWith(e)?a.slice(e.length,-e.length):a}let o=a.match(/^ {0,3}(`{3,}|~{3,})[^\r\n]*(?:\r\n|\n|\r)/);if(!o)return a;let s=a.slice(o[0].length),c=RegExp(`^ {0,3}${o[1][0]}{${o[1].length},}[ \\t]*$`,`m`).exec(s);return c?s.slice(0,c.index):s}function xH(e,t){return!e&&!t}async function SH(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var CH=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function wH(e){let t=e.lastIndexOf(`${tj}\n`);if(t<0||t>0&&e[t-1]!==`
90
90
  `)return{body:e,files:[]};let n=e.slice(t+tj.length+1).split(`
91
- `).filter(Boolean),r=[];for(let t of n){let n=CH.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var TH=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function EH({files:e}){return e.length===0?null:(0,R.jsx)(`ul`,{className:`mt-2 flex min-w-0 max-w-full flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,R.jsx)(`li`,{children:TH.has(e.mime)?(0,R.jsx)(`a`,{href:F(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block max-w-full overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02] focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11 max-md:min-w-11`,children:(0,R.jsx)(`img`,{src:F(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-[min(14rem,100%)] object-cover`})}):(0,R.jsxs)(`span`,{className:`inline-flex max-w-[min(16rem,100%)] min-w-0 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,R.jsx)(Fm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,R.jsx)(jh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}var DH=!1,OH=[],kH=0,AH=900;function jH(){DH=!0,window.clearTimeout(kH),kH=window.setTimeout(MH,AH)}function MH(){DH=!1,window.clearTimeout(kH);let e=OH;OH=[];for(let t of e)t()}function NH(e){if(!DH)return e(),()=>{};let t=()=>e();return OH.push(t),()=>{OH=OH.filter(e=>e!==t)}}var PH=8;function FH(e,t=24){let[n,r]=(0,m.useState)(t),i=(0,m.useRef)(8),a=n<e;return(0,m.useEffect)(()=>{if(!a)return;let e=0,t=NH(()=>{e=requestAnimationFrame(()=>{let e=performance.now();(0,Hv.flushSync)(()=>r(e=>e+i.current));let t=Math.max(1,performance.now()-e);i.current=Math.max(2,Math.min(400,Math.round(i.current*PH/t)))})});return()=>{t(),cancelAnimationFrame(e)}},[a,n]),Math.min(n,e)}function IH(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(IH).join(``)}function LH(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),LH(t,n)}function RH(){return e=>LH(e)}function zH(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await SH(e,navigator.clipboard),n(!0),H.success(`Code copied.`)}catch{H.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function BH({text:e,children:t,block:n=!1}){let{copy:r}=zH(e),i=(0,m.useRef)(void 0);return(0,R.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:q(`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,!n&&`max-md:break-words max-md:[overflow-wrap:anywhere]`),onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),xH(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),xH(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,R.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function VH({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=zH(bH(n,r?.position,!0)??IH(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,R.jsxs)(`div`,{className:`relative my-3 max-md:min-w-0 max-md:max-w-full rounded-lg bg-muted`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,R.jsx)(X,{label:i?`Copied`:`Copy the code`,icon:i?Vp:Cm,iconOnly:!0,onClick:()=>void a()})]}),(0,R.jsx)(`pre`,{className:`!my-0 max-md:max-w-full overflow-x-auto max-md:overscroll-x-contain !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function HH(e){return{pre:t=>(0,R.jsx)(VH,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,R.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,R.jsx)(BH,{text:bH(e,r?.position,i)??IH(r),block:i,children:n})},a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e?F(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,R.jsx)(`img`,{src:e?F(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,R.jsx)(`div`,{className:`my-3 w-full max-md:min-w-0 max-md:max-w-full overflow-x-auto max-md:overscroll-x-contain`,children:(0,R.jsx)(`table`,{className:`w-full max-md:min-w-max border-collapse text-sm`,children:e})})}}var UH=(0,m.memo)(function({text:e}){return(0,R.jsx)(oz,{remarkPlugins:[fH],rehypePlugins:[RH],urlTransform:mH,components:HH(e),children:e})}),WH=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=wH(e),i=n?yH(n):[],a=FH(i.length,3);return(0,R.jsxs)(`div`,{className:q(`md-body max-md:min-w-0 max-md:max-w-full max-md:break-words max-md:[overflow-wrap:anywhere]`,t),children:[i.slice(0,a).map((e,t)=>(0,R.jsx)(UH,{text:e},t)),(0,R.jsx)(EH,{files:r})]})});function GH({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,R.jsxs)(`section`,{className:q(`workspace-frame group/frame relative flex min-h-0 min-w-0 flex-col rounded-xl border shadow-xs`,i&&`flex-none`,n),...s,children:[e||t||a?(0,R.jsxs)(`div`,{className:q(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,R.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,R.jsx)(`span`,{}),(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,R.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,title:`${i?`Expand`:`Minimize`}${o?` · ${o}`:``}`,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none max-md:h-11 max-md:min-w-11 max-md:justify-center`,children:[o?(0,R.jsx)(rA,{chord:o,className:`kbd-hint max-md:hidden`}):null,(0,R.jsx)(Up,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function KH({title:e,right:t,className:n}){return(0,R.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,R.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,R.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function qH({title:e,right:t,prominent:n,children:r}){return(0,R.jsxs)(`section`,{className:q(`flex min-w-0 flex-col`,n?`gap-4`:`workspace-section gap-3 rounded-xl border p-4 shadow-xs max-md:rounded-lg max-md:p-3`),children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:(0,R.jsx)(KH,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var JH=`Pull requests`,YH=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,XH=`nothing is posted to GitHub`,ZH=`Refresh to load open pull requests with the GitHub CLI (gh).`,QH=`No open pull requests.`,$H=`loading pull requests from GitHub…`,eU=`reading the diff…`,tU=`the pull request has new commits since this review — review it again`,nU=`(no description)`,rU=`Review with a focus (optional)`,iU=`Leave it empty for a full review.`;function aU(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function oU(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function sU(e,t){return`+${e} −${t}`}function cU(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function lU(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function uU(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function dU(e,t){if(e.status===`running`)return fU(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?fU(e,t):e.status;return[uU(e.verdict),n].filter(Boolean).join(` · `)}function fU(e,t){let n=Math.max(0,Math.round(((e.finishedAt??t)-e.startedAt)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function pU(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${dM(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function mU(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${sU(e.additions,e.deletions)} · ${t}`}function hU(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,cU(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function gU(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function _U(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function vU(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function yU({pull:e,now:t}){return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:pU(e,t)}),(0,R.jsx)(`p`,{className:`text-sm tabular-nums`,children:mU(e)}),hU(e)?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:hU(e)}):null,e.url?(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4 max-md:min-h-11 max-md:items-center`,children:e.url}):null]})}function bU({read:e}){return(0,R.jsxs)(qH,{title:`Jev's read`,right:_U(e),children:[e.status===`running`?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),eU]}):null,e.status===`failed`?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,R.jsx)(WH,{text:e.line}):null]})}function xU({review:e,now:t}){return(0,R.jsxs)(R.Fragment,{children:[e.model?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,dM(t-e.startedAt)]}):null,e.stale?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:tU}):null,e.status===`running`?(0,R.jsx)(SU,{steps:e.steps}):null,e.status===`cancelled`?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,R.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,R.jsx)(WH,{text:e.text}):null]})}function SU({steps:e}){return(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,R.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function CU({number:e,focus:t,onChange:n}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:rU}),(0,R.jsx)(sM,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,className:`max-md:min-h-11`,onChange:e=>n(e.target.value)}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:iU})]})}function wU({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,R.jsxs)(qH,{title:`Review`,right:t?dU(t,n):void 0,children:[t?(0,R.jsx)(xU,{review:t,now:n}):null,(0,R.jsx)(CU,{number:e,focus:r,onChange:i}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,XH,`.`]})]})}function TU({files:e}){return(0,R.jsx)(qH,{title:`Files`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,R.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,R.jsx)(`tbody`,{children:e.map(e=>(0,R.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,R.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:sU(e.additions,e.deletions)})]},e.path))})})})})}function EU({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?dM(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,R.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,R.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,R.jsx)(WH,{text:e.body.trim()}):null]})}function DU({notes:e,now:t}){return e.length===0?null:(0,R.jsx)(qH,{title:`Discussion`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,R.jsx)(EU,{note:e,now:t},n))})})}function OU({number:e,error:t}){return t?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),`loading #`,e,`…`]})}function kU({number:e,onChanged:t}){let n=xj(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=vU(a);if(!n.data)return(0,R.jsx)(OU,{number:e,error:n.error});let{pull:s,review:c,read:l}=n.data,u=()=>{n.reload(),t?.()},d=async()=>{let t=r.trim();i(``),await U(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await U(`git.jev`,{number:e}),u()},p=async()=>{await U(`git.cancelReview`,{number:e}),u()};return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Review`,icon:Uh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,R.jsx)(X,{label:`Jev's read`,icon:Fp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,R.jsx)(SM,{icon:dm,label:`Stop the review`,text:`Stop`,shortcut:`X`,title:`Stop this review?`,description:`The agent stops reading the pull request. Nothing is posted to GitHub.`,confirmLabel:`Stop review`,variant:`destructive`,onConfirm:()=>void p()}):null]}),(0,R.jsx)(yU,{pull:s,now:o}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:YH}),l?(0,R.jsx)(bU,{read:l}):null,(0,R.jsx)(wU,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,R.jsx)(TU,{files:s.files}):null,(0,R.jsx)(qH,{title:`Description`,children:s.body.trim()?(0,R.jsx)(WH,{text:s.body.trim()}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:nU})}),(0,R.jsx)(DU,{notes:s.notes,now:o})]})}var AU=Jg([`relative inline-flex shrink-0 items-center justify-center w-fit border border-transparent font-medium whitespace-nowrap outline-none transition-shadow`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-3`],{variants:{variant:{default:`bg-primary text-primary-foreground`,outline:`border-border bg-transparent dark:bg-input/32`,secondary:`bg-secondary text-secondary-foreground`,info:`bg-info text-white`,success:`bg-success text-white`,warning:`bg-warning text-white`,destructive:`bg-destructive text-white`,focus:`bg-focus text-focus-foreground`,invert:`bg-invert text-invert-foreground`,"primary-light":`border-primary/10 bg-primary/10 text-primary dark:border-primary/25 dark:bg-primary/15 dark:text-primary`,"warning-light":`border-warning/15 bg-warning/10 text-warning-foreground dark:border-warning/25 dark:bg-warning/15 dark:text-warning`,"success-light":`border-success/15 bg-success/10 text-success-foreground dark:border-success/25 dark:bg-success/15 dark:text-success`,"info-light":`border-info/15 bg-info/10 text-info-foreground dark:border-info/25 dark:bg-info/15 dark:text-info`,"destructive-light":`border-destructive/15 bg-destructive/10 text-destructive-foreground dark:border-destructive/25 dark:bg-destructive/15 dark:text-destructive`,"invert-light":`border-invert/15 bg-invert/10 text-foreground dark:border-invert/45 dark:bg-invert/35 dark:text-invert-foreground`,"focus-light":`border-focus/15 bg-focus/10 text-focus-foreground dark:border-focus/25 dark:bg-focus/15 dark:text-focus`,"primary-outline":`bg-background border-border text-primary dark:bg-input/30`,"warning-outline":`bg-background border-border text-warning-foreground dark:bg-input/30`,"success-outline":`bg-background border-border text-success-foreground dark:bg-input/30`,"info-outline":`bg-background border-border text-info-foreground dark:bg-input/30`,"destructive-outline":`bg-background border-border text-destructive-foreground dark:bg-input/30`,"invert-outline":`bg-background border-border text-invert-foreground dark:bg-input/30`,"focus-outline":`bg-background border-border text-focus-foreground dark:bg-input/30`},size:{xs:`px-1 py-0.25 text-[0.6rem] leading-none h-4 min-w-4 gap-1`,sm:`px-1 py-0.25 text-[0.625rem] leading-none h-4.5 min-w-4.5 gap-1`,default:`px-1.25 py-0.5 text-xs h-5 min-w-5 gap-1`,lg:`px-1.5 py-0.5 text-xs h-5.5 min-w-5.5 gap-1`,xl:`px-2 py-0.75 text-sm h-6 min-w-6 gap-1.5`},radius:{default:`rounded-sm`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,radius:`default`}});function jU({className:e,variant:t,size:n,radius:r,asChild:i=!1,...a}){let o=i?kv:`span`;return(0,R.jsx)(o,{"data-slot":`badge`,className:q(AU({variant:t,size:n,radius:r,className:e})),...a})}var MU=`flex min-h-10 w-full flex-col gap-1 rounded-lg border border-transparent px-3 py-2.5 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:border-primary/40 aria-[current=true]:bg-accent`,NU=`flex flex-col gap-1 px-2 pb-3`,PU=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function FU({checks:e}){let t=aU(e);return t?(0,R.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,oU(e)),"aria-hidden":`true`,children:t}):(0,R.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function IU({pull:e,selected:t,onSelect:n}){let r=lU(e.review);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.number),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,R.jsx)(FU,{checks:e.checks}),e.draft?(0,R.jsx)(jU,{variant:`secondary`,children:`draft`}):null,(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:gU(e)}),(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,R.jsx)(`span`,{children:r}):null,(0,R.jsx)(`span`,{className:`tabular-nums`,children:sU(e.additions,e.deletions)})]})]})]})})}function LU({pulls:e,selectedId:t,onSelect:n}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(IU,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var RU=()=>aj(ij(`git`)),zU=e=>aj(ij(`git`,String(e)));function BU(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function VU({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?QH:e?$H:ZH;return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Um,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Retry`}):null]})}function HU({rest:e}){let t=eM(),n=xj(`git.pulls`,{},[`git`]),r=BU(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{U(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,R.jsx)(VU,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:JH,count:n.data?`${i.length} open`:void 0,children:(0,R.jsx)(X,{label:`Refresh`,icon:qh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,R.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,R.jsx)(LU,{pulls:i,selectedId:r,onSelect:zU}):(0,R.jsx)(oM,{})]}),c=r===void 0?null:(0,R.jsx)(kU,{number:r,onChanged:n.reload},r);return(0,R.jsx)(iM,{wide:t,list:s,detail:c,open:r!==void 0,onClose:RU,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function UU(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function WU({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,R.jsx)(sM,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{UU(e)&&(e.preventDefault(),l())}}),t?(0,R.jsx)(`p`,{id:`${i}-hint`,className:q(`text-xs text-muted-foreground`,/(?:Enter|Esc)/.test(t)&&`max-md:hidden`),children:t}):null,(0,R.jsx)(`div`,{className:`flex self-end`,children:(0,R.jsx)(X,{label:n,icon:s?rh:Np,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var GU=`Issues`,KU=`Issue`,qU=`Plan it opens a planning session on this issue; save the plan as a task once the panel agrees it.`,JU=`Refresh to load open issues with the GitHub CLI (gh).`,YU=`No open issues. File one with New issue.`,XU=`loading issues from GitHub…`,ZU=`issues are off (lobby.issues)`,QU=`(no description)`;function $U(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${dM(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function eW(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?dM(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function tW(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function nW({issue:e,now:t}){return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$U(e,t)}),e.url?(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4 max-md:min-h-11 max-md:items-center`,children:e.url}):null]})}function rW({comment:e,now:t}){return(0,R.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,R.jsx)(`span`,{children:dM(t-Date.parse(e.createdAt))}):null]}),(0,R.jsx)(WH,{text:e.body.trim()})]})}function iW({comments:e,now:t}){return e.length===0?null:(0,R.jsx)(qH,{title:`Comments`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,R.jsx)(rW,{comment:e,now:t},n))})})}function aW({issue:e}){let t=async()=>{await U(`planner.new`,{seed:{issue:{number:e.number,title:e.title,...e.url?{url:e.url}:{}},body:e.body}})&&aj(ij(`plan`))};return(0,R.jsx)(SM,{icon:zg,label:`Plan #${e.number} with the panel`,text:`Plan it`,shortcut:`N`,title:`Plan #${e.number} with the panel?`,description:`A new planning session starts from this issue. A plan already under way waits under Plan → Previous.`,confirmLabel:`Plan it`,onConfirm:()=>void t()})}function oW({number:e}){let t=xj(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${KU} #${e}`,children:[(0,R.jsx)(Gj,{children:(0,R.jsx)(aW,{issue:r})}),(0,R.jsx)(nW,{issue:r,now:n}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:qU}),(0,R.jsx)(qH,{title:`Description`,children:r.body.trim()?(0,R.jsx)(WH,{text:r.body.trim()}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:QU})}),(0,R.jsx)(iW,{comments:r.comments,now:n})]})}function sW({issue:e,selected:t,now:n,onSelect:r}){let i=tW(e.labels);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.number),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,R.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,R.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:eW(e,n)})]})})}function cW({issues:e,selectedId:t,now:n,onSelect:r}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(sW,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var lW=()=>aj(ij(`issues`)),uW=e=>aj(ij(`issues`,String(e)));function dW(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function fW(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(sm,{"aria-hidden":`true`})}),(0,R.jsx)(dj,{children:`Issues are off`}),(0,R.jsx)(fj,{className:`font-mono`,children:ZU})]})})}function pW({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?YU:e?XU:JU;return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(sm,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Retry`}):null]})}function mW({onCreate:e}){return(0,R.jsx)(tM,{className:`shrink-0 border-t border-border p-4`,children:(0,R.jsx)(WU,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function hW({rest:e}){let t=eM(),n=sA(`status`).data?.issuesEnabled??!0,r=xj(`issues.list`,{},[`issues`],n),i=dW(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{U(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await U(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,R.jsx)(fW,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,R.jsx)(fW,{}):(0,R.jsx)(yj,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:GU,count:r.data?`${a.length} open`:void 0,children:(0,R.jsx)(X,{label:`Refresh`,icon:qh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,R.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,R.jsx)(cW,{issues:a,selectedId:i,now:o,onSelect:uW}):(0,R.jsx)(oM,{}),(0,R.jsx)(mW,{onCreate:c})]}),d=i===void 0?null:(0,R.jsx)(oW,{number:i},i),f=r.data&&a.length===0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(pW,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,R.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,R.jsx)(mW,{onCreate:c})})]}):(0,R.jsx)(iM,{wide:t,list:u,detail:d,open:i!==void 0,onClose:lW,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}function gW(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}var _W={DEV:ym,DESIGN:Dh,QA:lg,RESEARCH:xg,"QUICK FIX":Ug,SCOUT:xm,PLANNER:tg,CLASSIFIER:yg,LOBBY:hh,LINT:$m};function vW(e){return e?_W[e.toUpperCase()]??Lp:zp}function yW(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function bW({source:e,className:t,strokeWidth:n}){if(yW(e))return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-agent-icon":e,className:q(`agent-oracle shrink-0`,t)});let r=vW(e);return(0,R.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:q(`shrink-0`,t)})}var xW={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,"QUICK FIX":`text-source-quickfix`,ORACLE:`text-primary`,LOBBY:`text-muted-foreground`};function SW(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function CW(e){return xW[e]??`text-muted-foreground`}var wW={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,"QUICK FIX":`var(--source-quickfix)`,ORACLE:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function TW(e){return wW[e]??`var(--muted-foreground)`}function EW(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function DW(e){return e?.runs??[]}function OW(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function kW({source:e,live:t}){let n=yW(e);return(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`chat-avatar`,"data-live":t||void 0,"data-oracle":n||void 0,style:{"--orb":TW(e)},children:(0,R.jsx)(bW,{source:e,strokeWidth:2.25,className:n?`size-7`:`size-3.5`})})}function AW({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,bubble:s=!0}){return(0,R.jsxs)(`div`,{className:`chat-row group/msg`,children:[(0,R.jsx)(`div`,{className:`chat-gutter`,children:r?(0,R.jsx)(kW,{source:e,live:i}):n?(0,R.jsx)(`time`,{className:`chat-hover-time`,children:n}):null}),(0,R.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,R.jsxs)(`p`,{className:`chat-speaker`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),n?(0,R.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,R.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,s?(0,R.jsx)(`div`,{className:`chat-bubble-agent`,style:{"--orb":TW(e)},children:a}):a]})]})}function jW({time:e,head:t,note:n,children:r,below:i}){return(0,R.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[t?(0,R.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[e?(0,R.jsx)(`time`,{className:`tabular-nums`,children:e}):null,(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`}),n?(0,R.jsx)(`span`,{children:n}):null]}):null,(0,R.jsx)(`div`,{className:`chat-bubble`,children:r}),i]})}function MW({failed:e,children:t}){return(0,R.jsx)(`div`,{role:`note`,className:q(`chat-note`,e&&`text-destructive`),children:(0,R.jsx)(`span`,{children:t})})}function NW({className:e}){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:q(`typing-dots`,e),children:[(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{})]})}function PW({onClick:e,className:t}){return(0,R.jsx)(`button`,{type:`button`,"aria-label":`Jump to latest`,title:`Jump to latest`,onClick:e,className:q(`jump-latest btn-raised grid size-9 place-items-center rounded-full border bg-card text-foreground shadow-card outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:size-11`,t),children:(0,R.jsx)(Dp,{"aria-hidden":`true`,className:`size-4`})})}var FW=3e5,IW=`No task is running in this session.`,LW=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,RW=`Nothing said yet. Type below to talk to the oracle about this task.`;function zW({entry:e}){return(0,R.jsxs)(MW,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${lM(e.at)}`:``]})}function BW({entry:e,head:t}){if(e.role===`you`)return(0,R.jsx)(jW,{time:lM(e.at),head:t,children:(0,R.jsx)(WH,{text:e.text})});let n=e.role===`panel`;return(0,R.jsx)(AW,{source:n?`PLANNER`:`ORACLE`,name:n?`Panel`:`Oracle`,time:lM(e.at),head:t,children:(0,R.jsx)(WH,{text:e.text})})}var VW=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,R.jsx)(B.div,{initial:n?{opacity:0,y:10}:!1,animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:420,damping:32},children:e.role===`note`?(0,R.jsx)(zW,{entry:e}):(0,R.jsx)(BW,{entry:e,head:t})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at);function HW({text:e,busy:t}){let n=!!e?.trim();return!n&&!t?null:(0,R.jsx)(AW,{source:`ORACLE`,name:`Oracle`,head:!0,live:t,aside:t&&n?`writing…`:void 0,children:n?(0,R.jsx)(WH,{text:e??``}):(0,R.jsx)(NW,{className:`mt-1`})})}function UW({hasTask:e}){return(0,R.jsxs)(sj,{className:`h-full border-0`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(ph,{"aria-hidden":`true`})}),e?null:(0,R.jsx)(dj,{children:IW}),(0,R.jsx)(fj,{children:e?RW:LW})]}),e?null:(0,R.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,R.jsx)(rA,{chord:`3`}),` Plan`]}),(0,R.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,R.jsx)(rA,{chord:`4`}),` Quick fix`]})]})]})}async function WW(e){let t=await Te(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function GW(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await WW(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}function KW({chat:e,reply:t,busy:n,hasOlder:r,hasTask:i}){let{ref:a,atBottom:o,stick:s,onScroll:c}=gW(e.length+(t?.length??0)),{merged:l,more:u,loading:d,load:f}=GW(e,r,a),p=(0,m.useCallback)(()=>{c();let e=a.current;e&&e.scrollTop<80&&u&&!d&&f()},[c,a,u,d,f]),h=l.length===0&&!t?.trim()&&!n,[g,_]=(0,m.useState)(!1);return(0,m.useEffect)(()=>_(!0),[]),(0,R.jsxs)(GH,{"aria-label":`Conversation`,className:`flex-1`,children:[(0,R.jsx)(`div`,{ref:a,onScroll:p,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:h?(0,R.jsx)(UW,{hasTask:i}):(0,R.jsxs)(`div`,{className:`chat-column`,children:[u?(0,R.jsx)(`p`,{className:`mb-4 text-center text-xs text-muted-foreground`,children:`Earlier messages load as you scroll up.`}):null,l.map((e,t)=>{let n=l[t-1],r=!n||n.role!==e.role||e.at-n.at>FW;return(0,R.jsx)(VW,{entry:e,head:r,fresh:g},e.id)}),(0,R.jsx)(HW,{text:t,busy:n})]})}),o?null:(0,R.jsx)(`div`,{className:`absolute right-4 bottom-dock z-10`,children:(0,R.jsx)(PW,{onClick:s})})]})}function qW(e){let t=e[0]===`ask`,[n,r]=t?e.slice(1):e;return{chat:t,agent:n,file:r}}function JW(e,t){let{agent:n,file:r}=qW(e);return ij(`knowledge`,...t?[`ask`]:[],n??``,r??``)}var YW=[`master`,`designer`,`backend`,`qa`],XW={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},ZW={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},QW=`Every write archives the version before it.`;function $W(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function eG(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function tG(e){return{text:e.text,occurrence:e.occurrence}}function nG(e){return YW.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}function rG(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function iG({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,R.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,R.jsx)(sM,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{rG(e)&&(e.preventDefault(),o())}}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:QW}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,disabled:t,children:`Cancel`}),(0,R.jsxs)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:o,disabled:t||!i.trim(),children:[t?(0,R.jsx)(pj,{}):null,`Save`]})]})]})]})}function aG({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=XA(e,YA.confirm);return(0,R.jsx)(HA,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:QW,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:QW})]}),(0,R.jsx)(sM,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:i,disabled:r,children:`Cancel`}),(0,R.jsxs)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:()=>a(o),disabled:r,children:[r?(0,R.jsx)(pj,{}):null,`Save file`]})]})]})})}function oG({note:e,about:t,onTakeBack:n,busy:r}){let i=t?`about "${t.replace(/\s+/g,` `).trim().slice(0,50)}": ${e.text}`:e.text;return(0,R.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Lh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,R.jsx)(X,{label:`Take the note back`,icon:Dg,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function sG({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,R.jsxs)(`li`,{role:`button`,tabIndex:0,"aria-pressed":n,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:n?`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-primary/30 bg-accent px-3 py-2.5 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11`:`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-border px-3 py-2.5 outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11`,children:[(0,R.jsx)(`div`,{className:`flex gap-2`,children:(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(WH,{text:e.text})})}),r.length>0?(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,R.jsx)(oG,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function cG({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,R.jsx)(qH,{title:`Notes on entries that changed`,right:String(e.length),children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,R.jsx)(oG,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function lG({view:e}){let t=e.entries.length;return(0,R.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsxs)(`h2`,{className:`min-w-0 break-words text-lg font-semibold tracking-tight`,children:[ZW[e.agent],` `,(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,$W(e.chars),` chars`]}),e.over?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:eG(e.file)}):null]})}function uG({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Edit the entry`,text:`Edit`,icon:Vh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,R.jsx)(X,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:Gh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,R.jsx)(X,{label:`Comment on the entry`,text:`Comment`,icon:dh,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,R.jsx)(X,{label:`Edit the whole file`,text:`Edit file`,icon:jm,shortcut:`F`,disabled:a,onClick:r}),(0,R.jsx)(SM,{icon:Cg,label:`Delete the entry`,text:`Delete`,shortcut:`Delete`,title:`Delete this entry?`,description:`The entry and its notes are removed. The version before is archived.`,confirmLabel:`Delete entry`,variant:`destructive`,disabled:a||!t,onConfirm:i})]})}function dG({agent:e,file:t,onChanged:n}){let r=xj(`knowledge.open`,{agent:e,file:t},[`knowledge`]),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=r.data?.view,p=f?.entries??[],h=p[Math.min(i,Math.max(0,p.length-1))],g=async e=>{d(!0),await e(),s(void 0),r.reload(),n(),d(!1)},_=e=>void g(()=>U(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>U(`knowledge.remove`,{agent:e,file:t,ref:tG(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>U(`knowledge.edit`,{agent:e,file:t,ref:tG(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>U(`knowledge.comment`,{agent:e,file:t,ref:tG(r),text:n}));g(()=>U(`knowledge.add`,{agent:e,file:t,...h?{ref:tG(h)}:{},text:n}))};return f?(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${ZW[e]} ${t}`,children:[(0,R.jsx)(uG,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,R.jsx)(lG,{view:f}),p.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,R.jsx)(`ul`,{className:`workspace-section flex flex-col gap-2 rounded-xl border p-3 shadow-xs`,children:p.map((e,t)=>(0,R.jsx)(sG,{entry:e,index:t,selected:t===i,notes:f.attached.filter(t=>t.entry===e.text),onPick:a,onTakeBack:_,busy:u},`${t}-${e.text}`))}),o?.kind===`edit`?(0,R.jsx)(iG,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,R.jsx)(WU,{label:`Comment on this entry`,hint:QW,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,R.jsx)(WU,{label:`Add an entry`,hint:QW,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{}),` saving…`]}):null,(0,R.jsx)(cG,{notes:f.detached,onTakeBack:_,busy:u}),(0,R.jsx)(aG,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>U(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}function fG(e){return`${e.agent}/${e.file}`}var pG={master:`ORACLE`,designer:`DESIGN`,backend:`DEV`,qa:`QA`},mG=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function hG({info:e}){return(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,R.jsx)(`span`,{children:$W(e.chars)}),e.over?(0,R.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,R.jsx)(`span`,{className:`text-primary`,children:mG(e.notes,`note`)}):null]})}function gG({info:e,selected:t,onSelect:n}){return(0,R.jsx)(`li`,{className:`ktree-leaf`,children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(fG(e)),className:q(MU,`ktree-file min-h-9 flex-row items-center gap-2 py-1.5 max-md:min-h-11`),children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-bud`}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,R.jsx)(hG,{info:e})]})})}var _G=`bot-lobby.knowledge.folded`;function vG(){try{let e=JSON.parse(window.localStorage.getItem(_G)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function yG({files:e,models:t={},selectedKey:n,onSelect:r}){let[i,a]=(0,m.useState)(vG),o=nG(e),s=e.reduce((e,t)=>e+t.notes,0);function c(e,t){a(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(_G,JSON.stringify(r))}catch{}return r})}return(0,R.jsxs)(`div`,{className:`ktree px-3 pt-1 pb-3`,children:[(0,R.jsxs)(`p`,{className:`ktree-root`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-8 shrink-0 place-items-center rounded-lg border text-primary`,children:(0,R.jsx)(Fp,{className:`size-4`})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block text-sm font-medium`,children:`Project knowledge`}),(0,R.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[mG(e.length,`file`),` · `,mG(o.length,`agent`),s>0?` · ${mG(s,`note`)}`:``]})]})]}),(0,R.jsx)(`ul`,{className:`ktree-branches`,"aria-label":`Agents and their knowledge`,children:o.map(e=>{let a=!i.includes(e.agent),o=pG[e.agent],s=`knowledge-${e.agent}`,l=t[e.agent];return(0,R.jsxs)(`li`,{className:`ktree-branch`,style:{"--orb":TW(o)},children:[(0,R.jsx)(`h3`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":a,"aria-controls":s,onClick:()=>c(e.agent,!a),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),c(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),a||c(e.agent,!0))},className:`ktree-node max-md:min-h-11`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-tile`,children:(0,R.jsx)(bW,{source:o,strokeWidth:2.25,className:o===`ORACLE`?`size-5`:`size-3.5`})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:XW[e.agent]}),l?(0,R.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`runs on `}),l]}):null]}),(0,R.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.notes>0?(0,R.jsxs)(`span`,{className:`text-primary`,children:[mG(e.notes,`note`),` · `]}):null,mG(e.files.length,`file`)]}),(0,R.jsx)(qp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ease-snap`,a&&`rotate-90`)})]})}),(0,R.jsx)(Du,{initial:!1,children:a?(0,R.jsx)(B.ul,{id:s,"aria-label":`${XW[e.agent]}'s knowledge`,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`ktree-leaves`,children:e.files.map(e=>(0,R.jsx)(gG,{info:e,selected:fG(e)===n,onSelect:r},fG(e)))},`files`):null})]},e.agent)})})]})}var bG=()=>aj(ij(`knowledge`)),xG=e=>{let[t,n]=e.split(`/`);aj(ij(`knowledge`,t??``,n??``))};function SG(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Fp,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{children:`No knowledge files yet.`})]})})}function CG(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,R.jsx)(dG,{agent:i.agent,file:i.file,onChanged:r},fG(i)):t&&n?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function wG(){let e=sA(`lobby`),t=sA(`status`),n=e.data,r=t.data?.busy??!1;return!n?.chat.length&&!n?.reply&&!r?(0,R.jsx)(`p`,{className:`m-auto max-w-md px-5 pb-dock text-center text-sm text-muted-foreground`,children:`Ask about this project below. The oracle checks saved knowledge, searches the codebase for missing information, and saves verified findings.`}):(0,R.jsx)(KW,{chat:n?.chat??[],reply:n?.reply,busy:r,hasOlder:n?.hasOlderChat??!1,hasTask:!!n?.task})}function TG({read:e,selected:t}){let n=e.data?.files.reduce((e,t)=>e+t.notes,0)??0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Knowledge`,count:n>0?`${n} note${n===1?``:`s`}`:void 0}),(0,R.jsx)(EG,{read:e,selected:t})]})}function EG({read:e,selected:t}){return!e.data&&e.error?(0,R.jsx)(yj,{message:`Could not load the knowledge files. ${e.error}`,onRetry:e.reload}):e.data?e.data.files.length?(0,R.jsx)(yG,{files:e.data.files,models:e.data.models??{},selectedKey:t,onSelect:xG}):(0,R.jsx)(SG,{}):(0,R.jsx)(oM,{})}function DG({rest:e}){let{chat:t,agent:n,file:r}=qW(e),i=eM(),a=xj(`knowledge.files`,{},[`knowledge`]),o=a.data?.files??[],s=o.find(e=>e.agent===n&&e.file===r);return(0,R.jsx)(iM,{wide:i,inlineDetail:!0,list:(0,R.jsx)(TG,{read:a,selected:s?fG(s):void 0}),detail:t?(0,R.jsx)(wG,{}):CG(o,n,r,a.reload),detailClassName:t?`flex flex-col overflow-hidden p-0`:void 0,open:t||!!(n&&r),onClose:bG,hint:`Select a file to read its entries, or ask about the project below.`,describe:t?`Knowledge chat`:`Knowledge file`})}function OG(e){let t=e[0]===`board`,n=e[+!!t];try{return{board:t,id:n?decodeURIComponent(n):void 0}}catch{return{board:t,id:n}}}function kG({className:e,...t}){return(0,R.jsx)(yC,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:q(`peer relative flex size-[1.125rem] shrink-0 items-center justify-center rounded-[5px] border border-input bg-background text-primary-foreground transition-colors duration-150 outline-none before:absolute before:-inset-3 before:content-[''] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary`,e),...t,children:(0,R.jsx)(xC,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var AG=`Sessions`,jG=`No sessions yet.`,MG=`Up to 5 sessions; each can be assigned to one agent or several.`,NG=`A session is a live Excalidraw room that you and your agents draw in together.`,PG=[{title:`Start a live room`,text:`In Excalidraw: Share → Live collaboration → Start session.`},{title:`Add it here`,text:`Paste the room link, or make a new room and open it in Excalidraw.`},{title:`Assign agents`,text:`They read the board and draw on it, under their own name.`}],FG=`Sessions`,IG=`Pick a session on the left to see its link, its room and its agents.`,LG=`Room link`,RG=`Masked until revealed. A revealed link stays in this tab and is never saved.`,zG=`Room`,BG=`Drawing`,VG=`Last check`,HG=`not checked yet`,UG=`Add a session`,WG=`https://excalidraw.com/#room=…`,GG=`Optional name`;function KG(e){return`${e} of 5 in use`}var qG=`Agents may draw here.`,JG=`Agents may only look.`,YG=`checking the room…`,XG=`Check that the room can be reached.`,ZG=`Assigned to`,QG=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,$G=`Add or rename`,eK=`Add by link`,tK=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,nK=`New room`,rK=`Makes a fresh room link to open in Excalidraw; the name is optional.`,iK=`Rename`,aK=`draw`,oK=`look only`,sK=`Copied to the clipboard`,cK=`Could not reveal the link.`,lK=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],uK={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function dK(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function fK(e){return e?e.ok?`✓`:`!`:``}function pK({title:e,right:t,className:n,children:r}){return(0,R.jsxs)(`section`,{className:q(`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,n),children:[(0,R.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function mK({row:e=!1}){return(0,R.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:PG.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised flex gap-3 rounded-xl border p-3.5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function hK({label:e,hint:t,buttonLabel:n,placeholder:r,initial:i=``,required:a,mono:o,primary:s,onSubmit:c}){let l=(0,m.useId)(),[u,d]=(0,m.useState)(i),[f,p]=(0,m.useState)(!1),h=a&&!u.trim(),g=async()=>{h||f||(p(!0),await c(u)&&d(i),p(!1))};return(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,R.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,R.jsxs)(`div`,{className:`flex gap-2 max-md:flex-wrap`,children:[(0,R.jsx)(`input`,{id:l,value:u,maxLength:o?2e3:80,placeholder:r,"aria-describedby":t?`${l}-hint`:void 0,onChange:e=>d(e.target.value),className:q(`h-8 min-w-0 flex-1 rounded-lg border border-input bg-background px-3 text-sm outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 max-md:min-h-11`,o&&`font-mono text-[0.8125rem]`)}),(0,R.jsx)(X,{type:`submit`,label:n,icon:f?rh:Gh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,R.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function gK({onChanged:e,primary:t}){return(0,R.jsx)(hK,{label:eK,hint:tK,buttonLabel:`Add`,placeholder:WG,required:!0,mono:!0,primary:t,onSubmit:async t=>await U(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function _K({onChanged:e,primary:t}){return(0,R.jsx)(hK,{label:nK,hint:rK,buttonLabel:`Create`,placeholder:GG,primary:t,onSubmit:async t=>{let n=t.trim();return await U(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function vK({onChanged:e,stacked:t=!1}){return(0,R.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,R.jsx)(gK,{onChanged:e,primary:!0}),(0,R.jsx)(_K,{onChanged:e,primary:!0})]})}function yK({session:e,onChanged:t}){return(0,R.jsx)(hK,{label:iK,initial:e.name,required:!0,buttonLabel:iK,onSubmit:async n=>await U(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function bK({icon:e,tone:t=`muted`,children:n}){return(0,R.jsxs)(`span`,{className:q(`inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium`,t===`primary`?`bg-accent text-primary`:t===`warning`?`bg-warning/10 text-warning`:`bg-muted text-muted-foreground`),children:[(0,R.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function xK({check:e,checking:t}){return t?(0,R.jsx)(bK,{icon:rh,children:YG}):e?e.ok?(0,R.jsx)(bK,{icon:rm,tone:`primary`,children:`reachable`}):(0,R.jsx)(bK,{icon:tm,tone:`warning`,children:`unreachable`}):(0,R.jsx)(bK,{icon:am,children:HG})}function SK({label:e,children:t}){return(0,R.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm max-md:grid-cols-[minmax(5rem,6rem)_minmax(0,1fr)]`,children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsx)(`dd`,{className:`min-w-0 break-words`,children:t})]})}function CK({check:e,checking:t}){return t?(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`,"aria-hidden":`true`}),YG]}):e?(0,R.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:XG})}function wK({agent:e,on:t,onToggle:n}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:q(`flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-lg border px-2.5 text-sm transition-[background-color,border-color,color] max-md:min-h-11`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,R.jsx)(kG,{checked:t,onCheckedChange:()=>n(e)}),(0,R.jsx)(`span`,{className:`truncate`,children:uK[e]})]})})}function TK({session:e,onChanged:t}){let n=async n=>{await U(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await U(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===lK.length;return(0,R.jsxs)(pK,{title:ZG,right:dK(e.agents.length),children:[(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:lK.map(t=>(0,R.jsx)(wK,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:QG}),(0,R.jsx)(X,{label:i?`Take every agent off`:`Assign every agent`,icon:$m,onClick:()=>void r()})]})]})}function EK({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await Te(`excalidraw.reveal`,{id:e.id})).link)}catch(e){H.error(e instanceof Error?e.message:cK)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>H(sK)).catch(()=>void 0),u=async()=>{await U(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,R.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,R.jsxs)(Gj,{children:[o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{label:`Copy the link`,text:`Copy`,icon:Cm,shortcut:`C`,onClick:l}),(0,R.jsx)(X,{label:`Open board`,icon:Dm,tone:`primary`,shortcut:`O`,href:o})]}):(0,R.jsx)(X,{label:`Reveal the link`,text:`Reveal`,icon:km,shortcut:`R`,onClick:()=>void c()}),(0,R.jsx)(X,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?zh:Vh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,R.jsx)(X,{label:`Check the room`,text:`Check`,icon:n?rh:lg,shortcut:`T`,disabled:n,onClick:r}),(0,R.jsx)(SM,{icon:Cg,label:`Remove the session`,text:`Remove`,shortcut:`Delete`,title:`Remove "${e.name}"?`,description:`Agents lose this session at once; the Excalidraw room itself is not touched.`,confirmLabel:`Remove session`,variant:`destructive`,onConfirm:a})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(bK,{icon:e.contribute?Vh:km,tone:e.contribute?`primary`:`muted`,children:e.contribute?aK:oK}),(0,R.jsx)(bK,{icon:jg,children:dK(e.agents.length)}),(0,R.jsx)(xK,{check:t,checking:n})]})]}),(0,R.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,R.jsxs)(pK,{title:LG,children:[(0,R.jsx)(`p`,{className:`rounded-lg border border-border bg-muted px-3 py-2 font-mono text-[0.8125rem] break-all text-foreground`,children:o??e.masked}),(0,R.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:RG})]}),(0,R.jsx)(pK,{title:zG,children:(0,R.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(SK,{label:BG,children:(0,R.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?qG:JG})}),(0,R.jsx)(SK,{label:VG,children:(0,R.jsx)(CK,{check:t,checking:n})})]})})]}),(0,R.jsx)(TK,{session:e,onChanged:i})]}),(0,R.jsx)(pK,{title:$G,children:(0,R.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,R.jsx)(yK,{session:e,onChanged:i}),(0,R.jsx)(gK,{onChanged:i}),(0,R.jsx)(_K,{onChanged:i})]})})]})}function DK({check:e,checking:t}){if(t)return(0,R.jsx)(pj,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=fK(e);return n?(0,R.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,R.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function OK({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":r?`true`:void 0,onClick:()=>i(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(DK,{check:t,checking:n}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:dK(e.agents.length)})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,R.jsx)(jU,{variant:`secondary`,children:e.contribute?aK:oK})]})]})})}function kK({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(OK,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var AK=()=>aj(ij(`excalidraw`)),jK=e=>aj(ij(`excalidraw`,e));function MK({count:e}){return(0,R.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,R.jsx)(`span`,{className:`tabular-nums`,children:KG(e)})]})}function NK({count:e,onChanged:t}){return(0,R.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:FG}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:IG})]}),(0,R.jsx)(MK,{count:e})]}),(0,R.jsx)(mK,{row:!0}),e<5?(0,R.jsx)(pK,{title:UG,children:(0,R.jsx)(vK,{onChanged:t})}):null,(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,R.jsx)(iA,{chord:`ArrowDown`,children:`next session`}),(0,R.jsx)(iA,{chord:`ArrowRight`,children:`into its detail`})]})]})}function PK({onChanged:e}){return(0,R.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock md:px-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 place-items-center rounded-xl border text-primary`,children:(0,R.jsx)(Fh,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:jG}),(0,R.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:NG})]}),(0,R.jsx)(mK,{}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:MG})]}),(0,R.jsx)(pK,{title:UG,className:`self-start`,children:(0,R.jsx)(vK,{onChanged:e,stacked:!0})})]})})}function FK({id:e}){let t=eM(),n=xj(`excalidraw.list`,{},[`excalidraw`]),[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)([]),s=n.data?.sessions??[],c=s.find(t=>t.id===e),l=async e=>{o(t=>[...t,e]);let t=await U(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await U(`excalidraw.remove`,{id:c.id})&&(n.reload(),AK())};if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,R.jsx)(PK,{onChanged:n.reload});let d=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:AG,count:n.data?`${s.length}/5`:void 0}),n.data?(0,R.jsx)(kK,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:jK}):(0,R.jsx)(oM,{})]}),f=c?(0,R.jsx)(EK,{session:c,check:r[c.id],checking:a.includes(c.id),onCheck:()=>void l(c.id),onChanged:n.reload,onRemove:()=>void u()}):t&&n.data?(0,R.jsx)(NK,{count:s.length,onChanged:n.reload}):null;return(0,R.jsx)(iM,{wide:t,list:d,detail:f,open:c!==void 0,onClose:AK,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}function IK(e,t){return e===`lobby.thinking`||t===`1`}var LK=`bot-lobby.collapsed.`,RK=new Set,zK=new Map;function BK(e){if(zK.has(e))return zK.get(e);if(e===`lobby.thinking`)return IK(e);try{return IK(e,localStorage.getItem(LK+e))}catch{return!1}}function VK(e,t){zK.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(LK+e,t?`1`:`0`)}catch{}for(let e of[...RK])e()}function HK(e){return RK.add(e),()=>{RK.delete(e)}}function UK(e){VK(e,!BK(e))}function WK(e){return[(0,m.useSyncExternalStore)(HK,()=>BK(e),()=>IK(e)),(0,m.useCallback)(()=>VK(e,!BK(e)),[e])]}function GK({entry:e}){return e.pending?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):e.kind===`error`?(0,R.jsx)(Vg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function KK({entry:e}){return(0,R.jsxs)(`li`,{className:`grid grid-cols-[2.75rem_5rem_1rem_minmax(0,1fr)] items-baseline gap-x-2 rounded-lg px-2 py-1.5 text-sm transition-colors hover:bg-muted`,children:[(0,R.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:lM(e.at)}),(0,R.jsx)(`span`,{className:q(`overflow-hidden text-xs font-medium whitespace-nowrap`,CW(e.source)),children:SW(e.source)}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center self-center`,children:(0,R.jsx)(GK,{entry:e})}),(0,R.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,R.jsx)(`span`,{className:q(`min-w-0 break-words`,e.kind===`error`?`text-destructive`:e.pending?``:`text-muted-foreground`),children:e.pending?`${e.text}…`:e.text})]})}function qK({entries:e,collapsed:t,onToggle:n,shortcut:r,bare:i}){let a=e.slice(-400),o=a.filter(e=>e.pending).length,{ref:s,atBottom:c,stick:l,onScroll:u}=gW(JSON.stringify(a));return(0,R.jsxs)(GH,{"aria-label":`Activity`,...i?{}:{title:`Activity`},collapsed:t,...n?{onToggle:n}:{},shortcut:r,className:`flex-1`,note:o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),` `,o,` running`]}):void 0,children:[(0,R.jsx)(`div`,{ref:s,onScroll:u,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-2 pt-2 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Activity`,tabIndex:0,children:a.length===0?(0,R.jsx)(`p`,{className:`px-2 py-1 text-sm text-muted-foreground`,children:`No activity yet.`}):(0,R.jsx)(`ul`,{children:a.map(e=>(0,R.jsx)(KK,{entry:e},e.id))})}),c?null:(0,R.jsx)(`div`,{className:`absolute inset-x-0 bottom-dock z-10 flex justify-center`,children:(0,R.jsx)(PW,{onClick:l})})]})}var JK=(e,t)=>e?.keys.find(e=>e.action===t)?.label,YK=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function XK({name:e,icon:t,shortcut:n,onClick:r}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Expand ${e}`,"aria-expanded":!1,"aria-keyshortcuts":n,onClick:r,className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,children:(0,R.jsx)(t,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsxs)(Tj,{side:`left`,children:[`Expand `,e,n?(0,R.jsx)(rA,{chord:n}):null]})]})}function ZK(e){let t=YK(e.status);return(0,R.jsx)(`aside`,{"aria-label":`Minimized panes`,className:`flex w-12 shrink-0 flex-col items-center gap-1 border-l border-border py-2`,children:t.activity&&e.activityFolded?(0,R.jsx)(XK,{name:`Activity`,icon:xp,shortcut:JK(e.status,`activity`),onClick:e.toggleActivity}):null})}function QK(e){let{data:t,status:n,activityFolded:r,toggleActivity:i}=e,a=YK(n),o=a.activity&&!r;if(!a.conversation&&!o)return null;let s=a.conversation&&o;return(0,R.jsxs)(`div`,{className:q(`grid min-h-0 flex-1 gap-3 p-3`,s?`grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)]`:`grid-cols-1`),children:[a.conversation?(0,R.jsx)(KW,{chat:t?.chat??[],reply:t?.reply,busy:n?.busy??!1,hasOlder:t?.hasOlderChat??!1,hasTask:!!t?.task}):null,o?(0,R.jsx)(qK,{entries:t?.activity??[],collapsed:!1,onToggle:i,shortcut:JK(n,`activity`)}):null]})}function $K(e){let{status:t}=e,n=YK(t).activity&&e.activityFolded;return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,R.jsx)(QK,{...e})}),n?(0,R.jsx)(ZK,{...e}):null]})}function eq({data:e,status:t}){let n=YK(t),r=[...n.conversation?[{id:`conversation`,label:`Conversation`,icon:ph}]:[],...n.activity?[{id:`activity`,label:`Activity`,icon:xp}]:[]],[i,a]=(0,m.useState)(`conversation`),o=r.find(e=>e.id===i)??r[0],s=(e?.activity??[]).filter(e=>e.pending).length;return o?(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[r.length>1?(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Pane`,className:`flex shrink-0 items-center gap-0.5 border-b border-border px-3 py-2`,children:r.map(e=>{let t=e.id===o.id,n=e.icon;return(0,R.jsxs)(`button`,{type:`button`,role:`radio`,"aria-checked":t,onClick:()=>a(e.id),className:q(`inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2.5 text-[0.8125rem] font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40`,t?`btn-raised bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:[(0,R.jsx)(n,{"aria-hidden":`true`,className:`size-4`}),e.label,e.id===`activity`&&s>0?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):null]},e.id)})}):null,o.id===`conversation`?(0,R.jsx)(KW,{chat:e?.chat??[],reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task}):null,o.id===`activity`?(0,R.jsx)(qK,{entries:e?.activity??[],collapsed:!1,bare:!0}):null]}):null}function tq(e){let t=eM();return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:t?(0,R.jsx)($K,{...e}):(0,R.jsx)(eq,{...e})})}function nq(){let e=sA(`lobby`),t=sA(`status`),[n,r]=WK(`lobby.activity`);return!e.data&&e.loading?(0,R.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{}),(0,R.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,R.jsx)(yj,{message:e.error,onRetry:()=>fe.onHello({})}):(0,R.jsx)(tq,{data:e.data,status:t.data,activityFolded:n,toggleActivity:r})}var rq=Jg([`relative flex flex-col bg-muted/50 gap-(--frame-gap) px-(--frame-px) py-(--frame-py) rounded-(--frame-radius)`,`[--frame-radius:var(--radius-xl)]`,`[--frame-gap:--spacing(0.75)] [--frame-px:--spacing(0.75)] [--frame-py:--spacing(0.75)] [--frame-panel-header-gap:0rem] [--frame-panel-footer-gap:--spacing(1)]`,`[--frame-panel-px-adjust:0px] [--frame-panel-py-adjust:0px] [--frame-panel-header-px-adjust:0px] [--frame-panel-header-py-adjust:0px] [--frame-panel-footer-px-adjust:0px] [--frame-panel-footer-py-adjust:0px]`,`[--frame-panel-px:calc(var(--frame-panel-px-base)+var(--frame-panel-px-adjust))] [--frame-panel-py:calc(var(--frame-panel-py-base)+var(--frame-panel-py-adjust))] [--frame-panel-header-px:calc(var(--frame-panel-header-px-base)+var(--frame-panel-header-px-adjust))] [--frame-panel-header-py:calc(var(--frame-panel-header-py-base)+var(--frame-panel-header-py-adjust))] [--frame-panel-footer-px:calc(var(--frame-panel-footer-px-base)+var(--frame-panel-footer-px-adjust))] [--frame-panel-footer-py:calc(var(--frame-panel-footer-py-base)+var(--frame-panel-footer-py-adjust))]`,``,`[--frame-panel-bg:var(--workspace-card)] [--frame-panel-border-color:var(--workspace-border)] [--frame-border-color:var(--workspace-border)]`,`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px)-1px)]`],{variants:{variant:{default:`border border-[var(--frame-border-color)] bg-clip-padding`,inverse:`[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding`,ghost:`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px))]`},spacing:{xs:`[--frame-panel-px-base:--spacing(2)] [--frame-panel-py-base:--spacing(2)] [--frame-panel-header-px-base:--spacing(2)] [--frame-panel-header-py-base:--spacing(0.5)] [--frame-panel-footer-px-base:--spacing(2)] [--frame-panel-footer-py-base:--spacing(0.5)]`,sm:`[--frame-panel-px-base:--spacing(3)] [--frame-panel-py-base:--spacing(3.5)] [--frame-panel-header-px-base:--spacing(3)] [--frame-panel-header-py-base:--spacing(1.5)] [--frame-panel-footer-px-base:--spacing(3)] [--frame-panel-footer-py-base:--spacing(1.5)]`,default:`[--frame-panel-px-base:--spacing(4)] [--frame-panel-py-base:--spacing(4)] [--frame-panel-header-px-base:--spacing(4)] [--frame-panel-header-py-base:--spacing(2)] [--frame-panel-footer-px-base:--spacing(4)] [--frame-panel-footer-py-base:--spacing(2)]`,lg:`[--frame-panel-px-base:--spacing(5)] [--frame-panel-py-base:--spacing(5)] [--frame-panel-header-px-base:--spacing(5)] [--frame-panel-header-py-base:--spacing(2.5)] [--frame-panel-footer-px-base:--spacing(5)] [--frame-panel-footer-py-base:--spacing(2.5)]`},stacked:{true:[`gap-0 *:has-[+[data-slot=frame-panel]]:rounded-b-none`,`*:has-[+[data-slot=frame-panel]]:before:hidden`,`*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:rounded-t-none`,`*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:border-t-0`],false:[`data-[spacing=sm]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-0.5`,`data-[spacing=default]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1`,`data-[spacing=lg]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-2`]},dense:{true:`p-0 gap-0 border-[var(--frame-border-color)] [--frame-panel-radius:var(--frame-radius)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px [&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:-mt-px`,false:``}},defaultVariants:{variant:`default`,spacing:`default`,stacked:!1,dense:!1}});function iq({className:e,variant:t,spacing:n,stacked:r,dense:i,...a}){return(0,R.jsx)(`div`,{className:q(rq({variant:t,spacing:n,stacked:r,dense:i}),e),"data-slot":`frame`,"data-spacing":n,...a})}function aq({className:e,fit:t,...n}){return(0,R.jsx)(`div`,{className:q(`relative overflow-hidden rounded-(--frame-panel-radius) border border-(--frame-panel-border-color) bg-(--frame-panel-bg) bg-clip-padding shadow-xs`,!t&&`grow`,`before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--frame-panel-radius)-1px)] before:shadow-black/5`,`dark:bg-clip-border dark:before:shadow-white/5`,`px-(--frame-panel-px) py-(--frame-panel-py)`,e),"data-slot":`frame-panel`,...n})}function oq({className:e,...t}){return(0,R.jsx)(`header`,{className:q(`flex flex-col gap-(--frame-panel-header-gap) px-(--frame-panel-header-px) py-(--frame-panel-header-py)`,e),"data-slot":`frame-panel-header`,...t})}var sq={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function cq(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function lq(e){return e>0?cq(e):`—`}function uq(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function dq(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function fq(e){return!Number.isFinite(e)||e<1e3?String(Math.max(0,Math.round(e||0))):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function pq(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function mq(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function hq(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function gq(e,t){let n=t===`model-kind`?sq[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var _q=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],vq={MASTER:`bg-primary`,ORACLE:`bg-primary`,DEV:`bg-source-dev`,DESIGN:`bg-source-design`,QA:`bg-source-qa`,RESEARCH:`bg-source-research`,"QUICK FIX":`bg-source-quickfix`};function yq(e){let t=vq[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%_q.length;return _q[n]??_q[0]}function bq(e){return sq[e]??e}var xq=6;function Sq({daily:e,cost:t}){let n=(0,m.useId)().replace(/:/g,``),r=xf(),[i,a]=(0,m.useState)(null),o=t?`Daily cost`:`Daily runs`,s=e.map(e=>t?e.cost:e.runs),c=Math.max(...s,t?.01:1),l=t?[0,c/2,c]:[...new Set([0,Math.ceil(c/2),c])],u=Date.parse(e[0]?.date??`1970-01-01`),d=Date.parse(e.at(-1)?.date??`1970-01-01`),f=Math.max(1,(d-u)/864e5),p=e=>52+(Date.parse(e)-u)/(f*864e5)*424,h=Math.max(.5,Math.min(28,424/(f+1)*.65)),g=e=>t?`$${e.toFixed(2)}`:String(Math.round(e)),_=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`}),v=[...new Set([e[0]?.date,e[Math.floor(e.length/2)]?.date,e.at(-1)?.date])].filter(e=>!!e);return(0,R.jsxs)(wq,{title:o,right:t?`USD · per day`:`all runs · successful runs`,children:[(0,R.jsx)(`div`,{className:`flex min-h-5 flex-wrap items-baseline gap-x-2 text-xs`,"aria-live":`polite`,children:i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`font-medium`,children:_(i.date)}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:t?g(i.cost):`${i.runs} runs · ${i.successes} successful`})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Hover or focus a day to inspect it.`})}),(0,R.jsxs)(`svg`,{viewBox:`0 0 512 220`,className:`w-full overflow-visible`,role:`group`,"aria-label":o,children:[(0,R.jsx)(`defs`,{children:(0,R.jsxs)(`linearGradient`,{id:`${n}-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--primary)`,stopOpacity:`0.5`})]})}),l.map(e=>(0,R.jsxs)(`g`,{"aria-hidden":`true`,children:[(0,R.jsx)(`line`,{x1:`36`,x2:`494`,y1:180-e/c*144,y2:180-e/c*144,stroke:`var(--workspace-border)`,strokeDasharray:`3 5`,opacity:`0.6`}),(0,R.jsx)(`text`,{x:`29`,y:184-e/c*144,textAnchor:`end`,fill:`var(--muted-foreground)`,fontSize:`10`,children:g(e)})]},e)),e.map((e,o)=>{let s=(t?e.cost:e.runs)/c*144,l=u===d?264:p(e.date),f=`${e.date}: ${t?g(e.cost):`${e.runs} runs, ${e.successes} successful`}`;return(0,R.jsxs)(`g`,{role:`img`,"aria-label":f,tabIndex:0,className:`outline-none`,onFocus:()=>a(e),onBlur:()=>a(null),onPointerEnter:()=>a(e),onPointerLeave:()=>a(null),children:[(0,R.jsx)(`title`,{children:f}),(0,R.jsx)(`rect`,{x:l-Math.max(h,12)/2,y:`26`,width:Math.max(h,12),height:`156`,rx:`4`,fill:`var(--accent)`,opacity:+(i?.date===e.date)}),(0,R.jsx)(B.rect,{"data-trend-bar":!0,x:l-h/2,width:h,rx:`3`,fill:`url(#${n}-fill)`,initial:!r&&{height:0,y:180},animate:{height:s,y:180-s},transition:{duration:r?0:.65,delay:r?0:Math.min(o*.04,.3),ease:[.22,1,.36,1]}}),t?null:(0,R.jsx)(B.rect,{x:l-h/2,width:h,rx:`3`,fill:`var(--success)`,initial:!r&&{height:0,y:180},animate:{height:e.successes/c*144,y:180-e.successes/c*144},transition:{duration:r?0:.65,delay:r?0:Math.min(o*.04,.3)}})]},e.date)}),v.map(e=>(0,R.jsx)(`text`,{"aria-hidden":`true`,x:u===d?264:p(e),y:`205`,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`11`,children:_(e)},e))]}),t?null:(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`i`,{className:`size-2 rounded-sm bg-primary`,"aria-hidden":`true`}),`All runs`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`i`,{className:`size-2 rounded-sm bg-success`,"aria-hidden":`true`}),`Successful`]})]})]})}function Cq({daily:e}){return(0,R.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,R.jsx)(Sq,{daily:e}),(0,R.jsx)(Sq,{daily:e,cost:!0})]})}function wq({title:e,right:t,children:n}){return(0,R.jsxs)(iq,{role:`region`,className:`min-w-0`,"aria-label":e,children:[(0,R.jsx)(oq,{className:`py-2.5`,children:(0,R.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-semibold`,children:[(0,R.jsx)(`span`,{children:e}),t?(0,R.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]})}),(0,R.jsx)(aq,{className:`flex min-w-0 flex-col gap-3`,children:n})]})}function Tq({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,xq);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>xq?(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`h-6 self-start rounded-lg text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:n?`Show fewer`:`Show all ${e.length}`}):null]})}function Eq({width:e,className:t,title:n}){let r=xf();return(0,R.jsx)(B.div,{"data-chart-bar":!0,title:n,className:`h-full ${t}`,initial:!r&&{width:0},animate:{width:`${e}%`},transition:{duration:r?0:.7,ease:[.22,1,.36,1]}})}function Dq(e,t){return t>0?Math.max(1.5,e/t*100):0}function Oq({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,R.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,R.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,R.jsxs)(`div`,{className:`relative h-5 overflow-hidden rounded-md border border-border bg-muted chart-track`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,R.jsx)(Eq,{className:`rounded-r-md bg-linear-to-r from-primary/65 to-primary`,width:Dq(t,r)}),n?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-1/2 h-3 w-0.5 -translate-y-1/2 rounded-full bg-foreground/40`,style:{left:`${Math.min(99.5,Dq(n,r))}%`}}):null]})]})}function kq({groups:e,label:t}){let n=e.filter(e=>e.avgMs>0).sort((e,t)=>t.avgMs-e.avgMs),r=Math.max(...n.map(e=>Math.max(e.avgMs,e.p90Ms)),1);return(0,R.jsx)(wq,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,R.jsx)(Tq,{rows:n,render:e=>(0,R.jsx)(Oq,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:lq(e.avgMs),sub:`p90 ${lq(e.p90Ms)}`},t(e))})})}var Aq={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},jq={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function Mq({label:e,rate:t,runs:n}){let r=mq(t),i=`${Math.round(t*100)}%`;return(0,R.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 ${jq[r.tone]}`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${Aq[r.tone]}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,R.jsxs)(`div`,{className:`flex h-5 overflow-hidden rounded-md border border-border bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,R.jsx)(Eq,{className:`bg-success/80`,width:t*100}),(0,R.jsx)(Eq,{className:`bg-destructive/60`,width:(1-t)*100})]})]})}function Nq({groups:e,label:t}){let n=e.filter(e=>e.runs>0).sort((e,t)=>e.successes/e.runs-t.successes/t.runs);return(0,R.jsx)(wq,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,R.jsx)(Tq,{rows:n,render:e=>(0,R.jsx)(Mq,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function Pq({share:e}){return(0,R.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${yq(e.agent)}`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`text-[0.8125rem]`,children:SW(e.agent)}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,R.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,cq(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function Fq({share:e}){return(0,R.jsx)(`div`,{className:`flex h-6 gap-0.5 overflow-hidden rounded-md border border-border bg-muted`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,R.jsx)(Eq,{className:`${yq(e.agent)} opacity-85`,width:e.share*100,title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function Iq({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,R.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,R.jsx)(Tq,{rows:e,render:e=>(0,R.jsx)(Oq,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:cq(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function Lq({timeShare:e}){let t=e.byAgent;return(0,R.jsxs)(wq,{title:`Where the time goes`,right:`share of run time by agent`,children:[t.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(Fq,{share:t}),(0,R.jsx)(Pq,{share:t})]}),(0,R.jsx)(Iq,{times:e.taskTimes})]})}function Rq(e){return(0,R.jsx)(FD,{...e})}function zq(e){return(0,R.jsx)(zD,{"data-slot":`select-value`,...e})}function Bq({className:e,children:t,...n}){return(0,R.jsxs)(LD,{"data-slot":`select-trigger`,className:q(`reui-select flex h-9 min-w-36 items-center justify-between gap-3 rounded-lg border px-3 text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/30 disabled:opacity-50`,e),...n,children:[t,(0,R.jsx)(BD,{asChild:!0,children:(0,R.jsx)(Up,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})})]})}function Vq({className:e,children:t,position:n=`popper`,align:r=`start`,...i}){return(0,R.jsx)(UD,{children:(0,R.jsxs)(GD,{"data-slot":`select-content`,position:n,align:r,sideOffset:4,className:q(`reui-menu z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) origin-(--radix-select-content-transform-origin) overflow-hidden rounded-xl border p-1 shadow-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 motion-reduce:animate-none`,e),...i,children:[(0,R.jsx)(hO,{className:`flex justify-center py-1`,children:(0,R.jsx)(Yp,{"aria-hidden":`true`,className:`size-4`})}),(0,R.jsx)(rO,{children:t}),(0,R.jsx)(_O,{className:`flex justify-center py-1`,children:(0,R.jsx)(Up,{"aria-hidden":`true`,className:`size-4`})})]})})}function Hq({className:e,children:t,...n}){return(0,R.jsxs)(lO,{"data-slot":`select-item`,className:q(`relative flex cursor-default items-center gap-2 rounded-lg py-2 pr-8 pl-3 text-xs outline-none select-none data-highlighted:bg-accent data-disabled:opacity-50`,e),...n,children:[(0,R.jsx)(dO,{children:t}),(0,R.jsx)(pO,{className:`absolute right-2`,children:(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3.5 text-primary`})})]})}function Uq({className:e,type:t,...n}){return(0,R.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`flex h-8 w-full rounded-lg border border-input bg-background px-3 py-1 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...n})}var Wq=[{value:`all`,label:`All time`},{value:`today`,label:`Today`},{value:`week`,label:`Past 7 days`},{value:`range`,label:`Date range`}];function Gq(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Kq({onChange:e}){let[t,n]=(0,m.useState)(`all`),r=Gq(new Date),[i,a]=(0,m.useState)(r),[o,s]=(0,m.useState)(r),[c,l]=(0,m.useState)(``);function u(t){if(n(t),l(``),t===`all`)e({});else if(t===`range`)i&&o&&i<=o&&e({from:i,to:o});else{let n=new Date;t===`week`&&n.setDate(n.getDate()-6),e({from:Gq(n),to:r})}}return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-end gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Period`}),(0,R.jsxs)(Rq,{value:t,onValueChange:u,children:[(0,R.jsx)(Bq,{"aria-label":`Metrics period`,children:(0,R.jsx)(zq,{})}),(0,R.jsx)(Vq,{children:Wq.map(e=>(0,R.jsx)(Hq,{value:e.value,children:e.label},e.value))})]})]}),t===`range`?(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-wrap items-end gap-2`,onSubmit:t=>{if(t.preventDefault(),!i||!o||i>o){l(`Choose an end date on or after the start date.`);return}l(``),e({from:i,to:o})},children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[`Start date`,(0,R.jsx)(Uq,{type:`date`,required:!0,value:i,onChange:e=>a(e.target.value),className:`h-9 w-36 max-w-full text-xs`})]}),(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[`End date`,(0,R.jsx)(Uq,{type:`date`,required:!0,value:o,onChange:e=>s(e.target.value),className:`h-9 w-36 max-w-full text-xs`})]}),(0,R.jsx)(Y,{type:`submit`,size:`sm`,className:`h-9`,children:`Apply`}),c?(0,R.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:c}):null]}):null]})}function qq({label:e,value:t,sub:n}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var Jq=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Yq({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,R.jsxs)(`section`,{className:`card-raised flex flex-col gap-3 rounded-xl border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,R.jsx)(qq,{label:`Calls`,value:Jq(e.calls,`call`),sub:`${uq(e.ok,e.calls)} ok`}),(0,R.jsx)(qq,{label:`Speed`,value:`p50 ${pq(e.p50Ms)}`,sub:`p90 ${pq(e.p90Ms)}`}),(0,R.jsx)(qq,{label:`Read`,value:e.input>0?`${fq(e.input)} tokens`:`—`}),(0,R.jsx)(qq,{label:`Routed down`,value:e.routed>0?Jq(e.routed,`run`):`none`,sub:e.routed>0?`${uq(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,Jq(e.seatRunsSkipped,`seat run`),` skipped · `,Jq(e.questionsAnswered,`question`),` answered · `,Jq(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,R.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var Xq=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function Zq(e,t=0){return e>0?e.toFixed(t):`—`}function Qq(e){return[String(e.runs),uq(e.successes,e.runs),lq(e.avgMs),lq(e.p50Ms),lq(e.p90Ms),Zq(e.avgTurns,1),Zq(e.avgTools,1),e.avgTokens>0?fq(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,dq(e.avgCost),dq(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function $q(e,t){return t===`model-kind`?bq(e.kinds[0]??``):e.kinds.map(bq).join(`, `)}function eJ({groups:e,groupBy:t}){return(0,R.jsxs)(`section`,{className:`card-raised flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border pt-4`,"aria-label":`All models`,children:[(0,R.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,R.jsx)(`span`,{children:`All models`}),(0,R.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,R.jsx)(`div`,{className:`max-h-80 overflow-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,tabIndex:0,role:`region`,"aria-label":`All model metrics, scroll horizontally to see all columns`,children:(0,R.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,R.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),Xq.map(e=>(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,R.jsx)(`tbody`,{children:e.map(e=>(0,R.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,R.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:$q(e,t)||`—`}),Qq(e).map((e,t)=>(0,R.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},Xq[t]))]},gq(e,t)))})]})})]})}var tJ={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function nJ({label:e,value:t,sub:n,dot:r}){return(0,R.jsxs)(`div`,{className:`workspace-section flex min-w-0 flex-col gap-1 rounded-xl border px-4 py-4 shadow-xs`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${tJ[r.tone]}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function rJ({tiles:e}){let t=mq(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,R.jsx)(nJ,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,R.jsx)(nJ,{label:`Success`,value:uq(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,R.jsx)(nJ,{label:`Avg run`,value:lq(e.avgMs),sub:`p90 ${lq(e.p90Ms)}`}),(0,R.jsx)(nJ,{label:`Cost`,value:dq(e.cost),sub:e.runs>0?`${dq(e.cost/e.runs)} per run`:`—`}),(0,R.jsx)(nJ,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${cq(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var iJ=`No runs recorded yet. Every Master turn, subagent run, quick fix and planning round lands here with its model, thinking level, time, tokens and cost.`;function aJ({groupBy:e,onGroup:t}){return(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex max-w-full flex-wrap gap-0.5 rounded-lg bg-muted p-0.5`,onKeyDown:n=>{let r=n.key===`ArrowRight`||n.key===`ArrowDown`?1:n.key===`ArrowLeft`||n.key===`ArrowUp`?-1:0;if(!r)return;n.preventDefault();let i=[`model`,`model-kind`],a=i[(i.indexOf(e)+r+i.length)%i.length];t(a),requestAnimationFrame(()=>n.currentTarget.querySelector(`[aria-checked='true']`)?.focus())},children:[`model`,`model-kind`].map(n=>(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,role:`radio`,tabIndex:e===n?0:-1,className:e===n?`bg-card text-foreground shadow-card hover:bg-card`:`text-muted-foreground`,"aria-checked":e===n,onClick:()=>t(n),children:hq(n)},n))})}function oJ({query:e,onQuery:t}){return(0,R.jsxs)(`label`,{className:`relative flex max-w-full items-center`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,R.jsx)(ag,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,R.jsx)(`input`,{id:`metrics-search`,type:`search`,value:e,maxLength:500,placeholder:`Search runs: model, agent, tool…`,onChange:e=>t(e.target.value),className:`h-8 w-64 max-w-full rounded-lg border border-input bg-background pr-9 pl-8 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`}),(0,R.jsx)(rA,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function sJ({data:e,groupBy:t,query:n}){let r=e=>gq(e,t);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsx)(rJ,{tiles:e.tiles}),e.tiles.runs===0?(0,R.jsx)(`p`,{className:`card-raised rounded-xl border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}" in this period.`:`No runs in this period. ${iJ}`}):null,e.daily.length>0?(0,R.jsx)(Cq,{daily:e.daily}):null,e.classifier?(0,R.jsx)(Yq,{summary:e.classifier}):null,e.tiles.runs>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,R.jsx)(kq,{groups:e.groups,label:r}),(0,R.jsx)(Nq,{groups:e.groups,label:r})]}),(0,R.jsx)(eJ,{groups:e.groups,groupBy:t})]}):null,e.tiles.runs>0||e.timeShare.taskTimes.length>0?(0,R.jsx)(Lq,{timeShare:e.timeShare}):null]})}function cJ(){return(0,R.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,role:`status`,"aria-label":`Loading metrics`,children:[0,1,2,3,4].map(e=>(0,R.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function lJ(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),[i,a]=(0,m.useState)({}),o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=xj(`metrics.get`,{groupBy:e,query:n,...i,timeZone:o},[`metrics`]);return!s.data&&s.error?(0,R.jsx)(yj,{message:`Could not load metrics. ${s.error}`,onRetry:s.reload}):(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Daily trends and model performance`})]}),s.loading&&s.data?(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`})]}),(0,R.jsxs)(`section`,{"aria-label":`Metrics filters`,className:`workspace-section flex flex-wrap items-end gap-4 rounded-xl border p-4`,children:[(0,R.jsx)(Kq,{onChange:a}),(0,R.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-end gap-3 lg:w-auto lg:flex-1 lg:justify-end`,children:[(0,R.jsx)(aJ,{groupBy:e,onGroup:t}),(0,R.jsx)(oJ,{query:n,onQuery:r})]}),(0,R.jsxs)(`p`,{className:`w-full text-xs text-muted-foreground`,children:[i.from?`${i.from} – ${i.to}`:`All recorded dates`,` · `,o,`. Runs and active tasks use their start date; completed tasks use their completion date.`]})]}),s.error?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not refresh metrics. `,s.error]}):null,(0,R.jsx)(`div`,{"aria-busy":s.loading,className:s.loading&&s.data?`opacity-60`:void 0,children:s.data?(0,R.jsx)(sJ,{data:s.data,groupBy:e,query:n},JSON.stringify([s.data,e])):(0,R.jsx)(cJ,{})})]})}var uJ=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function dJ(e,t){return JSON.stringify([e,`prompt`,t])}function fJ(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function pJ(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var mJ=`bot-lobby.prompt-sound-muted`,hJ=new Set,gJ,_J=!1;function vJ(){try{return localStorage.getItem(mJ)===`on`}catch{return _J}}function yJ(e){_J=e;try{localStorage.setItem(mJ,e?`on`:`off`)}catch{}for(let e of hJ)e()}function bJ(e){return hJ.add(e),()=>{hJ.delete(e)}}function xJ(){return(0,m.useSyncExternalStore)(bJ,vJ,()=>!1)}function SJ(){(0,m.useEffect)(()=>{let e=()=>{try{gJ??=new AudioContext,gJ.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function CJ(){if(!vJ()&&gJ&&gJ.state===`running`)try{let e=gJ.currentTime,t=gJ.createOscillator(),n=gJ.createGain();t.frequency.setValueAtTime(960,e),t.frequency.exponentialRampToValueAtTime(360,e+.16),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.12,e+.012),n.gain.exponentialRampToValueAtTime(1e-4,e+.22),t.connect(n),n.connect(gJ.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}function wJ(){if(!vJ()&&gJ&&gJ.state===`running`)try{let e=gJ.currentTime,t=gJ.createOscillator(),n=gJ.createGain();t.frequency.setValueAtTime(1500,e),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.045,e+.004),n.gain.exponentialRampToValueAtTime(1e-4,e+.028),t.connect(n),n.connect(gJ.destination),t.start(e),t.stop(e+.03),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var TJ=`bot-lobby.notifications`,EJ=`/icon-192.png`,DJ=new Set;function OJ(){for(let e of[...DJ])e()}function kJ(){try{return localStorage.getItem(TJ)===`on`}catch{return!1}}function AJ(e){return DJ.add(e),()=>{DJ.delete(e)}}function jJ(e){try{localStorage.setItem(TJ,e?`on`:`off`)}catch{}OJ()}function MJ(){return(0,m.useSyncExternalStore)(AJ,kJ,()=>!1)}async function NJ(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(jJ(!0),`granted`):`denied`)}function PJ(){jJ(!1)}function FJ(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function IJ(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function LJ(e){try{new Notification(`bot-lobby`,{body:e,icon:EJ,tag:`bot-lobby`})}catch{}}function RJ(){try{return new uJ(sessionStorage)}catch{return new uJ}}function zJ(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?fJ(e,t.sessionId??n.key??t.from,n.dialog.id):dJ(e,t.id)}function BJ(){let e=MJ();SJ(),aA();let t=xj(`tasks.list`,{},[`tasks`]),n=xj(`sessions.list`,{},[`sessions`]),r=fe.get(`prompts`),i=fe.get(`lobby`).data,a=(0,m.useRef)(RJ()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=P()??`current`,l=fe.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function VJ(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(l.forEach(()=>CJ()),c&&IJ()&&LJ(r),t===`delivery`&&H.info(r,{action:{label:`Review tasks`,onClick:()=>aj(`#/tasks`)}}))}function HJ(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;VJ(e,`prompts`,(a??[]).map(e=>zJ(i,e)),`A question is waiting for you.`,!!a&&!t.loading),VJ(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>fJ(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),VJ(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>pJ(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function UJ(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}HJ(e);let s=a?.task?.state??``,c=FJ(s);i.current&&c&&s!==i.current&&o&&IJ()&&LJ(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function WJ(){let e=BJ(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>UJ(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function GJ({className:e,thumbClassName:t,...n}){return(0,R.jsx)(IO,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:q(`peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150 outline-none before:absolute before:-inset-x-2 before:-inset-y-3 before:content-[''] focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,R.jsx)(RO,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block size-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-snap data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,t)})})}var KJ=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],qJ=`M32 17 C28 10 19 12 17 19 C10 19 7 26 10 32 C5 38 9 46 15 47 C16 54 25 56 32 50 C39 56 48 54 49 47 C55 46 59 38 54 32 C57 26 54 19 47 19 C45 12 36 10 32 17Z`,JJ=`M32 17 C28 12 21 12 18 19 C12 19 9 25 11 31 C7 36 9 44 15 46 C16 53 26 55 32 50 C38 55 48 53 49 46 C55 44 57 36 53 31 C55 25 52 19 46 19 C43 12 36 12 32 17Z`,YJ=[`M19 22 C16 25 17 29 22 29 C27 29 28 33 25 36`,`M12 35 C16 32 20 35 18 39 C16 43 20 47 24 45`,`M25 17 C22 20 26 22 28 22 C31 23 29 27 26 27`,`M11 42 C13 44 16 42 15 39 M22 49 C26 49 29 45 27 41`,`M15 25 C12 27 14 31 17 31 M21 32 C22 35 20 37 22 39 C24 41 28 38 29 35`,`M20 18 C22 18 23 20 21 22 M24 24 C21 23 20 25 21 27 M12 37 C14 36 16 38 15 40 M20 43 C23 44 25 42 24 40 M28 29 C30 30 30 32 28 33`];function XJ({level:e,className:t}){let n=xf(),r=Math.max(0,KJ.indexOf(e)),i=[0,1,2,2,3,4,6][r],a=r===KJ.length-1,o=`brain-${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`;return(0,R.jsxs)(`svg`,{viewBox:`0 0 64 72`,"data-slot":`effort-mascot`,"data-level":e,"data-folds":i*2,"data-elevated":a||void 0,"aria-hidden":`true`,focusable:`false`,className:q(`size-16 shrink-0 overflow-visible`,t),children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsxs)(`linearGradient`,{id:`${o}-ink`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,R.jsx)(`stop`,{stopColor:a?`var(--rainbow-5)`:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`0.55`,stopColor:a?`var(--rainbow-6)`:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:a?`var(--rainbow-7)`:`var(--primary)`})]}),(0,R.jsxs)(`radialGradient`,{id:`${o}-halo`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--rainbow-6)`,stopOpacity:`0.38`}),(0,R.jsx)(`stop`,{offset:`0.55`,stopColor:`var(--rainbow-7)`,stopOpacity:`0.18`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-5)`,stopOpacity:`0`})]}),(0,R.jsxs)(`linearGradient`,{id:`${o}-shine`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--card)`,stopOpacity:`0`}),(0,R.jsx)(`stop`,{offset:`0.5`,stopColor:`var(--primary)`,stopOpacity:`0.6`}),(0,R.jsx)(`stop`,{offset:`0.6`,stopColor:`var(--card)`,stopOpacity:`0.9`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--card)`,stopOpacity:`0`})]}),(0,R.jsxs)(`filter`,{id:`${o}-glow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,R.jsx)(`feGaussianBlur`,{stdDeviation:`1.4`}),(0,R.jsxs)(`feMerge`,{children:[(0,R.jsx)(`feMergeNode`,{}),(0,R.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,R.jsx)(`clipPath`,{id:`${o}-silhouette`,children:(0,R.jsx)(`path`,{d:qJ})}),(0,R.jsx)(`pattern`,{id:`${o}-hologram`,width:`4`,height:`3`,patternUnits:`userSpaceOnUse`,children:(0,R.jsx)(`path`,{d:`M0 1.5H4`,stroke:`var(--rainbow-5)`,strokeWidth:`0.4`,opacity:`0.4`})})]}),(0,R.jsx)(`ellipse`,{cx:`32`,cy:`63`,rx:a?14:19,ry:`2.5`,className:`fill-primary/10`}),a?(0,R.jsx)(B.circle,{"data-brain-halo":!0,cx:`32`,cy:`32`,r:`33`,fill:`url(#${o}-halo)`,initial:!1,animate:{opacity:n?.8:[.65,1,.65]},transition:{duration:n?0:3,repeat:n?0:1/0}}):null,(0,R.jsxs)(B.g,{"data-brain-body":!0,initial:!1,animate:{y:a?n?-5:[-5,-7,-5]:0},transition:{duration:n?0:a?3:.3,repeat:a&&!n?1/0:0,ease:`easeInOut`},stroke:`url(#${o}-ink)`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,filter:a?`url(#${o}-glow)`:void 0,children:[a?[`cyan`,`magenta`].map(e=>(0,R.jsx)(`use`,{href:`#${o}-shape`,"data-brain-phase":e,className:`brain-phase-echo`,stroke:`currentColor`},e)):null,(0,R.jsxs)(`g`,{id:`${o}-shape`,"data-brain-shape":!0,className:`brain-shape`,children:[(0,R.jsx)(`path`,{d:`M30 49 L30 56 Q32 59 35 57 L35 51`,className:`fill-primary/15`}),(0,R.jsx)(`path`,{d:r<=3?JJ:qJ,className:r===0?`fill-muted`:r<=3?`fill-primary/15`:`fill-primary/10`}),(0,R.jsx)(`path`,{d:`M32 17 C29 24 34 28 32 34 C30 40 34 45 32 50`,fill:`none`,opacity:r===0?.35:.8}),[!1,!0].map(e=>(0,R.jsx)(`g`,{transform:e?`translate(64 0) scale(-1 1)`:void 0,fill:`none`,children:YJ.slice(0,i).map((e,t)=>(0,R.jsx)(B.path,{"data-brain-fold":!0,d:e,initial:!n&&{opacity:0,pathLength:0},animate:{opacity:.85,pathLength:1},transition:{duration:n?0:.3,delay:n?0:t*.025}},e))},String(e))),r>0&&r<5?(0,R.jsx)(`g`,{stroke:`none`,fill:`var(--primary)`,children:[[20,27],[43,36],[25,44]].slice(0,Math.min(r,3)).map(([e,t],n)=>(0,R.jsx)(`circle`,{cx:e,cy:t,r:`1.4`,className:`brain-spark`,style:{animationDelay:`${n*-.7}s`}},e))}):null,r>=5?(0,R.jsx)(`g`,{clipPath:`url(#${o}-silhouette)`,stroke:`none`,children:(0,R.jsx)(`rect`,{"data-brain-shimmer":!0,className:`brain-shimmer`,x:`-24`,y:`10`,width:`18`,height:`48`,fill:`url(#${o}-shine)`})}):null]}),a?(0,R.jsxs)(`g`,{clipPath:`url(#${o}-silhouette)`,stroke:`none`,children:[(0,R.jsx)(`path`,{d:qJ,fill:`url(#${o}-hologram)`}),(0,R.jsx)(`rect`,{"data-brain-scan":!0,className:`brain-phase-scan`,x:`7`,y:`14`,width:`50`,height:`2`,fill:`var(--rainbow-5)`,opacity:`0.45`})]}):null]}),a?(0,R.jsx)(`g`,{fill:`url(#${o}-ink)`,children:[[8,14],[56,12],[5,49],[58,46]].map(([e,t])=>(0,R.jsx)(`path`,{d:`M0 -3 L0.8 -0.8 L3 0 L0.8 0.8 L0 3 L-0.8 0.8 L-3 0 L-0.8 -0.8Z`,transform:`translate(${e} ${t})`},e))}):null]})}var ZJ={minimal:`min`,medium:`med`},QJ={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`};function $J(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}function eY(e,t,n,r){for(let i=n+r;i>=0&&i<e.length;i+=r)if(t.includes(e[i]))return i;return n}function tY({value:e,levels:t,supported:n,model:r,label:i,disabled:a,onChange:o}){let s=(0,m.useRef)(null),[c,l]=(0,m.useState)(),[u,d]=(0,m.useState)(),f=(0,m.useRef)(void 0),p=(0,m.useRef)(0),h=(0,m.useCallback)(()=>{f.current=void 0,p.current=0,d(void 0)},[]),g=Math.max(t.length-1,1),_=$J(t,n,Math.max(0,t.indexOf(e))),v=c??u??_,y=v<0?0:v/g*100,b=t[v]??e,x=v>=0&&b!==e;(0,m.useEffect)(()=>{if(u===void 0)return;let e=window.setTimeout(h,1e4);return()=>window.clearTimeout(e)},[u,h]);let S=(0,m.useCallback)(e=>{let r=s.current?.getBoundingClientRect();if(!r||r.width===0)return _;let i=Math.min(1,Math.max(0,(e-r.left)/r.width));return $J(t,n,Math.round(i*g))},[g,t,_,n]);function C(e){a||n.length===0||(e.currentTarget.setPointerCapture(e.pointerId),l(S(e.clientX)))}function w(e){if(c===void 0)return;let t=S(e.clientX);t!==c&&l(t)}function T(){if(c===void 0)return;let n=t[c];l(void 0),n&&n!==e&&o(n)}function E(e){if(a||v<0)return;let r=f.current??v,i={ArrowRight:eY(t,n,r,1),ArrowUp:eY(t,n,r,1),ArrowLeft:eY(t,n,r,-1),ArrowDown:eY(t,n,r,-1),Home:$J(t,n,0),End:$J(t,n,g)}[e.key];if(i===void 0)return;e.preventDefault();let s=t[i];s&&i!==r&&(f.current=i,d(i),p.current+=1,Promise.resolve(o(s)).catch(()=>void 0).then(()=>{--p.current,p.current<=0&&h()}))}return(0,R.jsxs)(`div`,{className:q(`flex min-w-0 flex-col items-center gap-3 min-[360px]:flex-row`,a&&`opacity-60`),children:[(0,R.jsx)(XJ,{level:b}),(0,R.jsxs)(`div`,{className:`flex w-full min-w-0 flex-1 flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`span`,{"data-level":b,className:`effort-word text-[0.8125rem] font-medium capitalize`,"aria-hidden":`true`,children:b}),(0,R.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:QJ[b]??``})]}),(0,R.jsxs)(`div`,{ref:s,role:`slider`,tabIndex:a?-1:0,"aria-label":i,"aria-valuemin":0,"aria-valuemax":t.length-1,"aria-valuenow":Math.max(v,0),"aria-valuetext":b,"aria-disabled":a||void 0,onPointerDown:C,onPointerMove:w,onPointerUp:T,onPointerCancel:()=>l(void 0),onKeyDown:E,className:`relative mx-2.5 h-6 touch-none cursor-pointer rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-1/2 h-1.5 -translate-y-1/2 rounded-full bg-muted`}),(0,R.jsx)(B.span,{"aria-hidden":`true`,className:`absolute top-1/2 left-0 h-1.5 -translate-y-1/2 rounded-full bg-primary`,animate:{width:`${y}%`},transition:{type:`spring`,stiffness:520,damping:34}}),t.map((e,t)=>{let i=n.includes(e);return(0,R.jsx)(`span`,{"aria-hidden":`true`,title:i?e:`${r??`This model`} does not support ${e}`,className:q(`absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full`,i?t<=v?`bg-primary-foreground/80`:`bg-muted-foreground/40`:`bg-transparent ring-1 ring-muted-foreground/30`),style:{left:`${t/g*100}%`}},e)}),(0,R.jsx)(B.span,{"aria-hidden":`true`,className:q(`absolute top-1/2 size-4 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-white shadow-sm`,c!==void 0&&`scale-110`),animate:{left:`${y}%`},transition:{type:`spring`,stiffness:520,damping:28}})]}),(0,R.jsx)(`div`,{className:`relative mx-2.5 h-3.5 text-[0.68rem] text-muted-foreground`,"aria-hidden":`true`,children:t.map((e,t)=>{let i=n.includes(e);return(0,R.jsx)(`span`,{title:i?void 0:`${r??`This model`} does not support ${e}`,className:q(`absolute -translate-x-1/2 whitespace-nowrap`,t===v&&`font-medium text-foreground`,!i&&`opacity-40`),style:{left:`${t/g*100}%`},children:ZJ[e]??e},e)})}),x?(0,R.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,r??`this model`,`, so it runs at `,b,`.`]}):null]})]})}function nY(e){return(0,R.jsx)(hD,{...e})}function rY(e){return(0,R.jsx)(gD,{"data-slot":`popover-trigger`,...e})}function iY({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,R.jsx)(_D,{children:(0,R.jsx)(vD,{"data-slot":`popover-content`,align:t,sideOffset:n,className:q(`reui-menu z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-xl border p-1 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none`,e),...r})})}function aY(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function oY({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>aY(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(Math.max(0,t.findIndex(t=>t.value===e))))},[o]),(0,m.useEffect)(()=>{c&&d(0)},[c]),(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function _(t){t&&(s(!1),t.value!==e&&n(t.value))}function v(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>Math.min(h.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>Math.max(0,e-1))):e.key===`Home`&&!c?(e.preventDefault(),d(0)):e.key===`End`&&!c?(e.preventDefault(),d(Math.max(0,h.length-1))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(h[u]))}return(0,R.jsxs)(nY,{open:o,onOpenChange:s,children:[(0,R.jsxs)(rY,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:q(`reui-select flex h-8 w-full min-w-0 items-center justify-between gap-2 overflow-hidden rounded-lg border bg-card px-2.5 text-[0.8125rem] whitespace-nowrap outline-none transition-[border-color,box-shadow] duration-150 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50`,i),children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,R.jsx)(Up,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(iY,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`p-0 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,R.jsx)(ag,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-[0.8125rem] outline-none placeholder:text-muted-foreground`})]}),(0,R.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,R.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,R.jsxs)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"data-index":n,onPointerMove:()=>d(n),onClick:()=>_(t),className:q(`flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-[0.8125rem] select-none`,n===u&&`bg-accent`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,R.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})]})}function sY({label:e,help:t,children:n,stacked:r}){return(0,R.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 md:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] md:items-center md:gap-6`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 break-words`,children:[(0,R.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,R.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,R.jsx)(`div`,{className:`min-w-0`,children:n})]})}function cY({children:e}){return(0,R.jsx)(iq,{dense:!0,children:(0,R.jsx)(aq,{className:`flex flex-col divide-y divide-border py-0 [&>*]:py-3`,children:e})})}function lY({value:e,items:t,label:n,onChange:r}){return(0,R.jsx)(oY,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r,className:`max-md:h-auto max-md:min-h-11 max-md:items-start max-md:py-2 max-md:[&>span:first-child]:overflow-visible max-md:[&>span:first-child]:text-clip max-md:[&>span:first-child]:whitespace-normal max-md:[&>span:first-child]:break-words`})}var uY=`(prefers-color-scheme: dark)`,dY=[`dark`,`light`,`system`],fY=m.createContext(void 0);function pY(e){return e!==null&&dY.includes(e)}function mY(){return window.matchMedia(uY).matches?`dark`:`light`}function hY(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function gY(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function _Y({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return pY(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?mY():e,i=r?hY():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(uY),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||gY(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:mY()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(pY(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,R.jsx)(fY.Provider,{...i,value:l,children:e})}var vY=()=>{let e=m.useContext(fY);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},yY=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],bY={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},xY={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},SY=`inherit`,CY=`inherit`,wY=`Use the session's current model`,TY=`__custom__`,EY=`custom…`,DY=`Type a provider/model id`,OY=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],kY={agents:`Agents`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},AY=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`},{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],jY=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity log pane`},{id:`thinking`,label:`Thinking bubble`}],MY=`shown on the Lobby tab`,NY=`Planning rounds`,PY=`how many rounds the panel gets before the oracle settles the rest alone`,FY=[2,3,5,8,0],IY=`Split long plans`,LY=`saving a plan with more steps offers to split it into up to 5 tasks`,RY=[6,8,10,12,0],zY=`Port`,BY=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,VY=`Open browser`,HY=`open this page in the browser when pi starts`,UY=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],WY=`Git isolation`,GY=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the oracle and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],KY={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},qY=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],JY=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Master as hints; a quick fix that is really a task is held for you`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`qa`,label:`QA risk`,help:`once a task's work is in, the classifier reads the diff and sizes QA to it: no QA agent for a change with nothing that runs, a light check for a small one, deep review where a defect would spread; with it off the engine's rules decide`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, the classifier picks the sections that bear on the step, and the agent is told where the rest is`},{id:`scripts`,label:`Shared scripts`,help:`the classifier matches each step to the shared scripts that do part of it, and the agent is told to run them instead of redoing the work`},{id:`files`,label:`File hints`,help:`scouts, workers, quick fixes and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],YY={enabled:`Classifier`,enabledHelp:`a fast model makes the obvious decisions so large models spend fewer tokens on them`,engine:`Answered by`,engineHelp:`Jev, another classifier model, or any chat model your pi logins offer (OpenAI, Anthropic, Google, …); a small, fast one works best`,engineJev:`Jev on a host`,engineJevHelp:`TypeSafe's classifier, on the host below`,engineClassifier:`classifier model`,engineChat:`chat model, answers as JSON`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},XY={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},ZY=`https://tweakcn.com/editor/theme`;function QY(){let{theme:e}=vY();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function $Y({palette:e,dark:t}){let n=se(e,t);return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,R.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,R.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,R.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function eX(){let e=Ue(),t=QY(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,R.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 md:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:q(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,R.jsx)($Y,{palette:n,dark:t}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,R.jsxs)(`span`,{className:`truncate max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:[n.name,e.isSaved(n.id)?(0,R.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`saved`}):null]}),r?(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function tX({entry:e}){let t=Ue(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(e.name),[o,s]=(0,m.useState)();async function c(){let n=i.trim();if(!n||n===e.name)return r(!1);try{await t.rename(e.id,n),r(!1),s(void 0),H.success(`Renamed to ${n}.`)}catch(e){s(e.message)}}return(0,R.jsxs)(`li`,{className:`flex min-h-10 flex-wrap items-center gap-2 py-1.5`,children:[n?(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-1 items-center gap-1 max-md:flex-wrap`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,R.jsx)(Uq,{autoFocus:!0,value:i,maxLength:40,"aria-label":`New name for ${e.name}`,"aria-invalid":o?!0:void 0,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),a(e.name),r(!1))},className:`h-8 max-w-64 max-md:h-11 max-md:min-h-11 max-md:min-w-0 max-md:flex-1`}),(0,R.jsx)(X,{label:`Save the name`,text:`Save`,icon:Vp,tone:`primary`,type:`submit`,disabled:!i.trim()}),(0,R.jsx)(X,{label:`Keep the old name`,icon:Vg,iconOnly:!0,onClick:()=>{a(e.name),r(!1)}})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:e.name}),(0,R.jsx)(X,{label:`Rename ${e.name}`,text:`Rename`,icon:Vh,onClick:()=>{a(e.name),r(!0)}}),(0,R.jsx)(SM,{label:`Remove ${e.name}`,text:`Remove`,title:`Remove ${e.name}?`,description:`It is removed for every pi session. Keep a copy of its CSS if you want to use it again.`,confirmLabel:`Remove theme`,icon:Cg,variant:`destructive`,onConfirm:()=>void t.remove(e.id).catch(e=>H.error(e.message))})]}),o?(0,R.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:o}):null]})}function nX(){let e=Ue();return e.saved.length===0?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No saved themes yet. Import one below and give it a name.`}):(0,R.jsx)(`ul`,{"aria-label":`Saved themes`,className:`divide-y divide-border`,children:e.saved.map(e=>(0,R.jsx)(tX,{entry:e},e.id))})}function rX(){let e=Ue(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(null);async function u(t,a){let s=ee(t);if(`error`in s){o(s.error);return}o(void 0),c(!0);try{let t=await e.adopt(s,r.trim()||s.name||a);n(``),i(``);let o=s.light?s.dark?void 0:`dark`:`light`;H.success(o?`${t.name} saved and applied. It has no ${o} colours, so ${o} mode keeps the default ones.`:`${t.name} saved and applied.`)}catch(e){o(e.message)}finally{c(!1)}}async function d(e){if(e){if(e.size>2e5){o(`That file is too large to be a theme.`);return}await u(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,R.jsxs)(`a`,{href:ZY,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,R.jsx)(Dm,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,R.jsxs)(`label`,{className:`grid gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,R.jsx)(Uq,{value:r,maxLength:40,placeholder:`the theme's own name, or the file's`,onChange:e=>i(e.target.value),className:`h-8 max-w-80 text-foreground max-md:h-11 max-md:min-h-11`})]}),(0,R.jsx)(sM,{value:t,onChange:e=>{n(e.target.value),o(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":a?!0:void 0,placeholder:`:root {
91
+ `).filter(Boolean),r=[];for(let t of n){let n=CH.exec(t);if(!n)return{body:e,files:[]};let i=n[1].split(/[\\/]/).pop()??``;if(!/^[\w.-]+$/.test(i))return{body:e,files:[]};r.push({id:i,name:i.replace(/^[a-z0-9]+-/,``),mime:n[2]})}return r.length>0?{body:e.slice(0,t).trimEnd(),files:r}:{body:e,files:[]}}var TH=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function EH({files:e}){return e.length===0?null:(0,R.jsx)(`ul`,{className:`mt-2 flex min-w-0 max-w-full flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,R.jsx)(`li`,{children:TH.has(e.mime)?(0,R.jsx)(`a`,{href:F(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block max-w-full overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02] focus-visible:outline-2 focus-visible:outline-ring max-md:min-h-11 max-md:min-w-11`,children:(0,R.jsx)(`img`,{src:F(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-[min(14rem,100%)] object-cover`})}):(0,R.jsxs)(`span`,{className:`inline-flex max-w-[min(16rem,100%)] min-w-0 items-center gap-2 rounded-lg border border-border bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[e.mime===`application/pdf`?(0,R.jsx)(Nm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,R.jsx)(kh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}var DH=!1,OH=[],kH=0,AH=900;function jH(){DH=!0,window.clearTimeout(kH),kH=window.setTimeout(MH,AH)}function MH(){DH=!1,window.clearTimeout(kH);let e=OH;OH=[];for(let t of e)t()}function NH(e){if(!DH)return e(),()=>{};let t=()=>e();return OH.push(t),()=>{OH=OH.filter(e=>e!==t)}}var PH=8;function FH(e,t=24){let[n,r]=(0,m.useState)(t),i=(0,m.useRef)(8),a=n<e;return(0,m.useEffect)(()=>{if(!a)return;let e=0,t=NH(()=>{e=requestAnimationFrame(()=>{let e=performance.now();(0,Hv.flushSync)(()=>r(e=>e+i.current));let t=Math.max(1,performance.now()-e);i.current=Math.max(2,Math.min(400,Math.round(i.current*PH/t)))})});return()=>{t(),cancelAnimationFrame(e)}},[a,n]),Math.min(n,e)}function IH(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(IH).join(``)}function LH(e,t=!1){let n=t||e.tagName===`a`;e.tagName===`code`&&(e.properties={...e.properties,copyBlocked:n,blockCode:t===!1&&e.properties?.blockCode});for(let t of e.children??[])e.tagName===`pre`&&(t.properties={...t.properties,blockCode:!0}),LH(t,n)}function RH(){return e=>LH(e)}function zH(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await SH(e,navigator.clipboard),n(!0),H.success(`Code copied.`)}catch{H.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function BH({text:e,children:t,block:n=!1}){let{copy:r}=zH(e),i=(0,m.useRef)(void 0);return(0,R.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:q(`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,!n&&`max-md:break-words max-md:[overflow-wrap:anywhere]`),onPointerDown:e=>{i.current={x:e.clientX,y:e.clientY,moved:!1}},onPointerMove:e=>{let t=i.current;t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4&&(t.moved=!0)},onClick:e=>{e.stopPropagation(),xH(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),xH(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,R.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function VH({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=zH(bH(n,r?.position,!0)??IH(r)),o=r?.children?.find(e=>e.tagName===`code`)?.properties?.className,s=(Array.isArray(o)?o:[]).map(String).find(e=>e.startsWith(`language-`))?.slice(9);return(0,R.jsxs)(`div`,{className:`relative my-3 max-md:min-w-0 max-md:max-w-full rounded-lg bg-muted`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,R.jsx)(X,{label:i?`Copied`:`Copy the code`,icon:i?zp:xm,iconOnly:!0,onClick:()=>void a()})]}),(0,R.jsx)(`pre`,{className:`!my-0 max-md:max-w-full overflow-x-auto max-md:overscroll-x-contain !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function HH(e){return{pre:t=>(0,R.jsx)(VH,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,R.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,R.jsx)(BH,{text:bH(e,r?.position,i)??IH(r),block:i,children:n})},a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e?F(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,R.jsx)(`img`,{src:e?F(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,R.jsx)(`div`,{className:`my-3 w-full max-md:min-w-0 max-md:max-w-full overflow-x-auto max-md:overscroll-x-contain`,children:(0,R.jsx)(`table`,{className:`w-full max-md:min-w-max border-collapse text-sm`,children:e})})}}var UH=(0,m.memo)(function({text:e}){return(0,R.jsx)(oz,{remarkPlugins:[fH],rehypePlugins:[RH],urlTransform:mH,components:HH(e),children:e})}),WH=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=wH(e),i=n?yH(n):[],a=FH(i.length,3);return(0,R.jsxs)(`div`,{className:q(`md-body max-md:min-w-0 max-md:max-w-full max-md:break-words max-md:[overflow-wrap:anywhere]`,t),children:[i.slice(0,a).map((e,t)=>(0,R.jsx)(UH,{text:e},t)),(0,R.jsx)(EH,{files:r})]})});function GH({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,R.jsxs)(`section`,{className:q(`workspace-frame group/frame relative flex min-h-0 min-w-0 flex-col rounded-xl border shadow-xs`,i&&`flex-none`,n),...s,children:[e||t||a?(0,R.jsxs)(`div`,{className:q(`flex min-h-12 shrink-0 items-center justify-between gap-3 px-4`,!i&&`border-b border-border`),children:[e?(0,R.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,R.jsx)(`span`,{}),(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,R.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":!i,"aria-label":i?`Expand ${c}`:`Minimize ${c}`,title:`${i?`Expand`:`Minimize`}${o?` · ${o}`:``}`,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,"aria-describedby":`focused-action-help`,onClick:a,className:`btn-ghost -mr-1.5 inline-flex h-8 items-center gap-1.5 rounded-lg border border-transparent px-2 text-muted-foreground transition-[box-shadow,color,translate] duration-150 ease-snap outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none max-md:h-11 max-md:min-w-11 max-md:justify-center`,children:[o?(0,R.jsx)(rA,{chord:o,className:`kbd-hint max-md:hidden`}):null,(0,R.jsx)(Vp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function KH({title:e,right:t,className:n}){return(0,R.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,R.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,R.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function qH({title:e,right:t,prominent:n,children:r}){return(0,R.jsxs)(`section`,{className:q(`flex min-w-0 flex-col`,n?`gap-4`:`workspace-section gap-3 rounded-xl border p-4 shadow-xs max-md:rounded-lg max-md:p-3`),children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold text-foreground`,children:(0,R.jsx)(KH,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var JH=`Pull requests`,YH=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,XH=`nothing is posted to GitHub`,ZH=`Refresh to load open pull requests with the GitHub CLI (gh).`,QH=`No open pull requests.`,$H=`loading pull requests from GitHub…`,eU=`reading the diff…`,tU=`the pull request has new commits since this review — review it again`,nU=`(no description)`,rU=`Review with a focus (optional)`,iU=`Leave it empty for a full review.`;function aU(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function oU(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function sU(e,t){return`+${e} −${t}`}function cU(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function lU(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function uU(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function dU(e,t){if(e.status===`running`)return fU(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?fU(e,t):e.status;return[uU(e.verdict),n].filter(Boolean).join(` · `)}function fU(e,t){let n=Math.max(0,Math.round(((e.finishedAt??t)-e.startedAt)/1e3));return n<60?`${n}s`:`${Math.floor(n/60)}m ${String(n%60).padStart(2,`0`)}s`}function pU(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${dM(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function mU(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${sU(e.additions,e.deletions)} · ${t}`}function hU(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,cU(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function gU(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function _U(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function vU(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function yU({pull:e,now:t}){return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:pU(e,t)}),(0,R.jsx)(`p`,{className:`text-sm tabular-nums`,children:mU(e)}),hU(e)?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:hU(e)}):null,e.url?(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4 max-md:min-h-11 max-md:items-center`,children:e.url}):null]})}function bU({read:e}){return(0,R.jsxs)(qH,{title:`Jev's read`,right:_U(e),children:[e.status===`running`?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),eU]}):null,e.status===`failed`?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,R.jsx)(WH,{text:e.line}):null]})}function xU({review:e,now:t}){return(0,R.jsxs)(R.Fragment,{children:[e.model?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,dM(t-e.startedAt)]}):null,e.stale?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:tU}):null,e.status===`running`?(0,R.jsx)(SU,{steps:e.steps}):null,e.status===`cancelled`?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,R.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,R.jsx)(WH,{text:e.text}):null]})}function SU({steps:e}){return(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,R.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function CU({number:e,focus:t,onChange:n}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:rU}),(0,R.jsx)(sM,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,className:`max-md:min-h-11`,onChange:e=>n(e.target.value)}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:iU})]})}function wU({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,R.jsxs)(qH,{title:`Review`,right:t?dU(t,n):void 0,children:[t?(0,R.jsx)(xU,{review:t,now:n}):null,(0,R.jsx)(CU,{number:e,focus:r,onChange:i}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,XH,`.`]})]})}function TU({files:e}){return(0,R.jsx)(qH,{title:`Files`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,R.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,R.jsx)(`tbody`,{children:e.map(e=>(0,R.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,R.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:sU(e.additions,e.deletions)})]},e.path))})})})})}function EU({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?dM(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,R.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,R.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,R.jsx)(WH,{text:e.body.trim()}):null]})}function DU({notes:e,now:t}){return e.length===0?null:(0,R.jsx)(qH,{title:`Discussion`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,R.jsx)(EU,{note:e,now:t},n))})})}function OU({number:e,error:t}){return t?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),`loading #`,e,`…`]})}function kU({number:e,onChanged:t}){let n=xj(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=vU(a);if(!n.data)return(0,R.jsx)(OU,{number:e,error:n.error});let{pull:s,review:c,read:l}=n.data,u=()=>{n.reload(),t?.()},d=async()=>{let t=r.trim();i(``),await U(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await U(`git.jev`,{number:e}),u()},p=async()=>{await U(`git.cancelReview`,{number:e}),u()};return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Review`,icon:Vh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,R.jsx)(X,{label:`Jev's read`,icon:Np,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,R.jsx)(SM,{icon:lm,label:`Stop the review`,text:`Stop`,shortcut:`X`,title:`Stop this review?`,description:`The agent stops reading the pull request. Nothing is posted to GitHub.`,confirmLabel:`Stop review`,variant:`destructive`,onConfirm:()=>void p()}):null]}),(0,R.jsx)(yU,{pull:s,now:o}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:YH}),l?(0,R.jsx)(bU,{read:l}):null,(0,R.jsx)(wU,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,R.jsx)(TU,{files:s.files}):null,(0,R.jsx)(qH,{title:`Description`,children:s.body.trim()?(0,R.jsx)(WH,{text:s.body.trim()}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:nU})}),(0,R.jsx)(DU,{notes:s.notes,now:o})]})}var AU=Jg([`relative inline-flex shrink-0 items-center justify-center w-fit border border-transparent font-medium whitespace-nowrap outline-none transition-shadow`,`focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:ring-offset-background disabled:pointer-events-none disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-3`],{variants:{variant:{default:`bg-primary text-primary-foreground`,outline:`border-border bg-transparent dark:bg-input/32`,secondary:`bg-secondary text-secondary-foreground`,info:`bg-info text-white`,success:`bg-success text-white`,warning:`bg-warning text-white`,destructive:`bg-destructive text-white`,focus:`bg-focus text-focus-foreground`,invert:`bg-invert text-invert-foreground`,"primary-light":`border-primary/10 bg-primary/10 text-primary dark:border-primary/25 dark:bg-primary/15 dark:text-primary`,"warning-light":`border-warning/15 bg-warning/10 text-warning-foreground dark:border-warning/25 dark:bg-warning/15 dark:text-warning`,"success-light":`border-success/15 bg-success/10 text-success-foreground dark:border-success/25 dark:bg-success/15 dark:text-success`,"info-light":`border-info/15 bg-info/10 text-info-foreground dark:border-info/25 dark:bg-info/15 dark:text-info`,"destructive-light":`border-destructive/15 bg-destructive/10 text-destructive-foreground dark:border-destructive/25 dark:bg-destructive/15 dark:text-destructive`,"invert-light":`border-invert/15 bg-invert/10 text-foreground dark:border-invert/45 dark:bg-invert/35 dark:text-invert-foreground`,"focus-light":`border-focus/15 bg-focus/10 text-focus-foreground dark:border-focus/25 dark:bg-focus/15 dark:text-focus`,"primary-outline":`bg-background border-border text-primary dark:bg-input/30`,"warning-outline":`bg-background border-border text-warning-foreground dark:bg-input/30`,"success-outline":`bg-background border-border text-success-foreground dark:bg-input/30`,"info-outline":`bg-background border-border text-info-foreground dark:bg-input/30`,"destructive-outline":`bg-background border-border text-destructive-foreground dark:bg-input/30`,"invert-outline":`bg-background border-border text-invert-foreground dark:bg-input/30`,"focus-outline":`bg-background border-border text-focus-foreground dark:bg-input/30`},size:{xs:`px-1 py-0.25 text-[0.6rem] leading-none h-4 min-w-4 gap-1`,sm:`px-1 py-0.25 text-[0.625rem] leading-none h-4.5 min-w-4.5 gap-1`,default:`px-1.25 py-0.5 text-xs h-5 min-w-5 gap-1`,lg:`px-1.5 py-0.5 text-xs h-5.5 min-w-5.5 gap-1`,xl:`px-2 py-0.75 text-sm h-6 min-w-6 gap-1.5`},radius:{default:`rounded-sm`,full:`rounded-full`}},defaultVariants:{variant:`default`,size:`default`,radius:`default`}});function jU({className:e,variant:t,size:n,radius:r,asChild:i=!1,...a}){let o=i?kv:`span`;return(0,R.jsx)(o,{"data-slot":`badge`,className:q(AU({variant:t,size:n,radius:r,className:e})),...a})}var MU=`flex min-h-10 w-full flex-col gap-1 rounded-lg border border-transparent px-3 py-2.5 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:border-primary/40 aria-[current=true]:bg-accent`,NU=`flex flex-col gap-1 px-2 pb-3`,PU=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function FU({checks:e}){let t=aU(e);return t?(0,R.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,oU(e)),"aria-hidden":`true`,children:t}):(0,R.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function IU({pull:e,selected:t,onSelect:n}){let r=lU(e.review);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.number),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,R.jsx)(FU,{checks:e.checks}),e.draft?(0,R.jsx)(jU,{variant:`secondary`,children:`draft`}):null,(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:gU(e)}),(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,R.jsx)(`span`,{children:r}):null,(0,R.jsx)(`span`,{className:`tabular-nums`,children:sU(e.additions,e.deletions)})]})]})]})})}function LU({pulls:e,selectedId:t,onSelect:n}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(IU,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var RU=()=>aj(ij(`git`)),zU=e=>aj(ij(`git`,String(e)));function BU(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function VU({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?QH:e?$H:ZH;return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(zm,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Retry`}):null]})}function HU({rest:e}){let t=eM(),n=xj(`git.pulls`,{},[`git`]),r=BU(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{U(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,R.jsx)(VU,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:JH,count:n.data?`${i.length} open`:void 0,children:(0,R.jsx)(X,{label:`Refresh`,icon:Gh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,R.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,R.jsx)(LU,{pulls:i,selectedId:r,onSelect:zU}):(0,R.jsx)(oM,{})]}),c=r===void 0?null:(0,R.jsx)(kU,{number:r,onChanged:n.reload},r);return(0,R.jsx)(iM,{wide:t,list:s,detail:c,open:r!==void 0,onClose:RU,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function UU(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function WU({label:e,hint:t,buttonLabel:n=`Send`,onSend:r}){let i=(0,m.useId)(),[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)(!1),l=async()=>{a.trim()&&!s&&(c(!0),await r(a)&&o(``),c(!1))};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,R.jsx)(sM,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{UU(e)&&(e.preventDefault(),l())}}),t?(0,R.jsx)(`p`,{id:`${i}-hint`,className:q(`text-xs text-muted-foreground`,/(?:Enter|Esc)/.test(t)&&`max-md:hidden`),children:t}):null,(0,R.jsx)(`div`,{className:`flex self-end`,children:(0,R.jsx)(X,{label:n,icon:s?$m:jp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var GU=`Issues`,KU=`Issue`,qU=`Plan it opens a planning session on this issue; save the plan as a task once the panel agrees it.`,JU=`Refresh to load open issues with the GitHub CLI (gh).`,YU=`No open issues. File one with New issue.`,XU=`loading issues from GitHub…`,ZU=`issues are off (lobby.issues)`,QU=`(no description)`;function $U(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${dM(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function eW(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?dM(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function tW(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function nW({issue:e,now:t}){return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$U(e,t)}),e.url?(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`inline-flex max-w-full break-all text-xs text-primary underline underline-offset-4 max-md:min-h-11 max-md:items-center`,children:e.url}):null]})}function rW({comment:e,now:t}){return(0,R.jsxs)(`article`,{className:`card-raised flex flex-col gap-1.5 rounded-lg border px-3.5 py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,R.jsx)(`span`,{children:dM(t-Date.parse(e.createdAt))}):null]}),(0,R.jsx)(WH,{text:e.body.trim()})]})}function iW({comments:e,now:t}){return e.length===0?null:(0,R.jsx)(qH,{title:`Comments`,right:String(e.length),children:(0,R.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,R.jsx)(rW,{comment:e,now:t},n))})})}function aW({issue:e}){let t=async()=>{await U(`planner.new`,{seed:{issue:{number:e.number,title:e.title,...e.url?{url:e.url}:{}},body:e.body}})&&aj(ij(`plan`))};return(0,R.jsx)(SM,{icon:zg,label:`Plan #${e.number} with the panel`,text:`Plan it`,shortcut:`N`,title:`Plan #${e.number} with the panel?`,description:`A new planning session starts from this issue. A plan already under way waits under Plan → Previous.`,confirmLabel:`Plan it`,onConfirm:()=>void t()})}function oW({number:e}){let t=xj(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${KU} #${e}`,children:[(0,R.jsx)(Gj,{children:(0,R.jsx)(aW,{issue:r})}),(0,R.jsx)(nW,{issue:r,now:n}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:qU}),(0,R.jsx)(qH,{title:`Description`,children:r.body.trim()?(0,R.jsx)(WH,{text:r.body.trim()}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:QU})}),(0,R.jsx)(iW,{comments:r.comments,now:n})]})}function sW({issue:e,selected:t,now:n,onSelect:r}){let i=tW(e.labels);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.number),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,R.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,R.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:eW(e,n)})]})})}function cW({issues:e,selectedId:t,now:n,onSelect:r}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(sW,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var lW=()=>aj(ij(`issues`)),uW=e=>aj(ij(`issues`,String(e)));function dW(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function fW(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(am,{"aria-hidden":`true`})}),(0,R.jsx)(dj,{children:`Issues are off`}),(0,R.jsx)(fj,{className:`font-mono`,children:ZU})]})})}function pW({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?YU:e?XU:JU;return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(am,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,children:`Retry`}):null]})}function mW({onCreate:e}){return(0,R.jsx)(tM,{className:`shrink-0 border-t border-border p-4`,children:(0,R.jsx)(WU,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function hW({rest:e}){let t=eM(),n=sA(`status`).data?.issuesEnabled??!0,r=xj(`issues.list`,{},[`issues`],n),i=dW(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{U(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await U(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,R.jsx)(fW,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,R.jsx)(fW,{}):(0,R.jsx)(yj,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:GU,count:r.data?`${a.length} open`:void 0,children:(0,R.jsx)(X,{label:`Refresh`,icon:Gh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,R.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,R.jsx)(cW,{issues:a,selectedId:i,now:o,onSelect:uW}):(0,R.jsx)(oM,{}),(0,R.jsx)(mW,{onCreate:c})]}),d=i===void 0?null:(0,R.jsx)(oW,{number:i},i),f=r.data&&a.length===0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(pW,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,R.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,R.jsx)(mW,{onCreate:c})})]}):(0,R.jsx)(iM,{wide:t,list:u,detail:d,open:i!==void 0,onClose:lW,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}function gW(e){let t=(0,m.useRef)(null),n=(0,m.useRef)(!0),[r,i]=(0,m.useState)(!0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(null),s=(0,m.useCallback)(()=>{n.current=!0,i(!0);let e=t.current;e&&(e.scrollTop=e.scrollHeight)},[]);return(0,m.useLayoutEffect)(()=>{n.current&&s()},[e,s]),(0,m.useLayoutEffect)(()=>{let e=t.current;if(!e||typeof ResizeObserver>`u`)return;let r=new ResizeObserver(()=>{n.current&&(e.scrollTop=e.scrollHeight)});return r.observe(e),a.current=r,()=>{r.disconnect(),a.current=void 0,o.current=null}},[]),(0,m.useLayoutEffect)(()=>{let e=a.current,n=t.current?.firstElementChild??null;e&&n!==o.current&&(o.current&&e.unobserve(o.current),n&&e.observe(n),o.current=n)},[e]),{ref:t,atBottom:r,stick:s,onScroll:(0,m.useCallback)(()=>{let e=t.current;e&&(n.current=e.scrollHeight-e.scrollTop-e.clientHeight<48,i(n.current))},[])}}var _W={DEV:_m,DESIGN:Th,QA:lg,RESEARCH:xg,"QUICK FIX":Ug,SCOUT:ym,PLANNER:$h,CLASSIFIER:yg,LOBBY:ph,LINT:Ym};function vW(e){return e?_W[e.toUpperCase()]??Fp:Lp}function yW(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function bW({source:e,className:t,strokeWidth:n}){if(yW(e))return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-agent-icon":e,className:q(`agent-oracle shrink-0`,t)});let r=vW(e);return(0,R.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:q(`shrink-0`,t)})}var xW={MASTER:`text-primary`,DEV:`text-source-dev`,DESIGN:`text-source-design`,QA:`text-source-qa`,RESEARCH:`text-source-research`,"QUICK FIX":`text-source-quickfix`,ORACLE:`text-primary`,LOBBY:`text-muted-foreground`};function SW(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function CW(e){return xW[e]??`text-muted-foreground`}var wW={MASTER:`var(--primary)`,DEV:`var(--source-dev)`,DESIGN:`var(--source-design)`,QA:`var(--source-qa)`,RESEARCH:`var(--source-research)`,"QUICK FIX":`var(--source-quickfix)`,ORACLE:`var(--primary)`,LOBBY:`var(--muted-foreground)`};function TW(e){return wW[e]??`var(--muted-foreground)`}function EW(e){if(e.role===`researcher`)return`RESEARCH`;let t=e.domain??e.role;return t===`backend`||t===`dev`?`DEV`:t===`designer`||t===`design`?`DESIGN`:t===`researcher`||t===`research`?`RESEARCH`:t===`qa`?`QA`:t?String(t).toUpperCase():`AGENT`}function DW(e){return e?.runs??[]}function OW(e,t=40){let n=new Map;for(let t of e)n.set(t.source,t);return[...n.values()].sort((e,t)=>e.at-t.at).slice(-t)}function kW({source:e,name:t,time:n,head:r,live:i,children:a,aside:o}){let s=r&&!yW(e);return(0,R.jsxs)(`div`,{className:`chat-agent group/msg`,"data-live":i||void 0,style:i?{"--orb":TW(e)}:void 0,children:[s||o?(0,R.jsxs)(`p`,{className:`chat-speaker`,children:[s?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,style:{"--orb":TW(e)},children:[(0,R.jsx)(bW,{source:e,strokeWidth:2.25,className:`size-3.5 text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`}),t]}):null,s&&n?(0,R.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,R.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,(0,R.jsx)(`div`,{className:`chat-prose`,children:a}),n&&!s?(0,R.jsx)(`time`,{className:`chat-meta`,children:n}):null]})}function AW({time:e,head:t,note:n,children:r,below:i,actions:a}){return(0,R.jsxs)(`div`,{className:`group/msg flex flex-col items-end gap-1`,children:[(0,R.jsx)(`div`,{className:`chat-bubble`,children:r}),e||n||a?(0,R.jsxs)(`div`,{className:`chat-meta flex items-center gap-2`,children:[a,n?(0,R.jsx)(`span`,{children:n}):null,e?(0,R.jsx)(`time`,{className:`tabular-nums`,children:e}):null]}):null,i]})}function jW({failed:e,children:t}){return(0,R.jsx)(`div`,{role:`note`,className:q(`chat-note`,e&&`text-destructive`),children:(0,R.jsx)(`span`,{children:t})})}function MW({className:e}){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:q(`typing-dots`,e),children:[(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{}),(0,R.jsx)(`span`,{})]})}function NW({onClick:e,className:t}){return(0,R.jsx)(`button`,{type:`button`,"aria-label":`Jump to latest`,title:`Jump to latest`,onClick:e,className:q(`jump-latest btn-raised grid size-9 place-items-center rounded-full border bg-card text-foreground shadow-card outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:size-11`,t),children:(0,R.jsx)(Tp,{"aria-hidden":`true`,className:`size-4`})})}function PW(e,t){return e===`lobby.thinking`||t===`1`}var FW=`bot-lobby.collapsed.`,IW=new Set,LW=new Map;function RW(e){if(LW.has(e))return LW.get(e);if(e===`lobby.thinking`)return PW(e);try{return PW(e,localStorage.getItem(FW+e))}catch{return!1}}function zW(e,t){LW.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(FW+e,t?`1`:`0`)}catch{}for(let e of[...IW])e()}function BW(e){return IW.add(e),()=>{IW.delete(e)}}function VW(e){zW(e,!RW(e))}function HW(e){return[(0,m.useSyncExternalStore)(BW,()=>RW(e),()=>PW(e)),(0,m.useCallback)(()=>zW(e,!RW(e)),[e])]}function UW({className:e}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-slot":`working-mark`,className:q(`working-mark`,e),children:(0,R.jsx)(`span`,{className:`working-mark-core`})})}var WW=`lobby.activity.open`;function GW({entry:e}){return e.pending?(0,R.jsx)(UW,{className:`size-3`}):e.kind===`error`?(0,R.jsx)(Vg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function KW({entry:e}){return(0,R.jsxs)(`li`,{className:`activity-step`,title:lM(e.at),style:e.pending?{"--orb":TW(e.source)}:void 0,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex h-5 items-center justify-center`,children:(0,R.jsx)(GW,{entry:e})}),(0,R.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,R.jsxs)(`span`,{className:`min-w-0 break-words`,children:[(0,R.jsx)(`span`,{className:q(`font-medium`,CW(e.source)),children:SW(e.source)}),` `,(0,R.jsx)(`span`,{className:e.kind===`error`?`text-destructive`:e.pending?`text-foreground`:`text-muted-foreground`,children:e.pending?`${e.text}…`:e.text})]})]})}function qW(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m ${t%60}s`:`${Math.floor(n/60)}h ${String(n%60).padStart(2,`0`)}m`}function JW(e){let t=[...e].reverse().find(e=>e.pending),n=[...new Set(e.map(e=>SW(e.source)))];return{...t?{live:t}:{},took:(e.at(-1)?.at??0)-(e[0]?.at??0),count:`${e.length} ${e.length===1?`step`:`steps`}`,sources:n.length>3?`${n.slice(0,3).join(`, `)} +${n.length-3}`:n.join(`, `),errors:e.filter(e=>e.kind===`error`).length,warnings:e.filter(e=>e.kind===`warning`).length}}function YW(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;n(Date.now());let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),t}function XW({entries:e}){let[t]=HW(WW),[n,r]=(0,m.useState)();(0,m.useEffect)(()=>r(void 0),[t]);let i=n??t,a=(0,m.useId)(),{live:o,took:s,count:c,sources:l,errors:u,warnings:d}=JW(e),f=YW(!!o),p=o?{"--orb":TW(o.source)}:void 0;return(0,R.jsxs)(`div`,{className:`activity-run`,"data-live":o?!0:void 0,"data-open":i||void 0,style:p,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":i,"aria-controls":a,onClick:()=>r(!i),className:`activity-toggle`,children:[o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(UW,{}),(0,R.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,R.jsx)(`span`,{className:`activity-shimmer`,children:`Working`}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,R.jsxs)(`span`,{className:`activity-live-step`,children:[(0,R.jsx)(`span`,{className:q(`font-medium`,CW(o.source)),children:SW(o.source)}),` `,(0,R.jsxs)(`span`,{className:`text-foreground`,children:[o.text,`…`]})]},o.id)]}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:[c,e[0]&&f-e[0].at>=1e3?` · ${qW(f-e[0].at)}`:``]})]}):(0,R.jsxs)(`span`,{className:`min-w-0 truncate`,children:[(0,R.jsx)(`span`,{className:`text-foreground`,children:s>=1e3?`Worked for ${qW(s)}`:`Worked`}),(0,R.jsxs)(`span`,{className:`text-muted-foreground`,children:[` · `,c,l?` · ${l}`:``]})]}),u?(0,R.jsxs)(`span`,{className:`shrink-0 text-destructive`,children:[u,` `,u===1?`error`:`errors`]}):null,d?(0,R.jsxs)(`span`,{className:`shrink-0 text-warning`,children:[d,` `,d===1?`warning`:`warnings`]}):null,(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`activity-chevron size-4 shrink-0 text-muted-foreground`})]}),i?(0,R.jsx)(`ol`,{id:a,"aria-label":`Activity`,className:`activity-steps`,children:e.map(e=>(0,R.jsx)(KW,{entry:e},e.id))}):null]})}function ZW(e,t){let n=[...t].sort((e,t)=>e.at-t.at||e.id-t.id),r=[],i=0,a=e=>{let t=[];for(;i<n.length&&n[i].at<e;)t.push(n[i++]);t.length&&r.push({kind:`activity`,key:`steps-${t[0].id}`,entries:t})};for(let t of e)a(t.at),r.push({kind:`message`,entry:t});return a(1/0),r}var QW=3e5,$W=`No task is running in this session.`,eG=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,tG=`Nothing said yet. Type below to talk to the oracle about this task.`;function nG({entry:e}){return(0,R.jsxs)(jW,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${lM(e.at)}`:``]})}function rG({entry:e,head:t}){if(e.role===`you`)return(0,R.jsx)(AW,{time:lM(e.at),head:t,children:(0,R.jsx)(WH,{text:e.text})});let n=e.role===`panel`;return(0,R.jsx)(kW,{source:n?`PLANNER`:`ORACLE`,name:n?`Panel`:`Oracle`,time:lM(e.at),head:t,children:(0,R.jsx)(WH,{text:e.text})})}var iG=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,R.jsx)(B.div,{initial:n?{opacity:0,y:10}:!1,animate:{opacity:1,y:0},transition:{type:`spring`,stiffness:420,damping:32},children:e.role===`note`?(0,R.jsx)(nG,{entry:e}):(0,R.jsx)(rG,{entry:e,head:t})})},(e,t)=>e.head===t.head&&e.entry.id===t.entry.id&&e.entry.text===t.entry.text&&e.entry.at===t.entry.at);function aG({text:e,busy:t,working:n}){let r=!!e?.trim();return!r&&(!t||n)?null:(0,R.jsx)(kW,{source:`ORACLE`,name:`Oracle`,head:!0,live:t,aside:t&&r?`writing…`:void 0,children:r?(0,R.jsx)(WH,{text:e??``}):(0,R.jsx)(MW,{className:`mt-1`})})}function oG({hasTask:e}){return(0,R.jsxs)(sj,{className:`h-full border-0`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(dh,{"aria-hidden":`true`})}),e?null:(0,R.jsx)(dj,{children:$W}),(0,R.jsx)(fj,{children:e?tG:eG})]}),e?null:(0,R.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,R.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,R.jsx)(rA,{chord:`3`}),` Plan`]}),(0,R.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,R.jsx)(rA,{chord:`4`}),` Quick fix`]})]})]})}async function sG(e){let t=await Te(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function cG(e,t,n){let[r,i]=(0,m.useState)([]),[a,o]=(0,m.useState)(t),[s,c]=(0,m.useState)(!1),l=(0,m.useMemo)(()=>{let t=new Set(e.map(e=>e.id));return[...r.filter(e=>!t.has(e.id)),...e]},[r,e]);return{merged:l,more:a,loading:s,load:(0,m.useCallback)(async()=>{let e=l[0]?.id;if(e===void 0||s||!a)return;c(!0);let t=n.current,r=t?.scrollHeight??0,u=t?.scrollTop??0;try{let t=await sG(e);i(e=>[...t.entries,...e]),o(t.hasOlder),window.requestAnimationFrame(()=>{let e=n.current;e&&(e.scrollTop=e.scrollHeight-r+u)})}catch{o(!1)}finally{c(!1)}},[l,s,a,n])}}var lG=[];function uG({chat:e,activity:t=lG,reply:n,busy:r,hasOlder:i,hasTask:a}){let o=(0,m.useMemo)(()=>t.slice(-400),[t]),{ref:s,atBottom:c,stick:l,onScroll:u}=gW(`${e.length}:${n?.length??0}:${o.length}:${o.at(-1)?.pending??``}`),{merged:d,more:f,loading:p,load:h}=cG(e,i,s),g=(0,m.useCallback)(()=>{u();let e=s.current;e&&e.scrollTop<80&&f&&!p&&h()},[u,s,f,p,h]),_=(0,m.useMemo)(()=>ZW(d,o),[d,o]),v=d.length===0&&o.length===0&&!n?.trim()&&!r,y=_.at(-1),b=y?.kind===`activity`&&!!JW(y.entries).live,[x,S]=(0,m.useState)(!1);return(0,m.useEffect)(()=>S(!0),[]),(0,R.jsxs)(GH,{"aria-label":`Conversation`,"data-bare":!0,className:`flex-1 rounded-none border-0 shadow-none`,children:[(0,R.jsx)(`div`,{ref:s,onScroll:g,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:v?(0,R.jsx)(oG,{hasTask:a}):(0,R.jsxs)(`div`,{className:`chat-column`,children:[f?(0,R.jsx)(`p`,{className:`mb-4 text-center text-xs text-muted-foreground`,children:`Earlier messages load as you scroll up.`}):null,_.map((e,t)=>{if(e.kind===`activity`)return(0,R.jsx)(XW,{entries:e.entries},e.key);let n=_[t-1],r=n?.kind===`message`?n.entry:void 0,i=!r||r.role!==e.entry.role||e.entry.at-r.at>QW;return(0,R.jsx)(iG,{entry:e.entry,head:i,fresh:x},e.entry.id)}),(0,R.jsx)(aG,{text:n,busy:r,working:b})]})}),c?null:(0,R.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-dock z-10 flex justify-center [&>*]:pointer-events-auto`,children:(0,R.jsx)(NW,{onClick:l})})]})}function dG(e){let t=e[0]===`ask`,[n,r]=t?e.slice(1):e;return{chat:t,agent:n,file:r}}function fG(e,t){let{agent:n,file:r}=dG(e);return ij(`knowledge`,...t?[`ask`]:[],n??``,r??``)}var pG=[`master`,`designer`,`backend`,`qa`],mG={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},hG={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},gG=`Every write archives the version before it.`;function _G(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function vG(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function yG(e){return{text:e.text,occurrence:e.occurrence}}function bG(e){return pG.map(t=>{let n=e.filter(e=>e.agent===t);return{agent:t,files:n,notes:n.reduce((e,t)=>e+t.notes,0)}}).filter(e=>e.files.length>0)}function xG(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function SG({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,R.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,R.jsx)(sM,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{xG(e)&&(e.preventDefault(),o())}}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:gG}),(0,R.jsxs)(`div`,{className:`flex gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:r,disabled:t,children:`Cancel`}),(0,R.jsxs)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:o,disabled:t||!i.trim(),children:[t?(0,R.jsx)(pj,{}):null,`Save`]})]})]})]})}function CG({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=XA(e,YA.confirm);return(0,R.jsx)(HA,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:gG,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:gG})]}),(0,R.jsx)(sM,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,R.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:i,disabled:r,children:`Cancel`}),(0,R.jsxs)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:()=>a(o),disabled:r,children:[r?(0,R.jsx)(pj,{}):null,`Save file`]})]})]})})}function wG({note:e,about:t,onTakeBack:n,busy:r}){let i=t?`about "${t.replace(/\s+/g,` `).trim().slice(0,50)}": ${e.text}`:e.text;return(0,R.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Fh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,R.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,R.jsx)(X,{label:`Take the note back`,icon:Dg,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function TG({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,R.jsxs)(`li`,{role:`button`,tabIndex:0,"aria-pressed":n,onClick:s,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s())},className:n?`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-primary/30 bg-accent px-3 py-2.5 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11`:`flex min-h-9 cursor-pointer flex-col gap-1 rounded-lg border border-border px-3 py-2.5 outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11`,children:[(0,R.jsx)(`div`,{className:`flex gap-2`,children:(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(WH,{text:e.text})})}),r.length>0?(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,R.jsx)(wG,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function EG({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,R.jsx)(qH,{title:`Notes on entries that changed`,right:String(e.length),children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,R.jsx)(wG,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function DG({view:e}){let t=e.entries.length;return(0,R.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsxs)(`h2`,{className:`min-w-0 break-words text-lg font-semibold tracking-tight`,children:[hG[e.agent],` `,(0,R.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,_G(e.chars),` chars`]}),e.over?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:vG(e.file)}):null]})}function OG({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Edit the entry`,text:`Edit`,icon:zh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,R.jsx)(X,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:Uh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,R.jsx)(X,{label:`Comment on the entry`,text:`Comment`,icon:lh,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,R.jsx)(X,{label:`Edit the whole file`,text:`Edit file`,icon:km,shortcut:`F`,disabled:a,onClick:r}),(0,R.jsx)(SM,{icon:Cg,label:`Delete the entry`,text:`Delete`,shortcut:`Delete`,title:`Delete this entry?`,description:`The entry and its notes are removed. The version before is archived.`,confirmLabel:`Delete entry`,variant:`destructive`,disabled:a||!t,onConfirm:i})]})}function kG({agent:e,file:t,onChanged:n}){let r=xj(`knowledge.open`,{agent:e,file:t},[`knowledge`]),[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=r.data?.view,p=f?.entries??[],h=p[Math.min(i,Math.max(0,p.length-1))],g=async e=>{d(!0),await e(),s(void 0),r.reload(),n(),d(!1)},_=e=>void g(()=>U(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>U(`knowledge.remove`,{agent:e,file:t,ref:yG(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>U(`knowledge.edit`,{agent:e,file:t,ref:yG(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>U(`knowledge.comment`,{agent:e,file:t,ref:yG(r),text:n}));g(()=>U(`knowledge.add`,{agent:e,file:t,...h?{ref:yG(h)}:{},text:n}))};return f?(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${hG[e]} ${t}`,children:[(0,R.jsx)(OG,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,R.jsx)(DG,{view:f}),p.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,R.jsx)(`ul`,{className:`workspace-section flex flex-col gap-2 rounded-xl border p-3 shadow-xs`,children:p.map((e,t)=>(0,R.jsx)(TG,{entry:e,index:t,selected:t===i,notes:f.attached.filter(t=>t.entry===e.text),onPick:a,onTakeBack:_,busy:u},`${t}-${e.text}`))}),o?.kind===`edit`?(0,R.jsx)(SG,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,R.jsx)(WU,{label:`Comment on this entry`,hint:gG,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,R.jsx)(WU,{label:`Add an entry`,hint:gG,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{}),` saving…`]}):null,(0,R.jsx)(EG,{notes:f.detached,onTakeBack:_,busy:u}),(0,R.jsx)(CG,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>U(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}function AG(e){return`${e.agent}/${e.file}`}var jG={master:`ORACLE`,designer:`DESIGN`,backend:`DEV`,qa:`QA`},MG=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function NG({info:e}){return(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,R.jsx)(`span`,{children:_G(e.chars)}),e.over?(0,R.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,R.jsx)(`span`,{className:`text-primary`,children:MG(e.notes,`note`)}):null]})}function PG({info:e,selected:t,onSelect:n}){return(0,R.jsx)(`li`,{className:`ktree-leaf`,children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(AG(e)),className:q(MU,`ktree-file min-h-9 flex-row items-center gap-2 py-1.5 max-md:min-h-11`),children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-bud`}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,R.jsx)(NG,{info:e})]})})}var FG=`bot-lobby.knowledge.folded`;function IG(){try{let e=JSON.parse(window.localStorage.getItem(FG)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function LG({files:e,models:t={},selectedKey:n,onSelect:r}){let[i,a]=(0,m.useState)(IG),o=bG(e),s=e.reduce((e,t)=>e+t.notes,0);function c(e,t){a(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(FG,JSON.stringify(r))}catch{}return r})}return(0,R.jsxs)(`div`,{className:`ktree px-3 pt-1 pb-3`,children:[(0,R.jsxs)(`p`,{className:`ktree-root`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-8 shrink-0 place-items-center rounded-lg border text-primary`,children:(0,R.jsx)(Np,{className:`size-4`})}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:`block text-sm font-medium`,children:`Project knowledge`}),(0,R.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[MG(e.length,`file`),` · `,MG(o.length,`agent`),s>0?` · ${MG(s,`note`)}`:``]})]})]}),(0,R.jsx)(`ul`,{className:`ktree-branches`,"aria-label":`Agents and their knowledge`,children:o.map(e=>{let a=!i.includes(e.agent),o=jG[e.agent],s=`knowledge-${e.agent}`,l=t[e.agent];return(0,R.jsxs)(`li`,{className:`ktree-branch`,style:{"--orb":TW(o)},children:[(0,R.jsx)(`h3`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":a,"aria-controls":s,onClick:()=>c(e.agent,!a),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),c(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),a||c(e.agent,!0))},className:`ktree-node max-md:min-h-11`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`ktree-tile`,children:(0,R.jsx)(bW,{source:o,strokeWidth:2.25,className:o===`ORACLE`?`size-5`:`size-3.5`})}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block truncate text-sm font-medium text-foreground`,children:mG[e.agent]}),l?(0,R.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`runs on `}),l]}):null]}),(0,R.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[e.notes>0?(0,R.jsxs)(`span`,{className:`text-primary`,children:[MG(e.notes,`note`),` · `]}):null,MG(e.files.length,`file`)]}),(0,R.jsx)(Gp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 ease-snap`,a&&`rotate-90`)})]})}),(0,R.jsx)(Du,{initial:!1,children:a?(0,R.jsx)(B.ul,{id:s,"aria-label":`${mG[e.agent]}'s knowledge`,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`ktree-leaves`,children:e.files.map(e=>(0,R.jsx)(PG,{info:e,selected:AG(e)===n,onSelect:r},AG(e)))},`files`):null})]},e.agent)})})]})}var RG=()=>aj(ij(`knowledge`)),zG=e=>{let[t,n]=e.split(`/`);aj(ij(`knowledge`,t??``,n??``))};function BG(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Np,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{children:`No knowledge files yet.`})]})})}function VG(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,R.jsx)(kG,{agent:i.agent,file:i.file,onChanged:r},AG(i)):t&&n?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function HG(){let e=sA(`lobby`),t=sA(`status`),n=e.data,r=t.data?.busy??!1;return!n?.chat.length&&!n?.reply&&!r?(0,R.jsx)(`p`,{className:`m-auto max-w-md px-5 pb-dock text-center text-sm text-muted-foreground`,children:`Ask about this project below. The oracle checks saved knowledge, searches the codebase for missing information, and saves verified findings.`}):(0,R.jsx)(uG,{chat:n?.chat??[],reply:n?.reply,busy:r,hasOlder:n?.hasOlderChat??!1,hasTask:!!n?.task})}function UG({read:e,selected:t}){let n=e.data?.files.reduce((e,t)=>e+t.notes,0)??0;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Knowledge`,count:n>0?`${n} note${n===1?``:`s`}`:void 0}),(0,R.jsx)(WG,{read:e,selected:t})]})}function WG({read:e,selected:t}){return!e.data&&e.error?(0,R.jsx)(yj,{message:`Could not load the knowledge files. ${e.error}`,onRetry:e.reload}):e.data?e.data.files.length?(0,R.jsx)(LG,{files:e.data.files,models:e.data.models??{},selectedKey:t,onSelect:zG}):(0,R.jsx)(BG,{}):(0,R.jsx)(oM,{})}function GG({rest:e}){let{chat:t,agent:n,file:r}=dG(e),i=eM(),a=xj(`knowledge.files`,{},[`knowledge`]),o=a.data?.files??[],s=o.find(e=>e.agent===n&&e.file===r);return(0,R.jsx)(iM,{wide:i,inlineDetail:!0,list:(0,R.jsx)(UG,{read:a,selected:s?AG(s):void 0}),detail:t?(0,R.jsx)(HG,{}):VG(o,n,r,a.reload),detailClassName:t?`flex flex-col overflow-hidden p-0`:void 0,open:t||!!(n&&r),onClose:RG,hint:`Select a file to read its entries, or ask about the project below.`,describe:t?`Knowledge chat`:`Knowledge file`})}function KG(e){let t=e[0]===`board`,n=e[+!!t];try{return{board:t,id:n?decodeURIComponent(n):void 0}}catch{return{board:t,id:n}}}function qG({className:e,...t}){return(0,R.jsx)(yC,{"aria-keyshortcuts":`Space`,"aria-description":`When focused, press Space to toggle.`,"data-slot":`checkbox`,className:q(`peer relative flex size-[1.125rem] shrink-0 items-center justify-center rounded-[5px] border border-input bg-background text-primary-foreground transition-colors duration-150 outline-none before:absolute before:-inset-3 before:content-[''] focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-primary`,e),...t,children:(0,R.jsx)(xC,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var JG=`Sessions`,YG=`No sessions yet.`,XG=`Up to 5 sessions; each can be assigned to one agent or several.`,ZG=`A session is a live Excalidraw room that you and your agents draw in together.`,QG=[{title:`Start a live room`,text:`In Excalidraw: Share → Live collaboration → Start session.`},{title:`Add it here`,text:`Paste the room link, or make a new room and open it in Excalidraw.`},{title:`Assign agents`,text:`They read the board and draw on it, under their own name.`}],$G=`Sessions`,eK=`Pick a session on the left to see its link, its room and its agents.`,tK=`Room link`,nK=`Masked until revealed. A revealed link stays in this tab and is never saved.`,rK=`Room`,iK=`Drawing`,aK=`Last check`,oK=`not checked yet`,sK=`Add a session`,cK=`https://excalidraw.com/#room=…`,lK=`Optional name`;function uK(e){return`${e} of 5 in use`}var dK=`Agents may draw here.`,fK=`Agents may only look.`,pK=`checking the room…`,mK=`Check that the room can be reached.`,hK=`Assigned to`,gK=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,_K=`Add or rename`,vK=`Add by link`,yK=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,bK=`New room`,xK=`Makes a fresh room link to open in Excalidraw; the name is optional.`,SK=`Rename`,CK=`draw`,wK=`look only`,TK=`Copied to the clipboard`,EK=`Could not reveal the link.`,DK=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],OK={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function kK(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function AK(e){return e?e.ok?`✓`:`!`:``}function jK({title:e,right:t,className:n,children:r}){return(0,R.jsxs)(`section`,{className:q(`card-raised flex min-w-0 flex-col gap-3 rounded-xl border p-4`,n),children:[(0,R.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function MK({row:e=!1}){return(0,R.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:QG.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised flex gap-3 rounded-xl border p-3.5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function NK({label:e,hint:t,buttonLabel:n,placeholder:r,initial:i=``,required:a,mono:o,primary:s,onSubmit:c}){let l=(0,m.useId)(),[u,d]=(0,m.useState)(i),[f,p]=(0,m.useState)(!1),h=a&&!u.trim(),g=async()=>{h||f||(p(!0),await c(u)&&d(i),p(!1))};return(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,R.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,R.jsxs)(`div`,{className:`flex gap-2 max-md:flex-wrap`,children:[(0,R.jsx)(`input`,{id:l,value:u,maxLength:o?2e3:80,placeholder:r,"aria-describedby":t?`${l}-hint`:void 0,onChange:e=>d(e.target.value),className:q(`h-8 min-w-0 flex-1 rounded-lg border border-input bg-background px-3 text-sm outline-none transition-[border-color,box-shadow] placeholder:text-muted-foreground/70 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 max-md:min-h-11`,o&&`font-mono text-[0.8125rem]`)}),(0,R.jsx)(X,{type:`submit`,label:n,icon:f?$m:Uh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,R.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function PK({onChanged:e,primary:t}){return(0,R.jsx)(NK,{label:vK,hint:yK,buttonLabel:`Add`,placeholder:cK,required:!0,mono:!0,primary:t,onSubmit:async t=>await U(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function FK({onChanged:e,primary:t}){return(0,R.jsx)(NK,{label:bK,hint:xK,buttonLabel:`Create`,placeholder:lK,primary:t,onSubmit:async t=>{let n=t.trim();return await U(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function IK({onChanged:e,stacked:t=!1}){return(0,R.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,R.jsx)(PK,{onChanged:e,primary:!0}),(0,R.jsx)(FK,{onChanged:e,primary:!0})]})}function LK({session:e,onChanged:t}){return(0,R.jsx)(NK,{label:SK,initial:e.name,required:!0,buttonLabel:SK,onSubmit:async n=>await U(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function RK({icon:e,tone:t=`muted`,children:n}){return(0,R.jsxs)(`span`,{className:q(`inline-flex h-6 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium`,t===`primary`?`bg-accent text-primary`:t===`warning`?`bg-warning/10 text-warning`:`bg-muted text-muted-foreground`),children:[(0,R.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function zK({check:e,checking:t}){return t?(0,R.jsx)(RK,{icon:$m,children:pK}):e?e.ok?(0,R.jsx)(RK,{icon:tm,tone:`primary`,children:`reachable`}):(0,R.jsx)(RK,{icon:$p,tone:`warning`,children:`unreachable`}):(0,R.jsx)(RK,{icon:rm,children:oK})}function BK({label:e,children:t}){return(0,R.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm max-md:grid-cols-[minmax(5rem,6rem)_minmax(0,1fr)]`,children:[(0,R.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsx)(`dd`,{className:`min-w-0 break-words`,children:t})]})}function VK({check:e,checking:t}){return t?(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3.5`,"aria-hidden":`true`}),pK]}):e?(0,R.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:mK})}function HK({agent:e,on:t,onToggle:n}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:q(`flex h-9 w-full cursor-pointer items-center gap-2.5 rounded-lg border px-2.5 text-sm transition-[background-color,border-color,color] max-md:min-h-11`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,R.jsx)(qG,{checked:t,onCheckedChange:()=>n(e)}),(0,R.jsx)(`span`,{className:`truncate`,children:OK[e]})]})})}function UK({session:e,onChanged:t}){let n=async n=>{await U(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await U(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===DK.length;return(0,R.jsxs)(jK,{title:hK,right:kK(e.agents.length),children:[(0,R.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:DK.map(t=>(0,R.jsx)(HK,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,R.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:gK}),(0,R.jsx)(X,{label:i?`Take every agent off`:`Assign every agent`,icon:Ym,onClick:()=>void r()})]})]})}function WK({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await Te(`excalidraw.reveal`,{id:e.id})).link)}catch(e){H.error(e instanceof Error?e.message:EK)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>H(TK)).catch(()=>void 0),u=async()=>{await U(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,R.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,R.jsxs)(Gj,{children:[o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(X,{label:`Copy the link`,text:`Copy`,icon:xm,shortcut:`C`,onClick:l}),(0,R.jsx)(X,{label:`Open board`,icon:Tm,tone:`primary`,shortcut:`O`,href:o})]}):(0,R.jsx)(X,{label:`Reveal the link`,text:`Reveal`,icon:Dm,shortcut:`R`,onClick:()=>void c()}),(0,R.jsx)(X,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?Lh:zh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,R.jsx)(X,{label:`Check the room`,text:`Check`,icon:n?$m:lg,shortcut:`T`,disabled:n,onClick:r}),(0,R.jsx)(SM,{icon:Cg,label:`Remove the session`,text:`Remove`,shortcut:`Delete`,title:`Remove "${e.name}"?`,description:`Agents lose this session at once; the Excalidraw room itself is not touched.`,confirmLabel:`Remove session`,variant:`destructive`,onConfirm:a})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,R.jsx)(RK,{icon:e.contribute?zh:Dm,tone:e.contribute?`primary`:`muted`,children:e.contribute?CK:wK}),(0,R.jsx)(RK,{icon:jg,children:kK(e.agents.length)}),(0,R.jsx)(zK,{check:t,checking:n})]})]}),(0,R.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,R.jsxs)(jK,{title:tK,children:[(0,R.jsx)(`p`,{className:`rounded-lg border border-border bg-muted px-3 py-2 font-mono text-[0.8125rem] break-all text-foreground`,children:o??e.masked}),(0,R.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:nK})]}),(0,R.jsx)(jK,{title:rK,children:(0,R.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(BK,{label:iK,children:(0,R.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?dK:fK})}),(0,R.jsx)(BK,{label:aK,children:(0,R.jsx)(VK,{check:t,checking:n})})]})})]}),(0,R.jsx)(UK,{session:e,onChanged:i})]}),(0,R.jsx)(jK,{title:_K,children:(0,R.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,R.jsx)(LK,{session:e,onChanged:i}),(0,R.jsx)(PK,{onChanged:i}),(0,R.jsx)(FK,{onChanged:i})]})})]})}function GK({check:e,checking:t}){if(t)return(0,R.jsx)(pj,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=AK(e);return n?(0,R.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,R.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function KK({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":r?`true`:void 0,onClick:()=>i(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(GK,{check:t,checking:n}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:kK(e.agents.length)})]}),(0,R.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,R.jsx)(jU,{variant:`secondary`,children:e.contribute?CK:wK})]})]})})}function qK({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(KK,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var JK=()=>aj(ij(`excalidraw`)),YK=e=>aj(ij(`excalidraw`,e));function XK({count:e}){return(0,R.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,R.jsx)(`span`,{className:`tabular-nums`,children:uK(e)})]})}function ZK({count:e,onChanged:t}){return(0,R.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:$G}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:eK})]}),(0,R.jsx)(XK,{count:e})]}),(0,R.jsx)(MK,{row:!0}),e<5?(0,R.jsx)(jK,{title:sK,children:(0,R.jsx)(IK,{onChanged:t})}):null,(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,R.jsx)(iA,{chord:`ArrowDown`,children:`next session`}),(0,R.jsx)(iA,{chord:`ArrowRight`,children:`into its detail`})]})]})}function QK({onChanged:e}){return(0,R.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock md:px-8`,children:(0,R.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 place-items-center rounded-xl border text-primary`,children:(0,R.jsx)(Nh,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:YG}),(0,R.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:ZG})]}),(0,R.jsx)(MK,{}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:XG})]}),(0,R.jsx)(jK,{title:sK,className:`self-start`,children:(0,R.jsx)(IK,{onChanged:e,stacked:!0})})]})})}function $K({id:e}){let t=eM(),n=xj(`excalidraw.list`,{},[`excalidraw`]),[r,i]=(0,m.useState)({}),[a,o]=(0,m.useState)([]),s=n.data?.sessions??[],c=s.find(t=>t.id===e),l=async e=>{o(t=>[...t,e]);let t=await U(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await U(`excalidraw.remove`,{id:c.id})&&(n.reload(),JK())};if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,R.jsx)(QK,{onChanged:n.reload});let d=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:JG,count:n.data?`${s.length}/5`:void 0}),n.data?(0,R.jsx)(qK,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:YK}):(0,R.jsx)(oM,{})]}),f=c?(0,R.jsx)(WK,{session:c,check:r[c.id],checking:a.includes(c.id),onCheck:()=>void l(c.id),onChanged:n.reload,onRemove:()=>void u()}):t&&n.data?(0,R.jsx)(ZK,{count:s.length,onChanged:n.reload}):null;return(0,R.jsx)(iM,{wide:t,list:d,detail:f,open:c!==void 0,onClose:JK,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}var eq=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function tq({data:e,status:t}){let n=eq(t);if(!n.conversation)return null;let r=n.activity?e?.activity:void 0;return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(uG,{chat:e?.chat??[],...r?{activity:r}:{},reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task})})}function nq(){let e=sA(`lobby`),t=sA(`status`);return!e.data&&e.loading?(0,R.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(pj,{}),(0,R.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,R.jsx)(yj,{message:e.error,onRetry:()=>fe.onHello({})}):(0,R.jsx)(tq,{data:e.data,status:t.data})}var rq=Jg([`relative flex flex-col bg-muted/50 gap-(--frame-gap) px-(--frame-px) py-(--frame-py) rounded-(--frame-radius)`,`[--frame-radius:var(--radius-xl)]`,`[--frame-gap:--spacing(0.75)] [--frame-px:--spacing(0.75)] [--frame-py:--spacing(0.75)] [--frame-panel-header-gap:0rem] [--frame-panel-footer-gap:--spacing(1)]`,`[--frame-panel-px-adjust:0px] [--frame-panel-py-adjust:0px] [--frame-panel-header-px-adjust:0px] [--frame-panel-header-py-adjust:0px] [--frame-panel-footer-px-adjust:0px] [--frame-panel-footer-py-adjust:0px]`,`[--frame-panel-px:calc(var(--frame-panel-px-base)+var(--frame-panel-px-adjust))] [--frame-panel-py:calc(var(--frame-panel-py-base)+var(--frame-panel-py-adjust))] [--frame-panel-header-px:calc(var(--frame-panel-header-px-base)+var(--frame-panel-header-px-adjust))] [--frame-panel-header-py:calc(var(--frame-panel-header-py-base)+var(--frame-panel-header-py-adjust))] [--frame-panel-footer-px:calc(var(--frame-panel-footer-px-base)+var(--frame-panel-footer-px-adjust))] [--frame-panel-footer-py:calc(var(--frame-panel-footer-py-base)+var(--frame-panel-footer-py-adjust))]`,``,`[--frame-panel-bg:var(--workspace-card)] [--frame-panel-border-color:var(--workspace-border)] [--frame-border-color:var(--workspace-border)]`,`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px)-1px)]`],{variants:{variant:{default:`border border-[var(--frame-border-color)] bg-clip-padding`,inverse:`[--frame-panel-bg:color-mix(in_oklch,var(--color-muted)_40%,transparent)] border border-[var(--frame-border-color)] bg-background bg-clip-padding`,ghost:`[--frame-panel-radius:calc(var(--frame-radius)-var(--frame-px))]`},spacing:{xs:`[--frame-panel-px-base:--spacing(2)] [--frame-panel-py-base:--spacing(2)] [--frame-panel-header-px-base:--spacing(2)] [--frame-panel-header-py-base:--spacing(0.5)] [--frame-panel-footer-px-base:--spacing(2)] [--frame-panel-footer-py-base:--spacing(0.5)]`,sm:`[--frame-panel-px-base:--spacing(3)] [--frame-panel-py-base:--spacing(3.5)] [--frame-panel-header-px-base:--spacing(3)] [--frame-panel-header-py-base:--spacing(1.5)] [--frame-panel-footer-px-base:--spacing(3)] [--frame-panel-footer-py-base:--spacing(1.5)]`,default:`[--frame-panel-px-base:--spacing(4)] [--frame-panel-py-base:--spacing(4)] [--frame-panel-header-px-base:--spacing(4)] [--frame-panel-header-py-base:--spacing(2)] [--frame-panel-footer-px-base:--spacing(4)] [--frame-panel-footer-py-base:--spacing(2)]`,lg:`[--frame-panel-px-base:--spacing(5)] [--frame-panel-py-base:--spacing(5)] [--frame-panel-header-px-base:--spacing(5)] [--frame-panel-header-py-base:--spacing(2.5)] [--frame-panel-footer-px-base:--spacing(5)] [--frame-panel-footer-py-base:--spacing(2.5)]`},stacked:{true:[`gap-0 *:has-[+[data-slot=frame-panel]]:rounded-b-none`,`*:has-[+[data-slot=frame-panel]]:before:hidden`,`*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:rounded-t-none`,`*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:border-t-0`],false:[`data-[spacing=sm]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-0.5`,`data-[spacing=default]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1`,`data-[spacing=lg]:*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-2`]},dense:{true:`p-0 gap-0 border-[var(--frame-border-color)] [--frame-panel-radius:var(--frame-radius)] [&_[data-slot=frame-panel]]:-mx-px [&_[data-slot=frame-panel]]:before:hidden [&_[data-slot=frame-panel]:last-child]:-mb-px [&:not(:has([data-slot=frame-panel-header]))_[data-slot=frame-panel]:is(:first-child)]:-mt-px`,false:``}},defaultVariants:{variant:`default`,spacing:`default`,stacked:!1,dense:!1}});function iq({className:e,variant:t,spacing:n,stacked:r,dense:i,...a}){return(0,R.jsx)(`div`,{className:q(rq({variant:t,spacing:n,stacked:r,dense:i}),e),"data-slot":`frame`,"data-spacing":n,...a})}function aq({className:e,fit:t,...n}){return(0,R.jsx)(`div`,{className:q(`relative overflow-hidden rounded-(--frame-panel-radius) border border-(--frame-panel-border-color) bg-(--frame-panel-bg) bg-clip-padding shadow-xs`,!t&&`grow`,`before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--frame-panel-radius)-1px)] before:shadow-black/5`,`dark:bg-clip-border dark:before:shadow-white/5`,`px-(--frame-panel-px) py-(--frame-panel-py)`,e),"data-slot":`frame-panel`,...n})}function oq({className:e,...t}){return(0,R.jsx)(`header`,{className:q(`flex flex-col gap-(--frame-panel-header-gap) px-(--frame-panel-header-px) py-(--frame-panel-header-py)`,e),"data-slot":`frame-panel-header`,...t})}var sq={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function cq(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function lq(e){return e>0?cq(e):`—`}function uq(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function dq(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function fq(e){return!Number.isFinite(e)||e<1e3?String(Math.max(0,Math.round(e||0))):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}function pq(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function mq(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function hq(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function gq(e,t){let n=t===`model-kind`?sq[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var _q=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],vq={MASTER:`bg-primary`,ORACLE:`bg-primary`,DEV:`bg-source-dev`,DESIGN:`bg-source-design`,QA:`bg-source-qa`,RESEARCH:`bg-source-research`,"QUICK FIX":`bg-source-quickfix`};function yq(e){let t=vq[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%_q.length;return _q[n]??_q[0]}function bq(e){return sq[e]??e}var xq=6;function Sq({daily:e,cost:t}){let n=(0,m.useId)().replace(/:/g,``),r=xf(),[i,a]=(0,m.useState)(null),o=t?`Daily cost`:`Daily runs`,s=e.map(e=>t?e.cost:e.runs),c=Math.max(...s,t?.01:1),l=t?[0,c/2,c]:[...new Set([0,Math.ceil(c/2),c])],u=Date.parse(e[0]?.date??`1970-01-01`),d=Date.parse(e.at(-1)?.date??`1970-01-01`),f=Math.max(1,(d-u)/864e5),p=e=>52+(Date.parse(e)-u)/(f*864e5)*424,h=Math.max(.5,Math.min(28,424/(f+1)*.65)),g=e=>t?`$${e.toFixed(2)}`:String(Math.round(e)),_=e=>new Date(`${e}T12:00:00Z`).toLocaleDateString(void 0,{month:`short`,day:`numeric`,timeZone:`UTC`}),v=[...new Set([e[0]?.date,e[Math.floor(e.length/2)]?.date,e.at(-1)?.date])].filter(e=>!!e);return(0,R.jsxs)(wq,{title:o,right:t?`USD · per day`:`all runs · successful runs`,children:[(0,R.jsx)(`div`,{className:`flex min-h-5 flex-wrap items-baseline gap-x-2 text-xs`,"aria-live":`polite`,children:i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`font-medium`,children:_(i.date)}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:t?g(i.cost):`${i.runs} runs · ${i.successes} successful`})]}):(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Hover or focus a day to inspect it.`})}),(0,R.jsxs)(`svg`,{viewBox:`0 0 512 220`,className:`w-full overflow-visible`,role:`group`,"aria-label":o,children:[(0,R.jsx)(`defs`,{children:(0,R.jsxs)(`linearGradient`,{id:`${n}-fill`,x1:`0`,y1:`0`,x2:`0`,y2:`1`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--primary)`,stopOpacity:`0.5`})]})}),l.map(e=>(0,R.jsxs)(`g`,{"aria-hidden":`true`,children:[(0,R.jsx)(`line`,{x1:`36`,x2:`494`,y1:180-e/c*144,y2:180-e/c*144,stroke:`var(--workspace-border)`,strokeDasharray:`3 5`,opacity:`0.6`}),(0,R.jsx)(`text`,{x:`29`,y:184-e/c*144,textAnchor:`end`,fill:`var(--muted-foreground)`,fontSize:`10`,children:g(e)})]},e)),e.map((e,o)=>{let s=(t?e.cost:e.runs)/c*144,l=u===d?264:p(e.date),f=`${e.date}: ${t?g(e.cost):`${e.runs} runs, ${e.successes} successful`}`;return(0,R.jsxs)(`g`,{role:`img`,"aria-label":f,tabIndex:0,className:`outline-none`,onFocus:()=>a(e),onBlur:()=>a(null),onPointerEnter:()=>a(e),onPointerLeave:()=>a(null),children:[(0,R.jsx)(`title`,{children:f}),(0,R.jsx)(`rect`,{x:l-Math.max(h,12)/2,y:`26`,width:Math.max(h,12),height:`156`,rx:`4`,fill:`var(--accent)`,opacity:+(i?.date===e.date)}),(0,R.jsx)(B.rect,{"data-trend-bar":!0,x:l-h/2,width:h,rx:`3`,fill:`url(#${n}-fill)`,initial:!r&&{height:0,y:180},animate:{height:s,y:180-s},transition:{duration:r?0:.65,delay:r?0:Math.min(o*.04,.3),ease:[.22,1,.36,1]}}),t?null:(0,R.jsx)(B.rect,{x:l-h/2,width:h,rx:`3`,fill:`var(--success)`,initial:!r&&{height:0,y:180},animate:{height:e.successes/c*144,y:180-e.successes/c*144},transition:{duration:r?0:.65,delay:r?0:Math.min(o*.04,.3)}})]},e.date)}),v.map(e=>(0,R.jsx)(`text`,{"aria-hidden":`true`,x:u===d?264:p(e),y:`205`,textAnchor:`middle`,fill:`var(--muted-foreground)`,fontSize:`11`,children:_(e)},e))]}),t?null:(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-4 text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`i`,{className:`size-2 rounded-sm bg-primary`,"aria-hidden":`true`}),`All runs`]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,R.jsx)(`i`,{className:`size-2 rounded-sm bg-success`,"aria-hidden":`true`}),`Successful`]})]})]})}function Cq({daily:e}){return(0,R.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,R.jsx)(Sq,{daily:e}),(0,R.jsx)(Sq,{daily:e,cost:!0})]})}function wq({title:e,right:t,children:n}){return(0,R.jsxs)(iq,{role:`region`,className:`min-w-0`,"aria-label":e,children:[(0,R.jsx)(oq,{className:`py-2.5`,children:(0,R.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-semibold`,children:[(0,R.jsx)(`span`,{children:e}),t?(0,R.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]})}),(0,R.jsx)(aq,{className:`flex min-w-0 flex-col gap-3`,children:n})]})}function Tq({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,xq);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>xq?(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":n,onClick:()=>r(e=>!e),className:`h-6 self-start rounded-lg text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:n?`Show fewer`:`Show all ${e.length}`}):null]})}function Eq({width:e,className:t,title:n}){let r=xf();return(0,R.jsx)(B.div,{"data-chart-bar":!0,title:n,className:`h-full ${t}`,initial:!r&&{width:0},animate:{width:`${e}%`},transition:{duration:r?0:.7,ease:[.22,1,.36,1]}})}function Dq(e,t){return t>0?Math.max(1.5,e/t*100):0}function Oq({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,R.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,R.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,R.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,R.jsxs)(`div`,{className:`relative h-5 overflow-hidden rounded-md border border-border bg-muted chart-track`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,R.jsx)(Eq,{className:`rounded-r-md bg-linear-to-r from-primary/65 to-primary`,width:Dq(t,r)}),n?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-1/2 h-3 w-0.5 -translate-y-1/2 rounded-full bg-foreground/40`,style:{left:`${Math.min(99.5,Dq(n,r))}%`}}):null]})]})}function kq({groups:e,label:t}){let n=e.filter(e=>e.avgMs>0).sort((e,t)=>t.avgMs-e.avgMs),r=Math.max(...n.map(e=>Math.max(e.avgMs,e.p90Ms)),1);return(0,R.jsx)(wq,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,R.jsx)(Tq,{rows:n,render:e=>(0,R.jsx)(Oq,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:lq(e.avgMs),sub:`p90 ${lq(e.p90Ms)}`},t(e))})})}var Aq={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},jq={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function Mq({label:e,rate:t,runs:n}){let r=mq(t),i=`${Math.round(t*100)}%`;return(0,R.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 ${jq[r.tone]}`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${Aq[r.tone]}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,R.jsxs)(`div`,{className:`flex h-5 overflow-hidden rounded-md border border-border bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,R.jsx)(Eq,{className:`bg-success/80`,width:t*100}),(0,R.jsx)(Eq,{className:`bg-destructive/60`,width:(1-t)*100})]})]})}function Nq({groups:e,label:t}){let n=e.filter(e=>e.runs>0).sort((e,t)=>e.successes/e.runs-t.successes/t.runs);return(0,R.jsx)(wq,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,R.jsx)(Tq,{rows:n,render:e=>(0,R.jsx)(Mq,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function Pq({share:e}){return(0,R.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,R.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${yq(e.agent)}`,"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`text-[0.8125rem]`,children:SW(e.agent)}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,R.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,cq(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function Fq({share:e}){return(0,R.jsx)(`div`,{className:`flex h-6 gap-0.5 overflow-hidden rounded-md border border-border bg-muted`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,R.jsx)(Eq,{className:`${yq(e.agent)} opacity-85`,width:e.share*100,title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function Iq({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,R.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,R.jsx)(Tq,{rows:e,render:e=>(0,R.jsx)(Oq,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:cq(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function Lq({timeShare:e}){let t=e.byAgent;return(0,R.jsxs)(wq,{title:`Where the time goes`,right:`share of run time by agent`,children:[t.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,R.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,R.jsx)(Fq,{share:t}),(0,R.jsx)(Pq,{share:t})]}),(0,R.jsx)(Iq,{times:e.taskTimes})]})}function Rq(e){return(0,R.jsx)(FD,{...e})}function zq(e){return(0,R.jsx)(zD,{"data-slot":`select-value`,...e})}function Bq({className:e,children:t,...n}){return(0,R.jsxs)(LD,{"data-slot":`select-trigger`,className:q(`reui-select flex h-9 min-w-36 items-center justify-between gap-3 rounded-lg border px-3 text-xs outline-none focus-visible:ring-3 focus-visible:ring-ring/30 disabled:opacity-50`,e),...n,children:[t,(0,R.jsx)(BD,{asChild:!0,children:(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`})})]})}function Vq({className:e,children:t,position:n=`popper`,align:r=`start`,...i}){return(0,R.jsx)(UD,{children:(0,R.jsxs)(GD,{"data-slot":`select-content`,position:n,align:r,sideOffset:4,className:q(`reui-menu z-50 max-h-(--radix-select-content-available-height) min-w-(--radix-select-trigger-width) origin-(--radix-select-content-transform-origin) overflow-hidden rounded-xl border p-1 shadow-lg data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 motion-reduce:animate-none`,e),...i,children:[(0,R.jsx)(hO,{className:`flex justify-center py-1`,children:(0,R.jsx)(qp,{"aria-hidden":`true`,className:`size-4`})}),(0,R.jsx)(rO,{children:t}),(0,R.jsx)(_O,{className:`flex justify-center py-1`,children:(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-4`})})]})})}function Hq({className:e,children:t,...n}){return(0,R.jsxs)(lO,{"data-slot":`select-item`,className:q(`relative flex cursor-default items-center gap-2 rounded-lg py-2 pr-8 pl-3 text-xs outline-none select-none data-highlighted:bg-accent data-disabled:opacity-50`,e),...n,children:[(0,R.jsx)(dO,{children:t}),(0,R.jsx)(pO,{className:`absolute right-2`,children:(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3.5 text-primary`})})]})}function Uq({className:e,type:t,...n}){return(0,R.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`flex h-8 w-full rounded-lg border border-input bg-background px-3 py-1 text-base transition-[border-color,box-shadow] duration-150 outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:disabled:bg-input/80`,e),...n})}var Wq=[{value:`all`,label:`All time`},{value:`today`,label:`Today`},{value:`week`,label:`Past 7 days`},{value:`range`,label:`Date range`}];function Gq(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function Kq({onChange:e}){let[t,n]=(0,m.useState)(`all`),r=Gq(new Date),[i,a]=(0,m.useState)(r),[o,s]=(0,m.useState)(r),[c,l]=(0,m.useState)(``);function u(t){if(n(t),l(``),t===`all`)e({});else if(t===`range`)i&&o&&i<=o&&e({from:i,to:o});else{let n=new Date;t===`week`&&n.setDate(n.getDate()-6),e({from:Gq(n),to:r})}}return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-end gap-3`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Period`}),(0,R.jsxs)(Rq,{value:t,onValueChange:u,children:[(0,R.jsx)(Bq,{"aria-label":`Metrics period`,children:(0,R.jsx)(zq,{})}),(0,R.jsx)(Vq,{children:Wq.map(e=>(0,R.jsx)(Hq,{value:e.value,children:e.label},e.value))})]})]}),t===`range`?(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-wrap items-end gap-2`,onSubmit:t=>{if(t.preventDefault(),!i||!o||i>o){l(`Choose an end date on or after the start date.`);return}l(``),e({from:i,to:o})},children:[(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[`Start date`,(0,R.jsx)(Uq,{type:`date`,required:!0,value:i,onChange:e=>a(e.target.value),className:`h-9 w-36 max-w-full text-xs`})]}),(0,R.jsxs)(`label`,{className:`flex min-w-0 flex-col gap-1.5 text-xs text-muted-foreground`,children:[`End date`,(0,R.jsx)(Uq,{type:`date`,required:!0,value:o,onChange:e=>s(e.target.value),className:`h-9 w-36 max-w-full text-xs`})]}),(0,R.jsx)(Y,{type:`submit`,size:`sm`,className:`h-9`,children:`Apply`}),c?(0,R.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:c}):null]}):null]})}function qq({label:e,value:t,sub:n}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var Jq=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function Yq({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,R.jsxs)(`section`,{className:`card-raised flex flex-col gap-3 rounded-xl border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,R.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,R.jsx)(qq,{label:`Calls`,value:Jq(e.calls,`call`),sub:`${uq(e.ok,e.calls)} ok`}),(0,R.jsx)(qq,{label:`Speed`,value:`p50 ${pq(e.p50Ms)}`,sub:`p90 ${pq(e.p90Ms)}`}),(0,R.jsx)(qq,{label:`Read`,value:e.input>0?`${fq(e.input)} tokens`:`—`}),(0,R.jsx)(qq,{label:`Routed down`,value:e.routed>0?Jq(e.routed,`run`):`none`,sub:e.routed>0?`${uq(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,Jq(e.seatRunsSkipped,`seat run`),` skipped · `,Jq(e.questionsAnswered,`question`),` answered · `,Jq(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,R.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var Xq=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function Zq(e,t=0){return e>0?e.toFixed(t):`—`}function Qq(e){return[String(e.runs),uq(e.successes,e.runs),lq(e.avgMs),lq(e.p50Ms),lq(e.p90Ms),Zq(e.avgTurns,1),Zq(e.avgTools,1),e.avgTokens>0?fq(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,dq(e.avgCost),dq(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function $q(e,t){return t===`model-kind`?bq(e.kinds[0]??``):e.kinds.map(bq).join(`, `)}function eJ({groups:e,groupBy:t}){return(0,R.jsxs)(`section`,{className:`card-raised flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border pt-4`,"aria-label":`All models`,children:[(0,R.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,R.jsx)(`span`,{children:`All models`}),(0,R.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,R.jsx)(`div`,{className:`max-h-80 overflow-auto outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,tabIndex:0,role:`region`,"aria-label":`All model metrics, scroll horizontally to see all columns`,children:(0,R.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,R.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,R.jsxs)(`tr`,{children:[(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),Xq.map(e=>(0,R.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,R.jsx)(`tbody`,{children:e.map(e=>(0,R.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,R.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,R.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:$q(e,t)||`—`}),Qq(e).map((e,t)=>(0,R.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},Xq[t]))]},gq(e,t)))})]})})]})}var tJ={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function nJ({label:e,value:t,sub:n,dot:r}){return(0,R.jsxs)(`div`,{className:`workspace-section flex min-w-0 flex-col gap-1 rounded-xl border px-4 py-4 shadow-xs`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${tJ[r.tone]}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,R.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function rJ({tiles:e}){let t=mq(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,R.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,R.jsx)(nJ,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,R.jsx)(nJ,{label:`Success`,value:uq(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,R.jsx)(nJ,{label:`Avg run`,value:lq(e.avgMs),sub:`p90 ${lq(e.p90Ms)}`}),(0,R.jsx)(nJ,{label:`Cost`,value:dq(e.cost),sub:e.runs>0?`${dq(e.cost/e.runs)} per run`:`—`}),(0,R.jsx)(nJ,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${cq(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var iJ=`No runs recorded yet. Every Master turn, subagent run, quick fix and planning round lands here with its model, thinking level, time, tokens and cost.`;function aJ({groupBy:e,onGroup:t}){return(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex max-w-full flex-wrap gap-0.5 rounded-lg bg-muted p-0.5`,onKeyDown:n=>{let r=n.key===`ArrowRight`||n.key===`ArrowDown`?1:n.key===`ArrowLeft`||n.key===`ArrowUp`?-1:0;if(!r)return;n.preventDefault();let i=[`model`,`model-kind`],a=i[(i.indexOf(e)+r+i.length)%i.length];t(a),requestAnimationFrame(()=>n.currentTarget.querySelector(`[aria-checked='true']`)?.focus())},children:[`model`,`model-kind`].map(n=>(0,R.jsx)(Y,{variant:`ghost`,size:`sm`,role:`radio`,tabIndex:e===n?0:-1,className:e===n?`bg-card text-foreground shadow-card hover:bg-card`:`text-muted-foreground`,"aria-checked":e===n,onClick:()=>t(n),children:hq(n)},n))})}function oJ({query:e,onQuery:t}){return(0,R.jsxs)(`label`,{className:`relative flex max-w-full items-center`,children:[(0,R.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,R.jsx)(rg,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,R.jsx)(`input`,{id:`metrics-search`,type:`search`,value:e,maxLength:500,placeholder:`Search runs: model, agent, tool…`,onChange:e=>t(e.target.value),className:`h-8 w-64 max-w-full rounded-lg border border-input bg-background pr-9 pl-8 text-xs outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30`}),(0,R.jsx)(rA,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function sJ({data:e,groupBy:t,query:n}){let r=e=>gq(e,t);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,R.jsx)(rJ,{tiles:e.tiles}),e.tiles.runs===0?(0,R.jsx)(`p`,{className:`card-raised rounded-xl border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}" in this period.`:`No runs in this period. ${iJ}`}):null,e.daily.length>0?(0,R.jsx)(Cq,{daily:e.daily}):null,e.classifier?(0,R.jsx)(Yq,{summary:e.classifier}):null,e.tiles.runs>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,R.jsx)(kq,{groups:e.groups,label:r}),(0,R.jsx)(Nq,{groups:e.groups,label:r})]}),(0,R.jsx)(eJ,{groups:e.groups,groupBy:t})]}):null,e.tiles.runs>0||e.timeShare.taskTimes.length>0?(0,R.jsx)(Lq,{timeShare:e.timeShare}):null]})}function cJ(){return(0,R.jsx)(`div`,{className:`grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5`,role:`status`,"aria-label":`Loading metrics`,children:[0,1,2,3,4].map(e=>(0,R.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function lJ(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),[i,a]=(0,m.useState)({}),o=Intl.DateTimeFormat().resolvedOptions().timeZone,s=xj(`metrics.get`,{groupBy:e,query:n,...i,timeZone:o},[`metrics`]);return!s.data&&s.error?(0,R.jsx)(yj,{message:`Could not load metrics. ${s.error}`,onRetry:s.reload}):(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),(0,R.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:`Daily trends and model performance`})]}),s.loading&&s.data?(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(pj,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`})]}),(0,R.jsxs)(`section`,{"aria-label":`Metrics filters`,className:`workspace-section flex flex-wrap items-end gap-4 rounded-xl border p-4`,children:[(0,R.jsx)(Kq,{onChange:a}),(0,R.jsxs)(`div`,{className:`flex w-full min-w-0 flex-wrap items-end gap-3 lg:w-auto lg:flex-1 lg:justify-end`,children:[(0,R.jsx)(aJ,{groupBy:e,onGroup:t}),(0,R.jsx)(oJ,{query:n,onQuery:r})]}),(0,R.jsxs)(`p`,{className:`w-full text-xs text-muted-foreground`,children:[i.from?`${i.from} – ${i.to}`:`All recorded dates`,` · `,o,`. Runs and active tasks use their start date; completed tasks use their completion date.`]})]}),s.error?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not refresh metrics. `,s.error]}):null,(0,R.jsx)(`div`,{"aria-busy":s.loading,className:s.loading&&s.data?`opacity-60`:void 0,children:s.data?(0,R.jsx)(sJ,{data:s.data,groupBy:e,query:n},JSON.stringify([s.data,e])):(0,R.jsx)(cJ,{})})]})}var uJ=class{seen=new Set;initialized=new Set;storage;constructor(e){this.storage=e;try{let t=JSON.parse(e?.getItem(`bot-lobby.prompt-seen`)??`[]`);Array.isArray(t)&&(this.seen=new Set(t.filter(e=>typeof e==`string`)))}catch{}}observe(e,t,n=!1){let r=this.initialized.has(e)&&!n?t.filter(e=>!this.seen.has(e)):[];this.initialized.add(e);for(let e of t)this.seen.add(e);try{this.storage?.setItem(`bot-lobby.prompt-seen`,JSON.stringify([...this.seen]))}catch{}return r}};function dJ(e,t){return JSON.stringify([e,`prompt`,t])}function fJ(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function pJ(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var mJ=`bot-lobby.prompt-sound-muted`,hJ=new Set,gJ,_J=!1;function vJ(){try{return localStorage.getItem(mJ)===`on`}catch{return _J}}function yJ(e){_J=e;try{localStorage.setItem(mJ,e?`on`:`off`)}catch{}for(let e of hJ)e()}function bJ(e){return hJ.add(e),()=>{hJ.delete(e)}}function xJ(){return(0,m.useSyncExternalStore)(bJ,vJ,()=>!1)}function SJ(){(0,m.useEffect)(()=>{let e=()=>{try{gJ??=new AudioContext,gJ.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function CJ(){if(!vJ()&&gJ&&gJ.state===`running`)try{let e=gJ.currentTime,t=gJ.createOscillator(),n=gJ.createGain();t.frequency.setValueAtTime(960,e),t.frequency.exponentialRampToValueAtTime(360,e+.16),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.12,e+.012),n.gain.exponentialRampToValueAtTime(1e-4,e+.22),t.connect(n),n.connect(gJ.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}function wJ(){if(!vJ()&&gJ&&gJ.state===`running`)try{let e=gJ.currentTime,t=gJ.createOscillator(),n=gJ.createGain();t.frequency.setValueAtTime(1500,e),n.gain.setValueAtTime(1e-4,e),n.gain.exponentialRampToValueAtTime(.045,e+.004),n.gain.exponentialRampToValueAtTime(1e-4,e+.028),t.connect(n),n.connect(gJ.destination),t.start(e),t.stop(e+.03),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var TJ=`bot-lobby.notifications`,EJ=`/icon-192.png`,DJ=new Set;function OJ(){for(let e of[...DJ])e()}function kJ(){try{return localStorage.getItem(TJ)===`on`}catch{return!1}}function AJ(e){return DJ.add(e),()=>{DJ.delete(e)}}function jJ(e){try{localStorage.setItem(TJ,e?`on`:`off`)}catch{}OJ()}function MJ(){return(0,m.useSyncExternalStore)(AJ,kJ,()=>!1)}async function NJ(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(jJ(!0),`granted`):`denied`)}function PJ(){jJ(!1)}function FJ(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function IJ(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function LJ(e){try{new Notification(`bot-lobby`,{body:e,icon:EJ,tag:`bot-lobby`})}catch{}}function RJ(){try{return new uJ(sessionStorage)}catch{return new uJ}}function zJ(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?fJ(e,t.sessionId??n.key??t.from,n.dialog.id):dJ(e,t.id)}function BJ(){let e=MJ();SJ(),aA();let t=xj(`tasks.list`,{},[`tasks`]),n=xj(`sessions.list`,{},[`sessions`]),r=fe.get(`prompts`),i=fe.get(`lobby`).data,a=(0,m.useRef)(RJ()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=P()??`current`,l=fe.status().connection;return{enabled:e,tasks:t,sessions:n,prompts:r,lobby:i,seen:a,quiet:o,previousState:s,project:c,connection:l,lastConnection:(0,m.useRef)(l)}}function VJ(e,t,n,r,i){if(!i)return;let{seen:a,project:o,quiet:s,enabled:c}=e,l=a.current.observe(`${o}:${t}`,n,s.current.has(t));s.current.delete(t),l.length&&(l.forEach(()=>CJ()),c&&IJ()&&LJ(r),t===`delivery`&&H.info(r,{action:{label:`Review tasks`,onClick:()=>aj(`#/tasks`)}}))}function HJ(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;VJ(e,`prompts`,(a??[]).map(e=>zJ(i,e)),`A question is waiting for you.`,!!a&&!t.loading),VJ(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>fJ(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),VJ(e,`delivery`,r.data?.rows.filter(e=>e.delivery&&(e.delivery.status===`pending_approval`||e.delivery.status===`deferred`||e.delivery.status===`recoverable_failure`)).map(e=>pJ(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function UJ(e){let{lastConnection:t,connection:n,quiet:r,previousState:i,lobby:a,enabled:o}=e;if(t.current!==n||n!==`live`){t.current=n,r.current=new Set([`prompts`,`sessions`,`delivery`]),i.current=void 0;return}HJ(e);let s=a?.task?.state??``,c=FJ(s);i.current&&c&&s!==i.current&&o&&IJ()&&LJ(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function WJ(){let e=BJ(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>UJ(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function GJ({className:e,thumbClassName:t,...n}){return(0,R.jsx)(IO,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to toggle.`,"data-slot":`switch`,className:q(`peer relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors duration-150 outline-none before:absolute before:-inset-x-2 before:-inset-y-3 before:content-[''] focus-visible:ring-3 focus-visible:ring-ring/40 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...n,children:(0,R.jsx)(RO,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block size-4 rounded-full bg-white shadow-sm ring-0 transition-transform duration-200 ease-snap data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`,t)})})}var KJ=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],qJ=`M32 17 C28 10 19 12 17 19 C10 19 7 26 10 32 C5 38 9 46 15 47 C16 54 25 56 32 50 C39 56 48 54 49 47 C55 46 59 38 54 32 C57 26 54 19 47 19 C45 12 36 10 32 17Z`,JJ=`M32 17 C28 12 21 12 18 19 C12 19 9 25 11 31 C7 36 9 44 15 46 C16 53 26 55 32 50 C38 55 48 53 49 46 C55 44 57 36 53 31 C55 25 52 19 46 19 C43 12 36 12 32 17Z`,YJ=[`M19 22 C16 25 17 29 22 29 C27 29 28 33 25 36`,`M12 35 C16 32 20 35 18 39 C16 43 20 47 24 45`,`M25 17 C22 20 26 22 28 22 C31 23 29 27 26 27`,`M11 42 C13 44 16 42 15 39 M22 49 C26 49 29 45 27 41`,`M15 25 C12 27 14 31 17 31 M21 32 C22 35 20 37 22 39 C24 41 28 38 29 35`,`M20 18 C22 18 23 20 21 22 M24 24 C21 23 20 25 21 27 M12 37 C14 36 16 38 15 40 M20 43 C23 44 25 42 24 40 M28 29 C30 30 30 32 28 33`];function XJ({level:e,className:t}){let n=xf(),r=Math.max(0,KJ.indexOf(e)),i=[0,1,2,2,3,4,6][r],a=r===KJ.length-1,o=`brain-${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`;return(0,R.jsxs)(`svg`,{viewBox:`0 0 64 72`,"data-slot":`effort-mascot`,"data-level":e,"data-folds":i*2,"data-elevated":a||void 0,"aria-hidden":`true`,focusable:`false`,className:q(`size-16 shrink-0 overflow-visible`,t),children:[(0,R.jsxs)(`defs`,{children:[(0,R.jsxs)(`linearGradient`,{id:`${o}-ink`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[(0,R.jsx)(`stop`,{stopColor:a?`var(--rainbow-5)`:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`0.55`,stopColor:a?`var(--rainbow-6)`:`var(--primary)`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:a?`var(--rainbow-7)`:`var(--primary)`})]}),(0,R.jsxs)(`radialGradient`,{id:`${o}-halo`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--rainbow-6)`,stopOpacity:`0.38`}),(0,R.jsx)(`stop`,{offset:`0.55`,stopColor:`var(--rainbow-7)`,stopOpacity:`0.18`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-5)`,stopOpacity:`0`})]}),(0,R.jsxs)(`linearGradient`,{id:`${o}-shine`,children:[(0,R.jsx)(`stop`,{stopColor:`var(--card)`,stopOpacity:`0`}),(0,R.jsx)(`stop`,{offset:`0.5`,stopColor:`var(--primary)`,stopOpacity:`0.6`}),(0,R.jsx)(`stop`,{offset:`0.6`,stopColor:`var(--card)`,stopOpacity:`0.9`}),(0,R.jsx)(`stop`,{offset:`1`,stopColor:`var(--card)`,stopOpacity:`0`})]}),(0,R.jsxs)(`filter`,{id:`${o}-glow`,x:`-50%`,y:`-50%`,width:`200%`,height:`200%`,children:[(0,R.jsx)(`feGaussianBlur`,{stdDeviation:`1.4`}),(0,R.jsxs)(`feMerge`,{children:[(0,R.jsx)(`feMergeNode`,{}),(0,R.jsx)(`feMergeNode`,{in:`SourceGraphic`})]})]}),(0,R.jsx)(`clipPath`,{id:`${o}-silhouette`,children:(0,R.jsx)(`path`,{d:qJ})}),(0,R.jsx)(`pattern`,{id:`${o}-hologram`,width:`4`,height:`3`,patternUnits:`userSpaceOnUse`,children:(0,R.jsx)(`path`,{d:`M0 1.5H4`,stroke:`var(--rainbow-5)`,strokeWidth:`0.4`,opacity:`0.4`})})]}),(0,R.jsx)(`ellipse`,{cx:`32`,cy:`63`,rx:a?14:19,ry:`2.5`,className:`fill-primary/10`}),a?(0,R.jsx)(B.circle,{"data-brain-halo":!0,cx:`32`,cy:`32`,r:`33`,fill:`url(#${o}-halo)`,initial:!1,animate:{opacity:n?.8:[.65,1,.65]},transition:{duration:n?0:3,repeat:n?0:1/0}}):null,(0,R.jsxs)(B.g,{"data-brain-body":!0,initial:!1,animate:{y:a?n?-5:[-5,-7,-5]:0},transition:{duration:n?0:a?3:.3,repeat:a&&!n?1/0:0,ease:`easeInOut`},stroke:`url(#${o}-ink)`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,filter:a?`url(#${o}-glow)`:void 0,children:[a?[`cyan`,`magenta`].map(e=>(0,R.jsx)(`use`,{href:`#${o}-shape`,"data-brain-phase":e,className:`brain-phase-echo`,stroke:`currentColor`},e)):null,(0,R.jsxs)(`g`,{id:`${o}-shape`,"data-brain-shape":!0,className:`brain-shape`,children:[(0,R.jsx)(`path`,{d:`M30 49 L30 56 Q32 59 35 57 L35 51`,className:`fill-primary/15`}),(0,R.jsx)(`path`,{d:r<=3?JJ:qJ,className:r===0?`fill-muted`:r<=3?`fill-primary/15`:`fill-primary/10`}),(0,R.jsx)(`path`,{d:`M32 17 C29 24 34 28 32 34 C30 40 34 45 32 50`,fill:`none`,opacity:r===0?.35:.8}),[!1,!0].map(e=>(0,R.jsx)(`g`,{transform:e?`translate(64 0) scale(-1 1)`:void 0,fill:`none`,children:YJ.slice(0,i).map((e,t)=>(0,R.jsx)(B.path,{"data-brain-fold":!0,d:e,initial:!n&&{opacity:0,pathLength:0},animate:{opacity:.85,pathLength:1},transition:{duration:n?0:.3,delay:n?0:t*.025}},e))},String(e))),r>0&&r<5?(0,R.jsx)(`g`,{stroke:`none`,fill:`var(--primary)`,children:[[20,27],[43,36],[25,44]].slice(0,Math.min(r,3)).map(([e,t],n)=>(0,R.jsx)(`circle`,{cx:e,cy:t,r:`1.4`,className:`brain-spark`,style:{animationDelay:`${n*-.7}s`}},e))}):null,r>=5?(0,R.jsx)(`g`,{clipPath:`url(#${o}-silhouette)`,stroke:`none`,children:(0,R.jsx)(`rect`,{"data-brain-shimmer":!0,className:`brain-shimmer`,x:`-24`,y:`10`,width:`18`,height:`48`,fill:`url(#${o}-shine)`})}):null]}),a?(0,R.jsxs)(`g`,{clipPath:`url(#${o}-silhouette)`,stroke:`none`,children:[(0,R.jsx)(`path`,{d:qJ,fill:`url(#${o}-hologram)`}),(0,R.jsx)(`rect`,{"data-brain-scan":!0,className:`brain-phase-scan`,x:`7`,y:`14`,width:`50`,height:`2`,fill:`var(--rainbow-5)`,opacity:`0.45`})]}):null]}),a?(0,R.jsx)(`g`,{fill:`url(#${o}-ink)`,children:[[8,14],[56,12],[5,49],[58,46]].map(([e,t])=>(0,R.jsx)(`path`,{d:`M0 -3 L0.8 -0.8 L3 0 L0.8 0.8 L0 3 L-0.8 0.8 L-3 0 L-0.8 -0.8Z`,transform:`translate(${e} ${t})`},e))}):null]})}function ZJ(e,t,n,r){let i=Math.max(t.length-1,1);if(e===`ArrowRight`||e===`ArrowUp`)return iY(t,n,r,1);if(e===`ArrowLeft`||e===`ArrowDown`)return iY(t,n,r,-1);if(e===`Home`)return rY(t,n,0);if(e===`End`)return rY(t,n,i)}function QJ(e,t,n,r,i){let a=e.current?.getBoundingClientRect();if(!a||a.width===0)return i;let o=Math.min(1,Math.max(0,(t-a.left)/a.width));return rY(n,r,Math.round(o*Math.max(n.length-1,1)))}function $J(e){let[t,n]=(0,m.useState)(),r=(0,m.useRef)(void 0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{r.current=void 0,i.current=0,n(void 0)},[]);return(0,m.useEffect)(()=>{if(t===void 0)return;let e=window.setTimeout(a,1e4);return()=>window.clearTimeout(e)},[t,a]),{chosenByKey:t,intended:r,choose:(t,o)=>{r.current=t,n(t),i.current+=1,Promise.resolve(e(o)).catch(()=>void 0).then(()=>{--i.current,i.current<=0&&a()})}}}function eY({levels:e,supported:t,value:n,disabled:r,onChange:i}){let a=(0,m.useRef)(null),[o,s]=(0,m.useState)(),c=$J(i),l=rY(e,t,Math.max(0,e.indexOf(n))),u=o??c.chosenByKey??l,d=n=>QJ(a,n,e,t,l);function f(e){r||t.length===0||(e.currentTarget.setPointerCapture(e.pointerId),s(d(e.clientX)))}function p(e){if(o===void 0)return;let t=d(e.clientX);t!==o&&s(t)}function h(){if(o===void 0)return;let t=e[o];s(void 0),t&&t!==n&&i(t)}function g(n){if(r||u<0)return;let i=c.intended.current??u,a=ZJ(n.key,e,t,i);if(a===void 0)return;n.preventDefault();let o=e[a];o&&a!==i&&c.choose(a,o)}return{track:a,shown:u,dragging:o!==void 0,handlers:{onPointerDown:f,onPointerMove:p,onPointerUp:h,onPointerCancel:()=>s(void 0),onKeyDown:g}}}var tY={off:`No extra reasoning: the quickest, cheapest answer.`,minimal:`A moment of reasoning, barely.`,low:`Light reasoning for simple work.`,medium:`Balanced reasoning for most work.`,high:`Careful reasoning: slower, better on hard problems.`,xhigh:`Very deep reasoning: slow and costly.`,max:`As deep as the model goes.`},nY=[{left:8,top:30,delay:0},{left:19,top:65,delay:.5},{left:31,top:25,delay:1.1},{left:44,top:70,delay:.2},{left:56,top:35,delay:.8},{left:67,top:60,delay:1.4},{left:78,top:28,delay:.35},{left:90,top:62,delay:.95}];function rY(e,t,n){let r=-1;for(let i=0;i<e.length;i+=1)t.includes(e[i])&&(r<0||Math.abs(i-n)<Math.abs(r-n))&&(r=i);return r}function iY(e,t,n,r){for(let i=n+r;i>=0&&i<e.length;i+=r)if(t.includes(e[i]))return i;return n}function aY(e,t){let[n,r]=(0,m.useState)(e);return(0,m.useEffect)(()=>{if(n===e)return;if(t||n<0||e<0){r(e);return}let i=window.setTimeout(()=>r(t=>t+Math.sign(e-t)),70);return()=>window.clearTimeout(i)},[n,e,t]),n}function oY({level:e,direction:t,className:n,plain:r}){return(0,R.jsx)(`span`,{className:`relative inline-grid overflow-hidden align-bottom`,children:(0,R.jsx)(Du,{mode:`popLayout`,initial:!1,custom:t,children:(0,R.jsx)(B.span,{"data-level":e,className:q(!r&&`effort-word`,`col-start-1 row-start-1 capitalize`,n),custom:t,variants:{enter:e=>({y:e>=0?`70%`:`-70%`,opacity:0}),center:{y:0,opacity:1},exit:e=>({y:e>=0?`-70%`:`70%`,opacity:0})},initial:`enter`,animate:`center`,exit:`exit`,transition:{duration:.13,ease:`easeOut`},children:e},e)})})}function sY({text:e}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`About effort`,className:`grid size-5 shrink-0 place-items-center rounded-full text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:(0,R.jsx)(sm,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,R.jsxs)(Tj,{className:`max-w-56`,children:[e,` Higher effort thinks longer: smarter answers, more time and tokens.`]})]})}function cY({value:e,levels:t,supported:n,recommended:r,model:i,label:a,disabled:o,onChange:s}){let c=xf()??!1,l=eY({levels:t,supported:n,value:e,disabled:o,onChange:s}),{shown:u,dragging:d}=l,f=aY(u,d||c),[p,h]=(0,m.useState)(1),[g,_]=(0,m.useState)(f),[v,y]=(0,m.useState)(!1);f!==g&&(h(Math.sign(f-g)||1),_(f),y(!0));let[b,x]=(0,m.useState)(!1),S=Math.max(t.length-1,1),C=f<0?0:f/S*100,w=t[u]??e,T=t[f]??w,E=Math.max(0,f)/S,D=u>=0&&w!==e,O=r?rY(t,n,Math.max(0,t.indexOf(r))):-1,k=!c&&f>=t.indexOf(`xhigh`)&&t.includes(`xhigh`);return(0,R.jsxs)(`div`,{className:q(`flex min-w-0 flex-col items-center gap-3 min-[360px]:flex-row`,o&&`opacity-60`),children:[(0,R.jsx)(XJ,{level:T}),(0,R.jsxs)(`div`,{className:`flex w-full min-w-0 flex-1 flex-col gap-1.5`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2 text-sm`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`Effort`}),(0,R.jsx)(oY,{level:T,direction:p,className:`font-semibold`})]}),(0,R.jsx)(sY,{text:tY[T]??``})]}),(0,R.jsxs)(`div`,{className:`flex justify-between text-xs text-muted-foreground`,"aria-hidden":`true`,children:[(0,R.jsx)(`span`,{children:`Faster`}),(0,R.jsx)(`span`,{children:`Smarter`})]}),(0,R.jsxs)(`div`,{ref:l.track,role:`slider`,tabIndex:o?-1:0,"aria-label":a,"aria-valuemin":0,"aria-valuemax":t.length-1,"aria-valuenow":Math.max(u,0),"aria-valuetext":w,"aria-disabled":o||void 0,...l.handlers,onFocus:()=>x(!0),onBlur:()=>x(!1),"data-slot":`effort-track`,"data-passing":T,className:`group/effort relative mx-3.5 h-7 touch-none cursor-pointer rounded-full outline-none select-none`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`absolute inset-x-[-0.875rem] top-1/2 h-2 -translate-y-1/2 rounded-full bg-[var(--effort-track)] group-focus-visible/effort:ring-3 group-focus-visible/effort:ring-ring/40`}),(0,R.jsx)(B.span,{"aria-hidden":`true`,"data-slot":`effort-fill`,"data-level":T,className:`effort-fill absolute inset-x-[-0.875rem] top-1/2 h-2 -translate-y-1/2 overflow-hidden rounded-full`,style:{clipPath:`inset(0 calc(0.875rem + (1 - var(--effort-p)) * (100% - 1.75rem)) 0 0 round 999px)`},initial:!1,animate:{"--effort-p":C/100,filter:`saturate(${.75+E*.5})`},transition:d||c?{duration:0}:{type:`spring`,stiffness:420,damping:34},children:k?nY.map(e=>(0,R.jsx)(`span`,{className:`effort-spark absolute size-[3px] rounded-full bg-white`,style:{left:`${e.left}%`,top:`${e.top}%`,animationDelay:`${e.delay}s`}},e.left)):null}),t.map((e,t)=>{let r=n.includes(e);return(0,R.jsx)(`span`,{"aria-hidden":`true`,"data-stop":e,title:r?e:`${i??`This model`} does not support ${e}`,className:q(`absolute top-1/2 size-1 -translate-x-1/2 -translate-y-1/2 rounded-full transition-colors duration-150`,r?t<=f?`bg-white/85`:`bg-muted-foreground/45`:`bg-transparent ring-1 ring-muted-foreground/35`),style:{left:`${t/S*100}%`}},e)}),f>=0&&v&&!c?(0,R.jsx)(B.span,{"aria-hidden":`true`,"data-slot":`effort-ping`,className:`pointer-events-none absolute top-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full ring-2 ring-[var(--effort-ping)]`,style:{left:`${C}%`},initial:{scale:.6,opacity:.9},animate:{scale:3,opacity:0},transition:{duration:.45,ease:`easeOut`}},`ping-${f}`):null,(0,R.jsxs)(B.span,{"aria-hidden":`true`,"data-slot":`effort-thumb`,className:`absolute top-1/2 z-10 -translate-x-1/2 -translate-y-1/2`,initial:!1,animate:{left:`${C}%`},transition:d||c?{duration:0}:{type:`spring`,stiffness:520,damping:30},children:[(0,R.jsx)(B.span,{className:`effort-thumb block h-[1.125rem] w-7 rounded-full`,"data-level":T,animate:{scale:d?1.12:1,scaleX:d?1.18:1},transition:{type:`spring`,stiffness:600,damping:26}}),(0,R.jsx)(`span`,{"data-slot":`effort-bubble`,className:q(`pointer-events-none absolute bottom-[calc(100%+0.5rem)] rounded-md bg-foreground px-2 py-0.5 text-[0.7rem] font-semibold whitespace-nowrap text-background shadow-md transition-[opacity,translate] duration-150`,`after:absolute after:top-full after:border-4 after:border-transparent after:border-t-foreground`,f<=0?`left-0 after:left-3`:f>=S?`right-0 after:right-3`:`left-1/2 -translate-x-1/2 after:left-1/2 after:-translate-x-1/2`,d||b?`translate-y-0 opacity-100`:`translate-y-1 opacity-0 group-hover/effort:translate-y-0 group-hover/effort:opacity-100`),children:(0,R.jsx)(oY,{level:T,direction:p,className:`text-background`,plain:!0})})]})]}),(0,R.jsx)(`div`,{className:`relative mx-3.5 h-4 text-[0.7rem]`,"aria-hidden":`true`,children:O>=0?(0,R.jsx)(`span`,{"data-slot":`effort-recommended`,className:q(`absolute whitespace-nowrap transition-colors duration-150`,O===0?`left-[-0.875rem]`:O===S?`right-[-0.875rem]`:`-translate-x-1/2`,f===O?`font-medium text-foreground`:`text-muted-foreground`),style:O===0||O===S?void 0:{left:`${O/S*100}%`},children:`Recommended`}):null}),D?(0,R.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,i??`this model`,`, so it runs at `,w,`.`]}):null]})]})}function lY(e){return(0,R.jsx)(hD,{...e})}function uY(e){return(0,R.jsx)(gD,{"data-slot":`popover-trigger`,...e})}function dY({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,R.jsx)(_D,{children:(0,R.jsx)(vD,{"data-slot":`popover-content`,align:t,sideOffset:n,className:q(`reui-menu z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-xl border p-1 outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 motion-reduce:animate-none`,e),...r})})}function fY(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function pY({value:e,options:t,onChange:n,label:r,className:i,disabled:a}){let[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),[u,d]=(0,m.useState)(0),f=(0,m.useRef)(null),p=(0,m.useId)(),h=(0,m.useMemo)(()=>t.filter(e=>fY(e,c)),[t,c]),g=t.find(t=>t.value===e);(0,m.useEffect)(()=>{o&&(l(``),d(Math.max(0,t.findIndex(t=>t.value===e))))},[o]),(0,m.useEffect)(()=>{c&&d(0)},[c]),(0,m.useEffect)(()=>{f.current?.querySelector(`[data-index="${u}"]`)?.scrollIntoView({block:`nearest`})},[u,o,h.length]);function _(t){t&&(s(!1),t.value!==e&&n(t.value))}function v(e){e.key===`ArrowDown`?(e.preventDefault(),d(e=>Math.min(h.length-1,e+1))):e.key===`ArrowUp`?(e.preventDefault(),d(e=>Math.max(0,e-1))):e.key===`Home`&&!c?(e.preventDefault(),d(0)):e.key===`End`&&!c?(e.preventDefault(),d(Math.max(0,h.length-1))):e.key===`Tab`?s(!1):e.key===`Enter`&&!e.nativeEvent.isComposing&&(e.preventDefault(),_(h[u]))}return(0,R.jsxs)(lY,{open:o,onOpenChange:s,children:[(0,R.jsxs)(uY,{type:`button`,role:`combobox`,"aria-label":r,"aria-keyshortcuts":`Enter Space ArrowDown ArrowUp`,"aria-description":`When focused, press Enter, Space or an arrow key to choose. Type to search.`,"aria-expanded":o,"aria-haspopup":`listbox`,"aria-controls":o?p:void 0,disabled:a,onKeyDown:e=>{(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),s(!0))},"data-slot":`select-trigger`,className:q(`reui-select flex h-8 w-full min-w-0 items-center justify-between gap-2 overflow-hidden rounded-lg border bg-card px-2.5 text-[0.8125rem] whitespace-nowrap outline-none transition-[border-color,box-shadow] duration-150 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50`,i),children:[(0,R.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(dY,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`p-0 flex max-h-[min(20rem,var(--radix-popover-content-available-height))] w-[max(var(--radix-popover-trigger-width),17rem)] max-w-(--radix-popover-content-available-width) flex-col overflow-hidden rounded-lg outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,R.jsx)(rg,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,R.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:v,role:`searchbox`,"aria-label":`Search ${r}`,"aria-controls":p,"aria-activedescendant":h[u]?`${p}-${u}`:void 0,placeholder:`Search…`,autoComplete:`off`,spellCheck:!1,className:`h-8 min-w-0 flex-1 bg-transparent text-[0.8125rem] outline-none placeholder:text-muted-foreground`})]}),(0,R.jsxs)(`div`,{ref:f,id:p,role:`listbox`,"aria-label":r,className:`min-h-0 flex-1 overflow-y-auto p-1`,children:[h.length===0?(0,R.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,R.jsxs)(`div`,{id:`${p}-${n}`,role:`option`,"aria-selected":t.value===e,"data-index":n,onPointerMove:()=>d(n),onClick:()=>_(t),className:q(`flex cursor-default items-center gap-2 rounded-lg px-2.5 py-1.5 text-[0.8125rem] select-none`,n===u&&`bg-accent`),children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,R.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})]})}function mY({label:e,help:t,children:n,stacked:r}){return(0,R.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 md:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] md:items-center md:gap-6`,children:[(0,R.jsxs)(`div`,{className:`min-w-0 break-words`,children:[(0,R.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,R.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,R.jsx)(`div`,{className:`min-w-0`,children:n})]})}function hY({children:e}){return(0,R.jsx)(iq,{dense:!0,children:(0,R.jsx)(aq,{className:`flex flex-col divide-y divide-border py-0 [&>*]:py-3`,children:e})})}function gY({value:e,items:t,label:n,onChange:r}){return(0,R.jsx)(pY,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r,className:`max-md:h-auto max-md:min-h-11 max-md:items-start max-md:py-2 max-md:[&>span:first-child]:overflow-visible max-md:[&>span:first-child]:text-clip max-md:[&>span:first-child]:whitespace-normal max-md:[&>span:first-child]:break-words`})}var _Y=`(prefers-color-scheme: dark)`,vY=[`dark`,`light`,`system`],yY=m.createContext(void 0);function bY(e){return e!==null&&vY.includes(e)}function xY(){return window.matchMedia(_Y).matches?`dark`:`light`}function SY(){let e=document.createElement(`style`);return e.appendChild(document.createTextNode(`*,*::before,*::after{-webkit-transition:none!important;transition:none!important}`)),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.remove()})})}}function CY(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function wY({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return bY(e)?e:t}),s=m.useCallback(e=>{localStorage.setItem(n,e),o(e)},[n]),c=m.useCallback(e=>{let t=document.documentElement,n=e===`system`?xY():e,i=r?SY():null;t.classList.remove(`light`,`dark`),t.classList.add(n),i&&i()},[r]);m.useEffect(()=>{if(c(a),a!==`system`)return;let e=window.matchMedia(_Y),t=()=>{c(`system`)};return e.addEventListener(`change`,t),()=>{e.removeEventListener(`change`,t)}},[a,c]),m.useEffect(()=>{let e=e=>{e.repeat||e.metaKey||e.ctrlKey||e.altKey||CY(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:xY()===`dark`?`light`:`dark`;return localStorage.setItem(n,t),t})};return window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`keydown`,e)}},[n]),m.useEffect(()=>{let e=e=>{if(e.storageArea===localStorage&&e.key===n){if(bY(e.newValue)){o(e.newValue);return}o(t)}};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}},[t,n]);let l=m.useMemo(()=>({theme:a,setTheme:s}),[a,s]);return(0,R.jsx)(yY.Provider,{...i,value:l,children:e})}var TY=()=>{let e=m.useContext(yY);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},EY=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],DY={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},OY={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},kY=`inherit`,AY=`inherit`,jY=`Use the session's current model`,MY=`__custom__`,NY=`custom…`,PY=`Type a provider/model id`,FY={master:`high`,designer:`medium`,backend:`medium`,qa:`medium`,scout:`low`,researcher:`low`,quickfix:`low`,planner:`high`},IY=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],LY={agents:`Agents`,workflow:`Workflow`,lint:`Linting`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},RY=[{id:`startOn`,label:`On when pi starts`,help:`off: pi starts as plain pi, and ctrl+shift+m or /bot-lobby on turns bot-lobby on (a session that owns a task under way always starts on)`},{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],zY=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity steps in the conversation`},{id:`thinking`,label:`Thinking bubble`}],BY=`shown on the Lobby tab`,VY=`Planning rounds`,HY=`how many rounds the panel gets before the oracle settles the rest alone`,UY=[2,3,5,8,0],WY=`Split long plans`,GY=`saving a plan with more steps offers to split it into up to 5 tasks`,KY=[6,8,10,12,0],qY=`Port`,JY=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,YY=`Open browser`,XY=`open this page in the browser when pi starts`,ZY=[{id:`off`,label:`off`,help:`tasks work in the folder you started them in`},{id:`branch`,label:`branch`,help:`each new task gets a git branch named after it, checked out in the working folder`},{id:`worktree`,label:`worktree`,help:`each new task gets its own worktree and branch, named after it: every agent runs there, apart from your checkout`}],QY=`Git isolation`,$Y=[{id:`off`,label:`off`,help:`agents' work is never linted`},{id:`advise`,label:`advise`,help:`the oracle and QA are told what the project's linter finds on the lines a task changed; nothing is held`},{id:`block`,label:`block`,help:`new lint errors also hold a task's completion until they are fixed, or you accept the work as it is`}],eX={intro:`After every worker step, before QA and at completion, bot-lobby lints only the files the task's agents touched. Problems on the lines the task changed are the task's; anything already there is shown but never holds it. Suppressions and lint-config changes the task adds go to QA to judge.`,mode:`Lint gate`,command:`Command`,commandHelp:`empty runs the linters the project configures (ESLint, Biome, Oxlint, Ruff), each from its own folder; a command runs without a shell from the repository's top, with {files} standing for the touched files`,commandPlaceholder:`found from the project`,extensions:`File types`,extensionsHelp:`which touched files the command is given, such as .ts .tsx .py`,extensionsPlaceholder:`every touched file`,timeout:`Time limit`,timeoutHelp:`for one linter run; one that runs over reads as could not run, and holds nothing`,found:`Found in this project`,foundHelp:`config files in the project and the folders a few levels below it`,foundNone:`No linter config found. Add one to the project, or set a command above.`,foundReplaced:`The command replaces these.`,installed:`installed`,missing:`not installed`,missingHelp:`install the project's dependencies there, or lint cannot run`,top:`project root`},tX=[{id:`auto`,label:`Auto (OpenCode's free Jev, else TypeSafe)`},{id:`opencode`,label:`OpenCode Zen`},{id:`typesafe`,label:`TypeSafe`},{id:`openrouter`,label:`OpenRouter`},{id:`vercel`,label:`Vercel AI Gateway`}],nX=[{id:`seats`,label:`Planning seats`,help:`each round, only the seats your idea or latest answers touch sit; 1-4 in the Plan tab pins one`},{id:`answers`,label:`Obvious answers`,help:`a panel question whose recommended option the conversation already makes clearly right is answered for you (listed under Assumptions)`},{id:`triage`,label:`Task triage`,help:`a new task's size, domains and research need reach the Master as hints; a quick fix that is really a task is held for you`},{id:`effort`,label:`Effort routing`,help:`a simple step runs one thinking level lower, a trivial one on the cheaper model below; a routed run that falls short runs again on your settings`},{id:`qa`,label:`QA risk`,help:`once a task's work is in, the classifier reads the diff and sizes QA to it: no QA agent for a change with nothing that runs, a light check for a small one, deep review where a defect would spread; with it off the engine's rules decide`},{id:`review`,label:`Pull request read`,help:`the Git tab's quick read of a pull request: its size, and how likely it is risky, security-relevant, breaking or untested, before an agent reviews it`},{id:`knowledge`,label:`Relevant knowledge`,help:`when an agent's knowledge, standards or decisions file is too long for its prompt, the classifier picks the sections that bear on the step, and the agent is told where the rest is`},{id:`scripts`,label:`Shared scripts`,help:`the classifier matches each step to the shared scripts that do part of it, and the agent is told to run them instead of redoing the work`},{id:`files`,label:`File hints`,help:`scouts, workers, quick fixes and the planning panel start with the files most likely needed, and can look more up with find_relevant_files`}],rX={enabled:`Classifier`,enabledHelp:`a fast model makes the obvious decisions so large models spend fewer tokens on them`,engine:`Answered by`,engineHelp:`Jev, another classifier model, or any chat model your pi logins offer (OpenAI, Anthropic, Google, …); a small, fast one works best`,engineJev:`Jev on a host`,engineJevHelp:`TypeSafe's classifier, on the host below`,engineClassifier:`classifier model`,engineChat:`chat model, answers as JSON`,host:`Host`,model:`Model`,modelHelp:`empty uses the host's default`,key:`API key`,keyNote:`the key pi already holds for this host; it is never read by this page`,cheap:`Cheaper model`,cheapNone:`none: trivial steps keep their model and drop a thinking level`,cheapHelp:`what effort routing runs trivial steps on`},iX={title:`Settings`,intro:`Each agent's model and effort, the workflow and its lint gate, the lobby and the classifier. Changes save as you make them.`,loading:`Loading settings…`,loadFailed:`Could not load settings.`,saved:`Settings saved`,saving:`Saving…`,appearanceHelp:`Light, dark, or follow your system. Kept in this browser only.`,themeLabel:`Mode`,themeItems:[{id:`light`,label:`Light`},{id:`dark`,label:`Dark`},{id:`system`,label:`System`}],notificationsLabel:`Browser notifications`,notificationsHelp:`While this page is hidden, tell me when a question waits, a task finishes or a background session asks something.`,notificationsBlocked:`Notifications are blocked in your browser. Allow them for this site and try again.`,notificationsUnsupported:`This browser does not offer notifications.`,notificationsOn:`Browser notifications are on.`,notificationsOff:`Browser notifications are off.`,installLabel:`Install bot-lobby`,installHelp:`Opens in its own fullscreen window, with the shell cached so it starts when Pi is not running.`,installButton:`Install as fullscreen app`,installUnavailable:`Your browser has not offered to install it. Use its menu: “Install app” (Chrome, Edge) or Share, then “Add to Home Screen” (Safari).`,installDone:`bot-lobby is installed.`,installedNow:`Running as an installed app.`,fullscreenLabel:`Fullscreen`,fullscreenHelp:`Hide the browser's own bars for this tab (F11 does the same).`,fullscreenOn:`Exit fullscreen`,fullscreenOff:`Go fullscreen`},aX=`https://tweakcn.com/editor/theme`;function oX(){let{theme:e}=TY();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function sX({palette:e,dark:t}){let n=se(e,t);return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`flex h-9 items-center gap-1.5 rounded-lg border border-border px-2`,style:{background:n.background},children:[(0,R.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,R.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,R.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function cX(){let e=Ue(),t=oX(),n=(0,m.useRef)(null);function r(t){let r=t.key===`ArrowRight`||t.key===`ArrowDown`?1:t.key===`ArrowLeft`||t.key===`ArrowUp`?-1:0;if(!r)return;t.preventDefault(),t.stopPropagation();let i=Math.max(0,e.all.findIndex(t=>t.id===e.active.id)),a=e.all[(i+r+e.all.length)%e.all.length];e.choose(a.id),window.requestAnimationFrame(()=>n.current?.querySelector(`[data-theme-id="${a.id}"]`)?.focus())}return(0,R.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 md:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"aria-checked":r,"data-theme-id":n.id,tabIndex:r?0:-1,onClick:()=>e.choose(n.id),className:q(`grid gap-1.5 rounded-lg border p-2 text-left outline-none transition-[border-color,box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40`,r?`border-primary bg-accent shadow-[0_0_0_1px_var(--primary)]`:`border-border hover:bg-accent/50`),children:[(0,R.jsx)(sX,{palette:n,dark:t}),(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,R.jsxs)(`span`,{className:`truncate max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:[n.name,e.isSaved(n.id)?(0,R.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`saved`}):null]}),r?(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function lX({entry:e}){let t=Ue(),[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(e.name),[o,s]=(0,m.useState)();async function c(){let n=i.trim();if(!n||n===e.name)return r(!1);try{await t.rename(e.id,n),r(!1),s(void 0),H.success(`Renamed to ${n}.`)}catch(e){s(e.message)}}return(0,R.jsxs)(`li`,{className:`flex min-h-10 flex-wrap items-center gap-2 py-1.5`,children:[n?(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-1 items-center gap-1 max-md:flex-wrap`,onSubmit:e=>{e.preventDefault(),c()},children:[(0,R.jsx)(Uq,{autoFocus:!0,value:i,maxLength:40,"aria-label":`New name for ${e.name}`,"aria-invalid":o?!0:void 0,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Escape`&&(t.preventDefault(),t.stopPropagation(),a(e.name),r(!1))},className:`h-8 max-w-64 max-md:h-11 max-md:min-h-11 max-md:min-w-0 max-md:flex-1`}),(0,R.jsx)(X,{label:`Save the name`,text:`Save`,icon:zp,tone:`primary`,type:`submit`,disabled:!i.trim()}),(0,R.jsx)(X,{label:`Keep the old name`,icon:Vg,iconOnly:!0,onClick:()=>{a(e.name),r(!1)}})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm font-medium max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:e.name}),(0,R.jsx)(X,{label:`Rename ${e.name}`,text:`Rename`,icon:zh,onClick:()=>{a(e.name),r(!0)}}),(0,R.jsx)(SM,{label:`Remove ${e.name}`,text:`Remove`,title:`Remove ${e.name}?`,description:`It is removed for every pi session. Keep a copy of its CSS if you want to use it again.`,confirmLabel:`Remove theme`,icon:Cg,variant:`destructive`,onConfirm:()=>void t.remove(e.id).catch(e=>H.error(e.message))})]}),o?(0,R.jsx)(`p`,{role:`alert`,className:`w-full text-xs text-destructive`,children:o}):null]})}function uX(){let e=Ue();return e.saved.length===0?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No saved themes yet. Import one below and give it a name.`}):(0,R.jsx)(`ul`,{"aria-label":`Saved themes`,className:`divide-y divide-border`,children:e.saved.map(e=>(0,R.jsx)(lX,{entry:e},e.id))})}function dX(){let e=Ue(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)(),[s,c]=(0,m.useState)(!1),l=(0,m.useRef)(null);async function u(t,a){let s=ee(t);if(`error`in s){o(s.error);return}o(void 0),c(!0);try{let t=await e.adopt(s,r.trim()||s.name||a);n(``),i(``);let o=s.light?s.dark?void 0:`dark`:`light`;H.success(o?`${t.name} saved and applied. It has no ${o} colours, so ${o} mode keeps the default ones.`:`${t.name} saved and applied.`)}catch(e){o(e.message)}finally{c(!1)}}async function d(e){if(e){if(e.size>2e5){o(`That file is too large to be a theme.`);return}await u(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,R.jsxs)(`div`,{className:`grid gap-2`,children:[(0,R.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,R.jsxs)(`a`,{href:aX,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,R.jsx)(Tm,{"aria-hidden":`true`,className:`size-3`})]}),`, press Code, copy it, and paste it here, or save it as a file and upload that. Colours and fonts are used; corners stay the page's own.`]}),(0,R.jsxs)(`label`,{className:`grid gap-1 text-xs text-muted-foreground`,children:[`Name`,(0,R.jsx)(Uq,{value:r,maxLength:40,placeholder:`the theme's own name, or the file's`,onChange:e=>i(e.target.value),className:`h-8 max-w-80 text-foreground max-md:h-11 max-md:min-h-11`})]}),(0,R.jsx)(sM,{value:t,onChange:e=>{n(e.target.value),o(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":a?!0:void 0,placeholder:`:root {
92
92
  --background: oklch(0.98 0 0);
93
93
  --primary: oklch(0.55 0.2 260);
94
94
  …
95
95
  }
96
- .dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 max-md:flex-wrap`,children:[(0,R.jsx)(`input`,{ref:l,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{d(e.target.files?.[0]),e.target.value=``}}),(0,R.jsx)(X,{label:`Save and apply the pasted theme`,text:`Save theme`,icon:Vp,tone:`primary`,disabled:!t.trim()||s,onClick:()=>void u(t,`Custom theme`)}),(0,R.jsx)(X,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:kg,disabled:s,onClick:()=>l.current?.click()}),a?(0,R.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive max-md:ml-0 max-md:basis-full`,children:a}):null]})]})}function iX(){let{theme:e,setTheme:t}=vY(),n=xJ();return(0,R.jsx)(qH,{prominent:!0,title:kY.appearance,children:(0,R.jsxs)(cY,{children:[(0,R.jsx)(sY,{label:`Prompt sounds`,help:`A droplet for each new actionable prompt or delivery review. Kept in this browser; sound starts after interaction. Desktop notifications remain separate.`,children:(0,R.jsx)(GJ,{checked:!n,onCheckedChange:e=>yJ(!e),"aria-label":`Prompt sounds`})}),(0,R.jsx)(sY,{label:XY.themeLabel,help:XY.appearanceHelp,children:(0,R.jsx)(lY,{value:e,items:XY.themeItems.map(e=>({value:e.id,label:e.label})),label:XY.themeLabel,onChange:e=>t(e)})}),(0,R.jsx)(sY,{label:`Colour theme`,help:`The page's colours, the same in every pi session.`,stacked:!0,children:(0,R.jsx)(eX,{})}),(0,R.jsx)(sY,{label:`Saved themes`,help:`Themes you imported, kept with pi for every session and project.`,stacked:!0,children:(0,R.jsx)(nX,{})}),(0,R.jsx)(sY,{label:`Import a theme`,stacked:!0,children:(0,R.jsx)(rX,{})})]})})}var aX={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},oX=[...AY,...jY.map(e=>({id:`panel:${e.id}`,label:e.label,help:MY}))];function sX(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs,mcpTools:e.scout.mcpTools};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function cX(e,t){return aX[e].reduceRight((e,t)=>({[t]:e}),t)}function lX(e,t){return e.find(e=>e.id===t)?.thinkingLevels??OY}function uX(e,t){return OY[$J(OY,e,Math.max(0,OY.indexOf(t)))]??t}var dX=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,fX=e=>e>0?`over ${e} steps`:`never`;function pX({label:e,children:t}){return(0,R.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function mX(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:SY,label:CY,help:wY}]:[],...e.none?[{value:SY,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:SY,label:CY,help:wY}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:DY}]:[],{value:TY,label:EY,help:DY}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(lY,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,R.jsx)(Uq,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,className:`min-w-0 flex-1 max-md:h-11 max-md:min-h-11`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,R.jsx)(X,{label:`Use this model`,icon:Vp,tone:`primary`,onClick:c})]}):null]})}function hX({label:e,help:t,checked:n,onChange:r}){return(0,R.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4 max-md:min-h-11 max-md:items-start`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,R.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,R.jsx)(GJ,{checked:n,onCheckedChange:r,"aria-label":e})]})}function gX({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,R.jsx)(Uq,{value:i,placeholder:n,"aria-label":r,className:`max-md:h-11 max-md:min-h-11`,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function _X({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,R.jsx)(yX,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(H.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function vX({value:e,onSave:t}){return(0,R.jsx)(yX,{label:zY,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(H.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function yX({label:e,value:t,min:n,max:r,suffix:i,onSave:a}){let[o,s]=(0,m.useState)(t);(0,m.useEffect)(()=>s(t),[t]);let c=()=>{o!==t&&(a(o.trim())||s(t))};return(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Uq,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:q(i?`pr-10`:void 0,`max-md:h-11 max-md:min-h-11`),onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:i}):null]})}function bX({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(sM,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function xX({kind:e,config:t,models:n,save:r}){let i=sX(t,e),a=t=>r(cX(e,t)),o=bY[e],s=lX(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!lX(n,t).includes(i.thinking)&&(r.thinking=uX(lX(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:uX(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,R.jsxs)(`section`,{className:q(rq({spacing:`default`}),`glass min-w-0`),children:[(0,R.jsxs)(oq,{className:`flex-row items-baseline justify-between gap-3 py-3 max-md:flex-col max-md:items-start`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold max-md:max-w-full max-md:break-words`,children:o}),(0,R.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground max-md:min-w-0 max-md:max-w-full max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,R.jsxs)(aq,{className:`flex min-w-0 flex-col gap-3`,children:[(0,R.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,R.jsx)(pX,{label:xY.model,children:(0,R.jsx)(mX,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3 max-md:items-start max-md:[&_[role=slider]]:h-11`,children:[e===`scout`?(0,R.jsx)(XJ,{level:l}):null,(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:xY.thinking}),(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,R.jsx)(tY,{value:i.thinking,levels:OY,supported:s,model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,R.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3 max-md:flex-wrap max-md:items-start`,children:[u?(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":d,onClick:()=>f(e=>!e),className:`flex min-h-8 max-w-full items-center gap-1 rounded-md text-left text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 max-md:h-auto max-md:min-h-11`,children:[(0,R.jsx)(qp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),xY.instructions,!d&&i.instructions?(0,R.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,R.jsx)(`span`,{}),e===`master`?null:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 max-md:flex-wrap`,children:[(0,R.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:`Time limit`}),(0,R.jsx)(`div`,{className:`w-24`,children:(0,R.jsx)(_X,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,R.jsx)(bX,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null,(0,R.jsx)(bX,{value:(i.mcpTools??[]).join(`
97
- `),label:`${o} MCP tool grants (one exact tool name per line)`,onSave:e=>a({mcpTools:e.split(/\s+/).filter(Boolean)})}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Grant exact names such as mcp__github__get_issue. Children inherit these grants; read-only agents also require read-only tools.`})]})]})}function SX(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function CX({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,R.jsx)(hX,{label:t.label,help:t.help,checked:SX(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function wX({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,R.jsx)(qH,{prominent:!0,title:kY.workflow,children:(0,R.jsx)(cY,{children:(0,R.jsx)(sY,{label:WY,help:UY.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,R.jsx)(lY,{value:n,items:UY.map(e=>({value:e.id,label:e.label})),label:WY,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}var TX=e=>e?`${e}/`:KY.top;function EX(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function DX({replaced:e}){let t=xj(`settings.linters`,{},[]),n=t.data?.linters;return(0,R.jsx)(sY,{label:KY.found,help:e?KY.foundReplaced:KY.foundHelp,children:n?n.length===0?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:KY.foundNone}):(0,R.jsx)(`ul`,{"aria-label":KY.found,className:q(`flex flex-col gap-1.5 md:items-end`,e&&`opacity-60`),children:n.map(e=>(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.tool}),(0,R.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:TX(e.folder)}),(0,R.jsxs)(`span`,{title:e.installed?void 0:KY.missingHelp,className:q(`inline-flex shrink-0 items-center gap-1 text-xs`,e.installed?`text-success`:`text-warning`),children:[e.installed?(0,R.jsx)(rm,{"aria-hidden":`true`,className:`size-3.5`}):(0,R.jsx)(tm,{"aria-hidden":`true`,className:`size-3.5`}),e.installed?KY.installed:KY.missing]})]},`${e.tool}:${e.folder}`))}):(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:t.error?t.error:`Looking…`})})}function OX({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,R.jsxs)(qH,{prominent:!0,title:kY.lint,children:[(0,R.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:KY.intro}),(0,R.jsxs)(cY,{children:[(0,R.jsx)(sY,{label:KY.mode,help:GY.find(e=>e.id===n.mode)?.help,children:(0,R.jsx)(lY,{value:n.mode,items:GY.map(e=>({value:e.id,label:e.label})),label:KY.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,R.jsxs)(`div`,{className:q(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,R.jsx)(sY,{label:KY.command,help:KY.commandHelp,children:(0,R.jsx)(gX,{value:n.command,label:KY.command,placeholder:KY.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,R.jsx)(sY,{label:KY.extensions,help:KY.extensionsHelp,children:(0,R.jsx)(gX,{value:n.extensions.join(` `),label:KY.extensions,placeholder:KY.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:EX(e)}})})}):null,(0,R.jsx)(sY,{label:KY.timeout,help:KY.timeoutHelp,children:(0,R.jsx)(_X,{value:n.timeoutMs,label:`Lint ${KY.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})}),(0,R.jsx)(DX,{replaced:i})]})]})]})}function kX({config:e,save:t}){let n=e.lobby.web;return(0,R.jsx)(qH,{prominent:!0,title:kY.lobby,children:(0,R.jsxs)(cY,{children:[oX.map(n=>(0,R.jsx)(CX,{config:e,item:n,save:t},n.id)),(0,R.jsx)(sY,{label:NY,help:PY,children:(0,R.jsx)(lY,{value:String(e.lobby.maxPlanningRounds),items:FY.map(e=>({value:String(e),label:dX(e)})),label:NY,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,R.jsx)(sY,{label:IY,help:LY,children:(0,R.jsx)(lY,{value:String(e.lobby.splitPlanAbove),items:RY.map(e=>({value:String(e),label:fX(e)})),label:IY,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,R.jsx)(sY,{label:zY,help:BY,children:(0,R.jsx)(vX,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,R.jsx)(hX,{label:VY,help:HY,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function AX({value:e,models:t,classifiers:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=new Set([...n.map(e=>e.id),...t.map(e=>e.id)]),l=[{value:``,label:YY.engineJev,help:YY.engineJevHelp},...n.map(e=>({value:e.id,label:e.id,help:`${YY.engineClassifier}${e.label===e.id?``:` · ${e.label}`}`})),...t.map(e=>({value:e.id,label:e.id,help:`${YY.engineChat}${e.label&&e.label!==e.id?` · ${e.label}`:``}`})),...e&&!c.has(e)?[{value:e,label:e,help:DY}]:[],{value:TY,label:EY,help:DY}],u=t=>{if(t!==`__custom__`)return r(t);s(c.has(e)?``:e),a(!0)},d=()=>{let t=o.trim();a(!1),t!==e&&r(t)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(lY,{value:e,items:l,label:YY.engine,onChange:u}),i?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,R.jsx)(Uq,{autoFocus:!0,value:o,placeholder:`provider/model`,"aria-label":`Classifier model id`,className:`min-w-0 flex-1 max-md:h-11 max-md:min-h-11`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,R.jsx)(X,{label:`Use this model`,icon:Vp,tone:`primary`,onClick:d})]}):null]})}function jX({config:e,models:t,classifiers:n,save:r}){let i=e.classifier,a=qY.find(e=>e.id===i.provider)?.label,o=!i.engine;return(0,R.jsx)(qH,{prominent:!0,title:kY.classifier,children:(0,R.jsxs)(cY,{children:[(0,R.jsx)(hX,{label:YY.enabled,help:YY.enabledHelp,checked:i.enabled,onChange:e=>void r({classifier:{enabled:e}})}),(0,R.jsx)(sY,{label:YY.engine,help:YY.engineHelp,children:(0,R.jsx)(AX,{value:i.engine,models:t,classifiers:n,onChange:e=>void r({classifier:{engine:e}})})}),o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(sY,{label:YY.host,children:(0,R.jsx)(lY,{value:i.provider,items:qY.map(e=>({value:e.id,label:e.label})),label:YY.host,onChange:e=>void r({classifier:{provider:e}})})}),(0,R.jsx)(sY,{label:YY.model,help:YY.modelHelp,children:(0,R.jsx)(gX,{value:i.model,label:YY.model,placeholder:`the host's default`,onSave:e=>void r({classifier:{model:e}})})}),(0,R.jsx)(sY,{label:YY.key,help:YY.keyNote,children:(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:a??i.provider})})]}):null,JY.map(e=>(0,R.jsx)(hX,{label:e.label,help:e.help,checked:i.features[e.id],onChange:t=>void r({classifier:{features:{[e.id]:t}}})},e.id)),(0,R.jsx)(sY,{label:YY.cheap,help:YY.cheapHelp,children:(0,R.jsx)(mX,{value:i.effort.cheapModel,models:t,label:YY.cheap,none:!0,onChange:e=>void r({classifier:{effort:{cheapModel:e}}})})})]})})}function MX(){let e=MJ(),t=async e=>{if(!e)return PJ();let t=await NJ();t===`granted`?H.success(XY.notificationsOn):H.error(t===`unsupported`?XY.notificationsUnsupported:XY.notificationsBlocked)};return(0,R.jsx)(qH,{prominent:!0,title:kY.notifications,children:(0,R.jsx)(cY,{children:(0,R.jsx)(hX,{label:XY.notificationsLabel,help:XY.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function NX(){let{available:e,install:t}=y(),n=b(),r=x();return(0,R.jsx)(qH,{prominent:!0,title:kY.install,children:(0,R.jsxs)(cY,{children:[(0,R.jsx)(sY,{label:XY.installLabel,help:n?XY.installedNow:XY.installHelp,children:n?null:(0,R.jsx)(`div`,{className:`flex md:justify-end`,children:(0,R.jsx)(X,{label:XY.installButton,icon:Tm,tone:`primary`,onClick:()=>e?void t().then(()=>H.success(XY.installDone)):H.warning(XY.installUnavailable)})})}),r.supported?(0,R.jsx)(sY,{label:XY.fullscreenLabel,help:XY.fullscreenHelp,children:(0,R.jsx)(`div`,{className:`flex md:justify-end`,children:(0,R.jsx)(X,{label:r.on?XY.fullscreenOn:XY.fullscreenOff,icon:r.on?yh:sh,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var PX=[`Agents`,`Workflow`,`Linting`,`Lobby`,`Classifier`,`Appearance & notifications`];function FX({config:e,models:t,classifierModels:n=[],onConfig:r}){let[i,a]=(0,m.useState)(`Agents`),o=(0,m.useRef)(Promise.resolve()),s=e=>{let t=async()=>{try{return r((await Te(`settings.set`,{patch:e})).config),H.success(XY.saved),!0}catch(e){return H.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},n=o.current.then(t,t);return o.current=n,n};return(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock md:px-8 md:pt-8`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:XY.title}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:XY.intro})]}),(0,R.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 min-w-0 flex flex-wrap gap-1 border-b border-border pb-3 max-md:flex-nowrap max-md:overflow-x-auto max-md:overscroll-x-contain max-md:pb-2`,children:PX.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":i===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>a(e),className:q(`h-8 rounded-lg border border-transparent px-3 text-sm font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11 max-md:h-auto max-md:shrink-0 max-md:whitespace-nowrap`,i===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,R.jsx)(`div`,{id:`settings-Agents`,hidden:i!==`Agents`,"aria-hidden":i!==`Agents`,children:(0,R.jsx)(qH,{prominent:!0,title:kY.agents,children:(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:yY.map(n=>(0,R.jsx)(xX,{kind:n,config:e,models:t,save:s},n))})})}),(0,R.jsx)(`div`,{id:`settings-Workflow`,hidden:i!==`Workflow`,"aria-hidden":i!==`Workflow`,children:(0,R.jsx)(wX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Linting`,hidden:i!==`Linting`,"aria-hidden":i!==`Linting`,children:(0,R.jsx)(OX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Lobby`,hidden:i!==`Lobby`,"aria-hidden":i!==`Lobby`,children:(0,R.jsx)(kX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Classifier`,hidden:i!==`Classifier`,"aria-hidden":i!==`Classifier`,children:(0,R.jsx)(jX,{config:e,models:t,classifiers:n,save:s})}),(0,R.jsx)(`div`,{id:`settings-Appearance`,hidden:i!==`Appearance & notifications`,"aria-hidden":i!==`Appearance & notifications`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,R.jsx)(iX,{}),(0,R.jsx)(MX,{}),(0,R.jsx)(NX,{})]})})]})}function IX(){return(0,R.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock md:px-8 md:pt-8`,role:`status`,"aria-label":XY.loading,children:[0,1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function LX(){let e=xj(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,R.jsx)(yj,{message:`${XY.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,R.jsx)(FX,{config:t,models:e.data?.models??[],classifierModels:e.data?.classifierModels??[],onConfig:i}):(0,R.jsx)(IX,{})}function RX(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var zX=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,BX=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style`.split(` `)),VX=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function HX(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>5e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function UX(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function WX(e){if(!BX.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,UX(t.value)):VX.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=UX(e.textContent??``));for(let t of[...e.children])WX(t)}function GX(e,t){try{return KX(e,t??RX())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${zX}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function KX(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])WX(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${zX}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${UX(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function qX({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>GX(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,R.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:q(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,R.jsxs)(`div`,{ref:s,className:q(`group/mock relative h-80 w-full max-w-full overflow-hidden rounded-lg border bg-background max-md:min-h-0 max-md:max-h-full max-md:overflow-x-hidden max-md:overflow-y-auto max-md:overscroll-contain`,n),children:[(0,R.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,tabIndex:a?-1:void 0,className:q(`absolute top-0 left-0 origin-top-left border-0`,a&&`pointer-events-none`),style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,R.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,className:`absolute inset-0 flex items-end justify-end p-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:ring-inset max-md:p-3`,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card/90 px-1.5 py-0.5 text-[0.6875rem] font-medium text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity group-hover/mock:opacity-100 group-focus-within/mock:opacity-100`,children:[(0,R.jsx)(ah,{"aria-hidden":`true`,className:`size-3`}),`Expand`]})}):null]})}var JX=/\s*\(recommended\)\s*$/i,YX=1024,XX=`(max-width: 767.98px)`,ZX=`max-md:hidden`,QX=e=>e.replace(JX,``);function $X(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function eZ({option:e}){let t=QX(e.label);return $X(e)?(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,R.jsx)(qX,{preview:e.htmlPreview,label:t,minWidth:YX,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,R.jsx)(`img`,{src:F(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,R.jsx)(WH,{text:e.preview,className:q(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,R.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function tZ({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=xf(),l=cA(XX),{keyboardOpen:u,keyboardInset:d}=BA(),f=(0,m.useRef)(null),p=(0,m.useRef)(null),[h,g]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),_=e[h],v=e.length-1;(0,m.useEffect)(()=>s?.(h),[h,s]),(0,m.useLayoutEffect)(()=>{let e=f.current;e&&(e.scrollLeft=h*e.clientWidth),p.current?.focus()},[]);let y=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),v),n=f.current;g(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[v,c]);(0,m.useEffect)(()=>{let e=f.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=h*e.clientWidth});return t.observe(e),()=>t.disconnect()},[h]);function b(){let e=f.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==h&&t>=0&&t<=v&&g(t)}function x(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),y(h+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),y(t.key===`Home`?0:v);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),y(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(h))}let S=r.includes(h),C=l&&u?{height:`calc(100vh - ${d}px - 1.5rem)`,maxHeight:`calc(100vh - ${d}px - 1.5rem)`}:void 0;return(0,R.jsxs)(`div`,{ref:p,tabIndex:-1,"data-autofocus":``,onKeyDown:x,style:C,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none max-md:h-[calc(100svh-1.5rem)] max-md:max-h-[calc(100svh-1.5rem)]`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3 sm:px-5`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,title:l?`Back to the question`:`Back · Esc`,onClick:()=>o(h),className:`max-md:size-11`,children:(0,R.jsx)(_h,{"aria-hidden":`true`})}),(0,R.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[h+1,` of `,e.length]}),(0,R.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,R.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===h,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>y(t),className:q(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:h-11 max-md:min-w-11`,t===h?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,R.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,R.jsx)(`span`,{className:`truncate`,children:QX(e.label)}),r.includes(t)?(0,R.jsx)(Vp,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{ref:f,onScroll:b,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,R.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${QX(t.label)}`,"aria-hidden":n!==h,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 overflow-y-hidden px-4 py-4 sm:px-14 max-md:overflow-y-auto max-md:overscroll-contain`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,R.jsx)(`span`,{className:`font-medium`,children:QX(t.label)}),JX.test(t.label)?(0,R.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,R.jsx)(WH,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,R.jsx)(eZ,{option:t})})]},n))}),h>0?(0,R.jsx)(Y,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,title:l?`Previous option`:`Previous · ←`,onClick:()=>y(h-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full max-md:hidden max-md:size-11`,children:(0,R.jsx)(Gp,{"aria-hidden":`true`})}):null,h<v?(0,R.jsx)(Y,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,title:l?`Next option`:`Next · →`,onClick:()=>y(h+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full max-md:hidden max-md:size-11`,children:(0,R.jsx)(qp,{"aria-hidden":`true`})}):null]}),(0,R.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 sm:px-5`,children:[(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`←→`,className:ZX,children:`option`}),a?(0,R.jsx)(iA,{chord:`Enter`,className:ZX,children:i?S?`unpick`:`pick`:`choose`}):null,(0,R.jsx)(iA,{chord:`Esc`,className:ZX,children:`back`})]}),a&&_?(0,R.jsxs)(Y,{type:`button`,onClick:()=>a(h),className:`max-w-full max-md:min-h-11 max-md:min-w-11`,children:[i&&S?`Unpick`:i?`Pick`:`Choose`,(0,R.jsx)(`span`,{className:`truncate`,children:QX(_.label)})]}):null]})]})}function nZ(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function rZ({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,R.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>nZ(e,()=>void d(),()=>{o||r()}),children:[(0,R.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,R.jsx)(sM,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24 max-md:min-h-28`})]}),c?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(Y,{size:`sm`,className:`max-md:min-h-11`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,R.jsx)(Y,{size:`sm`,variant:`ghost`,className:`max-md:min-h-11`,disabled:o,onClick:r,children:`Cancel`})]})]})}var iZ=1200;function aZ({question:e}){let[t,n]=(0,m.useState)(),r=XA(t!==void 0,YA.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{"aria-label":`Mockups`,className:`grid grid-cols-2 gap-2 md:grid-cols-3`,children:i.map(({option:e,index:t,mockup:r})=>(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(qX,{preview:r,label:QX(e.label),frameWidth:iZ,onOpen:()=>n(t),className:`aspect-[3/2] h-auto`}),(0,R.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,QX(e.label)]})]},t))}),(0,R.jsx)(HA,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,R.jsx)(tZ,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function oZ({questions:e}){return(0,R.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised flex min-w-0 flex-col gap-2 rounded-xl border p-3 text-sm`,style:{"--orb":TW(e.from)},children:[(0,R.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,R.jsxs)(`span`,{className:`mt-px inline-flex shrink-0 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--orb)_12%,transparent)] px-2 py-0.5 text-xs font-medium text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,children:[(0,R.jsx)(bW,{source:e.from,className:`size-3`}),SW(e.from)]}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,R.jsx)(`ul`,{"aria-label":`Options`,className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,R.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,R.jsx)(aZ,{question:e})]},t))})}function sZ({message:e}){let t=e.decided??[];return t.length?(0,R.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1.5`,children:t.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-2.5 py-1.5 text-sm`,children:[(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-success`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:q(`font-medium`,CW(e.from)),children:SW(e.from)}),` `,e.question,` → `,(0,R.jsx)(`strong`,{children:e.answer}),(0,R.jsxs)(`span`,{className:`block text-xs text-muted-foreground`,children:[`decided by the classifier (`,e.probability.toFixed(2),`); comment on the plan to overrule`]})]})]},t))}):null}function cZ({message:e,index:t,busy:n,readOnly:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),c=o&&(o.editedAt??0)>(e.editedAt??0)?o:e,l=n||c!==e,u=async n=>{let r=await Te(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});s(r.message)},d=!r&&!e.settled?.length&&!i?(0,R.jsxs)(Y,{size:`xs`,variant:`ghost`,disabled:l,onClick:()=>a(!0),className:`text-muted-foreground max-md:min-h-11 max-md:whitespace-normal`,children:[(0,R.jsx)(Vh,{"aria-hidden":`true`}),`Edit`]}):null;return(0,R.jsx)(jW,{time:e.at>0?lM(e.at):void 0,head:!0,note:c.editedAt?`(edited)`:void 0,below:d,children:i?(0,R.jsx)(rZ,{text:c.text,disabled:n,onSave:u,onCancel:()=>a(!1)}):(0,R.jsx)(WH,{text:c.text})})}function lZ({message:e,index:t,busy:n,readOnly:r}){if(e.role===`you`)return(0,R.jsx)(cZ,{message:e,index:t,busy:n,readOnly:r});let i=e.questions??[];return(0,R.jsxs)(AW,{source:`PLANNER`,name:`Panel`,time:e.at>0?lM(e.at):void 0,head:!0,bubble:i.length===0,aside:i.length?`${i.length} question${i.length===1?``:`s`}`:void 0,children:[i.length>0?(0,R.jsx)(oZ,{questions:i}):(0,R.jsx)(WH,{text:e.text}),(0,R.jsx)(sZ,{message:e})]})}function uZ({messages:e,seed:t,busy:n=!1,readOnly:r=!1}){return(0,R.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,R.jsx)(MW,{children:t}):null,e.map((e,t)=>(0,R.jsx)(lZ,{message:e,index:t,busy:n,readOnly:r},`${e.at}-${t}`)),n?(0,R.jsx)(AW,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,aside:`the panel is thinking`,children:(0,R.jsx)(NW,{className:`mt-1`})}):null]})}var dZ=`ORACLE`,fZ=`No draft yet.`,pZ=`The draft appears after the panel's first round.`,mZ=`What each seat needs`,hZ=[`backend`,`designer`,`qa`,`researcher`],gZ={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},_Z=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,vZ={ORACLE:`Chairs the panel, and settles the last round alone.`,DEV:`Code, data and the APIs it touches.`,DESIGN:`Screens, flows and the words on them.`,QA:`Tests, edge cases and what could break.`,RESEARCH:`Prior art, docs and sources.`},yZ=[{title:`Describe it`,text:`Say what you want in the box below.`},{title:`The panel asks`,text:`Each seat asks what it needs to know.`},{title:`A draft forms`,text:`Answer, comment on lines, go another round.`},{title:`Save the plan`,text:`Keep it, or start it as a task.`}];function bZ(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function xZ(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function SZ(e,t){return`${e} ${t}${e===1?``:`s`}`}function CZ(e){return e.round===0&&e.messages.length===0&&!e.busy}function wZ(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${gZ[t.member]} failed`).split(`
98
- `)[0]}function TZ(e){let t=[],n=wZ(e);return e.busy?t.push(xZ(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${SZ(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(xZ(e.round,e.limit)),!e.busy&&e.limit>0&&e.round+1===e.limit&&t.push(`the next round is the last: the oracle settles the rest`),t}function EZ(e,t){let n=gZ[e],r=t.seats.includes(e),i=t.members.find(t=>t.member===e),a={member:e,label:n,seated:r,working:!1};if(!r)return{...a,text:`off`};if(i?.status===`thinking`)return{...a,working:!0,text:i.step??`thinking`};if(i?.status===`failed`)return{...a,text:`failed — Retry`};if(!i)return{...a,text:`·`};if(i.reply?.status===`ready`)return{...a,text:`ready`};let o=t.questions.filter(e=>e.from===n).length;return{...a,text:o===0?`done`:SZ(o,`question`)}}function DZ(e){let t=e.questions.filter(e=>e.from===dZ).length;return[{label:dZ,seated:!0,working:e.busy,text:e.busy?`chairing`:t?SZ(t,`question`):`·`},...hZ.map(t=>EZ(t,e))]}function OZ(e){let t=!1;return e.split(`
99
- `).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function kZ({notes:e}){return(0,R.jsx)(R.Fragment,{children:e.map((e,t)=>(0,R.jsx)(`p`,{className:`ml-6 rounded-lg border border-primary/15 bg-accent px-3 py-1.5 text-sm text-foreground italic`,children:e},t))})}var AZ=[],jZ=(0,m.memo)(function({row:e,notes:t,onComment:n}){let r=e.text.trim(),i=()=>n(r);return(0,R.jsxs)(`li`,{className:`group/line [contain-intrinsic-size:auto_2.75rem] [content-visibility:auto]`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1`,children:[(0,R.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:t.length>0?(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,R.jsx)(`div`,{className:q(`min-w-0 flex-1 cursor-pointer rounded-lg px-2 py-1.5 transition-colors hover:bg-muted`,e.fenced&&`font-mono text-sm whitespace-pre-wrap break-words`),onClick:e=>!e.target.closest(`a`)&&i(),children:e.fenced?e.text:(0,R.jsx)(WH,{text:e.text})}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground max-md:size-11 opacity-0 transition-opacity group-hover/line:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,"aria-label":`Comment on this line: ${r}`,onClick:i,children:(0,R.jsx)(dh,{"aria-hidden":`true`})})]}),(0,R.jsx)(kZ,{notes:t})]})});function MZ({draft:e,comments:t,onComment:n}){let r=(0,m.useMemo)(()=>OZ(e),[e]),i=FH(r.length);return(0,R.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:r.slice(0,i).map((e,r)=>e.text.trim()?(0,R.jsx)(jZ,{row:e,notes:t.get(e.text.trim())??AZ,onComment:n},r):(0,R.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},r))})}function NZ({notes:e}){return e.length===0?null:(0,R.jsx)(qH,{title:mZ,children:(0,R.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex min-w-0 gap-3 max-md:flex-wrap`,children:[(0,R.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,CW(e.from)),children:SW(e.from)}),(0,R.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(WH,{text:e.text})})]},t))})})}function PZ({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 font-medium`,e.seated?CW(e.label):`text-muted-foreground`),children:[(0,R.jsx)(bW,{source:e.label,className:`size-3.5`}),SW(e.label)]}),e.working&&!t?(0,R.jsx)(pj,{className:`size-3.5`,"aria-hidden":`true`}):null,(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function FZ({cell:e,intro:t,onToggled:n}){let{member:r}=e,i=`inline-flex min-h-8 items-center gap-2 rounded-lg border border-border px-3 text-[0.8125rem] max-md:min-h-11`;if(!r)return(0,R.jsx)(`li`,{className:q(i,`bg-muted`),children:(0,R.jsx)(PZ,{cell:e,intro:t})});let a=async()=>{await U(`planner.toggleSeat`,{member:r})&&n()};return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:q(i,`cursor-pointer transition-colors`,e.seated?`btn-raised bg-card`:`border-dashed text-muted-foreground hover:bg-muted`),children:[(0,R.jsx)(kG,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${SW(e.label)} sits on the panel`}),(0,R.jsx)(PZ,{cell:e,intro:t})]})})}function IZ({cells:e,intro:t,onToggled:n}){return(0,R.jsx)(`ul`,{"aria-label":`Panel`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,R.jsx)(FZ,{cell:e,intro:t,onToggled:n},e.label))})}function LZ({cell:e,onToggled:t}){let{member:n}=e,r=SW(e.label),i=q(`flex h-full flex-col gap-2 rounded-xl border p-3.5 transition-[background-color,border-color,box-shadow]`,e.seated?`border-[color-mix(in_oklab,var(--orb)_26%,var(--border))] bg-[color-mix(in_oklab,var(--orb)_5%,var(--card))] shadow-card`:`border-dashed border-input bg-transparent`),a=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`grid size-6 place-items-center rounded-lg bg-[color-mix(in_oklab,var(--orb)_14%,transparent)] text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,!e.seated&&`opacity-50 grayscale`),children:(0,R.jsx)(bW,{source:e.label,className:`size-3.5`})}),(0,R.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?CW(e.label):`text-muted-foreground`),children:r})]}),n?(0,R.jsx)(kG,{checked:e.seated,onCheckedChange:()=>void RZ(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:vZ[e.label]}),(0,R.jsx)(`span`,{className:q(`mt-auto text-xs font-medium`,e.seated?`text-foreground`:`text-muted-foreground`),children:n?e.seated?`seated`:`sits this one out`:`always chairs`})]}),o={"--orb":TW(e.label)};return n?(0,R.jsx)(`li`,{style:o,children:(0,R.jsx)(`label`,{className:q(i,`cursor-pointer`,e.seated?`hover:shadow-[0_0_0_3px_color-mix(in_oklab,var(--orb)_10%,transparent)]`:`hover:bg-muted`),children:a})}):(0,R.jsx)(`li`,{style:o,children:(0,R.jsx)(`div`,{className:i,children:a})})}async function RZ(e,t){await U(`planner.toggleSeat`,{member:e})&&t()}function zZ({cells:e,onToggled:t}){return(0,R.jsx)(`ul`,{"aria-label":`Panel`,className:`grid grid-cols-1 gap-3 @lg:grid-cols-2 @4xl:grid-cols-5`,children:e.map(e=>(0,R.jsx)(LZ,{cell:e,onToggled:t},e.label))})}function BZ({snap:e}){let t=TZ(e),n=!e.busy&&wZ(e)!==void 0;return(0,R.jsxs)(`p`,{role:`status`,className:n?`flex items-center gap-2 text-sm text-destructive`:`flex items-center gap-2 text-sm text-muted-foreground`,children:[e.busy?(0,R.jsx)(pj,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function VZ(){return(0,R.jsx)(X,{label:`Previous plans`,text:`Previous`,icon:Yh,shortcut:`H`,onClick:()=>aj(ij(`plan`,`previous`))})}function HZ({snap:e,onDone:t}){let n=sA(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await U(e,{})&&t()};return(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e.questions.length>0&&!e.busy?(0,R.jsx)(X,{label:`Answer questions`,icon:lh,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,R.jsx)(X,{label:`Retry`,icon:$h,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,R.jsx)(VZ,{}),(0,R.jsx)(X,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:rg,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,R.jsx)(SM,{icon:Nm,label:`New plan`,shortcut:`N`,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void U(`planner.new`,{}).then(t)})]})}function UZ({snap:e,onDone:t}){return(0,R.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border px-5 py-3 max-md:shrink max-md:px-4 max-md:py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,R.jsx)(BZ,{snap:e})]}),(0,R.jsx)(HZ,{snap:e,onDone:t})]}),(0,R.jsx)(IZ,{cells:DZ(e),intro:!1,onToggled:t})]})}var WZ=()=>aj(ij(`plan`,`previous`)),GZ=e=>aj(ij(`plan`,`previous`,e));function KZ(e){let t=Date.now()-Date.parse(e);return Number.isFinite(t)?dM(Math.max(0,t)):``}function qZ(e,t){return[`${t} message${t===1?``:`s`}`,`round ${e.rounds}`,KZ(e.updatedAt)].filter(Boolean).join(` · `)}function JZ({plan:e,selected:t}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>GZ(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),e.hasDraft?(0,R.jsx)(jU,{variant:`secondary`,children:`draft`}):null]}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:qZ(e,e.messages)})]})})}function YZ({id:e,onGone:t}){let n=xj(`planner.previousGet`,{id:e},[`planner`]),r=n.data;if(!r)return n.error?(0,R.jsx)(yj,{message:`Could not load that plan. ${n.error}`,onRetry:n.reload}):null;let i=!!r.archivedAt,a=async()=>{await U(`planner.previousOpen`,{id:e})&&aj(ij(`plan`))},o=async()=>{await U(`planner.previousArchive`,{id:e,archived:!i})&&t()},s=async()=>{await U(`planner.previousDelete`,{id:e})&&t()};return(0,R.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":r.title,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Carry on planning`,text:`Carry on`,icon:Uh,tone:`primary`,shortcut:`C`,onClick:()=>void a()}),(0,R.jsx)(X,{label:i?`Bring it back from the archive`:`Archive`,text:i?`Unarchive`:`Archive`,icon:i?Cp:Tp,shortcut:`E`,onClick:()=>void o()}),(0,R.jsx)(SM,{icon:Cg,label:`Delete`,shortcut:`Delete`,title:`Delete "${r.title}"?`,description:`The conversation and the draft are removed for good.`,confirmLabel:`Delete plan`,variant:`destructive`,onConfirm:()=>void s()})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:r.title}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:[i?`archived`:``,qZ(r,r.messages.length),r.seed??``].filter(Boolean).join(` · `)})]}),(0,R.jsxs)(qH,{title:`Draft plan`,children:[r.draft?(0,R.jsx)(WH,{text:r.draft}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The panel had not written a draft yet.`}),(0,R.jsx)(NZ,{notes:r.notes})]}),(0,R.jsx)(qH,{title:`Conversation`,children:(0,R.jsx)(uZ,{messages:r.messages,readOnly:!0})})]})}function XZ({id:e}){let t=eM(),[n,r]=(0,m.useState)(!1),i=xj(`planner.previous`,n?{archived:!0}:{},[`planner`]),a=i.data?.plans??[];if(!i.data&&i.error)return(0,R.jsx)(yj,{message:`Could not load the previous plans. ${i.error}`,onRetry:i.reload});let o=(0,R.jsxs)(aM,{title:n?`Archived plans`:`Previous plans`,count:i.data?String(a.length):void 0,children:[(0,R.jsx)(X,{label:`Back to the current plan`,icon:kp,iconOnly:!0,onClick:()=>aj(ij(`plan`))}),(0,R.jsx)(X,{label:n?`Show the previous plans`:`Show the archived plans`,text:n?`Previous`:`Archived`,icon:n?Yh:Tp,pressed:n,onClick:()=>{r(e=>!e),WZ()}})]}),s=i.data?a.length===0?(0,R.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:n?`No archived plans.`:`No previous plans. A plan you leave without saving it as a task waits here; one saved as a task is in the Tasks tab.`}):(0,R.jsx)(`ul`,{className:q(NU,`pt-2`),"aria-label":n?`Archived plans`:`Previous plans`,children:a.map(t=>(0,R.jsx)(JZ,{plan:t,selected:t.id===e},t.id))}):(0,R.jsx)(oM,{});return(0,R.jsx)(iM,{wide:t,list:(0,R.jsxs)(R.Fragment,{children:[o,s]}),detail:e?(0,R.jsx)(YZ,{id:e,onGone:()=>{i.reload(),WZ()}},e):null,open:e!==void 0,onClose:WZ,hint:`Pick a plan to read it, carry it on, archive it or delete it.`,describe:`A previous plan`})}function ZZ({line:e,onClose:t,onSent:n}){let r=XA(e!==void 0,YA.confirm);return(0,R.jsx)(HA,{open:e!==void 0&&r,onOpenChange:e=>!e&&t(),label:`Comment on this line`,className:`max-w-xl`,children:(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6 max-md:p-4`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h2`,{className:`text-base font-medium`,children:`Comment on this line`}),(0,R.jsx)(`p`,{className:`mt-1 line-clamp-3 text-sm break-words text-muted-foreground`,children:e})]}),(0,R.jsx)(WU,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async r=>e===void 0||!await U(`planner.commentLine`,{line:e,text:r.trim()})?!1:(n(e,r.trim()),t(),!0)})]})})}function QZ({limit:e}){return e<=0?null:(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,R.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function $Z({snap:e,onDone:t}){let n=DZ(e);return(0,R.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock max-md:px-4 max-md:pt-5 md:px-8 md:pt-10`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 shrink-0 place-items-center rounded-xl border text-primary`,children:(0,R.jsx)(tg,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,R.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:_Z})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-2 @3xl:items-end`,children:[(0,R.jsx)(VZ,{}),(0,R.jsx)(QZ,{limit:e.limit})]})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,R.jsx)(KH,{title:`The panel`,right:bZ(n)})}),(0,R.jsx)(zZ,{cells:n,onToggled:t})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,R.jsx)(KH,{title:`How a plan comes together`})}),(0,R.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:yZ.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised relative flex gap-3 rounded-xl border p-3.5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Dp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,R.jsx)(iA,{chord:`/`,className:`max-md:hidden`,children:`write`}),(0,R.jsx)(iA,{chord:`Enter`,className:`max-md:hidden`,children:`send to the panel`})]})]})})}function eQ({snap:e,wide:t}){let{ref:n,onScroll:r}=gW(JSON.stringify(e.messages));return(0,R.jsxs)(tM,{className:`workspace-pane flex flex-col rounded-xl border shadow-xs`,children:[(0,R.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,R.jsx)(KH,{title:`Conversation`,className:`w-full`})}),(0,R.jsx)(`div`,{ref:n,onScroll:r,className:q(`min-h-0 overflow-y-auto overscroll-y-contain`,t?`flex-1 px-5 pt-5 pb-dock`:`max-h-[45svh] p-5`),children:(0,R.jsx)(uZ,{messages:e.messages,busy:e.busy})})]})}function tQ({snap:e,comments:t,onComment:n,wide:r}){return(0,R.jsxs)(tM,{className:`workspace-pane flex flex-col rounded-xl border shadow-xs`,children:[(0,R.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,R.jsx)(KH,{title:`Draft plan`,className:`w-full`})}),(0,R.jsxs)(`div`,{className:q(`flex min-h-0 flex-col gap-5 overflow-y-auto overscroll-y-contain px-5 pt-5 pb-dock`,r&&`flex-1`),children:[e.draft?(0,R.jsx)(MZ,{draft:e.draft,comments:t,onComment:n}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.busy?pZ:fZ}),(0,R.jsx)(NZ,{notes:e.notes})]})]})}function nQ({snap:e,reload:t}){let n=eM(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(new Map);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(UZ,{snap:e,onDone:t}),(0,R.jsxs)(`div`,{className:q(n?`grid min-h-0 flex-1 grid-cols-[minmax(0,46fr)_minmax(0,54fr)] grid-rows-[minmax(0,1fr)] gap-3 p-3`:`flex flex-col gap-3 p-3`,`min-w-0`),children:[(0,R.jsx)(eQ,{snap:e,wide:n}),(0,R.jsx)(tQ,{snap:e,comments:a,onComment:i,wide:n})]}),(0,R.jsx)(ZZ,{line:r,onClose:()=>i(void 0),onSent:(e,t)=>o(n=>new Map(n).set(e,[...n.get(e)??[],t]))})]})}function rQ({rest:e=[]}){return e[0]===`previous`?(0,R.jsx)(XZ,{id:e[1]}):(0,R.jsx)(iQ,{})}function iQ(){let e=xj(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,R.jsx)(yj,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,R.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=CZ(t);return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,R.jsx)($Z,{snap:t,onDone:e.reload}):(0,R.jsx)(nQ,{snap:t,reload:e.reload})})}var aQ=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function oQ(e){return e.prompt.split(`
100
- `).find(e=>e.trim())?.trim()??`(empty)`}function sQ(e){return[...e].reverse()}function cQ(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function lQ(e,t){return e.startedAt?cQ((e.finishedAt??t)-e.startedAt):``}function uQ(e,t){let n=e.model?`${e.model}${e.thinking?` · ${e.thinking}`:``}`:e.thinking??``;return[lQ(e,t),n,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.usage?.cost?`$${e.usage.cost.toFixed(2)}`:``].filter(Boolean).join(` · `)}function dQ(e){return e===`queued`?`Waiting for the quick fix ahead of it.`:e===`running`?`starting…`:e===`held`?`Not started.`:`No tool calls.`}function fQ({job:e}){let t=e.status===`held`;return(0,R.jsxs)(R.Fragment,{children:[e.route?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Routed `,e.route]}):null,e.note&&t?(0,R.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-sm text-foreground`,children:[(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,R.jsxs)(`span`,{children:[`Held: `,e.note,`.`]})]}):null,e.note&&!t?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.routed?`Routed here by the oracle — ${e.note}`:e.note}):null,e.routed&&!e.note?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Routed here by the oracle.`}):null]})}function pQ({job:e}){let t=e.status===`running`;return e.steps.length===0?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[t?(0,R.jsx)(pj,{className:`size-3.5`}):null,dQ(e.status)]}):(0,R.jsx)(`ol`,{className:`flex flex-col gap-1 text-sm`,children:e.steps.map((e,n)=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:lM(e.at)}),(0,R.jsx)(`span`,{className:`flex h-5 w-3.5 shrink-0 items-center justify-center`,"aria-hidden":`true`,children:e.pending&&t?(0,R.jsx)(pj,{className:`size-3.5`}):(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}),(0,R.jsx)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:e.pending&&t?`${e.text}…`:e.text})]},n))})}function mQ({job:e}){return e.status===`held`?(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Run anyway`,icon:Uh,tone:`primary`,shortcut:`R`,onClick:()=>void U(`quickfix.runAnyway`,{id:e.id})}),(0,R.jsx)(X,{label:`Turn it into a task`,text:`Make it a task`,icon:th,shortcut:`T`,onClick:()=>void U(`quickfix.movedToTask`,{id:e.id})})]}):e.status!==`queued`&&e.status!==`running`?null:(0,R.jsx)(Gj,{children:(0,R.jsx)(SM,{icon:dm,label:`Cancel the quick fix`,text:`Cancel`,shortcut:`C`,title:`Cancel this quick fix?`,description:`The agent stops. Files it already edited stay as they are.`,confirmLabel:`Cancel quick fix`,variant:`destructive`,onConfirm:()=>void U(`quickfix.cancel`,{id:e.id})})})}function hQ({job:e,now:t}){return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Quick fix detail`,children:[(0,R.jsx)(mQ,{job:e}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:oQ(e)}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:e.status}),uQ(e,t)?(0,R.jsx)(`span`,{children:uQ(e,t)}):null]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),e.prompt.trim().includes(`
101
- `)?(0,R.jsx)(WH,{text:e.prompt}):null,(0,R.jsx)(fQ,{job:e}),(0,R.jsx)(qH,{title:`Steps`,children:(0,R.jsx)(pQ,{job:e})}),e.files?.length?(0,R.jsx)(qH,{title:`Edited`,children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,R.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,R.jsx)(`p`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:e.error}):null,e.report?(0,R.jsx)(qH,{title:`Report`,children:(0,R.jsx)(WH,{text:e.report})}):null]})}function gQ({status:e}){if(e===`running`)return(0,R.jsx)(pj,{className:`size-3.5`,"aria-label":`running`});let t={queued:_m,success:Vp,failed:Vg,timeout:Vg,cancelled:xh,held:Nh,running:_m}[e];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{"aria-hidden":`true`,className:`size-4 ${e===`success`?`text-success`:e===`failed`||e===`timeout`?`text-destructive`:e===`held`?`text-warning`:`text-muted-foreground`}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:e})]})}function _Q({job:e,selected:t,now:n,onSelect:r}){let i=lQ(e,n);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.id),className:q(MU,`flex-row items-start gap-2.5 text-sm max-md:min-h-11`),children:[(0,R.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,R.jsx)(gQ,{status:e.status})}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:oQ(e)}),i?(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:i}):null]})})}function vQ({jobs:e,selectedId:t,now:n,onSelect:r}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(_Q,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var yQ=()=>aj(ij(`quickfix`)),bQ=e=>aj(ij(`quickfix`,e));function xQ(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function SQ(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Ug,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:`font-medium text-foreground`,children:aQ})]})})}function CQ({id:e}){let t=eM(),n=xj(`quickfix.list`,{},[`quickfix`]),r=sQ(n.data?.jobs??[]),i=xQ(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,R.jsx)(SQ,{}):(0,R.jsx)(wQ,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function wQ({id:e,wide:t,loaded:n,jobs:r,now:i}){let a=e??(t?r[0]?.id:void 0),o=r.find(e=>e.id===a),s=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Quick fixes`,count:String(r.length)}),n?(0,R.jsx)(vQ,{jobs:r,selectedId:a,now:i,onSelect:bQ}):(0,R.jsx)(oM,{})]});return(0,R.jsx)(iM,{wide:t,list:s,detail:o?(0,R.jsx)(hQ,{job:o,now:i}):e?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:yQ,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var TQ={},EQ=new Set;function DQ(e){TQ=e;for(let e of[...EQ])e()}function OQ(e){TQ.taskId!==e&&DQ({...TQ,taskId:e})}function kQ(e){(TQ.session?.name!==e?.name||JSON.stringify(TQ.session?.address)!==JSON.stringify(e?.address))&&DQ({...TQ,session:e})}function AQ(e){return EQ.add(e),()=>{EQ.delete(e)}}function jQ(){return(0,m.useSyncExternalStore)(AQ,()=>TQ,()=>TQ)}var MQ=8;function NQ(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function PQ(e,t){let n=Math.min(t,MQ);if(n<=0)return[];let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return Array.from({length:n},(e,t)=>t<r)}function FQ({done:e,total:t}){return(0,R.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:PQ(e,t).map((e,t)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function IQ({check:e,className:t}){return(0,R.jsx)(e===`done`?rm:e===`dropped`?pm:hm,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function LQ({entry:e}){let t=e.at?lM(e.at):``;return e.role===`note`?(0,R.jsxs)(`li`,{className:`break-words text-center text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col items-end gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,R.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,R.jsx)(WH,{text:e.text})})]}):(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,R.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,R.jsx)(WH,{text:e.text})})]})}function RQ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 max-w-full flex-col gap-3`,children:[t?(0,R.jsx)(`div`,{className:`flex self-center`,children:(0,R.jsx)(X,{label:`Load earlier messages`,icon:$p,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,R.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex min-w-0 flex-col gap-4`,children:e.map(e=>(0,R.jsx)(LQ,{entry:e},e.id))})]})}function zQ({address:e,empty:t}){let n=xj(`sessions.chat`,e,[`sessions`]),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=n.data?.entries??[],c=new Set(s.map(e=>e.id)),l=[...(r?.entries??[]).filter(e=>!c.has(e.id)),...s],u=async()=>{let t=l[0];if(!t)return;o(!0);let n=await U(`sessions.chat`,{...e,before:t.id});n&&i({entries:[...n.entries,...r?.entries??[]],more:n.hasOlder}),o(!1)},d=r?.more??n.data?.hasOlder??!1;return(0,R.jsx)(RQ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var BQ={"this window":`This window`,background:`Background`,"other terminal":`Other terminals`},VQ=[`this window`,`background`,`other terminal`],HQ=`Nothing said yet.`,UQ=`This session runs in another terminal: its conversation shows here and your messages reach its oracle within seconds, but live activity only streams from sessions started in this window.`,WQ=`No other sessions. Start one below.`;function GQ(e,t,n){let r=t?.task;return{id:`here`,where:`this window`,name:e?.sessionName??r?.title??`unnamed session`,status:e?.busy?`working`:r?.state??`no task`,waiting:n,alive:!0,dialogs:[],...r?{task:r}:{}}}function KQ(e){let t=e.status===`exited`?`ended`:e.status===`starting`?`starting`:e.busy?`working`:`idle`;return{id:e.key,where:`background`,name:e.name,status:t,waiting:e.dialogs.length,key:e.key,alive:e.alive,dialogs:e.dialogs,...e.sessionId?{sessionId:e.sessionId}:{}}}function qQ(e){return{id:e.sessionId,where:`other terminal`,name:e.name??`unnamed session`,status:`running`,waiting:0,pid:e.pid,sessionId:e.sessionId,alive:!0,dialogs:[]}}function JQ(e,t,n,r,i){let a=new Set([e?.sessionId,...r.map(e=>e.sessionId)].filter(e=>!!e)),o=i.filter(e=>!a.has(e.sessionId));return[GQ(e,t,n),...r.map(KQ),...o.map(qQ)]}function YQ(e){return`${e} question${e===1?``:`s`} waiting for you`}function XQ(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function ZQ(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function QQ(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function $Q({options:e,send:t}){return(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:e.map(e=>(0,R.jsx)(Y,{variant:`outline`,className:`max-w-full min-w-0 whitespace-normal break-words text-left max-md:h-auto max-md:min-h-11`,onClick:()=>void t({value:e}),children:e},e))})}function e$({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,R.jsx)(sM,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,R.jsx)(`div`,{className:`flex self-end`,children:(0,R.jsx)(X,{label:`Send the answer`,text:`Send`,icon:Np,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function t$({dialog:e,send:t}){return e.method===`select`?(0,R.jsx)($Q,{options:e.options??[],send:t}):e.method===`confirm`?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,R.jsx)(Y,{className:`max-md:h-auto max-md:min-h-11`,onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,R.jsx)(Y,{variant:`outline`,className:`max-md:h-auto max-md:min-h-11`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,R.jsx)(e$,{dialog:e,send:t})}function n$({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await U(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,R.jsxs)(`div`,{className:`card-raised flex min-w-0 flex-col gap-3 rounded-lg border p-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:t.title}),t.message?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:t.message}):null]}),(0,R.jsx)(t$,{dialog:t,send:r}),(0,R.jsx)(`div`,{className:`flex self-start`,children:(0,R.jsx)(X,{label:`Put it away`,text:`Put away`,icon:Vg,onClick:()=>void r({cancelled:!0})})})]})}function r$({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,R.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,R.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:YQ(t.length)}),t.map(t=>(0,R.jsx)(n$,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var i$={"this window":Ch,background:Zm,"other terminal":pg};function a$({where:e,className:t}){let n=i$[e];return(0,R.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function o$({task:e}){let t=e.progress;return(0,R.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(FQ,{done:t.done,total:t.total}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function s$({entry:e}){let{key:t}=e;return e.where===`this window`?(0,R.jsx)(Gj,{children:(0,R.jsx)(X,{label:`Back to this window`,text:`Back to the Lobby`,icon:kp,tone:`primary`,shortcut:`B`,onClick:()=>aj(`#/lobby`)})}):t?(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Move here`,icon:jp,tone:`primary`,shortcut:`M`,onClick:()=>void U(`sessions.switch`,{key:t})}),(0,R.jsx)(SM,{icon:dm,label:`Stop the session`,text:`Stop`,shortcut:`S`,title:`Stop ${e.name}?`,description:`Its process ends. The task keeps its state and can be resumed in this window.`,confirmLabel:`Stop session`,variant:`destructive`,disabled:!e.alive,onConfirm:()=>void U(`sessions.stop`,{key:t})})]}):null}function c$({entry:e,lobby:t}){let n=QQ(e);return e.where===`this window`?(0,R.jsx)(RQ,{entries:t?.chat??[],more:!1,empty:HQ}):n?(0,R.jsx)(zQ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:XQ(e)},e.id):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:HQ})}function l$({entry:e,lobby:t,onChanged:n}){return(0,R.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex min-w-0 max-w-full flex-col gap-4 max-md:pb-dock`,children:[(0,R.jsx)(s$,{entry:e}),(0,R.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,R.jsxs)(`h3`,{className:`flex min-w-0 max-w-full flex-wrap items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,R.jsx)(a$,{where:e.where,className:`size-[1.1rem]`}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.name})]}),(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:ZQ(e)}),e.task?(0,R.jsx)(o$,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:YQ(e.waiting)}):null]}),e.where===`other terminal`?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:UQ}):null,e.key?(0,R.jsx)(r$,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,R.jsx)(qH,{title:`Conversation`,children:(0,R.jsx)(c$,{entry:e,lobby:t})})]})}function u$({entry:e,selected:t,onSelect:n}){let r=xf();return(0,R.jsx)(B.li,{layout:!r&&`position`,initial:!1,"data-slot":`active-session`,className:`min-w-0 border-t border-border first:border-t-0`,children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:q(MU,`min-w-0 flex-row items-start gap-3 rounded-none px-4 py-3 text-sm focus-visible:ring-inset max-md:min-h-11 max-md:h-auto`),children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`mt-0.5 grid size-8 shrink-0 place-items-center rounded-lg bg-foreground/4 text-foreground/75 shadow-[inset_0_0_0_1px_var(--border)]`,children:(0,R.jsx)(a$,{where:e.where})}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:q(`flex min-w-0 flex-wrap items-center gap-2 text-foreground`,t&&`font-medium`),children:[(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.name}),e.where===`this window`?(0,R.jsx)(jU,{variant:`secondary`,radius:`full`,size:`sm`,children:`This window`}):null]}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-1.5 break-words text-xs text-muted-foreground`,children:[e.status===`working`||e.status===`starting`?(0,R.jsx)(pj,{className:`size-3`,"aria-hidden":`true`}):null,e.status.replace(/_/g,` `),e.waiting>0?(0,R.jsxs)(jU,{variant:`warning-light`,radius:`full`,className:`text-warning tabular-nums`,children:[e.waiting,` waiting`]}):null]})]})]})})}function d$({where:e,entries:t,selectedId:n,onSelect:r}){return(0,R.jsxs)(`section`,{"aria-label":BQ[e],className:`flex flex-col`,children:[(0,R.jsx)(`h3`,{className:PU,children:(0,R.jsx)(KH,{title:BQ[e],right:String(t.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,R.jsx)(`ul`,{className:`workspace-section mx-3 mb-2 flex flex-col overflow-hidden rounded-xl border shadow-xs`,children:t.map(e=>(0,R.jsx)(u$,{entry:e,selected:e.id===n,onSelect:r},e.id))})]})}function f$({entries:e,selectedId:t,onSelect:n}){return(0,R.jsx)(`div`,{className:`flex flex-col pb-2`,children:VQ.map(r=>{let i=e.filter(e=>e.where===r);return i.length>0?(0,R.jsx)(d$,{where:r,entries:i,selectedId:t,onSelect:n},r):null})})}var p$=()=>aj(`#/sessions`),m$=e=>aj(`#/sessions/${encodeURIComponent(e)}`);function h$({windows:e}){return e.length===0?null:(0,R.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:(0,R.jsx)(qH,{title:`Other windows`,children:(0,R.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,R.jsx)(`li`,{children:(0,R.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-h-8 min-w-0 max-w-full items-center rounded-lg px-2.5 text-sm text-foreground break-words underline-offset-4 transition-colors hover:bg-muted hover:underline max-md:min-h-11 max-md:h-auto`,children:e.name})},e.url))})})})}function g$(){return(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session is not on the list any more.`})}function _$({id:e}){let t=eM(),n=sA(`status`).data,r=sA(`lobby`).data,i=sA(`prompts`).data?.prompts.length??0,a=xj(`sessions.list`,{},[`sessions`]);if(!a.data&&a.error)return(0,R.jsx)(yj,{message:`Could not load sessions. ${a.error}`,onRetry:a.reload});let o=JQ(n,r,i,a.data?.background??[],a.data?.live??[]),s=e??(t?o[0]?.id:void 0),c=o.find(e=>e.id===s),l=c&&c.where!==`this window`&&c.alive?QQ(c):void 0,u=l?JSON.stringify(l):``,d=c?.name;(0,m.useEffect)(()=>(kQ(l&&d?{name:d,address:l}:void 0),()=>kQ(void 0)),[u,d]);let f=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Sessions`,count:String(o.length)}),a.data?(0,R.jsx)(f$,{entries:o,selectedId:s,onSelect:m$}):(0,R.jsx)(oM,{}),a.data&&o.length===1?(0,R.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:WQ}):null,(0,R.jsx)(h$,{windows:n?.windows??[]})]}),p=c?(0,R.jsx)(l$,{entry:c,lobby:r,onChanged:a.reload},c.id):e?(0,R.jsx)(g$,{}):null;return(0,R.jsx)(iM,{wide:t,list:f,detail:p,open:!!e,onClose:p$,hint:`Select a session to see its conversation.`,describe:`Session detail`})}function v$(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function y$(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function b$(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}function x$({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,R.jsxs)(`span`,{className:`tabular-nums break-words`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,y$(v$(e,n,t)),` execution`]})}function S$({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=b$(r,e);return(0,R.jsxs)(`span`,{className:`tabular-nums break-words`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,t?`${t.phase.replaceAll(`_`,` `)} · `:``,`worked `,y$(e.workedMs+i)]})}function C$({timing:e,work:t,stopped:n=!1}){return t?(0,R.jsx)(S$,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,R.jsx)(x$,{timing:e,stopped:n},JSON.stringify(e)):(0,R.jsx)(`span`,{children:`Timing unavailable`})}var w$=`This merges the reviewed commit into main and pushes main, then removes the task worktree after verifying the merge. The task branch is kept.`,T$={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function E$({delivery:e,title:t}){return(0,R.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,R.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,R.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,R.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,R.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,R.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,R.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,R.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,R.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,R.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Local completion/QA: `,e.verification.localVerified?`passed`:`not verified`,` · Repository rules: `,e.verification.rulesKnown?`known`:`unavailable`,e.verification.requiredChecks.length?` · Required: ${e.verification.requiredChecks.join(`, `)}`:``]}):null]})}function D$({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=e===`merge_main`&&t.status===`successful`&&!!t.cleanupError,o=n||t.status===`in_progress`||t.status===`successful`&&!a||!!i;return(0,R.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11 max-md:whitespace-normal`,disabled:o,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:a?`Retry worktree cleanup`:`Merge to main`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e===`create_pr`?`Pushes the task branch and opens a PR targeting main. Does not merge.`:a?`Main was delivered. Removes the retained worktree after confirmation.`:`Updates and pushes main, then removes the task worktree. Requires confirmation.`}),i?(0,R.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function O$(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?Te(`tasks.deliveryReview`,{taskId:t}):e===`defer`?Te(`tasks.deliveryDefer`,r):Te(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function k$({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=P(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function A$(e){return e.scope.current===e.identity&&e.project===P()}function j$(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await O$(r,t.taskId,e.current.reviewId);A$(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){A$(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function M$(e){let t=k$(e),n=j$(t,e),r=XA(t.confirm,YA.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function N$({review:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,R.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:T$[e.current.status]}),e.current.error||e.error?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error??e.current.error,` Completed work is retained. Refresh review to reconcile the result before retrying.`]}):null,e.current.cleanupError?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.current.cleanupError,` Retry cleanup after resolving it.`]}):null,e.current.operation?.worktreeRemoved?(0,R.jsx)(`p`,{className:`text-sm`,children:`Task worktree removed.`}):null,e.current.result?(0,R.jsxs)(`p`,{className:`text-sm break-all`,children:[e.current.result.action===`create_pr`?`PR #${e.current.result.pullNumber??``} created`:`main pushed · ${e.current.result.commit??``}`,e.current.result.pullUrl?(0,R.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function P$({review:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-3 grid gap-3 max-md:grid-cols-1 md:grid-cols-2`,children:[(0,R.jsx)(D$,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,R.jsx)(D$,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,className:`max-md:min-h-11`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,R.jsx)(Y,{variant:`ghost`,className:`max-md:min-h-11`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function F$({review:e}){let t=e.current.status===`successful`&&!!e.current.cleanupError,n=t?`Main was already delivered. Remove the task worktree if it still contains only the reviewed commit. The task branch is kept.`:w$;return(0,R.jsx)(HA,{open:e.slot,onOpenChange:e.setConfirm,label:t?`Confirm worktree removal`:`Confirm merge to main`,description:n,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,R.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,R.jsx)(`h3`,{className:`font-medium`,children:t?`Remove task worktree?`:`Merge to main?`}),(0,R.jsx)(`p`,{className:`text-sm`,children:n}),(0,R.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,R.jsx)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,disabled:e.busy||!!e.current.blocked.merge_main||e.terminal&&!t,onClick:()=>void e.request(`merge_main`),children:t?`Confirm worktree removal`:`Confirm merge and push main`})]})]})})}function I$({title:e,review:t}){return(0,R.jsxs)(qH,{title:`Completed work · delivery review`,right:T$[t.current.status],children:[(0,R.jsx)(E$,{delivery:t.current,title:e}),(0,R.jsx)(N$,{review:t}),(0,R.jsx)(P$,{review:t}),(0,R.jsx)(F$,{review:t})]})}function L$(e){let t=M$(e);return(0,R.jsx)(I$,{title:e.title,review:t})}var R$={open:hm,delivered:sm,addressed:rm},z$={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function B$({comment:e}){let t=dM(Date.now()-Date.parse(e.createdAt)),n=R$[e.status];return(0,R.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),z$[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function V$({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,R.jsxs)(`li`,{className:`card-raised min-w-0 rounded-lg border px-3.5 py-2.5`,children:[r?(0,R.jsx)(rZ,{text:s.text,onSave:async n=>{let r=await Te(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,R.jsx)(WH,{text:s.text}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(B$,{comment:s}),n&&!r?(0,R.jsx)(Y,{size:`sm`,variant:`ghost`,className:`max-md:min-h-11`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function H$({taskId:e,finished:t,canComment:n}){let r=xj(`tasks.comments`,{taskId:e},[`tasks`]),i=sA(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,R.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,R.jsx)(KH,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan in the box below (Markdown and images work); the oracle amends it.`:`No comments yet.`}):(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,R.jsx)(V$,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}var U$={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},W$={open:`open`,done:`done`,dropped:`abandoned`},G$={none:{label:`None`,depth:`nothing that runs changed: the engine's checks decide, no QA agent`,tone:`bg-accent text-muted-foreground`},low:{label:`Low`,depth:`a light check: the diff, the nearest tests, done once confident`,tone:`bg-success/10 text-success`},medium:{label:`Medium`,depth:`a standard check: the acceptance criteria and realistic regressions`,tone:`bg-warning/10 text-warning`},high:{label:`High`,depth:`a deep, adversarial review: invariants, recovery and everything the change reaches`,tone:`bg-destructive/10 text-destructive`}};function K$(e){let t=e.source===`classifier`?`Jev`:`rules`;if(!e.qaRequired)return`${t} · no QA agent`;let{min:n,max:r}=e.testBudget;return`${t} · ${n===r?r:`${n}-${r}`} new tests at most`}var q$=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function J$(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function Y$(e){return e===`now`?`just now`:`${e} ago`}function X$(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[J$(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function Z$(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}function Q$(e){let t=e.filter(e=>e.kind!==`archived`),n=t.filter(e=>e.check===`open`).length,r=t.length-n,i=e.length-t.length;return[n?`${n} open`:``,r?`${r} finished`:``,i?`${i} archived`:``].filter(Boolean).join(` · `)||`0`}function $$({step:e,stopped:t}){let n=b$(!t,e);return(0,R.jsx)(`span`,{className:`tabular-nums`,children:y$((e.workedMs??0)+n)})}function e1(){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`relative mt-[0.3125rem] grid size-4 shrink-0 place-items-center`,children:[(0,R.jsx)(`span`,{className:`absolute size-2.5 rounded-full bg-primary/30 motion-safe:animate-ping`}),(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})]})}function t1({id:e,agents:t}){let[n,r]=(0,m.useState)(Date.now);(0,m.useEffect)(()=>{let e=window.setInterval(()=>r(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let i=t.filter(e=>!e.parentRunId||!t.some(t=>t.runId===e.parentRunId)).flatMap(e=>[e,...t.filter(t=>t.parentRunId===e.runId)]);return(0,R.jsx)(`ul`,{id:e,"aria-label":`Agents on this step`,className:`mt-1.5 flex flex-col gap-1 rounded-lg border border-border bg-muted/30 px-3 py-2`,children:i.map(e=>{let r=EW({domain:e.domain}),i=!!e.parentRunId&&t.some(t=>t.runId===e.parentRunId),a=Date.parse(e.startedAt);return(0,R.jsxs)(`li`,{className:q(`flex min-w-0 items-baseline gap-2 text-xs`,i&&`ml-4 border-l border-border pl-3`),children:[(0,R.jsx)(`span`,{className:q(`shrink-0 font-medium`,CW(r)),children:SW(r)}),i?(0,R.jsx)(`span`,{className:`shrink-0 text-muted-foreground`,children:`child`}):null,(0,R.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-foreground`,title:e.instruction,children:e.instruction||`Working`}),Number.isFinite(a)?(0,R.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:y$(Math.max(0,n-a))}):null]},e.runId)})})}function n1({step:e,index:t,stopped:n}){let r=!!e.active&&!n,i=r?e.agents??[]:[],a=i.length||(e.activeAgentCount??1),[o,s]=(0,m.useState)(!1),c=(0,m.useId)(),l=e.status===`done`,u=l?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`,d=l?rm:hm,f=`${a} ${a===1?`agent working`:`agents working`}`;return(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col`,"data-step":r?`active`:e.status,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5 text-sm max-md:flex-wrap`,children:[r?(0,R.jsx)(e1,{}):(0,R.jsx)(d,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${u}`}),(0,R.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,R.jsx)(`span`,{className:q(`min-w-0 break-words`,r||e.status===`current`?`text-foreground`:`text-muted-foreground`),children:e.text}),r&&i.length>0?(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),className:`btn-ghost inline-flex h-5 shrink-0 items-center gap-0.5 rounded-md px-1.5 text-xs text-primary outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,children:[`(`,f,`)`,(0,R.jsx)(Up,{"aria-hidden":`true`,className:q(`size-3 transition-transform`,o&&`rotate-180`)})]}):r?(0,R.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-primary`,children:[`(`,f,`)`]}):null,r?(0,R.jsxs)(`span`,{className:`shrink-0 rounded-md bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary`,children:[`active · `,(0,R.jsx)($$,{step:e,stopped:n}),(0,R.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):e.status===`current`&&!n?(0,R.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`next`,(0,R.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null]}),o&&i.length>0?(0,R.jsx)(`div`,{className:`pl-[3.25rem] max-md:pl-0`,children:(0,R.jsx)(t1,{id:c,agents:i})}):null]})}function r1({steps:e,stopped:t}){let n=e.filter(e=>e.status===`done`).length;return(0,R.jsx)(qH,{title:`Steps`,right:`${n}/${e.length} done`,children:(0,R.jsx)(`ol`,{className:`flex flex-col gap-2`,"aria-label":`Steps`,children:e.map((e,n)=>(0,R.jsx)(n1,{step:e,index:n,stopped:t},`${n}-${e.text}`))})})}function i1({text:e}){let[t,n]=(0,m.useState)(!1),r=(0,m.useId)();return(0,R.jsxs)(qH,{title:`Full plan`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`inline-flex min-h-11 w-fit items-center gap-1.5 rounded-md text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(qp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,t&&`rotate-90`)}),t?`Hide the details`:`Read the details of each step`]}),t?(0,R.jsx)(`div`,{id:r,children:(0,R.jsx)(WH,{text:e})}):null]})}function a1({detail:e,finished:t}){return e.plan&&e.planDetails?(0,R.jsx)(i1,{text:e.planDetails}):e.plan?(0,R.jsx)(qH,{title:`Approved plan`,children:(0,R.jsx)(WH,{text:e.plan})}):e.proposal?(0,R.jsx)(qH,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,R.jsx)(WH,{text:e.proposal})}):(0,R.jsx)(qH,{title:`Plan`,children:(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the oracle is still clarifying or scouting.`})})}function o1({amendments:e}){return e.length===0?null:(0,R.jsx)(qH,{title:`Amendments`,children:(0,R.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,R.jsx)(`li`,{className:`break-words`,children:e},e))})})}function s1({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,R.jsx)(qH,{title:`Waiting on`,children:(0,R.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(tm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.kind,` `,e.detail]})]},`${t}-${e.kind}`)),e.blockers.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(pm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function c1({risk:e}){let t=G$[e.risk];return(0,R.jsxs)(qH,{title:`QA risk`,right:K$(e),children:[(0,R.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-sm`,"data-qa-risk":e.risk,children:[(0,R.jsx)(`span`,{className:q(`rounded-md px-2 py-0.5 text-xs font-medium`,t.tone),children:t.label}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:t.depth})]}),e.focusAreas.length>0?(0,R.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,"aria-label":`What QA looks at first`,children:e.focusAreas.map(e=>(0,R.jsx)(`li`,{className:`break-words`,children:e},e))}):null,(0,R.jsxs)(`p`,{className:`text-xs break-words text-muted-foreground`,children:[e.riskFactors.join(` · `),e.qaRequired?` · existing tests ${e.existingTestsLikelySufficient?`likely enough`:`likely not enough`}`:``]})]})}function l1({runs:e}){return e.length===0?null:(0,R.jsx)(qH,{title:`Recent runs`,children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,R.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function u1({detail:e,finished:t}){return(0,R.jsxs)(R.Fragment,{children:[e.steps.length>0?(0,R.jsx)(r1,{steps:e.steps,stopped:t}):null,e.request?(0,R.jsx)(qH,{title:`Request`,children:(0,R.jsx)(WH,{text:e.request})}):null,(0,R.jsx)(a1,{detail:e,finished:t})]})}function d1({detail:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(o1,{amendments:e.amendments}),(0,R.jsx)(s1,{detail:e}),e.qaRisk?(0,R.jsx)(c1,{risk:e.qaRisk}):null,(0,R.jsx)(l1,{runs:e.runs})]})}function f1({row:e,quiet:t=!1}){let n=(0,m.useRef)(!0);(0,m.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);async function r(){if(e.section===`mine`)return aj(`#/lobby`);let t=P(),r=()=>n.current&&P()===t;try{let t=await Te(`tasks.open`,{taskId:e.id});if(!r())return;let n=await Te(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return aj(`#/lobby`);if(t.sessionId&&!t.key)return H.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return H.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await U(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&aj(`#/lobby`)}catch(e){r()&&H.error(e instanceof Error?e.message:String(e))}}let i=e.section===`mine`;return(0,R.jsx)(X,{label:i?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:jp,tone:t?`neutral`:`primary`,shortcut:`S`,onClick:()=>void r()})}function p1({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,R.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,R.jsxs)(`span`,{children:[n>0?(0,R.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,R.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function m1({planId:e}){let t=xj(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,R.jsxs)(R.Fragment,{children:[n.issue?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,R.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,R.jsx)(p1,{split:n.split}):null,(0,R.jsx)(qH,{title:`Agreed plan`,children:(0,R.jsx)(WH,{text:n.brief})})]}):t.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function h1({row:e,onGone:t}){let n=async n=>{await U(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await U(`plans.discard`,{planId:e.id})&&t()};return(0,R.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-4`,"aria-label":e.title,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Start here`,icon:Uh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,R.jsx)(X,{label:`Start in a new session`,text:`New session`,icon:dg,shortcut:`N`,onClick:()=>void n(`session`)}),(0,R.jsx)(SM,{icon:Cg,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,R.jsx)(IQ,{check:`open`,className:`mt-1.5`}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${Y$(e.age)}`:``]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,R.jsx)(m1,{planId:e.id})]})}function g1({row:e,onResumed:t}){let[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(!0);(0,m.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);async function a(){let n=P();r(!0);try{let r=await Te(`tasks.resume`,{taskId:e.id});if(P()!==n)return;let i=r.key;H(r.notice,i?{action:{label:`Watch`,onClick:()=>aj(`#/sessions/${encodeURIComponent(i)}`)}}:void 0),t()}catch(e){P()===n&&H.error(e instanceof Error?e.message:String(e))}finally{i.current&&r(!1)}}let o=e.owner===`not running`;return(0,R.jsx)(X,{label:o?`Resume: carry it on in a background session`:`Resume: unpause it where it runs`,text:`Resume`,icon:Uh,tone:`primary`,shortcut:`R`,disabled:n,onClick:()=>void a()})}function _1(e){if(e.kind===`archived`)return{state:`archived`,rest:Y$(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${Y$(e.age)}`:``;return{state:J$(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function v1(e){return e?[NQ(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function y1({row:e}){return e.progress?(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(FQ,{done:e.progress.done,total:e.progress.total}),(0,R.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function b1({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=_1(e);return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,R.jsx)(IQ,{check:e.check,className:`mt-1.5`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[W$[e.check],`:`]}),(0,R.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,R.jsx)(`span`,{children:i}):null]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,v1(t),n].filter(Boolean).join(` · `)}),(0,R.jsx)(y1,{row:e})]})}function x1({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await U(`tasks.restore`,{taskId:r},{undo:()=>void U(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await U(`tasks.archive`,{taskId:r},{undo:()=>void U(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await U(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void U(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function S1({row:e,archive:t}){return e.check===`open`?(0,R.jsx)(SM,{label:`Archive`,icon:Tp,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,R.jsx)(X,{label:`Archive`,icon:Tp,shortcut:`E`,onClick:()=>void t()})}function C1({on:e,toggle:t}){return Uj(`a`,t),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[0.8125rem] font-medium transition-colors hover:bg-accent max-md:min-h-11`,children:[(0,R.jsx)(qh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,R.jsx)(`span`,{children:`Auto`}),(0,R.jsx)(GJ,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,R.jsx)(rA,{chord:`A`,className:`kbd-hint`})]})}),(0,R.jsx)(Tj,{children:`Auto mode: the oracle decides without asking`})]})}function w1(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=x1(e),o=t.kind===`archived`,s=t.kind===`task`&&t.check===`open`&&!!t.resumable;return(0,R.jsxs)(Gj,{children:[s?(0,R.jsx)(g1,{row:t,onResumed:e.onChanged}):null,t.kind===`task`&&t.check===`open`?(0,R.jsx)(f1,{row:t,quiet:s}):null,t.kind===`task`?(0,R.jsx)(T1,{taskId:t.id}):null,o?(0,R.jsx)(X,{label:`Restore`,icon:Zh,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,R.jsx)(C1,{on:!!t.auto,toggle:a}):null,o?null:(0,R.jsx)(S1,{row:t,archive:r}),(0,R.jsx)(SM,{icon:Cg,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function T1({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=P();try{let r=await Te(`tasks.open`,{taskId:e});if(!t.current||P()!==n)return;r.notice&&H.info(r.notice);let i=await Te(`status.get`,{});if(!t.current||P()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a?aj(`#/sessions/${encodeURIComponent(a)}`):r.notice||H.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&P()===n&&H.error(e instanceof Error?e.message:String(e))}}return(0,R.jsx)(X,{label:`Open task conversation`,text:`Conversation`,icon:ph,shortcut:`O`,onClick:()=>void n()})}function E1(e){let{row:t}=e,n=t.kind===`plan`,r=xj(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=sA(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,R.jsx)(h1,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,R.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-5`,"aria-label":t.title,children:[(0,R.jsx)(w1,{...e}),(0,R.jsx)(b1,{row:t,task:a}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,R.jsx)(C$,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?.delivery?(0,R.jsx)(L$,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,R.jsx)(u1,{detail:r.data,finished:!o}):null,(0,R.jsx)(H$,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,R.jsx)(d1,{detail:r.data}):null,r.error&&!r.data?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function D1({row:e}){return e.check===`open`&&e.progress?(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,R.jsx)(FQ,{done:e.progress.done,total:e.progress.total}),(0,R.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function O1(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function k1({row:e,card:t}){return(0,R.jsxs)(R.Fragment,{children:[t?(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:e.status.replaceAll(`_`,` `)}):null,e.check===`open`?(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:X$(e)}):null,e.kind===`plan`?null:(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,R.jsx)(C$,{timing:e.timing,...e.work?{work:e.work}:{},stopped:e.check!==`open`})}),e.delivery?(0,R.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})}function A1({row:e,selected:t,onSelect:n,card:r=!1}){return(0,R.jsx)(`li`,{className:r?`overflow-hidden rounded-lg border border-input bg-card shadow-sm`:void 0,children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,R.jsx)(IQ,{check:e.check,className:`mt-0.5`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[W$[e.check],`:`]}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,O1(e),t&&`font-medium text-foreground`),children:e.title}),(0,R.jsx)(D1,{row:e})]}),(0,R.jsx)(k1,{row:e,card:r})]})})}function j1({rows:e,selectedId:t,onSelect:n}){return(0,R.jsx)(`div`,{className:`flex flex-col pb-2`,children:Z$(e).map(({section:e,rows:r})=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:PU,children:(0,R.jsx)(KH,{title:U$[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,R.jsx)(`ul`,{className:NU,children:r.map(e=>(0,R.jsx)(A1,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var M1=()=>aj(ij(`tasks`,`board`)),N1=e=>aj(ij(`tasks`,`board`,e)),P1=[`Backlog`,`In progress`,`Completed`];function F1(e){if(e.kind!==`archived`&&e.section!==`archived`)return e.check===`done`?`Completed`:e.kind===`plan`||e.status===`created`||e.check===`dropped`?`Backlog`:`In progress`}function I1({title:e,rows:t,id:n}){return(0,R.jsxs)(iq,{role:`region`,"aria-label":e,spacing:`sm`,className:`min-w-0 max-md:rounded-lg`,children:[(0,R.jsx)(oq,{className:`py-2`,children:(0,R.jsxs)(`h2`,{className:`flex items-center justify-between gap-2 text-sm font-semibold`,children:[e,(0,R.jsx)(jU,{variant:`secondary`,radius:`full`,children:t.length})]})}),(0,R.jsxs)(aq,{children:[(0,R.jsx)(`ul`,{className:`flex flex-col gap-3`,children:t.map(e=>(0,R.jsx)(A1,{row:e,selected:e.id===n,onSelect:N1,card:!0},`${e.kind}-${e.id}`))}),t.length?null:(0,R.jsx)(`p`,{className:`py-4 text-sm text-muted-foreground`,children:`No tasks here.`})]})]})}function L1({rows:e,id:t}){return(0,R.jsx)(`div`,{className:`grid min-w-0 items-start gap-4 p-4 max-md:gap-3 max-md:p-3 md:grid-cols-3`,"aria-label":`Task board`,children:P1.map(n=>(0,R.jsx)(I1,{title:n,rows:e.filter(e=>F1(e)===n),id:t},n))})}function R1({id:e}){let t=xj(`tasks.list`,{},[`tasks`,`plans`]),n=t.data?.rows??[],r=n.find(t=>t.id===e&&F1(t)!==void 0),i=r?.kind===`task`?r.id:void 0;if((0,m.useEffect)(()=>(OQ(i),()=>OQ(void 0)),[i]),!t.data&&t.error)return(0,R.jsx)(yj,{message:`Could not load tasks. ${t.error}`,onRetry:t.reload});let a=r?(0,R.jsx)(E1,{row:r,onGone:M1,onChanged:t.reload},r.id):null;return(0,R.jsx)(iM,{wide:!1,list:t.data?(0,R.jsx)(L1,{rows:n,id:e}):(0,R.jsx)(oM,{}),detail:a,open:!!r,onClose:M1,hint:`Select a task to see its detail.`,describe:`Task detail`})}var z1=()=>aj(ij(`tasks`)),B1=e=>aj(ij(`tasks`,e));function V1(){return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)($m,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{children:q$})]}),(0,R.jsx)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:()=>aj(ij(`plan`)),children:`Plan a task`})]})}function H1({shown:e,count:t,onToggle:n}){return(0,R.jsxs)(`label`,{className:`btn-raised flex h-7 min-w-0 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow] max-md:h-11 max-md:min-w-11`,children:[(0,R.jsx)(kG,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,R.jsx)(jU,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function U1({id:e,board:t=!1}){return(0,R.jsxs)(ok,{value:t?`board`:`list`,onValueChange:e=>aj(ij(`tasks`,...e===`board`?[`board`]:[])),className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(sk,{"aria-label":`Task views`,className:`flex gap-1 border-b border-border px-4 py-2 max-md:px-3 max-md:py-1.5`,children:[(0,R.jsx)(ck,{value:`list`,className:`rounded-lg border border-input px-3 py-1.5 text-sm text-muted-foreground data-[state=active]:bg-tab-fill data-[state=active]:text-foreground focus-visible:ring-3 focus-visible:ring-ring`,children:`List`}),(0,R.jsx)(ck,{value:`board`,className:`rounded-lg border border-input px-3 py-1.5 text-sm text-muted-foreground data-[state=active]:bg-tab-fill data-[state=active]:text-foreground focus-visible:ring-3 focus-visible:ring-ring`,children:`Board`})]}),(0,R.jsx)(lk,{value:`list`,className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(W1,{id:e})}),(0,R.jsx)(lk,{value:`board`,className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(R1,{id:e})})]})}function W1({id:e}){let t=eM(),[n,r]=(0,m.useState)(!1),i=xj(`tasks.list`,{},[`tasks`,`plans`]),a=xj(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=n?[...o,...s]:o,l=e??(t?c[0]?.id:void 0),u=[...c,...s].find(e=>e.id===l&&e.kind===`task`)?.id;if((0,m.useEffect)(()=>(OQ(u),()=>OQ(void 0)),[u]),!i.data&&i.error)return(0,R.jsx)(yj,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,R.jsx)(V1,{});let d=[...c,...s].find(e=>e.id===l),f=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Tasks`,count:Q$(c),children:(0,R.jsx)(H1,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,R.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:q$}):(0,R.jsx)(j1,{rows:c,selectedId:l,onSelect:B1}):(0,R.jsx)(oM,{})]}),p=d?(0,R.jsx)(E1,{row:d,onGone:z1,onChanged:i.reload},d.id):e?(0,R.jsx)(G1,{}):null;return(0,R.jsx)(iM,{wide:t,list:f,detail:p,open:!!e,onClose:z1,hint:`Select a task to see its detail.`,describe:`Task detail`})}function G1(){return(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var K1={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,s:`sessions`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function q1(){return cA(`(max-width: 767.98px)`)?(0,R.jsxs)(`section`,{className:`flex min-h-full flex-1 flex-col items-center justify-center gap-4 px-6 py-12 text-center`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-medium`,children:`Metrics is unavailable on phones.`}),(0,R.jsx)(`a`,{href:`#/lobby`,className:`btn-tint inline-flex min-h-11 items-center justify-center rounded-lg border px-5 text-sm font-medium focus-visible:ring-3 focus-visible:ring-ring/40`,children:`Lobby`})]}):(0,R.jsx)(lJ,{})}function J1(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function Y1(e){if(e.kind===`settings`)return(0,R.jsx)(LX,{});if(e.kind===`sessions`)return(0,R.jsx)(_$,{id:J1(e.key?[e.key]:[])});switch(e.tab){case`lobby`:return(0,R.jsx)(nq,{});case`tasks`:return(0,R.jsx)(U1,{...OG(e.rest)});case`plan`:return(0,R.jsx)(rQ,{rest:e.rest});case`quickfix`:return(0,R.jsx)(CQ,{id:J1(e.rest)});case`issues`:return(0,R.jsx)(hW,{rest:e.rest});case`metrics`:return(0,R.jsx)(q1,{});case`git`:return(0,R.jsx)(HU,{rest:e.rest});case`knowledge`:return(0,R.jsx)(DG,{rest:e.rest});case`excalidraw`:return(0,R.jsx)(FK,{id:J1(e.rest)})}}function X1(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var Z1={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,home:`Home`,end:`End`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function Q1(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:Z1[e]}function $1(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=Q1(n);if(!e)return;t.code=e}return t.code?t:void 0}function e0(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function t0(e,t){let n=$1(t);return n?e0(e,n):!1}function n0(e,t){for(let n of t)if(t0(e,n.key))return n.action}function r0(e,t){for(let n of t)if(t0(e,n.key))return n.id}function i0(e){return Oj(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||ZA()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function a0(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)Pj(e.key===`j`?1:-1);else return!1;return!0}function o0(e,t){let n=r0(e,t.tabs),r=n0(e,t.keys);return!n&&!r?!1:X1(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||ZA(),typing:Oj(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function s0(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=K1[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(a0(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function c0(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){n0(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&i0(n)){t=0;return}if(o0(n,e)){t=0;return}t=r?s0(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var l0=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],u0=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(K1).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],d0=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`quickfix`,page:`Quick fix`,keys:[[`R`,`run anyway`],[`T`,`make a task`],[`C`,`cancel`]]},{id:`git`,page:`Git`,keys:[[`R`,`refresh`],[`V`,`review`],[`Q`,`Jev's read`],[`X`,`stop`]]},{id:`issues`,page:`Issues`,keys:[[`R`,`refresh`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`excalidraw`,page:`Excalidraw`,keys:[[`R`,`reveal`],[`C`,`copy`],[`O`,`open`],[`W`,`draw`],[`T`,`check`],[`Delete`,`remove`]]},{id:`sessions`,page:`Sessions`,keys:[[`M`,`move here`],[`S`,`stop`],[`B`,`back`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],f0=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],p0=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function m0({line:e}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,R.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,R.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,R.jsx)(Zk,{children:e},e))}):(0,R.jsx)(rA,{chord:e.label??``})}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function h0(){return(0,R.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),d0.map(e=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,R.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(rA,{chord:e}),t]},e))})]},e.id))]})}function g0({title:e,lines:t}){return(0,R.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,R.jsx)(m0,{line:e},e.id))]})}function _0(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function v0(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function y0({open:e,onOpenChange:t,keys:n,tabs:r}){let i=cA(`(max-width: 767.98px)`),a=e&&!i,o=XA(a,YA.help);return(0,m.useEffect)(()=>{i&&e&&t(!1)},[i,e,t]),(0,m.useEffect)(()=>{if(!a||!o)return;let e=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&t0(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[n,t,o,a]),i?null:(0,R.jsxs)(HA,{open:a&&o,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,R.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(rA,{chord:`Esc`}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,R.jsx)(Vg,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-10 gap-y-6 overflow-y-auto px-6 py-5 md:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsx)(g0,{title:`Everywhere`,lines:_0(n)}),(0,R.jsx)(g0,{title:`Jump to a tab`,lines:v0(r)}),(0,R.jsx)(g0,{title:`Navigation and editing`,lines:u0}),(0,R.jsx)(g0,{title:`Message box`,lines:l0})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsx)(g0,{title:`Lists and panes`,lines:f0}),(0,R.jsx)(h0,{}),(0,R.jsx)(g0,{title:`Questions`,lines:p0})]})]})]})}function b0(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function x0(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(F(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Ce(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Ce(r.error,r.code,n.status);return r.result}function S0(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function C0(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var w0=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function T0(e,t){let n=e.lastIndexOf(`
96
+ .dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,R.jsxs)(`div`,{className:`flex items-center gap-1 max-md:flex-wrap`,children:[(0,R.jsx)(`input`,{ref:l,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{d(e.target.files?.[0]),e.target.value=``}}),(0,R.jsx)(X,{label:`Save and apply the pasted theme`,text:`Save theme`,icon:zp,tone:`primary`,disabled:!t.trim()||s,onClick:()=>void u(t,`Custom theme`)}),(0,R.jsx)(X,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:kg,disabled:s,onClick:()=>l.current?.click()}),a?(0,R.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive max-md:ml-0 max-md:basis-full`,children:a}):null]})]})}function fX(){let{theme:e,setTheme:t}=TY(),n=xJ();return(0,R.jsx)(qH,{prominent:!0,title:LY.appearance,children:(0,R.jsxs)(hY,{children:[(0,R.jsx)(mY,{label:`Prompt sounds`,help:`A droplet for each new actionable prompt or delivery review. Kept in this browser; sound starts after interaction. Desktop notifications remain separate.`,children:(0,R.jsx)(GJ,{checked:!n,onCheckedChange:e=>yJ(!e),"aria-label":`Prompt sounds`})}),(0,R.jsx)(mY,{label:iX.themeLabel,help:iX.appearanceHelp,children:(0,R.jsx)(gY,{value:e,items:iX.themeItems.map(e=>({value:e.id,label:e.label})),label:iX.themeLabel,onChange:e=>t(e)})}),(0,R.jsx)(mY,{label:`Colour theme`,help:`The page's colours, the same in every pi session.`,stacked:!0,children:(0,R.jsx)(cX,{})}),(0,R.jsx)(mY,{label:`Saved themes`,help:`Themes you imported, kept with pi for every session and project.`,stacked:!0,children:(0,R.jsx)(uX,{})}),(0,R.jsx)(mY,{label:`Import a theme`,stacked:!0,children:(0,R.jsx)(dX,{})})]})})}var pX={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},mX=[...RY,...zY.map(e=>({id:`panel:${e.id}`,label:e.label,help:BY}))];function hX(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs,mcpTools:e.scout.mcpTools};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function gX(e,t){return pX[e].reduceRight((e,t)=>({[t]:e}),t)}function _X(e,t){return e.find(e=>e.id===t)?.thinkingLevels??IY}function vX(e,t){return IY[rY(IY,e,Math.max(0,IY.indexOf(t)))]??t}var yX=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,bX=e=>e>0?`over ${e} steps`:`never`;function xX({label:e,children:t}){return(0,R.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function SX(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)(``),a=e.models.some(t=>t.id===e.value),o=[...e.inherit?[{value:kY,label:AY,help:jY}]:[],...e.none?[{value:kY,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:kY,label:AY,help:jY}]:[],...e.models.map(e=>({value:e.id,label:e.id,...e.label&&e.label!==e.id?{help:e.label}:{}})),...!a&&e.value!==`inherit`?[{value:e.value,label:e.value,help:PY}]:[],{value:MY,label:NY,help:PY}],s=t=>{if(t!==`__custom__`)return e.onChange(t);i(a?``:e.value),n(!0)},c=()=>{let t=r.trim();n(!1),t&&t!==e.value&&e.onChange(t)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(gY,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,R.jsx)(Uq,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,className:`min-w-0 flex-1 max-md:h-11 max-md:min-h-11`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,R.jsx)(X,{label:`Use this model`,icon:zp,tone:`primary`,onClick:c})]}):null]})}function CX({label:e,help:t,checked:n,onChange:r}){return(0,R.jsxs)(`div`,{className:`flex min-h-0 items-center justify-between gap-4 max-md:min-h-11 max-md:items-start`,children:[(0,R.jsxs)(`div`,{className:`min-w-0`,children:[(0,R.jsx)(`div`,{className:`break-words text-[0.8125rem] font-medium`,children:e}),t?(0,R.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:t}):null]}),(0,R.jsx)(GJ,{checked:n,onCheckedChange:r,"aria-label":e})]})}function wX({value:e,onSave:t,placeholder:n,label:r}){let[i,a]=(0,m.useState)(e);(0,m.useEffect)(()=>a(e),[e]);let o=()=>{let n=i.trim();n!==e&&t(n)};return(0,R.jsx)(Uq,{value:i,placeholder:n,"aria-label":r,className:`max-md:h-11 max-md:min-h-11`,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function TX({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,R.jsx)(DX,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(H.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function EX({value:e,onSave:t}){return(0,R.jsx)(DX,{label:qY,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(H.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function DX({label:e,value:t,min:n,max:r,suffix:i,onSave:a}){let[o,s]=(0,m.useState)(t);(0,m.useEffect)(()=>s(t),[t]);let c=()=>{o!==t&&(a(o.trim())||s(t))};return(0,R.jsxs)(`div`,{className:`relative`,children:[(0,R.jsx)(Uq,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:q(i?`pr-10`:void 0,`max-md:h-11 max-md:min-h-11`),onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-y-0 right-2.5 flex items-center text-xs text-muted-foreground`,children:i}):null]})}function OX({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,R.jsx)(sM,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function kX({kind:e,config:t,models:n,save:r}){let i=hX(t,e),a=t=>r(gX(e,t)),o=DY[e],s=_X(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!_X(n,t).includes(i.thinking)&&(r.thinking=vX(_X(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:vX(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,R.jsxs)(`section`,{className:q(rq({spacing:`default`}),`glass min-w-0`),children:[(0,R.jsxs)(oq,{className:`flex-row items-baseline justify-between gap-3 py-3 max-md:flex-col max-md:items-start`,children:[(0,R.jsx)(`h3`,{className:`text-sm font-semibold max-md:max-w-full max-md:break-words`,children:o}),(0,R.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground max-md:min-w-0 max-md:max-w-full max-md:break-words max-md:overflow-visible max-md:text-clip max-md:whitespace-normal`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,R.jsxs)(aq,{className:`flex min-w-0 flex-col gap-3`,children:[(0,R.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,R.jsx)(xX,{label:OY.model,children:(0,R.jsx)(SX,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,R.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3 max-md:items-start max-md:[&_[role=slider]]:h-11`,children:[e===`scout`?(0,R.jsx)(XJ,{level:l}):null,(0,R.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:OY.thinking}),(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,R.jsx)(cY,{value:i.thinking,levels:IY,supported:s,recommended:FY[e],model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,R.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3 max-md:flex-wrap max-md:items-start`,children:[u?(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":d,onClick:()=>f(e=>!e),className:`flex min-h-8 max-w-full items-center gap-1 rounded-md text-left text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30 max-md:h-auto max-md:min-h-11`,children:[(0,R.jsx)(Gp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),OY.instructions,!d&&i.instructions?(0,R.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,R.jsx)(`span`,{}),e===`master`?null:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 max-md:flex-wrap`,children:[(0,R.jsx)(`span`,{className:`break-words text-xs text-muted-foreground`,children:`Time limit`}),(0,R.jsx)(`div`,{className:`w-24`,children:(0,R.jsx)(TX,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,R.jsx)(OX,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null,(0,R.jsx)(OX,{value:(i.mcpTools??[]).join(`
97
+ `),label:`${o} MCP tool grants (one exact tool name per line)`,onSave:e=>a({mcpTools:e.split(/\s+/).filter(Boolean)})}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Grant exact names such as mcp__github__get_issue. Children inherit these grants; read-only agents also require read-only tools.`})]})]})}function AX(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function jX({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,R.jsx)(CX,{label:t.label,help:t.help,checked:AX(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function MX({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,R.jsx)(qH,{prominent:!0,title:LY.workflow,children:(0,R.jsx)(hY,{children:(0,R.jsx)(mY,{label:QY,help:ZY.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,R.jsx)(gY,{value:n,items:ZY.map(e=>({value:e.id,label:e.label})),label:QY,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}var NX=e=>e?`${e}/`:eX.top;function PX(e){return e.split(/[\s,]+/).map(e=>e.trim()).filter(Boolean)}function FX({replaced:e}){let t=xj(`settings.linters`,{},[]),n=t.data?.linters;return(0,R.jsx)(mY,{label:eX.found,help:e?eX.foundReplaced:eX.foundHelp,children:n?n.length===0?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:eX.foundNone}):(0,R.jsx)(`ul`,{"aria-label":eX.found,className:q(`flex flex-col gap-1.5 md:items-end`,e&&`opacity-60`),children:n.map(e=>(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:`min-w-0 break-words font-medium`,children:e.tool}),(0,R.jsx)(`span`,{className:`min-w-0 break-words text-xs text-muted-foreground`,children:NX(e.folder)}),(0,R.jsxs)(`span`,{title:e.installed?void 0:eX.missingHelp,className:q(`inline-flex shrink-0 items-center gap-1 text-xs`,e.installed?`text-success`:`text-warning`),children:[e.installed?(0,R.jsx)(tm,{"aria-hidden":`true`,className:`size-3.5`}):(0,R.jsx)($p,{"aria-hidden":`true`,className:`size-3.5`}),e.installed?eX.installed:eX.missing]})]},`${e.tool}:${e.folder}`))}):(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:t.error?t.error:`Looking…`})})}function IX({config:e,save:t}){let n=e.lint,r=n.mode===`off`,i=n.command.trim().length>0;return(0,R.jsxs)(qH,{prominent:!0,title:LY.lint,children:[(0,R.jsx)(`p`,{className:`max-w-3xl text-sm text-muted-foreground`,children:eX.intro}),(0,R.jsxs)(hY,{children:[(0,R.jsx)(mY,{label:eX.mode,help:$Y.find(e=>e.id===n.mode)?.help,children:(0,R.jsx)(gY,{value:n.mode,items:$Y.map(e=>({value:e.id,label:e.label})),label:eX.mode,onChange:e=>void t({lint:{mode:e}})})}),(0,R.jsxs)(`div`,{className:q(`flex flex-col divide-y divide-border [&>*]:py-3 [&>*:first-child]:pt-0 [&>*:last-child]:pb-0`,r&&`opacity-60`),"aria-disabled":r||void 0,children:[(0,R.jsx)(mY,{label:eX.command,help:eX.commandHelp,children:(0,R.jsx)(wX,{value:n.command,label:eX.command,placeholder:eX.commandPlaceholder,onSave:e=>void t({lint:{command:e}})})}),i?(0,R.jsx)(mY,{label:eX.extensions,help:eX.extensionsHelp,children:(0,R.jsx)(wX,{value:n.extensions.join(` `),label:eX.extensions,placeholder:eX.extensionsPlaceholder,onSave:e=>void t({lint:{extensions:PX(e)}})})}):null,(0,R.jsx)(mY,{label:eX.timeout,help:eX.timeoutHelp,children:(0,R.jsx)(TX,{value:n.timeoutMs,label:`Lint ${eX.timeout.toLowerCase()}`,onSave:e=>void t({lint:{timeoutMs:e}})})}),(0,R.jsx)(FX,{replaced:i})]})]})]})}function LX({config:e,save:t}){let n=e.lobby.web;return(0,R.jsx)(qH,{prominent:!0,title:LY.lobby,children:(0,R.jsxs)(hY,{children:[mX.map(n=>(0,R.jsx)(jX,{config:e,item:n,save:t},n.id)),(0,R.jsx)(mY,{label:VY,help:HY,children:(0,R.jsx)(gY,{value:String(e.lobby.maxPlanningRounds),items:UY.map(e=>({value:String(e),label:yX(e)})),label:VY,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,R.jsx)(mY,{label:WY,help:GY,children:(0,R.jsx)(gY,{value:String(e.lobby.splitPlanAbove),items:KY.map(e=>({value:String(e),label:bX(e)})),label:WY,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,R.jsx)(mY,{label:qY,help:JY,children:(0,R.jsx)(EX,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,R.jsx)(CX,{label:YY,help:XY,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function RX({value:e,models:t,classifiers:n,onChange:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(``),c=new Set([...n.map(e=>e.id),...t.map(e=>e.id)]),l=[{value:``,label:rX.engineJev,help:rX.engineJevHelp},...n.map(e=>({value:e.id,label:e.id,help:`${rX.engineClassifier}${e.label===e.id?``:` · ${e.label}`}`})),...t.map(e=>({value:e.id,label:e.id,help:`${rX.engineChat}${e.label&&e.label!==e.id?` · ${e.label}`:``}`})),...e&&!c.has(e)?[{value:e,label:e,help:PY}]:[],{value:MY,label:NY,help:PY}],u=t=>{if(t!==`__custom__`)return r(t);s(c.has(e)?``:e),a(!0)},d=()=>{let t=o.trim();a(!1),t!==e&&r(t)};return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(gY,{value:e,items:l,label:rX.engine,onChange:u}),i?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-start gap-2`,children:[(0,R.jsx)(Uq,{autoFocus:!0,value:o,placeholder:`provider/model`,"aria-label":`Classifier model id`,className:`min-w-0 flex-1 max-md:h-11 max-md:min-h-11`,onChange:e=>s(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),d())}}),(0,R.jsx)(X,{label:`Use this model`,icon:zp,tone:`primary`,onClick:d})]}):null]})}function zX({config:e,models:t,classifiers:n,save:r}){let i=e.classifier,a=tX.find(e=>e.id===i.provider)?.label,o=!i.engine;return(0,R.jsx)(qH,{prominent:!0,title:LY.classifier,children:(0,R.jsxs)(hY,{children:[(0,R.jsx)(CX,{label:rX.enabled,help:rX.enabledHelp,checked:i.enabled,onChange:e=>void r({classifier:{enabled:e}})}),(0,R.jsx)(mY,{label:rX.engine,help:rX.engineHelp,children:(0,R.jsx)(RX,{value:i.engine,models:t,classifiers:n,onChange:e=>void r({classifier:{engine:e}})})}),o?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(mY,{label:rX.host,children:(0,R.jsx)(gY,{value:i.provider,items:tX.map(e=>({value:e.id,label:e.label})),label:rX.host,onChange:e=>void r({classifier:{provider:e}})})}),(0,R.jsx)(mY,{label:rX.model,help:rX.modelHelp,children:(0,R.jsx)(wX,{value:i.model,label:rX.model,placeholder:`the host's default`,onSave:e=>void r({classifier:{model:e}})})}),(0,R.jsx)(mY,{label:rX.key,help:rX.keyNote,children:(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground md:text-right`,children:a??i.provider})})]}):null,nX.map(e=>(0,R.jsx)(CX,{label:e.label,help:e.help,checked:i.features[e.id],onChange:t=>void r({classifier:{features:{[e.id]:t}}})},e.id)),(0,R.jsx)(mY,{label:rX.cheap,help:rX.cheapHelp,children:(0,R.jsx)(SX,{value:i.effort.cheapModel,models:t,label:rX.cheap,none:!0,onChange:e=>void r({classifier:{effort:{cheapModel:e}}})})})]})})}function BX(){let e=MJ(),t=async e=>{if(!e)return PJ();let t=await NJ();t===`granted`?H.success(iX.notificationsOn):H.error(t===`unsupported`?iX.notificationsUnsupported:iX.notificationsBlocked)};return(0,R.jsx)(qH,{prominent:!0,title:LY.notifications,children:(0,R.jsx)(hY,{children:(0,R.jsx)(CX,{label:iX.notificationsLabel,help:iX.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function VX(){let{available:e,install:t}=y(),n=b(),r=x();return(0,R.jsx)(qH,{prominent:!0,title:LY.install,children:(0,R.jsxs)(hY,{children:[(0,R.jsx)(mY,{label:iX.installLabel,help:n?iX.installedNow:iX.installHelp,children:n?null:(0,R.jsx)(`div`,{className:`flex md:justify-end`,children:(0,R.jsx)(X,{label:iX.installButton,icon:Cm,tone:`primary`,onClick:()=>e?void t().then(()=>H.success(iX.installDone)):H.warning(iX.installUnavailable)})})}),r.supported?(0,R.jsx)(mY,{label:iX.fullscreenLabel,help:iX.fullscreenHelp,children:(0,R.jsx)(`div`,{className:`flex md:justify-end`,children:(0,R.jsx)(X,{label:r.on?iX.fullscreenOn:iX.fullscreenOff,icon:r.on?_h:rh,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var HX=[`Agents`,`Workflow`,`Linting`,`Lobby`,`Classifier`,`Appearance & notifications`];function UX({config:e,models:t,classifierModels:n=[],onConfig:r}){let[i,a]=(0,m.useState)(`Agents`),o=(0,m.useRef)(Promise.resolve()),s=e=>{let t=async()=>{try{return r((await Te(`settings.set`,{patch:e})).config),H.success(iX.saved),!0}catch(e){return H.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},n=o.current.then(t,t);return o.current=n,n};return(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock md:px-8 md:pt-8`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:iX.title}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:iX.intro})]}),(0,R.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 min-w-0 flex flex-wrap gap-1 border-b border-border pb-3 max-md:flex-nowrap max-md:overflow-x-auto max-md:overscroll-x-contain max-md:pb-2`,children:HX.map(e=>(0,R.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":i===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>a(e),className:q(`h-8 rounded-lg border border-transparent px-3 text-sm font-medium outline-none transition-[box-shadow,color] focus-visible:ring-3 focus-visible:ring-ring/40 max-md:min-h-11 max-md:h-auto max-md:shrink-0 max-md:whitespace-nowrap`,i===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,R.jsx)(`div`,{id:`settings-Agents`,hidden:i!==`Agents`,"aria-hidden":i!==`Agents`,children:(0,R.jsx)(qH,{prominent:!0,title:LY.agents,children:(0,R.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:EY.map(n=>(0,R.jsx)(kX,{kind:n,config:e,models:t,save:s},n))})})}),(0,R.jsx)(`div`,{id:`settings-Workflow`,hidden:i!==`Workflow`,"aria-hidden":i!==`Workflow`,children:(0,R.jsx)(MX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Linting`,hidden:i!==`Linting`,"aria-hidden":i!==`Linting`,children:(0,R.jsx)(IX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Lobby`,hidden:i!==`Lobby`,"aria-hidden":i!==`Lobby`,children:(0,R.jsx)(LX,{config:e,save:s})}),(0,R.jsx)(`div`,{id:`settings-Classifier`,hidden:i!==`Classifier`,"aria-hidden":i!==`Classifier`,children:(0,R.jsx)(zX,{config:e,models:t,classifiers:n,save:s})}),(0,R.jsx)(`div`,{id:`settings-Appearance`,hidden:i!==`Appearance & notifications`,"aria-hidden":i!==`Appearance & notifications`,children:(0,R.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,R.jsx)(fX,{}),(0,R.jsx)(BX,{}),(0,R.jsx)(VX,{})]})})]})}function WX(){return(0,R.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock md:px-8 md:pt-8`,role:`status`,"aria-label":iX.loading,children:[0,1,2,3].map(e=>(0,R.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function GX(){let e=xj(`settings.get`,{},[`status`]),[t,n]=(0,m.useState)(),r=(0,m.useRef)(0),i=(0,m.useCallback)(e=>{r.current=performance.now(),n(e)},[]);return(0,m.useEffect)(()=>{e.data&&e.requestedAt>r.current&&n(e.data.config)},[e.data,e.requestedAt]),!t&&e.error?(0,R.jsx)(yj,{message:`${iX.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,R.jsx)(UX,{config:t,models:e.data?.models??[],classifierModels:e.data?.classifierModels??[],onConfig:i}):(0,R.jsx)(WX,{})}function KX(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var qX=`default-src 'none'; script-src 'none'; style-src 'unsafe-inline'; img-src 'none'; font-src 'none'; connect-src 'none'; media-src 'none'; frame-src 'none'; object-src 'none'; form-action 'none'; base-uri 'none'`,JX=new Set(`div span p br hr h1 h2 h3 h4 h5 h6 section article header footer main aside nav ul ol li dl dt dd strong em b i u s small sub sup blockquote pre code table thead tbody tfoot tr th td caption colgroup col figure figcaption style`.split(` `)),YX=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function XX(e){if(!e||typeof e!=`object`)return;let t=e;if(!(typeof t.html!=`string`||t.html.length>1e5)&&!(t.css!==void 0&&(typeof t.css!=`string`||t.css.length>5e4)))return{html:t.html,...typeof t.css==`string`?{css:t.css}:{}}}function ZX(e){let t=e.replace(/\/\*[\s\S]*?\*\//g,``);return/\\|@import|url\s*\(|image-set\s*\(|expression\s*\(|behavior\s*:|-moz-binding/i.test(t)?``:t.replace(/<\/?style/gi,``)}function QX(e){if(!JX.has(e.localName)||e.namespaceURI!==`http://www.w3.org/1999/xhtml`){e.remove();return}for(let t of[...e.attributes])t.name===`style`?e.setAttribute(`style`,ZX(t.value)):YX.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=ZX(e.textContent??``));for(let t of[...e.children])QX(t)}function $X(e,t){try{return eZ(e,t??KX())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${qX}"><meta name="referrer" content="no-referrer"></head><body><p role="status">Static mockup unavailable. The preview could not be safely rendered.</p></body></html>`}}function eZ(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])QX(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${qX}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${ZX(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function tZ({preview:e,label:t,className:n,frameWidth:r,minWidth:i,onOpen:a}){let o=(0,m.useMemo)(()=>$X(e),[e]),s=(0,m.useRef)(null),[c,l]=(0,m.useState)();if((0,m.useLayoutEffect)(()=>{let e=s.current;if(!r&&!i||!e)return;let t=()=>l({width:e.clientWidth,height:e.clientHeight});if(t(),typeof ResizeObserver>`u`)return;let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r,i]),!r&&!i)return(0,R.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,className:q(`h-80 w-full rounded-lg border bg-background`,n)});let u=r??Math.max(c?.width??0,i??0),d=c&&c.width>0&&u>0?Math.min(1,c.width/u):1;return(0,R.jsxs)(`div`,{ref:s,className:q(`group/mock relative h-80 w-full max-w-full overflow-hidden rounded-lg border bg-background max-md:min-h-0 max-md:max-h-full max-md:overflow-x-hidden max-md:overflow-y-auto max-md:overscroll-contain`,n),children:[(0,R.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:o,tabIndex:a?-1:void 0,className:q(`absolute top-0 left-0 origin-top-left border-0`,a&&`pointer-events-none`),style:{width:u||`100%`,height:c?c.height/d:`100%`,transform:`scale(${d})`}}),a?(0,R.jsx)(`button`,{type:`button`,"data-compact":``,onClick:a,"aria-label":`Expand the mockup: ${t}`,className:`absolute inset-0 flex items-end justify-end p-2 outline-none focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:ring-inset max-md:p-3`,children:(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-md border border-border bg-card/90 px-1.5 py-0.5 text-[0.6875rem] font-medium text-muted-foreground opacity-0 shadow-sm backdrop-blur transition-opacity group-hover/mock:opacity-100 group-focus-within/mock:opacity-100`,children:[(0,R.jsx)(th,{"aria-hidden":`true`,className:`size-3`}),`Expand`]})}):null]})}var nZ=/\s*\(recommended\)\s*$/i,rZ=1024,iZ=`(max-width: 767.98px)`,aZ=`max-md:hidden`,oZ=e=>e.replace(nZ,``);function sZ(e){return!!(e&&(e.htmlPreview||e.image||e.preview))}function cZ({option:e}){let t=oZ(e.label);return sZ(e)?(0,R.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[e.htmlPreview?(0,R.jsx)(tZ,{preview:e.htmlPreview,label:t,minWidth:rZ,className:`h-auto min-h-[18rem] flex-1`}):null,e.image?(0,R.jsx)(`img`,{src:F(e.image),alt:`Mockup: ${t}`,className:`min-h-0 w-full flex-1 rounded-lg border bg-background object-contain`}):null,e.preview?(0,R.jsx)(WH,{text:e.preview,className:q(`overflow-auto rounded-lg border bg-background p-4 text-sm`,!e.htmlPreview&&!e.image&&`flex-1`)}):null]}):(0,R.jsx)(`p`,{className:`grid h-full place-items-center p-6 text-sm text-muted-foreground`,children:`No mockup for this option.`})}function lZ({options:e,start:t,title:n,picked:r=[],multi:i=!1,onChoose:a,onClose:o,onIndex:s}){let c=xf(),l=cA(iZ),{keyboardOpen:u,keyboardInset:d}=BA(),f=(0,m.useRef)(null),p=(0,m.useRef)(null),[h,g]=(0,m.useState)(()=>Math.min(Math.max(0,t),e.length-1)),_=e[h],v=e.length-1;(0,m.useEffect)(()=>s?.(h),[h,s]),(0,m.useLayoutEffect)(()=>{let e=f.current;e&&(e.scrollLeft=h*e.clientWidth),p.current?.focus()},[]);let y=(0,m.useCallback)(e=>{let t=Math.min(Math.max(0,e),v),n=f.current;g(t),n?.scrollTo({left:t*n.clientWidth,behavior:c?`auto`:`smooth`})},[v,c]);(0,m.useEffect)(()=>{let e=f.current;if(!e||typeof ResizeObserver>`u`)return;let t=new ResizeObserver(()=>{e.scrollLeft=h*e.clientWidth});return t.observe(e),()=>t.disconnect()},[h]);function b(){let e=f.current;if(!e||e.clientWidth===0)return;let t=Math.round(e.scrollLeft/e.clientWidth);t!==h&&t>=0&&t<=v&&g(t)}function x(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=t.target;if(n.closest(`input, textarea, [contenteditable='true']`))return;let r={ArrowLeft:-1,ArrowRight:1,PageUp:-1,PageDown:1}[t.key];if(r){t.preventDefault(),y(h+r);return}if(t.key===`Home`||t.key===`End`){t.preventDefault(),y(t.key===`Home`?0:v);return}let i=Number(t.key);if(Number.isInteger(i)&&i>=1&&i<=e.length){t.preventDefault(),y(i-1);return}t.key===`Enter`&&a&&!(n instanceof HTMLButtonElement)&&(t.preventDefault(),a(h))}let S=r.includes(h),C=l&&u?{height:`calc(100vh - ${d}px - 1.5rem)`,maxHeight:`calc(100vh - ${d}px - 1.5rem)`}:void 0;return(0,R.jsxs)(`div`,{ref:p,tabIndex:-1,"data-autofocus":``,onKeyDown:x,style:C,className:`mockup-viewer flex h-full min-h-0 flex-col outline-none max-md:h-[calc(100svh-1.5rem)] max-md:max-h-[calc(100svh-1.5rem)]`,role:`region`,"aria-label":`Mockups: ${n}`,"aria-roledescription":`carousel`,children:[(0,R.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2 border-b border-border px-4 py-3 sm:px-5`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Back to the question`,title:l?`Back to the question`:`Back · Esc`,onClick:()=>o(h),className:`max-md:size-11`,children:(0,R.jsx)(hh,{"aria-hidden":`true`})}),(0,R.jsx)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium`,children:n}),(0,R.jsxs)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,"aria-live":`polite`,children:[h+1,` of `,e.length]}),(0,R.jsx)(`div`,{role:`tablist`,"aria-label":`Options`,className:`flex w-full flex-wrap gap-1.5 sm:w-auto`,children:e.map((e,t)=>(0,R.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":t===h,"aria-controls":`mockup-slide-${t}`,"data-compact":``,onClick:()=>y(t),className:q(`inline-flex h-7 max-w-48 items-center gap-1 rounded-lg border px-2.5 text-xs font-medium transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring/40 max-md:h-11 max-md:min-w-11`,t===h?`border-primary/50 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,R.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:t+1}),(0,R.jsx)(`span`,{className:`truncate`,children:oZ(e.label)}),r.includes(t)?(0,R.jsx)(zp,{"aria-label":`picked`,className:`size-3 text-primary`}):null]},t))})]}),(0,R.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[(0,R.jsx)(`div`,{ref:f,onScroll:b,className:`mockup-track flex h-full snap-x snap-mandatory overflow-x-auto overflow-y-hidden overscroll-x-contain`,children:e.map((t,n)=>(0,R.jsxs)(`section`,{id:`mockup-slide-${n}`,role:`tabpanel`,"aria-roledescription":`slide`,"aria-label":`${n+1} of ${e.length}: ${oZ(t.label)}`,"aria-hidden":n!==h,className:`flex h-full w-full shrink-0 snap-center snap-always flex-col gap-2 overflow-y-hidden px-4 py-4 sm:px-14 max-md:overflow-y-auto max-md:overscroll-contain`,children:[(0,R.jsxs)(`div`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,R.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[n+1,`.`]}),(0,R.jsx)(`span`,{className:`font-medium`,children:oZ(t.label)}),nZ.test(t.label)?(0,R.jsx)(`span`,{className:`text-xs font-medium text-primary`,children:`Recommended`}):null,r.includes(n)?(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-xs text-primary`,children:[(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3`}),`picked`]}):null]}),t.description?(0,R.jsx)(WH,{text:t.description,className:`text-sm text-muted-foreground`}):null,(0,R.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,R.jsx)(cZ,{option:t})})]},n))}),h>0?(0,R.jsx)(Y,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Previous option`,title:l?`Previous option`:`Previous · ←`,onClick:()=>y(h-1),className:`absolute top-1/2 left-2 -translate-y-1/2 rounded-full max-md:hidden max-md:size-11`,children:(0,R.jsx)(Up,{"aria-hidden":`true`})}):null,h<v?(0,R.jsx)(Y,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Next option`,title:l?`Next option`:`Next · →`,onClick:()=>y(h+1),className:`absolute top-1/2 right-2 -translate-y-1/2 rounded-full max-md:hidden max-md:size-11`,children:(0,R.jsx)(Gp,{"aria-hidden":`true`})}):null]}),(0,R.jsxs)(`footer`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 sm:px-5`,children:[(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`←→`,className:aZ,children:`option`}),a?(0,R.jsx)(iA,{chord:`Enter`,className:aZ,children:i?S?`unpick`:`pick`:`choose`}):null,(0,R.jsx)(iA,{chord:`Esc`,className:aZ,children:`back`})]}),a&&_?(0,R.jsxs)(Y,{type:`button`,onClick:()=>a(h),className:`max-w-full max-md:min-h-11 max-md:min-w-11`,children:[i&&S?`Unpick`:i?`Pick`:`Choose`,(0,R.jsx)(`span`,{className:`truncate`,children:oZ(_.label)})]}):null]})]})}function uZ(e,t,n){e.nativeEvent.isComposing||(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),n()),e.key===`Enter`&&e.ctrlKey&&(e.preventDefault(),e.stopPropagation(),t()))}function dZ({text:e,disabled:t=!1,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),[o,s]=(0,m.useState)(!1),[c,l]=(0,m.useState)(``),u=(0,m.useRef)(null);(0,m.useEffect)(()=>{u.current?.focus({preventScroll:!0}),u.current?.select()},[]);let d=async()=>{if(!(t||o||!i.trim())){s(!0),l(``);try{await n(i.trim()),r()}catch(e){l(e instanceof Error?e.message:String(e)),s(!1)}}};return(0,R.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>uZ(e,()=>void d(),()=>{o||r()}),children:[(0,R.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,R.jsx)(sM,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24 max-md:min-h-28`})]}),c?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,R.jsx)(Y,{size:`sm`,className:`max-md:min-h-11`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,R.jsx)(Y,{size:`sm`,variant:`ghost`,className:`max-md:min-h-11`,disabled:o,onClick:r,children:`Cancel`})]})]})}var fZ=1200;function pZ({question:e}){let[t,n]=(0,m.useState)(),r=XA(t!==void 0,YA.sheet),i=e.options.flatMap((e,t)=>e.mockup?[{option:e,index:t,mockup:e.mockup}]:[]);if(i.length===0)return null;let a=e.options.map(e=>({label:e.label,description:e.description,...e.mockup?{htmlPreview:e.mockup}:{}}));return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`ul`,{"aria-label":`Mockups`,className:`grid grid-cols-2 gap-2 md:grid-cols-3`,children:i.map(({option:e,index:t,mockup:r})=>(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(tZ,{preview:r,label:oZ(e.label),frameWidth:fZ,onOpen:()=>n(t),className:`aspect-[3/2] h-auto`}),(0,R.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[t+1,`.`]}),` `,oZ(e.label)]})]},t))}),(0,R.jsx)(HA,{open:t!==void 0&&r,onOpenChange:e=>{e||n(void 0)},label:`Mockups: ${e.text}`,className:`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`,children:t===void 0?null:(0,R.jsx)(lZ,{options:a,start:t,title:e.text,onClose:()=>n(void 0)})})]})}function mZ({questions:e}){return(0,R.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised flex min-w-0 flex-col gap-2 rounded-xl border p-3 text-sm`,style:{"--orb":TW(e.from)},children:[(0,R.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,R.jsxs)(`span`,{className:`mt-px inline-flex shrink-0 items-center gap-1 rounded-full bg-[color-mix(in_oklab,var(--orb)_12%,transparent)] px-2 py-0.5 text-xs font-medium text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,children:[(0,R.jsx)(bW,{source:e.from,className:`size-3`}),SW(e.from)]}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,R.jsx)(`ul`,{"aria-label":`Options`,className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,R.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null,(0,R.jsx)(pZ,{question:e})]},t))})}function hZ({message:e}){let t=e.decided??[];return t.length?(0,R.jsx)(`ul`,{"aria-label":`Settled for you`,className:`mt-1 flex flex-col gap-1`,children:t.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex min-w-0 items-start gap-2 text-sm`,title:`Settled by the classifier, ${Math.round(e.probability*100)}% sure. Comment on the plan to overrule it.`,children:[(0,R.jsx)(zp,{"aria-hidden":`true`,className:`mt-[0.1875rem] size-3.5 shrink-0 text-success`}),(0,R.jsxs)(`span`,{className:`min-w-0`,children:[(0,R.jsx)(`span`,{className:q(`font-medium`,CW(e.from)),children:SW(e.from)}),` `,(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:e.question}),` `,(0,R.jsx)(`span`,{className:`font-medium`,children:e.answer}),(0,R.jsxs)(`span`,{className:`decided-hint`,children:[`auto · `,Math.round(e.probability*100),`% · comment to overrule`]})]})]},t))}):null}function gZ({message:e,index:t,busy:n,readOnly:r}){let[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),c=o&&(o.editedAt??0)>(e.editedAt??0)?o:e,l=n||c!==e,u=async n=>{let r=await Te(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});s(r.message)},d=!r&&!e.settled?.length&&!i?(0,R.jsxs)(`button`,{type:`button`,disabled:l,onClick:()=>a(!0),className:`chat-action`,children:[(0,R.jsx)(zh,{"aria-hidden":`true`,className:`size-3`}),`Edit`]}):null;return(0,R.jsx)(AW,{time:e.at>0?lM(e.at):void 0,head:!0,note:c.editedAt?`(edited)`:void 0,actions:d,children:i?(0,R.jsx)(dZ,{text:c.text,disabled:n,onSave:u,onCancel:()=>a(!1)}):(0,R.jsx)(WH,{text:c.text})})}function _Z({message:e,index:t,busy:n,readOnly:r}){if(e.role===`you`)return(0,R.jsx)(gZ,{message:e,index:t,busy:n,readOnly:r});let i=e.questions??[];return(0,R.jsxs)(kW,{source:`PLANNER`,name:`Panel`,time:e.at>0?lM(e.at):void 0,head:!0,bubble:i.length===0,aside:i.length?`${i.length} question${i.length===1?``:`s`}`:void 0,children:[i.length>0?(0,R.jsx)(mZ,{questions:i}):(0,R.jsx)(WH,{text:e.text}),(0,R.jsx)(hZ,{message:e})]})}function vZ({messages:e,seed:t,busy:n=!1,readOnly:r=!1}){return(0,R.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,R.jsx)(jW,{children:t}):null,e.map((e,t)=>(0,R.jsx)(_Z,{message:e,index:t,busy:n,readOnly:r},`${e.at}-${t}`)),n?(0,R.jsx)(kW,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,aside:`the panel is thinking`,children:(0,R.jsx)(MW,{className:`mt-1`})}):null]})}var yZ=`ORACLE`,bZ=`No draft yet.`,xZ=`The draft appears after the panel's first round.`,SZ=`What each seat needs`,CZ=[`backend`,`designer`,`qa`,`researcher`],wZ={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},TZ=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,EZ={ORACLE:`Chairs the panel, and settles the last round alone.`,DEV:`Code, data and the APIs it touches.`,DESIGN:`Screens, flows and the words on them.`,QA:`Tests, edge cases and what could break.`,RESEARCH:`Prior art, docs and sources.`},DZ=[{title:`Describe it`,text:`Say what you want in the box below.`},{title:`The panel asks`,text:`Each seat asks what it needs to know.`},{title:`A draft forms`,text:`Answer, comment on lines, go another round.`},{title:`Save the plan`,text:`Keep it, or start it as a task.`}];function OZ(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function kZ(e,t=0){return t<=0?`round ${e}`:e>t?`round ${e} · past the limit, revising`:e===t?`final round ${e}/${t}`:`round ${e}/${t}`}function AZ(e,t){return`${e} ${t}${e===1?``:`s`}`}function jZ(e){return e.round===0&&e.messages.length===0&&!e.busy}function MZ(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${wZ[t.member]} failed`).split(`
98
+ `)[0]}function NZ(e){let t=[],n=MZ(e);return e.busy?t.push(kZ(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${AZ(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(kZ(e.round,e.limit)),!e.busy&&e.limit>0&&e.round+1===e.limit&&t.push(`the next round is the last: the oracle settles the rest`),t}function PZ(e,t){let n=wZ[e],r=t.seats.includes(e),i=t.members.find(t=>t.member===e),a={member:e,label:n,seated:r,working:!1};if(!r)return{...a,text:`off`};if(i?.status===`thinking`)return{...a,working:!0,text:i.step??`thinking`};if(i?.status===`failed`)return{...a,text:`failed — Retry`};if(!i)return{...a,text:`·`};if(i.reply?.status===`ready`)return{...a,text:`ready`};let o=t.questions.filter(e=>e.from===n).length;return{...a,text:o===0?`done`:AZ(o,`question`)}}function FZ(e){let t=e.questions.filter(e=>e.from===yZ).length;return[{label:yZ,seated:!0,working:e.busy,text:e.busy?`chairing`:t?AZ(t,`question`):`·`},...CZ.map(t=>PZ(t,e))]}function IZ({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:q(`inline-flex items-center gap-1 font-medium`,e.seated?CW(e.label):`text-muted-foreground`),children:[(0,R.jsx)(bW,{source:e.label,className:`size-3`}),SW(e.label)]}),e.working&&!t?(0,R.jsx)(pj,{className:`size-3`,"aria-hidden":`true`}):null,n===`·`?null:(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function LZ({cell:e,intro:t,onToggled:n}){let{member:r}=e,i=`roster-chip inline-flex h-7 items-center gap-1.5 rounded-full border px-2.5 text-xs whitespace-nowrap max-md:min-h-11`;if(!r)return(0,R.jsx)(`li`,{className:q(i,`border-transparent bg-muted`),children:(0,R.jsx)(IZ,{cell:e,intro:t})});let a=async()=>{await U(`planner.toggleSeat`,{member:r})&&n()};return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`label`,{className:q(i,`cursor-pointer pl-1.5 transition-colors`,e.seated?`border-border bg-card hover:bg-muted`:`border-dashed border-border text-muted-foreground hover:bg-muted`),children:[(0,R.jsx)(qG,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${SW(e.label)} sits on the panel`,className:`size-3.5 rounded-[4px] [&_svg]:size-2.5`}),(0,R.jsx)(IZ,{cell:e,intro:t})]})})}function RZ({cells:e,intro:t,onToggled:n,className:r}){return(0,R.jsx)(`ul`,{"aria-label":`Panel`,className:q(`flex flex-wrap items-center gap-1.5`,r),children:e.map(e=>(0,R.jsx)(LZ,{cell:e,intro:t,onToggled:n},e.label))})}function zZ({cell:e,onToggled:t}){let{member:n}=e,r=SW(e.label),i=q(`flex h-full flex-col gap-2 rounded-xl border p-3.5 transition-[background-color,border-color,box-shadow]`,e.seated?`border-[color-mix(in_oklab,var(--orb)_26%,var(--border))] bg-[color-mix(in_oklab,var(--orb)_5%,var(--card))] shadow-card`:`border-dashed border-input bg-transparent`),a=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`grid size-6 place-items-center rounded-lg bg-[color-mix(in_oklab,var(--orb)_14%,transparent)] text-[color-mix(in_oklab,var(--orb)_85%,var(--foreground))]`,!e.seated&&`opacity-50 grayscale`),children:(0,R.jsx)(bW,{source:e.label,className:`size-3.5`})}),(0,R.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?CW(e.label):`text-muted-foreground`),children:r})]}),n?(0,R.jsx)(qG,{checked:e.seated,onCheckedChange:()=>void BZ(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:EZ[e.label]}),(0,R.jsx)(`span`,{className:q(`mt-auto text-xs font-medium`,e.seated?`text-foreground`:`text-muted-foreground`),children:n?e.seated?`seated`:`sits this one out`:`always chairs`})]}),o={"--orb":TW(e.label)};return n?(0,R.jsx)(`li`,{style:o,children:(0,R.jsx)(`label`,{className:q(i,`cursor-pointer`,e.seated?`hover:shadow-[0_0_0_3px_color-mix(in_oklab,var(--orb)_10%,transparent)]`:`hover:bg-muted`),children:a})}):(0,R.jsx)(`li`,{style:o,children:(0,R.jsx)(`div`,{className:i,children:a})})}async function BZ(e,t){await U(`planner.toggleSeat`,{member:e})&&t()}function VZ({cells:e,onToggled:t}){return(0,R.jsx)(`ul`,{"aria-label":`Panel`,className:`grid grid-cols-1 gap-3 @lg:grid-cols-2 @4xl:grid-cols-5`,children:e.map(e=>(0,R.jsx)(zZ,{cell:e,onToggled:t},e.label))})}function HZ({snap:e}){let t=NZ(e),n=!e.busy&&MZ(e)!==void 0;return(0,R.jsxs)(`p`,{role:`status`,className:n?`inline-flex items-center gap-2 text-sm text-destructive`:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[e.busy?(0,R.jsx)(pj,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function UZ({onOpen:e}){let t=(0,m.useRef)(null);return Uj(`v`,()=>t.current?.click()),(0,R.jsxs)(`button`,{ref:t,type:`button`,"aria-haspopup":`dialog`,"aria-keyshortcuts":`V`,onClick:e,className:`plan-link group`,children:[`View plan`,(0,R.jsx)(Gp,{"aria-hidden":`true`,className:`size-3.5 transition-transform duration-150 group-hover:translate-x-0.5 motion-reduce:transition-none`}),(0,R.jsx)(rA,{chord:`V`,className:`kbd-hint ml-1`})]})}function WZ({iconOnly:e}){return(0,R.jsx)(X,{label:`Previous plans`,text:`Previous`,icon:qh,shortcut:`H`,iconOnly:e,onClick:()=>aj(ij(`plan`,`previous`))})}function GZ({snap:e,onDone:t}){let n=sA(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=cA(`(max-width: 767.98px)`),i=e=>async()=>{await U(e,{})&&t()};return(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 @min-[68rem]:shrink-0`,children:[e.questions.length>0&&!e.busy?(0,R.jsx)(X,{label:`Answer questions`,icon:sh,tone:`primary`,shortcut:`A`,onClick:()=>void i(`planner.answer`)()}):null,e.retryable?(0,R.jsx)(X,{label:`Retry`,icon:Zh,shortcut:`R`,onClick:()=>void i(`planner.retry`)()}):null,(0,R.jsx)(WZ,{iconOnly:r}),(0,R.jsx)(X,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:tg,shortcut:n??`Ctrl+S`,iconOnly:r,disabled:!e.draft||e.busy,onClick:()=>void i(`planner.save`)()}),(0,R.jsx)(SM,{icon:jm,label:`New plan`,shortcut:`N`,iconOnly:r,title:`Start a new plan?`,description:`The conversation and the draft are left behind. Saved plans are not touched.`,confirmLabel:`New plan`,onConfirm:()=>void U(`planner.new`,{}).then(t)})]})}function KZ({snap:e,onDone:t,onViewPlan:n}){return(0,R.jsxs)(`header`,{className:`@container flex shrink-0 flex-col gap-2.5 border-b border-border px-5 pt-3 pb-3 max-md:shrink max-md:px-4 max-md:py-2.5`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-baseline gap-x-3 gap-y-1`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,R.jsx)(HZ,{snap:e}),e.draft?(0,R.jsx)(UZ,{onOpen:n}):null]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2.5 @min-[68rem]:flex-nowrap`,children:[(0,R.jsx)(RZ,{cells:FZ(e),intro:!1,onToggled:t,className:`order-last basis-full max-md:-mx-4 max-md:flex-nowrap max-md:overflow-x-auto max-md:px-4 max-md:[scrollbar-width:none] @min-[68rem]:order-none @min-[68rem]:min-w-0 @min-[68rem]:basis-auto`}),(0,R.jsx)(GZ,{snap:e,onDone:t})]})]})}function qZ(e){let t=!1;return e.split(`
99
+ `).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function JZ({notes:e}){return(0,R.jsx)(R.Fragment,{children:e.map((e,t)=>(0,R.jsx)(`p`,{className:`ml-6 rounded-lg border border-primary/15 bg-accent px-3 py-1.5 text-sm text-foreground italic`,children:e},t))})}var YZ=[],XZ=(0,m.memo)(function({row:e,index:t,notes:n,form:r,onComment:i}){let a=e.text.trim(),o=()=>i(t);return(0,R.jsxs)(`li`,{"data-line":t,className:q(`group/line`,!r&&`[contain-intrinsic-size:auto_2.75rem] [content-visibility:auto]`),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-1`,children:[(0,R.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:n.length>0?(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,R.jsx)(`div`,{className:q(`min-w-0 flex-1 cursor-pointer rounded-lg px-2 py-1.5 transition-colors hover:bg-muted`,r&&`bg-muted`,e.fenced&&`font-mono text-sm whitespace-pre-wrap break-words`),onClick:e=>!e.target.closest(`a`)&&o(),children:e.fenced?e.text:(0,R.jsx)(WH,{text:e.text})}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground max-md:size-11 opacity-0 transition-opacity group-hover/line:opacity-100 focus-visible:opacity-100 [@media(hover:none)]:opacity-100`,"aria-label":`Comment on this line: ${a}`,onClick:o,children:(0,R.jsx)(lh,{"aria-hidden":`true`})})]}),(0,R.jsx)(JZ,{notes:n}),r]})});function ZZ({draft:e,comments:t,commenting:n,form:r,onComment:i}){let a=(0,m.useMemo)(()=>qZ(e),[e]),o=FH(a.length);return(0,R.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:a.slice(0,o).map((e,a)=>e.text.trim()?(0,R.jsx)(XZ,{row:e,index:a,notes:t.get(e.text.trim())??YZ,form:a===n?r:void 0,onComment:i},a):(0,R.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},a))})}function QZ({notes:e}){return e.length===0?null:(0,R.jsx)(qH,{title:SZ,children:(0,R.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,R.jsxs)(`div`,{className:`flex min-w-0 gap-3 max-md:flex-wrap`,children:[(0,R.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,CW(e.from)),children:SW(e.from)}),(0,R.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,R.jsx)(WH,{text:e.text})})]},t))})})}function $Z({line:e,onCancel:t,onSent:n}){let r=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let e=r.current?.querySelector(`textarea`);e?.focus(),e?.scrollIntoView({block:`nearest`})},[]),(0,R.jsxs)(`div`,{ref:r,role:`group`,"aria-label":`Comment on this line`,className:`line-comment relative mt-1 mb-2 ml-6 rounded-xl border p-3`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Cancel the comment`,title:`Cancel · Esc`,onClick:t,className:`absolute top-1.5 right-1.5 size-7 text-muted-foreground max-md:size-11`,children:(0,R.jsx)(Vg,{"aria-hidden":`true`})}),(0,R.jsx)(WU,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async t=>await U(`planner.commentLine`,{line:e,text:t.trim()})?(n(t.trim()),!0):!1})]})}function eQ({open:e,onClose:t,snap:n,comments:r,onSent:i}){let a=XA(e,YA.sheet),o=cA(`(max-width: 767.98px)`),s=(0,m.useRef)(null),[c,l]=(0,m.useState)(),u=(0,m.useMemo)(()=>n.draft?qZ(n.draft):[],[n.draft]),d=c===void 0?void 0:u[c]?.text.trim(),f=()=>{let e=c;l(void 0),requestAnimationFrame(()=>s.current?.querySelector(`[data-line="${e}"] button[aria-label^="Comment on this line"]`)?.focus())};return(0,R.jsx)(Kj,{open:e&&a,onOpenChange:e=>!e&&t(),children:(0,R.jsxs)(Xj,{showCloseButton:!1,side:o?`bottom`:`right`,"aria-label":`Draft plan`,onEscapeKeyDown:e=>{d!==void 0&&(e.preventDefault(),f())},onCloseAutoFocus:()=>l(void 0),className:q(`plan-sheet gap-0`,o?`data-[side=bottom]:inset-0 data-[side=bottom]:h-full data-[side=bottom]:max-w-none data-[side=bottom]:rounded-none`:`data-[side=right]:w-[min(44rem,92vw)] data-[side=right]:sm:max-w-none`),children:[(0,R.jsxs)(Zj,{className:`flex-row items-center justify-between gap-3 border-b px-5 py-3 max-md:px-4`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(Qj,{className:`text-base font-semibold tracking-tight`,children:`Draft plan`}),(0,R.jsxs)($j,{className:`text-xs text-muted-foreground`,children:[n.round>0?`${kZ(n.round,n.limit)} · `:``,`choose a line to comment on it`]})]}),(0,R.jsx)(qj,{asChild:!0,children:(0,R.jsxs)(Y,{variant:`ghost`,size:`sm`,"aria-label":`Close the plan`,title:`Close · Esc`,className:q(`gap-2 text-muted-foreground`,o&&`h-11 px-3 text-sm`),children:[(0,R.jsx)(Vg,{"aria-hidden":`true`}),`Close`,o?null:(0,R.jsx)(rA,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,R.jsxs)(`div`,{ref:s,className:`flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto overscroll-contain px-5 pt-4 pb-8 max-md:px-3 max-md:pb-[max(1.5rem,env(safe-area-inset-bottom))]`,children:[n.draft?(0,R.jsx)(ZZ,{draft:n.draft,comments:r,commenting:d===void 0?void 0:c,form:d===void 0?void 0:(0,R.jsx)($Z,{line:d,onCancel:f,onSent:e=>(i(d,e),f())},c),onComment:l}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:n.busy?xZ:bZ}),(0,R.jsx)(QZ,{notes:n.notes})]})]})})}var tQ=()=>aj(ij(`plan`,`previous`)),nQ=e=>aj(ij(`plan`,`previous`,e));function rQ(e){let t=Date.now()-Date.parse(e);return Number.isFinite(t)?dM(Math.max(0,t)):``}function iQ(e,t){return[`${t} message${t===1?``:`s`}`,`round ${e.rounds}`,rQ(e.updatedAt)].filter(Boolean).join(` · `)}function aQ({plan:e,selected:t}){return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>nQ(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),e.hasDraft?(0,R.jsx)(jU,{variant:`secondary`,children:`draft`}):null]}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:iQ(e,e.messages)})]})})}function oQ({id:e,onGone:t}){let n=xj(`planner.previousGet`,{id:e},[`planner`]),r=n.data;if(!r)return n.error?(0,R.jsx)(yj,{message:`Could not load that plan. ${n.error}`,onRetry:n.reload}):null;let i=!!r.archivedAt,a=async()=>{await U(`planner.previousOpen`,{id:e})&&aj(ij(`plan`))},o=async()=>{await U(`planner.previousArchive`,{id:e,archived:!i})&&t()},s=async()=>{await U(`planner.previousDelete`,{id:e})&&t()};return(0,R.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":r.title,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Carry on planning`,text:`Carry on`,icon:Vh,tone:`primary`,shortcut:`C`,onClick:()=>void a()}),(0,R.jsx)(X,{label:i?`Bring it back from the archive`:`Archive`,text:i?`Unarchive`:`Archive`,icon:i?xp:Cp,shortcut:`E`,onClick:()=>void o()}),(0,R.jsx)(SM,{icon:Cg,label:`Delete`,shortcut:`Delete`,title:`Delete "${r.title}"?`,description:`The conversation and the draft are removed for good.`,confirmLabel:`Delete plan`,variant:`destructive`,onConfirm:()=>void s()})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:r.title}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:[i?`archived`:``,iQ(r,r.messages.length),r.seed??``].filter(Boolean).join(` · `)})]}),(0,R.jsxs)(qH,{title:`Draft plan`,children:[r.draft?(0,R.jsx)(WH,{text:r.draft}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The panel had not written a draft yet.`}),(0,R.jsx)(QZ,{notes:r.notes})]}),(0,R.jsx)(qH,{title:`Conversation`,children:(0,R.jsx)(vZ,{messages:r.messages,readOnly:!0})})]})}function sQ({id:e}){let t=eM(),[n,r]=(0,m.useState)(!1),i=xj(`planner.previous`,n?{archived:!0}:{},[`planner`]),a=i.data?.plans??[];if(!i.data&&i.error)return(0,R.jsx)(yj,{message:`Could not load the previous plans. ${i.error}`,onRetry:i.reload});let o=(0,R.jsxs)(aM,{title:n?`Archived plans`:`Previous plans`,count:i.data?String(a.length):void 0,children:[(0,R.jsx)(X,{label:`Back to the current plan`,icon:Dp,iconOnly:!0,onClick:()=>aj(ij(`plan`))}),(0,R.jsx)(X,{label:n?`Show the previous plans`:`Show the archived plans`,text:n?`Previous`:`Archived`,icon:n?qh:Cp,pressed:n,onClick:()=>{r(e=>!e),tQ()}})]}),s=i.data?a.length===0?(0,R.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:n?`No archived plans.`:`No previous plans. A plan you leave without saving it as a task waits here; one saved as a task is in the Tasks tab.`}):(0,R.jsx)(`ul`,{className:q(NU,`pt-2`),"aria-label":n?`Archived plans`:`Previous plans`,children:a.map(t=>(0,R.jsx)(aQ,{plan:t,selected:t.id===e},t.id))}):(0,R.jsx)(oM,{});return(0,R.jsx)(iM,{wide:t,list:(0,R.jsxs)(R.Fragment,{children:[o,s]}),detail:e?(0,R.jsx)(oQ,{id:e,onGone:()=>{i.reload(),tQ()}},e):null,open:e!==void 0,onClose:tQ,hint:`Pick a plan to read it, carry it on, archive it or delete it.`,describe:`A previous plan`})}function cQ({limit:e}){return e<=0?null:(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,R.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function lQ({snap:e,onDone:t}){let n=FZ(e);return(0,R.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock max-md:px-4 max-md:pt-5 md:px-8 md:pt-10`,children:(0,R.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,R.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,R.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`card-raised grid size-11 shrink-0 place-items-center rounded-xl border text-primary`,children:(0,R.jsx)($h,{className:`size-5`})}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,R.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:TZ})]})]}),(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-2 @3xl:items-end`,children:[(0,R.jsx)(WZ,{}),(0,R.jsx)(cQ,{limit:e.limit})]})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,R.jsx)(KH,{title:`The panel`,right:OZ(n)})}),(0,R.jsx)(VZ,{cells:n,onToggled:t})]}),(0,R.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,R.jsx)(KH,{title:`How a plan comes together`})}),(0,R.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:DZ.map((e,t)=>(0,R.jsxs)(`li`,{className:`card-raised relative flex gap-3 rounded-xl border p-3.5`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-6 shrink-0 place-items-center rounded-full bg-accent text-xs font-semibold text-primary tabular-nums`,children:t+1}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,R.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,R.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(Tp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,R.jsx)(iA,{chord:`/`,className:`max-md:hidden`,children:`write`}),(0,R.jsx)(iA,{chord:`Enter`,className:`max-md:hidden`,children:`send to the panel`})]})]})})}function uQ({snap:e,reload:t}){let[n,r]=(0,m.useState)(!1),[i,a]=(0,m.useState)(new Map),o=(e,t)=>a(n=>new Map(n).set(e,[...n.get(e)??[],t])),{ref:s,onScroll:c}=gW(`${JSON.stringify(e.messages)}${e.busy}`);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(KZ,{snap:e,onDone:t,onViewPlan:()=>r(!0)}),(0,R.jsx)(`div`,{ref:s,onScroll:c,className:`min-h-0 flex-1 overflow-y-auto overscroll-y-contain px-5 pt-5 pb-dock max-md:px-4`,children:(0,R.jsx)(vZ,{messages:e.messages,busy:e.busy})}),(0,R.jsx)(eQ,{open:n,onClose:()=>r(!1),snap:e,comments:i,onSent:o})]})}function dQ({rest:e=[]}){return e[0]===`previous`?(0,R.jsx)(sQ,{id:e[1]}):(0,R.jsx)(fQ,{})}function fQ(){let e=xj(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,R.jsx)(yj,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,R.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=jZ(t);return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,R.jsx)(lQ,{snap:t,onDone:e.reload}):(0,R.jsx)(uQ,{snap:t,reload:e.reload})})}var pQ=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function mQ(e){return e.prompt.split(`
100
+ `).find(e=>e.trim())?.trim()??`(empty)`}function hQ(e){return[...e].reverse()}function gQ(e){let t=Number.isFinite(e)?Math.max(0,Math.round(e/1e3)):0,n=Math.floor(t/60);if(n===0)return`${t}s`;let r=t%60;return r===0?`${n}m`:`${n}m ${String(r).padStart(2,`0`)}s`}function _Q(e,t){return e.startedAt?gQ((e.finishedAt??t)-e.startedAt):``}function vQ(e,t){let n=e.model?`${e.model}${e.thinking?` · ${e.thinking}`:``}`:e.thinking??``;return[_Q(e,t),n,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.usage?.cost?`$${e.usage.cost.toFixed(2)}`:``].filter(Boolean).join(` · `)}function yQ(e){return e===`queued`?`Waiting for the quick fix ahead of it.`:e===`running`?`starting…`:e===`held`?`Not started.`:`No tool calls.`}function bQ({job:e}){let t=e.status===`held`;return(0,R.jsxs)(R.Fragment,{children:[e.route?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Routed `,e.route]}):null,e.note&&t?(0,R.jsxs)(`p`,{className:`flex items-start gap-2 rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-sm text-foreground`,children:[(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,R.jsxs)(`span`,{children:[`Held: `,e.note,`.`]})]}):null,e.note&&!t?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.routed?`Routed here by the oracle — ${e.note}`:e.note}):null,e.routed&&!e.note?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Routed here by the oracle.`}):null]})}function xQ({job:e}){let t=e.status===`running`;return e.steps.length===0?(0,R.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[t?(0,R.jsx)(pj,{className:`size-3.5`}):null,yQ(e.status)]}):(0,R.jsx)(`ol`,{className:`flex flex-col gap-1 text-sm`,children:e.steps.map((e,n)=>(0,R.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:lM(e.at)}),(0,R.jsx)(`span`,{className:`flex h-5 w-3.5 shrink-0 items-center justify-center`,"aria-hidden":`true`,children:e.pending&&t?(0,R.jsx)(pj,{className:`size-3.5`}):(0,R.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}),(0,R.jsx)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:e.pending&&t?`${e.text}…`:e.text})]},n))})}function SQ({job:e}){return e.status===`held`?(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Run anyway`,icon:Vh,tone:`primary`,shortcut:`R`,onClick:()=>void U(`quickfix.runAnyway`,{id:e.id})}),(0,R.jsx)(X,{label:`Turn it into a task`,text:`Make it a task`,icon:Zm,shortcut:`T`,onClick:()=>void U(`quickfix.movedToTask`,{id:e.id})})]}):e.status!==`queued`&&e.status!==`running`?null:(0,R.jsx)(Gj,{children:(0,R.jsx)(SM,{icon:lm,label:`Cancel the quick fix`,text:`Cancel`,shortcut:`C`,title:`Cancel this quick fix?`,description:`The agent stops. Files it already edited stay as they are.`,confirmLabel:`Cancel quick fix`,variant:`destructive`,onConfirm:()=>void U(`quickfix.cancel`,{id:e.id})})})}function CQ({job:e,now:t}){return(0,R.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Quick fix detail`,children:[(0,R.jsx)(SQ,{job:e}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:mQ(e)}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:e.status}),vQ(e,t)?(0,R.jsx)(`span`,{children:vQ(e,t)}):null]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),e.prompt.trim().includes(`
101
+ `)?(0,R.jsx)(WH,{text:e.prompt}):null,(0,R.jsx)(bQ,{job:e}),(0,R.jsx)(qH,{title:`Steps`,children:(0,R.jsx)(xQ,{job:e})}),e.files?.length?(0,R.jsx)(qH,{title:`Edited`,children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,R.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,R.jsx)(`p`,{className:`rounded-lg border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm text-destructive`,children:e.error}):null,e.report?(0,R.jsx)(qH,{title:`Report`,children:(0,R.jsx)(WH,{text:e.report})}):null]})}function wQ({status:e}){if(e===`running`)return(0,R.jsx)(pj,{className:`size-3.5`,"aria-label":`running`});let t={queued:hm,success:zp,failed:Vg,timeout:Vg,cancelled:yh,held:jh,running:hm}[e];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(t,{"aria-hidden":`true`,className:`size-4 ${e===`success`?`text-success`:e===`failed`||e===`timeout`?`text-destructive`:e===`held`?`text-warning`:`text-muted-foreground`}`}),(0,R.jsx)(`span`,{className:`sr-only`,children:e})]})}function TQ({job:e,selected:t,now:n,onSelect:r}){let i=_Q(e,n);return(0,R.jsx)(`li`,{children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>r(e.id),className:q(MU,`flex-row items-start gap-2.5 text-sm max-md:min-h-11`),children:[(0,R.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,R.jsx)(wQ,{status:e.status})}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:mQ(e)}),i?(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:i}):null]})})}function EQ({jobs:e,selectedId:t,now:n,onSelect:r}){return(0,R.jsx)(`ul`,{className:NU,children:e.map(e=>(0,R.jsx)(TQ,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var DQ=()=>aj(ij(`quickfix`)),OQ=e=>aj(ij(`quickfix`,e));function kQ(e){let[t,n]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!e)return;let t=window.setInterval(()=>n(Date.now()),1e3);return()=>window.clearInterval(t)},[e]),e?t:Date.now()}function AQ(){return(0,R.jsx)(sj,{className:`m-4 flex-1`,children:(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Ug,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{className:`font-medium text-foreground`,children:pQ})]})})}function jQ({id:e}){let t=eM(),n=xj(`quickfix.list`,{},[`quickfix`]),r=hQ(n.data?.jobs??[]),i=kQ(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,R.jsx)(yj,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,R.jsx)(AQ,{}):(0,R.jsx)(MQ,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function MQ({id:e,wide:t,loaded:n,jobs:r,now:i}){let a=e??(t?r[0]?.id:void 0),o=r.find(e=>e.id===a),s=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Quick fixes`,count:String(r.length)}),n?(0,R.jsx)(EQ,{jobs:r,selectedId:a,now:i,onSelect:OQ}):(0,R.jsx)(oM,{})]});return(0,R.jsx)(iM,{wide:t,list:s,detail:o?(0,R.jsx)(CQ,{job:o,now:i}):e?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:DQ,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var NQ={},PQ=new Set;function FQ(e){NQ=e;for(let e of[...PQ])e()}function IQ(e){NQ.taskId!==e&&FQ({...NQ,taskId:e})}function LQ(e){(NQ.session?.name!==e?.name||JSON.stringify(NQ.session?.address)!==JSON.stringify(e?.address))&&FQ({...NQ,session:e})}function RQ(e){return PQ.add(e),()=>{PQ.delete(e)}}function zQ(){return(0,m.useSyncExternalStore)(RQ,()=>NQ,()=>NQ)}var BQ=8;function VQ(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function HQ(e,t){let n=Math.min(t,BQ);if(n<=0)return[];let r=Math.min(n,Math.round(Math.max(0,e)/t*n));return Array.from({length:n},(e,t)=>t<r)}function UQ({done:e,total:t}){return(0,R.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:HQ(e,t).map((e,t)=>(0,R.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function WQ({check:e,className:t}){return(0,R.jsx)(e===`done`?tm:e===`dropped`?dm:pm,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function GQ({entry:e}){let t=e.at?lM(e.at):``;return e.role===`note`?(0,R.jsxs)(`li`,{className:`break-words text-center text-xs text-muted-foreground [overflow-wrap:anywhere]`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col items-end gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,R.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,R.jsx)(WH,{text:e.text})})]}):(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,R.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,R.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,R.jsx)(WH,{text:e.text})})]})}function KQ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,R.jsxs)(`div`,{className:`flex min-w-0 max-w-full flex-col gap-3`,children:[t?(0,R.jsx)(`div`,{className:`flex self-center`,children:(0,R.jsx)(X,{label:`Load earlier messages`,icon:Zp,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,R.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex min-w-0 flex-col gap-4`,children:e.map(e=>(0,R.jsx)(GQ,{entry:e},e.id))})]})}function qQ({address:e,empty:t}){let n=xj(`sessions.chat`,e,[`sessions`]),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(!1),s=n.data?.entries??[],c=new Set(s.map(e=>e.id)),l=[...(r?.entries??[]).filter(e=>!c.has(e.id)),...s],u=async()=>{let t=l[0];if(!t)return;o(!0);let n=await U(`sessions.chat`,{...e,before:t.id});n&&i({entries:[...n.entries,...r?.entries??[]],more:n.hasOlder}),o(!1)},d=r?.more??n.data?.hasOlder??!1;return(0,R.jsx)(KQ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var JQ=`Nothing said yet.`,YQ=`This session runs in another terminal: its conversation shows here and your messages reach its oracle within seconds, but live activity only streams from sessions started in this window.`;function XQ(e,t,n){let r=t?.task;return{id:`here`,where:`this window`,name:e?.sessionName??r?.title??`unnamed session`,status:e?.busy?`working`:r?.state??`no task`,waiting:n,alive:!0,dialogs:[],...r?{task:r}:{}}}function ZQ(e){let t=e.status===`exited`?`ended`:e.status===`starting`?`starting`:e.busy?`working`:`idle`;return{id:e.key,where:`background`,name:e.name,status:t,waiting:e.dialogs.length,key:e.key,alive:e.alive,dialogs:e.dialogs,...e.sessionId?{sessionId:e.sessionId}:{}}}function QQ(e){return{id:e.sessionId,where:`other terminal`,name:e.name??`unnamed session`,status:`running`,waiting:0,pid:e.pid,sessionId:e.sessionId,alive:!0,dialogs:[]}}function $Q(e,t,n,r,i){let a=new Set([e?.sessionId,...r.map(e=>e.sessionId)].filter(e=>!!e)),o=i.filter(e=>!a.has(e.sessionId));return[XQ(e,t,n),...r.map(ZQ),...o.map(QQ)]}function e$(e){return`${e} question${e===1?``:`s`} waiting for you`}function t$(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function n$(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function r$(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function i$({options:e,send:t}){return(0,R.jsx)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:e.map(e=>(0,R.jsx)(Y,{variant:`outline`,className:`max-w-full min-w-0 whitespace-normal break-words text-left max-md:h-auto max-md:min-h-11`,onClick:()=>void t({value:e}),children:e},e))})}function a$({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,R.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,R.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,R.jsx)(sM,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,R.jsx)(`div`,{className:`flex self-end`,children:(0,R.jsx)(X,{label:`Send the answer`,text:`Send`,icon:jp,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function o$({dialog:e,send:t}){return e.method===`select`?(0,R.jsx)(i$,{options:e.options??[],send:t}):e.method===`confirm`?(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-wrap gap-2`,children:[(0,R.jsx)(Y,{className:`max-md:h-auto max-md:min-h-11`,onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,R.jsx)(Y,{variant:`outline`,className:`max-md:h-auto max-md:min-h-11`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,R.jsx)(a$,{dialog:e,send:t})}function s$({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await U(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,R.jsxs)(`div`,{className:`card-raised flex min-w-0 flex-col gap-3 rounded-lg border p-3`,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,R.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:t.title}),t.message?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:t.message}):null]}),(0,R.jsx)(o$,{dialog:t,send:r}),(0,R.jsx)(`div`,{className:`flex self-start`,children:(0,R.jsx)(X,{label:`Put it away`,text:`Put away`,icon:Vg,onClick:()=>void r({cancelled:!0})})})]})}function c$({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,R.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,R.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:e$(t.length)}),t.map(t=>(0,R.jsx)(s$,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var l$={"this window":xh,background:qm,"other terminal":pg};function u$({where:e,className:t}){let n=l$[e];return(0,R.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function d$({task:e}){let t=e.progress;return(0,R.jsxs)(`p`,{className:`flex min-w-0 flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(UQ,{done:t.done,total:t.total}),(0,R.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function f$({entry:e}){let{key:t}=e;return e.where===`this window`?(0,R.jsx)(Gj,{children:(0,R.jsx)(X,{label:`Back to this window`,text:`Back to the Lobby`,icon:Dp,tone:`primary`,shortcut:`B`,onClick:()=>aj(`#/lobby`)})}):t?(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Move here`,icon:kp,tone:`primary`,shortcut:`M`,onClick:()=>void U(`sessions.switch`,{key:t})}),(0,R.jsx)(SM,{icon:lm,label:`Stop the session`,text:`Stop`,shortcut:`S`,title:`Stop ${e.name}?`,description:`Its process ends. The task keeps its state and can be resumed in this window.`,confirmLabel:`Stop session`,variant:`destructive`,disabled:!e.alive,onConfirm:()=>void U(`sessions.stop`,{key:t})})]}):null}function p$({entry:e,lobby:t}){let n=r$(e);return e.where===`this window`?(0,R.jsx)(KQ,{entries:t?.chat??[],more:!1,empty:JQ}):n?(0,R.jsx)(qQ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:t$(e)},e.id):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:JQ})}function m$({entry:e,lobby:t,onChanged:n}){return(0,R.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex min-w-0 max-w-full flex-col gap-4 max-md:pb-dock`,children:[(0,R.jsx)(f$,{entry:e}),(0,R.jsxs)(`header`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,R.jsxs)(`h3`,{className:`flex min-w-0 max-w-full flex-wrap items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,R.jsx)(u$,{where:e.where,className:`size-[1.1rem]`}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.name})]}),(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:n$(e)}),e.task?(0,R.jsx)(d$,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,R.jsx)(`p`,{className:`text-sm text-foreground`,children:e$(e.waiting)}):null]}),e.where===`other terminal`?(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:YQ}):null,e.key?(0,R.jsx)(c$,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,R.jsx)(qH,{title:`Conversation`,children:(0,R.jsx)(p$,{entry:e,lobby:t})})]})}function h$(){return(0,R.jsxs)(`div`,{className:`flex flex-col items-start gap-3 p-6`,children:[(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session has ended or is no longer listed.`}),(0,R.jsx)(`a`,{href:`#/tasks`,className:`text-sm font-medium text-primary underline-offset-4 hover:underline`,children:`Back to Tasks`})]})}function g$({id:e}){let t=sA(`status`).data,n=sA(`lobby`).data,r=sA(`prompts`).data?.prompts.length??0,i=xj(`sessions.list`,{},[`sessions`]),a=$Q(t,n,r,i.data?.background??[],i.data?.live??[]).find(t=>t.id===e),o=a?.where===`this window`,s=a&&!o&&a.alive?r$(a):void 0,c=s?JSON.stringify(s):``,l=a?.name;return(0,m.useEffect)(()=>(LQ(s&&l?{name:l,address:s}:void 0),()=>LQ(void 0)),[c,l]),(0,m.useEffect)(()=>{o&&aj(`#/lobby`)},[o]),!i.data&&i.error?(0,R.jsx)(yj,{message:`Could not load the session. ${i.error}`,onRetry:i.reload}):i.data?!a||o?(0,R.jsx)(h$,{}):(0,R.jsx)(`div`,{className:`workspace-pane mx-auto flex h-full min-h-0 w-full max-w-4xl flex-col overflow-hidden rounded-xl border shadow-xs`,children:(0,R.jsx)(m$,{entry:a,lobby:n,onChanged:i.reload},a.id)}):(0,R.jsx)(oM,{})}function _$(e,t=0,n=!1){let r=!n&&!e.waiting&&!!e.runningSince,i=r?Date.parse(e.serverNow)-Date.parse(e.runningSince):0;return Math.max(0,e.elapsedMs)+(Number.isFinite(i)?Math.max(0,i):0)+(r?Math.max(0,t):0)}function v$(e){let t=Math.floor(e/1e3);return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${t%60}s`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function y$(e,t){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),!e)return;let t=performance.now(),n=window.setInterval(()=>r(performance.now()-t),1e3);return()=>window.clearInterval(n)},[e,t]),e?n:0}function b$({timing:e,stopped:t}){let[n,r]=(0,m.useState)(0);return(0,m.useEffect)(()=>{if(r(0),t||e.waiting||!e.runningSince)return;let n=performance.now(),i=window.setInterval(()=>r(performance.now()-n),1e3);return()=>window.clearInterval(i)},[e,t]),(0,R.jsxs)(`span`,{className:`tabular-nums break-words`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,v$(_$(e,n,t)),` execution`]})}function x$({work:e,timing:t,stopped:n}){let r=e.running&&!n&&!t?.waiting,i=y$(r,e);return(0,R.jsxs)(`span`,{className:`tabular-nums break-words`,"data-work-clock":r?`running`:`stopped`,children:[t?.waiting?`Waiting for you · `:``,t?`${t.phase.replaceAll(`_`,` `)} · `:``,`worked `,v$(e.workedMs+i)]})}function S$({timing:e,work:t,stopped:n=!1}){return t?(0,R.jsx)(x$,{work:t,...e?{timing:e}:{},stopped:n}):e?(0,R.jsx)(b$,{timing:e,stopped:n},JSON.stringify(e)):(0,R.jsx)(`span`,{children:`Timing unavailable`})}var C$=`This merges the reviewed commit into main and pushes main, then removes the task worktree after verifying the merge. The task branch is kept.`,w$={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function T$({delivery:e,title:t}){return(0,R.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,R.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,R.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,R.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,R.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,R.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,R.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,R.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,R.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,R.jsxs)(`p`,{className:`text-muted-foreground`,children:[`Local completion/QA: `,e.verification.localVerified?`passed`:`not verified`,` · Repository rules: `,e.verification.rulesKnown?`known`:`unavailable`,e.verification.requiredChecks.length?` · Required: ${e.verification.requiredChecks.join(`, `)}`:``]}):null]})}function E$({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=e===`merge_main`&&t.status===`successful`&&!!t.cleanupError,o=n||t.status===`in_progress`||t.status===`successful`&&!a||!!i;return(0,R.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11 max-md:whitespace-normal`,disabled:o,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:a?`Retry worktree cleanup`:`Merge to main`}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e===`create_pr`?`Pushes the task branch and opens a PR targeting main. Does not merge.`:a?`Main was delivered. Removes the retained worktree after confirmation.`:`Updates and pushes main, then removes the task worktree. Requires confirmation.`}),i?(0,R.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function D$(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?Te(`tasks.deliveryReview`,{taskId:t}):e===`defer`?Te(`tasks.deliveryDefer`,r):Te(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function O$({taskId:e,delivery:t}){let[n,r]=(0,m.useState)(t),[i,a]=(0,m.useState)(!1),[o,s]=(0,m.useState)(),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=P(),f=`${d}:${e}`,p=(0,m.useRef)(f);return p.current=f,(0,m.useEffect)(()=>(p.current=f,()=>{p.current=``}),[f]),(0,m.useEffect)(()=>{r(t),l(!1)},[t,e]),{current:n,setCurrent:r,busy:i,setBusy:a,error:o,setError:s,confirm:c,setConfirm:l,trigger:u,project:d,identity:f,scope:p}}function k$(e){return e.scope.current===e.identity&&e.project===P()}function A$(e,t){let n=(0,m.useRef)(!1);async function r(r){if(!(n.current||r===`merge_main`&&!e.confirm)){n.current=!0,e.setBusy(!0),e.setError(void 0),e.setConfirm(!1);try{let n=await D$(r,t.taskId,e.current.reviewId);k$(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){k$(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function j$(e){let t=O$(e),n=A$(t,e),r=XA(t.confirm,YA.confirm),i=t.current.status===`successful`||t.current.status===`in_progress`;function a(){t.trigger.current=document.activeElement,t.setConfirm(!0)}return{...t,request:n,slot:r,terminal:i,reviewMerge:a}}function M$({review:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,R.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:w$[e.current.status]}),e.current.error||e.error?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.error??e.current.error,` Completed work is retained. Refresh review to reconcile the result before retrying.`]}):null,e.current.cleanupError?(0,R.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[e.current.cleanupError,` Retry cleanup after resolving it.`]}):null,e.current.operation?.worktreeRemoved?(0,R.jsx)(`p`,{className:`text-sm`,children:`Task worktree removed.`}):null,e.current.result?(0,R.jsxs)(`p`,{className:`text-sm break-all`,children:[e.current.result.action===`create_pr`?`PR #${e.current.result.pullNumber??``} created`:`main pushed · ${e.current.result.commit??``}`,e.current.result.pullUrl?(0,R.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function N$({review:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`div`,{className:`mt-3 grid gap-3 max-md:grid-cols-1 md:grid-cols-2`,children:[(0,R.jsx)(E$,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,R.jsx)(E$,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,R.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,R.jsx)(Y,{variant:`ghost`,className:`max-md:min-h-11`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,R.jsx)(Y,{variant:`ghost`,className:`max-md:min-h-11`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function P$({review:e}){let t=e.current.status===`successful`&&!!e.current.cleanupError,n=t?`Main was already delivered. Remove the task worktree if it still contains only the reviewed commit. The task branch is kept.`:C$;return(0,R.jsx)(HA,{open:e.slot,onOpenChange:e.setConfirm,label:t?`Confirm worktree removal`:`Confirm merge to main`,description:n,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,R.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,R.jsx)(`h3`,{className:`font-medium`,children:t?`Remove task worktree?`:`Merge to main?`}),(0,R.jsx)(`p`,{className:`text-sm`,children:n}),(0,R.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,R.jsx)(Y,{variant:`outline`,className:`max-md:min-h-11`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,R.jsx)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,disabled:e.busy||!!e.current.blocked.merge_main||e.terminal&&!t,onClick:()=>void e.request(`merge_main`),children:t?`Confirm worktree removal`:`Confirm merge and push main`})]})]})})}function F$({title:e,review:t}){return(0,R.jsxs)(qH,{title:`Completed work · delivery review`,right:w$[t.current.status],children:[(0,R.jsx)(T$,{delivery:t.current,title:e}),(0,R.jsx)(M$,{review:t}),(0,R.jsx)(N$,{review:t}),(0,R.jsx)(P$,{review:t})]})}function I$(e){let t=j$(e);return(0,R.jsx)(F$,{title:e.title,review:t})}var L$={open:pm,delivered:am,addressed:tm},R$={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function z$({comment:e}){let t=dM(Date.now()-Date.parse(e.createdAt)),n=L$[e.status];return(0,R.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),R$[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function B$({comment:e,taskId:t,own:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??``)>(e.editedAt??``)?a:e;return(0,R.jsxs)(`li`,{className:`card-raised min-w-0 rounded-lg border px-3.5 py-2.5`,children:[r?(0,R.jsx)(dZ,{text:s.text,onSave:async n=>{let r=await Te(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,R.jsx)(WH,{text:s.text}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsx)(z$,{comment:s}),n&&!r?(0,R.jsx)(Y,{size:`sm`,variant:`ghost`,className:`max-md:min-h-11`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function V$({taskId:e,finished:t,canComment:n}){let r=xj(`tasks.comments`,{taskId:e},[`tasks`]),i=sA(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,R.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,R.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,R.jsx)(KH,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`No comments.`:n?`No comments yet. Comment on the plan in the box below (Markdown and images work); the oracle amends it.`:`No comments yet.`}):(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,R.jsx)(B$,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}var H$={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},U$={open:`open`,done:`done`,dropped:`abandoned`},W$={none:{label:`None`,depth:`nothing that runs changed: the engine's checks decide, no QA agent`,tone:`bg-accent text-muted-foreground`},low:{label:`Low`,depth:`a light check: the diff, the nearest tests, done once confident`,tone:`bg-success/10 text-success`},medium:{label:`Medium`,depth:`a standard check: the acceptance criteria and realistic regressions`,tone:`bg-warning/10 text-warning`},high:{label:`High`,depth:`a deep, adversarial review: invariants, recovery and everything the change reaches`,tone:`bg-destructive/10 text-destructive`}};function G$(e){let t=e.source===`classifier`?`Jev`:`rules`;if(!e.qaRequired)return`${t} · no QA agent`;let{min:n,max:r}=e.testBudget;return`${t} · ${n===r?r:`${n}-${r}`} new tests at most`}var K$=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function q$(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function J$(e){return e===`now`?`just now`:`${e} ago`}function Y$(e){if(e.kind===`plan`)return[`planned`,e.age?e.age===`now`?`saved just now`:`saved ${e.age} ago`:``,e.issue?`#${e.issue}`:``].filter(Boolean).join(` · `);let t=e.owner??(e.section===`mine`?`this session`:``);return[q$(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function X$(e){let t=[];for(let n of e){let e=t.at(-1);e&&e.section===n.section?e.rows.push(n):t.push({section:n.section,rows:[n]})}return t}function Z$(e){let t=e.filter(e=>e.kind!==`archived`),n=t.filter(e=>e.check===`open`).length,r=t.length-n,i=e.length-t.length;return[n?`${n} open`:``,r?`${r} finished`:``,i?`${i} archived`:``].filter(Boolean).join(` · `)||`0`}function Q$({step:e,stopped:t}){let n=y$(!t,e);return(0,R.jsx)(`span`,{className:`tabular-nums`,children:v$((e.workedMs??0)+n)})}function $$(){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`relative mt-[0.3125rem] grid size-4 shrink-0 place-items-center`,children:[(0,R.jsx)(`span`,{className:`absolute size-2.5 rounded-full bg-primary/30 motion-safe:animate-ping`}),(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary`})]})}function e1(e){return(e.split(`
102
+ `).find(e=>e.trim())?.trim()??``).replace(/^steps?\s+\d+(?:\s*[-–]\s*\d+)?\s*[:.\-–]\s*/i,``).replace(/^\*\*?goal\*\*?\s*[:\-–]\s*/i,``)}function t1({name:e,className:t}){return(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`grid size-5 shrink-0 place-items-center rounded-md border border-border bg-card`,CW(e),t),children:(0,R.jsx)(bW,{source:e,className:`size-3`})})}function n1({id:e,agents:t,stepText:n}){let[r,i]=(0,m.useState)(Date.now);(0,m.useEffect)(()=>{let e=window.setInterval(()=>i(Date.now()),1e3);return()=>window.clearInterval(e)},[]);let a=t.filter(e=>!e.parentRunId||!t.some(t=>t.runId===e.parentRunId)).flatMap(e=>[e,...t.filter(t=>t.parentRunId===e.runId)]);return(0,R.jsx)(`ul`,{id:e,"aria-label":`Agents on this step`,className:`mt-2 flex flex-col overflow-hidden rounded-lg border border-border bg-card`,children:a.map(e=>{let i=EW({domain:e.domain}),a=!!e.parentRunId&&t.some(t=>t.runId===e.parentRunId),o=Date.parse(e.startedAt),s=e1(e.instruction),c=s&&s.toLowerCase()!==n.trim().toLowerCase()?s:``;return(0,R.jsxs)(`li`,{className:`flex min-w-0 items-center gap-2.5 border-b border-border px-3 py-2 text-xs last:border-b-0`,children:[a?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1.5 h-4 w-3 shrink-0 rounded-bl-md border-b border-l border-border`}):null,(0,R.jsx)(t1,{name:i}),(0,R.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsx)(`span`,{className:q(`font-medium`,CW(i)),children:SW(i)}),a?(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`child`}):null,(0,R.jsx)(UW,{className:`size-3 text-muted-foreground`}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:`working`})]}),c?(0,R.jsx)(`span`,{className:`truncate text-muted-foreground`,title:e.instruction,children:c}):null]}),Number.isFinite(o)?(0,R.jsx)(`span`,{className:`shrink-0 tabular-nums text-muted-foreground`,children:v$(Math.max(0,r-o))}):null]},e.runId)})})}function r1({agents:e,count:t,step:n,stopped:r}){let i=[...new Set(e.map(e=>EW({domain:e.domain})))].slice(0,3);return(0,R.jsxs)(R.Fragment,{children:[i.length>0?(0,R.jsx)(`span`,{className:`flex -space-x-1.5`,children:i.map(e=>(0,R.jsx)(t1,{name:e,className:`size-[1.125rem] ring-2 ring-card`},e))}):null,(0,R.jsxs)(`span`,{children:[t,` `,t===1?`agent`:`agents`,(0,R.jsx)(`span`,{className:`sr-only`,children:` working`})]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground/60`,children:`·`}),(0,R.jsx)(Q$,{step:n,stopped:r})]})}var i1=`inline-flex h-6 shrink-0 items-center gap-1.5 rounded-full border border-primary/20 bg-primary/5 pr-2 pl-1 text-xs font-medium text-primary`;function a1({step:e,index:t,stopped:n}){let r=!!e.active&&!n,i=r?e.agents??[]:[],a=i.length||(e.activeAgentCount??1),[o,s]=(0,m.useState)(!1),c=(0,m.useId)(),l=e.status===`done`,u=l?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`,d=l?tm:pm;return(0,R.jsxs)(`li`,{className:`flex min-w-0 flex-col`,"data-step":r?`active`:e.status,children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5 text-sm max-md:flex-wrap`,children:[r?(0,R.jsx)($$,{}):(0,R.jsx)(d,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${u}`}),(0,R.jsxs)(`span`,{className:`shrink-0 text-xs leading-5 text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,R.jsx)(`span`,{className:q(`min-w-0 break-words`,r||e.status===`current`?`text-foreground`:`text-muted-foreground`),children:e.text}),r&&i.length>0?(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":o,"aria-controls":c,onClick:()=>s(e=>!e),className:q(i1,`-my-0.5 transition-colors outline-none hover:bg-primary/10 focus-visible:ring-3 focus-visible:ring-ring/40`),children:[(0,R.jsx)(r1,{agents:i,count:a,step:e,stopped:n}),(0,R.jsx)(Vp,{"aria-hidden":`true`,className:q(`size-3 transition-transform duration-200`,o&&`rotate-180`)}),(0,R.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):r?(0,R.jsxs)(`span`,{className:q(i1,`-my-0.5`),children:[(0,R.jsx)(r1,{agents:i,count:a,step:e,stopped:n}),(0,R.jsx)(`span`,{className:`sr-only`,children:` (being worked on now)`})]}):e.status===`current`&&!n?(0,R.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`next`,(0,R.jsx)(`span`,{className:`sr-only`,children:` (the step up next)`})]}):null]}),o&&i.length>0?(0,R.jsx)(`div`,{className:`pl-[3.25rem] max-md:pl-0`,children:(0,R.jsx)(n1,{id:c,agents:i,stepText:e.text})}):null]})}function o1({steps:e,stopped:t}){let n=e.filter(e=>e.status===`done`).length;return(0,R.jsx)(qH,{title:`Steps`,right:`${n}/${e.length} done`,children:(0,R.jsx)(`ol`,{className:`flex flex-col gap-2`,"aria-label":`Steps`,children:e.map((e,n)=>(0,R.jsx)(a1,{step:e,index:n,stopped:t},`${n}-${e.text}`))})})}function s1({text:e}){let[t,n]=(0,m.useState)(!1),r=(0,m.useId)();return(0,R.jsxs)(qH,{title:`Full plan`,children:[(0,R.jsxs)(`button`,{type:`button`,"aria-expanded":t,"aria-controls":r,onClick:()=>n(e=>!e),className:`inline-flex min-h-11 w-fit items-center gap-1.5 rounded-md text-sm text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(Gp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,t&&`rotate-90`)}),t?`Hide the details`:`Read the details of each step`]}),t?(0,R.jsx)(`div`,{id:r,children:(0,R.jsx)(WH,{text:e})}):null]})}function c1({detail:e,finished:t}){return e.plan&&e.planDetails?(0,R.jsx)(s1,{text:e.planDetails}):e.plan?(0,R.jsx)(qH,{title:`Approved plan`,children:(0,R.jsx)(WH,{text:e.plan})}):e.proposal?(0,R.jsx)(qH,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,R.jsx)(WH,{text:e.proposal})}):(0,R.jsx)(qH,{title:`Plan`,children:(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t?`It ended before a plan was made.`:`No proposal or plan yet — the oracle is still clarifying or scouting.`})})}function l1({amendments:e}){return e.length===0?null:(0,R.jsx)(qH,{title:`Amendments`,children:(0,R.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,R.jsx)(`li`,{className:`break-words`,children:e},e))})})}function u1({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,R.jsx)(qH,{title:`Waiting on`,children:(0,R.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)($p,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.kind,` `,e.detail]})]},`${t}-${e.kind}`)),e.blockers.map((e,t)=>(0,R.jsxs)(`li`,{className:`flex gap-2`,children:[(0,R.jsx)(dm,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function d1({risk:e}){let t=W$[e.risk];return(0,R.jsxs)(qH,{title:`QA risk`,right:G$(e),children:[(0,R.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1 text-sm`,"data-qa-risk":e.risk,children:[(0,R.jsx)(`span`,{className:q(`rounded-md px-2 py-0.5 text-xs font-medium`,t.tone),children:t.label}),(0,R.jsx)(`span`,{className:`text-muted-foreground`,children:t.depth})]}),e.focusAreas.length>0?(0,R.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,"aria-label":`What QA looks at first`,children:e.focusAreas.map(e=>(0,R.jsx)(`li`,{className:`break-words`,children:e},e))}):null,(0,R.jsxs)(`p`,{className:`text-xs break-words text-muted-foreground`,children:[e.riskFactors.join(` · `),e.qaRequired?` · existing tests ${e.existingTestsLikelySufficient?`likely enough`:`likely not enough`}`:``]})]})}function f1({runs:e}){return e.length===0?null:(0,R.jsx)(qH,{title:`Recent runs`,children:(0,R.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,R.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function p1({detail:e,finished:t}){return(0,R.jsxs)(R.Fragment,{children:[e.steps.length>0?(0,R.jsx)(o1,{steps:e.steps,stopped:t}):null,e.request?(0,R.jsx)(qH,{title:`Request`,children:(0,R.jsx)(WH,{text:e.request})}):null,(0,R.jsx)(c1,{detail:e,finished:t})]})}function m1({detail:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(l1,{amendments:e.amendments}),(0,R.jsx)(u1,{detail:e}),e.qaRisk?(0,R.jsx)(d1,{risk:e.qaRisk}):null,(0,R.jsx)(f1,{runs:e.runs})]})}function h1({row:e,quiet:t=!1}){let n=(0,m.useRef)(!0);(0,m.useEffect)(()=>(n.current=!0,()=>{n.current=!1}),[]);async function r(){if(e.section===`mine`)return aj(`#/lobby`);let t=P(),r=()=>n.current&&P()===t;try{let t=await Te(`tasks.open`,{taskId:e.id});if(!r())return;let n=await Te(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return aj(`#/lobby`);if(t.sessionId&&!t.key)return H.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return H.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await U(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&aj(`#/lobby`)}catch(e){r()&&H.error(e instanceof Error?e.message:String(e))}}let i=e.section===`mine`;return(0,R.jsx)(X,{label:i?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:kp,tone:t?`neutral`:`primary`,shortcut:`S`,onClick:()=>void r()})}function g1({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,R.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,R.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,R.jsxs)(`span`,{children:[n>0?(0,R.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,R.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function _1({planId:e}){let t=xj(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,R.jsxs)(R.Fragment,{children:[n.issue?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,R.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,R.jsx)(g1,{split:n.split}):null,(0,R.jsx)(qH,{title:`Agreed plan`,children:(0,R.jsx)(WH,{text:n.brief})})]}):t.error?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function v1({row:e,onGone:t}){let n=async n=>{await U(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await U(`plans.discard`,{planId:e.id})&&t()};return(0,R.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-4`,"aria-label":e.title,children:[(0,R.jsxs)(Gj,{children:[(0,R.jsx)(X,{label:`Start here`,icon:Vh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,R.jsx)(X,{label:`Start in a new session`,text:`New session`,icon:dg,shortcut:`N`,onClick:()=>void n(`session`)}),(0,R.jsx)(SM,{icon:Cg,label:`Discard`,shortcut:`Delete`,title:`Discard "${e.title}"?`,description:`The saved plan is removed from the list. This cannot be undone.`,confirmLabel:`Discard`,variant:`destructive`,onConfirm:()=>void r()})]}),(0,R.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,R.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,R.jsx)(WQ,{check:`open`,className:`mt-1.5`}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${J$(e.age)}`:``]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,R.jsx)(_1,{planId:e.id})]})}function y1({row:e,onResumed:t}){let[n,r]=(0,m.useState)(!1),i=(0,m.useRef)(!0);(0,m.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);async function a(){let n=P();r(!0);try{let r=await Te(`tasks.resume`,{taskId:e.id});if(P()!==n)return;let i=r.key;H(r.notice,i?{action:{label:`Watch`,onClick:()=>aj(`#/sessions/${encodeURIComponent(i)}`)}}:void 0),t()}catch(e){P()===n&&H.error(e instanceof Error?e.message:String(e))}finally{i.current&&r(!1)}}let o=e.owner===`not running`;return(0,R.jsx)(X,{label:o?`Resume: carry it on in a background session`:`Resume: unpause it where it runs`,text:`Resume`,icon:Vh,tone:`primary`,shortcut:`R`,disabled:n,onClick:()=>void a()})}function b1(e){if(e.kind===`archived`)return{state:`archived`,rest:J$(e.age??`now`)};let t=e.check!==`open`,n=e.owner??(e.section===`mine`?`this session`:``),r=t&&e.age?`${e.check===`dropped`?`dropped`:`done`} ${J$(e.age)}`:``;return{state:q$(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function x1(e){return e?[VQ(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function S1({row:e}){return e.progress?(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(UQ,{done:e.progress.done,total:e.progress.total}),(0,R.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]})]}):null}function C1({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=b1(e);return(0,R.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,R.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,R.jsx)(WQ,{check:e.check,className:`mt-1.5`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[U$[e.check],`:`]}),(0,R.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,R.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,R.jsx)(`span`,{children:i}):null]}),(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,x1(t),n].filter(Boolean).join(` · `)}),(0,R.jsx)(S1,{row:e})]})}function w1({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await U(`tasks.restore`,{taskId:r},{undo:()=>void U(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await U(`tasks.archive`,{taskId:r},{undo:()=>void U(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await U(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void U(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function T1({row:e,archive:t}){return e.check===`open`?(0,R.jsx)(SM,{label:`Archive`,icon:Cp,shortcut:`E`,title:`Archive "${e.title}"?`,description:`A task still under way is abandoned first, then moved to the archive. Restore brings it back.`,confirmLabel:`Archive`,onConfirm:()=>void t()}):(0,R.jsx)(X,{label:`Archive`,icon:Cp,shortcut:`E`,onClick:()=>void t()})}function E1({on:e,toggle:t}){return Uj(`a`,t),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`label`,{className:`flex h-8 cursor-pointer items-center gap-2 rounded-lg px-2.5 text-[0.8125rem] font-medium transition-colors hover:bg-accent max-md:min-h-11`,children:[(0,R.jsx)(Gh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,R.jsx)(`span`,{children:`Auto`}),(0,R.jsx)(GJ,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,R.jsx)(rA,{chord:`A`,className:`kbd-hint`})]})}),(0,R.jsx)(Tj,{children:`Auto mode: the oracle decides without asking`})]})}function D1(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=w1(e),o=t.kind===`archived`,s=t.kind===`task`&&t.check===`open`&&!!t.resumable;return(0,R.jsxs)(Gj,{children:[s?(0,R.jsx)(y1,{row:t,onResumed:e.onChanged}):null,t.kind===`task`&&t.check===`open`?(0,R.jsx)(h1,{row:t,quiet:s}):null,t.kind===`task`?(0,R.jsx)(O1,{taskId:t.id}):null,o?(0,R.jsx)(X,{label:`Restore`,icon:Yh,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,R.jsx)(E1,{on:!!t.auto,toggle:a}):null,o?null:(0,R.jsx)(T1,{row:t,archive:r}),(0,R.jsx)(SM,{icon:Cg,label:o?`Delete for good`:`Delete`,text:`Delete`,shortcut:`Delete`,title:`Delete "${t.title}" for good?`,description:`This cannot be undone.`,confirmLabel:`Delete`,variant:`destructive`,onConfirm:()=>void i()})]})}function O1({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=P();try{let r=await Te(`tasks.open`,{taskId:e});if(!t.current||P()!==n)return;r.notice&&H.info(r.notice);let i=await Te(`status.get`,{});if(!t.current||P()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a===`here`?aj(`#/lobby`):a?aj(`#/sessions/${encodeURIComponent(a)}`):r.notice||H.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&P()===n&&H.error(e instanceof Error?e.message:String(e))}}return(0,R.jsx)(X,{label:`Open task conversation`,text:`Conversation`,icon:dh,shortcut:`O`,onClick:()=>void n()})}function k1(e){let{row:t}=e,n=t.kind===`plan`,r=xj(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=sA(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,R.jsx)(v1,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`,s=r.data?r.data.work:t.work;return(0,R.jsxs)(`article`,{className:`flex min-w-0 flex-col gap-5`,"aria-label":t.title,children:[(0,R.jsx)(D1,{...e}),(0,R.jsx)(C1,{row:t,task:a}),(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,R.jsx)(S$,{timing:r.data?.timing??t.timing,...s?{work:s}:{},stopped:t.check!==`open`})}),r.data?.delivery?(0,R.jsx)(I$,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,R.jsx)(p1,{detail:r.data,finished:!o}):null,(0,R.jsx)(V$,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,R.jsx)(m1,{detail:r.data}):null,r.error&&!r.data?(0,R.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function A1({row:e}){return e.check===`open`&&e.progress?(0,R.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,R.jsx)(UQ,{done:e.progress.done,total:e.progress.total}),(0,R.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,R.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function j1(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function M1({row:e,card:t}){return(0,R.jsxs)(R.Fragment,{children:[t?(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:e.status.replaceAll(`_`,` `)}):null,e.check===`open`?(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:Y$(e)}):null,e.kind===`plan`?null:(0,R.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,R.jsx)(S$,{timing:e.timing,...e.work?{work:e.work}:{},stopped:e.check!==`open`})}),e.delivery?(0,R.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})}function N1({row:e,selected:t,onSelect:n,card:r=!1}){return(0,R.jsx)(`li`,{className:r?`overflow-hidden rounded-lg border border-input bg-card shadow-sm`:void 0,children:(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(e.id),className:q(MU,`max-md:min-h-11`),children:[(0,R.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,R.jsx)(WQ,{check:e.check,className:`mt-0.5`}),(0,R.jsxs)(`span`,{className:`sr-only`,children:[U$[e.check],`:`]}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,j1(e),t&&`font-medium text-foreground`),children:e.title}),(0,R.jsx)(A1,{row:e})]}),(0,R.jsx)(M1,{row:e,card:r})]})})}function P1({rows:e,selectedId:t,onSelect:n}){return(0,R.jsx)(`div`,{className:`flex flex-col pb-2`,children:X$(e).map(({section:e,rows:r})=>(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`h3`,{className:PU,children:(0,R.jsx)(KH,{title:H$[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,R.jsx)(`ul`,{className:NU,children:r.map(e=>(0,R.jsx)(N1,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var F1=()=>aj(ij(`tasks`,`board`)),I1=e=>aj(ij(`tasks`,`board`,e)),L1=[`Backlog`,`In progress`,`Completed`];function R1(e){if(e.kind!==`archived`&&e.section!==`archived`)return e.check===`done`?`Completed`:e.kind===`plan`||e.status===`created`||e.check===`dropped`?`Backlog`:`In progress`}function z1({title:e,rows:t,id:n}){return(0,R.jsxs)(iq,{role:`region`,"aria-label":e,spacing:`sm`,className:`min-w-0 max-md:rounded-lg`,children:[(0,R.jsx)(oq,{className:`py-2`,children:(0,R.jsxs)(`h2`,{className:`flex items-center justify-between gap-2 text-sm font-semibold`,children:[e,(0,R.jsx)(jU,{variant:`secondary`,radius:`full`,children:t.length})]})}),(0,R.jsxs)(aq,{children:[(0,R.jsx)(`ul`,{className:`flex flex-col gap-3`,children:t.map(e=>(0,R.jsx)(N1,{row:e,selected:e.id===n,onSelect:I1,card:!0},`${e.kind}-${e.id}`))}),t.length?null:(0,R.jsx)(`p`,{className:`py-4 text-sm text-muted-foreground`,children:`No tasks here.`})]})]})}function B1({rows:e,id:t}){return(0,R.jsx)(`div`,{className:`grid min-w-0 items-start gap-4 p-4 max-md:gap-3 max-md:p-3 md:grid-cols-3`,"aria-label":`Task board`,children:L1.map(n=>(0,R.jsx)(z1,{title:n,rows:e.filter(e=>R1(e)===n),id:t},n))})}function V1({id:e}){let t=xj(`tasks.list`,{},[`tasks`,`plans`]),n=t.data?.rows??[],r=n.find(t=>t.id===e&&R1(t)!==void 0),i=r?.kind===`task`?r.id:void 0;if((0,m.useEffect)(()=>(IQ(i),()=>IQ(void 0)),[i]),!t.data&&t.error)return(0,R.jsx)(yj,{message:`Could not load tasks. ${t.error}`,onRetry:t.reload});let a=r?(0,R.jsx)(k1,{row:r,onGone:F1,onChanged:t.reload},r.id):null;return(0,R.jsx)(iM,{wide:!1,list:t.data?(0,R.jsx)(B1,{rows:n,id:e}):(0,R.jsx)(oM,{}),detail:a,open:!!r,onClose:F1,hint:`Select a task to see its detail.`,describe:`Task detail`})}var H1=()=>aj(ij(`tasks`)),U1=e=>aj(ij(`tasks`,e));function W1(){return(0,R.jsxs)(sj,{className:`m-4 flex-1`,children:[(0,R.jsxs)(cj,{children:[(0,R.jsx)(uj,{variant:`icon`,children:(0,R.jsx)(Ym,{"aria-hidden":`true`})}),(0,R.jsx)(fj,{children:K$})]}),(0,R.jsx)(Y,{className:`max-md:min-h-11 max-md:whitespace-normal`,onClick:()=>aj(ij(`plan`)),children:`Plan a task`})]})}function G1({shown:e,count:t,onToggle:n}){return(0,R.jsxs)(`label`,{className:`btn-raised flex h-7 min-w-0 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow] max-md:h-11 max-md:min-w-11`,children:[(0,R.jsx)(qG,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,R.jsx)(jU,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function K1({id:e,board:t=!1}){return(0,R.jsxs)(ok,{value:t?`board`:`list`,onValueChange:e=>aj(ij(`tasks`,...e===`board`?[`board`]:[])),className:`flex min-h-0 flex-1 flex-col`,children:[(0,R.jsxs)(sk,{"aria-label":`Task views`,className:`flex gap-1 border-b border-border px-4 py-2 max-md:px-3 max-md:py-1.5`,children:[(0,R.jsx)(ck,{value:`list`,className:`rounded-lg border border-input px-3 py-1.5 text-sm text-muted-foreground data-[state=active]:bg-tab-fill data-[state=active]:text-foreground focus-visible:ring-3 focus-visible:ring-ring`,children:`List`}),(0,R.jsx)(ck,{value:`board`,className:`rounded-lg border border-input px-3 py-1.5 text-sm text-muted-foreground data-[state=active]:bg-tab-fill data-[state=active]:text-foreground focus-visible:ring-3 focus-visible:ring-ring`,children:`Board`})]}),(0,R.jsx)(lk,{value:`list`,className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(q1,{id:e})}),(0,R.jsx)(lk,{value:`board`,className:`flex min-h-0 flex-1 flex-col`,children:(0,R.jsx)(V1,{id:e})})]})}function q1({id:e}){let t=eM(),[n,r]=(0,m.useState)(!1),i=xj(`tasks.list`,{},[`tasks`,`plans`]),a=xj(`tasks.archived`,{},[`tasks`]),o=i.data?.rows??[],s=a.data?.rows??[],c=n?[...o,...s]:o,l=e??(t?c[0]?.id:void 0),u=[...c,...s].find(e=>e.id===l&&e.kind===`task`)?.id;if((0,m.useEffect)(()=>(IQ(u),()=>IQ(void 0)),[u]),!i.data&&i.error)return(0,R.jsx)(yj,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,R.jsx)(W1,{});let d=[...c,...s].find(e=>e.id===l),f=(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(aM,{title:`Tasks`,count:Z$(c),children:(0,R.jsx)(G1,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,R.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:K$}):(0,R.jsx)(P1,{rows:c,selectedId:l,onSelect:U1}):(0,R.jsx)(oM,{})]}),p=d?(0,R.jsx)(k1,{row:d,onGone:H1,onChanged:i.reload},d.id):e?(0,R.jsx)(J1,{}):null;return(0,R.jsx)(iM,{wide:t,list:f,detail:p,open:!!e,onClose:H1,hint:`Select a task to see its detail.`,describe:`Task detail`})}function J1(){return(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var Y1={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function X1({to:e}){return(0,m.useEffect)(()=>aj(e),[e]),null}function Z1(){return cA(`(max-width: 767.98px)`)?(0,R.jsxs)(`section`,{className:`flex min-h-full flex-1 flex-col items-center justify-center gap-4 px-6 py-12 text-center`,children:[(0,R.jsx)(`h1`,{className:`text-lg font-medium`,children:`Metrics is unavailable on phones.`}),(0,R.jsx)(`a`,{href:`#/lobby`,className:`btn-tint inline-flex min-h-11 items-center justify-center rounded-lg border px-5 text-sm font-medium focus-visible:ring-3 focus-visible:ring-ring/40`,children:`Lobby`})]}):(0,R.jsx)(lJ,{})}function Q1(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function $1(e){if(e.kind===`settings`)return(0,R.jsx)(GX,{});if(e.kind===`sessions`)return e.key?(0,R.jsx)(g$,{id:Q1([e.key])}):(0,R.jsx)(X1,{to:`#/lobby`});switch(e.tab){case`lobby`:return(0,R.jsx)(nq,{});case`tasks`:return(0,R.jsx)(K1,{...KG(e.rest)});case`plan`:return(0,R.jsx)(dQ,{rest:e.rest});case`quickfix`:return(0,R.jsx)(jQ,{id:Q1(e.rest)});case`issues`:return(0,R.jsx)(hW,{rest:e.rest});case`metrics`:return(0,R.jsx)(Z1,{});case`git`:return(0,R.jsx)(HU,{rest:e.rest});case`knowledge`:return(0,R.jsx)(GG,{rest:e.rest});case`excalidraw`:return(0,R.jsx)($K,{id:Q1(e.rest)})}}function e0(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var t0={tab:`Tab`,esc:`Escape`,escape:`Escape`,enter:`Enter`,space:`Space`,pageup:`PageUp`,pagedown:`PageDown`,home:`Home`,end:`End`,"]":`BracketRight`,"[":`BracketLeft`,"/":`Slash`,"?":`Slash`,",":`Comma`,".":`Period`};function n0(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:t0[e]}function r0(e){let t={alt:!1,ctrl:!1,shift:!1,meta:!1,code:``};for(let n of e.toLowerCase().split(`+`))if(n===`alt`)t.alt=!0;else if(n===`ctrl`||n===`control`)t.ctrl=!0;else if(n===`shift`)t.shift=!0;else if(n===`meta`||n===`cmd`)t.meta=!0;else{let e=n0(n);if(!e)return;t.code=e}return t.code?t:void 0}function i0(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function a0(e,t){let n=r0(t);return n?i0(e,n):!1}function o0(e,t){for(let n of t)if(a0(e,n.key))return n.action}function s0(e,t){for(let n of t)if(a0(e,n.key))return n.id}function c0(e){return Oj(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||ZA()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function l0(e,t,n,r){let i=!e.shiftKey&&/^[1-9]$/.test(e.key)?t[Number(e.key)-1]:void 0;if(i)r(i.id);else if(e.key===`/`)n(`search`);else if(e.key===`?`)n(`help`);else if(e.key===`j`||e.key===`k`)Pj(e.key===`j`?1:-1);else return!1;return!0}function u0(e,t){let n=s0(e,t.tabs),r=o0(e,t.keys);return!n&&!r?!1:e0(r,{overlay:!!document.querySelector(`[role='dialog']:not([data-state='closed']), [role='menu']:not([data-state='closed']), [role='listbox']`)||ZA(),typing:Oj(e.target)||e.target instanceof HTMLInputElement,saveAvailable:!!document.querySelector(`[data-plan-save]:not([disabled])`)})||(r===`search`||r===`savePlan`)&&!t.insideApp()?!0:(e.preventDefault(),n?t.onTab(n):r&&t.onAction(r),!0)}function d0(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=Y1[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(l0(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function f0(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){o0(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&c0(n)){t=0;return}if(u0(n,e)){t=0;return}t=r?d0(n,e,t):0};return window.addEventListener(`keydown`,n,!0),()=>window.removeEventListener(`keydown`,n,!0)},[e.enabled,e.keys,e.tabs,e.insideApp,e.onAction,e.onTab])}var p0=[{id:`focus`,caps:[`/`],help:`focus search, or the message box`},{id:`send`,label:`Enter`,help:`send the message`},{id:`newline`,label:`Shift+Enter`,help:`a new line (lists carry on)`},{id:`format`,label:`Ctrl+B`,help:`bold; Ctrl+I italic, Ctrl+E code, Ctrl+K link`},{id:`leave`,label:`Esc`,help:`leave the box for the tab bar`}],m0=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(Y1).map(([e,t])=>({id:`go.${t}`,caps:[`g`,e],help:`jump to ${t}`})),{id:`project`,caps:[`P`],help:`open the project switcher`},{id:`theme`,caps:[`D`],help:`switch between light and dark`},{id:`edit`,label:`Ctrl+Enter`,help:`save an edited message; Esc cancels`}],h0=[{id:`tasks`,page:`Tasks`,keys:[[`E`,`archive`],[`R`,`restore`],[`A`,`auto mode`],[`Delete`,`delete`]]},{id:`saved`,page:`Saved plan`,keys:[[`S`,`start here`],[`N`,`new session`],[`Delete`,`discard`]]},{id:`plan`,page:`Plan`,keys:[[`A`,`answer`],[`R`,`retry`],[`Ctrl+S`,`save`],[`N`,`new plan`]]},{id:`quickfix`,page:`Quick fix`,keys:[[`R`,`run anyway`],[`T`,`make a task`],[`C`,`cancel`]]},{id:`git`,page:`Git`,keys:[[`R`,`refresh`],[`V`,`review`],[`Q`,`Jev's read`],[`X`,`stop`]]},{id:`issues`,page:`Issues`,keys:[[`R`,`refresh`]]},{id:`knowledge`,page:`Knowledge`,keys:[[`E`,`edit`],[`A`,`add`],[`C`,`comment`],[`F`,`edit file`],[`Delete`,`delete`]]},{id:`excalidraw`,page:`Excalidraw`,keys:[[`R`,`reveal`],[`C`,`copy`],[`O`,`open`],[`W`,`draw`],[`T`,`check`],[`Delete`,`remove`]]},{id:`sessions`,page:`Sessions`,keys:[[`M`,`move here`],[`S`,`stop`],[`B`,`back`]]},{id:`confirm`,page:`Asked to confirm`,keys:[[`Y`,`yes, do it`],[`Esc`,`keep it`]]}],g0=[{id:`enter`,caps:[`↓`],help:`from the tab bar, into the page`},{id:`rows`,caps:[`↑`,`↓`],help:`move through a list (j and k work too)`},{id:`pane`,caps:[`←`,`→`],help:`between a list and its detail (h and l)`},{id:`ends`,caps:[`Home`,`End`],help:`first and last row`},{id:`open`,caps:[`Enter`,`Space`],help:`activate the focused button or row (links: Enter; checkboxes: Space)`},{id:`back`,label:`Esc`,help:`back up to the tab bar`}],_0=[{id:`qmove`,caps:[`↑`,`↓`],help:`move between the options`},{id:`qpick`,label:`Space`,help:`pick an option (several when allowed)`},{id:`qchoose`,label:`Enter`,help:`choose and go on; in your own answer, send it`},{id:`qacross`,caps:[`←`,`→`],help:`previous and next question`},{id:`qdigit`,caps:[`1`,`2`,`…`],help:`pick that option`},{id:`qesc`,label:`Esc`,help:`put the question away for later`}];function v0({line:e}){return(0,R.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,R.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,R.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,R.jsx)(Zk,{children:e},e))}):(0,R.jsx)(rA,{chord:e.label??``})}),(0,R.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function y0(){return(0,R.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),h0.map(e=>(0,R.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,R.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1.5 text-sm text-muted-foreground`,children:e.keys.map(([e,t])=>(0,R.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,R.jsx)(rA,{chord:e}),t]},e))})]},e.id))]})}function b0({title:e,lines:t}){return(0,R.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,R.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,R.jsx)(v0,{line:e},e.id))]})}function x0(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function S0(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function C0({open:e,onOpenChange:t,keys:n,tabs:r}){let i=cA(`(max-width: 767.98px)`),a=e&&!i,o=XA(a,YA.help);return(0,m.useEffect)(()=>{i&&e&&t(!1)},[i,e,t]),(0,m.useEffect)(()=>{if(!a||!o)return;let e=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&a0(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,e,!0),()=>window.removeEventListener(`keydown`,e,!0)},[n,t,o,a]),i?null:(0,R.jsxs)(HA,{open:a&&o,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,R.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,R.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(rA,{chord:`Esc`}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,R.jsx)(Vg,{"aria-hidden":`true`})})]})]}),(0,R.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-x-10 gap-y-6 overflow-y-auto px-6 py-5 md:grid-cols-2`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsx)(b0,{title:`Everywhere`,lines:x0(n)}),(0,R.jsx)(b0,{title:`Jump to a tab`,lines:S0(r)}),(0,R.jsx)(b0,{title:`Navigation and editing`,lines:m0}),(0,R.jsx)(b0,{title:`Message box`,lines:p0})]}),(0,R.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,R.jsx)(b0,{title:`Lists and panes`,lines:g0}),(0,R.jsx)(y0,{}),(0,R.jsx)(b0,{title:`Questions`,lines:_0})]})]})]})}var w0=`size-[1.05rem]`;function T0({hint:e,onHelp:t,className:n,side:r=`top`}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:n,children:(0,R.jsx)(Gm,{"aria-hidden":`true`,className:w0})})}),(0,R.jsxs)(Tj,{side:r,children:[`Keyboard shortcuts `,(0,R.jsx)(rA,{chord:e})]})]})}function E0({className:e,side:t=`top`}){let n=xJ(),r=cA(`(max-width: 767.98px)`),i=r?`App sounds`:n?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":i,"aria-pressed":n,"aria-describedby":r?`app-sounds-help focused-action-help`:`focused-action-help`,className:e,onClick:()=>yJ(!n),children:n?(0,R.jsx)(Fg,{"aria-hidden":`true`,className:w0}):(0,R.jsx)(Ng,{"aria-hidden":`true`,className:w0})})}),(0,R.jsx)(Tj,{side:t,children:i})]}),r?(0,R.jsx)(`span`,{id:`app-sounds-help`,className:`sr-only`,children:`App sounds controls prompt tones and navigation ticks.`}):null]})}function D0({className:e,side:t=`top`}){let{theme:n,setTheme:r}=TY(),i=n===`dark`||n===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":i?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>r(i?`light`:`dark`),className:e,children:i?(0,R.jsx)(_g,{"aria-hidden":`true`,className:w0}):(0,R.jsx)(Ch,{"aria-hidden":`true`,className:w0})})}),(0,R.jsxs)(Tj,{side:t,children:[i?`Light mode`:`Dark mode`,` `,(0,R.jsx)(`span`,{className:`max-md:hidden`,children:(0,R.jsx)(rA,{chord:`D`})})]})]})}function O0(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function k0(e){if(e.size===0)throw Error(`${e.name||`That file`} is empty.`);if(e.size>20971520)throw Error(`${e.name||`That file`} is larger than 20 MB.`);let t=new URLSearchParams({name:e.name||`pasted-file`,type:e.type}),n=await fetch(F(`/api/files.upload?${t}`),{method:`POST`,headers:{"Content-Type":`application/octet-stream`},body:e,credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Ce(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Ce(r.error,r.code,n.status);return r.result}function A0(e,t,n,r){let i=e.slice(0,t),a=e.slice(t,n),o=e.slice(n);if(a.length>=r.length*2&&a.startsWith(r)&&a.endsWith(r)){let e=a.slice(r.length,a.length-r.length);return{value:i+e+o,start:t,end:t+e.length}}return i.endsWith(r)&&o.startsWith(r)?{value:i.slice(0,i.length-r.length)+a+o.slice(r.length),start:t-r.length,end:n-r.length}:{value:i+r+a+r+o,start:t+r.length,end:n+r.length}}function j0(e,t,n){let r=e.slice(t,n)||`text`,i=`[${r}](url)`,a=t+r.length+3;return{value:e.slice(0,t)+i+e.slice(n),start:a,end:a+3}}var M0=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function N0(e,t){let n=e.lastIndexOf(`
102
103
  `,t-1)+1,r=e.indexOf(`
103
- `,t),i=e.slice(n,r<0?e.length:r),a=w0.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}function E0({rest:e}){let{chat:t}=qW(e);return(0,R.jsx)(`div`,{role:`group`,"aria-label":`Knowledge pane`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5`,children:[`Chat`,`Docs`].map(n=>(0,R.jsx)(`button`,{type:`button`,"aria-pressed":t===(n===`Chat`),onClick:()=>aj(JW(e,n===`Chat`)),className:q(`h-6 rounded-md border px-2.5 text-xs font-medium outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,t===(n===`Chat`)?`btn-raised btn-soft bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:n},n))})}var D0={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function O0(e,t,n){if(e.kind===`sessions`){let e={id:`newsession`,pill:`New session`,label:`Start a task in a new session`,placeholder:`Describe a task for a new session…`};return n?[{id:`session`,pill:`Message`,label:`Message ${n.name}`,placeholder:`Message ${n.name}…`,session:n},e,D0]:[e,D0]}if(e.kind!==`tab`)return[D0];if(e.tab===`knowledge`)return[{id:`knowledge`,pill:`Oracle`,label:`Ask the oracle about this project`,placeholder:`Ask about this project — the oracle searches the code and learns what is missing…`}];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},D0];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},D0];let r=e.tab===`tasks`?OG(e.rest).id??t:void 0;return r?[{id:`comment`,pill:`Comment`,label:`Comment on ${r}`,placeholder:`Comment on ${r}'s plan…`,taskId:r},{id:`task`,pill:`Task's oracle`,label:`Message ${r}'s oracle`,placeholder:`Leave a message for ${r}'s oracle…`,taskId:r},D0]:[D0]}var k0=0,A0=`toolbar-button relative inline-flex size-8 items-center justify-center rounded-lg border text-foreground transition-[background-color,border-color,translate] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`;function j0(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function M0({file:e,onRemove:t}){let n=(0,R.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`btn-ghost flex shrink-0 items-center justify-center rounded-lg border text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,e.image?`absolute top-1 right-1 size-5 bg-background/80 text-foreground backdrop-blur-sm`:`size-7`),children:(0,R.jsx)(Vg,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,R.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},title:`${e.name} · ${b0(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,R.jsx)(`img`,{src:F(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,R.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,R.jsx)(pj,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,R.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},className:`flex h-9 min-w-0 items-center gap-2 rounded-lg border border-border bg-muted pr-1 pl-2.5`,children:[(0,R.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,R.jsx)(Fm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,R.jsx)(pj,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,R.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,R.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:b0(e.size)})]}),n]})}function N0({route:e,keys:t,onHelp:n,dockNav:r}){let[i,a]=(0,m.useState)(``),[o,s]=(0,m.useState)([]),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),[h,g]=(0,m.useState)(),_=sA(`status`),v=sA(`lobby`),y=QA(),b=(_.data?.busy??!1)||!!v.data?.reply?.trim(),x=lA(),S=cA(`(max-width: 767.98px)`),{keyboardOpen:C,keyboardInset:w}=BA(),{taskId:T,session:E}=jQ(),D=(0,m.useMemo)(()=>O0(e,T,E),[e,T,E]),O=D.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),k=D.find(e=>e.id===h)??D[0];(0,m.useEffect)(()=>g(void 0),[O]);let A=(0,m.useRef)(null),ee=(0,m.useRef)(null),j=(0,m.useRef)(null),M=(0,m.useRef)(o);M.current=o;let te=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=te.current,t=ee.current;e&&t&&(te.current=void 0,t.setSelectionRange(e.start,e.end))},[i]);let ne=(0,m.useCallback)(e=>{te.current={start:e.start,end:e.end},a(e.value)},[]);(0,m.useEffect)(()=>{let e=A.current;if(!e)return;let t=document.documentElement,n=()=>t.style.setProperty(`--composer-h`,y?`0px`:`${Math.ceil(e.getBoundingClientRect().height+(S?w:0))}px`);n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect(),t.style.setProperty(`--composer-h`,`0px`)}},[y,w,C,S]);let N=(0,m.useCallback)(e=>{let t=[...e],n=8-M.current.length;t.length>n&&H.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++k0}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;s(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),x0(e).then(e=>s(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{H.error(e instanceof Error?e.message:`That file did not upload.`),s(e=>e.filter(e=>e.key!==t))})}},[]),re=(0,m.useCallback)(e=>{s(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),ie=o.some(e=>e.state===`uploading`),ae=o.flatMap(e=>e.info?[e.info.id]:[]),oe=(i.trim().length>0||ae.length>0)&&!ie&&!u,se=(0,m.useCallback)(async()=>{if(!oe)return;d(!0);let t=ae.length>0?ae:void 0,n={text:i,...t?{attachments:t}:{}};try{let r=!0;if(k.id===`oracle`){let e=await Te(`lobby.send`,n);e.notice&&H(e.notice)}else if(k.id===`knowledge`)r=await U(`knowledge.ask`,n)!==void 0,r&&e.kind===`tab`&&aj(JW(e.rest,!0));else if(k.id===`panel`)r=await U(`planner.send`,n)!==void 0;else if(k.id===`quickfix`)r=await U(`quickfix.submit`,n)!==void 0;else if(k.id===`task`)r=await U(`tasks.message`,{taskId:k.taskId,...n})!==void 0;else if(k.id===`session`)r=await U(`sessions.message`,{...k.session.address,...n})!==void 0;else if(k.id===`newsession`){let e=await U(`sessions.start`,{request:i,...t?{attachments:t}:{}});r=e!==void 0,e?.key&&aj(`#/sessions/${encodeURIComponent(e.key)}`)}else r=await U(`tasks.comment`,{taskId:k.taskId,...n})!==void 0;if(r){a(``);for(let e of M.current)e.image&&URL.revokeObjectURL(e.image);s([])}}catch(e){H.error(e instanceof Error?e.message:`Could not send`)}finally{d(!1)}},[oe,ae,k,i,e]),ce=(0,m.useCallback)(async()=>{try{await Te(`lobby.abort`,{})}catch(e){H.error(e instanceof Error?e.message:`Could not stop`)}},[]);return(0,R.jsxs)(`div`,{id:`app-dock`,ref:A,style:S&&C?{bottom:`${w}px`}:void 0,className:q(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(1.25rem,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap max-md:px-2`,S&&C?`max-md:pb-2`:`max-md:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,y&&`opacity-0`),inert:y,children:[r?(0,R.jsx)(`div`,{className:`pointer-events-auto mx-auto mb-1.5 w-full max-w-3xl`,children:r}):null,(0,R.jsx)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-3xl`,children:(0,R.jsxs)(`div`,{className:q(`group/composer relative rounded-2xl border border-dock-border bg-dock shadow-dock transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-ring focus-within:shadow-dock-focus`,x&&`min-[500px]:max-md:grid min-[500px]:max-md:grid-cols-[minmax(0,1fr)_auto] min-[500px]:max-md:min-w-0`,f&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),p(!0))},onDragLeave:()=>p(!1),onDrop:e=>{e.preventDefault(),p(!1),e.dataTransfer.files.length>0&&N(e.dataTransfer.files)},children:[(0,R.jsx)(Du,{initial:!1,children:o.length>0?(0,R.jsx)(B.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:420,damping:36},"aria-label":`Attachments`,className:q(`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,x&&`min-[500px]:max-md:col-span-full min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full`),children:o.map(e=>(0,R.jsx)(M0,{file:e,onRemove:()=>re(e.key)},e.key))},`files`):null}),c?(0,R.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:q(`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,x&&`min-[500px]:max-md:col-span-full min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full`),children:i.trim()?(0,R.jsx)(WH,{text:i}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,R.jsx)(`div`,{className:q(`flex px-4 pt-3 pb-1`,x&&`min-[500px]:max-md:col-start-1 min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full min-[500px]:max-md:pt-1 min-[500px]:max-md:pb-1`),children:(0,R.jsx)(`textarea`,{ref:ee,id:`composer-text`,"aria-label":k.label,value:i,onChange:e=>a(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),Lj();return}let t=e.currentTarget,n=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(n)){e.preventDefault();let{selectionStart:r,selectionEnd:i,value:a}=t;ne(n===`k`?C0(a,r,i):S0(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),l(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=T0(t.value,t.selectionStart);n&&(e.preventDefault(),ne(n));return}if(e.key===`Backspace`&&t.value===``&&M.current.length>0){e.preventDefault(),re(M.current.at(-1).key);return}(j0(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),se())},onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),N(t))},placeholder:b&&k.id===`oracle`?`The oracle is working. Enter steers it…`:k.placeholder,rows:1,className:q(`field-sizing-content max-h-[min(45vh,20rem)] min-h-[1.75rem] w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed caret-primary outline-none placeholder:text-muted-foreground md:text-[0.9375rem] md:leading-relaxed`,x&&`min-[500px]:max-md:max-h-[44px] min-[500px]:max-md:overflow-y-auto`)})}),(0,R.jsxs)(`div`,{className:q(`flex flex-wrap items-center gap-x-2 gap-y-2 px-2 pt-1 pb-2`,x&&`min-[500px]:max-md:col-start-2 min-[500px]:max-md:min-w-0 min-[500px]:max-md:flex-nowrap min-[500px]:max-md:gap-y-0 min-[500px]:max-md:pt-1 min-[500px]:max-md:pb-1`),children:[(0,R.jsx)(`input`,{ref:j,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{N(e.target.files??[]),e.target.value=``}}),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>j.current?.click(),className:A0,children:(0,R.jsx)(jh,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsx)(Tj,{children:`Attach images, PDFs or files`})]}),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":c,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>l(e=>!e),className:A0,children:(0,R.jsx)(km,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsxs)(Tj,{children:[`Preview `,(0,R.jsx)(rA,{chord:`Alt+P`})]})]}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-4 w-px bg-border`}),(0,R.jsx)(`div`,{className:q(`contents`,S&&!x&&`max-md:block max-md:w-full max-md:order-last`),children:e.kind===`tab`&&e.tab===`knowledge`?(0,R.jsx)(E0,{rest:e.rest}):x&&D.length>1?(0,R.jsxs)(Rq,{value:k.id,onValueChange:e=>g(e),children:[(0,R.jsx)(Bq,{"aria-label":`Send to`,className:`h-7 min-w-0 gap-1.5 px-2 text-xs`,children:(0,R.jsx)(zq,{})}),(0,R.jsx)(Vq,{children:D.map(e=>(0,R.jsx)(Hq,{value:e.id,children:e.pill},e.id))})]}):D.length>1?(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:`flex max-md:flex-wrap items-center gap-0.5 rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`,children:D.map(e=>(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===k.id,onClick:()=>g(e.id),className:q(`h-6 rounded-md border border-transparent px-2.5 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,e.id===k.id?`btn-raised btn-soft bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):(0,R.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,k.pill.toLowerCase()]})}),(0,R.jsx)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end overflow-hidden px-2 max-md:hidden`,children:(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-3.5`,children:[e.kind===`tab`&&e.tab===`plan`?(0,R.jsx)(iA,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[34rem]:inline-flex`,children:`save plan`}):null,(0,R.jsx)(iA,{chord:`/`,className:`hidden group-focus-within/composer:!hidden @[28rem]:inline-flex`,children:`write`}),(0,R.jsx)(iA,{chord:`Esc`,className:`hidden group-[:not(:focus-within)]/composer:!hidden @[28rem]:inline-flex`,children:`tabs`}),(0,R.jsx)(iA,{chord:`Shift+Enter`,className:`hidden @[22rem]:inline-flex`,children:`new line`}),(0,R.jsx)(iA,{chord:`Enter`,className:`hidden @[11rem]:inline-flex`,children:`send`}),(0,R.jsxs)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"data-compact":!0,onClick:n,className:`kbd-hint btn-ghost inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg border px-1.5 text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(rA,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,R.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})}),(0,R.jsxs)(`div`,{className:`contents max-md:ml-auto max-md:flex max-md:items-center max-md:gap-2`,children:[b&&k.id===`oracle`?(0,R.jsx)(SM,{label:`Stop`,icon:hg,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void ce()}):null,(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void se(),disabled:!oe,className:`btn-tint relative inline-flex size-8 items-center justify-center rounded-lg border [--tint:var(--primary)] before:absolute before:-inset-1 before:content-[''] text-primary-foreground transition-[background-color,color,box-shadow,translate,filter] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none disabled:text-muted-foreground`,children:u?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,R.jsx)(Np,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,R.jsxs)(Tj,{children:[`Send `,(0,R.jsx)(rA,{chord:`Enter`})]})]})]})]}),f?(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-xl bg-card/90 text-sm font-medium text-primary backdrop-blur-[2px]`,children:`Drop to attach`}):null]})})]})}function P0(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)();async function a(r){if(!t){n(!0),i(void 0);try{let{project:t}=await Te(`projects.open`,{path:r});be([t]),he(t.id,e)}catch(e){i(e.message)}finally{n(!1)}}}return{opening:t,error:r,open:a}}function F0({path:e,busy:t,browse:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,R.jsxs)(`form`,{className:`flex min-w-0 gap-2`,onSubmit:e=>{e.preventDefault(),n(r)},children:[(0,R.jsx)(Uq,{className:`min-w-0 flex-1 max-md:h-11`,"aria-label":`Folder path`,value:r,disabled:t,onChange:e=>i(e.target.value)}),(0,R.jsx)(Y,{type:`submit`,disabled:t||!r.trim(),className:`max-md:min-h-11`,children:`Go`})]})}function I0({data:e,busy:t,browse:n}){return(0,R.jsxs)(`div`,{className:`min-h-24 max-h-64 overflow-y-auto overscroll-contain rounded-lg border border-border max-md:max-h-[min(40vh,16rem)]`,"aria-label":`Folders`,role:`group`,children:[e?.parent?(0,R.jsxs)(Y,{variant:`ghost`,className:`h-auto min-h-11 w-full justify-start py-3 text-left max-md:min-h-12`,disabled:t,onClick:()=>n(e.parent),children:[(0,R.jsx)(Np,{}),` Parent folder`]}):null,e?.folders.map(e=>(0,R.jsxs)(Y,{variant:`ghost`,className:`h-auto min-h-11 w-full justify-start py-3 text-left max-md:min-h-12`,disabled:t,onClick:()=>n(e.path),children:[(0,R.jsx)(zm,{className:`shrink-0`}),(0,R.jsx)(`span`,{className:`whitespace-normal break-words`,children:e.name})]},e.path)),e&&!e.folders.length?(0,R.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`No subfolders. You can open this folder.`}):null,e?.truncated?(0,R.jsx)(`p`,{className:`p-3 text-sm text-muted-foreground`,children:`Listing limited to 2,000 entries. Enter a path to browse further.`}):null]})}function L0({tab:e,close:t,busyChanged:n}){let[r,i]=(0,m.useState)(),a=xj(`projects.browse`,r===void 0?{}:{path:r},[]),o=P0(e);return(0,m.useEffect)(()=>n(o.opening),[o.opening,n]),(0,R.jsxs)(`div`,{className:`flex min-h-0 max-h-full flex-col gap-4 overflow-y-auto p-5 max-md:max-h-[calc(100svh-2rem)] max-md:p-4`,children:[(0,R.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Open project folder`}),(0,R.jsx)(`p`,{className:`break-words text-sm text-muted-foreground`,children:`Browse folders on the machine running bot-lobby. Opening starts a separate session; your current project keeps running. Project-local extensions are not enabled automatically.`}),(0,R.jsx)(F0,{path:a.data?.path??r??``,busy:o.opening,browse:i}),(0,R.jsx)(I0,{data:a.data,busy:a.loading||o.opening,browse:i}),a.loading?(0,R.jsx)(`p`,{role:`status`,children:`Loading folders…`}):null,a.error||o.error?(0,R.jsx)(`p`,{role:`alert`,className:`break-words text-sm text-destructive`,children:a.error??o.error}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[a.error?(0,R.jsx)(Y,{variant:`outline`,onClick:a.reload,disabled:a.loading,className:`max-md:min-h-11`,children:`Retry`}):null,(0,R.jsx)(Y,{variant:`outline`,onClick:t,disabled:o.opening,className:`max-md:min-h-11`,children:`Cancel`}),(0,R.jsx)(Y,{disabled:!a.data||a.loading||!!a.error||o.opening,onClick:()=>void o.open(a.data.path),className:`max-md:min-h-11`,children:o.opening?`Opening project…`:`Open this folder`})]})]})}function R0({open:e,onClose:t,tab:n}){let r=XA(e,YA.help),[i,a]=(0,m.useState)(!1);return(0,R.jsx)(HA,{open:r,label:`Open project folder`,className:`max-md:max-h-[calc(100svh-2rem)] max-md:max-w-[calc(100vw-2rem)]`,onOpenChange:e=>{!e&&!i&&t()},dismissOnBackdrop:!i,onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[role="combobox"][aria-label="Project"]`)?.focus()},children:e?(0,R.jsx)(L0,{tab:n,close:t,busyChanged:a}):null})}function z0(){try{return{id:P()}}catch(e){return{error:e.message}}}function B0(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Open a folder from the Project menu, or refresh.`}}function V0(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await Te(`projects.list`,{});be(n.projects),e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function H0({data:e,error:t}){let n=z0();return n.error??t??B0(e,n.id)}function U0({projects:e}){let t=H0(e);return t?(0,R.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,R.jsx)(`span`,{children:t})]}):null}function W0(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option']`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}function G0({projects:e,tab:t,name:n,branch:r}){let{data:i,busy:a,slow:o,refresh:s}=e,[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=z0(),p=H0(e),h=f.error?`invalid`:f.id??i?.currentId??``;Uj(`p`,()=>l(!0)),Uj(`r`,()=>void s(),{enabled:c,inDialog:!0});function g(e){l(!1),e!==h&&he(e,t)}return(0,R.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1.5`,children:[(0,R.jsxs)(nY,{open:c,onOpenChange:l,children:[(0,R.jsxs)(rY,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c,"aria-keyshortcuts":`P ArrowDown`,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),l(!0))},className:`btn-ghost group flex h-8 min-w-0 items-center gap-2 rounded-lg border border-transparent px-2.5 text-sm font-medium outline-none transition-[box-shadow,background-color] duration-150 focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none max-md:h-11`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-2.5 shrink-0 rounded-full`,p?`bg-destructive`:`bg-primary`)}),(0,R.jsx)(`span`,{className:`truncate`,children:n}),(0,R.jsx)(Zp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(iY,{align:`start`,sideOffset:6,"aria-label":`Projects`,onKeyDown:W0,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`p-0 flex max-h-[calc(100svh-2rem)] w-[min(26rem,calc(100vw-1.5rem))] origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-xl outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 max-md:w-[calc(100vw-2rem)]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void s(),disabled:a,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`inline-flex h-7 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 disabled:opacity-60 max-md:h-11`,children:[a?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,R.jsx)(qh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,R.jsx)(rA,{chord:`R`,className:`kbd-hint`})]})]}),(0,R.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto overscroll-contain p-1 max-md:max-h-[calc(100svh-12rem)]`,children:i?.projects.map(e=>{let t=e.id===h;return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>g(e.id),className:q(`flex min-h-10 w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30 max-md:min-h-11`,t&&`bg-accent`),children:[(0,R.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium`,children:e.name}),(0,R.jsxs)(`span`,{className:`block whitespace-normal break-all text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})}),(0,R.jsxs)(`button`,{type:`button`,className:`flex min-h-11 items-center gap-2 border-t border-border px-3 py-3 text-sm font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40`,onClick:()=>{l(!1),d(!0)},children:[(0,R.jsx)(Lm,{"aria-hidden":`true`,className:`size-4`}),`Open folder…`]})]})]}),(0,R.jsx)(R0,{open:u,onClose:()=>d(!1),tab:t}),r?(0,R.jsxs)(`span`,{className:`hidden min-w-0 items-center gap-1 rounded-md bg-muted px-2 py-1 text-xs text-muted-foreground sm:inline-flex`,children:[(0,R.jsx)(Vm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,R.jsx)(`span`,{className:`truncate`,children:r})]}):null,o||p?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Refresh projects`,disabled:a,onClick:()=>void s(),className:`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground outline-none transition-[box-shadow,color,translate] hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px disabled:opacity-60 max-md:size-11`,children:a?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-4`}):(0,R.jsx)(qh,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsx)(Tj,{side:`bottom`,children:`Refresh projects`})]}):null]})}function K0({state:e}){return e===`live`?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,R.jsx)(Tj,{children:`Connected`})]}):e===`connecting`?(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,R.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}var q0=`toolbar-button inline-flex size-8 shrink-0 items-center justify-center rounded-lg border text-foreground transition-[background-color,border-color,translate] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`;function J0({label:e,hint:t,href:n,active:r,children:i}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`a`,{href:n,"aria-label":e,"aria-current":r?`page`:void 0,"aria-keyshortcuts":t,"aria-describedby":`focused-action-help`,className:q0,children:i})}),(0,R.jsxs)(Tj,{side:`bottom`,children:[e,` `,(0,R.jsx)(`span`,{className:`max-md:hidden`,children:(0,R.jsx)(rA,{chord:t})})]})]})}function Y0({hint:e,onHelp:t}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:q0,children:(0,R.jsx)(Ym,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,R.jsxs)(Tj,{side:`bottom`,children:[`Keyboard shortcuts `,(0,R.jsx)(rA,{chord:e})]})]})}function X0(){let e=xJ(),t=cA(`(max-width: 767.98px)`),n=t?`App sounds`:e?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":n,"aria-pressed":e,"aria-describedby":t?`app-sounds-help focused-action-help`:`focused-action-help`,className:q0,onClick:()=>yJ(!e),children:e?(0,R.jsx)(Fg,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,R.jsx)(Ng,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,R.jsx)(Tj,{side:`bottom`,children:n})]}),t?(0,R.jsx)(`span`,{id:`app-sounds-help`,className:`sr-only`,children:`App sounds controls prompt tones and navigation ticks.`}):null]})}function Z0(){let{theme:e,setTheme:t}=vY(),n=e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":n?`Switch to light mode`:`Switch to dark mode`,"aria-keyshortcuts":`D`,"aria-describedby":`focused-action-help`,onClick:()=>t(n?`light`:`dark`),className:q0,children:n?(0,R.jsx)(_g,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,R.jsx)(Th,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,R.jsxs)(Tj,{side:`bottom`,children:[n?`Light mode`:`Dark mode`,` `,(0,R.jsx)(`span`,{className:`max-md:hidden`,children:(0,R.jsx)(rA,{chord:`D`})})]})]})}function Q0({busy:e,task:t,sessionName:n}){return(0,R.jsxs)(`div`,{className:`mr-1 flex min-w-0 items-center gap-2 text-[0.8125rem]`,children:[e?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):null,t?(0,R.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate md:inline`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:t.id}),(0,R.jsxs)(`span`,{className:`hidden text-muted-foreground min-[1500px]:inline`,children:[` · `,t.state.replace(/_/g,` `)]})]}):(0,R.jsx)(`span`,{className:`hidden max-w-[10rem] truncate text-muted-foreground min-[1500px]:inline`,children:n??`no task in this session`})]})}function $0(e){if(!e)return 0;let t=[...e.children].filter(e=>e instanceof HTMLElement&&e.offsetParent!==null&&getComputedStyle(e).position!==`absolute`);if(!t.length)return 0;let n=Math.min(...t.map(e=>e.getBoundingClientRect().left)),r=Math.max(...t.map(e=>e.getBoundingClientRect().right)),i=0;for(let t of e.querySelectorAll(`*`))t.clientWidth<=1||t.offsetParent===null||t.scrollWidth<=t.clientWidth+1||getComputedStyle(t).textOverflow===`ellipsis`&&(i+=t.scrollWidth-t.clientWidth);return r-n+i}var e2=24;function t2(){let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(()=>{});return r.current=()=>{let t=e.current;if(!t)return;let r=t.querySelector(`[role="tablist"]`),i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,o=t.clientWidth-(parseFloat(i.paddingLeft)||0)-(parseFloat(i.paddingRight)||0),s=$0(t.querySelector(`.where`))+(r?.offsetWidth??0)+$0(t.querySelector(`.tools`))+a*2;n(s+e2<=o)},(0,m.useLayoutEffect)(()=>r.current()),(0,m.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>r.current());n.observe(t);for(let e of t.querySelectorAll(`[role="tablist"], .where, .tools`))n.observe(e);return()=>n.disconnect()},[]),{header:e,one:t}}function n2({status:e,task:t,connection:n,route:r,tabs:i,extra:a,keys:o,onHelp:s}){let c=e?.workspace.name??`bot-lobby`,l=e?.branch??e?.workspace.branch,u=e?.busy??!1,d=V0(),{header:f,one:p}=t2(),m=cA(`(max-width: 767.98px)`);return(0,R.jsxs)(`header`,{ref:f,className:`app-header shrink-0`,"data-one-row":p||void 0,children:[(0,R.jsx)(`div`,{className:`where flex min-w-0 items-center`,children:(0,R.jsx)(G0,{projects:d,tab:r.kind===`tab`?r.tab:r.kind,name:c,branch:l})}),m?(0,R.jsxs)(`div`,{className:`phone-status flex min-w-0 items-center justify-end gap-2`,children:[(0,R.jsx)(Q0,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,R.jsx)(K0,{state:n})]}):null,(0,R.jsx)(`div`,{className:`tabs min-w-0`,children:i}),(0,R.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-2`,children:[a,m?null:(0,R.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,R.jsx)(Q0,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,R.jsx)(K0,{state:n})]}),(0,R.jsx)(J0,{label:`Sessions`,hint:o.sessions??`Alt+O`,href:`#/sessions`,active:r.kind===`sessions`,children:(0,R.jsx)(Zm,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,R.jsx)(J0,{label:`Settings`,hint:o.settings??`Alt+S`,href:`#/settings`,active:r.kind===`settings`,children:(0,R.jsx)(sg,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),m?null:(0,R.jsx)(Y0,{hint:o.help??`Alt+H`,onHelp:s}),(0,R.jsx)(Z0,{}),(0,R.jsx)(X0,{}),(0,R.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,R.jsx)(U0,{projects:d})]})}function r2(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function i2(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await De()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(r2(e))}return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-y-auto p-6 max-md:items-start max-md:p-4`,children:(0,R.jsxs)(`form`,{onSubmit:s,className:`glass flex min-h-0 w-full max-w-md flex-col gap-4 rounded-xl p-6 max-md:max-h-[calc(100svh-2rem)] max-md:max-w-[28rem] max-md:overflow-y-auto max-md:p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(qm,{className:`size-5`,"aria-hidden":`true`}),(0,R.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,R.jsxs)(`p`,{className:`break-words text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,R.jsx)(`code`,{className:`rounded-lg bg-muted px-1.5 py-0.5 font-mono text-xs`,children:`/bot-lobby web`}),`to see it again). Paste it here.`]}),(0,R.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,R.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:7347/#token=…`,className:`h-8 min-w-0 rounded-lg border border-input bg-background px-3.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 max-md:h-11`})]}),n?(0,R.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),className:`max-md:min-h-11`,children:`Retry`}),(0,R.jsx)(Y,{type:`submit`,disabled:i||!e.trim(),className:`max-md:min-h-11`,children:`Sign in`})]})]})})}var a2=.6;function o2(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:a2,...n}}}var s2=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function c2(e,t=0,n=1){return o2(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:a2,times:s2(t,n),ease:`easeInOut`},strokeOpacity:{duration:a2,times:s2(t,t+.02)}})}function l2(e,t){return o2(e,{scale:[0,0,1.3,1]},{times:s2(t,t+.18),ease:`easeOut`})}function u2(e,t,n=1.3){return o2(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var d2=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function f2({play:e}){return(0,R.jsxs)(B.g,{style:d2(.1,.9),...o2(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,R.jsx)(`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`}),[8,12,16].map((t,n)=>(0,R.jsx)(B.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...o2(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function p2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.path,{d:`M13 5h8`,...c2(e,.15,.45)}),(0,R.jsx)(B.path,{d:`M13 12h8`,...c2(e,.3,.6)}),(0,R.jsx)(B.path,{d:`M13 19h8`,...c2(e,.45,.75)}),(0,R.jsx)(B.path,{d:`m3 17 2 2 4-4`,...c2(e,.35,.7)}),(0,R.jsx)(B.path,{d:`m3 7 2 2 4-4`,...c2(e,0,.35)})]})}function m2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:6,cy:19,r:3,style:d2(),...u2(e,0)}),(0,R.jsx)(B.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...c2(e,.1,.7)}),(0,R.jsx)(B.circle,{cx:18,cy:5,r:3,style:d2(),...l2(e,.62)})]})}function h2({play:e}){return(0,R.jsx)(B.g,{style:d2(),...o2(e,{rotate:[0,-14,10,-6,0],scale:[1,1.18,.94,1.04,1]},{duration:.5,ease:`easeInOut`}),children:(0,R.jsx)(B.path,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,fill:`currentColor`,...o2(e,{fillOpacity:[0,.85,0]},{duration:.5,times:[0,.2,1]})})})}function g2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:12,cy:12,r:10,style:d2(),...o2(e,{scale:[1,1,1.4],strokeOpacity:[0,.5,0]},{times:[0,.25,1],ease:`easeOut`})}),(0,R.jsx)(B.circle,{cx:12,cy:12,r:10,style:d2(),...o2(e,{scale:[1,.86,1.06,1]},{times:[0,.25,.55,1],ease:`easeInOut`})}),(0,R.jsx)(B.circle,{cx:12,cy:12,r:1,fill:`currentColor`,style:d2(),...o2(e,{scale:[1,2.4,.8,1]},{times:[0,.3,.6,1],ease:`easeInOut`})})]})}function _2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),[`M8 17v-3`,`M13 17V5`,`M18 17V9`].map((t,n)=>(0,R.jsx)(B.path,{d:t,style:d2(.5,1),...o2(e,{scaleY:[0,0,1.18,1]},{times:s2(.08+n*.14,.4+n*.14),ease:`easeOut`})},t))]})}function v2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:6,cy:6,r:3,style:d2(),...u2(e,0)}),(0,R.jsx)(B.line,{x1:6,x2:6,y1:9,y2:21,...c2(e,.05,.45)}),(0,R.jsx)(B.path,{d:`M13 6h3a2 2 0 0 1 2 2v7`,...c2(e,.2,.62)}),(0,R.jsx)(B.circle,{cx:18,cy:18,r:3,style:d2(),...l2(e,.58)})]})}function y2({play:e}){return(0,R.jsxs)(B.g,{style:d2(),...o2(e,{scaleX:[1,.55,1.08,1],y:[0,-1,0,0]},{times:[0,.35,.65,1],ease:`easeInOut`}),children:[(0,R.jsx)(B.path,{d:`M12 5v16`,style:d2(),...o2(e,{scaleY:[1,1.12,1,1]},{times:[0,.35,.65,1]})}),(0,R.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]})}function b2({play:e}){return(0,R.jsxs)(B.g,{style:d2(.6,.6),...o2(e,{x:[0,1.5,-1.5,1,0],y:[0,-1,.5,-.5,0],rotate:[0,-8,6,-3,0]},{ease:`easeInOut`}),children:[(0,R.jsx)(`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`}),(0,R.jsx)(`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`}),(0,R.jsx)(B.path,{d:`m2.3 2.3 7.286 7.286`,...c2(e,.1,.6)}),(0,R.jsx)(B.circle,{cx:11,cy:11,r:2,style:d2(),...u2(e,.5,1.5)})]})}var x2={lobby:f2,tasks:p2,plan:m2,quickfix:h2,issues:g2,metrics:_2,git:v2,knowledge:y2,excalidraw:b2};function S2({id:e,play:t,className:n}){let r=x2[e];return r?(0,R.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:q(`overflow-visible`,n),children:(0,R.jsx)(r,{play:t})},t):null}function C2(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0||n<2)return e;let r=Math.floor(n/2),i=(r-.75)*t,a=(r+1.75)*t;return e<i?e+Math.ceil((i-e)/t)*t:e>a?e-Math.ceil((e-a)/t)*t:e}function w2(e){return/(\d)$/.exec(e)?.[1]}function T2(e){return e.filter(e=>e.id!==`metrics`)}function E2(e,t,n=5){return C2(e,t,n)}function D2(e,t,n){let r=t.find(t=>t.id===e);if(r)return r.label;let i=n.replace(/^#\/?/,``).split(`/`)[0];return i===`settings`?`Settings`:i===`sessions`?`Sessions`:i===`metrics`?`Metrics`:i?i.charAt(0).toUpperCase()+i.slice(1):`Lobby`}var O2=`phone-tab-card inline-flex h-11 min-w-11 shrink-0 items-center justify-center gap-1.5 rounded-xl border px-2.5 text-sm font-medium whitespace-nowrap outline-none focus-visible:ring-3 focus-visible:ring-ring/40`;function k2(e){let t=w2(e.key);return t?`${t}. ${e.label}`:e.label}function A2(e,t){let n=w2(e.key);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(S2,{id:e.id,play:+!!t,className:`size-4 shrink-0`}),n?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-[0.7rem] font-semibold tabular-nums text-muted-foreground`,children:n}):null,t?(0,R.jsx)(`span`,{className:`max-w-[8.5rem] truncate`,children:e.label}):null]})}function j2(e){return e?{duration:0}:{type:`spring`,stiffness:520,damping:30,mass:.5}}function M2({tab:e,selected:t,reduced:n}){return(0,R.jsx)(B.span,{className:`inline-flex items-center gap-1.5`,animate:{scale:t?1.04:1},transition:j2(n),children:A2(e,t)})}function N2({tab:e,selected:t,canonical:n,reduced:r,onClick:i,roving:a}){let o=k2(e);return n?(0,R.jsx)(`button`,{type:`button`,role:`tab`,id:`tab-${e.id}`,"data-phone-tab-id":e.id,"aria-controls":`main`,"aria-label":o,"aria-keyshortcuts":e.key,"aria-selected":t,tabIndex:t||a?0:-1,onClick:i,className:O2,children:(0,R.jsx)(M2,{tab:e,selected:t,reduced:r})}):(0,R.jsx)(`span`,{"data-phone-tab-id":e.id,"data-active":t?`true`:`false`,className:O2,"aria-hidden":`true`,children:(0,R.jsx)(M2,{tab:e,selected:t,reduced:r})})}function P2({tabs:e,activeId:t,canonical:n,reduced:r,onClick:i,canonicalRef:a}){let o=t??e[0]?.id;return(0,R.jsx)(`div`,{ref:n?a:void 0,"data-phone-period":n?`canonical`:`copy`,"aria-hidden":!n||void 0,role:n?`tablist`:void 0,"aria-label":n?`Lobby tabs`:void 0,className:`phone-tabs-period`,children:e.map(e=>(0,R.jsx)(N2,{tab:e,selected:e.id===t,canonical:n,reduced:r,roving:e.id===o,onClick:t=>i(e.id,t)},e.id))})}function F2(e){return e<=0?0:e===1?1:5}function I2({tabs:e,activeId:t,reduced:n,onClick:r,canonicalRef:i}){let a=F2(e.length),o=Math.floor(a/2);return a?(0,R.jsx)(R.Fragment,{children:Array.from({length:a},(a,s)=>(0,R.jsx)(P2,{tabs:e,activeId:t,canonical:s===o,reduced:n,onClick:r,canonicalRef:s===o?i:void 0},s))}):null}function L2(e){e.current!==void 0&&window.clearTimeout(e.current),e.current=void 0}function R2(e){return e?.closest(`[data-phone-tab-id]`)?.dataset.phoneTabId}function z2(e){return R2(e.target instanceof Element?e.target:null)}function B2(e){return R2(document.elementFromPoint(e.clientX,e.clientY))??R2(e.target instanceof Element?e.target:null)}function V2(e,t){let n=e.dataset.phoneTabId;if(!n)return;let r=e.getBoundingClientRect();if(Number.isFinite(r.width))return{id:n,element:e,distance:Math.abs(r.left+r.width/2-t)}}function H2(e,t){return[...e.querySelectorAll(`[data-phone-tab-id]`)].map(e=>V2(e,t)).filter(e=>e!==void 0)}function U2(e){return e.reduce((e,t)=>!e||t.distance<e.distance?t:e,void 0)}function W2(e,t){return U2(H2(t,e.getBoundingClientRect().left+e.clientWidth/2))}function G2(e,t){if(e&&t)return[...e.querySelectorAll(`[data-phone-tab-id]`)].find(e=>e.dataset.phoneTabId===t)}function K2(e){let t=Number.parseFloat(getComputedStyle(e.parentElement??e).columnGap)||6;return e.offsetWidth+t}function q2(e,t,n){let r=Math.max(0,n.findIndex(e=>e.id===t));if(e===`Home`)return n[0]?.id;if(e===`End`)return n.at(-1)?.id;if(e===`ArrowRight`)return n[(r+1)%n.length]?.id;if(e===`ArrowLeft`)return n[(r-1+n.length)%n.length]?.id}function J2(e,t){return Math.abs(e-t)<=2}function Y2(){let e=(0,m.useRef)(null),t=(0,m.useRef)(null),n=(0,m.useRef)(null),r=(0,m.useRef)(void 0),i=(0,m.useRef)(void 0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(void 0),s=(0,m.useRef)(void 0),c=(0,m.useRef)(void 0),l=(0,m.useRef)(0),u=(0,m.useRef)(0),d=(0,m.useRef)(void 0);return(0,m.useMemo)(()=>({scroller:e,track:t,canonical:n,gesture:r,candidate:i,crossed:a,settleTimer:o,commitTimer:s,clickGuard:c,generation:l,scrollGeneration:u,programmatic:d}),[])}function X2(e){return{clearPending:(0,m.useCallback)(()=>{L2(e.settleTimer),L2(e.commitTimer),e.candidate.current=void 0,e.generation.current+=1},[e])}}function Z2(e){let t=(0,m.useCallback)(t=>{let n=e.scroller.current;if(!n)return;let r=e.scrollGeneration.current+1;e.scrollGeneration.current=r;let i={value:Math.max(0,t),generation:r};e.programmatic.current=i,n.scrollLeft=i.value,i.value=n.scrollLeft},[e]),n=(0,m.useCallback)(n=>{let r=e.scroller.current;if(!r||!n||r.clientWidth<=0)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),o=r.scrollLeft+a.left+a.width/2-(i.left+r.clientWidth/2);t(o)},[e,t]);return{centre:n,centreCanonical:(0,m.useCallback)(t=>{let r=G2(e.canonical.current,t);r&&(e.crossed.current=r),n(r)},[n,e]),rebase:(0,m.useCallback)((n,r)=>{let i=E2(n.scrollLeft,K2(r));if(J2(i,n.scrollLeft))return!1;let a=i-n.scrollLeft;return e.gesture.current&&(e.gesture.current.originScrollLeft+=a),t(i),!0},[e,t])}}function Q2(e){let t=(0,m.useCallback)(()=>{e.clickGuard.current=void 0},[e]);return{clearGuard:t,guardClick:(0,m.useCallback)(n=>{t(),e.clickGuard.current={kind:n}},[t,e]),consumeGuard:(0,m.useCallback)(n=>!n||!e.clickGuard.current?!1:(t(),!0),[t,e])}}function $2(e){return(0,m.useCallback)(()=>{let t=e.scroller.current,n=e.track.current;if(!t||!n)return;let r=W2(t,n);return r&&r.element!==e.crossed.current&&(e.crossed.current=r.element,wJ()),e.candidate.current=r,r},[e])}function e4(e,t,n,r,i){let a=(0,m.useCallback)((r,i)=>{r&&r.id!==e.activeId&&(L2(t.commitTimer),t.commitTimer.current=window.setTimeout(()=>{i!==t.generation.current||t.candidate.current?.element!==r.element||e.blocked||(n(),e.onSelect(r.id))},500))},[n,e,t]);return(0,m.useCallback)(()=>{L2(t.settleTimer),L2(t.commitTimer);let e=++t.generation.current;t.settleTimer.current=window.setTimeout(()=>{if(e!==t.generation.current||t.gesture.current)return;let n=r();n&&(i(n.element),a(n,e))},120)},[a,i,r,t])}function t4(e,t,n){return(0,m.useCallback)(r=>e.tabs.some(e=>e.id===r)?(t(),e.onSelect(r),n(r),!0):!1,[n,t,e])}function n4(e,t,n,r){return(0,m.useCallback)(()=>{let i=e.scroller.current,a=e.canonical.current;if(!i||!a)return;let o=e.programmatic.current;if(o&&o.generation===e.scrollGeneration.current&&J2(i.scrollLeft,o.value)){e.programmatic.current=void 0;return}if(e.programmatic.current=void 0,L2(e.commitTimer),L2(e.settleTimer),e.candidate.current=void 0,e.generation.current+=1,t(i,a)){e.gesture.current||r();return}n(),e.gesture.current||r()},[n,t,e,r])}function r4(e,t,n,r){let i=(0,m.useRef)({clearPending:t,settle:n});i.current={clearPending:t,settle:n},(0,m.useEffect)(()=>{let t=e.scroller.current;if(!r||!t)return;let n=n=>{let r=n.deltaX||(n.shiftKey?n.deltaY:0);r&&(n.preventDefault(),e.programmatic.current=void 0,i.current.clearPending(),t.scrollLeft+=r,i.current.settle())};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[r,e])}function i4(e,t,n){return(0,m.useCallback)(r=>{t(),n(),e.programmatic.current=void 0,e.gesture.current={id:r.pointerId,x:r.clientX,y:r.clientY,moved:!1,originScrollLeft:r.currentTarget.scrollLeft,downTabId:z2(r)},r.currentTarget.setPointerCapture?.(r.pointerId)},[n,t,e])}function a4(e,t){return(0,m.useCallback)(n=>{let r=e.gesture.current;r&&r.id===n.pointerId&&(Math.hypot(n.clientX-r.x,n.clientY-r.y)<8||(r.moved=!0,t(),(n.pointerType===`mouse`||n.pointerType===`pen`)&&(n.currentTarget.scrollLeft=r.originScrollLeft+r.x-n.clientX,n.preventDefault())))},[t,e])}function o4(e,t,n,r){return(0,m.useCallback)(i=>{let a=e.gesture.current;if(!a||a.id!==i.pointerId)return;e.gesture.current=void 0;let o=B2(i),s=a.downTabId;if(s&&!a.moved&&(!o||o===s)){n.guardClick(`committed`),t(s);return}(a.moved||s&&o&&o!==s)&&n.guardClick(`drag`),a.moved&&r()},[t,n,e,r])}function s4(e,t,n){return(0,m.useCallback)(()=>{let r=e.gesture.current?.moved;e.gesture.current=void 0,r&&t.guardClick(`drag`),r&&n()},[t,e,n])}function c4(e,t,n,r,i){return{onPointerDown:i4(e,i,n.clearGuard),onPointerMove:a4(e,i),onPointerUp:o4(e,t,n,r),onPointerCancel:s4(e,n,r)}}function l4(e,t){return(0,m.useCallback)((n,r)=>{t.consumeGuard(r.detail!==0)||e(n)},[e,t])}function u4(e,t){return(0,m.useCallback)(n=>{if(t.consumeGuard(n.detail!==0))return;let r=n.target instanceof Element?n.target.closest(`[data-phone-tab-id]`):null;if(!r||r.closest(`button`))return;let i=r.dataset.phoneTabId;i&&e(i)},[e,t])}function d4(e,t,n){return(0,m.useCallback)(r=>{if(r.key===`ArrowDown`&&!r.altKey){Ij()&&r.preventDefault();return}if(!e.tabs.length)return;let i=r.target.closest(`[role='tab']`)?.dataset.phoneTabId??e.activeId??e.tabs[0].id,a=q2(r.key,i,e.tabs);a?(r.preventDefault(),Rj.active=!0,Rj.to=a,n(a),G2(t.canonical.current,a)?.focus({preventScroll:!0})):(r.key===`Enter`||r.key===` `)&&i&&(r.preventDefault(),n(i))},[n,e,t])}function f4(e){let[t,n]=(0,m.useState)(0),[r,i]=(0,m.useState)(!1);return{sidePad:t,peek:r,setPeek:i,updatePad:(0,m.useCallback)(()=>{let t=e.scroller.current;if(!t||t.clientWidth<=0)return;let r=Math.max(22,t.clientWidth/2);n(e=>Math.abs(e-r)<.5?e:r)},[e])}}function p4(e,t){return e.find(e=>e.id===t)?.id??e[0]?.id}function m4(e,t,n,r){let{activeId:i,keyboardOpen:a,tabs:o}=e;(0,m.useLayoutEffect)(()=>{n(),t(p4(o,i))},[i,t,a,o,n,r])}function h4(e,t,n,r,i){let{activeId:a,tabs:o}=e;(0,m.useEffect)(()=>{let e=t.scroller.current;if(!e||typeof ResizeObserver>`u`)return;let s=new ResizeObserver(()=>{e.clientWidth<=0||(n(),i(),r(p4(o,a)))});return s.observe(e),t.track.current&&s.observe(t.track.current),()=>s.disconnect()},[a,r,n,t,o,i])}function g4(e){(0,m.useEffect)(()=>{let t=()=>e();return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[e])}function _4(e,t,n,r){(0,m.useEffect)(()=>{n(),t.crossed.current=void 0},[n,e.activeId,e.blocked,e.keyboardOpen,t,r])}function v4(e,t,n){(0,m.useEffect)(()=>()=>{t(),n(),e.programmatic.current=void 0},[n,t,e])}function y4(e,t,n){(0,m.useEffect)(()=>{e.keyboardOpen||n(!1),t()},[t,e.blocked,e.keyboardOpen,n])}function b4(e){let t=Y2(),{clearPending:n}=X2(t),r=Z2(t),i=Q2(t),a=f4(t),o=$2(t),s=e4(e,t,n,o,r.centre),c=t4(e,n,r.centreCanonical),l=n4(t,r.rebase,o,s),u=c4(t,c,i,s,n);r4(t,n,s,e.tabs.length>0);let d=d4(e,t,c),f=u4(c,i),p=l4(c,i),m=e.tabs.map(e=>e.id).join(`\0`);return m4(e,r.centreCanonical,a.updatePad,!e.keyboardOpen||a.peek),h4(e,t,n,r.centreCanonical,a.updatePad),_4(e,t,n,m),g4(n),v4(t,n,i.clearGuard),y4(e,n,a.setPeek),{scroller:t.scroller,track:t.track,canonical:t.canonical,sidePad:a.sidePad,periods:F2(e.tabs.length),peek:a.peek,setPeek:a.setPeek,onScroll:l,...u,onSurfaceClick:f,onCardClick:p,onKeyDown:d}}function x4(e,t){return D2(e,t,window.location.hash)}function S4({tabs:e,activeId:t,onSelect:n}){let r=(0,m.useMemo)(()=>T2(e),[e]),i=QA(),{keyboardOpen:a}=BA(),o=!!xf(),s=x4(t,e),c=b4({tabs:r,activeId:t,blocked:i,keyboardOpen:a,reduced:o,onSelect:n});if(!r.length)return null;let l=a&&!c.peek;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{"aria-hidden":l?`true`:void 0,inert:l,hidden:l,children:(0,R.jsx)(w4,{tabs:r,activeId:t,label:s,reduced:o,carousel:c,keyboardOpen:a})}),l?(0,R.jsx)(C4,{label:s,onOpen:()=>c.setPeek(!0)}):null]})}function C4({label:e,onOpen:t}){return(0,R.jsx)(`div`,{className:`phone-tabs phone-tabs-handle`,children:(0,R.jsxs)(`button`,{type:`button`,"data-phone-tabs-handle":!0,"aria-expanded":`false`,"aria-label":`Open tabs, current page ${e}`,onPointerDown:e=>e.preventDefault(),onClick:t,className:`phone-tabs-current inline-flex min-h-11 items-center gap-2 rounded-xl border px-4 text-sm font-medium focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:e}),(0,R.jsx)(Yp,{"aria-hidden":`true`,className:`size-4`})]})})}function w4({tabs:e,activeId:t,label:n,reduced:r,carousel:i,keyboardOpen:a}){return(0,R.jsxs)(`div`,{className:`phone-tabs`,"data-phone-tabs":!0,"data-periods":i.periods,children:[t&&!e.some(e=>e.id===t)?(0,R.jsx)(`span`,{"data-phone-page-handle":!0,className:`phone-tabs-page-handle`,children:n}):null,(0,R.jsx)(`div`,{ref:i.scroller,className:`phone-tabs-scroller`,onScroll:i.onScroll,onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel,onClick:i.onSurfaceClick,children:(0,R.jsx)(`div`,{ref:i.track,className:`phone-tabs-track`,style:{"--phone-period-pad":`${i.sidePad}px`},onKeyDown:i.onKeyDown,children:(0,R.jsx)(I2,{tabs:e,activeId:t,reduced:r,onClick:i.onCardClick,canonicalRef:i.canonical})})}),a&&i.peek?(0,R.jsx)(`button`,{type:`button`,"aria-label":`Close tabs`,onPointerDown:e=>e.preventDefault(),onClick:()=>i.setPeek(!1),className:`phone-tabs-close`,children:(0,R.jsx)(Up,{"aria-hidden":`true`,className:`size-4`})}):null]})}function T4(e){return/(\d)$/.exec(e)?.[1]}var E4=160;function D4(e){let t=xf(),[n,r]=(0,m.useState)(0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{t||performance.now()<i.current||(i.current=performance.now()+a2*1e3,r(e=>e+1))},[t]),o=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let t=e&&!o.current;if(o.current=e,!t)return;let n=window.setTimeout(a,E4);return()=>window.clearTimeout(n)},[e,a]),{play:n,onPointerEnter:(0,m.useCallback)(e=>{e.pointerType!==`touch`&&a()},[a])}}var O4=(0,m.forwardRef)(function({tab:e,active:t},n){let r=T4(e.key),{play:i,onPointerEnter:a}=D4(t);return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,onPointerEnter:a,className:q(`relative z-10 inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-lg border border-[var(--tab-outline)] px-2.5 text-[0.8125rem] leading-none font-medium whitespace-nowrap outline-none`,`transition-colors duration-200 ease-snap focus-visible:ring-3 focus-visible:ring-ring/40`,t?`text-foreground`:`bg-[var(--tab-idle)] text-muted-foreground hover:text-foreground`),children:[(0,R.jsx)(S2,{id:e.id,play:i,className:q(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)}),r?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`text-[0.72rem] font-semibold tabular-nums transition-colors duration-200`,t?`text-primary`:`text-muted-foreground/75`),children:r}):null,(0,R.jsx)(`span`,{children:e.label})]})}),(0,R.jsxs)(Tj,{children:[e.label,` `,(0,R.jsx)(rA,{chord:e.key})]})]})}),k4=1.5;function A4(e,t,n=t?.left??0,r=t?.right??0,i=1){if(e){if(!t||r-n<.5){e.style.opacity=`0`;return}e.style.opacity=String(Math.min(1,(r-n)/14)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${r-n}px`,e.style.transform=`translateX(${n}px)`,e.style.scale=i===1?``:`1 ${i}`}}function j4(e,t){let n=e.right-e.left,{height:r}=e,i=k4/2,a=Math.max(0,Math.min(e.radius-i,r/2-i,n/2-i)),o=r/2,s=e=>+(t===`left`?e:n-e).toFixed(2),c=+(t===`left`),l=1-c,u=i,d=n-i,f=r-i;return[`M${s(u)} ${o}L${s(u)} ${i+a}A${a} ${a} 0 0 ${c} ${s(u+a)} ${i}L${s(d-a)} ${i}A${a} ${a} 0 0 ${c} ${s(d)} ${i+a}L${s(d)} ${o}`,`M${s(u)} ${o}L${s(u)} ${f-a}A${a} ${a} 0 0 ${l} ${s(u+a)} ${f}L${s(d-a)} ${f}A${a} ${a} 0 0 ${l} ${s(d)} ${f-a}L${s(d)} ${o}`]}function M4(e,t,n,r){if(!e)return;if(!t||r<=.002){e.style.opacity=`0`;return}let i=t.right-t.left,a=`${i}x${t.height}r${t.radius}${n}`;e.dataset.shape!==a&&(e.dataset.shape=a,e.dataset.port=n,e.setAttribute(`viewBox`,`0 0 ${i} ${t.height}`),j4(t,n).forEach((t,n)=>e.children[n]?.setAttribute(`d`,t))),e.style.opacity=String(Math.min(1,r*12)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${i}px`,e.style.transform=`translateX(${t.left}px)`;let o=`${Math.min(1,r)} 2`;for(let t of e.children)t.style.strokeDasharray=o}var N4={type:`spring`,visualDuration:.12,bounce:0},P4={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},F4={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},I4={type:`spring`,visualDuration:.22,bounce:.25},L4={type:`spring`,visualDuration:.2,bounce:0},R4={type:`spring`,stiffness:900,damping:18,velocity:45,restDelta:.02,restSpeed:1},z4=(()=>{let e=Sr({keyframes:[0,1],visualDuration:I4.visualDuration,bounce:I4.bounce}),t=0;for(;t<1e3&&e.next(t).value<.97;)t+=4;return t/1e3})(),B4={type:`spring`,visualDuration:.28,bounce:.6};function V4(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)({}),c=(0,m.useRef)([]),l=(0,m.useRef)(void 0),u=(0,m.useRef)([]),d=(0,m.useRef)(1),f=(0,m.useRef)(1),p=(0,m.useCallback)(e=>{let t=e?s.current[e]:void 0;if(!t)return;let n=parseFloat(getComputedStyle(t).borderTopLeftRadius)||0;return{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight,radius:n}},[]),h=(0,m.useCallback)(()=>{for(let e of u.current)e.stop();u.current=[];for(let e of Object.values(s.current))e?.style.translate&&(e.style.translate=``)},[]),g=(0,m.useCallback)(e=>{h(),l.current=e,d.current=1,f.current=1;let t=p(e);A4(r.current,t),A4(i.current,void 0),M4(a.current,t,`left`,1),M4(o.current,void 0,`left`,0);for(let e of c.current)e&&(e.style.width=`0px`);MH()},[p,h]),_=(0,m.useCallback)((e,t)=>{let n=p(e),m=p(t);if(!n||!m)return g(t);h(),jH(),l.current=t;let _=m.left>n.left?1:-1,v=_>0?n.right:n.left,y=_>0?m.left:m.right,b=Math.abs(y-v),x=_>0?`right`:`left`,S=_>0?`left`:`right`,C=c.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),w=b>4?1-4/b:0,T={drained:1-Math.min(1,d.current),unrung:1-Math.min(1,f.current),head:0,tail:0,filled:0,rung:0,squash:1,budge:0},E=s.current[t];d.current=0,f.current=0;let D=()=>{let e=(n.right-n.left)*Math.min(1,T.drained);A4(i.current,n,_>0?n.left+e:n.left,_>0?n.right:n.right-e),M4(o.current,n,x,1-T.unrung);let t=v+_*b*T.head,s=v+_*b*T.tail,c=Math.min(t,s),l=Math.max(t,s);for(let e of C){if(!e?.liquid)continue;let t=Math.max(c,e.from),n=Math.min(l,e.to);e.liquid.style.width=`${Math.max(0,n-t)}px`,e.liquid.style.transform=`translateX(${Math.max(0,t-e.from)}px)`}let u=_*T.budge,d=u?{...m,left:m.left+u,right:m.right+u}:m;E&&(E.style.translate=Math.abs(u)>.01?`${u.toFixed(2)}px`:``);let f=(d.right-d.left)*Math.min(1,Math.max(0,T.filled));A4(r.current,d,_>0?d.left:d.right-f,_>0?d.left+f:d.right,Math.min(1,T.squash)),M4(a.current,d,S,T.rung)},O=(e,t,n,r,i=1)=>{let a=Wf(t,i,{...n,onUpdate:t=>{T[e]=t,r?.(t),D()}});return u.current.push(a),a},k=!1,A=()=>{if(k)return;k=!0;let e=O(`filled`,0,I4,e=>{d.current=e});e.then(()=>{l.current===t&&MH()}),O(`squash`,.8,B4),O(`rung`,0,L4,e=>{f.current=e}),O(`budge`,0,{...R4,delay:z4},void 0,0),Promise.all([e,...u.current]).then(()=>{l.current===t&&u.current.includes(e)&&g(t)})};O(`drained`,T.drained,N4),O(`unrung`,T.unrung,N4),O(`head`,0,P4,e=>{e>=w&&A()}),O(`tail`,0,F4),D()},[p,g,h]);(0,m.useLayoutEffect)(()=>{let t=l.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?g(e):_(t,e)},[e,t,_,g]);let v=(0,m.useRef)(e);return v.current=e,(0,m.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=!0,r=new ResizeObserver(()=>{if(t){t=!1;return}g(v.current)});return r.observe(e),()=>{r.disconnect(),h()}},[g,h]),{track:n,fill:r,drain:i,ring:a,unring:o,cells:s,liquids:c}}var H4=(0,m.forwardRef)(function({which:e},t){return(0,R.jsxs)(`svg`,{ref:t,"aria-hidden":`true`,[`data-tab-${e}`]:``,className:`pointer-events-none absolute left-0 z-20 overflow-visible opacity-0 will-change-transform`,fill:`none`,children:[(0,R.jsx)(`path`,{pathLength:1,strokeWidth:k4,strokeLinecap:`round`,className:`stroke-tab-rim`}),(0,R.jsx)(`path`,{pathLength:1,strokeWidth:k4,strokeLinecap:`round`,className:`stroke-tab-rim`})]})});function U4(e){if(e.left||e.right)return`linear-gradient(to right, ${e.left?`transparent 0, black 28px`:`black 0`}, ${e.right?`black calc(100% - 28px), transparent 100%`:`black 100%`})`}function W4({tabs:e,activeId:t,onSelect:n}){let r=cA(`(max-width: 767.98px)`),{track:i,fill:a,drain:o,ring:s,unring:c,cells:l,liquids:u}=V4(t,e.length),d=(0,m.useRef)(null),[f,p]=(0,m.useState)({left:!1,right:!1}),h=(0,m.useCallback)(()=>{let e=d.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;p(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;h();let t=new ResizeObserver(h);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[h,e.length]),(0,m.useEffect)(()=>{let e=d.current,n=t?l.current[t]:void 0;e&&n&&(n.offsetLeft<e.scrollLeft?e.scrollLeft=n.offsetLeft-8:n.offsetLeft+n.offsetWidth>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n.offsetLeft+n.offsetWidth-e.clientWidth+8))},[t,l]);function g(r){if(r.key===`ArrowDown`&&!r.altKey){Ij()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,o=e[(Math.max(0,e.findIndex(e=>e.id===a))+i+e.length)%e.length];Rj.active=!0,Rj.to=o.id,window.setTimeout(()=>{Rj.active=!1,Rj.to=void 0},3e3),n(o.id),l.current[o.id]?.focus({preventScroll:!0})}return r?(0,R.jsx)(S4,{tabs:e,activeId:t,onSelect:n}):(0,R.jsx)(`div`,{ref:d,onScroll:h,style:{maskImage:U4(f),WebkitMaskImage:U4(f)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] pointer-coarse:-my-1.5 pointer-coarse:py-1.5 [&::-webkit-scrollbar]:hidden`,children:(0,R.jsxs)(`div`,{ref:i,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:g,className:`relative mx-auto flex w-max items-center py-0.5`,children:[(0,R.jsx)(`span`,{ref:o,"aria-hidden":`true`,"data-tab-drain":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,R.jsx)(`span`,{ref:a,"aria-hidden":`true`,"data-tab-fill":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,R.jsx)(H4,{ref:c,which:`unring`}),(0,R.jsx)(H4,{ref:s,which:`ring`}),e.map((e,n)=>(0,R.jsxs)(m.Fragment,{children:[n>0?(0,R.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3.5 shrink-0 sm:w-4`,children:[(0,R.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,R.jsx)(`span`,{ref:e=>{u.current[n-1]=e},"data-tab-liquid":!0,className:`absolute top-0 left-0 h-[2px] w-0 rounded-full bg-tab-liquid shadow-[0_0_6px_var(--tab-liquid)] will-change-transform`})]}):null,(0,R.jsx)(O4,{ref:t=>{l.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function G4({oracleBusy:e,runs:t,activity:n,background:r}){let i=new Set;e&&i.add(`Oracle`);for(let e of t)e.status===`running`&&i.add(SW(EW(e)));for(let e of n)e.pending&&e.source!==`LOBBY`&&i.add(e.source===`MASTER`?`Oracle`:SW(e.source));let a=r.filter(e=>e.alive&&e.busy).length;return a&&i.add(a===1?`1 in the background`:`${a} in the background`),[...i]}function K4(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function q4(...e){let t=e.filter(e=>!!e);if(!t.length)return;let n=Math.max(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.top)),i=Math.min(...t.map(e=>e.left+e.width)),a=Math.min(...t.map(e=>e.top+e.height));return i>n&&a>r?{left:n,top:r,width:i-n,height:a-r}:void 0}function J4(e,t){return q4(e,{left:e.left,top:e.top,width:e.width,height:Math.max(0,t-e.top)})}var Y4=6,X4=`bot-lobby.orb`,Z4=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function Q4(e,t,n,r){let i=e=>e+Y4,a=(e,t)=>Math.max(e+Y4,e+t-r-Y4);return{x:Math.min(a(n.left,n.width),Math.max(i(n.left),e)),y:Math.min(a(n.top,n.height),Math.max(i(n.top),t))}}function $4(e,t,n,r){let i=e=>Math.max(1,e-r),a=Q4(e,t,n,r);return{fx:Math.min(1,Math.max(0,(a.x-n.left)/i(n.width))),fy:Math.min(1,Math.max(0,(a.y-n.top)/i(n.height)))}}function e3(e,t,n){return Q4(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function t3(e){if(e)try{let t=JSON.parse(e);return Z4(t.fx)&&Z4(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function n3(){try{return t3(localStorage.getItem(X4))}catch{return}}function r3(e){try{localStorage.setItem(X4,JSON.stringify(e))}catch{}}var i3=5,a3=16,o3={fx:1,fy:1};function s3(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}function c3(e){let t=document.getElementById(`main`)?.getBoundingClientRect();if(!t)return;if(!e)return s3(t);let n=window.visualViewport,r=s3({left:n?.offsetLeft??0,top:n?.offsetTop??0,width:n?.width??window.innerWidth,height:n?.height??window.innerHeight}),i=q4(s3(t),r);if(!i)return;let a=document.getElementById(`app-dock`)?.getBoundingClientRect().top;return a===void 0?i:J4(i,a)}function l3(e,t){return!e||!t?e===t:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function u3(e){let[t,n]=(0,m.useState)(()=>c3(e));return(0,m.useEffect)(()=>{let t=()=>{let t=c3(e);n(e=>l3(e,t)?e:t)},r=document.getElementById(`main`),i=document.getElementById(`app-dock`),a=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);r&&a?.observe(r),i&&a?.observe(i);let o=window.visualViewport;return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),o?.addEventListener(`resize`,t),o?.addEventListener(`scroll`,t),t(),()=>{a?.disconnect(),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t),o?.removeEventListener(`resize`,t),o?.removeEventListener(`scroll`,t)}},[e]),t}var d3=(0,m.forwardRef)(function({spotlight:e,thinking:t,busy:n=[],tone:r,expanded:i,hidden:a,shortcut:o,onOpen:s},c){let l=cA(`(max-width: 767.98px)`),u=u3(l),[d,f]=(0,m.useState)(n3),[p,h]=(0,m.useState)(),[g,_]=(0,m.useState)(!1),v=(0,m.useRef)(void 0),y=(0,m.useRef)(!1),b=(0,m.useRef)(44),x=d??(l?o3:void 0),S=p??(x&&u?e3(x,u,b.current):void 0),C=(0,m.useCallback)((e,t)=>{let n=c3(l);if(!n)return;let r=$4(e,t,n,b.current);f(r),r3(r)},[l]);(0,m.useEffect)(()=>{u&&h(e=>e&&Q4(e.x,e.y,u,b.current))},[u]);function w(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();b.current=t.width,v.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function T(e){let t=v.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!t.moved&&Math.hypot(n,r)<i3)return;t.moved=!0;let i=c3(l);i&&h(Q4(t.ox+n,t.oy+r,i,b.current))}function E(e){let t=v.current;v.current=void 0,t?.moved&&(y.current=!0,C(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),h(void 0))}function D(e){let t=e.shiftKey?64:a3,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowUp:[0,-t],ArrowDown:[0,t]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey)return;e.preventDefault();let r=e.currentTarget.getBoundingClientRect();b.current=r.width,C(r.left+n[0],r.top+n[1])}let O=!e&&n.length>0,k=e?SW(e):O?K4(n):void 0,A=e?`${t.map(SW).join(`, `)} thinking. `:O?`${n.join(`, `)} at work. `:``,ee=S&&u?S.x-u.left<140:!1,j={"--orb":r,...S?{left:S.x,top:S.y,right:`auto`,bottom:`auto`}:{}};return(0,R.jsxs)(Cj,{open:g&&!p,onOpenChange:_,children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${A}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,onClick:e=>{if(y.current){y.current=!1,e.preventDefault();return}s()},onPointerDown:w,onPointerMove:T,onPointerUp:E,onPointerCancel:()=>{v.current=void 0,h(void 0)},onKeyDown:D,style:j,"data-thinking":e?``:void 0,"data-busy":O?``:void 0,"data-dragging":p?``:void 0,"data-placed":S?``:void 0,"data-flip":ee||void 0,className:q(`thinking-bubble fixed z-20 touch-none rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,a&&`invisible`),children:[(0,R.jsx)(Du,{initial:!1,children:k?(0,R.jsx)(B.span,{className:`orb-label`,initial:{opacity:0,x:ee?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:ee?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,R.jsx)(Du,{mode:`popLayout`,initial:!1,children:(0,R.jsx)(B.span,{className:`inline-flex items-center gap-1`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:k},k)})},`label`):null}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,R.jsx)(`span`,{className:`orb-icon`,children:(0,R.jsx)(bW,{source:e,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,R.jsxs)(Tj,{side:`top`,children:[`Thinking `,!l&&o?(0,R.jsx)(rA,{chord:o}):null,(0,R.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),f3=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,p3=260,m3=200,h3=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function g3(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
104
+ `,t),i=e.slice(n,r<0?e.length:r),a=M0.exec(i);if(!a||t-n<a[0].length)return;let[o,s=``,c,l,u=`.`,d]=a;if(i.slice(o.length).trim()===``)return{value:e.slice(0,n)+e.slice(r<0?e.length:r),start:n,end:n};let f=`\n${s}${c??`${Number(l)+1}${u}`} ${d?`[ ] `:``}`;return{value:e.slice(0,t)+f+e.slice(t),start:t+f.length,end:t+f.length}}function P0({rest:e}){let{chat:t}=dG(e);return(0,R.jsx)(`div`,{role:`group`,"aria-label":`Knowledge pane`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5`,children:[`Chat`,`Docs`].map(n=>(0,R.jsx)(`button`,{type:`button`,"aria-pressed":t===(n===`Chat`),onClick:()=>aj(fG(e,n===`Chat`)),className:q(`h-6 rounded-md border px-2.5 text-xs font-medium outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,t===(n===`Chat`)?`btn-raised btn-soft bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:n},n))})}function F0(e){let[t,n]=(0,m.useState)(!1),[r,i]=(0,m.useState)();async function a(r){if(!t){n(!0),i(void 0);try{let{project:t}=await Te(`projects.open`,{path:r});be([t]),he(t.id,e)}catch(e){i(e.message)}finally{n(!1)}}}return{opening:t,error:r,open:a}}function I0({path:e,parent:t,busy:n,browse:r}){let[i,a]=(0,m.useState)(e);return(0,m.useEffect)(()=>a(e),[e]),(0,R.jsxs)(`form`,{className:`flex h-9 min-w-0 items-center rounded-md border border-input bg-background shadow-xs transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/20 max-md:h-11`,onSubmit:e=>{e.preventDefault(),r(i)},children:[(0,R.jsx)(`button`,{type:`button`,"aria-label":`Parent folder`,title:`Parent folder (Backspace)`,disabled:n||!t,onClick:()=>t&&r(t),className:`grid h-full w-9 shrink-0 place-items-center border-r border-input text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40`,children:(0,R.jsx)(jp,{"aria-hidden":`true`,className:`size-4`})}),(0,R.jsx)(`input`,{"aria-label":`Folder path`,value:i,disabled:n,spellCheck:!1,autoComplete:`off`,onChange:e=>a(e.target.value),className:`h-full min-w-0 flex-1 bg-transparent px-3 font-mono text-[0.8125rem] text-foreground outline-none placeholder:text-muted-foreground disabled:opacity-60`}),(0,R.jsx)(`button`,{type:`submit`,disabled:n||!i.trim(),className:`h-full shrink-0 border-l border-input px-3 text-xs font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:bg-muted disabled:pointer-events-none disabled:opacity-40`,children:`Go`})]})}function L0(e,t,n){let r=[...e.currentTarget.querySelectorAll(`button[data-folder]:not(:disabled)`)],i=r.indexOf(document.activeElement),a={ArrowDown:Math.min(r.length-1,i+1),ArrowUp:Math.max(0,i-1),Home:0,End:r.length-1}[e.key];a!==void 0&&r.length>0?(e.preventDefault(),r[a]?.focus()):e.key===`Backspace`&&t&&(e.preventDefault(),n(t))}function R0({data:e,loading:t,busy:n,browse:r}){let i=e?.folders.length??0;return(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-col overflow-hidden rounded-md border border-border`,children:[(0,R.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b border-border bg-muted/50 px-3 text-[0.7rem] font-medium tracking-wide text-muted-foreground uppercase`,children:[(0,R.jsx)(`span`,{children:`Name`}),(0,R.jsx)(`span`,{className:`normal-case tracking-normal`,children:t?`Loading…`:`${i.toLocaleString()} ${i===1?`folder`:`folders`}${e?.truncated?` (first 2,000)`:``}`})]}),(0,R.jsxs)(`div`,{"aria-label":`Folders`,role:`group`,onKeyDown:t=>L0(t,e?.parent,r),className:`h-64 overflow-y-auto overscroll-contain py-1 max-md:h-[min(40vh,16rem)]`,children:[e?.folders.map(e=>{let t=e.name.startsWith(`.`);return(0,R.jsxs)(`button`,{type:`button`,"data-folder":!0,disabled:n,onClick:()=>r(e.path),title:e.path,className:`group/row flex h-8 w-full min-w-0 items-center gap-2.5 px-3 text-left text-[0.8125rem] transition-colors outline-none hover:bg-muted focus-visible:bg-accent focus-visible:text-accent-foreground disabled:opacity-60 max-md:h-11`,children:[(0,R.jsx)(Lm,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,t?`text-muted-foreground/60`:`text-muted-foreground`)}),(0,R.jsx)(`span`,{className:q(`min-w-0 flex-1 truncate`,t&&`text-muted-foreground`),children:e.name}),(0,R.jsx)(Gp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground/0 transition-colors group-hover/row:text-muted-foreground group-focus-visible/row:text-muted-foreground`})]},e.path)}),e&&!i?(0,R.jsx)(`p`,{className:`px-3 py-6 text-center text-xs text-muted-foreground`,children:`No subfolders. You can open this folder.`}):null,e?.truncated?(0,R.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:`Only the first 2,000 entries are listed. Enter a path to go further.`}):null]})]})}function z0({tab:e,close:t,busyChanged:n}){let[r,i]=(0,m.useState)(),a=xj(`projects.browse`,r===void 0?{}:{path:r},[]),o=F0(e);return(0,m.useEffect)(()=>n(o.opening),[o.opening,n]),(0,R.jsxs)(`div`,{className:`flex min-h-0 max-h-full w-[min(40rem,calc(100vw-2rem))] flex-col overflow-y-auto max-md:max-h-[calc(100svh-2rem)]`,children:[(0,R.jsxs)(`div`,{className:`flex flex-col gap-1 border-b border-border px-5 pt-4 pb-3 max-md:px-4`,children:[(0,R.jsx)(`h2`,{className:`text-[0.9375rem] font-semibold`,children:`Open project folder`}),(0,R.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:`Folders on the machine running bot-lobby. The project opens in a session of its own; this one keeps running, and its project-local extensions stay off until you enable them.`})]}),(0,R.jsxs)(`div`,{className:`flex min-h-0 flex-col gap-3 px-5 py-4 max-md:px-4`,children:[(0,R.jsx)(I0,{path:a.data?.path??r??``,parent:a.data?.parent,busy:o.opening,browse:i}),(0,R.jsx)(R0,{data:a.data,loading:a.loading,busy:a.loading||o.opening,browse:i}),a.loading?(0,R.jsx)(`p`,{role:`status`,className:`sr-only`,children:`Loading folders…`}):null,a.error||o.error?(0,R.jsx)(`p`,{role:`alert`,className:`break-words text-xs text-destructive`,children:a.error??o.error}):null]}),(0,R.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 border-t border-border bg-muted/30 px-5 py-3 max-md:px-4`,children:[a.error?(0,R.jsx)(Y,{variant:`outline`,onClick:a.reload,disabled:a.loading,className:`max-md:min-h-11`,children:`Retry`}):null,(0,R.jsx)(Y,{variant:`outline`,onClick:t,disabled:o.opening,className:`max-md:min-h-11`,children:`Cancel`}),(0,R.jsx)(Y,{disabled:!a.data||a.loading||!!a.error||o.opening,onClick:()=>void o.open(a.data.path),className:`max-md:min-h-11`,children:o.opening?`Opening project…`:`Open this folder`})]})]})}function B0({open:e,onClose:t,tab:n}){let r=XA(e,YA.help),[i,a]=(0,m.useState)(!1);return(0,R.jsx)(HA,{open:r,label:`Open project folder`,className:`max-md:max-h-[calc(100svh-2rem)] max-md:max-w-[calc(100vw-2rem)]`,onOpenChange:e=>{!e&&!i&&t()},dismissOnBackdrop:!i,onCloseAutoFocus:e=>{e.preventDefault(),document.querySelector(`[role="combobox"][aria-label="Project"]`)?.focus()},children:e?(0,R.jsx)(z0,{tab:n,close:t,busyChanged:a}):null})}function V0(){try{return{id:P()}}catch(e){return{error:e.message}}}function H0(e,t){if(e){if(t&&!e.projects.some(e=>e.id===t))return`Selected project is unknown or offline. Refresh or choose a running project.`;if(!e.projects.length)return`No authorized running projects found. Open a folder from the Project menu, or refresh.`}}function U0(){let[e,t]=(0,m.useState)(),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(0);async function s(){let e=++o.current;a(!0),r(void 0);try{let n=await Te(`projects.list`,{});be(n.projects),e===o.current&&t(n)}catch(t){e===o.current&&r(t.message)}finally{e===o.current&&a(!1)}}(0,m.useEffect)(()=>(s(),()=>{o.current++}),[]);let[c,l]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{if(!i)return l(!1);let e=setTimeout(()=>l(!0),300);return()=>clearTimeout(e)},[i]),{data:e,error:n,busy:i,slow:c,refresh:s}}function W0({data:e,error:t}){let n=V0();return n.error??t??H0(e,n.id)}function G0({projects:e}){let t=W0(e);return t?(0,R.jsxs)(`p`,{role:`alert`,className:`notice flex min-w-0 items-start gap-2 pt-1 pb-0.5 text-xs break-words text-destructive`,children:[(0,R.jsx)(Tg,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,R.jsx)(`span`,{children:t})]}):null}function K0(e){let t=e.key===`ArrowDown`?1:e.key===`ArrowUp`?-1:0,n=e.key===`Home`?`first`:e.key===`End`?`last`:void 0;if(!t&&!n)return;let r=[...e.currentTarget.querySelectorAll(`[role='option']`)];if(r.length===0)return;e.preventDefault();let i=r.indexOf(document.activeElement);r[n===`first`?0:n===`last`?r.length-1:Math.max(0,Math.min(r.length-1,(i<0?t>0?-1:r.length:i)+t))]?.focus()}var q0=`bot-lobby:open-projects`;function J0({projects:e,tab:t,name:n,branch:r,look:i}){let a=i===`chip`,{data:o,busy:s,slow:c,refresh:l}=e,[u,d]=(0,m.useState)(!1),[f,p]=(0,m.useState)(!1),h=V0(),g=W0(e),_=h.error?`invalid`:h.id??o?.currentId??``;Uj(`p`,()=>d(!0)),(0,m.useEffect)(()=>{let e=()=>d(!0);return window.addEventListener(q0,e),()=>window.removeEventListener(q0,e)},[]),Uj(`r`,()=>void l(),{enabled:u,inDialog:!0});function v(e){d(!1),e!==_&&he(e,t)}return(0,R.jsxs)(`div`,{"aria-busy":s,className:`flex min-w-0 items-center gap-1`,children:[(0,R.jsxs)(lY,{open:u,onOpenChange:d,children:[(0,R.jsxs)(uY,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":u,"aria-keyshortcuts":`P ArrowDown`,onKeyDown:e=>{e.key!==`ArrowDown`||e.altKey||e.metaKey||e.ctrlKey||(e.preventDefault(),d(!0))},title:r?`${n} · ${r}`:n,className:q(`group flex min-w-0 items-center outline-none transition-colors duration-150 focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none`,a?`composer-chip h-7 gap-1.5 rounded-full px-2.5 text-xs font-medium text-foreground aria-expanded:bg-[var(--composer-chip-hover)]`:`h-10 gap-2 rounded-lg px-1.5 text-sm font-medium hover:bg-accent aria-expanded:bg-accent`),children:[a?(0,R.jsx)(Lm,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0`,g&&`text-destructive`)}):(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`project-mark`,"data-problem":g?!0:void 0,children:n.trim().charAt(0).toUpperCase()||`?`}),(0,R.jsx)(`span`,{className:`truncate`,children:n}),a?(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-3 shrink-0 text-muted-foreground transition-transform duration-150 group-aria-expanded:rotate-180 motion-reduce:transition-none`}):(0,R.jsx)(Yp,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,R.jsxs)(dY,{align:`start`,side:a?`top`:`bottom`,sideOffset:8,"aria-label":`Projects`,onKeyDown:K0,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`p-0 flex max-h-[calc(100svh-2rem)] w-[min(26rem,calc(100vw-1.5rem))] origin-(--radix-popover-content-transform-origin) flex-col overflow-hidden rounded-xl outline-none data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 max-md:w-[calc(100vw-2rem)]`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,R.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,R.jsxs)(`button`,{type:`button`,onClick:()=>void l(),disabled:s,"aria-label":`Refresh list`,"aria-keyshortcuts":`R`,className:`inline-flex h-7 items-center gap-1.5 rounded-lg px-2 text-xs text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 disabled:opacity-60 max-md:h-11`,children:[s?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,R.jsx)(Gh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,R.jsx)(rA,{chord:`R`,className:`kbd-hint`})]})]}),(0,R.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto overscroll-contain p-1 max-md:max-h-[calc(100svh-12rem)]`,children:o?.projects.map(e=>{let t=e.id===_;return(0,R.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>v(e.id),className:q(`flex min-h-10 w-full items-start gap-2.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors hover:bg-muted focus-visible:bg-muted focus-visible:ring-3 focus-visible:ring-ring/30 max-md:min-h-11`,t&&`bg-accent`),children:[(0,R.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,R.jsx)(zp,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,R.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,R.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium`,children:e.name}),(0,R.jsxs)(`span`,{className:`block whitespace-normal break-all text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})}),(0,R.jsxs)(`button`,{type:`button`,className:`flex min-h-11 items-center gap-2 border-t border-border px-3 py-3 text-sm font-medium outline-none hover:bg-accent focus-visible:ring-3 focus-visible:ring-ring/40`,onClick:()=>{d(!1),p(!0)},children:[(0,R.jsx)(Fm,{"aria-hidden":`true`,className:`size-4`}),`Open folder…`]})]})]}),(0,R.jsx)(B0,{open:f,onClose:()=>p(!1),tab:t}),c||g?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Refresh projects`,disabled:s,onClick:()=>void l(),className:q(`inline-flex shrink-0 items-center justify-center text-muted-foreground outline-none transition-[background-color,color,translate] hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px disabled:opacity-60 motion-reduce:active:translate-none`,a?`composer-chip size-7 rounded-full`:`size-8 rounded-lg hover:bg-accent max-md:size-11`),children:s?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):(0,R.jsx)(Gh,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,R.jsx)(Tj,{side:a?`top`:`bottom`,children:`Refresh projects`})]}):null]})}var Y0={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function X0(e,t,n){if(e.kind===`sessions`){let e={id:`newsession`,pill:`New session`,label:`Start a task in a new session`,placeholder:`Describe a task for a new session…`};return n?[{id:`session`,pill:`Message`,label:`Message ${n.name}`,placeholder:`Message ${n.name}…`,session:n},e,Y0]:[e,Y0]}if(e.kind!==`tab`)return[Y0];if(e.tab===`knowledge`)return[{id:`knowledge`,pill:`Oracle`,label:`Ask the oracle about this project`,placeholder:`Ask about this project — the oracle searches the code and learns what is missing…`}];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},Y0];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},Y0];let r=e.tab===`tasks`?KG(e.rest).id??t:void 0;return r?[{id:`comment`,pill:`Comment`,label:`Comment on ${r}`,placeholder:`Comment on ${r}'s plan…`,taskId:r},{id:`task`,pill:`Task's oracle`,label:`Message ${r}'s oracle`,placeholder:`Leave a message for ${r}'s oracle…`,taskId:r},Y0]:[Y0]}var Z0=0,Q0=`toolbar-button composer-tool relative inline-flex size-8 items-center justify-center rounded-full border text-foreground transition-[background-color,border-color,translate] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,$0=`composer-chip inline-flex h-7 min-w-0 items-center gap-1.5 rounded-full px-2.5 text-xs font-medium outline-none transition-colors duration-150 focus-visible:ring-3 focus-visible:ring-ring/40`;function e2(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function t2({file:e,onRemove:t}){let n=(0,R.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`btn-ghost flex shrink-0 items-center justify-center rounded-lg border text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,e.image?`absolute top-1 right-1 size-5 bg-background/80 text-foreground backdrop-blur-sm`:`size-7`),children:(0,R.jsx)(Vg,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,R.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},title:`${e.name} · ${O0(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,R.jsx)(`img`,{src:F(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,R.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,R.jsx)(pj,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,R.jsxs)(B.li,{layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{type:`spring`,stiffness:520,damping:32},className:`flex h-9 min-w-0 items-center gap-2 rounded-lg border border-border bg-muted pr-1 pl-2.5`,children:[(0,R.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,R.jsx)(Nm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,R.jsx)(pj,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,R.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,R.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,R.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:O0(e.size)})]}),n]})}function n2({route:e,keys:t,projects:n,onHelp:r,dockNav:i}){let[a,o]=(0,m.useState)(``),[s,c]=(0,m.useState)([]),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(!1),[g,_]=(0,m.useState)(),v=sA(`status`),y=sA(`lobby`),b=QA(),x=(v.data?.busy??!1)||!!y.data?.reply?.trim(),S=lA(),C=cA(`(max-width: 767.98px)`),{keyboardOpen:w,keyboardInset:T}=BA(),{taskId:E,session:D}=zQ(),O=(0,m.useMemo)(()=>X0(e,E,D),[e,E,D]),k=O.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),A=O.find(e=>e.id===g)??O[0];(0,m.useEffect)(()=>_(void 0),[k]);let ee=(0,m.useRef)(null),j=(0,m.useRef)(null),M=(0,m.useRef)(null),te=(0,m.useRef)(s);te.current=s;let ne=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=ne.current,t=j.current;e&&t&&(ne.current=void 0,t.setSelectionRange(e.start,e.end))},[a]);let N=(0,m.useCallback)(e=>{ne.current={start:e.start,end:e.end},o(e.value)},[]);(0,m.useEffect)(()=>{let e=ee.current;if(!e)return;let t=document.documentElement,n=()=>{let n=e.getBoundingClientRect();t.style.setProperty(`--composer-h`,b?`0px`:`${Math.ceil(n.height+(C?T:0))}px`),t.style.setProperty(`--composer-x`,`${Math.round(n.left)}px`),t.style.setProperty(`--composer-w`,`${Math.round(n.width)}px`)};n();let r=new ResizeObserver(n);return r.observe(e),window.addEventListener(`resize`,n),()=>{r.disconnect(),window.removeEventListener(`resize`,n),t.style.setProperty(`--composer-h`,`0px`),t.style.removeProperty(`--composer-x`),t.style.removeProperty(`--composer-w`)}},[b,T,w,C]);let re=(0,m.useCallback)(e=>{let t=[...e],n=8-te.current.length;t.length>n&&H.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++Z0}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;c(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),k0(e).then(e=>c(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{H.error(e instanceof Error?e.message:`That file did not upload.`),c(e=>e.filter(e=>e.key!==t))})}},[]),ie=(0,m.useCallback)(e=>{c(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),ae=s.some(e=>e.state===`uploading`),oe=s.flatMap(e=>e.info?[e.info.id]:[]),se=(a.trim().length>0||oe.length>0)&&!ae&&!d,ce=(0,m.useCallback)(async()=>{if(!se)return;f(!0);let t=oe.length>0?oe:void 0,n={text:a,...t?{attachments:t}:{}};try{let r=!0;if(A.id===`oracle`){let e=await Te(`lobby.send`,n);e.notice&&H(e.notice)}else if(A.id===`knowledge`)r=await U(`knowledge.ask`,n)!==void 0,r&&e.kind===`tab`&&aj(fG(e.rest,!0));else if(A.id===`panel`)r=await U(`planner.send`,n)!==void 0;else if(A.id===`quickfix`)r=await U(`quickfix.submit`,n)!==void 0;else if(A.id===`task`)r=await U(`tasks.message`,{taskId:A.taskId,...n})!==void 0;else if(A.id===`session`)r=await U(`sessions.message`,{...A.session.address,...n})!==void 0;else if(A.id===`newsession`){let e=await U(`sessions.start`,{request:a,...t?{attachments:t}:{}});r=e!==void 0,e?.key&&aj(`#/sessions/${encodeURIComponent(e.key)}`)}else r=await U(`tasks.comment`,{taskId:A.taskId,...n})!==void 0;if(r){o(``);for(let e of te.current)e.image&&URL.revokeObjectURL(e.image);c([])}}catch(e){H.error(e instanceof Error?e.message:`Could not send`)}finally{f(!1)}},[se,oe,A,a,e]),le=(0,m.useCallback)(async()=>{try{await Te(`lobby.abort`,{})}catch(e){H.error(e instanceof Error?e.message:`Could not stop`)}},[]),ue=e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),Lj();return}let t=e.currentTarget,n=e.key.toLowerCase();if((e.ctrlKey||e.metaKey)&&!e.altKey&&!e.shiftKey&&[`b`,`i`,`e`,`k`].includes(n)){e.preventDefault();let{selectionStart:r,selectionEnd:i,value:a}=t;N(n===`k`?j0(a,r,i):A0(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),u(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=N0(t.value,t.selectionStart);n&&(e.preventDefault(),N(n));return}if(e.key===`Backspace`&&t.value===``&&te.current.length>0){e.preventDefault(),ie(te.current.at(-1).key);return}(e2(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),ce())},de=e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),re(t))},fe=e=>{e.preventDefault(),h(!1),e.dataTransfer.files.length>0&&re(e.dataTransfer.files)},pe=e.kind===`tab`&&e.tab===`knowledge`,me=!C&&!S,P=S&&O.length>1?(0,R.jsxs)(Rq,{value:A.id,onValueChange:e=>_(e),children:[(0,R.jsx)(Bq,{"aria-label":`Send to`,className:`h-7 min-w-0 gap-1.5 px-2 text-xs`,children:(0,R.jsx)(zq,{})}),(0,R.jsx)(Vq,{children:O.map(e=>(0,R.jsx)(Hq,{value:e.id,children:e.pill},e.id))})]}):O.length>1?(0,R.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:q(`flex items-center gap-0.5 max-md:flex-wrap`,!me&&`rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`),children:O.map(e=>(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===A.id,onClick:()=>_(e.id),className:q(me?$0:`h-6 rounded-md border border-transparent px-2.5 text-xs font-medium transition-[background-color,color,box-shadow] duration-150 outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,me?e.id===A.id?`composer-chip-on`:`text-muted-foreground hover:text-foreground`:e.id===A.id?`btn-raised btn-soft bg-card text-foreground`:`btn-ghost text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):me?(0,R.jsxs)(`span`,{className:q($0,`text-muted-foreground`),children:[(0,R.jsx)(dh,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),`To the `,A.pill.toLowerCase()]}):(0,R.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,A.pill.toLowerCase()]}),F=v.data?.workspace.name??`bot-lobby`,he=v.data?.branch??v.data?.workspace.branch,ge=me?(0,R.jsxs)(`div`,{className:`composer-tray pointer-events-auto mx-auto w-full max-w-3xl`,"aria-label":`Message context`,role:`group`,children:[(0,R.jsx)(J0,{look:`chip`,projects:n,tab:e.kind===`tab`?e.tab:e.kind,name:F,branch:he}),pe?null:P,(0,R.jsxs)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end gap-3 overflow-hidden`,children:[e.kind===`tab`&&e.tab===`plan`?(0,R.jsx)(iA,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[24rem]:inline-flex`,children:`save plan`}):null,(0,R.jsx)(iA,{chord:`Shift+Enter`,className:`hidden @[14rem]:inline-flex`,children:`new line`}),(0,R.jsxs)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"data-compact":!0,onClick:r,className:q($0,`kbd-hint shrink-0 px-1.5 text-muted-foreground hover:text-foreground`),children:[(0,R.jsx)(rA,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,R.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]}),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`a`,{href:`#/settings`,"aria-label":`Models and effort`,className:q($0,`size-7 shrink-0 justify-center px-0 text-muted-foreground hover:text-foreground`),children:(0,R.jsx)(ag,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsx)(Tj,{children:`Each agent's model and effort`})]})]}):null;return(0,R.jsxs)(`div`,{id:`app-dock`,ref:ee,style:C&&w?{bottom:`${T}px`}:void 0,className:q(`dock pointer-events-none absolute inset-x-0 bottom-0 z-30 px-6 pb-[max(1.25rem,env(safe-area-inset-bottom))] transition-opacity duration-200 ease-snap max-md:px-2`,C&&w?`max-md:pb-2`:`max-md:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,b&&`opacity-0`),inert:b,children:[i?(0,R.jsx)(`div`,{className:`pointer-events-auto mx-auto mb-1.5 w-full max-w-3xl`,children:i}):null,ge,(0,R.jsx)(`div`,{className:`pointer-events-auto relative mx-auto w-full max-w-3xl`,children:(0,R.jsxs)(`div`,{className:q(`group/composer relative rounded-[22px] border border-dock-border bg-dock shadow-dock transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-[color-mix(in_oklab,var(--ring)_50%,var(--dock-border))] focus-within:shadow-dock-focus`,S&&`min-[500px]:max-md:grid min-[500px]:max-md:grid-cols-[minmax(0,1fr)_auto] min-[500px]:max-md:min-w-0`,p&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),h(!0))},onDragLeave:()=>h(!1),onDrop:fe,children:[(0,R.jsx)(Du,{initial:!1,children:s.length>0?(0,R.jsx)(B.ul,{initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:420,damping:36},"aria-label":`Attachments`,className:q(`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,S&&`min-[500px]:max-md:col-span-full min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full`),children:s.map(e=>(0,R.jsx)(t2,{file:e,onRemove:()=>ie(e.key)},e.key))},`files`):null}),l?(0,R.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:q(`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,S&&`min-[500px]:max-md:col-span-full min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full`),children:a.trim()?(0,R.jsx)(WH,{text:a}):(0,R.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,R.jsx)(`div`,{className:q(`flex px-4 pt-3.5 pb-1`,S&&`min-[500px]:max-md:col-start-1 min-[500px]:max-md:min-w-0 min-[500px]:max-md:max-w-full min-[500px]:max-md:pt-1 min-[500px]:max-md:pb-1`),children:(0,R.jsx)(`textarea`,{ref:j,id:`composer-text`,"aria-label":A.label,value:a,onChange:e=>o(e.target.value),onKeyDown:ue,onPaste:de,placeholder:x&&A.id===`oracle`?`The oracle is working. Enter steers it…`:A.placeholder,rows:1,className:q(`field-sizing-content max-h-[min(45vh,20rem)] min-h-[1.75rem] md:min-h-[2.75rem] w-full min-w-0 flex-1 resize-none bg-transparent text-base leading-relaxed caret-primary outline-none placeholder:text-muted-foreground md:text-[0.9375rem] md:leading-relaxed`,S&&`min-[500px]:max-md:max-h-[44px] min-[500px]:max-md:overflow-y-auto`)})}),(0,R.jsxs)(`div`,{className:q(`flex flex-wrap items-center gap-x-2 gap-y-2 px-2 pt-1 pb-2`,S&&`min-[500px]:max-md:col-start-2 min-[500px]:max-md:min-w-0 min-[500px]:max-md:flex-nowrap min-[500px]:max-md:gap-y-0 min-[500px]:max-md:pt-1 min-[500px]:max-md:pb-1`),children:[(0,R.jsx)(`input`,{ref:M,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{re(e.target.files??[]),e.target.value=``}}),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>M.current?.click(),className:Q0,children:(0,R.jsx)(Uh,{"aria-hidden":`true`,className:`size-[1.125rem]`})})}),(0,R.jsx)(Tj,{children:`Attach images, PDFs or files`})]}),(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":l,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>u(e=>!e),className:Q0,children:(0,R.jsx)(Dm,{"aria-hidden":`true`,className:`size-4`})})}),(0,R.jsxs)(Tj,{children:[`Preview `,(0,R.jsx)(rA,{chord:`Alt+P`})]})]}),pe||!me?(0,R.jsx)(`div`,{className:q(`contents`,C&&!S&&`max-md:block max-md:w-full max-md:order-last`),children:pe?(0,R.jsx)(P0,{rest:e.kind===`tab`?e.rest:[]}):P}):null,(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsxs)(`div`,{className:`contents max-md:ml-auto max-md:flex max-md:items-center max-md:gap-2`,children:[x&&A.id===`oracle`?(0,R.jsx)(SM,{label:`Stop`,icon:hg,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void le()}):null,(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void ce(),disabled:!se,className:`btn-tint relative inline-flex size-8 items-center justify-center rounded-full border [--tint:var(--primary)] before:absolute before:-inset-1 before:content-[''] text-primary-foreground transition-[background-color,color,box-shadow,translate,filter] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none disabled:text-muted-foreground`,children:d?(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,R.jsx)(jp,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,R.jsxs)(Tj,{children:[`Send `,(0,R.jsx)(rA,{chord:`Enter`})]})]})]})]}),p?(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute inset-0 flex items-center justify-center rounded-xl bg-card/90 text-sm font-medium text-primary backdrop-blur-[2px]`,children:`Drop to attach`}):null]})})]})}function r2({state:e}){return e===`live`?(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,R.jsx)(Tj,{children:`Connected`})]}):e===`connecting`?(0,R.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(pj,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,R.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}function i2(e){if(!e)return 0;let t=[...e.children].filter(e=>e instanceof HTMLElement&&e.offsetParent!==null&&getComputedStyle(e).position!==`absolute`);if(!t.length)return 0;let n=Math.min(...t.map(e=>e.getBoundingClientRect().left)),r=Math.max(...t.map(e=>e.getBoundingClientRect().right)),i=0;for(let t of e.querySelectorAll(`*`))t.clientWidth<=1||t.offsetParent===null||t.scrollWidth<=t.clientWidth+1||getComputedStyle(t).textOverflow===`ellipsis`&&(i+=t.scrollWidth-t.clientWidth);return r-n+i}var a2=24;function o2(){let e=(0,m.useRef)(null),[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(()=>{});return r.current=()=>{let t=e.current;if(!t)return;let r=t.querySelector(`[role="tablist"]`),i=getComputedStyle(t),a=parseFloat(i.columnGap)||0,o=t.clientWidth-(parseFloat(i.paddingLeft)||0)-(parseFloat(i.paddingRight)||0),s=i2(t.querySelector(`.where`))+(r?.offsetWidth??0)+i2(t.querySelector(`.tools`))+a*2;n(s+a2<=o)},(0,m.useLayoutEffect)(()=>r.current()),(0,m.useLayoutEffect)(()=>{let t=e.current;if(!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(()=>r.current());n.observe(t);for(let e of t.querySelectorAll(`[role="tablist"], .where, .tools`))n.observe(e);return()=>n.disconnect()},[]),{header:e,one:t}}function s2({connection:e,projects:t,lead:n,tabs:r,extra:i,tools:a}){let{header:o,one:s}=o2(),c=cA(`(max-width: 767.98px)`);return(0,R.jsxs)(`header`,{ref:o,className:`app-header shrink-0`,"data-one-row":s||void 0,children:[(0,R.jsx)(`div`,{className:`where flex min-w-0 items-center gap-2`,children:n}),c?(0,R.jsx)(`div`,{className:`phone-status flex min-w-0 items-center justify-end gap-2`,children:(0,R.jsx)(r2,{state:e})}):null,(0,R.jsx)(`div`,{className:`tabs min-w-0`,children:r}),(0,R.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-2`,children:[i,c?null:(0,R.jsx)(r2,{state:e}),a,(0,R.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,R.jsx)(G0,{projects:t})]})}var c2=`group/item flex min-h-9 w-full min-w-0 items-center gap-2.5 rounded-lg px-2 text-sm text-sidebar-foreground/85 outline-none transition-colors duration-150 hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=page]:bg-sidebar-accent aria-[current=page]:font-medium aria-[current=page]:text-sidebar-foreground max-md:min-h-11`;function l2({route:e,keys:t,rail:n}){let r=t.settings??`Alt+S`,i=(0,R.jsxs)(`a`,{href:`#/settings`,"aria-label":`Settings`,"aria-current":e.kind===`settings`?`page`:void 0,"aria-keyshortcuts":r,className:n?d2:q(c2,`flex-1`),children:[(0,R.jsx)(sg,{"aria-hidden":`true`,className:`size-4 shrink-0`}),n?null:(0,R.jsx)(`span`,{className:`flex-1`,children:`Settings`})]});return(0,R.jsx)(f2,{label:`Settings`,hint:r,side:n?`right`:`top`,children:i})}function u2({route:e,keys:t,onHelp:n,closer:r,phone:i=!1}){let a=q(d2,i?`size-11`:`size-8`);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{className:`flex min-h-12 items-center justify-end px-1`,children:r}),(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsxs)(`div`,{className:`sidebar-foot flex items-center gap-1 px-1 py-2`,children:[(0,R.jsx)(l2,{route:e,keys:t}),i?null:(0,R.jsx)(T0,{hint:t.help??`Alt+H`,onHelp:n,className:a}),(0,R.jsx)(D0,{className:a}),(0,R.jsx)(E0,{className:a})]})]})}var d2=`inline-flex size-9 shrink-0 items-center justify-center rounded-lg text-muted-foreground outline-none transition-[background-color,color,translate] duration-150 hover:bg-sidebar-accent hover:text-sidebar-foreground focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px aria-[current=page]:bg-sidebar-accent aria-[current=page]:text-sidebar-foreground motion-reduce:active:translate-none`;function f2({label:e,hint:t,side:n=`right`,children:r}){return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:r}),(0,R.jsxs)(Tj,{side:n,children:[e,` `,t?(0,R.jsx)(rA,{chord:t}):null]})]})}function p2({route:e,keys:t,onHelp:n}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`span`,{className:`flex-1`}),(0,R.jsx)(T0,{hint:t.help??`Alt+H`,onHelp:n,className:d2,side:`right`}),(0,R.jsx)(D0,{className:d2,side:`right`}),(0,R.jsx)(E0,{className:d2,side:`right`}),(0,R.jsx)(l2,{route:e,keys:t,rail:!0})]})}function m2(e){return(0,R.jsx)(`aside`,{id:`app-sidebar`,"aria-label":`Sidebar`,"data-folded":!0,className:`app-sidebar`,children:(0,R.jsx)(p2,{...e})})}function h2({open:e,onOpenChange:t,...n}){return(0,R.jsx)(Kj,{open:e,onOpenChange:t,children:(0,R.jsxs)(Xj,{side:`left`,showCloseButton:!1,"aria-describedby":`sidebar-sheet-description`,className:`app-sidebar-sheet gap-0 p-0 pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]`,children:[(0,R.jsx)(Qj,{className:`sr-only`,children:`Sidebar`}),(0,R.jsx)($j,{id:`sidebar-sheet-description`,className:`sr-only`,children:`Settings and the app's switches.`}),(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col px-1`,onClick:e=>{e.target.closest(`a[href]`)&&t(!1)},children:(0,R.jsx)(u2,{...n,phone:!0,closer:(0,R.jsx)(qj,{"aria-label":`Close sidebar`,className:q(d2,`size-11`),children:(0,R.jsx)(Vg,{"aria-hidden":`true`,className:`size-4`})})})})]})})}function g2({onOpen:e,expanded:t}){return(0,R.jsx)(`button`,{type:`button`,"aria-label":`Open sidebar`,"aria-haspopup":`dialog`,"aria-expanded":t,onClick:e,className:q(d2,`size-11 text-foreground`),children:(0,R.jsx)(ah,{"aria-hidden":`true`,className:`size-[1.15rem]`})})}function _2(e){let t=e.match(/[#&?]?token=([^&\s#]+)/i);if(t?.[1])return decodeURIComponent(t[1]);let n=e.trim();return n&&!n.includes(`/`)&&!n.includes(` `)?n:void 0}function v2(){let[e,t]=(0,m.useState)(``),[n,r]=(0,m.useState)(),[i,a]=(0,m.useState)(!1);async function o(e){a(!0),r(void 0),e&&(window.location.hash=`token=${encodeURIComponent(e)}`),await De()?window.location.reload():(r(e?`That link did not sign in. Copy the link from Pi and try again.`:`Paste the link from Pi below.`),a(!1))}function s(t){t.preventDefault(),o(_2(e))}return(0,R.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-y-auto p-6 max-md:items-start max-md:p-4`,children:(0,R.jsxs)(`form`,{onSubmit:s,className:`glass flex min-h-0 w-full max-w-md flex-col gap-4 rounded-xl p-6 max-md:max-h-[calc(100svh-2rem)] max-md:max-w-[28rem] max-md:overflow-y-auto max-md:p-4`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Um,{className:`size-5`,"aria-hidden":`true`}),(0,R.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,R.jsxs)(`p`,{className:`break-words text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,R.jsx)(`code`,{className:`rounded-lg bg-muted px-1.5 py-0.5 font-mono text-xs`,children:`/bot-lobby web`}),`to see it again). Paste it here.`]}),(0,R.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,R.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,R.jsx)(`input`,{value:e,onChange:e=>t(e.target.value),autoComplete:`off`,spellCheck:!1,placeholder:`http://127.0.0.1:7347/#token=…`,className:`h-8 min-w-0 rounded-lg border border-input bg-background px-3.5 text-sm outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 max-md:h-11`})]}),n?(0,R.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,R.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),className:`max-md:min-h-11`,children:`Retry`}),(0,R.jsx)(Y,{type:`submit`,disabled:i||!e.trim(),className:`max-md:min-h-11`,children:`Sign in`})]})]})})}var y2=.6;function b2(e,t,n={}){return{initial:e?void 0:!1,animate:t,transition:{duration:y2,...n}}}var x2=(e,t)=>[0,Math.max(e,.001),Math.min(Math.max(t,e+.01),.999),1];function S2(e,t=0,n=1){return b2(e,{pathLength:[0,0,1,1],strokeOpacity:[0,0,1,1]},{pathLength:{duration:y2,times:x2(t,n),ease:`easeInOut`},strokeOpacity:{duration:y2,times:x2(t,t+.02)}})}function C2(e,t){return b2(e,{scale:[0,0,1.3,1]},{times:x2(t,t+.18),ease:`easeOut`})}function w2(e,t,n=1.3){return b2(e,{scale:[1,1,n,1,1]},{times:[0,Math.max(t,.001),Math.min(t+.15,.9),Math.min(t+.35,.99),1],ease:`easeInOut`})}var T2=(e=.5,t=.5)=>({transformBox:`fill-box`,originX:e,originY:t});function E2({play:e}){return(0,R.jsxs)(B.g,{style:T2(.1,.9),...b2(e,{rotate:[0,-12,8,-4,0],scale:[1,1.12,.96,1.02,1]},{ease:`easeInOut`}),children:[(0,R.jsx)(`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`}),[8,12,16].map((t,n)=>(0,R.jsx)(B.circle,{cx:t,cy:11,r:1.15,fill:`currentColor`,stroke:`none`,...b2(e,{fillOpacity:[0,0,1,1,0],y:[0,0,-1.5,0,0]},{times:[0,.12+n*.12,.24+n*.12,.72,1]})},t))]})}function D2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.path,{d:`M13 5h8`,...S2(e,.15,.45)}),(0,R.jsx)(B.path,{d:`M13 12h8`,...S2(e,.3,.6)}),(0,R.jsx)(B.path,{d:`M13 19h8`,...S2(e,.45,.75)}),(0,R.jsx)(B.path,{d:`m3 17 2 2 4-4`,...S2(e,.35,.7)}),(0,R.jsx)(B.path,{d:`m3 7 2 2 4-4`,...S2(e,0,.35)})]})}function O2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:6,cy:19,r:3,style:T2(),...w2(e,0)}),(0,R.jsx)(B.path,{d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`,...S2(e,.1,.7)}),(0,R.jsx)(B.circle,{cx:18,cy:5,r:3,style:T2(),...C2(e,.62)})]})}function k2({play:e}){return(0,R.jsx)(B.g,{style:T2(),...b2(e,{rotate:[0,-14,10,-6,0],scale:[1,1.18,.94,1.04,1]},{duration:.5,ease:`easeInOut`}),children:(0,R.jsx)(B.path,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,fill:`currentColor`,...b2(e,{fillOpacity:[0,.85,0]},{duration:.5,times:[0,.2,1]})})})}function A2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:12,cy:12,r:10,style:T2(),...b2(e,{scale:[1,1,1.4],strokeOpacity:[0,.5,0]},{times:[0,.25,1],ease:`easeOut`})}),(0,R.jsx)(B.circle,{cx:12,cy:12,r:10,style:T2(),...b2(e,{scale:[1,.86,1.06,1]},{times:[0,.25,.55,1],ease:`easeInOut`})}),(0,R.jsx)(B.circle,{cx:12,cy:12,r:1,fill:`currentColor`,style:T2(),...b2(e,{scale:[1,2.4,.8,1]},{times:[0,.3,.6,1],ease:`easeInOut`})})]})}function j2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`}),[`M8 17v-3`,`M13 17V5`,`M18 17V9`].map((t,n)=>(0,R.jsx)(B.path,{d:t,style:T2(.5,1),...b2(e,{scaleY:[0,0,1.18,1]},{times:x2(.08+n*.14,.4+n*.14),ease:`easeOut`})},t))]})}function M2({play:e}){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(B.circle,{cx:6,cy:6,r:3,style:T2(),...w2(e,0)}),(0,R.jsx)(B.line,{x1:6,x2:6,y1:9,y2:21,...S2(e,.05,.45)}),(0,R.jsx)(B.path,{d:`M13 6h3a2 2 0 0 1 2 2v7`,...S2(e,.2,.62)}),(0,R.jsx)(B.circle,{cx:18,cy:18,r:3,style:T2(),...C2(e,.58)})]})}function N2({play:e}){return(0,R.jsxs)(B.g,{style:T2(),...b2(e,{scaleX:[1,.55,1.08,1],y:[0,-1,0,0]},{times:[0,.35,.65,1],ease:`easeInOut`}),children:[(0,R.jsx)(B.path,{d:`M12 5v16`,style:T2(),...b2(e,{scaleY:[1,1.12,1,1]},{times:[0,.35,.65,1]})}),(0,R.jsx)(`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`})]})}function P2({play:e}){return(0,R.jsxs)(B.g,{style:T2(.6,.6),...b2(e,{x:[0,1.5,-1.5,1,0],y:[0,-1,.5,-.5,0],rotate:[0,-8,6,-3,0]},{ease:`easeInOut`}),children:[(0,R.jsx)(`path`,{d:`M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z`}),(0,R.jsx)(`path`,{d:`m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18`}),(0,R.jsx)(B.path,{d:`m2.3 2.3 7.286 7.286`,...S2(e,.1,.6)}),(0,R.jsx)(B.circle,{cx:11,cy:11,r:2,style:T2(),...w2(e,.5,1.5)})]})}var F2={lobby:E2,tasks:D2,plan:O2,quickfix:k2,issues:A2,metrics:j2,git:M2,knowledge:N2,excalidraw:P2};function I2({id:e,play:t,className:n}){let r=F2[e];return r?(0,R.jsx)(`svg`,{"aria-hidden":`true`,"data-tab-icon":e,"data-play":t,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,className:q(`overflow-visible`,n),children:(0,R.jsx)(r,{play:t})},t):null}function L2(e,t,n=5){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0||n<2)return e;let r=Math.floor(n/2),i=(r-.75)*t,a=(r+1.75)*t;return e<i?e+Math.ceil((i-e)/t)*t:e>a?e-Math.ceil((e-a)/t)*t:e}function R2(e){return/(\d)$/.exec(e)?.[1]}function z2(e){return e.filter(e=>e.id!==`metrics`)}function B2(e,t,n=5){return L2(e,t,n)}function V2(e,t,n){let r=t.find(t=>t.id===e);if(r)return r.label;let i=n.replace(/^#\/?/,``).split(`/`)[0];return i===`settings`?`Settings`:i===`sessions`?`Sessions`:i===`metrics`?`Metrics`:i?i.charAt(0).toUpperCase()+i.slice(1):`Lobby`}var H2=`phone-tab-card inline-flex h-11 min-w-11 shrink-0 items-center justify-center gap-1.5 rounded-xl border px-2.5 text-sm font-medium whitespace-nowrap outline-none focus-visible:ring-3 focus-visible:ring-ring/40`;function U2(e){let t=R2(e.key);return t?`${t}. ${e.label}`:e.label}function W2(e,t){let n=R2(e.key);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(I2,{id:e.id,play:+!!t,className:`size-4 shrink-0`}),n?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`text-[0.7rem] font-semibold tabular-nums text-muted-foreground`,children:n}):null,t?(0,R.jsx)(`span`,{className:`max-w-[8.5rem] truncate`,children:e.label}):null]})}function G2(e){return e?{duration:0}:{type:`spring`,stiffness:520,damping:30,mass:.5}}function K2({tab:e,selected:t,reduced:n}){return(0,R.jsx)(B.span,{className:`inline-flex items-center gap-1.5`,animate:{scale:t?1.04:1},transition:G2(n),children:W2(e,t)})}function q2({tab:e,selected:t,canonical:n,reduced:r,onClick:i,roving:a}){let o=U2(e);return n?(0,R.jsx)(`button`,{type:`button`,role:`tab`,id:`tab-${e.id}`,"data-phone-tab-id":e.id,"aria-controls":`main`,"aria-label":o,"aria-keyshortcuts":e.key,"aria-selected":t,tabIndex:t||a?0:-1,onClick:i,className:H2,children:(0,R.jsx)(K2,{tab:e,selected:t,reduced:r})}):(0,R.jsx)(`span`,{"data-phone-tab-id":e.id,"data-active":t?`true`:`false`,className:H2,"aria-hidden":`true`,children:(0,R.jsx)(K2,{tab:e,selected:t,reduced:r})})}function J2({tabs:e,activeId:t,canonical:n,reduced:r,onClick:i,canonicalRef:a}){let o=t??e[0]?.id;return(0,R.jsx)(`div`,{ref:n?a:void 0,"data-phone-period":n?`canonical`:`copy`,"aria-hidden":!n||void 0,role:n?`tablist`:void 0,"aria-label":n?`Lobby tabs`:void 0,className:`phone-tabs-period`,children:e.map(e=>(0,R.jsx)(q2,{tab:e,selected:e.id===t,canonical:n,reduced:r,roving:e.id===o,onClick:t=>i(e.id,t)},e.id))})}function Y2(e){return e<=0?0:e===1?1:5}function X2({tabs:e,activeId:t,reduced:n,onClick:r,canonicalRef:i}){let a=Y2(e.length),o=Math.floor(a/2);return a?(0,R.jsx)(R.Fragment,{children:Array.from({length:a},(a,s)=>(0,R.jsx)(J2,{tabs:e,activeId:t,canonical:s===o,reduced:n,onClick:r,canonicalRef:s===o?i:void 0},s))}):null}function Z2(e){e.current!==void 0&&window.clearTimeout(e.current),e.current=void 0}function Q2(e){return e?.closest(`[data-phone-tab-id]`)?.dataset.phoneTabId}function $2(e){return Q2(e.target instanceof Element?e.target:null)}function e4(e){return Q2(document.elementFromPoint(e.clientX,e.clientY))??Q2(e.target instanceof Element?e.target:null)}function t4(e,t){let n=e.dataset.phoneTabId;if(!n)return;let r=e.getBoundingClientRect();if(Number.isFinite(r.width))return{id:n,element:e,distance:Math.abs(r.left+r.width/2-t)}}function n4(e,t){return[...e.querySelectorAll(`[data-phone-tab-id]`)].map(e=>t4(e,t)).filter(e=>e!==void 0)}function r4(e){return e.reduce((e,t)=>!e||t.distance<e.distance?t:e,void 0)}function i4(e,t){return r4(n4(t,e.getBoundingClientRect().left+e.clientWidth/2))}function a4(e,t){if(e&&t)return[...e.querySelectorAll(`[data-phone-tab-id]`)].find(e=>e.dataset.phoneTabId===t)}function o4(e){let t=Number.parseFloat(getComputedStyle(e.parentElement??e).columnGap)||6;return e.offsetWidth+t}function s4(e,t,n){let r=Math.max(0,n.findIndex(e=>e.id===t));if(e===`Home`)return n[0]?.id;if(e===`End`)return n.at(-1)?.id;if(e===`ArrowRight`)return n[(r+1)%n.length]?.id;if(e===`ArrowLeft`)return n[(r-1+n.length)%n.length]?.id}function c4(e,t){return Math.abs(e-t)<=2}function l4(){let e=(0,m.useRef)(null),t=(0,m.useRef)(null),n=(0,m.useRef)(null),r=(0,m.useRef)(void 0),i=(0,m.useRef)(void 0),a=(0,m.useRef)(void 0),o=(0,m.useRef)(void 0),s=(0,m.useRef)(void 0),c=(0,m.useRef)(void 0),l=(0,m.useRef)(0),u=(0,m.useRef)(0),d=(0,m.useRef)(void 0);return(0,m.useMemo)(()=>({scroller:e,track:t,canonical:n,gesture:r,candidate:i,crossed:a,settleTimer:o,commitTimer:s,clickGuard:c,generation:l,scrollGeneration:u,programmatic:d}),[])}function u4(e){return{clearPending:(0,m.useCallback)(()=>{Z2(e.settleTimer),Z2(e.commitTimer),e.candidate.current=void 0,e.generation.current+=1},[e])}}function d4(e){let t=(0,m.useCallback)(t=>{let n=e.scroller.current;if(!n)return;let r=e.scrollGeneration.current+1;e.scrollGeneration.current=r;let i={value:Math.max(0,t),generation:r};e.programmatic.current=i,n.scrollLeft=i.value,i.value=n.scrollLeft},[e]),n=(0,m.useCallback)(n=>{let r=e.scroller.current;if(!r||!n||r.clientWidth<=0)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),o=r.scrollLeft+a.left+a.width/2-(i.left+r.clientWidth/2);t(o)},[e,t]);return{centre:n,centreCanonical:(0,m.useCallback)(t=>{let r=a4(e.canonical.current,t);r&&(e.crossed.current=r),n(r)},[n,e]),rebase:(0,m.useCallback)((n,r)=>{let i=B2(n.scrollLeft,o4(r));if(c4(i,n.scrollLeft))return!1;let a=i-n.scrollLeft;return e.gesture.current&&(e.gesture.current.originScrollLeft+=a),t(i),!0},[e,t])}}function f4(e){let t=(0,m.useCallback)(()=>{e.clickGuard.current=void 0},[e]);return{clearGuard:t,guardClick:(0,m.useCallback)(n=>{t(),e.clickGuard.current={kind:n}},[t,e]),consumeGuard:(0,m.useCallback)(n=>!n||!e.clickGuard.current?!1:(t(),!0),[t,e])}}function p4(e){return(0,m.useCallback)(()=>{let t=e.scroller.current,n=e.track.current;if(!t||!n)return;let r=i4(t,n);return r&&r.element!==e.crossed.current&&(e.crossed.current=r.element,wJ()),e.candidate.current=r,r},[e])}function m4(e,t,n,r,i){let a=(0,m.useCallback)((r,i)=>{r&&r.id!==e.activeId&&(Z2(t.commitTimer),t.commitTimer.current=window.setTimeout(()=>{i!==t.generation.current||t.candidate.current?.element!==r.element||e.blocked||(n(),e.onSelect(r.id))},500))},[n,e,t]);return(0,m.useCallback)(()=>{Z2(t.settleTimer),Z2(t.commitTimer);let e=++t.generation.current;t.settleTimer.current=window.setTimeout(()=>{if(e!==t.generation.current||t.gesture.current)return;let n=r();n&&(i(n.element),a(n,e))},120)},[a,i,r,t])}function h4(e,t,n){return(0,m.useCallback)(r=>e.tabs.some(e=>e.id===r)?(t(),e.onSelect(r),n(r),!0):!1,[n,t,e])}function g4(e,t,n,r){return(0,m.useCallback)(()=>{let i=e.scroller.current,a=e.canonical.current;if(!i||!a)return;let o=e.programmatic.current;if(o&&o.generation===e.scrollGeneration.current&&c4(i.scrollLeft,o.value)){e.programmatic.current=void 0;return}if(e.programmatic.current=void 0,Z2(e.commitTimer),Z2(e.settleTimer),e.candidate.current=void 0,e.generation.current+=1,t(i,a)){e.gesture.current||r();return}n(),e.gesture.current||r()},[n,t,e,r])}function _4(e,t,n,r){let i=(0,m.useRef)({clearPending:t,settle:n});i.current={clearPending:t,settle:n},(0,m.useEffect)(()=>{let t=e.scroller.current;if(!r||!t)return;let n=n=>{let r=n.deltaX||(n.shiftKey?n.deltaY:0);r&&(n.preventDefault(),e.programmatic.current=void 0,i.current.clearPending(),t.scrollLeft+=r,i.current.settle())};return t.addEventListener(`wheel`,n,{passive:!1}),()=>t.removeEventListener(`wheel`,n)},[r,e])}function v4(e,t,n){return(0,m.useCallback)(r=>{t(),n(),e.programmatic.current=void 0,e.gesture.current={id:r.pointerId,x:r.clientX,y:r.clientY,moved:!1,originScrollLeft:r.currentTarget.scrollLeft,downTabId:$2(r)},r.currentTarget.setPointerCapture?.(r.pointerId)},[n,t,e])}function y4(e,t){return(0,m.useCallback)(n=>{let r=e.gesture.current;r&&r.id===n.pointerId&&(Math.hypot(n.clientX-r.x,n.clientY-r.y)<8||(r.moved=!0,t(),(n.pointerType===`mouse`||n.pointerType===`pen`)&&(n.currentTarget.scrollLeft=r.originScrollLeft+r.x-n.clientX,n.preventDefault())))},[t,e])}function b4(e,t,n,r){return(0,m.useCallback)(i=>{let a=e.gesture.current;if(!a||a.id!==i.pointerId)return;e.gesture.current=void 0;let o=e4(i),s=a.downTabId;if(s&&!a.moved&&(!o||o===s)){n.guardClick(`committed`),t(s);return}(a.moved||s&&o&&o!==s)&&n.guardClick(`drag`),a.moved&&r()},[t,n,e,r])}function x4(e,t,n){return(0,m.useCallback)(()=>{let r=e.gesture.current?.moved;e.gesture.current=void 0,r&&t.guardClick(`drag`),r&&n()},[t,e,n])}function S4(e,t,n,r,i){return{onPointerDown:v4(e,i,n.clearGuard),onPointerMove:y4(e,i),onPointerUp:b4(e,t,n,r),onPointerCancel:x4(e,n,r)}}function C4(e,t){return(0,m.useCallback)((n,r)=>{t.consumeGuard(r.detail!==0)||e(n)},[e,t])}function w4(e,t){return(0,m.useCallback)(n=>{if(t.consumeGuard(n.detail!==0))return;let r=n.target instanceof Element?n.target.closest(`[data-phone-tab-id]`):null;if(!r||r.closest(`button`))return;let i=r.dataset.phoneTabId;i&&e(i)},[e,t])}function T4(e,t,n){return(0,m.useCallback)(r=>{if(r.key===`ArrowDown`&&!r.altKey){Ij()&&r.preventDefault();return}if(!e.tabs.length)return;let i=r.target.closest(`[role='tab']`)?.dataset.phoneTabId??e.activeId??e.tabs[0].id,a=s4(r.key,i,e.tabs);a?(r.preventDefault(),Rj.active=!0,Rj.to=a,n(a),a4(t.canonical.current,a)?.focus({preventScroll:!0})):(r.key===`Enter`||r.key===` `)&&i&&(r.preventDefault(),n(i))},[n,e,t])}function E4(e){let[t,n]=(0,m.useState)(0),[r,i]=(0,m.useState)(!1);return{sidePad:t,peek:r,setPeek:i,updatePad:(0,m.useCallback)(()=>{let t=e.scroller.current;if(!t||t.clientWidth<=0)return;let r=Math.max(22,t.clientWidth/2);n(e=>Math.abs(e-r)<.5?e:r)},[e])}}function D4(e,t){return e.find(e=>e.id===t)?.id??e[0]?.id}function O4(e,t,n,r){let{activeId:i,keyboardOpen:a,tabs:o}=e;(0,m.useLayoutEffect)(()=>{n(),t(D4(o,i))},[i,t,a,o,n,r])}function k4(e,t,n,r,i){let{activeId:a,tabs:o}=e;(0,m.useEffect)(()=>{let e=t.scroller.current;if(!e||typeof ResizeObserver>`u`)return;let s=new ResizeObserver(()=>{e.clientWidth<=0||(n(),i(),r(D4(o,a)))});return s.observe(e),t.track.current&&s.observe(t.track.current),()=>s.disconnect()},[a,r,n,t,o,i])}function A4(e){(0,m.useEffect)(()=>{let t=()=>e();return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[e])}function j4(e,t,n,r){(0,m.useEffect)(()=>{n(),t.crossed.current=void 0},[n,e.activeId,e.blocked,e.keyboardOpen,t,r])}function M4(e,t,n){(0,m.useEffect)(()=>()=>{t(),n(),e.programmatic.current=void 0},[n,t,e])}function N4(e,t,n){(0,m.useEffect)(()=>{e.keyboardOpen||n(!1),t()},[t,e.blocked,e.keyboardOpen,n])}function P4(e){let t=l4(),{clearPending:n}=u4(t),r=d4(t),i=f4(t),a=E4(t),o=p4(t),s=m4(e,t,n,o,r.centre),c=h4(e,n,r.centreCanonical),l=g4(t,r.rebase,o,s),u=S4(t,c,i,s,n);_4(t,n,s,e.tabs.length>0);let d=T4(e,t,c),f=w4(c,i),p=C4(c,i),m=e.tabs.map(e=>e.id).join(`\0`);return O4(e,r.centreCanonical,a.updatePad,!e.keyboardOpen||a.peek),k4(e,t,n,r.centreCanonical,a.updatePad),j4(e,t,n,m),A4(n),M4(t,n,i.clearGuard),N4(e,n,a.setPeek),{scroller:t.scroller,track:t.track,canonical:t.canonical,sidePad:a.sidePad,periods:Y2(e.tabs.length),peek:a.peek,setPeek:a.setPeek,onScroll:l,...u,onSurfaceClick:f,onCardClick:p,onKeyDown:d}}function F4(e,t){return V2(e,t,window.location.hash)}function I4({tabs:e,activeId:t,onSelect:n}){let r=(0,m.useMemo)(()=>z2(e),[e]),i=QA(),{keyboardOpen:a}=BA(),o=!!xf(),s=F4(t,e),c=P4({tabs:r,activeId:t,blocked:i,keyboardOpen:a,reduced:o,onSelect:n});if(!r.length)return null;let l=a&&!c.peek;return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(`div`,{"aria-hidden":l?`true`:void 0,inert:l,hidden:l,children:(0,R.jsx)(R4,{tabs:r,activeId:t,label:s,reduced:o,carousel:c,keyboardOpen:a})}),l?(0,R.jsx)(L4,{label:s,onOpen:()=>c.setPeek(!0)}):null]})}function L4({label:e,onOpen:t}){return(0,R.jsx)(`div`,{className:`phone-tabs phone-tabs-handle`,children:(0,R.jsxs)(`button`,{type:`button`,"data-phone-tabs-handle":!0,"aria-expanded":`false`,"aria-label":`Open tabs, current page ${e}`,onPointerDown:e=>e.preventDefault(),onClick:t,className:`phone-tabs-current inline-flex min-h-11 items-center gap-2 rounded-xl border px-4 text-sm font-medium focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,R.jsx)(`span`,{className:`truncate`,children:e}),(0,R.jsx)(qp,{"aria-hidden":`true`,className:`size-4`})]})})}function R4({tabs:e,activeId:t,label:n,reduced:r,carousel:i,keyboardOpen:a}){return(0,R.jsxs)(`div`,{className:`phone-tabs`,"data-phone-tabs":!0,"data-periods":i.periods,children:[t&&!e.some(e=>e.id===t)?(0,R.jsx)(`span`,{"data-phone-page-handle":!0,className:`phone-tabs-page-handle`,children:n}):null,(0,R.jsx)(`div`,{ref:i.scroller,className:`phone-tabs-scroller`,onScroll:i.onScroll,onPointerDown:i.onPointerDown,onPointerMove:i.onPointerMove,onPointerUp:i.onPointerUp,onPointerCancel:i.onPointerCancel,onClick:i.onSurfaceClick,children:(0,R.jsx)(`div`,{ref:i.track,className:`phone-tabs-track`,style:{"--phone-period-pad":`${i.sidePad}px`},onKeyDown:i.onKeyDown,children:(0,R.jsx)(X2,{tabs:e,activeId:t,reduced:r,onClick:i.onCardClick,canonicalRef:i.canonical})})}),a&&i.peek?(0,R.jsx)(`button`,{type:`button`,"aria-label":`Close tabs`,onPointerDown:e=>e.preventDefault(),onClick:()=>i.setPeek(!1),className:`phone-tabs-close`,children:(0,R.jsx)(Vp,{"aria-hidden":`true`,className:`size-4`})}):null]})}function z4(e){return/(\d)$/.exec(e)?.[1]}var B4=160;function V4(e){let t=xf(),[n,r]=(0,m.useState)(0),i=(0,m.useRef)(0),a=(0,m.useCallback)(()=>{t||performance.now()<i.current||(i.current=performance.now()+y2*1e3,r(e=>e+1))},[t]),o=(0,m.useRef)(e);return(0,m.useEffect)(()=>{let t=e&&!o.current;if(o.current=e,!t)return;let n=window.setTimeout(a,B4);return()=>window.clearTimeout(n)},[e,a]),{play:n,onPointerEnter:(0,m.useCallback)(e=>{e.pointerType!==`touch`&&a()},[a])}}var H4=(0,m.forwardRef)(function({tab:e,active:t},n){let r=z4(e.key),{play:i,onPointerEnter:a}=V4(t);return(0,R.jsxs)(Cj,{children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,onPointerEnter:a,className:q(`relative z-10 inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-lg border border-[var(--tab-outline)] px-2.5 text-[0.8125rem] leading-none font-medium whitespace-nowrap outline-none`,`transition-colors duration-200 ease-snap focus-visible:ring-3 focus-visible:ring-ring/40`,t?`text-foreground`:`bg-[var(--tab-idle)] text-muted-foreground hover:text-foreground`),children:[(0,R.jsx)(I2,{id:e.id,play:i,className:q(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)}),r?(0,R.jsx)(`span`,{"aria-hidden":`true`,className:q(`text-[0.72rem] font-semibold tabular-nums transition-colors duration-200`,t?`text-primary`:`text-muted-foreground/75`),children:r}):null,(0,R.jsx)(`span`,{children:e.label})]})}),(0,R.jsxs)(Tj,{children:[e.label,` `,(0,R.jsx)(rA,{chord:e.key})]})]})}),U4=1.5;function W4(e,t,n=t?.left??0,r=t?.right??0,i=1){if(e){if(!t||r-n<.5){e.style.opacity=`0`;return}e.style.opacity=String(Math.min(1,(r-n)/14)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${r-n}px`,e.style.transform=`translateX(${n}px)`,e.style.scale=i===1?``:`1 ${i}`}}function G4(e,t){let n=e.right-e.left,{height:r}=e,i=U4/2,a=Math.max(0,Math.min(e.radius-i,r/2-i,n/2-i)),o=r/2,s=e=>+(t===`left`?e:n-e).toFixed(2),c=+(t===`left`),l=1-c,u=i,d=n-i,f=r-i;return[`M${s(u)} ${o}L${s(u)} ${i+a}A${a} ${a} 0 0 ${c} ${s(u+a)} ${i}L${s(d-a)} ${i}A${a} ${a} 0 0 ${c} ${s(d)} ${i+a}L${s(d)} ${o}`,`M${s(u)} ${o}L${s(u)} ${f-a}A${a} ${a} 0 0 ${l} ${s(u+a)} ${f}L${s(d-a)} ${f}A${a} ${a} 0 0 ${l} ${s(d)} ${f-a}L${s(d)} ${o}`]}function K4(e,t,n,r){if(!e)return;if(!t||r<=.002){e.style.opacity=`0`;return}let i=t.right-t.left,a=`${i}x${t.height}r${t.radius}${n}`;e.dataset.shape!==a&&(e.dataset.shape=a,e.dataset.port=n,e.setAttribute(`viewBox`,`0 0 ${i} ${t.height}`),G4(t,n).forEach((t,n)=>e.children[n]?.setAttribute(`d`,t))),e.style.opacity=String(Math.min(1,r*12)),e.style.top=`${t.top}px`,e.style.height=`${t.height}px`,e.style.width=`${i}px`,e.style.transform=`translateX(${t.left}px)`;let o=`${Math.min(1,r)} 2`;for(let t of e.children)t.style.strokeDasharray=o}var q4={type:`spring`,visualDuration:.12,bounce:0},J4={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},Y4={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},X4={type:`spring`,visualDuration:.22,bounce:.25},Z4={type:`spring`,visualDuration:.2,bounce:0},Q4={type:`spring`,stiffness:900,damping:18,velocity:45,restDelta:.02,restSpeed:1},$4=(()=>{let e=Sr({keyframes:[0,1],visualDuration:X4.visualDuration,bounce:X4.bounce}),t=0;for(;t<1e3&&e.next(t).value<.97;)t+=4;return t/1e3})(),e3={type:`spring`,visualDuration:.28,bounce:.6};function t3(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)(null),o=(0,m.useRef)(null),s=(0,m.useRef)({}),c=(0,m.useRef)([]),l=(0,m.useRef)(void 0),u=(0,m.useRef)([]),d=(0,m.useRef)(1),f=(0,m.useRef)(1),p=(0,m.useCallback)(e=>{let t=e?s.current[e]:void 0;if(!t)return;let n=parseFloat(getComputedStyle(t).borderTopLeftRadius)||0;return{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight,radius:n}},[]),h=(0,m.useCallback)(()=>{for(let e of u.current)e.stop();u.current=[];for(let e of Object.values(s.current))e?.style.translate&&(e.style.translate=``)},[]),g=(0,m.useCallback)(e=>{h(),l.current=e,d.current=1,f.current=1;let t=p(e);W4(r.current,t),W4(i.current,void 0),K4(a.current,t,`left`,1),K4(o.current,void 0,`left`,0);for(let e of c.current)e&&(e.style.width=`0px`);MH()},[p,h]),_=(0,m.useCallback)((e,t)=>{let n=p(e),m=p(t);if(!n||!m)return g(t);h(),jH(),l.current=t;let _=m.left>n.left?1:-1,v=_>0?n.right:n.left,y=_>0?m.left:m.right,b=Math.abs(y-v),x=_>0?`right`:`left`,S=_>0?`left`:`right`,C=c.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),w=b>4?1-4/b:0,T={drained:1-Math.min(1,d.current),unrung:1-Math.min(1,f.current),head:0,tail:0,filled:0,rung:0,squash:1,budge:0},E=s.current[t];d.current=0,f.current=0;let D=()=>{let e=(n.right-n.left)*Math.min(1,T.drained);W4(i.current,n,_>0?n.left+e:n.left,_>0?n.right:n.right-e),K4(o.current,n,x,1-T.unrung);let t=v+_*b*T.head,s=v+_*b*T.tail,c=Math.min(t,s),l=Math.max(t,s);for(let e of C){if(!e?.liquid)continue;let t=Math.max(c,e.from),n=Math.min(l,e.to);e.liquid.style.width=`${Math.max(0,n-t)}px`,e.liquid.style.transform=`translateX(${Math.max(0,t-e.from)}px)`}let u=_*T.budge,d=u?{...m,left:m.left+u,right:m.right+u}:m;E&&(E.style.translate=Math.abs(u)>.01?`${u.toFixed(2)}px`:``);let f=(d.right-d.left)*Math.min(1,Math.max(0,T.filled));W4(r.current,d,_>0?d.left:d.right-f,_>0?d.left+f:d.right,Math.min(1,T.squash)),K4(a.current,d,S,T.rung)},O=(e,t,n,r,i=1)=>{let a=Wf(t,i,{...n,onUpdate:t=>{T[e]=t,r?.(t),D()}});return u.current.push(a),a},k=!1,A=()=>{if(k)return;k=!0;let e=O(`filled`,0,X4,e=>{d.current=e});e.then(()=>{l.current===t&&MH()}),O(`squash`,.8,e3),O(`rung`,0,Z4,e=>{f.current=e}),O(`budge`,0,{...Q4,delay:$4},void 0,0),Promise.all([e,...u.current]).then(()=>{l.current===t&&u.current.includes(e)&&g(t)})};O(`drained`,T.drained,q4),O(`unrung`,T.unrung,q4),O(`head`,0,J4,e=>{e>=w&&A()}),O(`tail`,0,Y4),D()},[p,g,h]);(0,m.useLayoutEffect)(()=>{let t=l.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?g(e):_(t,e)},[e,t,_,g]);let v=(0,m.useRef)(e);return v.current=e,(0,m.useEffect)(()=>{let e=n.current;if(!e||typeof ResizeObserver>`u`)return;let t=!0,r=new ResizeObserver(()=>{if(t){t=!1;return}g(v.current)});return r.observe(e),()=>{r.disconnect(),h()}},[g,h]),{track:n,fill:r,drain:i,ring:a,unring:o,cells:s,liquids:c}}var n3=(0,m.forwardRef)(function({which:e},t){return(0,R.jsxs)(`svg`,{ref:t,"aria-hidden":`true`,[`data-tab-${e}`]:``,className:`pointer-events-none absolute left-0 z-20 overflow-visible opacity-0 will-change-transform`,fill:`none`,children:[(0,R.jsx)(`path`,{pathLength:1,strokeWidth:U4,strokeLinecap:`round`,className:`stroke-tab-rim`}),(0,R.jsx)(`path`,{pathLength:1,strokeWidth:U4,strokeLinecap:`round`,className:`stroke-tab-rim`})]})});function r3(e){if(e.left||e.right)return`linear-gradient(to right, ${e.left?`transparent 0, black 28px`:`black 0`}, ${e.right?`black calc(100% - 28px), transparent 100%`:`black 100%`})`}function i3({tabs:e,activeId:t,onSelect:n}){let r=cA(`(max-width: 767.98px)`),{track:i,fill:a,drain:o,ring:s,unring:c,cells:l,liquids:u}=t3(t,e.length),d=(0,m.useRef)(null),[f,p]=(0,m.useState)({left:!1,right:!1}),h=(0,m.useCallback)(()=>{let e=d.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;p(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=d.current;if(!e||typeof ResizeObserver>`u`)return;h();let t=new ResizeObserver(h);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[h,e.length]),(0,m.useEffect)(()=>{let e=d.current,n=t?l.current[t]:void 0;e&&n&&(n.offsetLeft<e.scrollLeft?e.scrollLeft=n.offsetLeft-8:n.offsetLeft+n.offsetWidth>e.scrollLeft+e.clientWidth&&(e.scrollLeft=n.offsetLeft+n.offsetWidth-e.clientWidth+8))},[t,l]);function g(r){if(r.key===`ArrowDown`&&!r.altKey){Ij()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=r.target.closest(`[role='tab']`)?.id.replace(/^tab-/,``)??t,o=e[(Math.max(0,e.findIndex(e=>e.id===a))+i+e.length)%e.length];Rj.active=!0,Rj.to=o.id,window.setTimeout(()=>{Rj.active=!1,Rj.to=void 0},3e3),n(o.id),l.current[o.id]?.focus({preventScroll:!0})}return r?(0,R.jsx)(I4,{tabs:e,activeId:t,onSelect:n}):(0,R.jsx)(`div`,{ref:d,onScroll:h,style:{maskImage:r3(f),WebkitMaskImage:r3(f)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] pointer-coarse:-my-1.5 pointer-coarse:py-1.5 [&::-webkit-scrollbar]:hidden`,children:(0,R.jsxs)(`div`,{ref:i,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:g,className:`relative mx-auto flex w-max items-center py-0.5`,children:[(0,R.jsx)(`span`,{ref:o,"aria-hidden":`true`,"data-tab-drain":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,R.jsx)(`span`,{ref:a,"aria-hidden":`true`,"data-tab-fill":!0,className:`pointer-events-none absolute left-0 z-0 rounded-lg bg-tab-fill opacity-0 will-change-transform`}),(0,R.jsx)(n3,{ref:c,which:`unring`}),(0,R.jsx)(n3,{ref:s,which:`ring`}),e.map((e,n)=>(0,R.jsxs)(m.Fragment,{children:[n>0?(0,R.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3.5 shrink-0 sm:w-4`,children:[(0,R.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,R.jsx)(`span`,{ref:e=>{u.current[n-1]=e},"data-tab-liquid":!0,className:`absolute top-0 left-0 h-[2px] w-0 rounded-full bg-tab-liquid shadow-[0_0_6px_var(--tab-liquid)] will-change-transform`})]}):null,(0,R.jsx)(H4,{ref:t=>{l.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function a3({oracleBusy:e,runs:t,activity:n,background:r}){let i=new Set;e&&i.add(`Oracle`);for(let e of t)e.status===`running`&&i.add(SW(EW(e)));for(let e of n)e.pending&&e.source!==`LOBBY`&&i.add(e.source===`MASTER`?`Oracle`:SW(e.source));let a=r.filter(e=>e.alive&&e.busy).length;return a&&i.add(a===1?`1 in the background`:`${a} in the background`),[...i]}function o3(e){return e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function s3(...e){let t=e.filter(e=>!!e);if(!t.length)return;let n=Math.max(...t.map(e=>e.left)),r=Math.max(...t.map(e=>e.top)),i=Math.min(...t.map(e=>e.left+e.width)),a=Math.min(...t.map(e=>e.top+e.height));return i>n&&a>r?{left:n,top:r,width:i-n,height:a-r}:void 0}function c3(e,t){return s3(e,{left:e.left,top:e.top,width:e.width,height:Math.max(0,t-e.top)})}var l3=6,u3=`bot-lobby.orb`,d3=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function f3(e,t,n,r){let i=e=>e+l3,a=(e,t)=>Math.max(e+l3,e+t-r-l3);return{x:Math.min(a(n.left,n.width),Math.max(i(n.left),e)),y:Math.min(a(n.top,n.height),Math.max(i(n.top),t))}}function p3(e,t,n,r){let i=e=>Math.max(1,e-r),a=f3(e,t,n,r);return{fx:Math.min(1,Math.max(0,(a.x-n.left)/i(n.width))),fy:Math.min(1,Math.max(0,(a.y-n.top)/i(n.height)))}}function m3(e,t,n){return f3(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function h3(e){if(e)try{let t=JSON.parse(e);return d3(t.fx)&&d3(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function g3(){try{return h3(localStorage.getItem(u3))}catch{return}}function _3(e){try{localStorage.setItem(u3,JSON.stringify(e))}catch{}}var v3=5,y3=16,b3={fx:1,fy:1};function x3(e){return{left:e.left,top:e.top,width:e.width,height:e.height}}function S3(e){let t=document.getElementById(`main`)?.getBoundingClientRect();if(!t)return;if(!e)return x3(t);let n=window.visualViewport,r=x3({left:n?.offsetLeft??0,top:n?.offsetTop??0,width:n?.width??window.innerWidth,height:n?.height??window.innerHeight}),i=s3(x3(t),r);if(!i)return;let a=document.getElementById(`app-dock`)?.getBoundingClientRect().top;return a===void 0?i:c3(i,a)}function C3(e,t){return!e||!t?e===t:e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function w3(e){let[t,n]=(0,m.useState)(()=>S3(e));return(0,m.useEffect)(()=>{let t=()=>{let t=S3(e);n(e=>C3(e,t)?e:t)},r=document.getElementById(`main`),i=document.getElementById(`app-dock`),a=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);r&&a?.observe(r),i&&a?.observe(i);let o=window.visualViewport;return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),o?.addEventListener(`resize`,t),o?.addEventListener(`scroll`,t),t(),()=>{a?.disconnect(),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t),o?.removeEventListener(`resize`,t),o?.removeEventListener(`scroll`,t)}},[e]),t}var T3=(0,m.forwardRef)(function({spotlight:e,thinking:t,busy:n=[],tone:r,expanded:i,hidden:a,shortcut:o,onOpen:s},c){let l=cA(`(max-width: 767.98px)`),u=w3(l),[d,f]=(0,m.useState)(g3),[p,h]=(0,m.useState)(),[g,_]=(0,m.useState)(!1),v=(0,m.useRef)(void 0),y=(0,m.useRef)(!1),b=(0,m.useRef)(44),x=d??(l?b3:void 0),S=p??(x&&u?m3(x,u,b.current):void 0),C=(0,m.useCallback)((e,t)=>{let n=S3(l);if(!n)return;let r=p3(e,t,n,b.current);f(r),_3(r)},[l]);(0,m.useEffect)(()=>{u&&h(e=>e&&f3(e.x,e.y,u,b.current))},[u]);function w(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();b.current=t.width,v.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function T(e){let t=v.current;if(!t||t.id!==e.pointerId)return;let n=e.clientX-t.sx,r=e.clientY-t.sy;if(!t.moved&&Math.hypot(n,r)<v3)return;t.moved=!0;let i=S3(l);i&&h(f3(t.ox+n,t.oy+r,i,b.current))}function E(e){let t=v.current;v.current=void 0,t?.moved&&(y.current=!0,C(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),h(void 0))}function D(e){let t=e.shiftKey?64:y3,n={ArrowLeft:[-t,0],ArrowRight:[t,0],ArrowUp:[0,-t],ArrowDown:[0,t]}[e.key];if(!n||e.altKey||e.ctrlKey||e.metaKey)return;e.preventDefault();let r=e.currentTarget.getBoundingClientRect();b.current=r.width,C(r.left+n[0],r.top+n[1])}let O=!e&&n.length>0,k=e?SW(e):O?o3(n):void 0,A=e?`${t.map(SW).join(`, `)} thinking. `:O?`${n.join(`, `)} at work. `:``,ee=S&&u?S.x-u.left<140:!1,j={"--orb":r,...S?{left:S.x,top:S.y,right:`auto`,bottom:`auto`}:{}};return(0,R.jsxs)(Cj,{open:g&&!p,onOpenChange:_,children:[(0,R.jsx)(wj,{asChild:!0,children:(0,R.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${A}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":i,"aria-keyshortcuts":o?`${o} Enter Space`:`Enter Space`,onClick:e=>{if(y.current){y.current=!1,e.preventDefault();return}s()},onPointerDown:w,onPointerMove:T,onPointerUp:E,onPointerCancel:()=>{v.current=void 0,h(void 0)},onKeyDown:D,style:j,"data-thinking":e?``:void 0,"data-busy":O?``:void 0,"data-dragging":p?``:void 0,"data-placed":S?``:void 0,"data-flip":ee||void 0,className:q(`thinking-bubble fixed z-20 touch-none rounded-full outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40`,a&&`invisible`),children:[(0,R.jsx)(Du,{initial:!1,children:k?(0,R.jsx)(B.span,{className:`orb-label`,initial:{opacity:0,x:ee?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:ee?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,R.jsx)(Du,{mode:`popLayout`,initial:!1,children:(0,R.jsx)(B.span,{className:`inline-flex items-center gap-1`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:k},k)})},`label`):null}),(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,R.jsx)(`span`,{className:`orb-icon`,children:(0,R.jsx)(bW,{source:e,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,R.jsxs)(Tj,{side:`top`,children:[`Thinking `,!l&&o?(0,R.jsx)(rA,{chord:o}):null,(0,R.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),E3=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,D3=260,O3=200,k3=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function A3(e){let t=[],n=[],r=!1;for(let i of e){if(/^\s*(```|~~~)/.test(i)&&(r=!r),!r&&!i.trim()){n.length&&t.push(n.join(`
104
105
  `).trim()),n=[];continue}n.push(i)}return n.length&&t.push(n.join(`
105
- `).trim()),t.filter(Boolean)}function _3(e){let t=e.split(/(?<=[.!?…])\s+(?=[A-Z"'“‘`(\[])/),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&(t.split("`").length-1)%2==1?n[n.length-1]=`${t} ${e}`:n.push(e)}return n}function v3(e){if(e.length<=p3||h3.test(e))return[e];let t=[],n=``;for(let r of _3(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>m3?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function y3(e){let t=e.replace(/\r\n?/g,`
106
+ `).trim()),t.filter(Boolean)}function j3(e){let t=e.split(/(?<=[.!?…])\s+(?=[A-Z"'“‘`(\[])/),n=[];for(let e of t){let t=n.at(-1);t!==void 0&&(t.split("`").length-1)%2==1?n[n.length-1]=`${t} ${e}`:n.push(e)}return n}function M3(e){if(e.length<=D3||k3.test(e))return[e];let t=[],n=``;for(let r of j3(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>O3?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function N3(e){let t=e.replace(/\r\n?/g,`
106
107
  `).trim().split(`
107
- `),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:f3.exec(e),i=t?(t[1]??t[2]??t[3])?.trim():void 0;i?n.push({title:i,lines:[]}):n.at(-1).lines.push(e)}let i=[];for(let e of n){let t=g3(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
108
+ `),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:E3.exec(e),i=t?(t[1]??t[2]??t[3])?.trim():void 0;i?n.push({title:i,lines:[]}):n.at(-1).lines.push(e)}let i=[];for(let e of n){let t=A3(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
108
109
 
109
- `)});else for(let e of t)for(let t of v3(e))i.push({text:t})}return i}var b3=4,x3=1800,S3=e=>({"--orb":e});function C3(e){let[t,n]=(0,m.useState)(0),r=e.join(`|`);return(0,m.useEffect)(()=>{if(n(0),e.length<2)return;let t=window.setInterval(()=>n(e=>e+1),x3);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function w3({thought:e}){let t=(0,m.useMemo)(()=>y3(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-b3),a=t.slice(i),o=SW(e.source);return(0,R.jsxs)(`li`,{className:`thought`,style:S3(TW(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`thought-label`,children:[(0,R.jsx)(bW,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,R.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):dM(Date.now()-e.at)}),t.length>1?(0,R.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,R.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,R.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,R.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,R.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,R.jsx)(WH,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function T3(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||e.isComposing||!t0(e,t)||e.target?.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),n())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function E3(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function D3({thoughts:e,collapsed:t,onToggle:n,shortcut:r,busy:i=[]}){let a=E3(OW(e)),o=a.filter(e=>e.live).map(e=>e.source),s=C3(o),c=s?TW(s):i.length?`var(--primary)`:`var(--orb-idle)`,l=s?`thinking`:i.length?`busy`:void 0,u=(0,m.useRef)(null),d=(0,m.useRef)(t);d.current=t,(0,m.useEffect)(()=>()=>{d.current||n()},[n]);let f=XA(!t,YA.sheet),p=QA();T3(f,r,n);let h=a.length>0||i.length>0;return(0,R.jsxs)(R.Fragment,{children:[h&&(0,Hv.createPortal)((0,R.jsx)(d3,{ref:u,spotlight:s,thinking:o,busy:i,tone:c,expanded:!t,hidden:p,shortcut:r,onOpen:n}),document.body),(0,R.jsxs)(HA,{open:f,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:q(`thought-pane max-w-xl`,l&&`thought-pane-live`),style:S3(c),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||u.current?.focus()})},children:[(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-working":l}),(0,R.jsx)(`div`,{className:`relative min-h-0 overflow-y-auto p-3 outline-none sm:p-4`,role:`log`,"aria-label":`Latest thoughts`,tabIndex:0,children:a.length?(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(e=>(0,R.jsx)(w3,{thought:e},e.id))}):(0,R.jsx)(`p`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`Thoughts from the oracle and every agent appear here, and only here.`})})]})]})}var O3=`(max-width: 767.98px)`,k3=32;function A3(e){e.style.removeProperty(`max-height`),e.removeAttribute(`data-phone-fit`);let t=e.querySelector(`[role='log'][data-phone-fit]`);t&&(t.style.removeProperty(`min-height`),t.style.removeProperty(`overflow-y`),t.removeAttribute(`data-phone-fit`))}function j3(){let e=document.querySelector(`.thought-pane`);if(!e)return;if(!window.matchMedia(O3).matches){A3(e);return}let t=window.visualViewport,n=t?.offsetTop??0,r=n+(t?.height??window.innerHeight),i=document.getElementById(`app-dock`)?.getBoundingClientRect().top??r;e.style.maxHeight=`${Math.max(0,Math.min(r,i)-n-k3)}px`,e.dataset.phoneFit=``;let a=e.querySelector(`[role='log']`);a&&(a.style.minHeight=`0`,a.style.overflowY=`auto`,a.dataset.phoneFit=``)}function M3(e){(0,m.useEffect)(()=>{if(!e)return;let t=()=>j3(),n=typeof MutationObserver>`u`?void 0:new MutationObserver(t);n?.observe(document.body,{childList:!0,subtree:!0});let r=document.getElementById(`app-dock`),i=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);r&&i?.observe(r);let a=window.visualViewport;return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),a?.addEventListener(`resize`,t),t(),()=>{n?.disconnect(),i?.disconnect(),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t),a?.removeEventListener(`resize`,t),document.querySelectorAll(`.thought-pane[data-phone-fit]`).forEach(A3)}},[e])}function N3({status:e,lobby:t}){M3(!!(e&&e.panels?.thinking!==!1));let[n,r]=WK(`lobby.thinking`),i=xj(`sessions.list`,{},[`sessions`]);if(!e||e.panels?.thinking===!1)return null;let a=G4({oracleBusy:e.busy,runs:DW(t),activity:t?.activity??[],background:i.data?.background??[]}),o=e.keys.find(e=>e.action===`thinking`)?.label;return(0,R.jsx)(D3,{thoughts:t?.thoughts??[],collapsed:n,onToggle:r,shortcut:o,busy:a})}var P3=/\s*\(recommended\)\s*$/i,F3=1200,I3=`Type something.`,L3=`(max-width: 767.98px)`,R3=`max-md:hidden`;function z3(e){return{text:e.replace(P3,``),recommended:P3.test(e)}}function B3({label:e}){let{text:t,recommended:n}=z3(e);return(0,R.jsxs)(`span`,{className:`leading-snug break-words`,children:[t,n?(0,R.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function V3({multi:e,on:t}){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:q(`relative mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e?`rounded-lg`:`rounded-full`,t?`border-primary bg-primary text-primary-foreground`:`border-input`),children:[t?(0,R.jsx)(Vp,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function H3({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsxs)(`label`,{className:q(`flex min-h-9 cursor-pointer items-start gap-2.5 rounded-lg border px-3 py-2 text-start text-sm transition-[background-color,border-color,transform] duration-150 ease-snap active:scale-[0.99] max-md:min-h-11`,i?`border-primary/50 bg-accent`:`border-input bg-background hover:bg-accent/60`,`has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/30`),children:[(0,R.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,R.jsx)(V3,{multi:n,on:i}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,R.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,R.jsx)(B3,{label:e.label})]})})]}),e.description?(0,R.jsx)(WH,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function U3({option:e,onExpand:t}){let n=cA(L3);return!e||!$X(e)?null:(0,R.jsxs)(`div`,{className:`card-raised flex min-w-0 max-w-full flex-col gap-2 rounded-lg border p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`p`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:[`Preview · `,z3(e.label).text]}),(0,R.jsxs)(Y,{type:`button`,variant:`ghost`,size:`xs`,onClick:t,"aria-keyshortcuts":`E`,title:n?`Expand mockup`:`Expand · E`,className:`-my-1 shrink-0 max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:[(0,R.jsx)(ah,{"aria-hidden":`true`}),`Expand`]})]}),e.image?(0,R.jsx)(`img`,{src:F(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,R.jsx)(qX,{preview:e.htmlPreview,label:z3(e.label).text,frameWidth:F3,onOpen:t,className:`h-auto aspect-[3/2]`}):null,e.preview?(0,R.jsx)(WH,{text:e.preview,className:`text-xs`}):null]})}function W3({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,onClick:i,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Cancel`}),(0,R.jsx)(Y,{type:e,disabled:n||r,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:r?`Sending…`:t})]})}function G3(e,t,n,r){let i=e[r];if(!i)return;let a=n[r]?.trim();if(a)return{questionIndex:r,question:i.question,kind:`custom`,answer:a};let o=(t[r]??[]).map(e=>i.options[e]?.label).filter(e=>!!e);if(o.length!==0)return i.multiSelect?{questionIndex:r,question:i.question,kind:`multi`,answer:o.join(`, `),selected:o}:{questionIndex:r,question:i.question,kind:`option`,answer:o[0]??null}}function K3({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:e.map((e,a)=>{let o=!!n[a]?.trim()||(t[a]?.length??0)>0;return(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to open this question.`,type:`button`,onClick:()=>i(a),"aria-current":a===r,className:q(`inline-flex min-h-8 min-w-0 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-start`,children:[a+1,` `,e.header]}),o?(0,R.jsx)(Vp,{className:`size-3 shrink-0`,"aria-hidden":`true`}):null]},a)})})}function q3({questions:e,submitting:t,onAnswer:n,onCancel:r,expanded:i,onExpand:a}){let[o,s]=(0,m.useState)(0),[c,l]=(0,m.useState)(!1),u=i??c,d=e=>a?a(e):l(e),[f,p]=(0,m.useState)(0),h=(0,m.useRef)(0),g=(0,m.useRef)(!1),[_,v]=(0,m.useState)({}),[y,b]=(0,m.useState)({}),[x,S]=(0,m.useState)({}),C=(0,m.useRef)(null),w=e[o],T=_[o]??[],E=y[o]??``,D=w?.options[x[o]??T[0]??0],O=G3(e,_,y,o),k=w?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=C.current;e&&(e.querySelector(`[data-option="${_[o]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[o]),(0,m.useEffect)(()=>{let e=g.current&&!u;g.current=u,e&&(S(e=>({...e,[o]:h.current})),C.current?.querySelector(`[data-option="${h.current}"]`)?.focus())},[u]),!w)return null;let A=w.options.some($X);function ee(e){p(Math.max(0,e)),h.current=Math.max(0,e),d(!0)}function j(e){h.current=e,d(!1)}if(u&&A)return(0,R.jsx)(tZ,{options:w.options,start:f,title:w.header||w.question,picked:T,multi:k,onChoose:e=>{M(e),k||j(e)},onClose:j,onIndex:e=>{h.current=e}},o);function M(e){let t=k?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e];v({..._,[o]:t}),k||b({...y,[o]:``}),S({...x,[o]:e})}function te(t,r){if(G3(e,t,r,o)){if(o<e.length-1){s(o+1);return}n({answers:e.map((n,i)=>G3(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function ne(e){e.preventDefault(),t||te(_,y)}function N(t){t>=0&&t<e.length&&s(t)}function re(e){let n=e.target,r=C.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||te(_,y);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||te(_,y)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),Dj(r,n,-1));return}let i=kj(e.key);if(i){e.preventDefault(),Dj(r,n,i);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),Dj(r,n,e.key===`Home`?`first`:`last`);return}let a=Aj(e.key);if(a&&!(n instanceof HTMLButtonElement)){e.preventDefault(),N(o+a);return}let s=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&s>=0){if(e.preventDefault(),k)T.length>0&&T.includes(s)?te(_,y):M(s);else{let e={..._,[o]:[s]},t={...y,[o]:``};v(e),b(t),te(e,t)}return}if(e.key===` `&&s>=0){e.preventDefault(),M(s);return}let c=Number(e.key);if(Number.isInteger(c)&&c>=1&&c<=w.options.length){e.preventDefault(),M(c-1),r.querySelector(`[data-option="${c-1}"]`)?.focus();return}e.key.toLowerCase()===`e`&&A&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),ee(s>=0?s:x[o]??T[0]??0))}return(0,R.jsxs)(`form`,{ref:C,className:`flex min-w-0 flex-col gap-3`,onSubmit:ne,onKeyDown:re,children:[(0,R.jsx)(K3,{questions:e,picks:_,own:y,index:o,onGo:s}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${o+1} of ${e.length}`:`Question`}),(0,R.jsx)(WH,{text:w.question,className:`mt-1 text-base`})]}),(0,R.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,D?.preview||D?.image||D?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[w.options.map((e,t)=>(0,R.jsx)(H3,{option:e,index:t,multi:k,name:`question-${o}`,selected:T.includes(t),onToggle:()=>M(t),onFocusOption:()=>S({...x,[o]:t})},t)),(0,R.jsxs)(`label`,{className:`flex min-h-9 min-w-0 flex-col gap-1 rounded-lg border border-input px-3 py-1.5 text-sm focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/30 max-md:min-h-11`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your own answer`}),(0,R.jsx)(sM,{"data-nav":``,value:E,onChange:e=>{b({...y,[o]:e.target.value}),e.target.value&&v({..._,[o]:[]})},placeholder:I3,"aria-label":`Your own answer`,rows:2,className:`min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0 md:text-sm max-md:min-h-11`})]})]}),(0,R.jsx)(U3,{option:D,onExpand:()=>ee(w.options.indexOf(D))})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:k?`Pick several`:`Pick one`}),(0,R.jsx)(iA,{chord:`↑↓`,className:R3,children:`move`}),(0,R.jsx)(iA,{chord:k?`Space`:`Enter`,className:R3,children:k?`pick`:`choose`}),k?(0,R.jsx)(iA,{chord:`Enter`,className:R3,children:`next`}):null,e.length>1?(0,R.jsx)(iA,{chord:`←→`,className:R3,children:`question`}):null,A?(0,R.jsx)(iA,{chord:`E`,className:R3,children:`expand mockups`}):null,(0,R.jsx)(iA,{chord:`Esc`,className:R3,children:`later`})]}),(0,R.jsx)(W3,{primary:`submit`,primaryLabel:o<e.length-1?`Next`:`Answer`,disabled:!O,submitting:t,onCancel:r})]})}function J3(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||Oj(i))return;let a=kj(e.key);if(a){e.preventDefault(),Dj(r,i,a);return}let o=i instanceof HTMLInputElement&&i.dataset.option!==void 0?Number(i.dataset.option):-1;if((e.key===`Enter`||e.key===` `)&&o>=0){e.preventDefault(),n(o,e.key===`Enter`);return}let s=Number(e.key);Number.isInteger(s)&&s>=1&&s<=t&&(e.preventDefault(),n(s-1,!1),r.querySelector(`[data-option="${s-1}"]`)?.focus())}function Y3({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{o.current?.querySelector(`[data-nav]`)?.focus()},[]),(0,R.jsxs)(`form`,{ref:o,className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>J3(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,R.jsx)(WH,{text:e.title,className:`text-base`}),(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,R.jsx)(H3,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`↑↓`,className:R3,children:`move`}),(0,R.jsx)(iA,{chord:`Enter`,className:R3,children:`choose`}),(0,R.jsx)(iA,{chord:`Esc`,className:R3,children:`later`})]}),(0,R.jsx)(W3,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function X3({view:e,submitting:t,onAnswer:n}){let r=(0,m.useRef)(null);(0,m.useEffect)(()=>r.current?.focus(),[]);function i(e){if(e.altKey||e.ctrlKey||e.metaKey||t)return;let r=e.key.toLowerCase();r===`y`?n(!0):r===`n`&&n(!1)}return(0,R.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex min-w-0 flex-col gap-3 outline-none`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(WH,{text:e.question,className:`text-base`}),e.detail?(0,R.jsx)(WH,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`Y`,className:R3,children:`yes`}),(0,R.jsx)(iA,{chord:`N`,className:R3,children:`no`}),(0,R.jsx)(iA,{chord:`Esc`,className:R3,children:`later`})]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`No`}),(0,R.jsx)(Y,{type:`button`,disabled:t,onClick:()=>n(!0),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Yes`})]})]})]})}function Z3({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,R.jsx)(WH,{text:e.question,className:`text-base`}),(0,R.jsx)(sM,{autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},value:i,onChange:e=>a(e.target.value),placeholder:e.placeholder??I3,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm max-md:min-h-11`}),(0,R.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`Enter`,className:R3,children:`answer`}),(0,R.jsx)(iA,{chord:`Shift+Enter`,className:R3,children:`new line`}),(0,R.jsx)(iA,{chord:`Esc`,className:R3,children:`later`})]}),(0,R.jsx)(W3,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function Q3({dialog:e,submitting:t,onAnswer:n}){let[r,i]=(0,m.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,m.useState)(``),s=e.options??[],c=e.method===`select`?a!==``:r.trim()!==``,l=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current?.querySelector(`[data-nav], textarea`)?.focus()},[]);function u(t){t.preventDefault(),e.method===`select`?n({value:a}):e.method===`confirm`?n({confirmed:!0}):(e.method===`input`||e.method===`editor`)&&n({value:r.trim()})}return(0,R.jsxs)(`form`,{ref:l,className:`flex min-w-0 flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&J3(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,R.jsx)(WH,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,R.jsx)(H3,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,R.jsx)(sM,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??I3,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm max-md:min-h-11`}):null,(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Cancel`}),e.method===`confirm`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`No`}),(0,R.jsx)(Y,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Yes`})]}):(0,R.jsx)(Y,{type:`submit`,disabled:!c||t,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Answer`})]})]})}function $3(e){let{view:t}=e;return t.kind===`questionnaire`?(0,R.jsx)(q3,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel,...e.onExpand?{expanded:e.expanded??!1,onExpand:e.onExpand}:{}}):t.kind===`choose`?(0,R.jsx)(Y3,{...e,view:t}):t.kind===`confirm`?(0,R.jsx)(X3,{...e,view:t}):t.kind===`text`?(0,R.jsx)(Z3,{...e,view:t}):(0,R.jsx)(Q3,{...e,dialog:t.dialog})}function e6(e){return typeof e==`object`&&e?e:{}}function t6(e){return typeof e==`string`?e.trim():``}function n6(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function r6(e){let t=e6(e),n=t6(t.label);if(!n)return;let r=t6(t.description),i=t6(t.preview),a=t6(t.image),o=HX(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function i6(e){let t=e6(e),n=t6(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(r6).filter(e=>!!e);return{question:n,header:t6(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function a6(e){let t=e6(e),n=t6(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=t6(t.message),i=n6(t.options),a=t6(t.placeholder),o=t6(t.prefill);return{id:t6(t.id),method:n,title:t6(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function o6(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(i6).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function s6(e){return{kind:`choose`,title:t6(e.title)||`Choose an option`,options:n6(e.options)}}function c6(e){let t=t6(e.question)||t6(e.title)||`Continue?`,n=t6(e.detail)||t6(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function l6(e){let t=t6(e.question)||t6(e.title)||`Type an answer`,n=t6(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function u6(e){let t=e6(e.payload);if(e.kind===`questionnaire`)return o6(t);if(e.kind===`choose`)return s6(t);if(e.kind===`confirm`)return c6(t);if(e.kind===`text`)return l6(t);let n=a6(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}var d6=`(max-width: 767.98px)`;function f6({submitting:e,onKeep:t,onLeave:n}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,R.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,onClick:t,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Keep answering`}),(0,R.jsx)(Y,{type:`button`,disabled:e,onClick:n,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:e?`Leaving…`:`Leave`})]})]})}function p6({count:e,onOpen:t}){return(0,R.jsxs)(Y,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:[(0,R.jsx)(lm,{"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,R.jsx)(`span`,{className:`hidden md:inline`,children:`waiting`})]})}function m6({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),d=cA(d6),{keyboardOpen:f,keyboardInset:p}=BA(),h=e.length,g=e[0],_=g?u6(g):void 0,v=h>0&&!r,y=XA(v,YA.question);(0,m.useEffect)(()=>{h===0&&(o(!1),i(!1))},[h,i]);let b=g?.id;(0,m.useEffect)(()=>u(!1),[b]);async function x(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Ce&&e.code===`question_withdrawn`?H(ej):H.error(e instanceof Error?e.message:t)}finally{c(!1)}}let S=g?.from?`${g.from} asks`:`A question`;return(0,R.jsx)(HA,{open:v&&y&&!!g,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(l?u(!1):a?o(!1):i(!0))},style:d&&f?{maxHeight:`calc(100vh - ${p}px - 1.5rem)`}:void 0,className:q(l?`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`:`max-w-3xl`,`max-md:w-[calc(100vw-2rem)] max-md:max-w-[calc(100vw-2rem)] max-md:max-h-[calc(100svh-1.5rem)]`,l&&`max-md:h-[calc(100svh-1.5rem)]`),children:g?(0,R.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`header`,{className:q(`flex items-center gap-3 px-6 pt-5 pb-3 max-md:px-4 max-md:pt-4 max-md:pb-2`,l&&`hidden`),children:[(0,R.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[S,h>1?` · 1 of ${h}`:``]}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:d?`Later`:`Later · Esc`,onClick:()=>i(!0),className:`max-md:size-11`,children:(0,R.jsx)(Vg,{"aria-hidden":`true`})})]}),(0,R.jsx)(`div`,{className:l?`flex min-h-0 min-w-0 flex-1 flex-col`:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain px-6 pb-6 max-md:px-4 max-md:pb-4`,children:_?a?(0,R.jsx)(f6,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void x(n(g.id),`Could not leave the question`)}):(0,R.jsx)($3,{view:_,submitting:s,onAnswer:e=>void x(t(g.id,e),`Could not send the answer`),onCancel:()=>o(!0),expanded:l,onExpand:u},g.id):(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(`p`,{className:`max-md:min-w-0 max-md:flex-1 text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,R.jsx)(Y,{type:`button`,disabled:s,onClick:()=>void x(n(g.id),`Could not dismiss the question`),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Dismiss`})]})})]}):null})}var h6=2;function g6(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function _6(e){try{return JSON.parse(e)}catch{return}}function v6(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function y6(e,t=g6){let n=t(F(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===h6?`offline`:`connecting`),n.onmessage=t=>{let n=_6(t.data);n&&v6(n,e)},()=>n.close()}var b6=2e3,x6=()=>Te(`projects.list`,{});async function S6(){let e;try{e=P()}catch{return}if(e&&!xe(e))try{be((await x6()).projects)}catch{}}function C6(){let e=(0,m.useRef)(void 0),t=(0,m.useRef)(void 0),n=(0,m.useCallback)(()=>{clearTimeout(t.current),e.current?.();try{P()}catch{fe.onStatus({connection:`offline`});return}e.current=y6({onHello:e=>{fe.onHello(e),S6()},onChanged:(e,t)=>fe.onChanged(e,t),onFeed:e=>fe.onFeedDelta(e),onReply:e=>fe.onReplyDelta(e),onNotice:(e,t)=>H[t](e),onConnection:e=>{fe.onStatus({connection:e}),e===`offline`&&(clearTimeout(t.current),t.current=setTimeout(()=>{Se(x6).catch(()=>!1).finally(n)},b6))}})},[]);return(0,m.useEffect)(()=>(n(),()=>{clearTimeout(t.current),e.current?.()}),[n]),n}var w6=`bot-lobby.recoveredAt`,T6;function E6(e,t=D6()){try{T6===void 0&&(T6=Number(t?.getItem(w6)??0))}catch{T6??=0}if(T6!==void 0&&e<=T6)return!1;T6=e;try{t?.setItem(w6,String(e))}catch{}return!0}function D6(){try{return globalThis.sessionStorage}catch{return}}function O6(e){let t=e?.recovered?.at,n=e?.recovered?.text;(0,m.useEffect)(()=>{t!==void 0&&n&&E6(t)&&H.success(n)},[t,n])}function k6(){let e=sA(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await Te(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await Te(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function A6(e,t,n,r){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?aj(`#/settings`):e===`sessions`?aj(`#/sessions`):e===`thinking`?UK(`lobby.thinking`):e===`activity`?t.kind===`tab`&&t.tab===`lobby`?UK(`lobby.activity`):aj(ij(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&U(`planner.save`,{})}var j6=2500;function M6(e){let[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(!1);return e===`live`&&(r.current=!0),(0,m.useEffect)(()=>{if(e!==`connecting`||!r.current)return n(!1);let t=setTimeout(()=>n(!0),j6);return()=>clearTimeout(t)},[e]),e===`offline`||e===`connecting`&&t}function N6({connection:e,onRetry:t}){return M6(e)?(0,R.jsx)(bj,{onRetry:t}):null}var P6={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{P6.route=++P6.tick}),document.addEventListener(`focusin`,()=>{P6.focus=++P6.tick});var F6=()=>P6.focus>P6.route;function I6(e){return e.kind===`tab`?e.tab:e.kind}function L6(){let e=oj(),t=sA(`status`),n=sA(`lobby`),{prompts:r,answer:i,dismiss:a}=k6(),{connection:o,signedOut:s}=oA(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=C6();WJ();let h=t.data;O6(h);let g=!!h&&!s;(0,m.useEffect)(()=>{g&&Ve()},[g]);let _=h?.tabs??[],v=h?.keys??[],y=e.kind===`tab`?e.tab:void 0,b=(0,m.useCallback)(e=>aj(ij(e)),[]),x=(0,R.jsx)(W4,{tabs:_,activeId:y,onSelect:b}),S=cA(`(max-width: 767.98px)`),C=(0,m.useCallback)(e=>{let t=S?_.filter(e=>e.id!==`metrics`):_;if(t.length===0)return;let n=t[(Math.max(0,t.findIndex(e=>e.id===y))+e+t.length)%t.length];n&&aj(ij(n.id))},[_,y,S]),w=(0,m.useCallback)(()=>l(e=>!e),[]),T=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&A6(t,rj(window.location.hash)??e,w,C)},[e,w,C,h?.panels]),E=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||f.current?.contains(e)===!0||e.closest(`.thinking-bubble`)?!0:e.closest(`[data-state='closed']`)!==null},[]);c0({enabled:!!h,keys:v,tabs:_,insideApp:E,onAction:T,onTab:b});let D=(0,m.useCallback)(()=>fe.onHello({}),[]),O=e.kind===`tab`?e.tab:e.kind,k=!!h;(0,m.useEffect)(()=>{if(!k)return;let e=Rj.active&&Rj.to===O;if(Rj.active=!1,Rj.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(F6()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`),t=window.matchMedia(`(max-width: 767.98px)`).matches,n=window.matchMedia(`(pointer: coarse)`).matches;!t&&!n&&e&&!e.disabled?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[O,k]);let A=Object.fromEntries(v.map(e=>[e.action,e.label])),ee=(0,R.jsx)(n2,{status:h,task:n.data?.task,connection:o,route:e,keys:A,onHelp:w,tabs:S?null:x,extra:u&&r.length>0?(0,R.jsx)(p6,{count:r.length,onOpen:()=>d(!1)}):null});return s||!h?(0,R.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[ee,(0,R.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-md:mx-0 max-md:mb-0`,children:s?(0,R.jsx)(i2,{}):t.error?(0,R.jsx)(yj,{message:t.error,onRetry:D}):(0,R.jsx)(vj,{})})]}):(0,R.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[ee,(0,R.jsx)(N6,{connection:o,onRetry:p}),(0,R.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||Oj(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||Lj()&&e.preventDefault()},role:y?`tabpanel`:void 0,"aria-labelledby":y?`tab-${y}`:void 0,className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-md:mx-0 max-md:mb-0`,children:(0,R.jsx)(B.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.2,.8,.2,1]},className:`flex min-h-0 flex-1 flex-col`,children:Y1(e)},I6(e))}),(0,R.jsx)(N0,{route:e,keys:A,onHelp:w,dockNav:S?x:null}),(0,R.jsx)(N3,{status:h,lobby:n.data}),(0,R.jsx)(m6,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,R.jsx)(y0,{open:c,onOpenChange:l,keys:v,tabs:_})]})}async function R6(e){switch(e){case`status`:return Te(`status.get`,{});case`lobby`:return Te(`lobby.snapshot`,{});case`prompts`:return Te(`prompts.list`,{});default:return}}var z6=[`status`,`lobby`,`prompts`];function B6(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await De(),e&&(fe.markUsed(z6,R6),t(!0))})(),()=>{e=!1}},[]),e}function V6(){return B6()?(0,R.jsx)(L6,{}):(0,R.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,R.jsx)(vj,{})})}var H6={info:Gm,success:rm,warning:Tg,error:pm},U6={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function W6(){let{item:e,waiting:t}=ap(),n=QA(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>rp(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,R.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`pointer-events-none fixed inset-x-0 z-40 flex justify-center px-4`,style:{bottom:`calc(var(--composer-h, 0px) + 0.25rem)`},children:(0,R.jsx)(Du,{mode:`wait`,children:r?(0,R.jsxs)(B.div,{initial:{opacity:0,scale:.55,y:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.92,y:6,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,stiffness:560,damping:15,mass:.8},className:`pointer-events-auto flex max-w-[min(32rem,100%)] items-center gap-3 rounded-xl border border-glass-border bg-popover/80 px-4 py-2.5 text-sm text-popover-foreground shadow-glass backdrop-blur-xs`,children:[(0,R.jsx)(G6,{kind:e.kind}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-raised -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border bg-card px-2.5 font-medium text-primary transition-[box-shadow,translate] active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,onClick:()=>{e.action?.onClick(),rp(e.id)},children:e.action.label}):null]},e.id):null})})}function G6({kind:e}){let t=H6[e];return(0,R.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,U6[e])})}(0,Xf.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(m.StrictMode,{children:(0,R.jsx)(_Y,{children:(0,R.jsx)(Pu,{reducedMotion:`user`,children:(0,R.jsxs)(Sj,{children:[(0,R.jsx)(V6,{}),(0,R.jsx)(W6,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});
110
+ `)});else for(let e of t)for(let t of M3(e))i.push({text:t})}return i}var P3=4,F3=1800,I3=e=>({"--orb":e});function L3(e){let[t,n]=(0,m.useState)(0),r=e.join(`|`);return(0,m.useEffect)(()=>{if(n(0),e.length<2)return;let t=window.setInterval(()=>n(e=>e+1),F3);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function R3({thought:e}){let t=(0,m.useMemo)(()=>N3(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-P3),a=t.slice(i),o=SW(e.source);return(0,R.jsxs)(`li`,{className:`thought`,style:I3(TW(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,R.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,R.jsxs)(`span`,{className:`thought-label`,children:[(0,R.jsx)(bW,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,R.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):dM(Date.now()-e.at)}),t.length>1?(0,R.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,R.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,R.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,R.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,R.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,R.jsx)(WH,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function z3(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{e.defaultPrevented||e.isComposing||!a0(e,t)||e.target?.closest(`input, textarea, [contenteditable='true']`)||(e.preventDefault(),n())};return window.addEventListener(`keydown`,r),()=>window.removeEventListener(`keydown`,r)},[e,t,n])}function B3(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at||t.id-e.id)}function V3({thoughts:e,collapsed:t,onToggle:n,shortcut:r,busy:i=[]}){let a=B3(OW(e)),o=a.filter(e=>e.live).map(e=>e.source),s=L3(o),c=s?TW(s):i.length?`var(--primary)`:`var(--orb-idle)`,l=s?`thinking`:i.length?`busy`:void 0,u=(0,m.useRef)(null),d=(0,m.useRef)(t);d.current=t,(0,m.useEffect)(()=>()=>{d.current||n()},[n]);let f=XA(!t,YA.sheet),p=QA();z3(f,r,n);let h=a.length>0||i.length>0;return(0,R.jsxs)(R.Fragment,{children:[h&&(0,Hv.createPortal)((0,R.jsx)(T3,{ref:u,spotlight:s,thinking:o,busy:i,tone:c,expanded:!t,hidden:p,shortcut:r,onOpen:n}),document.body),(0,R.jsxs)(HA,{open:f,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:q(`thought-pane max-w-xl`,l&&`thought-pane-live`),style:I3(c),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||u.current?.focus()})},children:[(0,R.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-working":l}),(0,R.jsx)(`div`,{className:`relative min-h-0 overflow-y-auto p-3 outline-none sm:p-4`,role:`log`,"aria-label":`Latest thoughts`,tabIndex:0,children:a.length?(0,R.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(e=>(0,R.jsx)(R3,{thought:e},e.id))}):(0,R.jsx)(`p`,{className:`px-2 py-6 text-center text-sm text-muted-foreground`,children:`Thoughts from the oracle and every agent appear here, and only here.`})})]})]})}var H3=`(max-width: 767.98px)`,U3=32;function W3(e){e.style.removeProperty(`max-height`),e.removeAttribute(`data-phone-fit`);let t=e.querySelector(`[role='log'][data-phone-fit]`);t&&(t.style.removeProperty(`min-height`),t.style.removeProperty(`overflow-y`),t.removeAttribute(`data-phone-fit`))}function G3(){let e=document.querySelector(`.thought-pane`);if(!e)return;if(!window.matchMedia(H3).matches){W3(e);return}let t=window.visualViewport,n=t?.offsetTop??0,r=n+(t?.height??window.innerHeight),i=document.getElementById(`app-dock`)?.getBoundingClientRect().top??r;e.style.maxHeight=`${Math.max(0,Math.min(r,i)-n-U3)}px`,e.dataset.phoneFit=``;let a=e.querySelector(`[role='log']`);a&&(a.style.minHeight=`0`,a.style.overflowY=`auto`,a.dataset.phoneFit=``)}function K3(e){(0,m.useEffect)(()=>{if(!e)return;let t=()=>G3(),n=typeof MutationObserver>`u`?void 0:new MutationObserver(t);n?.observe(document.body,{childList:!0,subtree:!0});let r=document.getElementById(`app-dock`),i=typeof ResizeObserver>`u`?void 0:new ResizeObserver(t);r&&i?.observe(r);let a=window.visualViewport;return window.addEventListener(`resize`,t),window.addEventListener(`orientationchange`,t),a?.addEventListener(`resize`,t),t(),()=>{n?.disconnect(),i?.disconnect(),window.removeEventListener(`resize`,t),window.removeEventListener(`orientationchange`,t),a?.removeEventListener(`resize`,t),document.querySelectorAll(`.thought-pane[data-phone-fit]`).forEach(W3)}},[e])}function q3({status:e,lobby:t}){K3(!!(e&&e.panels?.thinking!==!1));let[n,r]=HW(`lobby.thinking`),i=xj(`sessions.list`,{},[`sessions`]);if(!e||e.panels?.thinking===!1)return null;let a=a3({oracleBusy:e.busy,runs:DW(t),activity:t?.activity??[],background:i.data?.background??[]}),o=e.keys.find(e=>e.action===`thinking`)?.label;return(0,R.jsx)(V3,{thoughts:t?.thoughts??[],collapsed:n,onToggle:r,shortcut:o,busy:a})}var J3=/\s*\(recommended\)\s*$/i,Y3=1200,X3=`Type something.`,Z3=`(max-width: 767.98px)`,Q3=`max-md:hidden`;function $3(e){return{text:e.replace(J3,``),recommended:J3.test(e)}}function e6({label:e}){let{text:t,recommended:n}=$3(e);return(0,R.jsxs)(`span`,{className:`leading-snug break-words`,children:[t,n?(0,R.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function t6({multi:e,on:t}){return(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:q(`relative mt-0.5 flex size-4 shrink-0 items-center justify-center border`,e?`rounded-lg`:`rounded-full`,t?`border-primary bg-primary text-primary-foreground`:`border-input`),children:[t?(0,R.jsx)(zp,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,R.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function n6({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,R.jsxs)(`div`,{className:`grid gap-1`,children:[(0,R.jsxs)(`label`,{className:q(`flex min-h-9 cursor-pointer items-start gap-2.5 rounded-lg border px-3 py-2 text-start text-sm transition-[background-color,border-color,transform] duration-150 ease-snap active:scale-[0.99] max-md:min-h-11`,i?`border-primary/50 bg-accent`:`border-input bg-background hover:bg-accent/60`,`has-[:focus-visible]:border-ring has-[:focus-visible]:ring-3 has-[:focus-visible]:ring-ring/30`),children:[(0,R.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,R.jsx)(t6,{multi:n,on:i}),(0,R.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,R.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,R.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,R.jsx)(e6,{label:e.label})]})})]}),e.description?(0,R.jsx)(WH,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function r6({option:e,onExpand:t}){let n=cA(Z3);return!e||!sZ(e)?null:(0,R.jsxs)(`div`,{className:`card-raised flex min-w-0 max-w-full flex-col gap-2 rounded-lg border p-3`,children:[(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,R.jsxs)(`p`,{className:`min-w-0 truncate text-xs font-medium text-muted-foreground`,children:[`Preview · `,$3(e.label).text]}),(0,R.jsxs)(Y,{type:`button`,variant:`ghost`,size:`xs`,onClick:t,"aria-keyshortcuts":`E`,title:n?`Expand mockup`:`Expand · E`,className:`-my-1 shrink-0 max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:[(0,R.jsx)(th,{"aria-hidden":`true`}),`Expand`]})]}),e.image?(0,R.jsx)(`img`,{src:F(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,R.jsx)(tZ,{preview:e.htmlPreview,label:$3(e.label).text,frameWidth:Y3,onOpen:t,className:`h-auto aspect-[3/2]`}):null,e.preview?(0,R.jsx)(WH,{text:e.preview,className:`text-xs`}):null]})}function i6({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`ghost`,onClick:i,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Cancel`}),(0,R.jsx)(Y,{type:e,disabled:n||r,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:r?`Sending…`:t})]})}function a6(e,t,n,r){let i=e[r];if(!i)return;let a=n[r]?.trim();if(a)return{questionIndex:r,question:i.question,kind:`custom`,answer:a};let o=(t[r]??[]).map(e=>i.options[e]?.label).filter(e=>!!e);if(o.length!==0)return i.multiSelect?{questionIndex:r,question:i.question,kind:`multi`,answer:o.join(`, `),selected:o}:{questionIndex:r,question:i.question,kind:`option`,answer:o[0]??null}}function o6({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,R.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:e.map((e,a)=>{let o=!!n[a]?.trim()||(t[a]?.length??0)>0;return(0,R.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-description":`When focused, press Enter or Space to open this question.`,type:`button`,onClick:()=>i(a),"aria-current":a===r,className:q(`inline-flex min-h-8 min-w-0 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[(0,R.jsxs)(`span`,{className:`min-w-0 break-words text-start`,children:[a+1,` `,e.header]}),o?(0,R.jsx)(zp,{className:`size-3 shrink-0`,"aria-hidden":`true`}):null]},a)})})}function s6({questions:e,submitting:t,onAnswer:n,onCancel:r,expanded:i,onExpand:a}){let[o,s]=(0,m.useState)(0),[c,l]=(0,m.useState)(!1),u=i??c,d=e=>a?a(e):l(e),[f,p]=(0,m.useState)(0),h=(0,m.useRef)(0),g=(0,m.useRef)(!1),[_,v]=(0,m.useState)({}),[y,b]=(0,m.useState)({}),[x,S]=(0,m.useState)({}),C=(0,m.useRef)(null),w=e[o],T=_[o]??[],E=y[o]??``,D=w?.options[x[o]??T[0]??0],O=a6(e,_,y,o),k=w?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=C.current;e&&(e.querySelector(`[data-option="${_[o]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[o]),(0,m.useEffect)(()=>{let e=g.current&&!u;g.current=u,e&&(S(e=>({...e,[o]:h.current})),C.current?.querySelector(`[data-option="${h.current}"]`)?.focus())},[u]),!w)return null;let A=w.options.some(sZ);function ee(e){p(Math.max(0,e)),h.current=Math.max(0,e),d(!0)}function j(e){h.current=e,d(!1)}if(u&&A)return(0,R.jsx)(lZ,{options:w.options,start:f,title:w.header||w.question,picked:T,multi:k,onChoose:e=>{M(e),k||j(e)},onClose:j,onIndex:e=>{h.current=e}},o);function M(e){let t=k?T.includes(e)?T.filter(t=>t!==e):[...T,e]:[e];v({..._,[o]:t}),k||b({...y,[o]:``}),S({...x,[o]:e})}function te(t,r){if(a6(e,t,r,o)){if(o<e.length-1){s(o+1);return}n({answers:e.map((n,i)=>a6(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function ne(e){e.preventDefault(),t||te(_,y)}function N(t){t>=0&&t<e.length&&s(t)}function re(e){let n=e.target,r=C.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||te(_,y);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||te(_,y)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),Dj(r,n,-1));return}let i=kj(e.key);if(i){e.preventDefault(),Dj(r,n,i);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),Dj(r,n,e.key===`Home`?`first`:`last`);return}let a=Aj(e.key);if(a&&!(n instanceof HTMLButtonElement)){e.preventDefault(),N(o+a);return}let s=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&s>=0){if(e.preventDefault(),k)T.length>0&&T.includes(s)?te(_,y):M(s);else{let e={..._,[o]:[s]},t={...y,[o]:``};v(e),b(t),te(e,t)}return}if(e.key===` `&&s>=0){e.preventDefault(),M(s);return}let c=Number(e.key);if(Number.isInteger(c)&&c>=1&&c<=w.options.length){e.preventDefault(),M(c-1),r.querySelector(`[data-option="${c-1}"]`)?.focus();return}e.key.toLowerCase()===`e`&&A&&!e.ctrlKey&&!e.metaKey&&(e.preventDefault(),ee(s>=0?s:x[o]??T[0]??0))}return(0,R.jsxs)(`form`,{ref:C,className:`flex min-w-0 flex-col gap-3`,onSubmit:ne,onKeyDown:re,children:[(0,R.jsx)(o6,{questions:e,picks:_,own:y,index:o,onGo:s}),(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${o+1} of ${e.length}`:`Question`}),(0,R.jsx)(WH,{text:w.question,className:`mt-1 text-base`})]}),(0,R.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,D?.preview||D?.image||D?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,R.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[w.options.map((e,t)=>(0,R.jsx)(n6,{option:e,index:t,multi:k,name:`question-${o}`,selected:T.includes(t),onToggle:()=>M(t),onFocusOption:()=>S({...x,[o]:t})},t)),(0,R.jsxs)(`label`,{className:`flex min-h-9 min-w-0 flex-col gap-1 rounded-lg border border-input px-3 py-1.5 text-sm focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/30 max-md:min-h-11`,children:[(0,R.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Your own answer`}),(0,R.jsx)(sM,{"data-nav":``,value:E,onChange:e=>{b({...y,[o]:e.target.value}),e.target.value&&v({..._,[o]:[]})},placeholder:X3,"aria-label":`Your own answer`,rows:2,className:`min-h-9 resize-none border-0 bg-transparent p-0 text-sm shadow-none focus-visible:ring-0 md:text-sm max-md:min-h-11`})]})]}),(0,R.jsx)(r6,{option:D,onExpand:()=>ee(w.options.indexOf(D))})]}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(`span`,{children:k?`Pick several`:`Pick one`}),(0,R.jsx)(iA,{chord:`↑↓`,className:Q3,children:`move`}),(0,R.jsx)(iA,{chord:k?`Space`:`Enter`,className:Q3,children:k?`pick`:`choose`}),k?(0,R.jsx)(iA,{chord:`Enter`,className:Q3,children:`next`}):null,e.length>1?(0,R.jsx)(iA,{chord:`←→`,className:Q3,children:`question`}):null,A?(0,R.jsx)(iA,{chord:`E`,className:Q3,children:`expand mockups`}):null,(0,R.jsx)(iA,{chord:`Esc`,className:Q3,children:`later`})]}),(0,R.jsx)(i6,{primary:`submit`,primaryLabel:o<e.length-1?`Next`:`Answer`,disabled:!O,submitting:t,onCancel:r})]})}function c6(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||Oj(i))return;let a=kj(e.key);if(a){e.preventDefault(),Dj(r,i,a);return}let o=i instanceof HTMLInputElement&&i.dataset.option!==void 0?Number(i.dataset.option):-1;if((e.key===`Enter`||e.key===` `)&&o>=0){e.preventDefault(),n(o,e.key===`Enter`);return}let s=Number(e.key);Number.isInteger(s)&&s>=1&&s<=t&&(e.preventDefault(),n(s-1,!1),r.querySelector(`[data-option="${s-1}"]`)?.focus())}function l6({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>{o.current?.querySelector(`[data-nav]`)?.focus()},[]),(0,R.jsxs)(`form`,{ref:o,className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>c6(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,R.jsx)(WH,{text:e.title,className:`text-base`}),(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,R.jsx)(n6,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,R.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`↑↓`,className:Q3,children:`move`}),(0,R.jsx)(iA,{chord:`Enter`,className:Q3,children:`choose`}),(0,R.jsx)(iA,{chord:`Esc`,className:Q3,children:`later`})]}),(0,R.jsx)(i6,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function u6({view:e,submitting:t,onAnswer:n}){let r=(0,m.useRef)(null);(0,m.useEffect)(()=>r.current?.focus(),[]);function i(e){if(e.altKey||e.ctrlKey||e.metaKey||t)return;let r=e.key.toLowerCase();r===`y`?n(!0):r===`n`&&n(!1)}return(0,R.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex min-w-0 flex-col gap-3 outline-none`,children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(WH,{text:e.question,className:`text-base`}),e.detail?(0,R.jsx)(WH,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`Y`,className:Q3,children:`yes`}),(0,R.jsx)(iA,{chord:`N`,className:Q3,children:`no`}),(0,R.jsx)(iA,{chord:`Esc`,className:Q3,children:`later`})]}),(0,R.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`No`}),(0,R.jsx)(Y,{type:`button`,disabled:t,onClick:()=>n(!0),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Yes`})]})]})]})}function d6({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,R.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,R.jsx)(WH,{text:e.question,className:`text-base`}),(0,R.jsx)(sM,{autoFocus:!0,onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},value:i,onChange:e=>a(e.target.value),placeholder:e.placeholder??X3,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm max-md:min-h-11`}),(0,R.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,R.jsx)(iA,{chord:`Enter`,className:Q3,children:`answer`}),(0,R.jsx)(iA,{chord:`Shift+Enter`,className:Q3,children:`new line`}),(0,R.jsx)(iA,{chord:`Esc`,className:Q3,children:`later`})]}),(0,R.jsx)(i6,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function f6({dialog:e,submitting:t,onAnswer:n}){let[r,i]=(0,m.useState)(e.method===`editor`?e.prefill??``:``),[a,o]=(0,m.useState)(``),s=e.options??[],c=e.method===`select`?a!==``:r.trim()!==``,l=(0,m.useRef)(null);(0,m.useEffect)(()=>{l.current?.querySelector(`[data-nav], textarea`)?.focus()},[]);function u(t){t.preventDefault(),e.method===`select`?n({value:a}):e.method===`confirm`?n({confirmed:!0}):(e.method===`input`||e.method===`editor`)&&n({value:r.trim()})}return(0,R.jsxs)(`form`,{ref:l,className:`flex min-w-0 flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&c6(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,R.jsxs)(`div`,{children:[(0,R.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,R.jsx)(WH,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,R.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,R.jsx)(n6,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,R.jsx)(sM,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??X3,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm max-md:min-h-11`}):null,(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Cancel`}),e.method===`confirm`?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`No`}),(0,R.jsx)(Y,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Yes`})]}):(0,R.jsx)(Y,{type:`submit`,disabled:!c||t,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:t?`Sending…`:`Answer`})]})]})}function p6(e){let{view:t}=e;return t.kind===`questionnaire`?(0,R.jsx)(s6,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel,...e.onExpand?{expanded:e.expanded??!1,onExpand:e.onExpand}:{}}):t.kind===`choose`?(0,R.jsx)(l6,{...e,view:t}):t.kind===`confirm`?(0,R.jsx)(u6,{...e,view:t}):t.kind===`text`?(0,R.jsx)(d6,{...e,view:t}):(0,R.jsx)(f6,{...e,dialog:t.dialog})}function m6(e){return typeof e==`object`&&e?e:{}}function h6(e){return typeof e==`string`?e.trim():``}function g6(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function _6(e){let t=m6(e),n=h6(t.label);if(!n)return;let r=h6(t.description),i=h6(t.preview),a=h6(t.image),o=XX(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function v6(e){let t=m6(e),n=h6(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(_6).filter(e=>!!e);return{question:n,header:h6(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function y6(e){let t=m6(e),n=h6(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=h6(t.message),i=g6(t.options),a=h6(t.placeholder),o=h6(t.prefill);return{id:h6(t.id),method:n,title:h6(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function b6(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(v6).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function x6(e){return{kind:`choose`,title:h6(e.title)||`Choose an option`,options:g6(e.options)}}function S6(e){let t=h6(e.question)||h6(e.title)||`Continue?`,n=h6(e.detail)||h6(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function C6(e){let t=h6(e.question)||h6(e.title)||`Type an answer`,n=h6(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function w6(e){let t=m6(e.payload);if(e.kind===`questionnaire`)return b6(t);if(e.kind===`choose`)return x6(t);if(e.kind===`confirm`)return S6(t);if(e.kind===`text`)return C6(t);let n=y6(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}var T6=`(max-width: 767.98px)`;function E6({submitting:e,onKeep:t,onLeave:n}){return(0,R.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,R.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,R.jsxs)(`div`,{className:`flex items-center justify-end gap-2 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(Y,{type:`button`,variant:`outline`,onClick:t,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Keep answering`}),(0,R.jsx)(Y,{type:`button`,disabled:e,onClick:n,className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:e?`Leaving…`:`Leave`})]})]})}function D6({count:e,onOpen:t}){return(0,R.jsxs)(Y,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:[(0,R.jsx)(sm,{"aria-hidden":`true`}),(0,R.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,R.jsx)(`span`,{className:`hidden md:inline`,children:`waiting`})]})}function O6({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),d=cA(T6),{keyboardOpen:f,keyboardInset:p}=BA(),h=e.length,g=e[0],_=g?w6(g):void 0,v=h>0&&!r,y=XA(v,YA.question);(0,m.useEffect)(()=>{h===0&&(o(!1),i(!1))},[h,i]);let b=g?.id;(0,m.useEffect)(()=>u(!1),[b]);async function x(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Ce&&e.code===`question_withdrawn`?H(ej):H.error(e instanceof Error?e.message:t)}finally{c(!1)}}let S=g?.from?`${g.from} asks`:`A question`;return(0,R.jsx)(HA,{open:v&&y&&!!g,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(l?u(!1):a?o(!1):i(!0))},style:d&&f?{maxHeight:`calc(100vh - ${p}px - 1.5rem)`}:void 0,className:q(l?`h-[min(92svh,60rem)] max-h-[min(92svh,60rem)] max-w-6xl`:`max-w-3xl`,`max-md:w-[calc(100vw-2rem)] max-md:max-w-[calc(100vw-2rem)] max-md:max-h-[calc(100svh-1.5rem)]`,l&&`max-md:h-[calc(100svh-1.5rem)]`),children:g?(0,R.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,R.jsxs)(`header`,{className:q(`flex items-center gap-3 px-6 pt-5 pb-3 max-md:px-4 max-md:pt-4 max-md:pb-2`,l&&`hidden`),children:[(0,R.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[S,h>1?` · 1 of ${h}`:``]}),(0,R.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:d?`Later`:`Later · Esc`,onClick:()=>i(!0),className:`max-md:size-11`,children:(0,R.jsx)(Vg,{"aria-hidden":`true`})})]}),(0,R.jsx)(`div`,{className:l?`flex min-h-0 min-w-0 flex-1 flex-col`:`min-h-0 min-w-0 flex-1 overflow-y-auto overscroll-contain px-6 pb-6 max-md:px-4 max-md:pb-4`,children:_?a?(0,R.jsx)(E6,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void x(n(g.id),`Could not leave the question`)}):(0,R.jsx)(p6,{view:_,submitting:s,onAnswer:e=>void x(t(g.id,e),`Could not send the answer`),onCancel:()=>o(!0),expanded:l,onExpand:u},g.id):(0,R.jsxs)(`div`,{className:`flex items-center justify-between gap-3 max-md:flex-wrap max-md:justify-start`,children:[(0,R.jsx)(`p`,{className:`max-md:min-w-0 max-md:flex-1 text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,R.jsx)(Y,{type:`button`,disabled:s,onClick:()=>void x(n(g.id),`Could not dismiss the question`),className:`max-md:h-auto max-md:min-h-11 max-md:min-w-11 max-md:whitespace-normal`,children:`Dismiss`})]})})]}):null})}var k6=2;function A6(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function j6(e){try{return JSON.parse(e)}catch{return}}function M6(e,t){switch(e.type){case`hello`:t.onHello?.(e.versions);return;case`changed`:t.onChanged?.(e.topic,e.version);return;case`feed`:t.onFeed?.({activity:e.activity,thoughts:e.thoughts,chat:e.chat});return;case`reply`:t.onReply?.(e.text);return;case`notice`:t.onNotice?.(e.text,e.level)}}function N6(e,t=A6){let n=t(F(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===k6?`offline`:`connecting`),n.onmessage=t=>{let n=j6(t.data);n&&M6(n,e)},()=>n.close()}var P6=2e3,F6=()=>Te(`projects.list`,{});async function I6(){let e;try{e=P()}catch{return}if(e&&!xe(e))try{be((await F6()).projects)}catch{}}function L6(){let e=(0,m.useRef)(void 0),t=(0,m.useRef)(void 0),n=(0,m.useCallback)(()=>{clearTimeout(t.current),e.current?.();try{P()}catch{fe.onStatus({connection:`offline`});return}e.current=N6({onHello:e=>{fe.onHello(e),I6()},onChanged:(e,t)=>fe.onChanged(e,t),onFeed:e=>fe.onFeedDelta(e),onReply:e=>fe.onReplyDelta(e),onNotice:(e,t)=>H[t](e),onConnection:e=>{fe.onStatus({connection:e}),e===`offline`&&(clearTimeout(t.current),t.current=setTimeout(()=>{Se(F6).catch(()=>!1).finally(n)},P6))}})},[]);return(0,m.useEffect)(()=>(n(),()=>{clearTimeout(t.current),e.current?.()}),[n]),n}var R6=`bot-lobby.recoveredAt`,z6;function B6(e,t=V6()){try{z6===void 0&&(z6=Number(t?.getItem(R6)??0))}catch{z6??=0}if(z6!==void 0&&e<=z6)return!1;z6=e;try{t?.setItem(R6,String(e))}catch{}return!0}function V6(){try{return globalThis.sessionStorage}catch{return}}function H6(e){let t=e?.recovered?.at,n=e?.recovered?.text;(0,m.useEffect)(()=>{t!==void 0&&n&&B6(t)&&H.success(n)},[t,n])}function U6(){let e=sA(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await Te(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await Te(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function W6(e,t,n,r,i){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?aj(`#/settings`):e===`thinking`?VW(`lobby.thinking`):e===`sidebar`?i():e===`activity`?t.kind===`tab`&&t.tab===`lobby`?VW(WW):aj(ij(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&U(`planner.save`,{})}var G6=`toolbar-button inline-flex size-8 shrink-0 items-center justify-center rounded-lg border text-foreground transition-[background-color,border-color,translate] duration-150 ease-snap outline-none focus-visible:ring-3 focus-visible:ring-ring/40 active:translate-y-px motion-reduce:active:translate-none`,K6=2500;function q6(e){let[t,n]=(0,m.useState)(!1),r=(0,m.useRef)(!1);return e===`live`&&(r.current=!0),(0,m.useEffect)(()=>{if(e!==`connecting`||!r.current)return n(!1);let t=setTimeout(()=>n(!0),K6);return()=>clearTimeout(t)},[e]),e===`offline`||e===`connecting`&&t}function J6({connection:e,onRetry:t}){return q6(e)?(0,R.jsx)(bj,{onRetry:t}):null}var Y6={tick:0,route:0,focus:0};window.addEventListener(`hashchange`,()=>{Y6.route=++Y6.tick}),document.addEventListener(`focusin`,()=>{Y6.focus=++Y6.tick});var X6=()=>Y6.focus>Y6.route;function Z6(e){return e.kind===`tab`?e.tab:e.kind}function Q6(){let e=oj(),t=sA(`status`),n=sA(`lobby`),{prompts:r,answer:i,dismiss:a}=U6(),{connection:o,signedOut:s}=oA(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=L6();WJ();let h=t.data;H6(h);let g=!!h&&!s;(0,m.useEffect)(()=>{g&&Ve()},[g]);let _=h?.tabs??[],v=h?.keys??[],y=e.kind===`tab`?e.tab:void 0,b=(0,m.useCallback)(e=>aj(ij(e)),[]),x=(0,R.jsx)(i3,{tabs:_,activeId:y,onSelect:b}),S=cA(`(max-width: 767.98px)`),C=(0,m.useCallback)(e=>{let t=S?_.filter(e=>e.id!==`metrics`):_;if(t.length===0)return;let n=t[(Math.max(0,t.findIndex(e=>e.id===y))+e+t.length)%t.length];n&&aj(ij(n.id))},[_,y,S]),w=(0,m.useCallback)(()=>l(e=>!e),[]),T=U0(),[E,D]=(0,m.useState)(!1),O=(0,m.useCallback)(()=>{S&&D(e=>!e)},[S]),k=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&W6(t,rj(window.location.hash)??e,w,C,O)},[e,w,C,O,h?.panels]),A=(0,m.useCallback)(()=>{let e=document.activeElement;return!e||e===document.body||f.current?.contains(e)===!0||e.closest(`.thinking-bubble`)?!0:e.closest(`[data-state='closed']`)!==null},[]);f0({enabled:!!h,keys:v,tabs:_,insideApp:A,onAction:k,onTab:b});let ee=(0,m.useCallback)(()=>fe.onHello({}),[]),j=e.kind===`tab`?e.tab:e.kind,M=!!h;(0,m.useEffect)(()=>{if(!M)return;let e=Rj.active&&Rj.to===j;if(Rj.active=!1,Rj.to=void 0,e)return;let t=requestAnimationFrame(()=>{if(X6()||document.querySelector(`[role='dialog']:not([data-state='closed'])`))return;let e=document.getElementById(`composer-text`),t=window.matchMedia(`(max-width: 767.98px)`).matches,n=window.matchMedia(`(pointer: coarse)`).matches;!t&&!n&&e&&!e.disabled?e.focus({preventScroll:!0}):document.activeElement?.id!==`composer-text`&&document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(t)},[j,M]);let te=Object.fromEntries(v.map(e=>[e.action,e.label])),ne=!!h&&!s,N=h?.workspace.name??`bot-lobby`,re=S?ne?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(g2,{expanded:E,onOpen:()=>D(!0)}),(0,R.jsx)(J0,{look:`bar`,projects:T,tab:j,name:N,branch:h?.branch??h?.workspace.branch})]}):(0,R.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 text-sm font-medium`,children:[(0,R.jsx)(`span`,{"aria-hidden":`true`,className:`project-mark`,children:N.charAt(0).toUpperCase()}),(0,R.jsx)(`span`,{className:`truncate`,children:N})]}):null,ie=(0,R.jsx)(s2,{connection:o,projects:T,lead:re,tabs:S?null:x,extra:u&&r.length>0?(0,R.jsx)(D6,{count:r.length,onOpen:()=>d(!1)}):null,tools:ne?null:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(D0,{className:G6,side:`bottom`}),(0,R.jsx)(E0,{className:G6,side:`bottom`})]})});if(s||!h)return(0,R.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[ie,(0,R.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-md:mx-0 max-md:mb-0`,children:s?(0,R.jsx)(v2,{}):t.error?(0,R.jsx)(yj,{message:t.error,onRetry:ee}):(0,R.jsx)(vj,{})})]});let ae={route:e,keys:te,onHelp:w};return(0,R.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex`,children:[S?null:(0,R.jsx)(m2,{...ae}),(0,R.jsxs)(`div`,{className:`relative flex min-w-0 flex-1 flex-col`,children:[ie,(0,R.jsx)(J6,{connection:o,onRetry:p}),(0,R.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||Oj(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||Lj()&&e.preventDefault()},role:y?`tabpanel`:void 0,"aria-labelledby":y?`tab-${y}`:void 0,className:`surface mr-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-md:mx-0 max-md:mb-0`,children:(0,R.jsx)(B.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.18,ease:[.2,.8,.2,1]},className:`flex min-h-0 flex-1 flex-col`,children:$1(e)},Z6(e))}),(0,R.jsx)(n2,{route:e,keys:te,projects:T,onHelp:w,dockNav:S?x:null})]}),S?(0,R.jsx)(h2,{...ae,open:E,onOpenChange:D}):null,(0,R.jsx)(q3,{status:h,lobby:n.data}),(0,R.jsx)(O6,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,R.jsx)(C0,{open:c,onOpenChange:l,keys:v,tabs:_})]})}async function $6(e){switch(e){case`status`:return Te(`status.get`,{});case`lobby`:return Te(`lobby.snapshot`,{});case`prompts`:return Te(`prompts.list`,{});default:return}}var e8=[`status`,`lobby`,`prompts`];function t8(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await De(),e&&(fe.markUsed(e8,$6),t(!0))})(),()=>{e=!1}},[]),e}function n8(){return t8()?(0,R.jsx)(Q6,{}):(0,R.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,R.jsx)(vj,{})})}var r8={info:Vm,success:tm,warning:Tg,error:dm},i8={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function a8(){let{item:e,waiting:t}=ap(),n=QA(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>rp(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,R.jsx)(`div`,{role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`pointer-events-none fixed z-40 flex justify-center px-4`,style:{bottom:`calc(var(--composer-h, 0px) + 0.25rem)`,left:`var(--composer-x, 0px)`,width:`var(--composer-w, 100%)`},children:(0,R.jsx)(Du,{mode:`wait`,children:r?(0,R.jsxs)(B.div,{initial:{opacity:0,scale:.55,y:18},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.92,y:6,transition:{duration:.14,ease:`easeIn`}},transition:{type:`spring`,stiffness:560,damping:15,mass:.8},className:`pointer-events-auto flex max-w-[min(32rem,100%)] items-center gap-3 rounded-xl border border-glass-border bg-popover/80 px-4 py-2.5 text-sm text-popover-foreground shadow-glass backdrop-blur-xs`,children:[(0,R.jsx)(o8,{kind:e.kind}),(0,R.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,R.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,className:`btn-raised -my-1.5 -mr-1 h-7 shrink-0 rounded-lg border bg-card px-2.5 font-medium text-primary transition-[box-shadow,translate] active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none`,onClick:()=>{e.action?.onClick(),rp(e.id)},children:e.action.label}):null]},e.id):null})})}function o8({kind:e}){let t=r8[e];return(0,R.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,i8[e])})}(0,Xf.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(m.StrictMode,{children:(0,R.jsx)(wY,{children:(0,R.jsx)(Pu,{reducedMotion:`user`,children:(0,R.jsxs)(Sj,{children:[(0,R.jsx)(n8,{}),(0,R.jsx)(a8,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});