@a-t-h-i/bot-lobby 0.6.22 → 0.6.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/webui/dist/assets/index-BWwnNfkg.css +2 -0
- package/webui/dist/assets/{index-Jq_b8Zkn.js → index-Bh8la3EM.js} +38 -38
- package/webui/dist/assets/oracle-CkL__6uz.png +0 -0
- package/webui/dist/build.json +33 -13
- package/webui/dist/index.html +2 -2
- package/webui/dist/assets/index-SjTXGOCP.css +0 -2
|
@@ -15,12 +15,12 @@ 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{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fe(n):``}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe(`Lazy`);case 13:return e.child!==t&&t!==null?Fe(`Suspense Fallback`):Fe(`Suspense`);case 19:return Fe(`SuspenseList`);case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Fe(`Activity`);case 30:return Fe(`ViewTransition`);default:return``}}function ze(e){try{var t=``,n=null;do t+=Re(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 Be=Object.prototype.hasOwnProperty,Ve=t.unstable_scheduleCallback,He=t.unstable_cancelCallback,Ue=t.unstable_shouldYield,We=t.unstable_requestPaint,Ge=t.unstable_now,Ke=t.unstable_getCurrentPriorityLevel,qe=t.unstable_ImmediatePriority,Je=t.unstable_UserBlockingPriority,Ye=t.unstable_NormalPriority,Xe=t.unstable_LowPriority,Ze=t.unstable_IdlePriority,Qe=t.log,$e=t.unstable_setDisableYieldValue,et=null,tt=null;function nt(e){if(typeof Qe==`function`&&$e(e),tt&&typeof tt.setStrictMode==`function`)try{tt.setStrictMode(et,e)}catch{}}var rt=Math.clz32?Math.clz32:ot,it=Math.log,at=Math.LN2;function ot(e){return e>>>=0,e===0?32:31-(it(e)/at|0)|0}var st=256,ct=262144,lt=4194304;function ut(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 dt(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=ut(n))):i=ut(o):i=ut(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ut(n))):i=ut(o)):i=ut(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 ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pt(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-rt(n),i=1<<r;t|=e[r],n&=~i}return t}function mt(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 ht(){var e=lt;return lt<<=1,!(lt&62914560)&&(lt=4194304),e}function gt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function _t(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vt(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-rt(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&&yt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function yt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-rt(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function bt(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-rt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function xt(e,t){var n=t&-t;return n=n&42?1:St(n),(n&(e.suspendedLanes|t))===0?n:0}function St(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 Ct(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function wt(){var e=j.p;return e===0?(e=window.event,e===void 0?32:Nh(e.type)):e}function Tt(e,t){var n=j.p;try{return j.p=e,t()}finally{j.p=n}}var Et=Math.random().toString(36).slice(2),Dt=`__reactFiber$`+Et,Ot=`__reactProps$`+Et,kt=`__reactContainer$`+Et,At=`__reactEvents$`+Et,jt=`__reactListeners$`+Et,Mt=`__reactHandles$`+Et,Nt=`__reactResources$`+Et,Pt=`__reactMarker$`+Et,Ft=`__reactLoad$`+Et;function It(e){delete e[Dt],delete e[Ot],delete e[jt],delete e[Mt]}function Lt(e){var t;if(t=e[Dt])return t;for(var n=e.parentNode;n;){if(t=n[kt]||n[Dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Sm(e);e!==null;){if(n=e[Dt])return n;e=Sm(e)}return t}e=n,n=e.parentNode}return null}function Rt(e){if(e=e[Dt]||e[kt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function M(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function zt(e){var t=e[Nt];return t||=e[Nt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Bt(e){e[Pt]=!0}function Vt(e){e[Ft]=void 0}var Ht=new Set,Ut={};function Wt(e,t){Gt(e,t),Gt(e+`Capture`,t)}function Gt(e,t){for(Ut[e]=t,e=0;e<t.length;e++)Ht.add(t[e])}var Kt=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]*$`),qt={},Jt={};function Yt(e){return Be.call(Jt,e)?!0:Be.call(qt,e)?!1:Kt.test(e)?Jt[e]=!0:(qt[e]=!0,!1)}var Xt=!1;function Zt(){var e=Xt;return Xt=!1,e}function Qt(e,t,n){if(Yt(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 $t(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 en(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 tn(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function nn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function rn(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 an(e){if(!e._valueTracker){var t=nn(e)?`checked`:`value`;e._valueTracker=rn(e,t,``+e[t])}}function on(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=nn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var sn=/[\n"\\]/g;function cn(e){return e.replace(sn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function ln(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=``+tn(t)):e.value!==``+tn(t)&&(e.value=``+tn(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):dn(e,tn(n)):o===`number`&&e.value==t?dn(e,tn(e.value)):dn(e,tn(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=``+tn(s):e.removeAttribute(`name`)}function un(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)){an(e);return}n=n==null?``:``+tn(n),t=t==null?n:``+tn(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),an(e)}function dn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function fn(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=``+tn(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 pn(e,t,n){if(t!=null&&(t=``+tn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+tn(n)}function mn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(ve(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=tn(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),an(e)}function hn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var gn=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 _n(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||gn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function vn(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]=``,Xt=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(_n(e,a,r),Xt=!0)}else for(var o in t)t.hasOwnProperty(o)&&_n(e,o,t[o])}function yn(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 bn=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`]]),xn=/^[\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 Sn(e){return xn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Cn(){}var wn=null;function Tn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var En=null,Dn=null;function On(e){var t=Rt(e);if(t&&(e=t.stateNode)){var n=e[Ot]||null;a:switch(e=t.stateNode,t.type){case`input`:if(ln(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="`+cn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ot]||null;if(!a)throw Error(i(90));ln(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&&on(r)}break a;case`textarea`:pn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&fn(e,!!n.multiple,t,!1)}}}var kn=!1;function An(e,t,n){if(kn)return e(t,n);kn=!0;try{return e(t)}finally{if(kn=!1,(En!==null||Dn!==null)&&(Yd(),En&&(t=En,e=Dn,Dn=En=null,On(t),e)))for(t=0;t<e.length;t++)On(e[t])}}function jn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ot]||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 Mn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Nn=!1;if(Mn)try{var N={};Object.defineProperty(N,"passive",{get:function(){Nn=!0}}),window.addEventListener(`test`,N,N),window.removeEventListener(`test`,N,N)}catch{Nn=!1}var Pn=null,Fn=null,In=null;function Ln(){if(In)return In;var e,t=Fn,n=t.length,r,i=`value`in Pn?Pn.value:Pn.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 In=i.slice(e,1<r?1-r:void 0)}function Rn(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 zn(){return!0}function Bn(){return!1}function Vn(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)?zn:Bn,this.isPropagationStopped=Bn,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=zn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=zn)},persist:function(){},isPersistent:zn}),t}var Hn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Un=Vn(Hn),Wn=T({},Hn,{view:0,detail:0}),Gn=Vn(Wn),Kn,qn,Jn,Yn=T({},Wn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:or,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!==Jn&&(Jn&&e.type===`mousemove`?(Kn=e.screenX-Jn.screenX,qn=e.screenY-Jn.screenY):qn=Kn=0,Jn=e),Kn)},movementY:function(e){return`movementY`in e?e.movementY:qn}}),Xn=Vn(Yn),Zn=Vn(T({},Yn,{dataTransfer:0})),Qn=Vn(T({},Wn,{relatedTarget:0})),$n=Vn(T({},Hn,{animationName:0,elapsedTime:0,pseudoElement:0})),er=Vn(T({},Hn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),tr=Vn(T({},Hn,{data:0})),nr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},rr={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`},ir={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function ar(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=ir[e])?!!t[e]:!1}function or(){return ar}var sr=Vn(T({},Wn,{key:function(e){if(e.key){var t=nr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?rr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:or,charCode:function(e){return e.type===`keypress`?Rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),cr=Vn(T({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),lr=Vn(T({},Hn,{submitter:0})),ur=Vn(T({},Wn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:or})),dr=Vn(T({},Hn,{propertyName:0,elapsedTime:0,pseudoElement:0})),fr=Vn(T({},Yn,{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})),pr=Vn(T({},Hn,{newState:0,oldState:0,source:0})),mr=[9,13,27,32],hr=Mn&&`CompositionEvent`in window,gr=null;Mn&&`documentMode`in document&&(gr=document.documentMode);var _r=Mn&&`TextEvent`in window&&!gr,vr=Mn&&(!hr||gr&&8<gr&&11>=gr),yr=` `,br=!1;function xr(e,t){switch(e){case`keyup`:return mr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Cr=!1;function wr(e,t){switch(e){case`compositionend`:return Sr(t);case`keypress`:return t.which===32?(br=!0,yr):null;case`textInput`:return e=t.data,e===yr&&br?null:e;default:return null}}function Tr(e,t){if(Cr)return e===`compositionend`||!hr&&xr(e,t)?(e=Ln(),In=Fn=Pn=null,Cr=!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 vr&&t.locale!==`ko`?null:t.data;default:return null}}var Er={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 Dr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Er[e.type]:t===`textarea`}function Or(e,t,n,r){En?Dn?Dn.push(r):Dn=[r]:En=r,t=ip(t,`onChange`),0<t.length&&(n=new Un(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var kr=null,Ar=null;function jr(e){Zf(e,0)}function Mr(e){if(on(M(e)))return e}function Nr(e,t){if(e===`change`)return t}var Pr=!1;if(Mn){var Fr;if(Mn){var Ir=`oninput`in document;if(!Ir){var Lr=document.createElement(`div`);Lr.setAttribute(`oninput`,`return;`),Ir=typeof Lr.oninput==`function`}Fr=Ir}else Fr=!1;Pr=Fr&&(!document.documentMode||9<document.documentMode)}function Rr(){kr&&(kr.detachEvent(`onpropertychange`,zr),Ar=kr=null)}function zr(e){if(e.propertyName===`value`&&Mr(Ar)){var t=[];Or(t,Ar,e,Tn(e)),An(jr,t)}}function Br(e,t,n){e===`focusin`?(Rr(),kr=t,Ar=n,kr.attachEvent(`onpropertychange`,zr)):e===`focusout`&&Rr()}function Vr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Mr(Ar)}function Hr(e,t){if(e===`click`)return Mr(t)}function Ur(e,t){if(e===`input`||e===`change`)return Mr(t)}function Wr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Gr=typeof Object.is==`function`?Object.is:Wr;function Kr(e,t){if(Gr(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(!Be.call(t,i)||!Gr(e[i],t[i]))return!1}return!0}function qr(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 Jr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Yr(e,t){var n=Jr(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=Jr(n)}}function Xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Zr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=qr(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=qr(e.document)}return t}function Qr(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 $r=Mn&&`documentMode`in document&&11>=document.documentMode,ei=null,ti=null,ni=null,ri=!1;function ii(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ri||ei==null||ei!==qr(r)||(r=ei,`selectionStart`in r&&Qr(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}),ni&&Kr(ni,r)||(ni=r,r=ip(ti,`onSelect`),0<r.length&&(t=new Un(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ei)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var oi={animationend:ai(`Animation`,`AnimationEnd`),animationiteration:ai(`Animation`,`AnimationIteration`),animationstart:ai(`Animation`,`AnimationStart`),transitionrun:ai(`Transition`,`TransitionRun`),transitionstart:ai(`Transition`,`TransitionStart`),transitioncancel:ai(`Transition`,`TransitionCancel`),transitionend:ai(`Transition`,`TransitionEnd`)},si={},ci={};Mn&&(ci=document.createElement(`div`).style,`AnimationEvent`in window||(delete oi.animationend.animation,delete oi.animationiteration.animation,delete oi.animationstart.animation),`TransitionEvent`in window||delete oi.transitionend.transition);function li(e){if(si[e])return si[e];if(!oi[e])return e;var t=oi[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ci)return si[e]=t[n];return e}var ui=li(`animationend`),di=li(`animationiteration`),fi=li(`animationstart`),pi=li(`transitionrun`),mi=li(`transitionstart`),hi=li(`transitioncancel`),gi=li(`transitionend`),_i=new Map,vi=`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(` `);vi.push(`scrollEnd`);function yi(e,t){_i.set(e,t),Wt(t,[e])}var bi=0;function xi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Ad.identifierPrefix;var n=bi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Si(e){if(e==null||typeof e==`string`)return e;var t=null,n=Rd;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 Ci(e,t){return e=Si(e),t=Si(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var wi=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)},Ti=[],Ei=0,Di=0;function Oi(){for(var e=Ei,t=Di=Ei=0;t<e;){var n=Ti[t];Ti[t++]=null;var r=Ti[t];Ti[t++]=null;var i=Ti[t];Ti[t++]=null;var a=Ti[t];if(Ti[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&&Mi(n,i,a)}}function ki(e,t,n,r){Ti[Ei++]=e,Ti[Ei++]=t,Ti[Ei++]=n,Ti[Ei++]=r,Di|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Ai(e,t,n,r){return ki(e,t,n,r),Ni(e)}function ji(e,t){return ki(e,null,null,t),Ni(e)}function Mi(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-rt(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ni(e){if(50<zd)throw zd=0,Bd=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pi={};function Fi(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 Ii(e,t,n,r){return new Fi(e,t,n,r)}function Li(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ri(e,t){var n=e.alternate;return n===null?(n=Ii(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 zi(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 Bi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)Li(r)&&(s=1);else if(typeof r==`string`)s=rh(e,n,Te.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case le:return e=Ii(31,n,t,a),e.elementType=le,e.lanes=o,e;case te:return Vi(n.children,a,o,t);case ne:s=8,a|=24;break;case re:return e=Ii(12,n,t,a|2),e.elementType=re,e.lanes=o,e;case oe:return e=Ii(13,n,t,a),e.elementType=oe,e.lanes=o,e;case k:return e=Ii(19,n,t,a),e.elementType=k,e.lanes=o,e;case ue:case fe:return e=a|32,e=Ii(30,n,t,e),e.elementType=fe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case O:s=10;break a;case ie:s=9;break a;case ae:s=11;break a;case se:s=14;break a;case ce:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Ii(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Vi(e,t,n,r){return e=Ii(7,e,r,t),e.lanes=n,e}function Hi(e,t,n){return e=Ii(6,e,null,t),e.lanes=n,e}function Ui(e){var t=Ii(18,null,null,0);return t.stateNode=e,t}function Wi(e,t,n){return t=Ii(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gi=new WeakMap;function Ki(e,t){if(typeof e==`object`&&e){var n=Gi.get(e);return n===void 0?(t={value:e,source:t,stack:ze(t)},Gi.set(e,t),t):n}return{value:e,source:t,stack:ze(t)}}var qi=[],Ji=0,Yi=null,Xi=0,Zi=[],Qi=0,$i=null,ea=1,ta=``;function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Yi,Yi=e,Xi=t}function ra(e,t,n){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,$i=e;var r=ea;e=ta;var i=32-rt(r)-1;r&=~(1<<i),n+=1;var a=32-rt(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,ea=1<<32-rt(t)+i|n<<i|r,ta=a+e}else ea=1<<a|n<<i|r,ta=e}function ia(e){e.return!==null&&(na(e,1),ra(e,1,0))}function aa(e){for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null;for(;e===$i;)$i=Zi[--Qi],Zi[Qi]=null,ta=Zi[--Qi],Zi[Qi]=null,ea=Zi[--Qi],Zi[Qi]=null}function oa(e,t){Zi[Qi++]=ea,Zi[Qi++]=ta,Zi[Qi++]=$i,ea=t.id,ta=t.overflow,$i=e}var sa=null,ca=null,P=!1,la=null,ua=!1,da=Error(i(519));function fa(e){throw va(Ki(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),da}function pa(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Dt]=e,t[Ot]=r,n){case`dialog`:H(`cancel`,t),H(`close`,t);break;case`iframe`:case`object`:case`embed`:H(`load`,t);break;case`video`:case`audio`:for(n=0;n<Xf.length;n++)H(Xf[n],t);break;case`source`:H(`error`,t);break;case`img`:case`image`:case`link`:H(`error`,t),H(`load`,t);break;case`details`:H(`toggle`,t);break;case`input`:H(`invalid`,t),un(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:H(`invalid`,t);break;case`textarea`:H(`invalid`,t),mn(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&&(H(`beforetoggle`,t),H(`toggle`,t)),r.onScroll!=null&&H(`scroll`,t),r.onScrollEnd!=null&&H(`scrollend`,t),r.onClick!=null&&(t.onclick=Cn),t=!0):t=!1,t||fa(e,!0)}function ma(e){for(sa=e.return;sa;)switch(sa.tag){case 5:case 31:case 13:ua=!1;return;case 27:case 3:ua=!0;return;default:sa=sa.return}}function ha(e){if(e!==sa)return!1;if(!P)return ma(e),P=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Cp(e.type,e.memoizedProps)),n=!n),n&&ca&&fa(e),ma(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ca=xm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ca=xm(e)}else t===27?(t=ca,Mp(e.type)?(e=bm,bm=null,ca=e):ca=t):ca=sa?ym(e.stateNode.nextSibling):null;return!0}function ga(){ca=sa=null,P=!1}function _a(){var e=la;return e!==null&&(Sd===null?Sd=e:Sd.push.apply(Sd,e),la=null),e}function va(e){la===null?la=[e]:la.push(e)}var ya=Se(null),ba=null,xa=null;function Sa(e,t,n){we(ya,t._currentValue),t._currentValue=n}function Ca(e){e._currentValue=ya.current,Ce(ya)}function wa(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 Ta(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),wa(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),wa(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),wa(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 Ea(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;Gr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Oe.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[_h]:e.push(_h))}a=a.return}return e!==null&&Ta(t,e,n,r),t.flags|=262144,e!==null}function Da(e){for(e=e.firstContext;e!==null;){if(!Gr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Oa(e){ba=e,xa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ka(e){return ja(ba,e)}function Aa(e,t){return ba===null&&Oa(e),ja(e,t)}function ja(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},xa===null){if(e===null)throw Error(i(308));xa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else xa=xa.next=t;return n}var Ma=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()})}},Na=t.unstable_scheduleCallback,Pa=t.unstable_NormalPriority,Fa={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ia(){return{controller:new Ma,data:new Map,refCount:0}}function La(e){e.refCount--,e.refCount===0&&Na(Pa,function(){e.controller.abort()})}function Ra(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 za=null;function Ba(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var Va=null,Ha=0,Ua=0,Wa=null;function Ga(e,t){if(Va===null){var n=Va=[];Ha=0,Ua=Gf(),Wa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ha++,t.then(Ka,Ka),t}function Ka(){if(--Ha===0&&(za=null,Va!==null)){Wa!==null&&(Wa.status=`fulfilled`);var e=Va;Va=null,Ua=0,Wa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function qa(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 Ja=A.S;A.S=function(e,t){if(Td=Ge(),typeof t==`object`&&t&&typeof t.then==`function`&&Ga(e,t),za!==null)for(var n=Mf;n!==null;)Ra(n,za),n=n.next;if(n=e.types,n!==null){for(var r=Mf;r!==null;)Ra(r,n),r=r.next;if(Ua!==0){r=za,r===null&&(r=za=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ja!==null&&Ja(e,t)};var Ya=Se(null);function Xa(){var e=Ya.current;return e===null?cd.pooledCache:e}function Za(e,t){t===null?we(Ya,Ya.current):we(Ya,t.pool)}function Qa(){var e=Xa();return e===null?null:{parent:Fa._currentValue,pool:e}}var $a=Error(i(460)),eo=Error(i(474)),to=Error(i(542)),no={then:function(){}};function ro(e){return e=e.status,e===`fulfilled`||e===`rejected`}function io(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Cn,Cn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,co(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(Cn,Cn);else{if(e=cd,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,co(e),e}throw oo=t,$a}}function ao(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(oo=e,$a):e}}var oo=null;function so(){if(oo===null)throw Error(i(459));var e=oo;return oo=null,e}function co(e){if(e===$a||e===to)throw Error(i(483))}var lo=null,uo=0;function fo(e){var t=uo;return uo+=1,lo===null&&(lo=[]),io(lo,e,t)}function po(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function mo(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 ho(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=Ri(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=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=Hi(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===te?(e=d(e,t,n.props.children,r,n.key),po(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ce&&ao(i)===t.type)?(t=a(t,n.props),po(t,n),t.return=e,t):(t=Bi(n.type,n.key,n.props,null,e.mode,r),po(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=Wi(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=Vi(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=Hi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ee:return n=Bi(t.type,t.key,t.props,null,e.mode,n),po(n,t),n.return=e,n;case D:return t=Wi(t,e.mode,n),t.return=e,t;case ce:return t=ao(t),f(e,t,n)}if(ve(t)||he(t))return t=Vi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,fo(t),n);if(t.$$typeof===O)return f(e,Aa(e,t),n);mo(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 ee:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case ce:return n=ao(n),p(e,t,n,r)}if(ve(n)||he(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,fo(n),r);if(n.$$typeof===O)return p(e,t,Aa(e,n),r);mo(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 ee:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ce:return r=ao(r),m(e,t,n,r,i)}if(ve(r)||he(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,fo(r),i);if(r.$$typeof===O)return m(e,t,n,Aa(t,r),i);mo(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),P&&na(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 P&&na(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)}),P&&na(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),P&&na(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 P&&na(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)}),P&&na(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===te&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ee:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===te){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),po(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&ao(l)===r.type){n(e,r.sibling),c=a(r,o.props),po(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===te?(c=Vi(o.props.children,e.mode,c,o.key),po(c,o),c.return=e,e=c):(c=Bi(o.type,o.key,o.props,null,e.mode,c),po(c,o),c.return=e,e=c)}return s(e);case D: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=Wi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=ao(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(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,fo(o),c);if(o.$$typeof===O)return _(e,r,Aa(e,o),c);mo(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=Hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{uo=0;var i=_(e,t,n,r);return lo=null,i}catch(t){if(t===$a||t===to)throw t;var a=Ii(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var go=ho(!0),_o=ho(!1),vo=!1;function yo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bo(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 xo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function So(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ni(e),Mi(e,null,n),t}return ki(e,r,t,n),Ni(e)}function Co(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,bt(e,n)}}function wo(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 To=!1;function Eo(){if(To){var e=Wa;if(e!==null)throw e}}function Do(e,t,n,r){To=!1;var i=e.updateQueue;vo=!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?(R&f)===f:(r&f)===f){f!==0&&f===Ua&&(To=!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:vo=!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),gd|=o,e.lanes=o,e.memoizedState=d}}function Oo(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ko(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Oo(n[e],t)}var Ao=Se(null),jo=Se(0);function Mo(e,t){e=md,we(jo,e),we(Ao,t),md=e|t.baseLanes}function No(){we(jo,md),we(Ao,Ao.current)}function Po(){md=jo.current,Ce(Ao),Ce(jo)}var Fo=Se(null),Io=null;function Lo(e){var t=e.alternate;we(Ho,Ho.current&1),we(Fo,e),Io===null&&(t===null||Ao.current!==null||t.memoizedState!==null)&&(Io=e)}function Ro(e){we(Ho,Ho.current),we(Fo,e),Io===null&&(Io=e)}function zo(e){e.tag===22?(we(Ho,Ho.current),we(Fo,e),Io===null&&(Io=e)):Bo()}function Bo(){we(Ho,Ho.current),we(Fo,Fo.current)}function Vo(e){Ce(Fo),Io===e&&(Io=null),Ce(Ho)}var Ho=Se(0);function Uo(e,t){we(Fo,Fo.current),we(Ho,t)}function Wo(e){Ce(Ho),Ce(Fo),Io===e&&(Io=null)}function Go(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||gm(n)||_m(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 Ko=0,F=null,qo=null,Jo=null,Yo=!1,Xo=!1,Zo=!1,Qo=0,$o=0,es=null,ts=0;function ns(){throw Error(i(321))}function rs(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Gr(e[n],t[n]))return!1;return!0}function is(e,t,n,r,i,a){return Ko=a,F=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?xc:Sc,Zo=!1,a=n(r,i),Zo=!1,Xo&&(a=os(t,n,r,i)),as(e),a}function as(e){A.H=bc;var t=qo!==null&&qo.next!==null;if(Ko=0,Jo=qo=F=null,Yo=!1,$o=0,es=null,t)throw Error(i(300));e===null||zc||(e=e.dependencies,e!==null&&Da(e)&&(zc=!0))}function os(e,t,n,r){F=e;var a=0;do{if(Xo&&(es=null),$o=0,Xo=!1,25<=a)throw Error(i(301));if(a+=1,Jo=qo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}A.H=Cc,o=t(n,r)}while(Xo);return o}function ss(){var e=A.H,t=e.useState()[0];return t=typeof t.then==`function`?ms(t):t,e=e.useState()[0],(qo===null?null:qo.memoizedState)!==e&&(F.flags|=1024),t}function cs(){var e=Qo!==0;return Qo=0,e}function ls(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function us(e){if(Yo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Yo=!1}Ko=0,Jo=qo=F=null,Xo=!1,$o=Qo=0,es=null}function ds(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Jo===null?F.memoizedState=Jo=e:Jo=Jo.next=e,Jo}function fs(){if(qo===null){var e=F.alternate;e=e===null?null:e.memoizedState}else e=qo.next;var t=Jo===null?F.memoizedState:Jo.next;if(t!==null)Jo=t,qo=e;else{if(e===null)throw F.alternate===null?Error(i(467)):Error(i(310));qo=e,e={memoizedState:qo.memoizedState,baseState:qo.baseState,baseQueue:qo.baseQueue,queue:qo.queue,next:null},Jo===null?F.memoizedState=Jo=e:Jo=Jo.next=e}return Jo}function ps(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ms(e){var t=$o;return $o+=1,es===null&&(es=[]),e=io(es,e,t),t=F,(Jo===null?t.memoizedState:Jo.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?xc:Sc),e}function hs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ms(e);if(e.$$typeof===pe)return;if(e.$$typeof===O)return ka(e)}throw Error(i(438,String(e)))}function gs(e){var t=null,n=F.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=F.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=ps(),F.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]=de;return t.index++,n}function _s(e,t){return typeof t==`function`?t(e):t}function vs(e){return ys(fs(),qo,e)}function ys(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?(Ko&f)===f:(R&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ua&&(d=!0);else if((Ko&p)===p){u=u.next,p===Ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,F.lanes|=p,gd|=p;f=u.action,Zo&&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,F.lanes|=f,gd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Gr(o,e.memoizedState)&&(zc=!0,d&&(n=Wa,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 bs(e){var t=fs(),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);Gr(o,t.memoizedState)||(zc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function xs(e,t,n){var r=F,a=fs(),o=P;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Gr((qo||a).memoizedState,n);if(s&&(a.memoizedState=n,zc=!0),a=a.queue,Ks(ws.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Jo!==null&&!!(Jo.memoizedState.tag&1),Vs(e?9:8,{destroy:void 0},Cs.bind(null,r,a,n,t),null),e){if(r.flags|=2048,cd===null)throw Error(i(349));o||Ko&127||Ss(r,t,n)}return n}function Ss(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=F.updateQueue,t===null?(t=ps(),F.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Cs(e,t,n,r){t.value=n,t.getSnapshot=r,Ts(t)&&Es(e)}function ws(e,t,n){return n(function(){Ts(t)&&Es(e)})}function Ts(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Gr(e,n)}catch{return!0}}function Es(e){var t=ji(e,2);t!==null&&Wd(t,e,2)}function Ds(e){var t=ds();if(typeof e==`function`){var n=e;if(e=n(),Zo){nt(!0);try{n()}finally{nt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:e},t}function Os(e,t,n,r){return e.baseState=n,ys(e,qo,typeof r==`function`?r:_s)}function ks(e,t,n,r,a){if(_c(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)}};A.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,As(t,o)):(o.next=n.next,t.pending=n.next=o)}}function As(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=A.T,o={};o.types=a===null?null:a.types,A.T=o;try{var s=n(i,r),c=A.S;c!==null&&c(o,s),js(e,t,s)}catch(n){Ns(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),A.T=a}}else try{a=n(i,r),js(e,t,a)}catch(n){Ns(e,t,n)}}function js(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ms(e,t,n)},function(n){return Ns(e,t,n)}):Ms(e,t,n)}function Ms(e,t,n){t.status=`fulfilled`,t.value=n,Ps(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,As(e,n)))}function Ns(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ps(t),t=t.next;while(t!==r)}e.action=null}function Ps(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fs(e,t){return t}function Is(e,t){if(P){var n=cd.formState;if(n!==null){a:{var r=F;if(P){if(ca){b:{for(var i=ca,a=ua;i.nodeType!==8;){if(!a){i=null;break b}if(i=ym(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ca=ym(i.nextSibling),r=i.data===`F!`;break a}}fa(r)}r=!1}r&&(t=n[0])}}return n=ds(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fs,lastRenderedState:t},n.queue=r,n=mc.bind(null,F,r),r.dispatch=n,r=Ds(!1),a=gc.bind(null,F,!1,r.queue),r=ds(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=ks.bind(null,F,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ls(e){return Rs(fs(),qo,e)}function Rs(e,t,n){if(t=ys(e,t,Fs)[0],e=vs(_s)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ms(t)}catch(e){throw e===$a?to:e}else r=t;t=fs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(F.flags|=2048,Vs(9,{destroy:void 0},zs.bind(null,i,n),null)),[r,a,e]}function zs(e,t){e.action=t}function Bs(e){var t=fs(),n=qo;if(n!==null)return Rs(t,n,e);fs(),t=t.memoizedState,n=fs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Vs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=F.updateQueue,t===null&&(t=ps(),F.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 Hs(){return fs().memoizedState}function Us(e,t,n,r){var i=ds();F.flags|=e,i.memoizedState=Vs(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ws(e,t,n,r){var i=fs();r=r===void 0?null:r;var a=i.memoizedState.inst;qo!==null&&r!==null&&rs(r,qo.memoizedState.deps)?i.memoizedState=Vs(t,a,n,r):(F.flags|=e,i.memoizedState=Vs(1|t,a,n,r))}function Gs(e,t){Us(8390656,8,e,t)}function Ks(e,t){Ws(2048,8,e,t)}function qs(e){F.flags|=4;var t=F.updateQueue;if(t===null)t=ps(),F.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Js(e){var t=fs().memoizedState;return qs({ref:t,nextImpl:e}),function(){if(sd&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ys(e,t){return Ws(4,2,e,t)}function Xs(e,t){return Ws(4,4,e,t)}function Zs(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 Qs(e,t,n){n=n==null?null:n.concat([e]),Ws(4,4,Zs.bind(null,t,e),n)}function $s(){}function ec(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&rs(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function tc(e,t){var n=fs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&rs(t,r[1]))return r[0];if(r=e(),Zo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r}function nc(e,t,n){return n===void 0||Ko&1073741824&&!(R&261930)?e.memoizedState=t:(e.memoizedState=n,e=Hd(),F.lanes|=e,gd|=e,n)}function rc(e,t,n,r){return Gr(n,t)?n:Ao.current===null?!(Ko&106)||Ko&1073741824&&!(R&261930)?(zc=!0,e.memoizedState=n):(e=Hd(),F.lanes|=e,gd|=e,t):(e=nc(e,n,r),Gr(e,t)||(zc=!0),e)}function ic(e,t,n,r,i){var a=j.p;j.p=a!==0&&8>a?a:8;var o=A.T,s={};s.types=o===null?null:o.types,A.T=s,gc(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?hc(e,t,qa(c,r),Vd(e)):hc(e,t,r,Vd(e))}catch(n){hc(e,t,{then:function(){},status:`rejected`,reason:n},Vd())}finally{j.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function ac(){}function oc(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=sc(e).queue;ic(e,a,t,ye,n===null?ac:function(){return cc(e),n(r)})}function sc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:_s,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function cc(e){var t=sc(e);t.next===null&&(t=e.alternate.memoizedState),hc(e,t.next.queue,{},Vd())}function lc(){return ka(_h)}function uc(){return fs().memoizedState}function dc(){return fs().memoizedState}function fc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Vd();e=xo(n);var r=So(t,e,n);r!==null&&(Wd(r,t,n),Co(r,t,n)),t={cache:Ia()},e.payload=t;return}t=t.return}}function pc(e,t,n){var r=Vd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_c(e)?vc(t,n):(n=Ai(e,t,n,r),n!==null&&(Wd(n,e,r),yc(n,t,r)))}function mc(e,t,n){hc(e,t,n,Vd())}function hc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(_c(e))vc(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,Gr(s,o))return ki(e,t,i,0),cd===null&&Oi(),!1}catch{}if(n=Ai(e,t,i,r),n!==null)return Wd(n,e,r),yc(n,t,r),!0}return!1}function gc(e,t,n,r){if(r={lane:2,revertLane:Gf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},_c(e)){if(t)throw Error(i(479))}else t=Ai(e,n,r,2),t!==null&&Wd(t,e,2)}function _c(e){var t=e.alternate;return e===F||t!==null&&t===F}function vc(e,t){Xo=Yo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function yc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bt(e,n)}}var bc={readContext:ka,use:hs,useCallback:ns,useContext:ns,useEffect:ns,useImperativeHandle:ns,useLayoutEffect:ns,useInsertionEffect:ns,useMemo:ns,useReducer:ns,useRef:ns,useState:ns,useDebugValue:ns,useDeferredValue:ns,useTransition:ns,useSyncExternalStore:ns,useId:ns,useHostTransitionStatus:ns,useFormState:ns,useActionState:ns,useOptimistic:ns,useMemoCache:ns,useCacheRefresh:ns,useEffectEvent:ns},xc={readContext:ka,use:hs,useCallback:function(e,t){return ds().memoizedState=[e,t===void 0?null:t],e},useContext:ka,useEffect:Gs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Us(4194308,4,Zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Us(4194308,4,e,t)},useInsertionEffect:function(e,t){Us(4,2,e,t)},useMemo:function(e,t){var n=ds();t=t===void 0?null:t;var r=e();if(Zo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ds();if(n!==void 0){var i=n(t);if(Zo){nt(!0);try{n(t)}finally{nt(!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=pc.bind(null,F,e),[r.memoizedState,e]},useRef:function(e){var t=ds();return e={current:e},t.memoizedState=e},useState:function(e){e=Ds(e);var t=e.queue,n=mc.bind(null,F,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:$s,useDeferredValue:function(e,t){return nc(ds(),e,t)},useTransition:function(){var e=Ds(!1);return e=ic.bind(null,F,e.queue,!0,!1),ds().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=F,a=ds();if(P){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),cd===null)throw Error(i(349));R&127||Ss(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Gs(ws.bind(null,r,o,e),[e]),r.flags|=2048,Vs(9,{destroy:void 0},Cs.bind(null,r,o,n,t),null),n},useId:function(){var e=ds(),t=cd.identifierPrefix;if(P){var n=ta,r=ea;n=(r&~(1<<32-rt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Qo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ts++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:lc,useFormState:Is,useActionState:Is,useOptimistic:function(e){var t=ds();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=gc.bind(null,F,!0,n),n.dispatch=t,[e,t]},useMemoCache:gs,useCacheRefresh:function(){return ds().memoizedState=fc.bind(null,F)},useEffectEvent:function(e){var t=ds(),n={impl:e};return t.memoizedState=n,function(){if(sd&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Sc={readContext:ka,use:hs,useCallback:ec,useContext:ka,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:vs,useRef:Hs,useState:function(){return vs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){return rc(fs(),qo.memoizedState,e,t)},useTransition:function(){var e=vs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Ls,useActionState:Ls,useOptimistic:function(e,t){return Os(fs(),qo,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js},Cc={readContext:ka,use:hs,useCallback:ec,useContext:ka,useEffect:Ks,useImperativeHandle:Qs,useInsertionEffect:Ys,useLayoutEffect:Xs,useMemo:tc,useReducer:bs,useRef:Hs,useState:function(){return bs(_s)},useDebugValue:$s,useDeferredValue:function(e,t){var n=fs();return qo===null?nc(n,e,t):rc(n,qo.memoizedState,e,t)},useTransition:function(){var e=bs(_s)[0],t=fs().memoizedState;return[typeof e==`boolean`?e:ms(e),t]},useSyncExternalStore:xs,useId:uc,useHostTransitionStatus:lc,useFormState:Bs,useActionState:Bs,useOptimistic:function(e,t){var n=fs();return qo===null?(n.baseState=e,[e,n.queue.dispatch]):Os(n,qo,e,t)},useMemoCache:gs,useCacheRefresh:dc,useEffectEvent:Js};function wc(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 Tc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=xo(r);i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Wd(t,e,r),Co(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Vd(),i=xo(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=So(e,i,r),t!==null&&(Wd(t,e,r),Co(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Vd(),r=xo(n);r.tag=2,t!=null&&(r.callback=t),t=So(e,r,n),t!==null&&(Wd(t,e,n),Co(t,e,n))}};function Ec(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?!Kr(n,r)||!Kr(i,a):!0}function Dc(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&&Tc.enqueueReplaceState(t,t.state,null)}function Oc(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 kc(e){wi(e)}function Ac(e){console.error(e)}function jc(e){wi(e)}function Mc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Nc(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 Pc(e,t,n){return n=xo(n),n.tag=3,n.payload={element:null},n.callback=function(){Mc(e,t)},n}function Fc(e){return e=xo(e),e.tag=3,e}function Ic(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(){Nc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Nc(t,n,r),typeof i!=`function`&&(Od===null?Od=new Set([this]):Od.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Lc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ea(t,n,a,!0),n=Fo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Io===null?nf():n.alternate===null&&hd===0&&(hd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===no?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ef(e,r,a)),!1;case 22:return n.flags|=65536,r===no?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)),Ef(e,r,a)),!1}throw Error(i(435,n.tag))}return Ef(e,r,a),nf(),!1}if(P)return t=Fo.current,t===null?(r!==da&&(t=Error(i(423),{cause:r}),va(Ki(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ki(r,n),a=Pc(e.stateNode,r,a),wo(e,a),hd!==4&&(hd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==da&&(e=Error(i(422),{cause:r}),va(Ki(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ki(o,n),xd===null?xd=[o]:xd.push(o),hd!==4&&(hd=2),t===null)return!0;r=Ki(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Pc(n.stateNode,r,e),wo(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`&&(Od===null||!Od.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Fc(a),Ic(a,e,n,r),wo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Rc=Error(i(461)),zc=!1;function Bc(e,t,n,r){t.child=e===null?_o(t,null,n,r):go(t,e.child,n,r)}function Vc(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 Oa(t),r=is(e,t,n,o,a,i),s=cs(),e!==null&&!zc?(ls(e,t,i),hl(e,t,i)):(P&&s&&ia(t),t.flags|=1,Bc(e,t,r,i),t.child)}function Hc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Li(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Uc(e,t,a,r,i)):(e=Bi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!gl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Kr:n,n(o,r)&&e.ref===t.ref)return hl(e,t,i)}return t.flags|=1,e=Ri(a,r),e.ref=t.ref,e.return=t,t.child=e}function Uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Kr(a,r)&&e.ref===t.ref){if(zc=!1,t.pendingProps=r=a,gl(e,i))e.flags&131072&&(zc=!0);else return t.lanes=e.lanes,hl(e,t,i)}}return Zc(e,t,n,r,i)}function Wc(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 Kc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Za(t,a===null?null:a.cachePool),a===null?No():Mo(t,a),zo(t);else return r=t.lanes=536870912,Kc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&Za(t,null),No(),Bo()):(Za(t,a.cachePool),Mo(t,a),Bo(),t.memoizedState=null);return Bc(e,t,i,n),t.child}function Gc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Kc(e,t,n,r,i){var a=Xa();return a=a===null?null:{parent:Fa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&Za(t,null),No(),zo(t),e!==null&&Ea(e,t,r,!0),t.childLanes=i,null}function qc(e,t){return t=ol({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Jc(e,t,n){return go(t,e.child,null,n),e=qc(t,t.pendingProps),e.flags|=2,Vo(t),t.memoizedState=null,e}function Yc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(P){if(r.mode===`hidden`)return e=qc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Gc(null,e);if(Ro(t),(e=ca)?(e=hm(e,ua),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,ca=null)):e=null,e===null)throw fa(t);return t.lanes=536870912,null}return qc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ro(t),a){if(t.flags&256)t.flags&=-257,t=Jc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(zc||Ea(e,t,n,!1),a=(n&e.childLanes)!==0,zc||a){if(Ao.current===null){if(r=cd,r!==null&&(s=xt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ji(e,s),Wd(r,e,s),Rc;nf()}t=Jc(e,t,n)}else e=o.treeContext,ca=ym(s.nextSibling),sa=t,P=!0,la=null,ua=!1,e!==null&&oa(t,e),t=qc(t,r),t.flags|=134221824;return t}return e=Ri(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Xc(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 Zc(e,t,n,r,i){return Oa(t),n=is(e,t,n,r,void 0,i),r=cs(),e!==null&&!zc?(ls(e,t,i),hl(e,t,i)):(P&&r&&ia(t),t.flags|=1,Bc(e,t,n,i),t.child)}function Qc(e,t,n,r,i,a){return Oa(t),t.updateQueue=null,n=os(t,r,n,i),as(e),r=cs(),e!==null&&!zc?(ls(e,t,a),hl(e,t,a)):(P&&r&&ia(t),t.flags|=1,Bc(e,t,n,a),t.child)}function $c(e,t,n,r,i){if(Oa(t),t.stateNode===null){var a=Pi,o=n.contextType;typeof o==`object`&&o&&(a=ka(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Tc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},yo(t),o=n.contextType,a.context=typeof o==`object`&&o?ka(o):Pi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(wc(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&&Tc.enqueueReplaceState(a,a.state,null),Do(t,r,a,i),Eo(),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=Oc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Pi,typeof u==`object`&&u&&(o=ka(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)&&Dc(t,a,r,o),vo=!1;var f=t.memoizedState;a.state=f,Do(t,r,a,i),Eo(),l=t.memoizedState,s||f!==l||vo?(typeof d==`function`&&(wc(t,n,d,r),l=t.memoizedState),(c=vo||Ec(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,bo(e,t),o=t.memoizedProps,u=Oc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Pi,typeof l==`object`&&l&&(c=ka(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)&&Dc(t,a,r,c),vo=!1,f=t.memoizedState,a.state=f,Do(t,r,a,i),Eo();var p=t.memoizedState;o!==d||f!==p||vo||e!==null&&e.dependencies!==null&&Da(e.dependencies)?(typeof s==`function`&&(wc(t,n,s,r),p=t.memoizedState),(u=vo||Ec(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Da(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,Xc(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=go(t,e.child,null,i),t.child=go(t,null,n,i)):Bc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=hl(e,t,i),e}function el(e,t,n,r){return ga(),t.flags|=256,Bc(e,t,n,r),t.child}var tl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function nl(e){return{baseLanes:e,cachePool:Qa()}}function rl(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=yd),e}function il(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ho.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(P){if(i?Lo(t):Bo(),(e=ca)?(e=hm(e,ua),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:$i===null?null:{id:ea,overflow:ta},retryLane:536870912,hydrationErrors:null},n=Ui(e),n.return=t,t.child=n,sa=t,ca=null)):e=null,e===null)throw fa(t);return t.lanes=_m(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Bo(),i=t.mode,a=ol({mode:`hidden`,children:a},i),r=Vi(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=nl(n),r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(null,r)):(Lo(t),al(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return cl(e,t,a,o,r,c,s,n)}return i?(Bo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ri(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Vi(i,a,n,null),i.flags|=2):i=Ri(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Gc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=nl(n):(a=i.cachePool,a===null?a=Qa():(s=Fa._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=rl(e,o,n),t.memoizedState=tl,Gc(e.child,r)):(Lo(t),n=e.child,e=n.sibling,n=Ri(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 al(e,t){return t=ol({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function ol(e,t){return e=Ii(22,e,null,t),e.lanes=0,e}function sl(e,t,n){return go(t,e.child,null,n),e=al(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cl(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(Lo(t),t.flags&=-257,sl(e,t,c)):t.memoizedState===null?(Bo(),o=a.fallback,s=t.mode,a=ol({mode:`visible`,children:a.children},s),o=Vi(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,go(t,e.child,null,c),a=t.child,a.memoizedState=nl(c),a.childLanes=rl(e,r,c),t.memoizedState=tl,Gc(null,a)):(Bo(),t.child=e.child,t.flags|=128,null);if(Lo(t),_m(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,va({value:a,source:null,stack:null})),sl(e,t,c)}if(zc||Ea(e,t,c,!1),r=(c&e.childLanes)!==0,zc||r){if(Ao.current!==null)return sl(e,t,c);if(r=cd,r!==null&&(a=xt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,ji(e,a),Wd(r,e,a),Rc;return gm(o)||nf(),sl(e,t,c)}return gm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ca=ym(o.nextSibling),sa=t,P=!0,la=null,ua=!1,e!==null&&oa(t,e),t=al(t,a.children),t.flags|=134221824,t)}function ll(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),wa(e.return,t,n)}function ul(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Go(n)===null&&(t=e),e=e.sibling}return t}function dl(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 fl(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 pl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ho.current;if(t.flags&128)return Uo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Uo(t,o),i===`backwards`&&e!==null?(fl(e),Bc(e,t,r,n),fl(e)):Bc(e,t,r,n),r=P?Xi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ll(e,n,t);else if(e.tag===19)ll(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=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,fl(t)),dl(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&&Go(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}dl(t,!0,n,null,a,r);break;case`together`:dl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ul(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),dl(t,!1,i,n,a,r)}return t.child}function ml(e,t,n){var r=t.pendingProps;return Sa(t,t.type,r.value),Bc(e,t,r.children,n),t.child}function hl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ea(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=Ri(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ri(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function gl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Da(e)))}function _l(e,t,n){switch(t.tag){case 3:ke(t,t.stateNode.containerInfo),Sa(t,Fa,e.memoizedState.cache),ga();break;case 27:case 5:je(t);break;case 4:ke(t,t.stateNode.containerInfo);break;case 10:Sa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ro(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Lo(t),t.flags|=128,null;r=Ea(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?il(e,t,n):(Lo(t),e=hl(e,t,n),e===null?null:e.sibling)}Lo(t);break;case 19:if(t.flags&128)return pl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ea(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return pl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Uo(t,Ho.current),r)break;return null;case 22:return t.lanes=0,Wc(e,t,n,t.pendingProps);case 24:Sa(t,Fa,e.memoizedState.cache)}return hl(e,t,n)}function vl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)zc=!0;else{if(!gl(e,n)&&!(t.flags&128))return zc=!1,_l(e,t,n);zc=!!(e.flags&131072)}}else zc=!1,P&&t.flags&1048576&&ra(t,Xi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ao(t.elementType),t.type=e,typeof e==`function`)Li(e)?(r=Oc(e,r),t.tag=1,t=$c(null,t,e,r,n)):(t.tag=0,t=Zc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===ae){t.tag=11,t=Vc(null,t,e,r,n);break a}if(a===se){t.tag=14,t=Hc(null,t,e,r,n);break a}if(a===O){t.tag=10,t.type=e,t=ml(null,t,n);break a}}throw t=_e(e)||e,Error(i(306,t,``))}}return t;case 0:return Zc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Oc(r,t.pendingProps),$c(e,t,r,a,n);case 3:a:{if(ke(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,bo(e,t),Do(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Sa(t,Fa,r),r!==o.cache&&Ta(t,[Fa],n,!0),Eo(),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=el(e,t,r,n);break a}if(r!==a){a=Ki(Error(i(424)),t),va(a),t=el(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(ca=ym(e.firstChild),sa=t,P=!0,la=null,ua=!0,n=_o(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ga(),r===a){t=hl(e,t,n);break a}Bc(e,t,r,n)}t=t.child}return t;case 26:return Xc(e,t),e===null?(n=Um(t.type,null,t.pendingProps,null))?t.memoizedState=n:P||(t.stateNode=Sp(t.type,t.pendingProps,De.current,t)):t.memoizedState=Um(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return je(t),e===null&&P&&(r=t.stateNode=Tm(t.type,t.pendingProps,De.current),sa=t,ua=!0,a=ca,Mp(t.type)?(bm=a,ca=ym(r.firstChild)):ca=a),Bc(e,t,t.pendingProps.children,n),Xc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&P&&((a=r=ca)&&(r=pm(r,t.type,t.pendingProps,ua),r===null?a=!1:(t.stateNode=r,sa=t,ca=ym(r.firstChild),ua=!1,a=!0)),a||fa(t)),je(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Cp(a,o)?r=null:s!==null&&Cp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=is(e,t,ss,null,null,n),_h._currentValue=a),Xc(e,t),Bc(e,t,r,n),t.child;case 6:return e===null&&P&&((e=n=ca)&&(n=mm(n,t.pendingProps,ua),n===null?e=!1:(t.stateNode=n,sa=t,ca=null,e=!0)),e||fa(t)),null;case 13:return il(e,t,n);case 4:return ke(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=go(t,null,r,n):Bc(e,t,r,n),t.child;case 11:return Vc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Xc(e,t),Bc(e,t,r,n),t.child;case 8:return Bc(e,t,t.pendingProps.children,n),t.child;case 12:return Bc(e,t,t.pendingProps.children,n),t.child;case 10:return ml(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,Oa(t),a=ka(a),r=r(a),t.flags|=1,Bc(e,t,r,n),t.child;case 14:return Hc(e,t,t.type,t.pendingProps,n);case 15:return Uc(e,t,t.type,t.pendingProps,n);case 19:return pl(e,t,n);case 31:return Yc(e,t,n);case 22:return Wc(e,t,n,t.pendingProps);case 24:return Oa(t),r=ka(Fa),e===null?(a=Xa(),a===null&&(a=cd,o=Ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},yo(t),Sa(t,Fa,a)):((e.lanes&n)!==0&&(bo(e,t),Do(t,null,null,n),Eo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Sa(t,Fa,r),r!==a.cache&&Ta(t,[Fa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Sa(t,Fa,r))),Bc(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:P&&ia(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Xc(e,t),Bc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function yl(e){e.flags|=4}function bl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?ih(t,r):ih(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($d())e.flags|=8192;else throw oo=no,eo}}else e.flags&=-16777217}function xl(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t)){if($d())e.flags|=8192;else throw oo=no,eo}}function Sl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ht(),e.lanes|=t,bd|=t)}function Cl(e,t){if(!P)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 wl(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 Tl(e,t,n){var r=t.pendingProps;switch(aa(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wl(t),null;case 1:return wl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Ca(Fa),Ae(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ha(t)?yl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_a())),wl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(yl(t),o===null?(wl(t),bl(t,a,null,r,n)):(wl(t),xl(t,o))):o?o===e.memoizedState?(wl(t),t.flags&=-16777217):(yl(t),wl(t),xl(t,o)):(e=e.memoizedProps,e!==r&&yl(t),wl(t),bl(t,a,e,r,n)),null;case 27:if(Me(t),n=De.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return wl(t),t.subtreeFlags&=-33554433,null}e=Te.current,ha(t)?pa(t,e):(e=Tm(a,r,n),t.stateNode=e,yl(t))}return wl(t),t.subtreeFlags&=-33554433,null;case 5:if(Me(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return wl(t),t.subtreeFlags&=-33554433,null}if(o=Te.current,ha(t))pa(t,o);else{var s=yp(De.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[Dt]=t,o[Ot]=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&&yl(t)}}return wl(t),t.subtreeFlags&=-33554433,bl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&yl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=De.current,ha(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=sa,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||lp(e.nodeValue,n)),e||fa(t,!0)}else e=yp(e).createTextNode(r),e[Dt]=t,t.stateNode=e}return wl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ha(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[Dt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wl(t),e=!1}else n=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Vo(t),t):(Vo(t),null);if(t.flags&128)throw Error(i(558))}return wl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ha(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[Dt]=t}else ga(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;wl(t),a=!1}else a=_a(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(Vo(t),t):(Vo(t),null)}return Vo(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),Sl(t,t.updateQueue),wl(t),null);case 4:return Ae(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,wl(t),null;case 10:return Ca(t.type),wl(t),null;case 19:if(Wo(t),r=t.memoizedState,r===null)return wl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Cl(r,!1);else{if(hd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Go(e),o!==null){for(t.flags|=128,Cl(r,!1),e=o.updateQueue,t.updateQueue=e,Sl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)zi(n,e),n=n.sibling;return Uo(t,Ho.current&1|2),P&&na(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>Ed&&(t.flags|=128,a=!0,Cl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=Go(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Sl(t,e),Cl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!P)return wl(t),null}else 2*Ge()-r.renderingStartTime>Ed&&n!==536870912&&(t.flags|=128,a=!0,Cl(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=Ge(),e.sibling=null,o=Ho.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||P?Uo(t,o):(n=o,we(Fo,t),we(Ho,n),Io===null&&(Io=t)),P&&na(t,r.treeForkCount),e}return wl(t),null;case 22:case 23:return Vo(t),Po(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(wl(t),t.subtreeFlags&6&&(t.flags|=8192)):wl(t),n=t.updateQueue,n!==null&&Sl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Ya),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ca(Fa),wl(t),null;case 25:return null;case 30:return t.flags|=33554432,wl(t),null}throw Error(i(156,t.tag))}function El(e,t){switch(aa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(Fa),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(Vo(t),t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Vo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ga()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Wo(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 Ae(),null;case 10:return Ca(t.type),null;case 22:case 23:return Vo(t),Po(),e!==null&&Ce(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ca(Fa),null;case 25:return null;default:return null}}function Dl(e,t){switch(aa(t),t.tag){case 3:Ca(Fa),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Vo(t);break;case 13:Vo(t);break;case 19:Wo(t);break;case 10:Ca(t.type);break;case 22:case 23:Vo(t),Po(),e!==null&&Ce(Ya);break;case 24:Ca(Fa)}}function Ol(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){Tf(t,t.return,e)}}function kl(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){Tf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Tf(t,t.return,e)}}function Al(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ko(t,n)}catch(t){Tf(e,e.return,t)}}}function jl(e,t,n){n.props=Oc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Tf(e,t,n)}}function Ml(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=xi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Wp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Gp(e);f(e.child,!1,cm,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){Tf(e,t,n)}}function Nl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Tf(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){Tf(e,t,n)}else n.current=null}}function Pl(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++)um(e.stateNode,t[n])}function Fl(e){for(var t=e.return;t!==null&&(Rl(t)&&um(e.stateNode,t.stateNode),!Ll(t));)t=t.return}function Il(e){for(var t=e.return;t!==null&&(Rl(t)&&dm(e.stateNode,t.stateNode),!Ll(t));)t=t.return}function Ll(e){return e.tag===5||e.tag===3||e.tag===27}function Rl(e){return e&&e.tag===7&&e.stateNode!==null}function zl(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){Tf(e,e.return,t)}}function Bl(e,t,n){try{var r=e.stateNode;mp(r,e.type,n,t),r[Ot]=t}catch(t){Tf(e,e.return,t)}}function Vl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mp(e.type)||e.tag===4}function Hl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Vl(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&&Mp(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 Ul(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=Cn)),Pl(e,r),Xt=!0;else if(i!==4&&(i===27&&(Pl(e,r),r=null,Mp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Ul(e,t,n,r),e=e.sibling;e!==null;)Ul(e,t,n,r),e=e.sibling}function Wl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Pl(e,r),Xt=!0;else if(i!==4&&(i===27&&(Pl(e,r),r=null,Mp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Wl(e,t,n,r),e=e.sibling;e!==null;)Wl(e,t,n,r),e=e.sibling}function Gl(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[Dt]=e,t[Ot]=n}catch(t){Tf(e,e.return,t)}}var Kl=!1,ql=null;function Jl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Kl=!0)}var I=null;function Yl(){var e=I;return I=null,e}var Xl=0;function Zl(e,t,n,r,i){return Xl=0,Ql(e.child,t,n,r,i)}function Ql(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Rp(o);r.push(s),s.view&&(a=!0)}else a||Rp(o).view&&(a=!0);Kl=!0,Fp(o,Xl===0?t:t+`_`+Xl,n),Xl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Ql(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function $l(e,t){for(;e!==null;)e.tag===5?Ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||$l(e.child,t)),e=e.sibling}function eu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(eu(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=Ci(t.default,t.share),t!==`none`&&(Zl(e,n,t,null,!1)||$l(e.child,!1))}e=e.sibling}}function tu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=xi(r,n),a=Ci(r.default,n.paired?r.share:r.enter);a===`none`?eu(e):Zl(e,i,a,null,!1)?(eu(e),n.paired||t||Ud(e,r.onEnter)):$l(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)tu(e,t),e=e.sibling;else eu(e)}function nu(e){if(ql!==null&&ql.size!==0){var t=ql;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=Ci(n.default,n.share);if(a!==`none`&&(Zl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Ud(e,n.onShare)):$l(e.child,!1)),t.delete(r),t.size===0)break}}}nu(e)}e=e.sibling}}}function ru(e){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode),r=ql===null?void 0:ql.get(n),i=Ci(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Zl(e,n,i,null,!1)?r===void 0?Ud(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,ql.delete(n),Ud(e,t.onShare)):$l(e.child,!1)),ql!==null&&nu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else ql!==null&&nu(e)}function iu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=xi(t,e.stateNode);t=Ci(t.default,t.update),e.flags&=-5,t!==`none`&&Zl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&iu(e);e=e.sibling}}function au(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,$l(e.child,!1))}au(e)}e=e.sibling}}function ou(e){if(e.tag===30)e.stateNode.paired=null,$l(e.child,!1),au(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ou(e),e=e.sibling;else au(e)}function su(e){for(e=e.child;e!==null;)e.tag===30?$l(e.child,!1):e.subtreeFlags&33554432&&su(e),e=e.sibling}function cu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&Xl<a.length){var l=a[Xl],u=Rp(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&&Fp(c,Xl===0?n:n+`_`+Xl,i),s&&e.flags&4||(I===null&&(I=[]),I.push(c,Xl===0?r:r+`_`+Xl,t.memoizedProps)),Xl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:cu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function lu(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=xi(n,r),a=Ci(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;Xl=0,i=cu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Ud(e,n.onUpdate))}else e.subtreeFlags&33554432&&lu(e,t);e=e.sibling}}var uu=!1,du=!1,fu=!1,pu=!1,mu=typeof WeakSet==`function`?WeakSet:Set,hu=null,gu=!1,_u=!1,vu=!1,yu=!1;function bu(e,t,n){if(e=e.containerInfo,_p=Eh,e=Zr(e),Qr(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},Eh=!1,n=(n&335544064)===n,hu=t,t=n?9270:1024;hu!==null;){if(e=hu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&ru(r[a]);if(e.alternate===null&&e.flags&2)n&&Jl(e),xu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&ru(r),xu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Jl(e),xu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,hu=r):(n&&iu(e),xu(n))}}ql=null}function xu(e){for(;hu!==null;){var t=hu,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=Oc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Tf(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)fm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:fm(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=xi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=Ci(a.default,a.update),a!==`none`&&Zl(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,hu=r;break}hu=t.return}}function Su(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Hu(e,n),r&4&&Ol(5,n);break;case 1:if(Hu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Tf(n,n.return,e)}else{var i=Oc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Tf(n,n.return,e)}}}r&64&&Al(n),r&512&&Ml(n,n.return);break;case 3:if(Hu(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{ko(e,t)}catch(e){Tf(n,n.return,e)}}break;case 27:t===null&&r&4&&Gl(n);case 26:case 5:Hu(e,n),t===null&&r&4&&zl(n),r&512&&Ml(n,n.return);break;case 12:Hu(e,n);break;case 31:Hu(e,n),r&4&&ju(e,n);break;case 13:Hu(e,n),r&4&&Mu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=kf.bind(null,n),vm(e,n))));break;case 22:if(r=n.memoizedState!==null||uu,!r){var a=t!==null&&t.memoizedState!==null||du;t=uu,i=du,uu=r,(du=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Wu(e,n,r)):Hu(e,n),uu=t,du=i}break;case 30:Hu(e,n),r&512&&Ml(n,n.return);break;case 7:r&512&&Ml(n,n.return);default:Hu(e,n)}}function Cu(e,t){for(e=e.child;e!==null;)wu(e,t),e=e.sibling}function wu(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){Tf(e,e.return,t)}Tu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,Xt=!0}catch(t){Tf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Pp(s,!0):Pp(e.stateNode,!1)}catch(t){Tf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&Cu(e,t);break;default:Cu(e,t)}}function Tu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:wu(n,r);break a;case 22:n.memoizedState===null&&Tu(n,r);break a;default:Tu(n,r)}}e=e.sibling}}function Eu(e){var t=e.alternate;t!==null&&(e.alternate=null,Eu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&It(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 Du=null,Ou=!1;function ku(e,t,n){for(n=n.child;n!==null;)Au(e,t,n),n=n.sibling}function Au(e,t,n){if(tt&&typeof tt.onCommitFiberUnmount==`function`)try{tt.onCommitFiberUnmount(et,n)}catch{}switch(n.tag){case 26:du||Nl(n,t),ku(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!du&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:du||Nl(n,t),Il(n);var r=Du,i=Ou;Mp(n.type)&&(Du=n.stateNode,Ou=!1),ku(e,t,n),Em(n.stateNode,n.type,n.memoizedProps),Du=r,Ou=i;break;case 5:du||Nl(n,t),Il(n);case 6:if(n.tag===6&&Il(n),r=Du,i=Ou,Du=null,ku(e,t,n),Du=r,Ou=i,Du!==null){if(Ou)try{(Du.nodeType===9?Du.body:Du.nodeName===`HTML`?Du.ownerDocument.body:Du).removeChild(n.stateNode),Xt=!0}catch(e){Tf(n,t,e)}else try{Du.removeChild(n.stateNode),Xt=!0}catch(e){Tf(n,t,e)}}break;case 18:Du!==null&&(Ou?(e=Du,Np(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Qh(e)):Np(Du,n.stateNode));break;case 4:r=Du,i=Ou,Du=n.stateNode.containerInfo,Ou=!0,ku(e,t,n),Du=r,Ou=i;break;case 0:case 11:case 14:case 15:kl(2,n,t),du||kl(4,n,t),ku(e,t,n);break;case 1:du||(Nl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&jl(n,t,r)),ku(e,t,n);break;case 21:ku(e,t,n);break;case 22:du=(r=du)||n.memoizedState!==null,ku(e,t,n),du=r;break;case 30:Nl(n,t),ku(e,t,n);break;case 7:du||Nl(n,t),ku(e,t,n);break;default:ku(e,t,n)}}function ju(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Qh(e)}catch(e){Tf(t,t.return,e)}}}function Mu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Qh(e)}catch(e){Tf(t,t.return,e)}}function Nu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mu),t;default:throw Error(i(435,e.tag))}}function Pu(e,t){var n=Nu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Af.bind(null,e,t);t.then(r,r)}})}function Fu(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(Mp(l.type)){Du=l.stateNode,Ou=!1;break a}break;case 5:Du=l.stateNode,Ou=!1;break a;case 3:case 4:Du=l.stateNode.containerInfo,Ou=!0;break a}l=l.return}if(Du===null)throw Error(i(160));Au(s,c,o),Du=null,Ou=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Lu(t,e,n),t=t.sibling}var Iu=null;function Lu(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}Fu(t,e,n),Ru(e),a&4&&(kl(3,e,e.return),Ol(3,e),kl(5,e,e.return));break;case 1:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Nl(r,r.return)),a&64&&uu&&(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=Iu,Fu(t,e,n),Ru(e),a&512&&(du||r===null||Nl(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(uu)e.stateNode=Sp(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[Pt]||r[Dt]||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[Dt]=e,Bt(r),t=r;break a;case`link`:if(o=th(`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=th(`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[Dt]=e,Bt(r),t=r}e.stateNode=t}}else uu||nh(o,e.type,e.stateNode)}else e.stateNode=Xm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Bl(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||du||t.parentNode.removeChild(t)):a.count--,n===null?uu||nh(o,e.type,e.stateNode):Xm(o,n,e.memoizedProps))}break;case 27:Fu(t,e,n),Ru(e),a&512&&(du||r===null||Nl(r,r.return)),r!==null&&a&4&&Bl(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=fu,fu=!1,Fu(t,e,n),fu=o,Ru(e),a&512&&(du||r===null||Nl(r,r.return)),e.flags&32){t=e.stateNode;try{hn(t,``),Xt=!0}catch(t){Tf(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Bl(e,t,r===null?t:r.memoizedProps)),a&1024&&(pu=!0);break;case 6:if(Fu(t,e,n),Ru(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Xt=!0}catch(t){Tf(e,e.return,t)}}break;case 3:if(Xt=!1,eh=null,o=Iu,Iu=Am(t.containerInfo),Fu(t,e,n),Iu=o,Ru(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Qh(t.containerInfo)}catch(t){Tf(e,e.return,t)}pu&&(pu=!1,zu(e)),Xt=!1;break;case 4:a=fu,fu=uu,r=Zt(),o=Iu,Iu=Am(e.stateNode.containerInfo),Fu(t,e,n),Ru(e),Iu=o,Xt&&_u&&(vu=!0),Xt=r,fu=a;break;case 12:Fu(t,e,n),Ru(e);break;case 31:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 13:Fu(t,e,n),Ru(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(wd=Ge()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=uu,l=du,u=fu;uu=c||o,fu=u||o,du=l||s,Fu(t,e,n),du=l,fu=u,uu=c,Ru(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||uu||du||(t=s||du,n=uu,r=du,uu=o||uu,du=t,Uu(e,2),uu=n,du=r),!o&&fu||Cu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Pu(e,n))));break;case 19:Fu(t,e,n),Ru(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Pu(e,t)));break;case 30:a&512&&(du||r===null||Nl(r,r.return)),a=Zt(),o=_u,s=(n&335544064)===n,c=e.memoizedProps,_u=s&&Ci(c.default,c.update)!==`none`,Fu(t,e,n),Ru(e),s&&r!==null&&Xt&&(e.flags|=4),_u=o,Xt=a;break;case 21:break;case 7:a&512&&(du||r===null||Nl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Fu(t,e,n),Ru(e)}}function Ru(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Vl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(Rl(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Ll(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Wl(e,Hl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(hn(l,``),n.flags&=-33),Wl(e,Hl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Ul(e,Hl(e),u,s);break;default:throw Error(i(161))}}catch(t){Tf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function zu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;zu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Eh=!0,t.reset(),Eh=!1),e=e.sibling}}function Bu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Vu(t,e),t=t.sibling;else lu(t,!1)}function Vu(e,t){var n=e.alternate;if(n===null)tu(e,!1);else switch(e.tag){case 3:if(yu=gu=!1,Yl(),Bu(t,e),!gu&&!vu){if(e=I,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ip(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`})),yu=!0}I=null;break;case 5:Bu(t,e);break;case 4:r=gu,gu=!1,Bu(t,e),gu&&(vu=!0),gu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Bu(t,e):tu(e,!1));break;case 30:r=gu,i=Yl(),gu=!1,Bu(t,e),gu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=xi(a,o),o=xi(n.memoizedProps,o);var s=Ci(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,Xl=0,t=cu(e,n,t,o,s,a,!0),Xl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Ud(e,e.memoizedProps.onUpdate),I=i):i!==null&&(i.push.apply(i,I),I=i),gu=e.flags&32?!0:r;break;default:Bu(t,e)}}function Hu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Su(e,t.alternate,t),t=t.sibling}function Uu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:kl(4,n,n.return),Uu(n,r);break;case 1:Nl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&jl(n,n.return,i),Uu(n,r);break;case 27:r&2&&Em(n.stateNode,n.type,n.memoizedProps);case 5:Nl(n,n.return),n.tag!==5&&n.tag!==27||Il(n),Uu(n,r);break;case 6:Il(n);break;case 26:Nl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||du||i.parentNode.removeChild(i),Uu(n,r);break;case 22:n.memoizedState===null&&Uu(n,r);break;case 30:Nl(n,n.return),Uu(n,r);break;case 7:Nl(n,n.return);default:Uu(n,r)}e=e.sibling}}function Wu(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:Wu(i,a,n),Ol(4,a);break;case 1:if(Wu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Tf(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++)Oo(l[i],c)}catch(e){Tf(r,r.return,e)}}s&&o&64&&Al(a),Ml(a,a.return);break;case 27:n&2&&Gl(a);case 5:a.tag!==5&&a.tag!==27||Fl(a),Wu(i,a,n),s&&r===null&&o&4&&zl(a),Ml(a,a.return);break;case 6:Fl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||uu||nh(Am(c.ownerDocument),a.type,c),Wu(i,a,n),s&&r===null&&o&4&&zl(a),Ml(a,a.return);break;case 12:Wu(i,a,n);break;case 31:Wu(i,a,n),s&&o&4&&ju(i,a);break;case 13:Wu(i,a,n),s&&o&4&&Mu(i,a);break;case 22:a.memoizedState===null&&Wu(i,a,n),Ml(a,a.return);break;case 30:Wu(i,a,n),Ml(a,a.return);break;case 7:Ml(a,a.return);default:Wu(i,a,n)}t=t.sibling}}function Gu(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&&La(n))}function Ku(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&La(e))}function qu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Ju(e,t,n,r),t=t.sibling;else i&&su(t)}function Ju(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ou(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:qu(e,t,n,r),a&2048&&Ol(9,t);break;case 1:qu(e,t,n,r);break;case 3:qu(e,t,n,r),i&&yu&&(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&&La(a)));break;case 12:if(a&2048){qu(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){Tf(t,t.return,e)}}else qu(e,t,n,r);break;case 31:qu(e,t,n,r);break;case 13:qu(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&&ou(t),o._visibility&2?qu(e,t,n,r):(o._visibility|=2,Yu(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ou(s),o._visibility&2?qu(e,t,n,r):Xu(e,t)),a&2048&&Gu(s,t);break;case 24:qu(e,t,n,r),a&2048&&Ku(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&($l(a.child,!0),$l(t.child,!0))),qu(e,t,n,r);break;default:qu(e,t,n,r)}}function Yu(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:Yu(a,o,s,c,i),Ol(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Yu(a,o,s,c,i)):u._visibility&2?Yu(a,o,s,c,i):Xu(a,o),i&&l&2048&&Gu(o.alternate,o);break;case 24:Yu(a,o,s,c,i),i&&l&2048&&Ku(o.alternate,o);break;default:Yu(a,o,s,c,i)}t=t.sibling}}function Xu(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:Xu(n,r),i&2048&&Gu(r.alternate,r);break;case 24:Xu(n,r),i&2048&&Ku(r.alternate,r);break;default:Xu(n,r)}t=t.sibling}}var Zu=8192;function Qu(e,t,n){if(e.subtreeFlags&Zu)for(e=e.child;e!==null;)$u(e,t,n),e=e.sibling}function $u(e,t,n){switch(e.tag){case 26:Qu(e,t,n),e.flags&Zu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&sh(n,e)):ch(n,Iu,e.memoizedState,e.memoizedProps));break;case 5:Qu(e,t,n),e.flags&Zu&&(e=e.stateNode,(t&335544128)===t&&sh(n,e));break;case 3:case 4:var r=Iu;Iu=Am(e.stateNode.containerInfo),Qu(e,t,n),Iu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Zu,Zu=16777216,Qu(e,t,n),Zu=r):Qu(e,t,n));break;case 30:if((e.flags&Zu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,ql===null&&(ql=new Map),ql.set(r,i)}Qu(e,t,n);break;default:Qu(e,t,n)}}function ed(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 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];hu=r,id(r,e)}ed(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)nd(e),e=e.sibling}function nd(e){switch(e.tag){case 0:case 11:case 15:td(e),e.flags&2048&&kl(9,e,e.return);break;case 3:td(e);break;case 12:td(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,rd(e)):td(e);break;default:td(e)}}function rd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];hu=r,id(r,e)}ed(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:kl(8,t,t.return),rd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,rd(t));break;default:rd(t)}e=e.sibling}}function id(e,t){for(;hu!==null;){var n=hu;switch(n.tag){case 0:case 11:case 15:kl(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:La(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,hu=r;else a:for(n=e;hu!==null;){r=hu;var i=r.sibling,a=r.return;if(Eu(r),r===n){hu=null;break a}if(i!==null){i.return=a,hu=i;break a}hu=a}}}var ad={getCacheForType:function(e){var t=ka(Fa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ka(Fa).controller.signal}},od=typeof WeakMap==`function`?WeakMap:Map,sd=0,cd=null,L=null,R=0,ld=0,ud=null,dd=!1,fd=!1,pd=!1,md=0,hd=0,gd=0,_d=0,vd=0,yd=0,bd=0,xd=null,Sd=null,Cd=!1,wd=0,Td=0,Ed=1/0,Dd=null,Od=null,kd=0,Ad=null,jd=null,Md=0,Nd=0,Pd=null,Fd=null,Id=null,Ld=null,Rd=null,zd=0,Bd=null;function Vd(){return sd&2&&R!==0?R&-R:A.T===null?wt():Gf()}function Hd(){if(yd===0){if(!(R&536870912)||P){var e=ct;ct<<=1,!(ct&3932160)&&(ct=262144),yd=e}else yd=536870912}return e=Fo.current,e!==null&&(e.flags|=32),yd}function Ud(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Wp(xi(e.memoizedProps,n))),Ld===null&&(Ld=[]),Ld.push(t.bind(null,r))}}function Wd(e,t,n){(e===cd&&(ld===2||ld===9)||e.cancelPendingCommit!==null)&&(Zd(e,0),Jd(e,R,yd,!1)),_t(e,n),(!(sd&2)||e!==cd)&&(e===cd&&(!(sd&2)&&(_d|=n),hd===4&&Jd(e,R,yd,!1)),B(e))}function Gd(e,t,n){if(sd&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ft(e,t),a=r?of(e,t):rf(e,t,!0),o=r;do{if(a===0){fd&&!r&&Jd(e,t,0,!1);break}if(n=e.current.alternate,o&&!qd(n)){a=rf(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=xd;var l=c.current.memoizedState.isDehydrated;if(l&&(Zd(c,s).flags|=256),s=rf(c,s,!1),s!==2&&s!==6){if(pd&&!l){c.errorRecoveryDisabledLanes|=o,_d|=o,a=4;break a}o=Sd,Sd=a,o!==null&&(Sd===null?Sd=o:Sd.push.apply(Sd,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Zd(e,0),Jd(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:Jd(r,t,yd,!dd);break a;case 2:Sd=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=wd+300-Ge(),10<a)){if(Jd(r,t,yd,!dd),dt(r,0,!0)!==0)break a;Md=t,r.timeoutHandle=Ep(Kd.bind(null,r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,`Throttled`,-0,0),a);break a}Kd(r,n,Sd,Dd,Cd,t,yd,_d,bd,dd,o,null,-0,0)}break}while(1);B(e)}function Kd(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:Cn},ql=null,$u(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=fh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?wd-Ge():(a&4194048)===a?Td-Ge():0,m=uh(d,m),m!==null)){Md=a,e.cancelPendingCommit=m(pf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Jd(e,a,o,!l);return}pf(e,t,a,n,r,i,o,s,c,l,u,d)}function qd(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(!Gr(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 Jd(e,t,n,r){t=pt(e,t),t&=~vd,t&=~_d,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-rt(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&yt(e,n,t)}function Yd(){return sd&6?!0:(Rf(0,!1),!1)}function Xd(){if(L!==null){if(ld===0)var e=L.return;else e=L,xa=ba=null,us(e),lo=null,uo=0,e=L;for(;e!==null;)Dl(e.alternate,e),e=e.return;L=null}}function Zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Dp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Md=0,Xd(),cd=e,L=n=Ri(e.current,null),R=t,ld=0,ud=null,dd=!1,fd=ft(e,t),pd=!1,bd=yd=vd=_d=gd=hd=0,Sd=xd=null,Cd=!1,md=pt(e,t),Oi(),n}function Qd(e,t){F=null,A.H=bc,t===$a||t===to?(t=so(),ld=3):t===eo?(t=so(),ld=4):ld=t===Rc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ud=t,L===null&&(hd=1,Mc(e,Ki(t,e.current)))}function $d(){var e=Fo.current;return e===null?!0:(R&4194048)===R?Io===null:(R&62914560)===R||R&536870912?e===Io:!1}function ef(){var e=A.H;return A.H=bc,e===null?bc:e}function tf(){var e=A.A;return A.A=ad,e}function nf(){hd=4,dd||(R&4194048)!==R&&Fo.current!==null||(fd=!0),!(gd&134217727)&&!(_d&134217727)||cd===null||Jd(cd,R,yd,!1)}function rf(e,t,n){var r=sd;sd|=2;var i=ef(),a=tf();(cd!==e||R!==t)&&(Dd=null,Zd(e,t)),t=!1;var o=hd;a:do try{if(ld!==0&&L!==null){var s=L,c=ud;switch(ld){case 8:Xd(),o=6;break a;case 3:case 2:case 9:case 6:Fo.current===null&&(t=!0);var l=ld;if(ld=0,ud=null,uf(e,s,c,l),n&&fd){o=0;break a}break;default:l=ld,ld=0,ud=null,uf(e,s,c,l)}}af(),o=hd;break}catch(t){Qd(e,t)}while(1);return t&&e.shellSuspendCounter++,xa=ba=null,sd=r,A.H=i,A.A=a,L===null&&(cd=null,R=0,Oi()),o}function af(){for(;L!==null;)cf(L)}function of(e,t){var n=sd;sd|=2;var r=ef(),a=tf();cd!==e||R!==t?(Dd=null,Ed=Ge()+500,Zd(e,t)):fd=ft(e,t);a:do try{if(ld!==0&&L!==null){t=L;var o=ud;b:switch(ld){case 1:ld=0,ud=null,uf(e,t,o,1);break;case 2:case 9:if(ro(o)){ld=0,ud=null,lf(t);break}t=function(){ld!==2&&ld!==9||cd!==e||(ld=7),B(e)},o.then(t,t);break a;case 3:ld=7;break a;case 4:ld=5;break a;case 7:ro(o)?(ld=0,ud=null,lf(t)):(ld=0,ud=null,uf(e,t,o,7));break;case 5:var s=null;switch(L.tag){case 26:s=L.memoizedState;case 5:case 27:var c=L;if(s?ah(s):c.stateNode.complete){ld=0,ud=null;var l=c.sibling;if(l!==null)L=l;else{var u=c.return;u===null?L=null:(L=u,df(u))}break b}}ld=0,ud=null,uf(e,t,o,5);break;case 6:ld=0,ud=null,uf(e,t,o,6);break;case 8:Xd(),hd=6;break a;default:throw Error(i(462))}}sf();break}catch(t){Qd(e,t)}while(1);return xa=ba=null,A.H=r,A.A=a,sd=n,L===null?(cd=null,R=0,Oi(),hd):0}function sf(){for(;L!==null&&!Ue();)cf(L)}function cf(e){var t=vl(e.alternate,e,md);e.memoizedProps=e.pendingProps,t===null?df(e):L=t}function lf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Qc(n,t,t.pendingProps,t.type,void 0,R);break;case 11:t=Qc(n,t,t.pendingProps,t.type.render,t.ref,R);break;case 5:us(t);var r=t;r===sa&&(P?(ma(r),r.tag===5&&r.stateNode!=null&&(ca=r.stateNode)):(ma(r),P=!0));default:Dl(n,t),t=L=zi(t,md),t=vl(n,t,md)}e.memoizedProps=e.pendingProps,t===null?df(e):L=t}function uf(e,t,n,r){xa=ba=null,us(t),lo=null,uo=0;var i=t.return;try{if(Lc(e,i,t,n,R)){hd=1,Mc(e,Ki(n,e.current)),L=null;return}}catch(t){if(i!==null)throw L=i,t;hd=1,Mc(e,Ki(n,e.current)),L=null;return}t.flags&32768?(P||r===1?e=!0:fd||R&536870912?e=!1:(dd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Fo.current,r!==null&&r.tag===13&&(r.flags|=16384))),ff(t,e)):df(t)}function df(e){var t=e;do{if(t.flags&32768){ff(t,dd);return}e=t.return;var n=Tl(t.alternate,t,md);if(n!==null){L=n;return}if(t=t.sibling,t!==null){L=t;return}L=t=e}while(t!==null);hd===0&&(hd=5)}function ff(e,t){do{var n=El(e.alternate,e);if(n!==null){n.flags&=32767,L=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){L=e;return}L=e=n}while(e!==null);hd=6,L=null}function pf(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do xf();while(kd!==0);if(sd&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===cd&&(L=cd=null,R=0),jd=t,Ad=e,Md=n,Pd=a,Fd=r,mf(e,t,n,s,c,l,f)}}function mf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Nd=s,s|=Di,vt(e,n,s,r,i,a),Ld=null,(n&335544064)===n?(Rd=Ba(e),r=10262):(Rd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,jf(Ye,function(){return Cf(),null})):(e.callbackNode=null,e.callbackPriority=0),Kl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=A.T,A.T=null,i=j.p,j.p=2,a=sd,sd|=4;try{bu(e,t,n)}finally{sd=a,j.p=i,A.T=r}}kd=1,Kl?Id=Hp(o,e.containerInfo,Rd,_f,vf,gf,z,Cf,hf,null,null):(_f(),vf(),z())}function hf(e){if(kd!==0){var t=Ad.onRecoverableError;t(e,{componentStack:null})}}function gf(){kd===3&&(kd=0,Vu(jd,Ad),kd=4)}function _f(){if(kd===1){kd=0;var e=Ad,t=jd,n=Md,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=A.T,A.T=null;var i=j.p;j.p=2;var a=sd;sd|=4;try{_u=vu=!1,Lu(t,e,n),n=vp;var o=Zr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Xr(s.ownerDocument.documentElement,s)){if(c!==null&&Qr(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 _=Yr(s,h),v=Yr(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}}Eh=!!_p,vp=_p=null}finally{sd=a,j.p=i,A.T=r}}e.current=t,kd=2}}function vf(){if(kd===2){kd=0;var e=Ad,t=jd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=A.T,A.T=null;var r=j.p;j.p=2;var i=sd;sd|=4;try{Su(e,t.alternate,t)}finally{sd=i,j.p=r,A.T=n}}kd=3}}function z(){if(kd===4||kd===3){kd=0;var e=Id;Id=null,We();var t=Ad,n=jd,r=Md,i=Fd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?kd=5:(kd=0,jd=Ad=null,yf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Od=null),Ct(r),n=n.stateNode,tt&&typeof tt.onCommitFiberRoot==`function`)try{tt.onCommitFiberRoot(et,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=A.T,a=j.p,j.p=2,A.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{A.T=n,j.p=a}}if(i=Ld,o=Rd,Rd=null,i!==null&&(Ld=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);Md&3&&xf(),B(t),a=t.pendingLanes,r&261930&&a&42?t===Bd?zd++:(zd=0,Bd=t):(zd=0,Bd=null),Rf(0,!1)}}function yf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,La(t)))}function xf(){return Id!==null&&(Id.skipTransition(),Id=null),_f(),vf(),z(),Cf()}function Cf(){if(kd!==5)return!1;var e=Ad,t=Nd;Nd=0;var n=Ct(Md),r=A.T,a=j.p;try{j.p=32>n?32:n,A.T=null,n=Pd,Pd=null;var o=Ad,s=Md;if(kd=0,jd=Ad=null,Md=0,sd&6)throw Error(i(331));var c=sd;if(sd|=4,nd(o.current),Ju(o,o.current,s,n),sd=c,Rf(0,!1),tt&&typeof tt.onPostCommitFiberRoot==`function`)try{tt.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{j.p=a,A.T=r,yf(e,t)}}function wf(e,t,n){t=Ki(n,t),t=Pc(e.stateNode,t,2),e=So(e,t,2),e!==null&&(_t(e,2),B(e))}function Tf(e,t,n){if(e.tag===3)wf(e,e,n);else for(;t!==null;){if(t.tag===3){wf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Od===null||!Od.has(r))){e=Ki(n,e),n=Fc(2),r=So(t,n,2),r!==null&&(Ic(n,r,t,e),_t(r,2),B(r));break}}t=t.return}}function Ef(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;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)||(pd=!0,i.add(n),e=Df.bind(null,e,t,n),t.then(e,e))}function Df(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,cd===e&&(R&n)===n&&(hd===4||hd===3&&(R&62914560)===R&&300>Ge()-wd?sd&2?vd|=n:Zd(e,0):vd|=n,bd===R&&(bd=0)),B(e)}function Of(e,t){t===0&&(t=ht()),e=ji(e,t),e!==null&&(_t(e,t),B(e))}function kf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Af(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),Of(e,n)}function jf(e,t){return Ve(e,t)}var Mf=null,Nf=null,Pf=!1,Ff=!1,If=!1,Lf=0;function B(e){e!==Nf&&e.next===null&&(Nf===null?Mf=Nf=e:Nf=Nf.next=e),Ff=!0,Pf||(Pf=!0,Wf())}function Rf(e,t){if(!If&&Ff){If=!0;do for(var n=!1,r=Mf;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-rt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Uf(r,a))}else a=R,a=dt(r,r===cd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ft(r,a)||(n=!0,Uf(r,a))}r=r.next}while(n);If=!1}}function zf(){Bf()}function Bf(){Ff=Pf=!1;var e=0;Lf!==0&&Tp()&&(e=Lf);for(var t=Ge(),n=null,r=Mf;r!==null;){var i=r.next,a=Vf(r,t);a===0?(r.next=null,n===null?Mf=i:n.next=i,i===null&&(Nf=n)):(n=r,(e!==0||a&3)&&(Ff=!0)),r=i}kd!==0&&kd!==5||Rf(e,!1),Lf!==0&&(Lf=0)}function Vf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-rt(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=mt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=cd,n=R,n=dt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(ld===2||ld===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&He(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ft(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&He(r),Ct(n)){case 2:case 8:n=Je;break;case 32:n=Ye;break;case 268435456:n=Ze;break;default:n=Ye}return r=Hf.bind(null,e),n=Ve(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&He(r),e.callbackPriority=2,e.callbackNode=null,2}function Hf(e,t){if(kd!==0&&kd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(xf()&&e.callbackNode!==n)return null;var r=R;return r=dt(e,e===cd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Gd(e,r,t),Vf(e,Ge()),e.callbackNode!=null&&e.callbackNode===n?Hf.bind(null,e):null)}function Uf(e,t){if(xf())return null;Gd(e,t,!0)}function Wf(){Ap(function(){sd&6?Ve(qe,zf):Bf()})}function Gf(){if(Lf===0){var e=Ua;e===0&&(e=st,st<<=1,!(st&261888)&&(st=256)),Lf=e}return Lf}function Kf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Sn(e)}function qf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Kf((i[Ot]||null).action),o=r.submitter;o&&(t=(t=o[Ot]||null)?Kf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Un(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Lf!==0){var e=new FormData(i,o);oc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),oc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Jf=0;Jf<vi.length;Jf++){var Yf=vi[Jf];yi(Yf.toLowerCase(),`on`+(Yf[0].toUpperCase()+Yf.slice(1)))}yi(ui,`onAnimationEnd`),yi(di,`onAnimationIteration`),yi(fi,`onAnimationStart`),yi(`dblclick`,`onDoubleClick`),yi(`focusin`,`onFocus`),yi(`focusout`,`onBlur`),yi(pi,`onTransitionRun`),yi(mi,`onTransitionStart`),yi(hi,`onTransitionCancel`),yi(gi,`onTransitionEnd`),Gt(`onMouseEnter`,[`mouseout`,`mouseover`]),Gt(`onMouseLeave`,[`mouseout`,`mouseover`]),Gt(`onPointerEnter`,[`pointerout`,`pointerover`]),Gt(`onPointerLeave`,[`pointerout`,`pointerover`]),Wt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Wt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Wt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Wt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Wt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Wt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var 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(` `),V=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Xf));function Zf(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){wi(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){wi(e)}i.currentTarget=null,a=c}}}}function H(e,t){var n=t[At];n===void 0&&(n=t[At]=new Set);var r=e+`__bubble`;n.has(r)||(tp(t,e,2,!1),n.add(r))}function Qf(e,t,n){var r=0;t&&(r|=4),tp(n,e,r,t)}var $f=`_reactListening`+Math.random().toString(36).slice(2);function ep(e){if(!e[$f]){e[$f]=!0,Ht.forEach(function(t){t!==`selectionchange`&&(V.has(t)||Qf(t,!1,e),Qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$f]||(t[$f]=!0,Qf(`selectionchange`,!1,t))}}function tp(e,t,n,r){switch(Nh(t)){case 2:var i=Dh;break;case 8:i=Oh;break;default:i=kh}n=i.bind(null,t,n,e),i=void 0,!Nn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function np(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=Lt(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}An(function(){var r=a,i=Tn(n),s=[];a:{var c=_i.get(e);if(c!==void 0){var l=Un,u=e;switch(e){case`keypress`:if(Rn(n)===0)break a;case`keydown`:case`keyup`:l=sr;break;case`focusin`:u=`focus`,l=Qn;break;case`focusout`:u=`blur`,l=Qn;break;case`beforeblur`:case`afterblur`:l=Qn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Xn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Zn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=ur;break;case ui:case di:case fi:l=$n;break;case gi:l=dr;break;case`scroll`:case`scrollend`:l=Gn;break;case`wheel`:l=fr;break;case`copy`:case`cut`:case`paste`:l=er;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=cr;break;case`submit`:l=lr;break;case`toggle`:case`beforetoggle`:l=pr}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=jn(m,p),g!=null&&d.push(rp(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!==wn&&(u=n.relatedTarget||n.fromElement)&&(Lt(u)||u[kt]))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?Lt(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=Xn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=cr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:M(c),h=l==null?u:M(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Lt(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?M(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Nr;else if(Dr(c)){if(Pr)_=Ur;else{_=Vr;var v=Br}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&yn(r.elementType)&&(_=Nr):_=Hr;if(_&&=_(e,r)){Or(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?M(r):window,e){case`focusin`:(Dr(v)||v.contentEditable===`true`)&&(ei=v,ti=r,ni=null);break;case`focusout`:ni=ti=ei=null;break;case`mousedown`:ri=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ri=!1,ii(s,n,i);break;case`selectionchange`:if($r)break;case`keydown`:case`keyup`:ii(s,n,i)}var y;if(hr)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 Cr?xr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(vr&&n.locale!==`ko`&&(Cr||b!==`onCompositionStart`?b===`onCompositionEnd`&&Cr&&(y=Ln()):(Pn=i,Fn=`value`in Pn?Pn.value:Pn.textContent,Cr=!0)),v=ip(r,b),0<v.length&&(b=new tr(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=Sr(n),y!==null&&(b.data=y)))),(y=_r?wr(e,n):Tr(e,n))&&(b=ip(r,`onBeforeInput`),0<b.length&&(v=new tr(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),qf(s,e,r,n,i)}Zf(s,t)})}function rp(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=jn(e,n),i!=null&&r.unshift(rp(e,i,a)),i=jn(e,t),i!=null&&r.push(rp(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=jn(n,a),l!=null&&o.unshift(rp(n,l,c))):i||(l=jn(n,a),l!=null&&o.push(rp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var sp=/\r\n?/g,cp=/\u0000|\uFFFD/g;function U(e){return(typeof e==`string`?e:``+e).replace(sp,`
|
|
18
|
-
`).replace(cp,``)}function lp(e,t){return t=U(t),U(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&hn(e,``+r);else return;break;case`className`:$t(e,`class`,r);break;case`tabIndex`:$t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:$t(e,n,r);break;case`style`:vn(e,r,o);return;case`data`:if(t!==`object`){$t(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=Sn(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=Sn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Cn);return;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`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=Sn(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`:H(`beforetoggle`,e),H(`toggle`,e),Qt(e,`popover`,r);break;case`xlinkActuate`:en(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:en(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:en(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:en(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Qt(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=bn.get(n)||n,Qt(e,n,r);else return}Xt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:vn(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`)hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)hn(e,``+r);else return;break;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Cn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ut.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[Ot]||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}Xt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Qt(e,n,r)}return}Xt=!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`:H(`error`,e),H(`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`:H(`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)}}un(e,o,c,l,u,s,a,!1);return;case`select`:for(a in H(`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&&fn(e,!!r,n,!0):fn(e,!!r,t,!1);return;case`textarea`:for(s in H(`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)}mn(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`:H(`beforetoggle`,e),H(`toggle`,e),H(`cancel`,e),H(`close`,e);break;case`iframe`:case`object`:H(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)H(Xf[r],e);break;case`image`:H(`error`,e),H(`load`,e);break;case`details`:H(`toggle`,e);break;case`embed`:case`source`:case`link`:H(`error`,e),H(`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(yn(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&&(Xt=!0),o=m;break;case`name`:m!==f&&(Xt=!0),a=m;break;case`checked`:m!==f&&(Xt=!0),u=m;break;case`defaultChecked`:m!==f&&(Xt=!0),d=m;break;case`value`:m!==f&&(Xt=!0),s=m;break;case`defaultValue`:m!==f&&(Xt=!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)}}ln(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&&(Xt=!0),p=o;break;case`defaultValue`:o!==l&&(Xt=!0),c=o;break;case`multiple`:o!==l&&(Xt=!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?fn(e,!!n,n?[]:``,!1):fn(e,!!n,t,!0)):fn(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&&(Xt=!0),p=a;break;case`defaultValue`:a!==o&&(Xt=!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)}pn(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&&(Xt=!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(yn(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 bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[Dt]=r,n[Ot]=t,fp(n,e,t),Bt(n),n}function Cp(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 wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(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),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(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 Fp(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 Ip(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 Lp(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 Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(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`&&(Bp(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+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.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 Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.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},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.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(Xp(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=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.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,Jp(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,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=v(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(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}Gp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Qp,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||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Lt(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 sm(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)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Qp,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),sm(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),sm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=v(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(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`:fm(n),It(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(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[Pt])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=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(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 ym(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 bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(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 Cm(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 wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(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 Em(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===Cn&&(e.onclick=null),It(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);It(e)}var Om=new Map,km=new Set;function Am(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 jm=j.d;j.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=Yd();return e||t}function Nm(e){var t=Rt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Ft]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=zt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Bt(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,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=zt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Bt(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){jm.M(e,t);var n=Pm;if(n&&e){var r=zt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Bt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=De.current)?Am(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=Wm(n.href),t=zt(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=Wm(n.href);var o=zt(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(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.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},Om.set(e,o)),qm(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=Jm(n),t=zt(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 Wm(e){return`href="`+cn(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ft]){r.loading=1;return}}else t=e.createElement(`link`),t[Ft]=!0,t.onload=t.onerror=Vt.bind(null,t),fp(t,`link`,n),Bt(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 Jm(e){return`[src="`+cn(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Bt(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`),Bt(r),fp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(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,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Bt(a),a):(r=n,(a=Om.get(o))&&(r=T({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(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,Zm(r,n.precedence,e));return t.instance}function Zm(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 Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,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[Pt]||a[Dt]||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 nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(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 ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(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=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Bt(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=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.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=fh.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 _h={$$typeof:O,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function vh(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=gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.hiddenUpdates=gt(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 yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},yo(a),e}function bh(e){return e?(e=Pi,e):Pi}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=So(e,r,t),n!==null&&(Wd(n,e,t),Co(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Wd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=Vd();t=St(t);var n=ji(e,t);n!==null&&Wd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function Oh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=Rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ut(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-rt(o);s.entanglements[1]|=c,o&=~c}B(a),!(sd&6)&&(Ed=Ge()+500,Rf(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Wd(s,a,2),Yd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Tn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Lt(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 jh=e,null}function Nh(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(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`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 Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(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=Rt(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Lt(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,Tt(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Tt(e.priority,function(){Th(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 Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wn=r,n.target.dispatchEvent(r),wn=null}else return t=Rt(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=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(Mh(r||n)===null)continue;break}var a=Rt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.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[Ot]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ot]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){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 eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,Vd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),Yd(),t[kt]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.0`)throw Error(i(527,ng,`19.3.0`));j.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 rg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{et=ig.inject(rg),tt=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;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=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[kt]=t.current,ep(e),new eg(t)}})),wf=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=Cf()}))(),Tf={activity:400,thoughts:40,chat:100};function Ef(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var Df=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:Ef(t.activity,e.activity??[],Tf.activity),thoughts:Ef(t.thoughts,e.thoughts??[],Tf.thoughts),chat:Ef(t.chat,e.chat??[],Tf.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function Of(){return new Df}var kf=Of(),Af={info:3600,success:3e3,warning:5e3,error:6e3},jf,Mf=[],Nf=0,Pf=new Set;function Ff(){for(let e of[...Pf])e()}function If(e,t,n){let r=t.trim();if(!r||jf?.message===r||Mf.some(e=>e.message===r))return;let i={id:++Nf,kind:e,message:r,duration:n?.duration??Af[e],...n?.action?{action:n.action}:{}};jf?Mf=[...Mf,i].slice(-3):jf=i,Ff()}function Lf(e){jf?.id===e&&(jf=Mf[0],Mf=Mf.slice(1),Ff())}var B=Object.assign((e,t)=>If(`info`,e,t),{success:(e,t)=>If(`success`,e,t),error:(e,t)=>If(`error`,e,t),warning:(e,t)=>If(`warning`,e,t),info:(e,t)=>If(`info`,e,t)});function Rf(e){return Pf.add(e),()=>{Pf.delete(e)}}function zf(){return{item:(0,m.useSyncExternalStore)(Rf,()=>jf,()=>void 0),waiting:(0,m.useSyncExternalStore)(Rf,()=>Mf.length,()=>0)}}var Bf=/^[a-f0-9]{32}$/;function Vf(){return globalThis.location}function Hf(){let e=Vf()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!Bf.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function Uf(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=Hf();return t?`/projects/${t}${e}`:e}function Wf(e,t){if(!Bf.test(e))throw Error(`Invalid project ID.`);let n=Vf();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var Gf=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},Kf={"Content-Type":`application/json`};async function qf(e,t={}){let n=await fetch(e===`auth.login`||e===`projects.list`?`/api/${e}`:Uf(`/api/${e}`),{method:`POST`,headers:Kf,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&kf.onStatus({signedOut:!0}),new Gf(r.error,r.code,n.status);return r.result}function Jf(){return globalThis.location}async function Yf(){let e=Jf(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:Kf,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),kf.onStatus({signedOut:!1}),!0}function Xf(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function V(e,t,n={}){try{let r=await qf(e,t),i=r.notice;return i&&B(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){B.error(Xf(e));return}}var Zf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function H(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Zf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Qf=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},$f=e=>{let t=Qf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ep=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),tp={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 np(e){return e!=null}function rp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??tp.width,a=e.size??e.height??tp.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?ep(...c):ep(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??tp[`stroke-width`])*Number(e.size??e.width??tp.width)/Number(t.size??t.width??tp.width):t.strokeWidth??tp[`stroke-width`];return[`svg`,{...Object.entries(tp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&np(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&np(t.width)&&{[r(`width`)]:t.width},...`height`in t&&np(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 ip(e,t={}){return rp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ap=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},op=(0,m.createContext)({}),sp=()=>(0,m.useContext)(op),cp=(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=``}=sp()??{},b=!!c||ap(d),[x,S,C=[]]=ip(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ep(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 U(e,t=[],n=[]){let r=typeof e==`string`?H(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(cp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=$f(r.name)),i}var lp={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`}]]};lp.node;var up=U(lp),dp={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`}]]};dp.node;var fp=U(dp),pp={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};pp.node;var mp=U(pp),hp={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hp.node;var gp=U(hp),_p={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`}]]};_p.node;var vp=U(_p),yp={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};yp.node;var bp=U(yp),xp={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`}]]};xp.node;var Sp=U(xp),Cp={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`}]]};Cp.node;var wp=U(Cp),Tp={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Tp.node;var Ep=U(Tp),Dp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};Dp.node;var Op=U(Dp),kp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};kp.node;var Ap=U(kp),jp={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};jp.node;var Mp=U(jp),Np={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`}]]};Np.node;var Pp=U(Np),Fp={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`}]]};Fp.node;var Ip=U(Fp),Lp={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`]};Lp.node;var Rp=U(Lp),zp={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`]};zp.node;var Bp=U(zp),Vp={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`}]]};Vp.node;var Hp=U(Vp),Up={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Up.node;var Wp=U(Up),Gp={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`]};Gp.node;var Kp=U(Gp),qp={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`]};qp.node;var Jp=U(qp),Yp={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`]};Yp.node;var Xp=U(Yp),Zp={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Zp.node;var Qp=U(Zp),$p={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};$p.node;var em=U($p),tm={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`}]]};tm.node;var nm=U(tm),rm={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`}]]};rm.node;var im=U(rm),am={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`}]]};am.node;var om=U(am),sm={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`}]]};sm.node;var cm=U(sm),lm={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`]};lm.node;var um=U(lm),dm={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`}]]};dm.node;var fm=U(dm),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 mm=U(pm),hm={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`}]]};hm.node;var gm=U(hm),_m={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`}]]};_m.node;var vm=U(_m),ym={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`}]]};ym.node;var bm=U(ym),xm={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`}]]};xm.node;var Sm=U(xm),Cm={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`}]]};Cm.node;var wm=U(Cm),Tm={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`]};Tm.node;var Em=U(Tm),Dm={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`}]]};Dm.node;var Om=U(Dm),km={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`}]]};km.node;var Am=U(km),jm={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`}]]};jm.node;var Mm=U(jm),Nm={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`}]]};Nm.node;var Pm=U(Nm),Fm={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`]};Fm.node;var Im=U(Fm),Lm={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`}]]};Lm.node;var Rm=U(Lm),zm={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`}]]};zm.node;var Bm=U(zm),Vm={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`}]]};Vm.node;var Hm=U(Vm),Um={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Um.node;var Wm=U(Um),Gm={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`}]]};Gm.node;var Km=U(Gm),qm={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`}]]};qm.node;var Jm=U(qm),Ym={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`}]]};Ym.node;var Xm=U(Ym),Zm={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`}]]};Zm.node;var Qm=U(Zm),$m={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`}]]};$m.node;var eh=U($m),th={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`}]]};th.node;var nh=U(th),rh={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`}]]};rh.node;var ih=U(rh),ah={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`}]]};ah.node;var oh=U(ah),sh={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`}]]};sh.node;var ch=U(sh),lh={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`}]]};lh.node;var uh=U(lh),dh={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`}]]};dh.node;var fh=U(dh),ph={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};ph.node;var mh=U(ph),hh={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`}]]};hh.node;var gh=U(hh),_h={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`}]]};_h.node;var vh=U(_h),yh={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`}]]};yh.node;var bh=U(yh),xh={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`}]]};xh.node;var Sh=U(xh),Ch={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`}]]};Ch.node;var wh=U(Ch),Th={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Th.node;var Eh=U(Th),Dh={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};Dh.node;var Oh=U(Dh),kh={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`}]]};kh.node;var Ah=U(kh),jh={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`}]]};jh.node;var Mh=U(jh),Nh={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`]};Nh.node;var Ph=U(Nh),Fh={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`]};Fh.node;var Ih=U(Fh),Lh={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Lh.node;var Rh=U(Lh),zh={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`}]]};zh.node;var Bh=U(zh),Vh={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`]};Vh.node;var Hh=U(Vh),Uh={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`]};Uh.node;var Wh=U(Uh),Gh={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`}]]};Gh.node;var Kh=U(Gh),qh={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`}]]};qh.node;var Jh=U(qh),Yh={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`}]]};Yh.node;var Xh=U(Yh),Zh={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`}]]};Zh.node;var Qh=U(Zh),$h={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`}]]};$h.node;var eg=U($h),tg={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`}]]};tg.node;var ng=U(tg),rg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};rg.node;var ig=U(rg),ag={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`}]]};ag.node;var og=U(ag);function sg(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=sg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function cg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=sg(e))&&(r&&(r+=` `),r+=t);return r}var lg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ug=cg,dg=(e,t)=>n=>{if(t?.variants==null)return ug(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=lg(t)||lg(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 ug(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)},fg=(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},pg=(e,t)=>({classGroupId:e,validator:t}),mg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),hg=`-`,gg=[],_g=`arbitrary..`,vg=e=>{let t=xg(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return bg(e);let n=e.split(hg);return yg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?fg(i,t):t:i||gg}return n[e]||gg}}},yg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=yg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(hg):e.slice(t).join(hg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},bg=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?_g+r:void 0})(),xg=e=>{let{theme:t,classGroups:n}=e;return Sg(n,t)},Sg=(e,t)=>{let n=mg();for(let r in e){let i=e[r];Cg(i,n,r,t)}return n},Cg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];wg(i,t,n,r)}},wg=(e,t,n,r)=>{if(typeof e==`string`){Tg(e,t,n);return}if(typeof e==`function`){Eg(e,t,n,r);return}Dg(e,t,n,r)},Tg=(e,t,n)=>{let r=e===``?t:Og(t,e);r.classGroupId=n},Eg=(e,t,n,r)=>{if(kg(e)){Cg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(pg(n,e))},Dg=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Cg(o,Og(t,a),n,r)}},Og=(e,t)=>{let n=e,r=t.split(hg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=mg(),n.nextPart.set(t,i)),n=i}return n},kg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Ag=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)}}},jg=`!`,Mg=`:`,Ng=[],Pg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fg=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===Mg){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(jg)?(c=s.slice(0,-1),l=!0):s.startsWith(jg)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Pg(t,l,c,u)};if(t){let e=t+Mg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Pg(Ng,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Ig=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}},Lg=e=>({cache:Ag(e.cacheSize),parseClassName:Fg(e),sortModifiers:Ig(e),postfixLookupClassGroupIds:Rg(e),...vg(e)}),Rg=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},zg=/\s+/,Bg=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(zg),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?_+jg:_,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},Vg=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Hg(n))&&(i&&(i+=` `),i+=r);return i},Hg=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Hg(e[r]))&&(n&&(n+=` `),n+=t);return n},Ug=(e,...t)=>{let n,r,i,a,o=o=>(n=Lg(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=Bg(e,n);return i(e,a),a};return a=o,(...e)=>a(Vg(...e))},Wg=[],Gg=e=>{let t=t=>t[e]||Wg;return t.isThemeGetter=!0,t.themeKey=e,t},Kg=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,qg=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Jg=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Yg=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xg=/\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$/,Zg=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,Qg=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,$g=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,e_=e=>Jg.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),t_=e=>!!e&&Number.isInteger(Number(e)),n_=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),r_=e=>Yg.test(e),i_=()=>!0,a_=e=>Xg.test(e)&&!Zg.test(e),o_=()=>!1,s_=e=>Qg.test(e),c_=e=>$g.test(e),l_=e=>!G(e)&&!K(e),u_=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)),d_=e=>E_(e,A_,o_),G=e=>Kg.test(e),f_=e=>E_(e,j_,a_),p_=e=>E_(e,M_,W),m_=e=>E_(e,P_,i_),h_=e=>E_(e,N_,o_),g_=e=>E_(e,O_,o_),__=e=>E_(e,k_,c_),v_=e=>E_(e,F_,s_),K=e=>qg.test(e),y_=e=>D_(e,j_),b_=e=>D_(e,N_),x_=e=>D_(e,O_),S_=e=>D_(e,A_),C_=e=>D_(e,k_),w_=e=>D_(e,F_,!0),T_=e=>D_(e,P_,!0),E_=(e,t,n)=>{let r=Kg.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},D_=(e,t,n=!1)=>{let r=qg.exec(e);return r?r[1]?t(r[1]):n:!1},O_=e=>e===`position`||e===`percentage`,k_=e=>e===`image`||e===`url`,A_=e=>e===`length`||e===`size`||e===`bg-size`,j_=e=>e===`length`,M_=e=>e===`number`,N_=e=>e===`family-name`,P_=e=>e===`number`||e===`weight`,F_=e=>e===`shadow`,I_=Ug(()=>{let e=Gg(`color`),t=Gg(`font`),n=Gg(`text`),r=Gg(`font-weight`),i=Gg(`tracking`),a=Gg(`leading`),o=Gg(`breakpoint`),s=Gg(`container`),c=Gg(`spacing`),l=Gg(`radius`),u=Gg(`shadow`),d=Gg(`inset-shadow`),f=Gg(`text-shadow`),p=Gg(`drop-shadow`),m=Gg(`blur`),h=Gg(`perspective`),g=Gg(`aspect`),_=Gg(`ease`),v=Gg(`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=()=>[e_,`full`,`auto`,...w()],E=()=>[t_,`none`,`subgrid`,K,G],ee=()=>[`auto`,{span:[`full`,t_,K,G]},t_,K,G],D=()=>[t_,`auto`,K,G],te=()=>[`auto`,`min`,`max`,`fr`,K,G],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...w()],O=()=>[e_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[s,e_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[e_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,K,G],se=()=>[...b(),x_,g_,{position:[K,G]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,S_,d_,{size:[K,G]}],ue=()=>[n_,y_,f_],de=()=>[``,`none`,`full`,l,K,G],fe=()=>[``,W,y_,f_],pe=()=>[`solid`,`dashed`,`dotted`,`double`],me=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],he=()=>[W,n_,x_,g_],ge=()=>[``,`none`,m,K,G],_e=()=>[`none`,W,K,G],ve=()=>[`none`,W,K,G],A=()=>[W,K,G],j=()=>[e_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[r_],breakpoint:[r_],color:[i_],container:[r_],"drop-shadow":[r_],ease:[`in`,`out`,`in-out`],font:[l_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[r_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[r_],shadow:[r_],spacing:[`px`,W],text:[r_],"text-shadow":[r_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,e_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[u_],columns:[{columns:[W,`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:[t_,`auto`,K,G]}],basis:[{basis:[e_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,e_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[t_,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],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:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:O()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...O()]}],"min-w":[{"min-w":[s,`screen`,`none`,...O()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...O()]}],h:[{h:[`screen`,`lh`,...O()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...O()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...O()]}],"font-size":[{text:[`base`,n,y_,f_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,T_,m_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,n_,G]}],"font-family":[{font:[b_,h_,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":[W,`none`,K,p_]}],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:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...pe(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,f_]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[W,`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:[t_,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:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},t_,K,G],radial:[``,K,G],conic:[``,t_,K,G]},C_,__]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...pe(),`hidden`,`none`]}],"divide-style":[{divide:[...pe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...pe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,y_,f_]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`inner`,`none`,u,w_,v_]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,w_,v_]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:fe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[W,f_]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,w_,v_]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...me(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":me()}],"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":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"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":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:ge()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,w_,v_]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,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:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:A()}],"skew-x":[{"skew-x":A()}],"skew-y":[{"skew-y":A()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:j()}],"translate-x":[{"translate-x":j()}],"translate-y":[{"translate-y":j()}],"translate-z":[{"translate-z":j()}],"translate-none":[`translate-none`],zoom:[{zoom:[t_,K,G]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"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":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"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`,...k()]}],"stroke-w":[{stroke:[W,y_,f_,p_]}],stroke:[{stroke:[`none`,...k()]}],"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 I_(cg(e))}var L_=Object.defineProperty,R_=(e,t)=>L_(e,`name`,{value:t,configurable:!0});function z_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}R_(z_,`setRef`);function B_(...e){return t=>{let n=!1,r=e.map(e=>{let r=z_(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():z_(e[t],null)}}}}R_(B_,`composeRefs`);function V_(...e){return m.useCallback(B_(...e),e)}R_(V_,`useComposedRefs`);var H_=Object.defineProperty,U_=(e,t)=>H_(e,`name`,{value:t,configurable:!0});function W_(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];$_(r)&&typeof rv==`function`&&(r=rv(r._payload)),m.Children.forEach(r,e=>{if(Z_(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;$_(n)&&typeof rv==`function`&&(n=rv(n._payload)),a=J_(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?X_(a):void 0,l=V_(n,c);if(!a){if(r||r===0)throw Error(o?nv(e):tv(e));return r}let u=Y_(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}U_(W_,`createSlot`);var G_=W_(`Slot`),K_=Symbol.for(`radix.slottable`);function q_(e){let t=U_(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=K_,t}U_(q_,`createSlottable`);var J_=U_((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 Y_(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}}U_(Y_,`mergeProps`);function X_(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)}U_(X_,`getElementRef`);function Z_(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===K_}U_(Z_,`isSlottable`);var Q_=Symbol.for(`react.lazy`);function $_(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Q_&&`_payload`in e&&ev(e._payload)}U_($_,`isLazyComponent`);function ev(e){return typeof e==`object`&&!!e&&`then`in e}U_(ev,`isPromiseLike`);var tv=U_(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),nv=U_(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),rv=m.use,iv=l(Sf(),1),av=Object.defineProperty,ov=(e,t)=>av(e,`name`,{value:t,configurable:!0}),sv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=W_(`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,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cv(e,t){e&&iv.flushSync(()=>e.dispatchEvent(t))}ov(cv,`dispatchDiscreteCustomEvent`);var lv=Object.defineProperty,uv=(e,t)=>lv(e,`name`,{value:t,configurable:!0}),dv=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`}),fv=m.forwardRef(uv(function(e,t){return(0,I.jsx)(sv.span,{...e,ref:t,style:{...dv,...e.style}})},`VisuallyHidden`)),pv=Object.defineProperty,mv=(e,t)=>pv(e,`name`,{value:t,configurable:!0});function hv(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=mv(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,I.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 mv(i,`useContext`),[r,i]}mv(hv,`createContext`);function gv(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=mv(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,I.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 mv(s,`useContext`),[o,s]}mv(r,`createContext`);let i=mv(()=>{let t=n.map(e=>m.createContext(e));return mv(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,_v(i,...t)]}mv(gv,`createContextScope`);function _v(...e){let t=e[0];if(e.length===1)return t;let n=mv(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return mv(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}mv(_v,`composeContextScopes`);var vv=Object.defineProperty,yv=(e,t)=>vv(e,`name`,{value:t,configurable:!0}),bv=!!(typeof window<`u`&&window.document&&window.document.createElement);function xv(e,t,{checkForDefaultPrevented:n=!0}={}){return yv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}yv(xv,`composeEventHandlers`);function Sv(e){if(!bv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}yv(Sv,`getOwnerWindow`);function Cv(e){if(!bv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}yv(Cv,`getOwnerDocument`);function wv(e,t=!1){let{activeElement:n}=Cv(e);if(!n?.nodeName)return null;if(Tv(n)&&n.contentDocument)return wv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Cv(n).getElementById(e);if(t)return t}}return n}yv(wv,`getActiveElement`);function Tv(e){return e.tagName===`IFRAME`}yv(Tv,`isFrame`);var Ev=globalThis?.document?m.useLayoutEffect:()=>{},Dv=Object.defineProperty,Ov=(e,t)=>Dv(e,`name`,{value:t,configurable:!0}),kv=m.useEffectEvent,Av=m.useInsertionEffect;function jv(e){if(typeof kv==`function`)return kv(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Av==`function`?Av(()=>{t.current=e}):Ev(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ov(jv,`useEffectEvent`);var Mv=Object.defineProperty,Nv=(e,t)=>Mv(e,`name`,{value:t,configurable:!0}),Pv=m.useInsertionEffect||Ev;function Fv({prop:e,defaultProp:t,onChange:n=Nv(()=>{},`onChange`),caller:r}){let[i,a,o]=Iv({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Lv(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Nv(Fv,`useControllableState`);function Iv({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Pv(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Nv(Iv,`useUncontrolledState`);function Lv(e){return typeof e==`function`}Nv(Lv,`isFunction`);var Rv=Symbol(`RADIX:SYNC_STATE`);function zv(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=jv(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Rv)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:Rv,state:i})},[i,d.state,c]),[g,f]}Nv(zv,`useControllableStateReducer`);var Bv=Object.defineProperty,Vv=(e,t)=>Bv(e,`name`,{value:t,configurable:!0});function Hv(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}Vv(Hv,`useStateMachine`);var Uv=Vv(e=>{let{present:t,children:n}=e,r=Wv(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=Kv(r.ref,Jv(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function Wv(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]=Hv(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??qv(r.current),o.current=void 0):a.current=`none`},[s]),Ev(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=qv(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]),Ev(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Vv(a=>{let o=qv(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=Vv(e=>{e.target===t&&(a.current=qv(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=qv(t)}else r.current=null;n(e)},[])}}Vv(Wv,`usePresence`);function Gv(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Vv(Gv,`setRef`);function Kv(...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=Gv(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():Gv(n[e],null)}}},[])}Vv(Kv,`useStableComposedRefs`);function qv(e){return e?.animationName||`none`}Vv(qv,`getAnimationName`);function Jv(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)}Vv(Jv,`getElementRef`);var Yv=Object.defineProperty,Xv=(e,t)=>Yv(e,`name`,{value:t,configurable:!0}),Zv=m.useId||(()=>void 0),Qv=0;function $v(e){let[t,n]=m.useState(Zv());return Ev(()=>{e||n(e=>e??String(Qv++))},[e]),e||(t?`radix-${t}`:``)}Xv($v,`useId`);var ey=Object.defineProperty,ty=(e,t)=>ey(e,`name`,{value:t,configurable:!0});function ny(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}ty(ny,`useCallbackRef`);var ry=Object.defineProperty,iy=(e,t)=>ry(e,`name`,{value:t,configurable:!0}),ay=`dismissableLayer.update`,oy=`dismissableLayer.pointerDownOutside`,sy=`dismissableLayer.focusOutside`,cy,ly=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),uy=m.forwardRef(iy(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(ly),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=V_(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=py(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=my(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,ee=ny(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,E,ee]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(cy=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),hy(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=cy))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),hy())},[d,u]),m.useEffect(()=>{let e=iy(()=>h({}),`handleUpdate`);return document.addEventListener(ay,e),()=>document.removeEventListener(ay,e)},[]),(0,I.jsx)(sv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:xv(e.onFocusCapture,T.onFocusCapture),onBlurCapture:xv(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:xv(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function dy(){let e=m.useContext(ly),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}iy(dy,`useDismissableLayerSurface`);var fy=iy(()=>!0,`IS_TRUE`);function py(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=fy}=t,s=ny(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()}iy(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}iy(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)}iy(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}iy(p,`handleInteractionBubble`);let m=iy(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||gy(oy,s,p,{discrete:!0})};if(iy(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:iy(()=>c.current=!0,`onPointerDownCapture`)}}iy(py,`usePointerDownOutside`);function my(e,t=globalThis?.document){let n=ny(e),r=m.useRef(!1);return m.useEffect(()=>{let e=iy(e=>{e.target&&!r.current&&gy(sy,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:iy(()=>r.current=!0,`onFocusCapture`),onBlurCapture:iy(()=>r.current=!1,`onBlurCapture`)}}iy(my,`useFocusOutside`);function hy(){let e=new CustomEvent(ay);document.dispatchEvent(e)}iy(hy,`dispatchUpdate`);function gy(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?cv(i,a):i.dispatchEvent(a)}iy(gy,`handleAndDispatchCustomEvent`);var _y=Object.defineProperty,vy=(e,t)=>_y(e,`name`,{value:t,configurable:!0}),yy=`focusScope.autoFocusOnMount`,by=`focusScope.autoFocusOnUnmount`,xy={bubbles:!1,cancelable:!0},Sy=m.forwardRef(vy(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=ny(i),u=ny(a),d=m.useRef(null),f=V_(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:ky(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ky(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ky(s)};vy(e,`handleFocusIn`),vy(t,`handleFocusOut`),vy(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){Ay.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(yy,xy);s.addEventListener(yy,l),s.dispatchEvent(t),t.defaultPrevented||(Cy(Ny(Ty(s)),{select:!0}),document.activeElement===e&&ky(s))}return()=>{s.removeEventListener(yy,l),setTimeout(()=>{let t=new CustomEvent(by,xy);s.addEventListener(by,u),s.dispatchEvent(t),t.defaultPrevented||ky(e??document.body,{select:!0}),s.removeEventListener(by,u),Ay.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]=wy(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ky(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ky(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(sv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Cy(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ky(r,{select:t}),document.activeElement!==n)return}vy(Cy,`focusFirst`);function wy(e){let t=Ty(e);return[Ey(t,e),Ey(t.reverse(),e)]}vy(wy,`getTabbableEdges`);function Ty(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:vy(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}vy(Ty,`getTabbableCandidates`);function Ey(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Dy(r,{upTo:t})))return r}vy(Ey,`findVisible`);function Dy(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}vy(Dy,`isHidden`);function Oy(e){return e instanceof HTMLInputElement&&`select`in e}vy(Oy,`isSelectableInput`);function ky(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Oy(e)&&t&&e.select()}}vy(ky,`focus`);var Ay=jy();function jy(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=My(e,t),e.unshift(t)},remove(t){e=My(e,t),e[0]?.resume()}}}vy(jy,`createFocusScopesStack`);function My(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}vy(My,`arrayRemove`);function Ny(e){return e.filter(e=>e.tagName!==`A`)}vy(Ny,`removeLinks`);var Py=Object.defineProperty,Fy=m.forwardRef(((e,t)=>Py(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Ev(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?iv.createPortal((0,I.jsx)(sv.div,{...r,ref:t}),o):null},`Portal`)),Iy=Object.defineProperty,Ly=(e,t)=>Iy(e,`name`,{value:t,configurable:!0}),Ry=0,zy=null;function By(e){return Vy(),e.children}Ly(By,`FocusGuards`);function Vy(){m.useEffect(()=>{zy||={start:Hy(),end:Hy()};let{start:e,end:t}=zy;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ry++,()=>{Ry===1&&(zy?.start.remove(),zy?.end.remove(),zy=null),Ry=Math.max(0,Ry-1)}},[])}Ly(Vy,`useFocusGuards`);function Hy(){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}Ly(Hy,`createFocusGuard`);var Uy=function(){return Uy=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},Uy.apply(this,arguments)};function Wy(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 Gy(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 Ky=`right-scroll-bar-position`,qy=`width-before-scroll-bar`,Jy=`with-scroll-bars-hidden`,Yy=`--removed-body-scroll-bar-size`;function Xy(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function Zy(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 Qy=typeof window<`u`?m.useLayoutEffect:m.useEffect,$y=new WeakMap;function eb(e,t){var n=Zy(t||null,function(t){return e.forEach(function(e){return Xy(e,t)})});return Qy(function(){var t=$y.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||Xy(e,null)}),i.forEach(function(e){r.has(e)||Xy(e,a)})}$y.set(n,e)},[e]),n}function tb(e){return e}function nb(e,t){t===void 0&&(t=tb);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 rb(e){e===void 0&&(e={});var t=nb(null);return t.options=Uy({async:!0,ssr:!1},e),t}var ib=function(e){var t=e.sideCar,n=Wy(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,Uy({},n))};ib.isSideCarExport=!0;function ab(e,t){return e.useMedium(t),ib}var ob=rb(),sb=function(){},cb=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:sb,onWheelCapture:sb,onTouchMoveCapture:sb}),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=Wy(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=eb([n,t]),w=Uy(Uy({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:ob,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),Uy(Uy({},w),{ref:C})):m.createElement(y,Uy({},w,{className:c,ref:C}),s))});cb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},cb.classNames={fullWidth:qy,zeroRight:Ky};var lb=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ub(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=lb();return t&&e.setAttribute(`nonce`,t),e}function db(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function fb(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var pb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ub())&&(db(t,n),fb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mb=function(){var e=pb();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},hb=function(){var e=mb();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},gb={left:0,top:0,right:0,gap:0},_b=function(e){return parseInt(e||``,10)||0},vb=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[_b(n),_b(r),_b(i)]},yb=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return gb;var t=vb(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])}},bb=hb(),xb=`data-scroll-locked`,Sb=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
|
-
.${
|
|
18
|
+
`).replace(cp,``)}function lp(e,t){return t=U(t),U(e)===t}function up(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&hn(e,``+r);else return;break;case`className`:$t(e,`class`,r);break;case`tabIndex`:$t(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:$t(e,n,r);break;case`style`:vn(e,r,o);return;case`data`:if(t!==`object`){$t(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=Sn(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=Sn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Cn);return;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`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=Sn(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`:H(`beforetoggle`,e),H(`toggle`,e),Qt(e,`popover`,r);break;case`xlinkActuate`:en(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:en(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:en(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:en(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:en(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:en(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Qt(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=bn.get(n)||n,Qt(e,n,r);else return}Xt=!0}function dp(e,t,n,r,a,o){switch(n){case`style`:vn(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`)hn(e,r);else if(typeof r==`number`||typeof r==`bigint`)hn(e,``+r);else return;break;case`onScroll`:r!=null&&H(`scroll`,e);return;case`onScrollEnd`:r!=null&&H(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Cn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Ut.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[Ot]||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}Xt=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Qt(e,n,r)}return}Xt=!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`:H(`error`,e),H(`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`:H(`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)}}un(e,o,c,l,u,s,a,!1);return;case`select`:for(a in H(`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&&fn(e,!!r,n,!0):fn(e,!!r,t,!1);return;case`textarea`:for(s in H(`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)}mn(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`:H(`beforetoggle`,e),H(`toggle`,e),H(`cancel`,e),H(`close`,e);break;case`iframe`:case`object`:H(`load`,e);break;case`video`:case`audio`:for(r=0;r<Xf.length;r++)H(Xf[r],e);break;case`image`:H(`error`,e),H(`load`,e);break;case`details`:H(`toggle`,e);break;case`embed`:case`source`:case`link`:H(`error`,e),H(`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(yn(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&&(Xt=!0),o=m;break;case`name`:m!==f&&(Xt=!0),a=m;break;case`checked`:m!==f&&(Xt=!0),u=m;break;case`defaultChecked`:m!==f&&(Xt=!0),d=m;break;case`value`:m!==f&&(Xt=!0),s=m;break;case`defaultValue`:m!==f&&(Xt=!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)}}ln(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&&(Xt=!0),p=o;break;case`defaultValue`:o!==l&&(Xt=!0),c=o;break;case`multiple`:o!==l&&(Xt=!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?fn(e,!!n,n?[]:``,!1):fn(e,!!n,t,!0)):fn(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&&(Xt=!0),p=a;break;case`defaultValue`:a!==o&&(Xt=!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)}pn(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&&(Xt=!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(yn(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 bp(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 xp(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 Sp(e,t,n,r){return n=yp(n).createElement(e),n[Dt]=r,n[Ot]=t,fp(n,e,t),Bt(n),n}function Cp(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 wp=null;function Tp(){var e=window.event;return e&&e.type===`popstate`?e!==wp&&(wp=e,!0):(wp=null,!1)}var Ep=typeof setTimeout==`function`?setTimeout:void 0,Dp=typeof clearTimeout==`function`?clearTimeout:void 0,Op=typeof Promise==`function`?Promise:void 0,kp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Ep,Ap=typeof queueMicrotask==`function`?queueMicrotask:Op===void 0?Ep:function(e){return Op.resolve(null).then(e).catch(jp)};function jp(e){setTimeout(function(){throw e})}function Mp(e){return e===`head`}function Np(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),Qh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Dm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Dm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Pt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Dm(e.ownerDocument.body)}n=i}while(n);Qh(t)}function Pp(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 Fp(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 Ip(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 Lp(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 Rp(e){return Lp(e.getBoundingClientRect(),getComputedStyle(e),e)}function zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Lp(t,n,e)}function Bp(e){return e.documentElement.clientHeight}function Vp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Hp(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`&&(Bp(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+=oh(f),u>lh){s.length=o;break}f=new Promise(Vp.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 Up(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Up.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Up.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},Up.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Wp(e){return{name:e,group:new Up(`group`,e),imagePair:new Up(`image-pair`,e),old:new Up(`old`,e),new:new Up(`new`,e)}}function Gp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Gp.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(Xp(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=Jp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),f(this._fragmentFiber.child,!1,Kp,e,s,r)}this._eventListeners=a}};function Kp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Gp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Xp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Jp(i.optionsOrUseCapture),f(this._fragmentFiber.child,!1,qp,e,n,i),r.splice(t,1),a!==null&&a()}};function qp(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Jp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Yp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Xp(e,t,n,r){if(e.length===0)return-1;r=Yp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Yp(a.optionsOrUseCapture)===r)return i}return-1}Gp.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,Jp(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,Jp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Gp.prototype.focus=function(e){f(this._fragmentFiber.child,!0,Zp,e,void 0,void 0)};function Zp(e,t){return e.tag!==6&&(e=v(e),Cm(e,t))}Gp.prototype.focusLast=function(e){var t=[];f(this._fragmentFiber.child,!0,Qp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Zp(t[n],e);n--);};function Qp(e,t){return t.push(e),!1}Gp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=yp(e).activeElement,e!==null&&f(this._fragmentFiber.child,!1,$p,e,void 0,void 0))};function $p(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Gp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),f(this._fragmentFiber.child,!1,em,e,void 0,void 0)};function em(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Gp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),f(this._fragmentFiber.child,!1,tm,e,void 0,void 0);for(var n=t=0;n<nm.length;n++){var r=nm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):nm[t++]=r}nm.length=t}};function tm(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var nm=[],rm=!1;function im(e,t,n){nm.push({fragmentInstance:e,observer:t,instance:n}),rm||(rm=!0,wm(function(){rm=!1;var e=nm;nm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Gp.prototype.getClientRects=function(){var e=[];return f(this._fragmentFiber.child,!1,am,e,void 0,void 0),e};function am(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}Gp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Gp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];f(this._fragmentFiber.child,!1,Qp,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||om(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function om(e,t,n,r,i){var a=Lt(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 sm(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)}Gp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];f(this._fragmentFiber.child,!1,Qp,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),sm(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),sm(a,n)):v(a).scrollIntoView(e),r+=n?-1:1}};function cm(e,t){return e=v(e),lm(e,t),!1}function lm(e,t){e.reactFragments??=new Set,e.reactFragments.add(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.addEventListener(i.type,i.attachedListener,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<nm.length;i++){var a=nm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(nm[r++]=a)}nm.length=r,n.observe(e)}),lm(e,t))}function dm(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,Jp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?im(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function fm(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`:fm(n),It(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function pm(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[Pt])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=ym(e.nextSibling),e===null)break}return null}function mm(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=ym(e.nextSibling),e===null))return null;return e}function hm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=ym(e.nextSibling),e===null))return null;return e}function gm(e){return e.data===`$?`||e.data===`$~`}function _m(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function vm(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 ym(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 bm=null;function xm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return ym(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Sm(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 Cm(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 wm(e){kp(function(){kp(function(t){return e(t)})})}function Tm(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 Em(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===Cn&&(e.onclick=null),It(e)}function Dm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);It(e)}var Om=new Map,km=new Set;function Am(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 jm=j.d;j.d={f:Mm,r:Nm,D:Im,C:Lm,L:Rm,m:zm,X:Vm,S:Bm,M:Hm};function Mm(){var e=jm.f(),t=Yd();return e||t}function Nm(e){var t=Rt(e);t!==null&&t.tag===5&&t.type===`form`?cc(t):jm.r(e)}var Pm=typeof document>`u`?null:document;function Fm(e,t,n){var r=Pm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),km.has(i)||(km.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),fp(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Im(e){jm.D(e),Fm(`dns-prefetch`,e,null)}function Lm(e,t){jm.C(e,t),Fm(`preconnect`,e,t)}function Rm(e,t,n){jm.L(e,t,n);var r=Pm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Wm(e);break;case`script`:a=Jm(e)}if(!(Om.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Om.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Gm(a))||t===`script`&&r.querySelector(Ym(a))))){var o=r.createElement(`link`);fp(o,`link`,e),t===`style`&&(o[Ft]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function zm(e,t){jm.m(e,t);var n=Pm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Jm(e)}if(!Om.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Om.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ym(a)))return}r=n.createElement(`link`),fp(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Bm(e,t,n){jm.S(e,t,n);var r=Pm;if(r&&e){var i=zt(r).hoistableStyles,a=Wm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Gm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Om.get(a))&&Qm(e,n);var c=o=r.createElement(`link`);Bt(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,Zm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Vm(e,t){jm.X(e,t);var n=Pm;if(n&&e){var r=zt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Bt(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){jm.M(e,t);var n=Pm;if(n&&e){var r=zt(n).hoistableScripts,i=Jm(e),a=r.get(i);a||(a=n.querySelector(Ym(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Om.get(i))&&$m(e,t),a=n.createElement(`script`),Bt(a),fp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t,n,r){var a=(a=De.current)?Am(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=Wm(n.href),t=zt(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=Wm(n.href);var o=zt(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(Gm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Om.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},Om.set(e,o)),qm(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=Jm(n),t=zt(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 Wm(e){return`href="`+cn(e)+`"`}function Gm(e){return`link[rel="stylesheet"][`+e+`]`}function Km(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function qm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Ft]){r.loading=1;return}}else t=e.createElement(`link`),t[Ft]=!0,t.onload=t.onerror=Vt.bind(null,t),fp(t,`link`,n),Bt(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 Jm(e){return`[src="`+cn(e)+`"]`}function Ym(e){return`script[async]`+e}function Xm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Bt(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`),Bt(r),fp(r,`style`,a),Zm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Wm(n.href);var o=e.querySelector(Gm(a));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=Km(n),(a=Om.get(a))&&Qm(r,a),o=(e.ownerDocument||e).createElement(`link`),Bt(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,Zm(o,n.precedence,e),t.instance=o;case`script`:return o=Jm(n.src),(a=e.querySelector(Ym(o)))?(t.instance=a,Bt(a),a):(r=n,(a=Om.get(o))&&(r=T({},n),$m(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Bt(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,Zm(r,n.precedence,e));return t.instance}function Zm(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 Qm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function $m(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var eh=null;function th(e,t,n){if(eh===null){var r=new Map,i=eh=new Map;i.set(n,r)}else i=eh,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[Pt]||a[Dt]||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 nh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function rh(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 ih(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ah(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function oh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function sh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=oh(t),e.suspenseyImages.push(t)),e=ph.bind(e),t.decode().then(e,e))}function ch(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=Wm(r.href),a=t.querySelector(Gm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=fh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=Km(r),(i=Om.get(i))&&Qm(r,i),a=a.createElement(`link`),Bt(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=fh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var lh=0;function uh(e,t){return e.stylesheets&&e.count===0&&hh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&lh===0&&(lh=62500*gp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&hh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>lh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function dh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)hh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function fh(){this.count--,dh(this)}function ph(){this.imgCount--,dh(this)}var mh=null;function hh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,mh=new Map,t.forEach(gh,e),mh=null,fh.call(e))}function gh(e,t){if(!(t.state.loading&4)){var n=mh.get(e);if(n)var r=n.get(null);else{n=new Map,mh.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=fh.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 _h={$$typeof:O,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function vh(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=gt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.hiddenUpdates=gt(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 yh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new vh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ii(3,null,null,t),e.current=a,a.stateNode=e,t=Ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},yo(a),e}function bh(e){return e?(e=Pi,e):Pi}function xh(e,t,n,r,i,a){i=bh(i),r.context===null?r.context=i:r.pendingContext=i,r=xo(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=So(e,r,t),n!==null&&(Wd(n,e,t),Co(n,e,t))}function Sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ch(e,t){Sh(e,t),(e=e.alternate)&&Sh(e,t)}function wh(e){if(e.tag===13||e.tag===31){var t=ji(e,67108864);t!==null&&Wd(t,e,67108864),Ch(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=Vd();t=St(t);var n=ji(e,t);n!==null&&Wd(n,e,t),Ch(e,t)}}var Eh=!0;function Dh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=2,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function Oh(e,t,n,r){var i=A.T;A.T=null;var a=j.p;try{j.p=8,kh(e,t,n,r)}finally{j.p=a,A.T=i}}function kh(e,t,n,r){if(Eh){var i=Ah(r);if(i===null)np(e,t,r,jh,n),Hh(e,r);else if(Wh(i,e,t,n,r))r.stopPropagation();else if(Hh(e,r),t&4&&-1<Vh.indexOf(e)){for(;i!==null;){var a=Rt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=ut(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-rt(o);s.entanglements[1]|=c,o&=~c}B(a),!(sd&6)&&(Ed=Ge()+500,Rf(0,!1))}}break;case 31:case 13:s=ji(a,2),s!==null&&Wd(s,a,2),Yd(),Ch(a,2)}if(a=Ah(r),a===null&&np(e,t,r,jh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else np(e,t,r,null,n)}}function Ah(e){return e=Tn(e),Mh(e)}var jh=null;function Mh(e){if(jh=null,e=Lt(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 jh=e,null}function Nh(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(Ke()){case qe:return 2;case Je:return 8;case Ye:case Xe:return 32;case Ze:return 268435456;default:return 32}default:return 32}}var Ph=!1,Fh=null,Ih=null,Lh=null,Rh=new Map,zh=new Map,Bh=[],Vh=`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 Hh(e,t){switch(e){case`focusin`:case`focusout`:Fh=null;break;case`dragenter`:case`dragleave`:Ih=null;break;case`mouseover`:case`mouseout`:Lh=null;break;case`pointerover`:case`pointerout`:Rh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:zh.delete(t.pointerId)}}function Uh(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=Rt(t),t!==null&&wh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Wh(e,t,n,r,i){switch(t){case`focusin`:return Fh=Uh(Fh,e,t,n,r,i),!0;case`dragenter`:return Ih=Uh(Ih,e,t,n,r,i),!0;case`mouseover`:return Lh=Uh(Lh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Rh.set(a,Uh(Rh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,zh.set(a,Uh(zh.get(a)||null,e,t,n,r,i)),!0}return!1}function Gh(e){var t=Lt(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,Tt(e.priority,function(){Th(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Tt(e.priority,function(){Th(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 Kh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ah(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);wn=r,n.target.dispatchEvent(r),wn=null}else return t=Rt(n),t!==null&&wh(t),e.blockedOn=n,!1;t.shift()}return!0}function qh(e,t,n){Kh(e)&&n.delete(t)}function Jh(){Ph=!1,Fh!==null&&Kh(Fh)&&(Fh=null),Ih!==null&&Kh(Ih)&&(Ih=null),Lh!==null&&Kh(Lh)&&(Lh=null),Rh.forEach(qh),zh.forEach(qh)}function Yh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ph||(Ph=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jh)))}var Xh=null;function Zh(e){Xh!==e&&(Xh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xh===e&&(Xh=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(Mh(r||n)===null)continue;break}var a=Rt(n);a!==null&&(e.splice(t,3),t-=3,oc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Qh(e){function t(t){return Yh(t,e)}Fh!==null&&Yh(Fh,e),Ih!==null&&Yh(Ih,e),Lh!==null&&Yh(Lh,e),Rh.forEach(t),zh.forEach(t);for(var n=0;n<Bh.length;n++){var r=Bh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Bh.length&&(n=Bh[0],n.blockedOn===null);)Gh(n),n.blockedOn===null&&Bh.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[Ot]||null;if(typeof a==`function`)o||Zh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ot]||null)s=o.formAction;else if(Mh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Zh(n)}}}function $h(){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 eg(e){this._internalRoot=e}tg.prototype.render=eg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;xh(n,Vd(),e,t,null,null)},tg.prototype.unmount=eg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xh(e.current,2,null,e,null,null),Yd(),t[kt]=null}};function tg(e){this._internalRoot=e}tg.prototype.unstable_scheduleHydration=function(e){if(e){var t=wt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Bh.length&&t!==0&&t<Bh[n].priority;n++);Bh.splice(n,0,e),n===0&&Gh(e)}};var ng=n.version;if(ng!==`19.3.0`)throw Error(i(527,ng,`19.3.0`));j.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 rg={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:A,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var ig=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ig.isDisabled&&ig.supportsFiber)try{et=ig.inject(rg),tt=ig}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=kc,s=Ac,c=jc;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=yh(e,1,!1,null,null,n,r,null,o,s,c,$h),e[kt]=t.current,ep(e),new eg(t)}})),wf=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=Cf()}))(),Tf={activity:400,thoughts:40,chat:100};function Ef(e,t,n){let r=e??[],i=new Set(r.map(e=>e.id)),a=t.filter(e=>typeof e?.id==`number`&&!i.has(e.id));return[...r,...a].slice(-n)}var Df=class{records=new Map;listeners=new Set;reads=new Map;used=new Set;reader;currentStatus={connection:`connecting`,signedOut:!1};get(e){let t=this.records.get(e);if(t)return t;let n={version:0,data:void 0,loading:!1,error:void 0,stale:!1};return this.records.set(e,n),n}status(){return{...this.currentStatus}}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}markUsed(e,t){this.reader=t;let n=e.filter(e=>!this.used.has(e));this.used=new Set(e);for(let e of n)this.read(e)}onHello(e){for(let t of this.used){let n=e[t];n!==void 0&&(this.get(t).version=n),this.read(t)}}onChanged(e,t){let n=this.get(e);n.version=t,this.used.has(e)?this.read(e):n.stale=!0,this.notify()}onFeedDelta(e){let t=this.get(`lobby`).data;t&&(this.get(`lobby`).data={...t,activity:Ef(t.activity,e.activity??[],Tf.activity),thoughts:Ef(t.thoughts,e.thoughts??[],Tf.thoughts),chat:Ef(t.chat,e.chat??[],Tf.chat)},this.notify())}onReplyDelta(e){let t=this.get(`lobby`),n=t.data;n&&(t.data={...n,reply:e},this.notify())}onStatus(e){this.currentStatus={...this.currentStatus,...e},this.notify()}async read(e){let t=this.reader;if(!t)return;let n=(this.reads.get(e)??0)+1;this.reads.set(e,n);let r=this.get(e);r.loading=!0,r.error=void 0,this.notify();try{let i=await t(e);if(this.reads.get(e)!==n)return;this.apply(r,i)}catch(t){if(this.reads.get(e)!==n)return;r.loading=!1,r.error=t instanceof Error?t.message:String(t)}this.notify()}apply(e,t){e.data=t,e.loading=!1,e.stale=!1,e.error=void 0}notify(){for(let e of[...this.listeners])e()}};function Of(){return new Df}var kf=Of(),Af={info:3600,success:3e3,warning:5e3,error:6e3},jf,Mf=[],Nf=0,Pf=new Set;function Ff(){for(let e of[...Pf])e()}function If(e,t,n){let r=t.trim();if(!r||jf?.message===r||Mf.some(e=>e.message===r))return;let i={id:++Nf,kind:e,message:r,duration:n?.duration??Af[e],...n?.action?{action:n.action}:{}};jf?Mf=[...Mf,i].slice(-3):jf=i,Ff()}function Lf(e){jf?.id===e&&(jf=Mf[0],Mf=Mf.slice(1),Ff())}var B=Object.assign((e,t)=>If(`info`,e,t),{success:(e,t)=>If(`success`,e,t),error:(e,t)=>If(`error`,e,t),warning:(e,t)=>If(`warning`,e,t),info:(e,t)=>If(`info`,e,t)});function Rf(e){return Pf.add(e),()=>{Pf.delete(e)}}function zf(){return{item:(0,m.useSyncExternalStore)(Rf,()=>jf,()=>void 0),waiting:(0,m.useSyncExternalStore)(Rf,()=>Mf.length,()=>0)}}var Bf=/^[a-f0-9]{32}$/;function Vf(){return globalThis.location}function Hf(){let e=Vf()?.search??``,t=new URLSearchParams(e).getAll(`project`);if(t.length){if(t.length!==1||!Bf.test(t[0]))throw Error(`Invalid project ID. Choose a running project below.`);return t[0]}}function Uf(e){if(!e.startsWith(`/api/`)&&!e.startsWith(`/files/preview/`))return e;let t=Hf();return t?`/projects/${t}${e}`:e}function Wf(e,t){if(!Bf.test(e))throw Error(`Invalid project ID.`);let n=Vf();if(!n)throw Error(`Project switching requires a browser.`);let r=new URL(n.origin);r.pathname=n.pathname,r.searchParams.set(`project`,e),r.hash=`/${t}`,n.assign(r.href)}var Gf=class extends Error{code;status;constructor(e,t,n){super(e),this.name=`ApiError`,this.code=t,this.status=n}},Kf={"Content-Type":`application/json`};async function qf(e,t={}){let n=await fetch(e===`auth.login`||e===`projects.list`?`/api/${e}`:Uf(`/api/${e}`),{method:`POST`,headers:Kf,body:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>void 0);if(!r)throw new Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw r.code===`unauthorized`&&kf.onStatus({signedOut:!0}),new Gf(r.error,r.code,n.status);return r.result}function Jf(){return globalThis.location}async function Yf(){let e=Jf(),t=e?new URLSearchParams(e.hash.replace(/^#/,``)).get(`token`):null;if(!t||!(await fetch(`/api/auth.login`,{method:`POST`,headers:Kf,body:JSON.stringify({token:t}),credentials:`same-origin`}).catch(()=>void 0))?.ok)return!1;let n=globalThis.history;return n&&n.replaceState(null,``,e.pathname+e.search),kf.onStatus({signedOut:!1}),!0}function Xf(e){return e instanceof Error?e.message:`That did not work. Try again.`}async function V(e,t,n={}){try{let r=await qf(e,t),i=r.notice;return i&&B(i,n.undo?{action:{label:`Undo`,onClick:n.undo}}:void 0),r}catch(e){B.error(Xf(e));return}}var Zf=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function H(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:Zf(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var Qf=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},$f=e=>{let t=Qf(e);return t.charAt(0).toUpperCase()+t.slice(1)},ep=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),tp={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 np(e){return e!=null}function rp(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??tp.width,a=e.size??e.height??tp.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?ep(...c):ep(`lucide`,...s,...c),u=t.absoluteStrokeWidth?Number(t.strokeWidth??tp[`stroke-width`])*Number(e.size??e.width??tp.width)/Number(t.size??t.width??tp.width):t.strokeWidth??tp[`stroke-width`];return[`svg`,{...Object.entries(tp).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&np(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&np(t.width)&&{[r(`width`)]:t.width},...`height`in t&&np(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 ip(e,t={}){return rp(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var ap=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},op=(0,m.createContext)({}),sp=()=>(0,m.useContext)(op),cp=(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=``}=sp()??{},b=!!c||ap(d),[x,S,C=[]]=ip(u,{color:e??v,width:n??t??p,height:r??t??p,strokeWidth:i??h,absoluteStrokeWidth:a??g,nonScalingStroke:o??_,className:ep(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 U(e,t=[],n=[]){let r=typeof e==`string`?H(e,t,n):e,i=(0,m.forwardRef)(({className:e,...t},n)=>(0,m.createElement)(cp,{ref:n,icon:r,className:e,...t}));return r.name&&(i.displayName=$f(r.name)),i}var lp={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`}]]};lp.node;var up=U(lp),dp={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`}]]};dp.node;var fp=U(dp),pp={name:`arrow-down`,size:24,node:[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]};pp.node;var mp=U(pp),hp={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};hp.node;var gp=U(hp),_p={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`}]]};_p.node;var vp=U(_p),yp={name:`arrow-up`,size:24,node:[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]};yp.node;var bp=U(yp),xp={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`}]]};xp.node;var Sp=U(xp),Cp={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`}]]};Cp.node;var wp=U(Cp),Tp={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`}]]};Tp.node;var Ep=U(Tp),Dp={name:`chart-column`,size:24,node:[[`path`,{d:`M3 3v16a2 2 0 0 0 2 2h16`,key:`c24i48`}],[`path`,{d:`M18 17V9`,key:`2bz60n`}],[`path`,{d:`M13 17V5`,key:`1frdt8`}],[`path`,{d:`M8 17v-3`,key:`17ska0`}]],aliases:[`bar-chart-3`]};Dp.node;var Op=U(Dp),kp={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};kp.node;var Ap=U(kp),jp={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};jp.node;var Mp=U(jp),Np={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};Np.node;var Pp=U(Np),Fp={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`}]]};Fp.node;var Ip=U(Fp),Lp={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`}]]};Lp.node;var Rp=U(Lp),zp={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`]};zp.node;var Bp=U(zp),Vp={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`]};Vp.node;var Hp=U(Vp),Up={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`}]]};Up.node;var Wp=U(Up),Gp={name:`circle-dot`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};Gp.node;var Kp=U(Gp),qp={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`]};qp.node;var Jp=U(qp),Yp={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`]};Yp.node;var Xp=U(Yp),Zp={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`]};Zp.node;var Qp=U(Zp),$p={name:`circle`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]};$p.node;var em=U($p),tm={name:`clock`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]};tm.node;var nm=U(tm),rm={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`]};rm.node;var im=U(rm),am={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`}]]};am.node;var om=U(am),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=U(sm),lm={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`}]]};lm.node;var um=U(lm),dm={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`}]]};dm.node;var fm=U(dm),pm={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`}]]};pm.node;var mm=U(pm),hm={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`]};hm.node;var gm=U(hm),_m={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`}]]};_m.node;var vm=U(_m),ym={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`}]]};ym.node;var bm=U(ym),xm={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`}]]};xm.node;var Sm=U(xm),Cm={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`}]]};Cm.node;var wm=U(Cm),Tm={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`}]]};Tm.node;var Em=U(Tm),Dm={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`}]]};Dm.node;var Om=U(Dm),km={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`}]]};km.node;var Am=U(km),jm={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`]};jm.node;var Mm=U(jm),Nm={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`}]]};Nm.node;var Pm=U(Nm),Fm={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`}]]};Fm.node;var Im=U(Fm),Lm={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`}]]};Lm.node;var Rm=U(Lm),zm={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`}]]};zm.node;var Bm=U(zm),Vm={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`]};Vm.node;var Hm=U(Vm),Um={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`}]]};Um.node;var Wm=U(Um),Gm={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`}]]};Gm.node;var Km=U(Gm),qm={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`}]]};qm.node;var Jm=U(qm),Ym={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`}]]};Ym.node;var Xm=U(Ym),Zm={name:`minus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]};Zm.node;var Qm=U(Zm),$m={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`}]]};$m.node;var eh=U($m),th={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`}]]};th.node;var nh=U(th),rh={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`}]]};rh.node;var ih=U(rh),ah={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`}]]};ah.node;var oh=U(ah),sh={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`}]]};sh.node;var ch=U(sh),lh={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`}]]};lh.node;var uh=U(lh),dh={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`}]]};dh.node;var fh=U(dh),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 mh=U(ph),hh={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`}]]};hh.node;var gh=U(hh),_h={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`}]]};_h.node;var vh=U(_h),yh={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`}]]};yh.node;var bh=U(yh),xh={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};xh.node;var Sh=U(xh),Ch={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`}]]};Ch.node;var wh=U(Ch),Th={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`}]]};Th.node;var Eh=U(Th),Dh={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`}]]};Dh.node;var Oh=U(Dh),kh={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`}]]};kh.node;var Ah=U(kh),jh={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`}]]};jh.node;var Mh=U(jh),Nh={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};Nh.node;var Ph=U(Nh),Fh={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};Fh.node;var Ih=U(Fh),Lh={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`}]]};Lh.node;var Rh=U(Lh),zh={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`}]]};zh.node;var Bh=U(zh),Vh={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`]};Vh.node;var Hh=U(Vh),Uh={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`]};Uh.node;var Wh=U(Uh),Gh={name:`square`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]};Gh.node;var Kh=U(Gh),qh={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`}]]};qh.node;var Jh=U(qh),Yh={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`}]]};Yh.node;var Xh=U(Yh),Zh={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`}]]};Zh.node;var Qh=U(Zh),$h={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`]};$h.node;var eg=U($h),tg={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`]};tg.node;var ng=U(tg),rg={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`}]]};rg.node;var ig=U(rg),ag={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`}]]};ag.node;var og=U(ag),sg={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`}]]};sg.node;var cg=U(sg),lg={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`}]]};lg.node;var ug=U(lg),dg={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`}]]};dg.node;var fg=U(dg),pg={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`}]]};pg.node;var mg=U(pg),hg={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};hg.node;var gg=U(hg),_g={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`}]]};_g.node;var vg=U(_g);function yg(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=yg(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function bg(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=yg(e))&&(r&&(r+=` `),r+=t);return r}var xg=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Sg=bg,Cg=(e,t)=>n=>{if(t?.variants==null)return Sg(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=xg(t)||xg(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 Sg(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)},wg=(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},Tg=(e,t)=>({classGroupId:e,validator:t}),Eg=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Dg=`-`,Og=[],kg=`arbitrary..`,Ag=e=>{let t=Ng(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Mg(e);let n=e.split(Dg);return jg(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?wg(i,t):t:i||Og}return n[e]||Og}}},jg=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=jg(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Dg):e.slice(t).join(Dg),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Mg=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?kg+r:void 0})(),Ng=e=>{let{theme:t,classGroups:n}=e;return Pg(n,t)},Pg=(e,t)=>{let n=Eg();for(let r in e){let i=e[r];Fg(i,n,r,t)}return n},Fg=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ig(i,t,n,r)}},Ig=(e,t,n,r)=>{if(typeof e==`string`){Lg(e,t,n);return}if(typeof e==`function`){Rg(e,t,n,r);return}zg(e,t,n,r)},Lg=(e,t,n)=>{let r=e===``?t:Bg(t,e);r.classGroupId=n},Rg=(e,t,n,r)=>{if(Vg(e)){Fg(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Tg(n,e))},zg=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Fg(o,Bg(t,a),n,r)}},Bg=(e,t)=>{let n=e,r=t.split(Dg),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Eg(),n.nextPart.set(t,i)),n=i}return n},Vg=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,Hg=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)}}},Ug=`!`,Wg=`:`,Gg=[],Kg=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),qg=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===Wg){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(Ug)?(c=s.slice(0,-1),l=!0):s.startsWith(Ug)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Kg(t,l,c,u)};if(t){let e=t+Wg,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Kg(Gg,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Jg=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}},Yg=e=>({cache:Hg(e.cacheSize),parseClassName:qg(e),sortModifiers:Jg(e),postfixLookupClassGroupIds:Xg(e),...Ag(e)}),Xg=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},Zg=/\s+/,Qg=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Zg),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?_+Ug:_,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},$g=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=e_(n))&&(i&&(i+=` `),i+=r);return i},e_=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=e_(e[r]))&&(n&&(n+=` `),n+=t);return n},t_=(e,...t)=>{let n,r,i,a,o=o=>(n=Yg(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=Qg(e,n);return i(e,a),a};return a=o,(...e)=>a($g(...e))},n_=[],r_=e=>{let t=t=>t[e]||n_;return t.isThemeGetter=!0,t.themeKey=e,t},i_=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,a_=/^\((?:(\w[\w-]*):)?(.+)\)$/i,o_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,s_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,c_=/\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$/,l_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix|color|light-dark)\(.+\)$/,u_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,d_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,f_=e=>o_.test(e),W=e=>!!e&&!Number.isNaN(Number(e)),p_=e=>!!e&&Number.isInteger(Number(e)),m_=e=>e.endsWith(`%`)&&W(e.slice(0,-1)),h_=e=>s_.test(e),g_=()=>!0,__=e=>c_.test(e)&&!l_.test(e),v_=()=>!1,y_=e=>u_.test(e),b_=e=>d_.test(e),x_=e=>!G(e)&&!K(e),S_=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)),C_=e=>R_(e,H_,v_),G=e=>i_.test(e),w_=e=>R_(e,U_,__),T_=e=>R_(e,W_,W),E_=e=>R_(e,K_,g_),D_=e=>R_(e,G_,v_),O_=e=>R_(e,B_,v_),k_=e=>R_(e,V_,b_),A_=e=>R_(e,q_,y_),K=e=>a_.test(e),j_=e=>z_(e,U_),M_=e=>z_(e,G_),N_=e=>z_(e,B_),P_=e=>z_(e,H_),F_=e=>z_(e,V_),I_=e=>z_(e,q_,!0),L_=e=>z_(e,K_,!0),R_=(e,t,n)=>{let r=i_.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},z_=(e,t,n=!1)=>{let r=a_.exec(e);return r?r[1]?t(r[1]):n:!1},B_=e=>e===`position`||e===`percentage`,V_=e=>e===`image`||e===`url`,H_=e=>e===`length`||e===`size`||e===`bg-size`,U_=e=>e===`length`,W_=e=>e===`number`,G_=e=>e===`family-name`,K_=e=>e===`number`||e===`weight`,q_=e=>e===`shadow`,J_=t_(()=>{let e=r_(`color`),t=r_(`font`),n=r_(`text`),r=r_(`font-weight`),i=r_(`tracking`),a=r_(`leading`),o=r_(`breakpoint`),s=r_(`container`),c=r_(`spacing`),l=r_(`radius`),u=r_(`shadow`),d=r_(`inset-shadow`),f=r_(`text-shadow`),p=r_(`drop-shadow`),m=r_(`blur`),h=r_(`perspective`),g=r_(`aspect`),_=r_(`ease`),v=r_(`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=()=>[f_,`full`,`auto`,...w()],E=()=>[p_,`none`,`subgrid`,K,G],ee=()=>[`auto`,{span:[`full`,p_,K,G]},p_,K,G],D=()=>[p_,`auto`,K,G],te=()=>[`auto`,`min`,`max`,`fr`,K,G],ne=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],re=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],ie=()=>[`auto`,...w()],O=()=>[f_,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[s,f_,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[f_,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,K,G],se=()=>[...b(),N_,O_,{position:[K,G]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,P_,C_,{size:[K,G]}],ue=()=>[m_,j_,w_],de=()=>[``,`none`,`full`,l,K,G],fe=()=>[``,W,j_,w_],pe=()=>[`solid`,`dashed`,`dotted`,`double`],me=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],he=()=>[W,m_,N_,O_],ge=()=>[``,`none`,m,K,G],_e=()=>[`none`,W,K,G],ve=()=>[`none`,W,K,G],A=()=>[W,K,G],j=()=>[f_,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[h_],breakpoint:[h_],color:[g_],container:[h_],"drop-shadow":[h_],ease:[`in`,`out`,`in-out`],font:[x_],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[h_],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[h_],shadow:[h_],spacing:[`px`,W],text:[h_],"text-shadow":[h_],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,f_,G,K,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,K,G]}],"container-named":[S_],columns:[{columns:[W,`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:[p_,`auto`,K,G]}],basis:[{basis:[f_,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[W,f_,`auto`,`initial`,`none`,G]}],grow:[{grow:[``,W,K,G]}],shrink:[{shrink:[``,W,K,G]}],order:[{order:[p_,`first`,`last`,`none`,K,G]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:ee()}],"col-start":[{"col-start":D()}],"col-end":[{"col-end":D()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:ee()}],"row-start":[{"row-start":D()}],"row-end":[{"row-end":D()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":te()}],"auto-rows":[{"auto-rows":te()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ne(),`normal`]}],"justify-items":[{"justify-items":[...re(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...re()]}],"align-content":[{content:[`normal`,...ne()]}],"align-items":[{items:[...re(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...re(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ne()}],"place-items":[{"place-items":[...re(),`baseline`]}],"place-self":[{"place-self":[`auto`,...re()]}],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:ie()}],mx:[{mx:ie()}],my:[{my:ie()}],ms:[{ms:ie()}],me:[{me:ie()}],mbs:[{mbs:ie()}],mbe:[{mbe:ie()}],mt:[{mt:ie()}],mr:[{mr:ie()}],mb:[{mb:ie()}],ml:[{ml:ie()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:O()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...O()]}],"min-w":[{"min-w":[s,`screen`,`none`,...O()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...O()]}],h:[{h:[`screen`,`lh`,...O()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...O()]}],"max-h":[{"max-h":[`screen`,`lh`,`none`,...O()]}],"font-size":[{text:[`base`,n,j_,w_]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,L_,E_]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,m_,G]}],"font-family":[{font:[M_,D_,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":[W,`none`,K,T_]}],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:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...pe(),`wavy`]}],"text-decoration-thickness":[{decoration:[W,`from-font`,`auto`,K,w_]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[W,`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:[p_,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:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},p_,K,G],radial:[``,K,G],conic:[``,p_,K,G]},F_,k_]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:de()}],"rounded-s":[{"rounded-s":de()}],"rounded-e":[{"rounded-e":de()}],"rounded-t":[{"rounded-t":de()}],"rounded-r":[{"rounded-r":de()}],"rounded-b":[{"rounded-b":de()}],"rounded-l":[{"rounded-l":de()}],"rounded-ss":[{"rounded-ss":de()}],"rounded-se":[{"rounded-se":de()}],"rounded-ee":[{"rounded-ee":de()}],"rounded-es":[{"rounded-es":de()}],"rounded-tl":[{"rounded-tl":de()}],"rounded-tr":[{"rounded-tr":de()}],"rounded-br":[{"rounded-br":de()}],"rounded-bl":[{"rounded-bl":de()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...pe(),`hidden`,`none`]}],"divide-style":[{divide:[...pe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...pe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[W,K,G]}],"outline-w":[{outline:[``,W,j_,w_]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`inner`,`none`,u,I_,A_]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,I_,A_]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:fe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[W,w_]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,I_,A_]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[W,K,G]}],"mix-blend":[{"mix-blend":[...me(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":me()}],"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":[W]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[K,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"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":[W]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,K,G]}],filter:[{filter:[``,`none`,K,G]}],blur:[{blur:ge()}],brightness:[{brightness:[W,K,G]}],contrast:[{contrast:[W,K,G]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,I_,A_]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,W,K,G]}],"hue-rotate":[{"hue-rotate":[W,K,G]}],invert:[{invert:[``,W,K,G]}],saturate:[{saturate:[W,K,G]}],sepia:[{sepia:[``,W,K,G]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,K,G]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[W,K,G]}],"backdrop-contrast":[{"backdrop-contrast":[W,K,G]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,W,K,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[W,K,G]}],"backdrop-invert":[{"backdrop-invert":[``,W,K,G]}],"backdrop-opacity":[{"backdrop-opacity":[W,K,G]}],"backdrop-saturate":[{"backdrop-saturate":[W,K,G]}],"backdrop-sepia":[{"backdrop-sepia":[``,W,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:[W,`initial`,K,G]}],ease:[{ease:[`linear`,`initial`,_,K,G]}],delay:[{delay:[W,K,G]}],animate:[{animate:[`none`,v,K,G]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,K,G]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:A()}],"skew-x":[{"skew-x":A()}],"skew-y":[{"skew-y":A()}],transform:[{transform:[K,G,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:j()}],"translate-x":[{"translate-x":j()}],"translate-y":[{"translate-y":j()}],"translate-z":[{"translate-z":j()}],"translate-none":[`translate-none`],zoom:[{zoom:[p_,K,G]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"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":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"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`,...k()]}],"stroke-w":[{stroke:[W,j_,w_,T_]}],stroke:[{stroke:[`none`,...k()]}],"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 J_(bg(e))}var Y_=Object.defineProperty,X_=(e,t)=>Y_(e,`name`,{value:t,configurable:!0});function Z_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}X_(Z_,`setRef`);function Q_(...e){return t=>{let n=!1,r=e.map(e=>{let r=Z_(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():Z_(e[t],null)}}}}X_(Q_,`composeRefs`);function $_(...e){return m.useCallback(Q_(...e),e)}X_($_,`useComposedRefs`);var ev=Object.defineProperty,tv=(e,t)=>ev(e,`name`,{value:t,configurable:!0});function nv(e){let t=m.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];dv(r)&&typeof hv==`function`&&(r=hv(r._payload)),m.Children.forEach(r,e=>{if(lv(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;dv(n)&&typeof hv==`function`&&(n=hv(n._payload)),a=ov(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?cv(a):void 0,l=$_(n,c);if(!a){if(r||r===0)throw Error(o?mv(e):pv(e));return r}let u=sv(i,a.props??{});return a.type!==m.Fragment&&(u.ref=n?l:c),m.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}tv(nv,`createSlot`);var rv=nv(`Slot`),iv=Symbol.for(`radix.slottable`);function av(e){let t=tv(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=iv,t}tv(av,`createSlottable`);var ov=tv((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 sv(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}}tv(sv,`mergeProps`);function cv(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)}tv(cv,`getElementRef`);function lv(e){return m.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===iv}tv(lv,`isSlottable`);var uv=Symbol.for(`react.lazy`);function dv(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===uv&&`_payload`in e&&fv(e._payload)}tv(dv,`isLazyComponent`);function fv(e){return typeof e==`object`&&!!e&&`then`in e}tv(fv,`isPromiseLike`);var pv=tv(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),mv=tv(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),hv=m.use,gv=l(Sf(),1),_v=Object.defineProperty,vv=(e,t)=>_v(e,`name`,{value:t,configurable:!0}),yv=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=nv(`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,I.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function bv(e,t){e&&gv.flushSync(()=>e.dispatchEvent(t))}vv(bv,`dispatchDiscreteCustomEvent`);var xv=Object.defineProperty,Sv=(e,t)=>xv(e,`name`,{value:t,configurable:!0}),Cv=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`}),wv=m.forwardRef(Sv(function(e,t){return(0,I.jsx)(yv.span,{...e,ref:t,style:{...Cv,...e.style}})},`VisuallyHidden`)),Tv=Object.defineProperty,Ev=(e,t)=>Tv(e,`name`,{value:t,configurable:!0});function Dv(e,t){let n=m.createContext(t);n.displayName=e+`Context`;let r=Ev(e=>{let{children:t,...r}=e,i=m.useMemo(()=>r,Object.values(r));return(0,I.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 Ev(i,`useContext`),[r,i]}Ev(Dv,`createContext`);function Ov(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=Ev(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=m.useMemo(()=>o,Object.values(o));return(0,I.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 Ev(s,`useContext`),[o,s]}Ev(r,`createContext`);let i=Ev(()=>{let t=n.map(e=>m.createContext(e));return Ev(function(n){let r=n?.[e]||t;return m.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,kv(i,...t)]}Ev(Ov,`createContextScope`);function kv(...e){let t=e[0];if(e.length===1)return t;let n=Ev(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return Ev(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}Ev(kv,`composeContextScopes`);var Av=Object.defineProperty,jv=(e,t)=>Av(e,`name`,{value:t,configurable:!0}),Mv=!!(typeof window<`u`&&window.document&&window.document.createElement);function Nv(e,t,{checkForDefaultPrevented:n=!0}={}){return jv(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}jv(Nv,`composeEventHandlers`);function Pv(e){if(!Mv)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}jv(Pv,`getOwnerWindow`);function Fv(e){if(!Mv)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}jv(Fv,`getOwnerDocument`);function Iv(e,t=!1){let{activeElement:n}=Fv(e);if(!n?.nodeName)return null;if(Lv(n)&&n.contentDocument)return Iv(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=Fv(n).getElementById(e);if(t)return t}}return n}jv(Iv,`getActiveElement`);function Lv(e){return e.tagName===`IFRAME`}jv(Lv,`isFrame`);var Rv=globalThis?.document?m.useLayoutEffect:()=>{},zv=Object.defineProperty,Bv=(e,t)=>zv(e,`name`,{value:t,configurable:!0}),Vv=m.useEffectEvent,Hv=m.useInsertionEffect;function Uv(e){if(typeof Vv==`function`)return Vv(e);let t=m.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Hv==`function`?Hv(()=>{t.current=e}):Rv(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}Bv(Uv,`useEffectEvent`);var Wv=Object.defineProperty,Gv=(e,t)=>Wv(e,`name`,{value:t,configurable:!0}),Kv=m.useInsertionEffect||Rv;function qv({prop:e,defaultProp:t,onChange:n=Gv(()=>{},`onChange`),caller:r}){let[i,a,o]=Jv({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,m.useCallback(t=>{if(s){let n=Yv(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Gv(qv,`useControllableState`);function Jv({defaultProp:e,onChange:t}){let[n,r]=m.useState(e),i=m.useRef(n),a=m.useRef(t);return Kv(()=>{a.current=t},[t]),m.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Gv(Jv,`useUncontrolledState`);function Yv(e){return typeof e==`function`}Gv(Yv,`isFunction`);var Xv=Symbol(`RADIX:SYNC_STATE`);function Zv(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Uv(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=m.useReducer((t,n)=>{if(n.type===Xv)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:Xv,state:i})},[i,d.state,c]),[g,f]}Gv(Zv,`useControllableStateReducer`);var Qv=Object.defineProperty,$v=(e,t)=>Qv(e,`name`,{value:t,configurable:!0});function ey(e,t){return m.useReducer((e,n)=>t[e][n]??e,e)}$v(ey,`useStateMachine`);var ty=$v(e=>{let{present:t,children:n}=e,r=ny(t),i=typeof n==`function`?n({present:r.isPresent}):m.Children.only(n),a=iy(r.ref,oy(i));return typeof n==`function`||r.isPresent?m.cloneElement(i,{ref:a}):null},`Presence`);function ny(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]=ey(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??ay(r.current),o.current=void 0):a.current=`none`},[s]),Rv(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=ay(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]),Rv(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=$v(a=>{let o=ay(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=$v(e=>{e.target===t&&(a.current=ay(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=ay(t)}else r.current=null;n(e)},[])}}$v(ny,`usePresence`);function ry(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}$v(ry,`setRef`);function iy(...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=ry(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():ry(n[e],null)}}},[])}$v(iy,`useStableComposedRefs`);function ay(e){return e?.animationName||`none`}$v(ay,`getAnimationName`);function oy(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)}$v(oy,`getElementRef`);var sy=Object.defineProperty,cy=(e,t)=>sy(e,`name`,{value:t,configurable:!0}),ly=m.useId||(()=>void 0),uy=0;function dy(e){let[t,n]=m.useState(ly());return Rv(()=>{e||n(e=>e??String(uy++))},[e]),e||(t?`radix-${t}`:``)}cy(dy,`useId`);var fy=Object.defineProperty,py=(e,t)=>fy(e,`name`,{value:t,configurable:!0});function my(e){let t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>((...e)=>t.current?.(...e)),[])}py(my,`useCallbackRef`);var hy=Object.defineProperty,gy=(e,t)=>hy(e,`name`,{value:t,configurable:!0}),_y=`dismissableLayer.update`,vy=`dismissableLayer.pointerDownOutside`,yy=`dismissableLayer.focusOutside`,by,xy=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Sy=m.forwardRef(gy(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(xy),[d,f]=m.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=m.useState({}),g=$_(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=Ty(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=Ey(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,ee=my(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return m.useEffect(()=>{if(E)return p.addEventListener(`keydown`,ee,{capture:!0}),()=>p.removeEventListener(`keydown`,ee,{capture:!0})},[p,E,ee]),m.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(by=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Dy(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=by))}},[d,p,n,u]),m.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Dy())},[d,u]),m.useEffect(()=>{let e=gy(()=>h({}),`handleUpdate`);return document.addEventListener(_y,e),()=>document.removeEventListener(_y,e)},[]),(0,I.jsx)(yv.div,{...l,ref:g,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:Nv(e.onFocusCapture,T.onFocusCapture),onBlurCapture:Nv(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:Nv(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Cy(){let e=m.useContext(xy),[t,n]=m.useState(null);return m.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}gy(Cy,`useDismissableLayerSurface`);var wy=gy(()=>!0,`IS_TRUE`);function Ty(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=wy}=t,s=my(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()}gy(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}gy(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)}gy(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}gy(p,`handleInteractionBubble`);let m=gy(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Oy(vy,s,p,{discrete:!0})};if(gy(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:gy(()=>c.current=!0,`onPointerDownCapture`)}}gy(Ty,`usePointerDownOutside`);function Ey(e,t=globalThis?.document){let n=my(e),r=m.useRef(!1);return m.useEffect(()=>{let e=gy(e=>{e.target&&!r.current&&Oy(yy,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:gy(()=>r.current=!0,`onFocusCapture`),onBlurCapture:gy(()=>r.current=!1,`onBlurCapture`)}}gy(Ey,`useFocusOutside`);function Dy(){let e=new CustomEvent(_y);document.dispatchEvent(e)}gy(Dy,`dispatchUpdate`);function Oy(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?bv(i,a):i.dispatchEvent(a)}gy(Oy,`handleAndDispatchCustomEvent`);var ky=Object.defineProperty,Ay=(e,t)=>ky(e,`name`,{value:t,configurable:!0}),jy=`focusScope.autoFocusOnMount`,My=`focusScope.autoFocusOnUnmount`,Ny={bubbles:!1,cancelable:!0},Py=m.forwardRef(Ay(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=m.useState(null),l=my(i),u=my(a),d=m.useRef(null),f=$_(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:Vy(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Vy(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Vy(s)};Ay(e,`handleFocusIn`),Ay(t,`handleFocusOut`),Ay(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){Hy.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(jy,Ny);s.addEventListener(jy,l),s.dispatchEvent(t),t.defaultPrevented||(Fy(Gy(Ly(s)),{select:!0}),document.activeElement===e&&Vy(s))}return()=>{s.removeEventListener(jy,l),setTimeout(()=>{let t=new CustomEvent(My,Ny);s.addEventListener(My,u),s.dispatchEvent(t),t.defaultPrevented||Vy(e??document.body,{select:!0}),s.removeEventListener(My,u),Hy.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]=Iy(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Vy(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Vy(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,I.jsx)(yv.div,{tabIndex:-1,...o,ref:f,onKeyDown:h})},`FocusScope`));function Fy(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Vy(r,{select:t}),document.activeElement!==n)return}Ay(Fy,`focusFirst`);function Iy(e){let t=Ly(e);return[Ry(t,e),Ry(t.reverse(),e)]}Ay(Iy,`getTabbableEdges`);function Ly(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ay(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}Ay(Ly,`getTabbableCandidates`);function Ry(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):zy(r,{upTo:t})))return r}Ay(Ry,`findVisible`);function zy(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}Ay(zy,`isHidden`);function By(e){return e instanceof HTMLInputElement&&`select`in e}Ay(By,`isSelectableInput`);function Vy(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&By(e)&&t&&e.select()}}Ay(Vy,`focus`);var Hy=Uy();function Uy(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Wy(e,t),e.unshift(t)},remove(t){e=Wy(e,t),e[0]?.resume()}}}Ay(Uy,`createFocusScopesStack`);function Wy(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ay(Wy,`arrayRemove`);function Gy(e){return e.filter(e=>e.tagName!==`A`)}Ay(Gy,`removeLinks`);var Ky=Object.defineProperty,qy=m.forwardRef(((e,t)=>Ky(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=m.useState(!1);Rv(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?gv.createPortal((0,I.jsx)(yv.div,{...r,ref:t}),o):null},`Portal`)),Jy=Object.defineProperty,Yy=(e,t)=>Jy(e,`name`,{value:t,configurable:!0}),Xy=0,Zy=null;function Qy(e){return $y(),e.children}Yy(Qy,`FocusGuards`);function $y(){m.useEffect(()=>{Zy||={start:eb(),end:eb()};let{start:e,end:t}=Zy;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Xy++,()=>{Xy===1&&(Zy?.start.remove(),Zy?.end.remove(),Zy=null),Xy=Math.max(0,Xy-1)}},[])}Yy($y,`useFocusGuards`);function eb(){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}Yy(eb,`createFocusGuard`);var tb=function(){return tb=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},tb.apply(this,arguments)};function nb(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 rb(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 ib=`right-scroll-bar-position`,ab=`width-before-scroll-bar`,ob=`with-scroll-bars-hidden`,sb=`--removed-body-scroll-bar-size`;function cb(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function lb(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 ub=typeof window<`u`?m.useLayoutEffect:m.useEffect,db=new WeakMap;function fb(e,t){var n=lb(t||null,function(t){return e.forEach(function(e){return cb(e,t)})});return ub(function(){var t=db.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||cb(e,null)}),i.forEach(function(e){r.has(e)||cb(e,a)})}db.set(n,e)},[e]),n}function pb(e){return e}function mb(e,t){t===void 0&&(t=pb);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 hb(e){e===void 0&&(e={});var t=mb(null);return t.options=tb({async:!0,ssr:!1},e),t}var gb=function(e){var t=e.sideCar,n=nb(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,tb({},n))};gb.isSideCarExport=!0;function _b(e,t){return e.useMedium(t),gb}var vb=hb(),yb=function(){},bb=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:yb,onWheelCapture:yb,onTouchMoveCapture:yb}),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=nb(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=fb([n,t]),w=tb(tb({},x),i);return m.createElement(m.Fragment,null,u&&m.createElement(S,{sideCar:vb,removeScrollBar:l,shards:d,noRelative:p,noIsolation:h,inert:g,setCallbacks:a,allowPinchZoom:!!_,lockRef:n,gapMode:b}),o?m.cloneElement(m.Children.only(s),tb(tb({},w),{ref:C})):m.createElement(y,tb({},w,{className:c,ref:C}),s))});bb.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},bb.classNames={fullWidth:ab,zeroRight:ib};var xb=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Sb(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=xb();return t&&e.setAttribute(`nonce`,t),e}function Cb(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function wb(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Tb=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Sb())&&(Cb(t,n),wb(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Eb=function(){var e=Tb();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Db=function(){var e=Eb();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Ob={left:0,top:0,right:0,gap:0},kb=function(e){return parseInt(e||``,10)||0},Ab=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[kb(n),kb(r),kb(i)]},jb=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Ob;var t=Ab(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])}},Mb=Db(),Nb=`data-scroll-locked`,Pb=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
|
+
.${ob} {
|
|
20
20
|
overflow: hidden ${r};
|
|
21
21
|
padding-right: ${s}px ${r};
|
|
22
22
|
}
|
|
23
|
-
body[${
|
|
23
|
+
body[${Nb}] {
|
|
24
24
|
overflow: hidden ${r};
|
|
25
25
|
overscroll-behavior: contain;
|
|
26
26
|
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
@@ -33,73 +33,73 @@ Error generating stack: `+e.message+`
|
|
|
33
33
|
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.${
|
|
36
|
+
.${ib} {
|
|
37
37
|
right: ${s}px ${r};
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.${
|
|
40
|
+
.${ab} {
|
|
41
41
|
margin-right: ${s}px ${r};
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
.${
|
|
44
|
+
.${ib} .${ib} {
|
|
45
45
|
right: 0 ${r};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.${
|
|
48
|
+
.${ab} .${ab} {
|
|
49
49
|
margin-right: 0 ${r};
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
body[${
|
|
53
|
-
${
|
|
52
|
+
body[${Nb}] {
|
|
53
|
+
${sb}: ${s}px;
|
|
54
54
|
}
|
|
55
|
-
`},
|
|
55
|
+
`},Fb=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Ib=function(){m.useEffect(function(){return document.body.setAttribute(Nb,(Fb()+1).toString()),function(){var e=Fb()-1;e<=0?document.body.removeAttribute(Nb):document.body.setAttribute(Nb,e.toString())}},[])},Lb=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Ib();var a=m.useMemo(function(){return jb(i)},[i]);return m.createElement(Mb,{styles:Pb(a,!t,i,n?``:`!important`)})},Rb=!1;if(typeof window<`u`)try{var zb=Object.defineProperty({},"passive",{get:function(){return Rb=!0,!0}});window.addEventListener(`test`,zb,zb),window.removeEventListener(`test`,zb,zb)}catch{Rb=!1}var Bb=Rb?{passive:!1}:!1,Vb=function(e){return e.tagName===`TEXTAREA`},Hb=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Vb(e)&&n[t]===`visible`)},Ub=function(e){return Hb(e,`overflowY`)},Wb=function(e){return Hb(e,`overflowX`)},Gb=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Jb(e,r)){var i=Yb(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Kb=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},qb=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Jb=function(e,t){return e===`v`?Ub(t):Wb(t)},Yb=function(e,t){return e===`v`?Kb(t):qb(t)},Xb=function(e,t){return e===`h`&&t===`rtl`?-1:1},Zb=function(e,t,n,r,i){var a=Xb(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=Yb(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Jb(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},Qb=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$b=function(e){return[e.deltaX,e.deltaY]},ex=function(e){return e&&`current`in e?e.current:e},tx=function(e,t){return e[0]===t[0]&&e[1]===t[1]},nx=function(e){return`
|
|
56
56
|
.block-interactivity-${e} {pointer-events: none;}
|
|
57
57
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
58
|
-
`},Gb=0,Kb=[];function qb(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(Gb++)[0],a=m.useState(hb)[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=Gy([e.lockRef.current],(e.shards||[]).map(Hb),!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=Bb(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=Nb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Nb(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 zb(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(Kb.length&&Kb[Kb.length-1]===a){var r=`deltaY`in n?Vb(n):Bb(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ub(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Hb).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:Jb(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=Bb(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,Vb(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Bb(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return Kb.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Ob),document.addEventListener(`touchmove`,c,Ob),document.addEventListener(`touchstart`,u,Ob),function(){Kb=Kb.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Ob),document.removeEventListener(`touchmove`,c,Ob),document.removeEventListener(`touchstart`,u,Ob)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:Wb(i)}):null,p?m.createElement(Tb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Jb(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Yb=ab(ob,qb),Xb=m.forwardRef(function(e,t){return m.createElement(cb,Uy({},e,{ref:t,sideCar:Yb}))});Xb.classNames=cb.classNames;var Zb=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Qb=new WeakMap,$b=new WeakMap,ex={},tx=0,nx=function(e){return e&&(e.host||nx(e.parentNode))},rx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=nx(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})},ix=function(e,t,n,r){var i=rx(t,Array.isArray(e)?e:[e]);ex[n]||(ex[n]=new WeakMap);var a=ex[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=(Qb.get(e)||0)+1,l=(a.get(e)||0)+1;Qb.set(e,c),a.set(e,l),o.push(e),c===1&&i&&$b.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(),tx++,function(){o.forEach(function(e){var t=Qb.get(e)-1,i=a.get(e)-1;Qb.set(e,t),a.set(e,i),t||($b.has(e)||e.removeAttribute(r),$b.delete(e)),i||e.removeAttribute(n)}),tx--,tx||(Qb=new WeakMap,Qb=new WeakMap,$b=new WeakMap,ex={})}},ax=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Zb(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),ix(r,i,n,`aria-hidden`)):function(){return null}},ox=Object.defineProperty,sx=(e,t)=>ox(e,`name`,{value:t,configurable:!0}),cx=`Dialog`,[lx,ux]=gv(cx),[dx,fx]=lx(cx),px=sx(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]=Fv({prop:r,defaultProp:i??!1,onChange:a,caller:cx}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,I.jsx)(dx,{scope:t,triggerRef:s,contentRef:c,contentId:$v(),titleId:$v(),descriptionId:$v(),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`),mx=`DialogTrigger`,hx=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,...r}=e,i=fx(mx,n),a=V_(t,i.triggerRef);return(0,I.jsx)(sv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":Fx(i.open),...r,ref:a,onClick:xv(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),gx=`DialogPortal`,[_x,vx]=lx(gx,{forceMount:void 0}),yx=sx(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=fx(gx,t);return(0,I.jsx)(_x,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,I.jsx)(Uv,{present:n||a.open,children:(0,I.jsx)(Fy,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),bx=`DialogOverlay`,xx=m.forwardRef(sx(function(e,t){let n=vx(bx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fx(bx,e.__scopeDialog);return a.modal?(0,I.jsx)(Uv,{present:r||a.open,children:(0,I.jsx)(Cx,{...i,ref:t})}):null},`DialogOverlay`)),Sx=W_(`DialogOverlay.RemoveScroll`),Cx=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,...r}=e,i=fx(bx,n),a=V_(t,dy());return(0,I.jsx)(Xb,{as:Sx,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(sv.div,{"data-state":Fx(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),wx=`DialogContent`,Tx=m.forwardRef(sx(function(e,t){let n=vx(wx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=fx(wx,e.__scopeDialog);return(0,I.jsx)(Uv,{present:r||a.open,children:a.modal?(0,I.jsx)(Ex,{...i,ref:t}):(0,I.jsx)(Dx,{...i,ref:t})})},`DialogContent`)),Ex=m.forwardRef(sx(function(e,t){let n=fx(wx,e.__scopeDialog),r=m.useRef(null),i=V_(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return ax(e)},[]),(0,I.jsx)(Ox,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:xv(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:xv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:xv(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Dx=m.forwardRef(sx(function(e,t){let n=fx(wx,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,I.jsx)(Ox,{...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`)),Ox=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=fx(wx,n);return Vy(),(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(Sy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(uy,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Fx(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),kx=`DialogTitle`,Ax=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,...r}=e,i=fx(kx,n),{setTitleCount:a}=i;return Ev(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(sv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),jx=`DialogDescription`,Mx=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,...r}=e,i=fx(jx,n),{setDescriptionCount:a}=i;return Ev(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(sv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Nx=`DialogClose`,Px=m.forwardRef(sx(function(e,t){let{__scopeDialog:n,...r}=e,i=fx(Nx,n);return(0,I.jsx)(sv.button,{type:`button`,...r,ref:t,onClick:xv(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function Fx(e){return e?`open`:`closed`}sx(Fx,`getState`);var Ix=Object.defineProperty,Lx=(e,t)=>Ix(e,`name`,{value:t,configurable:!0}),[Rx,zx]=gv(`AlertDialog`,[ux]),Bx=ux(),Vx=Lx(e=>{let{__scopeAlertDialog:t,...n}=e,r=Bx(t);return(0,I.jsx)(px,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Bx(n);return(0,I.jsx)(hx,{...i,...r,ref:t})},`AlertDialogTrigger`));var Hx=Lx(e=>{let{__scopeAlertDialog:t,...n}=e,r=Bx(t);return(0,I.jsx)(yx,{...r,...n})},`AlertDialogPortal`),Ux=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Bx(n);return(0,I.jsx)(xx,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Wx,Gx]=Rx(`AlertDialogContent`),Kx=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Bx(n),o=V_(t,m.useRef(null)),s=m.useRef(null);return(0,I.jsx)(Wx,{scope:n,cancelRef:s,children:(0,I.jsx)(Tx,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:xv(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),qx=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Bx(n);return(0,I.jsx)(Ax,{...i,...r,ref:t})},`AlertDialogTitle`)),Jx=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Bx(n);return(0,I.jsx)(Mx,{...i,...r,ref:t})},`AlertDialogDescription`)),Yx=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Bx(n);return(0,I.jsx)(Px,{...i,...r,ref:t})},`AlertDialogAction`)),Xx=`AlertDialogCancel`,Zx=m.forwardRef(Lx(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Gx(Xx,n),a=Bx(n),o=V_(t,i);return(0,I.jsx)(Px,{...a,...r,ref:o})},`AlertDialogCancel`)),Qx=Vx,$x=Hx,eS=Ux,tS=Kx,nS=Yx,rS=Zx,iS=qx,aS=Jx,oS=Object.defineProperty,sS=(e,t)=>oS(e,`name`,{value:t,configurable:!0});function cS(e){let[t,n]=m.useState(void 0);return Ev(()=>{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}sS(cS,`useSize`);var lS=Object.defineProperty,uS=(e,t)=>lS(e,`name`,{value:t,configurable:!0}),dS=`Checkbox`,[fS,pS]=gv(dS),[mS,hS]=fS(dS);function gS(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]=Fv({prop:n,defaultProp:i??!1,onChange:c,caller:dS}),[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:!TS(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,I.jsx)(mS,{scope:t,...C,children:wS(d)?d(C):r})}uS(gS,`CheckboxProvider`);var _S=`CheckboxTrigger`,vS=m.forwardRef(uS(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}=hS(_S,e),_=V_(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=uS(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(sv.button,{type:`button`,role:`checkbox`,"aria-checked":TS(c)?`mixed`:c,"aria-required":l,"data-state":ES(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:xv(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:xv(n,e=>{p(),d(e=>TS(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),yS=m.forwardRef(uS(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,I.jsx)(gS,{__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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(vS,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(CS,{__scopeCheckbox:n})]})})},`Checkbox`)),bS=`CheckboxIndicator`,xS=m.forwardRef(uS(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=hS(bS,n);return(0,I.jsx)(Uv,{present:r||TS(a.checked)||a.checked===!0,children:(0,I.jsx)(sv.span,{"data-state":ES(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),SS=`CheckboxBubbleInput`,CS=m.forwardRef(uS(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}=hS(SS,e),_=V_(r,g),v=cS(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=TS(s),n.call(e,!TS(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!TS(s)&&s);return(0,I.jsx)(sv.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:xv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function wS(e){return typeof e==`function`}uS(wS,`isFunction`);function TS(e){return e===`indeterminate`}uS(TS,`isIndeterminate`);function ES(e){return TS(e)?`indeterminate`:e?`checked`:`unchecked`}uS(ES,`getState`);var DS=[`top`,`right`,`bottom`,`left`],OS=Math.min,kS=Math.max,AS=Math.round,jS=Math.floor,MS=e=>({x:e,y:e}),NS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function PS(e,t,n){return kS(e,OS(t,n))}function FS(e,t){return typeof e==`function`?e(t):e}function IS(e){return e.split(`-`)[0]}function LS(e){return e.split(`-`)[1]}function RS(e){return e===`x`?`y`:`x`}function zS(e){return e===`y`?`height`:`width`}function BS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function VS(e){return RS(BS(e))}function HS(e,t,n){n===void 0&&(n=!1);let r=LS(e),i=VS(e),a=zS(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ZS(o)),[o,ZS(o)]}function US(e){let t=ZS(e);return[WS(e),t,WS(t)]}function WS(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var GS=[`left`,`right`],KS=[`right`,`left`],qS=[`top`,`bottom`],JS=[`bottom`,`top`];function YS(e,t,n){switch(e){case`top`:case`bottom`:return n?t?KS:GS:t?GS:KS;case`left`:case`right`:return t?qS:JS;default:return[]}}function XS(e,t,n,r){let i=LS(e),a=YS(IS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(WS)))),a}function ZS(e){let t=IS(e);return NS[t]+e.slice(t.length)}function QS(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function $S(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:QS(e)}function eC(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 tC(e,t,n){let{reference:r,floating:i}=e,a=BS(t),o=VS(t),s=zS(o),c=IS(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=LS(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nC(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}=FS(t,e),p=$S(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=eC(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=eC(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 rC=50,iC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tC(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<rC&&(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}=tC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},aC=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}=FS(e,t)||{};if(l==null)return{};let d=$S(u),f={x:n,y:r},p=VS(i),m=zS(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=OS(d[_],T),ee=OS(d[v],T),D=C-h[m]-ee,te=C/2-h[m]/2+w,ne=PS(E,te,D),re=!c.arrow&&LS(i)!=null&&te!==ne&&a.reference[m]/2-(te<E?E:ee)-h[m]/2<0,ie=re?te<E?te-E:te-D:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),oC=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}=FS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=IS(r),_=BS(o),v=IS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ZS(o)]:US(o)),x=p!==`none`;!d&&x&&b.push(...XS(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=HS(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`||_===BS(t)||T.every(e=>BS(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=BS(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 sC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function cC(e){return DS.some(t=>e[t]>=0)}var lC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=FS(e,t);switch(i){case`referenceHidden`:{let e=sC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:cC(e)}}}case`escaped`:{let e=sC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:cC(e)}}}default:return{}}}}},uC=new Set([`left`,`top`]);async function dC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=IS(n),s=LS(n),c=BS(n)===`y`,l=uC.has(o)?-1:1,u=a&&c?-1:1,d=FS(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 fC=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 dC(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}}}}},pC=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}=FS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=BS(i),p=RS(f),m=u[p],h=u[f],g=(e,t)=>PS(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}}}}}},mC=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}=FS(e,t),u={x:n,y:r},d=BS(i),f=RS(d),p=u[f],m=u[d],h=FS(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=uC.has(IS(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}}}},hC=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}=FS(e,t),c=await i.detectOverflow(t,s),l=IS(n),u=LS(n),d=BS(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=OS(p-c[m],g),y=OS(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*kS(c.left,c.right):S=p-2*kS(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 gC(){return typeof window<`u`}function _C(e){return bC(e)?(e.nodeName||``).toLowerCase():`#document`}function vC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yC(e){return((bC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function bC(e){return gC()?e instanceof Node||e instanceof vC(e).Node:!1}function xC(e){return gC()?e instanceof Element||e instanceof vC(e).Element:!1}function SC(e){return gC()?e instanceof HTMLElement||e instanceof vC(e).HTMLElement:!1}function CC(e){return!gC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof vC(e).ShadowRoot}function wC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=FC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function TC(e){return/^(table|td|th)$/.test(_C(e))}function EC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var DC=/transform|translate|scale|rotate|perspective|filter/,OC=/paint|layout|strict|content/,kC=e=>!!e&&e!==`none`,AC;function jC(e){let t=xC(e)?FC(e):e;return kC(t.transform)||kC(t.translate)||kC(t.scale)||kC(t.rotate)||kC(t.perspective)||!NC()&&(kC(t.backdropFilter)||kC(t.filter))||DC.test(t.willChange||``)||OC.test(t.contain||``)}function MC(e){let t=LC(e);for(;SC(t)&&!PC(t);){if(jC(t))return t;if(EC(t))return null;t=LC(t)}return null}function NC(){return AC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),AC}function PC(e){return/^(html|body|#document)$/.test(_C(e))}function FC(e){return vC(e).getComputedStyle(e)}function IC(e){return xC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function LC(e){if(_C(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||CC(e)&&e.host||yC(e);return CC(t)?t.host:t}function RC(e){let t=LC(e);return PC(t)?(e.ownerDocument||e).body:SC(t)&&wC(t)?t:RC(t)}function zC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=RC(e),i=r===e.ownerDocument?.body,a=vC(r);if(i){let e=BC(a);return t.concat(a,a.visualViewport||[],wC(r)?r:[],e&&n?zC(e):[])}return t.concat(r,zC(r,[],n))}function BC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function VC(e){let t=FC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=SC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=AS(n)!==a||AS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function HC(e){return xC(e)?e:e.contextElement}function UC(e){let t=HC(e);if(!SC(t))return MS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=VC(t),o=(a?AS(n.width):n.width)/r,s=(a?AS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var WC=MS(0);function GC(e){let t=vC(e);return!NC()||!t.visualViewport?WC:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function KC(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===vC(e)}function qC(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=HC(e),o=MS(1);t&&(r?xC(r)&&(o=UC(r)):o=UC(e));let s=KC(a,n,r)?GC(a):MS(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=vC(a),t=xC(r)?vC(r):r,n=e,i=BC(n);for(;i&&t!==n;){let e=UC(i),t=i.getBoundingClientRect(),r=FC(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=vC(i),i=BC(n)}}return eC({width:u,height:d,x:c,y:l})}function JC(e,t){let n=IC(e).scrollLeft;return t?t.left+n:qC(yC(e)).left+n}function YC(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-JC(e,n),y:n.top+t.scrollTop}}function XC(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=yC(r),s=t?EC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=MS(1),u=MS(0),d=SC(r);if((d||!a)&&((_C(r)!==`body`||wC(o))&&(c=IC(r)),d)){let e=qC(r);l=UC(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?YC(o,c):MS(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 ZC(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function QC(e){let t=IC(e),n=e.ownerDocument.body,r=kS(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=kS(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+JC(e),o=-t.scrollTop;return FC(n).direction===`rtl`&&(a+=kS(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var $C=25;function ew(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=vC(e),a=yC(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!NC()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(JC(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<=$C&&(s-=o)}return{width:s,height:c,x:l,y:u}}function tw(e,t){let n=qC(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=UC(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function nw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ew(e,n,t);else if(t===`document`)r=QC(yC(e));else if(xC(t))r=tw(t,n);else{let n=GC(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return eC(r)}function rw(e,t){let n=t.get(e);if(n)return n;let r=zC(e,[],!1).filter(e=>xC(e)&&_C(e)!==`body`),i=null,a=FC(e).position===`fixed`,o=a?LC(e):e;for(;xC(o)&&!PC(o);){let e=FC(o),t=jC(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=LC(o)}return t.set(e,r),r}function iw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?EC(t)?[]:rw(t,this._c):[].concat(n),r],o=nw(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=nw(t,a[e],i);s=kS(n.top,s),c=OS(n.right,c),l=OS(n.bottom,l),u=kS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function aw(e){let{width:t,height:n}=VC(e);return{width:t,height:n}}function ow(e,t,n){let r=SC(t),i=yC(t),a=n===`fixed`,o=qC(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=MS(0);if((r||!a)&&((_C(t)!==`body`||wC(i))&&(s=IC(t)),r)){let e=qC(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=JC(i));let l=i&&!r&&!a?YC(i,s):MS(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 sw(e){return FC(e).position===`static`}function cw(e,t){if(!SC(e)||FC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return yC(e)===n&&(n=n.ownerDocument.body),n}function lw(e,t){let n=vC(e);if(EC(e))return n;if(!SC(e)){let t=LC(e);for(;t&&!PC(t);){if(xC(t)&&!sw(t))return t;t=LC(t)}return n}let r=cw(e,t);for(;r&&TC(r)&&sw(r);)r=cw(r,t);return r&&PC(r)&&sw(r)&&!jC(r)?n:r||MC(e)||n}var uw=async function(e){let t=this.getOffsetParent||lw,n=this.getDimensions,r=await n(e.floating);return{reference:ow(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dw(e){return FC(e).direction===`rtl`}var fw={convertOffsetParentRelativeRectToViewportRelativeRect:XC,getDocumentElement:yC,getClippingRect:iw,getOffsetParent:lw,getElementRects:uw,getClientRects:ZC,getDimensions:aw,getScale:UC,isElement:xC,isRTL:dw};function pw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mw(e,t,n){let r=null,i,a=yC(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=jS(d),h=jS(a.clientWidth-(u+f)),g=jS(a.clientHeight-(d+p)),_=jS(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:kS(0,OS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!pw(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=vC(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function hw(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=HC(e),u=i||a?[...l?zC(l):[],...t?zC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?mw(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?qC(e):null;c&&g();function g(){let t=qC(e);h&&!pw(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 gw=fC,_w=pC,vw=oC,yw=hC,bw=lC,xw=aC,Sw=mC,Cw=(e,t,n)=>{let r=new Map,i=n??{},a={...fw,...i.platform,_c:r};return iC(e,t,{...i,platform:a})},ww=typeof document<`u`?m.useLayoutEffect:function(){};function Tw(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(!Tw(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)&&!Tw(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Ew(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Dw(e,t){let n=Ew(e);return Math.round(t*n)/n}function Ow(e){let t=m.useRef(e);return ww(()=>{t.current=e}),t}function kw(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);Tw(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,ee=Ow(c),D=Ow(i),te=Ow(l),ne=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Cw(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!Tw(T.current,t)&&(T.current=t,iv.flushSync(()=>{d(t)}))})},[f,t,n,D,te]);ww(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=m.useRef(!1);ww(()=>(re.current=!0,()=>{re.current=!1}),[]),ww(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,ne);ne()}},[x,S,ne,ee,E]);let ie=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),O=m.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=Dw(O.floating,u.x),r=Dw(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Ew(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:ne,refs:ie,elements:O,floatingStyles:ae}),[u,ne,ie,O,ae])}var Aw=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?{}:xw({element:r.current,padding:i}).fn(n):r?xw({element:r,padding:i}).fn(n):{}}}},jw=(e,t)=>{let n=gw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Mw=(e,t)=>{let n=_w(e);return{name:n.name,fn:n.fn,options:[e,t]}},Nw=(e,t)=>({fn:Sw(e).fn,options:[e,t]}),Pw=(e,t)=>{let n=vw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Fw=(e,t)=>{let n=yw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Iw=(e,t)=>{let n=bw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Lw=(e,t)=>{let n=Aw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Rw=Object.defineProperty,zw=m.forwardRef(((e,t)=>Rw(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(sv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Bw=Object.defineProperty,Vw=(e,t)=>Bw(e,`name`,{value:t,configurable:!0}),Hw=`Popper`,[Uw,Ww]=gv(Hw),[Gw,Kw]=Uw(Hw),qw=Vw(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,I.jsx)(Gw,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),Jw=`PopperAnchor`,Yw=m.forwardRef(Vw(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=Kw(Jw,n),o=m.useRef(null),s=a.onAnchorChange,c=V_(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&&aT(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,I.jsx)(sv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Xw=`PopperContent`,[Zw,Qw]=Uw(Xw),$w=m.forwardRef(Vw(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,_=Kw(Xw,n),[v,y]=m.useState(null),b=V_(t,y),[x,S]=m.useState(null),C=cS(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],te=D.length>0,ne={padding:ee,boundary:D.filter(rT),altBoundary:te},{refs:re,floatingStyles:ie,placement:O,isPositioned:ae,middlewareData:oe}=kw({strategy:`fixed`,placement:E,whileElementsMounted:Vw((...e)=>hw(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[jw({mainAxis:i+T,alignmentAxis:o}),c&&Mw({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Nw():void 0,...ne}),c&&Pw({...ne}),Fw({...ne,apply:Vw(({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&&Lw({element:x,padding:s}),iT({arrowWidth:w,arrowHeight:T}),f&&Iw({strategy:`referenceHidden`,...ne,boundary:te?ne.boundary:void 0})]}),k=_.setPlacementState;Ev(()=>(k(O),()=>{k(void 0)}),[O,k]);let[se,ce]=aT(O),le=ny(h);Ev(()=>{ae&&le?.()},[ae,le]);let ue=oe.arrow?.x,de=oe.arrow?.y,fe=oe.arrow?.centerOffset!==0,[pe,me]=m.useState();return Ev(()=>{v&&me(window.getComputedStyle(v).zIndex)},[v]),(0,I.jsx)(`div`,{ref:re.setFloating,"data-radix-popper-content-wrapper":``,style:{...ie,transform:ae?ie.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:pe,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(Zw,{scope:n,placedSide:se,placedAlign:ce,onArrowChange:S,arrowX:ue,arrowY:de,shouldHideArrow:fe,children:(0,I.jsx)(sv.div,{"data-side":se,"data-align":ce,...g,ref:b,style:{...g.style,animation:ae?g.style?.animation:`none`}})})})},`PopperContent`)),eT=`PopperArrow`,tT={top:`bottom`,right:`left`,bottom:`top`,left:`right`},nT=m.forwardRef(Vw(function(e,t){let{__scopePopper:n,...r}=e,i=Qw(eT,n),a=tT[i.placedSide];return(0,I.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,I.jsx)(zw,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function rT(e){return e!==null}Vw(rT,`isNotNull`);var iT=Vw(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]=aT(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 aT(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Vw(aT,`getSideAndAlignFromPlacement`);var oT=qw,sT=Yw,cT=$w,lT=nT,uT=Object.defineProperty,dT=(e,t)=>uT(e,`name`,{value:t,configurable:!0}),fT=`Popover`,[pT,mT]=gv(fT,[Ww]),hT=Ww(),[gT,_T]=pT(fT),vT=dT(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=hT(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=Fv({prop:r,defaultProp:i??!1,onChange:a,caller:fT});return(0,I.jsx)(oT,{...s,children:(0,I.jsx)(gT,{scope:t,contentId:$v(),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`),yT=`PopoverTrigger`,bT=m.forwardRef(dT(function(e,t){let{__scopePopover:n,...r}=e,i=_T(yT,n),a=hT(n),o=V_(t,i.triggerRef),s=(0,I.jsx)(sv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":jT(i.open),...r,ref:o,onClick:xv(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(sT,{asChild:!0,...a,children:s})},`PopoverTrigger`)),xT=`PopoverPortal`,[ST,CT]=pT(xT,{forceMount:void 0}),wT=dT(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=_T(xT,t);return(0,I.jsx)(ST,{scope:t,forceMount:n,children:(0,I.jsx)(Uv,{present:n||a.open,children:(0,I.jsx)(Fy,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),TT=`PopoverContent`,ET=m.forwardRef(dT(function(e,t){let n=CT(TT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=_T(TT,e.__scopePopover);return(0,I.jsx)(Uv,{present:r||a.open,children:a.modal?(0,I.jsx)(OT,{...i,ref:t}):(0,I.jsx)(kT,{...i,ref:t})})},`PopoverContent`)),DT=W_(`PopoverContent.RemoveScroll`),OT=m.forwardRef(dT(function(e,t){let n=_T(TT,e.__scopePopover),r=m.useRef(null),i=V_(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return ax(e)},[]),(0,I.jsx)(Xb,{as:DT,allowPinchZoom:!0,children:(0,I.jsx)(AT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:xv(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:xv(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:xv(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),kT=m.forwardRef(dT(function(e,t){let n=_T(TT,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,I.jsx)(AT,{...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`)),AT=m.forwardRef(dT(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=_T(TT,n),p=hT(n);return Vy(),(0,I.jsx)(Sy,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(uy,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,I.jsx)(cT,{"data-state":jT(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 jT(e){return e?`open`:`closed`}dT(jT,`getState`);var MT=vT,NT=bT,PT=wT,FT=ET,IT=Object.defineProperty,LT=(e,t)=>IT(e,`name`,{value:t,configurable:!0}),RT=`Switch`,[zT,BT]=gv(RT),[VT,HT]=zT(RT);function UT(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]=Fv({prop:n,defaultProp:i??!1,onChange:c,caller:RT}),[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,I.jsx)(VT,{scope:t,...S,children:ZT(d)?d(S):r})}LT(UT,`SwitchProvider`);var WT=`SwitchTrigger`,GT=m.forwardRef(LT(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}=HT(WT,e),_=V_(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=LT(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,I.jsx)(sv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":QT(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:xv(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),KT=m.forwardRef(LT(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,I.jsx)(UT,{__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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(GT,{...d,ref:t,__scopeSwitch:n}),e&&(0,I.jsx)(XT,{__scopeSwitch:n})]})})},`Switch`)),qT=`SwitchThumb`,JT=m.forwardRef(LT(function(e,t){let{__scopeSwitch:n,...r}=e,i=HT(qT,n);return(0,I.jsx)(sv.span,{"data-state":QT(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),YT=`SwitchBubbleInput`,XT=m.forwardRef(LT(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}=HT(YT,e),_=V_(r,g),v=cS(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,I.jsx)(sv.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:xv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function ZT(e){return typeof e==`function`}LT(ZT,`isFunction`);function QT(e){return e?`checked`:`unchecked`}LT(QT,`getState`);var $T=Object.defineProperty,eE=(e,t)=>$T(e,`name`,{value:t,configurable:!0}),[tE,nE]=gv(`Tooltip`,[Ww]),rE=Ww(),iE=`TooltipProvider`,aE=700,oE=`tooltip.open`,[sE,cE]=tE(iE),lE=eE(e=>{let{__scopeTooltip:t,delayDuration:n=aE,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,I.jsx)(sE,{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`),uE=`Tooltip`,[dE,fE]=tE(uE),pE=eE(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=cE(uE,e.__scopeTooltip),l=rE(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=$v(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=Fv({prop:r,defaultProp:i??!1,onChange:eE(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(oE))):c.onClose(),a?.(e)},`onChange`),caller:uE}),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,I.jsx)(oT,{...l,children:(0,I.jsx)(dE,{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`),mE=`TooltipTrigger`,hE=m.forwardRef(eE(function(e,t){let{__scopeTooltip:n,...r}=e,i=fE(mE,n),a=cE(mE,n),o=rE(n),s=V_(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,I.jsx)(sT,{asChild:!0,...o,children:(0,I.jsx)(sv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:xv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:xv(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:xv(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:xv(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:xv(e.onBlur,i.onClose),onClick:xv(e.onClick,i.onClose)})})},`TooltipTrigger`)),gE=`TooltipPortal`,[_E,vE]=tE(gE,{forceMount:void 0}),yE=eE(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=fE(gE,t);return(0,I.jsx)(_E,{scope:t,forceMount:n,children:(0,I.jsx)(Uv,{present:n||a.open,children:(0,I.jsx)(Fy,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),bE=`TooltipContent`,xE=m.forwardRef(eE(function(e,t){let n=vE(bE,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=fE(bE,e.__scopeTooltip);return(0,I.jsx)(Uv,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(wE,{side:i,...a,ref:t}):(0,I.jsx)(SE,{side:i,...a,ref:t})})},`TooltipContent`)),SE=m.forwardRef(eE(function(e,t){let n=fE(bE,e.__scopeTooltip),r=cE(bE,e.__scopeTooltip),i=m.useRef(null),a=V_(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=DE(r,EE(r,n.getBoundingClientRect())),a=OE(t.getBoundingClientRect()),o=AE([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=eE(e=>p(e,u),`handleTriggerLeave`),t=eE(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=eE(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!kE(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(wE,{...e,ref:a})},`TooltipContentHoverable`)),CE=q_(`TooltipContent`),wE=m.forwardRef(eE(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=fE(bE,n),u=rE(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(oE,d),()=>document.removeEventListener(oE,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=eE(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 Ev(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,I.jsx)(uy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(cT,{"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,I.jsx)(CE,{children:r}),i?(0,I.jsx)(fv,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),TE=m.forwardRef(eE(function(e,t){let{__scopeTooltip:n,...r}=e,i=rE(n);return(0,I.jsx)(lT,{...i,...r,ref:t})},`TooltipArrow`));function EE(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`)}}eE(EE,`getExitSideFromRect`);function DE(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}eE(DE,`getPaddedExitPoints`);function OE(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}]}eE(OE,`getPointsFromRect`);function kE(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}eE(kE,`isPointInPolygon`);function AE(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)),jE(t)}eE(AE,`getHull`);function jE(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)}eE(jE,`getHullPresorted`);var ME=lE,NE=pE,PE=hE,FE=yE,IE=xE,LE=TE,RE=dg(`group/button pointer-coarse:min-h-10 pointer-coarse:min-w-10 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:ring-3 focus-visible:ring-ring/40 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:ring-destructive/30 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 J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?G_:`button`;return(0,I.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(RE({variant:t,size:n,className:e})),...i})}var zE=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 BE({className:e,...t}){return(0,I.jsx)(`kbd`,{"data-slot":`kbd`,className:q(zE,e),...t})}function VE({className:e,...t}){return(0,I.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var HE=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),UE={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},WE={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function GE(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return HE&&UE[t]?UE[t]:WE[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function KE({chord:e,className:t}){let n=GE(e);return(0,I.jsx)(VE,{className:t,children:n.map((e,t)=>(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,I.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,I.jsx)(BE,{children:e})]},t))})}function qE({chord:e,children:t,className:n}){return(0,I.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,I.jsx)(KE,{chord:e}),t]})}function JE({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=Jd();return(0,I.jsx)(px,{open:e,onOpenChange:t,children:(0,I.jsx)(nu,{children:e?(0,I.jsxs)(yx,{forceMount:!0,children:[(0,I.jsx)(xx,{asChild:!0,forceMount:!0,children:(0,I.jsx)(z.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,I.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center p-4`,children:(0,I.jsx)(Tx,{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,I.jsxs)(z.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,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,I.jsx)(Ax,{className:`sr-only`,children:n}),r?(0,I.jsx)(Mx,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var YE=[],XE=0,ZE=new Set;function QE(){for(let e of[...ZE])e()}function $E(e){return ZE.add(e),()=>{ZE.delete(e)}}function eD(){let e;for(let t of YE)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var tD={question:30,confirm:20,help:10,sheet:5};function nD(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return YE=[...YE,{id:n,priority:t,order:++XE}],QE(),()=>{YE=YE.filter(e=>e.id!==n),QE()}},[e,t,n]);let r=(0,m.useSyncExternalStore)($E,eD,()=>void 0);return e&&r===n}function rD(){return YE.length>0}function iD(){return(0,m.useSyncExternalStore)($E,()=>YE.length>0,()=>!1)}var aD=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],oD=`already answered in another window`,sD=`Attached files:`,cD=new Set(aD);function lD(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(cD.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function uD(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function dD(e){window.location.hash!==e&&(window.location.hash=e)}function fD(){let[e,t]=(0,m.useState)(()=>lD(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=lD(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 pD({className:e,...t}){return(0,I.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 mD({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var hD=dg(`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 gD({className:e,variant:t=`default`,...n}){return(0,I.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(hD({variant:t,className:e})),...n})}function _D({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function vD({className:e,...t}){return(0,I.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 yD({className:e,...t}){return(0,I.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,I.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))})}function bD({label:e=`Connecting…`}){return(0,I.jsxs)(`div`,{className:`flex min-h-48 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{}),(0,I.jsx)(`span`,{children:e})]})}function xD({message:e,onRetry:t}){return(0,I.jsxs)(pD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(mD,{children:[(0,I.jsxs)(_D,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Wh,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,I.jsx)(vD,{children:e??`The request failed. Try again.`})]}),t?(0,I.jsxs)(J,{variant:`outline`,onClick:t,children:[(0,I.jsx)(bh,{"aria-hidden":`true`}),`Try again`]}):null]})}function SD({onRetry:e}){return(0,I.jsxs)(`div`,{role:`status`,className:`mx-3 mb-1 flex items-center gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive max-sm:mx-2`,children:[(0,I.jsx)(ng,{className:`size-4`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{children:`Connection lost — retrying every 2 s.`}),e?(0,I.jsx)(J,{variant:`link`,className:`h-8 px-1 text-destructive`,onClick:e,children:`Retry now`}):null]})}function CD(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>kf.subscribe(t),[]),e}function wD(){return CD(),kf.status()}function TD(e){return CD(),kf.get(e)}function ED(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 DD(e,t,n,r=!0){CD();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[kf.status().connection,...n.map(e=>kf.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})),qf(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 OD({delayDuration:e=400,...t}){return(0,I.jsx)(ME,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function kD({...e}){return(0,I.jsx)(NE,{"data-slot":`tooltip`,...e})}function AD({...e}){return(0,I.jsx)(PE,{"data-slot":`tooltip-trigger`,...e})}function jD({className:e,sideOffset:t=6,children:n,...r}){return(0,I.jsx)(FE,{children:(0,I.jsxs)(IE,{"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,I.jsx)(LE,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function MD(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function ND(e,t,n){let r=MD(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 PD(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function FD(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function ID(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var LD=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function RD(e){return[...e.querySelectorAll(LD)].filter(e=>e.offsetParent!==null)}function zD(e,t,n){let r=RD(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 BD(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 VD(e){return e.querySelector(`[aria-current='true']`)??RD(e)[0]}function HD(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?VD(t):void 0)??RD(e)[0]??e).focus(),!0}function UD(){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 WD={active:!1},GD=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function KD(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!GD.has(t)}function qD(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function JD(){return rD()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function YD(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||qD(t,e)&&(PD(t.target)||(r||!JD())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var XD={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function Y({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=KD(r);YD(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,I.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`?`default`:s?`ghost`:`outline`,g=q(!s&&`px-2.5`,XD[n],c),_=s?`icon`:`default`,v=s?p:(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(`span`,{children:o??e}),r?(0,I.jsx)(KE,{chord:r,className:`kbd-hint ml-1`}):null]}),y=i?(0,I.jsx)(J,{asChild:!0,ref:d,variant:h,size:_,"data-tone":n,className:g,children:(0,I.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:v})}):(0,I.jsx)(J,{ref:d,type:`button`,variant:h,size:_,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:g,...u,children:v});return s?(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:y}),(0,I.jsxs)(jD,{children:[e,(0,I.jsx)(KE,{chord:r??(i?`Enter`:`Enter / Space`)})]})]}):y}function ZD({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,I.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-card/90 px-4 py-2 backdrop-blur-sm [&>[data-tone=danger]:not(:first-child)]:ml-auto`,t),children:e})}function QD({...e}){return(0,I.jsx)(px,{"data-slot":`sheet`,...e})}function $D({...e}){return(0,I.jsx)(Px,{"data-slot":`sheet-close`,...e})}function eO({...e}){return(0,I.jsx)(yx,{"data-slot":`sheet-portal`,...e})}function tO({className:e,...t}){return(0,I.jsx)(xx,{"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 nO({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,I.jsxs)(eO,{forceMount:i,children:[a?null:(0,I.jsx)(tO,{}),(0,I.jsxs)(Tx,{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,I.jsx)(Px,{"data-slot":`sheet-close`,asChild:!0,children:(0,I.jsxs)(J,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,I.jsx)(ig,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function rO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function iO({className:e,...t}){return(0,I.jsx)(Ax,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function aO({className:e,...t}){return(0,I.jsx)(Mx,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function oO(){return ED(`(min-width: 1024px)`)}function sO({className:e,...t}){return(0,I.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function cO({open:e,onClose:t,describe:n,children:r}){let i=nD(e,tD.sheet),a=(0,m.useRef)(!1);return i&&(a.current=!0),e||(a.current=!1),(0,I.jsx)(QD,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,I.jsxs)(nO,{forceMount:e&&a.current?!0:void 0,hidden:!i,showCloseButton:!1,className:q(`gap-0 data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,I.jsxs)(rO,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,I.jsx)(iO,{className:`text-sm`,children:`Detail`}),(0,I.jsx)(aO,{className:`sr-only`,children:n}),(0,I.jsx)($D,{asChild:!0,children:(0,I.jsxs)(J,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:`gap-2`,children:[(0,I.jsx)(ig,{"aria-hidden":`true`}),`Close`,(0,I.jsx)(KE,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function lO({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o}){let s=(0,m.useRef)(null),c=(0,m.useRef)(null);function l(t){let n=s.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||rD()||t.altKey||t.ctrlKey||t.metaKey||PD(t.target)||t.target instanceof HTMLInputElement)return;let r=FD(t.key,!1);r?(t.preventDefault(),zD(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),zD(n,t.target,t.key===`Home`?`first`:`last`)):e&&ID(t.key)===1&&c.current&&(t.preventDefault(),c.current.focus())}function u(e){e.defaultPrevented||e.nativeEvent.isComposing||rD()||e.altKey||e.ctrlKey||e.metaKey||PD(e.target)||ID(e.key)===-1&&s.current&&(e.preventDefault(),VD(s.current)?.focus())}return e?(0,I.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)]`,children:[(0,I.jsx)(sO,{"data-pane":`list`,ref:s,onKeyDown:l,className:`overflow-y-auto border-r border-border pb-dock`,children:t}),(0,I.jsx)(sO,{"data-pane":`detail`,ref:c,tabIndex:0,"aria-label":`Detail`,onKeyDown:u,className:`overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,children:n??(0,I.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,I.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,I.jsx)(Qm,{className:`size-5`})}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,I.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(KE,{chord:`ArrowUp`}),(0,I.jsx)(KE,{chord:`ArrowDown`}),`move`]}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(KE,{chord:`ArrowRight`}),`open`]})]})]})})})]}):(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,I.jsx)(sO,{"data-pane":`list`,ref:s,onKeyDown:l,children:t}),(0,I.jsx)(cO,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function uO({title:e,count:t,children:n}){return(0,I.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-card/90 px-4 py-2 backdrop-blur-sm`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function dO(){return(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,I.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function fO({className:e,...t}){return(0,I.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 pO(e){return e<10?`0${e}`:String(e)}function mO(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${pO(t.getHours())}:${pO(t.getMinutes())}`}function hO(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${pO(n%60)}m`}function gO(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 _O(e){let t=gO(e);return t===`now`?`just now`:`${t} ago`}function vO({...e}){return(0,I.jsx)(Qx,{"data-slot":`alert-dialog`,...e})}function yO({...e}){return(0,I.jsx)($x,{"data-slot":`alert-dialog-portal`,...e})}function bO({className:e,...t}){return(0,I.jsx)(eS,{"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 xO({className:e,...t}){return(0,I.jsxs)(yO,{children:[(0,I.jsx)(bO,{}),(0,I.jsx)(tS,{"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 SO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function CO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function wO({className:e,...t}){return(0,I.jsx)(iS,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function TO({className:e,...t}){return(0,I.jsx)(aS,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function EO({className:e,variant:t=`default`,...n}){return(0,I.jsx)(J,{variant:t,className:q(`h-8`,e),asChild:!0,children:(0,I.jsx)(nS,{"data-slot":`alert-dialog-action`,...n})})}function DO({className:e,...t}){return(0,I.jsx)(J,{variant:`outline`,className:q(`h-8`,e),asChild:!0,children:(0,I.jsx)(rS,{"data-slot":`alert-dialog-cancel`,...t})})}function OO({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=nD(f,tD.confirm),g=l===`destructive`;return YD(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,I.jsxs)(vO,{open:f&&h,onOpenChange:p,children:[(0,I.jsx)(Y,{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,I.jsxs)(xO,{children:[(0,I.jsxs)(SO,{children:[(0,I.jsx)(wO,{children:r}),(0,I.jsx)(TO,{children:i})]}),(0,I.jsxs)(CO,{children:[(0,I.jsxs)(DO,{children:[`Keep it`,(0,I.jsx)(KE,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,I.jsxs)(EO,{variant:g?`destructive`:`default`,onClick:o,children:[a,(0,I.jsx)(KE,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function kO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var AO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,MO={};function NO(e,t){return((t||MO).jsx?jO:AO).test(e)}var PO=/[ \t\n\f\r]/g;function FO(e){return typeof e==`object`?e.type===`text`&&IO(e.value):IO(e)}function IO(e){return e.replace(PO,``)===``}var LO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};LO.prototype.normal={},LO.prototype.property={},LO.prototype.space=void 0;function RO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new LO(n,r,t)}function zO(e){return e.toLowerCase()}var BO=class{constructor(e,t){this.attribute=t,this.property=e}};BO.prototype.attribute=``,BO.prototype.booleanish=!1,BO.prototype.boolean=!1,BO.prototype.commaOrSpaceSeparated=!1,BO.prototype.commaSeparated=!1,BO.prototype.defined=!1,BO.prototype.mustUseProperty=!1,BO.prototype.number=!1,BO.prototype.overloadedBoolean=!1,BO.prototype.property=``,BO.prototype.spaceSeparated=!1,BO.prototype.space=void 0;var VO=s({boolean:()=>X,booleanish:()=>UO,commaOrSpaceSeparated:()=>qO,commaSeparated:()=>KO,number:()=>Z,overloadedBoolean:()=>WO,spaceSeparated:()=>GO}),HO=0,X=JO(),UO=JO(),WO=JO(),Z=JO(),GO=JO(),KO=JO(),qO=JO();function JO(){return 2**++HO}var YO=Object.keys(VO),XO=class extends BO{constructor(e,t,n,r){let i=-1;if(super(e,t),ZO(this,`space`,r),typeof n==`number`)for(;++i<YO.length;){let e=YO[i];ZO(this,YO[i],(n&VO[e])===VO[e])}}};XO.prototype.defined=!0;function ZO(e,t,n){n&&(e[t]=n)}function QO(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new XO(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[zO(r)]=r,n[zO(a.attribute)]=r}return new LO(t,n,e.space)}var $O=QO({properties:{ariaActiveDescendant:null,ariaAtomic:UO,ariaAutoComplete:null,ariaBusy:UO,ariaChecked:UO,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:GO,ariaCurrent:null,ariaDescribedBy:GO,ariaDetails:null,ariaDisabled:UO,ariaDropEffect:GO,ariaErrorMessage:null,ariaExpanded:UO,ariaFlowTo:GO,ariaGrabbed:UO,ariaHasPopup:null,ariaHidden:UO,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:GO,ariaLevel:Z,ariaLive:null,ariaModal:UO,ariaMultiLine:UO,ariaMultiSelectable:UO,ariaOrientation:null,ariaOwns:GO,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:UO,ariaReadOnly:UO,ariaRelevant:null,ariaRequired:UO,ariaRoleDescription:GO,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:UO,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ek(e,t){return t in e?e[t]:t}function tk(e,t){return ek(e,t.toLowerCase())}var nk=QO({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:KO,acceptCharset:GO,accessKey:GO,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:GO,autoFocus:X,autoPlay:X,blocking:GO,capture:null,charSet:null,checked:X,cite:null,className:GO,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:UO,controls:X,controlsList:GO,coords:Z|KO,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:WO,draggable:UO,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:GO,height:Z,hidden:WO,high:Z,href:null,hrefLang:null,htmlFor:GO,httpEquiv:GO,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:GO,itemRef:GO,itemScope:X,itemType:GO,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:GO,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:GO,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:GO,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:UO,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:UO,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:GO,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:UO,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:KO,part:GO,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:tk}),rk=QO({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:qO,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:GO,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:KO,g2:KO,glyphName:KO,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:qO,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:GO,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:qO,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:qO,rev:qO,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:qO,requiredFeatures:qO,requiredFonts:qO,requiredFormats:qO,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:qO,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:qO,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:qO,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ek}),ik=QO({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()}}),ak=QO({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:tk}),ok=QO({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),sk={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`},ck=/[A-Z]/g,lk=/-[a-z]/g,uk=/^data[-\w.:]+$/i;function dk(e,t){let n=zO(t),r=t,i=BO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&uk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(lk,pk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!lk.test(e)){let n=e.replace(ck,fk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=XO}return new i(r,t)}function fk(e){return`-`+e.toLowerCase()}function pk(e){return e.charAt(1).toUpperCase()}var mk=RO([$O,nk,ik,ak,ok],`html`),hk=RO([$O,rk,ik,ak,ok],`svg`);function gk(e){return e.join(` `).trim()}var _k=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
|
-
`);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})),vk=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(_k());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}})),yk=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))}})),bk=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(vk()),r=yk();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})),xk=Ck(`end`),Sk=Ck(`start`);function Ck(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 wk(e){let t=Sk(e),n=xk(e);if(t&&n)return{start:t,end:n}}function Tk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Dk(e.position):`start`in e||`end`in e?Dk(e):`line`in e||`column`in e?Ek(e):``}function Ek(e){return Ok(e&&e.line)+`:`+Ok(e&&e.column)}function Dk(e){return Ek(e&&e.start)+`-`+Ek(e&&e.end)}function Ok(e){return e&&typeof e==`number`?e:1}var kk=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=Tk(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}};kk.prototype.file=``,kk.prototype.name=``,kk.prototype.reason=``,kk.prototype.message=``,kk.prototype.stack=``,kk.prototype.column=void 0,kk.prototype.line=void 0,kk.prototype.ancestors=void 0,kk.prototype.cause=void 0,kk.prototype.fatal=void 0,kk.prototype.place=void 0,kk.prototype.ruleId=void 0,kk.prototype.source=void 0;var Ak=l(bk(),1),jk={}.hasOwnProperty,Mk=new Map,Nk=/[A-Z]/g,Pk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Fk=new Set([`td`,`th`]),Ik=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Lk(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=Jk(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=qk(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`?hk:mk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Rk(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Rk(e,t,n){if(t.type===`element`)return zk(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Bk(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Hk(e,t,n);if(t.type===`mdxjsEsm`)return Vk(e,t);if(t.type===`root`)return Uk(e,t,n);if(t.type===`text`)return Wk(e,t)}function zk(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=hk,e.schema=i),e.ancestors.push(t);let a=eA(e,t.tagName,!1),o=Yk(e,t),s=Zk(e,t);return Pk.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!FO(e)})),Gk(e,o,a,t),Kk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Bk(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)}tA(e,t.position)}function Vk(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);tA(e,t.position)}function Hk(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=hk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:eA(e,t.name,!0),o=Xk(e,t),s=Zk(e,t);return Gk(e,o,a,t),Kk(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Uk(e,t,n){let r={};return Kk(r,Zk(e,t)),e.create(t,e.Fragment,r,n)}function Wk(e,t){return t.value}function Gk(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Kk(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function qk(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 Jk(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Sk(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 Yk(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&jk.call(t.properties,i)){let a=Qk(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Fk.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 Xk(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 tA(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 tA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Zk(e,t){let n=[],r=-1,i=e.passKeys?new Map:Mk;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=Rk(e,a,o);s!==void 0&&n.push(s)}return n}function Qk(e,t,n){let r=dk(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kO(n):gk(n)),r.property===`style`){let t=typeof n==`object`?n:$k(e,String(n));return e.stylePropertyNameCase===`css`&&(t=nA(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?sk[r.property]||r.property:r.attribute,n]}}function $k(e,t){try{return(0,Ak.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new kk("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=Ik+`#cannot-parse-style-attribute`,r}}function eA(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=NO(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=NO(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return jk.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);tA(e)}function tA(e,t){let n=new kk("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=Ik+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function nA(e){let t={},n;for(n in e)jk.call(e,n)&&(t[rA(n)]=e[n]);return t}function rA(e){let t=e.replace(Nk,iA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function iA(e){return`-`+e.toLowerCase()}var aA={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`]},oA={};function sA(e,t){let n=t||oA;return cA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function cA(e,t,n){if(uA(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 lA(e.children,t,n)}return Array.isArray(e)?lA(e,t,n):``}function lA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=cA(e[i],t,n);return r.join(``)}function uA(e){return!!(e&&typeof e==`object`)}var dA=document.createElement(`i`);function fA(e){let t=`&`+e+`;`;dA.innerHTML=t;let n=dA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function pA(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 mA(e,t){return e.length>0?(pA(e,e.length,0,t),e):t}var hA={}.hasOwnProperty;function gA(e){let t={},n=-1;for(;++n<e.length;)_A(t,e[n]);return t}function _A(e,t){let n;for(n in t){let r=(hA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){hA.call(r,a)||(r[a]=[]);let e=i[a];vA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function vA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);pA(e,0,0,r)}function yA(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 bA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var xA=jA(/[A-Za-z]/),SA=jA(/[\dA-Za-z]/),CA=jA(/[#-'*+\--9=?A-Z^-~]/);function wA(e){return e!==null&&(e<32||e===127)}var TA=jA(/\d/),EA=jA(/[\dA-Fa-f]/),DA=jA(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function OA(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var kA=jA(/\p{P}|\p{S}/u),AA=jA(/\s/);function jA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function MA(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&SA(e.charCodeAt(n+1))&&SA(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 NA(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function PA(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&$(t)?(e.enter(r),c(t)):l(t)}function c(t){return $(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var FA={tokenize:IA};function IA(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`),NA(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 Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var LA=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){RA(this,e,t,n,!1)}addBefore(e,t,n){RA(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 RA(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 zA={tokenize:VA},BA={tokenize:HA};function VA(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 LA;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(BA,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(BA,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 Q(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 LA;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 HA(e,t,n){return NA(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function UA(e){if(e===null||OA(e)||AA(e))return 1;if(kA(e))return 2}function WA(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 GA={name:`attention`,resolveAll:KA,tokenize:qA};function KA(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};JA(o,-a),JA(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=mA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=mA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=mA(r,WA(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=mA(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=mA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),pA(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 qA(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=UA(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=UA(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 JA(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var YA={name:`autolink`,tokenize:XA};function XA(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 xA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||SA(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||SA(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||wA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):CA(t)?(e.consume(t),l):n(t)}function u(e){return SA(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||SA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ZA={partial:!0,tokenize:QA};function QA(e,t,n){return r;function r(t){return $(t)?NA(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var $A={continuation:{tokenize:tj},exit:nj,name:`blockQuote`,tokenize:ej};function ej(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 $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function tj(e,t,n){let r=this;return i;function i(t){return $(t)?NA(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt($A,t,n)(r)}}function nj(e){e.exit(`blockQuote`)}var rj={name:`characterEscape`,tokenize:ij};function ij(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 DA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var aj={name:`characterReference`,tokenize:oj};function oj(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=SA,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=EA,u):(e.enter(`characterReferenceValue`),a=7,o=TA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===SA&&!fA(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 sj={partial:!0,tokenize:cj};function cj(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 lj={concrete:!0,name:`codeFenced`,tokenize:uj};function uj(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`),$(t)?NA(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(sj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),NA(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(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&&$(t)?NA(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(sj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(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`),$(t)?NA(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`),$(t)?NA(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var dj={name:`codeIndented`,tokenize:pj},fj={partial:!0,tokenize:mj};function pj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),PA(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(fj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function mj(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):PA(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var hj={name:`codeText`,previous:_j,resolve:gj,tokenize:vj};function gj(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 _j(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function vj(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)):Q(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||Q(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 yj=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&&bj(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),bj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),bj(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);bj(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);bj(this.left,t.reverse())}}}};function bj(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 xj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new yj(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,Sj(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 pA(e,0,1/0,u.slice(0)),!l}function Sj(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 Cj={resolve:Tj,tokenize:Ej},wj={partial:!0,tokenize:Dj};function Tj(e){return xj(e),e}function Ej(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):Q(t)?e.check(wj,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 Dj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),NA(e,a,`linePrefix`)}function a(i){if(i===null||Q(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 Oj(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||wA(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||Q(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||OA(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||wA(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 kj(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):Q(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||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Aj(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):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),NA(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(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 jj(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?NA(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Mj={name:`definition`,tokenize:Pj},Nj={partial:!0,tokenize:Fj};function Pj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return kj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=bA(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 OA(t)?jj(e,l)(t):l(t)}function l(t){return Oj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Nj,d,d)(t)}function d(t){return $(t)?NA(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Fj(e,t,n){return r;function r(t){return OA(t)?jj(e,i)(t):n(t)}function i(t){return Aj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?NA(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var Ij={name:`hardBreakEscape`,tokenize:Lj};function Lj(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Rj={name:`headingAtx`,resolve:zj,tokenize:Bj};function zj(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`};pA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Bj(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||OA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?NA(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||OA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Vj=`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(`.`),Hj=[`pre`,`script`,`style`,`textarea`],Uj={concrete:!0,name:`htmlFlow`,resolveTo:Gj,tokenize:Kj},Wj={partial:!0,tokenize:qj};function Gj(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 Kj(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:k):xA(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):xA(a)?(e.consume(a),i=4,r.interrupt?t:k):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:k):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return xA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||OA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Hj.includes(l)?(i=1,r.interrupt?t(s):D(s)):Vj.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||SA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||xA(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||SA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(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):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(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||OA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Q(t)?D(t):$(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),k):t===93&&i===5?(e.consume(t),oe):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Wj,ce,te)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(sj,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||Q(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),k):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return Hj.includes(n)?(e.consume(t),se):D(t)}return xA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),k):D(t)}function k(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),k):D(t)}function se(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function qj(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ZA,t,n)}}var Jj={name:`htmlText`,tokenize:Yj};function Yj(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):xA(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):xA(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):Q(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(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):Q(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):Q(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return xA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||SA(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,O(t)):$(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||SA(t)?(e.consume(t),w):t===47||t===62||OA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||xA(t)?(e.consume(t),E):Q(t)?(o=T,O(t)):$(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||SA(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Q(t)?(o=ee,O(t)):$(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Q(t)?(o=D,O(t)):$(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):Q(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||OA(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||OA(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return $(t)?NA(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var Xj={name:`labelEnd`,resolveAll:eM,resolveTo:tM,tokenize:nM},Zj={tokenize:rM},Qj={tokenize:iM},$j={tokenize:aM};function eM(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&&pA(e,0,e.length,n),e}function tM(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=mA(o,e.slice(i+1,i+r+3)),o=mA(o,[[`enter`,l,t]]),o=mA(o,WA(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=mA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=mA(o,e.slice(a+1)),o=mA(o,[[`exit`,s,t]]),pA(e,i,e.length,o),e}function nM(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(bA(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(Zj,u,o?u:d)(t):t===91?e.attempt(Qj,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt($j,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function rM(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 OA(t)?jj(e,a)(t):a(t)}function a(t){return t===41?u(t):Oj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return OA(t)?jj(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Aj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return OA(t)?jj(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 iM(e,t,n){let r=this;return i;function i(t){return kj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(bA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function aM(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 oM={name:`labelStartImage`,resolveAll:Xj.resolveAll,tokenize:sM};function sM(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 cM={name:`labelStartLink`,resolveAll:Xj.resolveAll,tokenize:lM};function lM(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 uM={name:`lineEnding`,tokenize:dM};function dM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),NA(e,t,`linePrefix`)}}var fM={name:`thematicBreak`,tokenize:pM};function pM(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||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?NA(e,s,`whitespace`)(t):s(t))}}var mM={continuation:{tokenize:vM},exit:bM,name:`list`,tokenize:_M},hM={partial:!0,tokenize:xM},gM={partial:!0,tokenize:yM};function _M(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:TA(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(fM,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 TA(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(ZA,r.interrupt?n:u,e.attempt(hM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(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 vM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ZA,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,NA(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(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(gM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,NA(e,e.attempt(mM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function yM(e,t,n){let r=this;return NA(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 bM(e){e.exit(this.containerState.type)}function xM(e,t,n){let r=this;return NA(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!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var SM={name:`setextUnderline`,resolveTo:CM,tokenize:wM};function CM(e,t){let n=new LA,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 wM(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`),$(t)?NA(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var TM={tokenize:EM};function EM(e){let t=this,n=e.attempt(ZA,r,e.attempt(this.parser.constructs.flowInitial,i,NA(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Cj,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 DM={resolveAll:jM()},OM=AM(`string`),kM=AM(`text`);function AM(e){return{resolveAll:jM(e===`text`?MM: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 jM(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 MM(e,t){let n=new LA,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 NM=s({attentionMarkers:()=>VM,contentInitial:()=>FM,disable:()=>HM,document:()=>PM,flow:()=>LM,flowInitial:()=>IM,insideSpan:()=>BM,string:()=>RM,text:()=>zM}),PM={42:mM,43:mM,45:mM,48:mM,49:mM,50:mM,51:mM,52:mM,53:mM,54:mM,55:mM,56:mM,57:mM,62:$A},FM={91:Mj},IM={[-2]:dj,[-1]:dj,32:dj},LM={35:Rj,42:fM,45:[SM,fM],60:Uj,61:SM,95:fM,96:lj,126:lj},RM={38:aj,92:rj},zM={[-5]:uM,[-4]:uM,[-3]:uM,33:oM,38:aj,42:GA,60:[YA,Jj],91:cM,92:[Ij,rj],93:Xj,95:GA,96:hj},BM={null:[GA,DM]},VM={null:[42,95]},HM={null:[]};function UM(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=mA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=WA(a,l.events,l),l.events):[]}function f(e,t){return GM(p(e),t)}function p(e){return WM(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){Q(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&&pA(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 WM(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 GM(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=`
|
|
58
|
+
`},rx=0,ix=[];function ax(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),i=m.useState(rx++)[0],a=m.useState(Db)[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=rb([e.lockRef.current],(e.shards||[]).map(ex),!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=Qb(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=Gb(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Gb(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 Zb(h,t,e,h===`h`?s:c,!0)},[]),c=m.useCallback(function(e){var n=e;if(ix.length&&ix[ix.length-1]===a){var r=`deltaY`in n?$b(n):Qb(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&tx(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ex).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:ox(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=Qb(e),r.current=void 0},[]),d=m.useCallback(function(t){l(t.type,$b(t),t.target,s(t,e.lockRef.current))},[]),f=m.useCallback(function(t){l(t.type,Qb(t),t.target,s(t,e.lockRef.current))},[]);m.useEffect(function(){return ix.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Bb),document.addEventListener(`touchmove`,c,Bb),document.addEventListener(`touchstart`,u,Bb),function(){ix=ix.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Bb),document.removeEventListener(`touchmove`,c,Bb),document.removeEventListener(`touchstart`,u,Bb)}},[]);var p=e.removeScrollBar,h=e.inert;return m.createElement(m.Fragment,null,h?m.createElement(a,{styles:nx(i)}):null,p?m.createElement(Lb,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ox(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var sx=_b(vb,ax),cx=m.forwardRef(function(e,t){return m.createElement(bb,tb({},e,{ref:t,sideCar:sx}))});cx.classNames=bb.classNames;var lx=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},ux=new WeakMap,dx=new WeakMap,fx={},px=0,mx=function(e){return e&&(e.host||mx(e.parentNode))},hx=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=mx(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})},gx=function(e,t,n,r){var i=hx(t,Array.isArray(e)?e:[e]);fx[n]||(fx[n]=new WeakMap);var a=fx[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=(ux.get(e)||0)+1,l=(a.get(e)||0)+1;ux.set(e,c),a.set(e,l),o.push(e),c===1&&i&&dx.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(),px++,function(){o.forEach(function(e){var t=ux.get(e)-1,i=a.get(e)-1;ux.set(e,t),a.set(e,i),t||(dx.has(e)||e.removeAttribute(r),dx.delete(e)),i||e.removeAttribute(n)}),px--,px||(ux=new WeakMap,ux=new WeakMap,dx=new WeakMap,fx={})}},_x=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||lx(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),gx(r,i,n,`aria-hidden`)):function(){return null}},vx=Object.defineProperty,yx=(e,t)=>vx(e,`name`,{value:t,configurable:!0}),bx=`Dialog`,[xx,Sx]=Ov(bx),[Cx,wx]=xx(bx),Tx=yx(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]=qv({prop:r,defaultProp:i??!1,onChange:a,caller:bx}),[d,f]=m.useState(0),[p,h]=m.useState(0);return(0,I.jsx)(Cx,{scope:t,triggerRef:s,contentRef:c,contentId:dy(),titleId:dy(),descriptionId:dy(),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`),Ex=`DialogTrigger`,Dx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,...r}=e,i=wx(Ex,n),a=$_(t,i.triggerRef);return(0,I.jsx)(yv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":qx(i.open),...r,ref:a,onClick:Nv(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ox=`DialogPortal`,[kx,Ax]=xx(Ox,{forceMount:void 0}),jx=yx(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=wx(Ox,t);return(0,I.jsx)(kx,{scope:t,forceMount:n,children:m.Children.map(r,e=>(0,I.jsx)(ty,{present:n||a.open,children:(0,I.jsx)(qy,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Mx=`DialogOverlay`,Nx=m.forwardRef(yx(function(e,t){let n=Ax(Mx,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wx(Mx,e.__scopeDialog);return a.modal?(0,I.jsx)(ty,{present:r||a.open,children:(0,I.jsx)(Fx,{...i,ref:t})}):null},`DialogOverlay`)),Px=nv(`DialogOverlay.RemoveScroll`),Fx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,...r}=e,i=wx(Mx,n),a=$_(t,Cy());return(0,I.jsx)(cx,{as:Px,allowPinchZoom:!0,shards:[i.contentRef],children:(0,I.jsx)(yv.div,{"data-state":qx(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),Ix=`DialogContent`,Lx=m.forwardRef(yx(function(e,t){let n=Ax(Ix,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=wx(Ix,e.__scopeDialog);return(0,I.jsx)(ty,{present:r||a.open,children:a.modal?(0,I.jsx)(Rx,{...i,ref:t}):(0,I.jsx)(zx,{...i,ref:t})})},`DialogContent`)),Rx=m.forwardRef(yx(function(e,t){let n=wx(Ix,e.__scopeDialog),r=m.useRef(null),i=$_(t,n.contentRef,r);return m.useEffect(()=>{let e=r.current;if(e)return _x(e)},[]),(0,I.jsx)(Bx,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:Nv(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Nv(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:Nv(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),zx=m.forwardRef(yx(function(e,t){let n=wx(Ix,e.__scopeDialog),r=m.useRef(!1),i=m.useRef(!1);return(0,I.jsx)(Bx,{...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`)),Bx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=wx(Ix,n);return $y(),(0,I.jsx)(I.Fragment,{children:(0,I.jsx)(Py,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(Sy,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":qx(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),Vx=`DialogTitle`,Hx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,...r}=e,i=wx(Vx,n),{setTitleCount:a}=i;return Rv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(yv.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),Ux=`DialogDescription`,Wx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,...r}=e,i=wx(Ux,n),{setDescriptionCount:a}=i;return Rv(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,I.jsx)(yv.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),Gx=`DialogClose`,Kx=m.forwardRef(yx(function(e,t){let{__scopeDialog:n,...r}=e,i=wx(Gx,n);return(0,I.jsx)(yv.button,{type:`button`,...r,ref:t,onClick:Nv(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function qx(e){return e?`open`:`closed`}yx(qx,`getState`);var Jx=Object.defineProperty,Yx=(e,t)=>Jx(e,`name`,{value:t,configurable:!0}),[Xx,Zx]=Ov(`AlertDialog`,[Sx]),Qx=Sx(),$x=Yx(e=>{let{__scopeAlertDialog:t,...n}=e,r=Qx(t);return(0,I.jsx)(Tx,{...r,...n,modal:!0})},`AlertDialog`);m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qx(n);return(0,I.jsx)(Dx,{...i,...r,ref:t})},`AlertDialogTrigger`));var eS=Yx(e=>{let{__scopeAlertDialog:t,...n}=e,r=Qx(t);return(0,I.jsx)(jx,{...r,...n})},`AlertDialogPortal`),tS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qx(n);return(0,I.jsx)(Nx,{...i,...r,ref:t})},`AlertDialogOverlay`)),[nS,rS]=Xx(`AlertDialogContent`),iS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Qx(n),o=$_(t,m.useRef(null)),s=m.useRef(null);return(0,I.jsx)(nS,{scope:n,cancelRef:s,children:(0,I.jsx)(Lx,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:Nv(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),aS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qx(n);return(0,I.jsx)(Hx,{...i,...r,ref:t})},`AlertDialogTitle`)),oS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qx(n);return(0,I.jsx)(Wx,{...i,...r,ref:t})},`AlertDialogDescription`)),sS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Qx(n);return(0,I.jsx)(Kx,{...i,...r,ref:t})},`AlertDialogAction`)),cS=`AlertDialogCancel`,lS=m.forwardRef(Yx(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=rS(cS,n),a=Qx(n),o=$_(t,i);return(0,I.jsx)(Kx,{...a,...r,ref:o})},`AlertDialogCancel`)),uS=$x,dS=eS,fS=tS,pS=iS,mS=sS,hS=lS,gS=aS,_S=oS,vS=Object.defineProperty,yS=(e,t)=>vS(e,`name`,{value:t,configurable:!0});function bS(e){let[t,n]=m.useState(void 0);return Rv(()=>{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}yS(bS,`useSize`);var xS=Object.defineProperty,SS=(e,t)=>xS(e,`name`,{value:t,configurable:!0}),CS=`Checkbox`,[wS,TS]=Ov(CS),[ES,DS]=wS(CS);function OS(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]=qv({prop:n,defaultProp:i??!1,onChange:c,caller:CS}),[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:!LS(i)&&i,isFormControl:S,bubbleInput:_,setBubbleInput:v};return(0,I.jsx)(ES,{scope:t,...C,children:IS(d)?d(C):r})}SS(OS,`CheckboxProvider`);var kS=`CheckboxTrigger`,AS=m.forwardRef(SS(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}=DS(kS,e),_=$_(i,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?.form;if(e){let t=SS(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,I.jsx)(yv.button,{type:`button`,role:`checkbox`,"aria-checked":LS(c)?`mixed`:c,"aria-required":l,"data-state":RS(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:_,onKeyDown:Nv(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:Nv(n,e=>{p(),d(e=>LS(e)?!0:!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`CheckboxTrigger`)),jS=m.forwardRef(SS(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,I.jsx)(OS,{__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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(AS,{...d,ref:t,__scopeCheckbox:n}),e&&(0,I.jsx)(FS,{__scopeCheckbox:n})]})})},`Checkbox`)),MS=`CheckboxIndicator`,NS=m.forwardRef(SS(function(e,t){let{__scopeCheckbox:n,forceMount:r,...i}=e,a=DS(MS,n);return(0,I.jsx)(ty,{present:r||LS(a.checked)||a.checked===!0,children:(0,I.jsx)(yv.span,{"data-state":RS(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})},`CheckboxIndicator`)),PS=`CheckboxBubbleInput`,FS=m.forwardRef(SS(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}=DS(PS,e),_=$_(r,g),v=bS(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=LS(s),n.call(e,!LS(s)&&s),e.dispatchEvent(t),y.current=!1}},[h,s,a,o]);let S=m.useRef(!LS(s)&&s);return(0,I.jsx)(yv.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:Nv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`CheckboxBubbleInput`));function IS(e){return typeof e==`function`}SS(IS,`isFunction`);function LS(e){return e===`indeterminate`}SS(LS,`isIndeterminate`);function RS(e){return LS(e)?`indeterminate`:e?`checked`:`unchecked`}SS(RS,`getState`);var zS=[`top`,`right`,`bottom`,`left`],BS=Math.min,VS=Math.max,HS=Math.round,US=Math.floor,WS=e=>({x:e,y:e}),GS={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function KS(e,t,n){return VS(e,BS(t,n))}function qS(e,t){return typeof e==`function`?e(t):e}function JS(e){return e.split(`-`)[0]}function YS(e){return e.split(`-`)[1]}function XS(e){return e===`x`?`y`:`x`}function ZS(e){return e===`y`?`height`:`width`}function QS(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function $S(e){return XS(QS(e))}function eC(e,t,n){n===void 0&&(n=!1);let r=YS(e),i=$S(e),a=ZS(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=lC(o)),[o,lC(o)]}function tC(e){let t=lC(e);return[nC(e),t,nC(t)]}function nC(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var rC=[`left`,`right`],iC=[`right`,`left`],aC=[`top`,`bottom`],oC=[`bottom`,`top`];function sC(e,t,n){switch(e){case`top`:case`bottom`:return n?t?iC:rC:t?rC:iC;case`left`:case`right`:return t?aC:oC;default:return[]}}function cC(e,t,n,r){let i=YS(e),a=sC(JS(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(nC)))),a}function lC(e){let t=JS(e);return GS[t]+e.slice(t.length)}function uC(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function dC(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:uC(e)}function fC(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 pC(e,t,n){let{reference:r,floating:i}=e,a=QS(t),o=$S(t),s=ZS(o),c=JS(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=YS(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function mC(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}=qS(t,e),p=dC(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=fC(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=fC(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 hC=50,gC=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mC},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pC(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<hC&&(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}=pC(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_C=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}=qS(e,t)||{};if(l==null)return{};let d=dC(u),f={x:n,y:r},p=$S(i),m=ZS(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=BS(d[_],T),ee=BS(d[v],T),D=C-h[m]-ee,te=C/2-h[m]/2+w,ne=KS(E,te,D),re=!c.arrow&&YS(i)!=null&&te!==ne&&a.reference[m]/2-(te<E?E:ee)-h[m]/2<0,ie=re?te<E?te-E:te-D:0;return{[p]:f[p]+ie,data:{[p]:ne,centerOffset:te-ne-ie,...re&&{alignmentOffset:ie}},reset:re}}}),vC=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}=qS(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=JS(r),_=QS(o),v=JS(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[lC(o)]:tC(o)),x=p!==`none`;!d&&x&&b.push(...cC(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=eC(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`||_===QS(t)||T.every(e=>QS(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=QS(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 yC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bC(e){return zS.some(t=>e[t]>=0)}var xC=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=qS(e,t);switch(i){case`referenceHidden`:{let e=yC(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:bC(e)}}}case`escaped`:{let e=yC(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:bC(e)}}}default:return{}}}}},SC=new Set([`left`,`top`]);async function CC(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=JS(n),s=YS(n),c=QS(n)===`y`,l=SC.has(o)?-1:1,u=a&&c?-1:1,d=qS(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 wC=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 CC(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}}}}},TC=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}=qS(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=QS(i),p=XS(f),m=u[p],h=u[f],g=(e,t)=>KS(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}}}}}},EC=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}=qS(e,t),u={x:n,y:r},d=QS(i),f=XS(d),p=u[f],m=u[d],h=qS(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=SC.has(JS(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}}}},DC=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}=qS(e,t),c=await i.detectOverflow(t,s),l=JS(n),u=YS(n),d=QS(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=BS(p-c[m],g),y=BS(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*VS(c.left,c.right):S=p-2*VS(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 OC(){return typeof window<`u`}function kC(e){return MC(e)?(e.nodeName||``).toLowerCase():`#document`}function AC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function jC(e){return((MC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function MC(e){return OC()?e instanceof Node||e instanceof AC(e).Node:!1}function NC(e){return OC()?e instanceof Element||e instanceof AC(e).Element:!1}function PC(e){return OC()?e instanceof HTMLElement||e instanceof AC(e).HTMLElement:!1}function FC(e){return!OC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof AC(e).ShadowRoot}function IC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=qC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function LC(e){return/^(table|td|th)$/.test(kC(e))}function RC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var zC=/transform|translate|scale|rotate|perspective|filter/,BC=/paint|layout|strict|content/,VC=e=>!!e&&e!==`none`,HC;function UC(e){let t=NC(e)?qC(e):e;return VC(t.transform)||VC(t.translate)||VC(t.scale)||VC(t.rotate)||VC(t.perspective)||!GC()&&(VC(t.backdropFilter)||VC(t.filter))||zC.test(t.willChange||``)||BC.test(t.contain||``)}function WC(e){let t=YC(e);for(;PC(t)&&!KC(t);){if(UC(t))return t;if(RC(t))return null;t=YC(t)}return null}function GC(){return HC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),HC}function KC(e){return/^(html|body|#document)$/.test(kC(e))}function qC(e){return AC(e).getComputedStyle(e)}function JC(e){return NC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function YC(e){if(kC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||FC(e)&&e.host||jC(e);return FC(t)?t.host:t}function XC(e){let t=YC(e);return KC(t)?(e.ownerDocument||e).body:PC(t)&&IC(t)?t:XC(t)}function ZC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=XC(e),i=r===e.ownerDocument?.body,a=AC(r);if(i){let e=QC(a);return t.concat(a,a.visualViewport||[],IC(r)?r:[],e&&n?ZC(e):[])}return t.concat(r,ZC(r,[],n))}function QC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $C(e){let t=qC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=PC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=HS(n)!==a||HS(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function ew(e){return NC(e)?e:e.contextElement}function tw(e){let t=ew(e);if(!PC(t))return WS(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=$C(t),o=(a?HS(n.width):n.width)/r,s=(a?HS(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var nw=WS(0);function rw(e){let t=AC(e);return!GC()||!t.visualViewport?nw:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function iw(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===AC(e)}function aw(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=ew(e),o=WS(1);t&&(r?NC(r)&&(o=tw(r)):o=tw(e));let s=iw(a,n,r)?rw(a):WS(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=AC(a),t=NC(r)?AC(r):r,n=e,i=QC(n);for(;i&&t!==n;){let e=tw(i),t=i.getBoundingClientRect(),r=qC(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=AC(i),i=QC(n)}}return fC({width:u,height:d,x:c,y:l})}function ow(e,t){let n=JC(e).scrollLeft;return t?t.left+n:aw(jC(e)).left+n}function sw(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ow(e,n),y:n.top+t.scrollTop}}function cw(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=jC(r),s=t?RC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=WS(1),u=WS(0),d=PC(r);if((d||!a)&&((kC(r)!==`body`||IC(o))&&(c=JC(r)),d)){let e=aw(r);l=tw(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sw(o,c):WS(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 lw(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function uw(e){let t=JC(e),n=e.ownerDocument.body,r=VS(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=VS(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ow(e),o=-t.scrollTop;return qC(n).direction===`rtl`&&(a+=VS(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dw=25;function fw(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=AC(e),a=jC(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!GC()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ow(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<=dw&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pw(e,t){let n=aw(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=tw(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mw(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fw(e,n,t);else if(t===`document`)r=uw(jC(e));else if(NC(t))r=pw(t,n);else{let n=rw(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return fC(r)}function hw(e,t){let n=t.get(e);if(n)return n;let r=ZC(e,[],!1).filter(e=>NC(e)&&kC(e)!==`body`),i=null,a=qC(e).position===`fixed`,o=a?YC(e):e;for(;NC(o)&&!KC(o);){let e=qC(o),t=UC(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=YC(o)}return t.set(e,r),r}function gw(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?RC(t)?[]:hw(t,this._c):[].concat(n),r],o=mw(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=mw(t,a[e],i);s=VS(n.top,s),c=BS(n.right,c),l=BS(n.bottom,l),u=VS(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function _w(e){let{width:t,height:n}=$C(e);return{width:t,height:n}}function vw(e,t,n){let r=PC(t),i=jC(t),a=n===`fixed`,o=aw(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=WS(0);if((r||!a)&&((kC(t)!==`body`||IC(i))&&(s=JC(t)),r)){let e=aw(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ow(i));let l=i&&!r&&!a?sw(i,s):WS(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 yw(e){return qC(e).position===`static`}function bw(e,t){if(!PC(e)||qC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return jC(e)===n&&(n=n.ownerDocument.body),n}function xw(e,t){let n=AC(e);if(RC(e))return n;if(!PC(e)){let t=YC(e);for(;t&&!KC(t);){if(NC(t)&&!yw(t))return t;t=YC(t)}return n}let r=bw(e,t);for(;r&&LC(r)&&yw(r);)r=bw(r,t);return r&&KC(r)&&yw(r)&&!UC(r)?n:r||WC(e)||n}var Sw=async function(e){let t=this.getOffsetParent||xw,n=this.getDimensions,r=await n(e.floating);return{reference:vw(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Cw(e){return qC(e).direction===`rtl`}var ww={convertOffsetParentRelativeRectToViewportRelativeRect:cw,getDocumentElement:jC,getClippingRect:gw,getOffsetParent:xw,getElementRects:Sw,getClientRects:lw,getDimensions:_w,getScale:tw,isElement:NC,isRTL:Cw};function Tw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ew(e,t,n){let r=null,i,a=jC(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=US(d),h=US(a.clientWidth-(u+f)),g=US(a.clientHeight-(d+p)),_=US(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:VS(0,BS(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Tw(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=AC(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dw(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=ew(e),u=i||a?[...l?ZC(l):[],...t?ZC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Ew(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?aw(e):null;c&&g();function g(){let t=aw(e);h&&!Tw(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 Ow=wC,kw=TC,Aw=vC,jw=DC,Mw=xC,Nw=_C,Pw=EC,Fw=(e,t,n)=>{let r=new Map,i=n??{},a={...ww,...i.platform,_c:r};return gC(e,t,{...i,platform:a})},Iw=typeof document<`u`?m.useLayoutEffect:function(){};function Lw(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(!Lw(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)&&!Lw(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Rw(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zw(e,t){let n=Rw(e);return Math.round(t*n)/n}function Bw(e){let t=m.useRef(e);return Iw(()=>{t.current=e}),t}function Vw(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);Lw(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,ee=Bw(c),D=Bw(i),te=Bw(l),ne=m.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Fw(C.current,w.current,e).then(e=>{let t={...e,isPositioned:te.current!==!1};re.current&&!Lw(T.current,t)&&(T.current=t,gv.flushSync(()=>{d(t)}))})},[f,t,n,D,te]);Iw(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let re=m.useRef(!1);Iw(()=>(re.current=!0,()=>{re.current=!1}),[]),Iw(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(ee.current)return ee.current(x,S,ne);ne()}},[x,S,ne,ee,E]);let ie=m.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),O=m.useMemo(()=>({reference:x,floating:S}),[x,S]),ae=m.useMemo(()=>{let e={position:n,left:0,top:0};if(!O.floating)return e;let t=zw(O.floating,u.x),r=zw(O.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Rw(O.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,O.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:ne,refs:ie,elements:O,floatingStyles:ae}),[u,ne,ie,O,ae])}var Hw=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?{}:Nw({element:r.current,padding:i}).fn(n):r?Nw({element:r,padding:i}).fn(n):{}}}},Uw=(e,t)=>{let n=Ow(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ww=(e,t)=>{let n=kw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gw=(e,t)=>({fn:Pw(e).fn,options:[e,t]}),Kw=(e,t)=>{let n=Aw(e);return{name:n.name,fn:n.fn,options:[e,t]}},qw=(e,t)=>{let n=jw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jw=(e,t)=>{let n=Mw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yw=(e,t)=>{let n=Hw(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xw=Object.defineProperty,Zw=m.forwardRef(((e,t)=>Xw(e,`name`,{value:t,configurable:!0}))(function(e,t){let{children:n,width:r=10,height:i=5,...a}=e;return(0,I.jsx)(yv.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,I.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})},`Arrow`)),Qw=Object.defineProperty,$w=(e,t)=>Qw(e,`name`,{value:t,configurable:!0}),eT=`Popper`,[tT,nT]=Ov(eT),[rT,iT]=tT(eT),aT=$w(e=>{let{__scopePopper:t,children:n}=e,[r,i]=m.useState(null),[a,o]=m.useState(void 0);return(0,I.jsx)(rT,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),oT=`PopperAnchor`,sT=m.forwardRef($w(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=iT(oT,n),o=m.useRef(null),s=a.onAnchorChange,c=$_(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&&_T(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,I.jsx)(yv.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),cT=`PopperContent`,[lT,uT]=tT(cT),dT=m.forwardRef($w(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,_=iT(cT,n),[v,y]=m.useState(null),b=$_(t,y),[x,S]=m.useState(null),C=bS(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),ee=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},D=Array.isArray(l)?l:[l],te=D.length>0,ne={padding:ee,boundary:D.filter(hT),altBoundary:te},{refs:re,floatingStyles:ie,placement:O,isPositioned:ae,middlewareData:oe}=Vw({strategy:`fixed`,placement:E,whileElementsMounted:$w((...e)=>Dw(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:_.anchor},middleware:[Uw({mainAxis:i+T,alignmentAxis:o}),c&&Ww({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?Gw():void 0,...ne}),c&&Kw({...ne}),qw({...ne,apply:$w(({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&&Yw({element:x,padding:s}),gT({arrowWidth:w,arrowHeight:T}),f&&Jw({strategy:`referenceHidden`,...ne,boundary:te?ne.boundary:void 0})]}),k=_.setPlacementState;Rv(()=>(k(O),()=>{k(void 0)}),[O,k]);let[se,ce]=_T(O),le=my(h);Rv(()=>{ae&&le?.()},[ae,le]);let ue=oe.arrow?.x,de=oe.arrow?.y,fe=oe.arrow?.centerOffset!==0,[pe,me]=m.useState();return Rv(()=>{v&&me(window.getComputedStyle(v).zIndex)},[v]),(0,I.jsx)(`div`,{ref:re.setFloating,"data-radix-popper-content-wrapper":``,style:{...ie,transform:ae?ie.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:pe,"--radix-popper-transform-origin":[oe.transformOrigin?.x,oe.transformOrigin?.y].join(` `),...oe.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,I.jsx)(lT,{scope:n,placedSide:se,placedAlign:ce,onArrowChange:S,arrowX:ue,arrowY:de,shouldHideArrow:fe,children:(0,I.jsx)(yv.div,{"data-side":se,"data-align":ce,...g,ref:b,style:{...g.style,animation:ae?g.style?.animation:`none`}})})})},`PopperContent`)),fT=`PopperArrow`,pT={top:`bottom`,right:`left`,bottom:`top`,left:`right`},mT=m.forwardRef($w(function(e,t){let{__scopePopper:n,...r}=e,i=uT(fT,n),a=pT[i.placedSide];return(0,I.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,I.jsx)(Zw,{...r,ref:t,style:{...r.style,display:`block`}})})},`PopperArrow`));function hT(e){return e!==null}$w(hT,`isNotNull`);var gT=$w(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]=_T(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 _T(e){let[t,n=`center`]=e.split(`-`);return[t,n]}$w(_T,`getSideAndAlignFromPlacement`);var vT=aT,yT=sT,bT=dT,xT=mT,ST=Object.defineProperty,CT=(e,t)=>ST(e,`name`,{value:t,configurable:!0}),wT=`Popover`,[TT,ET]=Ov(wT,[nT]),DT=nT(),[OT,kT]=TT(wT),AT=CT(e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=DT(t),c=m.useRef(null),[l,u]=m.useState(!1),[d,f]=qv({prop:r,defaultProp:i??!1,onChange:a,caller:wT});return(0,I.jsx)(vT,{...s,children:(0,I.jsx)(OT,{scope:t,contentId:dy(),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`),jT=`PopoverTrigger`,MT=m.forwardRef(CT(function(e,t){let{__scopePopover:n,...r}=e,i=kT(jT,n),a=DT(n),o=$_(t,i.triggerRef),s=(0,I.jsx)(yv.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":UT(i.open),...r,ref:o,onClick:Nv(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,I.jsx)(yT,{asChild:!0,...a,children:s})},`PopoverTrigger`)),NT=`PopoverPortal`,[PT,FT]=TT(NT,{forceMount:void 0}),IT=CT(e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=kT(NT,t);return(0,I.jsx)(PT,{scope:t,forceMount:n,children:(0,I.jsx)(ty,{present:n||a.open,children:(0,I.jsx)(qy,{asChild:!0,container:i,children:r})})})},`PopoverPortal`),LT=`PopoverContent`,RT=m.forwardRef(CT(function(e,t){let n=FT(LT,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=kT(LT,e.__scopePopover);return(0,I.jsx)(ty,{present:r||a.open,children:a.modal?(0,I.jsx)(BT,{...i,ref:t}):(0,I.jsx)(VT,{...i,ref:t})})},`PopoverContent`)),zT=nv(`PopoverContent.RemoveScroll`),BT=m.forwardRef(CT(function(e,t){let n=kT(LT,e.__scopePopover),r=m.useRef(null),i=$_(t,r),a=m.useRef(!1);return m.useEffect(()=>{let e=r.current;if(e)return _x(e)},[]),(0,I.jsx)(cx,{as:zT,allowPinchZoom:!0,children:(0,I.jsx)(HT,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Nv(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Nv(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:Nv(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})},`PopoverContentModal`)),VT=m.forwardRef(CT(function(e,t){let n=kT(LT,e.__scopePopover),r=m.useRef(!1),i=m.useRef(!1);return(0,I.jsx)(HT,{...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`)),HT=m.forwardRef(CT(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=kT(LT,n),p=DT(n);return $y(),(0,I.jsx)(Py,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,I.jsx)(Sy,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>f.onOpenChange(!1),deferPointerDownOutside:!0,children:(0,I.jsx)(bT,{"data-state":UT(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 UT(e){return e?`open`:`closed`}CT(UT,`getState`);var WT=AT,GT=MT,KT=IT,qT=RT,JT=Object.defineProperty,YT=(e,t)=>JT(e,`name`,{value:t,configurable:!0}),XT=`Switch`,[ZT,QT]=Ov(XT),[$T,eE]=ZT(XT);function tE(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]=qv({prop:n,defaultProp:i??!1,onChange:c,caller:XT}),[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,I.jsx)($T,{scope:t,...S,children:lE(d)?d(S):r})}YT(tE,`SwitchProvider`);var nE=`SwitchTrigger`,rE=m.forwardRef(YT(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}=eE(nE,e),_=$_(r,u),v=m.useRef(c);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=YT(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,I.jsx)(yv.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":uE(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:_,onClick:Nv(t,e=>{p(),d(e=>!e),g&&h&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),iE=m.forwardRef(YT(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,I.jsx)(tE,{__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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(rE,{...d,ref:t,__scopeSwitch:n}),e&&(0,I.jsx)(cE,{__scopeSwitch:n})]})})},`Switch`)),aE=`SwitchThumb`,oE=m.forwardRef(YT(function(e,t){let{__scopeSwitch:n,...r}=e,i=eE(aE,n);return(0,I.jsx)(yv.span,{"data-state":uE(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),sE=`SwitchBubbleInput`,cE=m.forwardRef(YT(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}=eE(sE,e),_=$_(r,g),v=bS(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,I.jsx)(yv.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:Nv(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function lE(e){return typeof e==`function`}YT(lE,`isFunction`);function uE(e){return e?`checked`:`unchecked`}YT(uE,`getState`);var dE=Object.defineProperty,fE=(e,t)=>dE(e,`name`,{value:t,configurable:!0}),[pE,mE]=Ov(`Tooltip`,[nT]),hE=nT(),gE=`TooltipProvider`,_E=700,vE=`tooltip.open`,[yE,bE]=pE(gE),xE=fE(e=>{let{__scopeTooltip:t,delayDuration:n=_E,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,I.jsx)(yE,{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`),SE=`Tooltip`,[CE,wE]=pE(SE),TE=fE(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=bE(SE,e.__scopeTooltip),l=hE(t),[u,d]=m.useState(null),[f,p]=m.useState(void 0),h=dy(),g=m.useRef(0),_=o??c.disableHoverableContent,v=s??c.delayDuration,y=m.useRef(!1),[b,x]=qv({prop:r,defaultProp:i??!1,onChange:fE(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(vE))):c.onClose(),a?.(e)},`onChange`),caller:SE}),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,I.jsx)(vT,{...l,children:(0,I.jsx)(CE,{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`),EE=`TooltipTrigger`,DE=m.forwardRef(fE(function(e,t){let{__scopeTooltip:n,...r}=e,i=wE(EE,n),a=bE(EE,n),o=hE(n),s=$_(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,I.jsx)(yT,{asChild:!0,...o,children:(0,I.jsx)(yv.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Nv(e.onPointerMove,e=>{e.pointerType!==`touch`&&!l.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),l.current=!0)}),onPointerLeave:Nv(e.onPointerLeave,()=>{i.onTriggerLeave(),l.current=!1}),onPointerDown:Nv(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,u,{once:!0})}),onFocus:Nv(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Nv(e.onBlur,i.onClose),onClick:Nv(e.onClick,i.onClose)})})},`TooltipTrigger`)),OE=`TooltipPortal`,[kE,AE]=pE(OE,{forceMount:void 0}),jE=fE(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=wE(OE,t);return(0,I.jsx)(kE,{scope:t,forceMount:n,children:(0,I.jsx)(ty,{present:n||a.open,children:(0,I.jsx)(qy,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),ME=`TooltipContent`,NE=m.forwardRef(fE(function(e,t){let n=AE(ME,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=wE(ME,e.__scopeTooltip);return(0,I.jsx)(ty,{present:r||o.open,children:o.disableHoverableContent?(0,I.jsx)(IE,{side:i,...a,ref:t}):(0,I.jsx)(PE,{side:i,...a,ref:t})})},`TooltipContent`)),PE=m.forwardRef(fE(function(e,t){let n=wE(ME,e.__scopeTooltip),r=bE(ME,e.__scopeTooltip),i=m.useRef(null),a=$_(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=zE(r,RE(r,n.getBoundingClientRect())),a=BE(t.getBoundingClientRect()),o=HE([...i,...a]);s(o),d(!0)},[d]);return m.useEffect(()=>()=>f(),[f]),m.useEffect(()=>{if(c&&u){let e=fE(e=>p(e,u),`handleTriggerLeave`),t=fE(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=fE(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!VE(n,o);r?f():i&&(f(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,f]),(0,I.jsx)(IE,{...e,ref:a})},`TooltipContentHoverable`)),FE=av(`TooltipContent`),IE=m.forwardRef(fE(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=wE(ME,n),u=hE(n),{onClose:d}=l;m.useEffect(()=>(document.addEventListener(vE,d),()=>document.removeEventListener(vE,d)),[d]),m.useEffect(()=>{if(l.trigger){let e=fE(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 Rv(()=>(f(a),()=>{f(void 0)}),[a,f]),(0,I.jsx)(Sy,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:d,children:(0,I.jsxs)(bT,{"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,I.jsx)(FE,{children:r}),i?(0,I.jsx)(wv,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`)),LE=m.forwardRef(fE(function(e,t){let{__scopeTooltip:n,...r}=e,i=hE(n);return(0,I.jsx)(xT,{...i,...r,ref:t})},`TooltipArrow`));function RE(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`)}}fE(RE,`getExitSideFromRect`);function zE(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}fE(zE,`getPaddedExitPoints`);function BE(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}]}fE(BE,`getPointsFromRect`);function VE(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}fE(VE,`isPointInPolygon`);function HE(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)),UE(t)}fE(HE,`getHull`);function UE(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)}fE(UE,`getHullPresorted`);var WE=xE,GE=TE,KE=DE,qE=jE,JE=NE,YE=LE,XE=Cg(`group/button pointer-coarse:min-h-10 pointer-coarse:min-w-10 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 J({className:e,variant:t=`default`,size:n=`default`,asChild:r=!1,...i}){let a=r?rv:`button`;return(0,I.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(XE({variant:t,size:n,className:e})),...i})}var ZE=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 QE({className:e,...t}){return(0,I.jsx)(`kbd`,{"data-slot":`kbd`,className:q(ZE,e),...t})}function $E({className:e,...t}){return(0,I.jsx)(`kbd`,{"data-slot":`kbd-group`,className:q(`inline-flex items-center gap-0.5`,e),...t})}var eD=typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),tD={alt:`⌥`,ctrl:`⌃`,shift:`⇧`,meta:`⌘`,cmd:`⌘`},nD={enter:`↵`,esc:`Esc`,escape:`Esc`,arrowleft:`←`,arrowright:`→`,arrowup:`↑`,arrowdown:`↓`,space:`Space`,delete:`Del`,backspace:`⌫`};function rD(e){return e.split(`+`).map(e=>{let t=e.toLowerCase();return eD&&tD[t]?tD[t]:nD[t]??(e.length===1?e.toUpperCase():e[0].toUpperCase()+e.slice(1))})}function iD({chord:e,className:t}){let n=rD(e);return(0,I.jsx)($E,{className:t,children:n.map((e,t)=>(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-0.5`,children:[t>0?(0,I.jsx)(`span`,{className:`sr-only`,children:`plus`}):null,(0,I.jsx)(QE,{children:e})]},t))})}function aD({chord:e,children:t,className:n}){return(0,I.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,I.jsx)(iD,{chord:e}),t]})}function oD({open:e,onOpenChange:t,label:n,description:r,dismissOnBackdrop:i=!0,className:a,style:o,onCloseAutoFocus:s,children:c}){let l=Jd();return(0,I.jsx)(Tx,{open:e,onOpenChange:t,children:(0,I.jsx)(nu,{children:e?(0,I.jsxs)(jx,{forceMount:!0,children:[(0,I.jsx)(Nx,{asChild:!0,forceMount:!0,children:(0,I.jsx)(z.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,I.jsx)(`div`,{className:`pointer-events-none fixed inset-0 z-50 grid place-items-center p-4`,children:(0,I.jsx)(Lx,{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,I.jsxs)(z.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,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,I.jsx)(Hx,{className:`sr-only`,children:n}),r?(0,I.jsx)(Wx,{className:`sr-only`,children:r}):null,c]})})})]}):null})})}var sD=[],cD=0,lD=new Set;function uD(){for(let e of[...lD])e()}function dD(e){return lD.add(e),()=>{lD.delete(e)}}function fD(){let e;for(let t of sD)(!e||t.priority>e.priority||t.priority===e.priority&&t.order<e.order)&&(e=t);return e?.id}var pD={question:30,confirm:20,help:10,sheet:5};function mD(e,t){let n=(0,m.useId)();(0,m.useEffect)(()=>{if(e)return sD=[...sD,{id:n,priority:t,order:++cD}],uD(),()=>{sD=sD.filter(e=>e.id!==n),uD()}},[e,t,n]);let r=(0,m.useSyncExternalStore)(dD,fD,()=>void 0);return e&&r===n}function hD(){return sD.length>0}function gD(){return(0,m.useSyncExternalStore)(dD,()=>sD.length>0,()=>!1)}var _D=[`lobby`,`tasks`,`plan`,`quickfix`,`issues`,`excalidraw`,`git`,`knowledge`,`metrics`],vD=`already answered in another window`,yD=`Attached files:`,bD=new Set(_D);function xD(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(bD.has(n))return{kind:`tab`,tab:n,rest:t.slice(1)}}function SD(e,...t){return`#/${e}${t.filter(Boolean).map(e=>`/${encodeURIComponent(e)}`).join(``)}`}function CD(e){window.location.hash!==e&&(window.location.hash=e)}function wD(){let[e,t]=(0,m.useState)(()=>xD(window.location.hash)??{kind:`tab`,tab:`lobby`,rest:[]});return(0,m.useEffect)(()=>{let e=()=>{let e=xD(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 TD({className:e,...t}){return(0,I.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 ED({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`empty-header`,className:q(`flex max-w-sm flex-col items-center gap-2`,e),...t})}var DD=Cg(`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 OD({className:e,variant:t=`default`,...n}){return(0,I.jsx)(`div`,{"data-slot":`empty-icon`,"data-variant":t,className:q(DD({variant:t,className:e})),...n})}function kD({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`empty-title`,className:q(`text-sm font-medium tracking-tight`,e),...t})}function AD({className:e,...t}){return(0,I.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 jD({className:e,...t}){return(0,I.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,I.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))})}function MD({label:e=`Connecting…`}){return(0,I.jsxs)(`div`,{className:`flex min-h-48 flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{}),(0,I.jsx)(`span`,{children:e})]})}function ND({message:e,onRetry:t}){return(0,I.jsxs)(TD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(ED,{children:[(0,I.jsxs)(kD,{className:`flex items-center gap-2`,children:[(0,I.jsx)(ng,{className:`size-4 text-destructive`,"aria-hidden":`true`}),`Could not load this view`]}),(0,I.jsx)(AD,{children:e??`The request failed. Try again.`})]}),t?(0,I.jsxs)(J,{variant:`outline`,onClick:t,children:[(0,I.jsx)(Oh,{"aria-hidden":`true`}),`Try again`]}):null]})}function PD({onRetry:e}){return(0,I.jsxs)(`div`,{role:`status`,className:`mx-3 mb-1 flex items-center gap-2 rounded-lg bg-destructive/10 px-3 py-2 text-sm text-destructive max-sm:mx-2`,children:[(0,I.jsx)(mg,{className:`size-4`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{children:`Connection lost — retrying every 2 s.`}),e?(0,I.jsx)(J,{variant:`link`,className:`h-8 px-1 text-destructive`,onClick:e,children:`Retry now`}):null]})}function FD(){let[e,t]=(0,m.useReducer)(e=>e+1,0);return(0,m.useEffect)(()=>kf.subscribe(t),[]),e}function ID(){return FD(),kf.status()}function LD(e){return FD(),kf.get(e)}function RD(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 zD(e,t,n,r=!0){FD();let[i,a]=(0,m.useState)({loading:!0,at:0}),[o,s]=(0,m.useState)(0),c=[kf.status().connection,...n.map(e=>kf.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})),qf(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 BD({delayDuration:e=400,...t}){return(0,I.jsx)(WE,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function VD({...e}){return(0,I.jsx)(GE,{"data-slot":`tooltip`,...e})}function HD({...e}){return(0,I.jsx)(KE,{"data-slot":`tooltip-trigger`,...e})}function UD({className:e,sideOffset:t=6,children:n,...r}){return(0,I.jsx)(qE,{children:(0,I.jsxs)(JE,{"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,I.jsx)(YE,{className:`z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground`})]})})}function WD(e){return[...e.querySelectorAll(`[data-nav]`)].filter(e=>!e.hasAttribute(`disabled`)&&e.getAttribute(`aria-hidden`)!==`true`)}function GD(e,t,n){let r=WD(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 KD(e){return e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLInputElement&&![`checkbox`,`radio`,`button`].includes(e.type)||e instanceof HTMLElement&&e.isContentEditable}function qD(e,t=!0){return e===`ArrowDown`||t&&e===`j`?1:e===`ArrowUp`||t&&e===`k`?-1:0}function JD(e,t=!0){return e===`ArrowRight`||t&&e===`l`?1:e===`ArrowLeft`||t&&e===`h`?-1:0}var YD=`button:not([disabled]), a[href], [role='button']:not([aria-disabled='true'])`;function XD(e){return[...e.querySelectorAll(YD)].filter(e=>e.offsetParent!==null)}function ZD(e,t,n){let r=XD(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 QD(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 $D(e){return e.querySelector(`[aria-current='true']`)??XD(e)[0]}function eO(){let e=document.getElementById(`main`);if(!e)return!1;let t=e.querySelector(`[data-pane='list']`);return((t?$D(t):void 0)??XD(e)[0]??e).focus(),!0}function tO(){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 nO={active:!1},rO=new Set([`g`,`j`,`k`,`h`,`l`,`d`,`p`,`/`,`?`,`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`]);function iO(e){if(!e)return!1;let t=e.toLowerCase();return t===`delete`||/^[a-z]$/.test(t)&&!rO.has(t)}function aO(e,t){return t.toLowerCase()===`delete`?e.key===`Delete`||e.key===`Backspace`:e.key.toLowerCase()===t.toLowerCase()}function oO(){return hD()||!!document.querySelector(`[role='dialog'], [role='alertdialog'], [role='menu'], [role='listbox']`)}function sO(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||aO(t,e)&&(KD(t.target)||(r||!oO())&&(t.preventDefault(),i.current()))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e,n,r])}var cO={neutral:`text-foreground`,primary:``,danger:`text-destructive hover:text-destructive`};function Y({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=iO(r);sO(f?r:void 0,()=>d.current?.click(),{enabled:f&&!l});let p=(0,I.jsx)(t,{"aria-hidden":`true`}),h=n===`primary`?`default`:s?`ghost`:`outline`,g=q(!s&&`px-2.5`,cO[n],c),_=s?`icon`:`default`,v=s?p:(0,I.jsxs)(I.Fragment,{children:[p,(0,I.jsx)(`span`,{children:o??e}),r?(0,I.jsx)(iD,{chord:r,className:`kbd-hint ml-1`}):null]}),y=i?(0,I.jsx)(J,{asChild:!0,ref:d,variant:h,size:_,"data-tone":n,className:g,children:(0,I.jsx)(`a`,{href:i,target:`_blank`,rel:`noreferrer noopener`,"aria-label":e,"aria-keyshortcuts":f?r:void 0,children:v})}):(0,I.jsx)(J,{ref:d,type:`button`,variant:h,size:_,"data-tone":n,"aria-label":e,"aria-pressed":a,"aria-keyshortcuts":f?r:void 0,disabled:l,className:g,...u,children:v});return s?(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:y}),(0,I.jsxs)(UD,{children:[e,(0,I.jsx)(iD,{chord:r??(i?`Enter`:`Enter / Space`)})]})]}):y}function lO({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,I.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-card/90 px-4 py-2 backdrop-blur-sm [&>[data-tone=danger]:not(:first-child)]:ml-auto`,t),children:e})}function uO({...e}){return(0,I.jsx)(Tx,{"data-slot":`sheet`,...e})}function dO({...e}){return(0,I.jsx)(Kx,{"data-slot":`sheet-close`,...e})}function fO({...e}){return(0,I.jsx)(jx,{"data-slot":`sheet-portal`,...e})}function pO({className:e,...t}){return(0,I.jsx)(Nx,{"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 mO({className:e,children:t,side:n=`right`,showCloseButton:r=!0,forceMount:i,hidden:a,...o}){return(0,I.jsxs)(fO,{forceMount:i,children:[a?null:(0,I.jsx)(pO,{}),(0,I.jsxs)(Lx,{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,I.jsx)(Kx,{"data-slot":`sheet-close`,asChild:!0,children:(0,I.jsxs)(J,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,I.jsx)(gg,{}),(0,I.jsx)(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function hO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`sheet-header`,className:q(`flex flex-col gap-0.5 p-4`,e),...t})}function gO({className:e,...t}){return(0,I.jsx)(Hx,{"data-slot":`sheet-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function _O({className:e,...t}){return(0,I.jsx)(Wx,{"data-slot":`sheet-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function vO(){return RD(`(min-width: 1024px)`)}function yO({className:e,...t}){return(0,I.jsx)(`section`,{className:q(`min-h-0 min-w-0`,e),...t})}function bO({open:e,onClose:t,describe:n,children:r}){let i=mD(e,pD.sheet),a=(0,m.useRef)(!1);return i&&(a.current=!0),e||(a.current=!1),(0,I.jsx)(uO,{open:e&&i,onOpenChange:e=>!e&&t(),children:(0,I.jsxs)(mO,{forceMount:e&&a.current?!0:void 0,hidden:!i,showCloseButton:!1,className:q(`gap-0 data-[side=right]:w-[92%] data-[side=right]:sm:max-w-3xl`,!i&&`!hidden`),children:[(0,I.jsxs)(hO,{className:`flex-row items-center justify-between border-b px-4 py-2`,children:[(0,I.jsx)(gO,{className:`text-sm`,children:`Detail`}),(0,I.jsx)(_O,{className:`sr-only`,children:n}),(0,I.jsx)(dO,{asChild:!0,children:(0,I.jsxs)(J,{variant:`ghost`,size:`sm`,"aria-label":`Close detail`,title:`Close · Esc`,className:`gap-2`,children:[(0,I.jsx)(gg,{"aria-hidden":`true`}),`Close`,(0,I.jsx)(iD,{chord:`Esc`,className:`kbd-hint`})]})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-5`,children:r})]})})}function xO({wide:e,list:t,detail:n,open:r,onClose:i,hint:a,describe:o}){let s=(0,m.useRef)(null),c=(0,m.useRef)(null);function l(t){let n=s.current;if(!n||t.defaultPrevented||t.nativeEvent.isComposing||hD()||t.altKey||t.ctrlKey||t.metaKey||KD(t.target)||t.target instanceof HTMLInputElement)return;let r=qD(t.key,!1);r?(t.preventDefault(),ZD(n,t.target,r)):t.key===`Home`||t.key===`End`?(t.preventDefault(),ZD(n,t.target,t.key===`Home`?`first`:`last`)):e&&JD(t.key)===1&&c.current&&(t.preventDefault(),c.current.focus())}function u(e){e.defaultPrevented||e.nativeEvent.isComposing||hD()||e.altKey||e.ctrlKey||e.metaKey||KD(e.target)||JD(e.key)===-1&&s.current&&(e.preventDefault(),$D(s.current)?.focus())}return e?(0,I.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[clamp(17rem,28%,23rem)_minmax(0,1fr)]`,children:[(0,I.jsx)(yO,{"data-pane":`list`,ref:s,onKeyDown:l,className:`overflow-y-auto border-r border-border pb-dock`,children:t}),(0,I.jsx)(yO,{"data-pane":`detail`,ref:c,tabIndex:0,"aria-label":`Detail`,onKeyDown:u,className:`overflow-y-auto px-5 pt-5 pb-dock outline-none focus-visible:bg-muted/30`,children:n??(0,I.jsx)(`div`,{className:`grid h-full min-h-48 place-items-center`,children:(0,I.jsxs)(`div`,{className:`flex max-w-xs flex-col items-center gap-3 text-center`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground`,children:(0,I.jsx)(oh,{className:`size-5`})}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:a}),(0,I.jsxs)(`p`,{className:`kbd-hint flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(iD,{chord:`ArrowUp`}),(0,I.jsx)(iD,{chord:`ArrowDown`}),`move`]}),(0,I.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[(0,I.jsx)(iD,{chord:`ArrowRight`}),`open`]})]})]})})})]}):(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto pb-dock`,children:[(0,I.jsx)(yO,{"data-pane":`list`,ref:s,onKeyDown:l,children:t}),(0,I.jsx)(bO,{open:r&&n!==null,onClose:i,describe:o,children:n})]})}function SO({title:e,count:t,children:n}){return(0,I.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-card/90 px-4 py-2 backdrop-blur-sm`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-medium`,children:e}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-2 flex-1`}),t?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null,n?(0,I.jsx)(`div`,{className:`flex items-center gap-1.5`,children:n}):null]})}function CO(){return(0,I.jsx)(`div`,{className:`flex flex-col gap-1.5 p-3`,role:`status`,"aria-label":`Loading`,children:[0,1,2,3].map(e=>(0,I.jsx)(`div`,{className:`h-11 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function wO({className:e,...t}){return(0,I.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 TO(e){return e<10?`0${e}`:String(e)}function EO(e){if(!Number.isFinite(e))return`0`;let t=new Date(e);return`${TO(t.getHours())}:${TO(t.getMinutes())}`}function DO(e){if(!Number.isFinite(e)||e<0)return`0s`;let t=Math.floor(e/1e3);if(t<60)return`${t}s`;let n=Math.floor(t/60);return n<60?`${n}m`:`${Math.floor(n/60)}h ${TO(n%60)}m`}function OO(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 kO(e){let t=OO(e);return t===`now`?`just now`:`${t} ago`}function AO({...e}){return(0,I.jsx)(uS,{"data-slot":`alert-dialog`,...e})}function jO({...e}){return(0,I.jsx)(dS,{"data-slot":`alert-dialog-portal`,...e})}function MO({className:e,...t}){return(0,I.jsx)(fS,{"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 NO({className:e,...t}){return(0,I.jsxs)(jO,{children:[(0,I.jsx)(MO,{}),(0,I.jsx)(pS,{"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 PO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:q(`flex flex-col gap-1.5`,e),...t})}function FO({className:e,...t}){return(0,I.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:q(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...t})}function IO({className:e,...t}){return(0,I.jsx)(gS,{"data-slot":`alert-dialog-title`,className:q(`text-base font-medium text-foreground`,e),...t})}function LO({className:e,...t}){return(0,I.jsx)(_S,{"data-slot":`alert-dialog-description`,className:q(`text-sm text-muted-foreground`,e),...t})}function RO({className:e,variant:t=`default`,...n}){return(0,I.jsx)(J,{variant:t,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,I.jsx)(mS,{"data-slot":`alert-dialog-action`,...n})})}function zO({className:e,...t}){return(0,I.jsx)(J,{variant:`outline`,size:`sm`,className:q(`h-7 gap-1 px-2.5`,e),asChild:!0,children:(0,I.jsx)(hS,{"data-slot":`alert-dialog-cancel`,...t})})}function BO({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=mD(f,pD.confirm),g=l===`destructive`;return sO(`y`,()=>{p(!1),o()},{enabled:f&&h,inDialog:!0}),(0,I.jsxs)(AO,{open:f&&h,onOpenChange:p,children:[(0,I.jsx)(Y,{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,I.jsxs)(NO,{children:[(0,I.jsxs)(PO,{children:[(0,I.jsx)(IO,{children:r}),(0,I.jsx)(LO,{children:i})]}),(0,I.jsxs)(FO,{children:[(0,I.jsxs)(zO,{children:[`Keep it`,(0,I.jsx)(iD,{chord:`Esc`,className:`kbd-hint ml-1`})]}),(0,I.jsxs)(RO,{variant:g?`destructive`:`default`,onClick:o,children:[a,(0,I.jsx)(iD,{chord:`Y`,className:`kbd-hint ml-1`})]})]})]})]})}function VO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var HO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,UO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WO={};function GO(e,t){return((t||WO).jsx?UO:HO).test(e)}var KO=/[ \t\n\f\r]/g;function qO(e){return typeof e==`object`?e.type===`text`&&JO(e.value):JO(e)}function JO(e){return e.replace(KO,``)===``}var YO=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};YO.prototype.normal={},YO.prototype.property={},YO.prototype.space=void 0;function XO(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new YO(n,r,t)}function ZO(e){return e.toLowerCase()}var QO=class{constructor(e,t){this.attribute=t,this.property=e}};QO.prototype.attribute=``,QO.prototype.booleanish=!1,QO.prototype.boolean=!1,QO.prototype.commaOrSpaceSeparated=!1,QO.prototype.commaSeparated=!1,QO.prototype.defined=!1,QO.prototype.mustUseProperty=!1,QO.prototype.number=!1,QO.prototype.overloadedBoolean=!1,QO.prototype.property=``,QO.prototype.spaceSeparated=!1,QO.prototype.space=void 0;var $O=s({boolean:()=>X,booleanish:()=>tk,commaOrSpaceSeparated:()=>ak,commaSeparated:()=>ik,number:()=>Z,overloadedBoolean:()=>nk,spaceSeparated:()=>rk}),ek=0,X=ok(),tk=ok(),nk=ok(),Z=ok(),rk=ok(),ik=ok(),ak=ok();function ok(){return 2**++ek}var sk=Object.keys($O),ck=class extends QO{constructor(e,t,n,r){let i=-1;if(super(e,t),lk(this,`space`,r),typeof n==`number`)for(;++i<sk.length;){let e=sk[i];lk(this,sk[i],(n&$O[e])===$O[e])}}};ck.prototype.defined=!0;function lk(e,t,n){n&&(e[t]=n)}function uk(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new ck(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ZO(r)]=r,n[ZO(a.attribute)]=r}return new YO(t,n,e.space)}var dk=uk({properties:{ariaActiveDescendant:null,ariaAtomic:tk,ariaAutoComplete:null,ariaBusy:tk,ariaChecked:tk,ariaColCount:Z,ariaColIndex:Z,ariaColSpan:Z,ariaControls:rk,ariaCurrent:null,ariaDescribedBy:rk,ariaDetails:null,ariaDisabled:tk,ariaDropEffect:rk,ariaErrorMessage:null,ariaExpanded:tk,ariaFlowTo:rk,ariaGrabbed:tk,ariaHasPopup:null,ariaHidden:tk,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:rk,ariaLevel:Z,ariaLive:null,ariaModal:tk,ariaMultiLine:tk,ariaMultiSelectable:tk,ariaOrientation:null,ariaOwns:rk,ariaPlaceholder:null,ariaPosInSet:Z,ariaPressed:tk,ariaReadOnly:tk,ariaRelevant:null,ariaRequired:tk,ariaRoleDescription:rk,ariaRowCount:Z,ariaRowIndex:Z,ariaRowSpan:Z,ariaSelected:tk,ariaSetSize:Z,ariaSort:null,ariaValueMax:Z,ariaValueMin:Z,ariaValueNow:Z,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function fk(e,t){return t in e?e[t]:t}function pk(e,t){return fk(e,t.toLowerCase())}var mk=uk({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ik,acceptCharset:rk,accessKey:rk,action:null,allow:null,allowFullScreen:X,allowPaymentRequest:X,allowUserMedia:X,alpha:X,alt:null,as:null,async:X,autoCapitalize:null,autoComplete:rk,autoFocus:X,autoPlay:X,blocking:rk,capture:null,charSet:null,checked:X,cite:null,className:rk,closedBy:null,colorSpace:null,cols:Z,colSpan:Z,command:null,commandFor:null,content:null,contentEditable:tk,controls:X,controlsList:rk,coords:Z|ik,crossOrigin:null,data:null,dateTime:null,decoding:null,default:X,defer:X,dir:null,dirName:null,disabled:X,download:nk,draggable:tk,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:X,formTarget:null,headers:rk,height:Z,hidden:nk,high:Z,href:null,hrefLang:null,htmlFor:rk,httpEquiv:rk,id:null,imageSizes:null,imageSrcSet:null,inert:X,inputMode:null,integrity:null,is:null,isMap:X,itemId:null,itemProp:rk,itemRef:rk,itemScope:X,itemType:rk,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:X,low:Z,manifest:null,max:null,maxLength:Z,media:null,method:null,min:null,minLength:Z,multiple:X,muted:X,name:null,nonce:null,noModule:X,noValidate:X,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:X,optimum:Z,pattern:null,ping:rk,placeholder:null,playsInline:X,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:X,referrerPolicy:null,rel:rk,required:X,reversed:X,rows:Z,rowSpan:Z,sandbox:rk,scope:null,scoped:X,seamless:X,selected:X,shadowRootClonable:X,shadowRootCustomElementRegistry:X,shadowRootDelegatesFocus:X,shadowRootMode:null,shadowRootSerializable:X,shape:null,size:Z,sizes:null,slot:null,span:Z,spellCheck:tk,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Z,step:null,style:null,tabIndex:Z,target:null,title:null,translate:null,type:null,typeMustMatch:X,useMap:null,value:tk,width:Z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:rk,axis:null,background:null,bgColor:null,border:Z,borderColor:null,bottomMargin:Z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:X,declare:X,event:null,face:null,frame:null,frameBorder:null,hSpace:Z,leftMargin:Z,link:null,longDesc:null,lowSrc:null,marginHeight:Z,marginWidth:Z,noResize:X,noHref:X,noShade:X,noWrap:X,object:null,profile:null,prompt:null,rev:null,rightMargin:Z,rules:null,scheme:null,scrolling:tk,standby:null,summary:null,text:null,topMargin:Z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Z,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:X,disablePictureInPicture:X,disableRemotePlayback:X,exportParts:ik,part:rk,prefix:null,property:null,results:Z,security:null,unselectable:null},space:`html`,transform:pk}),hk=uk({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:ak,accentHeight:Z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Z,amplitude:Z,arabicForm:null,ascent:Z,attributeName:null,attributeType:null,azimuth:Z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Z,by:null,calcMode:null,capHeight:Z,className:rk,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:Z,diffuseConstant:Z,direction:null,display:null,dur:null,divisor:Z,dominantBaseline:null,download:X,dx:null,dy:null,edgeMode:null,editable:null,elevation:Z,enableBackground:null,end:null,event:null,exponent:Z,externalResourcesRequired:null,fill:null,fillOpacity:Z,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:ik,g2:ik,glyphName:ik,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Z,horizOriginX:Z,horizOriginY:Z,id:null,ideographic:Z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Z,k:Z,k1:Z,k2:Z,k3:Z,k4:Z,kernelMatrix:ak,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Z,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:Z,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:Z,overlineThickness:Z,paintOrder:null,panose1:null,path:null,pathLength:Z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:rk,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Z,pointsAtY:Z,pointsAtZ:Z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ak,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ak,rev:ak,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ak,requiredFeatures:ak,requiredFonts:ak,requiredFormats:ak,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:Z,specularExponent:Z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Z,strikethroughThickness:Z,string:null,stroke:null,strokeDashArray:ak,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Z,strokeOpacity:Z,strokeWidth:null,style:null,surfaceScale:Z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ak,tabIndex:Z,tableValues:null,target:null,targetX:Z,targetY:Z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ak,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Z,underlineThickness:Z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Z,values:null,vAlphabetic:Z,vMathematical:Z,vectorEffect:null,vHanging:Z,vIdeographic:Z,version:null,vertAdvY:Z,vertOriginX:Z,vertOriginY:Z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:fk}),gk=uk({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()}}),_k=uk({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:pk}),vk=uk({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),yk={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`},bk=/[A-Z]/g,xk=/-[a-z]/g,Sk=/^data[-\w.:]+$/i;function Ck(e,t){let n=ZO(t),r=t,i=QO;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Sk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(xk,Tk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!xk.test(e)){let n=e.replace(bk,wk);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=ck}return new i(r,t)}function wk(e){return`-`+e.toLowerCase()}function Tk(e){return e.charAt(1).toUpperCase()}var Ek=XO([dk,mk,gk,_k,vk],`html`),Dk=XO([dk,hk,gk,_k,vk],`svg`);function Ok(e){return e.join(` `).trim()}var kk=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
|
+
`);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})),Ak=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(kk());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}})),jk=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))}})),Mk=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ak()),r=jk();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})),Nk=Fk(`end`),Pk=Fk(`start`);function Fk(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 Ik(e){let t=Pk(e),n=Nk(e);if(t&&n)return{start:t,end:n}}function Lk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?zk(e.position):`start`in e||`end`in e?zk(e):`line`in e||`column`in e?Rk(e):``}function Rk(e){return Bk(e&&e.line)+`:`+Bk(e&&e.column)}function zk(e){return Rk(e&&e.start)+`-`+Rk(e&&e.end)}function Bk(e){return e&&typeof e==`number`?e:1}var Vk=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=Lk(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}};Vk.prototype.file=``,Vk.prototype.name=``,Vk.prototype.reason=``,Vk.prototype.message=``,Vk.prototype.stack=``,Vk.prototype.column=void 0,Vk.prototype.line=void 0,Vk.prototype.ancestors=void 0,Vk.prototype.cause=void 0,Vk.prototype.fatal=void 0,Vk.prototype.place=void 0,Vk.prototype.ruleId=void 0,Vk.prototype.source=void 0;var Hk=l(Mk(),1),Uk={}.hasOwnProperty,Wk=new Map,Gk=/[A-Z]/g,Kk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),qk=new Set([`td`,`th`]),Jk=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Yk(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=oA(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=aA(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`?Dk:Ek,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Xk(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Xk(e,t,n){if(t.type===`element`)return Zk(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Qk(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return eA(e,t,n);if(t.type===`mdxjsEsm`)return $k(e,t);if(t.type===`root`)return tA(e,t,n);if(t.type===`text`)return nA(e,t)}function Zk(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Dk,e.schema=i),e.ancestors.push(t);let a=fA(e,t.tagName,!1),o=sA(e,t),s=lA(e,t);return Kk.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!qO(e)})),rA(e,o,a,t),iA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Qk(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)}pA(e,t.position)}function $k(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pA(e,t.position)}function eA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Dk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:fA(e,t.name,!0),o=cA(e,t),s=lA(e,t);return rA(e,o,a,t),iA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function tA(e,t,n){let r={};return iA(r,lA(e,t)),e.create(t,e.Fragment,r,n)}function nA(e,t){return t.value}function rA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function iA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function aA(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 oA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Pk(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 sA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Uk.call(t.properties,i)){let a=uA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&qk.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 cA(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 pA(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 pA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function lA(e,t){let n=[],r=-1,i=e.passKeys?new Map:Wk;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=Xk(e,a,o);s!==void 0&&n.push(s)}return n}function uA(e,t,n){let r=Ck(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?VO(n):Ok(n)),r.property===`style`){let t=typeof n==`object`?n:dA(e,String(n));return e.stylePropertyNameCase===`css`&&(t=mA(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?yk[r.property]||r.property:r.attribute,n]}}function dA(e,t){try{return(0,Hk.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Vk("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=Jk+`#cannot-parse-style-attribute`,r}}function fA(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=GO(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=GO(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Uk.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);pA(e)}function pA(e,t){let n=new Vk("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=Jk+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function mA(e){let t={},n;for(n in e)Uk.call(e,n)&&(t[hA(n)]=e[n]);return t}function hA(e){let t=e.replace(Gk,gA);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function gA(e){return`-`+e.toLowerCase()}var _A={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`]},vA={};function yA(e,t){let n=t||vA;return bA(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function bA(e,t,n){if(SA(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 xA(e.children,t,n)}return Array.isArray(e)?xA(e,t,n):``}function xA(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=bA(e[i],t,n);return r.join(``)}function SA(e){return!!(e&&typeof e==`object`)}var CA=document.createElement(`i`);function wA(e){let t=`&`+e+`;`;CA.innerHTML=t;let n=CA.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function TA(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 EA(e,t){return e.length>0?(TA(e,e.length,0,t),e):t}var DA={}.hasOwnProperty;function OA(e){let t={},n=-1;for(;++n<e.length;)kA(t,e[n]);return t}function kA(e,t){let n;for(n in t){let r=(DA.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){DA.call(r,a)||(r[a]=[]);let e=i[a];AA(r[a],Array.isArray(e)?e:e?[e]:[])}}}function AA(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);TA(e,0,0,r)}function jA(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 MA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var NA=UA(/[A-Za-z]/),PA=UA(/[\dA-Za-z]/),FA=UA(/[#-'*+\--9=?A-Z^-~]/);function IA(e){return e!==null&&(e<32||e===127)}var LA=UA(/\d/),RA=UA(/[\dA-Fa-f]/),zA=UA(/[!-/:-@[-`{-~]/);function Q(e){return e!==null&&e<-2}function BA(e){return e!==null&&(e<0||e===32)}function $(e){return e===-2||e===-1||e===32}var VA=UA(/\p{P}|\p{S}/u),HA=UA(/\s/);function UA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function WA(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&PA(e.charCodeAt(n+1))&&PA(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 GA(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function KA(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&$(t)?(e.enter(r),c(t)):l(t)}function c(t){return $(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var qA={tokenize:JA};function JA(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`),GA(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 Q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var YA=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){XA(this,e,t,n,!1)}addBefore(e,t,n){XA(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 XA(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 ZA={tokenize:$A},QA={tokenize:ej};function $A(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 YA;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(QA,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(QA,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 Q(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 YA;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 ej(e,t,n){return GA(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function tj(e){if(e===null||BA(e)||HA(e))return 1;if(VA(e))return 2}function nj(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 rj={name:`attention`,resolveAll:ij,tokenize:aj};function ij(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};oj(o,-a),oj(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=EA(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=EA(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=EA(r,nj(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=EA(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=EA(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),TA(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 aj(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=tj(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=tj(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 oj(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var sj={name:`autolink`,tokenize:cj};function cj(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 NA(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||PA(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||PA(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||IA(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):FA(t)?(e.consume(t),l):n(t)}function u(e){return PA(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||PA(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var lj={partial:!0,tokenize:uj};function uj(e,t,n){return r;function r(t){return $(t)?GA(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}var dj={continuation:{tokenize:pj},exit:mj,name:`blockQuote`,tokenize:fj};function fj(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 $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function pj(e,t,n){let r=this;return i;function i(t){return $(t)?GA(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(dj,t,n)(r)}}function mj(e){e.exit(`blockQuote`)}var hj={name:`characterEscape`,tokenize:gj};function gj(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 zA(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var _j={name:`characterReference`,tokenize:vj};function vj(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=PA,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=RA,u):(e.enter(`characterReferenceValue`),a=7,o=LA,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===PA&&!wA(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 yj={partial:!0,tokenize:bj};function bj(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 xj={concrete:!0,name:`codeFenced`,tokenize:Sj};function Sj(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`),$(t)?GA(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(yj,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),GA(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(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&&$(t)?GA(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(yj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(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`),$(t)?GA(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`),$(t)?GA(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Cj={name:`codeIndented`,tokenize:Tj},wj={partial:!0,tokenize:Ej};function Tj(e,t,n){return r;function r(t){return e.enter(`codeIndented`),KA(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Q(t)?e.attempt(wj,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Ej(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):KA(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Q(e)?i(e):n(e)}}var Dj={name:`codeText`,previous:kj,resolve:Oj,tokenize:Aj};function Oj(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 kj(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Aj(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)):Q(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||Q(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 jj=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&&Mj(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),Mj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Mj(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);Mj(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Mj(this.left,t.reverse())}}}};function Mj(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 Nj(e){let t={},n=-1,r,i,a,o,s,c,l,u=new jj(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,Pj(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 TA(e,0,1/0,u.slice(0)),!l}function Pj(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 Fj={resolve:Lj,tokenize:Rj},Ij={partial:!0,tokenize:zj};function Lj(e){return Nj(e),e}function Rj(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):Q(t)?e.check(Ij,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 zj(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GA(e,a,`linePrefix`)}function a(i){if(i===null||Q(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 Bj(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||IA(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||Q(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||BA(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||IA(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 Vj(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):Q(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||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Hj(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):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),GA(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(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 Uj(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?GA(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Wj={name:`definition`,tokenize:Kj},Gj={partial:!0,tokenize:qj};function Kj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Vj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=MA(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 BA(t)?Uj(e,l)(t):l(t)}function l(t){return Bj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Gj,d,d)(t)}function d(t){return $(t)?GA(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function qj(e,t,n){return r;function r(t){return BA(t)?Uj(e,i)(t):n(t)}function i(t){return Hj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?GA(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}var Jj={name:`hardBreakEscape`,tokenize:Yj};function Yj(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Xj={name:`headingAtx`,resolve:Zj,tokenize:Qj};function Zj(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`};TA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Qj(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||BA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?GA(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||BA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var $j=`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(`.`),eM=[`pre`,`script`,`style`,`textarea`],tM={concrete:!0,name:`htmlFlow`,resolveTo:rM,tokenize:iM},nM={partial:!0,tokenize:aM};function rM(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 iM(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:k):NA(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):NA(a)?(e.consume(a),i=4,r.interrupt?t:k):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:k):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return NA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||BA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&eM.includes(l)?(i=1,r.interrupt?t(s):D(s)):$j.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||PA(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||NA(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||PA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(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):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(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||BA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Q(t)?D(t):$(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),k):t===93&&i===5?(e.consume(t),oe):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(nM,ce,te)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(yj,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||Q(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function ie(t){return t===45?(e.consume(t),k):D(t)}function O(t){return t===47?(e.consume(t),o=``,ae):D(t)}function ae(t){if(t===62){let n=o.toLowerCase();return eM.includes(n)?(e.consume(t),se):D(t)}return NA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):D(t)}function oe(t){return t===93?(e.consume(t),k):D(t)}function k(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),k):D(t)}function se(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function aM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(lj,t,n)}}var oM={name:`htmlText`,tokenize:sM};function sM(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):NA(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):NA(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):Q(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(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):Q(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):Q(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return NA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||PA(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,O(t)):$(t)?(e.consume(t),C):ie(t)}function w(t){return t===45||PA(t)?(e.consume(t),w):t===47||t===62||BA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ie):t===58||t===95||NA(t)?(e.consume(t),E):Q(t)?(o=T,O(t)):$(t)?(e.consume(t),T):ie(t)}function E(t){return t===45||t===46||t===58||t===95||PA(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):Q(t)?(o=ee,O(t)):$(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):Q(t)?(o=D,O(t)):$(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):Q(t)?(o=te,O(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||BA(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||BA(e)?T(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return $(t)?GA(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var cM={name:`labelEnd`,resolveAll:fM,resolveTo:pM,tokenize:mM},lM={tokenize:hM},uM={tokenize:gM},dM={tokenize:_M};function fM(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&&TA(e,0,e.length,n),e}function pM(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=EA(o,e.slice(i+1,i+r+3)),o=EA(o,[[`enter`,l,t]]),o=EA(o,nj(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=EA(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=EA(o,e.slice(a+1)),o=EA(o,[[`exit`,s,t]]),TA(e,i,e.length,o),e}function mM(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(MA(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(lM,u,o?u:d)(t):t===91?e.attempt(uM,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(dM,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function hM(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 BA(t)?Uj(e,a)(t):a(t)}function a(t){return t===41?u(t):Bj(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return BA(t)?Uj(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Hj(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return BA(t)?Uj(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 gM(e,t,n){let r=this;return i;function i(t){return Vj.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(MA(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function _M(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 vM={name:`labelStartImage`,resolveAll:cM.resolveAll,tokenize:yM};function yM(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 bM={name:`labelStartLink`,resolveAll:cM.resolveAll,tokenize:xM};function xM(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 SM={name:`lineEnding`,tokenize:CM};function CM(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),GA(e,t,`linePrefix`)}}var wM={name:`thematicBreak`,tokenize:TM};function TM(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||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?GA(e,s,`whitespace`)(t):s(t))}}var EM={continuation:{tokenize:AM},exit:MM,name:`list`,tokenize:kM},DM={partial:!0,tokenize:NM},OM={partial:!0,tokenize:jM};function kM(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:LA(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(wM,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 LA(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(lj,r.interrupt?n:u,e.attempt(DM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(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 AM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(lj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,GA(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(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(OM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,GA(e,e.attempt(EM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function jM(e,t,n){let r=this;return GA(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 MM(e){e.exit(this.containerState.type)}function NM(e,t,n){let r=this;return GA(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!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var PM={name:`setextUnderline`,resolveTo:FM,tokenize:IM};function FM(e,t){let n=new YA,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 IM(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`),$(t)?GA(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var LM={tokenize:RM};function RM(e){let t=this,n=e.attempt(lj,r,e.attempt(this.parser.constructs.flowInitial,i,GA(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Fj,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 zM={resolveAll:UM()},BM=HM(`string`),VM=HM(`text`);function HM(e){return{resolveAll:UM(e===`text`?WM: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 UM(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 WM(e,t){let n=new YA,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 GM=s({attentionMarkers:()=>$M,contentInitial:()=>qM,disable:()=>eN,document:()=>KM,flow:()=>YM,flowInitial:()=>JM,insideSpan:()=>QM,string:()=>XM,text:()=>ZM}),KM={42:EM,43:EM,45:EM,48:EM,49:EM,50:EM,51:EM,52:EM,53:EM,54:EM,55:EM,56:EM,57:EM,62:dj},qM={91:Wj},JM={[-2]:Cj,[-1]:Cj,32:Cj},YM={35:Xj,42:wM,45:[PM,wM],60:tM,61:PM,95:wM,96:xj,126:xj},XM={38:_j,92:hj},ZM={[-5]:SM,[-4]:SM,[-3]:SM,33:vM,38:_j,42:rj,60:[sj,oM],91:bM,92:[Jj,hj],93:cM,95:rj,96:Dj},QM={null:[rj,zM]},$M={null:[42,95]},eN={null:[]};function tN(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=EA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=nj(a,l.events,l),l.events):[]}function f(e,t){return rN(p(e),t)}function p(e){return nN(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){Q(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&&TA(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 nN(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 rN(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
|
-
`;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 KM(e){let t={constructs:gA([NM,...(e||{}).extensions||[]]),content:n(FA),defined:[],document:n(zA),flow:n(TM),lazy:{},string:n(OM),text:n(kM)};return t;function n(e){return n;function n(n){return UM(t,e,n)}}}function qM(e){for(;!xj(e););return e}var JM=/[\0\t\n\r]/g;function YM(){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;){JM.lastIndex=c;let n=JM.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 XM=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ZM(e){return e.replace(XM,QM)}function QM(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return yA(n.slice(t?2:1),t?16:10)}return fA(n)||e}var $M={}.hasOwnProperty;function eN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),tN(n)(qM(KM(n).document().write(YM()(e,t,!0))))}function tN(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(ge),characterEscape:T,characterReference:T,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(ve,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(A),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(j),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:le,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:he,autolinkProtocol:me,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:pe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:oe,labelText:ae,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:k,resourceTitleString:se,resource:ce,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};rN(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]];$M.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]||aN).call(a,void 0,e[0])}for(r.position={start:nN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:nN(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:nN(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]||aN).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Tk({start:e.start,end:e.end})+`): it’s not open`);n.position.end=nN(e.end)}function u(){return sA(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=bA(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=Oe(),n.position={start:nN(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=nN(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=nN(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 D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){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 O(){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 ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ZM(t),n.identifier=bA(t).toLowerCase()}function oe(){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 k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ce(){this.data.inReference=void 0}function le(){this.data.referenceType=`collapsed`}function ue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=bA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function de(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=yA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=fA(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=nN(e.end)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ge(){return{type:`blockquote`,children:[]}}function _e(){return{type:`code`,lang:null,meta:null,value:``}}function ve(){return{type:`inlineCode`,value:``}}function A(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function j(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function nN(e){return{line:e.line,column:e.column,offset:e.offset}}function rN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?rN(e,r):iN(e,r)}}function iN(e,t){let n;for(n in t)if($M.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 aN(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Tk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Tk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Tk({start:t.start,end:t.end})+`) is still open`)}function oN(e){let t=this;t.parser=n;function n(n){return eN(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function sN(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 cN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
62
|
-
`}]}function
|
|
63
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function
|
|
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 iN(e){let t={constructs:OA([GM,...(e||{}).extensions||[]]),content:n(qA),defined:[],document:n(ZA),flow:n(LM),lazy:{},string:n(BM),text:n(VM)};return t;function n(e){return n;function n(n){return tN(t,e,n)}}}function aN(e){for(;!Nj(e););return e}var oN=/[\0\t\n\r]/g;function sN(){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;){oN.lastIndex=c;let n=oN.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 cN=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lN(e){return e.replace(cN,uN)}function uN(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jA(n.slice(t?2:1),t?16:10)}return wA(n)||e}var dN={}.hasOwnProperty;function fN(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),pN(n)(aN(iN(n).document().write(sN()(e,t,!0))))}function pN(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Ce),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(ye),blockQuote:a(ge),characterEscape:T,characterReference:T,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(ve,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(A),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(j),hardBreakEscape:a(be),hardBreakTrailing:a(be),htmlFlow:a(xe,o),htmlFlowData:T,htmlText:a(xe,o),htmlTextData:T,image:a(Se),label:o,link:a(Ce),listItem:a(Te),listItemValue:f,listOrdered:a(we,d),listUnordered:a(we),paragraph:a(Ee),reference:le,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(ye),strong:a(De),thematicBreak:a(ke)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:he,autolinkProtocol:me,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:pe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(O),label:oe,labelText:ae,lineEnding:ee,link:c(ie),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:k,resourceTitleString:se,resource:ce,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};hN(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]];dN.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]||_N).call(a,void 0,e[0])}for(r.position={start:mN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:mN(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:mN(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]||_N).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Lk({start:e.start,end:e.end})+`): it’s not open`);n.position.end=mN(e.end)}function u(){return yA(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=MA(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=Oe(),n.position={start:mN(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=mN(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=mN(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 D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){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 O(){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 ae(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=lN(t),n.identifier=MA(t).toLowerCase()}function oe(){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 k(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ce(){this.data.inReference=void 0}function le(){this.data.referenceType=`collapsed`}function ue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=MA(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function de(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jA(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=wA(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=mN(e.end)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ge(){return{type:`blockquote`,children:[]}}function _e(){return{type:`code`,lang:null,meta:null,value:``}}function ve(){return{type:`inlineCode`,value:``}}function A(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function j(){return{type:`emphasis`,children:[]}}function ye(){return{type:`heading`,depth:0,children:[]}}function be(){return{type:`break`}}function xe(){return{type:`html`,value:``}}function Se(){return{type:`image`,title:null,url:``,alt:null}}function Ce(){return{type:`link`,title:null,url:``,children:[]}}function we(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function Te(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Ee(){return{type:`paragraph`,children:[]}}function De(){return{type:`strong`,children:[]}}function Oe(){return{type:`text`,value:``}}function ke(){return{type:`thematicBreak`}}}function mN(e){return{line:e.line,column:e.column,offset:e.offset}}function hN(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?hN(e,r):gN(e,r)}}function gN(e,t){let n;for(n in t)if(dN.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 _N(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Lk({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Lk({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Lk({start:t.start,end:t.end})+`) is still open`)}function vN(e){let t=this;t.parser=n;function n(n){return fN(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function yN(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 bN(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
62
|
+
`}]}function xN(e,t){let n=t.value?t.value+`
|
|
63
|
+
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function SN(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function CN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function wN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=WA(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function TN(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function EN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function DN(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function ON(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DN(e,t);let i={src:WA(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function kN(e,t){let n={src:WA(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function AN(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function jN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return DN(e,t);let i={href:WA(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function MN(e,t){let n={href:WA(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function NN(e,t,n){let r=e.all(t),i=n?PN(n):FN(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
64
64
|
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
65
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
65
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function PN(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=FN(n[r])}return t}function FN(e){return e.spread??e.children.length>1}function IN(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function LN(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RN(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function zN(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function BN(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Pk(t.children[1]),o=Nk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function VN(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function HN(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var UN=9,WN=32;function GN(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(KN(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(KN(t.slice(i),i>0,!1)),a.join(``)}function KN(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===UN||t===WN;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===UN||t===WN;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function qN(e,t){let n={type:`text`,value:GN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function JN(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var YN={blockquote:yN,break:bN,code:xN,delete:SN,emphasis:CN,footnoteReference:wN,heading:TN,html:EN,imageReference:ON,image:kN,inlineCode:AN,linkReference:jN,link:MN,listItem:NN,list:IN,paragraph:LN,root:RN,strong:zN,table:BN,tableCell:HN,tableRow:VN,text:qN,thematicBreak:JN,toml:XN,yaml:XN,definition:XN,footnoteDefinition:XN};function XN(){}var{defineProperty:ZN}=Object,QN=typeof self==`object`?self:globalThis,$N=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new QN[e](t)},eP=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?ZN(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof QN[e]==`function`?$N(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n($N(a,o),i)};return r},tP=e=>eP(new Map,e)(0),nP=``,{toString:rP}={},{keys:iP,is:aP}=Object,oP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=rP.call(e).slice(8,-1);switch(n){case`Array`:return[1,nP];case`Object`:return[2,nP];case`Date`:return[3,nP];case`RegExp`:return[4,nP];case`Map`:return[5,nP];case`Set`:return[6,nP];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},sP=([e,t])=>e===0&&(t===`function`||t===`symbol`),cP=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=oP(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&aP(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of iP(o))(e||!sP(oP(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?nP:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(sP(oP(n))||sP(oP(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!sP(oP(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},lP=(e,{json:t,lossy:n}={})=>{let r=[];return cP(!(t||n),!!t,new Map,r)(e),r},uP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?tP(lP(e,t)):structuredClone(e):(e,t)=>tP(lP(e,t));function dP(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function fP(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function pP(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||dP,r=e.options.footnoteBackLabel||fP,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=WA(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...uP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
66
66
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
67
|
-
`}]}}var
|
|
67
|
+
`}]}}var mP=(function(e){if(e==null)return yP;if(typeof e==`function`)return vP(e);if(typeof e==`object`)return Array.isArray(e)?hP(e):gP(e);if(typeof e==`string`)return _P(e);throw Error(`Expected function, string, or object as test`)});function hP(e){let t=[],n=-1;for(;++n<e.length;)t[n]=mP(e[n]);return vP(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function gP(e){let t=e;return vP(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function _P(e){return vP(t);function t(t){return t&&t.type===e}}function vP(e){return t;function t(t,n,r){return!!(bP(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function yP(){return!0}function bP(e){return typeof e==`object`&&!!e&&`type`in e}function xP(e){return e}var SP=[];function CP(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=mP(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+xP(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=SP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=wP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function wP(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?SP:[e]}function TP(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),CP(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var EP={}.hasOwnProperty,DP={};function OP(e,t){let n=t||DP,r=new Map,i=new Map,a={all:s,applyData:AP,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...YN,...n.handlers},one:o,options:n,patch:kP,wrap:MP};return TP(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(EP.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=uP(n);return r.children=a.all(e),r}return uP(e)}return(a.options.unknownHandler||jP)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=NP(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=NP(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function kP(e,t){e.position&&(t.position=Ik(e))}function AP(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,uP(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function jP(e,t){let n=t.data||{},r=`value`in t&&!(EP.call(n,`hProperties`)||EP.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function MP(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
68
68
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
69
69
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
70
|
-
`}),n}function
|
|
71
|
-
`},i)),a}function CP(e,t){return e&&`run`in e?async function(n,r){let i=SP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return SP(n,{file:r,...e||t})}}function wP(e){if(e)throw e}var TP=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function EP(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function DP(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?OP(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function OP(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var kP={basename:AP,dirname:jP,extname:MP,join:NP,sep:`/`};function AP(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);IP(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function jP(e){if(IP(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function MP(e){IP(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function NP(...e){let t=-1,n;for(;++t<e.length;)IP(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:PP(n)}function PP(e){IP(e);let t=e.codePointAt(0)===47,n=FP(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function FP(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function IP(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var LP={cwd:RP};function RP(){return`/`}function zP(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function BP(e){if(typeof e==`string`)e=new URL(e);else if(!zP(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return VP(e)}function VP(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var HP=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],UP=class{constructor(e){let t;t=e?zP(e)?{path:e}:typeof e==`string`||qP(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:LP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<HP.length;){let e=HP[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)HP.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?kP.basename(this.path):void 0}set basename(e){GP(e,`basename`),WP(e,`basename`),this.path=kP.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?kP.dirname(this.path):void 0}set dirname(e){KP(this.basename,`dirname`),this.path=kP.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?kP.extname(this.path):void 0}set extname(e){if(WP(e,`extname`),KP(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=kP.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){zP(e)&&(e=BP(e)),GP(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?kP.basename(this.path,this.extname):void 0}set stem(e){GP(e,`stem`),WP(e,`stem`),this.path=kP.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new kk(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function WP(e,t){if(e&&e.includes(kP.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+kP.sep+"`")}function GP(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function KP(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function qP(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var JP=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),YP=l(TP(),1),XP={}.hasOwnProperty,ZP=new class e extends JP{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=DP()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,YP.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(eF(`data`,this.frozen),this.namespace[e]=t,this):XP.call(this.namespace,e)&&this.namespace[e]||void 0:e?(eF(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=rF(e),n=this.parser||this.Parser;return QP(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),QP(`process`,this.parser||this.Parser),$P(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=rF(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);aF(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),QP(`processSync`,this.parser||this.Parser),$P(`processSync`,this.compiler||this.Compiler),this.process(e,r),nF(`processSync`,`process`,t),n;function r(e,r){t=!0,wP(e),n=r}}run(e,t,n){tF(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=rF(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),nF(`runSync`,`run`,n),r;function i(e,t){wP(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=rF(t),r=this.compiler||this.Compiler;return $P(`stringify`,r),tF(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(eF(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,YP.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];EP(o)&&EP(r)&&(r=(0,YP.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function QP(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function $P(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function eF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tF(e){if(!EP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function nF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function rF(e){return iF(e)?e:new UP(e)}function iF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function aF(e){return typeof e==`string`||oF(e)}function oF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var sF=[],cF={allowDangerousHtml:!0},lF=/^(https?|ircs?|mailto|xmpp)$/i,uF=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function dF(e){let t=fF(e),n=pF(e);return mF(t.runSync(t.parse(n),n),e)}function fF(e){let t=e.rehypePlugins||sF,n=e.remarkPlugins||sF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cF}:cF;return ZP().use(oN).use(n).use(CP,r).use(t)}function pF(e){let t=e.children||``,n=new UP;return typeof t==`string`?n.value=t:``+t,n}function mF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||hF;for(let e of uF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return pP(e,l),Lk(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in aA)if(Object.hasOwn(aA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=aA[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function hF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||lF.test(e.slice(0,t))?e:``}function gF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function _F(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function vF(e,t,n){let r=nP((n||{}).ignore||[]),i=yF(t),a=-1;for(;++a<i.length;)dP(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function yF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([bF(e[0]),xF(e[1])])}return t}function bF(e){return typeof e==`string`?new RegExp(_F(e),`g`):e}function xF(e){return typeof e==`function`?e:function(){return e}}var SF=`phrasing`,CF=[`autolink`,`link`,`image`,`label`];function wF(){return{transforms:[MF],enter:{literalAutolink:EF,literalAutolinkEmail:DF,literalAutolinkHttp:DF,literalAutolinkWww:DF},exit:{literalAutolink:jF,literalAutolinkEmail:AF,literalAutolinkHttp:OF,literalAutolinkWww:kF}}}function TF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:SF,notInConstruct:CF},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:SF,notInConstruct:CF},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:SF,notInConstruct:CF}]}}function EF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function DF(e){this.config.enter.autolinkProtocol.call(this,e)}function OF(e){this.config.exit.autolinkProtocol.call(this,e)}function kF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function AF(e){this.config.exit.autolinkEmail.call(this,e)}function jF(e){this.exit(e)}function MF(e){vF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,NF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,PF]],{ignore:[`link`,`linkReference`]})}function NF(e,t,n,r,i){let a=``;if(!LF(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!FF(n)))return!1;let o=IF(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function PF(e,t,n,r){return!LF(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function FF(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function IF(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=gF(e,`(`),a=gF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function LF(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||AA(n)||kA(n))&&(!t||n!==47)}qF.peek=KF;function RF(){this.buffer()}function zF(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function BF(){this.buffer()}function VF(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function HF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function UF(e){this.exit(e)}function WF(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=bA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function GF(e){this.exit(e)}function KF(){return`[`}function qF(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function JF(){return{enter:{gfmFootnoteCallString:RF,gfmFootnoteCall:zF,gfmFootnoteDefinitionLabelString:BF,gfmFootnoteDefinition:VF},exit:{gfmFootnoteCallString:HF,gfmFootnoteCall:UF,gfmFootnoteDefinitionLabelString:WF,gfmFootnoteDefinition:GF}}}function YF(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:qF},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
72
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?
|
|
73
|
-
`)}function
|
|
74
|
-
`&&!e.before&&!e.after&&
|
|
75
|
-
`}function
|
|
70
|
+
`}),n}function NP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function PP(e,t){let n=OP(e,t),r=n.one(e,void 0),i=pP(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
71
|
+
`},i)),a}function FP(e,t){return e&&`run`in e?async function(n,r){let i=PP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return PP(n,{file:r,...e||t})}}function IP(e){if(e)throw e}var LP=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function RP(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function zP(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?BP(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function BP(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var VP={basename:HP,dirname:UP,extname:WP,join:GP,sep:`/`};function HP(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);JP(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function UP(e){if(JP(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function WP(e){JP(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function GP(...e){let t=-1,n;for(;++t<e.length;)JP(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:KP(n)}function KP(e){JP(e);let t=e.codePointAt(0)===47,n=qP(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function qP(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function JP(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var YP={cwd:XP};function XP(){return`/`}function ZP(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function QP(e){if(typeof e==`string`)e=new URL(e);else if(!ZP(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return $P(e)}function $P(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var eF=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],tF=class{constructor(e){let t;t=e?ZP(e)?{path:e}:typeof e==`string`||aF(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:YP.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<eF.length;){let e=eF[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)eF.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?VP.basename(this.path):void 0}set basename(e){rF(e,`basename`),nF(e,`basename`),this.path=VP.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?VP.dirname(this.path):void 0}set dirname(e){iF(this.basename,`dirname`),this.path=VP.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?VP.extname(this.path):void 0}set extname(e){if(nF(e,`extname`),iF(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=VP.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ZP(e)&&(e=QP(e)),rF(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?VP.basename(this.path,this.extname):void 0}set stem(e){rF(e,`stem`),nF(e,`stem`),this.path=VP.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Vk(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function nF(e,t){if(e&&e.includes(VP.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+VP.sep+"`")}function rF(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function iF(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function aF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var oF=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),sF=l(LP(),1),cF={}.hasOwnProperty,lF=new class e extends oF{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=zP()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,sF.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(fF(`data`,this.frozen),this.namespace[e]=t,this):cF.call(this.namespace,e)&&this.namespace[e]||void 0:e?(fF(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=hF(e),n=this.parser||this.Parser;return uF(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),uF(`process`,this.parser||this.Parser),dF(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=hF(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);_F(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),uF(`processSync`,this.parser||this.Parser),dF(`processSync`,this.compiler||this.Compiler),this.process(e,r),mF(`processSync`,`process`,t),n;function r(e,r){t=!0,IP(e),n=r}}run(e,t,n){pF(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=hF(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),mF(`runSync`,`run`,n),r;function i(e,t){IP(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=hF(t),r=this.compiler||this.Compiler;return dF(`stringify`,r),pF(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(fF(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,sF.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];RP(o)&&RP(r)&&(r=(0,sF.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function uF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function dF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function fF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function pF(e){if(!RP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function mF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function hF(e){return gF(e)?e:new tF(e)}function gF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function _F(e){return typeof e==`string`||vF(e)}function vF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var yF=[],bF={allowDangerousHtml:!0},xF=/^(https?|ircs?|mailto|xmpp)$/i,SF=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function CF(e){let t=wF(e),n=TF(e);return EF(t.runSync(t.parse(n),n),e)}function wF(e){let t=e.rehypePlugins||yF,n=e.remarkPlugins||yF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...bF}:bF;return lF().use(vN).use(n).use(FP,r).use(t)}function TF(e){let t=e.children||``,n=new tF;return typeof t==`string`?n.value=t:``+t,n}function EF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||DF;for(let e of SF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return TP(e,l),Yk(e,{Fragment:I.Fragment,components:i,ignoreInvalidStyle:!0,jsx:I.jsx,jsxs:I.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in _A)if(Object.hasOwn(_A,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=_A[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function DF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||xF.test(e.slice(0,t))?e:``}function OF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function kF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function AF(e,t,n){let r=mP((n||{}).ignore||[]),i=jF(t),a=-1;for(;++a<i.length;)CP(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&u.push({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length}}function jF(e){let t=[];if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([MF(e[0]),NF(e[1])])}return t}function MF(e){return typeof e==`string`?new RegExp(kF(e),`g`):e}function NF(e){return typeof e==`function`?e:function(){return e}}var PF=`phrasing`,FF=[`autolink`,`link`,`image`,`label`];function IF(){return{transforms:[WF],enter:{literalAutolink:RF,literalAutolinkEmail:zF,literalAutolinkHttp:zF,literalAutolinkWww:zF},exit:{literalAutolink:UF,literalAutolinkEmail:HF,literalAutolinkHttp:BF,literalAutolinkWww:VF}}}function LF(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:PF,notInConstruct:FF},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:PF,notInConstruct:FF},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:PF,notInConstruct:FF}]}}function RF(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function zF(e){this.config.enter.autolinkProtocol.call(this,e)}function BF(e){this.config.exit.autolinkProtocol.call(this,e)}function VF(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function HF(e){this.config.exit.autolinkEmail.call(this,e)}function UF(e){this.exit(e)}function WF(e){AF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,GF],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,KF]],{ignore:[`link`,`linkReference`]})}function GF(e,t,n,r,i){let a=``;if(!YF(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!qF(n)))return!1;let o=JF(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function KF(e,t,n,r){return!YF(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function qF(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function JF(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=OF(e,`(`),a=OF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function YF(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||HA(n)||VA(n))&&(!t||n!==47)}aI.peek=iI;function XF(){this.buffer()}function ZF(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function QF(){this.buffer()}function $F(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function eI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=MA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function tI(e){this.exit(e)}function nI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=MA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function rI(e){this.exit(e)}function iI(){return`[`}function aI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function oI(){return{enter:{gfmFootnoteCallString:XF,gfmFootnoteCall:ZF,gfmFootnoteDefinitionLabelString:QF,gfmFootnoteDefinition:$F},exit:{gfmFootnoteCallString:eI,gfmFootnoteCall:tI,gfmFootnoteDefinitionLabelString:nI,gfmFootnoteDefinition:rI}}}function sI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:aI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
72
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?lI:cI))),s(),o}}function cI(e,t,n){return t===0?e:lI(e,t,n)}function lI(e,t,n){return(n?``:` `)+e}var uI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];hI.attention=gI,hI.peek=_I;function dI(){return{canContainEols:[`delete`],enter:{strikethrough:pI},exit:{strikethrough:mI}}}function fI(){return{handlers:{delete:hI},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:uI}]}}function pI(e){this.enter({type:`delete`,children:[],position:void 0},e)}function mI(e){this.exit(e)}function hI(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function gI(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function _I(){return`~`}function vI(e){return e.length}function yI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||vI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=bI(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=xI(r[d]);else{let e=xI(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
73
|
+
`)}function bI(e){return e==null?``:String(e)}function xI(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var SI=mP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function CI(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),wI);return i(),o}function wI(e,t,n){return`>`+(n?``:` `)+e}function TI(e,t){return EI(e,t.inConstruct,!0)&&!EI(e,t.notInConstruct,!1)}function EI(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function DI(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
74
|
+
`&&!e.before&&!e.after&&TI(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
75
|
+
`}function OI(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function kI(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function AI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function jI(e,t,n,r){let i=AI(n),a=e.value||``;if(kI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,MI);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(OI(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
76
76
|
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
77
77
|
`),a&&(u+=o.move(a+`
|
|
78
|
-
`)),u+=o.move(s),c(),u}function
|
|
79
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function
|
|
78
|
+
`)),u+=o.move(s),c(),u}function MI(e,t,n){return(n?``:` `)+e}function NI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function PI(e,t,n,r){let i=NI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
79
|
+
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function FI(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}II.attention=LI,II.peek=RI;function II(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function LI(e,t){return{construct:`emphasis`,markers:FI(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function RI(e,t,n){return n.options.emphasis||`*`}function zI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function BI(e,t){let n=!1;return TP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&yA(e)&&(t.options.setext||n))}function VI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(BI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
80
80
|
`,after:`
|
|
81
81
|
`});return r(),t(),o+`
|
|
82
82
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
83
83
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
84
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=
|
|
84
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=zI(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}HI.peek=UI;function HI(e){return e.value||``}function UI(){return`<`}WI.peek=GI;function WI(e,t,n,r){let i=NI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function GI(){return`!`}KI.peek=qI;function KI(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function qI(){return`!`}JI.peek=YI;function JI(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function YI(){return"`"}function XI(e,t){let n=yA(e);return!(t.options.resourceLink||!e.url||e.title||!e.children||e.children.length!==1||e.children[0].type!==`text`||n!==e.url&&`mailto:`+n!==e.url||!/^[a-z][+\-.a-z]+:/i.test(e.url)||/[\0- <>\u007F]/.test(e.url))}ZI.peek=QI;function ZI(e,t,n,r){let i=NI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(XI(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function QI(e,t,n){return XI(e,n)?`<`:`[`}$I.peek=eL;function $I(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function eL(){return`[`}function tL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function nL(e){let t=tL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function rL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function iL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function aL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?rL(n):tL(n),s=e.ordered?o===`.`?`)`:`.`:nL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),iL(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function oL(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function sL(e,t,n,r){let i=oL(n),a=n.bulletCurrent||tL(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function cL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function lL(e,t,n,r){if(!e.children.some(function(e){return SI(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function uL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}dL.attention=fL,dL.peek=pL;function dL(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function fL(e,t){return{construct:`strong`,markers:uL(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function pL(e,t,n){return n.options.strong||`*`}function mL(e,t,n,r){return n.safe(e.value,r)}function hL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function gL(e,t,n){let r=(iL(n)+(n.options.ruleSpaces?` `:``)).repeat(hL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var _L={blockquote:CI,break:DI,code:jI,definition:PI,emphasis:II,hardBreak:DI,heading:VI,html:HI,image:WI,imageReference:KI,inlineCode:JI,link:ZI,linkReference:$I,list:aL,listItem:sL,paragraph:cL,root:lL,strong:dL,text:mL,thematicBreak:gL};function vL(){return{enter:{table:yL,tableData:CL,tableHeader:CL,tableRow:xL},exit:{codeText:wL,table:bL,tableData:SL,tableHeader:SL,tableRow:SL}}}function yL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function bL(e){this.exit(e),this.data.inTable=void 0}function xL(e){this.enter({type:`tableRow`,children:[]},e)}function SL(e){this.exit(e)}function CL(e){this.enter({type:`tableCell`,children:[]},e)}function wL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,TL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function TL(e,t){return t===`|`?t:e}function EL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
85
85
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
86
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return sI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=aL.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function hL(){return{exit:{taskListCheckValueChecked:_L,taskListCheckValueUnchecked:_L,paragraph:vL}}}function gL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:yL}}}function _L(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function vL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function yL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=aL.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function bL(){return[wF(),JF(),$F(),oL(),hL()]}function xL(e){return{extensions:[TF(),YF(e),eI(),mL(e),gL()]}}var SL={tokenize:IL,partial:!0},CL={tokenize:LL,partial:!0},wL={tokenize:RL,partial:!0},TL={tokenize:zL,partial:!0},EL={tokenize:BL,partial:!0},DL={name:`wwwAutolink`,tokenize:PL,previous:VL},OL={name:`protocolAutolink`,tokenize:FL,previous:HL},kL={name:`emailAutolink`,tokenize:NL,previous:UL},AL={};function jL(){return{text:AL}}for(var ML=48;ML<123;)AL[ML]=kL,ML++,ML===58?ML=65:ML===91&&(ML=97);AL[43]=kL,AL[45]=kL,AL[46]=kL,AL[95]=kL,AL[72]=[kL,OL],AL[104]=[kL,OL],AL[87]=[kL,DL],AL[119]=[kL,DL];function NL(e,t,n){let r=this,i,a;return o;function o(t){return!WL(t)||!UL.call(r,r.previous)||GL(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return WL(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(EL,u,l)(t):t===45||t===95||SA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&xA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function PL(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!VL.call(r,r.previous)||GL(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(SL,e.attempt(CL,e.attempt(wL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function FL(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&HL.call(r,r.previous)&&!GL(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(xA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||wA(t)||OA(t)||AA(t)||kA(t)?n(t):e.attempt(CL,e.attempt(wL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function IL(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function LL(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(TL,c,s)(t):t===null||OA(t)||AA(t)||t!==45&&kA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function RL(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(TL,t,a)(o):o===null||OA(o)||AA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function zL(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||OA(o)||AA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||OA(e)||AA(e)?t(e):r(e)}function a(e){return xA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):xA(t)?(e.consume(t),o):n(t)}}function BL(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return SA(e)?n(e):t(e)}}function VL(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||OA(e)}function HL(e){return!xA(e)}function UL(e){return!(e===47||WL(e))}function WL(e){return e===43||e===45||e===46||e===95||SA(e)}function GL(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var KL={tokenize:eR,partial:!0};function qL(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:ZL,continuation:{tokenize:QL},exit:$L}},text:{91:{name:`gfmFootnoteCall`,tokenize:XL},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:JL,resolveTo:YL}}}}function JL(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=bA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function YL(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function XL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||OA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(bA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return OA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function ZL(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||OA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=bA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return OA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),NA(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function QL(e,t,n){return e.check(ZA,t,e.attempt(KL,t,n))}function $L(e){e.exit(`gfmFootnoteDefinition`)}function eR(e,t,n){let r=this;return NA(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function tR(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&pA(o,o.length,0,WA(s,e.slice(r+1,n),t)),pA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),pA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=UA(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=UA(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var nR=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){rR(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function rR(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function iR(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function aR(){return{flow:{null:{name:`table`,tokenize:oR,resolveAll:sR}}}}function oR(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?NA(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||OA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?NA(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?NA(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?NA(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?NA(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||OA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function sR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new nR;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(lR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=cR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=cR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=cR(f,t,o,i,n,d)):(o[0]=o[1],d=cR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&lR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=iR(t.events,n))}return e}function cR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},uR(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=uR(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=uR(t.events,n[2]),a=uR(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},uR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function lR(e,t,n,r,i){let a=[],o=uR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function uR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var dR={name:`tasklistCheck`,tokenize:pR};function fR(){return{text:{91:dR}}}function pR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return OA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:mR},t,n)(r):n(r)}}function mR(e,t,n){return NA(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function hR(e){return gA([jL(),qL(),tR(e),aR(),fR()])}var gR={};function _R(e){let t=this,n=e||gR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(hR(n)),a.push(bL()),o.push(xL(n))}var vR=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function yR(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return vR.has(e.protocol)?t:``}catch{return``}}function bR(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 xR(e,t){return!e&&!t}async function SR(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var CR=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function wR(e){let t=e.lastIndexOf(`${sD}\n`);if(t<0||t>0&&e[t-1]!==`
|
|
87
|
-
`)return{body:e,files:[]};let n=e.slice(t+
|
|
88
|
-
`).filter(Boolean),r=[];for(let t of n){let n=CR.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 TR=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function ER({files:e}){return e.length===0?null:(0,I.jsx)(`ul`,{className:`mt-2 flex flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,I.jsx)(`li`,{children:TR.has(e.mime)?(0,I.jsx)(`a`,{href:Uf(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02]`,children:(0,I.jsx)(`img`,{src:Uf(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-56 object-cover`})}):(0,I.jsxs)(`span`,{className:`inline-flex max-w-64 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,I.jsx)(mm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,I.jsx)(eh,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}function DR(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(DR).join(``)}function OR(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}),OR(t,n)}function kR(){return e=>OR(e)}function AR(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await SR(e,navigator.clipboard),n(!0),B.success(`Code copied.`)}catch{B.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function jR({text:e,children:t,block:n=!1}){let{copy:r}=AR(e),i=(0,m.useRef)(void 0);return(0,I.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,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(),xR(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),xR(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,I.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function MR({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=AR(bR(n,r?.position,!0)??DR(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,I.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,I.jsx)(Y,{label:i?`Copied`:`Copy the code`,icon:i?Op:nm,iconOnly:!0,onClick:()=>void a()})]}),(0,I.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function NR(e){return{pre:t=>(0,I.jsx)(MR,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,I.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,I.jsx)(jR,{text:bR(e,r?.position,i)??DR(r),block:i,children:n})},a:({href:e,children:t})=>(0,I.jsx)(`a`,{href:e?Uf(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,I.jsx)(`img`,{src:e?Uf(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,I.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,I.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var PR=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=wR(e);return(0,I.jsxs)(`div`,{className:q(`md-body`,t),children:[n?(0,I.jsx)(dF,{remarkPlugins:[_R],rehypePlugins:[kR],urlTransform:yR,components:NR(n),children:n}):null,(0,I.jsx)(ER,{files:r})]})});function FR({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,I.jsxs)(`section`,{className:q(`group/frame relative flex min-h-0 min-w-0 flex-col`,i&&`flex-none`,n),...s,children:[e||t||a?(0,I.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,I.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,I.jsx)(`span`,{}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,I.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,I.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`,children:[o?(0,I.jsx)(KE,{chord:o,className:`kbd-hint`}):null,(0,I.jsx)(Ap,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function IR({title:e,right:t,className:n}){return(0,I.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,I.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,I.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function LR({title:e,right:t,prominent:n,children:r}){return(0,I.jsxs)(`section`,{className:q(`flex flex-col`,n?`gap-3`:`gap-2.5`),children:[(0,I.jsx)(`h3`,{className:n?`text-sm text-foreground`:`text-xs text-muted-foreground`,children:(0,I.jsx)(IR,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var RR=`Pull requests`,zR=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,BR=`nothing is posted to GitHub`,VR=`Refresh to load open pull requests with the GitHub CLI (gh).`,HR=`No open pull requests.`,UR=`loading pull requests from GitHub…`,WR=`reading the diff…`,GR=`the pull request has new commits since this review — review it again`,KR=`(no description)`,qR=`Review with a focus (optional)`,JR=`Leave it empty for a full review.`;function YR(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function XR(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function ZR(e,t){return`+${e} −${t}`}function QR(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function $R(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function ez(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function tz(e,t){if(e.status===`running`)return nz(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?nz(e,t):e.status;return[ez(e.verdict),n].filter(Boolean).join(` · `)}function nz(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 rz(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${_O(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function iz(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${ZR(e.additions,e.deletions)} · ${t}`}function az(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,QR(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function oz(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function sz(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function cz(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 lz({pull:e,now:t}){return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:rz(e,t)}),(0,I.jsx)(`p`,{className:`text-sm tabular-nums`,children:iz(e)}),az(e)?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:az(e)}):null,e.url?(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function uz({read:e}){return(0,I.jsxs)(LR,{title:`Jev's read`,right:sz(e),children:[e.status===`running`?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{className:`size-3.5`}),WR]}):null,e.status===`failed`?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,I.jsx)(PR,{text:e.line}):null]})}function dz({review:e,now:t}){return(0,I.jsxs)(I.Fragment,{children:[e.model?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,_O(t-e.startedAt)]}):null,e.stale?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:GR}):null,e.status===`running`?(0,I.jsx)(fz,{steps:e.steps}):null,e.status===`cancelled`?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,I.jsx)(PR,{text:e.text}):null]})}function fz({steps:e}){return(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,I.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function pz({number:e,focus:t,onChange:n}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:qR}),(0,I.jsx)(fO,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,onChange:e=>n(e.target.value)}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:JR})]})}function mz({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,I.jsxs)(LR,{title:`Review`,right:t?tz(t,n):void 0,children:[t?(0,I.jsx)(dz,{review:t,now:n}):null,(0,I.jsx)(pz,{number:e,focus:r,onChange:i}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,BR,`.`]})]})}function hz({files:e}){return(0,I.jsx)(LR,{title:`Files`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,I.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,I.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:ZR(e.additions,e.deletions)})]},e.path))})})})})}function gz({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?_O(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,I.jsxs)(`article`,{className:`flex flex-col gap-1.5 rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,I.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,I.jsx)(PR,{text:e.body.trim()}):null]})}function _z({notes:e,now:t}){return e.length===0?null:(0,I.jsx)(LR,{title:`Discussion`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,I.jsx)(gz,{note:e,now:t},n))})})}function vz({number:e,error:t}){return t?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{className:`size-3.5`}),`loading #`,e,`…`]})}function yz({number:e,onChanged:t}){let n=DD(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=cz(a);if(!n.data)return(0,I.jsx)(vz,{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 V(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await V(`git.jev`,{number:e}),u()},p=async()=>{await V(`git.cancelReview`,{number:e}),u()};return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,I.jsxs)(ZD,{children:[(0,I.jsx)(Y,{label:`Review`,icon:fh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,I.jsx)(Y,{label:`Jev's read`,icon:Sp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,I.jsx)(OO,{icon:Jp,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,I.jsx)(lz,{pull:s,now:o}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:zR}),l?(0,I.jsx)(uz,{read:l}):null,(0,I.jsx)(mz,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,I.jsx)(hz,{files:s.files}):null,(0,I.jsx)(LR,{title:`Description`,children:s.body.trim()?(0,I.jsx)(PR,{text:s.body.trim()}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:KR})}),(0,I.jsx)(_z,{notes:s.notes,now:o})]})}var bz=dg(`group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-lg border border-transparent px-2.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-accent text-foreground [a]:hover:bg-primary/20`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/12 text-destructive [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-accent`,ghost:`hover:bg-accent hover:text-foreground`,link:`text-link underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function xz({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?G_:`span`;return(0,I.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:q(bz({variant:t}),e),...r})}var Sz=`flex min-h-10 w-full flex-col gap-0.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:bg-accent`,Cz=`flex flex-col gap-0.5 px-2 pb-2`,wz=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function Tz({checks:e}){let t=YR(e);return t?(0,I.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,XR(e)),"aria-hidden":`true`,children:t}):(0,I.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function Ez({pull:e,selected:t,onSelect:n}){let r=$R(e.review);return(0,I.jsx)(`li`,{children:(0,I.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:Sz,children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,I.jsx)(Tz,{checks:e.checks}),e.draft?(0,I.jsx)(xz,{variant:`secondary`,children:`draft`}):null,(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,I.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:oz(e)}),(0,I.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,I.jsx)(`span`,{children:r}):null,(0,I.jsx)(`span`,{className:`tabular-nums`,children:ZR(e.additions,e.deletions)})]})]})]})})}function Dz({pulls:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`ul`,{className:Cz,children:e.map(e=>(0,I.jsx)(Ez,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var Oz=()=>dD(uD(`git`)),kz=e=>dD(uD(`git`,String(e)));function Az(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function jz({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?HR:e?UR:VR;return(0,I.jsxs)(pD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(vm,{"aria-hidden":`true`})}),(0,I.jsx)(vD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,I.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function Mz({rest:e}){let t=oO(),n=DD(`git.pulls`,{},[`git`]),r=Az(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{V(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,I.jsx)(xD,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,I.jsx)(jz,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:RR,count:n.data?`${i.length} open`:void 0,children:(0,I.jsx)(Y,{label:`Refresh`,icon:gh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,I.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,I.jsx)(Dz,{pulls:i,selectedId:r,onSelect:kz}):(0,I.jsx)(dO,{})]}),c=r===void 0?null:(0,I.jsx)(yz,{number:r,onChanged:n.reload},r);return(0,I.jsx)(lO,{wide:t,list:s,detail:c,open:r!==void 0,onClose:Oz,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function Nz(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function Pz({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,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,I.jsx)(fO,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{Nz(e)&&(e.preventDefault(),l())}}),t?(0,I.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,I.jsx)(`div`,{className:`flex self-end`,children:(0,I.jsx)(Y,{label:n,icon:s?Mm:bp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var Fz=`Issues`,Iz=`Issue`,Lz=`p plans it with the planning panel, then save it as a task`,Rz=`Refresh to load open issues with the GitHub CLI (gh).`,zz=`No open issues. File one with New issue.`,Bz=`loading issues from GitHub…`,Vz=`issues are off (lobby.issues)`,Hz=`(no description)`;function Uz(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${_O(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function Wz(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?_O(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function Gz(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function Kz({issue:e,now:t}){return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Uz(e,t)}),e.url?(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function qz({comment:e,now:t}){return(0,I.jsxs)(`article`,{className:`flex flex-col gap-1.5 rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,I.jsx)(`span`,{children:_O(t-Date.parse(e.createdAt))}):null]}),(0,I.jsx)(PR,{text:e.body.trim()})]})}function Jz({comments:e,now:t}){return e.length===0?null:(0,I.jsx)(LR,{title:`Comments`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,I.jsx)(qz,{comment:e,now:t},n))})})}function Yz({number:e}){let t=DD(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${Iz} #${e}`,children:[(0,I.jsx)(Kz,{issue:r,now:n}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Lz}),(0,I.jsx)(LR,{title:`Description`,children:r.body.trim()?(0,I.jsx)(PR,{text:r.body.trim()}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Hz})}),(0,I.jsx)(Jz,{comments:r.comments,now:n})]})}function Xz({issue:e,selected:t,now:n,onSelect:r}){let i=Gz(e.labels);return(0,I.jsx)(`li`,{children:(0,I.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:Sz,children:[(0,I.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,I.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,I.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:Wz(e,n)})]})})}function Zz({issues:e,selectedId:t,now:n,onSelect:r}){return(0,I.jsx)(`ul`,{className:Cz,children:e.map(e=>(0,I.jsx)(Xz,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var Qz=()=>dD(uD(`issues`)),$z=e=>dD(uD(`issues`,String(e)));function eB(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function tB(){return(0,I.jsx)(pD,{className:`m-4 flex-1`,children:(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(Wp,{"aria-hidden":`true`})}),(0,I.jsx)(_D,{children:`Issues are off`}),(0,I.jsx)(vD,{className:`font-mono`,children:Vz})]})})}function nB({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?zz:e?Bz:Rz;return(0,I.jsxs)(pD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(Wp,{"aria-hidden":`true`})}),(0,I.jsx)(vD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,I.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function rB({onCreate:e}){return(0,I.jsx)(sO,{className:`shrink-0 border-t border-border p-4`,children:(0,I.jsx)(Pz,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function iB({rest:e}){let t=oO(),n=TD(`status`).data?.issuesEnabled??!0,r=DD(`issues.list`,{},[`issues`],n),i=eB(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{V(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await V(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,I.jsx)(tB,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,I.jsx)(tB,{}):(0,I.jsx)(xD,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:Fz,count:r.data?`${a.length} open`:void 0,children:(0,I.jsx)(Y,{label:`Refresh`,icon:gh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,I.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,I.jsx)(Zz,{issues:a,selectedId:i,now:o,onSelect:$z}):(0,I.jsx)(dO,{}),(0,I.jsx)(rB,{onCreate:c})]}),d=i===void 0?null:(0,I.jsx)(Yz,{number:i},i),f=r.data&&a.length===0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(nB,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,I.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,I.jsx)(rB,{onCreate:c})})]}):(0,I.jsx)(lO,{wide:t,list:u,detail:d,open:i!==void 0,onClose:Qz,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}var aB=[`master`,`designer`,`backend`,`qa`],oB={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},sB={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},cB=`Every write archives the version before it.`;function lB(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function uB(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function dB(e){return{text:e.text,occurrence:e.occurrence}}function fB(e){return aB.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 pB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function mB({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,I.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,I.jsx)(fO,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{pB(e)&&(e.preventDefault(),o())}}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:cB}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:r,disabled:t,children:`Cancel`}),(0,I.jsxs)(J,{onClick:o,disabled:t||!i.trim(),children:[t?(0,I.jsx)(yD,{}):null,`Save`]})]})]})]})}function hB({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=nD(e,tD.confirm);return(0,I.jsx)(JE,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:cB,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:cB})]}),(0,I.jsx)(fO,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:i,disabled:r,children:`Cancel`}),(0,I.jsxs)(J,{onClick:()=>a(o),disabled:r,children:[r?(0,I.jsx)(yD,{}):null,`Save file`]})]})]})})}function gB({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,I.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(oh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,I.jsx)(Y,{label:`Take the note back`,icon:Kh,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function _B({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,I.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`:`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`,children:[(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(PR,{text:e.text})})}),r.length>0?(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,I.jsx)(gB,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function vB({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,I.jsx)(LR,{title:`Notes on entries that changed`,right:String(e.length),children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,I.jsx)(gB,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function yB({view:e}){let t=e.entries.length;return(0,I.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:[sB[e.agent],` `,(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,lB(e.chars),` chars`]}),e.over?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:uB(e.file)}):null]})}function bB({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,I.jsxs)(ZD,{children:[(0,I.jsx)(Y,{label:`Edit the entry`,text:`Edit`,icon:uh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,I.jsx)(Y,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:mh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,I.jsx)(Y,{label:`Comment on the entry`,text:`Comment`,icon:Rm,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,I.jsx)(Y,{label:`Edit the whole file`,text:`Edit file`,icon:um,shortcut:`F`,disabled:a,onClick:r}),(0,I.jsx)(OO,{icon:Hh,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 xB({agent:e,file:t,onChanged:n}){let r=DD(`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(()=>V(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>V(`knowledge.remove`,{agent:e,file:t,ref:dB(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>V(`knowledge.edit`,{agent:e,file:t,ref:dB(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>V(`knowledge.comment`,{agent:e,file:t,ref:dB(r),text:n}));g(()=>V(`knowledge.add`,{agent:e,file:t,...h?{ref:dB(h)}:{},text:n}))};return f?(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${sB[e]} ${t}`,children:[(0,I.jsx)(bB,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,I.jsx)(yB,{view:f}),p.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.map((e,t)=>(0,I.jsx)(_B,{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,I.jsx)(mB,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,I.jsx)(Pz,{label:`Comment on this entry`,hint:cB,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,I.jsx)(Pz,{label:`Add an entry`,hint:cB,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{}),` saving…`]}):null,(0,I.jsx)(vB,{notes:f.detached,onTakeBack:_,busy:u}),(0,I.jsx)(hB,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>V(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}function SB(e){return`${e.agent}/${e.file}`}function CB({info:e}){return(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,I.jsx)(`span`,{children:lB(e.chars)}),e.over?(0,I.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,I.jsxs)(`span`,{className:`text-primary`,children:[e.notes,` note`,e.notes===1?``:`s`]}):null]})}function wB({info:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(SB(e)),className:q(Sz,`min-h-9 flex-row items-center justify-between gap-3 py-1.5`),children:[(0,I.jsx)(`span`,{className:q(`min-w-0 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,I.jsx)(CB,{info:e})]})})}var TB={master:wp,designer:Xm,backend:Oh,qa:Mh},EB=`bot-lobby.knowledge.folded`;function DB(){try{let e=JSON.parse(window.localStorage.getItem(EB)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function OB({files:e,selectedKey:t,onSelect:n}){let[r,i]=(0,m.useState)(DB);function a(e,t){i(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(EB,JSON.stringify(r))}catch{}return r})}return(0,I.jsx)(`div`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:fB(e).map(e=>{let i=!r.includes(e.agent),o=TB[e.agent],s=`knowledge-${e.agent}`;return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h3`,{children:(0,I.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e.agent,!i),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),a(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),i||a(e.agent,!0))},className:`mt-1 flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-xs font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,I.jsx)(Mp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 transition-transform duration-200 ease-snap`,i&&`rotate-90`)}),(0,I.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:oB[e.agent]}),e.notes>0?(0,I.jsxs)(`span`,{className:`shrink-0 font-normal text-primary tabular-nums`,children:[e.notes,` note`,e.notes===1?``:`s`]}):null]})}),(0,I.jsx)(nu,{initial:!1,children:i?(0,I.jsx)(z.ul,{id:s,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`flex flex-col gap-0.5 overflow-hidden pl-3`,children:e.files.map(e=>(0,I.jsx)(wB,{info:e,selected:SB(e)===t,onSelect:n},SB(e)))},`files`):null})]},e.agent)})})}var kB=()=>dD(uD(`knowledge`)),AB=e=>{let[t,n]=e.split(`/`);dD(uD(`knowledge`,t??``,n??``))};function jB(){return(0,I.jsx)(pD,{className:`m-4 flex-1`,children:(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(Sp,{"aria-hidden":`true`})}),(0,I.jsx)(vD,{children:`No knowledge files yet.`})]})})}function MB(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,I.jsx)(xB,{agent:i.agent,file:i.file,onChanged:r},SB(i)):t&&n?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function NB({agent:e,file:t}){let n=oO(),r=DD(`knowledge.files`,{},[`knowledge`]),i=r.data?.files??[];if(!r.data&&r.error)return(0,I.jsx)(xD,{message:`Could not load the knowledge files. ${r.error}`,onRetry:r.reload});if(r.data&&i.length===0)return(0,I.jsx)(jB,{});let a=i.reduce((e,t)=>e+t.notes,0),o=i.find(n=>n.agent===e&&n.file===t),s=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:`Knowledge`,count:a>0?`${a} note${a===1?``:`s`}`:void 0}),r.data?(0,I.jsx)(OB,{files:i,selectedKey:o?SB(o):void 0,onSelect:AB}):(0,I.jsx)(dO,{})]});return(0,I.jsx)(lO,{wide:n,list:s,detail:MB(i,e,t,r.reload),open:!!(e&&t),onClose:kB,hint:`Select a file to read its entries.`,describe:`Knowledge file`})}function PB({className:e,...t}){return(0,I.jsx)(yS,{"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,I.jsx)(xS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var FB=`Sessions`,IB=`No sessions yet.`,LB=`Up to 5 sessions; each can be assigned to one agent or several.`,RB=`A session is a live Excalidraw room that you and your agents draw in together.`,zB=[{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.`}],BB=`Sessions`,VB=`Pick a session on the left to see its link, its room and its agents.`,HB=`Room link`,UB=`Masked until revealed. A revealed link stays in this tab and is never saved.`,WB=`Room`,GB=`Drawing`,KB=`Last check`,qB=`not checked yet`,JB=`Add a session`,YB=`https://excalidraw.com/#room=…`,XB=`Optional name`;function ZB(e){return`${e} of 5 in use`}var QB=`Agents may draw here.`,$B=`Agents may only look.`,eV=`checking the room…`,tV=`Check that the room can be reached.`,nV=`Assigned to`,rV=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,iV=`Add or rename`,aV=`Add by link`,oV=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,sV=`New room`,cV=`Makes a fresh room link to open in Excalidraw; the name is optional.`,lV=`Rename`,uV=`draw`,dV=`look only`,fV=`Copied to the clipboard`,pV=`Could not reveal the link.`,mV=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],hV={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function gV(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function _V(e){return e?e.ok?`✓`:`!`:``}function vV({title:e,right:t,className:n,children:r}){return(0,I.jsxs)(`section`,{className:q(`flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4`,n),children:[(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function yV({row:e=!1}){return(0,I.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:zB.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex gap-3 rounded-xl border border-border bg-card p-3.5`,children:[(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function bV({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,I.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,I.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.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`,o&&`font-mono text-[0.8125rem]`)}),(0,I.jsx)(Y,{type:`submit`,label:n,icon:f?Mm:mh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,I.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function xV({onChanged:e,primary:t}){return(0,I.jsx)(bV,{label:aV,hint:oV,buttonLabel:`Add`,placeholder:YB,required:!0,mono:!0,primary:t,onSubmit:async t=>await V(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function SV({onChanged:e,primary:t}){return(0,I.jsx)(bV,{label:sV,hint:cV,buttonLabel:`Create`,placeholder:XB,primary:t,onSubmit:async t=>{let n=t.trim();return await V(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function CV({onChanged:e,stacked:t=!1}){return(0,I.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,I.jsx)(xV,{onChanged:e,primary:!0}),(0,I.jsx)(SV,{onChanged:e,primary:!0})]})}function wV({session:e,onChanged:t}){return(0,I.jsx)(bV,{label:lV,initial:e.name,required:!0,buttonLabel:lV,onSubmit:async n=>await V(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function TV({icon:e,tone:t=`muted`,children:n}){return(0,I.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,I.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function EV({check:e,checking:t}){return t?(0,I.jsx)(TV,{icon:Mm,children:eV}):e?e.ok?(0,I.jsx)(TV,{icon:Bp,tone:`primary`,children:`reachable`}):(0,I.jsx)(TV,{icon:Rp,tone:`warning`,children:`unreachable`}):(0,I.jsx)(TV,{icon:Hp,children:qB})}function DV({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm`,children:[(0,I.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsx)(`dd`,{className:`min-w-0`,children:t})]})}function OV({check:e,checking:t}){return t?(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,I.jsx)(yD,{className:`size-3.5`,"aria-hidden":`true`}),eV]}):e?(0,I.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:tV})}function kV({agent:e,on:t,onToggle:n}){return(0,I.jsx)(`li`,{children:(0,I.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]`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,I.jsx)(PB,{checked:t,onCheckedChange:()=>n(e)}),(0,I.jsx)(`span`,{className:`truncate`,children:hV[e]})]})})}function AV({session:e,onChanged:t}){let n=async n=>{await V(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await V(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===mV.length;return(0,I.jsxs)(vV,{title:nV,right:gV(e.agents.length),children:[(0,I.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:mV.map(t=>(0,I.jsx)(kV,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:rV}),(0,I.jsx)(Y,{label:i?`Take every agent off`:`Assign every agent`,icon:Om,onClick:()=>void r()})]})]})}function jV({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await qf(`excalidraw.reveal`,{id:e.id})).link)}catch(e){B.error(e instanceof Error?e.message:pV)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>B(fV)).catch(()=>void 0),u=async()=>{await V(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,I.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,I.jsxs)(ZD,{children:[o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Y,{label:`Copy the link`,text:`Copy`,icon:nm,shortcut:`C`,onClick:l}),(0,I.jsx)(Y,{label:`Open board`,icon:om,tone:`primary`,shortcut:`O`,href:o})]}):(0,I.jsx)(Y,{label:`Reveal the link`,text:`Reveal`,icon:cm,shortcut:`R`,onClick:()=>void c()}),(0,I.jsx)(Y,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?ch:uh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,I.jsx)(Y,{label:`Check the room`,text:`Check`,icon:n?Mm:Mh,shortcut:`T`,disabled:n,onClick:r}),(0,I.jsx)(OO,{icon:Hh,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,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(TV,{icon:e.contribute?uh:cm,tone:e.contribute?`primary`:`muted`,children:e.contribute?uV:dV}),(0,I.jsx)(TV,{icon:Xh,children:gV(e.agents.length)}),(0,I.jsx)(EV,{check:t,checking:n})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsxs)(vV,{title:HB,children:[(0,I.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,I.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:UB})]}),(0,I.jsx)(vV,{title:WB,children:(0,I.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(DV,{label:GB,children:(0,I.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?QB:$B})}),(0,I.jsx)(DV,{label:KB,children:(0,I.jsx)(OV,{check:t,checking:n})})]})})]}),(0,I.jsx)(AV,{session:e,onChanged:i})]}),(0,I.jsx)(vV,{title:iV,children:(0,I.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,I.jsx)(wV,{session:e,onChanged:i}),(0,I.jsx)(xV,{onChanged:i}),(0,I.jsx)(SV,{onChanged:i})]})})]})}function MV({check:e,checking:t}){if(t)return(0,I.jsx)(yD,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=_V(e);return n?(0,I.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,I.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function NV({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,I.jsx)(`li`,{children:(0,I.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:Sz,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(MV,{check:t,checking:n}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:gV(e.agents.length)})]}),(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,I.jsx)(xz,{variant:`secondary`,children:e.contribute?uV:dV})]})]})})}function PV({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,I.jsx)(`ul`,{className:Cz,children:e.map(e=>(0,I.jsx)(NV,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var FV=()=>dD(uD(`excalidraw`)),IV=e=>dD(uD(`excalidraw`,e));function LV({count:e}){return(0,I.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:ZB(e)})]})}function RV({count:e,onChanged:t}){return(0,I.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,I.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:BB}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:VB})]}),(0,I.jsx)(LV,{count:e})]}),(0,I.jsx)(yV,{row:!0}),e<5?(0,I.jsx)(vV,{title:JB,children:(0,I.jsx)(CV,{onChanged:t})}):null,(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsx)(qE,{chord:`ArrowDown`,children:`next session`}),(0,I.jsx)(qE,{chord:`ArrowRight`,children:`into its detail`})]})]})}function zV({onChanged:e}){return(0,I.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock sm:px-8`,children:(0,I.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-11 place-items-center rounded-xl border border-border bg-card text-primary shadow-card`,children:(0,I.jsx)(ih,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:IB}),(0,I.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:RB})]}),(0,I.jsx)(yV,{}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:LB})]}),(0,I.jsx)(vV,{title:JB,className:`self-start`,children:(0,I.jsx)(CV,{onChanged:e,stacked:!0})})]})})}function BV({id:e}){let t=oO(),n=DD(`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 V(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await V(`excalidraw.remove`,{id:c.id})&&(n.reload(),FV())};if(!n.data&&n.error)return(0,I.jsx)(xD,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,I.jsx)(zV,{onChanged:n.reload});let d=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:FB,count:n.data?`${s.length}/5`:void 0}),n.data?(0,I.jsx)(PV,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:IV}):(0,I.jsx)(dO,{})]}),f=c?(0,I.jsx)(jV,{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,I.jsx)(RV,{count:s.length,onChanged:n.reload}):null;return(0,I.jsx)(lO,{wide:t,list:d,detail:f,open:c!==void 0,onClose:FV,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}function VV(e,t){return e===`lobby.thinking`||t===`1`}var HV=`bot-lobby.collapsed.`,UV=new Set,WV=new Map;function GV(e){if(WV.has(e))return WV.get(e);if(e===`lobby.thinking`)return VV(e);try{return VV(e,localStorage.getItem(HV+e))}catch{return!1}}function KV(e,t){WV.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(HV+e,t?`1`:`0`)}catch{}for(let e of[...UV])e()}function qV(e){return UV.add(e),()=>{UV.delete(e)}}function JV(e){KV(e,!GV(e))}function YV(e){return[(0,m.useSyncExternalStore)(qV,()=>GV(e),()=>VV(e)),(0,m.useCallback)(()=>KV(e,!GV(e)),[e])]}function XV(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 ZV={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 QV(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function $V(e){return ZV[e]??`text-muted-foreground`}var eH={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 tH(e){return eH[e]??`var(--muted-foreground)`}function nH(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 rH(e){return e?.runs??[]}function iH(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 aH({entry:e}){return e.pending?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):e.kind===`error`?(0,I.jsx)(ig,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,I.jsx)(Wh,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function oH({entry:e}){return(0,I.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,I.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:mO(e.at)}),(0,I.jsx)(`span`,{className:q(`overflow-hidden text-xs font-medium whitespace-nowrap`,$V(e.source)),children:QV(e.source)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center self-center`,children:(0,I.jsx)(aH,{entry:e})}),(0,I.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,I.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 sH({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}=XV(JSON.stringify(a));return(0,I.jsxs)(FR,{"aria-label":`Activity`,...i?{}:{title:`Activity`},collapsed:t,...n?{onToggle:n}:{},shortcut:r,className:`flex-1`,note:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),` `,o,` running`]}):void 0,children:[(0,I.jsx)(`div`,{ref:s,onScroll:u,className:`min-h-0 flex-1 overflow-y-auto 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,I.jsx)(`p`,{className:`px-2 py-1 text-sm text-muted-foreground`,children:`No activity yet.`}):(0,I.jsx)(`ul`,{children:a.map(e=>(0,I.jsx)(oH,{entry:e},e.id))})}),c?null:(0,I.jsx)(`div`,{className:`absolute inset-x-0 bottom-dock z-10 flex justify-center`,children:(0,I.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,className:`rounded-full bg-card shadow-card`,onClick:l})})]})}var cH=3e5,lH=`earlier messages load as you scroll up`,uH=`No task is running in this session.`,dH=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,fH=`Nothing said yet. Type below to talk to the oracle about this task.`;function pH({entry:e}){let t=e.text.startsWith(`✗`);return(0,I.jsx)(`div`,{className:t?`flex justify-center text-sm text-destructive`:`flex justify-center text-sm text-muted-foreground`,children:(0,I.jsxs)(`span`,{className:`max-w-[80%] text-center`,children:[e.text,e.at?` · ${mO(e.at)}`:``]})})}function mH({name:e,children:t}){return(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,I.jsx)(`span`,{className:`font-medium`,children:e}),(0,I.jsx)(`span`,{className:`ml-auto flex items-center gap-2 text-xs text-muted-foreground`,children:t})]})}function hH({entry:e,head:t}){return e.role===`you`?(0,I.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[t?(0,I.jsxs)(`span`,{className:`flex items-baseline gap-2 text-sm`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:mO(e.at)}),(0,I.jsx)(`span`,{className:`font-medium`,children:`You`})]}):null,(0,I.jsx)(`div`,{className:`max-w-[78%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,I.jsx)(PR,{text:e.text})})]}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[t?(0,I.jsx)(mH,{name:e.role===`panel`?`Panel`:`Oracle`,children:(0,I.jsx)(`time`,{children:mO(e.at)})}):null,(0,I.jsx)(`div`,{className:`max-w-[88%] pl-4`,children:(0,I.jsx)(PR,{text:e.text})})]})}var gH=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,I.jsx)(z.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,I.jsx)(pH,{entry:e}):(0,I.jsx)(hH,{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 _H({text:e,busy:t}){let n=!!e?.trim();return!n&&!t?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(mH,{name:`Oracle`,children:t?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),n?`writing`:`working…`]}):null}),n?(0,I.jsx)(`div`,{className:`max-w-[88%] pl-4`,children:(0,I.jsx)(PR,{text:e??``})}):null]})}function vH({hasTask:e}){return(0,I.jsxs)(pD,{className:`h-full border-0`,children:[(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(Bm,{"aria-hidden":`true`})}),e?null:(0,I.jsx)(_D,{children:uH}),(0,I.jsx)(vD,{children:e?fH:dH})]}),e?null:(0,I.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,I.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,I.jsx)(KE,{chord:`3`}),` Plan`]}),(0,I.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,I.jsx)(KE,{chord:`4`}),` Quick fix`]})]})]})}async function yH(e){let t=await qf(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function bH(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 yH(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 xH({chat:e,reply:t,busy:n,hasOlder:r,hasTask:i,bare:a}){let{ref:o,atBottom:s,stick:c,onScroll:l}=XV(e.length+(t?.length??0)),{merged:u,more:d,loading:f,load:p}=bH(e,r,o),h=(0,m.useCallback)(()=>{l();let e=o.current;e&&e.scrollTop<80&&d&&!f&&p()},[l,o,d,f,p]),g=u.length===0&&!t?.trim()&&!n,[_,v]=(0,m.useState)(!1);return(0,m.useEffect)(()=>v(!0),[]),(0,I.jsxs)(FR,{"aria-label":`Conversation`,...a?{}:{title:`Conversation`},note:d?lH:void 0,className:`flex-1`,children:[(0,I.jsx)(`div`,{ref:o,onScroll:h,className:`min-h-0 flex-1 overflow-y-auto px-5 pt-4 pb-dock outline-none focus-visible:bg-muted/30`,role:`log`,"aria-label":`Conversation`,tabIndex:0,children:g?(0,I.jsx)(vH,{hasTask:i}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[u.map((e,t)=>{let n=u[t-1],r=!n||n.role!==e.role||e.at-n.at>cH;return(0,I.jsx)(gH,{entry:e,head:r,fresh:_},e.id)}),(0,I.jsx)(_H,{text:t,busy:n})]})}),s?null:(0,I.jsx)(`div`,{className:`absolute right-4 bottom-dock z-10`,children:(0,I.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,tone:`primary`,className:`rounded-full shadow-sm`,onClick:c})})]})}function SH(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]),t}function CH(e){return e===`running`?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):e===`success`?(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-success`}):e===`failed`||e===`timeout`||e===`error`?(0,I.jsx)(ig,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`})}function wH(e,t){let n=e.startedAt?Date.parse(e.startedAt):NaN;return hO((e.finishedAt?Date.parse(e.finishedAt):t)-n)}function TH({runs:e}){let t=SH(e.some(e=>e.status===`running`));return e.length===0?null:(0,I.jsx)(`ul`,{className:`-mt-1 flex shrink-0 flex-wrap items-center gap-1.5 px-4 pb-3`,"aria-label":`Runs`,children:e.map((e,n)=>(0,I.jsxs)(`li`,{className:`flex items-center gap-2 rounded-full bg-muted py-1 pr-3 pl-2 text-xs`,children:[(0,I.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:CH(e.status)}),(0,I.jsx)(`span`,{className:`sr-only`,children:e.status??`unknown`}),(0,I.jsx)(`span`,{className:q(`font-medium`,$V(nH(e))),children:QV(nH(e))}),e.activity??e.step?(0,I.jsx)(`span`,{className:`max-w-[18rem] truncate text-muted-foreground`,children:e.activity??e.step}):null,(0,I.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:wH(e,t)})]},e.runId??n))})}var EH=8;function DH(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function OH(e,t){let n=Math.min(t,EH);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 kH({done:e,total:t}){return(0,I.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:OH(e,t).map((e,t)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function AH({check:e,className:t}){return(0,I.jsx)(e===`done`?Bp:e===`dropped`?Xp:Qp,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function jH({children:e}){return(0,I.jsx)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,children:e})}function MH({done:e,total:t,current:n}){let r=t>0?Math.min(100,Math.round(e/t*100)):0;return(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[e,` of `,t,` steps`]}),(0,I.jsx)(`div`,{className:`h-1.5 w-16 overflow-hidden rounded-full bg-border`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-label":`Plan progress`,children:(0,I.jsx)(z.div,{className:`h-full rounded-full bg-primary`,initial:!1,animate:{width:`${r}%`},transition:{type:`spring`,stiffness:260,damping:30}})}),n?(0,I.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate xl:inline`,children:[`now: `,(0,I.jsx)(`span`,{className:`text-foreground`,children:n})]}):null]})}function NH({task:e,status:t}){let n=t?.branch??t?.workspace.branch,r=e?.git?.branch??n;return(0,I.jsxs)(`section`,{className:`flex h-12 shrink-0 items-center gap-3 px-4`,"aria-label":`Task`,role:`group`,children:[(0,I.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] font-medium`,title:e?.title,children:[e?.title??`No task yet`,e?null:(0,I.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:t?.sessionName??`Type a request below to start one.`})]}),e?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:e.state.replace(/_/g,` `)}),(0,I.jsx)(jH,{children:e.id}),e.track?(0,I.jsx)(jH,{children:DH(e.track)}):null,(e.domains??[]).length>0?(0,I.jsx)(jH,{children:e.domains.join(`, `)}):null,r?(0,I.jsxs)(`span`,{className:`hidden max-w-48 shrink-0 items-center gap-1 text-xs text-muted-foreground lg:inline-flex`,children:[(0,I.jsx)(gm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,I.jsxs)(`span`,{className:`truncate`,children:[r,e.git?.from?` · from ${e.git.from}`:``]})]}):null,e.progress?(0,I.jsx)(MH,{done:e.progress.done,total:e.progress.total,current:e.currentStep}):null]}):null]})}function PH(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var FH={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 IH(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:FH[e]}function LH(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=IH(n);if(!e)return;t.code=e}return t.code?t:void 0}function RH(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function zH(e,t){let n=LH(t);return n?RH(e,n):!1}function BH(e,t){for(let n of t)if(zH(e,n.key))return n.action}function VH(e,t){for(let n of t)if(zH(e,n.key))return n.id}function HH(e){return PD(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||rD()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function UH(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`)BD(e.key===`j`?1:-1);else return!1;return!0}function WH(e,t){let n=VH(e,t.tabs),r=BH(e,t.keys);return!n&&!r?!1:PH(r,{overlay:!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)||rD(),typing:PD(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 GH(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=GY[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(UH(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function KH(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){BH(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&HH(n)){t=0;return}if(WH(n,e)){t=0;return}t=r?GH(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 qH=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,JH=260,YH=200,XH=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function ZH(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(`
|
|
86
|
+
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return yI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=_L.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function DL(){return{exit:{taskListCheckValueChecked:kL,taskListCheckValueUnchecked:kL,paragraph:AL}}}function OL(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:jL}}}function kL(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function AL(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function jL(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=_L.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function ML(){return[IF(),oI(),dI(),vL(),DL()]}function NL(e){return{extensions:[LF(),sI(e),fI(),EL(e),OL()]}}var PL={tokenize:JL,partial:!0},FL={tokenize:YL,partial:!0},IL={tokenize:XL,partial:!0},LL={tokenize:ZL,partial:!0},RL={tokenize:QL,partial:!0},zL={name:`wwwAutolink`,tokenize:KL,previous:$L},BL={name:`protocolAutolink`,tokenize:qL,previous:eR},VL={name:`emailAutolink`,tokenize:GL,previous:tR},HL={};function UL(){return{text:HL}}for(var WL=48;WL<123;)HL[WL]=VL,WL++,WL===58?WL=65:WL===91&&(WL=97);HL[43]=VL,HL[45]=VL,HL[46]=VL,HL[95]=VL,HL[72]=[VL,BL],HL[104]=[VL,BL],HL[87]=[VL,zL],HL[119]=[VL,zL];function GL(e,t,n){let r=this,i,a;return o;function o(t){return!nR(t)||!tR.call(r,r.previous)||rR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return nR(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(RL,u,l)(t):t===45||t===95||PA(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&NA(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function KL(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!$L.call(r,r.previous)||rR(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(PL,e.attempt(FL,e.attempt(IL,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function qL(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&eR.call(r,r.previous)&&!rR(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(NA(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||IA(t)||BA(t)||HA(t)||VA(t)?n(t):e.attempt(FL,e.attempt(IL,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function JL(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function YL(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(LL,c,s)(t):t===null||BA(t)||HA(t)||t!==45&&VA(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function XL(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(LL,t,a)(o):o===null||BA(o)||HA(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function ZL(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||BA(o)||HA(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||BA(e)||HA(e)?t(e):r(e)}function a(e){return NA(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):NA(t)?(e.consume(t),o):n(t)}}function QL(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return PA(e)?n(e):t(e)}}function $L(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||BA(e)}function eR(e){return!NA(e)}function tR(e){return!(e===47||nR(e))}function nR(e){return e===43||e===45||e===46||e===95||PA(e)}function rR(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var iR={tokenize:fR,partial:!0};function aR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:lR,continuation:{tokenize:uR},exit:dR}},text:{91:{name:`gfmFootnoteCall`,tokenize:cR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:oR,resolveTo:sR}}}}function oR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=MA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function sR(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function cR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||BA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(MA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return BA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function lR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||BA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=MA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return BA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),GA(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function uR(e,t,n){return e.check(lj,t,e.attempt(iR,t,n))}function dR(e){e.exit(`gfmFootnoteDefinition`)}function fR(e,t,n){let r=this;return GA(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function pR(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&TA(o,o.length,0,nj(s,e.slice(r+1,n),t)),TA(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),TA(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=tj(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=tj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var mR=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){hR(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function hR(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function gR(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function _R(){return{flow:{null:{name:`table`,tokenize:vR,resolveAll:yR}}}}function vR(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?GA(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||BA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$(t)?GA(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $(t)?GA(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Q(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $(t)?GA(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?GA(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||BA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function yR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new mR;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(xR(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=bR(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=bR(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=bR(f,t,o,i,n,d)):(o[0]=o[1],d=bR(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&xR(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=gR(t.events,n))}return e}function bR(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},SR(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=SR(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=SR(t.events,n[2]),a=SR(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},SR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function xR(e,t,n,r,i){let a=[],o=SR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function SR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var CR={name:`tasklistCheck`,tokenize:TR};function wR(){return{text:{91:CR}}}function TR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return BA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Q(r)?t(r):$(r)?e.check({tokenize:ER},t,n)(r):n(r)}}function ER(e,t,n){return GA(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function DR(e){return OA([UL(),aR(),pR(e),_R(),wR()])}var OR={};function kR(e){let t=this,n=e||OR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(DR(n)),a.push(ML()),o.push(NL(n))}var AR=new Set([`http:`,`https:`,`mailto:`,`tel:`]);function jR(e){let t=(e??``).trim();if(t===``)return``;if(/^[#/.]/.test(t))return t;try{let e=new URL(t,`https://example.invalid`);return AR.has(e.protocol)?t:``}catch{return``}}function MR(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 NR(e,t){return!e&&!t}async function PR(e,t){if(!t)throw Error(`Clipboard is unavailable. Select the code and copy it manually.`);await t.writeText(e)}var FR=/^-\s+(.+?)\s+\(([^()\s]+\/[^()\s]+)\)\s*$/;function IR(e){let t=e.lastIndexOf(`${yD}\n`);if(t<0||t>0&&e[t-1]!==`
|
|
87
|
+
`)return{body:e,files:[]};let n=e.slice(t+yD.length+1).split(`
|
|
88
|
+
`).filter(Boolean),r=[];for(let t of n){let n=FR.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 LR=new Set([`image/png`,`image/jpeg`,`image/gif`,`image/webp`]);function RR({files:e}){return e.length===0?null:(0,I.jsx)(`ul`,{className:`mt-2 flex flex-wrap gap-2`,"aria-label":`Attached files`,children:e.map(e=>(0,I.jsx)(`li`,{children:LR.has(e.mime)?(0,I.jsx)(`a`,{href:Uf(`/files/preview/attachments/${e.id}`),target:`_blank`,rel:`noopener noreferrer`,className:`block overflow-hidden rounded-lg border border-border bg-muted/40 transition-transform duration-150 ease-snap hover:scale-[1.02]`,children:(0,I.jsx)(`img`,{src:Uf(`/files/preview/attachments/${e.id}`),alt:e.name,loading:`lazy`,className:`max-h-40 max-w-56 object-cover`})}):(0,I.jsxs)(`span`,{className:`inline-flex max-w-64 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,I.jsx)(bm,{"aria-hidden":`true`,className:`size-4 shrink-0`}):(0,I.jsx)(ch,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,I.jsx)(`span`,{className:`truncate`,children:e.name})]})},e.id))})}function zR(e){return e?.type===`text`?e.value??``:(e?.children??[]).map(zR).join(``)}function BR(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}),BR(t,n)}function VR(){return e=>BR(e)}function HR(e){let[t,n]=(0,m.useState)(!1);async function r(){try{await PR(e,navigator.clipboard),n(!0),B.success(`Code copied.`)}catch{B.error(`Could not copy code. Select it and copy manually, or allow clipboard access.`)}}return{copied:t,copy:r}}function UR({text:e,children:t,block:n=!1}){let{copy:r}=HR(e),i=(0,m.useRef)(void 0);return(0,I.jsxs)(`code`,{role:`button`,tabIndex:0,"aria-label":`Copy code`,"aria-keyshortcuts":`Enter Space`,title:`Copy code · Enter / Space`,className:`cursor-copy focus-visible:outline-2 focus-visible:outline-ring`,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(),NR(window.getSelection()?.toString()??``,i.current?.moved??!1)&&r(),i.current=void 0},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),NR(window.getSelection()?.toString()??``,!1)&&r())},children:[t,n?null:(0,I.jsx)(`span`,{className:`sr-only`,children:` (activate to copy)`})]})}function WR({node:e,children:t,source:n}){let r=e,{copied:i,copy:a}=HR(MR(n,r?.position,!0)??zR(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,I.jsxs)(`div`,{className:`relative my-3 rounded-lg bg-muted`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between pl-3`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[s&&/^[\w+#.-]{1,20}$/.test(s)?s:`code`,` · tap to copy`]}),(0,I.jsx)(Y,{label:i?`Copied`:`Copy the code`,icon:i?Ap:cm,iconOnly:!0,onClick:()=>void a()})]}),(0,I.jsx)(`pre`,{className:`!my-0 overflow-x-auto !rounded-t-none !bg-transparent px-3 pb-3 text-sm leading-relaxed [&>code]:block`,children:t})]})}function GR(e){return{pre:t=>(0,I.jsx)(WR,{...t,source:e}),code:({node:t,children:n})=>{let r=t;if(r?.properties?.copyBlocked)return(0,I.jsx)(`code`,{children:n});let i=!!r?.properties?.blockCode;return(0,I.jsx)(UR,{text:MR(e,r?.position,i)??zR(r),block:i,children:n})},a:({href:e,children:t})=>(0,I.jsx)(`a`,{href:e?Uf(e):void 0,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}),img:({src:e,alt:t})=>(0,I.jsx)(`img`,{src:e?Uf(e):void 0,alt:t??``,loading:`lazy`}),table:({children:e})=>(0,I.jsx)(`div`,{className:`my-3 w-full overflow-x-auto`,children:(0,I.jsx)(`table`,{className:`w-full border-collapse text-sm`,children:e})})}}var KR=(0,m.memo)(function({text:e,className:t}){let{body:n,files:r}=IR(e);return(0,I.jsxs)(`div`,{className:q(`md-body`,t),children:[n?(0,I.jsx)(CF,{remarkPlugins:[kR],rehypePlugins:[VR],urlTransform:jR,components:GR(n),children:n}):null,(0,I.jsx)(RR,{files:r})]})});function qR({title:e,note:t,className:n,children:r,collapsed:i,onToggle:a,shortcut:o,...s}){let c=typeof e==`string`?e:`pane`;return(0,I.jsxs)(`section`,{className:q(`group/frame relative flex min-h-0 min-w-0 flex-col`,i&&`flex-none`,n),...s,children:[e||t||a?(0,I.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,I.jsx)(`h2`,{className:`min-w-0 truncate text-sm font-medium`,children:e}):(0,I.jsx)(`span`,{}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2`,children:[t?(0,I.jsx)(`span`,{className:`flex items-center gap-2 truncate text-xs text-muted-foreground`,children:t}):null,a?(0,I.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`,children:[o?(0,I.jsx)(iD,{chord:o,className:`kbd-hint`}):null,(0,I.jsx)(Mp,{"aria-hidden":`true`,className:q(`size-4 transition-transform duration-200 ease-snap`,i&&`-rotate-90`)})]}):null]})]}):null,i?null:r]})}function JR({title:e,right:t,className:n}){return(0,I.jsxs)(`span`,{className:q(`flex min-w-0 items-center gap-3`,n),children:[(0,I.jsx)(`span`,{className:`truncate font-medium`,children:e}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),t?(0,I.jsx)(`span`,{className:`shrink-0 text-xs font-normal text-muted-foreground`,children:t}):null]})}function YR({title:e,right:t,prominent:n,children:r}){return(0,I.jsxs)(`section`,{className:q(`flex flex-col`,n?`gap-3`:`gap-2.5`),children:[(0,I.jsx)(`h3`,{className:n?`text-sm text-foreground`:`text-xs text-muted-foreground`,children:(0,I.jsx)(JR,{title:e,right:t,className:n?`[&>span:first-child]:font-semibold`:void 0})}),r]})}var XR=`Pull requests`,ZR=`An agent reviews it, optionally with a focus you type; Jev's quick read sizes it up first.`,QR=`nothing is posted to GitHub`,$R=`Refresh to load open pull requests with the GitHub CLI (gh).`,ez=`No open pull requests.`,tz=`loading pull requests from GitHub…`,nz=`reading the diff…`,rz=`the pull request has new commits since this review — review it again`,iz=`(no description)`,az=`Review with a focus (optional)`,oz=`Leave it empty for a full review.`;function sz(e){return e===`passing`?`✓`:e===`failing`?`✗`:e===`pending`?`…`:``}function cz(e){return e===`passing`?`text-success`:e===`failing`?`text-destructive`:`text-muted-foreground`}function lz(e,t){return`+${e} −${t}`}function uz(e){return e===`APPROVED`?`approved`:e===`CHANGES_REQUESTED`?`changes requested`:e===`REVIEW_REQUIRED`?`review required`:``}function dz(e){return e?e.status===`running`?`reviewing`:e.status!==`done`||!e.verdict?``:e.verdict===`approve`?`approved`:e.verdict===`changes`?`changes found`:`commented`:``}function fz(e){return e===`approve`?`approve`:e===`changes`?`request changes`:e===`comment`?`comment`:``}function pz(e,t){if(e.status===`running`)return mz(e,t);if(e.status===`cancelled`)return`stopped`;let n=e.status===`done`?mz(e,t):e.status;return[fz(e.verdict),n].filter(Boolean).join(` · `)}function mz(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 hz(e,t){return[e.state?e.draft?`draft`:e.state.toLowerCase():e.draft?`draft`:``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${kO(t-Date.parse(e.updatedAt))}`:``].filter(Boolean).join(` · `)}function gz(e){let t=`${e.changedFiles} file${e.changedFiles===1?``:`s`}`;return`${e.headRef||`?`} → ${e.baseRef||`?`} · ${lz(e.additions,e.deletions)} · ${t}`}function _z(e){let t=e.mergeable===`CONFLICTING`?`conflicts`:e.mergeable===`MERGEABLE`?`mergeable`:``;return[e.checks?`checks ${e.checks} (${e.checkCount})`:``,uz(e.decision),t,e.labels.join(`, `)].filter(Boolean).join(` · `)}function vz(e){return[`${e.changedFiles} file${e.changedFiles===1?``:`s`}`,e.labels.join(`, `),e.review?.stale?`stale`:``].filter(Boolean).join(` · `)}function yz(e){return e.read?`${e.read.model} · ${e.read.ms} ms`:``}function bz(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 xz({pull:e,now:t}){return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:hz(e,t)}),(0,I.jsx)(`p`,{className:`text-sm tabular-nums`,children:gz(e)}),_z(e)?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:_z(e)}):null,e.url?(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function Sz({read:e}){return(0,I.jsxs)(YR,{title:`Jev's read`,right:yz(e),children:[e.status===`running`?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{className:`size-3.5`}),nz]}):null,e.status===`failed`?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:e.error??`Jev could not read it`}):null,e.status===`done`&&e.line?(0,I.jsx)(KR,{text:e.line}):null]})}function Cz({review:e,now:t}){return(0,I.jsxs)(I.Fragment,{children:[e.model?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:[e.model,e.thinking].filter(Boolean).join(` · `)}):null,e.focus?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`focus: `,e.focus]}):null,e.saved?(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`kept from `,kO(t-e.startedAt)]}):null,e.stale?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:rz}):null,e.status===`running`?(0,I.jsx)(wz,{steps:e.steps}):null,e.status===`cancelled`?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`stopped`}):null,e.status===`failed`||e.status===`timeout`?(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[`✗ `,e.error??e.status]}):null,e.text?(0,I.jsx)(KR,{text:e.text}):null]})}function wz({steps:e}){return(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.slice(-6).map((e,t)=>(0,I.jsxs)(`li`,{className:`break-words`,children:[`· `,e]},t))})}function Tz({number:e,focus:t,onChange:n}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(`label`,{htmlFor:`focus-${e}`,className:`text-[0.8125rem] font-medium text-foreground`,children:az}),(0,I.jsx)(wO,{id:`focus-${e}`,value:t,rows:2,maxLength:2e3,onChange:e=>n(e.target.value)}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:oz})]})}function Ez({number:e,review:t,now:n,focus:r,onFocus:i}){return(0,I.jsxs)(YR,{title:`Review`,right:t?pz(t,n):void 0,children:[t?(0,I.jsx)(Cz,{review:t,now:n}):null,(0,I.jsx)(Tz,{number:e,focus:r,onChange:i}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`A read-only agent reviews it — `,QR,`.`]})]})}function Dz({files:e}){return(0,I.jsx)(YR,{title:`Files`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`overflow-x-auto rounded-lg border border-border`,children:(0,I.jsx)(`table`,{className:`w-full border-collapse text-sm tabular-nums`,children:(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,I.jsx)(`td`,{className:`max-w-0 px-3 py-1.5 break-all`,children:e.path}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 text-right text-xs whitespace-nowrap text-muted-foreground`,children:lz(e.additions,e.deletions)})]},e.path))})})})})}function Oz({note:e,now:t}){let n=[e.state&&e.state!==`COMMENTED`?e.state.toLowerCase().replace(/_/g,` `):``,e.at?kO(t-Date.parse(e.at)):``].filter(Boolean).join(` · `);return(0,I.jsxs)(`article`,{className:`flex flex-col gap-1.5 rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),n?(0,I.jsx)(`span`,{children:n}):null]}),e.body.trim()?(0,I.jsx)(KR,{text:e.body.trim()}):null]})}function kz({notes:e,now:t}){return e.length===0?null:(0,I.jsx)(YR,{title:`Discussion`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,I.jsx)(Oz,{note:e,now:t},n))})})}function Az({number:e,error:t}){return t?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t]}):(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{className:`size-3.5`}),`loading #`,e,`…`]})}function jz({number:e,onChanged:t}){let n=zD(`git.pull`,{number:e},[`git`]),[r,i]=(0,m.useState)(``),a=n.data?.review?.status===`running`,o=bz(a);if(!n.data)return(0,I.jsx)(Az,{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 V(`git.review`,{number:e,...t?{focus:t}:{}}),u()},f=async()=>{await V(`git.jev`,{number:e}),u()},p=async()=>{await V(`git.cancelReview`,{number:e}),u()};return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Pull request #${e}`,children:[(0,I.jsxs)(lO,{children:[(0,I.jsx)(Y,{label:`Review`,icon:bh,tone:`primary`,shortcut:`V`,disabled:a,onClick:()=>void d()}),(0,I.jsx)(Y,{label:`Jev's read`,icon:Sp,shortcut:`Q`,disabled:a,onClick:()=>void f()}),a?(0,I.jsx)(BO,{icon:Xp,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,I.jsx)(xz,{pull:s,now:o}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ZR}),l?(0,I.jsx)(Sz,{read:l}):null,(0,I.jsx)(Ez,{number:e,review:c,now:o,focus:r,onFocus:i}),s.files.length>0?(0,I.jsx)(Dz,{files:s.files}):null,(0,I.jsx)(YR,{title:`Description`,children:s.body.trim()?(0,I.jsx)(KR,{text:s.body.trim()}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:iz})}),(0,I.jsx)(kz,{notes:s.notes,now:o})]})}var Mz=Cg(`group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-lg border border-transparent px-2.5 text-xs font-medium whitespace-nowrap transition-colors focus-visible:ring-[3px] focus-visible:ring-ring/40 aria-invalid:border-destructive aria-invalid:ring-destructive/20 [&>svg]:pointer-events-none [&>svg]:size-3!`,{variants:{variant:{default:`bg-accent text-foreground [a]:hover:bg-primary/20`,secondary:`bg-secondary text-secondary-foreground [a]:hover:bg-accent`,destructive:`bg-destructive/12 text-destructive [a]:hover:bg-destructive/20`,outline:`border-border text-foreground [a]:hover:bg-accent`,ghost:`hover:bg-accent hover:text-foreground`,link:`text-link underline-offset-4 hover:underline`}},defaultVariants:{variant:`default`}});function Nz({className:e,variant:t=`default`,asChild:n=!1,...r}){let i=n?rv:`span`;return(0,I.jsx)(i,{"data-slot":`badge`,"data-variant":t,className:q(Mz({variant:t}),e),...r})}var Pz=`flex min-h-10 w-full flex-col gap-0.5 rounded-lg px-2.5 py-2 text-left outline-none transition-colors duration-150 hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring/40 aria-[current=true]:bg-accent`,Fz=`flex flex-col gap-0.5 px-2 pb-2`,Iz=`px-4 pt-4 pb-1 text-xs font-medium text-muted-foreground`;function Lz({checks:e}){let t=sz(e);return t?(0,I.jsx)(`span`,{className:q(`w-4 shrink-0 text-center`,cz(e)),"aria-hidden":`true`,children:t}):(0,I.jsx)(`span`,{className:`w-4 shrink-0`,"aria-hidden":`true`})}function Rz({pull:e,selected:t,onSelect:n}){let r=dz(e.review);return(0,I.jsx)(`li`,{children:(0,I.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:Pz,children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,I.jsx)(Lz,{checks:e.checks}),e.draft?(0,I.jsx)(Nz,{variant:`secondary`,children:`draft`}):null,(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title})]}),(0,I.jsxs)(`span`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:vz(e)}),(0,I.jsxs)(`span`,{className:`flex items-baseline gap-2`,children:[r?(0,I.jsx)(`span`,{children:r}):null,(0,I.jsx)(`span`,{className:`tabular-nums`,children:lz(e.additions,e.deletions)})]})]})]})})}function zz({pulls:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`ul`,{className:Fz,children:e.map(e=>(0,I.jsx)(Rz,{pull:e,selected:e.number===t,onSelect:n},e.number))})}var Bz=()=>CD(SD(`git`)),Vz=e=>CD(SD(`git`,String(e)));function Hz(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function Uz({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?ez:e?tz:$R;return(0,I.jsxs)(TD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(wm,{"aria-hidden":`true`})}),(0,I.jsx)(AD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,I.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function Wz({rest:e}){let t=vO(),n=zD(`git.pulls`,{},[`git`]),r=Hz(e),i=n.data?.pulls??[],a=(0,m.useCallback)(()=>{V(`git.pulls`,{refresh:!0}).then(()=>n.reload())},[n]);if(!n.data&&n.error)return(0,I.jsx)(ND,{message:`Could not load pull requests. ${n.error}`,onRetry:n.reload});if(n.data&&i.length===0)return(0,I.jsx)(Uz,{loading:n.data.loading,loaded:n.data.loaded,error:n.data.error,onRetry:n.reload});let o=n.loading||!!n.data?.loading,s=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:XR,count:n.data?`${i.length} open`:void 0,children:(0,I.jsx)(Y,{label:`Refresh`,icon:wh,shortcut:`R`,disabled:o,className:q(`h-7`,o&&`[&_svg]:animate-spin`),onClick:a})}),n.data?.error?(0,I.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,n.data.error]}):null,n.data?(0,I.jsx)(zz,{pulls:i,selectedId:r,onSelect:Vz}):(0,I.jsx)(CO,{})]}),c=r===void 0?null:(0,I.jsx)(jz,{number:r,onChanged:n.reload},r);return(0,I.jsx)(xO,{wide:t,list:s,detail:c,open:r!==void 0,onClose:Bz,hint:`Select a pull request to see its detail.`,describe:`Pull request detail`})}function Gz(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function Kz({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,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`label`,{htmlFor:i,className:`text-sm font-medium text-foreground`,children:e}),(0,I.jsx)(wO,{id:i,value:a,rows:2,"aria-describedby":t?`${i}-hint`:void 0,onChange:e=>o(e.target.value),onKeyDown:e=>{Gz(e)&&(e.preventDefault(),l())}}),t?(0,I.jsx)(`p`,{id:`${i}-hint`,className:`text-xs text-muted-foreground`,children:t}):null,(0,I.jsx)(`div`,{className:`flex self-end`,children:(0,I.jsx)(Y,{label:n,icon:s?Rm:bp,tone:`primary`,shortcut:`Enter`,className:s?`[&_svg]:animate-spin`:void 0,onClick:()=>void l(),disabled:!a.trim()||s})})]})}var qz=`Issues`,Jz=`Issue`,Yz=`p plans it with the planning panel, then save it as a task`,Xz=`Refresh to load open issues with the GitHub CLI (gh).`,Zz=`No open issues. File one with New issue.`,Qz=`loading issues from GitHub…`,$z=`issues are off (lobby.issues)`,eB=`(no description)`;function tB(e,t){return[e.state?e.state.toLowerCase():``,e.author?`by ${e.author}`:``,e.updatedAt?`updated ${kO(t-Date.parse(e.updatedAt))}`:``,e.labels.join(`, `)].filter(Boolean).join(` · `)}function nB(e,t){return[e.author?`by ${e.author}`:``,e.updatedAt?kO(t-Date.parse(e.updatedAt)):``].filter(Boolean).join(` · `)}function rB(e){return e.length>0?`[${e.slice(0,2).join(`, `)}]`:``}function iB({issue:e,now:t}){return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:[(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground tabular-nums`,children:[`#`,e.number]}),` `,e.title]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:tB(e,t)}),e.url?(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer nofollow`,className:`text-xs break-all text-primary underline underline-offset-4`,children:e.url}):null]})}function aB({comment:e,now:t}){return(0,I.jsxs)(`article`,{className:`flex flex-col gap-1.5 rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.author??`comment`}),e.createdAt?(0,I.jsx)(`span`,{children:kO(t-Date.parse(e.createdAt))}):null]}),(0,I.jsx)(KR,{text:e.body.trim()})]})}function oB({comments:e,now:t}){return e.length===0?null:(0,I.jsx)(YR,{title:`Comments`,right:String(e.length),children:(0,I.jsx)(`div`,{className:`flex flex-col gap-3`,children:e.map((e,n)=>(0,I.jsx)(aB,{comment:e,now:t},n))})})}function sB({number:e}){let t=zD(`issues.get`,{number:e},[`issues`]),n=Date.now();if(!t.data)return t.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load #`,e,`. `,t.error]}):(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{className:`size-3.5`}),`loading #`,e,`…`]});let r=t.data.issue;return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${Jz} #${e}`,children:[(0,I.jsx)(iB,{issue:r,now:n}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Yz}),(0,I.jsx)(YR,{title:`Description`,children:r.body.trim()?(0,I.jsx)(KR,{text:r.body.trim()}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:eB})}),(0,I.jsx)(oB,{comments:r.comments,now:n})]})}function cB({issue:e,selected:t,now:n,onSelect:r}){let i=rB(e.labels);return(0,I.jsx)(`li`,{children:(0,I.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:Pz,children:[(0,I.jsxs)(`span`,{className:`flex flex-wrap items-start gap-2 text-sm`,children:[(0,I.jsxs)(`span`,{className:`shrink-0 text-muted-foreground tabular-nums`,children:[`#`,e.number]}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.title}),i?(0,I.jsx)(`span`,{className:`max-w-full break-words text-xs text-muted-foreground`,children:i}):null]}),(0,I.jsx)(`span`,{className:`pl-9 text-xs text-muted-foreground`,children:nB(e,n)})]})})}function lB({issues:e,selectedId:t,now:n,onSelect:r}){return(0,I.jsx)(`ul`,{className:Fz,children:e.map(e=>(0,I.jsx)(cB,{issue:e,selected:e.number===t,now:n,onSelect:r},e.number))})}var uB=()=>CD(SD(`issues`)),dB=e=>CD(SD(`issues`,String(e)));function fB(e){let t=Number(e[0]);return Number.isInteger(t)&&t>0?t:void 0}function pB(){return(0,I.jsx)(TD,{className:`m-4 flex-1`,children:(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(Kp,{"aria-hidden":`true`})}),(0,I.jsx)(kD,{children:`Issues are off`}),(0,I.jsx)(AD,{className:`font-mono`,children:$z})]})})}function mB({loading:e,loaded:t,error:n,onRetry:r}){let i=n?`✗ ${n}`:t?Zz:e?Qz:Xz;return(0,I.jsxs)(TD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(Kp,{"aria-hidden":`true`})}),(0,I.jsx)(AD,{className:n?`text-destructive`:void 0,children:i})]}),n?(0,I.jsx)(J,{variant:`outline`,onClick:r,children:`Retry`}):null]})}function hB({onCreate:e}){return(0,I.jsx)(yO,{className:`shrink-0 border-t border-border p-4`,children:(0,I.jsx)(Kz,{label:`New issue`,hint:`The first line becomes the title; the rest is the body. Enter files it.`,buttonLabel:`File issue`,onSend:e})})}function gB({rest:e}){let t=vO(),n=LD(`status`).data?.issuesEnabled??!0,r=zD(`issues.list`,{},[`issues`],n),i=fB(e),a=r.data?.issues??[],o=Date.now(),s=(0,m.useCallback)(()=>{V(`issues.list`,{refresh:!0}).then(()=>r.reload())},[r]),c=async e=>await V(`issues.create`,{text:e})?(r.reload(),!0):!1;if(!n)return(0,I.jsx)(pB,{});if(!r.data&&r.error)return r.error.includes(`issues are off`)?(0,I.jsx)(pB,{}):(0,I.jsx)(ND,{message:`Could not load issues. ${r.error}`,onRetry:r.reload});let l=r.loading||!!r.data?.loading,u=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:qz,count:r.data?`${a.length} open`:void 0,children:(0,I.jsx)(Y,{label:`Refresh`,icon:wh,shortcut:`R`,disabled:l,className:q(`h-7`,l&&`[&_svg]:animate-spin`),onClick:s})}),r.data?.error?(0,I.jsxs)(`p`,{className:`px-3 pt-2 text-sm text-destructive`,children:[`✗ `,r.data.error]}):null,r.data?(0,I.jsx)(lB,{issues:a,selectedId:i,now:o,onSelect:dB}):(0,I.jsx)(CO,{}),(0,I.jsx)(hB,{onCreate:c})]}),d=i===void 0?null:(0,I.jsx)(sB,{number:i},i),f=r.data&&a.length===0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(mB,{loading:r.data.loading,loaded:r.data.loaded,error:r.data.error,onRetry:r.reload}),(0,I.jsx)(`div`,{className:`shrink-0 pb-dock`,children:(0,I.jsx)(hB,{onCreate:c})})]}):(0,I.jsx)(xO,{wide:t,list:u,detail:d,open:i!==void 0,onClose:uB,hint:`Select an issue to read it.`,describe:`Issue detail`});return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:f})}var _B=[`master`,`designer`,`backend`,`qa`],vB={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`},yB={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`},bB=`Every write archives the version before it.`;function xB(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}function SB(e){return`over the compaction threshold — ask the oracle to compact ${e}`}function CB(e){return{text:e.text,occurrence:e.occurrence}}function wB(e){return _B.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 TB(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function EB({initial:e,busy:t,onSave:n,onCancel:r}){let[i,a]=(0,m.useState)(e),o=()=>{!t&&i.trim()&&n(i)};return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border border-input p-3`,children:[(0,I.jsx)(`label`,{htmlFor:`knowledge-entry`,className:`text-sm font-medium text-foreground`,children:`Edit entry`}),(0,I.jsx)(wO,{id:`knowledge-entry`,value:i,rows:4,autoFocus:!0,onChange:e=>a(e.target.value),onKeyDown:e=>{TB(e)&&(e.preventDefault(),o())}}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:bB}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:r,disabled:t,children:`Cancel`}),(0,I.jsxs)(J,{onClick:o,disabled:t||!i.trim(),children:[t?(0,I.jsx)(jD,{}):null,`Save`]})]})]})]})}function DB({open:e,file:t,initial:n,busy:r,onClose:i,onSave:a}){let[o,s]=(0,m.useState)(n),c=mD(e,pD.confirm);return(0,I.jsx)(oD,{open:e&&c,onOpenChange:e=>!e&&i(),label:`Edit ${t}`,description:bB,dismissOnBackdrop:!1,className:`max-w-3xl`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsxs)(`h2`,{className:`text-base font-medium`,children:[`Edit `,t]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:bB})]}),(0,I.jsx)(wO,{value:o,rows:14,className:`min-h-0 flex-1 font-mono text-sm`,onChange:e=>s(e.target.value)}),(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:i,disabled:r,children:`Cancel`}),(0,I.jsxs)(J,{onClick:()=>a(o),disabled:r,children:[r?(0,I.jsx)(jD,{}):null,`Save file`]})]})]})})}function OB({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,I.jsxs)(`li`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(mh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-primary`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:i}),(0,I.jsx)(Y,{label:`Take the note back`,icon:ig,iconOnly:!0,className:`-my-1 size-7`,disabled:r,onClick:()=>n(e.id)})]})}function kB({entry:e,index:t,selected:n,notes:r,onPick:i,onTakeBack:a,busy:o}){let s=()=>i(t);return(0,I.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`:`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`,children:[(0,I.jsx)(`div`,{className:`flex gap-2`,children:(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(KR,{text:e.text})})}),r.length>0?(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 pl-1`,children:r.map(e=>(0,I.jsx)(OB,{note:e,onTakeBack:a,busy:o},e.id))}):null]})}function AB({notes:e,onTakeBack:t,busy:n}){return e.length===0?null:(0,I.jsx)(YR,{title:`Notes on entries that changed`,right:String(e.length),children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1`,children:e.map(e=>(0,I.jsx)(OB,{note:e,about:e.entry,onTakeBack:t,busy:n},e.id))})})}function jB({view:e}){let t=e.entries.length;return(0,I.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:[yB[e.agent],` `,(0,I.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`· `,e.file]})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t,` `,t===1?`entry`:`entries`,` · `,xB(e.chars),` chars`]}),e.over?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:SB(e.file)}):null]})}function MB({draft:e,picked:t,setDraft:n,onEditFile:r,onDelete:i}){let a=!!e;return(0,I.jsxs)(lO,{children:[(0,I.jsx)(Y,{label:`Edit the entry`,text:`Edit`,icon:vh,shortcut:`E`,disabled:a||!t,onClick:()=>n({kind:`edit`,entry:t})}),(0,I.jsx)(Y,{label:t?`Add an entry after it`:`Add an entry`,text:`Add`,icon:Sh,shortcut:`A`,disabled:a,onClick:()=>n({kind:`add`,entry:t})}),(0,I.jsx)(Y,{label:`Comment on the entry`,text:`Comment`,icon:Wm,shortcut:`C`,disabled:a||!t,onClick:()=>n({kind:`comment`,entry:t})}),(0,I.jsx)(Y,{label:`Edit the whole file`,text:`Edit file`,icon:gm,shortcut:`F`,disabled:a,onClick:r}),(0,I.jsx)(BO,{icon:eg,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 NB({agent:e,file:t,onChanged:n}){let r=zD(`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(()=>V(`knowledge.unnote`,{id:e})),v=()=>{h&&g(()=>V(`knowledge.remove`,{agent:e,file:t,ref:CB(h)}))},y=n=>{let r=o?.entry;if(o?.kind===`edit`&&r)return void g(()=>V(`knowledge.edit`,{agent:e,file:t,ref:CB(r),text:n}));if(o?.kind===`comment`&&r)return void g(()=>V(`knowledge.comment`,{agent:e,file:t,ref:CB(r),text:n}));g(()=>V(`knowledge.add`,{agent:e,file:t,...h?{ref:CB(h)}:{},text:n}))};return f?(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`${yB[e]} ${t}`,children:[(0,I.jsx)(MB,{draft:o,picked:h,setDraft:s,onEditFile:()=>l(!0),onDelete:v}),(0,I.jsx)(jB,{view:f}),p.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing here yet. Add the first entry below.`}):null,(0,I.jsx)(`ul`,{className:`flex flex-col gap-2`,children:p.map((e,t)=>(0,I.jsx)(kB,{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,I.jsx)(EB,{initial:o.entry.text,busy:u,onSave:y,onCancel:()=>s(void 0)}):null,o?.kind===`comment`?(0,I.jsx)(Kz,{label:`Comment on this entry`,hint:bB,buttonLabel:`Add note`,onSend:async e=>(y(e),!0)}):null,o?.kind===`add`?(0,I.jsx)(Kz,{label:`Add an entry`,hint:bB,buttonLabel:`Add entry`,onSend:async e=>(y(e),!0)}):null,u&&!o?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{}),` saving…`]}):null,(0,I.jsx)(AB,{notes:f.detached,onTakeBack:_,busy:u}),(0,I.jsx)(DB,{open:c,file:t,initial:f.content,busy:u,onClose:()=>l(!1),onSave:n=>{l(!1),g(()=>V(`knowledge.replaceFile`,{agent:e,file:t,text:n}))}})]}):r.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not read the file. `,r.error]}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`reading…`})}function PB(e){return`${e.agent}/${e.file}`}function FB({info:e}){return(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground tabular-nums`,children:[(0,I.jsx)(`span`,{children:xB(e.chars)}),e.over?(0,I.jsx)(`span`,{className:`text-foreground`,children:`· over`}):null,e.notes>0?(0,I.jsxs)(`span`,{className:`text-primary`,children:[e.notes,` note`,e.notes===1?``:`s`]}):null]})}function IB({info:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,"data-row":!0,"aria-current":t?`true`:void 0,onClick:()=>n(PB(e)),className:q(Pz,`min-h-9 flex-row items-center justify-between gap-3 py-1.5`),children:[(0,I.jsx)(`span`,{className:q(`min-w-0 truncate text-sm text-foreground`,t&&`font-medium`),children:e.label}),(0,I.jsx)(FB,{info:e})]})})}var LB={master:Ep,designer:ih,backend:Ih,qa:Bh},RB=`bot-lobby.knowledge.folded`;function zB(){try{let e=JSON.parse(window.localStorage.getItem(RB)??`[]`);return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}catch{return[]}}function BB({files:e,selectedKey:t,onSelect:n}){let[r,i]=(0,m.useState)(zB);function a(e,t){i(n=>{let r=t?n.filter(t=>t!==e):[...new Set([...n,e])];try{window.localStorage.setItem(RB,JSON.stringify(r))}catch{}return r})}return(0,I.jsx)(`div`,{className:`flex flex-col gap-0.5 px-2 pb-2`,children:wB(e).map(e=>{let i=!r.includes(e.agent),o=LB[e.agent],s=`knowledge-${e.agent}`;return(0,I.jsxs)(`section`,{children:[(0,I.jsx)(`h3`,{children:(0,I.jsxs)(`button`,{"aria-keyshortcuts":`Enter Space ArrowLeft ArrowRight`,"aria-describedby":`focused-action-help`,type:`button`,"aria-expanded":i,"aria-controls":s,onClick:()=>a(e.agent,!i),onKeyDown:t=>{t.key===`ArrowLeft`||t.key===`h`?(t.preventDefault(),t.stopPropagation(),a(e.agent,!1)):(t.key===`ArrowRight`||t.key===`l`)&&(t.preventDefault(),t.stopPropagation(),i||a(e.agent,!0))},className:`mt-1 flex h-8 w-full items-center gap-2 rounded-lg px-2.5 text-left text-xs font-medium text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/40`,children:[(0,I.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 transition-transform duration-200 ease-snap`,i&&`rotate-90`)}),(0,I.jsx)(o,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,I.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:vB[e.agent]}),e.notes>0?(0,I.jsxs)(`span`,{className:`shrink-0 font-normal text-primary tabular-nums`,children:[e.notes,` note`,e.notes===1?``:`s`]}):null]})}),(0,I.jsx)(nu,{initial:!1,children:i?(0,I.jsx)(z.ul,{id:s,initial:{height:0,opacity:0},animate:{height:`auto`,opacity:1},exit:{height:0,opacity:0},transition:{type:`spring`,stiffness:520,damping:42},className:`flex flex-col gap-0.5 overflow-hidden pl-3`,children:e.files.map(e=>(0,I.jsx)(IB,{info:e,selected:PB(e)===t,onSelect:n},PB(e)))},`files`):null})]},e.agent)})})}var VB=()=>CD(SD(`knowledge`)),HB=e=>{let[t,n]=e.split(`/`);CD(SD(`knowledge`,t??``,n??``))};function UB(){return(0,I.jsx)(TD,{className:`m-4 flex-1`,children:(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(Sp,{"aria-hidden":`true`})}),(0,I.jsx)(AD,{children:`No knowledge files yet.`})]})})}function WB(e,t,n,r){let i=e.find(e=>e.agent===t&&e.file===n);return i?(0,I.jsx)(NB,{agent:i.agent,file:i.file,onChanged:r},PB(i)):t&&n?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That file is not on the list any more.`}):null}function GB({agent:e,file:t}){let n=vO(),r=zD(`knowledge.files`,{},[`knowledge`]),i=r.data?.files??[];if(!r.data&&r.error)return(0,I.jsx)(ND,{message:`Could not load the knowledge files. ${r.error}`,onRetry:r.reload});if(r.data&&i.length===0)return(0,I.jsx)(UB,{});let a=i.reduce((e,t)=>e+t.notes,0),o=i.find(n=>n.agent===e&&n.file===t),s=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:`Knowledge`,count:a>0?`${a} note${a===1?``:`s`}`:void 0}),r.data?(0,I.jsx)(BB,{files:i,selectedKey:o?PB(o):void 0,onSelect:HB}):(0,I.jsx)(CO,{})]});return(0,I.jsx)(xO,{wide:n,list:s,detail:WB(i,e,t,r.reload),open:!!(e&&t),onClose:VB,hint:`Select a file to read its entries.`,describe:`Knowledge file`})}function KB({className:e,...t}){return(0,I.jsx)(jS,{"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,I.jsx)(NS,{"data-slot":`checkbox-indicator`,className:`flex items-center justify-center`,children:(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3`,strokeWidth:3})})})}var qB=`Sessions`,JB=`No sessions yet.`,YB=`Up to 5 sessions; each can be assigned to one agent or several.`,XB=`A session is a live Excalidraw room that you and your agents draw in together.`,ZB=[{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.`}],QB=`Sessions`,$B=`Pick a session on the left to see its link, its room and its agents.`,eV=`Room link`,tV=`Masked until revealed. A revealed link stays in this tab and is never saved.`,nV=`Room`,rV=`Drawing`,iV=`Last check`,aV=`not checked yet`,oV=`Add a session`,sV=`https://excalidraw.com/#room=…`,cV=`Optional name`;function lV(e){return`${e} of 5 in use`}var uV=`Agents may draw here.`,dV=`Agents may only look.`,fV=`checking the room…`,pV=`Check that the room can be reached.`,mV=`Assigned to`,hV=`Assigned agents read the board and draw on it with excalidraw_read and excalidraw_draw, and appear in the room under their own name.`,gV=`Add or rename`,_V=`Add by link`,vV=`In Excalidraw, Share → Live collaboration → Start session, then paste the link. Enter adds it.`,yV=`New room`,bV=`Makes a fresh room link to open in Excalidraw; the name is optional.`,xV=`Rename`,SV=`draw`,CV=`look only`,wV=`Copied to the clipboard`,TV=`Could not reveal the link.`,EV=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],DV={master:`Master (oracle)`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scouts`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`};function OV(e){return e===0?`no agents`:`${e} agent${e===1?``:`s`}`}function kV(e){return e?e.ok?`✓`:`!`:``}function AV({title:e,right:t,className:n,children:r}){return(0,I.jsxs)(`section`,{className:q(`flex min-w-0 flex-col gap-3 rounded-xl border border-border bg-card p-4`,n),children:[(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:e}),t?(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground tabular-nums`,children:t}):null]}),r]})}function jV({row:e=!1}){return(0,I.jsx)(`ol`,{className:q(`grid gap-3`,e&&`@2xl:grid-cols-3`),children:ZB.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex gap-3 rounded-xl border border-border bg-card p-3.5`,children:[(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:e.title}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})}function MV({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,I.jsxs)(`form`,{className:`flex min-w-0 flex-col gap-2`,onSubmit:e=>{e.preventDefault(),g()},children:[(0,I.jsx)(`label`,{htmlFor:l,className:`text-xs font-medium text-muted-foreground`,children:e}),(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.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`,o&&`font-mono text-[0.8125rem]`)}),(0,I.jsx)(Y,{type:`submit`,label:n,icon:f?Rm:Sh,tone:s?`primary`:`neutral`,shortcut:`Enter`,disabled:h||f,className:f?`[&_svg]:animate-spin`:void 0})]}),t?(0,I.jsx)(`p`,{id:`${l}-hint`,className:`text-xs leading-relaxed text-muted-foreground`,children:t}):null]})}function NV({onChanged:e,primary:t}){return(0,I.jsx)(MV,{label:_V,hint:vV,buttonLabel:`Add`,placeholder:sV,required:!0,mono:!0,primary:t,onSubmit:async t=>await V(`excalidraw.add`,{link:t.trim()})?(e(),!0):!1})}function PV({onChanged:e,primary:t}){return(0,I.jsx)(MV,{label:yV,hint:bV,buttonLabel:`Create`,placeholder:cV,primary:t,onSubmit:async t=>{let n=t.trim();return await V(`excalidraw.create`,n?{name:n}:{})?(e(),!0):!1}})}function FV({onChanged:e,stacked:t=!1}){return(0,I.jsxs)(`div`,{className:q(`grid gap-4`,!t&&`@2xl:grid-cols-2`),children:[(0,I.jsx)(NV,{onChanged:e,primary:!0}),(0,I.jsx)(PV,{onChanged:e,primary:!0})]})}function IV({session:e,onChanged:t}){return(0,I.jsx)(MV,{label:xV,initial:e.name,required:!0,buttonLabel:xV,onSubmit:async n=>await V(`excalidraw.rename`,{id:e.id,name:n.trim()})?(t(),!0):!1},e.name)}function LV({icon:e,tone:t=`muted`,children:n}){return(0,I.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,I.jsx)(e,{"aria-hidden":`true`,className:`size-3.5`}),n]})}function RV({check:e,checking:t}){return t?(0,I.jsx)(LV,{icon:Rm,children:fV}):e?e.ok?(0,I.jsx)(LV,{icon:Hp,tone:`primary`,children:`reachable`}):(0,I.jsx)(LV,{icon:Bp,tone:`warning`,children:`unreachable`}):(0,I.jsx)(LV,{icon:Wp,children:aV})}function zV({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`grid grid-cols-[6rem_minmax(0,1fr)] items-baseline gap-3 text-sm`,children:[(0,I.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsx)(`dd`,{className:`min-w-0`,children:t})]})}function BV({check:e,checking:t}){return t?(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-muted-foreground`,children:[(0,I.jsx)(jD,{className:`size-3.5`,"aria-hidden":`true`}),fV]}):e?(0,I.jsxs)(`span`,{className:e.ok?`text-primary`:`text-foreground`,children:[e.ok?`✓`:`!`,` `,e.text]}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:pV})}function VV({agent:e,on:t,onToggle:n}){return(0,I.jsx)(`li`,{children:(0,I.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]`,t?`border-primary/25 bg-accent text-foreground`:`border-border text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,I.jsx)(KB,{checked:t,onCheckedChange:()=>n(e)}),(0,I.jsx)(`span`,{className:`truncate`,children:DV[e]})]})})}function HV({session:e,onChanged:t}){let n=async n=>{await V(`excalidraw.toggleAgent`,{id:e.id,agent:n})&&t()},r=async()=>{await V(`excalidraw.toggleAll`,{id:e.id})&&t()},i=e.agents.length===EV.length;return(0,I.jsxs)(AV,{title:mV,right:OV(e.agents.length),children:[(0,I.jsx)(`ul`,{className:`grid grid-cols-1 gap-1.5 @md:grid-cols-2`,children:EV.map(t=>(0,I.jsx)(VV,{agent:t,on:e.agents.includes(t),onToggle:n},t))}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`min-w-0 flex-1 text-xs leading-relaxed text-muted-foreground`,children:hV}),(0,I.jsx)(Y,{label:i?`Take every agent off`:`Assign every agent`,icon:Pm,onClick:()=>void r()})]})]})}function UV({session:e,check:t,checking:n,onCheck:r,onChanged:i,onRemove:a}){let[o,s]=(0,m.useState)(),c=async()=>{try{s((await qf(`excalidraw.reveal`,{id:e.id})).link)}catch(e){B.error(e instanceof Error?e.message:TV)}},l=()=>void navigator.clipboard?.writeText(o??``).then(()=>B(wV)).catch(()=>void 0),u=async()=>{await V(`excalidraw.toggleContribute`,{id:e.id})&&i()};return(0,I.jsxs)(`article`,{"aria-label":`Session detail`,className:`@container flex flex-col gap-4`,children:[(0,I.jsxs)(lO,{children:[o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Y,{label:`Copy the link`,text:`Copy`,icon:cm,shortcut:`C`,onClick:l}),(0,I.jsx)(Y,{label:`Open board`,icon:fm,tone:`primary`,shortcut:`O`,href:o})]}):(0,I.jsx)(Y,{label:`Reveal the link`,text:`Reveal`,icon:mm,shortcut:`R`,onClick:()=>void c()}),(0,I.jsx)(Y,{label:e.contribute?`Look only: agents stop drawing`:`Let agents draw`,text:e.contribute?`Look only`:`Let agents draw`,icon:e.contribute?gh:vh,shortcut:`W`,pressed:e.contribute,onClick:()=>void u()}),(0,I.jsx)(Y,{label:`Check the room`,text:`Check`,icon:n?Rm:Bh,shortcut:`T`,disabled:n,onClick:r}),(0,I.jsx)(BO,{icon:eg,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,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:e.name}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[(0,I.jsx)(LV,{icon:e.contribute?vh:mm,tone:e.contribute?`primary`:`muted`,children:e.contribute?SV:CV}),(0,I.jsx)(LV,{icon:cg,children:OV(e.agents.length)}),(0,I.jsx)(RV,{check:t,checking:n})]})]}),(0,I.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-4`,children:[(0,I.jsxs)(AV,{title:eV,children:[(0,I.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,I.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:tV})]}),(0,I.jsx)(AV,{title:nV,children:(0,I.jsxs)(`dl`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(zV,{label:rV,children:(0,I.jsx)(`span`,{className:e.contribute?`text-primary`:`text-muted-foreground`,children:e.contribute?uV:dV})}),(0,I.jsx)(zV,{label:iV,children:(0,I.jsx)(BV,{check:t,checking:n})})]})})]}),(0,I.jsx)(HV,{session:e,onChanged:i})]}),(0,I.jsx)(AV,{title:gV,children:(0,I.jsxs)(`div`,{className:`grid gap-4 @3xl:grid-cols-3`,children:[(0,I.jsx)(IV,{session:e,onChanged:i}),(0,I.jsx)(NV,{onChanged:i}),(0,I.jsx)(PV,{onChanged:i})]})})]})}function WV({check:e,checking:t}){if(t)return(0,I.jsx)(jD,{className:`size-3.5 shrink-0 text-muted-foreground`});let n=kV(e);return n?(0,I.jsx)(`span`,{className:q(`w-3.5 shrink-0 text-center`,e?.ok?`text-primary`:`text-foreground`),"aria-hidden":`true`,children:n}):(0,I.jsx)(`span`,{className:`w-3.5 shrink-0`,"aria-hidden":`true`})}function GV({session:e,check:t,checking:n,selected:r,onSelect:i}){return(0,I.jsx)(`li`,{children:(0,I.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:Pz,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-sm`,children:[(0,I.jsx)(WV,{check:t,checking:n}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,r&&`font-medium`),children:e.name}),(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:OV(e.agents.length)})]}),(0,I.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 pl-[1.375rem] text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-mono break-all`,children:e.masked}),(0,I.jsx)(Nz,{variant:`secondary`,children:e.contribute?SV:CV})]})]})})}function KV({sessions:e,checks:t,checking:n,selectedId:r,onSelect:i}){return(0,I.jsx)(`ul`,{className:Fz,children:e.map(e=>(0,I.jsx)(GV,{session:e,check:t[e.id],checking:n.includes(e.id),selected:e.id===r,onSelect:i},e.id))})}var qV=()=>CD(SD(`excalidraw`)),JV=e=>CD(SD(`excalidraw`,e));function YV({count:e}){return(0,I.jsxs)(`span`,{className:`flex items-center gap-2.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:5},(t,n)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-5 rounded-full`,n<e?`bg-primary`:`bg-border`)},n))}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:lV(e)})]})}function XV({count:e,onChanged:t}){return(0,I.jsxs)(`div`,{className:`@container flex max-w-4xl flex-col gap-5`,children:[(0,I.jsxs)(`header`,{className:`flex flex-wrap items-end justify-between gap-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:QB}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$B})]}),(0,I.jsx)(YV,{count:e})]}),(0,I.jsx)(jV,{row:!0}),e<5?(0,I.jsx)(AV,{title:oV,children:(0,I.jsx)(FV,{onChanged:t})}):null,(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-4`,children:[(0,I.jsx)(aD,{chord:`ArrowDown`,children:`next session`}),(0,I.jsx)(aD,{chord:`ArrowRight`,children:`into its detail`})]})]})}function ZV({onChanged:e}){return(0,I.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-10 pb-dock sm:px-8`,children:(0,I.jsxs)(`div`,{className:`mx-auto grid max-w-5xl gap-8 @4xl:grid-cols-[minmax(0,1fr)_minmax(0,24rem)]`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-11 place-items-center rounded-xl border border-border bg-card text-primary shadow-card`,children:(0,I.jsx)(fh,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:JB}),(0,I.jsx)(`p`,{className:`max-w-prose text-sm leading-relaxed text-muted-foreground`,children:XB})]}),(0,I.jsx)(jV,{}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:YB})]}),(0,I.jsx)(AV,{title:oV,className:`self-start`,children:(0,I.jsx)(FV,{onChanged:e,stacked:!0})})]})})}function QV({id:e}){let t=vO(),n=zD(`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 V(`excalidraw.check`,{id:e});o(t=>t.filter(t=>t!==e)),t&&i(n=>({...n,[e]:t}))},u=async()=>{c&&await V(`excalidraw.remove`,{id:c.id})&&(n.reload(),qV())};if(!n.data&&n.error)return(0,I.jsx)(ND,{message:`Could not load sessions. ${n.error}`,onRetry:n.reload});if(n.data&&s.length===0)return(0,I.jsx)(ZV,{onChanged:n.reload});let d=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:qB,count:n.data?`${s.length}/5`:void 0}),n.data?(0,I.jsx)(KV,{sessions:s,checks:r,checking:a,selectedId:e,onSelect:JV}):(0,I.jsx)(CO,{})]}),f=c?(0,I.jsx)(UV,{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,I.jsx)(XV,{count:s.length,onChanged:n.reload}):null;return(0,I.jsx)(xO,{wide:t,list:d,detail:f,open:c!==void 0,onClose:qV,hint:`Select a session to see its link and agents.`,describe:`Session detail`})}function $V(e,t){return e===`lobby.thinking`||t===`1`}var eH=`bot-lobby.collapsed.`,tH=new Set,nH=new Map;function rH(e){if(nH.has(e))return nH.get(e);if(e===`lobby.thinking`)return $V(e);try{return $V(e,localStorage.getItem(eH+e))}catch{return!1}}function iH(e,t){nH.set(e,t);try{e!==`lobby.thinking`&&localStorage.setItem(eH+e,t?`1`:`0`)}catch{}for(let e of[...tH])e()}function aH(e){return tH.add(e),()=>{tH.delete(e)}}function oH(e){iH(e,!rH(e))}function sH(e){return[(0,m.useSyncExternalStore)(aH,()=>rH(e),()=>$V(e)),(0,m.useCallback)(()=>iH(e,!rH(e)),[e])]}function cH(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 lH={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 uH(e){return e.length<=2?e:e.charAt(0)+e.slice(1).toLowerCase()}function dH(e){return lH[e]??`text-muted-foreground`}var fH={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 pH(e){return fH[e]??`var(--muted-foreground)`}function mH(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 hH(e){return e?.runs??[]}function gH(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 _H({entry:e}){return e.pending?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):e.kind===`error`?(0,I.jsx)(gg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):e.kind===`warning`?(0,I.jsx)(ng,{"aria-hidden":`true`,className:`size-3.5 text-warning`}):e.kind===`success`?(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3.5 text-success`}):(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}function vH({entry:e}){return(0,I.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,I.jsx)(`span`,{className:`text-xs tabular-nums text-muted-foreground`,children:EO(e.at)}),(0,I.jsx)(`span`,{className:q(`overflow-hidden text-xs font-medium whitespace-nowrap`,dH(e.source)),children:uH(e.source)}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center self-center`,children:(0,I.jsx)(_H,{entry:e})}),(0,I.jsx)(`span`,{className:`sr-only`,children:e.pending?`pending`:e.kind}),(0,I.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 yH({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}=cH(JSON.stringify(a));return(0,I.jsxs)(qR,{"aria-label":`Activity`,...i?{}:{title:`Activity`},collapsed:t,...n?{onToggle:n}:{},shortcut:r,className:`flex-1`,note:o?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),` `,o,` running`]}):void 0,children:[(0,I.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,I.jsx)(`p`,{className:`px-2 py-1 text-sm text-muted-foreground`,children:`No activity yet.`}):(0,I.jsx)(`ul`,{children:a.map(e=>(0,I.jsx)(vH,{entry:e},e.id))})}),c?null:(0,I.jsx)(`div`,{className:`absolute inset-x-0 bottom-dock z-10 flex justify-center`,children:(0,I.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,className:`rounded-full bg-card shadow-card`,onClick:l})})]})}var bH={DEV:im,DESIGN:ih,QA:Bh,RESEARCH:Qh,"QUICK FIX":vg,SCOUT:om,PLANNER:Ah,CLASSIFIER:Xh,LOBBY:Jm};function xH(e){return e?bH[e.toUpperCase()]??wp:Ep}function SH(e){let t=e?.toUpperCase();return t===`ORACLE`||t===`MASTER`}function CH({source:e,className:t,strokeWidth:n}){if(SH(e))return(0,I.jsx)(`span`,{"aria-hidden":`true`,"data-agent-icon":e,className:q(`agent-oracle shrink-0`,t)});let r=xH(e);return(0,I.jsx)(r,{"aria-hidden":`true`,"data-agent-icon":e??`thinking`,strokeWidth:n,className:q(`shrink-0`,t)})}function wH({source:e,live:t}){let n=SH(e);return(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`chat-avatar`,"data-live":t||void 0,"data-oracle":n||void 0,style:{"--orb":pH(e)},children:(0,I.jsx)(CH,{source:e,strokeWidth:2.25,className:n?`size-7`:`size-3.5`})})}function TH({source:e,name:t,time:n,head:r,live:i,children:a,aside:o,bubble:s=!0}){return(0,I.jsxs)(`div`,{className:`chat-row group/msg`,children:[(0,I.jsx)(`div`,{className:`chat-gutter`,children:r?(0,I.jsx)(wH,{source:e,live:i}):n?(0,I.jsx)(`time`,{className:`chat-hover-time`,children:n}):null}),(0,I.jsxs)(`div`,{className:`min-w-0`,children:[r?(0,I.jsxs)(`p`,{className:`chat-speaker`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:t}),n?(0,I.jsx)(`time`,{className:`text-xs text-muted-foreground tabular-nums`,children:n}):null,o?(0,I.jsx)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:o}):null]}):null,s?(0,I.jsx)(`div`,{className:`chat-bubble-agent`,style:{"--orb":pH(e)},children:a}):a]})]})}function EH({time:e,head:t,note:n,children:r,below:i}){return(0,I.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[t?(0,I.jsxs)(`p`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[e?(0,I.jsx)(`time`,{className:`tabular-nums`,children:e}):null,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`}),n?(0,I.jsx)(`span`,{children:n}):null]}):null,(0,I.jsx)(`div`,{className:`chat-bubble`,children:r}),i]})}function DH({failed:e,children:t}){return(0,I.jsx)(`div`,{role:`note`,className:q(`chat-note`,e&&`text-destructive`),children:(0,I.jsx)(`span`,{children:t})})}function OH({className:e}){return(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:q(`typing-dots`,e),children:[(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{}),(0,I.jsx)(`span`,{})]})}var kH=3e5,AH=`earlier messages load as you scroll up`,jH=`No task is running in this session.`,MH=`Type a request below and press enter to start one: the oracle scouts, proposes, plans and delegates.`,NH=`Nothing said yet. Type below to talk to the oracle about this task.`;function PH({entry:e}){return(0,I.jsxs)(DH,{failed:e.text.startsWith(`✗`),children:[e.text,e.at?` · ${EO(e.at)}`:``]})}function FH({entry:e,head:t}){if(e.role===`you`)return(0,I.jsx)(EH,{time:EO(e.at),head:t,children:(0,I.jsx)(KR,{text:e.text})});let n=e.role===`panel`;return(0,I.jsx)(TH,{source:n?`PLANNER`:`ORACLE`,name:n?`Panel`:`Oracle`,time:EO(e.at),head:t,children:(0,I.jsx)(KR,{text:e.text})})}var IH=(0,m.memo)(function({entry:e,head:t,fresh:n}){return(0,I.jsx)(z.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,I.jsx)(PH,{entry:e}):(0,I.jsx)(FH,{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 LH({text:e,busy:t}){let n=!!e?.trim();return!n&&!t?null:(0,I.jsx)(TH,{source:`ORACLE`,name:`Oracle`,head:!0,live:t,aside:t&&n?`writing…`:void 0,children:n?(0,I.jsx)(KR,{text:e??``}):(0,I.jsx)(OH,{className:`mt-1`})})}function RH({hasTask:e}){return(0,I.jsxs)(TD,{className:`h-full border-0`,children:[(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(Km,{"aria-hidden":`true`})}),e?null:(0,I.jsx)(kD,{children:jH}),(0,I.jsx)(AD,{children:e?NH:MH})]}),e?null:(0,I.jsxs)(`ul`,{className:`flex flex-col gap-2 text-sm text-muted-foreground`,children:[(0,I.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`Or plan it first with the whole panel in `,(0,I.jsx)(iD,{chord:`3`}),` Plan`]}),(0,I.jsxs)(`li`,{className:`flex items-center justify-center gap-2`,children:[`or make a direct change in `,(0,I.jsx)(iD,{chord:`4`}),` Quick fix`]})]})]})}async function zH(e){let t=await qf(`lobby.history`,{before:e});return{entries:t.entries,hasOlder:t.hasOlder}}function BH(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 zH(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 VH({chat:e,reply:t,busy:n,hasOlder:r,hasTask:i,bare:a}){let{ref:o,atBottom:s,stick:c,onScroll:l}=cH(e.length+(t?.length??0)),{merged:u,more:d,loading:f,load:p}=BH(e,r,o),h=(0,m.useCallback)(()=>{l();let e=o.current;e&&e.scrollTop<80&&d&&!f&&p()},[l,o,d,f,p]),g=u.length===0&&!t?.trim()&&!n,[_,v]=(0,m.useState)(!1);return(0,m.useEffect)(()=>v(!0),[]),(0,I.jsxs)(qR,{"aria-label":`Conversation`,...a?{}:{title:`Conversation`},note:d?AH:void 0,className:`flex-1`,children:[(0,I.jsx)(`div`,{ref:o,onScroll:h,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:g?(0,I.jsx)(RH,{hasTask:i}):(0,I.jsxs)(`div`,{className:`chat-column`,children:[u.map((e,t)=>{let n=u[t-1],r=!n||n.role!==e.role||e.at-n.at>kH;return(0,I.jsx)(IH,{entry:e,head:r,fresh:_},e.id)}),(0,I.jsx)(LH,{text:t,busy:n})]})}),s?null:(0,I.jsx)(`div`,{className:`absolute right-4 bottom-dock z-10`,children:(0,I.jsx)(Y,{label:`Jump to latest`,text:`Latest`,icon:mp,tone:`primary`,className:`rounded-full shadow-sm`,onClick:c})})]})}function HH(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]),t}function UH(e){return e===`running`?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):e===`success`?(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3.5 text-success`}):e===`failed`||e===`timeout`||e===`error`?(0,I.jsx)(gg,{"aria-hidden":`true`,className:`size-3.5 text-destructive`}):(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/50`})}function WH(e,t){let n=e.startedAt?Date.parse(e.startedAt):NaN;return DO((e.finishedAt?Date.parse(e.finishedAt):t)-n)}function GH({runs:e}){let t=HH(e.some(e=>e.status===`running`));return e.length===0?null:(0,I.jsx)(`ul`,{className:`-mt-1 flex shrink-0 flex-wrap items-center gap-1.5 px-4 pb-3`,"aria-label":`Runs`,children:e.map((e,n)=>(0,I.jsxs)(`li`,{className:`flex items-center gap-2 rounded-full bg-muted py-1 pr-3 pl-2 text-xs`,children:[(0,I.jsx)(`span`,{className:`flex size-4 items-center justify-center`,children:UH(e.status)}),(0,I.jsx)(`span`,{className:`sr-only`,children:e.status??`unknown`}),(0,I.jsx)(`span`,{className:q(`font-medium`,dH(mH(e))),children:uH(mH(e))}),e.activity??e.step?(0,I.jsx)(`span`,{className:`max-w-[18rem] truncate text-muted-foreground`,children:e.activity??e.step}):null,(0,I.jsx)(`span`,{className:`tabular-nums text-muted-foreground`,children:WH(e,t)})]},e.runId??n))})}var KH=8;function qH(e){return e?e.path===`fast`?`fast track (${e.size})`:`full workflow (${e.size})`:``}function JH(e,t){let n=Math.min(t,KH);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 YH({done:e,total:t}){return(0,I.jsx)(`span`,{className:`inline-flex items-center gap-0.5`,"aria-hidden":`true`,children:JH(e,t).map((e,t)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-3 rounded-full`,e?`bg-primary`:`bg-muted-foreground/25`)},t))})}function XH({check:e,className:t}){return(0,I.jsx)(e===`done`?Hp:e===`dropped`?Qp:em,{"aria-hidden":`true`,className:q(`size-4 shrink-0`,e===`done`?`text-success`:`text-muted-foreground`,t)})}function ZH({children:e}){return(0,I.jsx)(`span`,{className:`hidden shrink-0 items-center gap-1 text-xs text-muted-foreground md:inline-flex`,children:e})}function QH({done:e,total:t,current:n}){let r=t>0?Math.min(100,Math.round(e/t*100)):0;return(0,I.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[e,` of `,t,` steps`]}),(0,I.jsx)(`div`,{className:`h-1.5 w-16 overflow-hidden rounded-full bg-border`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":t,"aria-valuenow":e,"aria-label":`Plan progress`,children:(0,I.jsx)(z.div,{className:`h-full rounded-full bg-primary`,initial:!1,animate:{width:`${r}%`},transition:{type:`spring`,stiffness:260,damping:30}})}),n?(0,I.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate xl:inline`,children:[`now: `,(0,I.jsx)(`span`,{className:`text-foreground`,children:n})]}):null]})}function $H({task:e,status:t}){let n=t?.branch??t?.workspace.branch,r=e?.git?.branch??n;return(0,I.jsxs)(`section`,{className:`flex h-12 shrink-0 items-center gap-3 px-4`,"aria-label":`Task`,role:`group`,children:[(0,I.jsxs)(`h2`,{className:`min-w-0 flex-1 truncate text-[0.8125rem] font-medium`,title:e?.title,children:[e?.title??`No task yet`,e?null:(0,I.jsx)(`span`,{className:`ml-2 font-normal text-muted-foreground`,children:t?.sessionName??`Type a request below to start one.`})]}),e?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:e.state.replace(/_/g,` `)}),(0,I.jsx)(ZH,{children:e.id}),e.track?(0,I.jsx)(ZH,{children:qH(e.track)}):null,(e.domains??[]).length>0?(0,I.jsx)(ZH,{children:e.domains.join(`, `)}):null,r?(0,I.jsxs)(`span`,{className:`hidden max-w-48 shrink-0 items-center gap-1 text-xs text-muted-foreground lg:inline-flex`,children:[(0,I.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,I.jsxs)(`span`,{className:`truncate`,children:[r,e.git?.from?` · from ${e.git.from}`:``]})]}):null,e.progress?(0,I.jsx)(QH,{done:e.progress.done,total:e.progress.total,current:e.currentStep}):null]}):null]})}function eU(e,t){return t.overlay?!0:e===`savePlan`&&!t.saveAvailable}var tU={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 nU(e){return e.length===1&&/[a-z]/i.test(e)?`Key${e.toUpperCase()}`:e.length===1&&/[0-9]/.test(e)?`Digit${e}`:tU[e]}function rU(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=nU(n);if(!e)return;t.code=e}return t.code?t:void 0}function iU(e,t){return e.code===t.code&&e.altKey===t.alt&&e.ctrlKey===t.ctrl&&e.shiftKey===t.shift&&e.metaKey===t.meta}function aU(e,t){let n=rU(t);return n?iU(e,n):!1}function oU(e,t){for(let n of t)if(aU(e,n.key))return n.action}function sU(e,t){for(let n of t)if(aU(e,n.key))return n.id}function cU(e){return KD(e.target)||e.target instanceof HTMLInputElement||e.target instanceof HTMLSelectElement||hD()||!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)}function lU(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`)QD(e.key===`j`?1:-1);else return!1;return!0}function uU(e,t){let n=sU(e,t.tabs),r=oU(e,t.keys);return!n&&!r?!1:eU(r,{overlay:!!document.querySelector(`[role='dialog'], [role='menu'], [role='listbox']`)||hD(),typing:KD(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 dU(e,t,n){if(e.key===`Escape`)return Date.now()<n&&e.preventDefault(),0;if(Date.now()<n){let n=TX[e.key];return n&&(e.preventDefault(),t.onTab(n)),0}return e.key===`g`?Date.now()+1500:(lU(e,t.tabs,t.onAction,t.onTab)&&e.preventDefault(),0)}function fU(e){(0,m.useEffect)(()=>{if(!e.enabled)return;let t=0,n=n=>{if(n.defaultPrevented||n.isComposing)return;if(!e.insideApp()){oU(n,e.keys)===`help`&&(n.preventDefault(),e.onAction(`help`));return}let r=!n.altKey&&!n.ctrlKey&&!n.metaKey;if(r&&cU(n)){t=0;return}if(uU(n,e)){t=0;return}t=r?dU(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 pU=6,mU=`bot-lobby.orb`,hU=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1;function gU(e,t,n,r){let i=e=>e+pU,a=(e,t)=>Math.max(e+pU,e+t-r-pU);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 _U(e,t,n,r){let i=e=>Math.max(1,e-r),a=gU(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 vU(e,t,n){return gU(t.left+e.fx*Math.max(0,t.width-n),t.top+e.fy*Math.max(0,t.height-n),t,n)}function yU(e){if(e)try{let t=JSON.parse(e);return hU(t.fx)&&hU(t.fy)?{fx:t.fx,fy:t.fy}:void 0}catch{return}}function bU(){try{return yU(localStorage.getItem(mU))}catch{return}}function xU(e){try{localStorage.setItem(mU,JSON.stringify(e))}catch{}}var SU=5,CU=16;function wU(){let e=document.getElementById(`main`)?.getBoundingClientRect();return e?{left:e.left,top:e.top,width:e.width,height:e.height}:void 0}function TU(){let[e,t]=(0,m.useState)(wU);return(0,m.useEffect)(()=>{let e=()=>t(wU()),n=document.getElementById(`main`),r=typeof ResizeObserver>`u`||!n?void 0:new ResizeObserver(e);return n&&r?.observe(n),window.addEventListener(`resize`,e),e(),()=>{r?.disconnect(),window.removeEventListener(`resize`,e)}},[]),e}var EU=(0,m.forwardRef)(function({spotlight:e,thinking:t,tone:n,expanded:r,hidden:i,shortcut:a,onOpen:o},s){let c=TU(),[l,u]=(0,m.useState)(bU),[d,f]=(0,m.useState)(),[p,h]=(0,m.useState)(!1),g=(0,m.useRef)(void 0),_=(0,m.useRef)(!1),v=(0,m.useRef)(44),y=d??(l&&c?vU(l,c,v.current):void 0),b=(0,m.useCallback)((e,t)=>{let n=wU();if(!n)return;let r=_U(e,t,n,v.current);u(r),xU(r)},[]);function x(e){if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();v.current=t.width,g.current={id:e.pointerId,sx:e.clientX,sy:e.clientY,ox:t.left,oy:t.top,moved:!1},e.currentTarget.setPointerCapture?.(e.pointerId)}function S(e){let t=g.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)<SU)return;t.moved=!0;let i=wU();i&&f(gU(t.ox+n,t.oy+r,i,v.current))}function C(e){let t=g.current;g.current=void 0,t?.moved&&(_.current=!0,b(t.ox+e.clientX-t.sx,t.oy+e.clientY-t.sy),f(void 0))}function w(e){let t=e.shiftKey?64:CU,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();v.current=r.width,b(r.left+n[0],r.top+n[1])}let T=y&&c?y.x-c.left<140:!1,E={"--orb":n,...y?{left:y.x,top:y.y,right:`auto`,bottom:`auto`}:{}};return(0,I.jsxs)(VD,{open:p&&!d,onOpenChange:h,children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsxs)(`button`,{ref:s,type:`button`,"aria-label":`Open Thinking`,"aria-description":`${e?`${t.map(uH).join(`, `)} thinking. `:``}Drag, or use the arrow keys, to move it.`,"aria-haspopup":`dialog`,"aria-expanded":r,"aria-keyshortcuts":a?`${a} Enter Space`:`Enter Space`,onClick:e=>{if(_.current){_.current=!1,e.preventDefault();return}o()},onPointerDown:x,onPointerMove:S,onPointerUp:C,onPointerCancel:()=>{g.current=void 0,f(void 0)},onKeyDown:w,style:E,"data-thinking":e?``:void 0,"data-dragging":d?``:void 0,"data-placed":y?``:void 0,"data-flip":T||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`,i&&`invisible`),children:[(0,I.jsx)(nu,{initial:!1,children:e?(0,I.jsx)(z.span,{className:`orb-label`,initial:{opacity:0,x:T?-8:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:T?-8:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,I.jsx)(nu,{mode:`popLayout`,initial:!1,children:(0,I.jsx)(z.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:uH(e)},e)})},`label`):null}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`,children:(0,I.jsx)(`span`,{className:`orb-icon`,children:(0,I.jsx)(CH,{source:e,strokeWidth:2.25,className:`size-3.5`})})})]})}),(0,I.jsxs)(UD,{side:`top`,children:[`Thinking `,a?(0,I.jsx)(iD,{chord:a}):null,(0,I.jsx)(`span`,{className:`text-background/70`,children:` · drag to move`})]})]})}),DU=/^\s*(?:#{1,6}\s+(.+?)\s*#*|\*\*([^*\n]{2,90}?):?\*\*:?|__([^_\n]{2,90}?):?__:?)\s*$/,OU=260,kU=200,AU=/^\s*(?:[-*+]\s|\d+[.)]\s|>|```|~~~|\|)/m;function jU(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(`
|
|
89
89
|
`).trim()),n=[];continue}n.push(i)}return n.length&&t.push(n.join(`
|
|
90
|
-
`).trim()),t.filter(Boolean)}function
|
|
90
|
+
`).trim()),t.filter(Boolean)}function MU(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 NU(e){if(e.length<=OU||AU.test(e))return[e];let t=[],n=``;for(let r of MU(e.replace(/\s*\n\s*/g,` `)))n&&n.length+r.length+1>kU?(t.push(n),n=r):n=n?`${n} ${r}`:r;return n&&t.push(n),t}function PU(e){let t=e.replace(/\r\n?/g,`
|
|
91
91
|
`).trim().split(`
|
|
92
|
-
`),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:
|
|
92
|
+
`),n=[{lines:[]}],r=!1;for(let e of t){/^\s*(```|~~~)/.test(e)&&(r=!r);let t=r?null:DU.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=jU(e.lines);if(e.title)i.push({title:e.title,text:t.join(`
|
|
93
93
|
|
|
94
|
-
`)});else for(let e of t)for(let t of $H(e))i.push({text:t})}return i}var tU=4,nU=1800,rU=e=>({"--orb":e});function iU(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),nU);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function aU({thought:e}){let t=(0,m.useMemo)(()=>eU(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-tU),a=t.slice(i),o=QV(e.source);return(0,I.jsxs)(`li`,{className:`thought`,style:rU(tH(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`span`,{className:`thought-label`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-dot`}),o]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,I.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):_O(Date.now()-e.at)}),t.length>1?(0,I.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,I.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,I.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,I.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,I.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,I.jsx)(PR,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function oU(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{!e.isComposing&&zH(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 sU(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at)}function cU({thoughts:e,collapsed:t,onToggle:n,shortcut:r}){let i=sU(iH(e)),a=i.filter(e=>e.live).map(e=>e.source),o=iU(a),s=o?tH(o):`var(--orb-idle)`,c=(0,m.useRef)(null),l=(0,m.useRef)(t);l.current=t,(0,m.useEffect)(()=>()=>{l.current||n()},[n]);let u=nD(!t,tD.sheet),d=iD();return oU(u,r,n),(0,I.jsxs)(I.Fragment,{children:[(0,iv.createPortal)((0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsxs)(`button`,{ref:c,type:`button`,"aria-label":`Open Thinking`,"aria-description":o?`${a.map(QV).join(`, `)} thinking`:void 0,"aria-haspopup":`dialog`,"aria-expanded":!t,"aria-keyshortcuts":r?`${r} Enter Space`:`Enter Space`,onClick:n,style:rU(s),"data-thinking":o?``:void 0,className:q(`thinking-bubble fixed z-20 flex items-center justify-end gap-2 rounded-full outline-none focus-visible:ring-3 focus-visible:ring-ring/40`,d&&`invisible`),children:[(0,I.jsx)(nu,{initial:!1,children:o?(0,I.jsx)(z.span,{className:`orb-label`,initial:{opacity:0,x:8,scale:.9},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:8,scale:.9},transition:{type:`spring`,visualDuration:.3,bounce:.35},children:(0,I.jsx)(nu,{mode:`popLayout`,initial:!1,children:(0,I.jsx)(z.span,{className:`inline-block`,initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},transition:{type:`spring`,visualDuration:.28,bounce:.3},children:QV(o)},o)})},`label`):null}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`orb orb-float`})]})}),(0,I.jsxs)(jD,{side:`left`,children:[`Thinking `,r?(0,I.jsx)(KE,{chord:r}):null]})]}),document.body),(0,I.jsxs)(JE,{open:u,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:`thought-pane max-w-xl`,style:rU(s),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||c.current?.focus()})},children:[(0,I.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-thinking":o?``:void 0}),(0,I.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:i.length?(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(e=>(0,I.jsx)(aU,{thought:e},e.id))}):(0,I.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 lU=(e,t)=>e?.keys.find(e=>e.action===t)?.label,uU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function dU({name:e,icon:t,shortcut:n,onClick:r}){return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.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,I.jsx)(t,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsxs)(jD,{side:`left`,children:[`Expand `,e,n?(0,I.jsx)(KE,{chord:n}):null]})]})}function fU(e){let t=uU(e.status);return(0,I.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,I.jsx)(dU,{name:`Activity`,icon:up,shortcut:lU(e.status,`activity`),onClick:e.toggleActivity}):null})}function pU(e){let{data:t,status:n,activityFolded:r,toggleActivity:i}=e,a=uU(n),o=a.activity&&!r;if(!a.conversation&&!o)return null;let s=a.conversation&&o;return(0,I.jsxs)(`div`,{className:q(`grid min-h-0 flex-1`,s?`grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)] divide-x divide-border`:`grid-cols-1`),children:[a.conversation?(0,I.jsx)(xH,{chat:t?.chat??[],reply:t?.reply,busy:n?.busy??!1,hasOlder:t?.hasOlderChat??!1,hasTask:!!t?.task}):null,o?(0,I.jsx)(sH,{entries:t?.activity??[],collapsed:!1,onToggle:i,shortcut:lU(n,`activity`)}):null]})}function mU(e){let{status:t}=e,n=uU(t).activity&&e.activityFolded;return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,I.jsx)(pU,{...e})}),n?(0,I.jsx)(fU,{...e}):null]})}function hU({data:e,status:t}){let n=uU(t),r=[...n.conversation?[{id:`conversation`,label:`Conversation`,icon:Bm}]:[],...n.activity?[{id:`activity`,label:`Activity`,icon:up}]:[]],[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,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[r.length>1?(0,I.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,I.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,I.jsx)(n,{"aria-hidden":`true`,className:`size-4`}),e.label,e.id===`activity`&&s>0?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):null]},e.id)})}):null,o.id===`conversation`?(0,I.jsx)(xH,{chat:e?.chat??[],reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task,bare:!0}):null,o.id===`activity`?(0,I.jsx)(sH,{entries:e?.activity??[],collapsed:!1,bare:!0}):null]}):null}function gU(e){let{data:t,status:n}=e,r=oO(),i=uU(n);return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`shrink-0 border-b border-border`,children:[(0,I.jsx)(NH,{task:t?.task,status:n}),(0,I.jsx)(TH,{runs:rH(t)})]}),r?(0,I.jsx)(mU,{...e}):(0,I.jsx)(hU,{...e}),i.thinking?(0,I.jsx)(cU,{thoughts:t?.thoughts??[],collapsed:e.thinkingFolded,onToggle:e.toggleThinking,shortcut:lU(n,`thinking`)}):null]})}function _U(){let e=TD(`lobby`),t=TD(`status`),[n,r]=YV(`lobby.activity`),[i,a]=YV(`lobby.thinking`);return!e.data&&e.loading?(0,I.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(yD,{}),(0,I.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,I.jsx)(xD,{message:e.error,onRetry:()=>kf.onHello({})}):(0,I.jsx)(gU,{data:e.data,status:t.data,activityFolded:n,thinkingFolded:i,toggleActivity:r,toggleThinking:a})}var vU={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function yU(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 bU(e){return e>0?yU(e):`—`}function xU(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function SU(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function CU(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 wU(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function TU(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function EU(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function DU(e,t){let n=t===`model-kind`?vU[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var OU=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],kU={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 AU(e){let t=kU[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%OU.length;return OU[n]??OU[0]}function jU(e){return vU[e]??e}var MU=6;function NU({title:e,right:t,children:n}){return(0,I.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3 rounded-xl border border-border p-4`,"aria-label":e,children:[(0,I.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:e}),t?(0,I.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]}),n]})}function PU({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,MU);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>MU?(0,I.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 FU(e,t){return t>0?Math.max(1.5,e/t*100):0}function IU({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,I.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,I.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,I.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,I.jsx)(`div`,{className:`h-full rounded-full bg-primary/70`,style:{width:`${FU(t,r)}%`}}),n?(0,I.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,FU(n,r))}%`}}):null]})]})}function LU({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,I.jsx)(NU,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,I.jsx)(PU,{rows:n,render:e=>(0,I.jsx)(IU,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:bU(e.avgMs),sub:`p90 ${bU(e.p90Ms)}`},t(e))})})}var RU={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},zU={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function BU({label:e,rate:t,runs:n}){let r=TU(t),i=`${Math.round(t*100)}%`;return(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 ${zU[r.tone]}`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${RU[r.tone]}`}),(0,I.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,I.jsxs)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,I.jsx)(`div`,{className:`h-full bg-success/70`,style:{width:`${t*100}%`}}),(0,I.jsx)(`div`,{className:`h-full bg-destructive/45`,style:{width:`${(1-t)*100}%`}})]})]})}function VU({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,I.jsx)(NU,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,I.jsx)(PU,{rows:n,render:e=>(0,I.jsx)(BU,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function HU({share:e}){return(0,I.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,I.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${AU(e.agent)}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[0.8125rem]`,children:QV(e.agent)}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,I.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,yU(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function UU({share:e}){return(0,I.jsx)(`div`,{className:`flex h-2.5 gap-0.5 overflow-hidden rounded-full`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,I.jsx)(`span`,{className:`${AU(e.agent)} opacity-75 first:rounded-l-full last:rounded-r-full`,style:{width:`${e.share*100}%`},title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function WU({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,I.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,I.jsx)(PU,{rows:e,render:e=>(0,I.jsx)(IU,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:yU(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function GU({timeShare:e}){let t=e.byAgent;return(0,I.jsx)(NU,{title:`Where the time goes`,right:`share of run time by agent`,children:t.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsx)(UU,{share:t}),(0,I.jsx)(HU,{share:t}),(0,I.jsx)(WU,{times:e.taskTimes})]})})}function KU({label:e,value:t,sub:n}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,I.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var qU=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function JU({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,I.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-xl border border-border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,I.jsx)(KU,{label:`Calls`,value:qU(e.calls,`call`),sub:`${xU(e.ok,e.calls)} ok`}),(0,I.jsx)(KU,{label:`Speed`,value:`p50 ${wU(e.p50Ms)}`,sub:`p90 ${wU(e.p90Ms)}`}),(0,I.jsx)(KU,{label:`Read`,value:e.input>0?`${CU(e.input)} tokens`:`—`}),(0,I.jsx)(KU,{label:`Routed down`,value:e.routed>0?qU(e.routed,`run`):`none`,sub:e.routed>0?`${xU(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,qU(e.seatRunsSkipped,`seat run`),` skipped · `,qU(e.questionsAnswered,`question`),` answered · `,qU(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,I.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var YU=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function XU(e,t=0){return e>0?e.toFixed(t):`—`}function ZU(e){return[String(e.runs),xU(e.successes,e.runs),bU(e.avgMs),bU(e.p50Ms),bU(e.p90Ms),XU(e.avgTurns,1),XU(e.avgTools,1),e.avgTokens>0?CU(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,SU(e.avgCost),SU(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function QU(e,t){return t===`model-kind`?jU(e.kinds[0]??``):e.kinds.map(jU).join(`, `)}function $U({groups:e,groupBy:t}){return(0,I.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border border-border pt-4`,"aria-label":`All models`,children:[(0,I.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:`All models`}),(0,I.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,I.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,I.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,I.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),YU.map(e=>(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,I.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:QU(e,t)||`—`}),ZU(e).map((e,t)=>(0,I.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},YU[t]))]},DU(e,t)))})]})})]})}var eW={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function tW({label:e,value:t,sub:n,dot:r}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 bg-card px-4 py-3.5`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${eW[r.tone]}`}),(0,I.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,I.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function nW({tiles:e}){let t=TU(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-border bg-border sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,I.jsx)(tW,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,I.jsx)(tW,{label:`Success`,value:xU(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,I.jsx)(tW,{label:`Avg run`,value:bU(e.avgMs),sub:`p90 ${bU(e.p90Ms)}`}),(0,I.jsx)(tW,{label:`Cost`,value:SU(e.cost),sub:e.runs>0?`${SU(e.cost/e.runs)} per run`:`—`}),(0,I.jsx)(tW,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${yU(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var rW=`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 iW({groupBy:e,onGroup:t}){return(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex 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,I.jsx)(J,{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:EU(n)},n))})}function aW({query:e,onQuery:t}){return(0,I.jsxs)(`label`,{className:`relative flex items-center`,children:[(0,I.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,I.jsx)(Eh,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,I.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,I.jsx)(KE,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function oW({data:e,groupBy:t,query:n}){let r=e=>DU(e,t);return e.tiles.runs===0?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(nW,{tiles:e.tiles}),(0,I.jsx)(`p`,{className:`rounded-xl border border-border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}".`:rW})]}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(nW,{tiles:e.tiles}),e.classifier?(0,I.jsx)(JU,{summary:e.classifier}):null,(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,I.jsx)(LU,{groups:e.groups,label:r}),(0,I.jsx)(VU,{groups:e.groups,label:r})]}),(0,I.jsx)(GU,{timeShare:e.timeShare}),(0,I.jsx)($U,{groups:e.groups,groupBy:t})]})}function sW(){return(0,I.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,I.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function cW(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),i=DD(`metrics.get`,{groupBy:e,query:n},[`metrics`]);return!i.data&&i.error?(0,I.jsx)(xD,{message:`Could not load metrics. ${i.error}`,onRetry:i.reload}):(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,I.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,I.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),i.loading&&i.data?(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(yD,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),(0,I.jsx)(iW,{groupBy:e,onGroup:t}),(0,I.jsx)(aW,{query:n,onQuery:r})]}),i.data?(0,I.jsx)(oW,{data:i.data,groupBy:e,query:n}):(0,I.jsx)(sW,{})]})}var lW=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 uW(e,t){return JSON.stringify([e,`prompt`,t])}function dW(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function fW(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var pW=`bot-lobby.prompt-sound-muted`,mW=new Set,hW,gW=!1;function _W(){try{return localStorage.getItem(pW)===`on`}catch{return gW}}function vW(e){gW=e;try{localStorage.setItem(pW,e?`on`:`off`)}catch{}for(let e of mW)e()}function yW(e){return mW.add(e),()=>{mW.delete(e)}}function bW(){return(0,m.useSyncExternalStore)(yW,_W,()=>!1)}function xW(){(0,m.useEffect)(()=>{let e=()=>{try{hW??=new AudioContext,hW.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function SW(){if(!_W()&&hW&&hW.state===`running`)try{let e=hW.currentTime,t=hW.createOscillator(),n=hW.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(hW.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var CW=`bot-lobby.notifications`,wW=`/icon-192.png`,TW=new Set;function EW(){for(let e of[...TW])e()}function DW(){try{return localStorage.getItem(CW)===`on`}catch{return!1}}function OW(e){return TW.add(e),()=>{TW.delete(e)}}function kW(e){try{localStorage.setItem(CW,e?`on`:`off`)}catch{}EW()}function AW(){return(0,m.useSyncExternalStore)(OW,DW,()=>!1)}async function jW(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(kW(!0),`granted`):`denied`)}function MW(){kW(!1)}function NW(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function PW(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function FW(e){try{new Notification(`bot-lobby`,{body:e,icon:wW,tag:`bot-lobby`})}catch{}}function IW(){try{return new lW(sessionStorage)}catch{return new lW}}function LW(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?dW(e,t.sessionId??n.key??t.from,n.dialog.id):uW(e,t.id)}function RW(){let e=AW();xW(),CD();let t=DD(`tasks.list`,{},[`tasks`]),n=DD(`sessions.list`,{},[`sessions`]),r=kf.get(`prompts`),i=kf.get(`lobby`).data,a=(0,m.useRef)(IW()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=Hf()??`current`,l=kf.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 zW(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(()=>SW()),c&&PW()&&FW(r),t===`delivery`&&B.info(r,{action:{label:`Review tasks`,onClick:()=>dD(`#/tasks`)}}))}function BW(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;zW(e,`prompts`,(a??[]).map(e=>LW(i,e)),`A question is waiting for you.`,!!a&&!t.loading),zW(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>dW(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),zW(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=>fW(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function VW(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}BW(e);let s=a?.task?.state??``,c=NW(s);i.current&&c&&s!==i.current&&o&&PW()&&FW(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function HW(){let e=RW(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>VW(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function UW({className:e,type:t,...n}){return(0,I.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})}function WW({className:e,thumbClassName:t,...n}){return(0,I.jsx)(KT,{"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,I.jsx)(JT,{"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 GW=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],KW={repeat:1/0},qW=`M0 -4 L1 -1 L4 0 L1 1 L0 4 L-1 1 L-4 0 L-1 -1Z`,JW=[`var(--rainbow-1)`,`var(--rainbow-2)`,`var(--rainbow-3)`,`var(--rainbow-4)`,`var(--rainbow-5)`,`var(--rainbow-6)`,`var(--rainbow-7)`],YW={transformBox:`fill-box`,transformOrigin:`center`};function XW(e){switch(e){case`off`:return{animate:{scale:[1,1.03,1],rotate:-5},transition:{...KW,duration:4,ease:`easeInOut`}};case`minimal`:return{animate:{rotate:[0,0,7,9,0,0],y:[0,0,1.5,2,0,0]},transition:{...KW,duration:4.2,times:[0,.35,.7,.82,.86,1],ease:`easeInOut`}};case`low`:return{animate:{rotate:[-4,4,-4],y:[0,-1,0]},transition:{...KW,duration:3.2,ease:`easeInOut`}};case`medium`:return{animate:{rotate:[0,-5,-5,5,5,0],y:[0,-1,-1,-1,-1,0]},transition:{...KW,duration:4,times:[0,.12,.4,.52,.8,1],ease:`easeInOut`}};case`high`:return{animate:{y:[0,-1.5,0]},transition:{...KW,duration:.6,ease:`easeInOut`}};case`xhigh`:return{animate:{y:[0,-7,0,0],scaleY:[1,1.06,.88,1],scaleX:[1,.96,1.1,1]},transition:{...KW,duration:.7,times:[0,.4,.75,1],ease:`easeInOut`}};case`max`:return{animate:{y:[-1,-4,-1],rotate:[-3,3,-3]},transition:{...KW,duration:1.6,ease:`easeInOut`}}}}function ZW(){return(0,I.jsx)(`g`,{className:`fill-muted-foreground`,fontWeight:`700`,children:[0,1,2].map(e=>(0,I.jsx)(z.text,{x:44+e*4.5,y:17-e*5.5,fontSize:5.5+e*2,initial:{opacity:0},animate:{opacity:[0,1,0],y:[3,-4],x:[0,2.5]},transition:{...KW,duration:2.6,delay:e*.8,ease:`easeOut`},children:`z`},e))})}function QW(){return(0,I.jsx)(`g`,{className:`fill-primary`,fontSize:`9`,children:[0,1].map(e=>(0,I.jsx)(z.text,{x:48,y:20,initial:{opacity:0},animate:{opacity:[0,1,1,0],y:[2,-5,-11,-17],x:[0,3,1,5],rotate:[0,12,-8,10]},transition:{...KW,duration:3,delay:e*1.5,ease:`easeOut`},style:YW,children:e?`♫`:`♪`},e))})}function $W(){return(0,I.jsx)(z.text,{x:52,y:14,fontSize:`12`,fontWeight:`700`,className:`fill-primary`,initial:{opacity:0,scale:0},animate:{opacity:[0,0,1,1,0],scale:[0,0,1.2,1,.6],rotate:[0,0,-12,8,0]},transition:{...KW,duration:4,times:[0,.5,.58,.85,1]},style:YW,children:`?`})}function eG({spots:e,rainbow:t}){return(0,I.jsx)(`g`,{children:e.map(([e,n,r],i)=>(0,I.jsx)(z.path,{d:qW,className:t?void 0:`fill-primary`,style:{x:e,y:n,...t?{fill:JW[i%JW.length]}:{}},initial:{scale:0},animate:{scale:[0,1.1,0],rotate:[0,90,180]},transition:{...KW,duration:1.3,delay:r,ease:`easeInOut`}},i))})}function tG(){return(0,I.jsx)(`g`,{children:[-20,20].map((e,t)=>(0,I.jsxs)(`g`,{transform:`rotate(${e} 32 34)`,children:[(0,I.jsx)(`ellipse`,{cx:32,cy:34,rx:30,ry:9,fill:`none`,strokeWidth:.8,strokeDasharray:`2 3`,className:`stroke-primary/35`}),(0,I.jsx)(z.circle,{r:2,className:`fill-primary`,animate:{cx:[2,32,62,32,2],cy:[34,43,34,25,34]},transition:{...KW,duration:1.1,delay:t*.55,ease:`linear`}})]},e))})}function nG(){return(0,I.jsx)(z.path,{d:`M53 22 Q56 27 53 29 Q50 27 53 22Z`,className:`fill-primary/60`,animate:{y:[0,8],opacity:[0,1,0]},transition:{...KW,duration:.9,ease:`easeIn`,repeatDelay:.5}})}function rG({id:e}){return(0,I.jsx)(z.circle,{cx:32,cy:34,r:27,fill:`url(#${e}-glow)`,animate:{scale:[.92,1.08,.92],opacity:[.5,.85,.5]},transition:{...KW,duration:1.6,ease:`easeInOut`},style:{transformOrigin:`32px 34px`}})}function iG({rainbow:e}){return(0,I.jsx)(`g`,{children:Array.from({length:8},(t,n)=>{let r=n/8*Math.PI*2;return(0,I.jsx)(z.circle,{cx:32,cy:34,r:2,className:e?void 0:`fill-primary`,style:e?{fill:JW[n%JW.length]}:void 0,initial:{opacity:1,scale:1},animate:{cx:32+Math.cos(r)*32,cy:34+Math.sin(r)*30,opacity:0,scale:.3},transition:{duration:.6,ease:`easeOut`}},n)})})}function aG({level:e,move:t}){let n={fill:`none`,strokeWidth:2.2,strokeLinecap:`round`,className:`stroke-foreground`};if(e===`off`)return(0,I.jsx)(`path`,{d:`M20 33 Q24.5 36.5 29 33 M35 33 Q39.5 36.5 44 33`,...n});if(e===`low`)return(0,I.jsx)(`path`,{d:`M20 34 Q24.5 29.5 29 34 M35 34 Q39.5 29.5 44 34`,...n});if(e===`max`)return(0,I.jsx)(`g`,{children:[25,39].map((e,n)=>(0,I.jsx)(z.path,{d:`M0 -5.5 L1.6 -1.6 L5.5 0 L1.6 1.6 L0 5.5 L-1.6 1.6 L-5.5 0 L-1.6 -1.6Z`,style:{x:e,y:33,fill:JW[n?4:0]},animate:t?{rotate:[0,90,180],scale:[1,1.25,1]}:{},transition:{...KW,duration:1.2,ease:`easeInOut`,delay:n*.2}},e))});let r=e===`minimal`?.45:e===`high`?.7:e===`xhigh`?1.2:1,i=t&&e===`medium`?{x:[0,-2.5,-2.5,2.5,2.5,0]}:{x:0},a=t&&e===`medium`?{...KW,duration:4,times:[0,.12,.4,.52,.8,1]}:{duration:.2},o=e===`minimal`?3.2:e===`xhigh`?1.4:3.6,s=t?{scaleY:[r,r,.1,r,r]}:{scaleY:r},c=t?{...KW,duration:o,times:[0,.44,.5,.56,1]}:{duration:.2};return(0,I.jsx)(z.g,{animate:i,transition:a,children:[25,39].map(t=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(z.ellipse,{cx:t,cy:33,rx:3.4,ry:3.8,className:`fill-foreground`,style:YW,animate:s,transition:c}),e===`minimal`?null:(0,I.jsx)(`circle`,{cx:t+1.2,cy:31.6,r:1,className:`fill-card`})]},t))})}function oG({level:e,move:t}){let n={fill:`none`,strokeWidth:2,strokeLinecap:`round`,className:`stroke-foreground`};switch(e){case`off`:return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`circle`,{cx:32,cy:42,r:1.4,className:`fill-foreground`}),t?(0,I.jsx)(z.circle,{cx:35,cy:42,r:3,fill:`none`,strokeWidth:.9,className:`stroke-primary/60`,animate:{scale:[.2,1.3,1.5,0],opacity:[.6,.9,.9,0]},transition:{...KW,duration:4,times:[0,.7,.9,1]},style:{transformOrigin:`33px 42px`}}):null]});case`minimal`:return(0,I.jsx)(z.ellipse,{cx:32,cy:42,rx:3,ry:.8,className:`fill-foreground`,animate:t?{ry:[.8,.8,3.6,3.6,.8],rx:[3,3,3.6,3.6,3]}:{},transition:{...KW,duration:6,times:[0,.6,.7,.85,1]}});case`low`:return(0,I.jsx)(`path`,{d:`M26 40 Q32 45 38 40`,...n});case`medium`:return(0,I.jsx)(`path`,{d:`M28 41.5 Q32 43 36 41.5`,...n});case`high`:return(0,I.jsx)(`path`,{d:`M27 42 L37 41`,...n});case`xhigh`:return(0,I.jsx)(`path`,{d:`M25.5 39.5 Q32 47 38.5 39.5Z`,className:`fill-foreground`});case`max`:return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:`M24 38.5 Q32 50 40 38.5Z`,className:`fill-foreground`}),(0,I.jsx)(`path`,{d:`M28.5 44.5 Q32 47.5 35.5 44.5 Q32 43 28.5 44.5Z`,style:{fill:`var(--rainbow-1)`}})]})}}function sG({level:e,className:t}){let n=Jd()??!1,r=GW.includes(e)?e:`medium`,i=`m${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,a=!n,o=GW.indexOf(r),s=(0,m.useRef)(o),[c,l]=(0,m.useState)({n:0,up:!0});(0,m.useEffect)(()=>{o!==s.current&&(l(e=>({n:e.n+1,up:o>s.current})),s.current=o)},[o]);let u=XW(r),d=r===`max`,f=d?{stroke:`url(#${i}-rainbow)`}:void 0,p=!a||c.n===0?void 0:c.up?{y:[0,-9,0,0],scaleX:[1,.9,1.1,1],scaleY:[1,1.12,.9,1]}:{y:[0,0,0],scaleX:[1,1.12,1],scaleY:[1,.84,1]};return(0,I.jsxs)(`svg`,{viewBox:`0 0 64 64`,"data-slot":`effort-mascot`,"data-level":r,"aria-hidden":`true`,focusable:`false`,className:q(`size-14 shrink-0 overflow-visible`,t),children:[(0,I.jsxs)(`defs`,{children:[(0,I.jsxs)(`linearGradient`,{id:`${i}-rainbow`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[JW.map((e,t)=>(0,I.jsx)(`stop`,{offset:t/(JW.length-1),stopColor:e},t)),a&&d?(0,I.jsx)(`animateTransform`,{attributeName:`gradientTransform`,type:`rotate`,from:`0 0.5 0.5`,to:`360 0.5 0.5`,dur:`2.4s`,repeatCount:`indefinite`}):null]}),(0,I.jsxs)(`radialGradient`,{id:`${i}-glow`,children:[(0,I.jsx)(`stop`,{offset:`0.35`,stopColor:`var(--rainbow-6)`,stopOpacity:`0.45`}),(0,I.jsx)(`stop`,{offset:`0.7`,stopColor:`var(--rainbow-1)`,stopOpacity:`0.18`}),(0,I.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-3)`,stopOpacity:`0`})]})]}),d?a?(0,I.jsx)(rG,{id:i}):(0,I.jsx)(`circle`,{cx:32,cy:34,r:27,fill:`url(#${i}-glow)`}):null,a&&r===`xhigh`?(0,I.jsx)(tG,{}):null,(0,I.jsx)(z.g,{animate:p,transition:{duration:c.up?.55:.45,ease:`easeOut`},style:{transformOrigin:`32px 56px`},children:(0,I.jsxs)(z.g,{animate:a?u.animate:{rotate:r===`off`?-5:0},transition:a?u.transition:{duration:0},style:{transformOrigin:`32px 56px`},children:[(0,I.jsxs)(z.g,{style:{transformOrigin:`32px 17px`},animate:r===`off`?{rotate:32}:r===`minimal`?{rotate:14}:a&&r===`medium`?{rotate:[0,-12,10,0]}:a&&(r===`xhigh`||r===`max`)?{rotate:[-10,10,-10]}:{rotate:0},transition:a&&(r===`medium`||r===`xhigh`||r===`max`)?{...KW,duration:r===`medium`?2:.5,ease:`easeInOut`}:{type:`spring`,stiffness:200,damping:14},children:[(0,I.jsx)(`path`,{d:`M32 17 V10`,strokeWidth:2,strokeLinecap:`round`,className:d?void 0:`stroke-primary/70`,style:f}),(0,I.jsx)(z.circle,{cx:32,cy:7.5,r:3.2,className:d?void 0:r===`off`?`fill-muted-foreground/40`:`fill-primary`,style:{...YW,...d?{fill:`url(#${i}-rainbow)`}:{}},animate:a?r===`high`?{opacity:[1,.3,1]}:r===`medium`?{scale:[1,1.25,1]}:d||r===`xhigh`?{scale:[1,1.5,1]}:{scale:1,opacity:1}:{scale:1,opacity:1},transition:{...KW,duration:r===`high`?.5:r===`medium`?1.6:.4}})]}),[4.5,54].map((e,t)=>(0,I.jsx)(z.rect,{x:e,y:29,width:5.5,height:11,rx:2.5,className:d?void 0:`fill-primary/25`,style:{...YW,...d?{fill:JW[t?5:1],opacity:.6}:{}},animate:a&&(r===`xhigh`||d)?{rotate:t?[0,18,0]:[0,-18,0]}:{rotate:0},transition:{...KW,duration:.35}},e)),(0,I.jsx)(`rect`,{x:10,y:17,width:44,height:36,rx:11,strokeWidth:d?2.6:2,className:d?`fill-primary/10`:`fill-primary/10 stroke-primary/75`,style:f}),(0,I.jsx)(`rect`,{x:15,y:23,width:34,height:25,rx:7.5,className:`fill-card stroke-border`,strokeWidth:1}),a&&r===`high`?(0,I.jsx)(z.rect,{y:24,width:2,height:23,rx:1,className:`fill-primary/25`,animate:{x:[16,46,16]},transition:{...KW,duration:1.6,ease:`easeInOut`}}):null,r===`low`||d?(0,I.jsxs)(`g`,{className:`fill-destructive/25`,children:[(0,I.jsx)(`ellipse`,{cx:19.5,cy:39.5,rx:2.6,ry:1.6}),(0,I.jsx)(`ellipse`,{cx:44.5,cy:39.5,rx:2.6,ry:1.6})]}):null,(0,I.jsx)(aG,{level:r,move:a}),r===`high`||r===`xhigh`?(0,I.jsx)(`path`,{d:`M20 27 L28.5 28.8 M44 27 L35.5 28.8`,strokeWidth:1.9,strokeLinecap:`round`,className:`stroke-foreground`}):null,(0,I.jsx)(oG,{level:r,move:a}),(0,I.jsx)(`rect`,{x:20,y:53,width:24,height:4,rx:2,className:d?void 0:`fill-primary/25`,style:d?{fill:`url(#${i}-rainbow)`}:void 0})]})},c.n),r===`off`?a?(0,I.jsx)(ZW,{}):(0,I.jsx)(`text`,{x:48,y:14,fontSize:`9`,fontWeight:`700`,className:`fill-muted-foreground`,children:`z`}):null,a&&r===`minimal`?(0,I.jsx)(ZW,{}):null,a&&r===`low`?(0,I.jsx)(QW,{}):null,a&&r===`medium`?(0,I.jsx)($W,{}):null,a&&r===`high`?(0,I.jsx)(eG,{spots:[[6,14,0],[58,12,.6]]}):null,a&&r===`xhigh`?(0,I.jsx)(nG,{}):null,d?a?(0,I.jsx)(eG,{rainbow:!0,spots:[[5,12,0],[59,10,.2],[2,44,.45],[62,46,.65],[32,-2,.85],[14,60,1.05],[50,60,.3]]}):(0,I.jsx)(`g`,{children:[[5,12],[59,10],[32,-2]].map(([e,t],n)=>(0,I.jsx)(`path`,{d:qW,style:{x:e,y:t,fill:JW[n*2]}},n))}):null,a&&c.n>0&&c.up?(0,I.jsx)(iG,{rainbow:d},`burst-${c.n}`):null]})}var cG={minimal:`min`,medium:`med`},lG={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 uG(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 dG(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 fG({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),_=uG(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 uG(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:dG(t,n,r,1),ArrowUp:dG(t,n,r,1),ArrowLeft:dG(t,n,r,-1),ArrowDown:dG(t,n,r,-1),Home:uG(t,n,0),End:uG(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,I.jsxs)(`div`,{className:q(`flex flex-col gap-1`,a&&`opacity-60`),children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`span`,{"data-level":b,className:`effort-word text-[0.8125rem] font-medium capitalize`,"aria-hidden":`true`,children:b}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:lG[b]??``})]}),(0,I.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,I.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,I.jsx)(z.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,I.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,I.jsx)(z.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,I.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,I.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:cG[e]??e},e)})}),x?(0,I.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,r??`this model`,`, so it runs at `,b,`.`]}):null]})}function pG(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function mG({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=>pG(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,I.jsxs)(MT,{open:o,onOpenChange:s,children:[(0,I.jsxs)(NT,{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(`btn-raised 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,I.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,I.jsx)(PT,{children:(0,I.jsxs)(FT,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`glass-pop z-50 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,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,I.jsx)(Eh,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,I.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,I.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,I.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,I.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})})]})}function hG({label:e,help:t,children:n,stacked:r}){return(0,I.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 sm:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] sm:items-center sm:gap-6`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,I.jsx)(`div`,{className:`min-w-0`,children:n})]})}function gG({children:e}){return(0,I.jsx)(`div`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border px-4 [&>*]:py-3`,children:e})}function _G({value:e,items:t,label:n,onChange:r}){return(0,I.jsx)(mG,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r})}var vG=`(prefers-color-scheme: dark)`,yG=[`dark`,`light`,`system`],bG=m.createContext(void 0);function xG(e){return e!==null&&yG.includes(e)}function SG(){return window.matchMedia(vG).matches?`dark`:`light`}function CG(){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 wG(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function TG({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return xG(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`?SG():e,i=r?CG():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(vG),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||wG(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:SG()===`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(xG(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,I.jsx)(bG.Provider,{...i,value:l,children:e})}var EG=()=>{let e=m.useContext(bG);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},DG=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],OG={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},kG={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},AG=`inherit`,jG=`inherit`,MG=`Use the session's current model`,NG=`__custom__`,PG=`custom…`,FG=`Type a provider/model id`,IG=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],LG={agents:`Agents`,workflow:`Workflow`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},RG=[{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],zG=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity log pane`},{id:`thinking`,label:`Thinking bubble`}],BG=`shown on the Lobby tab`,VG=`Planning rounds`,HG=`how many rounds the panel gets before the oracle settles the rest alone`,UG=[2,3,5,8,0],WG=`Split long plans`,GG=`saving a plan with more steps offers to split it into up to 5 tasks`,KG=[6,8,10,12,0],qG=`Port`,JG=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,YG=`Open browser`,XG=`open this page in the browser when pi starts`,ZG=[{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`}],QG=`Git isolation`,$G=[{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`}],eK=[{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:`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, Jev picks the sections that bear on the step, and the agent is told where the rest is`},{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`}],tK={enabled:`Classifier`,enabledHelp:`Jev makes the obvious decisions so large models spend fewer tokens on them`,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`},nK={title:`Settings`,intro:`Each agent's model and effort, 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`},rK=`https://tweakcn.com/editor/theme`;function iK(){let{theme:e}=EG();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function aK({palette:e,dark:t}){let n=de(e,t);return(0,I.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,I.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,I.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,I.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function oK(){let e=be(),t=iK(),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,I.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,I.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,I.jsx)(aK,{palette:n,dark:t}),(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,I.jsxs)(`span`,{className:`truncate`,children:[n.name,n.id===`custom`?(0,I.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`imported`}):null]}),r?(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function sK(){let e=be(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(),a=(0,m.useRef)(null);function o(t,r){let a=re(t);if(`error`in a){i(a.error);return}i(void 0);let o=e.adopt(a,r);n(``);let s=a.light?a.dark?void 0:`dark`:`light`;B.success(s?`${o.name} applied. It has no ${s} colours, so ${s} mode keeps the default ones.`:`${o.name} applied.`)}async function s(e){if(e){if(e.size>2e5){i(`That file is too large to be a theme.`);return}o(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,I.jsxs)(`a`,{href:rK,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,I.jsx)(om,{"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,I.jsx)(fO,{value:t,onChange:e=>{n(e.target.value),i(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":r?!0:void 0,placeholder:`:root {
|
|
94
|
+
`)});else for(let e of t)for(let t of NU(e))i.push({text:t})}return i}var FU=4,IU=1800,LU=e=>({"--orb":e});function RU(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),IU);return()=>window.clearInterval(t)},[r,e.length]),e.length?e[t%e.length]:void 0}function zU({thought:e}){let t=(0,m.useMemo)(()=>PU(e.text),[e.text]),[n,r]=(0,m.useState)(!1),i=n?0:Math.max(0,t.length-FU),a=t.slice(i),o=uH(e.source);return(0,I.jsxs)(`li`,{className:`thought`,style:LU(pH(e.source)),"data-live":e.live||void 0,"aria-label":`${o}${e.live?`, thinking`:``}`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsxs)(`span`,{className:`thought-label`,children:[(0,I.jsx)(CH,{source:e.source,strokeWidth:2.25,className:`size-3.5`}),o]}),(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.live?(0,I.jsxs)(`span`,{className:`thought-live`,children:[`thinking`,(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`thought-ellipsis`})]}):kO(Date.now()-e.at)}),t.length>1?(0,I.jsxs)(`span`,{className:`ml-auto text-xs text-muted-foreground tabular-nums`,children:[t.length,` steps`]}):null]}),i?(0,I.jsxs)(`button`,{type:`button`,"data-compact":!0,className:`thought-more`,onClick:()=>r(!0),children:[i,` earlier `,i===1?`step`:`steps`]}):null,(0,I.jsx)(`ol`,{className:`thought-steps`,"data-single":a.length===1||void 0,children:a.map((t,n)=>(0,I.jsxs)(`li`,{"data-current":e.live&&n===a.length-1||void 0,children:[t.title?(0,I.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}):null,t.text?(0,I.jsx)(KR,{text:t.text,className:`thought-text`}):null]},i+n))})]})}function BU(e,t,n){(0,m.useEffect)(()=>{if(!e||!t)return;let r=e=>{!e.isComposing&&aU(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 VU(e){return[...e].sort((e,t)=>Number(t.live)-Number(e.live)||t.at-e.at)}function HU({thoughts:e,collapsed:t,onToggle:n,shortcut:r}){let i=VU(gH(e)),a=i.filter(e=>e.live).map(e=>e.source),o=RU(a),s=o?pH(o):`var(--orb-idle)`,c=(0,m.useRef)(null),l=(0,m.useRef)(t);l.current=t,(0,m.useEffect)(()=>()=>{l.current||n()},[n]);let u=mD(!t,pD.sheet),d=gD();return BU(u,r,n),(0,I.jsxs)(I.Fragment,{children:[(0,gv.createPortal)((0,I.jsx)(EU,{ref:c,spotlight:o,thinking:a,tone:s,expanded:!t,hidden:d,shortcut:r,onOpen:n}),document.body),(0,I.jsxs)(oD,{open:u,onOpenChange:e=>{!e&&!t&&n()},label:`Thinking`,className:`thought-pane max-w-xl`,style:LU(s),onCloseAutoFocus:e=>{e.preventDefault(),requestAnimationFrame(()=>{document.querySelector(`[role='dialog']`)||c.current?.focus()})},children:[(0,I.jsx)(`div`,{"aria-hidden":`true`,className:`thought-aura`,"data-thinking":o?``:void 0}),(0,I.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:i.length?(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(e=>(0,I.jsx)(zU,{thought:e},e.id))}):(0,I.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 UU=(e,t)=>e?.keys.find(e=>e.action===t)?.label,WU=e=>e?.panels??{conversation:!0,activity:!0,thinking:!0};function GU({name:e,icon:t,shortcut:n,onClick:r}){return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.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,I.jsx)(t,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsxs)(UD,{side:`left`,children:[`Expand `,e,n?(0,I.jsx)(iD,{chord:n}):null]})]})}function KU(e){let t=WU(e.status);return(0,I.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,I.jsx)(GU,{name:`Activity`,icon:up,shortcut:UU(e.status,`activity`),onClick:e.toggleActivity}):null})}function qU(e){let{data:t,status:n,activityFolded:r,toggleActivity:i}=e,a=WU(n),o=a.activity&&!r;if(!a.conversation&&!o)return null;let s=a.conversation&&o;return(0,I.jsxs)(`div`,{className:q(`grid min-h-0 flex-1`,s?`grid-cols-[minmax(0,1.4fr)_minmax(0,1fr)] divide-x divide-border`:`grid-cols-1`),children:[a.conversation?(0,I.jsx)(VH,{chat:t?.chat??[],reply:t?.reply,busy:n?.busy??!1,hasOlder:t?.hasOlderChat??!1,hasTask:!!t?.task}):null,o?(0,I.jsx)(yH,{entries:t?.activity??[],collapsed:!1,onToggle:i,shortcut:UU(n,`activity`)}):null]})}function JU(e){let{status:t}=e,n=WU(t).activity&&e.activityFolded;return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,I.jsx)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:(0,I.jsx)(qU,{...e})}),n?(0,I.jsx)(KU,{...e}):null]})}function YU({data:e,status:t}){let n=WU(t),r=[...n.conversation?[{id:`conversation`,label:`Conversation`,icon:Km}]:[],...n.activity?[{id:`activity`,label:`Activity`,icon:up}]:[]],[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,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[r.length>1?(0,I.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,I.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,I.jsx)(n,{"aria-hidden":`true`,className:`size-4`}),e.label,e.id===`activity`&&s>0?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):null]},e.id)})}):null,o.id===`conversation`?(0,I.jsx)(VH,{chat:e?.chat??[],reply:e?.reply,busy:t?.busy??!1,hasOlder:e?.hasOlderChat??!1,hasTask:!!e?.task,bare:!0}):null,o.id===`activity`?(0,I.jsx)(yH,{entries:e?.activity??[],collapsed:!1,bare:!0}):null]}):null}function XU(e){let{data:t,status:n}=e,r=vO(),i=WU(n);return(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`div`,{className:`shrink-0 border-b border-border`,children:[(0,I.jsx)($H,{task:t?.task,status:n}),(0,I.jsx)(GH,{runs:hH(t)})]}),r?(0,I.jsx)(JU,{...e}):(0,I.jsx)(YU,{...e}),i.thinking?(0,I.jsx)(HU,{thoughts:t?.thoughts??[],collapsed:e.thinkingFolded,onToggle:e.toggleThinking,shortcut:UU(n,`thinking`)}):null]})}function ZU(){let e=LD(`lobby`),t=LD(`status`),[n,r]=sH(`lobby.activity`),[i,a]=sH(`lobby.thinking`);return!e.data&&e.loading?(0,I.jsxs)(`div`,{className:`flex flex-1 items-center justify-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(jD,{}),(0,I.jsx)(`span`,{children:`Connecting…`})]}):!e.data&&e.error?(0,I.jsx)(ND,{message:e.error,onRetry:()=>kf.onHello({})}):(0,I.jsx)(XU,{data:e.data,status:t.data,activityFolded:n,thinkingFolded:i,toggleActivity:r,toggleThinking:a})}var QU={master:`master`,scout:`scout`,worker:`worker`,reviewer:`QA gate`,researcher:`research`,quickfix:`quick fix`,planner:`oracle (plan)`,panel:`panel`};function $U(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 eW(e){return e>0?$U(e):`—`}function tW(e,t){return t>0?`${Math.round(e/t*100)}%`:`—`}function nW(e){return e<=0?`—`:e<.01?`<$0.01`:`$${e.toFixed(2)}`}function rW(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 iW(e){return e<1e3?`${Math.round(e)} ms`:`${(e/1e3).toFixed(1)}s`}function aW(e){return e>=.9?{icon:`✓`,word:`healthy`,tone:`healthy`}:e>=.7?{icon:`!`,word:`shaky`,tone:`shaky`}:{icon:`✗`,word:`failing`,tone:`failing`}}function oW(e){return e===`model`?`by model · thinking`:`by model · thinking · agent`}function sW(e,t){let n=t===`model-kind`?QU[e.kinds[0]??``]??e.kinds[0]??``:``;return[e.model,e.thinking,n].filter(Boolean).join(` · `)}var cW=[`bg-chart-1`,`bg-chart-2`,`bg-chart-3`,`bg-chart-4`,`bg-chart-5`],lW={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 uW(e){let t=lW[e.toUpperCase()];if(t)return t;let n=0;for(let t of e)n=(n*31+t.charCodeAt(0))%cW.length;return cW[n]??cW[0]}function dW(e){return QU[e]??e}var fW=6;function pW({title:e,right:t,children:n}){return(0,I.jsxs)(`section`,{className:`flex min-w-0 flex-col gap-3 rounded-xl border border-border p-4`,"aria-label":e,children:[(0,I.jsxs)(`h2`,{className:`flex items-baseline justify-between gap-3 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:e}),t?(0,I.jsx)(`span`,{className:`truncate text-xs font-normal text-muted-foreground`,children:t}):null]}),n]})}function mW({rows:e,render:t}){let[n,r]=(0,m.useState)(!1),i=n?e:e.slice(0,fW);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:i.map(t)}),e.length>fW?(0,I.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 hW(e,t){return t>0?Math.max(1.5,e/t*100):0}function gW({label:e,value:t,marker:n,max:r,valueText:i,sub:a}){return(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,I.jsxs)(`span`,{className:`shrink-0 tabular-nums`,children:[i,a?(0,I.jsx)(`span`,{className:`ml-2 text-xs text-muted-foreground`,children:a}):null]})]}),(0,I.jsxs)(`div`,{className:`relative h-1.5 rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${i}`,children:[(0,I.jsx)(`div`,{className:`h-full rounded-full bg-primary/70`,style:{width:`${hW(t,r)}%`}}),n?(0,I.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,hW(n,r))}%`}}):null]})]})}function _W({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,I.jsx)(pW,{title:`Average run time`,right:`per model · thinking · tick is p90`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,I.jsx)(mW,{rows:n,render:e=>(0,I.jsx)(gW,{label:t(e),value:e.avgMs,marker:e.p90Ms,max:r,valueText:eW(e.avgMs),sub:`p90 ${eW(e.p90Ms)}`},t(e))})})}var vW={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`},yW={healthy:`text-success`,shaky:`text-warning`,failing:`text-destructive`};function bW({label:e,rate:t,runs:n}){let r=aW(t),i=`${Math.round(t*100)}%`;return(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3 text-[0.8125rem]`,children:[(0,I.jsx)(`span`,{className:`min-w-0 truncate`,title:e,children:e}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-2 tabular-nums`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 ${yW[r.tone]}`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-1.5 rounded-full ${vW[r.tone]}`}),(0,I.jsx)(`span`,{className:`sr-only`,children:r.word}),i]}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` run`,n===1?``:`s`]})]})]}),(0,I.jsxs)(`div`,{className:`flex h-1.5 overflow-hidden rounded-full bg-muted`,role:`img`,"aria-label":`${e}: ${r.word}, ${i} of ${n} runs`,children:[(0,I.jsx)(`div`,{className:`h-full bg-success/70`,style:{width:`${t*100}%`}}),(0,I.jsx)(`div`,{className:`h-full bg-destructive/45`,style:{width:`${(1-t)*100}%`}})]})]})}function xW({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,I.jsx)(pW,{title:`Success rate`,right:`green worked · red failed`,children:n.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No runs yet.`}):(0,I.jsx)(mW,{rows:n,render:e=>(0,I.jsx)(bW,{label:t(e),rate:e.successes/e.runs,runs:e.runs},t(e))})})}function SW({share:e}){return(0,I.jsx)(`ul`,{className:`flex flex-wrap gap-x-6 gap-y-1.5 text-xs`,children:e.map(e=>(0,I.jsxs)(`li`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`size-2 shrink-0 rounded-full ${uW(e.agent)}`,"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`text-[0.8125rem]`,children:uH(e.agent)}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[Math.round(e.share*100),`%`]}),(0,I.jsxs)(`span`,{className:`text-muted-foreground tabular-nums`,children:[`avg `,$U(e.ms/Math.max(1,e.runs)),` ×`,e.runs]})]},e.agent))})}function CW({share:e}){return(0,I.jsx)(`div`,{className:`flex h-2.5 gap-0.5 overflow-hidden rounded-full`,role:`img`,"aria-label":`Share of run time by agent`,children:e.map(e=>(0,I.jsx)(`span`,{className:`${uW(e.agent)} opacity-75 first:rounded-l-full last:rounded-r-full`,style:{width:`${e.share*100}%`},title:`${e.agent} ${Math.round(e.share*100)}%`},e.agent))})}function wW({times:e}){if(e.length===0)return null;let t=Math.max(...e.map(e=>e.avgMs),1);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2.5 pt-1`,children:[(0,I.jsx)(`h3`,{className:`text-xs text-muted-foreground`,children:`Request to done, by the oracle's model`}),(0,I.jsx)(mW,{rows:e,render:e=>(0,I.jsx)(gW,{label:[e.model,e.thinking].filter(Boolean).join(` · `),value:e.avgMs,max:t,valueText:$U(e.avgMs),sub:`×${e.tasks}`},`${e.model}-${e.thinking}`)})]})}function TW({timeShare:e}){let t=e.byAgent;return(0,I.jsx)(pW,{title:`Where the time goes`,right:`share of run time by agent`,children:t.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No timed runs yet.`}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,I.jsx)(CW,{share:t}),(0,I.jsx)(SW,{share:t}),(0,I.jsx)(wW,{times:e.taskTimes})]})})}function EW({label:e,value:t,sub:n}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsx)(`span`,{className:`text-sm font-medium tabular-nums`,children:t}),n?(0,I.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n}):null]})}var DW=(e,t,n=`${t}s`)=>`${e} ${e===1?t:n}`;function OW({summary:e}){let t=Object.entries(e.byPurpose).sort((e,t)=>t[1]-e[1]);return(0,I.jsxs)(`section`,{className:`flex flex-col gap-3 rounded-xl border border-border p-4`,"aria-label":`Classifier (Jev)`,children:[(0,I.jsx)(`h2`,{className:`text-sm font-medium`,children:`Classifier (Jev)`}),e.calls===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`no calls recorded`}):(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-x-6 gap-y-3 sm:grid-cols-4`,children:[(0,I.jsx)(EW,{label:`Calls`,value:DW(e.calls,`call`),sub:`${tW(e.ok,e.calls)} ok`}),(0,I.jsx)(EW,{label:`Speed`,value:`p50 ${iW(e.p50Ms)}`,sub:`p90 ${iW(e.p90Ms)}`}),(0,I.jsx)(EW,{label:`Read`,value:e.input>0?`${rW(e.input)} tokens`:`—`}),(0,I.jsx)(EW,{label:`Routed down`,value:e.routed>0?DW(e.routed,`run`):`none`,sub:e.routed>0?`${tW(e.routedOk,e.routed)} ok`:`no runs routed`})]}),(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`text-primary`,children:`spared`}),` `,DW(e.seatRunsSkipped,`seat run`),` skipped · `,DW(e.questionsAnswered,`question`),` answered · `,DW(e.quickFixesHeld,`quick fix`,`quick fixes`),` held`,t.length>0?(0,I.jsx)(`span`,{className:`ml-3 border-l border-border pl-3`,children:t.map(([e,t])=>`${e} ${t}`).join(` · `)}):null]})]})}var kW=[`Runs`,`OK`,`Avg`,`p50`,`p90`,`Turns`,`Tools`,`Tokens`,`tok/s`,`$/run`,`$ total`,`Stalls`];function AW(e,t=0){return e>0?e.toFixed(t):`—`}function jW(e){return[String(e.runs),tW(e.successes,e.runs),eW(e.avgMs),eW(e.p50Ms),eW(e.p90Ms),AW(e.avgTurns,1),AW(e.avgTools,1),e.avgTokens>0?rW(e.avgTokens):`—`,e.tokensPerSecond>0?e.tokensPerSecond.toFixed(0):`—`,nW(e.avgCost),nW(e.totalCost),e.timeouts>0?String(e.timeouts):`—`]}function MW(e,t){return t===`model-kind`?dW(e.kinds[0]??``):e.kinds.map(dW).join(`, `)}function NW({groups:e,groupBy:t}){return(0,I.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-2 overflow-hidden rounded-xl border border-border pt-4`,"aria-label":`All models`,children:[(0,I.jsxs)(`h2`,{className:`flex flex-wrap items-baseline justify-between gap-3 px-4 text-sm font-medium`,children:[(0,I.jsx)(`span`,{children:`All models`}),(0,I.jsxs)(`span`,{className:`text-xs font-normal text-muted-foreground`,children:[t===`model`?`by model · thinking`:`by model · thinking · agent`,` · sorted by runs`]})]}),(0,I.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,I.jsxs)(`table`,{className:`w-full border-collapse text-xs`,children:[(0,I.jsx)(`thead`,{className:`sticky top-0 bg-card text-muted-foreground`,children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Model`}),(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:`Think`}),(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-left font-medium`,children:t===`model-kind`?`Agent`:`Agents`}),kW.map(e=>(0,I.jsx)(`th`,{scope:`col`,className:`px-3 py-1.5 text-right font-medium whitespace-nowrap`,children:e},e))]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{className:`border-t border-border/70 transition-colors hover:bg-muted`,children:[(0,I.jsx)(`th`,{scope:`row`,className:`px-3 py-1.5 text-left font-normal text-foreground`,children:e.model}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:e.thinking||`—`}),(0,I.jsx)(`td`,{className:`px-3 py-1.5 whitespace-nowrap text-muted-foreground`,children:MW(e,t)||`—`}),jW(e).map((e,t)=>(0,I.jsx)(`td`,{className:`px-3 py-1.5 text-right tabular-nums whitespace-nowrap text-foreground`,children:e},kW[t]))]},sW(e,t)))})]})})]})}var PW={healthy:`bg-success`,shaky:`bg-warning`,failing:`bg-destructive`};function FW({label:e,value:t,sub:n,dot:r}){return(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5 bg-card px-4 py-3.5`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-2xl leading-tight font-semibold tracking-tight tabular-nums`,children:[r?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 shrink-0 rounded-full ${PW[r.tone]}`}),(0,I.jsx)(`span`,{className:`sr-only`,children:r.word})]}):null,t]}),(0,I.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:n||`\xA0`})]})}function IW({tiles:e}){let t=aW(e.runs>0?e.successes/e.runs:0),n=e.runs-e.successes;return(0,I.jsxs)(`div`,{className:`grid grid-cols-2 gap-px overflow-hidden rounded-xl border border-border bg-border sm:grid-cols-5 [&>:last-child]:col-span-2 sm:[&>:last-child]:col-span-1`,children:[(0,I.jsx)(FW,{label:`Runs`,value:String(e.runs),sub:e.runs===0?`no runs yet`:``}),(0,I.jsx)(FW,{label:`Success`,value:tW(e.successes,e.runs),sub:`${n} failed${e.stalls>0?` · ${e.stalls} stalled`:``}`,dot:{tone:t.tone,word:t.word}}),(0,I.jsx)(FW,{label:`Avg run`,value:eW(e.avgMs),sub:`p90 ${eW(e.p90Ms)}`}),(0,I.jsx)(FW,{label:`Cost`,value:nW(e.cost),sub:e.runs>0?`${nW(e.cost/e.runs)} per run`:`—`}),(0,I.jsx)(FW,{label:`Tasks`,value:`${e.completed} done`,sub:e.avgCompleteMs>0?`avg ${$U(e.avgCompleteMs)} · ${e.active} active`:`${e.active} active`})]})}var LW=`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 RW({groupBy:e,onGroup:t}){return(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`Group by`,className:`flex 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,I.jsx)(J,{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:oW(n)},n))})}function zW({query:e,onQuery:t}){return(0,I.jsxs)(`label`,{className:`relative flex items-center`,children:[(0,I.jsx)(`span`,{className:`sr-only`,children:`Search runs`}),(0,I.jsx)(Ph,{"aria-hidden":`true`,className:`pointer-events-none absolute left-2.5 size-3.5 text-muted-foreground`}),(0,I.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,I.jsx)(iD,{chord:`/`,className:`kbd-hint pointer-events-none absolute right-2`})]})}function BW({data:e,groupBy:t,query:n}){let r=e=>sW(e,t);return e.tiles.runs===0?(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(IW,{tiles:e.tiles}),(0,I.jsx)(`p`,{className:`rounded-xl border border-border p-4 text-sm text-muted-foreground`,children:n?`No run matches "${n}".`:LW})]}):(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,I.jsx)(IW,{tiles:e.tiles}),e.classifier?(0,I.jsx)(OW,{summary:e.classifier}):null,(0,I.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,I.jsx)(_W,{groups:e.groups,label:r}),(0,I.jsx)(xW,{groups:e.groups,label:r})]}),(0,I.jsx)(TW,{timeShare:e.timeShare}),(0,I.jsx)(NW,{groups:e.groups,groupBy:t})]})}function VW(){return(0,I.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,I.jsx)(`div`,{className:`h-20 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function HW(){let[e,t]=(0,m.useState)(`model`),[n,r]=(0,m.useState)(``),i=zD(`metrics.get`,{groupBy:e,query:n},[`metrics`]);return!i.data&&i.error?(0,I.jsx)(ND,{message:`Could not load metrics. ${i.error}`,onRetry:i.reload}):(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-6xl flex-col gap-4 px-5 pt-5 pb-dock`,children:[(0,I.jsxs)(`header`,{className:`flex flex-wrap items-center gap-x-3 gap-y-2`,children:[(0,I.jsx)(`h1`,{className:`text-lg font-semibold tracking-tight`,children:`Metrics`}),i.loading&&i.data?(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(jD,{className:`size-3`,"aria-hidden":`true`,role:`presentation`}),` refreshing`]}):null,(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`min-w-4 flex-1`}),(0,I.jsx)(RW,{groupBy:e,onGroup:t}),(0,I.jsx)(zW,{query:n,onQuery:r})]}),i.data?(0,I.jsx)(BW,{data:i.data,groupBy:e,query:n}):(0,I.jsx)(VW,{})]})}var UW=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 WW(e,t){return JSON.stringify([e,`prompt`,t])}function GW(e,t,n){return JSON.stringify([e,`dialog`,t,n])}function KW(e,t,n){return JSON.stringify([e,`delivery`,t,n])}var qW=`bot-lobby.prompt-sound-muted`,JW=new Set,YW,XW=!1;function ZW(){try{return localStorage.getItem(qW)===`on`}catch{return XW}}function QW(e){XW=e;try{localStorage.setItem(qW,e?`on`:`off`)}catch{}for(let e of JW)e()}function $W(e){return JW.add(e),()=>{JW.delete(e)}}function eG(){return(0,m.useSyncExternalStore)($W,ZW,()=>!1)}function tG(){(0,m.useEffect)(()=>{let e=()=>{try{YW??=new AudioContext,YW.resume().catch(()=>void 0)}catch{}};return window.addEventListener(`pointerdown`,e),window.addEventListener(`keydown`,e),()=>{window.removeEventListener(`pointerdown`,e),window.removeEventListener(`keydown`,e)}},[])}function nG(){if(!ZW()&&YW&&YW.state===`running`)try{let e=YW.currentTime,t=YW.createOscillator(),n=YW.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(YW.destination),t.start(e),t.stop(e+.24),t.onended=()=>{t.disconnect(),n.disconnect()}}catch{}}var rG=`bot-lobby.notifications`,iG=`/icon-192.png`,aG=new Set;function oG(){for(let e of[...aG])e()}function sG(){try{return localStorage.getItem(rG)===`on`}catch{return!1}}function cG(e){return aG.add(e),()=>{aG.delete(e)}}function lG(e){try{localStorage.setItem(rG,e?`on`:`off`)}catch{}oG()}function uG(){return(0,m.useSyncExternalStore)(cG,sG,()=>!1)}async function dG(){return typeof Notification>`u`?`unsupported`:(Notification.permission==="default"&&await Notification.requestPermission().catch(()=>void 0),Notification.permission===`granted`?(lG(!0),`granted`):`denied`)}function fG(){lG(!1)}function pG(e){if(e===`completed`)return`finished`;if(e===`abandoned`)return`dropped`}function mG(){return typeof Notification<`u`&&Notification.permission===`granted`&&document.hidden}function hG(e){try{new Notification(`bot-lobby`,{body:e,icon:iG,tag:`bot-lobby`})}catch{}}function gG(){try{return new UW(sessionStorage)}catch{return new UW}}function _G(e,t){let n=t.payload;return t.kind===`sessionDialog`&&n?.dialog?.id?GW(e,t.sessionId??n.key??t.from,n.dialog.id):WW(e,t.id)}function vG(){let e=uG();tG(),FD();let t=zD(`tasks.list`,{},[`tasks`]),n=zD(`sessions.list`,{},[`sessions`]),r=kf.get(`prompts`),i=kf.get(`lobby`).data,a=(0,m.useRef)(gG()),o=(0,m.useRef)(new Set([`prompts`,`sessions`,`delivery`])),s=(0,m.useRef)(void 0),c=Hf()??`current`,l=kf.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 yG(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(()=>nG()),c&&mG()&&hG(r),t===`delivery`&&B.info(r,{action:{label:`Review tasks`,onClick:()=>CD(`#/tasks`)}}))}function bG(e){let{prompts:t,sessions:n,tasks:r,project:i}=e,a=t.data?.prompts;yG(e,`prompts`,(a??[]).map(e=>_G(i,e)),`A question is waiting for you.`,!!a&&!t.loading),yG(e,`sessions`,n.data?.background.flatMap(e=>e.dialogs.map(t=>GW(i,e.sessionId??e.key,t.id)))??[],`A background session is asking something.`,!!n.data&&!n.loading),yG(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=>KW(i,e.id,e.delivery.reviewId))??[],`Completed work is ready for delivery review in Tasks.`,!!r.data&&!r.loading)}function xG(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}bG(e);let s=a?.task?.state??``,c=pG(s);i.current&&c&&s!==i.current&&o&&mG()&&hG(`${a?.task?.title??`The task`} ${c}.`),i.current=s}function SG(){let e=vG(),{connection:t,enabled:n,project:r,prompts:i,sessions:a,tasks:o,lobby:s}=e;(0,m.useEffect)(()=>xG(e),[t,n,r,i.data,i.loading,a.data,a.loading,o.data,o.loading,s])}function CG({className:e,type:t,...n}){return(0,I.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})}function wG({className:e,thumbClassName:t,...n}){return(0,I.jsx)(iE,{"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,I.jsx)(oE,{"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 TG=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],EG={repeat:1/0},DG=`M0 -4 L1 -1 L4 0 L1 1 L0 4 L-1 1 L-4 0 L-1 -1Z`,OG=[`var(--rainbow-1)`,`var(--rainbow-2)`,`var(--rainbow-3)`,`var(--rainbow-4)`,`var(--rainbow-5)`,`var(--rainbow-6)`,`var(--rainbow-7)`],kG={transformBox:`fill-box`,transformOrigin:`center`};function AG(e){switch(e){case`off`:return{animate:{scale:[1,1.03,1],rotate:-5},transition:{...EG,duration:4,ease:`easeInOut`}};case`minimal`:return{animate:{rotate:[0,0,7,9,0,0],y:[0,0,1.5,2,0,0]},transition:{...EG,duration:4.2,times:[0,.35,.7,.82,.86,1],ease:`easeInOut`}};case`low`:return{animate:{rotate:[-4,4,-4],y:[0,-1,0]},transition:{...EG,duration:3.2,ease:`easeInOut`}};case`medium`:return{animate:{rotate:[0,-5,-5,5,5,0],y:[0,-1,-1,-1,-1,0]},transition:{...EG,duration:4,times:[0,.12,.4,.52,.8,1],ease:`easeInOut`}};case`high`:return{animate:{y:[0,-1.5,0]},transition:{...EG,duration:.6,ease:`easeInOut`}};case`xhigh`:return{animate:{y:[0,-7,0,0],scaleY:[1,1.06,.88,1],scaleX:[1,.96,1.1,1]},transition:{...EG,duration:.7,times:[0,.4,.75,1],ease:`easeInOut`}};case`max`:return{animate:{y:[-1,-4,-1],rotate:[-3,3,-3]},transition:{...EG,duration:1.6,ease:`easeInOut`}}}}function jG(){return(0,I.jsx)(`g`,{className:`fill-muted-foreground`,fontWeight:`700`,children:[0,1,2].map(e=>(0,I.jsx)(z.text,{x:44+e*4.5,y:17-e*5.5,fontSize:5.5+e*2,initial:{opacity:0},animate:{opacity:[0,1,0],y:[3,-4],x:[0,2.5]},transition:{...EG,duration:2.6,delay:e*.8,ease:`easeOut`},children:`z`},e))})}function MG(){return(0,I.jsx)(`g`,{className:`fill-primary`,fontSize:`9`,children:[0,1].map(e=>(0,I.jsx)(z.text,{x:48,y:20,initial:{opacity:0},animate:{opacity:[0,1,1,0],y:[2,-5,-11,-17],x:[0,3,1,5],rotate:[0,12,-8,10]},transition:{...EG,duration:3,delay:e*1.5,ease:`easeOut`},style:kG,children:e?`♫`:`♪`},e))})}function NG(){return(0,I.jsx)(z.text,{x:52,y:14,fontSize:`12`,fontWeight:`700`,className:`fill-primary`,initial:{opacity:0,scale:0},animate:{opacity:[0,0,1,1,0],scale:[0,0,1.2,1,.6],rotate:[0,0,-12,8,0]},transition:{...EG,duration:4,times:[0,.5,.58,.85,1]},style:kG,children:`?`})}function PG({spots:e,rainbow:t}){return(0,I.jsx)(`g`,{children:e.map(([e,n,r],i)=>(0,I.jsx)(z.path,{d:DG,className:t?void 0:`fill-primary`,style:{x:e,y:n,...t?{fill:OG[i%OG.length]}:{}},initial:{scale:0},animate:{scale:[0,1.1,0],rotate:[0,90,180]},transition:{...EG,duration:1.3,delay:r,ease:`easeInOut`}},i))})}function FG(){return(0,I.jsx)(`g`,{children:[-20,20].map((e,t)=>(0,I.jsxs)(`g`,{transform:`rotate(${e} 32 34)`,children:[(0,I.jsx)(`ellipse`,{cx:32,cy:34,rx:30,ry:9,fill:`none`,strokeWidth:.8,strokeDasharray:`2 3`,className:`stroke-primary/35`}),(0,I.jsx)(z.circle,{r:2,className:`fill-primary`,animate:{cx:[2,32,62,32,2],cy:[34,43,34,25,34]},transition:{...EG,duration:1.1,delay:t*.55,ease:`linear`}})]},e))})}function IG(){return(0,I.jsx)(z.path,{d:`M53 22 Q56 27 53 29 Q50 27 53 22Z`,className:`fill-primary/60`,animate:{y:[0,8],opacity:[0,1,0]},transition:{...EG,duration:.9,ease:`easeIn`,repeatDelay:.5}})}function LG({id:e}){return(0,I.jsx)(z.circle,{cx:32,cy:34,r:27,fill:`url(#${e}-glow)`,animate:{scale:[.92,1.08,.92],opacity:[.5,.85,.5]},transition:{...EG,duration:1.6,ease:`easeInOut`},style:{transformOrigin:`32px 34px`}})}function RG({rainbow:e}){return(0,I.jsx)(`g`,{children:Array.from({length:8},(t,n)=>{let r=n/8*Math.PI*2;return(0,I.jsx)(z.circle,{cx:32,cy:34,r:2,className:e?void 0:`fill-primary`,style:e?{fill:OG[n%OG.length]}:void 0,initial:{opacity:1,scale:1},animate:{cx:32+Math.cos(r)*32,cy:34+Math.sin(r)*30,opacity:0,scale:.3},transition:{duration:.6,ease:`easeOut`}},n)})})}function zG({level:e,move:t}){let n={fill:`none`,strokeWidth:2.2,strokeLinecap:`round`,className:`stroke-foreground`};if(e===`off`)return(0,I.jsx)(`path`,{d:`M20 33 Q24.5 36.5 29 33 M35 33 Q39.5 36.5 44 33`,...n});if(e===`low`)return(0,I.jsx)(`path`,{d:`M20 34 Q24.5 29.5 29 34 M35 34 Q39.5 29.5 44 34`,...n});if(e===`max`)return(0,I.jsx)(`g`,{children:[25,39].map((e,n)=>(0,I.jsx)(z.path,{d:`M0 -5.5 L1.6 -1.6 L5.5 0 L1.6 1.6 L0 5.5 L-1.6 1.6 L-5.5 0 L-1.6 -1.6Z`,style:{x:e,y:33,fill:OG[n?4:0]},animate:t?{rotate:[0,90,180],scale:[1,1.25,1]}:{},transition:{...EG,duration:1.2,ease:`easeInOut`,delay:n*.2}},e))});let r=e===`minimal`?.45:e===`high`?.7:e===`xhigh`?1.2:1,i=t&&e===`medium`?{x:[0,-2.5,-2.5,2.5,2.5,0]}:{x:0},a=t&&e===`medium`?{...EG,duration:4,times:[0,.12,.4,.52,.8,1]}:{duration:.2},o=e===`minimal`?3.2:e===`xhigh`?1.4:3.6,s=t?{scaleY:[r,r,.1,r,r]}:{scaleY:r},c=t?{...EG,duration:o,times:[0,.44,.5,.56,1]}:{duration:.2};return(0,I.jsx)(z.g,{animate:i,transition:a,children:[25,39].map(t=>(0,I.jsxs)(`g`,{children:[(0,I.jsx)(z.ellipse,{cx:t,cy:33,rx:3.4,ry:3.8,className:`fill-foreground`,style:kG,animate:s,transition:c}),e===`minimal`?null:(0,I.jsx)(`circle`,{cx:t+1.2,cy:31.6,r:1,className:`fill-card`})]},t))})}function BG({level:e,move:t}){let n={fill:`none`,strokeWidth:2,strokeLinecap:`round`,className:`stroke-foreground`};switch(e){case`off`:return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`circle`,{cx:32,cy:42,r:1.4,className:`fill-foreground`}),t?(0,I.jsx)(z.circle,{cx:35,cy:42,r:3,fill:`none`,strokeWidth:.9,className:`stroke-primary/60`,animate:{scale:[.2,1.3,1.5,0],opacity:[.6,.9,.9,0]},transition:{...EG,duration:4,times:[0,.7,.9,1]},style:{transformOrigin:`33px 42px`}}):null]});case`minimal`:return(0,I.jsx)(z.ellipse,{cx:32,cy:42,rx:3,ry:.8,className:`fill-foreground`,animate:t?{ry:[.8,.8,3.6,3.6,.8],rx:[3,3,3.6,3.6,3]}:{},transition:{...EG,duration:6,times:[0,.6,.7,.85,1]}});case`low`:return(0,I.jsx)(`path`,{d:`M26 40 Q32 45 38 40`,...n});case`medium`:return(0,I.jsx)(`path`,{d:`M28 41.5 Q32 43 36 41.5`,...n});case`high`:return(0,I.jsx)(`path`,{d:`M27 42 L37 41`,...n});case`xhigh`:return(0,I.jsx)(`path`,{d:`M25.5 39.5 Q32 47 38.5 39.5Z`,className:`fill-foreground`});case`max`:return(0,I.jsxs)(`g`,{children:[(0,I.jsx)(`path`,{d:`M24 38.5 Q32 50 40 38.5Z`,className:`fill-foreground`}),(0,I.jsx)(`path`,{d:`M28.5 44.5 Q32 47.5 35.5 44.5 Q32 43 28.5 44.5Z`,style:{fill:`var(--rainbow-1)`}})]})}}function VG({level:e,className:t}){let n=Jd()??!1,r=TG.includes(e)?e:`medium`,i=`m${(0,m.useId)().replace(/[^a-zA-Z0-9]/g,``)}`,a=!n,o=TG.indexOf(r),s=(0,m.useRef)(o),[c,l]=(0,m.useState)({n:0,up:!0});(0,m.useEffect)(()=>{o!==s.current&&(l(e=>({n:e.n+1,up:o>s.current})),s.current=o)},[o]);let u=AG(r),d=r===`max`,f=d?{stroke:`url(#${i}-rainbow)`}:void 0,p=!a||c.n===0?void 0:c.up?{y:[0,-9,0,0],scaleX:[1,.9,1.1,1],scaleY:[1,1.12,.9,1]}:{y:[0,0,0],scaleX:[1,1.12,1],scaleY:[1,.84,1]};return(0,I.jsxs)(`svg`,{viewBox:`0 0 64 64`,"data-slot":`effort-mascot`,"data-level":r,"aria-hidden":`true`,focusable:`false`,className:q(`size-14 shrink-0 overflow-visible`,t),children:[(0,I.jsxs)(`defs`,{children:[(0,I.jsxs)(`linearGradient`,{id:`${i}-rainbow`,x1:`0`,y1:`0`,x2:`1`,y2:`1`,children:[OG.map((e,t)=>(0,I.jsx)(`stop`,{offset:t/(OG.length-1),stopColor:e},t)),a&&d?(0,I.jsx)(`animateTransform`,{attributeName:`gradientTransform`,type:`rotate`,from:`0 0.5 0.5`,to:`360 0.5 0.5`,dur:`2.4s`,repeatCount:`indefinite`}):null]}),(0,I.jsxs)(`radialGradient`,{id:`${i}-glow`,children:[(0,I.jsx)(`stop`,{offset:`0.35`,stopColor:`var(--rainbow-6)`,stopOpacity:`0.45`}),(0,I.jsx)(`stop`,{offset:`0.7`,stopColor:`var(--rainbow-1)`,stopOpacity:`0.18`}),(0,I.jsx)(`stop`,{offset:`1`,stopColor:`var(--rainbow-3)`,stopOpacity:`0`})]})]}),d?a?(0,I.jsx)(LG,{id:i}):(0,I.jsx)(`circle`,{cx:32,cy:34,r:27,fill:`url(#${i}-glow)`}):null,a&&r===`xhigh`?(0,I.jsx)(FG,{}):null,(0,I.jsx)(z.g,{animate:p,transition:{duration:c.up?.55:.45,ease:`easeOut`},style:{transformOrigin:`32px 56px`},children:(0,I.jsxs)(z.g,{animate:a?u.animate:{rotate:r===`off`?-5:0},transition:a?u.transition:{duration:0},style:{transformOrigin:`32px 56px`},children:[(0,I.jsxs)(z.g,{style:{transformOrigin:`32px 17px`},animate:r===`off`?{rotate:32}:r===`minimal`?{rotate:14}:a&&r===`medium`?{rotate:[0,-12,10,0]}:a&&(r===`xhigh`||r===`max`)?{rotate:[-10,10,-10]}:{rotate:0},transition:a&&(r===`medium`||r===`xhigh`||r===`max`)?{...EG,duration:r===`medium`?2:.5,ease:`easeInOut`}:{type:`spring`,stiffness:200,damping:14},children:[(0,I.jsx)(`path`,{d:`M32 17 V10`,strokeWidth:2,strokeLinecap:`round`,className:d?void 0:`stroke-primary/70`,style:f}),(0,I.jsx)(z.circle,{cx:32,cy:7.5,r:3.2,className:d?void 0:r===`off`?`fill-muted-foreground/40`:`fill-primary`,style:{...kG,...d?{fill:`url(#${i}-rainbow)`}:{}},animate:a?r===`high`?{opacity:[1,.3,1]}:r===`medium`?{scale:[1,1.25,1]}:d||r===`xhigh`?{scale:[1,1.5,1]}:{scale:1,opacity:1}:{scale:1,opacity:1},transition:{...EG,duration:r===`high`?.5:r===`medium`?1.6:.4}})]}),[4.5,54].map((e,t)=>(0,I.jsx)(z.rect,{x:e,y:29,width:5.5,height:11,rx:2.5,className:d?void 0:`fill-primary/25`,style:{...kG,...d?{fill:OG[t?5:1],opacity:.6}:{}},animate:a&&(r===`xhigh`||d)?{rotate:t?[0,18,0]:[0,-18,0]}:{rotate:0},transition:{...EG,duration:.35}},e)),(0,I.jsx)(`rect`,{x:10,y:17,width:44,height:36,rx:11,strokeWidth:d?2.6:2,className:d?`fill-primary/10`:`fill-primary/10 stroke-primary/75`,style:f}),(0,I.jsx)(`rect`,{x:15,y:23,width:34,height:25,rx:7.5,className:`fill-card stroke-border`,strokeWidth:1}),a&&r===`high`?(0,I.jsx)(z.rect,{y:24,width:2,height:23,rx:1,className:`fill-primary/25`,animate:{x:[16,46,16]},transition:{...EG,duration:1.6,ease:`easeInOut`}}):null,r===`low`||d?(0,I.jsxs)(`g`,{className:`fill-destructive/25`,children:[(0,I.jsx)(`ellipse`,{cx:19.5,cy:39.5,rx:2.6,ry:1.6}),(0,I.jsx)(`ellipse`,{cx:44.5,cy:39.5,rx:2.6,ry:1.6})]}):null,(0,I.jsx)(zG,{level:r,move:a}),r===`high`||r===`xhigh`?(0,I.jsx)(`path`,{d:`M20 27 L28.5 28.8 M44 27 L35.5 28.8`,strokeWidth:1.9,strokeLinecap:`round`,className:`stroke-foreground`}):null,(0,I.jsx)(BG,{level:r,move:a}),(0,I.jsx)(`rect`,{x:20,y:53,width:24,height:4,rx:2,className:d?void 0:`fill-primary/25`,style:d?{fill:`url(#${i}-rainbow)`}:void 0})]})},c.n),r===`off`?a?(0,I.jsx)(jG,{}):(0,I.jsx)(`text`,{x:48,y:14,fontSize:`9`,fontWeight:`700`,className:`fill-muted-foreground`,children:`z`}):null,a&&r===`minimal`?(0,I.jsx)(jG,{}):null,a&&r===`low`?(0,I.jsx)(MG,{}):null,a&&r===`medium`?(0,I.jsx)(NG,{}):null,a&&r===`high`?(0,I.jsx)(PG,{spots:[[6,14,0],[58,12,.6]]}):null,a&&r===`xhigh`?(0,I.jsx)(IG,{}):null,d?a?(0,I.jsx)(PG,{rainbow:!0,spots:[[5,12,0],[59,10,.2],[2,44,.45],[62,46,.65],[32,-2,.85],[14,60,1.05],[50,60,.3]]}):(0,I.jsx)(`g`,{children:[[5,12],[59,10],[32,-2]].map(([e,t],n)=>(0,I.jsx)(`path`,{d:DG,style:{x:e,y:t,fill:OG[n*2]}},n))}):null,a&&c.n>0&&c.up?(0,I.jsx)(RG,{rainbow:d},`burst-${c.n}`):null]})}var HG={minimal:`min`,medium:`med`},UG={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 WG(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 GG(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 KG({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),_=WG(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 WG(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:GG(t,n,r,1),ArrowUp:GG(t,n,r,1),ArrowLeft:GG(t,n,r,-1),ArrowDown:GG(t,n,r,-1),Home:WG(t,n,0),End:WG(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,I.jsxs)(`div`,{className:q(`flex flex-col gap-1`,a&&`opacity-60`),children:[(0,I.jsxs)(`div`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`span`,{"data-level":b,className:`effort-word text-[0.8125rem] font-medium capitalize`,"aria-hidden":`true`,children:b}),(0,I.jsx)(`span`,{className:`min-w-0 truncate text-xs text-muted-foreground`,children:UG[b]??``})]}),(0,I.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,I.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,I.jsx)(z.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,I.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,I.jsx)(z.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,I.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,I.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:HG[e]??e},e)})}),x?(0,I.jsxs)(`p`,{className:`text-xs text-warning`,children:[e,` is not supported by `,r??`this model`,`, so it runs at `,b,`.`]}):null]})}function qG(e,t){let n=`${e.label} ${e.hint??``} ${e.value}`.toLowerCase();return t.toLowerCase().split(/\s+/).filter(Boolean).every(e=>n.includes(e))}function JG({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=>qG(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,I.jsxs)(WT,{open:o,onOpenChange:s,children:[(0,I.jsxs)(GT,{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(`btn-raised 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,I.jsx)(`span`,{className:`min-w-0 truncate`,children:g?.label??e}),(0,I.jsx)(Mp,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`})]}),(0,I.jsx)(KT,{children:(0,I.jsxs)(qT,{align:`start`,sideOffset:4,collisionPadding:8,onOpenAutoFocus:e=>{e.preventDefault(),e.currentTarget.querySelector(`input`)?.focus()},className:`glass-pop z-50 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,I.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-2.5`,children:[(0,I.jsx)(Ph,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,I.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,I.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,I.jsxs)(`p`,{className:`px-2.5 py-2 text-xs text-muted-foreground`,children:[`Nothing matches “`,c,`”.`]}):null,h.map((t,n)=>(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,I.jsx)(`span`,{className:`truncate`,children:t.label}),t.hint?(0,I.jsx)(`span`,{className:`line-clamp-2 text-xs text-muted-foreground`,children:t.hint}):null]}),t.value===e?(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]},t.value))]})]})})]})}function YG({label:e,help:t,children:n,stacked:r}){return(0,I.jsxs)(`div`,{className:r?`grid gap-1.5`:`grid gap-1.5 sm:grid-cols-[minmax(0,1fr)_minmax(0,18rem)] sm:items-center sm:gap-6`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,I.jsx)(`div`,{className:`min-w-0`,children:n})]})}function XG({children:e}){return(0,I.jsx)(`div`,{className:`flex flex-col divide-y divide-border rounded-xl border border-border px-4 [&>*]:py-3`,children:e})}function ZG({value:e,items:t,label:n,onChange:r}){return(0,I.jsx)(JG,{value:e,options:t.map(e=>({value:e.value,label:e.label,...e.help?{hint:e.help}:{}})),label:n,onChange:r})}var QG=`(prefers-color-scheme: dark)`,$G=[`dark`,`light`,`system`],eK=m.createContext(void 0);function tK(e){return e!==null&&$G.includes(e)}function nK(){return window.matchMedia(QG).matches?`dark`:`light`}function rK(){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 iK(e){return e instanceof HTMLElement&&!!(e.isContentEditable||e.closest(`input, textarea, select, [contenteditable='true']`))}function aK({children:e,defaultTheme:t=`system`,storageKey:n=`theme`,disableTransitionOnChange:r=!0,...i}){let[a,o]=m.useState(()=>{let e=localStorage.getItem(n);return tK(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`?nK():e,i=r?rK():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(QG),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||iK(e.target)||e.key.toLowerCase()===`d`&&o(e=>{let t=e===`dark`?`light`:e===`light`?`dark`:nK()===`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(tK(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,I.jsx)(eK.Provider,{...i,value:l,children:e})}var oK=()=>{let e=m.useContext(eK);if(e===void 0)throw Error(`useTheme must be used within a ThemeProvider`);return e},sK=[`master`,`designer`,`backend`,`qa`,`scout`,`researcher`,`quickfix`,`planner`],cK={master:`Master`,designer:`Designer`,backend:`Backend`,qa:`QA`,scout:`Scout`,researcher:`Researcher`,quickfix:`Quick fix`,planner:`Planner`},lK={model:`Model`,thinking:`Effort`,timeout:`Time limit`,instructions:`Instructions`},uK=`inherit`,dK=`inherit`,fK=`Use the session's current model`,pK=`__custom__`,mK=`custom…`,hK=`Type a provider/model id`,gK=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`,`max`],_K={agents:`Agents`,workflow:`Workflow`,lobby:`Lobby`,classifier:`Classifier`,appearance:`Appearance`,notifications:`Notifications`,install:`Install as app`},vK=[{id:`issues`,label:`Issues tab`,help:`the GitHub Issues tab`}],yK=[{id:`conversation`,label:`Conversation pane`},{id:`activity`,label:`Activity log pane`},{id:`thinking`,label:`Thinking bubble`}],bK=`shown on the Lobby tab`,xK=`Planning rounds`,SK=`how many rounds the panel gets before the oracle settles the rest alone`,CK=[2,3,5,8,0],wK=`Split long plans`,TK=`saving a plan with more steps offers to split it into up to 5 tasks`,EK=[6,8,10,12,0],DK=`Port`,OK=`the base port (then the next free up to +20); 0 means any free port; applies the next time pi starts`,kK=`Open browser`,AK=`open this page in the browser when pi starts`,jK=[{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`}],MK=`Git isolation`,NK=[{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`}],PK=[{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:`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, Jev picks the sections that bear on the step, and the agent is told where the rest is`},{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`}],FK={enabled:`Classifier`,enabledHelp:`Jev makes the obvious decisions so large models spend fewer tokens on them`,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`},IK={title:`Settings`,intro:`Each agent's model and effort, 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`},LK=`https://tweakcn.com/editor/theme`;function RK(){let{theme:e}=oK();return e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches}function zK({palette:e,dark:t}){let n=de(e,t);return(0,I.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,I.jsx)(`span`,{className:`size-4 rounded-full border border-black/10`,style:{background:n.card}}),(0,I.jsx)(`span`,{className:`size-4 rounded-full`,style:{background:n.primary}}),(0,I.jsx)(`span`,{className:`h-2 flex-1 rounded-full`,style:{background:n.accent}})]})}function BK(){let e=be(),t=RK(),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,I.jsx)(`div`,{ref:n,role:`radiogroup`,"aria-label":`Colour theme`,onKeyDown:r,className:`grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4`,children:e.all.map(n=>{let r=n.id===e.active.id;return(0,I.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,I.jsx)(zK,{palette:n,dark:t}),(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2 px-0.5 text-[0.8125rem] font-medium`,children:[(0,I.jsxs)(`span`,{className:`truncate`,children:[n.name,n.id===`custom`?(0,I.jsx)(`span`,{className:`ml-1.5 text-xs font-normal text-muted-foreground`,children:`imported`}):null]}),r?(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-primary`}):null]})]},n.id)})})}function VK(){let e=be(),[t,n]=(0,m.useState)(``),[r,i]=(0,m.useState)(),a=(0,m.useRef)(null);function o(t,r){let a=re(t);if(`error`in a){i(a.error);return}i(void 0);let o=e.adopt(a,r);n(``);let s=a.light?a.dark?void 0:`dark`:`light`;B.success(s?`${o.name} applied. It has no ${s} colours, so ${s} mode keeps the default ones.`:`${o.name} applied.`)}async function s(e){if(e){if(e.size>2e5){i(`That file is too large to be a theme.`);return}o(await e.text(),e.name.replace(/\.[^.]+$/,``)||`Custom theme`)}}return(0,I.jsxs)(`div`,{className:`grid gap-2`,children:[(0,I.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Pick or build a theme in the`,` `,(0,I.jsxs)(`a`,{href:LK,target:`_blank`,rel:`noreferrer noopener`,className:`inline-flex items-center gap-0.5 text-link underline-offset-2 hover:underline`,children:[`tweakcn editor `,(0,I.jsx)(fm,{"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,I.jsx)(wO,{value:t,onChange:e=>{n(e.target.value),i(void 0)},rows:4,spellCheck:!1,"aria-label":`Theme CSS from tweakcn`,"aria-invalid":r?!0:void 0,placeholder:`:root {
|
|
95
95
|
--background: oklch(0.98 0 0);
|
|
96
96
|
--primary: oklch(0.55 0.2 260);
|
|
97
97
|
…
|
|
98
98
|
}
|
|
99
|
-
.dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`input`,{ref:a,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{s(e.target.files?.[0]),e.target.value=``}}),(0,I.jsx)(Y,{label:`Apply the pasted theme`,text:`Apply`,icon:Op,tone:`primary`,disabled:!t.trim(),onClick:()=>o(t,`Custom theme`)}),(0,I.jsx)(Y,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:Jh,onClick:()=>a.current?.click()}),e.custom?(0,I.jsx)(OO,{label:`Remove ${e.custom.name}`,text:`Remove`,title:`Remove the imported theme?`,description:`The imported theme is stored in this browser. Keep a copy if you want to use it again.`,confirmLabel:`Remove theme`,icon:Hh,variant:`destructive`,onConfirm:()=>e.removeCustom()}):null,r?(0,I.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:r}):null]})]})}function cK(){let{theme:e,setTheme:t}=EG(),n=bW();return(0,I.jsx)(LR,{prominent:!0,title:LG.appearance,children:(0,I.jsxs)(gG,{children:[(0,I.jsx)(hG,{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,I.jsx)(WW,{checked:!n,onCheckedChange:e=>vW(!e),"aria-label":`Prompt sounds`})}),(0,I.jsx)(hG,{label:nK.themeLabel,help:nK.appearanceHelp,children:(0,I.jsx)(_G,{value:e,items:nK.themeItems.map(e=>({value:e.id,label:e.label})),label:nK.themeLabel,onChange:e=>t(e)})}),(0,I.jsx)(hG,{label:`Colour theme`,help:`The page's colours. Kept in this browser only.`,stacked:!0,children:(0,I.jsx)(oK,{})}),(0,I.jsx)(hG,{label:`Import a theme`,stacked:!0,children:(0,I.jsx)(sK,{})})]})})}var lK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},uK=[...RG,...zG.map(e=>({id:`panel:${e.id}`,label:e.label,help:BG}))];function dK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function fK(e,t){return lK[e].reduceRight((e,t)=>({[t]:e}),t)}function pK(e,t){return e.find(e=>e.id===t)?.thinkingLevels??IG}function mK(e,t){return IG[uG(IG,e,Math.max(0,IG.indexOf(t)))]??t}var hK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,gK=e=>e>0?`over ${e} steps`:`never`;function _K({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function vK(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:AG,label:jG,help:MG}]:[],...e.none?[{value:AG,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:AG,label:jG,help:MG}]:[],...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:FG}]:[],{value:NG,label:PG,help:FG}],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,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(_G,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(UW,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,I.jsx)(Y,{label:`Use this model`,icon:Op,tone:`primary`,onClick:c})]}):null]})}function yK({label:e,help:t,checked:n,onChange:r}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,I.jsx)(WW,{checked:n,onCheckedChange:r,"aria-label":e})]})}function bK({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,I.jsx)(UW,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function xK({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,I.jsx)(CK,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(B.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function SK({value:e,onSave:t}){return(0,I.jsx)(CK,{label:qG,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(B.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function CK({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,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(UW,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:i?`pr-10`:void 0,onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,I.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 wK({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(fO,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function TK({kind:e,config:t,models:n,save:r}){let i=dK(t,e),a=t=>r(fK(e,t)),o=OG[e],s=pK(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!pK(n,t).includes(i.thinking)&&(r.thinking=mK(pK(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:mK(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,I.jsxs)(`section`,{className:`glass flex min-w-0 flex-col gap-3 rounded-xl p-4`,children:[(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:o}),(0,I.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,I.jsx)(_K,{label:kG.model,children:(0,I.jsx)(vK,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3`,children:[(0,I.jsx)(sG,{level:l,className:`size-16`}),(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:kG.thinking}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,I.jsx)(fG,{value:i.thinking,levels:IG,supported:s,model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,I.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[u?(0,I.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 items-center gap-1 rounded-md text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:[(0,I.jsx)(Mp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),kG.instructions,!d&&i.instructions?(0,I.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,I.jsx)(`span`,{}),e===`master`?null:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Time limit`}),(0,I.jsx)(`div`,{className:`w-24`,children:(0,I.jsx)(xK,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,I.jsx)(wK,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null]})}function EK(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function DK({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,I.jsx)(yK,{label:t.label,help:t.help,checked:EK(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function OK({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,I.jsx)(LR,{prominent:!0,title:LG.workflow,children:(0,I.jsx)(gG,{children:(0,I.jsx)(hG,{label:QG,help:ZG.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,I.jsx)(_G,{value:n,items:ZG.map(e=>({value:e.id,label:e.label})),label:QG,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}function kK({config:e,save:t}){let n=e.lobby.web;return(0,I.jsx)(LR,{prominent:!0,title:LG.lobby,children:(0,I.jsxs)(gG,{children:[uK.map(n=>(0,I.jsx)(DK,{config:e,item:n,save:t},n.id)),(0,I.jsx)(hG,{label:VG,help:HG,children:(0,I.jsx)(_G,{value:String(e.lobby.maxPlanningRounds),items:UG.map(e=>({value:String(e),label:hK(e)})),label:VG,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,I.jsx)(hG,{label:WG,help:GG,children:(0,I.jsx)(_G,{value:String(e.lobby.splitPlanAbove),items:KG.map(e=>({value:String(e),label:gK(e)})),label:WG,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,I.jsx)(hG,{label:qG,help:JG,children:(0,I.jsx)(SK,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,I.jsx)(yK,{label:YG,help:XG,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function AK({config:e,models:t,save:n}){let r=e.classifier,i=$G.find(e=>e.id===r.provider)?.label;return(0,I.jsx)(LR,{prominent:!0,title:LG.classifier,children:(0,I.jsxs)(gG,{children:[(0,I.jsx)(yK,{label:tK.enabled,help:tK.enabledHelp,checked:r.enabled,onChange:e=>void n({classifier:{enabled:e}})}),(0,I.jsx)(hG,{label:tK.host,children:(0,I.jsx)(_G,{value:r.provider,items:$G.map(e=>({value:e.id,label:e.label})),label:tK.host,onChange:e=>void n({classifier:{provider:e}})})}),(0,I.jsx)(hG,{label:tK.model,help:tK.modelHelp,children:(0,I.jsx)(bK,{value:r.model,label:tK.model,placeholder:`the host's default`,onSave:e=>void n({classifier:{model:e}})})}),(0,I.jsx)(hG,{label:tK.key,help:tK.keyNote,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:i??r.provider})}),eK.map(e=>(0,I.jsx)(yK,{label:e.label,help:e.help,checked:r.features[e.id],onChange:t=>void n({classifier:{features:{[e.id]:t}}})},e.id)),(0,I.jsx)(hG,{label:tK.cheap,help:tK.cheapHelp,children:(0,I.jsx)(vK,{value:r.effort.cheapModel,models:t,label:tK.cheap,none:!0,onChange:e=>void n({classifier:{effort:{cheapModel:e}}})})})]})})}function jK(){let e=AW(),t=async e=>{if(!e)return MW();let t=await jW();t===`granted`?B.success(nK.notificationsOn):B.error(t===`unsupported`?nK.notificationsUnsupported:nK.notificationsBlocked)};return(0,I.jsx)(LR,{prominent:!0,title:LG.notifications,children:(0,I.jsx)(gG,{children:(0,I.jsx)(yK,{label:nK.notificationsLabel,help:nK.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function MK(){let{available:e,install:t}=y(),n=b(),r=x();return(0,I.jsx)(LR,{prominent:!0,title:LG.install,children:(0,I.jsxs)(gG,{children:[(0,I.jsx)(hG,{label:nK.installLabel,help:n?nK.installedNow:nK.installHelp,children:n?null:(0,I.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,I.jsx)(Y,{label:nK.installButton,icon:im,tone:`primary`,onClick:()=>e?void t().then(()=>B.success(nK.installDone)):B.warning(nK.installUnavailable)})})}),r.supported?(0,I.jsx)(hG,{label:nK.fullscreenLabel,help:nK.fullscreenHelp,children:(0,I.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,I.jsx)(Y,{label:r.on?nK.fullscreenOn:nK.fullscreenOff,icon:r.on?Hm:Pm,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var NK=[`Agents`,`Workflow`,`Lobby`,`Classifier`,`Appearance & notifications`];function PK({config:e,models:t,onConfig:n}){let[r,i]=(0,m.useState)(`Agents`),a=(0,m.useRef)(Promise.resolve()),o=e=>{let t=async()=>{try{return n((await qf(`settings.set`,{patch:e})).config),B.success(nK.saved),!0}catch(e){return B.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},r=a.current.then(t,t);return a.current=r,r};return(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,children:[(0,I.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:nK.title}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:nK.intro})]}),(0,I.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 flex flex-wrap gap-1 border-b border-border pb-3`,children:NK.map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":r===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>i(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`,r===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,I.jsx)(`div`,{id:`settings-Agents`,hidden:r!==`Agents`,"aria-hidden":r!==`Agents`,children:(0,I.jsx)(LR,{prominent:!0,title:LG.agents,children:(0,I.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:DG.map(n=>(0,I.jsx)(TK,{kind:n,config:e,models:t,save:o},n))})})}),(0,I.jsx)(`div`,{id:`settings-Workflow`,hidden:r!==`Workflow`,"aria-hidden":r!==`Workflow`,children:(0,I.jsx)(OK,{config:e,save:o})}),(0,I.jsx)(`div`,{id:`settings-Lobby`,hidden:r!==`Lobby`,"aria-hidden":r!==`Lobby`,children:(0,I.jsx)(kK,{config:e,save:o})}),(0,I.jsx)(`div`,{id:`settings-Classifier`,hidden:r!==`Classifier`,"aria-hidden":r!==`Classifier`,children:(0,I.jsx)(AK,{config:e,models:t,save:o})}),(0,I.jsx)(`div`,{id:`settings-Appearance`,hidden:r!==`Appearance & notifications`,"aria-hidden":r!==`Appearance & notifications`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,I.jsx)(cK,{}),(0,I.jsx)(jK,{}),(0,I.jsx)(MK,{})]})})]})}function FK(){return(0,I.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,role:`status`,"aria-label":nK.loading,children:[0,1,2,3].map(e=>(0,I.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function IK(){let e=DD(`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,I.jsx)(xD,{message:`${nK.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,I.jsx)(PK,{config:t,models:e.data?.models??[],onConfig:i}):(0,I.jsx)(FK,{})}function LK(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 RK({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,I.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>LK(e,()=>void d(),()=>{o||r()}),children:[(0,I.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,I.jsx)(fO,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,I.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(J,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,I.jsx)(J,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}function zK({questions:e}){return(0,I.jsx)(`ol`,{className:`flex flex-col gap-3`,children:e.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex flex-col gap-1 text-sm`,children:[(0,I.jsxs)(`p`,{children:[(0,I.jsxs)(`span`,{className:`tabular-nums text-muted-foreground`,children:[String(t+1).padStart(2,`0`),`. `]}),(0,I.jsx)(`span`,{className:q(`font-medium`,$V(e.from)),children:QV(e.from)}),` `,e.text]}),(0,I.jsx)(`ul`,{className:`flex flex-col gap-0.5 pl-6 text-muted-foreground`,children:e.options.map(e=>(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mt-2 size-1.5 shrink-0 rounded-full border border-muted-foreground/60`}),(0,I.jsxs)(`span`,{children:[e.label,e.description?` — ${e.description}`:``]})]},e.label))})]},t))})}function BK({message:e}){return(0,I.jsx)(I.Fragment,{children:(e.decided??[]).map((e,t)=>(0,I.jsxs)(`p`,{className:`text-sm`,children:[(0,I.jsx)(Op,{"aria-hidden":`true`,className:`mr-1 inline size-3.5 text-success`}),(0,I.jsx)(`span`,{className:q(`font-medium`,$V(e.from)),children:QV(e.from)}),` `,e.question,` → `,(0,I.jsx)(`strong`,{children:e.answer}),` `,(0,I.jsxs)(`span`,{className:`text-muted-foreground`,children:[`· decided by the classifier (`,e.probability.toFixed(2),`); comment on the plan to overrule`]})]},t))})}function VK({message:e,index:t,busy:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??0)>(e.editedAt??0)?a:e,c=n||s!==e;return(0,I.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[e.at>0?mO(e.at):``,` You`,s.editedAt?` (edited)`:``]}),(0,I.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:r?(0,I.jsx)(RK,{text:s.text,disabled:n,onSave:async n=>{let r=await qf(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});o(r.message)},onCancel:()=>i(!1)}):(0,I.jsx)(PR,{text:s.text})}),!e.settled?.length&&!r?(0,I.jsx)(J,{size:`sm`,variant:`ghost`,disabled:c,onClick:()=>i(!0),children:`Edit`}):null]})}function HK({message:e,index:t,busy:n}){let r=e.at>0?mO(e.at):``;if(e.role===`you`)return(0,I.jsx)(VK,{message:e,index:t,busy:n});let i=e.questions??[];return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`Panel`}),` `,r]}),i.length>0?(0,I.jsx)(zK,{questions:i}):(0,I.jsx)(PR,{text:e.text}),(0,I.jsx)(BK,{message:e})]})}function UK({messages:e,seed:t,busy:n=!1}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-5`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t}):null,e.map((e,t)=>(0,I.jsx)(HK,{message:e,index:t,busy:n},`${e.at}-${t}`))]})}var WK=`ORACLE`,GK=`No draft yet.`,KK=`The draft appears after the panel's first round.`,qK=`What each seat needs`,JK=[`backend`,`designer`,`qa`,`researcher`],YK={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},XK=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,ZK={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.`},QK=[{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 $K(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function eq(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 tq(e,t){return`${e} ${t}${e===1?``:`s`}`}function nq(e){return e.round===0&&e.messages.length===0&&!e.busy}function rq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${YK[t.member]} failed`).split(`
|
|
100
|
-
`)[0]}function
|
|
101
|
-
`).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function cq({notes:e}){return(0,I.jsx)(I.Fragment,{children:e.map((e,t)=>(0,I.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))})}function lq({row:e,notes:t,onComment:n}){let r=e.text.trim(),i=()=>n(r);return(0,I.jsxs)(`li`,{className:`group/line`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,I.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:t.length>0?(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,I.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,I.jsx)(PR,{text:e.text})}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground 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,I.jsx)(Rm,{"aria-hidden":`true`})})]}),(0,I.jsx)(cq,{notes:t})]})}function uq({draft:e,comments:t,onComment:n}){return(0,I.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:sq(e).map((e,r)=>e.text.trim()?(0,I.jsx)(lq,{row:e,notes:t.get(e.text.trim())??[],onComment:n},r):(0,I.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},r))})}function dq({notes:e}){return e.length===0?null:(0,I.jsx)(LR,{title:qK,children:(0,I.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,$V(e.from)),children:QV(e.from)}),(0,I.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(PR,{text:e.text})})]},t))})})}function fq({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:q(`font-medium`,e.seated?$V(e.label):`text-muted-foreground`),children:QV(e.label)}),e.working&&!t?(0,I.jsx)(yD,{className:`size-3.5`,"aria-hidden":`true`}):null,(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function pq({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]`;if(!r)return(0,I.jsx)(`li`,{className:q(i,`bg-muted`),children:(0,I.jsx)(fq,{cell:e,intro:t})});let a=async()=>{await V(`planner.toggleSeat`,{member:r})&&n()};return(0,I.jsx)(`li`,{children:(0,I.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,I.jsx)(PB,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${QV(e.label)} sits on the panel`}),(0,I.jsx)(fq,{cell:e,intro:t})]})})}function mq({cells:e,intro:t,onToggled:n}){return(0,I.jsx)(`ul`,{"aria-label":`Panel`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,I.jsx)(pq,{cell:e,intro:t,onToggled:n},e.label))})}function hq({cell:e,onToggled:t}){let{member:n}=e,r=QV(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))]`:`border-dashed border-input bg-transparent`),a=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:q(`orb orb-dot`,!e.seated&&`opacity-40 grayscale`)}),(0,I.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?$V(e.label):`text-muted-foreground`),children:r})]}),n?(0,I.jsx)(PB,{checked:e.seated,onCheckedChange:()=>void gq(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:ZK[e.label]}),(0,I.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":tH(e.label)};return n?(0,I.jsx)(`li`,{style:o,children:(0,I.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,I.jsx)(`li`,{style:o,children:(0,I.jsx)(`div`,{className:i,children:a})})}async function gq(e,t){await V(`planner.toggleSeat`,{member:e})&&t()}function _q({cells:e,onToggled:t}){return(0,I.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,I.jsx)(hq,{cell:e,onToggled:t},e.label))})}function vq({snap:e}){let t=iq(e),n=!e.busy&&rq(e)!==void 0;return(0,I.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,I.jsx)(yD,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function yq({snap:e,onDone:t}){let n=TD(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await V(e,{})&&t()};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e.questions.length>0&&!e.busy?(0,I.jsx)(Y,{label:`Answer questions`,icon:Im,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,I.jsx)(Y,{label:`Retry`,icon:bh,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,I.jsx)(Y,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:wh,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,I.jsx)(OO,{icon:fm,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 V(`planner.new`,{}).then(t)})]})}function bq({snap:e,onDone:t}){return(0,I.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border px-5 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,I.jsx)(vq,{snap:e})]}),(0,I.jsx)(yq,{snap:e,onDone:t})]}),(0,I.jsx)(mq,{cells:oq(e),intro:!1,onToggled:t})]})}function xq({line:e,onClose:t,onSent:n}){let r=nD(e!==void 0,tD.confirm);return(0,I.jsx)(JE,{open:e!==void 0&&r,onOpenChange:e=>!e&&t(),label:`Comment on this line`,className:`max-w-xl`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-base font-medium`,children:`Comment on this line`}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-3 text-sm break-words text-muted-foreground`,children:e})]}),(0,I.jsx)(Pz,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async r=>e===void 0||!await V(`planner.commentLine`,{line:e,text:r.trim()})?!1:(n(e,r.trim()),t(),!0)})]})})}function Sq({limit:e}){return e<=0?null:(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,I.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function Cq({snap:e,onDone:t}){let n=oq(e);return(0,I.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock sm:px-8 sm:pt-10`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,I.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-11 shrink-0 place-items-center rounded-xl border border-border bg-card text-primary shadow-card`,children:(0,I.jsx)(Sh,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,I.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:XK})]})]}),(0,I.jsx)(Sq,{limit:e.limit})]}),(0,I.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,I.jsx)(IR,{title:`The panel`,right:$K(n)})}),(0,I.jsx)(_q,{cells:n,onToggled:t})]}),(0,I.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,I.jsx)(IR,{title:`How a plan comes together`})}),(0,I.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:QK.map((e,t)=>(0,I.jsxs)(`li`,{className:`relative flex gap-3 rounded-xl border border-border bg-card p-3.5`,children:[(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(mp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,I.jsx)(qE,{chord:`/`,children:`write`}),(0,I.jsx)(qE,{chord:`Enter`,children:`send to the panel`})]})]})})}function wq({snap:e,wide:t}){let{ref:n,onScroll:r}=XV(JSON.stringify(e.messages));return(0,I.jsxs)(sO,{className:`flex flex-col`,children:[(0,I.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,I.jsx)(IR,{title:`Conversation`,className:`w-full`})}),(0,I.jsx)(`div`,{ref:n,onScroll:r,className:q(`min-h-0 overflow-y-auto`,t?`flex-1 px-5 pt-5 pb-dock`:`max-h-[45svh] p-5`),children:(0,I.jsx)(UK,{messages:e.messages,busy:e.busy})})]})}function Tq({snap:e,comments:t,onComment:n,wide:r}){return(0,I.jsxs)(sO,{className:`flex flex-col`,children:[(0,I.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,I.jsx)(IR,{title:`Draft plan`,className:`w-full`})}),(0,I.jsxs)(`div`,{className:q(`flex min-h-0 flex-col gap-5 overflow-y-auto px-5 pt-5 pb-dock`,r&&`flex-1`),children:[e.draft?(0,I.jsx)(uq,{draft:e.draft,comments:t,onComment:n}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.busy?KK:GK}),(0,I.jsx)(dq,{notes:e.notes})]})]})}function Eq({snap:e,reload:t}){let n=oO(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(new Map);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(bq,{snap:e,onDone:t}),(0,I.jsxs)(`div`,{className:n?`grid min-h-0 flex-1 grid-cols-[minmax(0,46fr)_minmax(0,54fr)] grid-rows-[minmax(0,1fr)] divide-x divide-border`:`flex flex-col divide-y divide-border`,children:[(0,I.jsx)(wq,{snap:e,wide:n}),(0,I.jsx)(Tq,{snap:e,comments:a,onComment:i,wide:n})]}),(0,I.jsx)(xq,{line:r,onClose:()=>i(void 0),onSent:(e,t)=>o(n=>new Map(n).set(e,[...n.get(e)??[],t]))})]})}function Dq(){let e=DD(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,I.jsx)(xD,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,I.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=nq(t);return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,I.jsx)(Cq,{snap:t,onDone:e.reload}):(0,I.jsx)(Eq,{snap:t,reload:e.reload})})}var Oq=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function kq(e){return e.prompt.split(`
|
|
102
|
-
`).find(e=>e.trim())?.trim()??`(empty)`}function
|
|
103
|
-
`)?(0,I.jsx)(PR,{text:e.prompt}):null,(0,I.jsx)(Fq,{job:e}),(0,I.jsx)(LR,{title:`Steps`,children:(0,I.jsx)(Iq,{job:e})}),e.files?.length?(0,I.jsx)(LR,{title:`Edited`,children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,I.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,I.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,I.jsx)(LR,{title:`Report`,children:(0,I.jsx)(PR,{text:e.report})}):null]})}function zq({status:e}){if(e===`running`)return(0,I.jsx)(yD,{className:`size-3.5`,"aria-label":`running`});let t={queued:em,success:Op,failed:ig,timeout:ig,cancelled:Wm,held:nh,running:em}[e];return(0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.jsx)(`span`,{className:`sr-only`,children:e})]})}function Bq({job:e,selected:t,now:n,onSelect:r}){let i=Mq(e,n);return(0,I.jsx)(`li`,{children:(0,I.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(Sz,`flex-row items-start gap-2.5 text-sm`),children:[(0,I.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,I.jsx)(zq,{status:e.status})}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:kq(e)}),i?(0,I.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,I.jsx)(`ul`,{className:Cz,children:e.map(e=>(0,I.jsx)(Bq,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var Hq=()=>dD(uD(`quickfix`)),Uq=e=>dD(uD(`quickfix`,e));function Wq(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 Gq(){return(0,I.jsx)(pD,{className:`m-4 flex-1`,children:(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(og,{"aria-hidden":`true`})}),(0,I.jsx)(vD,{className:`font-medium text-foreground`,children:Oq})]})})}function Kq({id:e}){let t=oO(),n=DD(`quickfix.list`,{},[`quickfix`]),r=Aq(n.data?.jobs??[]),i=Wq(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,I.jsx)(xD,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,I.jsx)(Gq,{}):(0,I.jsx)(qq,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function qq({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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:`Quick fixes`,count:String(r.length)}),n?(0,I.jsx)(Vq,{jobs:r,selectedId:a,now:i,onSelect:Uq}):(0,I.jsx)(dO,{})]});return(0,I.jsx)(lO,{wide:t,list:s,detail:o?(0,I.jsx)(Rq,{job:o,now:i}):e?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:Hq,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var Jq={},Yq=new Set;function Xq(e){Jq=e;for(let e of[...Yq])e()}function Zq(e){Jq.taskId!==e&&Xq({...Jq,taskId:e})}function Qq(e){(Jq.session?.name!==e?.name||JSON.stringify(Jq.session?.address)!==JSON.stringify(e?.address))&&Xq({...Jq,session:e})}function $q(e){return Yq.add(e),()=>{Yq.delete(e)}}function eJ(){return(0,m.useSyncExternalStore)($q,()=>Jq,()=>Jq)}function tJ({entry:e}){let t=e.at?mO(e.at):``;return e.role===`note`?(0,I.jsxs)(`li`,{className:`text-center text-xs text-muted-foreground`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,I.jsxs)(`li`,{className:`flex flex-col items-end gap-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,I.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,I.jsx)(PR,{text:e.text})})]}):(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,I.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,I.jsx)(PR,{text:e.text})})]})}function nJ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t?(0,I.jsx)(`div`,{className:`flex self-center`,children:(0,I.jsx)(Y,{label:`Load earlier messages`,icon:Ip,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,I.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex flex-col gap-4`,children:e.map(e=>(0,I.jsx)(tJ,{entry:e},e.id))})]})}function rJ({address:e,empty:t}){let n=DD(`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 V(`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,I.jsx)(nJ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var iJ={"this window":`This window`,background:`Background`,"other terminal":`Other terminals`},aJ=[`this window`,`background`,`other terminal`],oJ=`Nothing said yet.`,sJ=`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.`,cJ=`No other sessions. Start one below.`;function lJ(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 uJ(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 dJ(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 fJ(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[lJ(e,t,n),...r.map(uJ),...o.map(dJ)]}function pJ(e){return`${e} question${e===1?``:`s`} waiting for you`}function mJ(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function hJ(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function gJ(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function _J({options:e,send:t}){return(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,I.jsx)(J,{variant:`outline`,onClick:()=>void t({value:e}),children:e},e))})}function vJ({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,I.jsx)(fO,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,I.jsx)(`div`,{className:`flex self-end`,children:(0,I.jsx)(Y,{label:`Send the answer`,text:`Send`,icon:bp,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function yJ({dialog:e,send:t}){return e.method===`select`?(0,I.jsx)(_J,{options:e.options??[],send:t}):e.method===`confirm`?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(J,{onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,I.jsx)(J,{variant:`outline`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,I.jsx)(vJ,{dialog:e,send:t})}function bJ({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await V(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-border bg-background/60 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}),t.message?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}):null]}),(0,I.jsx)(yJ,{dialog:t,send:r}),(0,I.jsx)(`div`,{className:`flex self-start`,children:(0,I.jsx)(Y,{label:`Put it away`,text:`Put away`,icon:ig,onClick:()=>void r({cancelled:!0})})})]})}function xJ({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,I.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,I.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:pJ(t.length)}),t.map(t=>(0,I.jsx)(bJ,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var SJ={"this window":Km,background:Em,"other terminal":Ih};function CJ({where:e,className:t}){let n=SJ[e];return(0,I.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function wJ({task:e}){let t=e.progress;return(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(kH,{done:t.done,total:t.total}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function TJ({entry:e}){let{key:t}=e;return e.where===`this window`?(0,I.jsx)(ZD,{children:(0,I.jsx)(Y,{label:`Back to this window`,text:`Back to the Lobby`,icon:gp,tone:`primary`,shortcut:`B`,onClick:()=>dD(`#/lobby`)})}):t?(0,I.jsxs)(ZD,{children:[(0,I.jsx)(Y,{label:`Move here`,icon:vp,tone:`primary`,shortcut:`M`,onClick:()=>void V(`sessions.switch`,{key:t})}),(0,I.jsx)(OO,{icon:Jp,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 V(`sessions.stop`,{key:t})})]}):null}function EJ({entry:e,lobby:t}){let n=gJ(e);return e.where===`this window`?(0,I.jsx)(nJ,{entries:t?.chat??[],more:!1,empty:oJ}):n?(0,I.jsx)(rJ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:mJ(e)},e.id):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:oJ})}function DJ({entry:e,lobby:t,onChanged:n}){return(0,I.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex flex-col gap-4`,children:[(0,I.jsx)(TJ,{entry:e}),(0,I.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`h3`,{className:`flex items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,I.jsx)(CJ,{where:e.where,className:`size-[1.1rem]`}),e.name]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:hJ(e)}),e.task?(0,I.jsx)(wJ,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:pJ(e.waiting)}):null]}),e.where===`other terminal`?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:sJ}):null,e.key?(0,I.jsx)(xJ,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,I.jsx)(LR,{title:`Conversation`,children:(0,I.jsx)(EJ,{entry:e,lobby:t})})]})}function OJ({entry:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.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(Sz,`flex-row items-start gap-2.5 text-sm`),children:[(0,I.jsx)(CJ,{where:e.where,className:`mt-0.5`}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.name}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[e.status===`working`||e.status===`starting`?(0,I.jsx)(yD,{className:`size-3`,"aria-hidden":`true`}):null,e.status.replace(/_/g,` `),e.waiting>0?(0,I.jsx)(`span`,{className:`rounded-md bg-warning/15 px-1.5 py-0.5 font-medium text-warning tabular-nums`,children:e.waiting}):null]})]})})}function kJ({where:e,entries:t,selectedId:n,onSelect:r}){return(0,I.jsxs)(`section`,{"aria-label":iJ[e],className:`flex flex-col`,children:[(0,I.jsx)(`h3`,{className:wz,children:(0,I.jsx)(IR,{title:iJ[e],right:String(t.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,I.jsx)(`ul`,{className:Cz,children:t.map(e=>(0,I.jsx)(OJ,{entry:e,selected:e.id===n,onSelect:r},e.id))})]})}function AJ({entries:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`div`,{className:`flex flex-col pb-2`,children:aJ.map(r=>{let i=e.filter(e=>e.where===r);return i.length>0?(0,I.jsx)(kJ,{where:r,entries:i,selectedId:t,onSelect:n},r):null})})}var jJ=()=>dD(`#/sessions`),MJ=e=>dD(`#/sessions/${encodeURIComponent(e)}`);function NJ({windows:e}){return e.length===0?null:(0,I.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:(0,I.jsx)(LR,{title:`Other windows`,children:(0,I.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-h-8 items-center rounded-lg px-2.5 text-sm text-foreground underline-offset-4 transition-colors hover:bg-muted hover:underline`,children:e.name})},e.url))})})})}function PJ(){return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session is not on the list any more.`})}function FJ({id:e}){let t=oO(),n=TD(`status`).data,r=TD(`lobby`).data,i=TD(`prompts`).data?.prompts.length??0,a=DD(`sessions.list`,{},[`sessions`]);if(!a.data&&a.error)return(0,I.jsx)(xD,{message:`Could not load sessions. ${a.error}`,onRetry:a.reload});let o=fJ(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?gJ(c):void 0,u=l?JSON.stringify(l):``,d=c?.name;(0,m.useEffect)(()=>(Qq(l&&d?{name:d,address:l}:void 0),()=>Qq(void 0)),[u,d]);let f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:`Sessions`,count:String(o.length)}),a.data?(0,I.jsx)(AJ,{entries:o,selectedId:s,onSelect:MJ}):(0,I.jsx)(dO,{}),a.data&&o.length===1?(0,I.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:cJ}):null,(0,I.jsx)(NJ,{windows:n?.windows??[]})]}),p=c?(0,I.jsx)(DJ,{entry:c,lobby:r,onChanged:a.reload},c.id):e?(0,I.jsx)(PJ,{}):null;return(0,I.jsx)(lO,{wide:t,list:f,detail:p,open:!!e,onClose:jJ,hint:`Select a session to see its conversation.`,describe:`Session detail`})}function IJ(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 LJ(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 RJ({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,I.jsxs)(`span`,{className:`tabular-nums`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,LJ(IJ(e,n,t)),` execution`]})}function zJ({timing:e,stopped:t=!1}){return e?(0,I.jsx)(RJ,{timing:e,stopped:t},JSON.stringify(e)):(0,I.jsx)(`span`,{children:`Timing unavailable`})}var BJ=`This directly merges the reviewed commit into main and pushes main. It does not create a pull request.`,VJ={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function HJ({delivery:e,title:t}){return(0,I.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,I.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,I.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,I.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,I.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,I.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,I.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,I.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,I.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,I.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 UJ({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=n||t.status===`in_progress`||t.status===`successful`||!!i;return(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(J,{variant:`outline`,disabled:a,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:`Merge to main`}),(0,I.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.`:`Directly updates and pushes main. Requires confirmation.`}),i?(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function WJ(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?qf(`tasks.deliveryReview`,{taskId:t}):e===`defer`?qf(`tasks.deliveryDefer`,r):qf(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function GJ({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=Hf(),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 KJ(e){return e.scope.current===e.identity&&e.project===Hf()}function qJ(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 WJ(r,t.taskId,e.current.reviewId);KJ(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){KJ(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function JJ(e){let t=GJ(e),n=qJ(t,e),r=nD(t.confirm,tD.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 YJ({review:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,I.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:VJ[e.current.status]}),e.current.error||e.error?(0,I.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.result?(0,I.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,I.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function XJ({review:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsx)(UJ,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,I.jsx)(UJ,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,I.jsx)(J,{variant:`ghost`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,I.jsx)(J,{variant:`ghost`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function ZJ({review:e}){return(0,I.jsx)(JE,{open:e.slot,onOpenChange:e.setConfirm,label:`Confirm merge to main`,description:BJ,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,I.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,I.jsx)(`h3`,{className:`font-medium`,children:`Merge to main?`}),(0,I.jsx)(`p`,{className:`text-sm`,children:BJ}),(0,I.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,I.jsx)(J,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal,onClick:()=>void e.request(`merge_main`),children:`Confirm merge and push main`})]})]})})}function QJ({title:e,review:t}){return(0,I.jsxs)(LR,{title:`Completed work · delivery review`,right:VJ[t.current.status],children:[(0,I.jsx)(HJ,{delivery:t.current,title:e}),(0,I.jsx)(YJ,{review:t}),(0,I.jsx)(XJ,{review:t}),(0,I.jsx)(ZJ,{review:t})]})}function $J(e){let t=JJ(e);return(0,I.jsx)(QJ,{title:e.title,review:t})}var eY={open:Qp,delivered:Wp,addressed:Bp},tY={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function nY({comment:e}){let t=_O(Date.now()-Date.parse(e.createdAt)),n=eY[e.status];return(0,I.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),tY[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function rY({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,I.jsxs)(`li`,{className:`rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[r?(0,I.jsx)(RK,{text:s.text,onSave:async n=>{let r=await qf(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,I.jsx)(PR,{text:s.text}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(nY,{comment:s}),n&&!r?(0,I.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function iY({taskId:e,finished:t,canComment:n}){let r=DD(`tasks.comments`,{taskId:e},[`tasks`]),i=TD(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,I.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,I.jsx)(IR,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,I.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,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,I.jsx)(rY,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}function aY({step:e,index:t}){let n=e.status===`done`?Bp:Qp,r=e.status===`done`?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`;return(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm`,children:[(0,I.jsx)(n,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${r}`}),(0,I.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:e.status===`current`?`min-w-0 break-words text-foreground`:`min-w-0 break-words text-muted-foreground`,children:e.text}),e.status===`current`?(0,I.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`now`,(0,I.jsx)(`span`,{className:`sr-only`,children:` (current step)`})]}):null]})}function oY({steps:e}){let t=e.filter(e=>e.status===`done`).length;return(0,I.jsx)(LR,{title:`Progress`,right:`${t}/${e.length} steps`,children:(0,I.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,t)=>(0,I.jsx)(aY,{step:e,index:t},`${t}-${e.text}`))})})}function sY({detail:e,finished:t}){return e.plan?(0,I.jsx)(LR,{title:`Approved plan`,children:(0,I.jsx)(PR,{text:e.plan})}):e.proposal?(0,I.jsx)(LR,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,I.jsx)(PR,{text:e.proposal})}):(0,I.jsx)(LR,{title:`Plan`,children:(0,I.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 cY({amendments:e}){return e.length===0?null:(0,I.jsx)(LR,{title:`Amendments`,children:(0,I.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,I.jsx)(`li`,{className:`break-words`,children:e},e))})})}function lY({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,I.jsx)(LR,{title:`Waiting on`,children:(0,I.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Rp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,I.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,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Xp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,I.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function uY({runs:e}){return e.length===0?null:(0,I.jsx)(LR,{title:`Recent runs`,children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,I.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function dY({detail:e,finished:t}){return(0,I.jsxs)(I.Fragment,{children:[e.request?(0,I.jsx)(LR,{title:`Request`,children:(0,I.jsx)(PR,{text:e.request})}):null,e.steps.length>0?(0,I.jsx)(oY,{steps:e.steps}):null,(0,I.jsx)(sY,{detail:e,finished:t})]})}function fY({detail:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(cY,{amendments:e.amendments}),(0,I.jsx)(lY,{detail:e}),(0,I.jsx)(uY,{runs:e.runs})]})}function pY({row:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){if(e.section===`mine`)return dD(`#/lobby`);let n=Hf(),r=()=>t.current&&Hf()===n;try{let t=await qf(`tasks.open`,{taskId:e.id});if(!r())return;let n=await qf(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return dD(`#/lobby`);if(t.sessionId&&!t.key)return B.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return B.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await V(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&dD(`#/lobby`)}catch(e){r()&&B.error(e instanceof Error?e.message:String(e))}}let r=e.section===`mine`;return(0,I.jsx)(Y,{label:r?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:vp,tone:`primary`,shortcut:`S`,onClick:()=>void n()})}var mY={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},hY={open:`open`,done:`done`,dropped:`abandoned`},gY=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function _Y(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function vY(e){return e===`now`?`just now`:`${e} ago`}function yY(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[_Y(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function bY(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 xY(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 SY({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,I.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,I.jsxs)(`span`,{children:[n>0?(0,I.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,I.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function CY({planId:e}){let t=DD(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,I.jsxs)(I.Fragment,{children:[n.issue?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,I.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,I.jsx)(SY,{split:n.split}):null,(0,I.jsx)(LR,{title:`Agreed plan`,children:(0,I.jsx)(PR,{text:n.brief})})]}):t.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function wY({row:e,onGone:t}){let n=async n=>{await V(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await V(`plans.discard`,{planId:e.id})&&t()};return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":e.title,children:[(0,I.jsxs)(ZD,{children:[(0,I.jsx)(Y,{label:`Start here`,icon:fh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,I.jsx)(Y,{label:`Start in a new session`,text:`New session`,icon:Ph,shortcut:`N`,onClick:()=>void n(`session`)}),(0,I.jsx)(OO,{icon:Hh,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,I.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,I.jsx)(AH,{check:`open`,className:`mt-1.5`}),(0,I.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${vY(e.age)}`:``]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,I.jsx)(CY,{planId:e.id})]})}function TY(e){if(e.kind===`archived`)return{state:`archived`,rest:vY(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`} ${vY(e.age)}`:``;return{state:_Y(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function EY(e){return e?[DH(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function DY({row:e,task:t}){return e.progress?(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(kH,{done:e.progress.done,total:e.progress.total}),(0,I.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]}),t?.currentStep?(0,I.jsxs)(`span`,{className:`text-foreground`,children:[t.currentStep,` `,(0,I.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:`now`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`(current step)`})]}):null]}):null}function OY({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=TY(e);return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,I.jsx)(AH,{check:e.check,className:`mt-1.5`}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[hY[e.check],`:`]}),(0,I.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,I.jsx)(`span`,{children:i}):null]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,EY(t),n].filter(Boolean).join(` · `)}),(0,I.jsx)(DY,{row:e,task:t})]})}function kY({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await V(`tasks.restore`,{taskId:r},{undo:()=>void V(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await V(`tasks.archive`,{taskId:r},{undo:()=>void V(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await V(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void V(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function AY({row:e,archive:t}){return e.check===`open`?(0,I.jsx)(OO,{label:`Archive`,icon:fp,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,I.jsx)(Y,{label:`Archive`,icon:fp,shortcut:`E`,onClick:()=>void t()})}function jY({on:e,toggle:t}){return YD(`a`,t),(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.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`,children:[(0,I.jsx)(gh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,I.jsx)(`span`,{children:`Auto`}),(0,I.jsx)(WW,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,I.jsx)(KE,{chord:`A`,className:`kbd-hint`})]})}),(0,I.jsx)(jD,{children:`Auto mode: the oracle decides without asking`})]})}function MY(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=kY(e),o=t.kind===`archived`;return(0,I.jsxs)(ZD,{children:[t.kind===`task`&&t.check===`open`?(0,I.jsx)(pY,{row:t}):null,t.kind===`task`?(0,I.jsx)(NY,{taskId:t.id}):null,o?(0,I.jsx)(Y,{label:`Restore`,icon:vh,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,I.jsx)(jY,{on:!!t.auto,toggle:a}):null,o?null:(0,I.jsx)(AY,{row:t,archive:r}),(0,I.jsx)(OO,{icon:Hh,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 NY({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=Hf();try{let r=await qf(`tasks.open`,{taskId:e});if(!t.current||Hf()!==n)return;r.notice&&B.info(r.notice);let i=await qf(`status.get`,{});if(!t.current||Hf()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a?dD(`#/sessions/${encodeURIComponent(a)}`):r.notice||B.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&Hf()===n&&B.error(e instanceof Error?e.message:String(e))}}return(0,I.jsx)(Y,{label:`Open task conversation`,text:`Conversation`,icon:Bm,shortcut:`O`,onClick:()=>void n()})}function PY(e){let{row:t}=e,n=t.kind===`plan`,r=DD(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=TD(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,I.jsx)(wY,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`;return(0,I.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":t.title,children:[(0,I.jsx)(MY,{...e}),(0,I.jsx)(OY,{row:t,task:a}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(zJ,{timing:r.data?.timing??t.timing,stopped:t.check!==`open`})}),r.data?.delivery?(0,I.jsx)($J,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,I.jsx)(dY,{detail:r.data,finished:!o}):null,(0,I.jsx)(iY,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,I.jsx)(fY,{detail:r.data}):null,r.error&&!r.data?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function FY({row:e}){return e.check===`open`&&e.progress?(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,I.jsx)(kH,{done:e.progress.done,total:e.progress.total}),(0,I.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function IY(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function LY({row:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.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:Sz,children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,I.jsx)(AH,{check:e.check,className:`mt-0.5`}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[hY[e.check],`:`]}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,IY(e),t&&`font-medium text-foreground`),children:e.title}),(0,I.jsx)(FY,{row:e})]}),e.check===`open`?(0,I.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:yY(e)}):null,e.kind===`plan`?null:(0,I.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,I.jsx)(zJ,{timing:e.timing,stopped:e.check!==`open`})}),e.delivery?(0,I.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})})}function RY({rows:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`div`,{className:`flex flex-col pb-2`,children:bY(e).map(({section:e,rows:r})=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:wz,children:(0,I.jsx)(IR,{title:mY[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,I.jsx)(`ul`,{className:Cz,children:r.map(e=>(0,I.jsx)(LY,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var zY=()=>dD(uD(`tasks`)),BY=e=>dD(uD(`tasks`,e));function VY(){return(0,I.jsxs)(pD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(mD,{children:[(0,I.jsx)(gD,{variant:`icon`,children:(0,I.jsx)(Om,{"aria-hidden":`true`})}),(0,I.jsx)(vD,{children:gY})]}),(0,I.jsx)(J,{onClick:()=>dD(uD(`plan`)),children:`Plan a task`})]})}function HY({shown:e,count:t,onToggle:n}){return(0,I.jsxs)(`label`,{className:`btn-raised flex h-7 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow]`,children:[(0,I.jsx)(PB,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,I.jsx)(xz,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function UY({id:e}){let t=oO(),[n,r]=(0,m.useState)(!1),i=DD(`tasks.list`,{},[`tasks`,`plans`]),a=DD(`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)(()=>(Zq(u),()=>Zq(void 0)),[u]),!i.data&&i.error)return(0,I.jsx)(xD,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,I.jsx)(VY,{});let d=[...c,...s].find(e=>e.id===l),f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(uO,{title:`Tasks`,count:xY(c),children:(0,I.jsx)(HY,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,I.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:gY}):(0,I.jsx)(RY,{rows:c,selectedId:l,onSelect:BY}):(0,I.jsx)(dO,{})]}),p=d?(0,I.jsx)(PY,{row:d,onGone:zY,onChanged:i.reload},d.id):e?(0,I.jsx)(WY,{}):null;return(0,I.jsx)(lO,{wide:t,list:f,detail:p,open:!!e,onClose:zY,hint:`Select a task to see its detail.`,describe:`Task detail`})}function WY(){return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var GY={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,s:`sessions`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function KY(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function qY(e){if(e.kind===`settings`)return(0,I.jsx)(IK,{});if(e.kind===`sessions`)return(0,I.jsx)(FJ,{id:KY(e.key?[e.key]:[])});switch(e.tab){case`lobby`:return(0,I.jsx)(_U,{});case`tasks`:return(0,I.jsx)(UY,{id:KY(e.rest)});case`plan`:return(0,I.jsx)(Dq,{});case`quickfix`:return(0,I.jsx)(Kq,{id:KY(e.rest)});case`issues`:return(0,I.jsx)(iB,{rest:e.rest});case`metrics`:return(0,I.jsx)(cW,{});case`git`:return(0,I.jsx)(Mz,{rest:e.rest});case`knowledge`:return(0,I.jsx)(NB,{agent:e.rest[0],file:e.rest[1]});case`excalidraw`:return(0,I.jsx)(BV,{id:KY(e.rest)})}}var JY=[{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`}],YY=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(GY).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`}],XY=[{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`]]}],ZY=[{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`}],QY=[{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 $Y({line:e}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,I.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,I.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,I.jsx)(BE,{children:e},e))}):(0,I.jsx)(KE,{chord:e.label??``})}),(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function eX(){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),XY.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,I.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,I.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,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(KE,{chord:e}),t]},e))})]},e.id))]})}function tX({title:e,lines:t}){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,I.jsx)($Y,{line:e},e.id))]})}function nX(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function rX(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function iX({open:e,onOpenChange:t,keys:n,tabs:r}){let i=nD(e,tD.help);return(0,m.useEffect)(()=>{if(!e||!i)return;let r=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&zH(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,r,!0),()=>window.removeEventListener(`keydown`,r,!0)},[e,i,t,n]),(0,I.jsxs)(JE,{open:e&&i,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,I.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,I.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(KE,{chord:`Esc`}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,I.jsx)(ig,{"aria-hidden":`true`})})]})]}),(0,I.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,I.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,I.jsx)(tX,{title:`Everywhere`,lines:nX(n)}),(0,I.jsx)(tX,{title:`Jump to a tab`,lines:rX(r)}),(0,I.jsx)(tX,{title:`Navigation and editing`,lines:YY}),(0,I.jsx)(tX,{title:`Message box`,lines:JY})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,I.jsx)(tX,{title:`Lists and panes`,lines:ZY}),(0,I.jsx)(eX,{}),(0,I.jsx)(tX,{title:`Questions`,lines:QY})]})]})]})}function aX(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function oX(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(Uf(`/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 Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Gf(r.error,r.code,n.status);return r.result}function sX(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 cX(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 lX=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function uX(e,t){let n=e.lastIndexOf(`
|
|
99
|
+
.dark { … }`,className:`max-h-56 font-mono text-xs md:text-xs`}),(0,I.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,I.jsx)(`input`,{ref:a,type:`file`,accept:`.css,.json,text/css,application/json`,hidden:!0,tabIndex:-1,"aria-label":`Upload a theme file`,onChange:e=>{s(e.target.files?.[0]),e.target.value=``}}),(0,I.jsx)(Y,{label:`Apply the pasted theme`,text:`Apply`,icon:Ap,tone:`primary`,disabled:!t.trim(),onClick:()=>o(t,`Custom theme`)}),(0,I.jsx)(Y,{label:`Upload a .css or .json theme file`,text:`Upload file`,icon:og,onClick:()=>a.current?.click()}),e.custom?(0,I.jsx)(BO,{label:`Remove ${e.custom.name}`,text:`Remove`,title:`Remove the imported theme?`,description:`The imported theme is stored in this browser. Keep a copy if you want to use it again.`,confirmLabel:`Remove theme`,icon:eg,variant:`destructive`,onConfirm:()=>e.removeCustom()}):null,r?(0,I.jsx)(`p`,{role:`alert`,className:`ml-2 min-w-0 text-xs text-destructive`,children:r}):null]})]})}function HK(){let{theme:e,setTheme:t}=oK(),n=eG();return(0,I.jsx)(YR,{prominent:!0,title:_K.appearance,children:(0,I.jsxs)(XG,{children:[(0,I.jsx)(YG,{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,I.jsx)(wG,{checked:!n,onCheckedChange:e=>QW(!e),"aria-label":`Prompt sounds`})}),(0,I.jsx)(YG,{label:IK.themeLabel,help:IK.appearanceHelp,children:(0,I.jsx)(ZG,{value:e,items:IK.themeItems.map(e=>({value:e.id,label:e.label})),label:IK.themeLabel,onChange:e=>t(e)})}),(0,I.jsx)(YG,{label:`Colour theme`,help:`The page's colours. Kept in this browser only.`,stacked:!0,children:(0,I.jsx)(BK,{})}),(0,I.jsx)(YG,{label:`Import a theme`,stacked:!0,children:(0,I.jsx)(VK,{})})]})})}var UK={master:[`master`],designer:[`agents`,`designer`],backend:[`agents`,`backend`],qa:[`agents`,`qa`],scout:[`scout`],researcher:[`researcher`],quickfix:[`quickFix`],planner:[`planner`]},WK=[...vK,...yK.map(e=>({id:`panel:${e.id}`,label:e.label,help:bK}))];function GK(e,t){switch(t){case`master`:return e.master;case`scout`:return{model:e.scout.model,thinking:`low`,timeoutMs:e.scout.timeoutMs};case`researcher`:return e.researcher;case`quickfix`:return e.quickFix;case`planner`:return e.planner;default:return e.agents[t]}}function KK(e,t){return UK[e].reduceRight((e,t)=>({[t]:e}),t)}function qK(e,t){return e.find(e=>e.id===t)?.thinkingLevels??gK}function JK(e,t){return gK[WG(gK,e,Math.max(0,gK.indexOf(t)))]??t}var YK=e=>e>0?`${e} round${e===1?``:`s`}`:`unlimited`,XK=e=>e>0?`over ${e} steps`:`never`;function ZK({label:e,children:t}){return(0,I.jsxs)(`div`,{className:`grid min-w-0 gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e}),t]})}function QK(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:uK,label:dK,help:fK}]:[],...e.none?[{value:uK,label:`none`,help:`Use the primary model`}]:[],...!e.inherit&&!e.none&&e.value===`inherit`?[{value:uK,label:dK,help:fK}]:[],...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:hK}]:[],{value:pK,label:mK,help:hK}],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,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(ZG,{value:e.value,items:o,label:e.label,onChange:s}),t?(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(CG,{autoFocus:!0,value:r,placeholder:`provider/model`,"aria-label":`Model id`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),(0,I.jsx)(Y,{label:`Use this model`,icon:Ap,tone:`primary`,onClick:c})]}):null]})}function $K({label:e,help:t,checked:n,onChange:r}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,I.jsxs)(`div`,{className:`min-w-0`,children:[(0,I.jsx)(`div`,{className:`text-[0.8125rem] font-medium`,children:e}),t?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:t}):null]}),(0,I.jsx)(wG,{checked:n,onCheckedChange:r,"aria-label":e})]})}function eq({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,I.jsx)(CG,{value:i,placeholder:n,"aria-label":r,onChange:e=>a(e.target.value),onBlur:o,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),o())}})}function tq({value:e,label:t,onSave:n}){let r=Math.round(e/6e4);return(0,I.jsx)(rq,{label:t,value:String(r),min:1,suffix:`min`,onSave:e=>{let t=Number(e);return!Number.isFinite(t)||t<=0?(B.error(`"${e}" is not a positive number of minutes.`),!1):(n(Math.round(t*6e4)),!0)}})}function nq({value:e,onSave:t}){return(0,I.jsx)(rq,{label:DK,value:String(e),min:0,max:65535,onSave:e=>!/^\d+$/.test(e)||Number(e)>65535?(B.error(`"${e}" is not a port (0, or 1-65535).`),!1):(t(Number(e)),!0)})}function rq({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,I.jsxs)(`div`,{className:`relative`,children:[(0,I.jsx)(CG,{type:`number`,inputMode:`numeric`,min:n,max:r,value:o,"aria-label":e,className:i?`pr-10`:void 0,onChange:e=>s(e.target.value),onBlur:c,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),c())}}),i?(0,I.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 iq({value:e,label:t,onSave:n}){let[r,i]=(0,m.useState)(e);return(0,m.useEffect)(()=>i(e),[e]),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsx)(wO,{rows:2,value:r,"aria-label":t,onChange:e=>i(e.target.value),onBlur:()=>{r.trim()!==e&&n(r.trim())}}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Saved when you leave the field.`})]})}function aq({kind:e,config:t,models:n,save:r}){let i=GK(t,e),a=t=>r(KK(e,t)),o=cK[e],s=qK(n,i.model),c=t=>{let r={model:t};e!==`scout`&&!qK(n,t).includes(i.thinking)&&(r.thinking=JK(qK(n,t),i.thinking)),a(r)},l=e===`scout`?`low`:JK(s,i.thinking),u=e!==`scout`&&e!==`researcher`,[d,f]=(0,m.useState)(!!i.instructions);return(0,I.jsxs)(`section`,{className:`glass flex min-w-0 flex-col gap-3 rounded-xl p-4`,children:[(0,I.jsxs)(`header`,{className:`flex items-baseline justify-between gap-3`,children:[(0,I.jsx)(`h3`,{className:`text-sm font-semibold`,children:o}),(0,I.jsxs)(`span`,{className:`truncate text-xs text-muted-foreground`,children:[i.model===`inherit`?`session model`:i.model,` · `,e===`scout`?`low`:i.thinking]})]}),(0,I.jsx)(`div`,{className:`grid gap-3 md:grid-cols-2 xl:grid-cols-1`,children:(0,I.jsx)(ZK,{label:lK.model,children:(0,I.jsx)(QK,{value:i.model,models:n,label:`${o} model`,inherit:e===`master`,onChange:c})})}),(0,I.jsxs)(`div`,{className:`flex items-center gap-3 rounded-lg bg-muted p-3`,children:[(0,I.jsx)(VG,{level:l,className:`size-16`}),(0,I.jsx)(`div`,{className:`min-w-0 flex-1`,children:e===`scout`?(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:lK.thinking}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`low`,` (fixed for scouts)`]})]}):(0,I.jsx)(KG,{value:i.thinking,levels:gK,supported:s,model:i.model===`inherit`?`the session model`:i.model,label:`${o} effort`,onChange:e=>a({thinking:e})})})]}),(0,I.jsxs)(`div`,{className:`flex min-h-7 items-center justify-between gap-3`,children:[u?(0,I.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 items-center gap-1 rounded-md text-xs text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/30`,children:[(0,I.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 transition-transform duration-200 ease-snap`,d&&`rotate-90`)}),lK.instructions,!d&&i.instructions?(0,I.jsx)(`span`,{className:`text-primary`,children:`· set`}):null]}):(0,I.jsx)(`span`,{}),e===`master`?null:(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Time limit`}),(0,I.jsx)(`div`,{className:`w-24`,children:(0,I.jsx)(tq,{value:i.timeoutMs??t.workflow.agentTimeoutMs,label:`${o} time limit`,onSave:e=>a({timeoutMs:e})})})]})]}),u&&d?(0,I.jsx)(iq,{value:i.instructions??``,label:`${o} instructions`,onSave:e=>a({instructions:e})}):null]})}function oq(e,t){return t.startsWith(`panel:`)?e.lobby.panels[t.slice(6)]:e.lobby[t]}function sq({config:e,item:t,save:n}){let r=t.id.startsWith(`panel:`);return(0,I.jsx)($K,{label:t.label,help:t.help,checked:oq(e,t.id),onChange:e=>{n(r?{lobby:{panels:{[t.id.slice(6)]:e}}}:{lobby:{[t.id]:e}})}})}function cq({config:e,save:t}){let n=e.workflow.gitIsolation;return(0,I.jsx)(YR,{prominent:!0,title:_K.workflow,children:(0,I.jsx)(XG,{children:(0,I.jsx)(YG,{label:MK,help:jK.find(e=>e.id===n)?.help??`enter cycles off, branch, worktree`,children:(0,I.jsx)(ZG,{value:n,items:jK.map(e=>({value:e.id,label:e.label})),label:MK,onChange:e=>void t({workflow:{gitIsolation:e}})})})})})}function lq({config:e,save:t}){let n=e.lobby.web;return(0,I.jsx)(YR,{prominent:!0,title:_K.lobby,children:(0,I.jsxs)(XG,{children:[WK.map(n=>(0,I.jsx)(sq,{config:e,item:n,save:t},n.id)),(0,I.jsx)(YG,{label:xK,help:SK,children:(0,I.jsx)(ZG,{value:String(e.lobby.maxPlanningRounds),items:CK.map(e=>({value:String(e),label:YK(e)})),label:xK,onChange:e=>void t({lobby:{maxPlanningRounds:Number(e)}})})}),(0,I.jsx)(YG,{label:wK,help:TK,children:(0,I.jsx)(ZG,{value:String(e.lobby.splitPlanAbove),items:EK.map(e=>({value:String(e),label:XK(e)})),label:wK,onChange:e=>void t({lobby:{splitPlanAbove:Number(e)}})})}),(0,I.jsx)(YG,{label:DK,help:OK,children:(0,I.jsx)(nq,{value:n.port,onSave:e=>void t({lobby:{web:{port:e}}})})}),(0,I.jsx)($K,{label:kK,help:AK,checked:n.openBrowser,onChange:e=>void t({lobby:{web:{openBrowser:e}}})})]})})}function uq({config:e,models:t,save:n}){let r=e.classifier,i=NK.find(e=>e.id===r.provider)?.label;return(0,I.jsx)(YR,{prominent:!0,title:_K.classifier,children:(0,I.jsxs)(XG,{children:[(0,I.jsx)($K,{label:FK.enabled,help:FK.enabledHelp,checked:r.enabled,onChange:e=>void n({classifier:{enabled:e}})}),(0,I.jsx)(YG,{label:FK.host,children:(0,I.jsx)(ZG,{value:r.provider,items:NK.map(e=>({value:e.id,label:e.label})),label:FK.host,onChange:e=>void n({classifier:{provider:e}})})}),(0,I.jsx)(YG,{label:FK.model,help:FK.modelHelp,children:(0,I.jsx)(eq,{value:r.model,label:FK.model,placeholder:`the host's default`,onSave:e=>void n({classifier:{model:e}})})}),(0,I.jsx)(YG,{label:FK.key,help:FK.keyNote,children:(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground sm:text-right`,children:i??r.provider})}),PK.map(e=>(0,I.jsx)($K,{label:e.label,help:e.help,checked:r.features[e.id],onChange:t=>void n({classifier:{features:{[e.id]:t}}})},e.id)),(0,I.jsx)(YG,{label:FK.cheap,help:FK.cheapHelp,children:(0,I.jsx)(QK,{value:r.effort.cheapModel,models:t,label:FK.cheap,none:!0,onChange:e=>void n({classifier:{effort:{cheapModel:e}}})})})]})})}function dq(){let e=uG(),t=async e=>{if(!e)return fG();let t=await dG();t===`granted`?B.success(IK.notificationsOn):B.error(t===`unsupported`?IK.notificationsUnsupported:IK.notificationsBlocked)};return(0,I.jsx)(YR,{prominent:!0,title:_K.notifications,children:(0,I.jsx)(XG,{children:(0,I.jsx)($K,{label:IK.notificationsLabel,help:IK.notificationsHelp,checked:e,onChange:e=>void t(e)})})})}function fq(){let{available:e,install:t}=y(),n=b(),r=x();return(0,I.jsx)(YR,{prominent:!0,title:_K.install,children:(0,I.jsxs)(XG,{children:[(0,I.jsx)(YG,{label:IK.installLabel,help:n?IK.installedNow:IK.installHelp,children:n?null:(0,I.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,I.jsx)(Y,{label:IK.installButton,icon:um,tone:`primary`,onClick:()=>e?void t().then(()=>B.success(IK.installDone)):B.warning(IK.installUnavailable)})})}),r.supported?(0,I.jsx)(YG,{label:IK.fullscreenLabel,help:IK.fullscreenHelp,children:(0,I.jsx)(`div`,{className:`flex sm:justify-end`,children:(0,I.jsx)(Y,{label:r.on?IK.fullscreenOn:IK.fullscreenOff,icon:r.on?Xm:Bm,pressed:r.on,onClick:()=>void r.toggle()})})}):null]})})}var pq=[`Agents`,`Workflow`,`Lobby`,`Classifier`,`Appearance & notifications`];function mq({config:e,models:t,onConfig:n}){let[r,i]=(0,m.useState)(`Agents`),a=(0,m.useRef)(Promise.resolve()),o=e=>{let t=async()=>{try{return n((await qf(`settings.set`,{patch:e})).config),B.success(IK.saved),!0}catch(e){return B.error(e instanceof Error?e.message:`That did not work. Try again.`),!1}},r=a.current.then(t,t);return a.current=r,r};return(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-6 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,children:[(0,I.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight`,children:IK.title}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:IK.intro})]}),(0,I.jsx)(`nav`,{"aria-label":`Settings sections`,className:`-mx-1 flex flex-wrap gap-1 border-b border-border pb-3`,children:pq.map(e=>(0,I.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-current":r===e?`page`:void 0,"aria-controls":`settings-${e.split(` `)[0]}`,onClick:()=>i(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`,r===e?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e},e))}),(0,I.jsx)(`div`,{id:`settings-Agents`,hidden:r!==`Agents`,"aria-hidden":r!==`Agents`,children:(0,I.jsx)(YR,{prominent:!0,title:_K.agents,children:(0,I.jsx)(`div`,{className:`grid grid-cols-1 gap-4 xl:grid-cols-2`,children:sK.map(n=>(0,I.jsx)(aq,{kind:n,config:e,models:t,save:o},n))})})}),(0,I.jsx)(`div`,{id:`settings-Workflow`,hidden:r!==`Workflow`,"aria-hidden":r!==`Workflow`,children:(0,I.jsx)(cq,{config:e,save:o})}),(0,I.jsx)(`div`,{id:`settings-Lobby`,hidden:r!==`Lobby`,"aria-hidden":r!==`Lobby`,children:(0,I.jsx)(lq,{config:e,save:o})}),(0,I.jsx)(`div`,{id:`settings-Classifier`,hidden:r!==`Classifier`,"aria-hidden":r!==`Classifier`,children:(0,I.jsx)(uq,{config:e,models:t,save:o})}),(0,I.jsx)(`div`,{id:`settings-Appearance`,hidden:r!==`Appearance & notifications`,"aria-hidden":r!==`Appearance & notifications`,children:(0,I.jsxs)(`div`,{className:`flex flex-col gap-8`,children:[(0,I.jsx)(HK,{}),(0,I.jsx)(dq,{}),(0,I.jsx)(fq,{})]})})]})}function hq(){return(0,I.jsx)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-4 px-5 pt-5 pb-dock sm:px-8 sm:pt-8`,role:`status`,"aria-label":IK.loading,children:[0,1,2,3].map(e=>(0,I.jsx)(`div`,{className:`h-48 rounded-lg bg-muted motion-safe:animate-pulse`},e))})}function gq(){let e=zD(`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,I.jsx)(ND,{message:`${IK.loadFailed} ${e.error}`,onRetry:e.reload}):t?(0,I.jsx)(mq,{config:t,models:e.data?.models??[],onConfig:i}):(0,I.jsx)(hq,{})}function _q(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 vq({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,I.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,onKeyDown:e=>_q(e,()=>void d(),()=>{o||r()}),children:[(0,I.jsxs)(`label`,{className:`text-sm`,children:[`Edit message`,(0,I.jsx)(wO,{ref:u,value:i,onChange:e=>a(e.target.value),disabled:o,className:`mt-2 max-h-[40vh] min-h-24`})]}),c?(0,I.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Could not save. `,c]}):null,(0,I.jsxs)(`div`,{className:`flex gap-2`,children:[(0,I.jsx)(J,{size:`sm`,onClick:()=>void d(),disabled:t||o||!i.trim(),children:o?`Saving…`:`Save`}),(0,I.jsx)(J,{size:`sm`,variant:`ghost`,disabled:o,onClick:r,children:`Cancel`})]})]})}function yq({questions:e}){return(0,I.jsx)(`ol`,{className:`mt-1 flex flex-col gap-2`,children:e.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex flex-col gap-2 rounded-xl border border-border bg-card p-3 text-sm`,style:{"--orb":pH(e.from)},children:[(0,I.jsxs)(`p`,{className:`flex items-start gap-2`,children:[(0,I.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,I.jsx)(CH,{source:e.from,className:`size-3`}),uH(e.from)]}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsxs)(`span`,{className:`sr-only`,children:[`Question `,t+1,`: `]}),e.text]})]}),e.options.length?(0,I.jsx)(`ul`,{className:`flex flex-wrap gap-1.5`,children:e.options.map(e=>(0,I.jsxs)(`li`,{className:`rounded-lg border border-border bg-muted/60 px-2 py-1 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:e.label}),e.description?` — ${e.description}`:``]},e.label))}):null]},t))})}function bq({message:e}){let t=e.decided??[];return t.length?(0,I.jsx)(`ul`,{className:`mt-1 flex flex-col gap-1.5`,children:t.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex items-start gap-2 rounded-lg bg-muted/60 px-2.5 py-1.5 text-sm`,children:[(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-success`}),(0,I.jsxs)(`span`,{className:`min-w-0`,children:[(0,I.jsx)(`span`,{className:q(`font-medium`,dH(e.from)),children:uH(e.from)}),` `,e.question,` → `,(0,I.jsx)(`strong`,{children:e.answer}),(0,I.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 xq({message:e,index:t,busy:n}){let[r,i]=(0,m.useState)(!1),[a,o]=(0,m.useState)(),s=a&&(a.editedAt??0)>(e.editedAt??0)?a:e,c=n||s!==e,l=async n=>{let r=await qf(`planner.editMessage`,{messageIndex:t,at:e.at,text:n});o(r.message)},u=!e.settled?.length&&!r?(0,I.jsxs)(J,{size:`xs`,variant:`ghost`,disabled:c,onClick:()=>i(!0),className:`text-muted-foreground`,children:[(0,I.jsx)(vh,{"aria-hidden":`true`}),`Edit`]}):null;return(0,I.jsx)(EH,{time:e.at>0?EO(e.at):void 0,head:!0,note:s.editedAt?`(edited)`:void 0,below:u,children:r?(0,I.jsx)(vq,{text:s.text,disabled:n,onSave:l,onCancel:()=>i(!1)}):(0,I.jsx)(KR,{text:s.text})})}function Sq({message:e,index:t,busy:n}){if(e.role===`you`)return(0,I.jsx)(xq,{message:e,index:t,busy:n});let r=e.questions??[];return(0,I.jsxs)(TH,{source:`PLANNER`,name:`Panel`,time:e.at>0?EO(e.at):void 0,head:!0,bubble:r.length===0,aside:r.length?`${r.length} question${r.length===1?``:`s`}`:void 0,children:[r.length>0?(0,I.jsx)(yq,{questions:r}):(0,I.jsx)(KR,{text:e.text}),(0,I.jsx)(bq,{message:e})]})}function Cq({messages:e,seed:t,busy:n=!1}){return(0,I.jsxs)(`div`,{className:`chat-column`,role:`log`,"aria-label":`Panel conversation`,children:[t?(0,I.jsx)(DH,{children:t}):null,e.map((e,t)=>(0,I.jsx)(Sq,{message:e,index:t,busy:n},`${e.at}-${t}`)),n?(0,I.jsx)(TH,{source:`PLANNER`,name:`Panel`,head:!0,live:!0,aside:`the panel is thinking`,children:(0,I.jsx)(OH,{className:`mt-1`})}):null]})}var wq=`ORACLE`,Tq=`No draft yet.`,Eq=`The draft appears after the panel's first round.`,Dq=`What each seat needs`,Oq=[`backend`,`designer`,`qa`,`researcher`],kq={backend:`DEV`,designer:`DESIGN`,qa:`QA`,researcher:`RESEARCH`},Aq=`Describe a task in the box below. The panel asks what it needs to know, round by round, until the plan is clear.`,jq={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.`},Mq=[{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 Nq(e){let t=e.filter(e=>e.member);return`${t.filter(e=>e.seated).length} of ${t.length} seated`}function Pq(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 Fq(e,t){return`${e} ${t}${e===1?``:`s`}`}function Iq(e){return e.round===0&&e.messages.length===0&&!e.busy}function Lq(e){let t=e.members.find(e=>e.status===`failed`);if(t)return(t.error??`${kq[t.member]} failed`).split(`
|
|
100
|
+
`)[0]}function Rq(e){let t=[],n=Lq(e);return e.busy?t.push(Pq(e.round,e.limit)):n?t.push(`${n} — Retry runs the round again`):e.questions.length>0&&t.push(`${Fq(e.questions.length,`question`)} waiting`),!e.busy&&e.round>0&&t.push(Pq(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 zq(e,t){let n=kq[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`:Fq(o,`question`)}}function Bq(e){let t=e.questions.filter(e=>e.from===wq).length;return[{label:wq,seated:!0,working:e.busy,text:e.busy?`chairing`:t?Fq(t,`question`):`·`},...Oq.map(t=>zq(t,e))]}function Vq(e){let t=!1;return e.split(`
|
|
101
|
+
`).map(e=>{let n=e.trimStart().startsWith("```");return n&&(t=!t),{text:e,fenced:t||n}})}function Hq({notes:e}){return(0,I.jsx)(I.Fragment,{children:e.map((e,t)=>(0,I.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))})}function Uq({row:e,notes:t,onComment:n}){let r=e.text.trim(),i=()=>n(r);return(0,I.jsxs)(`li`,{className:`group/line`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-1`,children:[(0,I.jsx)(`span`,{className:`flex w-4 shrink-0 justify-center pt-3.5`,"aria-hidden":`true`,children:t.length>0?(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-primary`}):null}),(0,I.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,I.jsx)(KR,{text:e.text})}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,className:`shrink-0 text-muted-foreground 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,I.jsx)(Wm,{"aria-hidden":`true`})})]}),(0,I.jsx)(Hq,{notes:t})]})}function Wq({draft:e,comments:t,onComment:n}){return(0,I.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Draft plan lines`,children:Vq(e).map((e,r)=>e.text.trim()?(0,I.jsx)(Uq,{row:e,notes:t.get(e.text.trim())??[],onComment:n},r):(0,I.jsx)(`li`,{"aria-hidden":`true`,className:`h-2`},r))})}function Gq({notes:e}){return e.length===0?null:(0,I.jsx)(YR,{title:Dq,children:(0,I.jsx)(`dl`,{className:`flex flex-col gap-2 text-sm`,children:e.map((e,t)=>(0,I.jsxs)(`div`,{className:`flex gap-3`,children:[(0,I.jsx)(`dt`,{className:q(`w-20 shrink-0 font-medium`,dH(e.from)),children:uH(e.from)}),(0,I.jsx)(`dd`,{className:`min-w-0 flex-1`,children:(0,I.jsx)(KR,{text:e.text})})]},t))})})}function Kq({cell:e,intro:t}){let n=t?e.member?e.seated?`seated`:`not seated`:`chairs`:e.text;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:q(`inline-flex items-center gap-1.5 font-medium`,e.seated?dH(e.label):`text-muted-foreground`),children:[(0,I.jsx)(CH,{source:e.label,className:`size-3.5`}),uH(e.label)]}),e.working&&!t?(0,I.jsx)(jD,{className:`size-3.5`,"aria-hidden":`true`}):null,(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:n})]})}function qq({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]`;if(!r)return(0,I.jsx)(`li`,{className:q(i,`bg-muted`),children:(0,I.jsx)(Kq,{cell:e,intro:t})});let a=async()=>{await V(`planner.toggleSeat`,{member:r})&&n()};return(0,I.jsx)(`li`,{children:(0,I.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,I.jsx)(KB,{checked:e.seated,onCheckedChange:()=>void a(),"aria-label":`${uH(e.label)} sits on the panel`}),(0,I.jsx)(Kq,{cell:e,intro:t})]})})}function Jq({cells:e,intro:t,onToggled:n}){return(0,I.jsx)(`ul`,{"aria-label":`Panel`,className:`flex flex-wrap gap-2`,children:e.map(e=>(0,I.jsx)(qq,{cell:e,intro:t,onToggled:n},e.label))})}function Yq({cell:e,onToggled:t}){let{member:n}=e,r=uH(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))]`:`border-dashed border-input bg-transparent`),a=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,I.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,I.jsx)(CH,{source:e.label,className:`size-3.5`})}),(0,I.jsx)(`span`,{className:q(`truncate text-sm font-semibold`,e.seated?dH(e.label):`text-muted-foreground`),children:r})]}),n?(0,I.jsx)(KB,{checked:e.seated,onCheckedChange:()=>void Xq(n,t),"aria-label":`${r} sits on the panel`}):null]}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:jq[e.label]}),(0,I.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":pH(e.label)};return n?(0,I.jsx)(`li`,{style:o,children:(0,I.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,I.jsx)(`li`,{style:o,children:(0,I.jsx)(`div`,{className:i,children:a})})}async function Xq(e,t){await V(`planner.toggleSeat`,{member:e})&&t()}function Zq({cells:e,onToggled:t}){return(0,I.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,I.jsx)(Yq,{cell:e,onToggled:t},e.label))})}function Qq({snap:e}){let t=Rq(e),n=!e.busy&&Lq(e)!==void 0;return(0,I.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,I.jsx)(jD,{className:`size-3.5`,"aria-hidden":`true`}):null,t.join(` · `)]})}function $q({snap:e,onDone:t}){let n=LD(`status`).data?.keys.find(e=>e.action===`savePlan`)?.label,r=e=>async()=>{await V(e,{})&&t()};return(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1`,children:[e.questions.length>0&&!e.busy?(0,I.jsx)(Y,{label:`Answer questions`,icon:Hm,tone:`primary`,shortcut:`A`,onClick:()=>void r(`planner.answer`)()}):null,e.retryable?(0,I.jsx)(Y,{label:`Retry`,icon:Oh,shortcut:`R`,onClick:()=>void r(`planner.retry`)()}):null,(0,I.jsx)(Y,{"data-plan-save":!0,label:`Save the plan`,text:`Save`,icon:Mh,shortcut:n??`Ctrl+S`,disabled:!e.draft||e.busy,onClick:()=>void r(`planner.save`)()}),(0,I.jsx)(BO,{icon:vm,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 V(`planner.new`,{}).then(t)})]})}function eJ({snap:e,onDone:t}){return(0,I.jsxs)(`header`,{className:`flex shrink-0 flex-col gap-3 border-b border-border px-5 py-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-x-4 gap-y-2`,children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight`,children:`Planning`}),(0,I.jsx)(Qq,{snap:e})]}),(0,I.jsx)($q,{snap:e,onDone:t})]}),(0,I.jsx)(Jq,{cells:Bq(e),intro:!1,onToggled:t})]})}function tJ({line:e,onClose:t,onSent:n}){let r=mD(e!==void 0,pD.confirm);return(0,I.jsx)(oD,{open:e!==void 0&&r,onOpenChange:e=>!e&&t(),label:`Comment on this line`,className:`max-w-xl`,children:(0,I.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 p-6`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h2`,{className:`text-base font-medium`,children:`Comment on this line`}),(0,I.jsx)(`p`,{className:`mt-1 line-clamp-3 text-sm break-words text-muted-foreground`,children:e})]}),(0,I.jsx)(Kz,{label:`Your comment`,hint:`Enter adds the comment · Esc cancels`,buttonLabel:`Add comment`,onSend:async r=>e===void 0||!await V(`planner.commentLine`,{line:e,text:r.trim()})?!1:(n(e,r.trim()),t(),!0)})]})})}function nJ({limit:e}){return e<=0?null:(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`flex gap-1`,children:Array.from({length:e},(t,n)=>(0,I.jsx)(`span`,{className:q(`h-1.5 w-4 rounded-full`,n===e-1?`bg-primary`:`bg-border`)},n))}),(0,I.jsxs)(`span`,{children:[`up to `,e,` rounds, the last the oracle's`]})]})}function rJ({snap:e,onDone:t}){let n=Bq(e);return(0,I.jsx)(`div`,{className:`@container flex-1 overflow-y-auto px-5 pt-8 pb-dock sm:px-8 sm:pt-10`,children:(0,I.jsxs)(`div`,{className:`mx-auto flex w-full max-w-5xl flex-col gap-8`,children:[(0,I.jsxs)(`header`,{className:`flex flex-col gap-4 @3xl:flex-row @3xl:items-end @3xl:justify-between`,children:[(0,I.jsxs)(`div`,{className:`flex items-start gap-4`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`grid size-11 shrink-0 place-items-center rounded-xl border border-border bg-card text-primary shadow-card`,children:(0,I.jsx)(Ah,{className:`size-5`})}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h2`,{className:`text-xl font-semibold tracking-tight`,children:`Plan with the panel`}),(0,I.jsx)(`p`,{className:`max-w-xl text-sm leading-relaxed text-muted-foreground`,children:Aq})]})]}),(0,I.jsx)(nJ,{limit:e.limit})]}),(0,I.jsxs)(`section`,{"aria-labelledby":`plan-panel`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`plan-panel`,className:`text-xs text-muted-foreground`,children:(0,I.jsx)(JR,{title:`The panel`,right:Nq(n)})}),(0,I.jsx)(Zq,{cells:n,onToggled:t})]}),(0,I.jsxs)(`section`,{"aria-labelledby":`plan-steps`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`plan-steps`,className:`text-xs text-muted-foreground`,children:(0,I.jsx)(JR,{title:`How a plan comes together`})}),(0,I.jsx)(`ol`,{className:`grid gap-3 @2xl:grid-cols-2 @4xl:grid-cols-4`,children:Mq.map((e,t)=>(0,I.jsxs)(`li`,{className:`relative flex gap-3 rounded-xl border border-border bg-card p-3.5`,children:[(0,I.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,I.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,I.jsx)(`span`,{className:`text-sm font-medium`,children:e.title}),(0,I.jsx)(`span`,{className:`text-xs leading-relaxed text-muted-foreground`,children:e.text})]})]},e.title))})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(mp,{"aria-hidden":`true`,className:`size-4 text-primary motion-safe:animate-bounce`}),`Start in the box below.`,(0,I.jsx)(aD,{chord:`/`,children:`write`}),(0,I.jsx)(aD,{chord:`Enter`,children:`send to the panel`})]})]})})}function iJ({snap:e,wide:t}){let{ref:n,onScroll:r}=cH(JSON.stringify(e.messages));return(0,I.jsxs)(yO,{className:`flex flex-col`,children:[(0,I.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,I.jsx)(JR,{title:`Conversation`,className:`w-full`})}),(0,I.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,I.jsx)(Cq,{messages:e.messages,busy:e.busy})})]})}function aJ({snap:e,comments:t,onComment:n,wide:r}){return(0,I.jsxs)(yO,{className:`flex flex-col`,children:[(0,I.jsx)(`h2`,{className:`flex min-h-12 shrink-0 items-center border-b border-border px-4 text-sm font-medium`,children:(0,I.jsx)(JR,{title:`Draft plan`,className:`w-full`})}),(0,I.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,I.jsx)(Wq,{draft:e.draft,comments:t,onComment:n}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.busy?Eq:Tq}),(0,I.jsx)(Gq,{notes:e.notes})]})]})}function oJ({snap:e,reload:t}){let n=vO(),[r,i]=(0,m.useState)(),[a,o]=(0,m.useState)(new Map);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(eJ,{snap:e,onDone:t}),(0,I.jsxs)(`div`,{className:n?`grid min-h-0 flex-1 grid-cols-[minmax(0,46fr)_minmax(0,54fr)] grid-rows-[minmax(0,1fr)] divide-x divide-border`:`flex flex-col divide-y divide-border`,children:[(0,I.jsx)(iJ,{snap:e,wide:n}),(0,I.jsx)(aJ,{snap:e,comments:a,onComment:i,wide:n})]}),(0,I.jsx)(tJ,{line:r,onClose:()=>i(void 0),onSent:(e,t)=>o(n=>new Map(n).set(e,[...n.get(e)??[],t]))})]})}function sJ(){let e=zD(`planner.get`,{},[`planner`]),t=e.data;if(!t&&e.error)return(0,I.jsx)(ND,{message:`Could not load the plan. ${e.error}`,onRetry:e.reload});if(!t)return(0,I.jsx)(`p`,{role:`status`,className:`p-5 text-sm text-muted-foreground`,children:`Loading the plan…`});let n=Iq(t);return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:n?(0,I.jsx)(rJ,{snap:t,onDone:e.reload}):(0,I.jsx)(oJ,{snap:t,reload:e.reload})})}var cJ=`Describe a small change in the box below and one agent makes it now, beside any running task.`;function lJ(e){return e.prompt.split(`
|
|
102
|
+
`).find(e=>e.trim())?.trim()??`(empty)`}function uJ(e){return[...e].reverse()}function dJ(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 fJ(e,t){return e.startedAt?dJ((e.finishedAt??t)-e.startedAt):``}function pJ(e,t){let n=e.model?`${e.model}${e.thinking?` · ${e.thinking}`:``}`:e.thinking??``;return[fJ(e,t),n,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.usage?.cost?`$${e.usage.cost.toFixed(2)}`:``].filter(Boolean).join(` · `)}function mJ(e){return e===`queued`?`Waiting for the quick fix ahead of it.`:e===`running`?`starting…`:e===`held`?`Not started.`:`No tool calls.`}function hJ({job:e}){let t=e.status===`held`;return(0,I.jsxs)(I.Fragment,{children:[e.route?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Routed `,e.route]}):null,e.note&&t?(0,I.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,I.jsx)(ng,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,I.jsxs)(`span`,{children:[`Held: `,e.note,`.`]})]}):null,e.note&&!t?(0,I.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,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Routed here by the oracle.`}):null]})}function gJ({job:e}){let t=e.status===`running`;return e.steps.length===0?(0,I.jsxs)(`p`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[t?(0,I.jsx)(jD,{className:`size-3.5`}):null,mJ(e.status)]}):(0,I.jsx)(`ol`,{className:`flex flex-col gap-1 text-sm`,children:e.steps.map((e,n)=>(0,I.jsxs)(`li`,{className:`flex items-start gap-2`,children:[(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:EO(e.at)}),(0,I.jsx)(`span`,{className:`flex h-5 w-3.5 shrink-0 items-center justify-center`,"aria-hidden":`true`,children:e.pending&&t?(0,I.jsx)(jD,{className:`size-3.5`}):(0,I.jsx)(`span`,{className:`size-1.5 rounded-full bg-muted-foreground/40`})}),(0,I.jsx)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:e.pending&&t?`${e.text}…`:e.text})]},n))})}function _J({job:e}){return e.status===`held`?(0,I.jsxs)(lO,{children:[(0,I.jsx)(Y,{label:`Run anyway`,icon:bh,tone:`primary`,shortcut:`R`,onClick:()=>void V(`quickfix.runAnyway`,{id:e.id})}),(0,I.jsx)(Y,{label:`Turn it into a task`,text:`Make it a task`,icon:Im,shortcut:`T`,onClick:()=>void V(`quickfix.movedToTask`,{id:e.id})})]}):e.status!==`queued`&&e.status!==`running`?null:(0,I.jsx)(lO,{children:(0,I.jsx)(BO,{icon:Xp,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 V(`quickfix.cancel`,{id:e.id})})})}function vJ({job:e,now:t}){return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":`Quick fix detail`,children:[(0,I.jsx)(_J,{job:e}),(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`h2`,{className:`text-lg font-semibold tracking-tight break-words`,children:lJ(e)}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:e.status}),pJ(e,t)?(0,I.jsx)(`span`,{children:pJ(e,t)}):null]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),e.prompt.trim().includes(`
|
|
103
|
+
`)?(0,I.jsx)(KR,{text:e.prompt}):null,(0,I.jsx)(hJ,{job:e}),(0,I.jsx)(YR,{title:`Steps`,children:(0,I.jsx)(gJ,{job:e})}),e.files?.length?(0,I.jsx)(YR,{title:`Edited`,children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.files.map(e=>(0,I.jsxs)(`li`,{className:`break-all`,children:[`· `,e]},e))})}):null,e.error?(0,I.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,I.jsx)(YR,{title:`Report`,children:(0,I.jsx)(KR,{text:e.report})}):null]})}function yJ({status:e}){if(e===`running`)return(0,I.jsx)(jD,{className:`size-3.5`,"aria-label":`running`});let t={queued:nm,success:Ap,failed:gg,timeout:gg,cancelled:Qm,held:uh,running:nm}[e];return(0,I.jsxs)(I.Fragment,{children:[(0,I.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,I.jsx)(`span`,{className:`sr-only`,children:e})]})}function bJ({job:e,selected:t,now:n,onSelect:r}){let i=fJ(e,n);return(0,I.jsx)(`li`,{children:(0,I.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(Pz,`flex-row items-start gap-2.5 text-sm`),children:[(0,I.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:(0,I.jsx)(yJ,{status:e.status})}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,t?`font-medium text-foreground`:`text-foreground`),children:lJ(e)}),i?(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:i}):null]})})}function xJ({jobs:e,selectedId:t,now:n,onSelect:r}){return(0,I.jsx)(`ul`,{className:Fz,children:e.map(e=>(0,I.jsx)(bJ,{job:e,selected:e.id===t,now:n,onSelect:r},e.id))})}var SJ=()=>CD(SD(`quickfix`)),CJ=e=>CD(SD(`quickfix`,e));function wJ(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 TJ(){return(0,I.jsx)(TD,{className:`m-4 flex-1`,children:(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(vg,{"aria-hidden":`true`})}),(0,I.jsx)(AD,{className:`font-medium text-foreground`,children:cJ})]})})}function EJ({id:e}){let t=vO(),n=zD(`quickfix.list`,{},[`quickfix`]),r=uJ(n.data?.jobs??[]),i=wJ(r.some(e=>e.status===`running`));if(!n.data&&n.error)return(0,I.jsx)(ND,{message:`Could not load quick fixes. ${n.error}`,onRetry:n.reload});let a=n.data&&r.length===0?(0,I.jsx)(TJ,{}):(0,I.jsx)(DJ,{id:e,wide:t,loaded:!!n.data,jobs:r,now:i});return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:a})}function DJ({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,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:`Quick fixes`,count:String(r.length)}),n?(0,I.jsx)(xJ,{jobs:r,selectedId:a,now:i,onSelect:CJ}):(0,I.jsx)(CO,{})]});return(0,I.jsx)(xO,{wide:t,list:s,detail:o?(0,I.jsx)(vJ,{job:o,now:i}):e?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That quick fix is not on the list any more.`}):null,open:!!e,onClose:SJ,hint:`Select a quick fix to see its steps.`,describe:`Quick fix detail`})}var OJ={},kJ=new Set;function AJ(e){OJ=e;for(let e of[...kJ])e()}function jJ(e){OJ.taskId!==e&&AJ({...OJ,taskId:e})}function MJ(e){(OJ.session?.name!==e?.name||JSON.stringify(OJ.session?.address)!==JSON.stringify(e?.address))&&AJ({...OJ,session:e})}function NJ(e){return kJ.add(e),()=>{kJ.delete(e)}}function PJ(){return(0,m.useSyncExternalStore)(NJ,()=>OJ,()=>OJ)}function FJ({entry:e}){let t=e.at?EO(e.at):``;return e.role===`note`?(0,I.jsxs)(`li`,{className:`text-center text-xs text-muted-foreground`,children:[e.text,t?` · ${t}`:``]}):e.role===`you`?(0,I.jsxs)(`li`,{className:`flex flex-col items-end gap-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-baseline gap-2 text-xs text-muted-foreground`,children:[t,` `,(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`You`})]}),(0,I.jsx)(`div`,{className:`max-w-[85%] rounded-xl rounded-tr-sm border border-primary/10 bg-you px-3.5 py-2`,children:(0,I.jsx)(KR,{text:e.text})})]}):(0,I.jsxs)(`li`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`span`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`size-2 rounded-full bg-primary`}),(0,I.jsx)(`span`,{className:`font-medium text-foreground`,children:`Oracle`}),` `,t]}),(0,I.jsx)(`div`,{className:`max-w-[90%] pl-4`,children:(0,I.jsx)(KR,{text:e.text})})]})}function IJ({entries:e,more:t,loading:n,onMore:r,empty:i}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[t?(0,I.jsx)(`div`,{className:`flex self-center`,children:(0,I.jsx)(Y,{label:`Load earlier messages`,icon:Rp,disabled:n,onClick:r??(()=>void 0)})}):null,e.length===0?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:i}):(0,I.jsx)(`ol`,{"aria-label":`Conversation`,className:`flex flex-col gap-4`,children:e.map(e=>(0,I.jsx)(FJ,{entry:e},e.id))})]})}function LJ({address:e,empty:t}){let n=zD(`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 V(`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,I.jsx)(IJ,{entries:l,more:d,loading:a,onMore:()=>void u(),empty:n.loading&&!n.data?`Loading the conversation…`:t})}var RJ={"this window":`This window`,background:`Background`,"other terminal":`Other terminals`},zJ=[`this window`,`background`,`other terminal`],BJ=`Nothing said yet.`,VJ=`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.`,HJ=`No other sessions. Start one below.`;function UJ(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 WJ(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 GJ(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 KJ(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[UJ(e,t,n),...r.map(WJ),...o.map(GJ)]}function qJ(e){return`${e} question${e===1?``:`s`} waiting for you`}function JJ(e){return e.status===`starting`?`starting ${e.name}…`:e.alive?`${e.name} has not said anything yet.`:`${e.name} has ended.`}function YJ(e){return[e.where,e.status.replace(/_/g,` `),e.pid?`pid ${e.pid}`:``].filter(Boolean).join(` · `)}function XJ(e){return e.key?{key:e.key}:e.sessionId?{sessionId:e.sessionId}:void 0}function ZJ({options:e,send:t}){return(0,I.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:e.map(e=>(0,I.jsx)(J,{variant:`outline`,onClick:()=>void t({value:e}),children:e},e))})}function QJ({dialog:e,send:t}){let n=(0,m.useId)(),[r,i]=(0,m.useState)(e.prefill??``);return(0,I.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,I.jsx)(`label`,{htmlFor:n,className:`sr-only`,children:e.title}),(0,I.jsx)(wO,{id:n,rows:e.method===`editor`?4:2,value:r,placeholder:e.placeholder,onChange:e=>i(e.target.value)}),(0,I.jsx)(`div`,{className:`flex self-end`,children:(0,I.jsx)(Y,{label:`Send the answer`,text:`Send`,icon:bp,tone:`primary`,disabled:!r.trim(),onClick:()=>void t({value:r.trim()})})})]})}function $J({dialog:e,send:t}){return e.method===`select`?(0,I.jsx)(ZJ,{options:e.options??[],send:t}):e.method===`confirm`?(0,I.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,I.jsx)(J,{onClick:()=>void t({confirmed:!0}),children:`Yes`}),(0,I.jsx)(J,{variant:`outline`,onClick:()=>void t({confirmed:!1}),children:`No`})]}):(0,I.jsx)(QJ,{dialog:e,send:t})}function eY({sessionKey:e,dialog:t,onAnswered:n}){let r=async r=>{await V(`sessions.answer`,{key:e,dialogId:t.id,answer:r})&&n()};return(0,I.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-lg border border-border bg-background/60 p-3`,children:[(0,I.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium text-foreground`,children:t.title}),t.message?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t.message}):null]}),(0,I.jsx)($J,{dialog:t,send:r}),(0,I.jsx)(`div`,{className:`flex self-start`,children:(0,I.jsx)(Y,{label:`Put it away`,text:`Put away`,icon:gg,onClick:()=>void r({cancelled:!0})})})]})}function tY({sessionKey:e,dialogs:t,onAnswered:n}){return t.length===0?null:(0,I.jsxs)(`section`,{"aria-label":`Questions waiting`,className:`flex flex-col gap-2`,children:[(0,I.jsx)(`p`,{role:`status`,className:`text-sm font-medium text-foreground`,children:qJ(t.length)}),t.map(t=>(0,I.jsx)(eY,{sessionKey:e,dialog:t,onAnswered:n},t.id))]})}var nY={"this window":eh,background:Mm,"other terminal":Wh};function rY({where:e,className:t}){let n=nY[e];return(0,I.jsx)(n,{"aria-hidden":`true`,className:q(`size-4 shrink-0 text-muted-foreground`,t)})}function iY({task:e}){let t=e.progress;return(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-2 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`break-all`,children:e.id}),t&&t.total>0?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(YH,{done:t.done,total:t.total}),(0,I.jsxs)(`span`,{className:`tabular-nums`,children:[t.done,`/`,t.total]})]}):null]})}function aY({entry:e}){let{key:t}=e;return e.where===`this window`?(0,I.jsx)(lO,{children:(0,I.jsx)(Y,{label:`Back to this window`,text:`Back to the Lobby`,icon:gp,tone:`primary`,shortcut:`B`,onClick:()=>CD(`#/lobby`)})}):t?(0,I.jsxs)(lO,{children:[(0,I.jsx)(Y,{label:`Move here`,icon:vp,tone:`primary`,shortcut:`M`,onClick:()=>void V(`sessions.switch`,{key:t})}),(0,I.jsx)(BO,{icon:Xp,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 V(`sessions.stop`,{key:t})})]}):null}function oY({entry:e,lobby:t}){let n=XJ(e);return e.where===`this window`?(0,I.jsx)(IJ,{entries:t?.chat??[],more:!1,empty:BJ}):n?(0,I.jsx)(LJ,{address:n,empty:e.where===`other terminal`?`Nothing said in this session yet.`:JJ(e)},e.id):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:BJ})}function sY({entry:e,lobby:t,onChanged:n}){return(0,I.jsxs)(`article`,{"aria-label":`Session detail`,className:`flex flex-col gap-4`,children:[(0,I.jsx)(aY,{entry:e}),(0,I.jsxs)(`header`,{className:`flex flex-col gap-1.5`,children:[(0,I.jsxs)(`h3`,{className:`flex items-center gap-2.5 text-lg font-semibold tracking-tight text-foreground`,children:[(0,I.jsx)(rY,{where:e.where,className:`size-[1.1rem]`}),e.name]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:YJ(e)}),e.task?(0,I.jsx)(iY,{task:e.task}):null,e.where!==`background`&&e.waiting>0?(0,I.jsx)(`p`,{className:`text-sm text-foreground`,children:qJ(e.waiting)}):null]}),e.where===`other terminal`?(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:VJ}):null,e.key?(0,I.jsx)(tY,{sessionKey:e.key,dialogs:e.dialogs,onAnswered:n}):null,(0,I.jsx)(YR,{title:`Conversation`,children:(0,I.jsx)(oY,{entry:e,lobby:t})})]})}function cY({entry:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.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(Pz,`flex-row items-start gap-2.5 text-sm`),children:[(0,I.jsx)(rY,{where:e.where,className:`mt-0.5`}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words text-foreground`,t&&`font-medium`),children:e.name}),(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground`,children:[e.status===`working`||e.status===`starting`?(0,I.jsx)(jD,{className:`size-3`,"aria-hidden":`true`}):null,e.status.replace(/_/g,` `),e.waiting>0?(0,I.jsx)(`span`,{className:`rounded-md bg-warning/15 px-1.5 py-0.5 font-medium text-warning tabular-nums`,children:e.waiting}):null]})]})})}function lY({where:e,entries:t,selectedId:n,onSelect:r}){return(0,I.jsxs)(`section`,{"aria-label":RJ[e],className:`flex flex-col`,children:[(0,I.jsx)(`h3`,{className:Iz,children:(0,I.jsx)(JR,{title:RJ[e],right:String(t.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,I.jsx)(`ul`,{className:Fz,children:t.map(e=>(0,I.jsx)(cY,{entry:e,selected:e.id===n,onSelect:r},e.id))})]})}function uY({entries:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`div`,{className:`flex flex-col pb-2`,children:zJ.map(r=>{let i=e.filter(e=>e.where===r);return i.length>0?(0,I.jsx)(lY,{where:r,entries:i,selectedId:t,onSelect:n},r):null})})}var dY=()=>CD(`#/sessions`),fY=e=>CD(`#/sessions/${encodeURIComponent(e)}`);function pY({windows:e}){return e.length===0?null:(0,I.jsx)(`div`,{className:`px-4 pb-4 pt-2`,children:(0,I.jsx)(YR,{title:`Other windows`,children:(0,I.jsx)(`ul`,{className:`flex flex-col`,children:e.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,className:`flex min-h-8 items-center rounded-lg px-2.5 text-sm text-foreground underline-offset-4 transition-colors hover:bg-muted hover:underline`,children:e.name})},e.url))})})})}function mY(){return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That session is not on the list any more.`})}function hY({id:e}){let t=vO(),n=LD(`status`).data,r=LD(`lobby`).data,i=LD(`prompts`).data?.prompts.length??0,a=zD(`sessions.list`,{},[`sessions`]);if(!a.data&&a.error)return(0,I.jsx)(ND,{message:`Could not load sessions. ${a.error}`,onRetry:a.reload});let o=KJ(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?XJ(c):void 0,u=l?JSON.stringify(l):``,d=c?.name;(0,m.useEffect)(()=>(MJ(l&&d?{name:d,address:l}:void 0),()=>MJ(void 0)),[u,d]);let f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:`Sessions`,count:String(o.length)}),a.data?(0,I.jsx)(uY,{entries:o,selectedId:s,onSelect:fY}):(0,I.jsx)(CO,{}),a.data&&o.length===1?(0,I.jsx)(`p`,{className:`px-4 pb-3 text-sm text-muted-foreground`,children:HJ}):null,(0,I.jsx)(pY,{windows:n?.windows??[]})]}),p=c?(0,I.jsx)(sY,{entry:c,lobby:r,onChanged:a.reload},c.id):e?(0,I.jsx)(mY,{}):null;return(0,I.jsx)(xO,{wide:t,list:f,detail:p,open:!!e,onClose:dY,hint:`Select a session to see its conversation.`,describe:`Session detail`})}function gY(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 vY({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,I.jsxs)(`span`,{className:`tabular-nums`,children:[e.waiting?`Waiting for you · `:``,e.phase.replaceAll(`_`,` `),` · `,_Y(gY(e,n,t)),` execution`]})}function yY({timing:e,stopped:t=!1}){return e?(0,I.jsx)(vY,{timing:e,stopped:t},JSON.stringify(e)):(0,I.jsx)(`span`,{children:`Timing unavailable`})}var bY=`This directly merges the reviewed commit into main and pushes main. It does not create a pull request.`,xY={pending_approval:`Ready for your review`,deferred:`Saved for later`,in_progress:`Delivery in progress`,successful:`Delivered`,recoverable_failure:`Delivery needs attention`};function SY({delivery:e,title:t}){return(0,I.jsxs)(`div`,{className:`grid gap-2 text-sm`,children:[(0,I.jsx)(`p`,{className:`font-medium break-words`,children:t}),(0,I.jsxs)(`dl`,{className:`grid gap-1 break-all text-muted-foreground`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Project: `}),(0,I.jsx)(`dd`,{className:`inline`,children:e.project})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Repository: `}),(0,I.jsx)(`dd`,{className:`inline`,children:e.repository??`Unavailable — refresh review`})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Source: `}),(0,I.jsxs)(`dd`,{className:`inline`,children:[e.sourceBranch,` · `,e.sourceCommit??`Commit unavailable`]})]}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`dt`,{className:`inline`,children:`Target: `}),(0,I.jsxs)(`dd`,{className:`inline`,children:[`main`,e.targetCommit?` · ${e.targetCommit}`:``]})]})]}),(0,I.jsxs)(`p`,{children:[`Checks: `,e.verification?.checks??`unavailable`]}),(0,I.jsx)(`p`,{children:e.verification?.summary??`Verification unavailable. Refresh the review before delivery.`}),e.verification?(0,I.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 CY({action:e,delivery:t,busy:n,onAction:r}){let i=t.blocked[e],a=n||t.status===`in_progress`||t.status===`successful`||!!i;return(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.jsx)(J,{variant:`outline`,disabled:a,onClick:()=>r(e),children:e===`create_pr`?`Create PR`:`Merge to main`}),(0,I.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.`:`Directly updates and pushes main. Requires confirmation.`}),i?(0,I.jsxs)(`p`,{className:`text-sm text-destructive`,children:[i,` Refresh review after resolving this restriction, then choose the action again.`]}):null]})}async function wY(e,t,n){let r={taskId:t,reviewId:n};return e===`refresh`?qf(`tasks.deliveryReview`,{taskId:t}):e===`defer`?qf(`tasks.deliveryDefer`,r):qf(`tasks.deliver`,{...r,action:e,...e===`merge_main`?{confirmMain:!0}:{}})}function TY({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=Hf(),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 EY(e){return e.scope.current===e.identity&&e.project===Hf()}function DY(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 wY(r,t.taskId,e.current.reviewId);EY(e)&&(e.setCurrent(n.delivery),t.onChanged())}catch(t){EY(e)&&e.setError(t instanceof Error?t.message:String(t))}finally{n.current=!1,e.scope.current&&e.setBusy(!1)}}}return r}function OY(e){let t=TY(e),n=DY(t,e),r=mD(t.confirm,pD.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 kY({review:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Task completion is recorded separately. Nothing is published without your approval.`}),(0,I.jsx)(`p`,{role:`status`,className:`text-sm`,children:e.busy?`Updating delivery…`:e.current.operation?`Operation: ${e.current.operation.stage}`:xY[e.current.status]}),e.current.error||e.error?(0,I.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.result?(0,I.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,I.jsxs)(`span`,{children:[` · `,e.current.result.pullUrl]}):null]}):null]})}function AY({review:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`mt-3 grid gap-3 sm:grid-cols-2`,children:[(0,I.jsx)(CY,{action:`create_pr`,delivery:e.current,busy:e.busy,onAction:()=>void e.request(`create_pr`)}),(0,I.jsx)(CY,{action:`merge_main`,delivery:e.current,busy:e.busy,onAction:e.reviewMerge})]}),(0,I.jsxs)(`div`,{className:`mt-3 flex flex-wrap gap-2`,children:[(0,I.jsx)(J,{variant:`ghost`,disabled:e.busy,onClick:()=>void e.request(`refresh`),children:`Refresh review`}),(0,I.jsx)(J,{variant:`ghost`,disabled:e.busy||e.terminal,onClick:()=>void e.request(`defer`),children:`Not now`})]})]})}function jY({review:e}){return(0,I.jsx)(oD,{open:e.slot,onOpenChange:e.setConfirm,label:`Confirm merge to main`,description:bY,onCloseAutoFocus:t=>{t.preventDefault(),requestAnimationFrame(()=>e.trigger.current?.focus())},children:(0,I.jsxs)(`div`,{className:`grid gap-4 p-4`,children:[(0,I.jsx)(`h3`,{className:`font-medium`,children:`Merge to main?`}),(0,I.jsx)(`p`,{className:`text-sm`,children:bY}),(0,I.jsxs)(`p`,{className:`break-all text-sm text-muted-foreground`,children:[e.current.repository,` · `,e.current.sourceCommit,` → main`]}),(0,I.jsxs)(`div`,{className:`flex flex-wrap justify-end gap-2`,children:[(0,I.jsx)(J,{variant:`outline`,onClick:()=>e.setConfirm(!1),children:`Cancel`}),(0,I.jsx)(J,{disabled:e.busy||!!e.current.blocked.merge_main||e.terminal,onClick:()=>void e.request(`merge_main`),children:`Confirm merge and push main`})]})]})})}function MY({title:e,review:t}){return(0,I.jsxs)(YR,{title:`Completed work · delivery review`,right:xY[t.current.status],children:[(0,I.jsx)(SY,{delivery:t.current,title:e}),(0,I.jsx)(kY,{review:t}),(0,I.jsx)(AY,{review:t}),(0,I.jsx)(jY,{review:t})]})}function NY(e){let t=OY(e);return(0,I.jsx)(MY,{title:e.title,review:t})}var PY={open:em,delivered:Kp,addressed:Hp},FY={open:`waiting for the owning session`,delivered:`sent to the oracle`,addressed:`plan amended`};function IY({comment:e}){let t=kO(Date.now()-Date.parse(e.createdAt)),n=PY[e.status];return(0,I.jsxs)(`p`,{className:`mt-1 flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(n,{"aria-hidden":`true`,className:e.status===`addressed`?`size-3.5 text-success`:`size-3.5`}),FY[e.status],`, `,t,e.editedAt?` (edited)`:``]})}function LY({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,I.jsxs)(`li`,{className:`rounded-lg border border-border bg-background/60 px-3.5 py-2.5`,children:[r?(0,I.jsx)(vq,{text:s.text,onSave:async n=>{let r=await qf(`tasks.editComment`,{taskId:t,commentId:e.id,text:n});o(r.comment)},onCancel:()=>i(!1)}):(0,I.jsx)(KR,{text:s.text}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(IY,{comment:s}),n&&!r?(0,I.jsx)(J,{size:`sm`,variant:`ghost`,onClick:()=>i(!0),children:`Edit`}):null]})]})}function RY({taskId:e,finished:t,canComment:n}){let r=zD(`tasks.comments`,{taskId:e},[`tasks`]),i=LD(`status`),a=r.data?.comments??[],o=a.filter(e=>e.status!==`addressed`).length;return(0,I.jsxs)(`section`,{"aria-labelledby":`comments-${e}`,className:`flex flex-col gap-3`,children:[(0,I.jsx)(`h3`,{id:`comments-${e}`,className:`text-sm`,children:(0,I.jsx)(JR,{title:`Comments`,right:o>0?`${o} open`:void 0})}),a.length===0?(0,I.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,I.jsx)(`ul`,{className:`flex flex-col gap-2.5`,children:a.map(t=>(0,I.jsx)(LY,{taskId:e,comment:t,own:!!(t.by&&t.by===i.data?.sessionId)},`${e}-${t.id}`))})]})}function zY({step:e,index:t}){let n=e.status===`done`?Hp:em,r=e.status===`done`?`text-success`:e.status===`current`?`text-primary`:`text-muted-foreground`;return(0,I.jsxs)(`li`,{className:`flex items-start gap-2.5 text-sm`,children:[(0,I.jsx)(n,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 ${r}`}),(0,I.jsxs)(`span`,{className:`shrink-0 text-xs text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,I.jsx)(`span`,{className:e.status===`current`?`min-w-0 break-words text-foreground`:`min-w-0 break-words text-muted-foreground`,children:e.text}),e.status===`current`?(0,I.jsxs)(`span`,{className:`shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:[`now`,(0,I.jsx)(`span`,{className:`sr-only`,children:` (current step)`})]}):null]})}function BY({steps:e}){let t=e.filter(e=>e.status===`done`).length;return(0,I.jsx)(YR,{title:`Progress`,right:`${t}/${e.length} steps`,children:(0,I.jsx)(`ol`,{className:`flex flex-col gap-2`,children:e.map((e,t)=>(0,I.jsx)(zY,{step:e,index:t},`${t}-${e.text}`))})})}function VY({detail:e,finished:t}){return e.plan?(0,I.jsx)(YR,{title:`Approved plan`,children:(0,I.jsx)(KR,{text:e.plan})}):e.proposal?(0,I.jsx)(YR,{title:t?`Proposal`:`Proposal (no plan yet)`,children:(0,I.jsx)(KR,{text:e.proposal})}):(0,I.jsx)(YR,{title:`Plan`,children:(0,I.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 HY({amendments:e}){return e.length===0?null:(0,I.jsx)(YR,{title:`Amendments`,children:(0,I.jsx)(`ul`,{className:`flex list-disc flex-col gap-1 pl-5 text-sm text-muted-foreground`,children:e.map(e=>(0,I.jsx)(`li`,{className:`break-words`,children:e},e))})})}function UY({detail:e}){return e.waiting.length===0&&e.blockers.length===0?null:(0,I.jsx)(YR,{title:`Waiting on`,children:(0,I.jsxs)(`ul`,{className:`flex flex-col gap-1 text-sm`,children:[e.waiting.map((e,t)=>(0,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Bp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-warning`}),(0,I.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,I.jsxs)(`li`,{className:`flex gap-2`,children:[(0,I.jsx)(Qp,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-destructive`}),(0,I.jsxs)(`span`,{className:`min-w-0 break-words text-muted-foreground`,children:[e.reason,` (needs: `,e.need,`)`]})]},`${t}-${e.reason}`))]})})}function WY({runs:e}){return e.length===0?null:(0,I.jsx)(YR,{title:`Recent runs`,children:(0,I.jsx)(`ul`,{className:`flex flex-col gap-1 text-sm text-muted-foreground`,children:e.map((e,t)=>(0,I.jsx)(`li`,{className:`break-words`,children:e},`${t}-${e}`))})})}function GY({detail:e,finished:t}){return(0,I.jsxs)(I.Fragment,{children:[e.request?(0,I.jsx)(YR,{title:`Request`,children:(0,I.jsx)(KR,{text:e.request})}):null,e.steps.length>0?(0,I.jsx)(BY,{steps:e.steps}):null,(0,I.jsx)(VY,{detail:e,finished:t})]})}function KY({detail:e}){return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(HY,{amendments:e.amendments}),(0,I.jsx)(UY,{detail:e}),(0,I.jsx)(WY,{runs:e.runs})]})}function qY({row:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){if(e.section===`mine`)return CD(`#/lobby`);let n=Hf(),r=()=>t.current&&Hf()===n;try{let t=await qf(`tasks.open`,{taskId:e.id});if(!r())return;let n=await qf(`status.get`,{});if(!r())return;if(t.sessionId&&t.sessionId===n.sessionId)return CD(`#/lobby`);if(t.sessionId&&!t.key)return B.info(`This task runs in another terminal. Switch to that terminal to work on it.`);if(n.busy)return B.info(`The oracle is working in this window. Stop it first, then open the task in its session.`);await V(`sessions.switch`,t.key?{key:t.key}:{claimTaskId:e.id})&&r()&&CD(`#/lobby`)}catch(e){r()&&B.error(e instanceof Error?e.message:String(e))}}let r=e.section===`mine`;return(0,I.jsx)(Y,{label:r?`Open in its session: this window`:`Open in its session`,text:`Open in session`,icon:vp,tone:`primary`,shortcut:`S`,onClick:()=>void n()})}var JY={mine:`This session`,others:`Other sessions`,pending:`Pending`,recent:`Finished`,archived:`Archived`},YY={open:`open`,done:`done`,dropped:`abandoned`},XY=`No tasks yet. Start one from the Lobby tab, or plan one in the Plan tab.`;function ZY(e,t){return`${e.replace(/_/g,` `)}${t?` · paused`:``}`}function QY(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[ZY(e.status,e.paused),e.auto?`auto`:``,t].filter(Boolean).join(` · `)}function eX(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 tX(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 nX({split:e}){let t=e.after.length>0?`, after ${e.after.map(e=>`part ${e}`).join(` and `)}`:``;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[(0,I.jsxs)(`span`,{className:`font-medium text-primary`,children:[`part `,e.part,` of `,e.of]}),` of one plan that was split into tasks`,t?(0,I.jsx)(`span`,{className:`text-foreground`,children:t}):null]}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.titles.map((t,n)=>(0,I.jsxs)(`span`,{children:[n>0?(0,I.jsx)(`span`,{className:`text-muted-foreground/60`,children:` · `}):null,(0,I.jsxs)(`span`,{className:n+1===e.part?`font-medium text-foreground`:void 0,children:[n+1,`. `,t]})]},`${n}-${t}`))})]})}function rX({planId:e}){let t=zD(`plans.get`,{planId:e},[`plans`]),n=t.data;return n?(0,I.jsxs)(I.Fragment,{children:[n.issue?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`from issue #`,n.issue.number,` — `,n.issue.title,n.issue.url?(0,I.jsxs)(`span`,{className:`break-all`,children:[` `,n.issue.url]}):null]}):null,n.split?(0,I.jsx)(nX,{split:n.split}):null,(0,I.jsx)(YR,{title:`Agreed plan`,children:(0,I.jsx)(KR,{text:n.brief})})]}):t.error?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the agreed plan. `,t.error]}):null}function iX({row:e,onGone:t}){let n=async n=>{await V(`plans.start`,{planId:e.id,where:n})&&t()},r=async()=>{await V(`plans.discard`,{planId:e.id})&&t()};return(0,I.jsxs)(`article`,{className:`flex flex-col gap-4`,"aria-label":e.title,children:[(0,I.jsxs)(lO,{children:[(0,I.jsx)(Y,{label:`Start here`,icon:bh,tone:`primary`,shortcut:`S`,onClick:()=>void n(`here`)}),(0,I.jsx)(Y,{label:`Start in a new session`,text:`New session`,icon:Hh,shortcut:`N`,onClick:()=>void n(`session`)}),(0,I.jsx)(BO,{icon:eg,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,I.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,I.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-medium`,children:[(0,I.jsx)(XH,{check:`open`,className:`mt-1.5`}),(0,I.jsx)(`span`,{className:`min-w-0 break-words`,children:e.title})]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`pending`,e.age?` · saved ${QY(e.age)}`:``]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:e.id})]}),(0,I.jsx)(rX,{planId:e.id})]})}function aX(e){if(e.kind===`archived`)return{state:`archived`,rest:QY(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`} ${QY(e.age)}`:``;return{state:ZY(e.status,e.paused),rest:[t?``:n,r].filter(Boolean).join(` · `)}}function oX(e){return e?[qH(e.track),e.domains.join(`, `)].filter(Boolean).join(` · `):``}function sX({row:e,task:t}){return e.progress?(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(YH,{done:e.progress.done,total:e.progress.total}),(0,I.jsxs)(`span`,{children:[e.progress.done,` of `,e.progress.total,` steps`]}),t?.currentStep?(0,I.jsxs)(`span`,{className:`text-foreground`,children:[t.currentStep,` `,(0,I.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium`,children:`now`}),(0,I.jsx)(`span`,{className:`sr-only`,children:`(current step)`})]}):null]}):null}function cX({row:e,task:t}){let n=t?.git?`branch ${t.git.branch}${t.git.from?` · from ${t.git.from}`:``}`:``,{state:r,rest:i}=aX(e);return(0,I.jsxs)(`header`,{className:`flex flex-col gap-2`,children:[(0,I.jsxs)(`h2`,{className:`flex items-start gap-2.5 text-lg font-semibold tracking-tight`,children:[(0,I.jsx)(XH,{check:e.check,className:`mt-1.5`}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[YY[e.check],`:`]}),(0,I.jsx)(`span`,{className:e.check===`dropped`?`min-w-0 break-words line-through`:`min-w-0 break-words`,children:e.title})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1 text-sm text-muted-foreground`,children:[(0,I.jsx)(`span`,{className:`rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-foreground`,children:r}),i?(0,I.jsx)(`span`,{children:i}):null]}),(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground break-all`,children:[e.id,oX(t),n].filter(Boolean).join(` · `)}),(0,I.jsx)(sX,{row:e,task:t})]})}function lX({row:e,onGone:t,onChanged:n}){let r=e.id;return{restore:async()=>{await V(`tasks.restore`,{taskId:r},{undo:()=>void V(`tasks.archive`,{taskId:r})})&&t()},archive:async()=>{await V(`tasks.archive`,{taskId:r},{undo:()=>void V(`tasks.restore`,{taskId:r})})&&t()},remove:async()=>{await V(`tasks.delete`,{taskId:r,where:e.kind===`archived`?`archive`:`list`})&&t()},toggleAuto:()=>void V(`tasks.auto`,{taskId:r,on:!e.auto}).then(n)}}function uX({row:e,archive:t}){return e.check===`open`?(0,I.jsx)(BO,{label:`Archive`,icon:fp,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,I.jsx)(Y,{label:`Archive`,icon:fp,shortcut:`E`,onClick:()=>void t()})}function dX({on:e,toggle:t}){return sO(`a`,t),(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.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`,children:[(0,I.jsx)(wh,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}),(0,I.jsx)(`span`,{children:`Auto`}),(0,I.jsx)(wG,{checked:e,onCheckedChange:t,"aria-label":`Auto mode`,"aria-keyshortcuts":`A`}),(0,I.jsx)(iD,{chord:`A`,className:`kbd-hint`})]})}),(0,I.jsx)(UD,{children:`Auto mode: the oracle decides without asking`})]})}function fX(e){let{row:t}=e,{restore:n,archive:r,remove:i,toggleAuto:a}=lX(e),o=t.kind===`archived`;return(0,I.jsxs)(lO,{children:[t.kind===`task`&&t.check===`open`?(0,I.jsx)(qY,{row:t}):null,t.kind===`task`?(0,I.jsx)(pX,{taskId:t.id}):null,o?(0,I.jsx)(Y,{label:`Restore`,icon:Eh,shortcut:`R`,onClick:()=>void n()}):null,t.check===`open`&&!o?(0,I.jsx)(dX,{on:!!t.auto,toggle:a}):null,o?null:(0,I.jsx)(uX,{row:t,archive:r}),(0,I.jsx)(BO,{icon:eg,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 pX({taskId:e}){let t=(0,m.useRef)(!0);(0,m.useEffect)(()=>(t.current=!0,()=>{t.current=!1}),[]);async function n(){let n=Hf();try{let r=await qf(`tasks.open`,{taskId:e});if(!t.current||Hf()!==n)return;r.notice&&B.info(r.notice);let i=await qf(`status.get`,{});if(!t.current||Hf()!==n)return;let a=r.key??(r.sessionId===i.sessionId?`here`:r.sessionId);a?CD(`#/sessions/${encodeURIComponent(a)}`):r.notice||B.info(`This task has no active session. No replacement session was created.`)}catch(e){t.current&&Hf()===n&&B.error(e instanceof Error?e.message:String(e))}}return(0,I.jsx)(Y,{label:`Open task conversation`,text:`Conversation`,icon:Km,shortcut:`O`,onClick:()=>void n()})}function mX(e){let{row:t}=e,n=t.kind===`plan`,r=zD(`tasks.get`,{taskId:t.id},[`tasks`],!n),i=LD(`lobby`).data?.task,a=i?.id===t.id?i:void 0;if(n)return(0,I.jsx)(iX,{row:t,onGone:e.onGone});let o=t.check===`open`&&t.kind===`task`;return(0,I.jsxs)(`article`,{className:`flex flex-col gap-5`,"aria-label":t.title,children:[(0,I.jsx)(fX,{...e}),(0,I.jsx)(cX,{row:t,task:a}),(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,I.jsx)(yY,{timing:r.data?.timing??t.timing,stopped:t.check!==`open`})}),r.data?.delivery?(0,I.jsx)(NY,{taskId:t.id,title:t.title,delivery:r.data.delivery,onChanged:r.reload},t.id):null,r.data?(0,I.jsx)(GY,{detail:r.data,finished:!o}):null,(0,I.jsx)(RY,{taskId:t.id,finished:!o,canComment:o}),r.data?(0,I.jsx)(KY,{detail:r.data}):null,r.error&&!r.data?(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Could not load the plan detail. `,r.error]}):null]})}function hX({row:e}){return e.check===`open`&&e.progress?(0,I.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5 text-xs text-muted-foreground tabular-nums`,children:[(0,I.jsx)(YH,{done:e.progress.done,total:e.progress.total}),(0,I.jsxs)(`span`,{children:[e.progress.done,`/`,e.progress.total]})]}):e.age&&e.check!==`open`?(0,I.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:e.age}):null}function gX(e){return e.check===`dropped`?`text-muted-foreground line-through`:e.kind===`archived`||e.check===`done`?`text-muted-foreground`:`text-foreground`}function _X({row:e,selected:t,onSelect:n}){return(0,I.jsx)(`li`,{children:(0,I.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:Pz,children:[(0,I.jsxs)(`span`,{className:`flex items-start gap-2 text-sm`,children:[(0,I.jsx)(XH,{check:e.check,className:`mt-0.5`}),(0,I.jsxs)(`span`,{className:`sr-only`,children:[YY[e.check],`:`]}),(0,I.jsx)(`span`,{className:q(`min-w-0 flex-1 break-words`,gX(e),t&&`font-medium text-foreground`),children:e.title}),(0,I.jsx)(hX,{row:e})]}),e.check===`open`?(0,I.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:$Y(e)}):null,e.kind===`plan`?null:(0,I.jsx)(`span`,{className:`pl-6 text-xs text-muted-foreground`,children:(0,I.jsx)(yY,{timing:e.timing,stopped:e.check!==`open`})}),e.delivery?(0,I.jsxs)(`span`,{className:`pl-6 text-xs text-foreground`,children:[`Delivery: `,e.delivery.status.replaceAll(`_`,` `),` · open task to review`]}):null]})})}function vX({rows:e,selectedId:t,onSelect:n}){return(0,I.jsx)(`div`,{className:`flex flex-col pb-2`,children:eX(e).map(({section:e,rows:r})=>(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h3`,{className:Iz,children:(0,I.jsx)(JR,{title:JY[e],right:String(r.length),className:`[&>span:first-child]:font-medium [&>span:first-child]:text-muted-foreground`})}),(0,I.jsx)(`ul`,{className:Fz,children:r.map(e=>(0,I.jsx)(_X,{row:e,selected:e.id===t,onSelect:n},`${e.kind}-${e.id}`))})]},e))})}var yX=()=>CD(SD(`tasks`)),bX=e=>CD(SD(`tasks`,e));function xX(){return(0,I.jsxs)(TD,{className:`m-4 flex-1`,children:[(0,I.jsxs)(ED,{children:[(0,I.jsx)(OD,{variant:`icon`,children:(0,I.jsx)(Pm,{"aria-hidden":`true`})}),(0,I.jsx)(AD,{children:XY})]}),(0,I.jsx)(J,{onClick:()=>CD(SD(`plan`)),children:`Plan a task`})]})}function SX({shown:e,count:t,onToggle:n}){return(0,I.jsxs)(`label`,{className:`btn-raised flex h-7 cursor-pointer items-center gap-2 rounded-lg border bg-card px-2 text-xs font-medium transition-[box-shadow]`,children:[(0,I.jsx)(KB,{checked:e,onCheckedChange:n,"aria-label":`Show archived tasks`,className:`size-4`}),`Archived`,(0,I.jsx)(Nz,{variant:`secondary`,className:`h-5 px-1.5`,children:t})]})}function CX({id:e}){let t=vO(),[n,r]=(0,m.useState)(!1),i=zD(`tasks.list`,{},[`tasks`,`plans`]),a=zD(`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)(()=>(jJ(u),()=>jJ(void 0)),[u]),!i.data&&i.error)return(0,I.jsx)(ND,{message:`Could not load tasks. ${i.error}`,onRetry:i.reload});if(i.data&&o.length===0&&s.length===0)return(0,I.jsx)(xX,{});let d=[...c,...s].find(e=>e.id===l),f=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(SO,{title:`Tasks`,count:tX(c),children:(0,I.jsx)(SX,{shown:n,count:s.length,onToggle:()=>r(e=>!e)})}),i.data?c.length===0?(0,I.jsx)(`p`,{className:`p-4 text-sm text-muted-foreground`,children:XY}):(0,I.jsx)(vX,{rows:c,selectedId:l,onSelect:bX}):(0,I.jsx)(CO,{})]}),p=d?(0,I.jsx)(mX,{row:d,onGone:yX,onChanged:i.reload},d.id):e?(0,I.jsx)(wX,{}):null;return(0,I.jsx)(xO,{wide:t,list:f,detail:p,open:!!e,onClose:yX,hint:`Select a task to see its detail.`,describe:`Task detail`})}function wX(){return(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`That task is not on the list any more.`})}var TX={l:`lobby`,p:`plan`,t:`tasks`,i:`issues`,u:`git`,s:`sessions`,n:`knowledge`,q:`quickfix`,m:`metrics`,e:`settings`,x:`excalidraw`};function EX(e){let t=e[0];if(t)try{return decodeURIComponent(t)}catch{return t}}function DX(e){if(e.kind===`settings`)return(0,I.jsx)(gq,{});if(e.kind===`sessions`)return(0,I.jsx)(hY,{id:EX(e.key?[e.key]:[])});switch(e.tab){case`lobby`:return(0,I.jsx)(ZU,{});case`tasks`:return(0,I.jsx)(CX,{id:EX(e.rest)});case`plan`:return(0,I.jsx)(sJ,{});case`quickfix`:return(0,I.jsx)(EJ,{id:EX(e.rest)});case`issues`:return(0,I.jsx)(gB,{rest:e.rest});case`metrics`:return(0,I.jsx)(HW,{});case`git`:return(0,I.jsx)(Wz,{rest:e.rest});case`knowledge`:return(0,I.jsx)(GB,{agent:e.rest[0],file:e.rest[1]});case`excalidraw`:return(0,I.jsx)(QV,{id:EX(e.rest)})}}var OX=[{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`}],kX=[{id:`digits`,caps:[`1`,`…`,`9`],help:`jump to a tab in current order`},{id:`help`,caps:[`?`],help:`keyboard shortcuts`},...Object.entries(TX).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`}],AX=[{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`]]}],jX=[{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`}],MX=[{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 NX({line:e}){return(0,I.jsxs)(`div`,{className:`flex items-center gap-3 py-1`,children:[(0,I.jsx)(`span`,{className:`flex w-28 shrink-0 items-center`,children:e.caps?(0,I.jsx)(`span`,{className:`inline-flex items-center gap-1`,children:e.caps.map(e=>(0,I.jsx)(QE,{children:e},e))}):(0,I.jsx)(iD,{chord:e.label??``})}),(0,I.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:e.help})]})}function PX(){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:`Buttons on a page`}),AX.map(e=>(0,I.jsxs)(`div`,{className:`flex items-start gap-3 py-1`,children:[(0,I.jsx)(`span`,{className:`w-28 shrink-0 pt-0.5 text-sm font-medium`,children:e.page}),(0,I.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,I.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[(0,I.jsx)(iD,{chord:e}),t]},e))})]},e.id))]})}function FX({title:e,lines:t}){return(0,I.jsxs)(`section`,{className:`flex flex-col gap-1`,children:[(0,I.jsx)(`h3`,{className:`mb-1 text-xs font-medium tracking-wide text-muted-foreground uppercase`,children:e}),t.map(e=>(0,I.jsx)(NX,{line:e},e.id))]})}function IX(e){return e.map(e=>({id:e.action,label:e.label,help:e.help}))}function LX(e){return e.map(e=>({id:`tab.${e.id}`,label:e.key,help:`jump to the ${e.label} tab`}))}function RX({open:e,onOpenChange:t,keys:n,tabs:r}){let i=mD(e,pD.help);return(0,m.useEffect)(()=>{if(!e||!i)return;let r=e=>{let r=n.find(e=>e.action===`help`)?.key;(e.key===`Escape`||r&&aU(e,r))&&(e.preventDefault(),t(!1))};return window.addEventListener(`keydown`,r,!0),()=>window.removeEventListener(`keydown`,r,!0)},[e,i,t,n]),(0,I.jsxs)(oD,{open:e&&i,onOpenChange:t,label:`Keys`,className:`max-w-4xl`,children:[(0,I.jsxs)(`header`,{className:`flex items-center justify-between gap-3 border-b border-border px-6 py-4`,children:[(0,I.jsx)(`h2`,{"aria-hidden":`true`,className:`text-base font-semibold tracking-tight`,children:`Keyboard shortcuts`}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(iD,{chord:`Esc`}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Close`,onClick:()=>t(!1),children:(0,I.jsx)(gg,{"aria-hidden":`true`})})]})]}),(0,I.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,I.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,I.jsx)(FX,{title:`Everywhere`,lines:IX(n)}),(0,I.jsx)(FX,{title:`Jump to a tab`,lines:LX(r)}),(0,I.jsx)(FX,{title:`Navigation and editing`,lines:kX}),(0,I.jsx)(FX,{title:`Message box`,lines:OX})]}),(0,I.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[(0,I.jsx)(FX,{title:`Lists and panes`,lines:jX}),(0,I.jsx)(PX,{}),(0,I.jsx)(FX,{title:`Questions`,lines:MX})]})]})]})}function zX(e){return e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}async function BX(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(Uf(`/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 Gf(`the lobby answered ${n.status}`,`failed`,n.status);if(!r.ok)throw new Gf(r.error,r.code,n.status);return r.result}function VX(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 HX(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 UX=/^(\s*)(?:([-*+])|(\d+)([.)]))\s+(\[[ xX]\]\s+)?/;function WX(e,t){let n=e.lastIndexOf(`
|
|
104
104
|
`,t-1)+1,r=e.indexOf(`
|
|
105
|
-
`,t),i=e.slice(n,r<0?e.length:r),a=lX.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}}var dX={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function fX(e){if(e)try{return decodeURIComponent(e)}catch{return e}}function pX(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,dX]:[e,dX]}if(e.kind!==`tab`)return[dX];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},dX];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},dX];let r=e.tab===`tasks`?fX(e.rest[0])??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},dX]:[dX]}var mX=0,hX=`btn-ghost relative inline-flex size-8 items-center justify-center rounded-lg border border-transparent before:absolute before:-inset-1 before:content-[''] 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 aria-pressed:text-foreground`;function gX(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function _X({file:e,onRemove:t}){let n=(0,I.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors outline-none hover:bg-accent 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,I.jsx)(ig,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,I.jsxs)(z.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} · ${aX(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,I.jsx)(`img`,{src:Uf(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,I.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,I.jsx)(yD,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,I.jsxs)(z.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,I.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,I.jsx)(mm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,I.jsx)(yD,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,I.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,I.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,I.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:aX(e.size)})]}),n]})}function vX({route:e,keys:t,onHelp:n}){let[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(),g=TD(`status`),_=TD(`lobby`),v=iD(),y=(g.data?.busy??!1)||!!_.data?.reply?.trim(),{taskId:b,session:x}=eJ(),S=(0,m.useMemo)(()=>pX(e,b,x),[e,b,x]),C=S.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),w=S.find(e=>e.id===p)??S[0];(0,m.useEffect)(()=>h(void 0),[C]);let T=(0,m.useRef)(null),E=(0,m.useRef)(null),ee=(0,m.useRef)(null),D=(0,m.useRef)(a);D.current=a;let te=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=te.current,t=E.current;e&&t&&(te.current=void 0,t.setSelectionRange(e.start,e.end))},[r]);let ne=(0,m.useCallback)(e=>{te.current={start:e.start,end:e.end},i(e.value)},[]);(0,m.useEffect)(()=>{let e=T.current;if(!e)return;let t=document.documentElement,n=()=>t.style.setProperty(`--composer-h`,v?`0px`:`${Math.ceil(e.getBoundingClientRect().height)}px`);n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect(),t.style.setProperty(`--composer-h`,`0px`)}},[v]);let re=(0,m.useCallback)(e=>{let t=[...e],n=8-D.current.length;t.length>n&&B.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++mX}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;o(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),oX(e).then(e=>o(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{B.error(e instanceof Error?e.message:`That file did not upload.`),o(e=>e.filter(e=>e.key!==t))})}},[]),ie=(0,m.useCallback)(e=>{o(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),O=a.some(e=>e.state===`uploading`),ae=a.flatMap(e=>e.info?[e.info.id]:[]),oe=(r.trim().length>0||ae.length>0)&&!O&&!l,k=(0,m.useCallback)(async()=>{if(!oe)return;u(!0);let e=ae.length>0?ae:void 0,t={text:r,...e?{attachments:e}:{}};try{let n=!0;if(w.id===`oracle`){let e=await qf(`lobby.send`,t);e.notice&&B(e.notice)}else if(w.id===`panel`)n=await V(`planner.send`,t)!==void 0;else if(w.id===`quickfix`)n=await V(`quickfix.submit`,t)!==void 0;else if(w.id===`task`)n=await V(`tasks.message`,{taskId:w.taskId,...t})!==void 0;else if(w.id===`session`)n=await V(`sessions.message`,{...w.session.address,...t})!==void 0;else if(w.id===`newsession`){let t=await V(`sessions.start`,{request:r,...e?{attachments:e}:{}});n=t!==void 0,t?.key&&dD(`#/sessions/${encodeURIComponent(t.key)}`)}else n=await V(`tasks.comment`,{taskId:w.taskId,...t})!==void 0;if(n){i(``);for(let e of D.current)e.image&&URL.revokeObjectURL(e.image);o([])}}catch(e){B.error(e instanceof Error?e.message:`Could not send`)}finally{u(!1)}},[oe,ae,w,r]),se=(0,m.useCallback)(async()=>{try{await qf(`lobby.abort`,{})}catch(e){B.error(e instanceof Error?e.message:`Could not stop`)}},[]);return(0,I.jsx)(`div`,{ref:T,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-sm:px-2 max-sm:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,v&&`opacity-0`),inert:v,children:(0,I.jsx)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-3xl`,children:(0,I.jsxs)(`div`,{className:q(`group/composer relative rounded-2xl border border-dock-border bg-dock shadow-dock backdrop-blur-xl backdrop-saturate-150 transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-ring/45 focus-within:shadow-dock-focus`,d&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),f(!0))},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length>0&&re(e.dataTransfer.files)},children:[(0,I.jsx)(nu,{initial:!1,children:a.length>0?(0,I.jsx)(z.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:`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,children:a.map(e=>(0,I.jsx)(_X,{file:e,onRemove:()=>ie(e.key)},e.key))},`files`):null}),s?(0,I.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,children:r.trim()?(0,I.jsx)(PR,{text:r}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,I.jsx)(`div`,{className:`flex px-4 pt-3 pb-1`,children:(0,I.jsx)(`textarea`,{ref:E,id:`composer-text`,"aria-label":w.label,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),UD();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`?cX(a,r,i):sX(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),c(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=uX(t.value,t.selectionStart);n&&(e.preventDefault(),ne(n));return}if(e.key===`Backspace`&&t.value===``&&D.current.length>0){e.preventDefault(),ie(D.current.at(-1).key);return}(gX(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),k())},onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),re(t))},placeholder:y&&w.id===`oracle`?`The oracle is working. Enter steers it…`:w.placeholder,rows:1,className:`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`})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-2 pt-1 pb-2`,children:[(0,I.jsx)(`input`,{ref:ee,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{re(e.target.files??[]),e.target.value=``}}),(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>ee.current?.click(),className:hX,children:(0,I.jsx)(eh,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsx)(jD,{children:`Attach images, PDFs or files`})]}),(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":s,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>c(e=>!e),className:hX,children:(0,I.jsx)(cm,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsxs)(jD,{children:[`Preview `,(0,I.jsx)(KE,{chord:`Alt+P`})]})]}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-4 w-px bg-border`}),S.length>1?(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`,children:S.map(e=>(0,I.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===w.id,onClick:()=>h(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===w.id?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):(0,I.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,w.pill.toLowerCase()]}),(0,I.jsx)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end overflow-hidden px-2`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-3.5`,children:[e.kind===`tab`&&e.tab===`plan`?(0,I.jsx)(qE,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[34rem]:inline-flex`,children:`save plan`}):null,(0,I.jsx)(qE,{chord:`/`,className:`hidden group-focus-within/composer:!hidden @[28rem]:inline-flex`,children:`write`}),(0,I.jsx)(qE,{chord:`Esc`,className:`hidden group-[:not(:focus-within)]/composer:!hidden @[28rem]:inline-flex`,children:`tabs`}),(0,I.jsx)(qE,{chord:`Shift+Enter`,className:`hidden @[22rem]:inline-flex`,children:`new line`}),(0,I.jsx)(qE,{chord:`Enter`,className:`hidden @[11rem]:inline-flex`,children:`send`}),(0,I.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 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg 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,I.jsx)(KE,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,I.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})}),y&&w.id===`oracle`?(0,I.jsx)(OO,{label:`Stop`,icon:Rh,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void se()}):null,(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void k(),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:l?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,I.jsx)(bp,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,I.jsxs)(jD,{children:[`Send `,(0,I.jsx)(KE,{chord:`Enter`})]})]})]}),d?(0,I.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 yX(){try{return{id:Hf()}}catch(e){return{error:e.message}}}function bX(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. Start a project in Pi, then refresh.`}}function xX(){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 qf(`projects.list`,{});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 SX({data:e,error:t}){let n=yX();return n.error??t??bX(e,n.id)}function CX({projects:e}){let t=SX(e);return t?(0,I.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,I.jsx)(Wh,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:t})]}):null}function wX(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 TX({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=yX(),d=SX(e),f=u.error?`invalid`:u.id??i?.currentId??``,p=!!i?.projects.length;YD(`p`,()=>l(!0),{enabled:p}),YD(`r`,()=>void s(),{enabled:c,inDialog:!0});function h(e){l(!1),e!==f&&Wf(e,t)}return(0,I.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1.5`,children:[(0,I.jsxs)(MT,{open:c&&p,onOpenChange:l,children:[(0,I.jsxs)(NT,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c&&p,"aria-keyshortcuts":`P ArrowDown`,disabled:!p,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`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-2.5 shrink-0 rounded-full`,d?`bg-destructive`:`bg-primary`)}),(0,I.jsx)(`span`,{className:`truncate`,children:n}),(0,I.jsx)(Pp,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground`,!p&&`opacity-40`)})]}),(0,I.jsx)(PT,{children:(0,I.jsxs)(FT,{align:`start`,sideOffset:6,"aria-label":`Projects`,onKeyDown:wX,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`glass-pop z-50 flex 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`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,I.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`,children:[a?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,I.jsx)(gh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,I.jsx)(KE,{chord:`R`,className:`kbd-hint`})]})]}),(0,I.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto p-1`,children:i?.projects.map(e=>{let t=e.id===f;return(0,I.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>h(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`,t&&`bg-accent`),children:[(0,I.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,I.jsx)(Op,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,I.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})})]})})]}),r?(0,I.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,I.jsx)(gm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,I.jsx)(`span`,{className:`truncate`,children:r})]}):null,o||d?(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.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`,children:a?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-4`}):(0,I.jsx)(gh,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsx)(jD,{side:`bottom`,children:`Refresh projects`})]}):null]})}function EX({state:e}){return e===`live`?(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,I.jsx)(jD,{children:`Connected`})]}):e===`connecting`?(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,I.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}var DX=`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[background-color,color,box-shadow,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 aria-[current=page]:text-foreground`;function OX({label:e,hint:t,href:n,active:r,children:i}){return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`a`,{href:n,"aria-label":e,"aria-current":r?`page`:void 0,"aria-keyshortcuts":t,"aria-describedby":`focused-action-help`,className:DX,children:i})}),(0,I.jsxs)(jD,{side:`bottom`,children:[e,` `,(0,I.jsx)(KE,{chord:t})]})]})}function kX({hint:e,onHelp:t}){return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:DX,children:(0,I.jsx)(wm,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsxs)(jD,{side:`bottom`,children:[`Keyboard shortcuts `,(0,I.jsx)(KE,{chord:e})]})]})}function AX(){let e=bW(),t=e?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":t,"aria-pressed":e,"aria-describedby":`focused-action-help`,className:DX,onClick:()=>vW(!e),children:e?(0,I.jsx)(eg,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,I.jsx)(Qh,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsx)(jD,{side:`bottom`,children:t})]})}function jX(){let{theme:e,setTheme:t}=EG(),n=e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.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:DX,children:n?(0,I.jsx)(Bh,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,I.jsx)(Jm,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsxs)(jD,{side:`bottom`,children:[n?`Light mode`:`Dark mode`,` `,(0,I.jsx)(KE,{chord:`D`})]})]})}function MX({busy:e,task:t,sessionName:n}){return(0,I.jsxs)(`div`,{className:`mr-1 flex min-w-0 items-center gap-2 text-[0.8125rem]`,children:[e?(0,I.jsx)(yD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):null,t?(0,I.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate md:inline`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:t.id}),(0,I.jsxs)(`span`,{className:`hidden text-muted-foreground min-[1500px]:inline`,children:[` · `,t.state.replace(/_/g,` `)]})]}):(0,I.jsx)(`span`,{className:`hidden max-w-[10rem] truncate text-muted-foreground min-[1500px]:inline`,children:n??`no task in this session`})]})}function NX({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=xX();return(0,I.jsxs)(`header`,{className:`app-header shrink-0`,children:[(0,I.jsx)(`div`,{className:`where flex min-w-0 items-center`,children:(0,I.jsx)(TX,{projects:d,tab:r.kind===`tab`?r.tab:r.kind,name:c,branch:l})}),(0,I.jsx)(`div`,{className:`tabs min-w-0`,children:i}),(0,I.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-0.5`,children:[a,(0,I.jsx)(MX,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,I.jsx)(EX,{state:n}),(0,I.jsx)(OX,{label:`Sessions`,hint:o.sessions??`Alt+O`,href:`#/sessions`,active:r.kind===`sessions`,children:(0,I.jsx)(Em,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,I.jsx)(OX,{label:`Settings`,hint:o.settings??`Alt+S`,href:`#/settings`,active:r.kind===`settings`,children:(0,I.jsx)(Ah,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,I.jsx)(kX,{hint:o.help??`Alt+H`,onHelp:s}),(0,I.jsx)(jX,{}),(0,I.jsx)(AX,{}),(0,I.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,I.jsx)(CX,{projects:d})]})}function PX(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 FX(){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 Yf()?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(PX(e))}return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,I.jsxs)(`form`,{onSubmit:s,className:`glass flex w-full max-w-md flex-col gap-4 rounded-xl p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Sm,{className:`size-5`,"aria-hidden":`true`}),(0,I.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,I.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,I.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,I.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 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`})]}),n?(0,I.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,I.jsx)(J,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var IX={lobby:Bm,tasks:Om,plan:Sh,quickfix:og,issues:Wp,metrics:Ep,git:vm,knowledge:Sp,excalidraw:ih};function LX(e){return/(\d)$/.exec(e)?.[1]}var RX=(0,m.forwardRef)(function({tab:e,active:t},n){let r=LX(e.key),i=IX[e.id];return(0,I.jsxs)(kD,{children:[(0,I.jsx)(AD,{asChild:!0,children:(0,I.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,className:q(`relative z-10 inline-flex h-10 shrink-0 items-center gap-1.5 rounded-lg px-3 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`:`text-muted-foreground hover:text-foreground`),children:[i?(0,I.jsx)(z.span,{"aria-hidden":`true`,className:`inline-flex`,initial:t?{scale:.7,y:2}:!1,animate:{scale:1,y:0},transition:{type:`spring`,visualDuration:.32,bounce:.55,delay:.12},children:(0,I.jsx)(i,{className:q(`size-4 shrink-0 transition-colors duration-200`,t&&`text-primary`)})},t?`on`:`off`):null,r?(0,I.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,I.jsx)(`span`,{children:e.label})]})}),(0,I.jsxs)(jD,{children:[e.label,` `,(0,I.jsx)(KE,{chord:e.key})]})]})});function zX(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}`}}var BX={type:`spring`,visualDuration:.12,bounce:0},VX={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},HX={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},UX={type:`spring`,visualDuration:.22,bounce:.4},WX={type:`spring`,visualDuration:.28,bounce:.6};function GX(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)({}),o=(0,m.useRef)([]),s=(0,m.useRef)(void 0),c=(0,m.useRef)([]),l=(0,m.useRef)(1),u=(0,m.useCallback)(e=>{let t=e?a.current[e]:void 0;return t?{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight}:void 0},[]),d=(0,m.useCallback)(()=>{for(let e of c.current)e.stop();c.current=[]},[]),f=(0,m.useCallback)(e=>{d(),s.current=e,l.current=1,zX(r.current,u(e)),zX(i.current,void 0);for(let e of o.current)e&&(e.style.width=`0px`)},[u,d]),p=(0,m.useCallback)((e,t)=>{let n=u(e),a=u(t);if(!n||!a)return f(t);d(),s.current=t;let p=a.left>n.left?1:-1,m=p>0?n.right:n.left,h=p>0?a.left:a.right,g=Math.abs(h-m),_=o.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),v=_.filter(Boolean).sort((e,t)=>Math.abs(h-(e.from+e.to)/2)-Math.abs(h-(t.from+t.to)/2))[0],y=v&&g>0?Math.min(.97,Math.abs((v.from+v.to)/2-m)/g):.7,b={drained:1-Math.min(1,l.current),head:0,tail:0,filled:0,squash:1};l.current=0;let x=()=>{let e=(n.right-n.left)*Math.min(1,b.drained);zX(i.current,n,p>0?n.left+e:n.left,p>0?n.right:n.right-e);let t=m+p*g*b.head,o=m+p*g*b.tail,s=Math.min(t,o),c=Math.max(t,o);for(let e of _){if(!e?.liquid)continue;let t=Math.max(s,e.from),n=Math.min(c,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 l=(a.right-a.left)*Math.max(0,b.filled);zX(r.current,a,p>0?a.left:a.right-l,p>0?a.left+l:a.right,b.squash)},S=(e,t,n,r)=>{let i=vf(t,1,{...n,onUpdate:t=>{b[e]=t,r?.(t),x()}});return c.current.push(i),i},C=!1,w=()=>{if(C)return;C=!0;let e=S(`filled`,0,UX,e=>{l.current=e});S(`squash`,.8,WX),Promise.all([e,...c.current]).then(()=>{s.current===t&&c.current.includes(e)&&f(t)})};S(`drained`,b.drained,BX),S(`head`,0,VX,e=>{e>=y&&w()}),S(`tail`,0,HX),x()},[u,f,d]);(0,m.useLayoutEffect)(()=>{let t=s.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?f(e):p(t,e)},[e,t,p,f]);let h=(0,m.useRef)(e);return h.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}f(h.current)});return r.observe(e),()=>{r.disconnect(),d()}},[f,d]),{track:n,fill:r,drain:i,cells:a,liquids:o}}function KX(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 qX({tabs:e,activeId:t,onSelect:n}){let{track:r,fill:i,drain:a,cells:o,liquids:s}=GX(t,e.length),c=(0,m.useRef)(null),[l,u]=(0,m.useState)({left:!1,right:!1}),d=(0,m.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;u(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=c.current;if(!e||typeof ResizeObserver>`u`)return;d();let t=new ResizeObserver(d);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[d,e.length]),(0,m.useEffect)(()=>{let e=c.current,n=t?o.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,o]);function f(r){if(r.key===`ArrowDown`&&!r.altKey){HD()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=e[(Math.max(0,e.findIndex(e=>e.id===t))+i+e.length)%e.length];WD.active=!0,window.setTimeout(()=>{WD.active=!1},3e3),n(a.id),o.current[a.id]?.focus({preventScroll:!0})}return(0,I.jsx)(`div`,{ref:c,onScroll:d,style:{maskImage:KX(l),WebkitMaskImage:KX(l)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,I.jsxs)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:f,className:`relative mx-auto flex w-max items-center gap-1 py-0.5`,children:[(0,I.jsx)(`span`,{ref:a,"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,I.jsx)(`span`,{ref:i,"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`}),e.map((e,n)=>(0,I.jsxs)(m.Fragment,{children:[n>0?(0,I.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-3 shrink-0 sm:w-4`,children:[(0,I.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,I.jsx)(`span`,{ref:e=>{s.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,I.jsx)(RX,{ref:t=>{o.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function JX(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var YX=`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'`,XX=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(` `)),ZX=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function QX(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 $X(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 eZ(e){if(!XX.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`,$X(t.value)):ZX.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=$X(e.textContent??``));for(let t of[...e.children])eZ(t)}function tZ(e,t){try{return nZ(e,t??JX())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${YX}"><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 nZ(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])eZ(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${YX}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${$X(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function rZ({preview:e,label:t}){let n=(0,m.useMemo)(()=>tZ(e),[e]);return(0,I.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:n,className:`h-80 w-full rounded-lg border bg-background`})}var iZ=/\s*\(recommended\)\s*$/i,aZ=`Type something.`;function oZ(e){return{text:e.replace(iZ,``),recommended:iZ.test(e)}}function sZ({label:e}){let{text:t,recommended:n}=oZ(e);return(0,I.jsxs)(`span`,{className:`leading-snug`,children:[t,n?(0,I.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function cZ({multi:e,on:t}){return(0,I.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,I.jsx)(Op,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function lZ({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.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]`,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,I.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,I.jsx)(cZ,{multi:n,on:i}),(0,I.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,I.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,I.jsx)(sZ,{label:e.label})]})})]}),e.description?(0,I.jsx)(PR,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function uZ({option:e}){return!e||!e.preview&&!e.image&&!e.htmlPreview?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border bg-muted/30 p-3`,children:[(0,I.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[`Preview · `,oZ(e.label).text]}),e.image?(0,I.jsx)(`img`,{src:Uf(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,I.jsx)(rZ,{preview:e.htmlPreview,label:oZ(e.label).text}):null,e.preview?(0,I.jsx)(PR,{text:e.preview,className:`text-xs`}):null]})}function dZ({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,children:`Cancel`}),(0,I.jsx)(J,{type:e,disabled:n||r,children:r?`Sending…`:t})]})}function fZ(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 pZ({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,I.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,I.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 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[a+1,` `,e.header,o?(0,I.jsx)(Op,{className:`size-3`,"aria-hidden":`true`}):null]},a)})})}function mZ({questions:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)({}),[c,l]=(0,m.useState)({}),[u,d]=(0,m.useState)({}),f=(0,m.useRef)(null),p=e[i],h=o[i]??[],g=c[i]??``,_=p?.options[u[i]??h[0]??0],v=fZ(e,o,c,i),y=p?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=f.current;e&&(e.querySelector(`[data-option="${o[i]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[i]),!p)return null;function b(e){let t=y?h.includes(e)?h.filter(t=>t!==e):[...h,e]:[e];s({...o,[i]:t}),y||l({...c,[i]:``}),d({...u,[i]:e})}function x(t,r){if(fZ(e,t,r,i)){if(i<e.length-1){a(i+1);return}n({answers:e.map((n,i)=>fZ(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function S(e){e.preventDefault(),t||x(o,c)}function C(t){t>=0&&t<e.length&&a(t)}function w(e){let n=e.target,r=f.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||x(o,c);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||x(o,c)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),ND(r,n,-1));return}let a=FD(e.key);if(a){e.preventDefault(),ND(r,n,a);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),ND(r,n,e.key===`Home`?`first`:`last`);return}let u=ID(e.key);if(u&&!(n instanceof HTMLButtonElement)){e.preventDefault(),C(i+u);return}let d=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&d>=0){if(e.preventDefault(),y)h.length>0&&h.includes(d)?x(o,c):b(d);else{let e={...o,[i]:[d]},t={...c,[i]:``};s(e),l(t),x(e,t)}return}if(e.key===` `&&d>=0){e.preventDefault(),b(d);return}let m=Number(e.key);Number.isInteger(m)&&m>=1&&m<=p.options.length&&(e.preventDefault(),b(m-1),r.querySelector(`[data-option="${m-1}"]`)?.focus())}return(0,I.jsxs)(`form`,{ref:f,className:`flex flex-col gap-3`,onSubmit:S,onKeyDown:w,children:[(0,I.jsx)(pZ,{questions:e,picks:o,own:c,index:i,onGo:a}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${i+1} of ${e.length}`:`Question`}),(0,I.jsx)(PR,{text:p.question,className:`mt-1 text-base`})]}),(0,I.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,_?.preview||_?.image||_?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[p.options.map((e,t)=>(0,I.jsx)(lZ,{option:e,index:t,multi:y,name:`question-${i}`,selected:h.includes(t),onToggle:()=>b(t),onFocusOption:()=>d({...u,[i]:t})},t)),(0,I.jsxs)(`label`,{className:`flex min-h-9 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`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:aZ}),(0,I.jsx)(fO,{"data-nav":``,value:g,onChange:e=>{l({...c,[i]:e.target.value}),e.target.value&&s({...o,[i]:[]})},placeholder:aZ,"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`})]})]}),(0,I.jsx)(uZ,{option:_})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:y?`Pick several`:`Pick one`}),(0,I.jsx)(qE,{chord:`↑↓`,children:`move`}),(0,I.jsx)(qE,{chord:y?`Space`:`Enter`,children:y?`pick`:`choose`}),y?(0,I.jsx)(qE,{chord:`Enter`,children:`next`}):null,e.length>1?(0,I.jsx)(qE,{chord:`←→`,children:`question`}):null,(0,I.jsx)(qE,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(dZ,{primary:`submit`,primaryLabel:i<e.length-1?`Next`:`Answer`,disabled:!v,submitting:t,onCancel:r})]})}function hZ(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||PD(i))return;let a=FD(e.key);if(a){e.preventDefault(),ND(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 gZ({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,I.jsxs)(`form`,{ref:o,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>hZ(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,I.jsx)(PR,{text:e.title,className:`text-base`}),(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,I.jsx)(lZ,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(qE,{chord:`↑↓`,children:`move`}),(0,I.jsx)(qE,{chord:`Enter`,children:`choose`}),(0,I.jsx)(qE,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(dZ,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function _Z({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,I.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex flex-col gap-3 outline-none`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(PR,{text:e.question,className:`text-base`}),e.detail?(0,I.jsx)(PR,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,I.jsx)(qE,{chord:`Y`,children:`yes`}),(0,I.jsx)(qE,{chord:`N`,children:`no`}),(0,I.jsx)(qE,{chord:`Esc`,children:`later`})]}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),children:`No`}),(0,I.jsx)(J,{type:`button`,disabled:t,onClick:()=>n(!0),children:t?`Sending…`:`Yes`})]})]})]})}function vZ({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,I.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,I.jsx)(PR,{text:e.question,className:`text-base`}),(0,I.jsx)(fO,{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??aZ,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,I.jsx)(qE,{chord:`Enter`,children:`answer`}),(0,I.jsx)(qE,{chord:`Shift+Enter`,children:`new line`}),(0,I.jsx)(qE,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(dZ,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function yZ({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,I.jsxs)(`form`,{ref:l,className:`flex flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&hZ(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,I.jsx)(PR,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,I.jsx)(lZ,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,I.jsx)(fO,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??aZ,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm`}):null,(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),children:`Cancel`}),e.method===`confirm`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),children:`No`}),(0,I.jsx)(J,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),children:t?`Sending…`:`Yes`})]}):(0,I.jsx)(J,{type:`submit`,disabled:!c||t,children:t?`Sending…`:`Answer`})]})]})}function bZ(e){let{view:t}=e;return t.kind===`questionnaire`?(0,I.jsx)(mZ,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel}):t.kind===`choose`?(0,I.jsx)(gZ,{...e,view:t}):t.kind===`confirm`?(0,I.jsx)(_Z,{...e,view:t}):t.kind===`text`?(0,I.jsx)(vZ,{...e,view:t}):(0,I.jsx)(yZ,{...e,dialog:t.dialog})}function xZ(e){return typeof e==`object`&&e?e:{}}function SZ(e){return typeof e==`string`?e.trim():``}function CZ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function wZ(e){let t=xZ(e),n=SZ(t.label);if(!n)return;let r=SZ(t.description),i=SZ(t.preview),a=SZ(t.image),o=QX(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function TZ(e){let t=xZ(e),n=SZ(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(wZ).filter(e=>!!e);return{question:n,header:SZ(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function EZ(e){let t=xZ(e),n=SZ(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=SZ(t.message),i=CZ(t.options),a=SZ(t.placeholder),o=SZ(t.prefill);return{id:SZ(t.id),method:n,title:SZ(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function DZ(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(TZ).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function OZ(e){return{kind:`choose`,title:SZ(e.title)||`Choose an option`,options:CZ(e.options)}}function kZ(e){let t=SZ(e.question)||SZ(e.title)||`Continue?`,n=SZ(e.detail)||SZ(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function AZ(e){let t=SZ(e.question)||SZ(e.title)||`Type an answer`,n=SZ(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function jZ(e){let t=xZ(e.payload);if(e.kind===`questionnaire`)return DZ(t);if(e.kind===`choose`)return OZ(t);if(e.kind===`confirm`)return kZ(t);if(e.kind===`text`)return AZ(t);let n=EZ(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}function MZ({submitting:e,onKeep:t,onLeave:n}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,onClick:t,children:`Keep answering`}),(0,I.jsx)(J,{type:`button`,disabled:e,onClick:n,children:e?`Leaving…`:`Leave`})]})]})}function NZ({count:e,onOpen:t}){return(0,I.jsxs)(J,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning`,children:[(0,I.jsx)(Kp,{"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,I.jsx)(`span`,{className:`hidden sm:inline`,children:`waiting`})]})}function PZ({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),l=e.length,u=e[0],d=u?jZ(u):void 0,f=l>0&&!r,p=nD(f,tD.question);(0,m.useEffect)(()=>{l===0&&(o(!1),i(!1))},[l,i]);async function h(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Gf&&e.code===`question_withdrawn`?B(oD):B.error(e instanceof Error?e.message:t)}finally{c(!1)}}let g=u?.from?`${u.from} asks`:`A question`;return(0,I.jsx)(JE,{open:f&&p&&!!u,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(a?o(!1):i(!0))},className:`max-w-3xl`,children:u?(0,I.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`header`,{className:`flex items-center gap-3 px-6 pt-5 pb-3`,children:[(0,I.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[g,l>1?` · 1 of ${l}`:``]}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:`Later · Esc`,onClick:()=>i(!0),children:(0,I.jsx)(ig,{"aria-hidden":`true`})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 pb-6`,children:d?a?(0,I.jsx)(MZ,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void h(n(u.id),`Could not leave the question`)}):(0,I.jsx)(bZ,{view:d,submitting:s,onAnswer:e=>void h(t(u.id,e),`Could not send the answer`),onCancel:()=>o(!0)},u.id):(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,I.jsx)(J,{type:`button`,disabled:s,onClick:()=>void h(n(u.id),`Could not dismiss the question`),children:`Dismiss`})]})})]}):null})}var FZ=2;function IZ(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function LZ(e){try{return JSON.parse(e)}catch{return}}function RZ(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 zZ(e,t=IZ){let n=t(Uf(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===FZ?`offline`:`connecting`),n.onmessage=t=>{let n=LZ(t.data);n&&RZ(n,e)},()=>n.close()}function BZ(){let e=(0,m.useRef)(void 0),t=(0,m.useCallback)(()=>{e.current?.();try{Hf()}catch{kf.onStatus({connection:`offline`});return}e.current=zZ({onHello:e=>kf.onHello(e),onChanged:(e,t)=>kf.onChanged(e,t),onFeed:e=>kf.onFeedDelta(e),onReply:e=>kf.onReplyDelta(e),onNotice:(e,t)=>B[t](e),onConnection:e=>kf.onStatus({connection:e})})},[]);return(0,m.useEffect)(()=>(t(),()=>e.current?.()),[t]),t}function VZ(){let e=TD(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await qf(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await qf(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function HZ(e,t,n,r){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?dD(`#/settings`):e===`sessions`?dD(`#/sessions`):e===`activity`||e===`thinking`?t.kind===`tab`&&t.tab===`lobby`?JV(`lobby.${e}`):dD(uD(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&V(`planner.save`,{})}function UZ({connection:e,onRetry:t}){return e===`offline`?(0,I.jsx)(SD,{onRetry:t}):null}function WZ(e){return e.kind===`tab`?e.tab:e.kind}function GZ(){let e=fD(),t=TD(`status`),n=TD(`lobby`),{prompts:r,answer:i,dismiss:a}=VZ(),{connection:o,signedOut:s}=wD(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=BZ();HW();let h=t.data,g=h?.tabs??[],_=h?.keys??[],v=e.kind===`tab`?e.tab:void 0,y=(0,m.useCallback)(e=>dD(uD(e)),[]),b=(0,m.useCallback)(e=>{if(g.length===0)return;let t=Math.max(0,g.findIndex(e=>e.id===v)),n=g[(t+e+g.length)%g.length];n&&dD(uD(n.id))},[g,v]),x=(0,m.useCallback)(()=>l(e=>!e),[]),S=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&HZ(t,lD(window.location.hash)??e,x,b)},[e,x,b,h?.panels]),C=(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},[]);KH({enabled:!!h,keys:_,tabs:g,insideApp:C,onAction:S,onTab:y});let w=(0,m.useCallback)(()=>kf.onHello({}),[]),T=e.kind===`tab`?e.tab:e.kind,E=!!h;(0,m.useEffect)(()=>{if(!E)return;if(WD.active){WD.active=!1;return}let e=requestAnimationFrame(()=>{document.activeElement?.id===`composer-text`||document.querySelector(`[role='dialog']`)||document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(e)},[T,E]);let ee=Object.fromEntries(_.map(e=>[e.action,e.label])),D=(0,I.jsx)(NX,{status:h,task:n.data?.task,connection:o,route:e,keys:ee,onHelp:x,tabs:(0,I.jsx)(qX,{tabs:g,activeId:v,onSelect:y}),extra:u&&r.length>0?(0,I.jsx)(NZ,{count:r.length,onOpen:()=>d(!1)}):null});return s||!h?(0,I.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[D,(0,I.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-sm:mx-0 max-sm:mb-0`,children:s?(0,I.jsx)(FX,{}):t.error?(0,I.jsx)(xD,{message:t.error,onRetry:w}):(0,I.jsx)(bD,{})})]}):(0,I.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[D,(0,I.jsx)(UZ,{connection:o,onRetry:p}),(0,I.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||PD(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||UD()&&e.preventDefault()},role:v?`tabpanel`:void 0,"aria-labelledby":v?`tab-${v}`:void 0,className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-sm:mx-0 max-sm:mb-0`,children:(0,I.jsx)(z.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:qY(e)},WZ(e))}),(0,I.jsx)(vX,{route:e,keys:ee,onHelp:x}),(0,I.jsx)(PZ,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,I.jsx)(iX,{open:c,onOpenChange:l,keys:_,tabs:g})]})}async function KZ(e){switch(e){case`status`:return qf(`status.get`,{});case`lobby`:return qf(`lobby.snapshot`,{});case`prompts`:return qf(`prompts.list`,{});default:return}}var qZ=[`status`,`lobby`,`prompts`];function JZ(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Yf(),e&&(kf.markUsed(qZ,KZ),t(!0))})(),()=>{e=!1}},[]),e}function YZ(){return JZ()?(0,I.jsx)(GZ,{}):(0,I.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,I.jsx)(bD,{})})}var XZ={info:bm,success:Bp,warning:Wh,error:Xp},ZZ={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function QZ(){let{item:e,waiting:t}=zf(),n=iD(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>Lf(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,I.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,I.jsx)(nu,{mode:`wait`,children:r?(0,I.jsxs)(z.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,I.jsx)($Z,{kind:e.kind}),(0,I.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,I.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(),Lf(e.id)},children:e.action.label}):null]},e.id):null})})}function $Z({kind:e}){let t=XZ[e];return(0,I.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,ZZ[e])})}(0,wf.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(m.StrictMode,{children:(0,I.jsx)(TG,{children:(0,I.jsx)(lu,{reducedMotion:`user`,children:(0,I.jsxs)(OD,{children:[(0,I.jsx)(YZ,{}),(0,I.jsx)(QZ,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});
|
|
105
|
+
`,t),i=e.slice(n,r<0?e.length:r),a=UX.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}}var GX={id:`oracle`,pill:`Oracle`,label:`Message the oracle`,placeholder:`Message the oracle…`};function KX(e){if(e)try{return decodeURIComponent(e)}catch{return e}}function qX(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,GX]:[e,GX]}if(e.kind!==`tab`)return[GX];if(e.tab===`plan`)return[{id:`panel`,pill:`Panel`,label:`Message the panel`,placeholder:`Describe a task, or answer the panel…`},GX];if(e.tab===`quickfix`)return[{id:`quickfix`,pill:`Quick fix`,label:`Describe a quick fix`,placeholder:`Describe a small change…`},GX];let r=e.tab===`tasks`?KX(e.rest[0])??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},GX]:[GX]}var JX=0,YX=`btn-ghost relative inline-flex size-8 items-center justify-center rounded-lg border border-transparent before:absolute before:-inset-1 before:content-[''] 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 aria-pressed:text-foreground`;function XX(e){return e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing}function ZX({file:e,onRemove:t}){let n=(0,I.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.name}`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,onClick:t,className:q(`flex shrink-0 items-center justify-center rounded-lg text-muted-foreground transition-colors outline-none hover:bg-accent 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,I.jsx)(gg,{"aria-hidden":`true`,className:`size-3.5`})});return e.image?(0,I.jsxs)(z.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} · ${zX(e.size)}`,className:`relative size-16 shrink-0 overflow-hidden rounded-lg border border-border bg-muted`,children:[(0,I.jsx)(`img`,{src:Uf(e.image),alt:e.name,className:`size-full object-cover`}),e.state===`uploading`?(0,I.jsx)(`span`,{className:`absolute inset-0 flex items-center justify-center bg-background/60`,children:(0,I.jsx)(jD,{className:`size-4`,"aria-hidden":`true`,role:`presentation`})}):null,n]}):(0,I.jsxs)(z.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,I.jsxs)(`span`,{className:`relative flex shrink-0 items-center justify-center text-muted-foreground`,children:[(0,I.jsx)(bm,{"aria-hidden":`true`,className:`size-4`}),e.state===`uploading`?(0,I.jsx)(jD,{className:`absolute -right-1 -bottom-1 size-2.5`,"aria-hidden":`true`,role:`presentation`}):null]}),(0,I.jsxs)(`span`,{className:`min-w-0 max-w-40`,children:[(0,I.jsx)(`span`,{className:`block truncate text-xs font-medium`,children:e.name}),(0,I.jsx)(`span`,{className:`block text-[0.65rem] leading-tight text-muted-foreground`,children:e.state===`uploading`?`uploading…`:zX(e.size)})]}),n]})}function QX({route:e,keys:t,onHelp:n}){let[r,i]=(0,m.useState)(``),[a,o]=(0,m.useState)([]),[s,c]=(0,m.useState)(!1),[l,u]=(0,m.useState)(!1),[d,f]=(0,m.useState)(!1),[p,h]=(0,m.useState)(),g=LD(`status`),_=LD(`lobby`),v=gD(),y=(g.data?.busy??!1)||!!_.data?.reply?.trim(),{taskId:b,session:x}=PJ(),S=(0,m.useMemo)(()=>qX(e,b,x),[e,b,x]),C=S.map(e=>`${e.id}:${e.taskId??e.session?.name??``}`).join(`|`),w=S.find(e=>e.id===p)??S[0];(0,m.useEffect)(()=>h(void 0),[C]);let T=(0,m.useRef)(null),E=(0,m.useRef)(null),ee=(0,m.useRef)(null),D=(0,m.useRef)(a);D.current=a;let te=(0,m.useRef)(void 0);(0,m.useLayoutEffect)(()=>{let e=te.current,t=E.current;e&&t&&(te.current=void 0,t.setSelectionRange(e.start,e.end))},[r]);let ne=(0,m.useCallback)(e=>{te.current={start:e.start,end:e.end},i(e.value)},[]);(0,m.useEffect)(()=>{let e=T.current;if(!e)return;let t=document.documentElement,n=()=>t.style.setProperty(`--composer-h`,v?`0px`:`${Math.ceil(e.getBoundingClientRect().height)}px`);n();let r=new ResizeObserver(n);return r.observe(e),()=>{r.disconnect(),t.style.setProperty(`--composer-h`,`0px`)}},[v]);let re=(0,m.useCallback)(e=>{let t=[...e],n=8-D.current.length;t.length>n&&B.warning(`At most 8 files go with one message.`);for(let e of t.slice(0,Math.max(0,n))){let t=`f${++JX}`,n=e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0;o(r=>[...r,{key:t,name:e.name||(n?`image.png`:`file`),size:e.size,...n?{image:n}:{},state:`uploading`}]),BX(e).then(e=>o(n=>n.map(n=>n.key===t?{...n,state:`ready`,info:e}:n))).catch(e=>{B.error(e instanceof Error?e.message:`That file did not upload.`),o(e=>e.filter(e=>e.key!==t))})}},[]),ie=(0,m.useCallback)(e=>{o(t=>{let n=t.find(t=>t.key===e);return n?.image&&URL.revokeObjectURL(n.image),t.filter(t=>t.key!==e)})},[]),O=a.some(e=>e.state===`uploading`),ae=a.flatMap(e=>e.info?[e.info.id]:[]),oe=(r.trim().length>0||ae.length>0)&&!O&&!l,k=(0,m.useCallback)(async()=>{if(!oe)return;u(!0);let e=ae.length>0?ae:void 0,t={text:r,...e?{attachments:e}:{}};try{let n=!0;if(w.id===`oracle`){let e=await qf(`lobby.send`,t);e.notice&&B(e.notice)}else if(w.id===`panel`)n=await V(`planner.send`,t)!==void 0;else if(w.id===`quickfix`)n=await V(`quickfix.submit`,t)!==void 0;else if(w.id===`task`)n=await V(`tasks.message`,{taskId:w.taskId,...t})!==void 0;else if(w.id===`session`)n=await V(`sessions.message`,{...w.session.address,...t})!==void 0;else if(w.id===`newsession`){let t=await V(`sessions.start`,{request:r,...e?{attachments:e}:{}});n=t!==void 0,t?.key&&CD(`#/sessions/${encodeURIComponent(t.key)}`)}else n=await V(`tasks.comment`,{taskId:w.taskId,...t})!==void 0;if(n){i(``);for(let e of D.current)e.image&&URL.revokeObjectURL(e.image);o([])}}catch(e){B.error(e instanceof Error?e.message:`Could not send`)}finally{u(!1)}},[oe,ae,w,r]),se=(0,m.useCallback)(async()=>{try{await qf(`lobby.abort`,{})}catch(e){B.error(e instanceof Error?e.message:`Could not stop`)}},[]);return(0,I.jsx)(`div`,{ref:T,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-sm:px-2 max-sm:pb-[max(0.5rem,env(safe-area-inset-bottom))]`,v&&`opacity-0`),inert:v,children:(0,I.jsx)(`div`,{className:`pointer-events-auto mx-auto w-full max-w-3xl`,children:(0,I.jsxs)(`div`,{className:q(`group/composer relative rounded-2xl border border-dock-border bg-dock shadow-dock backdrop-blur-xl backdrop-saturate-150 transition-[border-color,box-shadow] duration-300 ease-snap focus-within:border-ring/45 focus-within:shadow-dock-focus`,d&&`border-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--ring)_30%,transparent)]`),onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),f(!0))},onDragLeave:()=>f(!1),onDrop:e=>{e.preventDefault(),f(!1),e.dataTransfer.files.length>0&&re(e.dataTransfer.files)},children:[(0,I.jsx)(nu,{initial:!1,children:a.length>0?(0,I.jsx)(z.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:`flex flex-wrap items-end gap-2 overflow-hidden px-3 pt-3`,children:a.map(e=>(0,I.jsx)(ZX,{file:e,onRemove:()=>ie(e.key)},e.key))},`files`):null}),s?(0,I.jsx)(`div`,{"aria-label":`Markdown preview`,role:`region`,className:`max-h-48 overflow-y-auto border-b border-border px-4 py-3`,children:r.trim()?(0,I.jsx)(KR,{text:r}):(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Nothing to preview yet.`})}):null,(0,I.jsx)(`div`,{className:`flex px-4 pt-3 pb-1`,children:(0,I.jsx)(`textarea`,{ref:E,id:`composer-text`,"aria-label":w.label,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>{if(e.key===`Escape`&&!e.nativeEvent.isComposing){e.preventDefault(),tO();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`?HX(a,r,i):VX(a,r,i,n===`b`?`**`:n===`i`?`_`:"`"));return}if(e.altKey&&!e.ctrlKey&&!e.metaKey&&n===`p`){e.preventDefault(),c(e=>!e);return}if(e.key===`Enter`&&e.shiftKey&&!e.nativeEvent.isComposing&&t.selectionStart===t.selectionEnd){let n=WX(t.value,t.selectionStart);n&&(e.preventDefault(),ne(n));return}if(e.key===`Backspace`&&t.value===``&&D.current.length>0){e.preventDefault(),ie(D.current.at(-1).key);return}(XX(e)||e.key===`Enter`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),k())},onPaste:e=>{let t=[...e.clipboardData.files];t.length!==0&&(e.preventDefault(),re(t))},placeholder:y&&w.id===`oracle`?`The oracle is working. Enter steers it…`:w.placeholder,rows:1,className:`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`})}),(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1 px-2 pt-1 pb-2`,children:[(0,I.jsx)(`input`,{ref:ee,type:`file`,multiple:!0,hidden:!0,tabIndex:-1,"aria-label":`Attach files`,onChange:e=>{re(e.target.files??[]),e.target.value=``}}),(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"aria-label":`Attach images, PDFs or files`,"data-compact":!0,onClick:()=>ee.current?.click(),className:YX,children:(0,I.jsx)(ch,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsx)(UD,{children:`Attach images, PDFs or files`})]}),(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Preview the Markdown`,"aria-pressed":s,"aria-keyshortcuts":`Alt+P`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>c(e=>!e),className:YX,children:(0,I.jsx)(mm,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsxs)(UD,{children:[`Preview `,(0,I.jsx)(iD,{chord:`Alt+P`})]})]}),(0,I.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-4 w-px bg-border`}),S.length>1?(0,I.jsx)(`div`,{role:`radiogroup`,"aria-label":`Send to`,className:`flex items-center gap-0.5 rounded-lg bg-muted p-0.5 shadow-[inset_0_1px_2px_rgb(0_0_0/0.07)]`,children:S.map(e=>(0,I.jsx)(`button`,{"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,type:`button`,role:`radio`,"data-compact":!0,"aria-checked":e.id===w.id,onClick:()=>h(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===w.id?`btn-raised bg-card text-foreground`:`text-muted-foreground hover:text-foreground`),children:e.pill},e.id))}):(0,I.jsxs)(`span`,{className:`px-1 text-xs text-muted-foreground`,children:[`To the `,w.pill.toLowerCase()]}),(0,I.jsx)(`div`,{className:`@container ml-auto flex min-w-0 flex-1 items-center justify-end overflow-hidden px-2`,children:(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-3.5`,children:[e.kind===`tab`&&e.tab===`plan`?(0,I.jsx)(aD,{chord:t.savePlan??`Ctrl+S`,className:`hidden @[34rem]:inline-flex`,children:`save plan`}):null,(0,I.jsx)(aD,{chord:`/`,className:`hidden group-focus-within/composer:!hidden @[28rem]:inline-flex`,children:`write`}),(0,I.jsx)(aD,{chord:`Esc`,className:`hidden group-[:not(:focus-within)]/composer:!hidden @[28rem]:inline-flex`,children:`tabs`}),(0,I.jsx)(aD,{chord:`Shift+Enter`,className:`hidden @[22rem]:inline-flex`,children:`new line`}),(0,I.jsx)(aD,{chord:`Enter`,className:`hidden @[11rem]:inline-flex`,children:`send`}),(0,I.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 inline-flex h-7 shrink-0 items-center gap-1.5 rounded-lg 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,I.jsx)(iD,{chord:t.help??`Alt+H`,className:`kbd-hint`}),(0,I.jsx)(`span`,{className:`hidden @[8rem]:inline`,children:`shortcuts`})]})]})}),y&&w.id===`oracle`?(0,I.jsx)(BO,{label:`Stop`,icon:Kh,iconOnly:!0,compact:!0,title:`Stop the oracle?`,description:`The current response stops. Work already recorded is kept.`,confirmLabel:`Stop`,variant:`destructive`,onConfirm:()=>void se()}):null,(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Send`,"aria-keyshortcuts":`Enter Space`,"aria-describedby":`focused-action-help`,"data-compact":!0,onClick:()=>void k(),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:l?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5 text-primary-foreground`}):(0,I.jsx)(bp,{"aria-hidden":`true`,className:`size-4`,strokeWidth:2.25})})}),(0,I.jsxs)(UD,{children:[`Send `,(0,I.jsx)(iD,{chord:`Enter`})]})]})]}),d?(0,I.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 $X(){try{return{id:Hf()}}catch(e){return{error:e.message}}}function eZ(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. Start a project in Pi, then refresh.`}}function tZ(){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 qf(`projects.list`,{});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 nZ({data:e,error:t}){let n=$X();return n.error??t??eZ(e,n.id)}function rZ({projects:e}){let t=nZ(e);return t?(0,I.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,I.jsx)(ng,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,I.jsx)(`span`,{children:t})]}):null}function iZ(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 aZ({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=$X(),d=nZ(e),f=u.error?`invalid`:u.id??i?.currentId??``,p=!!i?.projects.length;sO(`p`,()=>l(!0),{enabled:p}),sO(`r`,()=>void s(),{enabled:c,inDialog:!0});function h(e){l(!1),e!==f&&Wf(e,t)}return(0,I.jsxs)(`div`,{"aria-busy":a,className:`flex min-w-0 items-center gap-1.5`,children:[(0,I.jsxs)(WT,{open:c&&p,onOpenChange:l,children:[(0,I.jsxs)(GT,{type:`button`,role:`combobox`,"aria-label":`Project`,"aria-description":`${n}${r?`, branch ${r}`:``}`,"aria-haspopup":`listbox`,"aria-expanded":c&&p,"aria-keyshortcuts":`P ArrowDown`,disabled:!p,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`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,className:q(`size-2.5 shrink-0 rounded-full`,d?`bg-destructive`:`bg-primary`)}),(0,I.jsx)(`span`,{className:`truncate`,children:n}),(0,I.jsx)(Ip,{"aria-hidden":`true`,className:q(`size-3.5 shrink-0 text-muted-foreground`,!p&&`opacity-40`)})]}),(0,I.jsx)(KT,{children:(0,I.jsxs)(qT,{align:`start`,sideOffset:6,"aria-label":`Projects`,onKeyDown:iZ,onOpenAutoFocus:e=>{let t=e.currentTarget?.querySelector(`[role='option'][aria-selected='true']`)??e.currentTarget?.querySelector(`[role='option']`);t&&(e.preventDefault(),t.focus())},className:`glass-pop z-50 flex 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`,children:[(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Running projects`}),(0,I.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`,children:[a?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}):(0,I.jsx)(wh,{"aria-hidden":`true`,className:`size-3`}),`Refresh`,(0,I.jsx)(iD,{chord:`R`,className:`kbd-hint`})]})]}),(0,I.jsx)(`div`,{role:`listbox`,"aria-label":`Projects`,className:`flex max-h-72 flex-col overflow-y-auto p-1`,children:i?.projects.map(e=>{let t=e.id===f;return(0,I.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":t,onClick:()=>h(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`,t&&`bg-accent`),children:[(0,I.jsx)(`span`,{className:`flex h-5 w-4 shrink-0 items-center justify-center`,children:t?(0,I.jsx)(Ap,{"aria-hidden":`true`,className:`size-3.5 text-primary`}):null}),(0,I.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,I.jsx)(`span`,{className:`block truncate text-sm font-medium`,children:e.name}),(0,I.jsxs)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:[e.cwd,` · :`,e.port]})]})]},e.id)})})]})})]}),r?(0,I.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,I.jsx)(Sm,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,I.jsx)(`span`,{className:`truncate`,children:r})]}):null,o||d?(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.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`,children:a?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-4`}):(0,I.jsx)(wh,{"aria-hidden":`true`,className:`size-4`})})}),(0,I.jsx)(UD,{side:`bottom`,children:`Refresh projects`})]}):null]})}function oZ({state:e}){return e===`live`?(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`span`,{role:`img`,"aria-label":`Connected`,className:`grid size-6 place-items-center`,children:(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-success`})})}),(0,I.jsx)(UD,{children:`Connected`})]}):e===`connecting`?(0,I.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3`}),`reconnecting…`]}):(0,I.jsx)(`span`,{className:`text-xs font-medium text-destructive`,children:`Connection lost`})}var sZ=`btn-ghost inline-flex size-8 shrink-0 items-center justify-center rounded-lg border border-transparent text-muted-foreground transition-[background-color,color,box-shadow,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 aria-[current=page]:text-foreground`;function cZ({label:e,hint:t,href:n,active:r,children:i}){return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`a`,{href:n,"aria-label":e,"aria-current":r?`page`:void 0,"aria-keyshortcuts":t,"aria-describedby":`focused-action-help`,className:sZ,children:i})}),(0,I.jsxs)(UD,{side:`bottom`,children:[e,` `,(0,I.jsx)(iD,{chord:t})]})]})}function lZ({hint:e,onHelp:t}){return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":`Keyboard shortcuts`,"aria-haspopup":`dialog`,"aria-keyshortcuts":e,"aria-describedby":`focused-action-help`,onClick:t,className:sZ,children:(0,I.jsx)(Am,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsxs)(UD,{side:`bottom`,children:[`Keyboard shortcuts `,(0,I.jsx)(iD,{chord:e})]})]})}function uZ(){let e=eG(),t=e?`Unmute prompt sounds`:`Mute prompt sounds`;return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsx)(`button`,{type:`button`,"aria-label":t,"aria-pressed":e,"aria-describedby":`focused-action-help`,className:sZ,onClick:()=>QW(!e),children:e?(0,I.jsx)(fg,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,I.jsx)(ug,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsx)(UD,{side:`bottom`,children:t})]})}function dZ(){let{theme:e,setTheme:t}=oK(),n=e===`dark`||e===`system`&&typeof window<`u`&&window.matchMedia(`(prefers-color-scheme: dark)`).matches;return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.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:sZ,children:n?(0,I.jsx)(Jh,{"aria-hidden":`true`,className:`size-[1.05rem]`}):(0,I.jsx)(nh,{"aria-hidden":`true`,className:`size-[1.05rem]`})})}),(0,I.jsxs)(UD,{side:`bottom`,children:[n?`Light mode`:`Dark mode`,` `,(0,I.jsx)(iD,{chord:`D`})]})]})}function fZ({busy:e,task:t,sessionName:n}){return(0,I.jsxs)(`div`,{className:`mr-1 flex min-w-0 items-center gap-2 text-[0.8125rem]`,children:[e?(0,I.jsx)(jD,{"aria-hidden":`true`,role:`presentation`,className:`size-3.5`}):null,t?(0,I.jsxs)(`span`,{className:`hidden max-w-[16rem] truncate md:inline`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:t.id}),(0,I.jsxs)(`span`,{className:`hidden text-muted-foreground min-[1500px]:inline`,children:[` · `,t.state.replace(/_/g,` `)]})]}):(0,I.jsx)(`span`,{className:`hidden max-w-[10rem] truncate text-muted-foreground min-[1500px]:inline`,children:n??`no task in this session`})]})}function pZ(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 mZ=24;function hZ(){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=pZ(t.querySelector(`.where`))+(r?.offsetWidth??0)+pZ(t.querySelector(`.tools`))+a*2;n(s+mZ<=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 gZ({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=tZ(),{header:f,one:p}=hZ();return(0,I.jsxs)(`header`,{ref:f,className:`app-header shrink-0`,"data-one-row":p||void 0,children:[(0,I.jsx)(`div`,{className:`where flex min-w-0 items-center`,children:(0,I.jsx)(aZ,{projects:d,tab:r.kind===`tab`?r.tab:r.kind,name:c,branch:l})}),(0,I.jsx)(`div`,{className:`tabs min-w-0`,children:i}),(0,I.jsxs)(`div`,{className:`tools flex min-w-0 items-center justify-end gap-0.5`,children:[a,(0,I.jsx)(fZ,{busy:u,...t?{task:t}:{},...e?.sessionName?{sessionName:e.sessionName}:{}}),(0,I.jsx)(oZ,{state:n}),(0,I.jsx)(cZ,{label:`Sessions`,hint:o.sessions??`Alt+O`,href:`#/sessions`,active:r.kind===`sessions`,children:(0,I.jsx)(Mm,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,I.jsx)(cZ,{label:`Settings`,hint:o.settings??`Alt+S`,href:`#/settings`,active:r.kind===`settings`,children:(0,I.jsx)(Rh,{"aria-hidden":`true`,className:`size-[1.05rem]`})}),(0,I.jsx)(lZ,{hint:o.help??`Alt+H`,onHelp:s}),(0,I.jsx)(dZ,{}),(0,I.jsx)(uZ,{}),(0,I.jsx)(`span`,{id:`focused-action-help`,className:`sr-only`,children:`Focused buttons: Enter or Space. Links: Enter. Checkboxes: Space.`})]}),(0,I.jsx)(rZ,{projects:d})]})}function _Z(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 vZ(){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 Yf()?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(_Z(e))}return(0,I.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center p-6`,children:(0,I.jsxs)(`form`,{onSubmit:s,className:`glass flex w-full max-w-md flex-col gap-4 rounded-xl p-6`,children:[(0,I.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(Om,{className:`size-5`,"aria-hidden":`true`}),(0,I.jsx)(`h1`,{className:`text-base font-medium`,children:`Sign in to bot-lobby`})]}),(0,I.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Pi printed a link when it started (or run `,(0,I.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,I.jsxs)(`label`,{className:`flex flex-col gap-1.5 text-sm`,children:[(0,I.jsx)(`span`,{className:`font-medium`,children:`Lobby link or token`}),(0,I.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 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`})]}),n?(0,I.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:n}):null,(0,I.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`ghost`,disabled:i,onClick:()=>void o(void 0),children:`Retry`}),(0,I.jsx)(J,{type:`submit`,disabled:i||!e.trim(),children:`Sign in`})]})]})})}var yZ={lobby:Km,tasks:Pm,plan:Ah,quickfix:vg,issues:Kp,metrics:Op,git:wm,knowledge:Sp,excalidraw:fh};function bZ(e){return/(\d)$/.exec(e)?.[1]}var xZ=(0,m.forwardRef)(function({tab:e,active:t},n){let r=bZ(e.key),i=yZ[e.id];return(0,I.jsxs)(VD,{children:[(0,I.jsx)(HD,{asChild:!0,children:(0,I.jsxs)(`a`,{ref:n,role:`tab`,id:`tab-${e.id}`,href:`#/${e.id}`,"aria-selected":t,"aria-keyshortcuts":e.key,tabIndex:t?0:-1,className:q(`relative z-10 inline-flex h-7.5 shrink-0 items-center gap-1.5 rounded-lg 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`:`text-muted-foreground hover:text-foreground`),children:[i?(0,I.jsx)(z.span,{"aria-hidden":`true`,className:`inline-flex`,initial:t?{scale:.7,y:2}:!1,animate:{scale:1,y:0},transition:{type:`spring`,visualDuration:.32,bounce:.55,delay:.12},children:(0,I.jsx)(i,{className:q(`size-3.5 shrink-0 transition-colors duration-200`,t&&`text-primary`)})},t?`on`:`off`):null,r?(0,I.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,I.jsx)(`span`,{children:e.label})]})}),(0,I.jsxs)(UD,{children:[e.label,` `,(0,I.jsx)(iD,{chord:e.key})]})]})});function SZ(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}`}}var CZ={type:`spring`,visualDuration:.12,bounce:0},wZ={type:`spring`,visualDuration:.17,bounce:.15,delay:.015},TZ={type:`spring`,visualDuration:.17,bounce:.05,delay:.07},EZ={type:`spring`,visualDuration:.22,bounce:.4},DZ={type:`spring`,visualDuration:.28,bounce:.6};function OZ(e,t){let n=(0,m.useRef)(null),r=(0,m.useRef)(null),i=(0,m.useRef)(null),a=(0,m.useRef)({}),o=(0,m.useRef)([]),s=(0,m.useRef)(void 0),c=(0,m.useRef)([]),l=(0,m.useRef)(1),u=(0,m.useCallback)(e=>{let t=e?a.current[e]:void 0;return t?{left:t.offsetLeft,right:t.offsetLeft+t.offsetWidth,top:t.offsetTop,height:t.offsetHeight}:void 0},[]),d=(0,m.useCallback)(()=>{for(let e of c.current)e.stop();c.current=[]},[]),f=(0,m.useCallback)(e=>{d(),s.current=e,l.current=1,SZ(r.current,u(e)),SZ(i.current,void 0);for(let e of o.current)e&&(e.style.width=`0px`)},[u,d]),p=(0,m.useCallback)((e,t)=>{let n=u(e),a=u(t);if(!n||!a)return f(t);d(),s.current=t;let p=a.left>n.left?1:-1,m=p>0?n.right:n.left,h=p>0?a.left:a.right,g=Math.abs(h-m),_=o.current.map(e=>{let t=e?.parentElement;return t?{liquid:e,from:t.offsetLeft,to:t.offsetLeft+t.offsetWidth}:void 0}),v=_.filter(Boolean).sort((e,t)=>Math.abs(h-(e.from+e.to)/2)-Math.abs(h-(t.from+t.to)/2))[0],y=v&&g>0?Math.min(.97,Math.abs((v.from+v.to)/2-m)/g):.7,b={drained:1-Math.min(1,l.current),head:0,tail:0,filled:0,squash:1};l.current=0;let x=()=>{let e=(n.right-n.left)*Math.min(1,b.drained);SZ(i.current,n,p>0?n.left+e:n.left,p>0?n.right:n.right-e);let t=m+p*g*b.head,o=m+p*g*b.tail,s=Math.min(t,o),c=Math.max(t,o);for(let e of _){if(!e?.liquid)continue;let t=Math.max(s,e.from),n=Math.min(c,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 l=(a.right-a.left)*Math.max(0,b.filled);SZ(r.current,a,p>0?a.left:a.right-l,p>0?a.left+l:a.right,b.squash)},S=(e,t,n,r)=>{let i=vf(t,1,{...n,onUpdate:t=>{b[e]=t,r?.(t),x()}});return c.current.push(i),i},C=!1,w=()=>{if(C)return;C=!0;let e=S(`filled`,0,EZ,e=>{l.current=e});S(`squash`,.8,DZ),Promise.all([e,...c.current]).then(()=>{s.current===t&&c.current.includes(e)&&f(t)})};S(`drained`,b.drained,CZ),S(`head`,0,wZ,e=>{e>=y&&w()}),S(`tail`,0,TZ),x()},[u,f,d]);(0,m.useLayoutEffect)(()=>{let t=s.current,n=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches;!t||!e||t===e||n?f(e):p(t,e)},[e,t,p,f]);let h=(0,m.useRef)(e);return h.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}f(h.current)});return r.observe(e),()=>{r.disconnect(),d()}},[f,d]),{track:n,fill:r,drain:i,cells:a,liquids:o}}function kZ(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 AZ({tabs:e,activeId:t,onSelect:n}){let{track:r,fill:i,drain:a,cells:o,liquids:s}=OZ(t,e.length),c=(0,m.useRef)(null),[l,u]=(0,m.useState)({left:!1,right:!1}),d=(0,m.useCallback)(()=>{let e=c.current;if(!e)return;let t=e.scrollLeft>2,n=e.scrollLeft+e.clientWidth<e.scrollWidth-2;u(e=>e.left===t&&e.right===n?e:{left:t,right:n})},[]);(0,m.useEffect)(()=>{let e=c.current;if(!e||typeof ResizeObserver>`u`)return;d();let t=new ResizeObserver(d);return t.observe(e),e.firstElementChild&&t.observe(e.firstElementChild),()=>t.disconnect()},[d,e.length]),(0,m.useEffect)(()=>{let e=c.current,n=t?o.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,o]);function f(r){if(r.key===`ArrowDown`&&!r.altKey){eO()&&r.preventDefault();return}let i=r.key===`ArrowRight`?1:r.key===`ArrowLeft`?-1:0;if(!i||e.length===0)return;r.preventDefault();let a=e[(Math.max(0,e.findIndex(e=>e.id===t))+i+e.length)%e.length];nO.active=!0,window.setTimeout(()=>{nO.active=!1},3e3),n(a.id),o.current[a.id]?.focus({preventScroll:!0})}return(0,I.jsx)(`div`,{ref:c,onScroll:d,style:{maskImage:kZ(l),WebkitMaskImage:kZ(l)},className:`min-w-0 max-w-full overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:(0,I.jsxs)(`div`,{ref:r,role:`tablist`,"aria-label":`Lobby tabs`,onKeyDown:f,className:`relative mx-auto flex w-max items-center gap-0.5 py-0.5`,children:[(0,I.jsx)(`span`,{ref:a,"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,I.jsx)(`span`,{ref:i,"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`}),e.map((e,n)=>(0,I.jsxs)(m.Fragment,{children:[n>0?(0,I.jsxs)(`span`,{"aria-hidden":`true`,"data-tab-link":!0,className:`relative h-[2px] w-2.5 shrink-0 sm:w-3`,children:[(0,I.jsx)(`span`,{className:`absolute inset-0 border-t-2 border-dotted border-input`}),(0,I.jsx)(`span`,{ref:e=>{s.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,I.jsx)(xZ,{ref:t=>{o.current[e.id]=t},tab:e,active:e.id===t})]},e.id))]})})}function jZ(){let e=globalThis.DOMParser;if(!e)throw Error(`DOMParser is unavailable`);return new e}var MZ=`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'`,NZ=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(` `)),PZ=new Set(`class id title role aria-label aria-hidden colspan rowspan scope`.split(` `));function FZ(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 IZ(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 LZ(e){if(!NZ.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`,IZ(t.value)):PZ.has(t.name)||e.removeAttribute(t.name);e.localName===`style`&&(e.textContent=IZ(e.textContent??``));for(let t of[...e.children])LZ(t)}function RZ(e,t){try{return zZ(e,t??jZ())}catch{return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${MZ}"><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 zZ(e,t){let n=t.parseFromString(e.html,`text/html`);for(let e of[...n.head.children,...n.body.children])LZ(e);let r=[...n.head.querySelectorAll(`style`)].map(e=>e.outerHTML).join(``);return`<!doctype html><html><head><meta http-equiv="Content-Security-Policy" content="${MZ}"><meta name="referrer" content="no-referrer"><style>body{margin:16px;overflow-wrap:anywhere}*{box-sizing:border-box}${IZ(e.css??``).replace(/</g,`\\3c `)}</style>${r}</head><body>${n.body.innerHTML}</body></html>`}function BZ({preview:e,label:t}){let n=(0,m.useMemo)(()=>RZ(e),[e]);return(0,I.jsx)(`iframe`,{title:`Static mockup: ${t}`,sandbox:``,referrerPolicy:`no-referrer`,srcDoc:n,className:`h-80 w-full rounded-lg border bg-background`})}var VZ=/\s*\(recommended\)\s*$/i,HZ=`Type something.`;function UZ(e){return{text:e.replace(VZ,``),recommended:VZ.test(e)}}function WZ({label:e}){let{text:t,recommended:n}=UZ(e);return(0,I.jsxs)(`span`,{className:`leading-snug`,children:[t,n?(0,I.jsx)(`span`,{className:`ms-1 font-medium text-primary`,children:`(Recommended)`}):null]})}function GZ({multi:e,on:t}){return(0,I.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,I.jsx)(Ap,{className:q(e?`size-3`:`hidden`)}):null,t&&!e?(0,I.jsx)(`span`,{className:`size-2 rounded-full bg-primary-foreground`}):null]})}function KZ({option:e,index:t,multi:n,name:r,selected:i,onToggle:a,onFocusOption:o}){return(0,I.jsxs)(`div`,{className:`grid gap-1`,children:[(0,I.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]`,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,I.jsx)(`input`,{type:n?`checkbox`:`radio`,name:r,"data-nav":``,"data-option":t,className:`sr-only`,checked:i,onChange:a,onFocus:o}),(0,I.jsx)(GZ,{multi:n,on:i}),(0,I.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:(0,I.jsxs)(`span`,{className:`flex gap-1.5`,children:[(0,I.jsxs)(`span`,{"aria-hidden":`true`,className:`text-muted-foreground tabular-nums`,children:[t+1,`.`]}),(0,I.jsx)(WZ,{label:e.label})]})})]}),e.description?(0,I.jsx)(KR,{text:e.description,className:`px-3 text-muted-foreground`}):null]})}function qZ({option:e}){return!e||!e.preview&&!e.image&&!e.htmlPreview?null:(0,I.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-lg border bg-muted/30 p-3`,children:[(0,I.jsxs)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:[`Preview · `,UZ(e.label).text]}),e.image?(0,I.jsx)(`img`,{src:Uf(e.image),alt:``,loading:`lazy`,className:`max-h-64 w-full rounded-lg border object-contain`}):null,e.htmlPreview?(0,I.jsx)(BZ,{preview:e.htmlPreview,label:UZ(e.label).text}):null,e.preview?(0,I.jsx)(KR,{text:e.preview,className:`text-xs`}):null]})}function JZ({primary:e,primaryLabel:t,disabled:n,submitting:r,onCancel:i}){return(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`ghost`,onClick:i,children:`Cancel`}),(0,I.jsx)(J,{type:e,disabled:n||r,children:r?`Sending…`:t})]})}function YZ(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 XZ({questions:e,picks:t,own:n,index:r,onGo:i}){return e.length===1?(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e[0]?.header}):(0,I.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,I.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 items-center gap-1 rounded-lg border px-3 text-xs font-medium transition-colors`,a===r?`border-primary bg-primary/10 text-primary`:`border-border text-muted-foreground hover:bg-muted`),children:[a+1,` `,e.header,o?(0,I.jsx)(Ap,{className:`size-3`,"aria-hidden":`true`}):null]},a)})})}function ZZ({questions:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(0),[o,s]=(0,m.useState)({}),[c,l]=(0,m.useState)({}),[u,d]=(0,m.useState)({}),f=(0,m.useRef)(null),p=e[i],h=o[i]??[],g=c[i]??``,_=p?.options[u[i]??h[0]??0],v=YZ(e,o,c,i),y=p?.multiSelect===!0;if((0,m.useEffect)(()=>{let e=f.current;e&&(e.querySelector(`[data-option="${o[i]?.[0]??0}"]`)??e.querySelector(`[data-nav]`))?.focus()},[i]),!p)return null;function b(e){let t=y?h.includes(e)?h.filter(t=>t!==e):[...h,e]:[e];s({...o,[i]:t}),y||l({...c,[i]:``}),d({...u,[i]:e})}function x(t,r){if(YZ(e,t,r,i)){if(i<e.length-1){a(i+1);return}n({answers:e.map((n,i)=>YZ(e,t,r,i)).filter(e=>!!e),cancelled:!1})}}function S(e){e.preventDefault(),t||x(o,c)}function C(t){t>=0&&t<e.length&&a(t)}function w(e){let n=e.target,r=f.current;if(!r||e.altKey)return;if(e.key===`Enter`&&(e.ctrlKey||e.metaKey)){e.preventDefault(),t||x(o,c);return}if(n instanceof HTMLTextAreaElement){e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing?(e.preventDefault(),t||x(o,c)):e.key===`ArrowUp`&&n.selectionStart===0&&n.selectionEnd===0&&(e.preventDefault(),GD(r,n,-1));return}let a=qD(e.key);if(a){e.preventDefault(),GD(r,n,a);return}if(e.key===`Home`||e.key===`End`){e.preventDefault(),GD(r,n,e.key===`Home`?`first`:`last`);return}let u=JD(e.key);if(u&&!(n instanceof HTMLButtonElement)){e.preventDefault(),C(i+u);return}let d=n instanceof HTMLInputElement&&n.dataset.option!==void 0?Number(n.dataset.option):-1;if(e.key===`Enter`&&d>=0){if(e.preventDefault(),y)h.length>0&&h.includes(d)?x(o,c):b(d);else{let e={...o,[i]:[d]},t={...c,[i]:``};s(e),l(t),x(e,t)}return}if(e.key===` `&&d>=0){e.preventDefault(),b(d);return}let m=Number(e.key);Number.isInteger(m)&&m>=1&&m<=p.options.length&&(e.preventDefault(),b(m-1),r.querySelector(`[data-option="${m-1}"]`)?.focus())}return(0,I.jsxs)(`form`,{ref:f,className:`flex flex-col gap-3`,onSubmit:S,onKeyDown:w,children:[(0,I.jsx)(XZ,{questions:e,picks:o,own:c,index:i,onGo:a}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.length>1?`Question ${i+1} of ${e.length}`:`Question`}),(0,I.jsx)(KR,{text:p.question,className:`mt-1 text-base`})]}),(0,I.jsxs)(`div`,{className:q(`grid min-w-0 gap-4`,_?.preview||_?.image||_?.htmlPreview?`lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)]`:``),children:[(0,I.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-2`,children:[p.options.map((e,t)=>(0,I.jsx)(KZ,{option:e,index:t,multi:y,name:`question-${i}`,selected:h.includes(t),onToggle:()=>b(t),onFocusOption:()=>d({...u,[i]:t})},t)),(0,I.jsxs)(`label`,{className:`flex min-h-9 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`,children:[(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:HZ}),(0,I.jsx)(wO,{"data-nav":``,value:g,onChange:e=>{l({...c,[i]:e.target.value}),e.target.value&&s({...o,[i]:[]})},placeholder:HZ,"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`})]})]}),(0,I.jsx)(qZ,{option:_})]}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(`span`,{children:y?`Pick several`:`Pick one`}),(0,I.jsx)(aD,{chord:`↑↓`,children:`move`}),(0,I.jsx)(aD,{chord:y?`Space`:`Enter`,children:y?`pick`:`choose`}),y?(0,I.jsx)(aD,{chord:`Enter`,children:`next`}):null,e.length>1?(0,I.jsx)(aD,{chord:`←→`,children:`question`}):null,(0,I.jsx)(aD,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(JZ,{primary:`submit`,primaryLabel:i<e.length-1?`Next`:`Answer`,disabled:!v,submitting:t,onCancel:r})]})}function QZ(e,t,n){let r=e.currentTarget,i=e.target;if(e.altKey||KD(i))return;let a=qD(e.key);if(a){e.preventDefault(),GD(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 $Z({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,I.jsxs)(`form`,{ref:o,className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i&&n(i)},onKeyDown:r=>QZ(r,e.options.length,(r,i)=>{let o=e.options[r];o!==void 0&&(a(o),i&&!t&&n(o))}),children:[(0,I.jsx)(KR,{text:e.title,className:`text-base`}),(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.options.map((e,t)=>(0,I.jsx)(KZ,{option:{label:e},index:t,multi:!1,name:`choice`,selected:i===e,onToggle:()=>a(e)},e))}),(0,I.jsxs)(`p`,{className:`flex flex-wrap items-center gap-x-4 gap-y-1.5 text-xs text-muted-foreground`,children:[(0,I.jsx)(aD,{chord:`↑↓`,children:`move`}),(0,I.jsx)(aD,{chord:`Enter`,children:`choose`}),(0,I.jsx)(aD,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(JZ,{primary:`submit`,primaryLabel:`Choose`,disabled:!i,submitting:t,onCancel:r})]})}function eQ({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,I.jsxs)(`div`,{ref:r,tabIndex:-1,"data-autofocus":``,onKeyDown:i,className:`flex flex-col gap-3 outline-none`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(KR,{text:e.question,className:`text-base`}),e.detail?(0,I.jsx)(KR,{text:e.detail,className:`mt-1 text-muted-foreground`}):null]}),(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,I.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,I.jsx)(aD,{chord:`Y`,children:`yes`}),(0,I.jsx)(aD,{chord:`N`,children:`no`}),(0,I.jsx)(aD,{chord:`Esc`,children:`later`})]}),(0,I.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n(!1),children:`No`}),(0,I.jsx)(J,{type:`button`,disabled:t,onClick:()=>n(!0),children:t?`Sending…`:`Yes`})]})]})]})}function tQ({view:e,submitting:t,onAnswer:n,onCancel:r}){let[i,a]=(0,m.useState)(``);return(0,I.jsxs)(`form`,{className:`flex flex-col gap-3`,onSubmit:e=>{e.preventDefault(),i.trim()&&n(i.trim())},children:[(0,I.jsx)(KR,{text:e.question,className:`text-base`}),(0,I.jsx)(wO,{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??HZ,"aria-label":e.question,rows:3,className:`min-h-9 resize-none text-sm md:text-sm`}),(0,I.jsxs)(`p`,{className:`flex items-center gap-x-4 text-xs text-muted-foreground`,children:[(0,I.jsx)(aD,{chord:`Enter`,children:`answer`}),(0,I.jsx)(aD,{chord:`Shift+Enter`,children:`new line`}),(0,I.jsx)(aD,{chord:`Esc`,children:`later`})]}),(0,I.jsx)(JZ,{primary:`submit`,primaryLabel:`Answer`,disabled:!i.trim(),submitting:t,onCancel:r})]})}function nQ({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,I.jsxs)(`form`,{ref:l,className:`flex flex-col gap-3`,onSubmit:u,onKeyDown:r=>{e.method===`select`&&QZ(r,s.length,(e,r)=>{let i=s[e];i!==void 0&&(o(i),r&&!t&&n({value:i}))})},children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.title}),e.message?(0,I.jsx)(KR,{text:e.message,className:`mt-1 text-base`}):null]}),e.method===`select`?(0,I.jsx)(`div`,{className:`flex flex-col gap-2`,children:s.map((e,t)=>(0,I.jsx)(KZ,{option:{label:e},index:t,multi:!1,name:`dialog`,selected:a===e,onToggle:()=>o(e)},e))}):null,e.method===`input`||e.method===`editor`?(0,I.jsx)(wO,{value:r,onChange:e=>i(e.target.value),placeholder:e.placeholder??HZ,"aria-label":e.title,rows:e.method===`editor`?4:2,className:`min-h-9 resize-none text-sm md:text-sm`}):null,(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({cancelled:!0}),children:`Cancel`}),e.method===`confirm`?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,disabled:t,onClick:()=>n({confirmed:!1}),children:`No`}),(0,I.jsx)(J,{type:`button`,disabled:t,onClick:()=>n({confirmed:!0}),children:t?`Sending…`:`Yes`})]}):(0,I.jsx)(J,{type:`submit`,disabled:!c||t,children:t?`Sending…`:`Answer`})]})]})}function rQ(e){let{view:t}=e;return t.kind===`questionnaire`?(0,I.jsx)(ZZ,{questions:t.questions,submitting:e.submitting,onAnswer:e.onAnswer,onCancel:e.onCancel}):t.kind===`choose`?(0,I.jsx)($Z,{...e,view:t}):t.kind===`confirm`?(0,I.jsx)(eQ,{...e,view:t}):t.kind===`text`?(0,I.jsx)(tQ,{...e,view:t}):(0,I.jsx)(nQ,{...e,dialog:t.dialog})}function iQ(e){return typeof e==`object`&&e?e:{}}function aQ(e){return typeof e==`string`?e.trim():``}function oQ(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function sQ(e){let t=iQ(e),n=aQ(t.label);if(!n)return;let r=aQ(t.description),i=aQ(t.preview),a=aQ(t.image),o=FZ(t.htmlPreview);return{label:n,...r?{description:r}:{},...i?{preview:i}:{},...a?{image:a}:{},...o?{htmlPreview:o}:{}}}function cQ(e){let t=iQ(e),n=aQ(t.question);if(!n)return;let r=(Array.isArray(t.options)?t.options:[]).map(sQ).filter(e=>!!e);return{question:n,header:aQ(t.header)||`Question`,options:r,...t.multiSelect===!0?{multiSelect:!0}:{}}}function lQ(e){let t=iQ(e),n=aQ(t.method);if(n!==`select`&&n!==`confirm`&&n!==`input`&&n!==`editor`)return;let r=aQ(t.message),i=oQ(t.options),a=aQ(t.placeholder),o=aQ(t.prefill);return{id:aQ(t.id),method:n,title:aQ(t.title)||`Answer`,...r?{message:r}:{},...i.length>0?{options:i}:{},...a?{placeholder:a}:{},...o?{prefill:o}:{}}}function uQ(e){let t=(Array.isArray(e.questions)?e.questions:[]).map(cQ).filter(e=>!!e);return t.length>0?{kind:`questionnaire`,questions:t}:void 0}function dQ(e){return{kind:`choose`,title:aQ(e.title)||`Choose an option`,options:oQ(e.options)}}function fQ(e){let t=aQ(e.question)||aQ(e.title)||`Continue?`,n=aQ(e.detail)||aQ(e.message);return{kind:`confirm`,question:t,...n?{detail:n}:{}}}function pQ(e){let t=aQ(e.question)||aQ(e.title)||`Type an answer`,n=aQ(e.placeholder);return{kind:`text`,question:t,...n?{placeholder:n}:{}}}function mQ(e){let t=iQ(e.payload);if(e.kind===`questionnaire`)return uQ(t);if(e.kind===`choose`)return dQ(t);if(e.kind===`confirm`)return fQ(t);if(e.kind===`text`)return pQ(t);let n=lQ(t.dialog);return n?{kind:`sessionDialog`,dialog:n}:void 0}function hQ({submitting:e,onKeep:t,onLeave:n}){return(0,I.jsxs)(`div`,{className:`flex flex-col gap-4`,role:`alert`,children:[(0,I.jsx)(`p`,{className:`text-sm`,children:`Leave without answering? The oracle will not guess for you.`}),(0,I.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,I.jsx)(J,{type:`button`,variant:`outline`,onClick:t,children:`Keep answering`}),(0,I.jsx)(J,{type:`button`,disabled:e,onClick:n,children:e?`Leaving…`:`Leave`})]})]})}function gQ({count:e,onOpen:t}){return(0,I.jsxs)(J,{type:`button`,variant:`soft`,onClick:t,"aria-label":`${e} question${e===1?``:`s`} waiting — open`,className:`gap-1.5 text-warning`,children:[(0,I.jsx)(Jp,{"aria-hidden":`true`}),(0,I.jsx)(`span`,{className:`tabular-nums`,children:e}),(0,I.jsx)(`span`,{className:`hidden sm:inline`,children:`waiting`})]})}function _Q({prompts:e,answer:t,dismiss:n,minimized:r,onMinimize:i}){let[a,o]=(0,m.useState)(!1),[s,c]=(0,m.useState)(!1),l=e.length,u=e[0],d=u?mQ(u):void 0,f=l>0&&!r,p=mD(f,pD.question);(0,m.useEffect)(()=>{l===0&&(o(!1),i(!1))},[l,i]);async function h(e,t){c(!0);try{await e,o(!1)}catch(e){e instanceof Gf&&e.code===`question_withdrawn`?B(vD):B.error(e instanceof Error?e.message:t)}finally{c(!1)}}let g=u?.from?`${u.from} asks`:`A question`;return(0,I.jsx)(oD,{open:f&&p&&!!u,label:`Question from the lobby`,dismissOnBackdrop:!1,onOpenChange:e=>{e||(a?o(!1):i(!0))},className:`max-w-3xl`,children:u?(0,I.jsxs)(`section`,{"aria-label":`Question from the lobby`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,I.jsxs)(`header`,{className:`flex items-center gap-3 px-6 pt-5 pb-3`,children:[(0,I.jsxs)(`p`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-muted-foreground first-letter:uppercase`,children:[g,l>1?` · 1 of ${l}`:``]}),(0,I.jsx)(J,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":`Later: put the question away`,title:`Later · Esc`,onClick:()=>i(!0),children:(0,I.jsx)(gg,{"aria-hidden":`true`})})]}),(0,I.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-6 pb-6`,children:d?a?(0,I.jsx)(hQ,{submitting:s,onKeep:()=>o(!1),onLeave:()=>void h(n(u.id),`Could not leave the question`)}):(0,I.jsx)(rQ,{view:d,submitting:s,onAnswer:e=>void h(t(u.id,e),`Could not send the answer`),onCancel:()=>o(!0)},u.id):(0,I.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This question cannot be shown here.`}),(0,I.jsx)(J,{type:`button`,disabled:s,onClick:()=>void h(n(u.id),`Could not dismiss the question`),children:`Dismiss`})]})})]}):null})}var vQ=2;function yQ(e){let t=globalThis.EventSource;if(!t)throw Error(`EventSource is not available in this environment`);return new t(e)}function bQ(e){try{return JSON.parse(e)}catch{return}}function xQ(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 SQ(e,t=yQ){let n=t(Uf(`/api/events`));return e.onConnection?.(`connecting`),n.onopen=()=>e.onConnection?.(`live`),n.onerror=()=>e.onConnection?.(n.readyState===vQ?`offline`:`connecting`),n.onmessage=t=>{let n=bQ(t.data);n&&xQ(n,e)},()=>n.close()}function CQ(){let e=(0,m.useRef)(void 0),t=(0,m.useCallback)(()=>{e.current?.();try{Hf()}catch{kf.onStatus({connection:`offline`});return}e.current=SQ({onHello:e=>kf.onHello(e),onChanged:(e,t)=>kf.onChanged(e,t),onFeed:e=>kf.onFeedDelta(e),onReply:e=>kf.onReplyDelta(e),onNotice:(e,t)=>B[t](e),onConnection:e=>kf.onStatus({connection:e})})},[]);return(0,m.useEffect)(()=>(t(),()=>e.current?.()),[t]),t}function wQ(){let e=LD(`prompts`),t=(0,m.useCallback)(async(e,t)=>{await qf(`prompts.answer`,{id:e,answer:t})},[]),n=(0,m.useCallback)(async e=>{await qf(`prompts.dismiss`,{id:e})},[]);return{prompts:e.data?.prompts??[],loading:e.loading,error:e.error,answer:t,dismiss:n}}function TQ(e,t,n,r){e===`search`?(document.querySelector(`#main input[type='search']`)??document.getElementById(`composer-text`))?.focus():e===`help`?n():e===`settings`?CD(`#/settings`):e===`sessions`?CD(`#/sessions`):e===`activity`||e===`thinking`?t.kind===`tab`&&t.tab===`lobby`?oH(`lobby.${e}`):CD(SD(`lobby`)):e===`nextTab`?r(1):e===`prevTab`?r(-1):e===`savePlan`&&t.kind===`tab`&&t.tab===`plan`&&V(`planner.save`,{})}function EQ({connection:e,onRetry:t}){return e===`offline`?(0,I.jsx)(PD,{onRetry:t}):null}function DQ(e){return e.kind===`tab`?e.tab:e.kind}function OQ(){let e=wD(),t=LD(`status`),n=LD(`lobby`),{prompts:r,answer:i,dismiss:a}=wQ(),{connection:o,signedOut:s}=ID(),[c,l]=(0,m.useState)(!1),[u,d]=(0,m.useState)(!1),f=(0,m.useRef)(null),p=CQ();SG();let h=t.data,g=h?.tabs??[],_=h?.keys??[],v=e.kind===`tab`?e.tab:void 0,y=(0,m.useCallback)(e=>CD(SD(e)),[]),b=(0,m.useCallback)(e=>{if(g.length===0)return;let t=Math.max(0,g.findIndex(e=>e.id===v)),n=g[(t+e+g.length)%g.length];n&&CD(SD(n.id))},[g,v]),x=(0,m.useCallback)(()=>l(e=>!e),[]),S=(0,m.useCallback)(t=>{(t!==`thinking`&&t!==`activity`||h?.panels?.[t]!==!1)&&TQ(t,xD(window.location.hash)??e,x,b)},[e,x,b,h?.panels]),C=(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},[]);fU({enabled:!!h,keys:_,tabs:g,insideApp:C,onAction:S,onTab:y});let w=(0,m.useCallback)(()=>kf.onHello({}),[]),T=e.kind===`tab`?e.tab:e.kind,E=!!h;(0,m.useEffect)(()=>{if(!E)return;if(nO.active){nO.active=!1;return}let e=requestAnimationFrame(()=>{document.activeElement?.id===`composer-text`||document.querySelector(`[role='dialog']`)||document.getElementById(`main`)?.focus({preventScroll:!0})});return()=>cancelAnimationFrame(e)},[T,E]);let ee=Object.fromEntries(_.map(e=>[e.action,e.label])),D=(0,I.jsx)(gZ,{status:h,task:n.data?.task,connection:o,route:e,keys:ee,onHelp:x,tabs:(0,I.jsx)(AZ,{tabs:g,activeId:v,onSelect:y}),extra:u&&r.length>0?(0,I.jsx)(gQ,{count:r.length,onOpen:()=>d(!1)}):null});return s||!h?(0,I.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[D,(0,I.jsx)(`main`,{className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto max-sm:mx-0 max-sm:mb-0`,children:s?(0,I.jsx)(vZ,{}):t.error?(0,I.jsx)(ND,{message:t.error,onRetry:w}):(0,I.jsx)(MD,{})})]}):(0,I.jsxs)(`div`,{ref:f,className:`fixed inset-0 flex flex-col`,children:[D,(0,I.jsx)(EQ,{connection:o,onRetry:p}),(0,I.jsx)(`main`,{id:`main`,tabIndex:-1,onKeyDown:e=>{e.key!==`Escape`||e.defaultPrevented||KD(e.target)||e.target.closest(`[role='dialog'], [role='menu'], [role='listbox']`)||tO()&&e.preventDefault()},role:v?`tabpanel`:void 0,"aria-labelledby":v?`tab-${v}`:void 0,className:`surface mx-3 mb-3 flex min-h-0 flex-1 flex-col overflow-y-auto outline-none max-sm:mx-0 max-sm:mb-0`,children:(0,I.jsx)(z.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:DX(e)},DQ(e))}),(0,I.jsx)(QX,{route:e,keys:ee,onHelp:x}),(0,I.jsx)(_Q,{prompts:r,answer:i,dismiss:a,minimized:u,onMinimize:d}),(0,I.jsx)(RX,{open:c,onOpenChange:l,keys:_,tabs:g})]})}async function kQ(e){switch(e){case`status`:return qf(`status.get`,{});case`lobby`:return qf(`lobby.snapshot`,{});case`prompts`:return qf(`prompts.list`,{});default:return}}var AQ=[`status`,`lobby`,`prompts`];function jQ(){let[e,t]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{let e=!0;return(async()=>{await Yf(),e&&(kf.markUsed(AQ,kQ),t(!0))})(),()=>{e=!1}},[]),e}function MQ(){return jQ()?(0,I.jsx)(OQ,{}):(0,I.jsx)(`div`,{className:`fixed inset-0 flex`,children:(0,I.jsx)(MD,{})})}var NQ={info:Em,success:Hp,warning:ng,error:Qp},PQ={info:`text-primary`,success:`text-success`,warning:`text-warning`,error:`text-destructive`};function FQ(){let{item:e,waiting:t}=zf(),n=gD(),r=e&&!n;return(0,m.useEffect)(()=>{if(!e||n)return;let r=window.setTimeout(()=>Lf(e.id),t>0?Math.min(e.duration,1600):e.duration);return()=>window.clearTimeout(r)},[e,n,t]),(0,I.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,I.jsx)(nu,{mode:`wait`,children:r?(0,I.jsxs)(z.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,I.jsx)(IQ,{kind:e.kind}),(0,I.jsx)(`span`,{className:`min-w-0 break-words`,children:e.message}),e.action?(0,I.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(),Lf(e.id)},children:e.action.label}):null]},e.id):null})})}function IQ({kind:e}){let t=NQ[e];return(0,I.jsx)(t,{"aria-hidden":`true`,className:q(`size-5 shrink-0`,PQ[e])})}(0,wf.createRoot)(document.getElementById(`root`)).render((0,I.jsx)(m.StrictMode,{children:(0,I.jsx)(aK,{children:(0,I.jsx)(lu,{reducedMotion:`user`,children:(0,I.jsxs)(BD,{children:[(0,I.jsx)(MQ,{}),(0,I.jsx)(FQ,{})]})})})})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`,{updateViaCache:`none`}).catch(()=>void 0)});
|