ledung 1.5.0 → 1.6.0
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/CHANGELOG.md +5 -1
- package/dist/main.js +18 -8
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/web/dist/assets/{highlightCore-CGEYh7VF.js → highlightCore-Cci4B5B5.js} +1 -1
- package/web/dist/assets/{index-Cti8k_M1.js → index-C_l4DtEI.js} +56 -56
- package/web/dist/index.html +1 -1
|
@@ -5,8 +5,8 @@ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=
|
|
|
5
5
|
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
6
|
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function L(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function R(e){try{var t=``,n=null;do t+=L(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
7
|
Error generating stack: `+e.message+`
|
|
8
|
-
`+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(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 ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(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-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Qe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function bt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[St])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Fe.call(Wt,e)?!0:Fe.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var z=!1;function Kt(){var e=z;return z=!1,e}function qt(e,t,n){if(Gt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Yt(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 Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Qt(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 $t(e){if(!e._valueTracker){var t=Zt(e)?`checked`:`value`;e._valueTracker=Qt(e,t,``+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var tn=/[\n"\\]/g;function nn(e){return e.replace(tn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function rn(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=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):on(e,Xt(n)):o===`number`&&e.value==t?on(e,Xt(e.value)):on(e,Xt(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=``+Xt(s):e.removeAttribute(`name`)}function an(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)){$t(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(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),$t(e)}function on(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function sn(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=``+Xt(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 cn(e,t,n){t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Xt(n)}function ln(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),$t(e)}function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dn=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 fn(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||dn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function pn(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]=``,z=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(fn(e,a,r),z=!0)}else for(var o in t)t.hasOwnProperty(o)&&fn(e,o,t[o])}function mn(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 hn=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`]]),gn=/^[\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 _n(e){return gn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function B(){}var vn=null;function V(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var yn=null,bn=null;function xn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(rn(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="`+nn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));rn(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&&en(r)}break a;case`textarea`:cn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&sn(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(yn!==null||bn!==null)&&(Ld(),yn&&(t=yn,e=bn,bn=yn=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,n=t.length,r,i=`value`in On?On.value:On.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 An=i.slice(e,1<r?1-r:void 0)}function Mn(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 Nn(){return!0}function Pn(){return!1}function Fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Nn:Pn,this.isPropagationStopped=Pn,this}return D(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=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=D({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=D({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$n,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!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(D({},Un,{dataTransfer:0})),Kn=Fn(D({},Rn,{relatedTarget:0})),qn=Fn(D({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=Fn(D({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=Fn(D({},In,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={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`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function H(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function $n(){return H}var er=Fn(D({},Rn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$n,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),U=Fn(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),tr=Fn(D({},In,{submitter:0})),nr=Fn(D({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$n})),rr=Fn(D({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Fn(D({},Un,{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})),ar=Fn(D({},In,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Tn&&`CompositionEvent`in window,cr=null;Tn&&`documentMode`in document&&(cr=document.documentMode);var lr=Tn&&`TextEvent`in window&&!cr,ur=Tn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=jn(),An=kn=On=null,hr=!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 ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){yn?bn?bn.push(r):bn=[r]:yn=r,t=qf(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Bf(e,0)}function wr(e){if(en(Pt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Tn){var Dr;if(Tn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,V(e)),Cn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(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(!Fe.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(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 Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(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=zr(e.document)}return t}function Wr(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 Gr=Tn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=qf(qr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Tn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Bt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;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 hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=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)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[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&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(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-Qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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 ji(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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Oi(31,n,t,a),e.elementType=oe,e.lanes=o,e;case A:return Ni(n.children,a,o,t);case j:s=8,a|=24;break;case M:return e=Oi(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case ne:return e=Oi(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Oi(19,n,t,a),e.elementType=re,e.lanes=o,e;case se:case le:return e=a|32,e=Oi(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case te:s=9;break a;case P:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function W(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:R(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:R(t)}}var G=[],K=0,Ri=null,zi=0,Bi=[],Vi=0,q=null,Hi=1,Ui=``;function Wi(e,t){G[K++]=zi,G[K++]=Ri,Ri=e,zi=t}function Gi(e,t,n){Bi[Vi++]=Hi,Bi[Vi++]=Ui,Bi[Vi++]=q,q=e;var r=Hi;e=Ui;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Hi=1<<32-Qe(t)+i|n<<i|r,Ui=a+e}else Hi=1<<a|n<<i|r,Ui=e}function Ki(e){e.return!==null&&(Wi(e,1),Gi(e,1,0))}function qi(e){for(;e===Ri;)Ri=G[--K],G[K]=null,zi=G[--K],G[K]=null;for(;e===q;)q=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null,Hi=Bi[--Vi],Bi[Vi]=null}function Ji(e,t){Bi[Vi++]=Hi,Bi[Vi++]=Ui,Bi[Vi++]=q,Hi=t.id,Ui=t.overflow,q=e}var Yi=null,Xi=null,J=!1,Zi=null,Qi=!1,$i=Error(i(519));function ea(e){throw oa(W(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),$i}function ta(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),an(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),ln(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||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=B),t=!0):t=!1,t||ea(e,!0)}function na(e){for(Yi=e.return;Yi;)switch(Yi.tag){case 5:case 31:case 13:Qi=!1;return;case 27:case 3:Qi=!0;return;default:Yi=Yi.return}}function ra(e){if(e!==Yi)return!1;if(!J)return na(e),J=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Xi&&ea(e),na(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Xi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Xi=dm(e)}else t===27?(t=Xi,Sp(e.type)?(e=um,um=null,Xi=e):Xi=t):Xi=Yi?lm(e.stateNode.nextSibling):null;return!0}function ia(){Xi=Yi=null,J=!1}function aa(){var e=Zi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Zi=null),e}function oa(e){Zi===null?Zi=[e]:Zi.push(e)}var sa=ye(null),ca=null,la=null;function ua(e,t,n){xe(sa,t._currentValue),t._currentValue=n}function da(e){e._currentValue=sa.current,be(sa)}function fa(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 pa(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),fa(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),fa(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),fa(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 ma(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;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&pa(t,e,n,r),t.flags|=262144,e!==null}function ha(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ga(e){ca=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _a(e){return ya(ca,e)}function va(e,t){return ca===null&&ga(e),ya(e,t)}function ya(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(i(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var ba=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()})}},xa=t.unstable_scheduleCallback,Sa=t.unstable_NormalPriority,Ca={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wa(){return{controller:new ba,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&xa(Sa,function(){e.controller.abort()})}function Ea(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 Da=null;function Oa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ka=null,Aa=0,ja=0,Ma=null;function Na(e,t){if(ka===null){var n=ka=[];Aa=0,ja=Nf(),Ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Aa++,t.then(Pa,Pa),t}function Pa(){if(--Aa===0&&(Da=null,ka!==null)){Ma!==null&&(Ma.status=`fulfilled`);var e=ka;ka=null,ja=0,Ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fa(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 Ia=F.S;F.S=function(e,t){if(pd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&Na(e,t),Da!==null)for(var n=yf;n!==null;)Ea(n,Da),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Ea(r,n),r=r.next;if(ja!==0){r=Da,r===null&&(r=Da=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ia!==null&&Ia(e,t)};var La=ye(null);function Ra(){var e=La.current;return e===null?Xu.pooledCache:e}function za(e,t){t===null?xe(La,La.current):xe(La,t.pool)}function Ba(){var e=Ra();return e===null?null:{parent:Ca._currentValue,pool:e}}var Va=Error(i(460)),Ha=Error(i(474)),Ua=Error(i(542)),Wa={then:function(){}};function Ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(B,B),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Xa(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(B,B);else{if(e=Xu,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,Xa(e),e}throw Ja=t,Va}}function qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ja=e,Va):e}}var Ja=null;function Ya(){if(Ja===null)throw Error(i(459));var e=Ja;return Ja=null,e}function Xa(e){if(e===Va||e===Ua)throw Error(i(483))}var Za=null,Qa=0;function $a(e){var t=Qa;return Qa+=1,Za===null&&(Za=[]),Ka(Za,e,t)}function eo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function to(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function no(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=Ai(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=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===A?(e=d(e,t,n.props.children,r,n.key),eo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&qa(i)===t.type)?(t=a(t,n.props),eo(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),eo(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=Ii(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=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),eo(n,t),n.return=e,n;case ee:return t=Ii(t,e.mode,n),t.return=e,t;case ae:return t=qa(t),f(e,t,n)}if(he(t)||fe(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,$a(t),n);if(t.$$typeof===N)return f(e,va(e,t),n);to(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 k:return n.key===i?l(e,t,n,r):null;case ee:return n.key===i?u(e,t,n,r):null;case ae:return n=qa(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,$a(n),r);if(n.$$typeof===N)return p(e,t,va(e,n),r);to(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=qa(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,$a(r),i);if(r.$$typeof===N)return m(e,t,n,va(t,r),i);to(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),J&&Wi(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 J&&Wi(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)}),J&&Wi(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),J&&Wi(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 J&&Wi(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)}),J&&Wi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),eo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),eo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Ni(o.props.children,e.mode,c,o.key),eo(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),eo(c,o),c.return=e,e=c)}return s(e);case ee: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=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=qa(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(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,$a(o),c);if(o.$$typeof===N)return _(e,r,va(e,o),c);to(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Qa=0;var i=_(e,t,n,r);return Za=null,i}catch(t){if(t===Va||t===Ua)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ro=no(!0),io=no(!1),ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(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 co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function uo(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,ht(e,n)}}function fo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var po=!1;function mo(){if(po){var e=Ma;if(e!==null)throw e}}function ho(e,t,n,r){po=!1;var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===ja&&(po=!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=D({},d,f);break a;case 2:ao=!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),id|=o,e.lanes=o,e.memoizedState=d}}function go(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function _o(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)go(n[e],t)}var vo=ye(null),yo=ye(0);function bo(e,t){e=nd,xe(yo,e),xe(vo,t),nd=e|t.baseLanes}function xo(){xe(yo,nd),xe(vo,vo.current)}function So(){nd=yo.current,be(vo),be(yo)}var Co=ye(null),wo=null;function To(e){var t=e.alternate;xe(Ao,Ao.current&1),xe(Co,e),wo===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){xe(Ao,Ao.current),xe(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(xe(Ao,Ao.current),xe(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){xe(Ao,Ao.current),xe(Co,Co.current)}function ko(e){be(Co),wo===e&&(wo=null),be(Ao)}var Ao=ye(0);function jo(e,t){xe(Co,Co.current),xe(Ao,t)}function Mo(e){be(Ao),be(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(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 Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?lc:uc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){F.H=cc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ha(e)&&(Dc=!0))}function Jo(e,t,n,r){Y=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=dc,o=t(n,r)}while(Ro);return o}function Yo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ka(Ho,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?lc:uc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===ue)return;if(e.$$typeof===N)return _a(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=ts(),Y.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]=ce;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(Po&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ja&&(d=!0);else if((Po&p)===p){u=u.next,p===ja&&(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,Y.lanes|=p,id|=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,Y.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Dc=!0,d&&(n=Ma,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 cs(e){var t=es(),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);Lr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Y,a=es(),o=J;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Po&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=ts(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function ms(e){var t=Ci(e,2);t!==null&&Md(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ac(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(J){var n=Xu.formState;if(n!==null){a:{var r=Y;if(J){if(Xi){b:{for(var i=Xi,a=Qi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Xi=lm(i.nextSibling),r=i.data===`F!`;break a}}ea(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,Y,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,Y,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Va?Ua:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=ts(),Y.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 As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Y.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Y.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=ts(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||Po&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),Y.lanes|=e,id|=e,n)}function Gs(e,t,n,r){return Lr(n,t)?n:vo.current===null?!(Po&106)||Po&1073741824&&!(Q&261930)?(Dc=!0,e.memoizedState=n):(e=Ad(),Y.lanes|=e,id|=e,t):(e=Ws(e,n,r),Lr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,ic(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,Fa(c,r),kd(e)):rc(e,t,r,kd(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,ge,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},kd())}function Zs(){return _a(sh)}function Qs(){return es().memoizedState}function $s(){return es().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=co(n);var r=lo(t,e,n);r!==null&&(Md(r,t,n),uo(r,t,n)),t={cache:wa()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=Si(e,t,n,r),n!==null&&(Md(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,kd())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,Lr(s,o))return xi(e,t,i,0),Xu===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Md(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Md(t,e,2)}function ac(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function oc(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var cc={readContext:_a,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},lc={readContext:_a,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:_a,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ze(!0);try{n(t)}finally{Ze(!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=tc.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,Y,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=$o();if(J){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Q&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Xu.identifierPrefix;if(J){var n=Ui,r=Hi;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=ec.bind(null,Y)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Ws(n,e,t):Gs(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is};function fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=co(r);i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Md(t,e,r),uo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Md(t,e,r),uo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=co(n);r.tag=2,t!=null&&(r.callback=t),t=lo(e,r,n),t!==null&&(Md(t,e,n),uo(t,e,n))}};function mc(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?!Rr(n,r)||!Rr(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function _c(e){gi(e)}function vc(e){console.error(e)}function yc(e){gi(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=co(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=co(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ma(t,n,a,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Wa?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)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(J)return t=Co.current,t===null?(r!==$i&&(t=Error(i(423),{cause:r}),oa(W(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=W(r,n),a=Sc(e.stateNode,r,a),fo(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==$i&&(e=Error(i(422),{cause:r}),oa(W(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=W(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=W(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),fo(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`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),fo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?io(t,null,n,r):ro(t,e.child,n,r)}function kc(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 ga(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(J&&s&&Ki(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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 Pc(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?xo():bo(t,a),Do(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&za(t,null),xo(),Oo()):(za(t,a.cachePool),bo(t,a),Oo(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=Ra();return a=a===null?null:{parent:Ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&za(t,null),xo(),Do(t),e!==null&&ma(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return ro(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(J){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(Eo(t),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:q===null?null:{id:Hi,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||ma(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(vo.current===null){if(r=Xu,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Md(r,e,s),Ec;Wd()}t=Ic(e,t,n)}else e=o.treeContext,Xi=lm(s.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 ga(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(J&&r&&Ki(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ga(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Dc?(Zo(e,t,a),rl(e,t,a)):(J&&r&&Ki(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ga(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=_a(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},oo(t),o=n.contextType,a.context=typeof o==`object`&&o?_a(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),ho(t,r,a,i),mo(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=_a(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)&&hc(t,a,r,o),ao=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),mo(),l=t.memoizedState,s||f!==l||ao?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=ao||mc(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,so(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=_a(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)&&hc(t,a,r,c),ao=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i),mo();var p=t.memoizedState;o!==d||f!==p||ao||e!==null&&e.dependencies!==null&&ha(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=ao||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ha(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,Rc(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=ro(t,e.child,null,i),t.child=ro(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ia(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Ba()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(J){if(i?To(t):Oo(),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:q===null?null:{id:Hi,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(To(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=Ba():(s=Ca._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Ai(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 qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return ro(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Oo(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ro(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),sm(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,oa({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||ma(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(vo.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Md(r,e,a),Ec;return om(o)||Wd(),Yc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Xi=lm(o.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fa(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(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 tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=J?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(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&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return ua(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ma(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=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ha(e)))}function al(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ua(t,Ca,e.memoizedState.cache),ia();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=ma(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(To(t),e=rl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ma(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:ua(t,Ca,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,J&&t.flags&1048576&&Gi(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=gc(e,r),t.tag=1,t=Vc(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===P){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=me(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=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,so(e,t),ho(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ua(t,Ca,r),r!==o.cache&&pa(t,[Ca],n,!0),mo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Hc(e,t,r,n);break a}if(r!==a){a=W(Error(i(424)),t),oa(a),t=Hc(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(Xi=lm(e.firstChild),Yi=t,J=!0,Zi=null,Qi=!0,n=io(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ia(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:J||(t.stateNode=fp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&J&&(r=t.stateNode=hm(t.type,t.pendingProps,we.current),Yi=t,Qi=!0,a=Xi,Sp(t.type)?(um=a,Xi=lm(r.firstChild)):Xi=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&J&&((a=r=Xi)&&(r=rm(r,t.type,t.pendingProps,Qi),r===null?a=!1:(t.stateNode=r,Yi=t,Xi=lm(r.firstChild),Qi=!1,a=!0)),a||ea(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),sh._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&J&&((e=n=Xi)&&(n=im(n,t.pendingProps,Qi),n===null?e=!1:(t.stateNode=n,Yi=t,Xi=null,e=!0)),e||ea(t)),null;case 13:return Kc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ro(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ga(t),a=_a(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ga(t),r=_a(Ca),e===null?(a=Ra(),a===null&&(a=Xu,o=wa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},oo(t),ua(t,Ca,a)):((e.lanes&n)!==0&&(so(e,t),ho(t,null,null,n),mo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ua(t,Ca,r),r!==a.cache&&pa(t,[Ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ua(t,Ca,r))),Oc(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:J&&Ki(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(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(Vd())e.flags|=8192;else throw Ja=Wa,Ha}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Ja=Wa,Ha}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,cd|=t)}function dl(e,t){if(!J)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 fl(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 pl(e,t,n){var r=t.pendingProps;switch(qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),da(Ca),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ra(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,aa())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ra(t)?ta(t,e):(e=hm(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ra(t))ta(t,o);else{var s=lp(we.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[St]=t,o[Ct]=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(np(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&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ra(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Yi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ea(t,!0)}else e=lp(e).createTextNode(r),e[St]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ra(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[St]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ra(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[St]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(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),ul(t,t.updateQueue),fl(t),null);case 4:return De(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return da(t.type),fl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return jo(t,Ao.current&1|2),J&&Wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>md&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!J)return fl(t),null}else 2*Be()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,dl(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=Be(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||J?jo(t,o):(n=o,xe(Co,t),xe(Ao,n),wo===null&&(wo=t)),J&&Wi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(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&&be(La),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Ca),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Ca),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(ko(t),t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(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 De(),null;case 10:return da(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&be(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Ca),null;case 25:return null;default:return null}}function hl(e,t){switch(qi(t),t.tag){case 3:da(Ca),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:da(t.type);break;case 22:case 23:ko(t),So(),e!==null&&be(La);break;case 24:da(Ca)}}function gl(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){ff(t,t.return,e)}}function _l(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_o(t,n)}catch(t){ff(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function bl(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=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,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){ff(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function Sl(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++)em(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&em(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&tm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(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){ff(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Ct]=t}catch(t){ff(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(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&&Sp(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 jl(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=B)),Sl(e,r),z=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),z=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[St]=e,t[Ct]=n}catch(t){ff(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Pl=!0,Tp(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(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=hi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||jd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;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=hi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),jd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Fl!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(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,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Op(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&&Tp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,eu=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Ur(e),Wr(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(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&ql(e),uu(n))}}Fl=null}function uu(e){for(;iu!==null;){var t=iu,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=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(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=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Bl(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,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&gl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(ju(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{_o(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:ju(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||eu;t=$l,i=eu,$l=r,(eu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),$l=t,eu=i}break;case 30:ju(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(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){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,z=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:eu||xl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!eu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:eu||xl(n,t),wl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:eu||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),z=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),z=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),eu||_l(4,n,t),vu(e,t,n);break;case 1:eu||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:eu=(r=eu)||n.memoizedState!==null,vu(e,t,n),eu=r;break;case 30:xl(n,t),vu(e,t,n);break;case 7:eu||xl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(i(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(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(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(i(160));yu(s,c,o),gu=null,_u=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(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}wu(t,e,n),Du(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(r,r.return)),a&64&&$l&&(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=Tu,wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(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($l)e.stateNode=fp(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[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Gm(`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),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`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),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else $l||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||eu||t.parentNode.removeChild(t)):a.count--,n===null?$l||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(r,r.return)),r!==null&&a&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=tu,tu=!1,wu(t,e,n),tu=o,Du(e),a&512&&(eu||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{un(t,``),z=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),a&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,z=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(z=!1,Wm=null,o=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=o,Du(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}nu&&(nu=!1,Ou(e)),z=!1;break;case 4:a=tu,tu=$l,r=Kt(),o=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=o,z&&ou&&(su=!0),z=r,tu=a;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=$l,l=eu,u=tu;$l=c||o,tu=u||o,eu=l||s,wu(t,e,n),eu=l,tu=u,$l=c,Du(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||$l||eu||(t=s||eu,n=$l,r=eu,$l=o||$l,eu=t,Mu(e,2),$l=n,eu=r),!o&&tu||fu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:a&512&&(eu||r===null||xl(r,r.return)),a=Kt(),o=ou,s=(n&335544064)===n,c=e.memoizedProps,ou=s&&hi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&z&&(e.flags|=4),ou=o,z=a;break;case 21:break;case 7:a&512&&(eu||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(El(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(un(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else Ql(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,Rl(),ku(t,e),!au&&!su){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(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`})),cu=!0}Ll=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Wl(e,!1));break;case 30:r=au,i=Rl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Zl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),Mu(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),Mu(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||eu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:xl(n,n.return),Mu(n,r);break;case 7:xl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(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:Nu(i,a,n),gl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)go(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),bl(a,a.return);break;case 30:Nu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(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&&Ta(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(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&&Ta(a)));break;case 12:if(a&2048){Iu(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){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(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&&Yl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(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:Ru(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(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:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(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 Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:_l(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:Ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=_a(Ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return _a(Ca).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,X=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return X&2&&Q!==0?Q&-Q:F.T===null?yt():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||J){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),sd=e}else sd=536870912}return e=Co.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(pi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),ft(e,n),(!(X&2)||e!==Xu)&&(e===Xu&&(!(X&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(X&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))a=Gd(e,t,!1),o=!1;else{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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-Be(),10<a)){if(Id(r,t,sd,!$u),ot(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(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;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:B},Fl=null,Hu(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=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Be():(a&4194048)===a?pd-Be():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(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(!Lr(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 Id(e,t,n,r){t=ct(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function Ld(){return X&6?!0:(Ef(0,!1),!1)}function Rd(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,la=ca=null,Qo(e),Za=null,Qa=0,e=Z;for(;e!==null;)hl(e.alternate,e),e=e.return;Z=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Xu=e,Z=n=Ai(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=st(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=ct(e,t),bi(),n}function Bd(e,t){Y=null,F.H=cc,t===Va||t===Ua?(t=Ya(),Zu=3):t===Ha?(t=Ya(),Zu=4):Zu=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,bc(e,W(t,e.current)))}function Vd(){var e=Co.current;return e===null?!0:(Q&4194048)===Q?wo===null:(Q&62914560)===Q||Q&536870912?e===wo:!1}function Hd(){var e=F.H;return F.H=cc,e===null?cc:e}function Ud(){var e=F.A;return F.A=Ju,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&Co.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Id(Xu,Q,sd,!1)}function Gd(e,t,n){var r=X;X|=2;var i=Hd(),a=Ud();(Xu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,la=ca=null,X=r,F.H=i,F.A=a,Z===null&&(Xu=null,Q=0,bi()),o}function Kd(){for(;Z!==null;)Yd(Z)}function qd(e,t){var n=X;X|=2;var r=Hd(),a=Ud();Xu!==e||Q!==t?(hd=null,md=Be()+500,zd(e,t)):ed=st(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(Ga(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ga(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return la=ca=null,F.H=r,F.A=a,X=n,Z===null?(Xu=null,Q=0,bi(),rd):0}function Jd(){for(;Z!==null&&!Re();)Yd(Z)}function Yd(e){var t=ol(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Qo(t);var r=t;r===Yi&&(J?(na(r),r.tag===5&&r.stateNode!=null&&(Xi=r.stateNode)):(na(r),J=!0));default:hl(n,t),t=Z=ji(t,nd),t=ol(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Zd(e,t,n,r){la=ca=null,Qo(t),Za=null,Qa=0;var i=t.return;try{if(Tc(e,i,t,n,Q)){rd=1,bc(e,W(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,bc(e,W(n,e.current)),Z=null;return}t.flags&32768?(J||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=pl(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=yi,pt(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Oa(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(We,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=X,X|=4;try{lu(e,t,n)}finally{X=a,I.p=i,F.T=r}}_d=1,Pl?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=X;X|=4;try{ou=su=!1,Eu(t,e,n),n=cp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{X=a,I.p=i,F.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{du(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,ze();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),vt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.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{F.T=n,I.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ta(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=vt(bd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,X&6)throw Error(i(331));var c=X;if(X|=4,Gu(o.current),Lu(o,o.current,s,n),X=c,Ef(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{I.p=a,F.T=r,cf(e,t)}}function df(e,t,n){t=W(n,t),t=Sc(e.stateNode,t,2),e=lo(e,t,2),e!==null&&(ft(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=W(n,e),n=Cc(2),r=lo(t,n,2),r!==null&&(wc(n,r,t,e),ft(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;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)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>Be()-fd?X&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=ut()),e=Ci(e,t),e!==null&&(ft(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return Ie(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=ot(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Be(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=ot(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),vt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=Af.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=ot(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){X&6?Ie(He,Df):Of()})}function Nf(){if(wf===0){var e=ja;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ui.length;If++){var Lf=ui[If];di(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){gi(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){gi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!En||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 Gf(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=Mt(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}Cn(function(){var r=a,i=V(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Kn;break;case`focusout`:u=`blur`,l=Kn;break;case`beforeblur`:case`afterblur`:l=Kn;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=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=qn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=zn;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=U;break;case`submit`:l=tr;break;case`toggle`:case`beforetoggle`:l=ar}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=wn(m,p),g!=null&&d.push(Kf(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!==vn&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))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?Mt(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=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=U,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&mn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)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 hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,hr=!0)),v=qf(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(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=wn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=wn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(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=wn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=wn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
9
|
-
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(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`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=B);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`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=_n(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`:$(`beforetoggle`,e),$(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(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=hn.get(n)||n,qt(e,n,r);else return}z=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:pn(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`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=B);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.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[Ct]||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}z=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}z=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`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:ep(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:ep(e,t,s,c,n,null)}ln(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:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:ep(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(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)||ep(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&&(z=!0),o=m;break;case`name`:m!==f&&(z=!0),a=m;break;case`checked`:m!==f&&(z=!0),u=m;break;case`defaultChecked`:m!==f&&(z=!0),d=m;break;case`value`:m!==f&&(z=!0),s=m;break;case`defaultValue`:m!==f&&(z=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}rn(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)||ep(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&&(z=!0),p=o;break;case`defaultValue`:o!==l&&(z=!0),c=o;break;case`multiple`:o!==l&&(z=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(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:ep(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&&(z=!0),p=a;break;case`defaultValue`:a!==o&&(z=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}cn(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:ep(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&&(z=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(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)&&ep(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:ep(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(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||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[St]=r,n[Ct]=t,np(n,e,t),It(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(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 Ep(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 Dp(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 Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(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`&&(Ap(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+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.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 Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.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},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.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(Bp(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=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(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,Rp(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,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(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=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(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=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(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=b(n[0]),i=b(n[n.length-1]);var a=_(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||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Mt(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=g(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=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(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)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(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=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[kt])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(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 mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(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 gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===B&&(e.onclick=null),jt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var vm=new Map,ym=new Set;function bm(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 xm=I.d;I.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),It(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),It(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ft(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);It(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=we.current)?bm(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=Pm(n.href),t=Ft(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=Pm(n.href);var o=Ft(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.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},vm.set(e,o)),Lm(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=Rm(n),t=Ft(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 Pm(e){return`href="`+nn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),np(t,`link`,n),It(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 Rm(e){return`[src="`+nn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,It(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),np(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[kt]||a[St]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function ch(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(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 lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=wa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},oo(a),e}function uh(e){return e?(e=Ei,e):Ei}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=lo(e,r,t),n!==null&&(Md(n,e,t),uo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=_t(t);var n=Ci(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function vh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(X&6)&&(md=Be()+500,Ef(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=V(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Mt(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 xh=e,null}function Ch(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(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Nt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Mt(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,bt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);vn=r,n.target.dispatchEvent(r),vn=null}else return t=Nt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[Ct]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[wt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ye=Jh.inject(qh),Xe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[wt]=t.current,Uf(e),new Wh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=d(),y=_(),b=[`default`,`acceptEdits`,`auto`,`plan`],x=`~chats`;function S(e){return e===`~chats`?`Chats`:e}var C=[`normal`,`high`,`critical`],w=[`merge`,`devShip`,`computerControl`],T=[`merge`,`devShip`],E=String.raw`(?<![\w.-])g?sudo(?:\.exe)?(?![\w.-])`,D=String.raw`(?<![\w.-])runas(?:\.exe)?(?![\w.-])`,O=[`Bash`,`PowerShell`];function k(e,t){if(!O.includes(e)||typeof t.command!=`string`)return!1;let n=t.command;return[E,D].some(e=>new RegExp(e,`i`).test(n))}var ee=[{name:`Kubernetes or Helm commands`,kind:`command`,pattern:String.raw`\b(kubectl|helm)\b`},{name:`Terraform apply, destroy or state changes`,kind:`command`,pattern:String.raw`\bterraform\s+(apply|destroy|import|state\s+(rm|mv|push))\b`},{name:`Pulumi up, destroy or refresh`,kind:`command`,pattern:String.raw`\bpulumi\s+(up|destroy|refresh)\b`},{name:`Cloud CLI commands (aws, az, gcloud) that are not read-only`,kind:`command`,pattern:String.raw`\b(aws|az|gcloud)\b(?![^|;&]*\b(describe|list|get|show|ls|version|help)\b)`},{name:`Publishing to npm`,kind:`command`,pattern:String.raw`\bnpm\s+publish\b`},{name:`Pushing a container image`,kind:`command`,pattern:String.raw`\b(docker|podman)\s+push\b`},{name:`Pushing to main or master, or force-pushing`,kind:`command`,pattern:String.raw`\bgit\s+(?:-[Cc]\s+\S+\s+)*push\b[^|;&]*(\s--force\b|\s-f\b|\s--force-with-lease\b|\bmain\b|\bmaster\b)`},{name:`Elevated commands with gsudo or sudo`,kind:`command`,pattern:E},{name:`Starting a program as administrator (-Verb RunAs, runas)`,kind:`command`,pattern:D},{name:`.env files`,kind:`path`,pattern:String.raw`(^|[\\/])\.env(\.[^\\/]*)?$`},{name:`Files named like credentials`,kind:`path`,pattern:String.raw`credentials`},{name:`Key and certificate files (.pem, .key, .p12, .pfx)`,kind:`path`,pattern:String.raw`\.(pem|key|p12|pfx)$`}];function A(e,t){return ee.find(n=>n.kind===t&&n.pattern===e)?.name}function j(e,t){return ee.filter(n=>!(n.kind===`command`?e:t).includes(n.pattern))}function M(e){let t=j(e.commandPatterns,e.pathPatterns);return{...e,commandPatterns:[...e.commandPatterns,...t.filter(e=>e.kind===`command`).map(e=>e.pattern)],pathPatterns:[...e.pathPatterns,...t.filter(e=>e.kind===`path`).map(e=>e.pattern)]}}var te=[`Blocks a finished PR`,`Blocks a card from Ready`,`Process`,`Housekeeping`,`Record only`],N=`Accepted.`,P=`Changes needed:`;function ne(e,t){let n=t.trim();return e===`accept`?{answer:n?`${N}\n\n${n}`:N}:n?{answer:`${P} ${n}`}:{problem:`Say what needs changing in the box first.`}}var re=/\s*\(recommended\)\s*$/i,ie=e=>e.replace(/\*\*|`/g,``);function ae(e){let t=e.match(/^\*\*(.+?)\*\*[.:]?\s*([\s\S]*)$/);return t?{label:t[1].replace(/\.$/,``),detail:t[2].trim()}:{label:e,detail:``}}function oe(e){return`${e.key} — ${ie(ae(e.text).label)}`}function se(e,t){if(e?.trim())return e;let n=[];if(t.review){let e=t.review;return t.title&&n.push(`**Review: ${t.title}**`),n.push(`**What we were solving**\n\n${e.solving}`,`**What was done**\n\n${e.done}`),e.notes&&n.push(`**Notes**\n\n${e.notes}`),e.evidence?.length&&n.push(`**Evidence**\n\n${e.evidence.map(e=>`- ${e.caption} (\`${e.file.replace(/`/g,`'`)}\`)`).join(`
|
|
8
|
+
`+e.stack}}var Fe=Object.prototype.hasOwnProperty,Ie=t.unstable_scheduleCallback,Le=t.unstable_cancelCallback,Re=t.unstable_shouldYield,ze=t.unstable_requestPaint,Be=t.unstable_now,Ve=t.unstable_getCurrentPriorityLevel,He=t.unstable_ImmediatePriority,Ue=t.unstable_UserBlockingPriority,We=t.unstable_NormalPriority,Ge=t.unstable_LowPriority,Ke=t.unstable_IdlePriority,qe=t.log,Je=t.unstable_setDisableYieldValue,Ye=null,Xe=null;function Ze(e){if(typeof qe==`function`&&Je(e),Xe&&typeof Xe.setStrictMode==`function`)try{Xe.setStrictMode(Ye,e)}catch{}}var Qe=Math.clz32?Math.clz32:tt,$e=Math.log,et=Math.LN2;function tt(e){return e>>>=0,e===0?32:31-($e(e)/et|0)|0}var nt=256,rt=262144,it=4194304;function at(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 ot(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=at(n))):i=at(o):i=at(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=at(n))):i=at(o)):i=at(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 st(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ct(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-Qe(n),i=1<<r;t|=e[r],n&=~i}return t}function lt(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 ut(){var e=it;return it<<=1,!(it&62914560)&&(it=4194304),e}function dt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ft(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(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-Qe(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&&mt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function mt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Qe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function ht(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Qe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function gt(e,t){var n=t&-t;return n=n&42?1:_t(n),(n&(e.suspendedLanes|t))===0?n:0}function _t(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 vt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function yt(){var e=I.p;return e===0?(e=window.event,e===void 0?32:Ch(e.type)):e}function bt(e,t){var n=I.p;try{return I.p=e,t()}finally{I.p=n}}var xt=Math.random().toString(36).slice(2),St=`__reactFiber$`+xt,Ct=`__reactProps$`+xt,wt=`__reactContainer$`+xt,Tt=`__reactEvents$`+xt,Et=`__reactListeners$`+xt,Dt=`__reactHandles$`+xt,Ot=`__reactResources$`+xt,kt=`__reactMarker$`+xt,At=`__reactLoad$`+xt;function jt(e){delete e[St],delete e[Ct],delete e[Et],delete e[Dt]}function Mt(e){var t;if(t=e[St])return t;for(var n=e.parentNode;n;){if(t=n[wt]||n[St]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=fm(e);e!==null;){if(n=e[St])return n;e=fm(e)}return t}e=n,n=e.parentNode}return null}function Nt(e){if(e=e[St]||e[wt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function Ft(e){var t=e[Ot];return t||=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map},t}function It(e){e[kt]=!0}function Lt(e){e[At]=void 0}var Rt=new Set,zt={};function Bt(e,t){Vt(e,t),Vt(e+`Capture`,t)}function Vt(e,t){for(zt[e]=t,e=0;e<t.length;e++)Rt.add(t[e])}var Ht=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]*$`),Ut={},Wt={};function Gt(e){return Fe.call(Wt,e)?!0:Fe.call(Ut,e)?!1:Ht.test(e)?Wt[e]=!0:(Ut[e]=!0,!1)}var z=!1;function Kt(){var e=z;return z=!1,e}function qt(e,t,n){if(Gt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Jt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Yt(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 Xt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Zt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Qt(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 $t(e){if(!e._valueTracker){var t=Zt(e)?`checked`:`value`;e._valueTracker=Qt(e,t,``+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Zt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var tn=/[\n"\\]/g;function nn(e){return e.replace(tn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function rn(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=``+Xt(t)):e.value!==``+Xt(t)&&(e.value=``+Xt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):on(e,Xt(n)):o===`number`&&e.value==t?on(e,Xt(e.value)):on(e,Xt(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=``+Xt(s):e.removeAttribute(`name`)}function an(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)){$t(e);return}n=n==null?``:``+Xt(n),t=t==null?n:``+Xt(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),$t(e)}function on(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function sn(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=``+Xt(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 cn(e,t,n){t!=null&&(t=``+Xt(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+Xt(n)}function ln(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(he(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Xt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),$t(e)}function un(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dn=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 fn(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||dn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function pn(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]=``,z=!0);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&(fn(e,a,r),z=!0)}else for(var o in t)t.hasOwnProperty(o)&&fn(e,o,t[o])}function mn(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 hn=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`]]),gn=/^[\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 _n(e){return gn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function vn(){}var B=null;function yn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var V=null,bn=null;function xn(e){var t=Nt(e);if(t&&(e=t.stateNode)){var n=e[Ct]||null;a:switch(e=t.stateNode,t.type){case`input`:if(rn(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="`+nn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Ct]||null;if(!a)throw Error(i(90));rn(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&&en(r)}break a;case`textarea`:cn(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&sn(e,!!n.multiple,t,!1)}}}var Sn=!1;function Cn(e,t,n){if(Sn)return e(t,n);Sn=!0;try{return e(t)}finally{if(Sn=!1,(V!==null||bn!==null)&&(Ld(),V&&(t=V,e=bn,bn=V=null,xn(t),e)))for(t=0;t<e.length;t++)xn(e[t])}}function wn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Ct]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var Tn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,En=!1;if(Tn)try{var Dn={};Object.defineProperty(Dn,"passive",{get:function(){En=!0}}),window.addEventListener(`test`,Dn,Dn),window.removeEventListener(`test`,Dn,Dn)}catch{En=!1}var On=null,kn=null,An=null;function jn(){if(An)return An;var e,t=kn,n=t.length,r,i=`value`in On?On.value:On.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 An=i.slice(e,1<r?1-r:void 0)}function Mn(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 Nn(){return!0}function Pn(){return!1}function Fn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Nn:Pn,this.isPropagationStopped=Pn,this}return D(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=Nn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Nn)},persist:function(){},isPersistent:Nn}),t}var In={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ln=Fn(In),Rn=D({},In,{view:0,detail:0}),zn=Fn(Rn),Bn,Vn,Hn,Un=D({},Rn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:H,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!==Hn&&(Hn&&e.type===`mousemove`?(Bn=e.screenX-Hn.screenX,Vn=e.screenY-Hn.screenY):Vn=Bn=0,Hn=e),Bn)},movementY:function(e){return`movementY`in e?e.movementY:Vn}}),Wn=Fn(Un),Gn=Fn(D({},Un,{dataTransfer:0})),Kn=Fn(D({},Rn,{relatedTarget:0})),qn=Fn(D({},In,{animationName:0,elapsedTime:0,pseudoElement:0})),Jn=Fn(D({},In,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Yn=Fn(D({},In,{data:0})),Xn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Zn={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`},Qn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function $n(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Qn[e])?!!t[e]:!1}function H(){return $n}var er=Fn(D({},Rn,{key:function(e){if(e.key){var t=Xn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Mn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:H,charCode:function(e){return e.type===`keypress`?Mn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Mn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),tr=Fn(D({},Un,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),U=Fn(D({},In,{submitter:0})),nr=Fn(D({},Rn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:H})),rr=Fn(D({},In,{propertyName:0,elapsedTime:0,pseudoElement:0})),ir=Fn(D({},Un,{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})),ar=Fn(D({},In,{newState:0,oldState:0,source:0})),or=[9,13,27,32],sr=Tn&&`CompositionEvent`in window,cr=null;Tn&&`documentMode`in document&&(cr=document.documentMode);var lr=Tn&&`TextEvent`in window&&!cr,ur=Tn&&(!sr||cr&&8<cr&&11>=cr),dr=` `,fr=!1;function pr(e,t){switch(e){case`keyup`:return or.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function mr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var hr=!1;function gr(e,t){switch(e){case`compositionend`:return mr(t);case`keypress`:return t.which===32?(fr=!0,dr):null;case`textInput`:return e=t.data,e===dr&&fr?null:e;default:return null}}function _r(e,t){if(hr)return e===`compositionend`||!sr&&pr(e,t)?(e=jn(),An=kn=On=null,hr=!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 ur&&t.locale!==`ko`?null:t.data;default:return null}}var vr={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 yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!vr[e.type]:t===`textarea`}function br(e,t,n,r){V?bn?bn.push(r):bn=[r]:V=r,t=qf(t,`onChange`),0<t.length&&(n=new Ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var xr=null,Sr=null;function Cr(e){Bf(e,0)}function wr(e){if(en(Pt(e)))return e}function Tr(e,t){if(e===`change`)return t}var Er=!1;if(Tn){var Dr;if(Tn){var Or=`oninput`in document;if(!Or){var kr=document.createElement(`div`);kr.setAttribute(`oninput`,`return;`),Or=typeof kr.oninput==`function`}Dr=Or}else Dr=!1;Er=Dr&&(!document.documentMode||9<document.documentMode)}function Ar(){xr&&(xr.detachEvent(`onpropertychange`,jr),Sr=xr=null)}function jr(e){if(e.propertyName===`value`&&wr(Sr)){var t=[];br(t,Sr,e,yn(e)),Cn(Cr,t)}}function Mr(e,t,n){e===`focusin`?(Ar(),xr=t,Sr=n,xr.attachEvent(`onpropertychange`,jr)):e===`focusout`&&Ar()}function Nr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return wr(Sr)}function Pr(e,t){if(e===`click`)return wr(t)}function Fr(e,t){if(e===`input`||e===`change`)return wr(t)}function Ir(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Lr=typeof Object.is==`function`?Object.is:Ir;function Rr(e,t){if(Lr(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(!Fe.call(t,i)||!Lr(e[i],t[i]))return!1}return!0}function zr(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 Br(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Vr(e,t){var n=Br(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=Br(n)}}function Hr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ur(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=zr(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=zr(e.document)}return t}function Wr(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 Gr=Tn&&`documentMode`in document&&11>=document.documentMode,Kr=null,qr=null,Jr=null,Yr=!1;function Xr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Yr||Kr==null||Kr!==zr(r)||(r=Kr,`selectionStart`in r&&Wr(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}),Jr&&Rr(Jr,r)||(Jr=r,r=qf(qr,`onSelect`),0<r.length&&(t=new Ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Kr)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Qr={animationend:Zr(`Animation`,`AnimationEnd`),animationiteration:Zr(`Animation`,`AnimationIteration`),animationstart:Zr(`Animation`,`AnimationStart`),transitionrun:Zr(`Transition`,`TransitionRun`),transitionstart:Zr(`Transition`,`TransitionStart`),transitioncancel:Zr(`Transition`,`TransitionCancel`),transitionend:Zr(`Transition`,`TransitionEnd`)},$r={},ei={};Tn&&(ei=document.createElement(`div`).style,`AnimationEvent`in window||(delete Qr.animationend.animation,delete Qr.animationiteration.animation,delete Qr.animationstart.animation),`TransitionEvent`in window||delete Qr.transitionend.transition);function ti(e){if($r[e])return $r[e];if(!Qr[e])return e;var t=Qr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ei)return $r[e]=t[n];return e}var ni=ti(`animationend`),ri=ti(`animationiteration`),ii=ti(`animationstart`),ai=ti(`transitionrun`),oi=ti(`transitionstart`),si=ti(`transitioncancel`),ci=ti(`transitionend`),li=new Map,ui=`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(` `);ui.push(`scrollEnd`);function di(e,t){li.set(e,t),Bt(t,[e])}var fi=0;function pi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=vd.identifierPrefix;var n=fi++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function mi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Ed;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 hi(e,t){return e=mi(e),t=mi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var gi=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)},_i=[],vi=0,yi=0;function bi(){for(var e=vi,t=yi=vi=0;t<e;){var n=_i[t];_i[t++]=null;var r=_i[t];_i[t++]=null;var i=_i[t];_i[t++]=null;var a=_i[t];if(_i[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&&wi(n,i,a)}}function xi(e,t,n,r){_i[vi++]=e,_i[vi++]=t,_i[vi++]=n,_i[vi++]=r,yi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Si(e,t,n,r){return xi(e,t,n,r),Ti(e)}function Ci(e,t){return xi(e,null,null,t),Ti(e)}function wi(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-Qe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ti(e){if(50<Dd)throw Dd=0,Od=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Ei={};function Di(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 Oi(e,t,n,r){return new Di(e,t,n,r)}function ki(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,t){var n=e.alternate;return n===null?(n=Oi(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 ji(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 Mi(e,t,n,r,a,o){var s=0;if(r=e,typeof r==`function`)ki(r)&&(s=1);else if(typeof r==`string`)s=qm(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case oe:return e=Oi(31,n,t,a),e.elementType=oe,e.lanes=o,e;case A:return Ni(n.children,a,o,t);case j:s=8,a|=24;break;case M:return e=Oi(12,n,t,a|2),e.elementType=M,e.lanes=o,e;case ne:return e=Oi(13,n,t,a),e.elementType=ne,e.lanes=o,e;case re:return e=Oi(19,n,t,a),e.elementType=re,e.lanes=o,e;case se:case le:return e=a|32,e=Oi(30,n,t,e),e.elementType=le,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case N:s=10;break a;case te:s=9;break a;case P:s=11;break a;case ie:s=14;break a;case ae:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=Oi(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function Ni(e,t,n,r){return e=Oi(7,e,r,t),e.lanes=n,e}function Pi(e,t,n){return e=Oi(6,e,null,t),e.lanes=n,e}function Fi(e){var t=Oi(18,null,null,0);return t.stateNode=e,t}function Ii(e,t,n){return t=Oi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Li=new WeakMap;function Ri(e,t){if(typeof e==`object`&&e){var n=Li.get(e);return n===void 0?(t={value:e,source:t,stack:R(t)},Li.set(e,t),t):n}return{value:e,source:t,stack:R(t)}}var W=[],G=0,K=null,zi=0,Bi=[],Vi=0,Hi=null,q=1,Ui=``;function Wi(e,t){W[G++]=zi,W[G++]=K,K=e,zi=t}function Gi(e,t,n){Bi[Vi++]=q,Bi[Vi++]=Ui,Bi[Vi++]=Hi,Hi=e;var r=q;e=Ui;var i=32-Qe(r)-1;r&=~(1<<i),n+=1;var a=32-Qe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,q=1<<32-Qe(t)+i|n<<i|r,Ui=a+e}else q=1<<a|n<<i|r,Ui=e}function Ki(e){e.return!==null&&(Wi(e,1),Gi(e,1,0))}function qi(e){for(;e===K;)K=W[--G],W[G]=null,zi=W[--G],W[G]=null;for(;e===Hi;)Hi=Bi[--Vi],Bi[Vi]=null,Ui=Bi[--Vi],Bi[Vi]=null,q=Bi[--Vi],Bi[Vi]=null}function Ji(e,t){Bi[Vi++]=q,Bi[Vi++]=Ui,Bi[Vi++]=Hi,q=t.id,Ui=t.overflow,Hi=e}var Yi=null,Xi=null,J=!1,Zi=null,Qi=!1,$i=Error(i(519));function ea(e){throw oa(Ri(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),$i}function ta(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[St]=e,t[Ct]=r,n){case`dialog`:$(`cancel`,t),$(`close`,t);break;case`iframe`:case`object`:case`embed`:$(`load`,t);break;case`video`:case`audio`:for(n=0;n<Rf.length;n++)$(Rf[n],t);break;case`source`:$(`error`,t);break;case`img`:case`image`:case`link`:$(`error`,t),$(`load`,t);break;case`details`:$(`toggle`,t);break;case`input`:$(`invalid`,t),an(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:$(`invalid`,t);break;case`textarea`:$(`invalid`,t),ln(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||$f(t.textContent,n)?(r.popover!=null&&($(`beforetoggle`,t),$(`toggle`,t)),r.onScroll!=null&&$(`scroll`,t),r.onScrollEnd!=null&&$(`scrollend`,t),r.onClick!=null&&(t.onclick=vn),t=!0):t=!1,t||ea(e,!0)}function na(e){for(Yi=e.return;Yi;)switch(Yi.tag){case 5:case 31:case 13:Qi=!1;return;case 27:case 3:Qi=!0;return;default:Yi=Yi.return}}function ra(e){if(e!==Yi)return!1;if(!J)return na(e),J=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||pp(e.type,e.memoizedProps)),n=!n),n&&Xi&&ea(e),na(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Xi=dm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Xi=dm(e)}else t===27?(t=Xi,Sp(e.type)?(e=um,um=null,Xi=e):Xi=t):Xi=Yi?lm(e.stateNode.nextSibling):null;return!0}function ia(){Xi=Yi=null,J=!1}function aa(){var e=Zi;return e!==null&&(ud===null?ud=e:ud.push.apply(ud,e),Zi=null),e}function oa(e){Zi===null?Zi=[e]:Zi.push(e)}var sa=ye(null),ca=null,la=null;function ua(e,t,n){xe(sa,t._currentValue),t._currentValue=n}function da(e){e._currentValue=sa.current,be(sa)}function fa(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 pa(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),fa(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),fa(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),fa(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 ma(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;Lr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===Te.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[sh]:e.push(sh))}a=a.return}return e!==null&&pa(t,e,n,r),t.flags|=262144,e!==null}function ha(e){for(e=e.firstContext;e!==null;){if(!Lr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ga(e){ca=e,la=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function _a(e){return ya(ca,e)}function va(e,t){return ca===null&&ga(e),ya(e,t)}function ya(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},la===null){if(e===null)throw Error(i(308));la=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else la=la.next=t;return n}var ba=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()})}},xa=t.unstable_scheduleCallback,Sa=t.unstable_NormalPriority,Ca={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wa(){return{controller:new ba,data:new Map,refCount:0}}function Ta(e){e.refCount--,e.refCount===0&&xa(Sa,function(){e.controller.abort()})}function Ea(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 Da=null;function Oa(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var ka=null,Aa=0,ja=0,Ma=null;function Na(e,t){if(ka===null){var n=ka=[];Aa=0,ja=Nf(),Ma={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Aa++,t.then(Pa,Pa),t}function Pa(){if(--Aa===0&&(Da=null,ka!==null)){Ma!==null&&(Ma.status=`fulfilled`);var e=ka;ka=null,ja=0,Ma=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Fa(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 Ia=F.S;F.S=function(e,t){if(pd=Be(),typeof t==`object`&&t&&typeof t.then==`function`&&Na(e,t),Da!==null)for(var n=yf;n!==null;)Ea(n,Da),n=n.next;if(n=e.types,n!==null){for(var r=yf;r!==null;)Ea(r,n),r=r.next;if(ja!==0){r=Da,r===null&&(r=Da=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Ia!==null&&Ia(e,t)};var La=ye(null);function Ra(){var e=La.current;return e===null?Xu.pooledCache:e}function za(e,t){t===null?xe(La,La.current):xe(La,t.pool)}function Ba(){var e=Ra();return e===null?null:{parent:Ca._currentValue,pool:e}}var Va=Error(i(460)),Ha=Error(i(474)),Ua=Error(i(542)),Wa={then:function(){}};function Ga(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ka(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(vn,vn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Xa(e),e===void 0&&!(`reason`in t)?Error(i(600)):e;default:if(typeof t.status==`string`)t.then(vn,vn);else{if(e=Xu,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,Xa(e),e}throw Ja=t,Va}}function qa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ja=e,Va):e}}var Ja=null;function Ya(){if(Ja===null)throw Error(i(459));var e=Ja;return Ja=null,e}function Xa(e){if(e===Va||e===Ua)throw Error(i(483))}var Za=null,Qa=0;function $a(e){var t=Qa;return Qa+=1,Za===null&&(Za=[]),Ka(Za,e,t)}function eo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function to(e,t){throw t.$$typeof===O?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function no(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=Ai(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=Pi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===A?(e=d(e,t,n.props.children,r,n.key),eo(e,n),e):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===ae&&qa(i)===t.type)?(t=a(t,n.props),eo(t,n),t.return=e,t):(t=Mi(n.type,n.key,n.props,null,e.mode,r),eo(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=Ii(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=Ni(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=Pi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case k:return n=Mi(t.type,t.key,t.props,null,e.mode,n),eo(n,t),n.return=e,n;case ee:return t=Ii(t,e.mode,n),t.return=e,t;case ae:return t=qa(t),f(e,t,n)}if(he(t)||fe(t))return t=Ni(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,$a(t),n);if(t.$$typeof===N)return f(e,va(e,t),n);to(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 k:return n.key===i?l(e,t,n,r):null;case ee:return n.key===i?u(e,t,n,r):null;case ae:return n=qa(n),p(e,t,n,r)}if(he(n)||fe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,$a(n),r);if(n.$$typeof===N)return p(e,t,va(e,n),r);to(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 k:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case ee:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ae:return r=qa(r),m(e,t,n,r,i)}if(he(r)||fe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,$a(r),i);if(r.$$typeof===N)return m(e,t,n,va(t,r),i);to(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),J&&Wi(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 J&&Wi(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)}),J&&Wi(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),J&&Wi(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 J&&Wi(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)}),J&&Wi(a,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===A&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case k:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===A){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),eo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ae&&qa(l)===r.type){n(e,r.sibling),c=a(r,o.props),eo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===A?(c=Ni(o.props.children,e.mode,c,o.key),eo(c,o),c.return=e,e=c):(c=Mi(o.type,o.key,o.props,null,e.mode,c),eo(c,o),c.return=e,e=c)}return s(e);case ee: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=Ii(o,e.mode,c),c.return=e,e=c}return s(e);case ae:return o=qa(o),_(e,r,o,c)}if(he(o))return h(e,r,o,c);if(fe(o)){if(l=fe(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,$a(o),c);if(o.$$typeof===N)return _(e,r,va(e,o),c);to(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=Pi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Qa=0;var i=_(e,t,n,r);return Za=null,i}catch(t){if(t===Va||t===Ua)throw t;var a=Oi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var ro=no(!0),io=no(!1),ao=!1;function oo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(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 co(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function lo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ti(e),wi(e,null,n),t}return xi(e,r,t,n),Ti(e)}function uo(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,ht(e,n)}}function fo(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}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var po=!1;function mo(){if(po){var e=Ma;if(e!==null)throw e}}function ho(e,t,n,r){po=!1;var i=e.updateQueue;ao=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Q&f)===f:(r&f)===f){f!==0&&f===ja&&(po=!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=D({},d,f);break a;case 2:ao=!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),id|=o,e.lanes=o,e.memoizedState=d}}function go(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function _o(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)go(n[e],t)}var vo=ye(null),yo=ye(0);function bo(e,t){e=nd,xe(yo,e),xe(vo,t),nd=e|t.baseLanes}function xo(){xe(yo,nd),xe(vo,vo.current)}function So(){nd=yo.current,be(vo),be(yo)}var Co=ye(null),wo=null;function To(e){var t=e.alternate;xe(Ao,Ao.current&1),xe(Co,e),wo===null&&(t===null||vo.current!==null||t.memoizedState!==null)&&(wo=e)}function Eo(e){xe(Ao,Ao.current),xe(Co,e),wo===null&&(wo=e)}function Do(e){e.tag===22?(xe(Ao,Ao.current),xe(Co,e),wo===null&&(wo=e)):Oo()}function Oo(){xe(Ao,Ao.current),xe(Co,Co.current)}function ko(e){be(Co),wo===e&&(wo=null),be(Ao)}var Ao=ye(0);function jo(e,t){xe(Co,Co.current),xe(Ao,t)}function Mo(e){be(Ao),be(Co),wo===e&&(wo=null)}function No(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||om(n)||sm(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 Po=0,Y=null,Fo=null,Io=null,Lo=!1,Ro=!1,zo=!1,Bo=0,Vo=0,Ho=null,Uo=0;function Wo(){throw Error(i(321))}function Go(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function Ko(e,t,n,r,i,a){return Po=a,Y=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,F.H=e===null||e.memoizedState===null?lc:uc,zo=!1,a=n(r,i),zo=!1,Ro&&(a=Jo(t,n,r,i)),qo(e),a}function qo(e){F.H=cc;var t=Fo!==null&&Fo.next!==null;if(Po=0,Io=Fo=Y=null,Lo=!1,Vo=0,Ho=null,t)throw Error(i(300));e===null||Dc||(e=e.dependencies,e!==null&&ha(e)&&(Dc=!0))}function Jo(e,t,n,r){Y=e;var a=0;do{if(Ro&&(Ho=null),Vo=0,Ro=!1,25<=a)throw Error(i(301));if(a+=1,Io=Fo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}F.H=dc,o=t(n,r)}while(Ro);return o}function Yo(){var e=F.H,t=e.useState()[0];return t=typeof t.then==`function`?ns(t):t,e=e.useState()[0],(Fo===null?null:Fo.memoizedState)!==e&&(Y.flags|=1024),t}function Xo(){var e=Bo!==0;return Bo=0,e}function Zo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Qo(e){if(Lo){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Lo=!1}Po=0,Io=Fo=Y=null,Ro=!1,Vo=Bo=0,Ho=null}function $o(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Io===null?Y.memoizedState=Io=e:Io=Io.next=e,Io}function es(){if(Fo===null){var e=Y.alternate;e=e===null?null:e.memoizedState}else e=Fo.next;var t=Io===null?Y.memoizedState:Io.next;if(t!==null)Io=t,Fo=e;else{if(e===null)throw Y.alternate===null?Error(i(467)):Error(i(310));Fo=e,e={memoizedState:Fo.memoizedState,baseState:Fo.baseState,baseQueue:Fo.baseQueue,queue:Fo.queue,next:null},Io===null?Y.memoizedState=Io=e:Io=Io.next=e}return Io}function ts(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ns(e){var t=Vo;return Vo+=1,Ho===null&&(Ho=[]),e=Ka(Ho,e,t),t=Y,(Io===null?t.memoizedState:Io.next)===null&&(t=t.alternate,F.H=t===null||t.memoizedState===null?lc:uc),e}function rs(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return ns(e);if(e.$$typeof===ue)return;if(e.$$typeof===N)return _a(e)}throw Error(i(438,String(e)))}function is(e){var t=null,n=Y.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=Y.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=ts(),Y.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]=ce;return t.index++,n}function as(e,t){return typeof t==`function`?t(e):t}function os(e){return ss(es(),Fo,e)}function ss(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?(Po&f)===f:(Q&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ja&&(d=!0);else if((Po&p)===p){u=u.next,p===ja&&(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,Y.lanes|=p,id|=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,Y.lanes|=f,id|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Lr(o,e.memoizedState)&&(Dc=!0,d&&(n=Ma,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 cs(e){var t=es(),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);Lr(o,t.memoizedState)||(Dc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ls(e,t,n){var r=Y,a=es(),o=J;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Lr((Fo||a).memoizedState,n);if(s&&(a.memoizedState=n,Dc=!0),a=a.queue,Ps(fs.bind(null,r,a,e),[e]),e=a.getSnapshot!==t||s||Io!==null&&!!(Io.memoizedState.tag&1),ks(e?9:8,{destroy:void 0},ds.bind(null,r,a,n,t),null),e){if(r.flags|=2048,Xu===null)throw Error(i(349));o||Po&127||us(r,t,n)}return n}function us(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Y.updateQueue,t===null?(t=ts(),Y.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ds(e,t,n,r){t.value=n,t.getSnapshot=r,ps(t)&&ms(e)}function fs(e,t,n){return n(function(){ps(t)&&ms(e)})}function ps(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function ms(e){var t=Ci(e,2);t!==null&&Md(t,e,2)}function hs(e){var t=$o();if(typeof e==`function`){var n=e;if(e=n(),zo){Ze(!0);try{n()}finally{Ze(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:e},t}function gs(e,t,n,r){return e.baseState=n,ss(e,Fo,typeof r==`function`?r:as)}function _s(e,t,n,r,a){if(ac(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)}};F.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,vs(t,o)):(o.next=n.next,t.pending=n.next=o)}}function vs(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=F.T,o={};o.types=a===null?null:a.types,F.T=o;try{var s=n(i,r),c=F.S;c!==null&&c(o,s),ys(e,t,s)}catch(n){xs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),F.T=a}}else try{a=n(i,r),ys(e,t,a)}catch(n){xs(e,t,n)}}function ys(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){bs(e,t,n)},function(n){return xs(e,t,n)}):bs(e,t,n)}function bs(e,t,n){t.status=`fulfilled`,t.value=n,Ss(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,vs(e,n)))}function xs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ss(t),t=t.next;while(t!==r)}e.action=null}function Ss(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Cs(e,t){return t}function ws(e,t){if(J){var n=Xu.formState;if(n!==null){a:{var r=Y;if(J){if(Xi){b:{for(var i=Xi,a=Qi;i.nodeType!==8;)if(!a||(i=lm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Xi=lm(i.nextSibling),r=i.data===`F!`;break a}}ea(r)}r=!1}r&&(t=n[0])}}return n=$o(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Cs,lastRenderedState:t},n.queue=r,n=nc.bind(null,Y,r),r.dispatch=n,r=hs(!1),a=ic.bind(null,Y,!1,r.queue),r=$o(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=_s.bind(null,Y,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ts(e){return Es(es(),Fo,e)}function Es(e,t,n){if(t=ss(e,t,Cs)[0],e=os(as)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=ns(t)}catch(e){throw e===Va?Ua:e}else r=t;t=es();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(Y.flags|=2048,ks(9,{destroy:void 0},Ds.bind(null,i,n),null)),[r,a,e]}function Ds(e,t){e.action=t}function Os(e){var t=es(),n=Fo;if(n!==null)return Es(t,n,e);es(),t=t.memoizedState,n=es();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ks(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=Y.updateQueue,t===null&&(t=ts(),Y.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 As(){return es().memoizedState}function js(e,t,n,r){var i=$o();Y.flags|=e,i.memoizedState=ks(1|t,{destroy:void 0},n,r===void 0?null:r)}function Ms(e,t,n,r){var i=es();r=r===void 0?null:r;var a=i.memoizedState.inst;Fo!==null&&r!==null&&Go(r,Fo.memoizedState.deps)?i.memoizedState=ks(t,a,n,r):(Y.flags|=e,i.memoizedState=ks(1|t,a,n,r))}function Ns(e,t){js(8390656,8,e,t)}function Ps(e,t){Ms(2048,8,e,t)}function Fs(e){Y.flags|=4;var t=Y.updateQueue;if(t===null)t=ts(),Y.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Is(e){var t=es().memoizedState;return Fs({ref:t,nextImpl:e}),function(){if(X&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function Ls(e,t){return Ms(4,2,e,t)}function Rs(e,t){return Ms(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 Bs(e,t,n){n=n==null?null:n.concat([e]),Ms(4,4,zs.bind(null,t,e),n)}function Vs(){}function Hs(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Go(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Us(e,t){var n=es();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Go(t,r[1]))return r[0];if(r=e(),zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r}function Ws(e,t,n){return n===void 0||Po&1073741824&&!(Q&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ad(),Y.lanes|=e,id|=e,n)}function Gs(e,t,n,r){return Lr(n,t)?n:vo.current===null?!(Po&106)||Po&1073741824&&!(Q&261930)?(Dc=!0,e.memoizedState=n):(e=Ad(),Y.lanes|=e,id|=e,t):(e=Ws(e,n,r),Lr(e,t)||(Dc=!0),e)}function Ks(e,t,n,r,i){var a=I.p;I.p=a!==0&&8>a?a:8;var o=F.T,s={};s.types=o===null?null:o.types,F.T=s,ic(e,!1,t,n);try{var c=i(),l=F.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?rc(e,t,Fa(c,r),kd(e)):rc(e,t,r,kd(e))}catch(n){rc(e,t,{then:function(){},status:`rejected`,reason:n},kd())}finally{I.p=a,o!==null&&s.types!==null&&(o.types=s.types),F.T=o}}function qs(){}function Js(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Ys(e).queue;Ks(e,a,t,ge,n===null?qs:function(){return Xs(e),n(r)})}function Ys(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ge,baseState:ge,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:ge},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:as,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Xs(e){var t=Ys(e);t.next===null&&(t=e.alternate.memoizedState),rc(e,t.next.queue,{},kd())}function Zs(){return _a(sh)}function Qs(){return es().memoizedState}function $s(){return es().memoizedState}function ec(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=kd();e=co(n);var r=lo(t,e,n);r!==null&&(Md(r,t,n),uo(r,t,n)),t={cache:wa()},e.payload=t;return}t=t.return}}function tc(e,t,n){var r=kd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ac(e)?oc(t,n):(n=Si(e,t,n,r),n!==null&&(Md(n,e,r),sc(n,t,r)))}function nc(e,t,n){rc(e,t,n,kd())}function rc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(ac(e))oc(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,Lr(s,o))return xi(e,t,i,0),Xu===null&&bi(),!1}catch{}if(n=Si(e,t,i,r),n!==null)return Md(n,e,r),sc(n,t,r),!0}return!1}function ic(e,t,n,r){if(r={lane:2,revertLane:Nf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ac(e)){if(t)throw Error(i(479))}else t=Si(e,n,r,2),t!==null&&Md(t,e,2)}function ac(e){var t=e.alternate;return e===Y||t!==null&&t===Y}function oc(e,t){Ro=Lo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function sc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ht(e,n)}}var cc={readContext:_a,use:rs,useCallback:Wo,useContext:Wo,useEffect:Wo,useImperativeHandle:Wo,useLayoutEffect:Wo,useInsertionEffect:Wo,useMemo:Wo,useReducer:Wo,useRef:Wo,useState:Wo,useDebugValue:Wo,useDeferredValue:Wo,useTransition:Wo,useSyncExternalStore:Wo,useId:Wo,useHostTransitionStatus:Wo,useFormState:Wo,useActionState:Wo,useOptimistic:Wo,useMemoCache:Wo,useCacheRefresh:Wo,useEffectEvent:Wo},lc={readContext:_a,use:rs,useCallback:function(e,t){return $o().memoizedState=[e,t===void 0?null:t],e},useContext:_a,useEffect:Ns,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),js(4194308,4,zs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return js(4194308,4,e,t)},useInsertionEffect:function(e,t){js(4,2,e,t)},useMemo:function(e,t){var n=$o();t=t===void 0?null:t;var r=e();if(zo){Ze(!0);try{e()}finally{Ze(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=$o();if(n!==void 0){var i=n(t);if(zo){Ze(!0);try{n(t)}finally{Ze(!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=tc.bind(null,Y,e),[r.memoizedState,e]},useRef:function(e){var t=$o();return e={current:e},t.memoizedState=e},useState:function(e){e=hs(e);var t=e.queue,n=nc.bind(null,Y,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Vs,useDeferredValue:function(e,t){return Ws($o(),e,t)},useTransition:function(){var e=hs(!1);return e=Ks.bind(null,Y,e.queue,!0,!1),$o().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=Y,a=$o();if(J){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Xu===null)throw Error(i(349));Q&127||us(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,Ns(fs.bind(null,r,o,e),[e]),r.flags|=2048,ks(9,{destroy:void 0},ds.bind(null,r,o,n,t),null),n},useId:function(){var e=$o(),t=Xu.identifierPrefix;if(J){var n=Ui,r=q;n=(r&~(1<<32-Qe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Bo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Uo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Zs,useFormState:ws,useActionState:ws,useOptimistic:function(e){var t=$o();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ic.bind(null,Y,!0,n),n.dispatch=t,[e,t]},useMemoCache:is,useCacheRefresh:function(){return $o().memoizedState=ec.bind(null,Y)},useEffectEvent:function(e){var t=$o(),n={impl:e};return t.memoizedState=n,function(){if(X&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},uc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:os,useRef:As,useState:function(){return os(as)},useDebugValue:Vs,useDeferredValue:function(e,t){return Gs(es(),Fo.memoizedState,e,t)},useTransition:function(){var e=os(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Ts,useActionState:Ts,useOptimistic:function(e,t){return gs(es(),Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is},dc={readContext:_a,use:rs,useCallback:Hs,useContext:_a,useEffect:Ps,useImperativeHandle:Bs,useInsertionEffect:Ls,useLayoutEffect:Rs,useMemo:Us,useReducer:cs,useRef:As,useState:function(){return cs(as)},useDebugValue:Vs,useDeferredValue:function(e,t){var n=es();return Fo===null?Ws(n,e,t):Gs(n,Fo.memoizedState,e,t)},useTransition:function(){var e=cs(as)[0],t=es().memoizedState;return[typeof e==`boolean`?e:ns(e),t]},useSyncExternalStore:ls,useId:Qs,useHostTransitionStatus:Zs,useFormState:Os,useActionState:Os,useOptimistic:function(e,t){var n=es();return Fo===null?(n.baseState=e,[e,n.queue.dispatch]):gs(n,Fo,e,t)},useMemoCache:is,useCacheRefresh:$s,useEffectEvent:Is};function fc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:D({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=kd(),i=co(r);i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Md(t,e,r),uo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=kd(),i=co(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=lo(e,i,r),t!==null&&(Md(t,e,r),uo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=kd(),r=co(n);r.tag=2,t!=null&&(r.callback=t),t=lo(e,r,n),t!==null&&(Md(t,e,n),uo(t,e,n))}};function mc(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?!Rr(n,r)||!Rr(i,a):!0}function hc(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&&pc.enqueueReplaceState(t,t.state,null)}function gc(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=D({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function _c(e){gi(e)}function vc(e){console.error(e)}function yc(e){gi(e)}function bc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function xc(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 Sc(e,t,n){return n=co(n),n.tag=3,n.payload={element:null},n.callback=function(){bc(e,t)},n}function Cc(e){return e=co(e),e.tag=3,e}function wc(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(){xc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){xc(t,n,r),typeof i!=`function`&&(gd===null?gd=new Set([this]):gd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Tc(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&ma(t,n,a,!0),n=Co.current,n!==null){switch(n.tag){case 31:case 13:case 19:return wo===null?Wd():n.alternate===null&&rd===0&&(rd=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Wa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),pf(e,r,a)),!1;case 22:return n.flags|=65536,r===Wa?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)),pf(e,r,a)),!1}throw Error(i(435,n.tag))}return pf(e,r,a),Wd(),!1}if(J)return t=Co.current,t===null?(r!==$i&&(t=Error(i(423),{cause:r}),oa(Ri(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=Ri(r,n),a=Sc(e.stateNode,r,a),fo(e,a),rd!==4&&(rd=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==$i&&(e=Error(i(422),{cause:r}),oa(Ri(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=Ri(o,n),ld===null?ld=[o]:ld.push(o),rd!==4&&(rd=2),t===null)return!0;r=Ri(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Sc(n.stateNode,r,e),fo(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`&&(gd===null||!gd.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Cc(a),wc(a,e,n,r),fo(n,a),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Ec=Error(i(461)),Dc=!1;function Oc(e,t,n,r){t.child=e===null?io(t,null,n,r):ro(t,e.child,n,r)}function kc(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 ga(t),r=Ko(e,t,n,o,a,i),s=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(J&&s&&Ki(t),t.flags|=1,Oc(e,t,r,i),t.child)}function Ac(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ki(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,jc(e,t,a,r,i)):(e=Mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!il(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Rr:n,n(o,r)&&e.ref===t.ref)return rl(e,t,i)}return t.flags|=1,e=Ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function jc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Rr(a,r)&&e.ref===t.ref){if(Dc=!1,t.pendingProps=r=a,il(e,i))e.flags&131072&&(Dc=!0);else return t.lanes=e.lanes,rl(e,t,i)}}return zc(e,t,n,r,i)}function Mc(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 Pc(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?xo():bo(t,a),Do(t);else return r=t.lanes=536870912,Pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&za(t,null),xo(),Oo()):(za(t,a.cachePool),bo(t,a),Oo(),t.memoizedState=null);return Oc(e,t,i,n),t.child}function Nc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Pc(e,t,n,r,i){var a=Ra();return a=a===null?null:{parent:Ca._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&za(t,null),xo(),Do(t),e!==null&&ma(e,t,r,!0),t.childLanes=i,null}function Fc(e,t){return t=Jc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Ic(e,t,n){return ro(t,e.child,null,n),e=Fc(t,t.pendingProps),e.flags|=2,ko(t),t.memoizedState=null,e}function Lc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(J){if(r.mode===`hidden`)return e=Fc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Nc(null,e);if(Eo(t),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:q,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Fc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Eo(t),a){if(t.flags&256)t.flags&=-257,t=Ic(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(Dc||ma(e,t,n,!1),a=(n&e.childLanes)!==0,Dc||a){if(vo.current===null){if(r=Xu,r!==null&&(s=gt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ci(e,s),Md(r,e,s),Ec;Wd()}t=Ic(e,t,n)}else e=o.treeContext,Xi=lm(s.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=Fc(t,r),t.flags|=134221824;return t}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Rc(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 ga(t),n=Ko(e,t,n,r,void 0,i),r=Xo(),e!==null&&!Dc?(Zo(e,t,i),rl(e,t,i)):(J&&r&&Ki(t),t.flags|=1,Oc(e,t,n,i),t.child)}function Bc(e,t,n,r,i,a){return ga(t),t.updateQueue=null,n=Jo(t,r,n,i),qo(e),r=Xo(),e!==null&&!Dc?(Zo(e,t,a),rl(e,t,a)):(J&&r&&Ki(t),t.flags|=1,Oc(e,t,n,a),t.child)}function Vc(e,t,n,r,i){if(ga(t),t.stateNode===null){var a=Ei,o=n.contextType;typeof o==`object`&&o&&(a=_a(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=pc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},oo(t),o=n.contextType,a.context=typeof o==`object`&&o?_a(o):Ei,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(fc(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&&pc.enqueueReplaceState(a,a.state,null),ho(t,r,a,i),mo(),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=gc(n,s);a.props=c;var l=a.context,u=n.contextType;o=Ei,typeof u==`object`&&u&&(o=_a(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)&&hc(t,a,r,o),ao=!1;var f=t.memoizedState;a.state=f,ho(t,r,a,i),mo(),l=t.memoizedState,s||f!==l||ao?(typeof d==`function`&&(fc(t,n,d,r),l=t.memoizedState),(c=ao||mc(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,so(e,t),o=t.memoizedProps,u=gc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Ei,typeof l==`object`&&l&&(c=_a(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)&&hc(t,a,r,c),ao=!1,f=t.memoizedState,a.state=f,ho(t,r,a,i),mo();var p=t.memoizedState;o!==d||f!==p||ao||e!==null&&e.dependencies!==null&&ha(e.dependencies)?(typeof s==`function`&&(fc(t,n,s,r),p=t.memoizedState),(u=ao||mc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&ha(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,Rc(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=ro(t,e.child,null,i),t.child=ro(t,null,n,i)):Oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=rl(e,t,i),e}function Hc(e,t,n,r){return ia(),t.flags|=256,Oc(e,t,n,r),t.child}var Uc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Wc(e){return{baseLanes:e,cachePool:Ba()}}function Gc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=sd),e}function Kc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ao.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(J){if(i?To(t):Oo(),(e=Xi)?(e=am(e,Qi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Hi===null?null:{id:q,overflow:Ui},retryLane:536870912,hydrationErrors:null},n=Fi(e),n.return=t,t.child=n,Yi=t,Xi=null)):e=null,e===null)throw ea(t);return t.lanes=sm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Oo(),i=t.mode,a=Jc({mode:`hidden`,children:a},i),r=Ni(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Wc(n),r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(null,r)):(To(t),qc(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return Xc(e,t,a,o,r,c,s,n)}return i?(Oo(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ai(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ni(i,a,n,null),i.flags|=2):i=Ai(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Nc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Wc(n):(a=i.cachePool,a===null?a=Ba():(s=Ca._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=Gc(e,o,n),t.memoizedState=Uc,Nc(e.child,r)):(To(t),n=e.child,e=n.sibling,n=Ai(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 qc(e,t){return t=Jc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Jc(e,t){return e=Oi(22,e,null,t),e.lanes=0,e}function Yc(e,t,n){return ro(t,e.child,null,n),e=qc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xc(e,t,n,r,a,o,s,c){if(n)return t.flags&256?(To(t),t.flags&=-257,Yc(e,t,c)):t.memoizedState===null?(Oo(),o=a.fallback,s=t.mode,a=Jc({mode:`visible`,children:a.children},s),o=Ni(o,s,c,null),o.flags|=2,a.return=t,o.return=t,a.sibling=o,t.child=a,ro(t,e.child,null,c),a=t.child,a.memoizedState=Wc(c),a.childLanes=Gc(e,r,c),t.memoizedState=Uc,Nc(null,a)):(Oo(),t.child=e.child,t.flags|=128,null);if(To(t),sm(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,oa({value:a,source:null,stack:null})),Yc(e,t,c)}if(Dc||ma(e,t,c,!1),r=(c&e.childLanes)!==0,Dc||r){if(vo.current!==null)return Yc(e,t,c);if(r=Xu,r!==null&&(a=gt(r,c),a!==0&&a!==s.retryLane))throw s.retryLane=a,Ci(e,a),Md(r,e,a),Ec;return om(o)||Wd(),Yc(e,t,c)}return om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,Xi=lm(o.nextSibling),Yi=t,J=!0,Zi=null,Qi=!1,e!==null&&Ji(t,e),t=qc(t,a.children),t.flags|=134221824,t)}function Zc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fa(e.return,t,n)}function Qc(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&No(n)===null&&(t=e),e=e.sibling}return t}function $c(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 el(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 tl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ao.current;if(t.flags&128)return jo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,jo(t,o),i===`backwards`&&e!==null?(el(e),Oc(e,t,r,n),el(e)):Oc(e,t,r,n),r=J?zi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zc(e,n,t);else if(e.tag===19)Zc(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=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,el(t)),$c(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&&No(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}$c(t,!0,n,null,a,r);break;case`together`:$c(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=Qc(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),$c(t,!1,i,n,a,r)}return t.child}function nl(e,t,n){var r=t.pendingProps;return ua(t,t.type,r.value),Oc(e,t,r.children,n),t.child}function rl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),id|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(ma(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=Ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function il(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&ha(e)))}function al(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),ua(t,Ca,e.memoizedState.cache),ia();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:ua(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Eo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return To(t),t.flags|=128,null;r=ma(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?Kc(e,t,n):(To(t),e=rl(e,t,n),e===null?null:e.sibling)}To(t);break;case 19:if(t.flags&128)return tl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(ma(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return tl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),jo(t,Ao.current),r)break;return null;case 22:return t.lanes=0,Mc(e,t,n,t.pendingProps);case 24:ua(t,Ca,e.memoizedState.cache)}return rl(e,t,n)}function ol(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Dc=!0;else{if(!il(e,n)&&!(t.flags&128))return Dc=!1,al(e,t,n);Dc=!!(e.flags&131072)}}else Dc=!1,J&&t.flags&1048576&&Gi(t,zi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=qa(t.elementType),t.type=e,typeof e==`function`)ki(e)?(r=gc(e,r),t.tag=1,t=Vc(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===P){t.tag=11,t=kc(null,t,e,r,n);break a}if(a===ie){t.tag=14,t=Ac(null,t,e,r,n);break a}if(a===N){t.tag=10,t.type=e,t=nl(null,t,n);break a}}throw t=me(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=gc(r,t.pendingProps),Vc(e,t,r,a,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,so(e,t),ho(t,r,null,n);var s=t.memoizedState;if(r=s.cache,ua(t,Ca,r),r!==o.cache&&pa(t,[Ca],n,!0),mo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Hc(e,t,r,n);break a}if(r!==a){a=Ri(Error(i(424)),t),oa(a),t=Hc(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(Xi=lm(e.firstChild),Yi=t,J=!0,Zi=null,Qi=!0,n=io(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(ia(),r===a){t=rl(e,t,n);break a}Oc(e,t,r,n)}t=t.child}return t;case 26:return Rc(e,t),e===null?(n=Nm(t.type,null,t.pendingProps,null))?t.memoizedState=n:J||(t.stateNode=fp(t.type,t.pendingProps,we.current,t)):t.memoizedState=Nm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&J&&(r=t.stateNode=hm(t.type,t.pendingProps,we.current),Yi=t,Qi=!0,a=Xi,Sp(t.type)?(um=a,Xi=lm(r.firstChild)):Xi=a),Oc(e,t,t.pendingProps.children,n),Rc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&J&&((a=r=Xi)&&(r=rm(r,t.type,t.pendingProps,Qi),r===null?a=!1:(t.stateNode=r,Yi=t,Xi=lm(r.firstChild),Qi=!1,a=!0)),a||ea(t)),Oe(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,pp(a,o)?r=null:s!==null&&pp(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=Ko(e,t,Yo,null,null,n),sh._currentValue=a),Rc(e,t),Oc(e,t,r,n),t.child;case 6:return e===null&&J&&((e=n=Xi)&&(n=im(n,t.pendingProps,Qi),n===null?e=!1:(t.stateNode=n,Yi=t,Xi=null,e=!0)),e||ea(t)),null;case 13:return Kc(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ro(t,null,r,n):Oc(e,t,r,n),t.child;case 11:return kc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Rc(e,t),Oc(e,t,r,n),t.child;case 8:return Oc(e,t,t.pendingProps.children,n),t.child;case 12:return Oc(e,t,t.pendingProps.children,n),t.child;case 10:return nl(e,t,n);case 9:return a=t.type._context,r=t.pendingProps.children,ga(t),a=_a(a),r=r(a),t.flags|=1,Oc(e,t,r,n),t.child;case 14:return Ac(e,t,t.type,t.pendingProps,n);case 15:return jc(e,t,t.type,t.pendingProps,n);case 19:return tl(e,t,n);case 31:return Lc(e,t,n);case 22:return Mc(e,t,n,t.pendingProps);case 24:return ga(t),r=_a(Ca),e===null?(a=Ra(),a===null&&(a=Xu,o=wa(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},oo(t),ua(t,Ca,a)):((e.lanes&n)!==0&&(so(e,t),ho(t,null,null,n),mo()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,ua(t,Ca,r),r!==a.cache&&pa(t,[Ca],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),ua(t,Ca,r))),Oc(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:J&&Ki(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Rc(e,t),Oc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function sl(e){e.flags|=4}function cl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?Jm(t,r):Jm(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(Vd())e.flags|=8192;else throw Ja=Wa,Ha}}else e.flags&=-16777217}function ll(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Ym(t)){if(Vd())e.flags|=8192;else throw Ja=Wa,Ha}}function ul(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ut(),e.lanes|=t,cd|=t)}function dl(e,t){if(!J)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 fl(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 pl(e,t,n){var r=t.pendingProps;switch(qi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fl(t),null;case 1:return fl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),da(Ca),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ra(t)?sl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,aa())),fl(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(sl(t),o===null?(fl(t),cl(t,a,null,r,n)):(fl(t),ll(t,o))):o?o===e.memoizedState?(fl(t),t.flags&=-16777217):(sl(t),fl(t),ll(t,o)):(e=e.memoizedProps,e!==r&&sl(t),fl(t),cl(t,a,e,r,n)),null;case 27:if(ke(t),n=we.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}e=Se.current,ra(t)?ta(t,e):(e=hm(a,r,n),t.stateNode=e,sl(t))}return fl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return fl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,ra(t))ta(t,o);else{var s=lp(we.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[St]=t,o[Ct]=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(np(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&&sl(t)}}return fl(t),t.subtreeFlags&=-33554433,cl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&sl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=we.current,ra(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Yi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[St]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||$f(e.nodeValue,n)),e||ea(t,!0)}else e=lp(e).createTextNode(r),e[St]=t,t.stateNode=e}return fl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ra(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[St]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),e=!1}else n=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ko(t),t):(ko(t),null);if(t.flags&128)throw Error(i(558))}return fl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=ra(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[St]=t}else ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;fl(t),a=!1}else a=aa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ko(t),t):(ko(t),null)}return ko(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),ul(t,t.updateQueue),fl(t),null);case 4:return De(),e===null&&Uf(t.stateNode.containerInfo),t.flags|=67108864,fl(t),null;case 10:return da(t.type),fl(t),null;case 19:if(Mo(t),r=t.memoizedState,r===null)return fl(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)dl(r,!1);else{if(rd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=No(e),o!==null){for(t.flags|=128,dl(r,!1),e=o.updateQueue,t.updateQueue=e,ul(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ji(n,e),n=n.sibling;return jo(t,Ao.current&1|2),J&&Wi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Be()>md&&(t.flags|=128,a=!0,dl(r,!1),t.lanes=4194304)}}else{if(!a){if(e=No(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,ul(t,e),dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!J)return fl(t),null}else 2*Be()-r.renderingStartTime>md&&n!==536870912&&(t.flags|=128,a=!0,dl(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=Be(),e.sibling=null,o=Ao.current,o=a?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||J?jo(t,o):(n=o,xe(Co,t),xe(Ao,n),wo===null&&(wo=t)),J&&Wi(t,r.treeForkCount),e}return fl(t),null;case 22:case 23:return ko(t),So(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(fl(t),t.subtreeFlags&6&&(t.flags|=8192)):fl(t),n=t.updateQueue,n!==null&&ul(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&&be(La),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),da(Ca),fl(t),null;case 25:return null;case 30:return t.flags|=33554432,fl(t),null}throw Error(i(156,t.tag))}function ml(e,t){switch(qi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return da(Ca),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(ko(t),t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Mo(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 De(),null;case 10:return da(t.type),null;case 22:case 23:return ko(t),So(),e!==null&&be(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return da(Ca),null;case 25:return null;default:return null}}function hl(e,t){switch(qi(t),t.tag){case 3:da(Ca),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&ko(t);break;case 13:ko(t);break;case 19:Mo(t);break;case 10:da(t.type);break;case 22:case 23:ko(t),So(),e!==null&&be(La);break;case 24:da(Ca)}}function gl(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){ff(t,t.return,e)}}function _l(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){ff(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){ff(t,t.return,e)}}function vl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{_o(t,n)}catch(t){ff(e,e.return,t)}}}function yl(e,t,n){n.props=gc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){ff(e,t,n)}}function bl(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=pi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Pp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Fp(e);m(e.child,!1,Qp,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){ff(e,t,n)}}function xl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){ff(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){ff(e,t,n)}else n.current=null}}function Sl(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++)em(e.stateNode,t[n])}function Cl(e){for(var t=e.return;t!==null&&(El(t)&&em(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function wl(e){for(var t=e.return;t!==null&&(El(t)&&tm(e.stateNode,t.stateNode),!Tl(t));)t=t.return}function Tl(e){return e.tag===5||e.tag===3||e.tag===27}function El(e){return e&&e.tag===7&&e.stateNode!==null}function Dl(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){ff(e,e.return,t)}}function Ol(e,t,n){try{var r=e.stateNode;ip(r,e.type,n,t),r[Ct]=t}catch(t){ff(e,e.return,t)}}function kl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Sp(e.type)||e.tag===4}function Al(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||kl(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&&Sp(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 jl(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=vn)),Sl(e,r),z=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(jl(e,t,n,r),e=e.sibling;e!==null;)jl(e,t,n,r),e=e.sibling}function Ml(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Sl(e,r),z=!0;else if(i!==4&&(i===27&&(Sl(e,r),r=null,Sp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Ml(e,t,n,r),e=e.sibling;e!==null;)Ml(e,t,n,r),e=e.sibling}function Nl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);np(t,r,n),t[St]=e,t[Ct]=n}catch(t){ff(e,e.return,t)}}var Pl=!1,Fl=null;function Il(e){(e.tag===30||e.subtreeFlags&33554432)&&(Pl=!0)}var Ll=null;function Rl(){var e=Ll;return Ll=null,e}var zl=0;function Bl(e,t,n,r,i){return zl=0,Vl(e.child,t,n,r,i)}function Vl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Op(o);r.push(s),s.view&&(a=!0)}else a||Op(o).view&&(a=!0);Pl=!0,Tp(o,zl===0?t:t+`_`+zl,n),zl++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Vl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Hl(e,t){for(;e!==null;)e.tag===5?Ep(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Hl(e.child,t)),e=e.sibling}function Ul(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Ul(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=hi(t.default,t.share),t!==`none`&&(Bl(e,n,t,null,!1)||Hl(e.child,!1))}e=e.sibling}}function Wl(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=pi(r,n),a=hi(r.default,n.paired?r.share:r.enter);a===`none`?Ul(e):Bl(e,i,a,null,!1)?(Ul(e),n.paired||t||jd(e,r.onEnter)):Hl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Wl(e,t),e=e.sibling;else Ul(e)}function Gl(e){if(Fl!==null&&Fl.size!==0){var t=Fl;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=hi(n.default,n.share);if(a!==`none`&&(Bl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,jd(e,n.onShare)):Hl(e.child,!1)),t.delete(r),t.size===0)break}}}Gl(e)}e=e.sibling}}}function Kl(e){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode),r=Fl===null?void 0:Fl.get(n),i=hi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Bl(e,n,i,null,!1)?r===void 0?jd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Fl.delete(n),jd(e,t.onShare)):Hl(e.child,!1)),Fl!==null&&Gl(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Kl(e),e=e.sibling;else Fl!==null&&Gl(e)}function ql(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pi(t,e.stateNode);t=hi(t.default,t.update),e.flags&=-5,t!==`none`&&Bl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&ql(e);e=e.sibling}}function Jl(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,Hl(e.child,!1))}Jl(e)}e=e.sibling}}function Yl(e){if(e.tag===30)e.stateNode.paired=null,Hl(e.child,!1),Jl(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Yl(e),e=e.sibling;else Jl(e)}function Xl(e){for(e=e.child;e!==null;)e.tag===30?Hl(e.child,!1):e.subtreeFlags&33554432&&Xl(e),e=e.sibling}function Zl(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&zl<a.length){var l=a[zl],u=Op(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&&Tp(c,zl===0?n:n+`_`+zl,i),s&&e.flags&4||(Ll===null&&(Ll=[]),Ll.push(c,zl===0?r:r+`_`+zl,t.memoizedProps)),zl++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:Zl(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function Ql(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=pi(n,r),a=hi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(kp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;zl=0,i=Zl(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||jd(e,n.onUpdate))}else e.subtreeFlags&33554432&&Ql(e,t);e=e.sibling}}var $l=!1,eu=!1,tu=!1,nu=!1,ru=typeof WeakSet==`function`?WeakSet:Set,iu=null,au=!1,ou=!1,su=!1,cu=!1;function lu(e,t,n){if(e=e.containerInfo,sp=gh,e=Ur(e),Wr(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(cp={focusedElem:e,selectionRange:r},gh=!1,n=(n&335544064)===n,iu=t,t=n?9270:1024;iu!==null;){if(e=iu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&Kl(r[a]);if(e.alternate===null&&e.flags&2)n&&Il(e),uu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&Kl(r),uu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Il(e),uu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,iu=r):(n&&ql(e),uu(n))}}Fl=null}function uu(e){for(;iu!==null;){var t=iu,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=gc(t.type,a);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){ff(t,t.return,e)}}break;case 3:if(a&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)nm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:nm(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=pi(r.memoizedProps,r.stateNode),a=t.memoizedProps,a=hi(a.default,a.update),a!==`none`&&Bl(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,iu=r;break}iu=t.return}}function du(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:ju(e,n),r&4&&gl(5,n);break;case 1:if(ju(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){ff(n,n.return,e)}else{var i=gc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){ff(n,n.return,e)}}}r&64&&vl(n),r&512&&bl(n,n.return);break;case 3:if(ju(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{_o(e,t)}catch(e){ff(n,n.return,e)}}break;case 27:t===null&&r&4&&Nl(n);case 26:case 5:ju(e,n),t===null&&r&4&&Dl(n),r&512&&bl(n,n.return);break;case 12:ju(e,n);break;case 31:ju(e,n),r&4&&bu(e,n);break;case 13:ju(e,n),r&4&&xu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=gf.bind(null,n),cm(e,n))));break;case 22:if(r=n.memoizedState!==null||$l,!r){var a=t!==null&&t.memoizedState!==null||eu;t=$l,i=eu,$l=r,(eu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Nu(e,n,r)):ju(e,n),$l=t,eu=i}break;case 30:ju(e,n),r&512&&bl(n,n.return);break;case 7:r&512&&bl(n,n.return);default:ju(e,n)}}function fu(e,t){for(e=e.child;e!==null;)pu(e,t),e=e.sibling}function pu(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){ff(e,e.return,t)}mu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,z=!0}catch(t){ff(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?wp(s,!0):wp(e.stateNode,!1)}catch(t){ff(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&fu(e,t);break;default:fu(e,t)}}function mu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:pu(n,r);break a;case 22:n.memoizedState===null&&mu(n,r);break a;default:mu(n,r)}}e=e.sibling}}function hu(e){var t=e.alternate;t!==null&&(e.alternate=null,hu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&jt(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 gu=null,_u=!1;function vu(e,t,n){for(n=n.child;n!==null;)yu(e,t,n),n=n.sibling}function yu(e,t,n){if(Xe&&typeof Xe.onCommitFiberUnmount==`function`)try{Xe.onCommitFiberUnmount(Ye,n)}catch{}switch(n.tag){case 26:eu||xl(n,t),vu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!eu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:eu||xl(n,t),wl(n);var r=gu,i=_u;Sp(n.type)&&(gu=n.stateNode,_u=!1),vu(e,t,n),gm(n.stateNode,n.type,n.memoizedProps),gu=r,_u=i;break;case 5:eu||xl(n,t),wl(n);case 6:if(n.tag===6&&wl(n),r=gu,i=_u,gu=null,vu(e,t,n),gu=r,_u=i,gu!==null){if(_u)try{(gu.nodeType===9?gu.body:gu.nodeName===`HTML`?gu.ownerDocument.body:gu).removeChild(n.stateNode),z=!0}catch(e){ff(n,t,e)}else try{gu.removeChild(n.stateNode),z=!0}catch(e){ff(n,t,e)}}break;case 18:gu!==null&&(_u?(e=gu,Cp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Hh(e)):Cp(gu,n.stateNode));break;case 4:r=gu,i=_u,gu=n.stateNode.containerInfo,_u=!0,vu(e,t,n),gu=r,_u=i;break;case 0:case 11:case 14:case 15:_l(2,n,t),eu||_l(4,n,t),vu(e,t,n);break;case 1:eu||(xl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&yl(n,t,r)),vu(e,t,n);break;case 21:vu(e,t,n);break;case 22:eu=(r=eu)||n.memoizedState!==null,vu(e,t,n),eu=r;break;case 30:xl(n,t),vu(e,t,n);break;case 7:eu||xl(n,t),vu(e,t,n);break;default:vu(e,t,n)}}function bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Hh(e)}catch(e){ff(t,t.return,e)}}}function xu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Hh(e)}catch(e){ff(t,t.return,e)}}function Su(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ru),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ru),t;default:throw Error(i(435,e.tag))}}function Cu(e,t){var n=Su(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=_f.bind(null,e,t);t.then(r,r)}})}function wu(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(Sp(l.type)){gu=l.stateNode,_u=!1;break a}break;case 5:gu=l.stateNode,_u=!1;break a;case 3:case 4:gu=l.stateNode.containerInfo,_u=!0;break a}l=l.return}if(gu===null)throw Error(i(160));yu(s,c,o),gu=null,_u=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Eu(t,e,n),t=t.sibling}var Tu=null;function Eu(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}wu(t,e,n),Du(e),a&4&&(_l(3,e,e.return),gl(3,e),_l(5,e,e.return));break;case 1:wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(r,r.return)),a&64&&$l&&(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=Tu,wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(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($l)e.stateNode=fp(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[kt]||r[St]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=a.createElement(t),a.head.insertBefore(r,a.querySelector(`head > title`))),np(r,t,n),r[St]=e,It(r),t=r;break a;case`link`:if(o=Gm(`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),np(r,t,n),a.head.appendChild(r);break;case`meta`:if(o=Gm(`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),np(r,t,n),a.head.appendChild(r);break;default:throw Error(i(468,t))}r[St]=e,It(r),t=r}e.stateNode=t}}else $l||Km(o,e.type,e.stateNode)}else e.stateNode=Bm(o,n,e.memoizedProps)}else a===n?n===null&&e.stateNode!==null&&Ol(e,e.memoizedProps,r.memoizedProps):(a===null?(t=r.stateNode,t===null||eu||t.parentNode.removeChild(t)):a.count--,n===null?$l||Km(o,e.type,e.stateNode):Bm(o,n,e.memoizedProps))}break;case 27:wu(t,e,n),Du(e),a&512&&(eu||r===null||xl(r,r.return)),r!==null&&a&4&&Ol(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=tu,tu=!1,wu(t,e,n),tu=o,Du(e),a&512&&(eu||r===null||xl(r,r.return)),e.flags&32){t=e.stateNode;try{un(t,``),z=!0}catch(t){ff(e,e.return,t)}}a&4&&e.stateNode!=null&&(t=e.memoizedProps,Ol(e,t,r===null?t:r.memoizedProps)),a&1024&&(nu=!0);break;case 6:if(wu(t,e,n),Du(e),a&4){if(e.stateNode===null)throw Error(i(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,z=!0}catch(t){ff(e,e.return,t)}}break;case 3:if(z=!1,Wm=null,o=Tu,Tu=bm(t.containerInfo),wu(t,e,n),Tu=o,Du(e),a&4&&r!==null&&r.memoizedState.isDehydrated)try{Hh(t.containerInfo)}catch(t){ff(e,e.return,t)}nu&&(nu=!1,Ou(e)),z=!1;break;case 4:a=tu,tu=$l,r=Kt(),o=Tu,Tu=bm(e.stateNode.containerInfo),wu(t,e,n),Du(e),Tu=o,z&&ou&&(su=!0),z=r,tu=a;break;case 12:wu(t,e,n),Du(e);break;case 31:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 13:wu(t,e,n),Du(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(fd=Be()),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=$l,l=eu,u=tu;$l=c||o,tu=u||o,eu=l||s,wu(t,e,n),eu=l,tu=u,$l=c,Du(e),a&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||$l||eu||(t=s||eu,n=$l,r=eu,$l=o||$l,eu=t,Mu(e,2),$l=n,eu=r),!o&&tu||fu(e,o)),a&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Cu(e,n))));break;case 19:wu(t,e,n),Du(e),a&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Cu(e,t)));break;case 30:a&512&&(eu||r===null||xl(r,r.return)),a=Kt(),o=ou,s=(n&335544064)===n,c=e.memoizedProps,ou=s&&hi(c.default,c.update)!==`none`,wu(t,e,n),Du(e),s&&r!==null&&z&&(e.flags|=4),ou=o,z=a;break;case 21:break;case 7:a&512&&(eu||r===null||xl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:wu(t,e,n),Du(e)}}function Du(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(kl(r)){n=r;break}r=r.return}r=null;for(var a=e.return;a!==null;){if(El(a)){var o=a.stateNode;r===null?r=[o]:r.push(o)}if(Tl(a))break;a=a.return}var s=r;if(n==null)throw Error(i(160));switch(n.tag){case 27:var c=n.stateNode;Ml(e,Al(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(un(l,``),n.flags&=-33),Ml(e,Al(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;jl(e,Al(e),u,s);break;default:throw Error(i(161))}}catch(t){ff(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ou(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Ou(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,gh=!0,t.reset(),gh=!1),e=e.sibling}}function ku(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Au(t,e),t=t.sibling;else Ql(t,!1)}function Au(e,t){var n=e.alternate;if(n===null)Wl(e,!1);else switch(e.tag){case 3:if(cu=au=!1,Rl(),ku(t,e),!au&&!su){if(e=Ll,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Ep(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`})),cu=!0}Ll=null;break;case 5:ku(t,e);break;case 4:r=au,au=!1,ku(t,e),au&&(su=!0),au=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?ku(t,e):Wl(e,!1));break;case 30:r=au,i=Rl(),au=!1,ku(t,e),au&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=pi(a,o),o=pi(n.memoizedProps,o);var s=hi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,zl=0,t=Zl(e,n,t,o,s,a,!0),zl!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(jd(e,e.memoizedProps.onUpdate),Ll=i):i!==null&&(i.push.apply(i,Ll),Ll=i),au=e.flags&32?!0:r;break;default:ku(t,e)}}function ju(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)du(e,t.alternate,t),t=t.sibling}function Mu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:_l(4,n,n.return),Mu(n,r);break;case 1:xl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&yl(n,n.return,i),Mu(n,r);break;case 27:r&2&&gm(n.stateNode,n.type,n.memoizedProps);case 5:xl(n,n.return),n.tag!==5&&n.tag!==27||wl(n),Mu(n,r);break;case 6:wl(n);break;case 26:xl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||eu||i.parentNode.removeChild(i),Mu(n,r);break;case 22:n.memoizedState===null&&Mu(n,r);break;case 30:xl(n,n.return),Mu(n,r);break;case 7:xl(n,n.return);default:Mu(n,r)}e=e.sibling}}function Nu(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:Nu(i,a,n),gl(4,a);break;case 1:if(Nu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){ff(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++)go(l[i],c)}catch(e){ff(r,r.return,e)}}s&&o&64&&vl(a),bl(a,a.return);break;case 27:n&2&&Nl(a);case 5:a.tag!==5&&a.tag!==27||Cl(a),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 6:Cl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||$l||Km(bm(c.ownerDocument),a.type,c),Nu(i,a,n),s&&r===null&&o&4&&Dl(a),bl(a,a.return);break;case 12:Nu(i,a,n);break;case 31:Nu(i,a,n),s&&o&4&&bu(i,a);break;case 13:Nu(i,a,n),s&&o&4&&xu(i,a);break;case 22:a.memoizedState===null&&Nu(i,a,n),bl(a,a.return);break;case 30:Nu(i,a,n),bl(a,a.return);break;case 7:bl(a,a.return);default:Nu(i,a,n)}t=t.sibling}}function Pu(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&&Ta(n))}function Fu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ta(e))}function Iu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Lu(e,t,n,r),t=t.sibling;else i&&Xl(t)}function Lu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Yl(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Iu(e,t,n,r),a&2048&&gl(9,t);break;case 1:Iu(e,t,n,r);break;case 3:Iu(e,t,n,r),i&&cu&&(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&&Ta(a)));break;case 12:if(a&2048){Iu(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){ff(t,t.return,e)}}else Iu(e,t,n,r);break;case 31:Iu(e,t,n,r);break;case 13:Iu(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&&Yl(t),o._visibility&2?Iu(e,t,n,r):(o._visibility|=2,Ru(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&Yl(s),o._visibility&2?Iu(e,t,n,r):zu(e,t)),a&2048&&Pu(s,t);break;case 24:Iu(e,t,n,r),a&2048&&Fu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Hl(a.child,!0),Hl(t.child,!0))),Iu(e,t,n,r);break;default:Iu(e,t,n,r)}}function Ru(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:Ru(a,o,s,c,i),gl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ru(a,o,s,c,i)):u._visibility&2?Ru(a,o,s,c,i):zu(a,o),i&&l&2048&&Pu(o.alternate,o);break;case 24:Ru(a,o,s,c,i),i&&l&2048&&Fu(o.alternate,o);break;default:Ru(a,o,s,c,i)}t=t.sibling}}function zu(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:zu(n,r),i&2048&&Pu(r.alternate,r);break;case 24:zu(n,r),i&2048&&Fu(r.alternate,r);break;default:zu(n,r)}t=t.sibling}}var Bu=8192;function Vu(e,t,n){if(e.subtreeFlags&Bu)for(e=e.child;e!==null;)Hu(e,t,n),e=e.sibling}function Hu(e,t,n){switch(e.tag){case 26:Vu(e,t,n),e.flags&Bu&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&Zm(n,e)):Qm(n,Tu,e.memoizedState,e.memoizedProps));break;case 5:Vu(e,t,n),e.flags&Bu&&(e=e.stateNode,(t&335544128)===t&&Zm(n,e));break;case 3:case 4:var r=Tu;Tu=bm(e.stateNode.containerInfo),Vu(e,t,n),Tu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Bu,Bu=16777216,Vu(e,t,n),Bu=r):Vu(e,t,n));break;case 30:if((e.flags&Bu)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Fl===null&&(Fl=new Map),Fl.set(r,i)}Vu(e,t,n);break;default:Vu(e,t,n)}}function Uu(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 Wu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Gu(e),e=e.sibling}function Gu(e){switch(e.tag){case 0:case 11:case 15:Wu(e),e.flags&2048&&_l(9,e,e.return);break;case 3:Wu(e);break;case 12:Wu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ku(e)):Wu(e);break;default:Wu(e)}}function Ku(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];iu=r,qu(r,e)}Uu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:_l(8,t,t.return),Ku(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Ku(t));break;default:Ku(t)}e=e.sibling}}function qu(e,t){for(;iu!==null;){var n=iu;switch(n.tag){case 0:case 11:case 15:_l(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:Ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,iu=r;else a:for(n=e;iu!==null;){r=iu;var i=r.sibling,a=r.return;if(hu(r),r===n){iu=null;break a}if(i!==null){i.return=a,iu=i;break a}iu=a}}}var Ju={getCacheForType:function(e){var t=_a(Ca),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return _a(Ca).controller.signal}},Yu=typeof WeakMap==`function`?WeakMap:Map,X=0,Xu=null,Z=null,Q=0,Zu=0,Qu=null,$u=!1,ed=!1,td=!1,nd=0,rd=0,id=0,ad=0,od=0,sd=0,cd=0,ld=null,ud=null,dd=!1,fd=0,pd=0,md=1/0,hd=null,gd=null,_d=0,vd=null,yd=null,bd=0,xd=0,Sd=null,Cd=null,wd=null,Td=null,Ed=null,Dd=0,Od=null;function kd(){return X&2&&Q!==0?Q&-Q:F.T===null?yt():Nf()}function Ad(){if(sd===0){if(!(Q&536870912)||J){var e=rt;rt<<=1,!(rt&3932160)&&(rt=262144),sd=e}else sd=536870912}return e=Co.current,e!==null&&(e.flags|=32),sd}function jd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Pp(pi(e.memoizedProps,n))),Td===null&&(Td=[]),Td.push(t.bind(null,r))}}function Md(e,t,n){(e===Xu&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)&&(zd(e,0),Id(e,Q,sd,!1)),ft(e,n),(!(X&2)||e!==Xu)&&(e===Xu&&(!(X&2)&&(ad|=n),rd===4&&Id(e,Q,sd,!1)),Tf(e))}function Nd(e,t,n){if(X&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||st(e,t),a=r?qd(e,t):Gd(e,t,!0),o=r;do{if(a===0){ed&&!r&&Id(e,t,0,!1);break}if(n=e.current.alternate,o&&!Fd(n))a=Gd(e,t,!1),o=!1;else{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=ld;var l=c.current.memoizedState.isDehydrated;if(l&&(zd(c,s).flags|=256),s=Gd(c,s,!1),s!==2&&s!==6){if(td&&!l){c.errorRecoveryDisabledLanes|=o,ad|=o,a=4;break a}o=ud,ud=a,o!==null&&(ud===null?ud=o:ud.push.apply(ud,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){zd(e,0),Id(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:Id(r,t,sd,!$u);break a;case 2:ud=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=fd+300-Be(),10<a)){if(Id(r,t,sd,!$u),ot(r,0,!0)!==0)break a;bd=t,r.timeoutHandle=gp(Pd.bind(null,r,n,ud,hd,dd,t,sd,ad,cd,$u,o,`Throttled`,-0,0),a);break a}Pd(r,n,ud,hd,dd,t,sd,ad,cd,$u,o,null,-0,0)}break}}while(1);Tf(e)}function Pd(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;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:vn},Fl=null,Hu(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=nh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?fd-Be():(a&4194048)===a?pd-Be():0,m=eh(d,m),m!==null)?(bd=a,e.cancelPendingCommit=m(ef.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Id(e,a,o,!l)):ef(e,t,a,n,r,i,o,s,c,l,u,d)}function Fd(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(!Lr(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 Id(e,t,n,r){t=ct(e,t),t&=~od,t&=~ad,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Qe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&mt(e,n,t)}function Ld(){return X&6?!0:(Ef(0,!1),!1)}function Rd(){if(Z!==null){if(Zu===0)var e=Z.return;else e=Z,la=ca=null,Qo(e),Za=null,Qa=0,e=Z;for(;e!==null;)hl(e.alternate,e),e=e.return;Z=null}}function zd(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,_p(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),bd=0,Rd(),Xu=e,Z=n=Ai(e.current,null),Q=t,Zu=0,Qu=null,$u=!1,ed=st(e,t),td=!1,cd=sd=od=ad=id=rd=0,ud=ld=null,dd=!1,nd=ct(e,t),bi(),n}function Bd(e,t){Y=null,F.H=cc,t===Va||t===Ua?(t=Ya(),Zu=3):t===Ha?(t=Ya(),Zu=4):Zu=t===Ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Qu=t,Z===null&&(rd=1,bc(e,Ri(t,e.current)))}function Vd(){var e=Co.current;return e===null?!0:(Q&4194048)===Q?wo===null:(Q&62914560)===Q||Q&536870912?e===wo:!1}function Hd(){var e=F.H;return F.H=cc,e===null?cc:e}function Ud(){var e=F.A;return F.A=Ju,e}function Wd(){rd=4,$u||(Q&4194048)!==Q&&Co.current!==null||(ed=!0),!(id&134217727)&&!(ad&134217727)||Xu===null||Id(Xu,Q,sd,!1)}function Gd(e,t,n){var r=X;X|=2;var i=Hd(),a=Ud();(Xu!==e||Q!==t)&&(hd=null,zd(e,t)),t=!1;var o=rd;a:do try{if(Zu!==0&&Z!==null){var s=Z,c=Qu;switch(Zu){case 8:Rd(),o=6;break a;case 3:case 2:case 9:case 6:Co.current===null&&(t=!0);var l=Zu;if(Zu=0,Qu=null,Zd(e,s,c,l),n&&ed){o=0;break a}break;default:l=Zu,Zu=0,Qu=null,Zd(e,s,c,l)}}Kd(),o=rd;break}catch(t){Bd(e,t)}while(1);return t&&e.shellSuspendCounter++,la=ca=null,X=r,F.H=i,F.A=a,Z===null&&(Xu=null,Q=0,bi()),o}function Kd(){for(;Z!==null;)Yd(Z)}function qd(e,t){var n=X;X|=2;var r=Hd(),a=Ud();Xu!==e||Q!==t?(hd=null,md=Be()+500,zd(e,t)):ed=st(e,t);a:do try{if(Zu!==0&&Z!==null){t=Z;var o=Qu;b:switch(Zu){case 1:Zu=0,Qu=null,Zd(e,t,o,1);break;case 2:case 9:if(Ga(o)){Zu=0,Qu=null,Xd(t);break}t=function(){Zu!==2&&Zu!==9||Xu!==e||(Zu=7),Tf(e)},o.then(t,t);break a;case 3:Zu=7;break a;case 4:Zu=5;break a;case 7:Ga(o)?(Zu=0,Qu=null,Xd(t)):(Zu=0,Qu=null,Zd(e,t,o,7));break;case 5:var s=null;switch(Z.tag){case 26:s=Z.memoizedState;case 5:case 27:var c=Z;if(s?Ym(s):c.stateNode.complete){Zu=0,Qu=null;var l=c.sibling;if(l!==null)Z=l;else{var u=c.return;u===null?Z=null:(Z=u,Qd(u))}break b}}Zu=0,Qu=null,Zd(e,t,o,5);break;case 6:Zu=0,Qu=null,Zd(e,t,o,6);break;case 8:Rd(),rd=6;break a;default:throw Error(i(462))}}Jd();break}catch(t){Bd(e,t)}while(1);return la=ca=null,F.H=r,F.A=a,X=n,Z===null?(Xu=null,Q=0,bi(),rd):0}function Jd(){for(;Z!==null&&!Re();)Yd(Z)}function Yd(e){var t=ol(e.alternate,e,nd);e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Xd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bc(n,t,t.pendingProps,t.type,void 0,Q);break;case 11:t=Bc(n,t,t.pendingProps,t.type.render,t.ref,Q);break;case 5:Qo(t);var r=t;r===Yi&&(J?(na(r),r.tag===5&&r.stateNode!=null&&(Xi=r.stateNode)):(na(r),J=!0));default:hl(n,t),t=Z=ji(t,nd),t=ol(n,t,nd)}e.memoizedProps=e.pendingProps,t===null?Qd(e):Z=t}function Zd(e,t,n,r){la=ca=null,Qo(t),Za=null,Qa=0;var i=t.return;try{if(Tc(e,i,t,n,Q)){rd=1,bc(e,Ri(n,e.current)),Z=null;return}}catch(t){if(i!==null)throw Z=i,t;rd=1,bc(e,Ri(n,e.current)),Z=null;return}t.flags&32768?(J||r===1?e=!0:ed||Q&536870912?e=!1:($u=e=!0,(r===2||r===9||r===3||r===6)&&(r=Co.current,r!==null&&r.tag===13&&(r.flags|=16384))),$d(t,e)):Qd(t)}function Qd(e){var t=e;do{if(t.flags&32768){$d(t,$u);return}e=t.return;var n=pl(t.alternate,t,nd);if(n!==null){Z=n;return}if(t=t.sibling,t!==null){Z=t;return}Z=t=e}while(t!==null);rd===0&&(rd=5)}function $d(e,t){do{var n=ml(e.alternate,e);if(n!==null){n.flags&=32767,Z=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Z=e;return}Z=e=n}while(e!==null);rd=6,Z=null}function ef(e,t,n,r,a,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do lf();while(_d!==0);if(X&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));e===Xu&&(Z=Xu=null,Q=0),yd=t,vd=e,bd=n,Sd=a,Cd=r,tf(e,t,n,s,c,l,f)}}function tf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(xd=s,s|=yi,pt(e,n,s,r,i,a),Td=null,(n&335544064)===n?(Ed=Oa(e),r=10262):(Ed=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,vf(We,function(){return uf(),null})):(e.callbackNode=null,e.callbackPriority=0),Pl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=F.T,F.T=null,i=I.p,I.p=2,a=X,X|=4;try{lu(e,t,n)}finally{X=a,I.p=i,F.T=r}}_d=1,Pl?wd=Mp(o,e.containerInfo,Ed,af,of,rf,sf,uf,nf,null,null):(af(),of(),sf())}function nf(e){if(_d!==0){var t=vd.onRecoverableError;t(e,{componentStack:null})}}function rf(){_d===3&&(_d=0,Au(yd,vd),_d=4)}function af(){if(_d===1){_d=0;var e=vd,t=yd,n=bd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=F.T,F.T=null;var i=I.p;I.p=2;var a=X;X|=4;try{ou=su=!1,Eu(t,e,n),n=cp;var o=Ur(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&Hr(s.ownerDocument.documentElement,s)){if(c!==null&&Wr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Vr(s,h),v=Vr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}gh=!!sp,cp=sp=null}finally{X=a,I.p=i,F.T=r}}e.current=t,_d=2}}function of(){if(_d===2){_d=0;var e=vd,t=yd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=F.T,F.T=null;var r=I.p;I.p=2;var i=X;X|=4;try{du(e,t.alternate,t)}finally{X=i,I.p=r,F.T=n}}_d=3}}function sf(){if(_d===4||_d===3){_d=0;var e=wd;wd=null,ze();var t=vd,n=yd,r=bd,i=Cd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?_d=5:(_d=0,yd=vd=null,cf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(gd=null),vt(r),n=n.stateNode,Xe&&typeof Xe.onCommitFiberRoot==`function`)try{Xe.onCommitFiberRoot(Ye,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=F.T,a=I.p,I.p=2,F.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{F.T=n,I.p=a}}if(i=Td,o=Ed,Ed=null,i!==null&&(Td=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);bd&3&&lf(),Tf(t),a=t.pendingLanes,r&261930&&a&42?t===Od?Dd++:(Dd=0,Od=t):(Dd=0,Od=null),Ef(0,!1)}}function cf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ta(t)))}function lf(){return wd!==null&&(wd.skipTransition(),wd=null),af(),of(),sf(),uf()}function uf(){if(_d!==5)return!1;var e=vd,t=xd;xd=0;var n=vt(bd),r=F.T,a=I.p;try{I.p=32>n?32:n,F.T=null,n=Sd,Sd=null;var o=vd,s=bd;if(_d=0,yd=vd=null,bd=0,X&6)throw Error(i(331));var c=X;if(X|=4,Gu(o.current),Lu(o,o.current,s,n),X=c,Ef(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot==`function`)try{Xe.onPostCommitFiberRoot(Ye,o)}catch{}return!0}finally{I.p=a,F.T=r,cf(e,t)}}function df(e,t,n){t=Ri(n,t),t=Sc(e.stateNode,t,2),e=lo(e,t,2),e!==null&&(ft(e,2),Tf(e))}function ff(e,t,n){if(e.tag===3)df(e,e,n);else for(;t!==null;){if(t.tag===3){df(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(gd===null||!gd.has(r))){e=Ri(n,e),n=Cc(2),r=lo(t,n,2),r!==null&&(wc(n,r,t,e),ft(r,2),Tf(r));break}}t=t.return}}function pf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Yu;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)||(td=!0,i.add(n),e=mf.bind(null,e,t,n),t.then(e,e))}function mf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Xu===e&&(Q&n)===n&&(rd===4||rd===3&&(Q&62914560)===Q&&300>Be()-fd?X&2?od|=n:zd(e,0):od|=n,cd===Q&&(cd=0)),Tf(e)}function hf(e,t){t===0&&(t=ut()),e=Ci(e,t),e!==null&&(ft(e,t),Tf(e))}function gf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),hf(e,n)}function _f(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),hf(e,n)}function vf(e,t){return Ie(e,t)}var yf=null,bf=null,xf=!1,Sf=!1,Cf=!1,wf=0;function Tf(e){e!==bf&&e.next===null&&(bf===null?yf=bf=e:bf=bf.next=e),Sf=!0,xf||(xf=!0,Mf())}function Ef(e,t){if(!Cf&&Sf){Cf=!0;do for(var n=!1,r=yf;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-Qe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,jf(r,a))}else a=Q,a=ot(r,r===Xu?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||st(r,a)||(n=!0,jf(r,a))}r=r.next}while(n);Cf=!1}}function Df(){Of()}function Of(){Sf=xf=!1;var e=0;wf!==0&&hp()&&(e=wf);for(var t=Be(),n=null,r=yf;r!==null;){var i=r.next,a=kf(r,t);a===0?(r.next=null,n===null?yf=i:n.next=i,i===null&&(bf=n)):(n=r,(e!==0||a&3)&&(Sf=!0)),r=i}_d!==0&&_d!==5||Ef(e,!1),wf!==0&&(wf=0)}function kf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Qe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=lt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Xu,n=Q,n=ot(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Zu===2||Zu===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Le(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||st(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Le(r),vt(n)){case 2:case 8:n=Ue;break;case 32:n=We;break;case 268435456:n=Ke;break;default:n=We}return r=Af.bind(null,e),n=Ie(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Le(r),e.callbackPriority=2,e.callbackNode=null,2}function Af(e,t){if(_d!==0&&_d!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(lf()&&e.callbackNode!==n)return null;var r=Q;return r=ot(e,e===Xu?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Nd(e,r,t),kf(e,Be()),e.callbackNode!=null&&e.callbackNode===n?Af.bind(null,e):null)}function jf(e,t){if(lf())return null;Nd(e,t,!0)}function Mf(){bp(function(){X&6?Ie(He,Df):Of()})}function Nf(){if(wf===0){var e=ja;e===0&&(e=nt,nt<<=1,!(nt&261888)&&(nt=256)),wf=e}return wf}function Pf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:_n(e)}function Ff(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Pf((i[Ct]||null).action),o=r.submitter;o&&(t=(t=o[Ct]||null)?Pf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wf!==0){var e=new FormData(i,o);Js(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),Js(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var If=0;If<ui.length;If++){var Lf=ui[If];di(Lf.toLowerCase(),`on`+(Lf[0].toUpperCase()+Lf.slice(1)))}di(ni,`onAnimationEnd`),di(ri,`onAnimationIteration`),di(ii,`onAnimationStart`),di(`dblclick`,`onDoubleClick`),di(`focusin`,`onFocus`),di(`focusout`,`onBlur`),di(ai,`onTransitionRun`),di(oi,`onTransitionStart`),di(si,`onTransitionCancel`),di(ci,`onTransitionEnd`),Vt(`onMouseEnter`,[`mouseout`,`mouseover`]),Vt(`onMouseLeave`,[`mouseout`,`mouseover`]),Vt(`onPointerEnter`,[`pointerout`,`pointerover`]),Vt(`onPointerLeave`,[`pointerout`,`pointerover`]),Bt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Bt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Bt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Bt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Bt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Rf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),zf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Rf));function Bf(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){gi(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){gi(e)}i.currentTarget=null,a=c}}}}function $(e,t){var n=t[Tt];n===void 0&&(n=t[Tt]=new Set);var r=e+`__bubble`;n.has(r)||(Wf(t,e,2,!1),n.add(r))}function Vf(e,t,n){var r=0;t&&(r|=4),Wf(n,e,r,t)}var Hf=`_reactListening`+Math.random().toString(36).slice(2);function Uf(e){if(!e[Hf]){e[Hf]=!0,Rt.forEach(function(t){t!==`selectionchange`&&(zf.has(t)||Vf(t,!1,e),Vf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hf]||(t[Hf]=!0,Vf(`selectionchange`,!1,t))}}function Wf(e,t,n,r){switch(Ch(t)){case 2:var i=_h;break;case 8:i=vh;break;default:i=yh}n=i.bind(null,t,n,e),i=void 0,!En||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 Gf(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=Mt(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}Cn(function(){var r=a,i=yn(n),s=[];a:{var c=li.get(e);if(c!==void 0){var l=Ln,u=e;switch(e){case`keypress`:if(Mn(n)===0)break a;case`keydown`:case`keyup`:l=er;break;case`focusin`:u=`focus`,l=Kn;break;case`focusout`:u=`blur`,l=Kn;break;case`beforeblur`:case`afterblur`:l=Kn;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=Wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Gn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=nr;break;case ni:case ri:case ii:l=qn;break;case ci:l=rr;break;case`scroll`:case`scrollend`:l=zn;break;case`wheel`:l=ir;break;case`copy`:case`cut`:case`paste`:l=Jn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=tr;break;case`submit`:l=U;break;case`toggle`:case`beforetoggle`:l=ar}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=wn(m,p),g!=null&&d.push(Kf(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!==B&&(u=n.relatedTarget||n.fromElement)&&(Mt(u)||u[wt]))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?Mt(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=Wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=tr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:Pt(c),h=l==null?u:Pt(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Mt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?E(c,l,Jf):null,c!==null&&Yf(s,u,c,d,!1),l!==null&&f!==null&&Yf(s,f,l,d,!0)))}a:{if(c=r?Pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Tr;else if(yr(c)){if(Er)_=Fr;else{_=Nr;var v=Mr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&mn(r.elementType)&&(_=Tr):_=Pr;if(_&&=_(e,r)){br(s,_,n,i);break a}v&&v(e,c,r)}switch(v=r?Pt(r):window,e){case`focusin`:(yr(v)||v.contentEditable===`true`)&&(Kr=v,qr=r,Jr=null);break;case`focusout`:Jr=qr=Kr=null;break;case`mousedown`:Yr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Yr=!1,Xr(s,n,i);break;case`selectionchange`:if(Gr)break;case`keydown`:case`keyup`:Xr(s,n,i)}var y;if(sr)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 hr?pr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(ur&&n.locale!==`ko`&&(hr||b!==`onCompositionStart`?b===`onCompositionEnd`&&hr&&(y=jn()):(On=i,kn=`value`in On?On.value:On.textContent,hr=!0)),v=qf(r,b),0<v.length&&(b=new Yn(b,e,null,n,i),s.push({event:b,listeners:v}),y?b.data=y:(y=mr(n),y!==null&&(b.data=y)))),(y=lr?gr(e,n):_r(e,n))&&(b=qf(r,`onBeforeInput`),0<b.length&&(v=new Yn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:v,listeners:b}),v.data=y)),Ff(s,e,r,n,i)}Bf(s,t)})}function Kf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function qf(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=wn(e,n),i!=null&&r.unshift(Kf(e,i,a)),i=wn(e,t),i!=null&&r.push(Kf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Jf(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Yf(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=wn(n,a),l!=null&&o.unshift(Kf(n,l,c))):i||(l=wn(n,a),l!=null&&o.push(Kf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Xf=/\r\n?/g,Zf=/\u0000|\uFFFD/g;function Qf(e){return(typeof e==`string`?e:``+e).replace(Xf,`
|
|
9
|
+
`).replace(Zf,``)}function $f(e,t){return t=Qf(t),Qf(e)===t}function ep(e,t,n,r,a,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||un(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&un(e,``+r);else return;break;case`className`:Jt(e,`class`,r);break;case`tabIndex`:Jt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Jt(e,n,r);break;case`style`:pn(e,r,o);return;case`data`:if(t!==`object`){Jt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(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`&&ep(e,t,`name`,a.name,a,null),ep(e,t,`formEncType`,a.formEncType,a,null),ep(e,t,`formMethod`,a.formMethod,a,null),ep(e,t,`formTarget`,a.formTarget,a,null)):(ep(e,t,`encType`,a.encType,a,null),ep(e,t,`method`,a.method,a,null),ep(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=_n(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=vn);return;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`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=_n(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`:$(`beforetoggle`,e),$(`toggle`,e),qt(e,`popover`,r);break;case`xlinkActuate`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Yt(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=hn.get(n)||n,qt(e,n,r);else return}z=!0}function tp(e,t,n,r,a,o){switch(n){case`style`:pn(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`)un(e,r);else if(typeof r==`number`||typeof r==`bigint`)un(e,``+r);else return;break;case`onScroll`:r!=null&&$(`scroll`,e);return;case`onScrollEnd`:r!=null&&$(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=vn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!zt.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[Ct]||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}z=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):qt(e,n,r)}return}z=!0}function np(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:$(`error`,e),$(`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:ep(e,t,o,s,n,null)}}a&&ep(e,t,`srcSet`,n.srcSet,n,null),r&&ep(e,t,`src`,n.src,n,null);return;case`input`:$(`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:ep(e,t,r,d,n,null)}}an(e,o,c,l,u,s,a,!1);return;case`select`:for(a in $(`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:ep(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&sn(e,!!r,n,!0):sn(e,!!r,t,!1);return;case`textarea`:for(s in $(`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:ep(e,t,s,c,n,null)}ln(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:ep(e,t,l,r,n,null)}return;case`dialog`:$(`beforetoggle`,e),$(`toggle`,e),$(`cancel`,e),$(`close`,e);break;case`iframe`:case`object`:$(`load`,e);break;case`video`:case`audio`:for(r=0;r<Rf.length;r++)$(Rf[r],e);break;case`image`:$(`error`,e),$(`load`,e);break;case`details`:$(`toggle`,e);break;case`embed`:case`source`:case`link`:$(`error`,e),$(`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:ep(e,t,u,r,n,null)}return;default:if(mn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&tp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&ep(e,t,c,r,n,null))}var rp={};function ip(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)||ep(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&&(z=!0),o=m;break;case`name`:m!==f&&(z=!0),a=m;break;case`checked`:m!==f&&(z=!0),u=m;break;case`defaultChecked`:m!==f&&(z=!0),d=m;break;case`value`:m!==f&&(z=!0),s=m;break;case`defaultValue`:m!==f&&(z=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&ep(e,t,p,m,r,f)}}rn(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)||ep(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&&(z=!0),p=o;break;case`defaultValue`:o!==l&&(z=!0),c=o;break;case`multiple`:o!==l&&(z=!0),s=o;default:o!==l&&ep(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?sn(e,!!n,n?[]:``,!1):sn(e,!!n,t,!0)):sn(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:ep(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&&(z=!0),p=a;break;case`defaultValue`:a!==o&&(z=!0),m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&ep(e,t,s,a,r,o)}cn(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:ep(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&&(z=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:ep(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)&&ep(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:ep(e,t,u,p,r,m)}return;default:if(mn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&tp(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||tp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&ep(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||ep(e,t,f,p,r,m)}function ap(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function op(){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&&ap(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&&ap(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 sp=null,cp=null;function lp(e){return e.nodeType===9?e:e.ownerDocument}function up(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 dp(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 fp(e,t,n,r){return n=lp(n).createElement(e),n[St]=r,n[Ct]=t,np(n,e,t),It(n),n}function pp(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 mp=null;function hp(){var e=window.event;return e&&e.type===`popstate`?e!==mp&&(mp=e,!0):(mp=null,!1)}var gp=typeof setTimeout==`function`?setTimeout:void 0,_p=typeof clearTimeout==`function`?clearTimeout:void 0,vp=typeof Promise==`function`?Promise:void 0,yp=typeof requestAnimationFrame==`function`?requestAnimationFrame:gp,bp=typeof queueMicrotask==`function`?queueMicrotask:vp===void 0?gp:function(e){return vp.resolve(null).then(e).catch(xp)};function xp(e){setTimeout(function(){throw e})}function Sp(e){return e===`head`}function Cp(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),Hh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)_m(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,_m(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[kt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&_m(e.ownerDocument.body)}n=i}while(n);Hh(t)}function wp(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 Tp(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 Ep(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 Dp(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 Op(e){return Dp(e.getBoundingClientRect(),getComputedStyle(e),e)}function kp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Dp(t,n,e)}function Ap(e){return e.documentElement.clientHeight}function jp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Mp(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`&&(Ap(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+=Xm(f),u>$m){s.length=o;break}f=new Promise(jp.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 Np(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}Np.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:D({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Np.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},Np.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Pp(e){return{name:e,group:new Np(`group`,e),imagePair:new Np(`image-pair`,e),old:new Np(`old`,e),new:new Np(`new`,e)}}function Fp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Fp.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(Bp(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=Rp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),m(this._fragmentFiber.child,!1,Ip,e,s,r)}this._eventListeners=a}};function Ip(e,t,n,r){return b(e).addEventListener(t,n,r),!1}Fp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Bp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Rp(i.optionsOrUseCapture),m(this._fragmentFiber.child,!1,Lp,e,n,i),r.splice(t,1),a!==null&&a()}};function Lp(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function Rp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function zp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Bp(e,t,n,r){if(e.length===0)return-1;r=zp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&zp(a.optionsOrUseCapture)===r)return i}return-1}Fp.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(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,Rp(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,Rp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Fp.prototype.focus=function(e){m(this._fragmentFiber.child,!0,Vp,e,void 0,void 0)};function Vp(e,t){return e.tag!==6&&(e=b(e),pm(e,t))}Fp.prototype.focusLast=function(e){var t=[];m(this._fragmentFiber.child,!0,Hp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!Vp(t[n],e);n--);};function Hp(e,t){return t.push(e),!1}Fp.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=lp(e).activeElement,e!==null&&m(this._fragmentFiber.child,!1,Up,e,void 0,void 0))};function Up(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Fp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),m(this._fragmentFiber.child,!1,Wp,e,void 0,void 0)};function Wp(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}Fp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),m(this._fragmentFiber.child,!1,Gp,e,void 0,void 0);for(var n=t=0;n<Kp.length;n++){var r=Kp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Kp[t++]=r}Kp.length=t}};function Gp(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var Kp=[],qp=!1;function Jp(e,t,n){Kp.push({fragmentInstance:e,observer:t,instance:n}),qp||(qp=!0,mm(function(){qp=!1;var e=Kp;Kp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Fp.prototype.getClientRects=function(){var e=[];return m(this._fragmentFiber.child,!1,Yp,e,void 0,void 0),e};function Yp(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=b(e),t.push.apply(t,e.getClientRects());return!1}Fp.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},Fp.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];m(this._fragmentFiber.child,!1,Hp,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(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=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(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=b(n[0]),i=b(n[n.length-1]);var a=_(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||Xp(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Xp(e,t,n,r,i){var a=Mt(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=g(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=E(n,a,T),t===null?t=!1:(m(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=E(r,a,T),t===null?t=!1:(m(t,!0,w,a,r),a=x,S=x=null,t=a!==null)),t):!1}function Zp(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)}Fp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(i(566));var t=[];m(this._fragmentFiber.child,!1,Hp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),Zp(e,n);return}if(r=b(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=b(a),Zp(a,n)):b(a).scrollIntoView(e),r+=n?-1:1}};function Qp(e,t){return e=b(e),$p(e,t),!1}function $p(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function em(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Kp.length;i++){var a=Kp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Kp[r++]=a)}Kp.length=r,n.observe(e)}),$p(e,t))}function tm(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,Rp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?Jp(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function nm(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`:nm(n),jt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function rm(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[kt])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=lm(e.nextSibling),e===null)break}return null}function im(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lm(e.nextSibling),e===null))return null;return e}function am(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lm(e.nextSibling),e===null))return null;return e}function om(e){return e.data===`$?`||e.data===`$~`}function sm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cm(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 lm(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 um=null;function dm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function fm(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 pm(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 mm(e){yp(function(){yp(function(t){return e(t)})})}function hm(e,t,n){switch(t=lp(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 gm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&ep(e,t,r,null,rp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===vn&&(e.onclick=null),jt(e)}function _m(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);jt(e)}var vm=new Map,ym=new Set;function bm(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 xm=I.d;I.d={f:Sm,r:Cm,D:Em,C:Dm,L:Om,m:km,X:jm,S:Am,M:Mm};function Sm(){var e=xm.f(),t=Ld();return e||t}function Cm(e){var t=Nt(e);t!==null&&t.tag===5&&t.type===`form`?Xs(t):xm.r(e)}var wm=typeof document>`u`?null:document;function Tm(e,t,n){var r=wm;if(r&&typeof t==`string`&&t){var i=nn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),ym.has(i)||(ym.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),np(t,`link`,e),It(t),r.head.appendChild(t)))}}function Em(e){xm.D(e),Tm(`dns-prefetch`,e,null)}function Dm(e,t){xm.C(e,t),Tm(`preconnect`,e,t)}function Om(e,t,n){xm.L(e,t,n);var r=wm;if(r&&e&&t){var i=`link[rel="preload"][as="`+nn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+nn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+nn(n.imageSizes)+`"]`)):i+=`[href="`+nn(e)+`"]`;var a=i;switch(t){case`style`:a=Pm(e);break;case`script`:a=Rm(e)}if(!(vm.has(a)||(e=D({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),vm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Fm(a))||t===`script`&&r.querySelector(zm(a))))){var o=r.createElement(`link`);np(o,`link`,e),t===`style`&&(o[At]=!0,o.onload=o.onerror=function(){Lt(o)}),It(o),r.head.appendChild(o)}}}function km(e,t){xm.m(e,t);var n=wm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+nn(r)+`"][href="`+nn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Rm(e)}if(!vm.has(a)&&(e=D({rel:`modulepreload`,href:e},t),vm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(zm(a)))return}r=n.createElement(`link`),np(r,`link`,e),It(r),n.head.appendChild(r)}}}function Am(e,t,n){xm.S(e,t,n);var r=wm;if(r&&e){var i=Ft(r).hoistableStyles,a=Pm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Fm(a)))s.loading=5;else{e=D({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=vm.get(a))&&Hm(e,n);var c=o=r.createElement(`link`);It(c),np(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,Vm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function jm(e,t){xm.X(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Mm(e,t){xm.M(e,t);var n=wm;if(n&&e){var r=Ft(n).hoistableScripts,i=Rm(e),a=r.get(i);a||(a=n.querySelector(zm(i)),a||(e=D({src:e,async:!0,type:`module`},t),(t=vm.get(i))&&Um(e,t),a=n.createElement(`script`),It(a),np(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Nm(e,t,n,r){var a=(a=we.current)?bm(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=Pm(n.href),t=Ft(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=Pm(n.href);var o=Ft(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(Fm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=vm.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},vm.set(e,o)),Lm(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=Rm(n),t=Ft(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 Pm(e){return`href="`+nn(e)+`"`}function Fm(e){return`link[rel="stylesheet"][`+e+`]`}function Im(e){return D({},e,{"data-precedence":e.precedence,precedence:null})}function Lm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[At]){r.loading=1;return}}else t=e.createElement(`link`),t[At]=!0,t.onload=t.onerror=Lt.bind(null,t),np(t,`link`,n),It(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 Rm(e){return`[src="`+nn(e)+`"]`}function zm(e){return`script[async]`+e}function Bm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+nn(n.href)+`"]`);if(r)return t.instance=r,It(r),r;var a=D({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),It(r),np(r,`style`,a),Vm(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Pm(n.href);var o=e.querySelector(Fm(a));if(o)return t.state.loading|=4,t.instance=o,It(o),o;r=Im(n),(a=vm.get(a))&&Hm(r,a),o=(e.ownerDocument||e).createElement(`link`),It(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),np(o,`link`,r),t.state.loading|=4,Vm(o,n.precedence,e),t.instance=o;case`script`:return o=Rm(n.src),(a=e.querySelector(zm(o)))?(t.instance=a,It(a),a):(r=n,(a=vm.get(o))&&(r=D({},n),Um(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),It(a),np(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,Vm(r,n.precedence,e));return t.instance}function Vm(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 Hm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Um(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Wm=null;function Gm(e,t,n){if(Wm===null){var r=new Map,i=Wm=new Map;i.set(n,r)}else i=Wm,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[kt]||a[St]||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 Km(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function qm(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 Jm(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function Ym(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Xm(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function Zm(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=Xm(t),e.suspenseyImages.push(t)),e=rh.bind(e),t.decode().then(e,e))}function Qm(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=Pm(r.href),a=t.querySelector(Fm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=nh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,It(a);return}a=t.ownerDocument||t,r=Im(r),(i=vm.get(i))&&Hm(r,i),a=a.createElement(`link`),It(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),np(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=nh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $m=0;function eh(e,t){return e.stylesheets&&e.count===0&&ah(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$m===0&&($m=62500*op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ah(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$m?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function th(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)ah(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function nh(){this.count--,th(this)}function rh(){this.imgCount--,th(this)}var ih=null;function ah(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ih=new Map,t.forEach(oh,e),ih=null,nh.call(e))}function oh(e,t){if(!(t.state.loading&4)){var n=ih.get(e);if(n)var r=n.get(null);else{n=new Map,ih.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=nh.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 sh={$$typeof:N,Provider:null,Consumer:null,_currentValue:ge,_currentValue2:ge,_threadCount:0};function ch(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=dt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dt(0),this.hiddenUpdates=dt(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 lh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ch(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Oi(3,null,null,t),e.current=a,a.stateNode=e,t=wa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},oo(a),e}function uh(e){return e?(e=Ei,e):Ei}function dh(e,t,n,r,i,a){i=uh(i),r.context===null?r.context=i:r.pendingContext=i,r=co(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=lo(e,r,t),n!==null&&(Md(n,e,t),uo(n,e,t))}function fh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ph(e,t){fh(e,t),(e=e.alternate)&&fh(e,t)}function mh(e){if(e.tag===13||e.tag===31){var t=Ci(e,67108864);t!==null&&Md(t,e,67108864),ph(e,67108864)}}function hh(e){if(e.tag===13||e.tag===31){var t=kd();t=_t(t);var n=Ci(e,t);n!==null&&Md(n,e,t),ph(e,t)}}var gh=!0;function _h(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=2,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function vh(e,t,n,r){var i=F.T;F.T=null;var a=I.p;try{I.p=8,yh(e,t,n,r)}finally{I.p=a,F.T=i}}function yh(e,t,n,r){if(gh){var i=bh(r);if(i===null)Gf(e,t,r,xh,n),Mh(e,r);else if(Ph(i,e,t,n,r))r.stopPropagation();else if(Mh(e,r),t&4&&-1<jh.indexOf(e)){for(;i!==null;){var a=Nt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=at(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Qe(o);s.entanglements[1]|=c,o&=~c}Tf(a),!(X&6)&&(md=Be()+500,Ef(0,!1))}}break;case 31:case 13:s=Ci(a,2),s!==null&&Md(s,a,2),Ld(),ph(a,2)}if(a=bh(r),a===null&&Gf(e,t,r,xh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Gf(e,t,r,null,n)}}function bh(e){return e=yn(e),Sh(e)}var xh=null;function Sh(e){if(xh=null,e=Mt(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 xh=e,null}function Ch(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(Ve()){case He:return 2;case Ue:return 8;case We:case Ge:return 32;case Ke:return 268435456;default:return 32}default:return 32}}var wh=!1,Th=null,Eh=null,Dh=null,Oh=new Map,kh=new Map,Ah=[],jh=`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 Mh(e,t){switch(e){case`focusin`:case`focusout`:Th=null;break;case`dragenter`:case`dragleave`:Eh=null;break;case`mouseover`:case`mouseout`:Dh=null;break;case`pointerover`:case`pointerout`:Oh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:kh.delete(t.pointerId)}}function Nh(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=Nt(t),t!==null&&mh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Ph(e,t,n,r,i){switch(t){case`focusin`:return Th=Nh(Th,e,t,n,r,i),!0;case`dragenter`:return Eh=Nh(Eh,e,t,n,r,i),!0;case`mouseover`:return Dh=Nh(Dh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Oh.set(a,Nh(Oh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,kh.set(a,Nh(kh.get(a)||null,e,t,n,r,i)),!0}return!1}function Fh(e){var t=Mt(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,bt(e.priority,function(){hh(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,bt(e.priority,function(){hh(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 Ih(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);B=r,n.target.dispatchEvent(r),B=null}else return t=Nt(n),t!==null&&mh(t),e.blockedOn=n,!1;t.shift()}return!0}function Lh(e,t,n){Ih(e)&&n.delete(t)}function Rh(){wh=!1,Th!==null&&Ih(Th)&&(Th=null),Eh!==null&&Ih(Eh)&&(Eh=null),Dh!==null&&Ih(Dh)&&(Dh=null),Oh.forEach(Lh),kh.forEach(Lh)}function zh(e,n){e.blockedOn===n&&(e.blockedOn=null,wh||(wh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Rh)))}var Bh=null;function Vh(e){Bh!==e&&(Bh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Bh===e&&(Bh=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(Sh(r||n)===null)continue;break}var a=Nt(n);a!==null&&(e.splice(t,3),t-=3,Js(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Hh(e){function t(t){return zh(t,e)}Th!==null&&zh(Th,e),Eh!==null&&zh(Eh,e),Dh!==null&&zh(Dh,e),Oh.forEach(t),kh.forEach(t);for(var n=0;n<Ah.length;n++){var r=Ah[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ah.length&&(n=Ah[0],n.blockedOn===null);)Fh(n),n.blockedOn===null&&Ah.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[Ct]||null;if(typeof a==`function`)o||Vh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Ct]||null)s=o.formAction;else if(Sh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Vh(n)}}}function Uh(){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 Wh(e){this._internalRoot=e}Gh.prototype.render=Wh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;dh(n,kd(),e,t,null,null)},Gh.prototype.unmount=Wh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;dh(e.current,2,null,e,null,null),Ld(),t[wt]=null}};function Gh(e){this._internalRoot=e}Gh.prototype.unstable_scheduleHydration=function(e){if(e){var t=yt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ah.length&&t!==0&&t<Ah[n].priority;n++);Ah.splice(n,0,e),n===0&&Fh(e)}};var Kh=n.version;if(Kh!==`19.3.0`)throw Error(i(527,Kh,`19.3.0`));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var qh={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:F,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Jh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jh.isDisabled&&Jh.supportsFiber)try{Ye=Jh.inject(qh),Xe=Jh}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=_c,s=vc,c=yc;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=lh(e,1,!1,null,null,n,r,null,o,s,c,Uh),e[wt]=t.current,Uf(e),new Wh(t)}})),_=o(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=d(),y=_(),b=[`default`,`acceptEdits`,`auto`,`plan`],x=`~chats`;function S(e){return e===`~chats`?`Chats`:e}var C=[`normal`,`high`,`critical`],w=[`merge`,`devShip`,`computerControl`],T=[`merge`,`devShip`],E=String.raw`(?<![\w.-])g?sudo(?:\.exe)?(?![\w.-])`,D=String.raw`(?<![\w.-])runas(?:\.exe)?(?![\w.-])`,O=[`Bash`,`PowerShell`];function k(e,t){if(!O.includes(e)||typeof t.command!=`string`)return!1;let n=t.command;return[E,D].some(e=>new RegExp(e,`i`).test(n))}var ee=[{name:`Kubernetes or Helm commands`,kind:`command`,pattern:String.raw`\b(kubectl|helm)\b`},{name:`Terraform apply, destroy or state changes`,kind:`command`,pattern:String.raw`\bterraform\s+(apply|destroy|import|state\s+(rm|mv|push))\b`},{name:`Pulumi up, destroy or refresh`,kind:`command`,pattern:String.raw`\bpulumi\s+(up|destroy|refresh)\b`},{name:`Cloud CLI commands (aws, az, gcloud) that are not read-only`,kind:`command`,pattern:String.raw`\b(aws|az|gcloud)\b(?![^|;&]*\b(describe|list|get|show|ls|version|help)\b)`},{name:`Publishing to npm`,kind:`command`,pattern:String.raw`\bnpm\s+publish\b`},{name:`Pushing a container image`,kind:`command`,pattern:String.raw`\b(docker|podman)\s+push\b`},{name:`Pushing to main or master, or force-pushing`,kind:`command`,pattern:String.raw`\bgit\s+(?:-[Cc]\s+\S+\s+)*push\b[^|;&]*(\s--force\b|\s-f\b|\s--force-with-lease\b|\bmain\b|\bmaster\b)`},{name:`Elevated commands with gsudo or sudo`,kind:`command`,pattern:E},{name:`Starting a program as administrator (-Verb RunAs, runas)`,kind:`command`,pattern:D},{name:`.env files`,kind:`path`,pattern:String.raw`(^|[\\/])\.env(\.[^\\/]*)?$`},{name:`Files named like credentials`,kind:`path`,pattern:String.raw`credentials`},{name:`Key and certificate files (.pem, .key, .p12, .pfx)`,kind:`path`,pattern:String.raw`\.(pem|key|p12|pfx)$`}];function A(e,t){return ee.find(n=>n.kind===t&&n.pattern===e)?.name}function j(e,t){return ee.filter(n=>!(n.kind===`command`?e:t).includes(n.pattern))}function M(e){let t=j(e.commandPatterns,e.pathPatterns);return{...e,commandPatterns:[...e.commandPatterns,...t.filter(e=>e.kind===`command`).map(e=>e.pattern)],pathPatterns:[...e.pathPatterns,...t.filter(e=>e.kind===`path`).map(e=>e.pattern)]}}var te=[`Blocks a finished PR`,`Blocks a card from Ready`,`Process`,`Housekeeping`,`Record only`],N=`Accepted.`,P=`Changes needed:`;function ne(e,t){let n=t.trim();return e===`accept`?{answer:n?`${N}\n\n${n}`:N}:n?{answer:`${P} ${n}`}:{problem:`Say what needs changing in the box first.`}}var re=/\s*\(recommended\)\s*$/i,ie=e=>e.replace(/\*\*|`/g,``);function ae(e){let t=e.match(/^\*\*(.+?)\*\*[.:]?\s*([\s\S]*)$/);return t?{label:t[1].replace(/\.$/,``),detail:t[2].trim()}:{label:e,detail:``}}function oe(e){return`${e.key} — ${ie(ae(e.text).label)}`}function se(e,t){if(e?.trim())return e;let n=[];if(t.review){let e=t.review;return t.title&&n.push(`**Review: ${t.title}**`),n.push(`**What we were solving**\n\n${e.solving}`,`**What was done**\n\n${e.done}`),e.notes&&n.push(`**Notes**\n\n${e.notes}`),e.evidence?.length&&n.push(`**Evidence**\n\n${e.evidence.map(e=>`- ${e.caption} (\`${e.file.replace(/`/g,`'`)}\`)`).join(`
|
|
10
10
|
`)}`),n.push(`Answered "${N}" or "${P} …" on the review page.`),n.join(`
|
|
11
11
|
|
|
12
12
|
`)}t.title&&n.push(`**${t.title}**`),t.issue&&n.push(t.issue),t.evidence&&n.push(`**Evidence**\n\n${t.evidence}`),t.options?.length&&n.push(t.options.map(e=>`- ${e.key}) ${e.text}${e.cost?` Cost: ${e.cost}`:``}`).join(`
|
|
@@ -21,88 +21,88 @@ Error generating stack: `+e.message+`
|
|
|
21
21
|
|
|
22
22
|
`,Re=/^Board message in thread (\S+) "(.*)", (posted by this Ledung[^\n]*?|from \S+ user [^\n]*?|typed on \S+ by [^\n]*?)\. To: ([^\n]*?)\.\n\n(`{3,})\n/;function ze(e){let t=/^posted by this Ledung(?: \(project "(.*?)"\))? as @(\S+)$/.exec(e);return t?{kind:`out`,service:``,author:t[2],project:t[1]??null}:(t=/^from (\S+) user @(\S+?)'s Ledung(?: \(project "(.*?)", as its header says\))?;/.exec(e),t?{kind:`ledung`,service:t[1],author:t[2],project:t[3]??null}:(t=/^typed on (\S+) by @(\S+?), not through/.exec(e),t?{kind:`typed`,service:t[1],author:t[2],project:null}:null))}function Be(e){let t=Re.exec(e);if(!t)return null;let n=ze(t[3]);if(!n)return null;let r=t[5],i=e.slice(t[0].length),a=i.indexOf(`\n${r}`);if(a<0)return null;let o=i.slice(a+1+r.length);return o&&!o.startsWith(`
|
|
23
23
|
`)?null:{...n,threadId:t[1],title:t[2],to:t[4],text:i.slice(0,a),note:o.trim()}}function Ve(e){let t=[],n=[],r=()=>{n.length&&t.push({type:`text`,text:n.join(Le)}),n.length=0},i=0;for(;i<=e.length;){let a=e.slice(i),o=Ge(a);if(o){if(r(),t.push({type:`board`,mark:o.mark}),i+=o.length,i>=e.length)break;i+=7;continue}let s=a.indexOf(Le);if(n.push(s<0?a:a.slice(0,s)),s<0)break;i+=s+7}return r(),t}function He(e,t,n,r){if(!e||t)return null;let i=Ve(n??``);return r?i:i.filter(e=>e.type===`board`||e.text.split(Le).some(We))}var Ue=/^(?:.*\. )?(?:Your task, from your manager|Message from your manager)(?: ".*")?:$/,We=e=>Ue.test(e.split(`
|
|
24
|
-
`,1)[0]);function Ge(e){let t=Re.exec(e);if(!t)return null;let n=t[5],r=t[0].length,i=e.indexOf(`\n${n}`,r);if(i<0)return null;let a=i+1+n.length,o=e.indexOf(Le,a),s=o<0?e.length:o,c=Be(e.slice(0,s));return c?{mark:c,length:s}:null}var Ke=e=>/(^|__)board_post$/.test(e);function qe(e){let t=t=>typeof e[t]==`string`?e[t]:``;return{to:Array.isArray(e.to)?e.to.map(String).join(`, `):t(`to`),title:t(`title`),text:t(`text`),threadId:t(`thread`)}}function Je(e,t){return t.toLowerCase().split(/\s+/).filter(Boolean).every(t=>e.toLowerCase().includes(t))}function Ye(e,t){if(!e)return{used:[],others:[],hidden:0};let n=new Map(e.repos.map(e=>[e.repo.toLowerCase(),e.private])),r=e.used.filter(e=>Je(e.repo,t)).map(e=>({repo:e.repo,private:n.get(e.repo.toLowerCase())??null,projects:e.projects})),i=new Set(e.used.map(e=>e.repo.toLowerCase())),a=e.repos.filter(e=>!i.has(e.repo.toLowerCase())&&Je(e.repo,t)).map(e=>({repo:e.repo,private:e.private,projects:[]}));return{used:r,others:a.slice(0,60),hidden:Math.max(0,a.length-60)}}function Xe(e){return`${e.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g,`-`).replace(/^[-.]+|[-.]+$/g,``).replace(/-{2,}/g,`-`)||`ledung`}-board`.slice(0,100)}var Ze=`ledung.autocorrect`;function Qe(e){try{return e.getItem(Ze)===`1`}catch{return!1}}function $e(e,t){try{t?e.setItem(Ze,`1`):e.removeItem(Ze)}catch{}}var et={autoCorrect:`off`},tt={};function nt(e){return e?tt:et}var rt=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],it=`ledung.theme`;function at(e){return e===`light`||e===`dark`?e:`system`}function ot(e){try{return at(e.getItem(it))}catch{return`system`}}function st(e,t){try{t===`system`?e.removeItem(it):e.setItem(it,t)}catch{}}function ct(e,t){t===`system`?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,t)}var lt={starting:`Ready`,idle:`Ready`,queued:`Waiting for a free place`,running:`Working`,waiting:`Needs your answer`,stopping:`Stopping`,ended:`Ended`};function ut(e){return e.status===`starting`||e.paused&&e.status===`running`?`idle`:e.status}var dt=`ledung.statusDot`;function ft(e){try{return e.getItem(dt)
|
|
25
|
-
`):void 0}var Et={red:{label:`Red`,light:`#b3261e`,dark:`#f28b82`},orange:{label:`Orange`,light:`#a94600`,dark:`#f5a35c`},amber:{label:`Amber`,light:`#865d00`,dark:`#e6c34d`},green:{label:`Green`,light:`#1d7a2c`,dark:`#81c995`},teal:{label:`Teal`,light:`#00766a`,dark:`#4fd1c5`},blue:{label:`Blue`,light:`#2457c5`,dark:`#8ab4f8`},purple:{label:`Purple`,light:`#6d3fb8`,dark:`#c3a6ff`},pink:{label:`Pink`,light:`#ab2c6b`,dark:`#f48fb1`}};function Dt(e,t){return e?t===`manager`||e.sessions===`same`?e.manager:e.sessions===`none`?null:e.sessions:null}var Ot=[`green`,`purple`,`teal`,`amber`,`pink`,`orange`];function kt(e){return Et[e]}function At(e,t,n=!1){return n?{tabs:null,remote:!1,here:e.find(e=>e.here)??null}:{tabs:e.length>1?e:null,remote:t,here:e.find(e=>e.here)??null}}var jt=3e3,Mt=`ledung:paired?`,Nt=`ledung:paired`;function Pt(e,t,n,r=`not-paired`){return!!e.linked&&!e.here&&!t&&!n&&r===`not-paired`}function Ft(){return Mt}function It(e,t){return t&&e===Mt?Nt:null}function Lt(e,t){let n;try{n=new URL(t).origin}catch{return!1}return e.fromFrame&&e.origin===n&&e.data===Nt}function Rt(e,t){return t!==null&&e.some(e=>e.id===t&&!e.here)?t:null}function zt(e){let t=/^#\/c\/([^/]+)$/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1]).toLowerCase()}catch{return null}}function Bt(e){if(!e)return;let{light:t,dark:n}=kt(e.colour);return{"--cc-light":t,"--cc-dark":n}}function Vt(e=globalThis){return e.self!==e.top}function Ht(e){return e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}function Ut(e,t,n){return e.here?t===null?0:n:e.waiting??0}var Wt=[it,Ze,dt,ht,yt],Gt=16,z=`ledung:settings?`,Kt=`ledung:settings`,qt=`ledung:setting`,Jt=e=>typeof e==`string`&&Wt.includes(e),Yt=e=>typeof e==`string`&&e.length<=Gt,Xt=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null;function Zt(e){let t={};for(let[n,r]of Object.entries(Xt(e)??{}))Jt(n)&&Yt(r)&&(t[n]=r);return t}function Qt(e){return`ledung.frameSettings.${e}`}function $t(e,t){try{let n=e.getItem(Qt(t));return n===null?null:Zt(JSON.parse(n))}catch{return null}}function en(e,t,n,r){let i;try{i=new URL(t).origin}catch{return null}if(!e.fromFrame||e.origin!==i)return null;let a=Xt(e.data);if(a?.type===z)return{type:Kt,settings:$t(r,n)};if(a?.type===qt&&Jt(a.key)&&(a.value===null||Yt(a.value))){let e={...$t(r,n)};a.value===null?delete e[a.key]:e[a.key]=a.value;try{r.setItem(Qt(n),JSON.stringify(e))}catch{}}return null}function tn(e,t,n,r){let i=en(e,t.url,t.id,n);return i&&r(i),Lt(e,t.url)}function nn(){return{type:z}}function rn(e,t){let n=Xt(e);if(t&&n?.type===Kt)return n.settings===null?null:Zt(n.settings)}function an(e,t){try{for(let n of Wt){let r=t[n];r===void 0?e.removeItem(n):e.setItem(n,r)}}catch{}}function on(e){let t=[];try{for(let n of Wt){let r=e.getItem(n);Yt(r)&&t.push({type:qt,key:n,value:r})}}catch{}return t}function sn(e,t){return{getItem:t=>e().getItem(t),setItem:(n,r)=>{e().setItem(n,r),Jt(n)&&Yt(r)&&t({type:qt,key:n,value:r})},removeItem:n=>{e().removeItem(n),Jt(n)&&t({type:qt,key:n,value:null})}}}var cn=null,ln=e=>{cn!==null&&window.parent.postMessage(e,cn)},un=sn(()=>localStorage,ln);function dn(){Vt()&&(window.addEventListener(`message`,e=>{let t=rn(e.data,e.source===window.parent);if(t!==void 0){if(cn=e.origin,t===null)for(let e of on(localStorage))ln(e);else an(localStorage,t),window.dispatchEvent(new StorageEvent(`storage`,{key:null}))}}),window.parent.postMessage(nn(),`*`))}var fn=new Set,pn=Qe(localStorage),mn=e=>{pn=e;for(let e of fn)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.autocorrect`||e.key===null)&&mn(Qe(localStorage))});var hn=e=>(fn.add(e),()=>{fn.delete(e)}),gn=()=>pn;function _n(){return[(0,v.useSyncExternalStore)(hn,gn),e=>{$e(un,e),mn(e)}]}function B(){return nt((0,v.useSyncExternalStore)(hn,gn))}var vn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),V=o(((e,t)=>{t.exports=vn()}))();function yn({board:e,open:t,connection:n,onClick:r}){let i=Ie(e);return i?(0,V.jsx)(`button`,{className:`board-chip ${i.level}${n?` ${n.className}`:``}${t?` on`:``}`,title:`${n?`${n.text} `:``}${i.text} — ${i.title}`,"aria-pressed":t,onClick:r,children:i.text}):null}var bn=e=>{if(!e)return`not yet`;let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<90?`${t} s ago`:`${Math.round(t/60)} min ago`},xn=e=>e.trim().replace(/^@/,``),Sn=(e,t)=>e.toLowerCase()===t.toLowerCase(),Cn=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,wn=e=>e.state===`ok`?`On`:e.state===`starting`?`Starting`:e.state===`error`?`Problem`:`Off`;function Tn({board:e}){return e?.configured?(0,V.jsxs)(`section`,{className:`board-settings`,children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsxs)(`p`,{className:`muted`,children:[e.identity?(0,V.jsxs)(V.Fragment,{children:[`Every board posts as `,(0,V.jsxs)(`strong`,{children:[`@`,e.identity]}),`, the GitHub login of this computer (`,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}):(0,V.jsxs)(V.Fragment,{children:[`Boards post as this computer's GitHub login (`,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}),` `,`Each project chooses its board and who may post to its manager in its own settings.`]}),e.boards.map(t=>(0,V.jsx)(En,{repo:t,board:e},t.repo))]}):(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsx)(`p`,{className:`muted`,children:`Managers can talk to managers in other people's Ledungs through a shared board (a GitHub repository). No project uses one yet: each project chooses its board, who may post to it and its channels in its own settings, under Message board.`})]})}function En({repo:e,board:t}){let n=e.state===`ok`?`ok`:e.state===`error`?`warn`:`idle`;return(0,V.jsxs)(`div`,{className:`board-block`,children:[(0,V.jsxs)(`p`,{className:`board-state`,children:[(0,V.jsx)(`span`,{className:`board-dot ${n}`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`mono`,children:e.repo}),` · `,wn(e),e.state===`ok`||e.state===`error`?(0,V.jsxs)(V.Fragment,{children:[` · checked `,bn(e.lastPollAt)]}):null]})]}),e.error&&(0,V.jsx)(`p`,{className:`board-error`,children:e.error}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Projects: `,e.projects.map((n,r)=>(0,V.jsxs)(`span`,{children:[r?`, `:``,n,t.projects[n]?.enabled?``:` (off)`,e.frontDesk===n?` (front desk)`:``]},n)),e.frontDesk?null:(0,V.jsxs)(V.Fragment,{children:[` · no front desk: posts to just @`,t.identity??`you`,` reach nobody`]})]}),(e.ignored.length>0||e.quiet>0||e.paused.length>0)&&(0,V.jsxs)(`ul`,{className:`board-counts`,children:[e.ignored.map(e=>(0,V.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` from `,(0,V.jsxs)(`strong`,{children:[`@`,e.login]}),` ignored: no project here allows them (last `,bn(e.lastAt),`).`]},e.login)),e.quiet>0&&(0,V.jsxs)(`li`,{children:[e.quiet,` post`,e.quiet===1?``:`s`,` in the last day reached no manager (no front desk, or the project's board is off).`]}),e.paused.map(e=>(0,V.jsxs)(`li`,{children:[`Thread `,e.threadId,` no longer wakes `,e.project,` until `,new Date(e.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),` (too many wakes in an hour).`]},`${e.project}/${e.threadId}`))]})]})}var Dn=(e,t)=>{let n=e?.projects[t],r=n?.repo??``;return{enabled:n?.enabled??!1,repo:r,allow:n?.allow??[],channels:(n?.channels??[]).join(` `),frontDesk:!!r&&e?.boards.find(e=>e.repo===r)?.frontDesk===t}},On=e=>e.split(/[\s,]+/).filter(Boolean).map(e=>e.replace(/^#/,``).toLowerCase()).join(` `);function kn(e,t){let n=e.repo.trim();return[e.enabled!==t.enabled,n!==t.repo,e.frontDesk!==t.frontDesk,On(e.channels)!==On(t.channels),e.allow.length!==t.allow.length||e.allow.some(e=>!t.allow.some(t=>Sn(t,e)))].filter(Boolean).length}function An(e){let t=e.repo.trim();return t&&!Cn.test(t)?`The board repository is owner/name.`:e.enabled&&!t?`Name the board repository to turn the board on.`:null}function jn(e,t){let n=t.repo.trim();return R.setBoardProject(e,{enabled:t.enabled,repo:n||null,allow:t.allow,channels:t.channels.split(/[\s,]+/).filter(Boolean),frontDesk:t.frontDesk&&!!n})}function Mn({board:e,project:t,projects:n,form:r,onChange:i}){let a=B(),o=Dn(e,t),s=e=>i({...r,...e}),c=r.repo.trim(),l=!c||Cn.test(c),u=n.map(e=>e.name).filter(n=>n!==t&&e?.projects[n]?.repo),d=e?.boards.find(e=>e.repo===c),f=(d?.projects??[]).filter(e=>e!==t),p=d?.frontDesk??null,m=e?.projects[t]?.ignored??[],h=t=>{let n=e?.projects[t];n&&s({repo:n.repo??``,allow:[...n.allow],channels:n.channels.join(` `),frontDesk:(n.repo??``)===r.repo.trim()&&r.frontDesk})};return(0,V.jsxs)(`div`,{className:`board-settings`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Lets this project's manager read and post to managers in other people's Ledungs, on a board (a GitHub repository) and only with the people you allow here. Off by default.`}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.enabled,onChange:e=>s({enabled:e.target.checked})}),` Use the board in this project`]}),u.length>0&&(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Copy from another project`,(0,V.jsxs)(`select`,{"aria-label":`Copy the board settings from`,value:``,onChange:e=>h(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`Choose a project…`}),u.map(t=>(0,V.jsxs)(`option`,{value:t,children:[t,` (`,e.projects[t].repo,`)`]},t))]})]}),(0,V.jsx)(Nn,{project:t,value:r.repo,ok:l,onChange:e=>s({repo:e})}),c&&l&&(0,V.jsxs)(`div`,{className:`board-warning`,children:[(0,V.jsxs)(`strong`,{children:[`Everyone with access to `,c,` can read every post on it`]}),`, whichever project or Ledung wrote it. The list below only decides who can reach this project's manager, not who can read. A sensitive project should have a board repository of its own.`,` `,(0,V.jsx)(`strong`,{children:`Files attached to posts`}),` (screenshots, logs) can be read and copied by the same people; Ledung asks you before any leaves. Pruning takes them off the board's branch after their thread closes, but can't take back a copy someone made, and unreachable commits and cached views of them can remain on GitHub until GitHub Support removes them.`,f.length>0&&(0,V.jsxs)(V.Fragment,{children:[` Also on this board here: `,f.join(`, `),`.`]})]}),c&&l&&(0,V.jsx)(In,{project:t,savedRepo:o.repo,repo:c,allow:r.allow,active:d?.state===`ok`,onChange:e=>s({allow:e})}),m.length>0&&(0,V.jsx)(`ul`,{className:`board-counts`,children:m.map(e=>(0,V.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` to this project ignored from `,(0,V.jsxs)(`strong`,{children:[`@`,e.login]}),`, who isn't on its list (last `,bn(e.lastAt),`).`,` `,!r.allow.some(t=>Sn(t,e.login))&&(0,V.jsxs)(`button`,{className:`small`,onClick:()=>s({allow:[...r.allow,e.login]}),children:[`Allow @`,e.login]})]},e.login))}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.frontDesk,disabled:!c||!l,onChange:e=>s({frontDesk:e.target.checked})}),` `,(0,V.jsxs)(`span`,{children:[`Front desk on this board: gets posts addressed to just `,(0,V.jsxs)(`span`,{className:`mono`,children:[`@`,e?.identity??`you`]})]})]}),p&&p!==t&&r.frontDesk&&(0,V.jsxs)(`p`,{className:`muted`,children:[p,` is the front desk now; saving moves it here.`]}),p&&p!==t&&!r.frontDesk&&(0,V.jsxs)(`p`,{className:`muted`,children:[`The front desk on this board is `,p,`.`]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Channels it follows`,(0,V.jsx)(`input`,{...a,value:r.channels,disabled:!r.enabled,placeholder:`#ledung #ops`,onChange:e=>s({channels:e.target.value})})]}),(0,V.jsx)(`p`,{className:`muted`,children:`A channel's posts wake nobody; the manager reads them when it looks. A running manager gets the board's tools at its next start or resume.`}),r.enabled&&!c&&(0,V.jsx)(`p`,{className:`muted`,children:`Name the board repository to turn it on.`})]})}function Nn({project:e,value:t,ok:n,onChange:r,load:i,label:a=`Board repository`,newName:o}){let s=B(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(!1),x=y?t:``,S=(0,v.useCallback)(t=>{h(!0),_(null),(i??(t=>R.boardRepos(e,t)))(t).then(p,e=>_(e.message)).finally(()=>h(!1))},[e,i]);(0,v.useEffect)(()=>{p(null),l(!1),d(!1)},[e]);let C=()=>{l(!0),!f&&!m&&S(!1)},w=e=>{r(e),b(!1),l(!1),d(!1)},T=Ye(f,x),E=x.trim(),D=Cn.test(E)&&!T.used.some(e=>e.repo.toLowerCase()===E.toLowerCase())&&!T.others.some(e=>e.repo.toLowerCase()===E.toLowerCase());return(0,V.jsxs)(`div`,{className:`repo-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(l(!1),b(!1))},onKeyDown:e=>{e.key===`Escape`&&l(!1)},children:[(0,V.jsxs)(`label`,{className:`board-channels`,children:[a,(0,V.jsx)(`input`,{...s,className:`mono`,value:t,placeholder:`Choose, search or type owner/name`,"aria-invalid":!n,"aria-expanded":c,role:`combobox`,"aria-controls":`repo-picker-list`,autoComplete:`off`,spellCheck:!1,onFocus:C,onClick:C,onChange:e=>{l(!0),b(!0),r(e.target.value),!f&&!m&&S(!1)},onKeyDown:e=>{if(e.key===`Enter`&&c){e.preventDefault();let t=T.used[0]??T.others[0];D?w(E):t?w(t.repo):l(!1)}}})]}),c&&!u&&(0,V.jsxs)(`div`,{className:`repo-list`,id:`repo-picker-list`,role:`listbox`,children:[(0,V.jsxs)(`div`,{className:`board-block-head`,children:[(0,V.jsx)(`span`,{className:`muted`,children:m?`Reading your repositories…`:f?`${f.repos.length}${f.truncated?`+`:``} repositories you can reach`:``}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:m,onClick:()=>S(!0),title:`Read the list from GitHub again`,children:`Refresh`})]}),g&&(0,V.jsx)(`p`,{className:`board-error`,children:g}),f?.error&&(0,V.jsxs)(`p`,{className:`board-error`,children:[f.error,` You can still type owner/name.`]}),T.used.length>0&&(0,V.jsx)(`p`,{className:`repo-head`,children:`Boards your other projects use`}),T.used.map(e=>(0,V.jsx)(Pn,{row:e,onPick:w},`u${e.repo}`)),T.others.length>0&&(0,V.jsx)(`p`,{className:`repo-head`,children:`Your GitHub repositories`}),T.others.map(e=>(0,V.jsx)(Pn,{row:e,onPick:w},e.repo)),T.hidden>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[T.hidden,` more: type to narrow the list.`]}),D&&(0,V.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>w(E),children:[(0,V.jsxs)(`span`,{className:`mono`,children:[`Use `,E]}),(0,V.jsx)(`span`,{className:`muted`,children:` (typed; checked when you save)`})]}),f&&!f.error&&!T.used.length&&!T.others.length&&!D&&(0,V.jsx)(`p`,{className:`muted`,children:`Nothing matches. Type the whole name as owner/name to use a repository that isn't listed.`}),(0,V.jsxs)(`button`,{type:`button`,className:`small repo-create`,onClick:()=>d(!0),children:[`Create a new private `,o?``:`board `,`repo…`]})]}),!n&&!c&&(0,V.jsx)(`p`,{className:`board-error`,children:`Write the repository as owner/name.`}),c&&u&&(0,V.jsx)(Fn,{project:e,name:o,onCancel:()=>d(!1),onCreated:w})]})}function Pn({row:e,onPick:t}){return(0,V.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>t(e.repo),children:[(0,V.jsx)(`span`,{className:`mono repo-name`,children:e.repo}),e.private!==null&&(0,V.jsx)(`span`,{className:`chip ${e.private?``:`warn`}`,children:e.private?`private`:`public`}),e.projects.length>0&&(0,V.jsxs)(`span`,{className:`muted`,children:[` used by `,e.projects.join(`, `)]})]})}function Fn({project:e,name:t,onCancel:n,onCreated:r}){let i=B(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(()=>t??Xe(e)),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{R.boardOwners().then(e=>{o(e.owners),c(e.owners[0]?.login??``)},e=>f(e.message))},[]);let h=/^[A-Za-z0-9_.-]{1,100}$/.test(l)&&l!==`.`&&l!==`..`,g=async()=>{m(!0),f(null);try{r((await R.createBoardRepo(s,l)).repo)}catch(e){f(e.message),m(!1)}};return(0,V.jsxs)(`div`,{className:`repo-list repo-create-form`,role:`dialog`,"aria-label":`Create a new private ${t?``:`board `}repository`,children:[(0,V.jsxs)(`h4`,{children:[`Create a new private `,t?``:`board `,`repository`]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`This creates a new `,(0,V.jsx)(`strong`,{children:`private`}),` repository on GitHub, as your `,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),` login. Only you can see it until you add people on GitHub.`]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Owner`,(0,V.jsxs)(`select`,{value:s,disabled:!a||p,onChange:e=>c(e.target.value),children:[!a&&(0,V.jsx)(`option`,{children:`Reading your accounts…`}),(a??[]).map(e=>(0,V.jsxs)(`option`,{value:e.login,children:[e.login,e.kind===`user`?` (you)`:` (organisation)`]},e.login))]})]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Name`,(0,V.jsx)(`input`,{...i,className:`mono`,value:l,disabled:p,"aria-invalid":!h,onChange:e=>u(e.target.value.trim())})]}),!h&&(0,V.jsx)(`p`,{className:`board-error`,children:`Use letters, digits, - _ and . only.`}),d&&(0,V.jsx)(`p`,{className:`board-error`,children:d}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`button`,{type:`button`,disabled:p||!s||!h,onClick:()=>void g(),children:p?`Creating…`:`Confirm: create ${s}/${l}`}),(0,V.jsx)(`button`,{type:`button`,disabled:p,onClick:n,children:`Cancel`})]})]})}function In({project:e,savedRepo:t,repo:n,allow:r,active:i,onChange:a}){let o=B(),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=!!t&&t===n,g=(0,v.useCallback)(()=>{u(!0),f(null),R.boardPeople(e).then(c,e=>f(e.message)).finally(()=>u(!1))},[e]);(0,v.useEffect)(()=>{c(null),h&&g()},[h,t,i,g]);let _=e=>r.some(t=>Sn(t,e)),y=e=>a(_(e)?r.filter(t=>!Sn(t,e)):[...r,e]),b=new Set((s?.lostAccess??[]).map(e=>e.toLowerCase())),x=new Set((s?.people??[]).map(e=>e.id.toLowerCase())),S=r.filter(e=>!x.has(e.toLowerCase())),C=()=>{let e=xn(p);e&&(m(``),_(e)||a([...r,e]))};return(0,V.jsxs)(`div`,{className:`board-block`,children:[(0,V.jsxs)(`div`,{className:`board-block-head`,children:[(0,V.jsx)(`h4`,{children:`Who may post to this project's manager`}),(0,V.jsx)(`button`,{className:`small`,disabled:l||!h,onClick:g,title:`Read the list of people with access to the board again`,children:l?`Reading…`:`Refresh`})]}),d&&(0,V.jsx)(`p`,{className:`board-error`,children:d}),!h&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Save to see who has access to `,n,`.`]}),s?.note&&(0,V.jsx)(`p`,{className:`muted`,children:s.note}),s&&s.source!==`none`&&(0,V.jsxs)(`p`,{className:`muted`,children:[s.source===`collaborators`?`People with access to ${n}: they can all read its posts.`:`Members of ${n.split(`/`)[0]}: people with access to ${n} can read its posts.`,` Having access doesn't let anyone reach this manager: tick the people you trust.`]}),(0,V.jsxs)(`ul`,{className:`board-people`,children:[(s?.people??[]).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_(e.id),onChange:()=>y(e.id)}),e.avatarUrl?(0,V.jsx)(`img`,{className:`avatar`,src:e.avatarUrl,alt:``,width:28,height:28,loading:`lazy`}):(0,V.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{className:`person`,children:[(0,V.jsx)(`span`,{children:e.name??e.id}),e.name&&(0,V.jsxs)(`span`,{className:`muted`,children:[` @`,e.id]})]}),b.has(e.id.toLowerCase())&&(0,V.jsx)(`span`,{className:`chip warn`,title:`On the list, but no longer has access to the board repository`,children:`lost access`})]})},e.id)),S.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>y(e)}),(0,V.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`person`,children:(0,V.jsxs)(`span`,{children:[`@`,e]})}),s?.source===`collaborators`&&(0,V.jsx)(`span`,{className:`chip warn`,title:`On the list, but not among the people with access to the board repository`,children:`lost access`})]})},e)),h&&s&&!s.people.length&&!S.length&&(0,V.jsx)(`li`,{className:`muted`,children:`No one is listed. Type a login below.`})]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`input`,{...o,value:p,placeholder:`GitHub login, e.g. magto`,"aria-label":`GitHub login to allow`,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&C()}}),(0,V.jsx)(`button`,{className:`small`,disabled:!xn(p),onClick:C,children:`Allow`})]})]})}var Ln={out:`Post from this manager`,ledung:`Board message`,typed:`Typed on the board`};function Rn({mark:e,time:t,onOpenThread:n}){let r=e.kind===`out`?(0,V.jsxs)(V.Fragment,{children:[`to `,e.to]}):e.kind===`ledung`?(0,V.jsxs)(V.Fragment,{children:[`from `,(0,V.jsxs)(`strong`,{children:[`@`,e.author]}),`'s Ledung`,e.project?` (project ${e.project})`:``]}):(0,V.jsxs)(V.Fragment,{children:[`typed on `,e.service||`the board`,` by `,(0,V.jsxs)(`strong`,{children:[`@`,e.author]})]});return(0,V.jsxs)(`div`,{className:`msg board-post ${e.kind}`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:Ln[e.kind]}),(0,V.jsx)(`span`,{className:`board-from`,children:r}),t]}),(0,V.jsxs)(`div`,{className:`board-thread`,children:[`Thread `,e.threadId?`#${e.threadId} `:``,e.title&&(0,V.jsxs)(V.Fragment,{children:[`“`,e.title,`”`]}),n&&e.threadId&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>n(e.threadId),children:`Open in Board`})]}),e.kind!==`out`&&e.to&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · to `,e.to]})]}),(0,V.jsx)(`div`,{className:`msg-body plain`,children:e.text}),(0,V.jsx)(`div`,{className:`muted board-trust`,children:e.kind===`out`?`Sent from this Ledung.`:e.kind===`ledung`?`Sender verified by the board service; not from you. A post can't approve anything.`:`Sender verified by the board service. Typed by that person, not through a Ledung; not from you.`})]})}function zn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Bn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Vn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hn={};function Un(e,t){return((t||Hn).jsx?Vn:Bn).test(e)}var Wn=/[ \t\n\f\r]/g;function Gn(e){return typeof e==`object`?e.type===`text`&&Kn(e.value):Kn(e)}function Kn(e){return e.replace(Wn,``)===``}var qn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};qn.prototype.normal={},qn.prototype.property={},qn.prototype.space=void 0;function Jn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new qn(n,r,t)}function Yn(e){return e.toLowerCase()}var Xn=class{constructor(e,t){this.attribute=t,this.property=e}};Xn.prototype.attribute=``,Xn.prototype.booleanish=!1,Xn.prototype.boolean=!1,Xn.prototype.commaOrSpaceSeparated=!1,Xn.prototype.commaSeparated=!1,Xn.prototype.defined=!1,Xn.prototype.mustUseProperty=!1,Xn.prototype.number=!1,Xn.prototype.overloadedBoolean=!1,Xn.prototype.property=``,Xn.prototype.spaceSeparated=!1,Xn.prototype.space=void 0;var Zn=s({boolean:()=>H,booleanish:()=>$n,commaOrSpaceSeparated:()=>rr,commaSeparated:()=>nr,number:()=>U,overloadedBoolean:()=>er,spaceSeparated:()=>tr}),Qn=0,H=ir(),$n=ir(),er=ir(),U=ir(),tr=ir(),nr=ir(),rr=ir();function ir(){return 2**++Qn}var ar=Object.keys(Zn),or=class extends Xn{constructor(e,t,n,r){let i=-1;if(super(e,t),sr(this,`space`,r),typeof n==`number`)for(;++i<ar.length;){let e=ar[i];sr(this,ar[i],(n&Zn[e])===Zn[e])}}};or.prototype.defined=!0;function sr(e,t,n){n&&(e[t]=n)}function cr(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new or(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Yn(r)]=r,n[Yn(a.attribute)]=r}return new qn(t,n,e.space)}var lr=cr({properties:{ariaActiveDescendant:null,ariaAtomic:$n,ariaAutoComplete:null,ariaBusy:$n,ariaChecked:$n,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:tr,ariaCurrent:null,ariaDescribedBy:tr,ariaDetails:null,ariaDisabled:$n,ariaDropEffect:tr,ariaErrorMessage:null,ariaExpanded:$n,ariaFlowTo:tr,ariaGrabbed:$n,ariaHasPopup:null,ariaHidden:$n,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:tr,ariaLevel:U,ariaLive:null,ariaModal:$n,ariaMultiLine:$n,ariaMultiSelectable:$n,ariaOrientation:null,ariaOwns:tr,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:$n,ariaReadOnly:$n,ariaRelevant:null,ariaRequired:$n,ariaRoleDescription:tr,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:$n,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function ur(e,t){return t in e?e[t]:t}function dr(e,t){return ur(e,t.toLowerCase())}var fr=cr({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:nr,acceptCharset:tr,accessKey:tr,action:null,allow:null,allowFullScreen:H,allowPaymentRequest:H,allowUserMedia:H,alpha:H,alt:null,as:null,async:H,autoCapitalize:null,autoComplete:tr,autoFocus:H,autoPlay:H,blocking:tr,capture:null,charSet:null,checked:H,cite:null,className:tr,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:$n,controls:H,controlsList:tr,coords:U|nr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:er,draggable:$n,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:H,formTarget:null,headers:tr,height:U,hidden:er,high:U,href:null,hrefLang:null,htmlFor:tr,httpEquiv:tr,id:null,imageSizes:null,imageSrcSet:null,inert:H,inputMode:null,integrity:null,is:null,isMap:H,itemId:null,itemProp:tr,itemRef:tr,itemScope:H,itemType:tr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:H,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:H,muted:H,name:null,nonce:null,noModule:H,noValidate:H,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:H,optimum:U,pattern:null,ping:tr,placeholder:null,playsInline:H,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:H,referrerPolicy:null,rel:tr,required:H,reversed:H,rows:U,rowSpan:U,sandbox:tr,scope:null,scoped:H,seamless:H,selected:H,shadowRootClonable:H,shadowRootCustomElementRegistry:H,shadowRootDelegatesFocus:H,shadowRootMode:null,shadowRootSerializable:H,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:$n,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:H,useMap:null,value:$n,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:tr,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:H,declare:H,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:H,noHref:H,noShade:H,noWrap:H,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:$n,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:H,disablePictureInPicture:H,disableRemotePlayback:H,exportParts:nr,part:tr,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:dr}),pr=cr({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:rr,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:tr,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:H,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:nr,g2:nr,glyphName:nr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:rr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,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:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:tr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:rr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:rr,rev:rr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:rr,requiredFeatures:rr,requiredFonts:rr,requiredFormats:rr,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:rr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:rr,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:rr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:ur}),mr=cr({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()}}),hr=cr({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:dr}),gr=cr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),_r={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`},vr=/[A-Z]/g,yr=/-[a-z]/g,br=/^data[-\w.:]+$/i;function xr(e,t){let n=Yn(t),r=t,i=Xn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&br.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(yr,Cr);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!yr.test(e)){let n=e.replace(vr,Sr);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=or}return new i(r,t)}function Sr(e){return`-`+e.toLowerCase()}function Cr(e){return e.charAt(1).toUpperCase()}var wr=Jn([lr,fr,mr,hr,gr],`html`),Tr=Jn([lr,pr,mr,hr,gr],`svg`);function Er(e){return e.join(` `).trim()}var Dr=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(`
|
|
26
|
-
`);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})),Or=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(Dr());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}})),kr=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))}})),Ar=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Or()),r=kr();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})),jr=Nr(`end`),Mr=Nr(`start`);function Nr(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 Pr(e){let t=Mr(e),n=jr(e);if(t&&n)return{start:t,end:n}}function Fr(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Lr(e.position):`start`in e||`end`in e?Lr(e):`line`in e||`column`in e?Ir(e):``}function Ir(e){return Rr(e&&e.line)+`:`+Rr(e&&e.column)}function Lr(e){return Ir(e&&e.start)+`-`+Ir(e&&e.end)}function Rr(e){return e&&typeof e==`number`?e:1}var zr=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=Fr(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}};zr.prototype.file=``,zr.prototype.name=``,zr.prototype.reason=``,zr.prototype.message=``,zr.prototype.stack=``,zr.prototype.column=void 0,zr.prototype.line=void 0,zr.prototype.ancestors=void 0,zr.prototype.cause=void 0,zr.prototype.fatal=void 0,zr.prototype.place=void 0,zr.prototype.ruleId=void 0,zr.prototype.source=void 0;var Br=l(Ar(),1),Vr={}.hasOwnProperty,Hr=new Map,Ur=/[A-Z]/g,Wr=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Gr=new Set([`td`,`th`]),Kr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function qr(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=ii(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=ri(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`?Tr:wr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Jr(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Jr(e,t,n){if(t.type===`element`)return Yr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Xr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Qr(e,t,n);if(t.type===`mdxjsEsm`)return Zr(e,t);if(t.type===`root`)return $r(e,t,n);if(t.type===`text`)return ei(e,t)}function Yr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Tr,e.schema=i),e.ancestors.push(t);let a=ui(e,t.tagName,!1),o=ai(e,t),s=si(e,t);return Wr.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Gn(e)})),ti(e,o,a,t),ni(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Xr(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)}di(e,t.position)}function Zr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);di(e,t.position)}function Qr(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Tr,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:ui(e,t.name,!0),o=oi(e,t),s=si(e,t);return ti(e,o,a,t),ni(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function $r(e,t,n){let r={};return ni(r,si(e,t)),e.create(t,e.Fragment,r,n)}function ei(e,t){return t.value}function ti(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ni(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ri(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 ii(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Mr(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 ai(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Vr.call(t.properties,i)){let a=ci(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Gr.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 oi(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 di(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 di(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function si(e,t){let n=[],r=-1,i=e.passKeys?new Map:Hr;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=Jr(e,a,o);s!==void 0&&n.push(s)}return n}function ci(e,t,n){let r=xr(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?zn(n):Er(n)),r.property===`style`){let t=typeof n==`object`?n:li(e,String(n));return e.stylePropertyNameCase===`css`&&(t=fi(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?_r[r.property]||r.property:r.attribute,n]}}function li(e,t){try{return(0,Br.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new zr("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=Kr+`#cannot-parse-style-attribute`,r}}function ui(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=Un(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=Un(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Vr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);di(e)}function di(e,t){let n=new zr("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=Kr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function fi(e){let t={},n;for(n in e)Vr.call(e,n)&&(t[pi(n)]=e[n]);return t}function pi(e){let t=e.replace(Ur,mi);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function mi(e){return`-`+e.toLowerCase()}var hi={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`]},gi={};function _i(e,t){let n=t||gi;return vi(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function vi(e,t,n){if(bi(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 yi(e.children,t,n)}return Array.isArray(e)?yi(e,t,n):``}function yi(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=vi(e[i],t,n);return r.join(``)}function bi(e){return!!(e&&typeof e==`object`)}var xi=document.createElement(`i`);function Si(e){let t=`&`+e+`;`;xi.innerHTML=t;let n=xi.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Ci(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 wi(e,t){return e.length>0?(Ci(e,e.length,0,t),e):t}var Ti={}.hasOwnProperty;function Ei(e){let t={},n=-1;for(;++n<e.length;)Di(t,e[n]);return t}function Di(e,t){let n;for(n in t){let r=(Ti.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ti.call(r,a)||(r[a]=[]);let e=i[a];Oi(r[a],Array.isArray(e)?e:e?[e]:[])}}}function Oi(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Ci(e,0,0,r)}function ki(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 Ai(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var ji=Bi(/[A-Za-z]/),Mi=Bi(/[\dA-Za-z]/),Ni=Bi(/[#-'*+\--9=?A-Z^-~]/);function Pi(e){return e!==null&&(e<32||e===127)}var Fi=Bi(/\d/),Ii=Bi(/[\dA-Fa-f]/),Li=Bi(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var Ri=Bi(/\p{P}|\p{S}/u),zi=Bi(/\s/);function Bi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Vi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Mi(e.charCodeAt(n+1))&&Mi(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 q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Hi(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&K(t)?(e.enter(r),c(t)):l(t)}function c(t){return K(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Ui={tokenize:Wi};function Wi(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(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);else return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Gi=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Ki(this,e,t,n,!1)}addBefore(e,t,n){Ki(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 Ki(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 qi={tokenize:Yi},Ji={tokenize:Xi};function Yi(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 Gi;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(Ji,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(Ji,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);else 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);else return W(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 Gi;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 Xi(e,t,n){return q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function J(e){if(e===null||G(e)||zi(e))return 1;if(Ri(e))return 2}function Zi(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 Qi={name:`attention`,resolveAll:$i,tokenize:ea};function $i(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};ta(o,-a),ta(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=wi(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=wi(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=wi(r,Zi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=wi(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=wi(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Ci(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 ea(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=J(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=J(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 ta(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var na={name:`autolink`,tokenize:ra};function ra(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 ji(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Mi(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||Mi(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||Pi(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Ni(t)?(e.consume(t),l):n(t)}function u(e){return Mi(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||Mi(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ia={partial:!0,tokenize:aa};function aa(e,t,n){return r;function r(t){return K(t)?q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var oa={continuation:{tokenize:ca},exit:la,name:`blockQuote`,tokenize:sa};function sa(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 K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ca(e,t,n){let r=this;return i;function i(t){return K(t)?q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(oa,t,n)(r)}}function la(e){e.exit(`blockQuote`)}var ua={name:`characterEscape`,tokenize:da};function da(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 Li(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var fa={name:`characterReference`,tokenize:pa};function pa(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=Mi,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=Ii,u):(e.enter(`characterReferenceValue`),a=7,o=Fi,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Mi&&!Si(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 ma={partial:!0,tokenize:ha};function ha(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 ga={concrete:!0,name:`codeFenced`,tokenize:_a};function _a(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`),K(t)?q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ma,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(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&&K(t)?q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(ma,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(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`),K(t)?q(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`),K(t)?q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var va={name:`codeIndented`,tokenize:ba},ya={partial:!0,tokenize:xa};function ba(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Hi(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(ya,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function xa(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Hi(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var Sa={name:`codeText`,previous:wa,resolve:Ca,tokenize:Ta};function Ca(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 wa(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ta(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)):W(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||W(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 Ea=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&&Da(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),Da(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Da(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);Da(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Da(this.left,t.reverse())}}}};function Da(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 Oa(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Ea(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,ka(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 Ci(e,0,1/0,u.slice(0)),!l}function ka(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 Aa={resolve:Ma,tokenize:Na},ja={partial:!0,tokenize:Pa};function Ma(e){return Oa(e),e}function Na(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):W(t)?e.check(ja,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 Pa(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,a,`linePrefix`)}function a(i){if(i===null||W(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 Fa(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||Pi(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||W(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||G(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||Pi(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 Ia(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):W(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||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function La(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):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(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 Ra(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var za={name:`definition`,tokenize:Va},Ba={partial:!0,tokenize:Ha};function Va(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ia.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Ai(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 G(t)?Ra(e,l)(t):l(t)}function l(t){return Fa(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Ba,d,d)(t)}function d(t){return K(t)?q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ha(e,t,n){return r;function r(t){return G(t)?Ra(e,i)(t):n(t)}function i(t){return La(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Ua={name:`hardBreakEscape`,tokenize:Wa};function Wa(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ga={name:`headingAtx`,resolve:Ka,tokenize:qa};function Ka(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`};Ci(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function qa(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||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?q(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||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ja=`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(`.`),Ya=[`pre`,`script`,`style`,`textarea`],Xa={concrete:!0,name:`htmlFlow`,resolveTo:Qa,tokenize:$a},Za={partial:!0,tokenize:eo};function Qa(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 $a(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:P):ji(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):ji(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return ji(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Ya.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ja.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Mi(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||ji(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Mi(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(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):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(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||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Za,re,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ma,ee,re)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Ya.includes(n)?(e.consume(t),ne):O(t)}return ji(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||W(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function eo(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ia,t,n)}}var to={name:`htmlText`,tokenize:no};function no(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):ji(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):ji(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):W(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):W(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return ji(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Mi(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,M(t)):K(t)?(e.consume(t),C):j(t)}function w(t){return t===45||Mi(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||ji(t)?(e.consume(t),E):W(t)?(o=T,M(t)):K(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||Mi(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,M(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,M(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):W(t)?(o=k,M(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||G(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return K(t)?q(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var ro={name:`labelEnd`,resolveAll:so,resolveTo:co,tokenize:lo},io={tokenize:uo},ao={tokenize:fo},oo={tokenize:po};function so(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&&Ci(e,0,e.length,n),e}function co(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=wi(o,e.slice(i+1,i+r+3)),o=wi(o,[[`enter`,l,t]]),o=wi(o,Zi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=wi(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=wi(o,e.slice(a+1)),o=wi(o,[[`exit`,s,t]]),Ci(e,i,e.length,o),e}function lo(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(Ai(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(io,u,o?u:d)(t):t===91?e.attempt(ao,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(oo,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function uo(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 G(t)?Ra(e,a)(t):a(t)}function a(t){return t===41?u(t):Fa(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?Ra(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?La(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?Ra(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 fo(e,t,n){let r=this;return i;function i(t){return Ia.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Ai(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function po(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 mo={name:`labelStartImage`,resolveAll:ro.resolveAll,tokenize:ho};function ho(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 go={name:`labelStartLink`,resolveAll:ro.resolveAll,tokenize:_o};function _o(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 vo={name:`lineEnding`,tokenize:yo};function yo(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(e,t,`linePrefix`)}}var bo={name:`thematicBreak`,tokenize:xo};function xo(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||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?q(e,s,`whitespace`)(t):s(t))}}var So={continuation:{tokenize:Eo},exit:Oo,name:`list`,tokenize:To},Co={partial:!0,tokenize:ko},wo={partial:!0,tokenize:Do};function To(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:Fi(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(bo,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 Fi(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(ia,r.interrupt?n:u,e.attempt(Co,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(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 Eo(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ia,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(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(wo,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(So,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Do(e,t,n){let r=this;return q(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 Oo(e){e.exit(this.containerState.type)}function ko(e,t,n){let r=this;return q(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!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Ao={name:`setextUnderline`,resolveTo:jo,tokenize:Mo};function jo(e,t){let n=new Gi,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 Mo(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`),K(t)?q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var No={tokenize:Po};function Po(e){let t=this,n=e.attempt(ia,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Aa,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Y={resolveAll:Ro()},Fo=Lo(`string`),Io=Lo(`text`);function Lo(e){return{resolveAll:Ro(e===`text`?zo: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);else 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 Ro(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 zo(e,t){let n=new Gi,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 Bo=s({attentionMarkers:()=>Jo,contentInitial:()=>Ho,disable:()=>Yo,document:()=>Vo,flow:()=>Wo,flowInitial:()=>Uo,insideSpan:()=>qo,string:()=>Go,text:()=>Ko}),Vo={42:So,43:So,45:So,48:So,49:So,50:So,51:So,52:So,53:So,54:So,55:So,56:So,57:So,62:oa},Ho={91:za},Uo={[-2]:va,[-1]:va,32:va},Wo={35:Ga,42:bo,45:[Ao,bo],60:Xa,61:Ao,95:bo,96:ga,126:ga},Go={38:fa,92:ua},Ko={[-5]:vo,[-4]:vo,[-3]:vo,33:mo,38:fa,42:Qi,60:[na,to],91:go,92:[Ua,ua],93:ro,95:Qi,96:Sa},qo={null:[Qi,Y]},Jo={null:[42,95]},Yo={null:[]};function Xo(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=wi(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Zi(a,l.events,l),l.events):[]}function f(e,t){return Qo(p(e),t)}function p(e){return Zo(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){W(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&&Ci(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 Zo(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 Qo(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=`
|
|
24
|
+
`,1)[0]);function Ge(e){let t=Re.exec(e);if(!t)return null;let n=t[5],r=t[0].length,i=e.indexOf(`\n${n}`,r);if(i<0)return null;let a=i+1+n.length,o=e.indexOf(Le,a),s=o<0?e.length:o,c=Be(e.slice(0,s));return c?{mark:c,length:s}:null}var Ke=e=>/(^|__)board_post$/.test(e);function qe(e){let t=t=>typeof e[t]==`string`?e[t]:``;return{to:Array.isArray(e.to)?e.to.map(String).join(`, `):t(`to`),title:t(`title`),text:t(`text`),threadId:t(`thread`)}}function Je(e,t){return t.toLowerCase().split(/\s+/).filter(Boolean).every(t=>e.toLowerCase().includes(t))}function Ye(e,t){if(!e)return{used:[],others:[],hidden:0};let n=new Map(e.repos.map(e=>[e.repo.toLowerCase(),e.private])),r=e.used.filter(e=>Je(e.repo,t)).map(e=>({repo:e.repo,private:n.get(e.repo.toLowerCase())??null,projects:e.projects})),i=new Set(e.used.map(e=>e.repo.toLowerCase())),a=e.repos.filter(e=>!i.has(e.repo.toLowerCase())&&Je(e.repo,t)).map(e=>({repo:e.repo,private:e.private,projects:[]}));return{used:r,others:a.slice(0,60),hidden:Math.max(0,a.length-60)}}function Xe(e){return`${e.trim().toLowerCase().replace(/[^a-z0-9_.-]+/g,`-`).replace(/^[-.]+|[-.]+$/g,``).replace(/-{2,}/g,`-`)||`ledung`}-board`.slice(0,100)}var Ze=`ledung.autocorrect`;function Qe(e){try{return e.getItem(Ze)===`1`}catch{return!1}}function $e(e,t){try{t?e.setItem(Ze,`1`):e.removeItem(Ze)}catch{}}var et={autoCorrect:`off`},tt={};function nt(e){return e?tt:et}var rt=[{id:`system`,label:`System`},{id:`light`,label:`Light`},{id:`dark`,label:`Dark`}],it=`ledung.theme`;function at(e){return e===`light`||e===`dark`?e:`system`}function ot(e){try{return at(e.getItem(it))}catch{return`system`}}function st(e,t){try{t===`system`?e.removeItem(it):e.setItem(it,t)}catch{}}function ct(e,t){t===`system`?e.removeAttribute(`data-theme`):e.setAttribute(`data-theme`,t)}var lt={starting:`Ready`,idle:`Ready`,queued:`Waiting for a free place`,running:`Working`,waiting:`Needs your answer`,stopping:`Stopping`,ended:`Ended`};function ut(e){return e.status===`starting`||e.paused&&e.status===`running`?`idle`:e.status}var dt=`ledung.statusDot`;function ft(e){try{return e.getItem(dt)===`1`}catch{return!1}}function pt(e,t){try{t?e.setItem(dt,`1`):e.removeItem(dt)}catch{}}function mt(e,t){return e?{dot:!0,ended:!1}:{dot:!1,tooltip:lt[t.status],ended:t.status===`ended`}}var ht=`ledung.archivedLink`;function gt(e){try{return e.getItem(ht)===`1`}catch{return!1}}function _t(e,t){try{t?e.setItem(ht,`1`):e.removeItem(ht)}catch{}}function vt(e,t,n){return e&&t>0&&!n}var yt=`ledung.compactSidebar`,bt=3,xt=[{step:1,label:`None`},{step:2,label:`Less padding, no time row`},{step:3,label:`Name + ship`},{step:4,label:`Tightest`}],St=e=>e===1||e===2||e===3||e===4?e:null;function Ct(e){try{return St(Number(e.getItem(`ledung.compactSidebar`)))??bt}catch{return bt}}function wt(e,t){try{t===bt?e.removeItem(yt):e.setItem(yt,String(t))}catch{}}function Tt(e){switch(e){case 1:return{time:!0,usage:!0,plusOnly:!1};case 2:return{time:!1,usage:!0,plusOnly:!1};case 3:return{time:!1,usage:!1,plusOnly:!0};case 4:return{time:!1,usage:!1,plusOnly:!0,shipMax:6}}}function Et(e,t,n,r){let i=[t??``,...e>1?[n,r]:[]].filter(Boolean);return i.length?i.join(`
|
|
25
|
+
`):void 0}var Dt={red:{label:`Red`,light:`#b3261e`,dark:`#f28b82`},orange:{label:`Orange`,light:`#a94600`,dark:`#f5a35c`},amber:{label:`Amber`,light:`#865d00`,dark:`#e6c34d`},green:{label:`Green`,light:`#1d7a2c`,dark:`#81c995`},teal:{label:`Teal`,light:`#00766a`,dark:`#4fd1c5`},blue:{label:`Blue`,light:`#2457c5`,dark:`#8ab4f8`},purple:{label:`Purple`,light:`#6d3fb8`,dark:`#c3a6ff`},pink:{label:`Pink`,light:`#ab2c6b`,dark:`#f48fb1`}};function Ot(e,t){return e?t===`manager`||e.sessions===`same`?e.manager:e.sessions===`none`?null:e.sessions:null}var kt=[`green`,`purple`,`teal`,`amber`,`pink`,`orange`];function At(e){return Dt[e]}function jt(e,t,n=!1){return n?{tabs:null,remote:!1,here:e.find(e=>e.here)??null}:{tabs:e.length>1?e:null,remote:t,here:e.find(e=>e.here)??null}}var Mt=3e3,Nt=`ledung:paired?`,Pt=`ledung:paired`;function Ft(e,t,n,r=`not-paired`){return!!e.linked&&!e.here&&!t&&!n&&r===`not-paired`}function It(){return Nt}function Lt(e,t){return t&&e===Nt?Pt:null}function Rt(e,t){let n;try{n=new URL(t).origin}catch{return!1}return e.fromFrame&&e.origin===n&&e.data===Pt}function zt(e,t){return t!==null&&e.some(e=>e.id===t&&!e.here)?t:null}function Bt(e){let t=/^#\/c\/([^/]+)$/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1]).toLowerCase()}catch{return null}}function Vt(e){if(!e)return;let{light:t,dark:n}=At(e.colour);return{"--cc-light":t,"--cc-dark":n}}function Ht(e=globalThis){return e.self!==e.top}function Ut(e){return e.button===0&&!e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}function Wt(e,t,n){return e.here?t===null?0:n:e.waiting??0}var Gt=[it,Ze,dt,ht,yt],z=16,Kt=`ledung:settings?`,qt=`ledung:settings`,Jt=`ledung:setting`,Yt=e=>typeof e==`string`&&Gt.includes(e),Xt=e=>typeof e==`string`&&e.length<=z,Zt=e=>typeof e==`object`&&e&&!Array.isArray(e)?e:null;function Qt(e){let t={};for(let[n,r]of Object.entries(Zt(e)??{}))Yt(n)&&Xt(r)&&(t[n]=r);return t}function $t(e){return`ledung.frameSettings.${e}`}function en(e,t){try{let n=e.getItem($t(t));return n===null?null:Qt(JSON.parse(n))}catch{return null}}function tn(e,t,n,r){let i;try{i=new URL(t).origin}catch{return null}if(!e.fromFrame||e.origin!==i)return null;let a=Zt(e.data);if(a?.type===Kt)return{type:qt,settings:en(r,n)};if(a?.type===Jt&&Yt(a.key)&&(a.value===null||Xt(a.value))){let e={...en(r,n)};a.value===null?delete e[a.key]:e[a.key]=a.value;try{r.setItem($t(n),JSON.stringify(e))}catch{}}return null}function nn(e,t,n,r){let i=tn(e,t.url,t.id,n);return i&&r(i),Rt(e,t.url)}function rn(){return{type:Kt}}function an(e,t){let n=Zt(e);if(t&&n?.type===qt)return n.settings===null?null:Qt(n.settings)}function on(e,t){try{for(let n of Gt){let r=t[n];r===void 0?e.removeItem(n):e.setItem(n,r)}}catch{}}function sn(e){let t=[];try{for(let n of Gt){let r=e.getItem(n);Xt(r)&&t.push({type:Jt,key:n,value:r})}}catch{}return t}function cn(e,t){return{getItem:t=>e().getItem(t),setItem:(n,r)=>{e().setItem(n,r),Yt(n)&&Xt(r)&&t({type:Jt,key:n,value:r})},removeItem:n=>{e().removeItem(n),Yt(n)&&t({type:Jt,key:n,value:null})}}}var ln=null,un=e=>{ln!==null&&window.parent.postMessage(e,ln)},dn=cn(()=>localStorage,un);function fn(){Ht()&&(window.addEventListener(`message`,e=>{let t=an(e.data,e.source===window.parent);if(t!==void 0){if(ln=e.origin,t===null)for(let e of sn(localStorage))un(e);else on(localStorage,t),window.dispatchEvent(new StorageEvent(`storage`,{key:null}))}}),window.parent.postMessage(rn(),`*`))}var pn=new Set,mn=Qe(localStorage),hn=e=>{mn=e;for(let e of pn)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.autocorrect`||e.key===null)&&hn(Qe(localStorage))});var gn=e=>(pn.add(e),()=>{pn.delete(e)}),_n=()=>mn;function vn(){return[(0,v.useSyncExternalStore)(gn,_n),e=>{$e(dn,e),hn(e)}]}function B(){return nt((0,v.useSyncExternalStore)(gn,_n))}var yn=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),V=o(((e,t)=>{t.exports=yn()}))();function bn({board:e,open:t,connection:n,onClick:r}){let i=Ie(e);return i?(0,V.jsx)(`button`,{className:`board-chip ${i.level}${n?` ${n.className}`:``}${t?` on`:``}`,title:`${n?`${n.text} `:``}${i.text} — ${i.title}`,"aria-pressed":t,onClick:r,children:i.text}):null}var xn=e=>{if(!e)return`not yet`;let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<90?`${t} s ago`:`${Math.round(t/60)} min ago`},Sn=e=>e.trim().replace(/^@/,``),Cn=(e,t)=>e.toLowerCase()===t.toLowerCase(),wn=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Tn=e=>e.state===`ok`?`On`:e.state===`starting`?`Starting`:e.state===`error`?`Problem`:`Off`;function En({board:e}){return e?.configured?(0,V.jsxs)(`section`,{className:`board-settings`,children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsxs)(`p`,{className:`muted`,children:[e.identity?(0,V.jsxs)(V.Fragment,{children:[`Every board posts as `,(0,V.jsxs)(`strong`,{children:[`@`,e.identity]}),`, the GitHub login of this computer (`,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}):(0,V.jsxs)(V.Fragment,{children:[`Boards post as this computer's GitHub login (`,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),`).`]}),` `,`Each project chooses its board and who may post to its manager in its own settings.`]}),e.boards.map(t=>(0,V.jsx)(Dn,{repo:t,board:e},t.repo))]}):(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsx)(`p`,{className:`muted`,children:`Managers can talk to managers in other people's Ledungs through a shared board (a GitHub repository). No project uses one yet: each project chooses its board, who may post to it and its channels in its own settings, under Message board.`})]})}function Dn({repo:e,board:t}){let n=e.state===`ok`?`ok`:e.state===`error`?`warn`:`idle`;return(0,V.jsxs)(`div`,{className:`board-block`,children:[(0,V.jsxs)(`p`,{className:`board-state`,children:[(0,V.jsx)(`span`,{className:`board-dot ${n}`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`mono`,children:e.repo}),` · `,Tn(e),e.state===`ok`||e.state===`error`?(0,V.jsxs)(V.Fragment,{children:[` · checked `,xn(e.lastPollAt)]}):null]})]}),e.error&&(0,V.jsx)(`p`,{className:`board-error`,children:e.error}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Projects: `,e.projects.map((n,r)=>(0,V.jsxs)(`span`,{children:[r?`, `:``,n,t.projects[n]?.enabled?``:` (off)`,e.frontDesk===n?` (front desk)`:``]},n)),e.frontDesk?null:(0,V.jsxs)(V.Fragment,{children:[` · no front desk: posts to just @`,t.identity??`you`,` reach nobody`]})]}),(e.ignored.length>0||e.quiet>0||e.paused.length>0)&&(0,V.jsxs)(`ul`,{className:`board-counts`,children:[e.ignored.map(e=>(0,V.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` from `,(0,V.jsxs)(`strong`,{children:[`@`,e.login]}),` ignored: no project here allows them (last `,xn(e.lastAt),`).`]},e.login)),e.quiet>0&&(0,V.jsxs)(`li`,{children:[e.quiet,` post`,e.quiet===1?``:`s`,` in the last day reached no manager (no front desk, or the project's board is off).`]}),e.paused.map(e=>(0,V.jsxs)(`li`,{children:[`Thread `,e.threadId,` no longer wakes `,e.project,` until `,new Date(e.until).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),` (too many wakes in an hour).`]},`${e.project}/${e.threadId}`))]})]})}var On=(e,t)=>{let n=e?.projects[t],r=n?.repo??``;return{enabled:n?.enabled??!1,repo:r,allow:n?.allow??[],channels:(n?.channels??[]).join(` `),frontDesk:!!r&&e?.boards.find(e=>e.repo===r)?.frontDesk===t}},kn=e=>e.split(/[\s,]+/).filter(Boolean).map(e=>e.replace(/^#/,``).toLowerCase()).join(` `);function An(e,t){let n=e.repo.trim();return[e.enabled!==t.enabled,n!==t.repo,e.frontDesk!==t.frontDesk,kn(e.channels)!==kn(t.channels),e.allow.length!==t.allow.length||e.allow.some(e=>!t.allow.some(t=>Cn(t,e)))].filter(Boolean).length}function jn(e){let t=e.repo.trim();return t&&!wn.test(t)?`The board repository is owner/name.`:e.enabled&&!t?`Name the board repository to turn the board on.`:null}function Mn(e,t){let n=t.repo.trim();return R.setBoardProject(e,{enabled:t.enabled,repo:n||null,allow:t.allow,channels:t.channels.split(/[\s,]+/).filter(Boolean),frontDesk:t.frontDesk&&!!n})}function Nn({board:e,project:t,projects:n,form:r,onChange:i}){let a=B(),o=On(e,t),s=e=>i({...r,...e}),c=r.repo.trim(),l=!c||wn.test(c),u=n.map(e=>e.name).filter(n=>n!==t&&e?.projects[n]?.repo),d=e?.boards.find(e=>e.repo===c),f=(d?.projects??[]).filter(e=>e!==t),p=d?.frontDesk??null,m=e?.projects[t]?.ignored??[],h=t=>{let n=e?.projects[t];n&&s({repo:n.repo??``,allow:[...n.allow],channels:n.channels.join(` `),frontDesk:(n.repo??``)===r.repo.trim()&&r.frontDesk})};return(0,V.jsxs)(`div`,{className:`board-settings`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Lets this project's manager read and post to managers in other people's Ledungs, on a board (a GitHub repository) and only with the people you allow here. Off by default.`}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.enabled,onChange:e=>s({enabled:e.target.checked})}),` Use the board in this project`]}),u.length>0&&(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Copy from another project`,(0,V.jsxs)(`select`,{"aria-label":`Copy the board settings from`,value:``,onChange:e=>h(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`Choose a project…`}),u.map(t=>(0,V.jsxs)(`option`,{value:t,children:[t,` (`,e.projects[t].repo,`)`]},t))]})]}),(0,V.jsx)(Pn,{project:t,value:r.repo,ok:l,onChange:e=>s({repo:e})}),c&&l&&(0,V.jsxs)(`div`,{className:`board-warning`,children:[(0,V.jsxs)(`strong`,{children:[`Everyone with access to `,c,` can read every post on it`]}),`, whichever project or Ledung wrote it. The list below only decides who can reach this project's manager, not who can read. A sensitive project should have a board repository of its own.`,` `,(0,V.jsx)(`strong`,{children:`Files attached to posts`}),` (screenshots, logs) can be read and copied by the same people; Ledung asks you before any leaves. Pruning takes them off the board's branch after their thread closes, but can't take back a copy someone made, and unreachable commits and cached views of them can remain on GitHub until GitHub Support removes them.`,f.length>0&&(0,V.jsxs)(V.Fragment,{children:[` Also on this board here: `,f.join(`, `),`.`]})]}),c&&l&&(0,V.jsx)(Ln,{project:t,savedRepo:o.repo,repo:c,allow:r.allow,active:d?.state===`ok`,onChange:e=>s({allow:e})}),m.length>0&&(0,V.jsx)(`ul`,{className:`board-counts`,children:m.map(e=>(0,V.jsxs)(`li`,{children:[e.count,` post`,e.count===1?``:`s`,` to this project ignored from `,(0,V.jsxs)(`strong`,{children:[`@`,e.login]}),`, who isn't on its list (last `,xn(e.lastAt),`).`,` `,!r.allow.some(t=>Cn(t,e.login))&&(0,V.jsxs)(`button`,{className:`small`,onClick:()=>s({allow:[...r.allow,e.login]}),children:[`Allow @`,e.login]})]},e.login))}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.frontDesk,disabled:!c||!l,onChange:e=>s({frontDesk:e.target.checked})}),` `,(0,V.jsxs)(`span`,{children:[`Front desk on this board: gets posts addressed to just `,(0,V.jsxs)(`span`,{className:`mono`,children:[`@`,e?.identity??`you`]})]})]}),p&&p!==t&&r.frontDesk&&(0,V.jsxs)(`p`,{className:`muted`,children:[p,` is the front desk now; saving moves it here.`]}),p&&p!==t&&!r.frontDesk&&(0,V.jsxs)(`p`,{className:`muted`,children:[`The front desk on this board is `,p,`.`]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Channels it follows`,(0,V.jsx)(`input`,{...a,value:r.channels,disabled:!r.enabled,placeholder:`#ledung #ops`,onChange:e=>s({channels:e.target.value})})]}),(0,V.jsx)(`p`,{className:`muted`,children:`A channel's posts wake nobody; the manager reads them when it looks. A running manager gets the board's tools at its next start or resume.`}),r.enabled&&!c&&(0,V.jsx)(`p`,{className:`muted`,children:`Name the board repository to turn it on.`})]})}function Pn({project:e,value:t,ok:n,onChange:r,load:i,label:a=`Board repository`,newName:o}){let s=B(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(!1),x=y?t:``,S=(0,v.useCallback)(t=>{h(!0),_(null),(i??(t=>R.boardRepos(e,t)))(t).then(p,e=>_(e.message)).finally(()=>h(!1))},[e,i]);(0,v.useEffect)(()=>{p(null),l(!1),d(!1)},[e]);let C=()=>{l(!0),!f&&!m&&S(!1)},w=e=>{r(e),b(!1),l(!1),d(!1)},T=Ye(f,x),E=x.trim(),D=wn.test(E)&&!T.used.some(e=>e.repo.toLowerCase()===E.toLowerCase())&&!T.others.some(e=>e.repo.toLowerCase()===E.toLowerCase());return(0,V.jsxs)(`div`,{className:`repo-picker`,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(l(!1),b(!1))},onKeyDown:e=>{e.key===`Escape`&&l(!1)},children:[(0,V.jsxs)(`label`,{className:`board-channels`,children:[a,(0,V.jsx)(`input`,{...s,className:`mono`,value:t,placeholder:`Choose, search or type owner/name`,"aria-invalid":!n,"aria-expanded":c,role:`combobox`,"aria-controls":`repo-picker-list`,autoComplete:`off`,spellCheck:!1,onFocus:C,onClick:C,onChange:e=>{l(!0),b(!0),r(e.target.value),!f&&!m&&S(!1)},onKeyDown:e=>{if(e.key===`Enter`&&c){e.preventDefault();let t=T.used[0]??T.others[0];D?w(E):t?w(t.repo):l(!1)}}})]}),c&&!u&&(0,V.jsxs)(`div`,{className:`repo-list`,id:`repo-picker-list`,role:`listbox`,children:[(0,V.jsxs)(`div`,{className:`board-block-head`,children:[(0,V.jsx)(`span`,{className:`muted`,children:m?`Reading your repositories…`:f?`${f.repos.length}${f.truncated?`+`:``} repositories you can reach`:``}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:m,onClick:()=>S(!0),title:`Read the list from GitHub again`,children:`Refresh`})]}),g&&(0,V.jsx)(`p`,{className:`board-error`,children:g}),f?.error&&(0,V.jsxs)(`p`,{className:`board-error`,children:[f.error,` You can still type owner/name.`]}),T.used.length>0&&(0,V.jsx)(`p`,{className:`repo-head`,children:`Boards your other projects use`}),T.used.map(e=>(0,V.jsx)(Fn,{row:e,onPick:w},`u${e.repo}`)),T.others.length>0&&(0,V.jsx)(`p`,{className:`repo-head`,children:`Your GitHub repositories`}),T.others.map(e=>(0,V.jsx)(Fn,{row:e,onPick:w},e.repo)),T.hidden>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[T.hidden,` more: type to narrow the list.`]}),D&&(0,V.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>w(E),children:[(0,V.jsxs)(`span`,{className:`mono`,children:[`Use `,E]}),(0,V.jsx)(`span`,{className:`muted`,children:` (typed; checked when you save)`})]}),f&&!f.error&&!T.used.length&&!T.others.length&&!D&&(0,V.jsx)(`p`,{className:`muted`,children:`Nothing matches. Type the whole name as owner/name to use a repository that isn't listed.`}),(0,V.jsxs)(`button`,{type:`button`,className:`small repo-create`,onClick:()=>d(!0),children:[`Create a new private `,o?``:`board `,`repo…`]})]}),!n&&!c&&(0,V.jsx)(`p`,{className:`board-error`,children:`Write the repository as owner/name.`}),c&&u&&(0,V.jsx)(In,{project:e,name:o,onCancel:()=>d(!1),onCreated:w})]})}function Fn({row:e,onPick:t}){return(0,V.jsxs)(`button`,{type:`button`,role:`option`,className:`repo-row`,onClick:()=>t(e.repo),children:[(0,V.jsx)(`span`,{className:`mono repo-name`,children:e.repo}),e.private!==null&&(0,V.jsx)(`span`,{className:`chip ${e.private?``:`warn`}`,children:e.private?`private`:`public`}),e.projects.length>0&&(0,V.jsxs)(`span`,{className:`muted`,children:[` used by `,e.projects.join(`, `)]})]})}function In({project:e,name:t,onCancel:n,onCreated:r}){let i=B(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(()=>t??Xe(e)),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(!1);(0,v.useEffect)(()=>{R.boardOwners().then(e=>{o(e.owners),c(e.owners[0]?.login??``)},e=>f(e.message))},[]);let h=/^[A-Za-z0-9_.-]{1,100}$/.test(l)&&l!==`.`&&l!==`..`,g=async()=>{m(!0),f(null);try{r((await R.createBoardRepo(s,l)).repo)}catch(e){f(e.message),m(!1)}};return(0,V.jsxs)(`div`,{className:`repo-list repo-create-form`,role:`dialog`,"aria-label":`Create a new private ${t?``:`board `}repository`,children:[(0,V.jsxs)(`h4`,{children:[`Create a new private `,t?``:`board `,`repository`]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`This creates a new `,(0,V.jsx)(`strong`,{children:`private`}),` repository on GitHub, as your `,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),` login. Only you can see it until you add people on GitHub.`]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Owner`,(0,V.jsxs)(`select`,{value:s,disabled:!a||p,onChange:e=>c(e.target.value),children:[!a&&(0,V.jsx)(`option`,{children:`Reading your accounts…`}),(a??[]).map(e=>(0,V.jsxs)(`option`,{value:e.login,children:[e.login,e.kind===`user`?` (you)`:` (organisation)`]},e.login))]})]}),(0,V.jsxs)(`label`,{className:`board-channels`,children:[`Name`,(0,V.jsx)(`input`,{...i,className:`mono`,value:l,disabled:p,"aria-invalid":!h,onChange:e=>u(e.target.value.trim())})]}),!h&&(0,V.jsx)(`p`,{className:`board-error`,children:`Use letters, digits, - _ and . only.`}),d&&(0,V.jsx)(`p`,{className:`board-error`,children:d}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`button`,{type:`button`,disabled:p||!s||!h,onClick:()=>void g(),children:p?`Creating…`:`Confirm: create ${s}/${l}`}),(0,V.jsx)(`button`,{type:`button`,disabled:p,onClick:n,children:`Cancel`})]})]})}function Ln({project:e,savedRepo:t,repo:n,allow:r,active:i,onChange:a}){let o=B(),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(``),h=!!t&&t===n,g=(0,v.useCallback)(()=>{u(!0),f(null),R.boardPeople(e).then(c,e=>f(e.message)).finally(()=>u(!1))},[e]);(0,v.useEffect)(()=>{c(null),h&&g()},[h,t,i,g]);let _=e=>r.some(t=>Cn(t,e)),y=e=>a(_(e)?r.filter(t=>!Cn(t,e)):[...r,e]),b=new Set((s?.lostAccess??[]).map(e=>e.toLowerCase())),x=new Set((s?.people??[]).map(e=>e.id.toLowerCase())),S=r.filter(e=>!x.has(e.toLowerCase())),C=()=>{let e=Sn(p);e&&(m(``),_(e)||a([...r,e]))};return(0,V.jsxs)(`div`,{className:`board-block`,children:[(0,V.jsxs)(`div`,{className:`board-block-head`,children:[(0,V.jsx)(`h4`,{children:`Who may post to this project's manager`}),(0,V.jsx)(`button`,{className:`small`,disabled:l||!h,onClick:g,title:`Read the list of people with access to the board again`,children:l?`Reading…`:`Refresh`})]}),d&&(0,V.jsx)(`p`,{className:`board-error`,children:d}),!h&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Save to see who has access to `,n,`.`]}),s?.note&&(0,V.jsx)(`p`,{className:`muted`,children:s.note}),s&&s.source!==`none`&&(0,V.jsxs)(`p`,{className:`muted`,children:[s.source===`collaborators`?`People with access to ${n}: they can all read its posts.`:`Members of ${n.split(`/`)[0]}: people with access to ${n} can read its posts.`,` Having access doesn't let anyone reach this manager: tick the people you trust.`]}),(0,V.jsxs)(`ul`,{className:`board-people`,children:[(s?.people??[]).map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:_(e.id),onChange:()=>y(e.id)}),e.avatarUrl?(0,V.jsx)(`img`,{className:`avatar`,src:e.avatarUrl,alt:``,width:28,height:28,loading:`lazy`}):(0,V.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,V.jsxs)(`span`,{className:`person`,children:[(0,V.jsx)(`span`,{children:e.name??e.id}),e.name&&(0,V.jsxs)(`span`,{className:`muted`,children:[` @`,e.id]})]}),b.has(e.id.toLowerCase())&&(0,V.jsx)(`span`,{className:`chip warn`,title:`On the list, but no longer has access to the board repository`,children:`lost access`})]})},e.id)),S.map(e=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:!0,onChange:()=>y(e)}),(0,V.jsx)(`span`,{className:`avatar blank`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`person`,children:(0,V.jsxs)(`span`,{children:[`@`,e]})}),s?.source===`collaborators`&&(0,V.jsx)(`span`,{className:`chip warn`,title:`On the list, but not among the people with access to the board repository`,children:`lost access`})]})},e)),h&&s&&!s.people.length&&!S.length&&(0,V.jsx)(`li`,{className:`muted`,children:`No one is listed. Type a login below.`})]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`input`,{...o,value:p,placeholder:`GitHub login, e.g. magto`,"aria-label":`GitHub login to allow`,onChange:e=>m(e.target.value),onKeyDown:e=>{e.key===`Enter`&&C()}}),(0,V.jsx)(`button`,{className:`small`,disabled:!Sn(p),onClick:C,children:`Allow`})]})]})}var Rn={out:`Post from this manager`,ledung:`Board message`,typed:`Typed on the board`};function zn({mark:e,time:t,onOpenThread:n}){let r=e.kind===`out`?(0,V.jsxs)(V.Fragment,{children:[`to `,e.to]}):e.kind===`ledung`?(0,V.jsxs)(V.Fragment,{children:[`from `,(0,V.jsxs)(`strong`,{children:[`@`,e.author]}),`'s Ledung`,e.project?` (project ${e.project})`:``]}):(0,V.jsxs)(V.Fragment,{children:[`typed on `,e.service||`the board`,` by `,(0,V.jsxs)(`strong`,{children:[`@`,e.author]})]});return(0,V.jsxs)(`div`,{className:`msg board-post ${e.kind}`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:Rn[e.kind]}),(0,V.jsx)(`span`,{className:`board-from`,children:r}),t]}),(0,V.jsxs)(`div`,{className:`board-thread`,children:[`Thread `,e.threadId?`#${e.threadId} `:``,e.title&&(0,V.jsxs)(V.Fragment,{children:[`“`,e.title,`”`]}),n&&e.threadId&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>n(e.threadId),children:`Open in Board`})]}),e.kind!==`out`&&e.to&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · to `,e.to]})]}),(0,V.jsx)(`div`,{className:`msg-body plain`,children:e.text}),(0,V.jsx)(`div`,{className:`muted board-trust`,children:e.kind===`out`?`Sent from this Ledung.`:e.kind===`ledung`?`Sender verified by the board service; not from you. A post can't approve anything.`:`Sender verified by the board service. Typed by that person, not through a Ledung; not from you.`})]})}function Bn(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Vn=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hn=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Un={};function Wn(e,t){return((t||Un).jsx?Hn:Vn).test(e)}var Gn=/[ \t\n\f\r]/g;function Kn(e){return typeof e==`object`?e.type===`text`&&qn(e.value):qn(e)}function qn(e){return e.replace(Gn,``)===``}var Jn=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Jn.prototype.normal={},Jn.prototype.property={},Jn.prototype.space=void 0;function Yn(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Jn(n,r,t)}function Xn(e){return e.toLowerCase()}var Zn=class{constructor(e,t){this.attribute=t,this.property=e}};Zn.prototype.attribute=``,Zn.prototype.booleanish=!1,Zn.prototype.boolean=!1,Zn.prototype.commaOrSpaceSeparated=!1,Zn.prototype.commaSeparated=!1,Zn.prototype.defined=!1,Zn.prototype.mustUseProperty=!1,Zn.prototype.number=!1,Zn.prototype.overloadedBoolean=!1,Zn.prototype.property=``,Zn.prototype.spaceSeparated=!1,Zn.prototype.space=void 0;var Qn=s({boolean:()=>H,booleanish:()=>er,commaOrSpaceSeparated:()=>ir,commaSeparated:()=>rr,number:()=>U,overloadedBoolean:()=>tr,spaceSeparated:()=>nr}),$n=0,H=ar(),er=ar(),tr=ar(),U=ar(),nr=ar(),rr=ar(),ir=ar();function ar(){return 2**++$n}var or=Object.keys(Qn),sr=class extends Zn{constructor(e,t,n,r){let i=-1;if(super(e,t),cr(this,`space`,r),typeof n==`number`)for(;++i<or.length;){let e=or[i];cr(this,or[i],(n&Qn[e])===Qn[e])}}};sr.prototype.defined=!0;function cr(e,t,n){n&&(e[t]=n)}function lr(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new sr(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xn(r)]=r,n[Xn(a.attribute)]=r}return new Jn(t,n,e.space)}var ur=lr({properties:{ariaActiveDescendant:null,ariaAtomic:er,ariaAutoComplete:null,ariaBusy:er,ariaChecked:er,ariaColCount:U,ariaColIndex:U,ariaColSpan:U,ariaControls:nr,ariaCurrent:null,ariaDescribedBy:nr,ariaDetails:null,ariaDisabled:er,ariaDropEffect:nr,ariaErrorMessage:null,ariaExpanded:er,ariaFlowTo:nr,ariaGrabbed:er,ariaHasPopup:null,ariaHidden:er,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:nr,ariaLevel:U,ariaLive:null,ariaModal:er,ariaMultiLine:er,ariaMultiSelectable:er,ariaOrientation:null,ariaOwns:nr,ariaPlaceholder:null,ariaPosInSet:U,ariaPressed:er,ariaReadOnly:er,ariaRelevant:null,ariaRequired:er,ariaRoleDescription:nr,ariaRowCount:U,ariaRowIndex:U,ariaRowSpan:U,ariaSelected:er,ariaSetSize:U,ariaSort:null,ariaValueMax:U,ariaValueMin:U,ariaValueNow:U,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function dr(e,t){return t in e?e[t]:t}function fr(e,t){return dr(e,t.toLowerCase())}var pr=lr({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:rr,acceptCharset:nr,accessKey:nr,action:null,allow:null,allowFullScreen:H,allowPaymentRequest:H,allowUserMedia:H,alpha:H,alt:null,as:null,async:H,autoCapitalize:null,autoComplete:nr,autoFocus:H,autoPlay:H,blocking:nr,capture:null,charSet:null,checked:H,cite:null,className:nr,closedBy:null,colorSpace:null,cols:U,colSpan:U,command:null,commandFor:null,content:null,contentEditable:er,controls:H,controlsList:nr,coords:U|rr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:H,defer:H,dir:null,dirName:null,disabled:H,download:tr,draggable:er,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:H,formTarget:null,headers:nr,height:U,hidden:tr,high:U,href:null,hrefLang:null,htmlFor:nr,httpEquiv:nr,id:null,imageSizes:null,imageSrcSet:null,inert:H,inputMode:null,integrity:null,is:null,isMap:H,itemId:null,itemProp:nr,itemRef:nr,itemScope:H,itemType:nr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:H,low:U,manifest:null,max:null,maxLength:U,media:null,method:null,min:null,minLength:U,multiple:H,muted:H,name:null,nonce:null,noModule:H,noValidate:H,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:H,optimum:U,pattern:null,ping:nr,placeholder:null,playsInline:H,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:H,referrerPolicy:null,rel:nr,required:H,reversed:H,rows:U,rowSpan:U,sandbox:nr,scope:null,scoped:H,seamless:H,selected:H,shadowRootClonable:H,shadowRootCustomElementRegistry:H,shadowRootDelegatesFocus:H,shadowRootMode:null,shadowRootSerializable:H,shape:null,size:U,sizes:null,slot:null,span:U,spellCheck:er,src:null,srcDoc:null,srcLang:null,srcSet:null,start:U,step:null,style:null,tabIndex:U,target:null,title:null,translate:null,type:null,typeMustMatch:H,useMap:null,value:er,width:U,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:nr,axis:null,background:null,bgColor:null,border:U,borderColor:null,bottomMargin:U,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:H,declare:H,event:null,face:null,frame:null,frameBorder:null,hSpace:U,leftMargin:U,link:null,longDesc:null,lowSrc:null,marginHeight:U,marginWidth:U,noResize:H,noHref:H,noShade:H,noWrap:H,object:null,profile:null,prompt:null,rev:null,rightMargin:U,rules:null,scheme:null,scrolling:er,standby:null,summary:null,text:null,topMargin:U,valueType:null,version:null,vAlign:null,vLink:null,vSpace:U,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:H,disablePictureInPicture:H,disableRemotePlayback:H,exportParts:rr,part:nr,prefix:null,property:null,results:U,security:null,unselectable:null},space:`html`,transform:fr}),mr=lr({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:ir,accentHeight:U,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:U,amplitude:U,arabicForm:null,ascent:U,attributeName:null,attributeType:null,azimuth:U,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:U,by:null,calcMode:null,capHeight:U,className:nr,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:U,diffuseConstant:U,direction:null,display:null,dur:null,divisor:U,dominantBaseline:null,download:H,dx:null,dy:null,edgeMode:null,editable:null,elevation:U,enableBackground:null,end:null,event:null,exponent:U,externalResourcesRequired:null,fill:null,fillOpacity:U,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:rr,g2:rr,glyphName:rr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:U,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:U,horizOriginX:U,horizOriginY:U,id:null,ideographic:U,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:U,k:U,k1:U,k2:U,k3:U,k4:U,kernelMatrix:ir,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:U,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:U,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:U,overlineThickness:U,paintOrder:null,panose1:null,path:null,pathLength:U,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:nr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:U,pointsAtY:U,pointsAtZ:U,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ir,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ir,rev:ir,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ir,requiredFeatures:ir,requiredFonts:ir,requiredFormats:ir,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:U,specularExponent:U,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:U,strikethroughThickness:U,string:null,stroke:null,strokeDashArray:ir,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:U,strokeOpacity:U,strokeWidth:null,style:null,surfaceScale:U,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ir,tabIndex:U,tableValues:null,target:null,targetX:U,targetY:U,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ir,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:U,underlineThickness:U,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:U,values:null,vAlphabetic:U,vMathematical:U,vectorEffect:null,vHanging:U,vIdeographic:U,version:null,vertAdvY:U,vertOriginX:U,vertOriginY:U,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:U,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:dr}),hr=lr({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()}}),gr=lr({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:fr}),_r=lr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),vr={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`},yr=/[A-Z]/g,br=/-[a-z]/g,xr=/^data[-\w.:]+$/i;function Sr(e,t){let n=Xn(t),r=t,i=Zn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&xr.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(br,wr);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!br.test(e)){let n=e.replace(yr,Cr);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=sr}return new i(r,t)}function Cr(e){return`-`+e.toLowerCase()}function wr(e){return e.charAt(1).toUpperCase()}var Tr=Yn([ur,pr,hr,gr,_r],`html`),Er=Yn([ur,mr,hr,gr,_r],`svg`);function Dr(e){return e.join(` `).trim()}var Or=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(`
|
|
26
|
+
`);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})),kr=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(Or());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}})),Ar=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))}})),jr=o(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(kr()),r=Ar();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})),Mr=Pr(`end`),Nr=Pr(`start`);function Pr(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 Fr(e){let t=Nr(e),n=Mr(e);if(t&&n)return{start:t,end:n}}function Ir(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Rr(e.position):`start`in e||`end`in e?Rr(e):`line`in e||`column`in e?Lr(e):``}function Lr(e){return zr(e&&e.line)+`:`+zr(e&&e.column)}function Rr(e){return Lr(e&&e.start)+`-`+Lr(e&&e.end)}function zr(e){return e&&typeof e==`number`?e:1}var Br=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=Ir(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}};Br.prototype.file=``,Br.prototype.name=``,Br.prototype.reason=``,Br.prototype.message=``,Br.prototype.stack=``,Br.prototype.column=void 0,Br.prototype.line=void 0,Br.prototype.ancestors=void 0,Br.prototype.cause=void 0,Br.prototype.fatal=void 0,Br.prototype.place=void 0,Br.prototype.ruleId=void 0,Br.prototype.source=void 0;var Vr=l(jr(),1),Hr={}.hasOwnProperty,Ur=new Map,Wr=/[A-Z]/g,Gr=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Kr=new Set([`td`,`th`]),qr=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Jr(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=ai(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=ii(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`?Er:Tr,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Yr(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Yr(e,t,n){if(t.type===`element`)return Xr(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Zr(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return $r(e,t,n);if(t.type===`mdxjsEsm`)return Qr(e,t);if(t.type===`root`)return ei(e,t,n);if(t.type===`text`)return ti(e,t)}function Xr(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Er,e.schema=i),e.ancestors.push(t);let a=di(e,t.tagName,!1),o=oi(e,t),s=ci(e,t);return Gr.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Kn(e)})),ni(e,o,a,t),ri(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Zr(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)}fi(e,t.position)}function Qr(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fi(e,t.position)}function $r(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Er,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:di(e,t.name,!0),o=si(e,t),s=ci(e,t);return ni(e,o,a,t),ri(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function ei(e,t,n){let r={};return ri(r,ci(e,t)),e.create(t,e.Fragment,r,n)}function ti(e,t){return t.value}function ni(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ri(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function ii(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 ai(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Nr(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 oi(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Hr.call(t.properties,i)){let a=li(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Kr.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 si(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 fi(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 fi(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function ci(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ur;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=Yr(e,a,o);s!==void 0&&n.push(s)}return n}function li(e,t,n){let r=Sr(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Bn(n):Dr(n)),r.property===`style`){let t=typeof n==`object`?n:ui(e,String(n));return e.stylePropertyNameCase===`css`&&(t=pi(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?vr[r.property]||r.property:r.attribute,n]}}function ui(e,t){try{return(0,Vr.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Br("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=qr+`#cannot-parse-style-attribute`,r}}function di(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=Wn(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=Wn(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Hr.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);fi(e)}function fi(e,t){let n=new Br("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=qr+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function pi(e){let t={},n;for(n in e)Hr.call(e,n)&&(t[mi(n)]=e[n]);return t}function mi(e){let t=e.replace(Wr,hi);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function hi(e){return`-`+e.toLowerCase()}var gi={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`]},_i={};function vi(e,t){let n=t||_i;return yi(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function yi(e,t,n){if(xi(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 bi(e.children,t,n)}return Array.isArray(e)?bi(e,t,n):``}function bi(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=yi(e[i],t,n);return r.join(``)}function xi(e){return!!(e&&typeof e==`object`)}var Si=document.createElement(`i`);function Ci(e){let t=`&`+e+`;`;Si.innerHTML=t;let n=Si.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function wi(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 Ti(e,t){return e.length>0?(wi(e,e.length,0,t),e):t}var Ei={}.hasOwnProperty;function Di(e){let t={},n=-1;for(;++n<e.length;)Oi(t,e[n]);return t}function Oi(e,t){let n;for(n in t){let r=(Ei.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Ei.call(r,a)||(r[a]=[]);let e=i[a];ki(r[a],Array.isArray(e)?e:e?[e]:[])}}}function ki(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);wi(e,0,0,r)}function Ai(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 ji(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Mi=Vi(/[A-Za-z]/),Ni=Vi(/[\dA-Za-z]/),Pi=Vi(/[#-'*+\--9=?A-Z^-~]/);function Fi(e){return e!==null&&(e<32||e===127)}var Ii=Vi(/\d/),Li=Vi(/[\dA-Fa-f]/),Ri=Vi(/[!-/:-@[-`{-~]/);function W(e){return e!==null&&e<-2}function G(e){return e!==null&&(e<0||e===32)}function K(e){return e===-2||e===-1||e===32}var zi=Vi(/\p{P}|\p{S}/u),Bi=Vi(/\s/);function Vi(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Hi(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Ni(e.charCodeAt(n+1))&&Ni(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 q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return K(r)?(e.enter(n),s(r)):t(r)}function s(r){return K(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Ui(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&K(t)?(e.enter(r),c(t)):l(t)}function c(t){return K(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Wi={tokenize:Gi};function Gi(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(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);else return W(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Ki=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){qi(this,e,t,n,!1)}addBefore(e,t,n){qi(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 qi(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 Ji={tokenize:Xi},Yi={tokenize:J};function Xi(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 Ki;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(Yi,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(Yi,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);else 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);else return W(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 Ki;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 J(e,t,n){return q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Zi(e){if(e===null||G(e)||Bi(e))return 1;if(zi(e))return 2}function Qi(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 $i={name:`attention`,resolveAll:ea,tokenize:ta};function ea(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};na(o,-a),na(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=Ti(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Ti(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Ti(r,Qi(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Ti(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=Ti(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),wi(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 ta(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Zi(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=Zi(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 na(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var ra={name:`autolink`,tokenize:ia};function ia(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 Mi(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Ni(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||Ni(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||Fi(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Pi(t)?(e.consume(t),l):n(t)}function u(e){return Ni(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||Ni(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var aa={partial:!0,tokenize:oa};function oa(e,t,n){return r;function r(t){return K(t)?q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||W(e)?t(e):n(e)}}var sa={continuation:{tokenize:la},exit:ua,name:`blockQuote`,tokenize:ca};function ca(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 K(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function la(e,t,n){let r=this;return i;function i(t){return K(t)?q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(sa,t,n)(r)}}function ua(e){e.exit(`blockQuote`)}var da={name:`characterEscape`,tokenize:fa};function fa(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 Ri(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var pa={name:`characterReference`,tokenize:ma};function ma(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=Ni,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=Li,u):(e.enter(`characterReferenceValue`),a=7,o=Ii,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Ni&&!Ci(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 ha={partial:!0,tokenize:ga};function ga(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 _a={concrete:!0,name:`codeFenced`,tokenize:va};function va(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`),K(t)?q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||W(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(ha,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||W(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):K(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||W(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||W(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&&K(t)?q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||W(t)?e.check(ha,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||W(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`),K(t)?q(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`),K(t)?q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||W(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var ya={name:`codeIndented`,tokenize:xa},ba={partial:!0,tokenize:Sa};function xa(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Ui(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):W(t)?e.attempt(ba,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||W(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Sa(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):W(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Ui(e,t,a,`linePrefix`,4,4)(o)}function a(e){return W(e)?i(e):n(e)}}var Ca={name:`codeText`,previous:Ta,resolve:wa,tokenize:Ea};function wa(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 Ta(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Ea(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)):W(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||W(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 Da=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&&Oa(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),Oa(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Oa(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);Oa(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Oa(this.left,t.reverse())}}}};function Oa(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 ka(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Da(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,Aa(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 wi(e,0,1/0,u.slice(0)),!l}function Aa(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 ja={resolve:Na,tokenize:Pa},Ma={partial:!0,tokenize:Fa};function Na(e){return ka(e),e}function Pa(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):W(t)?e.check(Ma,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 Fa(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,a,`linePrefix`)}function a(i){if(i===null||W(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 Ia(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||Fi(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||W(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||G(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||Fi(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 La(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):W(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||W(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!K(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ra(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):W(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||W(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 za(e,t){let n;return r;function r(i){return W(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):K(i)?q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Ba={name:`definition`,tokenize:Ha},Va={partial:!0,tokenize:Ua};function Ha(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return La.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ji(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 G(t)?za(e,l)(t):l(t)}function l(t){return Ia(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Va,d,d)(t)}function d(t){return K(t)?q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||W(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ua(e,t,n){return r;function r(t){return G(t)?za(e,i)(t):n(t)}function i(t){return Ra(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return K(t)?q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||W(e)?t(e):n(e)}}var Wa={name:`hardBreakEscape`,tokenize:Ga};function Ga(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return W(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Ka={name:`headingAtx`,resolve:qa,tokenize:Ja};function qa(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`};wi(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Ja(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||G(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||W(n)?(e.exit(`atxHeading`),t(n)):K(n)?q(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||G(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ya=`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(`.`),Xa=[`pre`,`script`,`style`,`textarea`],Za={concrete:!0,name:`htmlFlow`,resolveTo:$a,tokenize:eo},Qa={partial:!0,tokenize:to};function $a(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 eo(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:P):Mi(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):Mi(a)?(e.consume(a),i=4,r.interrupt?t:P):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:P):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return Mi(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||G(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Xa.includes(l)?(i=1,r.interrupt?t(s):O(s)):Ya.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Ni(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return K(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Mi(t)?(e.consume(t),b):K(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||Ni(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):K(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):K(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||W(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||G(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||K(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||W(t)?O(t):K(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ne):t===63&&i===3?(e.consume(t),P):t===93&&i===5?(e.consume(t),N):W(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Qa,re,k)(t)):t===null||W(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(ha,ee,re)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return t===null||W(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),P):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return Xa.includes(n)?(e.consume(t),ne):O(t)}return Mi(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function N(t){return t===93?(e.consume(t),P):O(t)}function P(t){return t===62?(e.consume(t),ne):t===45&&i===2?(e.consume(t),P):O(t)}function ne(t){return t===null||W(t)?(e.exit(`htmlFlowData`),re(t)):(e.consume(t),ne)}function re(n){return e.exit(`htmlFlow`),t(n)}}function to(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(aa,t,n)}}var no={name:`htmlText`,tokenize:ro};function ro(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):Mi(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):Mi(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):W(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):W(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):W(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):W(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return Mi(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Ni(t)?(e.consume(t),S):C(t)}function C(t){return W(t)?(o=C,M(t)):K(t)?(e.consume(t),C):j(t)}function w(t){return t===45||Ni(t)?(e.consume(t),w):t===47||t===62||G(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||Mi(t)?(e.consume(t),E):W(t)?(o=T,M(t)):K(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||Ni(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):W(t)?(o=D,M(t)):K(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):W(t)?(o=O,M(t)):K(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,A):t===null?n(t):W(t)?(o=k,M(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||G(t)?T(t):(e.consume(t),ee)}function A(e){return e===47||e===62||G(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return K(t)?q(e,N,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):N(t)}function N(t){return e.enter(`htmlTextData`),o(t)}}var io={name:`labelEnd`,resolveAll:co,resolveTo:lo,tokenize:uo},ao={tokenize:fo},oo={tokenize:po},so={tokenize:mo};function co(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&&wi(e,0,e.length,n),e}function lo(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=Ti(o,e.slice(i+1,i+r+3)),o=Ti(o,[[`enter`,l,t]]),o=Ti(o,Qi(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Ti(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Ti(o,e.slice(a+1)),o=Ti(o,[[`exit`,s,t]]),wi(e,i,e.length,o),e}function uo(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(ji(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(ao,u,o?u:d)(t):t===91?e.attempt(oo,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(so,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function fo(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 G(t)?za(e,a)(t):a(t)}function a(t){return t===41?u(t):Ia(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return G(t)?za(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ra(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return G(t)?za(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 po(e,t,n){let r=this;return i;function i(t){return La.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function mo(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 ho={name:`labelStartImage`,resolveAll:io.resolveAll,tokenize:go};function go(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 _o={name:`labelStartLink`,resolveAll:io.resolveAll,tokenize:vo};function vo(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 yo={name:`lineEnding`,tokenize:bo};function bo(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),q(e,t,`linePrefix`)}}var xo={name:`thematicBreak`,tokenize:So};function So(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||W(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),K(t)?q(e,s,`whitespace`)(t):s(t))}}var Co={continuation:{tokenize:Do},exit:ko,name:`list`,tokenize:Eo},wo={partial:!0,tokenize:Ao},To={partial:!0,tokenize:Oo};function Eo(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:Ii(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(xo,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 Ii(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(aa,r.interrupt?n:u,e.attempt(wo,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return K(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 Do(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(aa,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!K(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(To,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,q(e,e.attempt(Co,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Oo(e,t,n){let r=this;return q(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 ko(e){e.exit(this.containerState.type)}function Ao(e,t,n){let r=this;return q(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!K(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var jo={name:`setextUnderline`,resolveTo:Mo,tokenize:No};function Mo(e,t){let n=new Ki,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 No(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`),K(t)?q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||W(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Po={tokenize:Y};function Y(e){let t=this,n=e.attempt(aa,r,e.attempt(this.parser.constructs.flowInitial,i,q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(ja,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Fo={resolveAll:zo()},Io=Ro(`string`),Lo=Ro(`text`);function Ro(e){return{resolveAll:zo(e===`text`?Bo: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);else 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 zo(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 Bo(e,t){let n=new Ki,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 Vo=s({attentionMarkers:()=>Yo,contentInitial:()=>Uo,disable:()=>Xo,document:()=>Ho,flow:()=>Go,flowInitial:()=>Wo,insideSpan:()=>Jo,string:()=>Ko,text:()=>qo}),Ho={42:Co,43:Co,45:Co,48:Co,49:Co,50:Co,51:Co,52:Co,53:Co,54:Co,55:Co,56:Co,57:Co,62:sa},Uo={91:Ba},Wo={[-2]:ya,[-1]:ya,32:ya},Go={35:Ka,42:xo,45:[jo,xo],60:Za,61:jo,95:xo,96:_a,126:_a},Ko={38:pa,92:da},qo={[-5]:yo,[-4]:yo,[-3]:yo,33:ho,38:pa,42:$i,60:[ra,no],91:_o,92:[Wa,da],93:io,95:$i,96:Ca},Jo={null:[$i,Fo]},Yo={null:[42,95]},Xo={null:[]};function Zo(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=Ti(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Qi(a,l.events,l),l.events):[]}function f(e,t){return $o(p(e),t)}function p(e){return Qo(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){W(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&&wi(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 Qo(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 $o(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=`
|
|
27
27
|
`;break;case-3:o=`\r
|
|
28
|
-
`;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 $o(e){let t={constructs:Ei([Bo,...(e||{}).extensions||[]]),content:n(Ui),defined:[],document:n(qi),flow:n(No),lazy:{},string:n(Fo),text:n(Io)};return t;function n(e){return n;function n(n){return Xo(t,e,n)}}}function es(e){for(;!Oa(e););return e}var ts=/[\0\t\n\r]/g;function ns(){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;){ts.lastIndex=c;let n=ts.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 rs=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function is(e){return e.replace(rs,as)}function as(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return ki(n.slice(t?2:1),t?16:10)}return Si(n)||e}var os={}.hasOwnProperty;function ss(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),cs(n)(es($o(n).document().write(ns()(e,t,!0))))}function cs(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ye),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(I),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(F),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(_e,s),htmlFlowData:E,htmlText:o(_e,s),htmlTextData:E,image:o(ve),label:s,link:o(ye),listItem:o(xe),listItemValue:p,listOrdered:o(be,f),listUnordered:o(be),paragraph:o(Se),reference:ae,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(I),strong:o(Ce),thematicBreak:o(Te)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(A),htmlTextData:D,image:l(te),label:P,labelText:N,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};us(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),os.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||fs).call(o,void 0,e[0])}for(r.position={start:ls(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ls(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];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 n=r;for(s=void 0;n--;){let t=e[n];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=n}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),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(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:ls(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||fs).call(this,e,r[0])),n.position.end=ls(e.end)}function d(){return _i(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){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 v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:ls(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ls(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ls(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){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 N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=is(t),n.identifier=Ai(t).toLowerCase()}function P(){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 ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=ki(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Si(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=ls(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function F(){return{type:`emphasis`,children:[],position:void 0}}function I(){return{type:`heading`,depth:0,children:[],position:void 0}}function ge(){return{type:`break`,position:void 0}}function _e(){return{type:`html`,value:``,position:void 0}}function ve(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ye(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function Ce(){return{type:`strong`,children:[],position:void 0}}function we(){return{type:`text`,value:``,position:void 0}}function Te(){return{type:`thematicBreak`,position:void 0}}}function ls(e){return{line:e.line,column:e.column,offset:e.offset}}function us(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?us(e,r):ds(e,r)}}function ds(e,t){let n;for(n in t)if(os.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`afterExit`:case`beforeEnter`:{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 fs(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Fr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Fr({start:t.start,end:t.end})+`) is still open`)}function ps(e){let t=this;t.parser=n;function n(n){return ss(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ms(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 hs(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
29
|
-
`}]}function
|
|
30
|
-
`:``,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
|
|
28
|
+
`;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 es(e){let t={constructs:Di([Vo,...(e||{}).extensions||[]]),content:n(Wi),defined:[],document:n(Ji),flow:n(Po),lazy:{},string:n(Io),text:n(Lo)};return t;function n(e){return n;function n(n){return Zo(t,e,n)}}}function ts(e){for(;!ka(e););return e}var ns=/[\0\t\n\r]/g;function rs(){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;){ns.lastIndex=c;let n=ns.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 is=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function as(e){return e.replace(is,os)}function os(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ai(n.slice(t?2:1),t?16:10)}return Ci(n)||e}var ss={}.hasOwnProperty;function cs(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ls(n)(ts(es(n).document().write(rs()(e,t,!0))))}function ls(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ye),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(I),blockQuote:o(fe),characterEscape:E,characterReference:E,codeFenced:o(pe),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(pe,s),codeText:o(me,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(he),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(F),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(_e,s),htmlFlowData:E,htmlText:o(_e,s),htmlTextData:E,image:o(ve),label:s,link:o(ye),listItem:o(xe),listItemValue:p,listOrdered:o(be,f),listUnordered:o(be),paragraph:o(Se),reference:ae,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(I),strong:o(Ce),thematicBreak:o(Te)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:de,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(ee),htmlFlowData:D,htmlText:l(A),htmlTextData:D,image:l(te),label:P,labelText:N,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:oe,resourceDestinationString:ne,resourceTitleString:re,resource:ie,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};ds(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),ss.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||ps).call(o,void 0,e[0])}for(r.position={start:us(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:us(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];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 n=r;for(s=void 0;n--;){let t=e[n];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=n}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),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(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:us(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ps).call(this,e,r[0])),n.position.end=us(e.end)}function d(){return vi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(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 m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){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 v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ji(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=we(),n.position={start:us(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=us(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=us(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){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 N(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=as(t),n.identifier=ji(t).toLowerCase()}function P(){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 ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ie(){this.data.inReference=void 0}function ae(){this.data.referenceType=`collapsed`}function oe(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ai(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Ci(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=us(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function de(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function fe(){return{type:`blockquote`,children:[],position:void 0}}function pe(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function me(){return{type:`inlineCode`,value:``,position:void 0}}function he(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function F(){return{type:`emphasis`,children:[],position:void 0}}function I(){return{type:`heading`,depth:0,children:[],position:void 0}}function ge(){return{type:`break`,position:void 0}}function _e(){return{type:`html`,value:``,position:void 0}}function ve(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ye(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function Ce(){return{type:`strong`,children:[],position:void 0}}function we(){return{type:`text`,value:``,position:void 0}}function Te(){return{type:`thematicBreak`,position:void 0}}}function us(e){return{line:e.line,column:e.column,offset:e.offset}}function ds(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ds(e,r):fs(e,r)}}function fs(e,t){let n;for(n in t)if(ss.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`afterExit`:case`beforeEnter`:{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 ps(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ir({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ir({start:t.start,end:t.end})+`) is still open`)}function ms(e){let t=this;t.parser=n;function n(n){return cs(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function hs(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 gs(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
29
|
+
`}]}function _s(e,t){let n=t.value?t.value+`
|
|
30
|
+
`:``,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 vs(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ys(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function bs(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=Hi(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 xs(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 Ss(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Cs(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 ws(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cs(e,t);let i={src:Hi(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 Ts(e,t){let n={src:Hi(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 Es(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 Ds(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Cs(e,t);let i={href:Hi(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 Os(e,t){let n={href:Hi(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 ks(e,t,n){let r=e.all(t),i=n?As(n):js(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:`
|
|
31
31
|
`}),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:`
|
|
32
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function
|
|
32
|
+
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function As(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=js(n[r])}return t}function js(e){return e.spread??e.children.length>1}function Ms(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 Ns(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Ps(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function Fs(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Is(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=Nr(t.children[1]),o=Mr(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 Ls(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 Rs(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var zs=9,Bs=32;function Vs(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(Hs(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(Hs(t.slice(i),i>0,!1)),a.join(``)}function Hs(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===zs||t===Bs;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===zs||t===Bs;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function Us(e,t){let n={type:`text`,value:Vs(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Ws(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var Gs={blockquote:hs,break:gs,code:_s,delete:vs,emphasis:ys,footnoteReference:bs,heading:xs,html:Ss,imageReference:ws,image:Ts,inlineCode:Es,linkReference:Ds,link:Os,listItem:ks,list:Ms,paragraph:Ns,root:Ps,strong:Fs,table:Is,tableCell:Rs,tableRow:Ls,text:Us,thematicBreak:Ws,toml:Ks,yaml:Ks,definition:Ks,footnoteDefinition:Ks};function Ks(){}var{defineProperty:qs}=Object,Js=typeof self==`object`?self:globalThis,Ys=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new Js[e](t)},Xs=(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__`?qs(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 Js[e]==`function`?Ys(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(Ys(a,o),i)};return r},Zs=e=>Xs(new Map,e)(0),Qs=``,{toString:$s}={},{keys:ec,is:tc}=Object,nc=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=$s.call(e).slice(8,-1);switch(n){case`Array`:return[1,Qs];case`Object`:return[2,Qs];case`Date`:return[3,Qs];case`RegExp`:return[4,Qs];case`Map`:return[5,Qs];case`Set`:return[6,Qs];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},rc=([e,t])=>e===0&&(t===`function`||t===`symbol`),ic=(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]=nc(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&tc(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 ec(o))(e||!rc(nc(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?Qs: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||!(rc(nc(n))||rc(nc(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!rc(nc(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},ac=(e,{json:t,lossy:n}={})=>{let r=[];return ic(!(t||n),!!t,new Map,r)(e),r},oc=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?Zs(ac(e,t)):structuredClone(e):(e,t)=>Zs(ac(e,t));function sc(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 cc(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function lc(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||sc,r=e.options.footnoteBackLabel||cc,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=Hi(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:{...oc(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
33
33
|
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
34
|
-
`}]}}var
|
|
34
|
+
`}]}}var uc=(function(e){if(e==null)return hc;if(typeof e==`function`)return mc(e);if(typeof e==`object`)return Array.isArray(e)?dc(e):fc(e);if(typeof e==`string`)return pc(e);throw Error(`Expected function, string, or object as test`)});function dc(e){let t=[],n=-1;for(;++n<e.length;)t[n]=uc(e[n]);return mc(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function fc(e){let t=e;return mc(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function pc(e){return mc(t);function t(t){return t&&t.type===e}}function mc(e){return t;function t(t,n,r){return!!(gc(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function hc(){return!0}function gc(e){return typeof e==`object`&&!!e&&`type`in e}function _c(e){return e}var vc=[];function yc(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=uc(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 (`+_c(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=vc,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=bc(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 bc(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?vc:[e]}function xc(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),yc(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 Sc={}.hasOwnProperty,Cc={};function wc(e,t){let n=t||Cc,r=new Map,i=new Map,a={all:s,applyData:Ec,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...Gs,...n.handlers},one:o,options:n,patch:Tc,wrap:Oc};return xc(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(Sc.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=oc(n);return r.children=a.all(e),r}return oc(e)}return(a.options.unknownHandler||Dc)(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=kc(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=kc(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Tc(e,t){e.position&&(t.position=Fr(e))}function Ec(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,oc(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Dc(e,t){let n=t.data||{},r=`value`in t&&!(Sc.call(n,`hProperties`)||Sc.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 Oc(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
35
35
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
36
36
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
37
|
-
`}),n}function
|
|
38
|
-
`},i)),a}function Ac(e,t){return e&&`run`in e?async function(n,r){let i=kc(n,{file:r,...t});await e.run(i,r)}:function(n,r){return kc(n,{file:r,...e||t})}}function jc(e){if(e)throw e}var Mc=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 Nc(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 Pc(){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);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Fc(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 Fc(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 Ic={basename:Lc,dirname:Rc,extname:zc,join:Bc,sep:`/`};function Lc(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Uc(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 Rc(e){if(Uc(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 zc(e){Uc(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}}else 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 Bc(...e){let t=-1,n;for(;++t<e.length;)Uc(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Vc(n)}function Vc(e){Uc(e);let t=e.codePointAt(0)===47,n=Hc(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Hc(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 Uc(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Wc={cwd:Gc};function Gc(){return`/`}function Kc(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function qc(e){if(typeof e==`string`)e=new URL(e);else if(!Kc(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 Jc(e)}function Jc(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 Yc=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Xc=class{constructor(e){let t;t=e?Kc(e)?{path:e}:typeof e==`string`||el(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Wc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Yc.length;){let e=Yc[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)Yc.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Ic.basename(this.path):void 0}set basename(e){Qc(e,`basename`),Zc(e,`basename`),this.path=Ic.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Ic.dirname(this.path):void 0}set dirname(e){$c(this.basename,`dirname`),this.path=Ic.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Ic.extname(this.path):void 0}set extname(e){if(Zc(e,`extname`),$c(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=Ic.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){Kc(e)&&(e=qc(e)),Qc(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Ic.basename(this.path,this.extname):void 0}set stem(e){Qc(e,`stem`),Zc(e,`stem`),this.path=Ic.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 zr(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 Zc(e,t){if(e&&e.includes(Ic.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Ic.sep+"`")}function Qc(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function $c(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function el(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var tl=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),nl=l(Mc(),1),rl={}.hasOwnProperty,il=new class e extends tl{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=Pc()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,nl.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(sl(`data`,this.frozen),this.namespace[e]=t,this):rl.call(this.namespace,e)&&this.namespace[e]||void 0:e?(sl(`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=ul(e),n=this.parser||this.Parser;return al(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),al(`process`,this.parser||this.Parser),ol(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ul(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);fl(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(),al(`processSync`,this.parser||this.Parser),ol(`processSync`,this.compiler||this.Compiler),this.process(e,r),ll(`processSync`,`process`,t),n;function r(e,r){t=!0,jc(e),n=r}}run(e,t,n){cl(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=ul(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),ll(`runSync`,`run`,n),r;function i(e,t){jc(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ul(t),r=this.compiler||this.Compiler;return ol(`stringify`,r),cl(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(sl(`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,nl.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];Nc(o)&&Nc(r)&&(r=(0,nl.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function al(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function ol(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function sl(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 cl(e){if(!Nc(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ll(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ul(e){return dl(e)?e:new Xc(e)}function dl(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function fl(e){return typeof e==`string`||pl(e)}function pl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var ml=[],hl={allowDangerousHtml:!0},gl=/^(https?|ircs?|mailto|xmpp)$/i,_l=[{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 vl(e){let t=yl(e),n=bl(e);return xl(t.runSync(t.parse(n),n),e)}function yl(e){let t=e.rehypePlugins||ml,n=e.remarkPlugins||ml,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...hl}:hl;return il().use(ps).use(n).use(Ac,r).use(t)}function bl(e){let t=e.children||``,n=new Xc;return typeof t==`string`?n.value=t:``+t,n}function xl(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Sl;for(let e of _l)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return bc(e,l),qr(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.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 hi)if(Object.hasOwn(hi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=hi[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 Sl(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||gl.test(e.slice(0,t))?e:``}function Cl(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 wl(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function Tl(e,t,n){let r=lc((n||{}).ignore||[]),i=El(t),a=-1;for(;++a<i.length;)vc(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;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function El(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Dl(e[0]),Ol(e[1])])}return t}function Dl(e){return typeof e==`string`?new RegExp(wl(e),`g`):e}function Ol(e){return typeof e==`function`?e:function(){return e}}var kl=`phrasing`,Al=[`autolink`,`link`,`image`,`label`];function jl(){return{transforms:[zl],enter:{literalAutolink:Nl,literalAutolinkEmail:Pl,literalAutolinkHttp:Pl,literalAutolinkWww:Pl},exit:{literalAutolink:Rl,literalAutolinkEmail:Ll,literalAutolinkHttp:Fl,literalAutolinkWww:Il}}}function Ml(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:kl,notInConstruct:Al},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:kl,notInConstruct:Al},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:kl,notInConstruct:Al}]}}function Nl(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Pl(e){this.config.enter.autolinkProtocol.call(this,e)}function Fl(e){this.config.exit.autolinkProtocol.call(this,e)}function Il(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 Ll(e){this.config.exit.autolinkEmail.call(this,e)}function Rl(e){this.exit(e)}function zl(e){Tl(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Bl],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Vl]],{ignore:[`link`,`linkReference`]})}function Bl(e,t,n,r,i){let a=``;if(!Wl(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Hl(n)))return!1;let o=Ul(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 Vl(e,t,n,r){return!Wl(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Hl(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 Ul(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=Cl(e,`(`),a=Cl(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 Wl(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||zi(n)||Ri(n))&&(!t||n!==47)}eu.peek=$l;function Gl(){this.buffer()}function Kl(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function ql(){this.buffer()}function Jl(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Yl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Xl(e){this.exit(e)}function Zl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Ai(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ql(e){this.exit(e)}function $l(){return`[`}function eu(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 tu(){return{enter:{gfmFootnoteCallString:Gl,gfmFootnoteCall:Kl,gfmFootnoteDefinitionLabelString:ql,gfmFootnoteDefinition:Jl},exit:{gfmFootnoteCallString:Yl,gfmFootnoteCall:Xl,gfmFootnoteDefinitionLabelString:Zl,gfmFootnoteDefinition:Ql}}}function nu(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:eu},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?`
|
|
39
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?iu
|
|
40
|
-
`)}function
|
|
41
|
-
`&&!e.before&&!e.after&&
|
|
42
|
-
`}function
|
|
37
|
+
`}),n}function kc(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ac(e,t){let n=wc(e,t),r=n.one(e,void 0),i=lc(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
38
|
+
`},i)),a}function jc(e,t){return e&&`run`in e?async function(n,r){let i=Ac(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ac(n,{file:r,...e||t})}}function Mc(e){if(e)throw e}var Nc=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 Pc(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 Fc(){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);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Ic(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 Ic(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 Lc={basename:Rc,dirname:zc,extname:Bc,join:Vc,sep:`/`};function Rc(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Wc(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 zc(e){if(Wc(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 Bc(e){Wc(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}}else 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 Vc(...e){let t=-1,n;for(;++t<e.length;)Wc(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Hc(n)}function Hc(e){Wc(e);let t=e.codePointAt(0)===47,n=Uc(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Uc(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 Wc(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var Gc={cwd:Kc};function Kc(){return`/`}function qc(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function Jc(e){if(typeof e==`string`)e=new URL(e);else if(!qc(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 Yc(e)}function Yc(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 Xc=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],Zc=class{constructor(e){let t;t=e?qc(e)?{path:e}:typeof e==`string`||tl(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:Gc.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<Xc.length;){let e=Xc[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)Xc.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Lc.basename(this.path):void 0}set basename(e){$c(e,`basename`),Qc(e,`basename`),this.path=Lc.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Lc.dirname(this.path):void 0}set dirname(e){el(this.basename,`dirname`),this.path=Lc.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Lc.extname(this.path):void 0}set extname(e){if(Qc(e,`extname`),el(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=Lc.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){qc(e)&&(e=Jc(e)),$c(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Lc.basename(this.path,this.extname):void 0}set stem(e){$c(e,`stem`),Qc(e,`stem`),this.path=Lc.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 Br(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 Qc(e,t){if(e&&e.includes(Lc.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Lc.sep+"`")}function $c(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function el(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function tl(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var nl=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),rl=l(Nc(),1),il={}.hasOwnProperty,al=new class e extends nl{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=Fc()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,rl.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(cl(`data`,this.frozen),this.namespace[e]=t,this):il.call(this.namespace,e)&&this.namespace[e]||void 0:e?(cl(`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=dl(e),n=this.parser||this.Parser;return ol(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ol(`process`,this.parser||this.Parser),sl(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=dl(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);pl(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(),ol(`processSync`,this.parser||this.Parser),sl(`processSync`,this.compiler||this.Compiler),this.process(e,r),ul(`processSync`,`process`,t),n;function r(e,r){t=!0,Mc(e),n=r}}run(e,t,n){ll(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=dl(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),ul(`runSync`,`run`,n),r;function i(e,t){Mc(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=dl(t),r=this.compiler||this.Compiler;return sl(`stringify`,r),ll(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(cl(`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,rl.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];Pc(o)&&Pc(r)&&(r=(0,rl.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ol(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function sl(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function cl(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 ll(e){if(!Pc(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function ul(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function dl(e){return fl(e)?e:new Zc(e)}function fl(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function pl(e){return typeof e==`string`||ml(e)}function ml(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var hl=[],gl={allowDangerousHtml:!0},_l=/^(https?|ircs?|mailto|xmpp)$/i,vl=[{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 yl(e){let t=bl(e),n=xl(e);return Sl(t.runSync(t.parse(n),n),e)}function bl(e){let t=e.rehypePlugins||hl,n=e.remarkPlugins||hl,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...gl}:gl;return al().use(ms).use(n).use(jc,r).use(t)}function xl(e){let t=e.children||``,n=new Zc;return typeof t==`string`?n.value=t:``+t,n}function Sl(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||Cl;for(let e of vl)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return xc(e,l),Jr(e,{Fragment:V.Fragment,components:i,ignoreInvalidStyle:!0,jsx:V.jsx,jsxs:V.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 gi)if(Object.hasOwn(gi,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=gi[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 Cl(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||_l.test(e.slice(0,t))?e:``}function wl(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 Tl(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function El(e,t,n){let r=uc((n||{}).ignore||[]),i=Dl(t),a=-1;for(;++a<i.length;)yc(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;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function Dl(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([Ol(e[0]),kl(e[1])])}return t}function Ol(e){return typeof e==`string`?new RegExp(Tl(e),`g`):e}function kl(e){return typeof e==`function`?e:function(){return e}}var Al=`phrasing`,jl=[`autolink`,`link`,`image`,`label`];function Ml(){return{transforms:[Bl],enter:{literalAutolink:Pl,literalAutolinkEmail:Fl,literalAutolinkHttp:Fl,literalAutolinkWww:Fl},exit:{literalAutolink:zl,literalAutolinkEmail:Rl,literalAutolinkHttp:Il,literalAutolinkWww:Ll}}}function Nl(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:Al,notInConstruct:jl},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:Al,notInConstruct:jl},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:Al,notInConstruct:jl}]}}function Pl(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function Fl(e){this.config.enter.autolinkProtocol.call(this,e)}function Il(e){this.config.exit.autolinkProtocol.call(this,e)}function Ll(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 Rl(e){this.config.exit.autolinkEmail.call(this,e)}function zl(e){this.exit(e)}function Bl(e){El(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Vl],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,Hl]],{ignore:[`link`,`linkReference`]})}function Vl(e,t,n,r,i){let a=``;if(!Gl(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!Ul(n)))return!1;let o=Wl(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 Hl(e,t,n,r){return!Gl(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function Ul(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 Wl(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=wl(e,`(`),a=wl(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 Gl(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||Bi(n)||zi(n))&&(!t||n!==47)}tu.peek=eu;function Kl(){this.buffer()}function ql(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Jl(){this.buffer()}function Yl(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Xl(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Zl(e){this.exit(e)}function Ql(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function $l(e){this.exit(e)}function eu(){return`[`}function tu(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 nu(){return{enter:{gfmFootnoteCallString:Kl,gfmFootnoteCall:ql,gfmFootnoteDefinitionLabelString:Jl,gfmFootnoteDefinition:Yl},exit:{gfmFootnoteCallString:Xl,gfmFootnoteCall:Zl,gfmFootnoteDefinitionLabelString:Ql,gfmFootnoteDefinition:$l}}}function ru(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tu},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?`
|
|
39
|
+
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?au:iu))),s(),o}}function iu(e,t,n){return t===0?e:au(e,t,n)}function au(e,t,n){return(n?``:` `)+e}var ou=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];du.attention=fu,du.peek=pu;function su(){return{canContainEols:[`delete`],enter:{strikethrough:lu},exit:{strikethrough:uu}}}function cu(){return{handlers:{delete:du},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:ou}]}}function lu(e){this.enter({type:`delete`,children:[],position:void 0},e)}function uu(e){this.exit(e)}function du(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 fu(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function pu(){return`~`}function mu(e){return e.length}function hu(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||mu,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=gu(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]=_u(r[d]);else{let e=_u(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(`
|
|
40
|
+
`)}function gu(e){return e==null?``:String(e)}function _u(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 vu=uc([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function yu(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()),bu);return i(),o}function bu(e,t,n){return`>`+(n?``:` `)+e}function xu(e,t){return Su(e,t.inConstruct,!0)&&!Su(e,t.notInConstruct,!1)}function Su(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 Cu(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
41
|
+
`&&!e.before&&!e.after&&xu(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
42
|
+
`}function wu(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 Tu(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 Eu(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function Du(e,t,n,r){let i=Eu(n),a=e.value||``;if(Tu(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,Ou);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(wu(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:`
|
|
43
43
|
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
44
44
|
`),a&&(u+=o.move(a+`
|
|
45
|
-
`)),u+=o.move(s),c(),u}function
|
|
46
|
-
`,...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
|
|
45
|
+
`)),u+=o.move(s),c(),u}function Ou(e,t,n){return(n?``:` `)+e}function ku(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function Au(e,t,n,r){let i=ku(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?` `:`
|
|
46
|
+
`,...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 ju(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}Mu.attention=Nu,Mu.peek=Pu;function Mu(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function Nu(e,t){return{construct:`emphasis`,markers:ju(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function Pu(e,t,n){return n.options.emphasis||`*`}function Fu(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function Iu(e,t){let n=!1;return xc(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)&&vi(e)&&(t.options.setext||n))}function Lu(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(Iu(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
47
47
|
`,after:`
|
|
48
48
|
`});return r(),t(),o+`
|
|
49
49
|
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
50
50
|
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
51
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=
|
|
51
|
+
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=Fu(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}Ru.peek=zu;function Ru(e){return e.value||``}function zu(){return`<`}Bu.peek=Vu;function Bu(e,t,n,r){let i=ku(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 Vu(){return`!`}Hu.peek=Uu;function Hu(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 Uu(){return`!`}Wu.peek=Gu;function Wu(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 Gu(){return"`"}function Ku(e,t){let n=vi(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))}qu.peek=Ju;function qu(e,t,n,r){let i=ku(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(Ku(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 Ju(e,t,n){return Ku(e,n)?`<`:`[`}Yu.peek=X;function Yu(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 X(){return`[`}function Xu(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 Z(e){let t=Xu(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 Q(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Zu(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 Qu(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Q(n):Xu(n),s=e.ordered?o===`.`?`)`:`.`:Z(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),Zu(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 $u(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 ed(e,t,n,r){let i=$u(n),a=n.bulletCurrent||Xu(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 td(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function nd(e,t,n,r){if(!e.children.some(function(e){return vu(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function rd(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}id.attention=ad,id.peek=od;function id(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function ad(e,t){return{construct:`strong`,markers:rd(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function od(e,t,n){return n.options.strong||`*`}function sd(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function cd(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 ld(e,t,n){let r=(Zu(n)+(n.options.ruleSpaces?` `:``)).repeat(cd(n));return n.options.ruleSpaces?r.slice(0,-1):r}var ud={blockquote:yu,break:Cu,code:Du,definition:Au,emphasis:Mu,hardBreak:Cu,heading:Lu,html:Ru,image:Bu,imageReference:Hu,inlineCode:Wu,link:qu,linkReference:Yu,list:Qu,listItem:ed,paragraph:td,root:nd,strong:id,text:sd,thematicBreak:ld};function dd(){return{enter:{table:fd,tableData:gd,tableHeader:gd,tableRow:md},exit:{codeText:_d,table:pd,tableData:hd,tableHeader:hd,tableRow:hd}}}function fd(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 pd(e){this.exit(e),this.data.inTable=void 0}function md(e){this.enter({type:`tableRow`,children:[]},e)}function hd(e){this.exit(e)}function gd(e){this.enter({type:`tableCell`,children:[]},e)}function _d(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vd));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vd(e,t){return t===`|`?t:e}function yd(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
52
52
|
`,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(`
|
|
53
|
-
`))}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 mu(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=ld.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function yd(){return{exit:{taskListCheckValueChecked:xd,taskListCheckValueUnchecked:xd,paragraph:Sd}}}function bd(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:Cd}}}function xd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Sd(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 Cd(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=ld.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 wd(){return[jl(),tu(),ou(),ud(),yd()]}function Td(e){return{extensions:[Ml(),nu(e),su(),vd(e),bd()]}}var Ed={tokenize:Bd,partial:!0},Dd={tokenize:Vd,partial:!0},Od={tokenize:Hd,partial:!0},kd={tokenize:Ud,partial:!0},Ad={tokenize:Wd,partial:!0},jd={name:`wwwAutolink`,tokenize:Rd,previous:Gd},Md={name:`protocolAutolink`,tokenize:zd,previous:Kd},Nd={name:`emailAutolink`,tokenize:Ld,previous:qd},Pd={};function Fd(){return{text:Pd}}for(var Id=48;Id<123;)Pd[Id]=Nd,Id++,Id===58?Id=65:Id===91&&(Id=97);Pd[43]=Nd,Pd[45]=Nd,Pd[46]=Nd,Pd[95]=Nd,Pd[72]=[Nd,Md],Pd[104]=[Nd,Md],Pd[87]=[Nd,jd],Pd[119]=[Nd,jd];function Ld(e,t,n){let r=this,i,a;return o;function o(t){return!Jd(t)||!qd.call(r,r.previous)||Yd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Jd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Ad,u,l)(t):t===45||t===95||Mi(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&&ji(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Rd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Gd.call(r,r.previous)||Yd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Ed,e.attempt(Dd,e.attempt(Od,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zd(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Kd.call(r,r.previous)&&!Yd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(ji(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||Pi(t)||G(t)||zi(t)||Ri(t)?n(t):e.attempt(Dd,e.attempt(Od,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bd(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 Vd(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(kd,c,s)(t):t===null||G(t)||zi(t)||t!==45&&Ri(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 Hd(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(kd,t,a)(o):o===null||G(o)||zi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Ud(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||G(o)||zi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||G(e)||zi(e)?t(e):r(e)}function a(e){return ji(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):ji(t)?(e.consume(t),o):n(t)}}function Wd(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Mi(e)?n(e):t(e)}}function Gd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function Kd(e){return!ji(e)}function qd(e){return!(e===47||Jd(e))}function Jd(e){return e===43||e===45||e===46||e===95||Mi(e)}function Yd(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 Xd={tokenize:af,partial:!0};function Zd(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:tf,continuation:{tokenize:nf},exit:rf}},text:{91:{name:`gfmFootnoteCall`,tokenize:ef},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Qd,resolveTo:$d}}}}function Qd(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=Ai(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 $d(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 ef(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||G(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Ai(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return G(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 tf(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||G(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Ai(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return G(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),q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function nf(e,t,n){return e.check(ia,t,e.attempt(Xd,t,n))}function rf(e){e.exit(`gfmFootnoteDefinition`)}function af(e,t,n){let r=this;return q(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 of(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&&Ci(o,o.length,0,Zi(s,e.slice(r+1,n),t)),Ci(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Ci(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=J(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=J(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var sf=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){cf(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 cf(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 lf(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 uf(){return{flow:{null:{name:`table`,tokenize:df,resolveAll:ff}}}}function df(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||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):W(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):K(t)?q(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||G(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,K(t)?q(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 K(t)?q(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||W(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 K(t)?q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||W(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||W(n)?(e.exit(`tableRow`),t(n)):K(n)?q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||G(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 ff(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 sf;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(mf(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=pf(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=pf(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=pf(f,t,o,i,n,d)):(o[0]=o[1],d=pf(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&mf(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=lf(t.events,n))}return e}function pf(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},hf(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=hf(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=hf(t.events,n[2]),a=hf(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({},hf(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function mf(e,t,n,r,i){let a=[],o=hf(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 hf(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var gf={name:`tasklistCheck`,tokenize:vf};function _f(){return{text:{91:gf}}}function vf(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 G(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 W(r)?t(r):K(r)?e.check({tokenize:yf},t,n)(r):n(r)}}function yf(e,t,n){return q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function bf(e){return Ei([Fd(),Zd(),of(e),uf(),_f()])}var xf={};function Sf(e){let t=this,n=e||xf,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bf(n)),a.push(wd()),o.push(Td(n))}var Cf=e=>/\.(png|jpe?g)$/i.test(e.replace(/[?#].*$/,``)),wf=(e,t,n)=>t.startsWith(`board:`)?`/api/board-attachment?file=${encodeURIComponent(t)}`:`/api/sessions/${e}/image?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`;function Tf(e){let[t,n]=(0,v.useState)(null),r=wf(e.sessionId,e.path,e.folder);return t?(0,V.jsxs)(`p`,{className:`error`,children:[e.alt?`${e.alt}: `:``,t]}):(0,V.jsx)(`img`,{src:r,alt:e.alt??e.path,className:`project-image${e.full?` full`:``}${e.onClick?` clickable`:``}`,onClick:e.onClick,onError:()=>{fetch(r,{credentials:`same-origin`}).then(e=>e.json()).then(e=>n(e.error??`The image could not be shown.`)).catch(()=>n(`The image could not be shown.`))}})}async function Ef(e){if(window.isSecureContext&&navigator.clipboard)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function Df({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,V.jsx)(`button`,{type:`button`,className:`copy-button`,onClick:async()=>{await Ef(e),r(!0),setTimeout(()=>r(!1),1500)},children:n?`Copied`:t})}function Of(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(Of).join(``):e&&typeof e==`object`&&`props`in e?Of(e.props.children):``}function kf(e){return e.startsWith(`#`)?!1:/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith(`file:`)?!0:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)}function Af(e,t){let n=t.replace(/^file:\/\/\/?/,``);if(/^[a-zA-Z]:[\\/]/.test(n)||n.startsWith(`/`))return n;let r=e?e.split(`/`):[];for(let e of n.split(`/`))e!==``&&e!==`.`&&(e===`..`&&r.length&&r[r.length-1]!==`..`?r.pop():r.push(e));return r.join(`/`)}function jf({text:e,baseDir:t=``,onOpenFile:n,sessionId:r}){return(0,V.jsx)(`div`,{className:`markdown`,children:(0,V.jsx)(vl,{remarkPlugins:[Sf],components:{pre:({children:e})=>{let t=Of(e).replace(/\n$/,``);return(0,V.jsxs)(`div`,{className:`code-block`,children:[(0,V.jsx)(Df,{text:t}),(0,V.jsx)(`pre`,{children:e})]})},a:({href:e,children:r})=>n&&e&&kf(e)?(0,V.jsx)(`a`,{href:e,className:`file-link`,onClick:r=>{r.preventDefault(),n(Af(t,e))},children:r}):(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:r}),img:({src:e,alt:i})=>{let a=typeof e==`string`?e:``;if(!r||!a||!kf(a)||a.startsWith(`file:`))return(0,V.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`]`]});let o=Af(t,a.replace(/[?#].*$/,``));return!Cf(o)||o.startsWith(`..`)?(0,V.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`: only PNG and JPEG images inside the project]`]}):(0,V.jsx)(Tf,{sessionId:r,path:o,alt:i,onClick:()=>n?.(o)})},table:({children:e})=>(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsx)(`table`,{children:e})})},children:e})})}var Mf=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Nf=e=>R.usagePublishRepos(e);function Pf(e){let t=Math.round((Date.now()-e)/6e4);return t<1?`just now`:t<60?`${t} min ago`:t<2880?`${Math.round(t/60)} h ago`:`${Math.round(t/1440)} days ago`}function Ff({accounts:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),m=(0,v.useCallback)(()=>{R.usagePublish().then(e=>r(e),()=>{}),R.sharedUsage().then(a,()=>{})},[]);(0,v.useEffect)(()=>{m();let e=setInterval(m,6e4);return()=>clearInterval(e)},[m]);let h=n?.allAccounts??!1,g=(n?.accounts??[]).join(`
|
|
53
|
+
`))}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 hu(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=ud.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function bd(){return{exit:{taskListCheckValueChecked:Sd,taskListCheckValueUnchecked:Sd,paragraph:Cd}}}function xd(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:wd}}}function Sd(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function Cd(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 wd(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=ud.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 Td(){return[Ml(),nu(),su(),dd(),bd()]}function Ed(e){return{extensions:[Nl(),ru(e),cu(),yd(e),xd()]}}var Dd={tokenize:Vd,partial:!0},Od={tokenize:Hd,partial:!0},kd={tokenize:Ud,partial:!0},Ad={tokenize:Wd,partial:!0},jd={tokenize:Gd,partial:!0},Md={name:`wwwAutolink`,tokenize:zd,previous:Kd},Nd={name:`protocolAutolink`,tokenize:Bd,previous:qd},Pd={name:`emailAutolink`,tokenize:Rd,previous:Jd},Fd={};function Id(){return{text:Fd}}for(var Ld=48;Ld<123;)Fd[Ld]=Pd,Ld++,Ld===58?Ld=65:Ld===91&&(Ld=97);Fd[43]=Pd,Fd[45]=Pd,Fd[46]=Pd,Fd[95]=Pd,Fd[72]=[Pd,Nd],Fd[104]=[Pd,Nd],Fd[87]=[Pd,Md],Fd[119]=[Pd,Md];function Rd(e,t,n){let r=this,i,a;return o;function o(t){return!Yd(t)||!Jd.call(r,r.previous)||Xd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Yd(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(jd,u,l)(t):t===45||t===95||Ni(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&&Mi(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function zd(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Kd.call(r,r.previous)||Xd(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Dd,e.attempt(Od,e.attempt(kd,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function Bd(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&qd.call(r,r.previous)&&!Xd(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Mi(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||Fi(t)||G(t)||Bi(t)||zi(t)?n(t):e.attempt(Od,e.attempt(kd,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Vd(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 Hd(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(Ad,c,s)(t):t===null||G(t)||Bi(t)||t!==45&&zi(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 Ud(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(Ad,t,a)(o):o===null||G(o)||Bi(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Wd(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||G(o)||Bi(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||G(e)||Bi(e)?t(e):r(e)}function a(e){return Mi(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Mi(t)?(e.consume(t),o):n(t)}}function Gd(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Ni(e)?n(e):t(e)}}function Kd(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function qd(e){return!Mi(e)}function Jd(e){return!(e===47||Yd(e))}function Yd(e){return e===43||e===45||e===46||e===95||Ni(e)}function Xd(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 Zd={tokenize:of,partial:!0};function Qd(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:nf,continuation:{tokenize:rf},exit:af}},text:{91:{name:`gfmFootnoteCall`,tokenize:tf},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$d,resolveTo:ef}}}}function $d(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=ji(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 ef(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 tf(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||G(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ji(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return G(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 nf(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||G(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ji(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return G(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),q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rf(e,t,n){return e.check(aa,t,e.attempt(Zd,t,n))}function af(e){e.exit(`gfmFootnoteDefinition`)}function of(e,t,n){let r=this;return q(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 sf(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&&wi(o,o.length,0,Qi(s,e.slice(r+1,n),t)),wi(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),wi(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=Zi(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=Zi(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var cf=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){lf(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 lf(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 uf(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 df(){return{flow:{null:{name:`table`,tokenize:ff,resolveAll:pf}}}}function ff(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||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):W(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):K(t)?q(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||G(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,K(t)?q(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 K(t)?q(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||W(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 K(t)?q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||W(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||W(n)?(e.exit(`tableRow`),t(n)):K(n)?q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||G(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 pf(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 cf;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(hf(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=mf(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=mf(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=mf(f,t,o,i,n,d)):(o[0]=o[1],d=mf(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&hf(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=uf(t.events,n))}return e}function mf(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},gf(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=gf(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=gf(t.events,n[2]),a=gf(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({},gf(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function hf(e,t,n,r,i){let a=[],o=gf(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 gf(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var _f={name:`tasklistCheck`,tokenize:yf};function vf(){return{text:{91:_f}}}function yf(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 G(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 W(r)?t(r):K(r)?e.check({tokenize:bf},t,n)(r):n(r)}}function bf(e,t,n){return q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function xf(e){return Di([Id(),Qd(),sf(e),df(),vf()])}var Sf={};function Cf(e){let t=this,n=e||Sf,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(xf(n)),a.push(Td()),o.push(Ed(n))}var wf=e=>/\.(png|jpe?g)$/i.test(e.replace(/[?#].*$/,``)),Tf=(e,t,n)=>t.startsWith(`board:`)?`/api/board-attachment?file=${encodeURIComponent(t)}`:`/api/sessions/${e}/image?path=${encodeURIComponent(t)}${n?`&in=${n}`:``}`;function Ef(e){let[t,n]=(0,v.useState)(null),r=Tf(e.sessionId,e.path,e.folder);return t?(0,V.jsxs)(`p`,{className:`error`,children:[e.alt?`${e.alt}: `:``,t]}):(0,V.jsx)(`img`,{src:r,alt:e.alt??e.path,className:`project-image${e.full?` full`:``}${e.onClick?` clickable`:``}`,onClick:e.onClick,onError:()=>{fetch(r,{credentials:`same-origin`}).then(e=>e.json()).then(e=>n(e.error??`The image could not be shown.`)).catch(()=>n(`The image could not be shown.`))}})}async function Df(e){if(window.isSecureContext&&navigator.clipboard)return navigator.clipboard.writeText(e);let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select(),document.execCommand(`copy`),t.remove()}function Of({text:e,label:t=`Copy`}){let[n,r]=(0,v.useState)(!1);return(0,V.jsx)(`button`,{type:`button`,className:`copy-button`,onClick:async()=>{await Df(e),r(!0),setTimeout(()=>r(!1),1500)},children:n?`Copied`:t})}function kf(e){return typeof e==`string`||typeof e==`number`?String(e):Array.isArray(e)?e.map(kf).join(``):e&&typeof e==`object`&&`props`in e?kf(e.props.children):``}function Af(e){return e.startsWith(`#`)?!1:/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith(`file:`)?!0:!/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(e)}function jf(e,t){let n=t.replace(/^file:\/\/\/?/,``);if(/^[a-zA-Z]:[\\/]/.test(n)||n.startsWith(`/`))return n;let r=e?e.split(`/`):[];for(let e of n.split(`/`))e!==``&&e!==`.`&&(e===`..`&&r.length&&r[r.length-1]!==`..`?r.pop():r.push(e));return r.join(`/`)}function Mf({text:e,baseDir:t=``,onOpenFile:n,sessionId:r}){return(0,V.jsx)(`div`,{className:`markdown`,children:(0,V.jsx)(yl,{remarkPlugins:[Cf],components:{pre:({children:e})=>{let t=kf(e).replace(/\n$/,``);return(0,V.jsxs)(`div`,{className:`code-block`,children:[(0,V.jsx)(Of,{text:t}),(0,V.jsx)(`pre`,{children:e})]})},a:({href:e,children:r})=>n&&e&&Af(e)?(0,V.jsx)(`a`,{href:e,className:`file-link`,onClick:r=>{r.preventDefault(),n(jf(t,e))},children:r}):(0,V.jsx)(`a`,{href:e,target:`_blank`,rel:`noreferrer noopener`,children:r}),img:({src:e,alt:i})=>{let a=typeof e==`string`?e:``;if(!r||!a||!Af(a)||a.startsWith(`file:`))return(0,V.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`]`]});let o=jf(t,a.replace(/[?#].*$/,``));return!wf(o)||o.startsWith(`..`)?(0,V.jsxs)(`span`,{className:`image-note`,children:[`[image not shown`,i?`: ${i}`:``,`: only PNG and JPEG images inside the project]`]}):(0,V.jsx)(Ef,{sessionId:r,path:o,alt:i,onClick:()=>n?.(o)})},table:({children:e})=>(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsx)(`table`,{children:e})})},children:e})})}var Nf=/^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/,Pf=e=>R.usagePublishRepos(e);function Ff(e){let t=Math.round((Date.now()-e)/6e4);return t<1?`just now`:t<60?`${t} min ago`:t<2880?`${Math.round(t/60)} h ago`:`${Math.round(t/1440)} days ago`}function If({accounts:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)([]),[f,p]=(0,v.useState)(!1),m=(0,v.useCallback)(()=>{R.usagePublish().then(e=>r(e),()=>{}),R.sharedUsage().then(a,()=>{})},[]);(0,v.useEffect)(()=>{m();let e=setInterval(m,6e4);return()=>clearInterval(e)},[m]);let h=n?.allAccounts??!1,g=(n?.accounts??[]).join(`
|
|
54
54
|
`);if((0,v.useEffect)(()=>{n&&(s(n.repo??``),l(h),d(g?g.split(`
|
|
55
|
-
`):[]))},[n?.repo,h,g]),!n)return null;let _=o.trim(),y=!_||
|
|
56
|
-
`)!==g||_!==(n.repo??``),S=()=>t(async()=>{r(await R.setUsagePublish(b,_||null,{allAccounts:c,accounts:[...u].sort()})),a(await R.sharedUsage(!0))}),C=[...new Set([`default`,...e.map(e=>e.name),...n.accounts])],w=t=>e.find(e=>e.name===t)?.email??null,T=(e,t)=>d(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e)),E=!n.enabled&&!n.pendingRemovals?.length;if(E&&!f)return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),(0,V.jsxs)(`div`,{className:`offline`,children:[(0,V.jsx)(`span`,{className:`offline-name`,children:`Publish usage`}),(0,V.jsx)(`span`,{className:`offline-why`,children:`Share this computer's usage totals with your other computers through a GitHub repository.`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>p(!0),children:`Set up ›`})]})]});let D=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Shares this computer's usage totals with a GitHub repository, through your `,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),` login, so the Shared tab can show every computer's usage side by side. Each computer keeps one file there and replaces it every 5 minutes when something changed.`]}),(0,V.jsxs)(`div`,{role:`group`,"aria-label":`Accounts to publish`,children:[(0,V.jsx)(`h4`,{children:`Accounts`}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`All accounts`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(every Claude account on this computer, ones added later too)`})]})]}),C.map(t=>(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:c||u.includes(t),disabled:c,onChange:e=>T(t,e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`span`,{className:`field-name`,children:[`Publish `,t]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`(`,t==="default"?`this computer's own login`:w(t)??`not signed in yet`,!e.some(e=>e.name===t)&&t!=="default"?`, removed`:``,`)`]})]})]},t))]}),(0,V.jsx)(Nn,{project:``,label:`Default usage repository`,newName:`ledung-usage`,value:o,ok:y,onChange:s,load:Nf}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Every project publishes here unless its own settings name a usage repository of its own.`,!!n.projectRepos?.length&&(0,V.jsxs)(V.Fragment,{children:[` Projects with their own: `,n.projectRepos.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`; `:``,e.projects.join(`, `),` → `,(0,V.jsx)(`span`,{className:`mono`,children:e.repo})]},e.repo)),`.`]})]}),(b||_)&&(0,V.jsxs)(`div`,{className:`board-warning`,children:[(0,V.jsxs)(`strong`,{children:[`Everyone with read access to `,_&&y?_:`the repository`,` sees what is published`]}),`: this computer's name, your GitHub login, and for each account switched on above, per day and model, the tokens, API-equivalent cost and calls, and its plan limits; a project with a repository of its own goes there instead. A project shows by name only where you switch that on in its settings; every other project is `,(0,V.jsx)(`span`,{className:`mono`,children:`other#`}),` and four characters. Never prompts, replies, tool output, paths, folder or branch names, session titles, emails or tokens.`]}),(0,V.jsx)(`button`,{disabled:!x||!y||b&&!_,onClick:()=>void S(),children:`Save`}),b&&!_&&(0,V.jsx)(`span`,{className:`muted`,children:` Choose the repository to publish to.`}),!b&&n.enabled&&(0,V.jsx)(`span`,{className:`muted`,children:` No account is switched on: saving stops publishing and removes this computer's usage from the repositories.`}),n.enabled&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Publishes as `,(0,V.jsx)(`strong`,{children:n.computer}),n.lastPublishedAt?`; last published ${Pf(n.lastPublishedAt)}`:``,`.`,n.error&&(0,V.jsxs)(`span`,{className:`board-error`,children:[` The last publish failed: `,n.error,` Ledung tries again shortly (after 1, 2, then every 5 minutes).`]})]}),!!n.pendingRemovals?.length&&(0,V.jsxs)(`p`,{className:`board-error`,children:[`This computer's usage is still in `,n.pendingRemovals.join(`, `),`; Ledung keeps trying to remove it.`,!n.enabled&&n.error?` ${n.error}`:``]}),(0,V.jsx)(If,{view:n,onView:r,run:t}),i?.repo&&(0,V.jsx)(Lf,{shared:i,onShared:a,run:t})]});return E?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),(0,V.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":`Publish usage`,children:[(0,V.jsxs)(`h4`,{children:[(0,V.jsx)(`span`,{children:`Publish usage`}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Close Publish usage`,title:`Close`,onClick:()=>p(!1),children:`✕`})]}),D]})]}):(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Publish usage`}),D]})}function If({view:e,onView:t,run:n}){let r=B(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h4`,{children:`Usage key`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Makes a project's `,(0,V.jsx)(`span`,{className:`mono`,children:`other#`}),` label the same on all your computers, without its name. It stays on this computer, next to the link keys. `,e.hasKey?`This computer has one.`:`This computer makes one, or takes a linked computer's, when publishing is switched on.`]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[e.hasKey&&!i&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>a((await R.revealUsageKey()).key)),children:`Show the key`}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`mono`,children:i}),` `,(0,V.jsx)(Df,{text:i}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>a(null),children:`Hide`})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.takeLinkedUsageKey())),children:`Take a linked computer's key`})]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`Paste a usage key from another computer`,onChange:e=>s(e.target.value.trim())}),(0,V.jsx)(`button`,{className:`small`,disabled:!o,onClick:()=>void n(async()=>{t(await R.setUsageKey(o)),s(``),a(null)}),children:`Use this key`})]})]})}function Lf({shared:e,onShared:t,run:n}){let[r,i]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h4`,{children:[`Computers publishing to `,e.repo]}),e.error&&(0,V.jsx)(`p`,{className:`board-error`,children:e.error}),!e.entries.length&&!e.error&&(0,V.jsx)(`p`,{className:`muted`,children:`None yet.`}),(0,V.jsx)(`ul`,{className:`board-counts`,children:e.entries.map(a=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(Rf,{entry:a}),a.stale&&!a.own&&e.canRemove&&(r===a.id?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`button`,{className:`small danger`,onClick:()=>void n(async()=>{t(await R.removeSharedUsage(a.id)),i(null)}),children:`Confirm: remove its usage`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(null),children:`Cancel`})]}):(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(a.id),children:`Remove…`})]}))]},a.id))}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.sharedUsage(!0))),children:`Check again`})]})}function Rf({entry:e}){let t=`${e.computer??`A computer`}${e.login?` (@${e.login})`:``}${e.own?`, this computer`:``}`;return e.state===`newer`?(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),`: published by a newer Ledung. Update Ledung to read it.`]}):e.state===`invalid`?(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),`: its file can't be read (`,e.reason,`).`]}):(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),e.asOf?`, as of ${Pf(e.asOf)}`:``,e.stale&&(0,V.jsx)(`span`,{className:`chip warn`,children:`silent for 30 days`})]})}function zf({value:e,onChange:t}){let n=e.usageRepo.trim();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Bf,{value:e.publishUsageName,onChange:n=>t({...e,publishUsageName:n})}),(0,V.jsx)(Nn,{project:``,label:(0,V.jsx)(`span`,{className:`field-name`,children:`Usage repository`}),newName:`ledung-usage`,value:e.usageRepo,ok:!n||Mf.test(n),onChange:n=>t({...e,usageRepo:n}),load:Nf}),(0,V.jsx)(`span`,{className:`muted`,children:`Where its usage is published, instead of this computer's default repository (Settings → Claude & usage → Publish usage); empty: the default.`})]})}function Bf({value:e,onChange:t}){return(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Publish its usage under its name`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(when usage is published in Settings; otherwise it shows as other# and four characters)`})]})]})}var $=`ledung.waitingFilter`;function Vf(e){try{let t=JSON.parse(e.getItem($)??`null`);if(t&&(t.mode===`one`||t.mode===`all`))return{mode:t.mode,one:String(t.one??``),hidden:Array.isArray(t.hidden)?t.hidden.map(String):[]}}catch{}return{mode:`all`,one:``,hidden:[]}}function Hf(e,t){try{e.setItem($,JSON.stringify(t))}catch{}}function Uf(e,t,n){let r=Vf(e);(r.one===t||r.hidden.includes(t))&&Hf(e,{mode:r.mode,one:r.one===t?n:r.one,hidden:r.hidden.map(e=>e===t?n:e)})}function Wf(e,t,n,r,i){let a=e.map(e=>{let r=ce(e),i=t(e.sessionId);return{q:e,v:r,project:i,tier:me(r.tier,n(i))}}),o=F(i),s=a.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&r(e.project)).sort((e,t)=>o({tier:e.tier,rank:e.v.rank,askedAt:e.q.askedAt},{tier:t.tier,rank:t.v.rank,askedAt:t.q.askedAt})),c=a.filter(e=>e.q.status!==`open`&&r(e.project)).sort((e,t)=>(t.q.answeredAt??t.q.askedAt)-(e.q.answeredAt??e.q.askedAt)).slice(0,30);return{items:a,forYou:s,done:c,listFor:e=>e.q.status===`open`?e.q.addressedTo===`user`?s:[e]:c}}var Gf={A:`Lockdown level A: nothing reaches in; it may still reach out`,B:`Lockdown level B, nearly air-gapped: nothing reaches in or out`};function Kf(e){return e===`A`?1:2}function qf(e){let t=e?.lockdown?.level;return t===`A`||t===`B`?t:null}function Jf(e,t,n){let r=Array.from({length:n},()=>Array(t).fill(` `)),i=Array.from({length:n},()=>Array(t).fill(``)),a=(e,a,o,s=``)=>{e>=0&&a>=0&&e<t&&a<n&&(r[a][e]=o,i[a][e]=s)},o=(e,t,n,r=``)=>[...n].forEach((n,i)=>a(e+i,t,n,r)),s=(e,r,i)=>{let o=e,s=e,c=t-1-e,l=n-1-e;for(let e=o;e<=c;e++){let t=i&&(e-o)%6==3;a(e,s,t?`o`:r[0]),a(e,l,t?`o`:r[0])}for(let e=s;e<=l;e++){let t=i&&(e-s)%3==2&&e<l-1;a(o,e,t?`o`:r[1]),a(c,e,t?`o`:r[1])}a(o,s,r[2]),a(c,s,r[3]),a(o,l,r[4]),a(c,l,r[5])},c=e===`B`;return c?(s(0,`━┃┏┓┗┛`,!0),s(1,`─│┌┐└┘`,!1)):s(0,`─│┌┐└┘`,!0),o(3,0,`┤ LOCK ${e} ├`,c?`d`:`a`),o(t-7,0,`(|)`,c?`d`:``),c||a(t-1,Math.floor(n/2),`»`,`a`),{ch:r,kind:i}}function Yf(e){return e.ch.map((t,n)=>{let r=[];return t.forEach((t,i)=>{let a=e.kind[n][i],o=r[r.length-1];o&&o.kind===a?o.text+=t:r.push({text:t,kind:a})}),r})}var Xf=10,Zf=0;function Qf(){if(Zf)return Zf;let e=document.createElement(`span`);e.className=`lframe-probe`,e.textContent=`0`.repeat(100),document.body.append(e);let t=e.getBoundingClientRect().width/100;return e.remove(),t>0&&document.fonts?.status!==`loading`&&(Zf=t),t||6}function $f({level:e,fill:t,children:n}){return e?(0,V.jsx)(ep,{level:e,fill:!!t,children:n}):(0,V.jsx)(V.Fragment,{children:n})}function ep({level:e,fill:t,children:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null),s=Kf(e);(0,v.useLayoutEffect)(()=>{let e=()=>{let e=r.current,n=i.current;if(!e||!n)return;let a=Qf(),c=e.clientWidth,l=Math.max(2*s+12,Math.floor(c/a)),u=Math.max(0,(c-l*a)/2),d,f=0,p=0;if(t){let t=e.clientHeight;d=Math.max(2*s+3,Math.floor(t/Xf)),f=Math.max(0,(t-d*Xf)/2)}else{let e=n.clientHeight-(parseFloat(getComputedStyle(n).paddingBottom)||0),t=Math.max(1,Math.ceil(e/Xf-.01));d=t+2*s,p=Math.max(0,t*Xf-e)}let m={cols:l,rows:d,cw:a,padX:u,padY:f,extra:p};o(e=>e&&e.cols===l&&e.rows===d&&e.cw===a&&Math.abs(e.padX-u)<.5&&Math.abs(e.padY-f)<.5&&Math.abs(e.extra-p)<.5?e:m)};e();let n=new ResizeObserver(e);n.observe(r.current),n.observe(i.current);let a=!0;return document.fonts?.ready.then(()=>{a&&(Zf=0,e())}),()=>{a=!1,n.disconnect()}},[e,t,s]);let c=a?.cw??6,l=(a?.padX??0)+s*c,u=(a?.padY??0)+s*Xf;return(0,V.jsxs)(`div`,{ref:r,className:`lframe ${e.toLowerCase()}${t?` fill`:``}`,"data-lock":e,children:[(0,V.jsx)(`pre`,{className:`lframe-border`,"aria-hidden":`true`,style:a?{left:a.padX,top:a.padY,width:a.cols*c,height:a.rows*Xf}:void 0,children:a&&Yf(Jf(e,a.cols,a.rows)).map((e,t)=>(0,V.jsxs)(`span`,{children:[t>0&&`
|
|
57
|
-
`,e.map((e,t)=>e.kind?(0,V.jsx)(`span`,{className:`k-${e.kind}`,children:e.text},t):e.text)]},t))}),(0,V.jsx)(`div`,{ref:i,className:`lframe-inner`,style:{margin:`${u}px ${l}px`,paddingBottom:a?.extra||void 0},children:n})]})}var tp={manager:`on`,session:`off`};function np(e,t,n){return n?.[e]?.newSkills??t[e]?.newSkills??tp[e]}function rp(e,t,n,r){let i=r?.[t],a=n[t];return i?.on?.includes(e)?!0:i?.off?.includes(e)?!1:a?.on?.includes(e)?!0:!a?.off?.includes(e)&&np(t,n,r)===`on`}function ip(e,t,n,r){let i=e[t]??{},a=e=>(e??[]).filter(e=>e!==n),o={...i,on:r===!0?[...a(i.on),n].sort():a(i.on),off:r===!1?[...a(i.off),n].sort():a(i.off)};return o.on.length||delete o.on,o.off.length||delete o.off,{...e,[t]:o}}var ap=(e,t,n)=>!!(e?.[t]?.on?.includes(n)||e?.[t]?.off?.includes(n)),op=[{role:`manager`,label:`Manager`},{role:`session`,label:`Sessions`}],sp={personal:`Personal`,"claude.ai":`From claude.ai`};function cp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let t=!0;return n(null),i(null),R.skills(e).then(e=>{t&&n(e)},e=>{t&&i(e.message)}),()=>{t=!1}},[e]),{list:t,error:r}}function lp({list:e,error:t,value:n,onChange:r,defaults:i}){if(t)return(0,V.jsxs)(`p`,{className:`error`,children:[`Couldn't list the skills: `,t]});if(!e)return(0,V.jsx)(`p`,{className:`muted`,children:`Looking for your skills…`});let a=i??{},o=i?n:void 0,s=(e,t)=>i?rp(e,t,a,o):rp(e,t,n,void 0),c=new Set(e.skills.map(e=>e.name)),l=[...new Set(op.flatMap(({role:e})=>[...n[e]?.on??[],...n[e]?.off??[]]))].filter(e=>!c.has(e)).sort(),u=(e,t)=>{let i={...n[e]};t===null?delete i.newSkills:i.newSkills=t,r({...n,[e]:i})},d=[`personal`,`claude.ai`].map(t=>({source:t,skills:e.skills.filter(e=>e.source===t)})).filter(e=>e.skills.length);return(0,V.jsxs)(`div`,{className:`skill-picker`,children:[(0,V.jsxs)(`table`,{children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Skill`}),op.map(({role:e,label:t})=>(0,V.jsx)(`th`,{children:t},e))]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{className:`skill-new`,children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:`New skills`}),(0,V.jsxs)(`div`,{className:`muted`,children:[`A skill with no tick chosen`,i?` here or in Settings`:``,`, such as one you add later.`]})]}),op.map(({role:e,label:t})=>(0,V.jsx)(`td`,{children:i?(0,V.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:n[e]?.newSkills??``,onChange:t=>u(e,t.target.value||null),children:[(0,V.jsxs)(`option`,{value:``,children:[`Settings: `,np(e,a,void 0)]}),(0,V.jsx)(`option`,{value:`on`,children:`on`}),(0,V.jsx)(`option`,{value:`off`,children:`off`})]}):(0,V.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:np(e,n,void 0),onChange:t=>u(e,t.target.value),children:[(0,V.jsx)(`option`,{value:`on`,children:`on`}),(0,V.jsx)(`option`,{value:`off`,children:`off`})]})},e))]}),d.map(e=>[(0,V.jsx)(`tr`,{className:`skill-group`,children:(0,V.jsx)(`td`,{colSpan:3,children:sp[e.source]})},`h-${e.source}`),...e.skills.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),e.description&&(0,V.jsx)(`div`,{className:`muted`,children:e.description})]}),op.map(({role:t,label:a})=>{let o=ap(n,t,e.name);return(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name}, ${a}`,checked:s(e.name,t),onChange:i=>r(ip(n,t,e.name,i.target.checked))}),i&&o&&(0,V.jsx)(`button`,{type:`button`,className:`small skill-clear`,title:`Follow Settings again`,onClick:()=>r(ip(n,t,e.name,null)),children:`here ✕`})]},t)})]},e.name))]),l.length>0&&(0,V.jsx)(`tr`,{className:`skill-group`,children:(0,V.jsx)(`td`,{colSpan:3,children:`Not on this computer any more`})}),l.map(e=>(0,V.jsxs)(`tr`,{className:`skill-gone`,children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`mono`,children:e})}),op.map(({role:t,label:i})=>(0,V.jsx)(`td`,{children:ap(n,t,e)&&(0,V.jsxs)(`button`,{type:`button`,className:`small skill-clear`,"aria-label":`Clear ${e}, ${i}`,onClick:()=>r(ip(n,t,e,null)),children:[n[t]?.on?.includes(e)?`on`:`off`,` ✕`]})},t))]},`gone-${e}`))]})]}),!e.skills.length&&(0,V.jsxs)(`p`,{className:`muted`,children:[`No skills of your own were found`,i?` where this project runs`:` on this computer`,`.`]}),e.plugins.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Plugin skills go on and off with their plugin, in the session profile: `,e.plugins.join(`, `),`.`]})]})}function up(e,t,n){if(!e)return``;let r=e.skills.length,i=r=>e.skills.filter(e=>n?rp(e.name,r,n,t):rp(e.name,r,t,void 0)).length;return`manager ${i(`manager`)} of ${r}, sessions ${i(`session`)} of ${r}`}function dp({run:e}){let{list:t,error:n}=cp(void 0),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{t&&r===null&&i(t.defaults)},[t]),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Skills`}),(0,V.jsx)(`p`,{className:`muted`,children:`Which of your own skills managers and sessions get, unless a project's ⚙ says otherwise. Running sessions keep theirs; new and resumed ones get these.`}),(0,V.jsxs)(`details`,{children:[(0,V.jsxs)(`summary`,{children:[`Default skills`,t&&r?`: ${up(t,r,null)}`:``]}),(0,V.jsx)(lp,{list:t,error:n,value:r??{},onChange:e=>{i(e),o(!1)},defaults:null}),(0,V.jsx)(`button`,{className:`primary`,disabled:!r,onClick:()=>void e(async()=>{i(await R.setSkillDefaults(r??{})),o(!0)}),children:`Save`}),a&&(0,V.jsx)(`span`,{className:`muted`,children:` Saved.`})]})]})}function fp({colour:e,children:t}){if(!e)return(0,V.jsx)(V.Fragment,{children:t});let n=Et[e];return(0,V.jsx)(`span`,{className:`named`,style:{"--name-light":n.light,"--name-dark":n.dark},children:t})}function pp({project:e,run:t}){let n=n=>t(()=>R.setProjectColours(e.name,n)),{manager:r,sessions:i}=e.colours,a=Object.keys(Et),o=(e,t,n,r)=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${t?` on`:``}`,"aria-pressed":t,title:Et[e].label,"aria-label":`${r}: ${Et[e].label}`,onClick:n,children:(0,V.jsx)(fp,{colour:e,children:`●`})},e);return(0,V.jsxs)(`div`,{className:`name-colours`,children:[(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Manager name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Manager name`}),(0,V.jsx)(`button`,{type:`button`,className:`small${r===null?` on`:``}`,"aria-pressed":r===null,onClick:()=>n({manager:null,sessions:i}),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,r===e,()=>n({manager:e,sessions:i}),`Manager name`))})]}),(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Its sessions' name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Its sessions' names`}),(0,V.jsx)(`button`,{type:`button`,className:`small${i===`same`?` on`:``}`,"aria-pressed":i===`same`,onClick:()=>n({manager:r,sessions:`same`}),children:`Same as manager`}),(0,V.jsx)(`button`,{type:`button`,className:`small${i===`none`?` on`:``}`,"aria-pressed":i===`none`,onClick:()=>n({manager:r,sessions:`none`}),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,i===e,()=>n({manager:r,sessions:e}),`Its sessions' names`))})]})]})}function mp({colour:e,run:t}){let n=e=>t(()=>R.setChatsColour(e));return(0,V.jsx)(`div`,{className:`name-colours`,children:(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Chats' name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Chats' names`}),(0,V.jsx)(`button`,{type:`button`,className:`small${e===null?` on`:``}`,"aria-pressed":e===null,onClick:()=>n(null),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:Object.keys(Et).map(t=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${e===t?` on`:``}`,"aria-pressed":e===t,title:Et[t].label,"aria-label":`Chats' names: ${Et[t].label}`,onClick:()=>n(t),children:(0,V.jsx)(fp,{colour:t,children:`●`})},t))})]})})}function hp(e,t){return Dt(t.find(t=>t.name===e.project)?.colours,e.role)}var gp=[{id:`update`,label:`Update & restart`,part:`ledung`,settings:[{label:`Update Ledung`,about:`Gets what is new and restarts into it`,keywords:[`upgrade`,`version`,`release`,`new`]},{label:`Restart Ledung`,about:`Starts Ledung again on its newest version; sessions keep running`,keywords:[`reload`,`reboot`]},{label:`Stop Ledung`,about:`Stops Ledung and its sessions`,keywords:[`quit`,`exit`,`shut down`,`close`,`background`]},{label:`Shortcuts`,about:`A Ledung icon on the Desktop and in the Start menu, or in Applications`,keywords:[`desktop`,`icon`,`start menu`,`applications`,`launcher`,`dock`,`shortcut`]},{label:`Start at sign-in`,about:`Start Ledung in the background when you sign in`,keywords:[`startup`,`autostart`,`login`,`log in`,`boot`,`windows`,`launch agent`]},{label:`Log`,about:`Where a background Ledung writes what it says`,keywords:[`log`,`output`,`console`,`debug`,`ledung.log`]}]},{id:`claude`,label:`Claude & usage`,part:`ledung`,settings:[{label:`Accounts`,about:`The Claude accounts sessions run on`,keywords:[`claude`,`login`,`sign in`,`plan`,`subscription`]},{label:`Usage stops`,about:`Hold new turns when a plan window is this full`,keywords:[`usage`,`limit`,`quota`,`pause`,`window`,`percent`]},{label:`Claude Code`,about:`The Claude Code program sessions run`,keywords:[`cli`,`program`,`version`,`install`]},{label:`Publish usage`,about:`Send usage figures to a dashboard, per Claude account`,keywords:[`usage`,`dashboard`,`share`,`statistics`,`account`,`all accounts`,`repository`,`github`]}]},{id:`sessions`,label:`Sessions`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills managers and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Session profiles`,storedIn:`config`,about:`Sets of tools and settings sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`macros`,label:`Macros`,part:`ledung`,settings:[{label:`Macros`,about:`Text you send often, as a chip in the info bar, a keybind, or both`,keywords:[`macro`,`shortcut`,`keybind`,`key`,`hotkey`,`chip`,`snippet`,`quick`,`text`]}]},{id:`remote`,label:`Remote & devices`,part:`ledung`,settings:[{label:`Computers`,about:`This computer's name and colour, and the others Ledung knows`,keywords:[`machine`,`colour`,`color`,`name`]},{label:`Remote access`,about:`Reach this Ledung from your phone, anywhere, through a relay`,keywords:[`phone`,`mobile`,`tunnel`,`internet`,`away`]},{label:`Phones`,about:`Phones that may open this Ledung`,keywords:[`phone`,`mobile`,`device`,`pair`]},{label:`Linked computers`,about:`Link this Ledung with another of yours`,keywords:[`link`,`machine`,`pair`,`device`]},{label:`Relay`,about:`Run a relay for other people`,keywords:[`server`,`host`,`tunnel`]},{label:`Message board`,about:`Managers post to each other on a shared board`,keywords:[`board`,`posts`,`messages`]}]},{id:`look`,label:`Look & feel`,part:`browser`,settings:[{label:`Appearance`,storedIn:`browser`,about:`Light, dark or the computer's own`,keywords:[`theme`,`dark`,`light`,`mode`,`colour`,`color`,`system`]},{label:`Autocorrect`,storedIn:`browser`,about:`Whether the browser corrects words as you type`,keywords:[`spelling`,`typing`,`spell`]},{label:`Status dot`,storedIn:`browser`,about:`The coloured dot by each session in the sidebar`,keywords:[`sidebar`,`dot`,`colour`,`color`]},{label:`Show "Archived" in the sidebar`,storedIn:`browser`,about:`The Archived entry under each project`,keywords:[`archive`,`sidebar`]},{label:`Compact sidebar`,storedIn:`browser`,about:`Smaller session cards in the sidebar`,keywords:[`sidebar`,`dense`,`small`,`cards`]},{label:`App`,storedIn:`browser`,about:`Install Ledung as an app`,keywords:[`install`,`pwa`,`desktop`,`icon`]}]},{id:`notifications`,label:`Notifications`,part:`browser`,settings:[{label:`Notifications`,storedIn:`browser`,about:`A browser notification when something needs your answer`,keywords:[`alert`,`notify`,`sound`,`popup`]}]},{id:`config`,label:`Config file`,part:`info`,settings:[{label:`Config file`,storedIn:`config`,about:`Ledung's config file and its problems`,keywords:[`json`,`port`,`file`,`settings`]}]},{id:`about`,label:`About`,part:`info`,settings:[{label:`About`,about:`Version and where Ledung runs from`,keywords:[`version`,`licence`,`license`]},{label:`Update channel`,about:`Public releases only, or dev builds too (npm installs)`,keywords:[`channel`,`dev`,`public`,`npm`,`beta`]}]}],_p=gp[0].id,vp=e=>`settings:${e}`,yp={usageStop:`Usage stops`,claudeProblem:`Claude Code`,configProblem:`Config file`};function bp(e){let t=gp.find(t=>t.settings.some(t=>t.label===yp[e]));return t?vp(t.id):`settings`}function xp(e,t){if(e===`accounts`)return`claude`;let n=e?.startsWith(`settings:`)?e.slice(9):null;return n&&gp.some(e=>e.id===n)?n:t?null:_p}var Sp=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Name`,about:`The project's name in the sidebar`,keywords:[`rename`,`title`]},{label:`Claude account`,about:`The account its sessions run on`,keywords:[`account`,`login`,`plan`]},{label:`Model`,about:`The model its sessions use`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Model for its manager`,about:`The model its manager uses`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Permissions for new sessions`,about:`The permission mode new sessions start in`,keywords:[`permission`,`mode`,`auto`,`plan`,`accept`]},{label:`Extra folders`,about:`Folders outside the project its sessions may work in`,keywords:[`folder`,`directory`,`path`]},{label:`Publish its usage under its name`,about:`Published usage figures carry the project's name`,keywords:[`usage`,`dashboard`,`share`]},{label:`Usage repository`,about:`The repository its usage is published to, instead of this computer's default one`,keywords:[`usage`,`dashboard`,`share`,`repo`,`github`,`board`,`publish`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`powers`,label:`Manager's powers`,part:`ledung`,settings:[{label:`What the manager may decide for you`,about:`What its manager may answer in your place`,keywords:[`grant`,`decide`,`approve`,`manager`]},{label:`Its manager adds projects and starts or stops other managers without asking you`,keywords:[`projects`,`managers`,`manager`]},{label:`Its manager reads and changes workflow settings of your projects`,keywords:[`workflow`,`manager`]},{label:`Dev ship command`,about:`A command away mode may let through`,keywords:[`ship`,`deploy`,`publish`,`away`]},{label:`Lockdown`,about:`Keep its sessions off the network and out of other tools`,keywords:[`network`,`container`,`island`,`security`,`sandbox`]}]},{id:`skills`,label:`Skills & profiles`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills its manager and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Profile for its manager`,about:`The session profile its manager starts with`,keywords:[`profile`,`tools`,`mcp`,`manager`]},{label:`Profile for its sessions`,about:`The session profile its sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Manager name`,about:`Its manager's name colour in the sidebar`,keywords:[`colour`,`color`,`manager`]},{label:`Its sessions' names`,about:`Its sessions' name colour in the sidebar`,keywords:[`colour`,`color`]}]},{id:`workflow`,label:`Workflow`,part:`ledung`,settings:[{label:`Workflow`,about:`Whether it follows a written process, and which`,keywords:[`process`,`agent`]},{label:`Project config for the workflow`,about:`The process's config file for this project`,keywords:[`process`,`config`,`file`]}]},{id:`tickets`,label:`Tickets & questions`,part:`ledung`,settings:[{label:`Ticket pattern`,about:`What a ticket number looks like`,keywords:[`issue`,`ticket`,`jira`]},{label:`Ticket link`,about:`Where a ticket number links to`,keywords:[`issue`,`ticket`,`url`]},{label:`Question tiers`,about:`The order of its questions in Waiting for you`,keywords:[`questions`,`waiting`,`priority`,`order`]}]},{id:`board`,label:`Message board`,part:`ledung`,settings:[{label:`Use the board in this project`,about:`Its manager posts to and reads the message board`,keywords:[`board`,`posts`,`messages`]}]},{id:`remove`,label:`Remove project`,part:`info`,settings:[{label:`Remove project`,about:`Takes it off the list and stops its sessions; the folder is not touched`,keywords:[`delete`,`remove`]}]}],Cp=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Folder`,storedIn:`config`,about:`Where new chats start`,keywords:[`folder`,`directory`,`path`]},{label:`Permission mode`,storedIn:`config`,about:`The permission mode new chats start in`,keywords:[`permission`,`mode`,`auto`,`plan`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Chats' names`,about:`The chats' name colour in the sidebar`,keywords:[`colour`,`color`]}]}];function wp(e){if(e===`chats`)return{project:null,group:null};if(e?.startsWith(`chats:`))return{project:null,group:e.slice(6)};if(!e?.startsWith(`ps:`))return null;let t=e.slice(3),n=t.indexOf(`/`);return n<0?{project:t,group:null}:{project:t.slice(0,n),group:t.slice(n+1)}}var Tp=(e,t)=>e===null?`chats:${t}`:`ps:${e}/${t}`;function Ep(e,t){let n=e.project===null?Cp:Sp;return e.group&&n.some(t=>t.id===e.group)?e.group:t?null:n[0].id}function Dp(e){return[{id:`ledung`,label:`Ledung`,view:`settings`},{id:`chats`,label:`Chats`,view:`chats`},...e.map(e=>({id:`ps:${e.name}`,label:e.name,view:`ps:${e.name}`})),{id:`add`,label:`+ Add project`,view:`add`}]}function Op(e){if(!e)return null;if(e===`settings`||e===`accounts`||e.startsWith(`settings:`))return`ledung`;if(e===`add`)return e;let t=wp(e);return t?t.project===null?`chats`:`ps:${t.project}`:null}function kp(e){let t=!!e.remote;return{remote:t?`on`:`off`,phones:t?`on`:`needs`,linked:t?`on`:`needs`,relay:e.relaySetUp===null?`hidden`:e.relaySetUp?`on`:`off`,board:e.boardConfigured?`on`:`off`}}var Ap=e=>e?``:`off`;function jp(e){return e?e.npm?{update:null,restart:`Starts Ledung again from the installed package, so an update with npm takes effect. Sessions keep running and reconnect.`}:{update:`Gets what is new on main from GitHub into the folder this release was built from, builds a new release and restarts into it. Sessions keep running and reconnect.`,restart:`Loads the newest release. Sessions keep running and reconnect.`}:{update:null,restart:`Starts Ledung again on its newest version. Sessions keep running and reconnect.`}}function Mp(e){return e?e.npm?`from npm`:e.available?e.restarting?`restarting…`:e.updating?`updating…`:e.checking?`checking…`:e.check?e.check.upToDate?`up to date`:`${e.check.behind} new change${e.check.behind===1?``:`s`}`:`not checked`:`no updates here`:``}function Np(e){return[{id:`ledung`,label:`Ledung`,groups:gp,viewOf:vp},{id:`chats`,label:`Chats`,groups:Cp,viewOf:e=>Tp(null,e)},...e.map(e=>({id:`ps:${e.name}`,label:e.name,groups:Sp,viewOf:t=>Tp(e.name,t)}))]}var Pp=e=>e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,` `).trim(),Fp=e=>Pp(e).split(` `).filter(Boolean),Ip={label:4,keyword:3,group:2,about:1};function Lp(e,t,n=null){let r=Fp(e);if(!r.length)return[];let i=r.join(` `),a=[],o=[...t.filter(e=>e.id===n),...t.filter(e=>e.id!==n)],s=0;for(let e of o)for(let t of e.groups){let n=Fp(t.label);for(let o of t.settings){s++;let c=[[Ip.label,Fp(o.label)],[Ip.keyword,(o.keywords??[]).flatMap(Fp)],[Ip.group,n],[Ip.about,Fp(o.about??``)]],l=0;for(let e of r){let t=Math.max(0,...c.filter(([,t])=>t.some(t=>t.startsWith(e))).map(([e])=>e));if(!t){l=0;break}l+=t}if(!l)continue;let u=Pp(o.label);u===i?l+=10:` ${u} `.includes(` ${i}`)&&(l+=5),a.push({hit:{tab:e.id,tabLabel:e.label,group:t.id,groupLabel:t.label,label:o.label,about:o.about,storedIn:o.storedIn,view:e.viewOf(t.id)},score:l,order:s})}}return a.sort((e,t)=>t.score-e.score||e.order-t.order).map(e=>e.hit)}var Rp=(e,t,n)=>Lp(e,Np(t),n);function zp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.updateStatus().then(n,e=>i(e.message))},[e]);let a=!!t&&(t.checking||t.updating||t.restarting);return(0,v.useEffect)(()=>{if(!a)return;let e=setInterval(()=>R.updateStatus().then(n,()=>{}),1e3);return()=>clearInterval(e)},[a]),{view:t,error:r,act:e=>{i(null),e().then(n,e=>i(e.message))}}}function Bp(e){let[t,n]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(e).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Vp(e){let t=zp(e.hellos),n=Mp(t.view),r=Op(e.view),i=!!t.view?.check&&!t.view.check.upToDate,a=Wp(r,e.projects,t=>{t!==e.view&&e.onOpen(t)});return(0,V.jsx)(Hp.Provider,{value:a,children:(0,V.jsxs)(`div`,{className:`page-view settings-frame`,children:[(0,V.jsxs)(`header`,{className:`session-head settings-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Settings`}),(0,V.jsx)(`div`,{className:`muted`,children:`One place for Ledung, chats and every project.`})]}),(0,V.jsxs)(`div`,{className:`session-corner settings-version`,children:[(0,V.jsxs)(`span`,{className:`settings-state${i?` behind`:n===`up to date`?` ok`:``}`,title:e.source?`Running ${e.source.version}`:void 0,children:[`Ledung `,e.source?.version??``,n&&(0,V.jsxs)(V.Fragment,{children:[` · `,n]})]}),e.canRestart?(0,V.jsx)(Qp,{hellos:e.hellos}):(0,V.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]})]}),(0,V.jsx)(`nav`,{className:`settings-tabs`,role:`tablist`,"aria-label":`Settings`,children:Dp(e.projects).map(t=>(0,V.jsx)(`button`,{role:`tab`,"aria-selected":r===t.id,className:`settings-tab${r===t.id?` on`:``}${t.id===`add`?` add`:``}`,onClick:()=>{(r!==t.id||e.view!==t.view)&&e.onOpen(t.view)},children:t.label},t.id))}),(0,V.jsx)(`div`,{className:`settings-tab-body`,children:e.children(t)})]})})}var Hp=(0,v.createContext)(null),Up=e=>e instanceof HTMLElement&&(e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`);function Wp(e,t,n){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useMemo)(()=>Rp(r,t,e),[r,t,e]),l=(0,v.useRef)(r);return l.current=r,(0,v.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.isComposing||(e.key===`Escape`&&l.current?(e.preventDefault(),i(``),s.current?.focus()):e.key===`/`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!Up(e.target)&&s.current&&(e.preventDefault(),s.current.focus(),s.current.select()))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]),{query:r,setQuery:i,hits:c,input:s,tab:e,target:a,choose:e=>{i(``),o({tab:e.tab,group:e.group,label:e.label,n:Date.now()}),n(e.view)},reached:e=>o(t=>t?.n===e?null:t)}}var Gp=`section h3, section h4, label.toggle, .compact-slider > span, .offline-name, .field-name`;function Kp(e,t){if(!e)return null;let n=Pp(t),r=[...e.querySelectorAll(Gp)].find(e=>{let t=Pp(e.textContent??``);return t===n||t===`run a ${n}`});return r?r.closest(`.field, .offline`)??r.closest(`label, details, .compact-slider`)??r:null}var qp=2500,Jp=2e3;function Yp({search:e}){let t=B();return(0,V.jsxs)(`div`,{className:`settings-search`,children:[(0,V.jsx)(`span`,{className:`settings-search-icon`,"aria-hidden":!0,children:`⌕`}),(0,V.jsx)(`input`,{ref:e.input,type:`search`,placeholder:`Search settings`,"aria-label":`Search settings`,value:e.query,...t,onChange:t=>e.setQuery(t.target.value),onKeyDown:t=>{t.key===`Enter`&&e.hits[0]&&(t.preventDefault(),e.choose(e.hits[0])),t.key===`ArrowDown`&&(t.preventDefault(),document.querySelector(`.search-results button`)?.focus())}}),e.query?(0,V.jsx)(`button`,{type:`button`,className:`settings-search-clear`,"aria-label":`Clear search`,title:`Clear search`,onClick:()=>{e.setQuery(``),e.input.current?.focus()},children:`×`}):(0,V.jsx)(`kbd`,{children:`/`})]})}function Xp({search:e}){let t=e.query.trim();return e.hits.length?(0,V.jsxs)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[e.hits.length,` setting`,e.hits.length===1?``:`s`,` match "`,t,`"`]}),(0,V.jsx)(`ul`,{children:e.hits.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{className:`search-hit`,onClick:()=>e.choose(t),onKeyDown:t=>{let n=t.currentTarget.parentElement,r=t.key===`ArrowDown`?n?.nextElementSibling:t.key===`ArrowUp`?n?.previousElementSibling:void 0;r!==void 0&&(t.preventDefault(),r?r.querySelector(`button`)?.focus():t.key===`ArrowUp`&&e.input.current?.focus())},children:[(0,V.jsxs)(`span`,{className:`search-hit-name`,children:[t.label,t.storedIn&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)($p,{kind:t.storedIn})]})]}),(0,V.jsxs)(`span`,{className:`search-hit-path`,children:[t.tabLabel,` › `,t.groupLabel]}),t.about&&(0,V.jsx)(`span`,{className:`search-hit-about muted`,children:t.about})]})},`${t.tab}/${t.group}/${t.label}`))})]}):(0,V.jsx)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:(0,V.jsxs)(`p`,{className:`muted`,children:[`No setting matches "`,t,`".`]})})}var Zp=6e4;function Qp({hellos:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{r===`restarting`&&e>a&&i(`idle`)},[r,e,a]),(0,v.useEffect)(()=>{if(r!==`restarting`)return;let e=setTimeout(()=>i(`timeout`),Zp);return()=>clearTimeout(e)},[r]),r===`restarting`?(0,V.jsx)(`span`,{className:`muted`,children:`Restarting…`}):t?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Sessions keep running and reconnect.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:async()=>{o(e),n(!1),i(`restarting`);try{await R.restart()}catch{i(`failed`),n(!1)}},children:`Restart`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(!1),children:`Cancel`})]}):(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[r===`failed`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`The restart was refused.`}),r===`timeout`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`Ledung hasn't come back yet. Check its window, or its log when it runs in the background.`}),(0,V.jsx)(`button`,{className:`small`,title:`Restart Ledung on its newest version`,onClick:()=>{i(`idle`),n(!0)},children:`Restart Ledung`})]})}function $p({kind:e}){return(0,V.jsx)(`span`,{className:`where ${e}`,title:e===`browser`?`Kept in this browser only: another browser or device has its own`:`Read from Ledung's config file`,children:e===`browser`?`this browser`:`config`})}function em(e){let t=(0,v.useContext)(Hp),n=!!t?.query.trim(),r=(0,v.useRef)(null),i=t?.target,a=!!i&&i.tab===t.tab&&i.group===e.current&&!n;(0,v.useEffect)(()=>{if(!a||!i||!t)return;let e=Date.now(),n,o=()=>{let a=Kp(r.current,i.label);a?(a.classList.add(`search-found`),a.scrollIntoView({block:`center`}),setTimeout(()=>a.classList.remove(`search-found`),qp),t.reached(i.n)):Date.now()-e<Jp?n=setTimeout(o,100):t.reached(i.n)};return o(),()=>clearTimeout(n)},[a,i?.n]);let o=(0,V.jsxs)(`div`,{className:`settings-side`,children:[t&&(0,V.jsx)(Yp,{search:t}),n&&e.current===null?(0,V.jsx)(Xp,{search:t}):(0,V.jsx)(tm,{...e})]});if(e.current===null)return(0,V.jsxs)(`div`,{className:`settings-split narrow`,children:[o,e.foot]});let s=e.groups.find(t=>t.id===e.current)?.label??``;return(0,V.jsxs)(`div`,{className:`settings-split${e.narrow?` narrow`:``}`,children:[!e.narrow&&o,(0,V.jsxs)(`div`,{className:`settings-main`,children:[n&&!e.narrow&&(0,V.jsx)(Xp,{search:t}),(0,V.jsxs)(`div`,{className:`settings-content`,role:`region`,"aria-label":s,ref:r,hidden:n&&!e.narrow,children:[e.narrow&&(0,V.jsxs)(`div`,{className:`settings-group-head`,children:[(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(null),children:`← All settings`}),(0,V.jsx)(`h3`,{children:s})]}),e.children]}),e.foot]})]})}function tm(e){return(0,V.jsx)(`nav`,{className:`settings-menu`,"aria-label":`Settings groups`,children:e.groups.map((t,n)=>{let r=n>0&&e.groups[n-1].part!==t.part,i=e.marked?.has(t.id);return(0,V.jsxs)(v.Fragment,{children:[r&&(0,V.jsx)(`div`,{className:`settings-menu-sep`}),r&&t.part===`browser`&&(0,V.jsx)(`div`,{className:`settings-menu-cap`,children:`This browser`}),(0,V.jsxs)(`button`,{className:`settings-menu-item${e.current===t.id?` on`:``}${t.id===`remove`?` danger`:``}`,"aria-current":e.current===t.id?`page`:void 0,onClick:()=>e.onOpen(t.id),children:[(0,V.jsxs)(`span`,{children:[t.label,i&&(0,V.jsx)(`span`,{className:`unsaved-mark`,title:`Changed, not saved yet`,"aria-label":`(not saved)`,children:` •`})]}),(0,V.jsxs)(`span`,{className:`muted`,children:[e.words[t.id]??``,e.narrow&&` ›`]})]})]},t.id)})})}function nm(e){return!e.count&&!e.saved?null:(0,V.jsxs)(`div`,{className:`save-bar`,role:`region`,"aria-label":`Unsaved changes`,children:[(0,V.jsxs)(`span`,{className:`muted`,children:[e.count?`${e.count} unsaved change${e.count===1?``:`s`}`:`Saved.`,e.count>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,e.note]}),e.count>0&&e.disabled&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`error`,children:e.disabled})]})]}),(0,V.jsx)(`span`,{className:`grow`}),e.count>0&&(0,V.jsx)(`button`,{className:`small`,disabled:e.busy,onClick:e.onDiscard,children:`Discard`}),e.count>0&&(0,V.jsx)(`button`,{className:`small primary`,disabled:e.busy||!!e.disabled,onClick:e.onSave,children:e.busy?`Saving…`:`Save`})]})}function rm({follows:e,text:t,onReset:n}){return(0,V.jsxs)(`span`,{className:`inherit${e?``:` over`}`,children:[t,!e&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{type:`button`,className:`link`,onClick:e=>{e.preventDefault(),n()},children:`Reset`})]})]})}var im=`(max-width: 760px)`;function am(e,t){if(e===`width`){let e=Math.max(220,Math.floor(t/2));return{min:220,max:e,def:Math.min(290,e)}}let n=Math.max(120,Math.floor(t*.75));return{min:120,max:n,def:Math.min(n,Math.max(120,Math.floor(t*.55)))}}function om(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function sm(e){let t=e==null?NaN:Number(e);return Number.isFinite(t)&&t>0?t:null}function cm(e,t,n,r,i){return e===(t===`width`?`ArrowRight`:`ArrowDown`)?om(n+20,r,i):e===(t===`width`?`ArrowLeft`:`ArrowUp`)?om(n-20,r,i):e===`Home`?r:e===`End`?i:null}function lm(e,t){let[n,r]=(0,v.useState)(e),[i,a]=(0,v.useState)(e),o=JSON.stringify(e);return(0,v.useEffect)(()=>{r(e),a(r=>t(n,r)?r:e)},[o]),{saved:n,value:i,set:a,done:e=>{r(e),a(e)},discard:()=>a(n)}}var um=(e=``)=>({name:e,account:``,model:``,managerModel:``,permissionMode:``,managerGrant:``,projectToolsUnasked:!1,projectSettingsTools:!1,publishUsageName:!1,usageRepo:``,managerProfile:``,sessionProfile:``,skills:{},...M({commandPatterns:[],pathPatterns:[]}),devShipCommand:``,ticketPattern:``,ticketUrl:``,questionTiers:te.join(`
|
|
58
|
-
`),extraFolders:``,workflowUse:null,workflowName:``,workflowConfig:``,lockdownLevel:`off`,lockdownBoard:!1,lockdownRemoteControl:!1,lockdownNetwork:``,lockdownDockerNetwork:``});function
|
|
55
|
+
`):[]))},[n?.repo,h,g]),!n)return null;let _=o.trim(),y=!_||Nf.test(_),b=c||u.length>0,x=c!==h||[...u].sort().join(`
|
|
56
|
+
`)!==g||_!==(n.repo??``),S=()=>t(async()=>{r(await R.setUsagePublish(b,_||null,{allAccounts:c,accounts:[...u].sort()})),a(await R.sharedUsage(!0))}),C=[...new Set([`default`,...e.map(e=>e.name),...n.accounts])],w=t=>e.find(e=>e.name===t)?.email??null,T=(e,t)=>d(n=>t?[...new Set([...n,e])]:n.filter(t=>t!==e)),E=!n.enabled&&!n.pendingRemovals?.length;if(E&&!f)return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),(0,V.jsxs)(`div`,{className:`offline`,children:[(0,V.jsx)(`span`,{className:`offline-name`,children:`Publish usage`}),(0,V.jsx)(`span`,{className:`offline-why`,children:`Share this computer's usage totals with your other computers through a GitHub repository.`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>p(!0),children:`Set up ›`})]})]});let D=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Shares this computer's usage totals with a GitHub repository, through your `,(0,V.jsx)(`span`,{className:`mono`,children:`gh`}),` login, so the Shared tab can show every computer's usage side by side. Each computer keeps one file there and replaces it every 5 minutes when something changed.`]}),(0,V.jsxs)(`div`,{role:`group`,"aria-label":`Accounts to publish`,children:[(0,V.jsx)(`h4`,{children:`Accounts`}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:c,onChange:e=>l(e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`All accounts`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(every Claude account on this computer, ones added later too)`})]})]}),C.map(t=>(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:c||u.includes(t),disabled:c,onChange:e=>T(t,e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`span`,{className:`field-name`,children:[`Publish `,t]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`(`,t==="default"?`this computer's own login`:w(t)??`not signed in yet`,!e.some(e=>e.name===t)&&t!=="default"?`, removed`:``,`)`]})]})]},t))]}),(0,V.jsx)(Pn,{project:``,label:`Default usage repository`,newName:`ledung-usage`,value:o,ok:y,onChange:s,load:Pf}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Every project publishes here unless its own settings name a usage repository of its own.`,!!n.projectRepos?.length&&(0,V.jsxs)(V.Fragment,{children:[` Projects with their own: `,n.projectRepos.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`; `:``,e.projects.join(`, `),` → `,(0,V.jsx)(`span`,{className:`mono`,children:e.repo})]},e.repo)),`.`]})]}),(b||_)&&(0,V.jsxs)(`div`,{className:`board-warning`,children:[(0,V.jsxs)(`strong`,{children:[`Everyone with read access to `,_&&y?_:`the repository`,` sees what is published`]}),`: this computer's name, your GitHub login, and for each account switched on above, per day and model, the tokens, API-equivalent cost and calls, and its plan limits; a project with a repository of its own goes there instead. A project shows by name only where you switch that on in its settings; every other project is `,(0,V.jsx)(`span`,{className:`mono`,children:`other#`}),` and four characters. Never prompts, replies, tool output, paths, folder or branch names, session titles, emails or tokens.`]}),(0,V.jsx)(`button`,{disabled:!x||!y||b&&!_,onClick:()=>void S(),children:`Save`}),b&&!_&&(0,V.jsx)(`span`,{className:`muted`,children:` Choose the repository to publish to.`}),!b&&n.enabled&&(0,V.jsx)(`span`,{className:`muted`,children:` No account is switched on: saving stops publishing and removes this computer's usage from the repositories.`}),n.enabled&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Publishes as `,(0,V.jsx)(`strong`,{children:n.computer}),n.lastPublishedAt?`; last published ${Ff(n.lastPublishedAt)}`:``,`.`,n.error&&(0,V.jsxs)(`span`,{className:`board-error`,children:[` The last publish failed: `,n.error,` Ledung tries again shortly (after 1, 2, then every 5 minutes).`]})]}),!!n.pendingRemovals?.length&&(0,V.jsxs)(`p`,{className:`board-error`,children:[`This computer's usage is still in `,n.pendingRemovals.join(`, `),`; Ledung keeps trying to remove it.`,!n.enabled&&n.error?` ${n.error}`:``]}),(0,V.jsx)(Lf,{view:n,onView:r,run:t}),i?.repo&&(0,V.jsx)(Rf,{shared:i,onShared:a,run:t})]});return E?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),(0,V.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":`Publish usage`,children:[(0,V.jsxs)(`h4`,{children:[(0,V.jsx)(`span`,{children:`Publish usage`}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Close Publish usage`,title:`Close`,onClick:()=>p(!1),children:`✕`})]}),D]})]}):(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Publish usage`}),D]})}function Lf({view:e,onView:t,run:n}){let r=B(),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``);return(0,V.jsxs)(`div`,{children:[(0,V.jsx)(`h4`,{children:`Usage key`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Makes a project's `,(0,V.jsx)(`span`,{className:`mono`,children:`other#`}),` label the same on all your computers, without its name. It stays on this computer, next to the link keys. `,e.hasKey?`This computer has one.`:`This computer makes one, or takes a linked computer's, when publishing is switched on.`]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[e.hasKey&&!i&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>a((await R.revealUsageKey()).key)),children:`Show the key`}),i&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`mono`,children:i}),` `,(0,V.jsx)(Of,{text:i}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>a(null),children:`Hide`})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.takeLinkedUsageKey())),children:`Take a linked computer's key`})]}),(0,V.jsxs)(`div`,{className:`board-add`,children:[(0,V.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`Paste a usage key from another computer`,onChange:e=>s(e.target.value.trim())}),(0,V.jsx)(`button`,{className:`small`,disabled:!o,onClick:()=>void n(async()=>{t(await R.setUsageKey(o)),s(``),a(null)}),children:`Use this key`})]})]})}function Rf({shared:e,onShared:t,run:n}){let[r,i]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`h4`,{children:[`Computers publishing to `,e.repo]}),e.error&&(0,V.jsx)(`p`,{className:`board-error`,children:e.error}),!e.entries.length&&!e.error&&(0,V.jsx)(`p`,{className:`muted`,children:`None yet.`}),(0,V.jsx)(`ul`,{className:`board-counts`,children:e.entries.map(a=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(zf,{entry:a}),a.stale&&!a.own&&e.canRemove&&(r===a.id?(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`button`,{className:`small danger`,onClick:()=>void n(async()=>{t(await R.removeSharedUsage(a.id)),i(null)}),children:`Confirm: remove its usage`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(null),children:`Cancel`})]}):(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(a.id),children:`Remove…`})]}))]},a.id))}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.sharedUsage(!0))),children:`Check again`})]})}function zf({entry:e}){let t=`${e.computer??`A computer`}${e.login?` (@${e.login})`:``}${e.own?`, this computer`:``}`;return e.state===`newer`?(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),`: published by a newer Ledung. Update Ledung to read it.`]}):e.state===`invalid`?(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),`: its file can't be read (`,e.reason,`).`]}):(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t}),e.asOf?`, as of ${Ff(e.asOf)}`:``,e.stale&&(0,V.jsx)(`span`,{className:`chip warn`,children:`silent for 30 days`})]})}function Bf({value:e,onChange:t}){let n=e.usageRepo.trim();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)($,{value:e.publishUsageName,onChange:n=>t({...e,publishUsageName:n})}),(0,V.jsx)(Pn,{project:``,label:(0,V.jsx)(`span`,{className:`field-name`,children:`Usage repository`}),newName:`ledung-usage`,value:e.usageRepo,ok:!n||Nf.test(n),onChange:n=>t({...e,usageRepo:n}),load:Pf}),(0,V.jsx)(`span`,{className:`muted`,children:`Where its usage is published, instead of this computer's default repository (Settings → Claude & usage → Publish usage); empty: the default.`})]})}function $({value:e,onChange:t}){return(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Publish its usage under its name`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(when usage is published in Settings; otherwise it shows as other# and four characters)`})]})]})}var Vf=`ledung.waitingFilter`;function Hf(e){try{let t=JSON.parse(e.getItem(Vf)??`null`);if(t&&(t.mode===`one`||t.mode===`all`))return{mode:t.mode,one:String(t.one??``),hidden:Array.isArray(t.hidden)?t.hidden.map(String):[]}}catch{}return{mode:`all`,one:``,hidden:[]}}function Uf(e,t){try{e.setItem(Vf,JSON.stringify(t))}catch{}}function Wf(e,t,n){let r=Hf(e);(r.one===t||r.hidden.includes(t))&&Uf(e,{mode:r.mode,one:r.one===t?n:r.one,hidden:r.hidden.map(e=>e===t?n:e)})}function Gf(e,t,n,r,i){let a=e.map(e=>{let r=ce(e),i=t(e.sessionId);return{q:e,v:r,project:i,tier:me(r.tier,n(i))}}),o=F(i),s=a.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&r(e.project)).sort((e,t)=>o({tier:e.tier,rank:e.v.rank,askedAt:e.q.askedAt},{tier:t.tier,rank:t.v.rank,askedAt:t.q.askedAt})),c=a.filter(e=>e.q.status!==`open`&&r(e.project)).sort((e,t)=>(t.q.answeredAt??t.q.askedAt)-(e.q.answeredAt??e.q.askedAt)).slice(0,30);return{items:a,forYou:s,done:c,listFor:e=>e.q.status===`open`?e.q.addressedTo===`user`?s:[e]:c}}var Kf={A:`Lockdown level A: nothing reaches in; it may still reach out`,B:`Lockdown level B, nearly air-gapped: nothing reaches in or out`};function qf(e){return e===`A`?1:2}function Jf(e){let t=e?.lockdown?.level;return t===`A`||t===`B`?t:null}function Yf(e,t,n){let r=Array.from({length:n},()=>Array(t).fill(` `)),i=Array.from({length:n},()=>Array(t).fill(``)),a=(e,a,o,s=``)=>{e>=0&&a>=0&&e<t&&a<n&&(r[a][e]=o,i[a][e]=s)},o=(e,t,n,r=``)=>[...n].forEach((n,i)=>a(e+i,t,n,r)),s=(e,r,i)=>{let o=e,s=e,c=t-1-e,l=n-1-e;for(let e=o;e<=c;e++){let t=i&&(e-o)%6==3;a(e,s,t?`o`:r[0]),a(e,l,t?`o`:r[0])}for(let e=s;e<=l;e++){let t=i&&(e-s)%3==2&&e<l-1;a(o,e,t?`o`:r[1]),a(c,e,t?`o`:r[1])}a(o,s,r[2]),a(c,s,r[3]),a(o,l,r[4]),a(c,l,r[5])},c=e===`B`;return c?(s(0,`━┃┏┓┗┛`,!0),s(1,`─│┌┐└┘`,!1)):s(0,`─│┌┐└┘`,!0),o(3,0,`┤ LOCK ${e} ├`,c?`d`:`a`),o(t-7,0,`(|)`,c?`d`:``),c||a(t-1,Math.floor(n/2),`»`,`a`),{ch:r,kind:i}}function Xf(e){return e.ch.map((t,n)=>{let r=[];return t.forEach((t,i)=>{let a=e.kind[n][i],o=r[r.length-1];o&&o.kind===a?o.text+=t:r.push({text:t,kind:a})}),r})}var Zf=10,Qf=0;function $f(){if(Qf)return Qf;let e=document.createElement(`span`);e.className=`lframe-probe`,e.textContent=`0`.repeat(100),document.body.append(e);let t=e.getBoundingClientRect().width/100;return e.remove(),t>0&&document.fonts?.status!==`loading`&&(Qf=t),t||6}function ep({level:e,fill:t,children:n}){return e?(0,V.jsx)(tp,{level:e,fill:!!t,children:n}):(0,V.jsx)(V.Fragment,{children:n})}function tp({level:e,fill:t,children:n}){let r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(null),s=qf(e);(0,v.useLayoutEffect)(()=>{let e=()=>{let e=r.current,n=i.current;if(!e||!n)return;let a=$f(),c=e.clientWidth,l=Math.max(2*s+12,Math.floor(c/a)),u=Math.max(0,(c-l*a)/2),d,f=0,p=0;if(t){let t=e.clientHeight;d=Math.max(2*s+3,Math.floor(t/Zf)),f=Math.max(0,(t-d*Zf)/2)}else{let e=n.clientHeight-(parseFloat(getComputedStyle(n).paddingBottom)||0),t=Math.max(1,Math.ceil(e/Zf-.01));d=t+2*s,p=Math.max(0,t*Zf-e)}let m={cols:l,rows:d,cw:a,padX:u,padY:f,extra:p};o(e=>e&&e.cols===l&&e.rows===d&&e.cw===a&&Math.abs(e.padX-u)<.5&&Math.abs(e.padY-f)<.5&&Math.abs(e.extra-p)<.5?e:m)};e();let n=new ResizeObserver(e);n.observe(r.current),n.observe(i.current);let a=!0;return document.fonts?.ready.then(()=>{a&&(Qf=0,e())}),()=>{a=!1,n.disconnect()}},[e,t,s]);let c=a?.cw??6,l=(a?.padX??0)+s*c,u=(a?.padY??0)+s*Zf;return(0,V.jsxs)(`div`,{ref:r,className:`lframe ${e.toLowerCase()}${t?` fill`:``}`,"data-lock":e,children:[(0,V.jsx)(`pre`,{className:`lframe-border`,"aria-hidden":`true`,style:a?{left:a.padX,top:a.padY,width:a.cols*c,height:a.rows*Zf}:void 0,children:a&&Xf(Yf(e,a.cols,a.rows)).map((e,t)=>(0,V.jsxs)(`span`,{children:[t>0&&`
|
|
57
|
+
`,e.map((e,t)=>e.kind?(0,V.jsx)(`span`,{className:`k-${e.kind}`,children:e.text},t):e.text)]},t))}),(0,V.jsx)(`div`,{ref:i,className:`lframe-inner`,style:{margin:`${u}px ${l}px`,paddingBottom:a?.extra||void 0},children:n})]})}var np={manager:`on`,session:`off`};function rp(e,t,n){return n?.[e]?.newSkills??t[e]?.newSkills??np[e]}function ip(e,t,n,r){let i=r?.[t],a=n[t];return i?.on?.includes(e)?!0:i?.off?.includes(e)?!1:a?.on?.includes(e)?!0:!a?.off?.includes(e)&&rp(t,n,r)===`on`}function ap(e,t,n,r){let i=e[t]??{},a=e=>(e??[]).filter(e=>e!==n),o={...i,on:r===!0?[...a(i.on),n].sort():a(i.on),off:r===!1?[...a(i.off),n].sort():a(i.off)};return o.on.length||delete o.on,o.off.length||delete o.off,{...e,[t]:o}}var op=(e,t,n)=>!!(e?.[t]?.on?.includes(n)||e?.[t]?.off?.includes(n)),sp=[{role:`manager`,label:`Manager`},{role:`session`,label:`Sessions`}],cp={personal:`Personal`,"claude.ai":`From claude.ai`};function lp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let t=!0;return n(null),i(null),R.skills(e).then(e=>{t&&n(e)},e=>{t&&i(e.message)}),()=>{t=!1}},[e]),{list:t,error:r}}function up({list:e,error:t,value:n,onChange:r,defaults:i}){if(t)return(0,V.jsxs)(`p`,{className:`error`,children:[`Couldn't list the skills: `,t]});if(!e)return(0,V.jsx)(`p`,{className:`muted`,children:`Looking for your skills…`});let a=i??{},o=i?n:void 0,s=(e,t)=>i?ip(e,t,a,o):ip(e,t,n,void 0),c=new Set(e.skills.map(e=>e.name)),l=[...new Set(sp.flatMap(({role:e})=>[...n[e]?.on??[],...n[e]?.off??[]]))].filter(e=>!c.has(e)).sort(),u=(e,t)=>{let i={...n[e]};t===null?delete i.newSkills:i.newSkills=t,r({...n,[e]:i})},d=[`personal`,`claude.ai`].map(t=>({source:t,skills:e.skills.filter(e=>e.source===t)})).filter(e=>e.skills.length);return(0,V.jsxs)(`div`,{className:`skill-picker`,children:[(0,V.jsxs)(`table`,{children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Skill`}),sp.map(({role:e,label:t})=>(0,V.jsx)(`th`,{children:t},e))]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{className:`skill-new`,children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:`New skills`}),(0,V.jsxs)(`div`,{className:`muted`,children:[`A skill with no tick chosen`,i?` here or in Settings`:``,`, such as one you add later.`]})]}),sp.map(({role:e,label:t})=>(0,V.jsx)(`td`,{children:i?(0,V.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:n[e]?.newSkills??``,onChange:t=>u(e,t.target.value||null),children:[(0,V.jsxs)(`option`,{value:``,children:[`Settings: `,rp(e,a,void 0)]}),(0,V.jsx)(`option`,{value:`on`,children:`on`}),(0,V.jsx)(`option`,{value:`off`,children:`off`})]}):(0,V.jsxs)(`select`,{"aria-label":`New skills, ${t}`,value:rp(e,n,void 0),onChange:t=>u(e,t.target.value),children:[(0,V.jsx)(`option`,{value:`on`,children:`on`}),(0,V.jsx)(`option`,{value:`off`,children:`off`})]})},e))]}),d.map(e=>[(0,V.jsx)(`tr`,{className:`skill-group`,children:(0,V.jsx)(`td`,{colSpan:3,children:cp[e.source]})},`h-${e.source}`),...e.skills.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`span`,{className:`mono`,children:e.name}),e.description&&(0,V.jsx)(`div`,{className:`muted`,children:e.description})]}),sp.map(({role:t,label:a})=>{let o=op(n,t,e.name);return(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,"aria-label":`${e.name}, ${a}`,checked:s(e.name,t),onChange:i=>r(ap(n,t,e.name,i.target.checked))}),i&&o&&(0,V.jsx)(`button`,{type:`button`,className:`small skill-clear`,title:`Follow Settings again`,onClick:()=>r(ap(n,t,e.name,null)),children:`here ✕`})]},t)})]},e.name))]),l.length>0&&(0,V.jsx)(`tr`,{className:`skill-group`,children:(0,V.jsx)(`td`,{colSpan:3,children:`Not on this computer any more`})}),l.map(e=>(0,V.jsxs)(`tr`,{className:`skill-gone`,children:[(0,V.jsx)(`td`,{children:(0,V.jsx)(`span`,{className:`mono`,children:e})}),sp.map(({role:t,label:i})=>(0,V.jsx)(`td`,{children:op(n,t,e)&&(0,V.jsxs)(`button`,{type:`button`,className:`small skill-clear`,"aria-label":`Clear ${e}, ${i}`,onClick:()=>r(ap(n,t,e,null)),children:[n[t]?.on?.includes(e)?`on`:`off`,` ✕`]})},t))]},`gone-${e}`))]})]}),!e.skills.length&&(0,V.jsxs)(`p`,{className:`muted`,children:[`No skills of your own were found`,i?` where this project runs`:` on this computer`,`.`]}),e.plugins.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Plugin skills go on and off with their plugin, in the session profile: `,e.plugins.join(`, `),`.`]})]})}function dp(e,t,n){if(!e)return``;let r=e.skills.length,i=r=>e.skills.filter(e=>n?ip(e.name,r,n,t):ip(e.name,r,t,void 0)).length;return`manager ${i(`manager`)} of ${r}, sessions ${i(`session`)} of ${r}`}function fp({run:e}){let{list:t,error:n}=lp(void 0),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{t&&r===null&&i(t.defaults)},[t]),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Skills`}),(0,V.jsx)(`p`,{className:`muted`,children:`Which of your own skills managers and sessions get, unless a project's ⚙ says otherwise. Running sessions keep theirs; new and resumed ones get these.`}),(0,V.jsxs)(`details`,{children:[(0,V.jsxs)(`summary`,{children:[`Default skills`,t&&r?`: ${dp(t,r,null)}`:``]}),(0,V.jsx)(up,{list:t,error:n,value:r??{},onChange:e=>{i(e),o(!1)},defaults:null}),(0,V.jsx)(`button`,{className:`primary`,disabled:!r,onClick:()=>void e(async()=>{i(await R.setSkillDefaults(r??{})),o(!0)}),children:`Save`}),a&&(0,V.jsx)(`span`,{className:`muted`,children:` Saved.`})]})]})}function pp({colour:e,children:t}){if(!e)return(0,V.jsx)(V.Fragment,{children:t});let n=Dt[e];return(0,V.jsx)(`span`,{className:`named`,style:{"--name-light":n.light,"--name-dark":n.dark},children:t})}function mp({project:e,run:t}){let n=n=>t(()=>R.setProjectColours(e.name,n)),{manager:r,sessions:i}=e.colours,a=Object.keys(Dt),o=(e,t,n,r)=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${t?` on`:``}`,"aria-pressed":t,title:Dt[e].label,"aria-label":`${r}: ${Dt[e].label}`,onClick:n,children:(0,V.jsx)(pp,{colour:e,children:`●`})},e);return(0,V.jsxs)(`div`,{className:`name-colours`,children:[(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Manager name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Manager name`}),(0,V.jsx)(`button`,{type:`button`,className:`small${r===null?` on`:``}`,"aria-pressed":r===null,onClick:()=>n({manager:null,sessions:i}),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,r===e,()=>n({manager:e,sessions:i}),`Manager name`))})]}),(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Its sessions' name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Its sessions' names`}),(0,V.jsx)(`button`,{type:`button`,className:`small${i===`same`?` on`:``}`,"aria-pressed":i===`same`,onClick:()=>n({manager:r,sessions:`same`}),children:`Same as manager`}),(0,V.jsx)(`button`,{type:`button`,className:`small${i===`none`?` on`:``}`,"aria-pressed":i===`none`,onClick:()=>n({manager:r,sessions:`none`}),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:a.map(e=>o(e,i===e,()=>n({manager:r,sessions:e}),`Its sessions' names`))})]})]})}function hp({colour:e,run:t}){let n=e=>t(()=>R.setChatsColour(e));return(0,V.jsx)(`div`,{className:`name-colours`,children:(0,V.jsxs)(`div`,{className:`name-colour-row`,role:`group`,"aria-label":`Chats' name colour`,children:[(0,V.jsxs)(`div`,{className:`name-colour-head`,children:[(0,V.jsx)(`span`,{className:`name-colour-label field-name`,children:`Chats' names`}),(0,V.jsx)(`button`,{type:`button`,className:`small${e===null?` on`:``}`,"aria-pressed":e===null,onClick:()=>n(null),children:`None`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:Object.keys(Dt).map(t=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${e===t?` on`:``}`,"aria-pressed":e===t,title:Dt[t].label,"aria-label":`Chats' names: ${Dt[t].label}`,onClick:()=>n(t),children:(0,V.jsx)(pp,{colour:t,children:`●`})},t))})]})})}function gp(e,t){return Ot(t.find(t=>t.name===e.project)?.colours,e.role)}var _p=[{id:`update`,label:`Update & restart`,part:`ledung`,settings:[{label:`Update Ledung`,about:`Gets what is new and restarts into it`,keywords:[`upgrade`,`version`,`release`,`new`]},{label:`Restart Ledung`,about:`Starts Ledung again on its newest version; sessions keep running`,keywords:[`reload`,`reboot`]},{label:`Stop Ledung`,about:`Stops Ledung and its sessions`,keywords:[`quit`,`exit`,`shut down`,`close`,`background`]},{label:`Shortcuts`,about:`A Ledung icon on the Desktop and in the Start menu, or in Applications`,keywords:[`desktop`,`icon`,`start menu`,`applications`,`launcher`,`dock`,`shortcut`]},{label:`Start at sign-in`,about:`Start Ledung in the background when you sign in`,keywords:[`startup`,`autostart`,`login`,`log in`,`boot`,`windows`,`launch agent`]},{label:`Log`,about:`Where a background Ledung writes what it says`,keywords:[`log`,`output`,`console`,`debug`,`ledung.log`]}]},{id:`claude`,label:`Claude & usage`,part:`ledung`,settings:[{label:`Accounts`,about:`The Claude accounts sessions run on`,keywords:[`claude`,`login`,`sign in`,`plan`,`subscription`]},{label:`Usage stops`,about:`Hold new turns when a plan window is this full`,keywords:[`usage`,`limit`,`quota`,`pause`,`window`,`percent`]},{label:`Claude Code`,about:`The Claude Code program sessions run`,keywords:[`cli`,`program`,`version`,`install`]},{label:`Publish usage`,about:`Send usage figures to a dashboard, per Claude account`,keywords:[`usage`,`dashboard`,`share`,`statistics`,`account`,`all accounts`,`repository`,`github`]}]},{id:`sessions`,label:`Sessions`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills managers and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Session profiles`,storedIn:`config`,about:`Sets of tools and settings sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`macros`,label:`Macros`,part:`ledung`,settings:[{label:`Macros`,about:`Text you send often, as a chip in the info bar, a keybind, or both`,keywords:[`macro`,`shortcut`,`keybind`,`key`,`hotkey`,`chip`,`snippet`,`quick`,`text`]}]},{id:`remote`,label:`Remote & devices`,part:`ledung`,settings:[{label:`Computers`,about:`This computer's name and colour, and the others Ledung knows`,keywords:[`machine`,`colour`,`color`,`name`]},{label:`Remote access`,about:`Reach this Ledung from your phone, anywhere, through a relay`,keywords:[`phone`,`mobile`,`tunnel`,`internet`,`away`]},{label:`Phones`,about:`Phones that may open this Ledung`,keywords:[`phone`,`mobile`,`device`,`pair`]},{label:`Linked computers`,about:`Link this Ledung with another of yours`,keywords:[`link`,`machine`,`pair`,`device`]},{label:`Relay`,about:`Run a relay for other people`,keywords:[`server`,`host`,`tunnel`]},{label:`Message board`,about:`Managers post to each other on a shared board`,keywords:[`board`,`posts`,`messages`]}]},{id:`look`,label:`Look & feel`,part:`browser`,settings:[{label:`Appearance`,storedIn:`browser`,about:`Light, dark or the computer's own`,keywords:[`theme`,`dark`,`light`,`mode`,`colour`,`color`,`system`]},{label:`Autocorrect`,storedIn:`browser`,about:`Whether the browser corrects words as you type`,keywords:[`spelling`,`typing`,`spell`]},{label:`Status dot`,storedIn:`browser`,about:`The coloured dot by each session in the sidebar`,keywords:[`sidebar`,`dot`,`colour`,`color`]},{label:`Show "Archived" in the sidebar`,storedIn:`browser`,about:`The Archived entry under each project`,keywords:[`archive`,`sidebar`]},{label:`Compact sidebar`,storedIn:`browser`,about:`Smaller session cards in the sidebar`,keywords:[`sidebar`,`dense`,`small`,`cards`]},{label:`App`,storedIn:`browser`,about:`Install Ledung as an app`,keywords:[`install`,`pwa`,`desktop`,`icon`]}]},{id:`notifications`,label:`Notifications`,part:`browser`,settings:[{label:`Notifications`,storedIn:`browser`,about:`A browser notification when something needs your answer`,keywords:[`alert`,`notify`,`sound`,`popup`]}]},{id:`config`,label:`Config file`,part:`info`,settings:[{label:`Config file`,storedIn:`config`,about:`Ledung's config file and its problems`,keywords:[`json`,`port`,`file`,`settings`]}]},{id:`about`,label:`About`,part:`info`,settings:[{label:`About`,about:`Version and where Ledung runs from`,keywords:[`version`,`licence`,`license`]},{label:`Update channel`,about:`Public releases only, or dev builds too (npm installs)`,keywords:[`channel`,`dev`,`public`,`npm`,`beta`]}]}],vp=_p[0].id,yp=e=>`settings:${e}`,bp={usageStop:`Usage stops`,claudeProblem:`Claude Code`,configProblem:`Config file`};function xp(e){let t=_p.find(t=>t.settings.some(t=>t.label===bp[e]));return t?yp(t.id):`settings`}function Sp(e,t){if(e===`accounts`)return`claude`;let n=e?.startsWith(`settings:`)?e.slice(9):null;return n&&_p.some(e=>e.id===n)?n:t?null:vp}var Cp=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Name`,about:`The project's name in the sidebar`,keywords:[`rename`,`title`]},{label:`Claude account`,about:`The account its sessions run on`,keywords:[`account`,`login`,`plan`]},{label:`Model`,about:`The model its sessions use`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Model for its manager`,about:`The model its manager uses`,keywords:[`opus`,`sonnet`,`haiku`,`claude`]},{label:`Permissions for new sessions`,about:`The permission mode new sessions start in`,keywords:[`permission`,`mode`,`auto`,`plan`,`accept`]},{label:`Extra folders`,about:`Folders outside the project its sessions may work in`,keywords:[`folder`,`directory`,`path`]},{label:`Publish its usage under its name`,about:`Published usage figures carry the project's name`,keywords:[`usage`,`dashboard`,`share`]},{label:`Usage repository`,about:`The repository its usage is published to, instead of this computer's default one`,keywords:[`usage`,`dashboard`,`share`,`repo`,`github`,`board`,`publish`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`powers`,label:`Manager's powers`,part:`ledung`,settings:[{label:`What the manager may decide for you`,about:`What its manager may answer in your place`,keywords:[`grant`,`decide`,`approve`,`manager`]},{label:`Its manager adds projects and starts or stops other managers without asking you`,keywords:[`projects`,`managers`,`manager`]},{label:`Its manager reads and changes workflow settings of your projects`,keywords:[`workflow`,`manager`]},{label:`Dev ship command`,about:`A command away mode may let through`,keywords:[`ship`,`deploy`,`publish`,`away`]},{label:`Lockdown`,about:`Keep its sessions off the network and out of other tools`,keywords:[`network`,`container`,`island`,`security`,`sandbox`]}]},{id:`skills`,label:`Skills & profiles`,part:`ledung`,settings:[{label:`Skills`,about:`Which of your own skills its manager and sessions get`,keywords:[`skill`,`plugins`,`commands`]},{label:`Profile for its manager`,about:`The session profile its manager starts with`,keywords:[`profile`,`tools`,`mcp`,`manager`]},{label:`Profile for its sessions`,about:`The session profile its sessions start with`,keywords:[`profile`,`tools`,`mcp`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Manager name`,about:`Its manager's name colour in the sidebar`,keywords:[`colour`,`color`,`manager`]},{label:`Its sessions' names`,about:`Its sessions' name colour in the sidebar`,keywords:[`colour`,`color`]}]},{id:`workflow`,label:`Workflow`,part:`ledung`,settings:[{label:`Workflow`,about:`Whether it follows a written process, and which`,keywords:[`process`,`agent`]},{label:`Project config for the workflow`,about:`The process's config file for this project`,keywords:[`process`,`config`,`file`]}]},{id:`tickets`,label:`Tickets & questions`,part:`ledung`,settings:[{label:`Ticket pattern`,about:`What a ticket number looks like`,keywords:[`issue`,`ticket`,`jira`]},{label:`Ticket link`,about:`Where a ticket number links to`,keywords:[`issue`,`ticket`,`url`]},{label:`Question tiers`,about:`The order of its questions in Waiting for you`,keywords:[`questions`,`waiting`,`priority`,`order`]}]},{id:`board`,label:`Message board`,part:`ledung`,settings:[{label:`Use the board in this project`,about:`Its manager posts to and reads the message board`,keywords:[`board`,`posts`,`messages`]}]},{id:`remove`,label:`Remove project`,part:`info`,settings:[{label:`Remove project`,about:`Takes it off the list and stops its sessions; the folder is not touched`,keywords:[`delete`,`remove`]}]}],wp=[{id:`general`,label:`General`,part:`ledung`,settings:[{label:`Folder`,storedIn:`config`,about:`Where new chats start`,keywords:[`folder`,`directory`,`path`]},{label:`Permission mode`,storedIn:`config`,about:`The permission mode new chats start in`,keywords:[`permission`,`mode`,`auto`,`plan`]}]},{id:`safety`,label:`What always goes to you`,part:`ledung`,settings:[{label:`What always goes to you`,about:`Commands and paths that always ask you first`,keywords:[`sensitive`,`safety`,`ask`,`patterns`,`commands`,`production`]}]},{id:`look`,label:`Look`,part:`ledung`,settings:[{label:`Chats' names`,about:`The chats' name colour in the sidebar`,keywords:[`colour`,`color`]}]}];function Tp(e){if(e===`chats`)return{project:null,group:null};if(e?.startsWith(`chats:`))return{project:null,group:e.slice(6)};if(!e?.startsWith(`ps:`))return null;let t=e.slice(3),n=t.indexOf(`/`);return n<0?{project:t,group:null}:{project:t.slice(0,n),group:t.slice(n+1)}}var Ep=(e,t)=>e===null?`chats:${t}`:`ps:${e}/${t}`;function Dp(e,t){let n=e.project===null?wp:Cp;return e.group&&n.some(t=>t.id===e.group)?e.group:t?null:n[0].id}function Op(e){return[{id:`ledung`,label:`Ledung`,view:`settings`},{id:`chats`,label:`Chats`,view:`chats`},...e.map(e=>({id:`ps:${e.name}`,label:e.name,view:`ps:${e.name}`})),{id:`add`,label:`+ Add project`,view:`add`}]}function kp(e){if(!e)return null;if(e===`settings`||e===`accounts`||e.startsWith(`settings:`))return`ledung`;if(e===`add`)return e;let t=Tp(e);return t?t.project===null?`chats`:`ps:${t.project}`:null}function Ap(e){let t=!!e.remote;return{remote:t?`on`:`off`,phones:t?`on`:`needs`,linked:t?`on`:`needs`,relay:e.relaySetUp===null?`hidden`:e.relaySetUp?`on`:`off`,board:e.boardConfigured?`on`:`off`}}var jp=e=>e?``:`off`;function Mp(e){return e?e.npm?{update:null,restart:`Starts Ledung again from the installed package, so an update with npm takes effect. Sessions keep running and reconnect.`}:{update:`Gets what is new on main from GitHub into the folder this release was built from, builds a new release and restarts into it. Sessions keep running and reconnect.`,restart:`Loads the newest release. Sessions keep running and reconnect.`}:{update:null,restart:`Starts Ledung again on its newest version. Sessions keep running and reconnect.`}}function Np(e){return e?e.npm?`from npm`:e.available?e.restarting?`restarting…`:e.updating?`updating…`:e.checking?`checking…`:e.check?e.check.upToDate?`up to date`:`${e.check.behind} new change${e.check.behind===1?``:`s`}`:`not checked`:`no updates here`:``}function Pp(e){return[{id:`ledung`,label:`Ledung`,groups:_p,viewOf:yp},{id:`chats`,label:`Chats`,groups:wp,viewOf:e=>Ep(null,e)},...e.map(e=>({id:`ps:${e.name}`,label:e.name,groups:Cp,viewOf:t=>Ep(e.name,t)}))]}var Fp=e=>e.normalize(`NFD`).replace(/[̀-ͯ]/g,``).toLowerCase().replace(/[^\p{L}\p{N}]+/gu,` `).trim(),Ip=e=>Fp(e).split(` `).filter(Boolean),Lp={label:4,keyword:3,group:2,about:1};function Rp(e,t,n=null){let r=Ip(e);if(!r.length)return[];let i=r.join(` `),a=[],o=[...t.filter(e=>e.id===n),...t.filter(e=>e.id!==n)],s=0;for(let e of o)for(let t of e.groups){let n=Ip(t.label);for(let o of t.settings){s++;let c=[[Lp.label,Ip(o.label)],[Lp.keyword,(o.keywords??[]).flatMap(Ip)],[Lp.group,n],[Lp.about,Ip(o.about??``)]],l=0;for(let e of r){let t=Math.max(0,...c.filter(([,t])=>t.some(t=>t.startsWith(e))).map(([e])=>e));if(!t){l=0;break}l+=t}if(!l)continue;let u=Fp(o.label);u===i?l+=10:` ${u} `.includes(` ${i}`)&&(l+=5),a.push({hit:{tab:e.id,tabLabel:e.label,group:t.id,groupLabel:t.label,label:o.label,about:o.about,storedIn:o.storedIn,view:e.viewOf(t.id)},score:l,order:s})}}return a.sort((e,t)=>t.score-e.score||e.order-t.order).map(e=>e.hit)}var zp=(e,t,n)=>Rp(e,Pp(t),n);function Bp(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.updateStatus().then(n,e=>i(e.message))},[e]);let a=!!t&&(t.checking||t.updating||t.restarting);return(0,v.useEffect)(()=>{if(!a)return;let e=setInterval(()=>R.updateStatus().then(n,()=>{}),1e3);return()=>clearInterval(e)},[a]),{view:t,error:r,act:e=>{i(null),e().then(n,e=>i(e.message))}}}function Vp(e){let[t,n]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(e).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let t=matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}function Hp(e){let t=Bp(e.hellos),n=Np(t.view),r=kp(e.view),i=!!t.view?.check&&!t.view.check.upToDate,a=Gp(r,e.projects,t=>{t!==e.view&&e.onOpen(t)});return(0,V.jsx)(Up.Provider,{value:a,children:(0,V.jsxs)(`div`,{className:`page-view settings-frame`,children:[(0,V.jsxs)(`header`,{className:`session-head settings-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Settings`}),(0,V.jsx)(`div`,{className:`muted`,children:`One place for Ledung, chats and every project.`})]}),(0,V.jsxs)(`div`,{className:`session-corner settings-version`,children:[(0,V.jsxs)(`span`,{className:`settings-state${i?` behind`:n===`up to date`?` ok`:``}`,title:e.source?`Running ${e.source.version}`:void 0,children:[`Ledung `,e.source?.version??``,n&&(0,V.jsxs)(V.Fragment,{children:[` · `,n]})]}),e.canRestart?(0,V.jsx)($p,{hellos:e.hellos}):(0,V.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]})]}),(0,V.jsx)(`nav`,{className:`settings-tabs`,role:`tablist`,"aria-label":`Settings`,children:Op(e.projects).map(t=>(0,V.jsx)(`button`,{role:`tab`,"aria-selected":r===t.id,className:`settings-tab${r===t.id?` on`:``}${t.id===`add`?` add`:``}`,onClick:()=>{(r!==t.id||e.view!==t.view)&&e.onOpen(t.view)},children:t.label},t.id))}),(0,V.jsx)(`div`,{className:`settings-tab-body`,children:e.children(t)})]})})}var Up=(0,v.createContext)(null),Wp=e=>e instanceof HTMLElement&&(e.isContentEditable||e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.tagName===`SELECT`);function Gp(e,t,n){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(null),s=(0,v.useRef)(null),c=(0,v.useMemo)(()=>zp(r,t,e),[r,t,e]),l=(0,v.useRef)(r);return l.current=r,(0,v.useEffect)(()=>{let e=e=>{e.defaultPrevented||e.isComposing||(e.key===`Escape`&&l.current?(e.preventDefault(),i(``),s.current?.focus()):e.key===`/`&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!Wp(e.target)&&s.current&&(e.preventDefault(),s.current.focus(),s.current.select()))};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]),{query:r,setQuery:i,hits:c,input:s,tab:e,target:a,choose:e=>{i(``),o({tab:e.tab,group:e.group,label:e.label,n:Date.now()}),n(e.view)},reached:e=>o(t=>t?.n===e?null:t)}}var Kp=`section h3, section h4, label.toggle, .compact-slider > span, .offline-name, .field-name`;function qp(e,t){if(!e)return null;let n=Fp(t),r=[...e.querySelectorAll(Kp)].find(e=>{let t=Fp(e.textContent??``);return t===n||t===`run a ${n}`});return r?r.closest(`.field, .offline`)??r.closest(`label, details, .compact-slider`)??r:null}var Jp=2500,Yp=2e3;function Xp({search:e}){let t=B();return(0,V.jsxs)(`div`,{className:`settings-search`,children:[(0,V.jsx)(`span`,{className:`settings-search-icon`,"aria-hidden":!0,children:`⌕`}),(0,V.jsx)(`input`,{ref:e.input,type:`search`,placeholder:`Search settings`,"aria-label":`Search settings`,value:e.query,...t,onChange:t=>e.setQuery(t.target.value),onKeyDown:t=>{t.key===`Enter`&&e.hits[0]&&(t.preventDefault(),e.choose(e.hits[0])),t.key===`ArrowDown`&&(t.preventDefault(),document.querySelector(`.search-results button`)?.focus())}}),e.query?(0,V.jsx)(`button`,{type:`button`,className:`settings-search-clear`,"aria-label":`Clear search`,title:`Clear search`,onClick:()=>{e.setQuery(``),e.input.current?.focus()},children:`×`}):(0,V.jsx)(`kbd`,{children:`/`})]})}function Zp({search:e}){let t=e.query.trim();return e.hits.length?(0,V.jsxs)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[e.hits.length,` setting`,e.hits.length===1?``:`s`,` match "`,t,`"`]}),(0,V.jsx)(`ul`,{children:e.hits.map(t=>(0,V.jsx)(`li`,{children:(0,V.jsxs)(`button`,{className:`search-hit`,onClick:()=>e.choose(t),onKeyDown:t=>{let n=t.currentTarget.parentElement,r=t.key===`ArrowDown`?n?.nextElementSibling:t.key===`ArrowUp`?n?.previousElementSibling:void 0;r!==void 0&&(t.preventDefault(),r?r.querySelector(`button`)?.focus():t.key===`ArrowUp`&&e.input.current?.focus())},children:[(0,V.jsxs)(`span`,{className:`search-hit-name`,children:[t.label,t.storedIn&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(em,{kind:t.storedIn})]})]}),(0,V.jsxs)(`span`,{className:`search-hit-path`,children:[t.tabLabel,` › `,t.groupLabel]}),t.about&&(0,V.jsx)(`span`,{className:`search-hit-about muted`,children:t.about})]})},`${t.tab}/${t.group}/${t.label}`))})]}):(0,V.jsx)(`div`,{className:`search-results`,role:`region`,"aria-label":`Search results`,children:(0,V.jsxs)(`p`,{className:`muted`,children:[`No setting matches "`,t,`".`]})})}var Qp=6e4;function $p({hellos:e}){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`idle`),[a,o]=(0,v.useState)(0);return(0,v.useEffect)(()=>{r===`restarting`&&e>a&&i(`idle`)},[r,e,a]),(0,v.useEffect)(()=>{if(r!==`restarting`)return;let e=setTimeout(()=>i(`timeout`),Qp);return()=>clearTimeout(e)},[r]),r===`restarting`?(0,V.jsx)(`span`,{className:`muted`,children:`Restarting…`}):t?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Sessions keep running and reconnect.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:async()=>{o(e),n(!1),i(`restarting`);try{await R.restart()}catch{i(`failed`),n(!1)}},children:`Restart`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(!1),children:`Cancel`})]}):(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[r===`failed`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`The restart was refused.`}),r===`timeout`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`Ledung hasn't come back yet. Check its window, or its log when it runs in the background.`}),(0,V.jsx)(`button`,{className:`small`,title:`Restart Ledung on its newest version`,onClick:()=>{i(`idle`),n(!0)},children:`Restart Ledung`})]})}function em({kind:e}){return(0,V.jsx)(`span`,{className:`where ${e}`,title:e===`browser`?`Kept in this browser only: another browser or device has its own`:`Read from Ledung's config file`,children:e===`browser`?`this browser`:`config`})}function tm(e){let t=(0,v.useContext)(Up),n=!!t?.query.trim(),r=(0,v.useRef)(null),i=t?.target,a=!!i&&i.tab===t.tab&&i.group===e.current&&!n;(0,v.useEffect)(()=>{if(!a||!i||!t)return;let e=Date.now(),n,o=()=>{let a=qp(r.current,i.label);a?(a.classList.add(`search-found`),a.scrollIntoView({block:`center`}),setTimeout(()=>a.classList.remove(`search-found`),Jp),t.reached(i.n)):Date.now()-e<Yp?n=setTimeout(o,100):t.reached(i.n)};return o(),()=>clearTimeout(n)},[a,i?.n]);let o=(0,V.jsxs)(`div`,{className:`settings-side`,children:[t&&(0,V.jsx)(Xp,{search:t}),n&&e.current===null?(0,V.jsx)(Zp,{search:t}):(0,V.jsx)(nm,{...e})]});if(e.current===null)return(0,V.jsxs)(`div`,{className:`settings-split narrow`,children:[o,e.foot]});let s=e.groups.find(t=>t.id===e.current)?.label??``;return(0,V.jsxs)(`div`,{className:`settings-split${e.narrow?` narrow`:``}`,children:[!e.narrow&&o,(0,V.jsxs)(`div`,{className:`settings-main`,children:[n&&!e.narrow&&(0,V.jsx)(Zp,{search:t}),(0,V.jsxs)(`div`,{className:`settings-content`,role:`region`,"aria-label":s,ref:r,hidden:n&&!e.narrow,children:[e.narrow&&(0,V.jsxs)(`div`,{className:`settings-group-head`,children:[(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(null),children:`← All settings`}),(0,V.jsx)(`h3`,{children:s})]}),e.children]}),e.foot]})]})}function nm(e){return(0,V.jsx)(`nav`,{className:`settings-menu`,"aria-label":`Settings groups`,children:e.groups.map((t,n)=>{let r=n>0&&e.groups[n-1].part!==t.part,i=e.marked?.has(t.id);return(0,V.jsxs)(v.Fragment,{children:[r&&(0,V.jsx)(`div`,{className:`settings-menu-sep`}),r&&t.part===`browser`&&(0,V.jsx)(`div`,{className:`settings-menu-cap`,children:`This browser`}),(0,V.jsxs)(`button`,{className:`settings-menu-item${e.current===t.id?` on`:``}${t.id===`remove`?` danger`:``}`,"aria-current":e.current===t.id?`page`:void 0,onClick:()=>e.onOpen(t.id),children:[(0,V.jsxs)(`span`,{children:[t.label,i&&(0,V.jsx)(`span`,{className:`unsaved-mark`,title:`Changed, not saved yet`,"aria-label":`(not saved)`,children:` •`})]}),(0,V.jsxs)(`span`,{className:`muted`,children:[e.words[t.id]??``,e.narrow&&` ›`]})]})]},t.id)})})}function rm(e){return!e.count&&!e.saved?null:(0,V.jsxs)(`div`,{className:`save-bar`,role:`region`,"aria-label":`Unsaved changes`,children:[(0,V.jsxs)(`span`,{className:`muted`,children:[e.count?`${e.count} unsaved change${e.count===1?``:`s`}`:`Saved.`,e.count>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,e.note]}),e.count>0&&e.disabled&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`error`,children:e.disabled})]})]}),(0,V.jsx)(`span`,{className:`grow`}),e.count>0&&(0,V.jsx)(`button`,{className:`small`,disabled:e.busy,onClick:e.onDiscard,children:`Discard`}),e.count>0&&(0,V.jsx)(`button`,{className:`small primary`,disabled:e.busy||!!e.disabled,onClick:e.onSave,children:e.busy?`Saving…`:`Save`})]})}function im({follows:e,text:t,onReset:n}){return(0,V.jsxs)(`span`,{className:`inherit${e?``:` over`}`,children:[t,!e&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{type:`button`,className:`link`,onClick:e=>{e.preventDefault(),n()},children:`Reset`})]})]})}var am=`(max-width: 760px)`;function om(e,t){if(e===`width`){let e=Math.max(220,Math.floor(t/2));return{min:220,max:e,def:Math.min(290,e)}}let n=Math.max(120,Math.floor(t*.75));return{min:120,max:n,def:Math.min(n,Math.max(120,Math.floor(t*.55)))}}function sm(e,t,n){return Math.round(Math.min(n,Math.max(t,e)))}function cm(e){let t=e==null?NaN:Number(e);return Number.isFinite(t)&&t>0?t:null}function lm(e,t,n,r,i){return e===(t===`width`?`ArrowRight`:`ArrowDown`)?sm(n+20,r,i):e===(t===`width`?`ArrowLeft`:`ArrowUp`)?sm(n-20,r,i):e===`Home`?r:e===`End`?i:null}function um(e,t){let[n,r]=(0,v.useState)(e),[i,a]=(0,v.useState)(e),o=JSON.stringify(e);return(0,v.useEffect)(()=>{r(e),a(r=>t(n,r)?r:e)},[o]),{saved:n,value:i,set:a,done:e=>{r(e),a(e)},discard:()=>a(n)}}var dm=(e=``)=>({name:e,account:``,model:``,managerModel:``,permissionMode:``,managerGrant:``,projectToolsUnasked:!1,projectSettingsTools:!1,publishUsageName:!1,usageRepo:``,managerProfile:``,sessionProfile:``,skills:{},...M({commandPatterns:[],pathPatterns:[]}),devShipCommand:``,ticketPattern:``,ticketUrl:``,questionTiers:te.join(`
|
|
58
|
+
`),extraFolders:``,workflowUse:null,workflowName:``,workflowConfig:``,lockdownLevel:`off`,lockdownBoard:!1,lockdownRemoteControl:!1,lockdownNetwork:``,lockdownDockerNetwork:``});function fm(e){return{name:e.name,account:e.account??``,model:e.model??``,managerModel:e.managerModel??``,permissionMode:e.permissionMode??``,managerGrant:e.managerGrant??``,projectToolsUnasked:e.projectToolsUnasked,projectSettingsTools:e.projectSettingsTools===!0,publishUsageName:e.publishUsageName===!0,usageRepo:e.usageRepo??``,managerProfile:e.profiles.manager??``,sessionProfile:e.profiles.session??``,skills:e.skills,commandPatterns:e.sensitive.commandPatterns,pathPatterns:e.sensitive.pathPatterns,devShipCommand:e.devShipCommand??``,ticketPattern:e.tickets?.pattern??``,ticketUrl:e.tickets?.url??``,questionTiers:e.questionTiers.join(`
|
|
59
59
|
`),extraFolders:e.extraFolders.join(`
|
|
60
60
|
`),workflowUse:e.workflow?.use??null,workflowName:e.workflow?.name??``,workflowConfig:e.workflow?.projectConfig??``,lockdownLevel:e.lockdown.level,lockdownBoard:e.lockdown.board,lockdownRemoteControl:e.lockdown.remoteControl,lockdownNetwork:(e.lockdown.network??[]).join(`
|
|
61
|
-
`),lockdownDockerNetwork:e.lockdown.dockerNetwork??``}}function
|
|
62
|
-
`).map(e=>e.trim()).filter(Boolean))],
|
|
63
|
-
`)})}})})}function Um({value:e,onChange:t,heading:n=!0}){let r=B(),[i,a]=(0,v.useState)(`command`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),u=[...e.commandPatterns.map(e=>({kind:`command`,pattern:e})),...e.pathPatterns.map(e=>({kind:`path`,pattern:e}))],d=j(e.commandPatterns,e.pathPatterns),f=n=>t({...e,commandPatterns:n.kind===`command`?e.commandPatterns.filter(e=>e!==n.pattern):e.commandPatterns,pathPatterns:n.kind===`path`?e.pathPatterns.filter(e=>e!==n.pattern):e.pathPatterns}),p=()=>{let n=o.trim();if(n){try{new RegExp(n,`i`)}catch(e){l(`Not a valid regular expression: ${e.message}`);return}l(null),s(``),t(i===`command`?{...e,commandPatterns:e.commandPatterns.includes(n)?e.commandPatterns:[...e.commandPatterns,n]}:{...e,pathPatterns:e.pathPatterns.includes(n)?e.pathPatterns:[...e.pathPatterns,n]})}};return(0,V.jsxs)(`div`,{className:`sensitive-list`,children:[(0,V.jsx)(`p`,{children:n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`strong`,{children:`Always goes to you`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(no session, manager or "for this session" permission can allow these; you decide each time, in every permission mode)`})]}):(0,V.jsx)(`span`,{className:`muted`,children:`No session, manager or "for this session" permission can allow these; you decide each time, in every permission mode.`})}),u.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`Nothing is sensitive here; every action is decided by the permission mode and the manager.`}),(0,V.jsx)(`ul`,{children:u.map(e=>{let t=A(e.pattern,e.kind);return(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`span`,{className:`sensitive-entry`,children:[(0,V.jsx)(`span`,{children:t??(e.kind===`command`?`Commands matching`:`Files matching`)}),(0,V.jsx)(`code`,{className:t?`muted`:void 0,children:e.pattern})]}),(0,V.jsx)(`button`,{type:`button`,className:`small deny`,onClick:()=>f(e),"aria-label":`Delete: ${t??e.pattern}`,children:`Delete`})]},e.kind+e.pattern)})}),d.length>0&&(0,V.jsx)(`p`,{children:(0,V.jsxs)(`button`,{type:`button`,className:`small`,onClick:()=>t(M(e)),children:[`Add suggested (`,d.length,` of `,ee.length,` not in the list)`]})}),(0,V.jsxs)(`div`,{className:`sensitive-add`,children:[(0,V.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),"aria-label":`What the pattern is matched against`,children:[(0,V.jsx)(`option`,{value:`command`,children:`A command`}),(0,V.jsx)(`option`,{value:`path`,children:`A file path`})]}),(0,V.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`regular expression, e.g. \\bmigrate:prod\\b`,onChange:e=>{s(e.target.value),l(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p())}}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:p,disabled:!o.trim(),children:`Add`})]}),c&&(0,V.jsx)(`p`,{className:`error`,children:c})]})}function Wm({value:e,onChange:t,accounts:n,profiles:r,container:i,workflow:a,lockdownB:o}){let s={value:e,onChange:t};return(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Om,{...s}),(0,V.jsx)(km,{...s,accounts:n,container:i}),(0,V.jsx)(Am,{...s}),(0,V.jsx)(jm,{...s}),(0,V.jsx)(Nm,{...s}),(0,V.jsx)(Pm,{...s}),(0,V.jsx)(zf,{value:e,onChange:t}),(0,V.jsx)(Gm,{value:e,onChange:t,levelB:o,container:i}),(0,V.jsx)(Im,{...s,role:`manager`,profiles:r}),(0,V.jsx)(Im,{...s,role:`session`,profiles:r}),(0,V.jsx)(Lm,{...s,project:void 0}),!!a?.workflows.length&&(0,V.jsx)(Bm,{...s,workflow:a,container:!!i}),(0,V.jsxs)(`details`,{children:[(0,V.jsxs)(`summary`,{children:[`More: actions that always go to you, tickets, question tiers`,i?``:` and extra folders`]}),(0,V.jsx)(Um,{value:e,onChange:t}),(0,V.jsx)(Fm,{...s}),(0,V.jsx)(Vm,{...s}),(0,V.jsx)(Hm,{...s}),!i&&(0,V.jsx)(Mm,{...s})]})]})}function Gm({value:e,onChange:t,levelB:n,container:r}){let i=B(),a=e.lockdownLevel!==`off`,o=e.lockdownLevel===`B`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Lockdown`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(walls the project off from other projects' managers and sessions; only you can turn it off or down again)`}),(0,V.jsxs)(`select`,{value:e.lockdownLevel,onChange:n=>t({...e,lockdownLevel:n.target.value}),children:[(0,V.jsx)(`option`,{value:`off`,children:`Off (default): managers and sessions reach it as usual`}),(0,V.jsx)(`option`,{value:`A`,children:`Level A: nothing reaches in; it may still reach out`}),(0,V.jsxs)(`option`,{value:`B`,disabled:!!n&&!o,children:[`Level B, nearly air-gapped: nothing reaches in or out`,n?`: not available here`:``]})]})]}),n&&(0,V.jsx)(`p`,{className:`muted`,children:n}),a&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Other projects' managers see only its name: they can't message it (except, at level A, to answer each of its messages once), start or stop its manager, or use its folders. While a project is locked, every other session on this computer is kept out of its folders: file tools on every system, and shell commands run in Claude Code's sandbox on macOS and Linux (not on Windows, where only the file tools are stopped). Running sessions take it when Ledung restarts them, which it does as soon as each is free; their conversations are kept.`}),o&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Level B also closes the way out. Its manager has no tools for other managers, other projects or the board. Its sessions get none of your MCP servers, plugins, connectors or own settings, no web tools, and can't read outside their folders.`,r?` Its container is checked before every start: only the project folder mounted, no Docker socket, and only the network you mark below.`:` Their shell commands run in the sandbox with no network but the hosts below.`,` `,`Only what Claude Code and a shell need of Ledung's environment is passed on.`]}),!o&&(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.lockdownBoard,onChange:n=>t({...e,lockdownBoard:n.target.checked})}),` `,`Keep the message board on for it`]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.lockdownRemoteControl,onChange:n=>t({...e,lockdownRemoteControl:n.target.checked})}),` `,`Keep Remote Control for its manager`]}),o&&!r&&(0,V.jsxs)(`label`,{children:[`Hosts its shell commands may reach `,(0,V.jsx)(`span`,{className:`muted`,children:`(one per line, such as registry.npmjs.org or *.example.com; empty: no network)`}),(0,V.jsx)(`textarea`,{...i,rows:3,value:e.lockdownNetwork,onChange:n=>t({...e,lockdownNetwork:n.target.value})})]}),o&&r&&(0,V.jsxs)(`label`,{children:[`Its island network `,(0,V.jsx)(`span`,{className:`muted`,children:`(the Docker network its container may be on; mark it only once it reaches nothing but what the project may)`}),(0,V.jsx)(`input`,{...i,value:e.lockdownDockerNetwork,onChange:n=>t({...e,lockdownDockerNetwork:n.target.value})})]})]})]})}function Km(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=t=>{i(null),o(!0),e.load(t).then(n,e=>i(e.message)).finally(()=>o(!1))};return(0,v.useEffect)(()=>s(e.start),[e.reloadKey,e.start]),(0,V.jsxs)(`div`,{className:`browser`,children:[r&&(0,V.jsx)(`p`,{className:`error`,children:r}),a&&(0,V.jsx)(`p`,{className:`muted`,children:`Loading folders…`}),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`browser-head`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:!t.parent,onClick:()=>s(t.parent??void 0),title:`One folder up`,children:`↑ Up`}),(0,V.jsx)(`span`,{className:`mono browser-path`,children:t.path})]}),t.roots.length>1&&(0,V.jsx)(`div`,{className:`browser-roots`,children:t.roots.map(e=>(0,V.jsx)(`button`,{className:`small`,onClick:()=>s(e),children:e},e))}),(0,V.jsxs)(`ul`,{className:`browser-list`,children:[!t.entries.length&&(0,V.jsx)(`li`,{className:`muted`,children:`No folders here.`}),t.entries.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`button`,{className:`link`,onClick:()=>s(e.path),children:[`📁 `,e.name]}),e.git!==null&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · git`,e.git?` · ${e.git}`:``]}),e.project&&(0,V.jsxs)(`span`,{className:`chip`,children:[`project `,e.project]})]},e.path))]}),(0,V.jsx)(`div`,{className:`browser-foot`,children:(0,V.jsx)(`button`,{className:`primary`,onClick:()=>e.onPick(t.path),children:e.pickLabel})})]})]})}function qm({run:e,onAdded:t,accounts:n,defaultAccount:r,profiles:i,lockdownB:a}){let o=B(),[s,c]=(0,v.useState)(`local`),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(()=>({...um(),account:r??``})),w=(0,v.useRef)(r??``);(0,v.useEffect)(()=>{let e=w.current,t=r??``;w.current=t,C(n=>n.account===e?{...n,account:t}:n)},[r]);let[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(!1),[k,ee]=(0,v.useState)(!1),[A,j]=(0,v.useState)(``),[M,te]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),ne=Rm(s===`local`&&l?l:void 0,S.workflowConfig,S.workflowName),re=ne&&s!==`local`?{...ne,exists:s!==`new`&&null}:ne,ie=()=>{m(null),g(!0),R.containers().then(f,e=>m(e.message)).finally(()=>g(!1))};(0,v.useEffect)(()=>{u(null),te(null),s===`docker`&&ie(),s===`docker`&&n.find(e=>e.name===S.account)?.kind===`folder`&&C(e=>({...e,account:``})),s===`new`&&!T&&R.projectsFolder().then(e=>E(e.path),()=>{})},[s]);let ae=e=>{u(e);let t=e.split(/[\\/]/).filter(Boolean).pop()??``;S.name||C({...S,name:t.replace(/[^A-Za-z0-9 ._-]/g,``).slice(0,48)})},oe=()=>e(async()=>{P(!0);let e=ne?.workflows[0],n=e&&!S.workflowName&&gm(S,s===`docker`)?{...S,workflowName:e}:S;try{if(s===`new`){let e=await R.createProject({parent:T??void 0,github:k,task:A.trim()||void 0,settings:fm(n,null)});e.warning&&te(e.warning),t(e.project)}else t(s===`local`?await R.addProject({...fm(n,null),runner:`local`,path:l}):await R.addProject({...fm(n,null),runner:`docker`,container:_,pathInContainer:l,...b?{user:b}:{}}))}finally{P(!1)}}),se=S.name.trim()&&(s===`new`||l);return(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Add a project`}),(0,V.jsx)(`div`,{className:`muted`,children:`A project is a folder where Claude Code works, with its settings and one manager.`})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsxs)(`div`,{className:`segmented`,role:`tablist`,children:[(0,V.jsx)(`button`,{className:s===`local`?`on`:``,onClick:()=>c(`local`),children:`Folder on this computer`}),(0,V.jsx)(`button`,{className:s===`docker`?`on`:``,onClick:()=>c(`docker`),children:`Folder in a container`}),(0,V.jsx)(`button`,{className:s===`new`?`on`:``,onClick:()=>c(`new`),children:`New project`})]}),s===`local`&&(l?(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsx)(`span`,{className:`mono`,children:l}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,V.jsx)(Km,{load:R.browse,reloadKey:`local`,onPick:ae,pickLabel:`Use this folder`})),s===`docker`&&(0,V.jsxs)(V.Fragment,{children:[p&&(0,V.jsx)(`p`,{className:`error`,children:p}),h&&(0,V.jsx)(`p`,{className:`muted`,children:`Looking for running containers…`}),!h&&(d||p)&&(0,V.jsx)(`p`,{children:(0,V.jsx)(`button`,{className:`small`,onClick:ie,children:`Refresh containers`})}),d&&!d.length&&(0,V.jsx)(`p`,{className:`muted`,children:`No containers are running. Start the container first.`}),d&&d.length>0&&(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Container`,(0,V.jsxs)(`select`,{value:_,onChange:e=>{y(e.target.value),x(d.find(t=>t.name===e.target.value)?.user??``),u(null)},children:[(0,V.jsx)(`option`,{value:``,children:`Choose a running container`}),d.map(e=>(0,V.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.image,`)`]},e.name))]})]}),(0,V.jsxs)(`label`,{children:[`Run as user `,(0,V.jsx)(`span`,{className:`muted`,children:`(empty: the container's default)`}),(0,V.jsx)(`input`,{...o,value:b,onChange:e=>x(e.target.value)})]})]}),_&&(l?(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsxs)(`span`,{className:`mono`,children:[_,`:`,l]}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,V.jsx)(Km,{load:e=>R.browseContainer(_,b,e),reloadKey:`${_}|${b}`,onPick:ae,pickLabel:`Use this folder`}))]}),s===`new`&&(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Ledung creates a folder named after the project, with a git repository.`}),D?(0,V.jsx)(Km,{load:R.browse,reloadKey:`parent`,start:T??void 0,onPick:e=>{E(e),O(!1)},pickLabel:`Create it in this folder`}):(0,V.jsxs)(`p`,{children:[`In: `,(0,V.jsx)(`span`,{className:`mono`,children:T??`…`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>O(!0),children:`Change`})]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>ee(e.target.checked)}),` Create a private GitHub repository too`]}),(0,V.jsxs)(`label`,{children:[`What is the project for? `,(0,V.jsx)(`span`,{className:`muted`,children:`(optional: given to its manager as its first task)`}),(0,V.jsx)(`textarea`,{...o,rows:3,value:A,onChange:e=>j(e.target.value)})]})]}),(s===`new`||l)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Settings`}),(0,V.jsx)(Wm,{value:S,onChange:C,accounts:n,profiles:i,container:s===`docker`,workflow:ne,lockdownB:a}),(0,V.jsx)(zm,{check:re,settings:S,container:s===`docker`}),(0,V.jsx)(`button`,{className:`primary`,disabled:!se||N,onClick:()=>void oe(),children:N?`Adding…`:s===`new`?`Create project`:`Add project`})]}),M&&(0,V.jsx)(`p`,{className:`banner`,children:M})]})]})}function Jm({view:e,project:t,projects:n,run:r,onOpen:i,onRemoved:a,onRenamed:o,accounts:s,profiles:c,board:l,lockdownB:u}){let d=Bp(im),f=Ep(wp(e)??{project:t.name,group:null},d),p=lm(dm(t),(e,t)=>bm(e,t).length>0),m=lm(Dn(l,t.name),(e,t)=>kn(t,e)>0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(C,()=>{})},[]),(0,v.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>y(!1),3e3);return()=>clearTimeout(e)},[_]);let w=p.value,T=t.runner===`docker`,E=Rm(t.runner===`local`?t.path:void 0,w.workflowConfig,w.workflowName),D={value:w,onChange:e=>{p.set(e),y(!1)},defaults:{profiles:Cm(S,E?.on&&gm(w,T)&&(w.workflowName||E.workflows[0])||null)}},O=bm(p.saved,w),k=kn(m.value,m.saved),ee=O.length+k,A=new Set(O.map(e=>vm[e]));k&&A.add(`board`);let j=w.name.trim()!==t.name,M={safety:String(w.commandPatterns.length+w.pathPatterns.length),powers:w.lockdownLevel===`off`?``:`lockdown ${w.lockdownLevel}`,board:m.saved.enabled?``:`off`},te=()=>r(async()=>{g(!0);try{if(k&&(await jn(t.name,m.value),m.done(m.value)),O.length&&j){let e=(await R.renameProject(t.name,w.name.trim(),fm(w,t))).name;Uf(localStorage,t.name,e),o(f?Tp(e,f):`ps:${e}`);return}O.length&&p.done(dm(await R.updateProject(t.name,fm(w,t)))),y(!0)}finally{g(!1)}}),N=()=>{p.discard(),m.discard()},P=(k?An(m.value):null)??(w.name.trim()?null:`The project needs a name.`);return(0,V.jsxs)(em,{groups:Sp,current:f,words:M,marked:A,narrow:d,onOpen:e=>i(e===null?`ps:${t.name}`:Tp(t.name,e)),foot:(0,V.jsx)(nm,{count:ee,saved:_,busy:h,note:j?`saving renames the project; its sessions, manager and questions stay with it, and its folder is not moved`:`running sessions keep theirs; new and resumed ones get these`,disabled:P,onSave:()=>void te(),onDiscard:N}),children:[f===`general`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`General`}),(0,V.jsx)(`p`,{className:`muted mono tab-where`,children:t.where}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Om,{...D}),(0,V.jsx)(km,{...D,accounts:s,container:T}),(0,V.jsx)(Am,{...D}),(0,V.jsx)(jm,{...D}),!T&&(0,V.jsx)(Mm,{...D}),(0,V.jsx)(zf,{value:w,onChange:D.onChange})]})]}),f===`safety`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`What always goes to you`}),(0,V.jsx)(`div`,{className:`safety`,children:(0,V.jsx)(Um,{value:w,onChange:D.onChange,heading:!1})})]}),f===`powers`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Manager's powers`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Nm,{...D}),(0,V.jsx)(Pm,{...D}),(0,V.jsx)(Fm,{...D}),(0,V.jsx)(Gm,{value:w,onChange:D.onChange,levelB:u,container:T})]})]}),f===`skills`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Skills & profiles`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Lm,{...D,project:t.name}),(0,V.jsx)(Im,{...D,role:`manager`,profiles:c}),(0,V.jsx)(Im,{...D,role:`session`,profiles:c})]})]}),f===`look`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Look`}),(0,V.jsx)(`p`,{className:`muted`,children:`The names of its manager and its sessions in the sidebar and their headers. Saved at once, for every browser.`}),(0,V.jsx)(pp,{project:t,run:r})]}),f===`workflow`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Workflow`}),E?.workflows.length?(0,V.jsx)(`div`,{className:`form`,children:(0,V.jsx)(Bm,{...D,workflow:E,container:T})}):(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Workflow`}),`: `,(0,V.jsx)(`span`,{className:`muted`,children:E?`none is configured in Ledung's config ("workflow" or "workflows").`:`looking…`})]}),t.runner===`local`&&(0,V.jsx)(zm,{check:E,settings:w,container:!1})]}),f===`tickets`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Tickets & questions`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Vm,{...D}),(0,V.jsx)(Hm,{...D})]})]}),f===`board`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsx)(Mn,{board:l,project:t.name,projects:n,form:m.value,onChange:e=>{m.set(e),y(!1)}})]}),f===`remove`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Remove project`}),(0,V.jsx)(`p`,{className:`muted`,children:`Takes the project off the list and stops its sessions. Their history stays, and the folder is not touched.`}),b?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsxs)(`button`,{className:`small primary`,onClick:()=>void r(async()=>{await R.removeProject(t.name),a()}),children:[`Remove `,t.name]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>x(!1),children:`Cancel`})]}):(0,V.jsx)(`button`,{onClick:()=>x(!0),children:`Remove project…`})]})]})}function Ym({project:e,run:t,onStarted:n}){let r=B(),[i,a]=(0,v.useState)(``);return(0,V.jsx)($f,{level:qf(e),fill:!0,children:(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:e.name}),(0,V.jsx)(`div`,{className:`muted mono`,children:e.where})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsx)(`p`,{children:`This project's manager hasn't started yet. Write to it and it starts: give it a task, or ask where things stand.`}),(0,V.jsxs)(`div`,{className:`composer`,children:[(0,V.jsx)(`textarea`,{...r,rows:4,value:i,onChange:e=>a(e.target.value),placeholder:`Message the manager of ${e.name}`}),(0,V.jsx)(`button`,{className:`primary`,disabled:!i.trim(),onClick:()=>void t(async()=>n((await R.messageManager(e.name,i)).id)),children:`Start manager`})]})]})]})})}var Xm={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function Zm({chats:e,profiles:t,run:n,onStarted:r}){let i=B(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),_=a??e?.folder??``,y=p||e?.permissionMode||`auto`,x=()=>n(async()=>{g(!0);try{r((await R.startChat({...a?{folder:a}:{},...l.trim()?{model:l.trim()}:{},...d?{profile:d}:{},...p?{permissionMode:p}:{}})).id)}finally{g(!1)}});return(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`New chat`}),(0,V.jsx)(`div`,{className:`muted`,children:`A Claude Code session of your own, with no project, workflow or manager. It asks you directly.`})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsxs)(`div`,{className:`form`,children:[s?(0,V.jsx)(Km,{load:R.browse,reloadKey:`chat`,start:_||void 0,onPick:e=>{o(e),c(!1)},pickLabel:`Chat in this folder`}):(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsx)(`span`,{className:`mono`,children:_||`…`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>c(!0),children:`Change`})]}),(0,V.jsxs)(`label`,{children:[`Model `,(0,V.jsx)(`span`,{className:`muted`,children:`(empty: Claude Code's own default)`}),(0,V.jsx)(`input`,{...i,value:l,onChange:e=>u(e.target.value),placeholder:`opus, sonnet, haiku or a full model name`})]}),t.length>1&&(0,V.jsxs)(`label`,{children:[`Profile `,(0,V.jsx)(`span`,{className:`muted`,children:`(what it gets of your own plugins, MCP servers and tools)`}),(0,V.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`full: your whole setup`}),t.filter(e=>e!==`full`).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Permission mode `,(0,V.jsx)(`span`,{className:`muted`,children:`(changeable in the chat; what always goes to you is asked in every mode)`}),(0,V.jsx)(`select`,{value:y,onChange:e=>m(e.target.value),children:b.map(e=>(0,V.jsx)(`option`,{value:e,children:Xm[e]},e))})]})]}),(0,V.jsx)(`button`,{className:`primary`,disabled:h||s||!e,onClick:()=>void x(),children:h?`Starting…`:`Start chat`})]})]})}function Qm({view:e,chats:t,run:n,onOpen:r}){let i=Bp(im),a=Ep(wp(e)??{project:null,group:null},i),o=lm({commandPatterns:t?.sensitive.commandPatterns??[],pathPatterns:t?.sensitive.pathPatterns??[]},(e,t)=>JSON.stringify(e)!==JSON.stringify(t)),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>u(!1),3e3);return()=>clearTimeout(e)},[l]),!t)return(0,V.jsx)(`div`,{className:`page-body`,children:(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})});let d=[`commandPatterns`,`pathPatterns`].filter(e=>JSON.stringify(o.saved[e])!==JSON.stringify(o.value[e])).length,f=[...t.fromConfig.commandPatterns,...t.fromConfig.pathPatterns,...t.fromConfig.mcpTools],p=()=>n(async()=>{c(!0);try{let e=(await R.updateChats({...o.value,mcpTools:t.sensitive.mcpTools})).sensitive;o.done({commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns}),u(!0)}finally{c(!1)}});return(0,V.jsxs)(em,{groups:Cp,current:a,words:{safety:String(o.value.commandPatterns.length+o.value.pathPatterns.length)},marked:d?new Set([`safety`]):void 0,narrow:i,onOpen:e=>r(e===null?`chats`:Tp(null,e)),foot:(0,V.jsx)(nm,{count:d,saved:l,busy:s,note:`running chats keep theirs; new and resumed ones get these`,onSave:()=>void p(),onDiscard:o.discard}),children:[a===`general`&&(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`General`}),(0,V.jsx)($p,{kind:`config`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`Chats are sessions with no project. They ask you directly, and run on this computer. Both of these are set in Ledung's config ("chats"); each new chat can choose another.`}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Folder`}),`: `,(0,V.jsx)(`span`,{className:`mono`,children:t.folder})]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Permission mode`}),`: `,Xm[t.permissionMode]]})]}),a===`safety`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`What always goes to you`}),(0,V.jsxs)(`div`,{className:`safety`,children:[(0,V.jsx)(Um,{value:o.value,onChange:e=>{o.set(e),u(!1)},heading:!1}),f.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Also always asked, from Ledung's config: `,f.map((e,t)=>(0,V.jsxs)(v.Fragment,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e)),`.`]})]})]}),a===`look`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Look`}),(0,V.jsx)(`p`,{className:`muted`,children:`The chats' names in the sidebar and their headers. Saved at once, for every browser.`}),(0,V.jsx)(mp,{colour:t.colour,run:n})]})]})}function $m(e){return{text:[e.cut===`timeout`?`Cut off: it ran past its time limit (${Math.round(e.durationMs/1e3)} s), and it and everything it started were ended.`:e.cut===`stopped`?`Stopped: it and everything it started were ended.`:e.cut===`restart`?`Ended by Restart Ledung.`:`Exit code ${e.exitCode??`unknown`}.`,e.truncated?`The output was cut to its first part.`:null,`${e.shell} · ${e.cwd} · ${(e.durationMs/1e3).toFixed(1)} s.`,e.toClaude?`Claude gets it with your next message.`:`Claude did not get it.`].filter(Boolean).join(` `),problem:!!e.cut||e.exitCode!==0||!e.toClaude}}function eh(e){let t=e.trimStart();return t.startsWith(`!`)&&t.slice(1).trim()||null}function th(e){return`This matches ${e.replace(/^command matches /,``)}; run it?`}function nh(e,t){return`Runs ${t===`docker`?`in the project's container`:`in ${e}`} in the session's folder. The command and its output go to Claude as context, with no reply, and are kept in the history: don't print secrets.`}function rh(e){return e===`mcp__ledung__ask_user`}var ih=200;function ah(e){let t=e.trim();return t.length>0&&t.length<=ih&&!t.includes("```")&&!/\n\s*\n/.test(t)&&!/^\s*([-*+•]|\d+[.)])\s/m.test(t)}function oh(e){let t=new Set,n=-1,r=[],i=()=>{n>=0&&r.forEach(e=>t.add(e)),n=-1,r=[]};return e.forEach((e,t)=>{e.kind===`end`?i():e.kind===`tool`&&!e.sub?(n=rh(e.name)?t:-1,r=[]):e.kind===`text`&&!e.sub&&n>=0&&ah(e.text)&&r.push(t)}),i(),t}function sh(e){let t=e=>e>=1e4?`${Math.round(e/1e3)}k`:`${(e/1e3).toFixed(1)}k`;if(typeof e?.pre_tokens!=`number`||typeof e.post_tokens!=`number`)return`Compacted.`;let n=typeof e.duration_ms==`number`?` in ${Math.round(e.duration_ms/1e3)} s`:``;return`Compacted: ${t(e.pre_tokens)} → ${t(e.post_tokens)}${n}.`}function ch(e){return`Ledung kept only the start of this output (about ${e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`} more was cut). The full output is in Claude Code's own transcript of the session.`}function lh(e){let t=Number(e?.ledung_cut?.chars??0);return Number.isFinite(t)&&t>0?t:0}var uh=(e=>`Ledung has delivered messages for you. They are attached as context and are not from ${e}.`)(``).slice(0,-1);function dh(e){let t=e.split(`
|
|
61
|
+
`),lockdownDockerNetwork:e.lockdown.dockerNetwork??``}}function pm(e,t){return{name:e.name.trim(),...e.model.trim()?{model:e.model.trim()}:{},...e.managerModel.trim()?{managerModel:e.managerModel.trim()}:{},...e.permissionMode?{permissionMode:e.permissionMode}:{},...e.managerGrant.trim()?{managerGrant:e.managerGrant.trim()}:{},...e.projectToolsUnasked?{projectToolsUnasked:!0}:{},...e.projectSettingsTools?{projectSettingsTools:!0}:{},...e.publishUsageName?{publishUsageName:!0}:{},...e.usageRepo.trim()?{usageRepo:e.usageRepo.trim()}:{},...e.managerProfile||e.sessionProfile?{profiles:{...e.managerProfile?{manager:e.managerProfile}:{},...e.sessionProfile?{session:e.sessionProfile}:{}}}:{},...mm(e.skills)?{skills:e.skills}:{},sensitive:{commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns,mcpTools:t?.sensitive.mcpTools??[]},...e.devShipCommand.trim()?{devShipCommand:e.devShipCommand.trim()}:{},...e.ticketPattern.trim()&&e.ticketUrl.trim()?{tickets:{pattern:e.ticketPattern.trim(),url:e.ticketUrl.trim()}}:{},...gm(hm(e.questionTiers),te)||!hm(e.questionTiers).length?{}:{questionTiers:hm(e.questionTiers)},...hm(e.extraFolders).length?{extraFolders:hm(e.extraFolders)}:{},...e.account?{account:e.account}:{},...e.workflowUse!==null||e.workflowName||e.workflowConfig.trim()?{workflow:{...e.workflowUse===null?{}:{use:e.workflowUse},...e.workflowName?{name:e.workflowName}:{},...e.workflowConfig.trim()?{projectConfig:e.workflowConfig.trim()}:{}}}:{},...e.lockdownLevel===`off`?{}:{lockdown:{level:e.lockdownLevel,...e.lockdownBoard?{board:!0}:{},...e.lockdownRemoteControl?{remoteControl:!0}:{},...hm(e.lockdownNetwork).length?{network:hm(e.lockdownNetwork)}:{},...e.lockdownDockerNetwork.trim()?{dockerNetwork:e.lockdownDockerNetwork.trim()}:{}}}}}var mm=e=>Object.values(e).some(e=>e&&(e.newSkills||e.on?.length||e.off?.length)),hm=e=>[...new Set(e.split(`
|
|
62
|
+
`).map(e=>e.trim()).filter(Boolean))],gm=(e,t)=>e.length===t.length&&e.every((e,n)=>e===t[n]),_m=(e,t)=>e.workflowUse??!t;function vm(e,t,n){return t?{...e,workflowUse:n?!0:null,workflowName:t}:{...e,workflowUse:n?null:!1,workflowName:``}}var ym={name:`general`,account:`general`,model:`general`,managerModel:`general`,permissionMode:`general`,extraFolders:`general`,publishUsageName:`general`,usageRepo:`general`,commandPatterns:`safety`,pathPatterns:`safety`,managerGrant:`powers`,projectToolsUnasked:`powers`,projectSettingsTools:`powers`,devShipCommand:`powers`,lockdownLevel:`powers`,lockdownBoard:`powers`,lockdownRemoteControl:`powers`,lockdownNetwork:`powers`,lockdownDockerNetwork:`powers`,skills:`skills`,managerProfile:`skills`,sessionProfile:`skills`,workflowUse:`workflow`,workflowName:`workflow`,workflowConfig:`workflow`,ticketPattern:`tickets`,ticketUrl:`tickets`,questionTiers:`tickets`},bm=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function xm(e,t){return Object.keys(ym).filter(n=>!bm(e[n],t[n]))}function Sm(e,t){return e===``||typeof e==`object`&&!mm(e)?{follows:!0,text:`Ledung default: ${t}`}:{follows:!1,text:`Overrides Ledung (${t})`}}var Cm={account:``,model:``,managerModel:``,permissionMode:``,skills:{},managerProfile:``,sessionProfile:``};function wm(e,t){let n=e?.groups.find(e=>e.workflow===t)??e?.groups.find(e=>e.workflow===null);return{manager:n?.defaults.manager??`full`,session:n?.defaults.session??`full`}}var Tm={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function Em({name:e,hint:t,line:n,children:r}){let i=(0,v.useId)();return(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsxs)(`label`,{htmlFor:i,children:[(0,V.jsx)(`span`,{className:`field-name`,children:e}),t&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`muted`,children:t})]})]}),n,r(i)]})}function Dm(e,t,n){if(!e.defaults)return null;let r=Sm(e.value[t],n);return(0,V.jsx)(im,{follows:r.follows,text:r.text,onReset:()=>e.onChange({...e.value,[t]:Cm[t]})})}var Om=(e,t)=>n=>e.onChange({...e.value,[t]:n.target.value});function km(e){let t=B();return(0,V.jsx)(Em,{name:`Name`,children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.name,onChange:Om(e,`name`),maxLength:48,placeholder:`e.g. Website`})})}function Am(e){return(0,V.jsx)(Em,{name:`Claude account`,hint:`(for its manager and all its sessions)`,line:Dm(e,`account`,`this computer's own login`),children:t=>(0,V.jsxs)(`select`,{id:t,value:e.value.account,onChange:Om(e,`account`),children:[(0,V.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(t=>(0,V.jsxs)(`option`,{value:t.name,disabled:e.container&&t.kind===`folder`,children:[t.name,t.email?` (${t.email})`:``,e.container&&t.kind===`folder`?` — login folders work only on this computer`:``]},t.name))]})})}function jm(e){let t=B();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Em,{name:`Model`,hint:`(empty: from the project's Claude settings, else Claude Code's default)`,line:Dm(e,`model`,`the project's Claude settings, else Claude Code's`),children:n=>(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`input`,{id:n,...t,value:e.value.model,onChange:Om(e,`model`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`}),(0,V.jsxs)(`datalist`,{id:`ledung-models`,children:[(0,V.jsx)(`option`,{value:`opus`}),(0,V.jsx)(`option`,{value:`sonnet`}),(0,V.jsx)(`option`,{value:`haiku`})]})]})}),(0,V.jsx)(Em,{name:`Model for its manager`,hint:`(empty: the same as its sessions)`,line:Dm(e,`managerModel`,`the same as its sessions`),children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.managerModel,onChange:Om(e,`managerModel`),list:`ledung-models`,placeholder:`opus, sonnet, haiku or a full model name`})})]})}function Mm(e){return(0,V.jsx)(Em,{name:`Permissions for new sessions`,line:Dm(e,`permissionMode`,`Ask`),children:t=>(0,V.jsxs)(`select`,{id:t,value:e.value.permissionMode,onChange:Om(e,`permissionMode`),children:[(0,V.jsx)(`option`,{value:``,children:`Ask (default)`}),b.filter(e=>e!=="default").map(e=>(0,V.jsx)(`option`,{value:e,children:Tm[e]},e))]})})}function Nm(e){let t=B();return(0,V.jsx)(Em,{name:`Extra folders`,hint:`(full paths, one per line: besides the project folder and folders inside it, its manager may start sessions in folders under these, such as where its git worktrees go. Empty: none)`,children:n=>(0,V.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.extraFolders,onChange:Om(e,`extraFolders`),className:`mono`})})}function Pm(e){let t=B();return(0,V.jsx)(Em,{name:`What the manager may decide for you`,hint:`(empty: it asks you about everything)`,children:n=>(0,V.jsx)(`textarea`,{id:n,...t,rows:2,value:e.value.managerGrant,onChange:Om(e,`managerGrant`),placeholder:`e.g. Ordinary development decisions: code structure, naming, which tests to add.`})})}function Fm(e){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.value.projectToolsUnasked,onChange:t=>e.onChange({...e.value,projectToolsUnasked:t.target.checked})}),` `,(0,V.jsx)(`span`,{className:`field-name`,children:`Its manager adds projects and starts or stops other managers without asking you`})]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.value.projectSettingsTools,onChange:t=>e.onChange({...e.value,projectSettingsTools:t.target.checked})}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Its manager reads and changes workflow settings of your projects`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(not locked ones; a new grant, a new dev ship command or a sensitive pattern removed still asks you)`})]})]})]})}function Im(e){let t=B();return(0,V.jsx)(Em,{name:`Dev ship command`,hint:`(a pattern the whole command must match, e.g. npm run ship:dev; while you're away and allow dev ship, the manager may run it. Empty: never)`,children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.devShipCommand,onChange:Om(e,`devShipCommand`),className:`mono`})})}function Lm(e){let t=e.role===`manager`?`managerProfile`:`sessionProfile`,n=e.value[t],r=n&&!e.profiles.includes(n)?[...e.profiles,n]:e.profiles;return(0,V.jsx)(Em,{name:e.role===`manager`?`Profile for its manager`:`Profile for its sessions`,hint:`(what it gets of your own plugins, MCP servers and tools; Ledung's tools always stay)`,line:e.defaults&&Dm(e,t,e.defaults.profiles[e.role]),children:i=>(0,V.jsxs)(`select`,{id:i,value:n,onChange:Om(e,t),children:[(0,V.jsx)(`option`,{value:``,children:`default (from the config)`}),r.map(t=>(0,V.jsxs)(`option`,{value:t,children:[t,e.profiles.includes(t)?``:` — not in the config`]},t))]})})}function Rm(e){let{list:t,error:n}=lp(e.project);return(0,V.jsxs)(`div`,{className:`field`,children:[e.defaults&&Dm(e,`skills`,`Settings → Sessions → Skills${t?`, ${dp(t,{},t.defaults)}`:``}`),(0,V.jsxs)(`details`,{className:`skills-choice`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Skills`}),t?`: ${dp(t,e.value.skills,t.defaults)}`:``,` `,(0,V.jsx)(`span`,{className:`muted`,children:`(which of your own skills its manager and sessions get; unchosen ones follow Settings)`})]}),(0,V.jsx)(up,{list:t,error:n,value:e.value.skills,onChange:t=>e.onChange({...e.value,skills:t}),defaults:t?.defaults??{}})]})]})}function zm(e,t,n){let[r,i]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let r=!0;return R.workflowCheck(e,t.trim()||void 0,n||void 0).then(e=>{r&&i(e)},()=>{}),()=>{r=!1}},[e,t,n]),r}function Bm({check:e,settings:t,container:n}){return!e?.on||!_m(t,n)||e.exists!==!1?null:(0,V.jsxs)(`p`,{className:`banner`,children:[`This project has no `,(0,V.jsx)(`span`,{className:`mono`,children:e.projectConfig}),`. Its sessions will follow the process but stop where it needs the project's settings. Write that file, or choose None as its workflow.`]})}function Vm(e){let t=B(),{workflow:n,container:r}=e;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Em,{name:`Workflow`,hint:`(its sessions are told to read the process first)`,children:t=>(0,V.jsxs)(`select`,{id:t,value:_m(e.value,r)?e.value.workflowName||n.workflows[0]:``,onChange:t=>e.onChange(vm(e.value,t.target.value,r)),children:[(0,V.jsx)(`option`,{value:``,children:`None`}),n.workflows.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e)),e.value.workflowName&&!n.workflows.includes(e.value.workflowName)&&(0,V.jsxs)(`option`,{value:e.value.workflowName,children:[e.value.workflowName,` (not in the config)`]})]})}),_m(e.value,r)&&n.on&&(0,V.jsx)(Em,{name:`Project config for the workflow`,hint:`(inside the project folder; empty: ${n.projectConfig})`,children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.workflowConfig,onChange:Om(e,`workflowConfig`),className:`mono`})})]})}function Hm(e){let t=B();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Em,{name:`Ticket pattern`,hint:`(e.g. [A-Z]+-\\d+)`,children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.ticketPattern,onChange:Om(e,`ticketPattern`),className:`mono`})}),(0,V.jsx)(Em,{name:`Ticket link`,hint:`({id} is replaced by the ticket)`,children:n=>(0,V.jsx)(`input`,{id:n,...t,value:e.value.ticketUrl,onChange:Om(e,`ticketUrl`),className:`mono`,placeholder:`https://tracker.example/browse/{id}`})})]})}function Um(e){let t=B();return(0,V.jsx)(Em,{name:`Question tiers`,hint:`(one per line, first first: every question gives one, and Waiting for you groups them in this order. Never empty: clearing it brings back the five standard ones)`,children:n=>(0,V.jsx)(`textarea`,{id:n,...t,rows:5,value:e.value.questionTiers,onChange:Om(e,`questionTiers`),onBlur:()=>{hm(e.value.questionTiers).length||e.onChange({...e.value,questionTiers:te.join(`
|
|
63
|
+
`)})}})})}function Wm({value:e,onChange:t,heading:n=!0}){let r=B(),[i,a]=(0,v.useState)(`command`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),u=[...e.commandPatterns.map(e=>({kind:`command`,pattern:e})),...e.pathPatterns.map(e=>({kind:`path`,pattern:e}))],d=j(e.commandPatterns,e.pathPatterns),f=n=>t({...e,commandPatterns:n.kind===`command`?e.commandPatterns.filter(e=>e!==n.pattern):e.commandPatterns,pathPatterns:n.kind===`path`?e.pathPatterns.filter(e=>e!==n.pattern):e.pathPatterns}),p=()=>{let n=o.trim();if(n){try{new RegExp(n,`i`)}catch(e){l(`Not a valid regular expression: ${e.message}`);return}l(null),s(``),t(i===`command`?{...e,commandPatterns:e.commandPatterns.includes(n)?e.commandPatterns:[...e.commandPatterns,n]}:{...e,pathPatterns:e.pathPatterns.includes(n)?e.pathPatterns:[...e.pathPatterns,n]})}};return(0,V.jsxs)(`div`,{className:`sensitive-list`,children:[(0,V.jsx)(`p`,{children:n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`strong`,{children:`Always goes to you`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(no session, manager or "for this session" permission can allow these; you decide each time, in every permission mode)`})]}):(0,V.jsx)(`span`,{className:`muted`,children:`No session, manager or "for this session" permission can allow these; you decide each time, in every permission mode.`})}),u.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`Nothing is sensitive here; every action is decided by the permission mode and the manager.`}),(0,V.jsx)(`ul`,{children:u.map(e=>{let t=A(e.pattern,e.kind);return(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`span`,{className:`sensitive-entry`,children:[(0,V.jsx)(`span`,{children:t??(e.kind===`command`?`Commands matching`:`Files matching`)}),(0,V.jsx)(`code`,{className:t?`muted`:void 0,children:e.pattern})]}),(0,V.jsx)(`button`,{type:`button`,className:`small deny`,onClick:()=>f(e),"aria-label":`Delete: ${t??e.pattern}`,children:`Delete`})]},e.kind+e.pattern)})}),d.length>0&&(0,V.jsx)(`p`,{children:(0,V.jsxs)(`button`,{type:`button`,className:`small`,onClick:()=>t(M(e)),children:[`Add suggested (`,d.length,` of `,ee.length,` not in the list)`]})}),(0,V.jsxs)(`div`,{className:`sensitive-add`,children:[(0,V.jsxs)(`select`,{value:i,onChange:e=>a(e.target.value),"aria-label":`What the pattern is matched against`,children:[(0,V.jsx)(`option`,{value:`command`,children:`A command`}),(0,V.jsx)(`option`,{value:`path`,children:`A file path`})]}),(0,V.jsx)(`input`,{...r,className:`mono`,value:o,placeholder:`regular expression, e.g. \\bmigrate:prod\\b`,onChange:e=>{s(e.target.value),l(null)},onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),p())}}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:p,disabled:!o.trim(),children:`Add`})]}),c&&(0,V.jsx)(`p`,{className:`error`,children:c})]})}function Gm({value:e,onChange:t,accounts:n,profiles:r,container:i,workflow:a,lockdownB:o}){let s={value:e,onChange:t};return(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(km,{...s}),(0,V.jsx)(Am,{...s,accounts:n,container:i}),(0,V.jsx)(jm,{...s}),(0,V.jsx)(Mm,{...s}),(0,V.jsx)(Pm,{...s}),(0,V.jsx)(Fm,{...s}),(0,V.jsx)(Bf,{value:e,onChange:t}),(0,V.jsx)(Km,{value:e,onChange:t,levelB:o,container:i}),(0,V.jsx)(Lm,{...s,role:`manager`,profiles:r}),(0,V.jsx)(Lm,{...s,role:`session`,profiles:r}),(0,V.jsx)(Rm,{...s,project:void 0}),!!a?.workflows.length&&(0,V.jsx)(Vm,{...s,workflow:a,container:!!i}),(0,V.jsxs)(`details`,{children:[(0,V.jsxs)(`summary`,{children:[`More: actions that always go to you, tickets, question tiers`,i?``:` and extra folders`]}),(0,V.jsx)(Wm,{value:e,onChange:t}),(0,V.jsx)(Im,{...s}),(0,V.jsx)(Hm,{...s}),(0,V.jsx)(Um,{...s}),!i&&(0,V.jsx)(Nm,{...s})]})]})}function Km({value:e,onChange:t,levelB:n,container:r}){let i=B(),a=e.lockdownLevel!==`off`,o=e.lockdownLevel===`B`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Lockdown`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`(walls the project off from other projects' managers and sessions; only you can turn it off or down again)`}),(0,V.jsxs)(`select`,{value:e.lockdownLevel,onChange:n=>t({...e,lockdownLevel:n.target.value}),children:[(0,V.jsx)(`option`,{value:`off`,children:`Off (default): managers and sessions reach it as usual`}),(0,V.jsx)(`option`,{value:`A`,children:`Level A: nothing reaches in; it may still reach out`}),(0,V.jsxs)(`option`,{value:`B`,disabled:!!n&&!o,children:[`Level B, nearly air-gapped: nothing reaches in or out`,n?`: not available here`:``]})]})]}),n&&(0,V.jsx)(`p`,{className:`muted`,children:n}),a&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Other projects' managers see only its name: they can't message it (except, at level A, to answer each of its messages once), start or stop its manager, or use its folders. While a project is locked, every other session on this computer is kept out of its folders: file tools on every system, and shell commands run in Claude Code's sandbox on macOS and Linux (not on Windows, where only the file tools are stopped). Running sessions take it when Ledung restarts them, which it does as soon as each is free; their conversations are kept.`}),o&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Level B also closes the way out. Its manager has no tools for other managers, other projects or the board. Its sessions get none of your MCP servers, plugins, connectors or own settings, no web tools, and can't read outside their folders.`,r?` Its container is checked before every start: only the project folder mounted, no Docker socket, and only the network you mark below.`:` Their shell commands run in the sandbox with no network but the hosts below.`,` `,`Only what Claude Code and a shell need of Ledung's environment is passed on.`]}),!o&&(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.lockdownBoard,onChange:n=>t({...e,lockdownBoard:n.target.checked})}),` `,`Keep the message board on for it`]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.lockdownRemoteControl,onChange:n=>t({...e,lockdownRemoteControl:n.target.checked})}),` `,`Keep Remote Control for its manager`]}),o&&!r&&(0,V.jsxs)(`label`,{children:[`Hosts its shell commands may reach `,(0,V.jsx)(`span`,{className:`muted`,children:`(one per line, such as registry.npmjs.org or *.example.com; empty: no network)`}),(0,V.jsx)(`textarea`,{...i,rows:3,value:e.lockdownNetwork,onChange:n=>t({...e,lockdownNetwork:n.target.value})})]}),o&&r&&(0,V.jsxs)(`label`,{children:[`Its island network `,(0,V.jsx)(`span`,{className:`muted`,children:`(the Docker network its container may be on; mark it only once it reaches nothing but what the project may)`}),(0,V.jsx)(`input`,{...i,value:e.lockdownDockerNetwork,onChange:n=>t({...e,lockdownDockerNetwork:n.target.value})})]})]})]})}function qm(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(!1),s=t=>{i(null),o(!0),e.load(t).then(n,e=>i(e.message)).finally(()=>o(!1))};return(0,v.useEffect)(()=>s(e.start),[e.reloadKey,e.start]),(0,V.jsxs)(`div`,{className:`browser`,children:[r&&(0,V.jsx)(`p`,{className:`error`,children:r}),a&&(0,V.jsx)(`p`,{className:`muted`,children:`Loading folders…`}),t&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`browser-head`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:!t.parent,onClick:()=>s(t.parent??void 0),title:`One folder up`,children:`↑ Up`}),(0,V.jsx)(`span`,{className:`mono browser-path`,children:t.path})]}),t.roots.length>1&&(0,V.jsx)(`div`,{className:`browser-roots`,children:t.roots.map(e=>(0,V.jsx)(`button`,{className:`small`,onClick:()=>s(e),children:e},e))}),(0,V.jsxs)(`ul`,{className:`browser-list`,children:[!t.entries.length&&(0,V.jsx)(`li`,{className:`muted`,children:`No folders here.`}),t.entries.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsxs)(`button`,{className:`link`,onClick:()=>s(e.path),children:[`📁 `,e.name]}),e.git!==null&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · git`,e.git?` · ${e.git}`:``]}),e.project&&(0,V.jsxs)(`span`,{className:`chip`,children:[`project `,e.project]})]},e.path))]}),(0,V.jsx)(`div`,{className:`browser-foot`,children:(0,V.jsx)(`button`,{className:`primary`,onClick:()=>e.onPick(t.path),children:e.pickLabel})})]})]})}function Jm({run:e,onAdded:t,accounts:n,defaultAccount:r,profiles:i,lockdownB:a}){let o=B(),[s,c]=(0,v.useState)(`local`),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(null),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(``),[S,C]=(0,v.useState)(()=>({...dm(),account:r??``})),w=(0,v.useRef)(r??``);(0,v.useEffect)(()=>{let e=w.current,t=r??``;w.current=t,C(n=>n.account===e?{...n,account:t}:n)},[r]);let[T,E]=(0,v.useState)(null),[D,O]=(0,v.useState)(!1),[k,ee]=(0,v.useState)(!1),[A,j]=(0,v.useState)(``),[M,te]=(0,v.useState)(null),[N,P]=(0,v.useState)(!1),ne=zm(s===`local`&&l?l:void 0,S.workflowConfig,S.workflowName),re=ne&&s!==`local`?{...ne,exists:s!==`new`&&null}:ne,ie=()=>{m(null),g(!0),R.containers().then(f,e=>m(e.message)).finally(()=>g(!1))};(0,v.useEffect)(()=>{u(null),te(null),s===`docker`&&ie(),s===`docker`&&n.find(e=>e.name===S.account)?.kind===`folder`&&C(e=>({...e,account:``})),s===`new`&&!T&&R.projectsFolder().then(e=>E(e.path),()=>{})},[s]);let ae=e=>{u(e);let t=e.split(/[\\/]/).filter(Boolean).pop()??``;S.name||C({...S,name:t.replace(/[^A-Za-z0-9 ._-]/g,``).slice(0,48)})},oe=()=>e(async()=>{P(!0);let e=ne?.workflows[0],n=e&&!S.workflowName&&_m(S,s===`docker`)?{...S,workflowName:e}:S;try{if(s===`new`){let e=await R.createProject({parent:T??void 0,github:k,task:A.trim()||void 0,settings:pm(n,null)});e.warning&&te(e.warning),t(e.project)}else t(s===`local`?await R.addProject({...pm(n,null),runner:`local`,path:l}):await R.addProject({...pm(n,null),runner:`docker`,container:_,pathInContainer:l,...b?{user:b}:{}}))}finally{P(!1)}}),se=S.name.trim()&&(s===`new`||l);return(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Add a project`}),(0,V.jsx)(`div`,{className:`muted`,children:`A project is a folder where Claude Code works, with its settings and one manager.`})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsxs)(`div`,{className:`segmented`,role:`tablist`,children:[(0,V.jsx)(`button`,{className:s===`local`?`on`:``,onClick:()=>c(`local`),children:`Folder on this computer`}),(0,V.jsx)(`button`,{className:s===`docker`?`on`:``,onClick:()=>c(`docker`),children:`Folder in a container`}),(0,V.jsx)(`button`,{className:s===`new`?`on`:``,onClick:()=>c(`new`),children:`New project`})]}),s===`local`&&(l?(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsx)(`span`,{className:`mono`,children:l}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,V.jsx)(qm,{load:R.browse,reloadKey:`local`,onPick:ae,pickLabel:`Use this folder`})),s===`docker`&&(0,V.jsxs)(V.Fragment,{children:[p&&(0,V.jsx)(`p`,{className:`error`,children:p}),h&&(0,V.jsx)(`p`,{className:`muted`,children:`Looking for running containers…`}),!h&&(d||p)&&(0,V.jsx)(`p`,{children:(0,V.jsx)(`button`,{className:`small`,onClick:ie,children:`Refresh containers`})}),d&&!d.length&&(0,V.jsx)(`p`,{className:`muted`,children:`No containers are running. Start the container first.`}),d&&d.length>0&&(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Container`,(0,V.jsxs)(`select`,{value:_,onChange:e=>{y(e.target.value),x(d.find(t=>t.name===e.target.value)?.user??``),u(null)},children:[(0,V.jsx)(`option`,{value:``,children:`Choose a running container`}),d.map(e=>(0,V.jsxs)(`option`,{value:e.name,children:[e.name,` (`,e.image,`)`]},e.name))]})]}),(0,V.jsxs)(`label`,{children:[`Run as user `,(0,V.jsx)(`span`,{className:`muted`,children:`(empty: the container's default)`}),(0,V.jsx)(`input`,{...o,value:b,onChange:e=>x(e.target.value)})]})]}),_&&(l?(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsxs)(`span`,{className:`mono`,children:[_,`:`,l]}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>u(null),children:`Change`})]}):(0,V.jsx)(qm,{load:e=>R.browseContainer(_,b,e),reloadKey:`${_}|${b}`,onPick:ae,pickLabel:`Use this folder`}))]}),s===`new`&&(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Ledung creates a folder named after the project, with a git repository.`}),D?(0,V.jsx)(qm,{load:R.browse,reloadKey:`parent`,start:T??void 0,onPick:e=>{E(e),O(!1)},pickLabel:`Create it in this folder`}):(0,V.jsxs)(`p`,{children:[`In: `,(0,V.jsx)(`span`,{className:`mono`,children:T??`…`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>O(!0),children:`Change`})]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:k,onChange:e=>ee(e.target.checked)}),` Create a private GitHub repository too`]}),(0,V.jsxs)(`label`,{children:[`What is the project for? `,(0,V.jsx)(`span`,{className:`muted`,children:`(optional: given to its manager as its first task)`}),(0,V.jsx)(`textarea`,{...o,rows:3,value:A,onChange:e=>j(e.target.value)})]})]}),(s===`new`||l)&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Settings`}),(0,V.jsx)(Gm,{value:S,onChange:C,accounts:n,profiles:i,container:s===`docker`,workflow:ne,lockdownB:a}),(0,V.jsx)(Bm,{check:re,settings:S,container:s===`docker`}),(0,V.jsx)(`button`,{className:`primary`,disabled:!se||N,onClick:()=>void oe(),children:N?`Adding…`:s===`new`?`Create project`:`Add project`})]}),M&&(0,V.jsx)(`p`,{className:`banner`,children:M})]})]})}function Ym({view:e,project:t,projects:n,run:r,onOpen:i,onRemoved:a,onRenamed:o,accounts:s,profiles:c,board:l,lockdownB:u}){let d=Vp(am),f=Dp(Tp(e)??{project:t.name,group:null},d),p=um(fm(t),(e,t)=>xm(e,t).length>0),m=um(On(l,t.name),(e,t)=>An(t,e)>0),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(C,()=>{})},[]),(0,v.useEffect)(()=>{if(!_)return;let e=setTimeout(()=>y(!1),3e3);return()=>clearTimeout(e)},[_]);let w=p.value,T=t.runner===`docker`,E=zm(t.runner===`local`?t.path:void 0,w.workflowConfig,w.workflowName),D={value:w,onChange:e=>{p.set(e),y(!1)},defaults:{profiles:wm(S,E?.on&&_m(w,T)&&(w.workflowName||E.workflows[0])||null)}},O=xm(p.saved,w),k=An(m.value,m.saved),ee=O.length+k,A=new Set(O.map(e=>ym[e]));k&&A.add(`board`);let j=w.name.trim()!==t.name,M={safety:String(w.commandPatterns.length+w.pathPatterns.length),powers:w.lockdownLevel===`off`?``:`lockdown ${w.lockdownLevel}`,board:m.saved.enabled?``:`off`},te=()=>r(async()=>{g(!0);try{if(k&&(await Mn(t.name,m.value),m.done(m.value)),O.length&&j){let e=(await R.renameProject(t.name,w.name.trim(),pm(w,t))).name;Wf(localStorage,t.name,e),o(f?Ep(e,f):`ps:${e}`);return}O.length&&p.done(fm(await R.updateProject(t.name,pm(w,t)))),y(!0)}finally{g(!1)}}),N=()=>{p.discard(),m.discard()},P=(k?jn(m.value):null)??(w.name.trim()?null:`The project needs a name.`);return(0,V.jsxs)(tm,{groups:Cp,current:f,words:M,marked:A,narrow:d,onOpen:e=>i(e===null?`ps:${t.name}`:Ep(t.name,e)),foot:(0,V.jsx)(rm,{count:ee,saved:_,busy:h,note:j?`saving renames the project; its sessions, manager and questions stay with it, and its folder is not moved`:`running sessions keep theirs; new and resumed ones get these`,disabled:P,onSave:()=>void te(),onDiscard:N}),children:[f===`general`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`General`}),(0,V.jsx)(`p`,{className:`muted mono tab-where`,children:t.where}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(km,{...D}),(0,V.jsx)(Am,{...D,accounts:s,container:T}),(0,V.jsx)(jm,{...D}),(0,V.jsx)(Mm,{...D}),!T&&(0,V.jsx)(Nm,{...D}),(0,V.jsx)(Bf,{value:w,onChange:D.onChange})]})]}),f===`safety`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`What always goes to you`}),(0,V.jsx)(`div`,{className:`safety`,children:(0,V.jsx)(Wm,{value:w,onChange:D.onChange,heading:!1})})]}),f===`powers`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Manager's powers`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Pm,{...D}),(0,V.jsx)(Fm,{...D}),(0,V.jsx)(Im,{...D}),(0,V.jsx)(Km,{value:w,onChange:D.onChange,levelB:u,container:T})]})]}),f===`skills`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Skills & profiles`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Rm,{...D,project:t.name}),(0,V.jsx)(Lm,{...D,role:`manager`,profiles:c}),(0,V.jsx)(Lm,{...D,role:`session`,profiles:c})]})]}),f===`look`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Look`}),(0,V.jsx)(`p`,{className:`muted`,children:`The names of its manager and its sessions in the sidebar and their headers. Saved at once, for every browser.`}),(0,V.jsx)(mp,{project:t,run:r})]}),f===`workflow`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Workflow`}),E?.workflows.length?(0,V.jsx)(`div`,{className:`form`,children:(0,V.jsx)(Vm,{...D,workflow:E,container:T})}):(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Workflow`}),`: `,(0,V.jsx)(`span`,{className:`muted`,children:E?`none is configured in Ledung's config ("workflow" or "workflows").`:`looking…`})]}),t.runner===`local`&&(0,V.jsx)(Bm,{check:E,settings:w,container:!1})]}),f===`tickets`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Tickets & questions`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsx)(Hm,{...D}),(0,V.jsx)(Um,{...D})]})]}),f===`board`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Message board`}),(0,V.jsx)(Nn,{board:l,project:t.name,projects:n,form:m.value,onChange:e=>{m.set(e),y(!1)}})]}),f===`remove`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Remove project`}),(0,V.jsx)(`p`,{className:`muted`,children:`Takes the project off the list and stops its sessions. Their history stays, and the folder is not touched.`}),b?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsxs)(`button`,{className:`small primary`,onClick:()=>void r(async()=>{await R.removeProject(t.name),a()}),children:[`Remove `,t.name]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>x(!1),children:`Cancel`})]}):(0,V.jsx)(`button`,{onClick:()=>x(!0),children:`Remove project…`})]})]})}function Xm({project:e,run:t,onStarted:n}){let r=B(),[i,a]=(0,v.useState)(``);return(0,V.jsx)(ep,{level:Jf(e),fill:!0,children:(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:e.name}),(0,V.jsx)(`div`,{className:`muted mono`,children:e.where})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsx)(`p`,{children:`This project's manager hasn't started yet. Write to it and it starts: give it a task, or ask where things stand.`}),(0,V.jsxs)(`div`,{className:`composer`,children:[(0,V.jsx)(`textarea`,{...r,rows:4,value:i,onChange:e=>a(e.target.value),placeholder:`Message the manager of ${e.name}`}),(0,V.jsx)(`button`,{className:`primary`,disabled:!i.trim(),onClick:()=>void t(async()=>n((await R.messageManager(e.name,i)).id)),children:`Start manager`})]})]})]})})}var Zm={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`};function Qm({chats:e,profiles:t,run:n,onStarted:r}){let i=B(),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(``),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),_=a??e?.folder??``,y=p||e?.permissionMode||`auto`,x=()=>n(async()=>{g(!0);try{r((await R.startChat({...a?{folder:a}:{},...l.trim()?{model:l.trim()}:{},...d?{profile:d}:{},...p?{permissionMode:p}:{}})).id)}finally{g(!1)}});return(0,V.jsxs)(`div`,{className:`page-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`New chat`}),(0,V.jsx)(`div`,{className:`muted`,children:`A Claude Code session of your own, with no project, workflow or manager. It asks you directly.`})]})}),(0,V.jsxs)(`div`,{className:`page-body`,children:[(0,V.jsxs)(`div`,{className:`form`,children:[s?(0,V.jsx)(qm,{load:R.browse,reloadKey:`chat`,start:_||void 0,onPick:e=>{o(e),c(!1)},pickLabel:`Chat in this folder`}):(0,V.jsxs)(`p`,{children:[`Folder: `,(0,V.jsx)(`span`,{className:`mono`,children:_||`…`}),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>c(!0),children:`Change`})]}),(0,V.jsxs)(`label`,{children:[`Model `,(0,V.jsx)(`span`,{className:`muted`,children:`(empty: Claude Code's own default)`}),(0,V.jsx)(`input`,{...i,value:l,onChange:e=>u(e.target.value),placeholder:`opus, sonnet, haiku or a full model name`})]}),t.length>1&&(0,V.jsxs)(`label`,{children:[`Profile `,(0,V.jsx)(`span`,{className:`muted`,children:`(what it gets of your own plugins, MCP servers and tools)`}),(0,V.jsxs)(`select`,{value:d,onChange:e=>f(e.target.value),children:[(0,V.jsx)(`option`,{value:``,children:`full: your whole setup`}),t.filter(e=>e!==`full`).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Permission mode `,(0,V.jsx)(`span`,{className:`muted`,children:`(changeable in the chat; what always goes to you is asked in every mode)`}),(0,V.jsx)(`select`,{value:y,onChange:e=>m(e.target.value),children:b.map(e=>(0,V.jsx)(`option`,{value:e,children:Zm[e]},e))})]})]}),(0,V.jsx)(`button`,{className:`primary`,disabled:h||s||!e,onClick:()=>void x(),children:h?`Starting…`:`Start chat`})]})]})}function $m({view:e,chats:t,run:n,onOpen:r}){let i=Vp(am),a=Dp(Tp(e)??{project:null,group:null},i),o=um({commandPatterns:t?.sensitive.commandPatterns??[],pathPatterns:t?.sensitive.pathPatterns??[]},(e,t)=>JSON.stringify(e)!==JSON.stringify(t)),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1);if((0,v.useEffect)(()=>{if(!l)return;let e=setTimeout(()=>u(!1),3e3);return()=>clearTimeout(e)},[l]),!t)return(0,V.jsx)(`div`,{className:`page-body`,children:(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})});let d=[`commandPatterns`,`pathPatterns`].filter(e=>JSON.stringify(o.saved[e])!==JSON.stringify(o.value[e])).length,f=[...t.fromConfig.commandPatterns,...t.fromConfig.pathPatterns,...t.fromConfig.mcpTools],p=()=>n(async()=>{c(!0);try{let e=(await R.updateChats({...o.value,mcpTools:t.sensitive.mcpTools})).sensitive;o.done({commandPatterns:e.commandPatterns,pathPatterns:e.pathPatterns}),u(!0)}finally{c(!1)}});return(0,V.jsxs)(tm,{groups:wp,current:a,words:{safety:String(o.value.commandPatterns.length+o.value.pathPatterns.length)},marked:d?new Set([`safety`]):void 0,narrow:i,onOpen:e=>r(e===null?`chats`:Ep(null,e)),foot:(0,V.jsx)(rm,{count:d,saved:l,busy:s,note:`running chats keep theirs; new and resumed ones get these`,onSave:()=>void p(),onDiscard:o.discard}),children:[a===`general`&&(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`General`}),(0,V.jsx)(em,{kind:`config`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`Chats are sessions with no project. They ask you directly, and run on this computer. Both of these are set in Ledung's config ("chats"); each new chat can choose another.`}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Folder`}),`: `,(0,V.jsx)(`span`,{className:`mono`,children:t.folder})]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`span`,{className:`field-name`,children:`Permission mode`}),`: `,Zm[t.permissionMode]]})]}),a===`safety`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`What always goes to you`}),(0,V.jsxs)(`div`,{className:`safety`,children:[(0,V.jsx)(Wm,{value:o.value,onChange:e=>{o.set(e),u(!1)},heading:!1}),f.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Also always asked, from Ledung's config: `,f.map((e,t)=>(0,V.jsxs)(v.Fragment,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e)),`.`]})]})]}),a===`look`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Look`}),(0,V.jsx)(`p`,{className:`muted`,children:`The chats' names in the sidebar and their headers. Saved at once, for every browser.`}),(0,V.jsx)(hp,{colour:t.colour,run:n})]})]})}function eh(e){return{text:[e.cut===`timeout`?`Cut off: it ran past its time limit (${Math.round(e.durationMs/1e3)} s), and it and everything it started were ended.`:e.cut===`stopped`?`Stopped: it and everything it started were ended.`:e.cut===`restart`?`Ended by Restart Ledung.`:`Exit code ${e.exitCode??`unknown`}.`,e.truncated?`The output was cut to its first part.`:null,`${e.shell} · ${e.cwd} · ${(e.durationMs/1e3).toFixed(1)} s.`,e.toClaude?`Claude gets it with your next message.`:`Claude did not get it.`].filter(Boolean).join(` `),problem:!!e.cut||e.exitCode!==0||!e.toClaude}}function th(e){let t=e.trimStart();return t.startsWith(`!`)&&t.slice(1).trim()||null}function nh(e){return`This matches ${e.replace(/^command matches /,``)}; run it?`}function rh(e,t){return`Runs ${t===`docker`?`in the project's container`:`in ${e}`} in the session's folder. The command and its output go to Claude as context, with no reply, and are kept in the history: don't print secrets.`}function ih(e){return e===`mcp__ledung__ask_user`}var ah=200;function oh(e){let t=e.trim();return t.length>0&&t.length<=ah&&!t.includes("```")&&!/\n\s*\n/.test(t)&&!/^\s*([-*+•]|\d+[.)])\s/m.test(t)}function sh(e){let t=new Set,n=-1,r=[],i=()=>{n>=0&&r.forEach(e=>t.add(e)),n=-1,r=[]};return e.forEach((e,t)=>{e.kind===`end`?i():e.kind===`tool`&&!e.sub?(n=ih(e.name)?t:-1,r=[]):e.kind===`text`&&!e.sub&&n>=0&&oh(e.text)&&r.push(t)}),i(),t}function ch(e){let t=e=>e>=1e4?`${Math.round(e/1e3)}k`:`${(e/1e3).toFixed(1)}k`;if(typeof e?.pre_tokens!=`number`||typeof e.post_tokens!=`number`)return`Compacted.`;let n=typeof e.duration_ms==`number`?` in ${Math.round(e.duration_ms/1e3)} s`:``;return`Compacted: ${t(e.pre_tokens)} → ${t(e.post_tokens)}${n}.`}function lh(e){return`Ledung kept only the start of this output (about ${e>=1048576?`${(e/1024/1024).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`} more was cut). The full output is in Claude Code's own transcript of the session.`}function uh(e){let t=Number(e?.ledung_cut?.chars??0);return Number.isFinite(t)&&t>0?t:0}var dh=(e=>`Ledung has delivered messages for you. They are attached as context and are not from ${e}.`)(``).slice(0,-1);function fh(e){let t=e.split(`
|
|
64
64
|
|
|
65
|
-
`),n=t.at(-1);return!n.startsWith(
|
|
65
|
+
`),n=t.at(-1);return!n.startsWith(dh)||!n.endsWith(`.`)||n.includes(`
|
|
66
66
|
`)?e:t.slice(0,-1).join(`
|
|
67
67
|
|
|
68
|
-
`)}var
|
|
68
|
+
`)}var ph=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r)setTimeout(function(){r(e)},0);else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h)d[r]=void 0;else{if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends ph{};function mh(e,t){let n=0;for(;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function hh(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function gh(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function _h(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function vh(e,t){return gh(e,t,``)}function yh(e,t){return _h(e,t,``)}function bh(e,t){return t.slice(0,xh(e,t))}function xh(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function Sh(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function Ch(e,t){if(t)return Th(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function wh(e,t){if(t)return Th(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function Th(e,t){if(!t)return[wh(e),Ch(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=Sh(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var Eh=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,Dh=RegExp(`[${Eh}]+|\\s+|[^${Eh}]`,`ug`);new class extends ph{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=Sh(e,r)}else n=e.match(Dh)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&Oh(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&Oh(n,i,r,null,t.intlSegmenter),e}};function Oh(e,t,n,r,i){if(t&&n){let[a,o]=Th(t.value,i),[s,c]=Th(n.value,i);if(e){let r=mh(a,s);e.value=_h(e.value,s,r),t.value=vh(t.value,r),n.value=vh(n.value,r)}if(r){let e=hh(o,c);r.value=gh(r.value,c,e),t.value=yh(t.value,e),n.value=yh(n.value,e)}}else if(n){if(e){let e=wh(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=wh(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=wh(r.value,i),[a,o]=Th(t.value,i),s=mh(n,a);t.value=vh(t.value,s);let c=hh(vh(n,s),o);t.value=yh(t.value,c),r.value=gh(r.value,n,c),e.value=_h(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=wh(r.value,i),n=bh(Ch(t.value,i),e);t.value=yh(t.value,n)}else if(e){let n=bh(Ch(e.value,i),wh(t.value,i));t.value=vh(t.value,n)}}new class extends ph{tokenize(e){let t=RegExp(`(\\r?\\n)|[${Eh}]+|[^\\S\\n\\r]+|[^${Eh}]`,`ug`);return e.match(t)||[]}};var kh=new class extends ph{constructor(){super(...arguments),this.tokenize=jh}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
69
69
|
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
70
70
|
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
71
71
|
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
72
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function
|
|
73
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function
|
|
72
|
+
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function Ah(e,t,n){return kh.diff(e,t,n)}function jh(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
73
|
+
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function Mh(e){return e==`.`||e==`!`||e==`?`}new class extends ph{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(Mh(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends ph{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends ph{constructor(){super(...arguments),this.tokenize=jh}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(Nh(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function Nh(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a=0;for(;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=Nh(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=Nh(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends ph{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};function Ph({before:e,after:t}){let n=Ah(e,t);return(0,V.jsx)(`pre`,{className:`diff`,children:n.map((e,t)=>{let n=e.added?`diff-add`:e.removed?`diff-del`:`diff-same`,r=e.added?`+`:e.removed?`-`:` `,i=e.value.replace(/\n$/,``).split(`
|
|
74
74
|
`);return(0,V.jsxs)(`span`,{className:n,children:[i.map(e=>`${r} ${e}`).join(`
|
|
75
75
|
`),`
|
|
76
|
-
`]},t)})})}function
|
|
77
|
-
`)[0]:
|
|
78
|
-
`)}var Kh=e=>e===`waiting`||!!e?.startsWith(`q:`);function qh(e,t,n){return Kh(n)?Kh(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function Jh(e){return e>0?{back:1}:{queue:!0}}function Yh(e,t,n,r,i){if(r===i)return{verdict:null,to:n};let a=Xh(e,t,n+1);return{verdict:i,to:a>=0&&a!==n?a:Math.min(n+1,e.length-1)}}function Xh(e,t,n){for(let r=0;r<e.length;r++){let i=(n+r)%e.length;if(!t(e[i]))return i}return-1}function Zh(e,t,n,r){let i=e.filter(e=>!t(e)).length;return i?n===null?{send:!1,to:Xh(e,t,0),missing:i}:r-n<500?{send:!1,tooSoon:!0}:{send:!0}:{send:!0}}var Qh=e=>(e.ctrlKey||e.metaKey)&&e.key===`Enter`,$h=e=>Qh(e)&&!e.repeat,eg=new Map,tg=(e,t)=>({judged:{},note:``,paths:e.map(e=>e.path),project:t,carried:{},touched:{}});function ng(e,t,n,r){let i=[...n.entries()].filter(([n,i])=>n!==e&&r(n)&&i.project===t.project).sort(([e],[t])=>t-e);if(!i.length)return t;let a={...t.judged},o={...t.carried},s=!1;return t.paths.forEach((e,n)=>{if(!(a[n]?.verdict||t.touched[n]||o[n]!==void 0))for(let[t,r]of i){let i=r.paths.indexOf(e),c=i>=0?r.judged[i]:void 0;if(c?.verdict){a[n]={verdict:c.verdict,note:a[n]?.note.trim()?a[n].note:c.note},o[n]=t,s=!0;break}}}),s?{...t,judged:a,carried:o}:t}var rg=e=>[...new Set(Object.values(e.carried))].sort((e,t)=>e-t),ig=e=>Object.values(e.judged).filter(e=>e.verdict).length,ag=(e,t)=>e>0&&t>0&&e<=t*.6,og=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;function sg({busy:e,onWithdraw:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n&&i.current?.focus()},[n]),n?(0,V.jsxs)(`div`,{className:`withdraw-row asking`,role:`group`,"aria-label":`Withdraw the question`,children:[(0,V.jsx)(`span`,{children:`Withdraw it for the asker? It leaves the queue.`}),(0,V.jsx)(`button`,{className:`small deny`,disabled:e,onClick:t,children:`Yes, withdraw`}),(0,V.jsx)(`button`,{ref:i,className:`small`,disabled:e,onClick:()=>r(!1),children:`Keep it`})]}):(0,V.jsx)(`div`,{className:`withdraw-row`,children:(0,V.jsx)(`button`,{className:`small`,disabled:e,title:`Withdraw it for the asker; it leaves the queue`,onClick:()=>r(!0),children:`Withdraw…`})})}var cg=`ledung-shots-order`;function lg(e){let t=e.opinions.find(e=>e.verdict)?.verdict;return t===`fail`?0:t===`unsure`?1:t===`pass`?3:2}function ug(e){let t=B(),n=e.question,r=n.status===`open`,i=t=>r?ng(n.id,t,eg,t=>e.withdrawnIds.includes(t)):t,[a,o]=(0,v.useState)(()=>{let t=i(eg.get(n.id)??tg(n.shots,e.session.project));return eg.set(n.id,t),t}),[s,c]=(0,v.useState)(()=>{try{return localStorage.getItem(cg)===`off-first`}catch{return!1}}),l=(0,v.useMemo)(()=>{let e=n.shots.map((e,t)=>t);return s?e.sort((e,t)=>lg(n.shots[e])-lg(n.shots[t])||e-t):e},[n.shots,s]),[u,d]=(0,v.useState)(()=>{let e=Zh(l,e=>a.judged[e]?.verdict,null,0);return`to`in e?e.to:0}),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=e=>{eg.set(n.id,e),o(e),b(null)},C=e.withdrawnIds.join(`,`);(0,v.useEffect)(()=>{let e=eg.get(n.id)??a,t=i(e);t!==e&&x(t)},[C]);let w=Math.min(u,l.length-1),T=l[w],E=n.shots[T],D=a.judged[T],O=n.shots.filter((e,t)=>a.judged[t]?.verdict).length,k=e=>d((e+l.length)%l.length),ee=e=>{let t=E.group,r=w;do r=(r+e+l.length)%l.length;while(n.shots[l[r]].group===t&&r!==w);for(;e<0&&r>0&&n.shots[l[r-1]].group===n.shots[l[r]].group;)r--;k(r)},A=e=>{if(!r)return;let{verdict:t,to:n}=Yh(l,e=>a.judged[e]?.verdict,w,D?.verdict,e),i={...a.carried};delete i[T],x({...a,judged:{...a.judged,[T]:{verdict:t,note:D?.note??``}},carried:i,touched:{...a.touched,[T]:!0}}),n!==w&&k(n)},j=e=>x({...a,judged:{...a.judged,[T]:{verdict:D?.verdict??null,note:e}}}),M=()=>{let e=!s;try{localStorage.setItem(cg,e?`off-first`:`as-taken`)}catch{}c(e);let t=n.shots.map((e,t)=>t),r=e?t.sort((e,t)=>lg(n.shots[e])-lg(n.shots[t])||e-t):t;d(Math.max(0,r.indexOf(T)))},te=async t=>{h(!0),_(null);try{await t(),eg.delete(n.id),e.onDone?.()}catch(e){_(e.message)}finally{h(!1)}},N=()=>{if(m)return;if(!O)return _(`Judge at least one shot first.`);let e=Zh(l,e=>a.judged[e]?.verdict,y,Date.now());`tooSoon`in e||(`to`in e?(b(Date.now()),_(null),k(e.to)):te(()=>R.answerQuestion(n.id,Gh(n.shots,a.judged,a.note))))},P=n.shots.length-O,ne=y!==null&&P>0,re=rg(a),ie=a.carried[T];(0,v.useEffect)(()=>{let t=t=>{let n=/^(TEXTAREA|INPUT|SELECT)$/.test(document.activeElement?.tagName??``);if(Qh(t)&&r){t.preventDefault(),$h(t)&&N();return}if(t.key===`Escape`){n?document.activeElement.blur():e.onClose();return}if(n||t.ctrlKey||t.metaKey||t.altKey)return;let i=t.key;if(i===`ArrowRight`)k(w+1);else if(i===`ArrowLeft`)k(w-1);else if(i===`ArrowDown`)ee(1);else if(i===`ArrowUp`)ee(-1);else if(i===`1`||i===`2`||i===`3`)A(Vh[Number(i)-1]);else if((i===`n`||i===`N`)&&r)p(e=>e+1);else if(i===`o`||i===`O`)M();else if((i===`s`||i===`S`)&&e.onToggleSidebar)e.onToggleSidebar();else if((i===`c`||i===`C`)&&e.onGoToConversation)e.onGoToConversation();else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)});let ae=(0,v.useRef)(null),oe=(0,v.useRef)(null),se=(0,v.useRef)(null),[ce,le]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=ae.current,t=oe.current;if(!e||!t)return;let n=new ResizeObserver(()=>{let n=getComputedStyle(t);le(ag(t.getBoundingClientRect().height-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom),e.clientHeight))});return n.observe(e),n.observe(t),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=oe.current,t=se.current;if(!e||!t||getComputedStyle(e).position!==`sticky`)return;let n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().top-n;r<0&&e.closest(`.shots`)?.scrollBy({top:r-8})},[T]);let ue=[];l.forEach((e,t)=>{let r=n.shots[e].group;ue.at(-1)?.name===r?ue.at(-1).items.push(t):ue.push({name:r,items:[t]})});let de=(0,V.jsxs)(V.Fragment,{children:[ie!==void 0&&(0,V.jsxs)(`p`,{className:`carried-hint`,children:[`Carried over from #`,ie,`, withdrawn: check it still holds for this picture.`]}),(0,V.jsx)(`div`,{className:`vbtns`,children:Vh.map((e,t)=>(0,V.jsxs)(`button`,{className:`${e}${D?.verdict===e?` on`:``}`,"aria-pressed":D?.verdict===e,onClick:()=>A(e),children:[Hh[e],(0,V.jsx)(`kbd`,{children:t+1})]},e))})]});return(0,V.jsxs)(`div`,{className:`shots${ce?` pin`:``}`,ref:ae,children:[(0,V.jsxs)(`div`,{className:`shot-main`,children:[(0,V.jsxs)(`div`,{className:`shot-top`,ref:oe,children:[(0,V.jsxs)(`div`,{className:`stage`,children:[(0,V.jsx)(Tf,{sessionId:n.sessionId,path:E.path,alt:`${E.group} ${E.path}`},`${n.id}:${T}`),l.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:`nav l`,onClick:()=>k(w-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,V.jsx)(`button`,{className:`nav r`,onClick:()=>k(w+1),"aria-label":`Next screenshot`,children:`›`})]})]}),r&&(0,V.jsx)(`div`,{className:`shot-vbar`,role:`group`,"aria-label":`Your verdict`,children:de})]}),(0,V.jsx)(`nav`,{className:`strip`,"aria-label":`Screenshots`,children:ue.map(e=>(0,V.jsxs)(`div`,{className:`sgrp`,children:[(0,V.jsxs)(`span`,{children:[e.name,` · `,e.items.filter(e=>a.judged[l[e]]?.verdict).length,`/`,e.items.length]}),(0,V.jsx)(`div`,{children:e.items.map(t=>{let r=l[t],i=a.judged[r];return(0,V.jsxs)(`button`,{className:`thumb`,"aria-current":t===w,"aria-label":`${e.name} ${n.shots[r].path}`,onClick:()=>k(t),children:[(0,V.jsx)(`img`,{src:wf(n.sessionId,n.shots[r].path),alt:``}),(0,V.jsx)(`span`,{className:`vdot${i?.verdict?` ${i.verdict}`:``}${i?.note.trim()?` n`:``}${a.carried[r]===void 0?``:` c`}`,title:a.carried[r]===void 0?void 0:`Carried over from #${a.carried[r]}: give it a second look`})]},r)})})]},e.name+e.items[0]))})]}),(0,V.jsxs)(`aside`,{className:`slip`,"aria-live":`polite`,children:[(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,n.id]}),(0,V.jsx)(`span`,{className:`chip`,children:S(e.session.project)}),(0,V.jsx)(`span`,{className:`muted`,children:Eg(n.askedAt)}),(0,V.jsx)(`button`,{className:`link slip-session`,onClick:e.session.onOpen,children:e.session.title})]}),(0,V.jsxs)(`div`,{className:`slip-question`,children:[(0,V.jsx)(`strong`,{className:`slip-title`,children:e.title}),e.refersTo,(0,V.jsx)(`div`,{className:`question-text prose`,children:(0,V.jsx)(jf,{text:e.issue||n.question,sessionId:n.sessionId})}),e.evidence&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Evidence`}),(0,V.jsx)(`div`,{className:`question-text prose`,children:(0,V.jsx)(jf,{text:e.evidence,sessionId:n.sessionId})})]}),!!e.options?.length&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Options`}),(0,V.jsx)(`ol`,{className:`slip-options`,children:e.options.map(t=>{let r=(e.opinions??[]).filter(e=>e.pick===t.key).map(e=>e.who);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:t.label.replace(/\*\*/g,``)}),t.detail&&(0,V.jsx)(`div`,{className:`prose`,children:(0,V.jsx)(jf,{text:t.detail,sessionId:n.sessionId})}),t.cost&&(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsx)(`b`,{children:`Cost`}),` · `,t.cost]}),r.length>0&&(0,V.jsxs)(`div`,{className:`picked-by`,children:[(0,V.jsx)(`b`,{children:`Picked by`}),` `,r.join(`, `)]})]},t.key)})}),(0,V.jsx)(`span`,{className:`muted hint`,children:`Your verdicts on the shots are the answer.`})]})]}),(0,V.jsx)(`h3`,{ref:se,children:E.group}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`span`,{className:`chip`,children:[w+1,` / `,l.length]}),E.facts.map(e=>(0,V.jsx)(`span`,{className:`chip`,children:e},e)),(0,V.jsx)(`span`,{className:`chip mono`,children:E.path})]}),(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Look for`}),(0,V.jsx)(`p`,{children:E.lookFor})]}),E.doneWhen&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Judge against (the done-condition)`}),(0,V.jsx)(`p`,{children:E.doneWhen})]}),E.opinions.length>0&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`What the others thought`}),E.opinions.map((e,t)=>(0,V.jsxs)(`div`,{className:`op${e.verdict?` ${e.verdict}`:``}`,children:[(0,V.jsx)(`small`,{children:e.who}),e.verdict&&(0,V.jsx)(`strong`,{className:e.verdict,children:Uh[e.verdict]}),(0,V.jsx)(`p`,{children:e.text})]},t))]}),r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`sblk slip-verdict`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Your verdict`}),de]}),(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`label`,{className:`lbl`,htmlFor:`shot-note`,children:`Note on this shot`}),(0,V.jsx)(dg,{value:D?.note??``,focus:f,onChange:j},`${n.id}:${T}`)]}),(0,V.jsxs)(`div`,{className:`send-blk`,children:[(0,V.jsxs)(`div`,{className:P?`shot-count missing`:`muted`,children:[O,` of `,n.shots.length,` judged`,P>0&&` · ${P} without a verdict`]}),re.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[Object.keys(a.carried).length,` verdict`,Object.keys(a.carried).length===1?``:`s`,` carried over from `,re.map(e=>`#${e}`).join(`, `),`, withdrawn while you judged `,re.length===1?`it`:`them`,`; ringed on the strip until you judge `,Object.keys(a.carried).length===1?`it`:`them`,` here.`]}),(0,V.jsx)(`label`,{className:`lbl`,htmlFor:`shot-answer-note`,children:`Note to the asker (optional)`}),(0,V.jsx)(`textarea`,{...t,id:`shot-answer-note`,className:`answer-box`,rows:2,placeholder:`Anything to go with the verdicts`,value:a.note,onChange:e=>x({...a,note:e.target.value})}),(0,V.jsx)(`div`,{className:`actions`,children:(0,V.jsx)(`button`,{className:ne?`deny`:`allow`,disabled:m||!O,onClick:N,children:ne?`Send with ${P} without a verdict`:`Send verdicts`})}),ne&&P>0?(0,V.jsxs)(`p`,{className:`error`,children:[P===1?`1 shot has`:`${P} shots have`,` no verdict yet; this is the first. Give `,P===1?`it`:`them`,` one, or press "Send with `,P,` without a verdict" to send `,P===1?`it`:`them`,` as "no verdict".`]}):(0,V.jsxs)(`span`,{className:`muted hint`,children:[O>0&&P>0&&`Send shows the shots without a verdict first. `,(0,V.jsxs)(`span`,{className:`kbd-hint`,children:[(0,V.jsx)(`kbd`,{children:`Ctrl`}),`+`,(0,V.jsx)(`kbd`,{children:`Enter`}),` sends`]})]}),g&&(0,V.jsx)(`p`,{className:`error`,children:g}),(0,V.jsx)(sg,{busy:m,onWithdraw:()=>void te(()=>R.withdrawQuestion(n.id))})]})]}):(0,V.jsx)(`div`,{className:`send-blk`,children:n.status===`answered`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`lbl`,children:[`Answer`,n.answeredBy===`user`?` from ${e.userName}`:``]}),(0,V.jsx)(`pre`,{className:`shot-answer`,children:n.answer}),(0,V.jsx)(`span`,{className:`muted`,children:n.deliveredAt?`delivered ${Eg(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),ig(a)>0&&(0,V.jsxs)(`p`,{className:`error`,children:[`It was withdrawn while you judged it: your `,ig(a),` verdict`,ig(a)===1?` was`:`s were`,` not sent. In this tab, until it is reloaded, a question of this project with the same shots takes them where it has no verdict yet.`]})]})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(`button`,{className:`small${s?` on`:``}`,"aria-pressed":s,onClick:M,title:`Order (O)`,children:`Looks off first`})}),(0,V.jsxs)(`div`,{className:`keys`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` shot`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↑`}),(0,V.jsx)(`kbd`,{children:`↓`}),` issue`]}),r&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),(0,V.jsx)(`kbd`,{children:`2`}),(0,V.jsx)(`kbd`,{children:`3`}),` verdict, then next`]}),r&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`O`}),` order`]}),e.onGoToConversation&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),e.onToggleSidebar&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]})]})]})]})}function dg(e){let t=B(),[n,r]=(0,v.useState)(null),[i]=(0,v.useState)(e.focus);return(0,v.useEffect)(()=>{e.focus!==i&&n?.focus()},[e.focus]),(0,V.jsx)(`textarea`,{...t,id:`shot-note`,ref:r,className:`answer-box`,rows:2,placeholder:og()?`Write here`:`N to write, Esc to leave`,value:e.value,onChange:t=>e.onChange(t.target.value)})}var fg=e=>e.shots?.length?`${e.shots.length} screenshot${e.shots.length===1?``:`s`}`:null;function pg(e){let t=B(),n=e.question,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async e=>{o(!0),c(null);try{await e()}catch(e){c(e.message)}finally{o(!1)}},u=n.details?.review?n.details:null,d=u?null:fg(n),f=u?n.status===`open`?`Open the review`:`Show the review`:n.status===`open`?`Judge in the screenshot view`:`Show the screenshots`,p=(d||u)&&(e.onOpenInDesk?(0,V.jsx)(`button`,{className:`small`,onClick:e.onOpenInDesk,children:f}):(0,V.jsx)(`a`,{className:`button-link`,href:`#/waiting/q/${n.id}`,children:f})),m=n.shots?.length?(0,V.jsx)(`div`,{className:`chat-thumbs`,children:n.shots.map((e,t)=>(0,V.jsx)(`img`,{src:wf(n.sessionId,e.path),alt:e.path,title:`${e.group} · ${e.path}`},t))}):null,h=(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,n.id]}),e.from&&(0,V.jsxs)(V.Fragment,{children:[` · from `,(0,V.jsx)(`strong`,{children:e.from})]}),e.session&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{className:`link`,onClick:e.session.onOpen,children:e.session.title}),(0,V.jsxs)(`span`,{className:`muted`,children:[` (`,S(e.session.project),`)`]})]}),(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,Eg(n.askedAt)]}),n.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · to manager "`,e.titleOf?.(n.addressedTo)??`manager`,`"`]}),n.aboutQuestion!==null&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · about #`,n.aboutQuestion]}),d&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`chip shot-chip`,children:d})]}),u&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`})]})]}),g=u?(0,V.jsx)(`div`,{className:`question-text`,children:(0,V.jsx)(`strong`,{children:u.title})}):(0,V.jsx)(`div`,{className:`question-text`,children:(0,V.jsx)(jf,{text:n.question,onOpenFile:e.onOpenFile})}),_=n.answeredBy===`user`?n.forwardedFrom===null?e.userName:`${e.userName} (passed on by the manager)`:`Manager "${e.titleOf?.(n.answeredBy??``)??`manager`}", under its standing grant`;return n.status===`open`?(0,V.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-open${e.focus?` focus`:``}`,children:[h,g,m,n.aboutRequest&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. "Allow once" allows it once; any other answer denies it, with your words as the reason.`]}),n.options&&!p&&(0,V.jsx)(`div`,{className:`question-options`,children:n.options.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`option${r===e?` on`:``}`,onClick:()=>i(e),children:e},e))}),!p&&(0,V.jsx)(`textarea`,{...t,className:`answer-box`,placeholder:n.aboutRequest?`Choose above, or type why you deny it`:n.options?`Choose above or type your answer`:`Type your answer`,value:r,onChange:e=>i(e.target.value),rows:2}),(0,V.jsxs)(`div`,{className:`actions`,children:[p||(0,V.jsx)(`button`,{className:`allow`,disabled:a||!r.trim(),onClick:()=>l(()=>R.answerQuestion(n.id,r)),children:`Answer`}),e.onOpenInDesk&&!p&&(0,V.jsx)(`button`,{className:`small`,title:`Open it in Waiting for you`,onClick:e.onOpenInDesk,children:`Open in Waiting for you`})]}),s&&(0,V.jsx)(`p`,{className:`error`,children:s}),(0,V.jsx)(sg,{busy:a,onWithdraw:()=>void l(()=>R.withdrawQuestion(n.id))})]}):(0,V.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-done ${n.status}${e.focus?` focus`:``}`,children:[h,g,m,n.status===`answered`?(0,V.jsxs)(`p`,{children:[(0,V.jsxs)(`strong`,{children:[_,`:`]}),` `,d||u?(0,V.jsxs)(`span`,{className:`shot-answer`,children:[`
|
|
79
|
-
`,n.answer]}):n.answer,(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,n.deliveredAt?`delivered ${
|
|
80
|
-
`):``}function
|
|
76
|
+
`]},t)})})}function Fh({text:e}){return(0,V.jsxs)(`div`,{className:`code-block`,children:[(0,V.jsx)(Of,{text:e}),(0,V.jsx)(`pre`,{children:(0,V.jsx)(`code`,{children:e})})]})}function Ih(e){return typeof e.file_path==`string`?e.file_path:typeof e.path==`string`?e.path:null}function Lh(e,t){return e===`Bash`&&typeof t.command==`string`?t.command.split(`
|
|
77
|
+
`)[0]:Ih(t)||(typeof t.pattern==`string`?t.pattern:typeof t.url==`string`?t.url:typeof t.description==`string`?t.description:``)}function Rh({toolName:e,input:t}){let n=Ih(t);switch(e){case`Bash`:return(0,V.jsxs)(V.Fragment,{children:[t.description&&(0,V.jsx)(`p`,{className:`muted`,children:t.description}),(0,V.jsx)(Fh,{text:String(t.command??``)}),t.run_in_background&&(0,V.jsx)(`p`,{className:`muted`,children:`Runs in the background.`})]});case`Edit`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`path`,children:[n,t.replace_all?` (every occurrence)`:``]}),(0,V.jsx)(Ph,{before:String(t.old_string??``),after:String(t.new_string??``)})]});case`MultiEdit`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`path`,children:n}),(t.edits??[]).map((e,t)=>(0,V.jsx)(Ph,{before:String(e.old_string??``),after:String(e.new_string??``)},t))]});case`Write`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`path`,children:[n,` (whole file)`]}),(0,V.jsx)(Ph,{before:``,after:String(t.content??``)})]});case`NotebookEdit`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`path`,children:t.notebook_path}),(0,V.jsx)(Fh,{text:String(t.new_source??``)})]});default:return(0,V.jsx)(Fh,{text:JSON.stringify(t,null,2)})}}function zh({permission:e,managerTitle:t}){return e.toolName===`AskUserQuestion`?(0,V.jsx)(Vh,{permission:e}):(0,V.jsx)(Bh,{permission:e,managerTitle:t})}function Bh({permission:e,managerTitle:t}){let n=B(),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=async(t,n=`once`,r=a)=>{c(!0),u(null);try{await R.decide(e.id,{behavior:t,scope:n,message:t===`deny`?r:void 0})}catch(e){u(e.message),c(!1)}};return(0,V.jsxs)(`div`,{className:`card permission`,children:[(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsxs)(`strong`,{children:[`Permission: `,e.toolName]}),e.title&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,e.title]}),e.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,e.sensitive?`with`:`for`,` manager "`,t??`manager`,`"`,e.sensitive?``:` to decide`]})]}),e.sensitive&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Sensitive`}),`: only you can allow this, once at a time.`,e.addressedTo!==`user`&&` Its manager asks you about it; you can also decide it here.`,` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`(`,e.sensitive,`)`]})]}),e.uac&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Administrator`}),`: `,`This raises a UAC prompt on the PC's desktop; allow it only when you are at the PC.`,` `,(0,V.jsx)(`span`,{className:`muted`,children:`Stop may not end what runs as administrator: Windows does not let Ledung end it. Close it on the PC.`})]}),e.reason&&(0,V.jsx)(`p`,{className:`muted`,children:e.reason}),(0,V.jsx)(Rh,{toolName:e.toolName,input:e.input}),r&&(0,V.jsx)(`textarea`,{...n,className:`deny-message`,placeholder:`Optional: tell the session why, or what to do instead`,value:a,onChange:e=>o(e.target.value),rows:2,autoFocus:!0}),(0,V.jsxs)(`div`,{className:`actions`,children:[(0,V.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>d(`allow`),children:`Allow once`}),!e.sensitive&&(0,V.jsx)(`button`,{disabled:s,title:`Allow this request and its repeats for the rest of this session`,onClick:()=>d(`allow`,`session`),children:`Allow for this session`}),r?(0,V.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>d(`deny`),children:`Deny`}):(0,V.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>i(!0),children:`Deny…`}),e.uac&&(0,V.jsx)(`button`,{className:`deny`,disabled:s,title:`Deny it, telling the session nobody is at the PC to answer UAC`,onClick:()=>d(`deny`,`once`,`Denied: the person is not at the PC, so nobody can answer the UAC prompt there. Do not retry the elevated command now; carry on without it, or ask for it later.`),children:`Deny: not at the PC`})]}),l&&(0,V.jsx)(`p`,{className:`error`,children:l})]})}function Vh({permission:e}){let t=B(),n=e.input.questions??[],[r,i]=(0,v.useState)({}),[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),d=(e,t)=>{i(n=>{let r=n[e.question]??[];return e.multiSelect?{...n,[e.question]:r.includes(t)?r.filter(e=>e!==t):[...r,t]}:{...n,[e.question]:[t]}}),e.multiSelect||o(t=>({...t,[e.question]:``}))},f=e=>{let t=a[e.question]?.trim();return[...r[e.question]??[],...t?[t]:[]].join(`, `)},p=n.every(e=>f(e)),m=async t=>{c(!0),u(null);try{let r=Object.fromEntries(n.map(e=>[e.question,f(e)]));await R.decide(e.id,t===`allow`?{behavior:t,answers:r}:{behavior:t,message:`Simon declined to answer.`})}catch(e){u(e.message),c(!1)}};return(0,V.jsxs)(`div`,{className:`card question`,children:[n.map(e=>(0,V.jsxs)(`fieldset`,{children:[(0,V.jsxs)(`legend`,{children:[e.header&&(0,V.jsx)(`span`,{className:`chip`,children:e.header}),` `,e.question]}),e.options.map(t=>{let n=(r[e.question]??[]).includes(t.label);return(0,V.jsxs)(`button`,{type:`button`,className:`option${n?` on`:``}`,onClick:()=>d(e,t.label),children:[(0,V.jsx)(`strong`,{children:t.label}),t.description&&(0,V.jsxs)(`span`,{className:`muted`,children:[` `,t.description]})]},t.label)}),(0,V.jsx)(`input`,{...t,className:`other`,placeholder:`Or type your own answer`,value:a[e.question]??``,onChange:t=>{let n=t.target.value;o(t=>({...t,[e.question]:n})),!e.multiSelect&&n&&i(t=>({...t,[e.question]:[]}))}})]},e.question)),(0,V.jsxs)(`div`,{className:`actions`,children:[(0,V.jsx)(`button`,{className:`allow`,disabled:s||!p,onClick:()=>m(`allow`),children:`Answer`}),(0,V.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>m(`deny`),children:`Decline`})]}),l&&(0,V.jsx)(`p`,{className:`error`,children:l})]})}var Hh=[`pass`,`fail`,`unsure`],Uh={pass:`Pass`,fail:`Fail`,unsure:`Unsure`},Wh={pass:`looks right`,fail:`looks off`,unsure:`can't tell`},Gh=e=>e.replace(/\s+/g,` `).trim();function Kh(e,t,n=``){let r=e=>t[e]?.verdict??null,i=Hh.map(t=>[Uh[t],e.filter((e,n)=>r(n)===t).length]).filter(([,e])=>e>0).map(([e,t])=>`${e} ${t}`),a=e.filter((e,t)=>!r(t)).length;a&&i.push(`no verdict ${a}`);let o=e.map((e,n)=>{let i=r(n),a=Gh(t[n]?.note??``);return`- ${Gh(e.group)} · ${Gh(e.path)}: ${i?Uh[i]:`no verdict`}${a?` — ${a}`:``}`}),s=n.trim();return[`Screenshot verdicts: ${i.join(` · `)}`,...o,...s?[``,s]:[]].join(`
|
|
78
|
+
`)}var qh=e=>e===`waiting`||!!e?.startsWith(`q:`);function Jh(e,t,n){return qh(n)?qh(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function Yh(e){return e>0?{back:1}:{queue:!0}}function Xh(e,t,n,r,i){if(r===i)return{verdict:null,to:n};let a=Zh(e,t,n+1);return{verdict:i,to:a>=0&&a!==n?a:Math.min(n+1,e.length-1)}}function Zh(e,t,n){for(let r=0;r<e.length;r++){let i=(n+r)%e.length;if(!t(e[i]))return i}return-1}function Qh(e,t,n,r){let i=e.filter(e=>!t(e)).length;return i?n===null?{send:!1,to:Zh(e,t,0),missing:i}:r-n<500?{send:!1,tooSoon:!0}:{send:!0}:{send:!0}}var $h=e=>(e.ctrlKey||e.metaKey)&&e.key===`Enter`,eg=e=>$h(e)&&!e.repeat,tg=new Map,ng=(e,t)=>({judged:{},note:``,paths:e.map(e=>e.path),project:t,carried:{},touched:{}});function rg(e,t,n,r){let i=[...n.entries()].filter(([n,i])=>n!==e&&r(n)&&i.project===t.project).sort(([e],[t])=>t-e);if(!i.length)return t;let a={...t.judged},o={...t.carried},s=!1;return t.paths.forEach((e,n)=>{if(!(a[n]?.verdict||t.touched[n]||o[n]!==void 0))for(let[t,r]of i){let i=r.paths.indexOf(e),c=i>=0?r.judged[i]:void 0;if(c?.verdict){a[n]={verdict:c.verdict,note:a[n]?.note.trim()?a[n].note:c.note},o[n]=t,s=!0;break}}}),s?{...t,judged:a,carried:o}:t}var ig=e=>[...new Set(Object.values(e.carried))].sort((e,t)=>e-t),ag=e=>Object.values(e.judged).filter(e=>e.verdict).length,og=(e,t)=>e>0&&t>0&&e<=t*.6,sg=()=>typeof matchMedia==`function`&&matchMedia(`(pointer: coarse)`).matches;function cg({busy:e,onWithdraw:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null);return(0,v.useEffect)(()=>{n&&i.current?.focus()},[n]),n?(0,V.jsxs)(`div`,{className:`withdraw-row asking`,role:`group`,"aria-label":`Withdraw the question`,children:[(0,V.jsx)(`span`,{children:`Withdraw it for the asker? It leaves the queue.`}),(0,V.jsx)(`button`,{className:`small deny`,disabled:e,onClick:t,children:`Yes, withdraw`}),(0,V.jsx)(`button`,{ref:i,className:`small`,disabled:e,onClick:()=>r(!1),children:`Keep it`})]}):(0,V.jsx)(`div`,{className:`withdraw-row`,children:(0,V.jsx)(`button`,{className:`small`,disabled:e,title:`Withdraw it for the asker; it leaves the queue`,onClick:()=>r(!0),children:`Withdraw…`})})}var lg=`ledung-shots-order`;function ug(e){let t=e.opinions.find(e=>e.verdict)?.verdict;return t===`fail`?0:t===`unsure`?1:t===`pass`?3:2}function dg(e){let t=B(),n=e.question,r=n.status===`open`,i=t=>r?rg(n.id,t,tg,t=>e.withdrawnIds.includes(t)):t,[a,o]=(0,v.useState)(()=>{let t=i(tg.get(n.id)??ng(n.shots,e.session.project));return tg.set(n.id,t),t}),[s,c]=(0,v.useState)(()=>{try{return localStorage.getItem(lg)===`off-first`}catch{return!1}}),l=(0,v.useMemo)(()=>{let e=n.shots.map((e,t)=>t);return s?e.sort((e,t)=>ug(n.shots[e])-ug(n.shots[t])||e-t):e},[n.shots,s]),[u,d]=(0,v.useState)(()=>{let e=Qh(l,e=>a.judged[e]?.verdict,null,0);return`to`in e?e.to:0}),[f,p]=(0,v.useState)(0),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(null),x=e=>{tg.set(n.id,e),o(e),b(null)},C=e.withdrawnIds.join(`,`);(0,v.useEffect)(()=>{let e=tg.get(n.id)??a,t=i(e);t!==e&&x(t)},[C]);let w=Math.min(u,l.length-1),T=l[w],E=n.shots[T],D=a.judged[T],O=n.shots.filter((e,t)=>a.judged[t]?.verdict).length,k=e=>d((e+l.length)%l.length),ee=e=>{let t=E.group,r=w;do r=(r+e+l.length)%l.length;while(n.shots[l[r]].group===t&&r!==w);for(;e<0&&r>0&&n.shots[l[r-1]].group===n.shots[l[r]].group;)r--;k(r)},A=e=>{if(!r)return;let{verdict:t,to:n}=Xh(l,e=>a.judged[e]?.verdict,w,D?.verdict,e),i={...a.carried};delete i[T],x({...a,judged:{...a.judged,[T]:{verdict:t,note:D?.note??``}},carried:i,touched:{...a.touched,[T]:!0}}),n!==w&&k(n)},j=e=>x({...a,judged:{...a.judged,[T]:{verdict:D?.verdict??null,note:e}}}),M=()=>{let e=!s;try{localStorage.setItem(lg,e?`off-first`:`as-taken`)}catch{}c(e);let t=n.shots.map((e,t)=>t),r=e?t.sort((e,t)=>ug(n.shots[e])-ug(n.shots[t])||e-t):t;d(Math.max(0,r.indexOf(T)))},te=async t=>{h(!0),_(null);try{await t(),tg.delete(n.id),e.onDone?.()}catch(e){_(e.message)}finally{h(!1)}},N=()=>{if(m)return;if(!O)return _(`Judge at least one shot first.`);let e=Qh(l,e=>a.judged[e]?.verdict,y,Date.now());`tooSoon`in e||(`to`in e?(b(Date.now()),_(null),k(e.to)):te(()=>R.answerQuestion(n.id,Kh(n.shots,a.judged,a.note))))},P=n.shots.length-O,ne=y!==null&&P>0,re=ig(a),ie=a.carried[T];(0,v.useEffect)(()=>{let t=t=>{let n=/^(TEXTAREA|INPUT|SELECT)$/.test(document.activeElement?.tagName??``);if($h(t)&&r){t.preventDefault(),eg(t)&&N();return}if(t.key===`Escape`){n?document.activeElement.blur():e.onClose();return}if(n||t.ctrlKey||t.metaKey||t.altKey)return;let i=t.key;if(i===`ArrowRight`)k(w+1);else if(i===`ArrowLeft`)k(w-1);else if(i===`ArrowDown`)ee(1);else if(i===`ArrowUp`)ee(-1);else if(i===`1`||i===`2`||i===`3`)A(Hh[Number(i)-1]);else if((i===`n`||i===`N`)&&r)p(e=>e+1);else if(i===`o`||i===`O`)M();else if((i===`s`||i===`S`)&&e.onToggleSidebar)e.onToggleSidebar();else if((i===`c`||i===`C`)&&e.onGoToConversation)e.onGoToConversation();else return;t.preventDefault()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)});let ae=(0,v.useRef)(null),oe=(0,v.useRef)(null),se=(0,v.useRef)(null),[ce,le]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let e=ae.current,t=oe.current;if(!e||!t)return;let n=new ResizeObserver(()=>{let n=getComputedStyle(t);le(og(t.getBoundingClientRect().height-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom),e.clientHeight))});return n.observe(e),n.observe(t),()=>n.disconnect()},[]),(0,v.useEffect)(()=>{let e=oe.current,t=se.current;if(!e||!t||getComputedStyle(e).position!==`sticky`)return;let n=e.getBoundingClientRect().bottom,r=t.getBoundingClientRect().top-n;r<0&&e.closest(`.shots`)?.scrollBy({top:r-8})},[T]);let ue=[];l.forEach((e,t)=>{let r=n.shots[e].group;ue.at(-1)?.name===r?ue.at(-1).items.push(t):ue.push({name:r,items:[t]})});let de=(0,V.jsxs)(V.Fragment,{children:[ie!==void 0&&(0,V.jsxs)(`p`,{className:`carried-hint`,children:[`Carried over from #`,ie,`, withdrawn: check it still holds for this picture.`]}),(0,V.jsx)(`div`,{className:`vbtns`,children:Hh.map((e,t)=>(0,V.jsxs)(`button`,{className:`${e}${D?.verdict===e?` on`:``}`,"aria-pressed":D?.verdict===e,onClick:()=>A(e),children:[Uh[e],(0,V.jsx)(`kbd`,{children:t+1})]},e))})]});return(0,V.jsxs)(`div`,{className:`shots${ce?` pin`:``}`,ref:ae,children:[(0,V.jsxs)(`div`,{className:`shot-main`,children:[(0,V.jsxs)(`div`,{className:`shot-top`,ref:oe,children:[(0,V.jsxs)(`div`,{className:`stage`,children:[(0,V.jsx)(Ef,{sessionId:n.sessionId,path:E.path,alt:`${E.group} ${E.path}`},`${n.id}:${T}`),l.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:`nav l`,onClick:()=>k(w-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,V.jsx)(`button`,{className:`nav r`,onClick:()=>k(w+1),"aria-label":`Next screenshot`,children:`›`})]})]}),r&&(0,V.jsx)(`div`,{className:`shot-vbar`,role:`group`,"aria-label":`Your verdict`,children:de})]}),(0,V.jsx)(`nav`,{className:`strip`,"aria-label":`Screenshots`,children:ue.map(e=>(0,V.jsxs)(`div`,{className:`sgrp`,children:[(0,V.jsxs)(`span`,{children:[e.name,` · `,e.items.filter(e=>a.judged[l[e]]?.verdict).length,`/`,e.items.length]}),(0,V.jsx)(`div`,{children:e.items.map(t=>{let r=l[t],i=a.judged[r];return(0,V.jsxs)(`button`,{className:`thumb`,"aria-current":t===w,"aria-label":`${e.name} ${n.shots[r].path}`,onClick:()=>k(t),children:[(0,V.jsx)(`img`,{src:Tf(n.sessionId,n.shots[r].path),alt:``}),(0,V.jsx)(`span`,{className:`vdot${i?.verdict?` ${i.verdict}`:``}${i?.note.trim()?` n`:``}${a.carried[r]===void 0?``:` c`}`,title:a.carried[r]===void 0?void 0:`Carried over from #${a.carried[r]}: give it a second look`})]},r)})})]},e.name+e.items[0]))})]}),(0,V.jsxs)(`aside`,{className:`slip`,"aria-live":`polite`,children:[(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,n.id]}),(0,V.jsx)(`span`,{className:`chip`,children:S(e.session.project)}),(0,V.jsx)(`span`,{className:`muted`,children:Dg(n.askedAt)}),(0,V.jsx)(`button`,{className:`link slip-session`,onClick:e.session.onOpen,children:e.session.title})]}),(0,V.jsxs)(`div`,{className:`slip-question`,children:[(0,V.jsx)(`strong`,{className:`slip-title`,children:e.title}),e.refersTo,(0,V.jsx)(`div`,{className:`question-text prose`,children:(0,V.jsx)(Mf,{text:e.issue||n.question,sessionId:n.sessionId})}),e.evidence&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Evidence`}),(0,V.jsx)(`div`,{className:`question-text prose`,children:(0,V.jsx)(Mf,{text:e.evidence,sessionId:n.sessionId})})]}),!!e.options?.length&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Options`}),(0,V.jsx)(`ol`,{className:`slip-options`,children:e.options.map(t=>{let r=(e.opinions??[]).filter(e=>e.pick===t.key).map(e=>e.who);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`strong`,{children:t.label.replace(/\*\*/g,``)}),t.detail&&(0,V.jsx)(`div`,{className:`prose`,children:(0,V.jsx)(Mf,{text:t.detail,sessionId:n.sessionId})}),t.cost&&(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsx)(`b`,{children:`Cost`}),` · `,t.cost]}),r.length>0&&(0,V.jsxs)(`div`,{className:`picked-by`,children:[(0,V.jsx)(`b`,{children:`Picked by`}),` `,r.join(`, `)]})]},t.key)})}),(0,V.jsx)(`span`,{className:`muted hint`,children:`Your verdicts on the shots are the answer.`})]})]}),(0,V.jsx)(`h3`,{ref:se,children:E.group}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`span`,{className:`chip`,children:[w+1,` / `,l.length]}),E.facts.map(e=>(0,V.jsx)(`span`,{className:`chip`,children:e},e)),(0,V.jsx)(`span`,{className:`chip mono`,children:E.path})]}),(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Look for`}),(0,V.jsx)(`p`,{children:E.lookFor})]}),E.doneWhen&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Judge against (the done-condition)`}),(0,V.jsx)(`p`,{children:E.doneWhen})]}),E.opinions.length>0&&(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`What the others thought`}),E.opinions.map((e,t)=>(0,V.jsxs)(`div`,{className:`op${e.verdict?` ${e.verdict}`:``}`,children:[(0,V.jsx)(`small`,{children:e.who}),e.verdict&&(0,V.jsx)(`strong`,{className:e.verdict,children:Wh[e.verdict]}),(0,V.jsx)(`p`,{children:e.text})]},t))]}),r?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`sblk slip-verdict`,children:[(0,V.jsx)(`span`,{className:`lbl`,children:`Your verdict`}),de]}),(0,V.jsxs)(`div`,{className:`sblk`,children:[(0,V.jsx)(`label`,{className:`lbl`,htmlFor:`shot-note`,children:`Note on this shot`}),(0,V.jsx)(fg,{value:D?.note??``,focus:f,onChange:j},`${n.id}:${T}`)]}),(0,V.jsxs)(`div`,{className:`send-blk`,children:[(0,V.jsxs)(`div`,{className:P?`shot-count missing`:`muted`,children:[O,` of `,n.shots.length,` judged`,P>0&&` · ${P} without a verdict`]}),re.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[Object.keys(a.carried).length,` verdict`,Object.keys(a.carried).length===1?``:`s`,` carried over from `,re.map(e=>`#${e}`).join(`, `),`, withdrawn while you judged `,re.length===1?`it`:`them`,`; ringed on the strip until you judge `,Object.keys(a.carried).length===1?`it`:`them`,` here.`]}),(0,V.jsx)(`label`,{className:`lbl`,htmlFor:`shot-answer-note`,children:`Note to the asker (optional)`}),(0,V.jsx)(`textarea`,{...t,id:`shot-answer-note`,className:`answer-box`,rows:2,placeholder:`Anything to go with the verdicts`,value:a.note,onChange:e=>x({...a,note:e.target.value})}),(0,V.jsx)(`div`,{className:`actions`,children:(0,V.jsx)(`button`,{className:ne?`deny`:`allow`,disabled:m||!O,onClick:N,children:ne?`Send with ${P} without a verdict`:`Send verdicts`})}),ne&&P>0?(0,V.jsxs)(`p`,{className:`error`,children:[P===1?`1 shot has`:`${P} shots have`,` no verdict yet; this is the first. Give `,P===1?`it`:`them`,` one, or press "Send with `,P,` without a verdict" to send `,P===1?`it`:`them`,` as "no verdict".`]}):(0,V.jsxs)(`span`,{className:`muted hint`,children:[O>0&&P>0&&`Send shows the shots without a verdict first. `,(0,V.jsxs)(`span`,{className:`kbd-hint`,children:[(0,V.jsx)(`kbd`,{children:`Ctrl`}),`+`,(0,V.jsx)(`kbd`,{children:`Enter`}),` sends`]})]}),g&&(0,V.jsx)(`p`,{className:`error`,children:g}),(0,V.jsx)(cg,{busy:m,onWithdraw:()=>void te(()=>R.withdrawQuestion(n.id))})]})]}):(0,V.jsx)(`div`,{className:`send-blk`,children:n.status===`answered`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{className:`lbl`,children:[`Answer`,n.answeredBy===`user`?` from ${e.userName}`:``]}),(0,V.jsx)(`pre`,{className:`shot-answer`,children:n.answer}),(0,V.jsx)(`span`,{className:`muted`,children:n.deliveredAt?`delivered ${Dg(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),ag(a)>0&&(0,V.jsxs)(`p`,{className:`error`,children:[`It was withdrawn while you judged it: your `,ag(a),` verdict`,ag(a)===1?` was`:`s were`,` not sent. In this tab, until it is reloaded, a question of this project with the same shots takes them where it has no verdict yet.`]})]})}),(0,V.jsx)(`div`,{children:(0,V.jsx)(`button`,{className:`small${s?` on`:``}`,"aria-pressed":s,onClick:M,title:`Order (O)`,children:`Looks off first`})}),(0,V.jsxs)(`div`,{className:`keys`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` shot`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`↑`}),(0,V.jsx)(`kbd`,{children:`↓`}),` issue`]}),r&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),(0,V.jsx)(`kbd`,{children:`2`}),(0,V.jsx)(`kbd`,{children:`3`}),` verdict, then next`]}),r&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`O`}),` order`]}),e.onGoToConversation&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),e.onToggleSidebar&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]})]})]})]})}function fg(e){let t=B(),[n,r]=(0,v.useState)(null),[i]=(0,v.useState)(e.focus);return(0,v.useEffect)(()=>{e.focus!==i&&n?.focus()},[e.focus]),(0,V.jsx)(`textarea`,{...t,id:`shot-note`,ref:r,className:`answer-box`,rows:2,placeholder:sg()?`Write here`:`N to write, Esc to leave`,value:e.value,onChange:t=>e.onChange(t.target.value)})}var pg=e=>e.shots?.length?`${e.shots.length} screenshot${e.shots.length===1?``:`s`}`:null;function mg(e){let t=B(),n=e.question,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(null),l=async e=>{o(!0),c(null);try{await e()}catch(e){c(e.message)}finally{o(!1)}},u=n.details?.review?n.details:null,d=u?null:pg(n),f=u?n.status===`open`?`Open the review`:`Show the review`:n.status===`open`?`Judge in the screenshot view`:`Show the screenshots`,p=(d||u)&&(e.onOpenInDesk?(0,V.jsx)(`button`,{className:`small`,onClick:e.onOpenInDesk,children:f}):(0,V.jsx)(`a`,{className:`button-link`,href:`#/waiting/q/${n.id}`,children:f})),m=n.shots?.length?(0,V.jsx)(`div`,{className:`chat-thumbs`,children:n.shots.map((e,t)=>(0,V.jsx)(`img`,{src:Tf(n.sessionId,e.path),alt:e.path,title:`${e.group} · ${e.path}`},t))}):null,h=(0,V.jsxs)(`div`,{className:`card-head`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,n.id]}),e.from&&(0,V.jsxs)(V.Fragment,{children:[` · from `,(0,V.jsx)(`strong`,{children:e.from})]}),e.session&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`button`,{className:`link`,onClick:e.session.onOpen,children:e.session.title}),(0,V.jsxs)(`span`,{className:`muted`,children:[` (`,S(e.session.project),`)`]})]}),(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,Dg(n.askedAt)]}),n.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · to manager "`,e.titleOf?.(n.addressedTo)??`manager`,`"`]}),n.aboutQuestion!==null&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · about #`,n.aboutQuestion]}),d&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`chip shot-chip`,children:d})]}),u&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`})]})]}),g=u?(0,V.jsx)(`div`,{className:`question-text`,children:(0,V.jsx)(`strong`,{children:u.title})}):(0,V.jsx)(`div`,{className:`question-text`,children:(0,V.jsx)(Mf,{text:n.question,onOpenFile:e.onOpenFile})}),_=n.answeredBy===`user`?n.forwardedFrom===null?e.userName:`${e.userName} (passed on by the manager)`:`Manager "${e.titleOf?.(n.answeredBy??``)??`manager`}", under its standing grant`;return n.status===`open`?(0,V.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-open${e.focus?` focus`:``}`,children:[h,g,m,n.aboutRequest&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. "Allow once" allows it once; any other answer denies it, with your words as the reason.`]}),n.options&&!p&&(0,V.jsx)(`div`,{className:`question-options`,children:n.options.map(e=>(0,V.jsx)(`button`,{type:`button`,className:`option${r===e?` on`:``}`,onClick:()=>i(e),children:e},e))}),!p&&(0,V.jsx)(`textarea`,{...t,className:`answer-box`,placeholder:n.aboutRequest?`Choose above, or type why you deny it`:n.options?`Choose above or type your answer`:`Type your answer`,value:r,onChange:e=>i(e.target.value),rows:2}),(0,V.jsxs)(`div`,{className:`actions`,children:[p||(0,V.jsx)(`button`,{className:`allow`,disabled:a||!r.trim(),onClick:()=>l(()=>R.answerQuestion(n.id,r)),children:`Answer`}),e.onOpenInDesk&&!p&&(0,V.jsx)(`button`,{className:`small`,title:`Open it in Waiting for you`,onClick:e.onOpenInDesk,children:`Open in Waiting for you`})]}),s&&(0,V.jsx)(`p`,{className:`error`,children:s}),(0,V.jsx)(cg,{busy:a,onWithdraw:()=>void l(()=>R.withdrawQuestion(n.id))})]}):(0,V.jsxs)(`div`,{id:`qc-${n.id}`,className:`card question-done ${n.status}${e.focus?` focus`:``}`,children:[h,g,m,n.status===`answered`?(0,V.jsxs)(`p`,{children:[(0,V.jsxs)(`strong`,{children:[_,`:`]}),` `,d||u?(0,V.jsxs)(`span`,{className:`shot-answer`,children:[`
|
|
79
|
+
`,n.answer]}):n.answer,(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,n.deliveredAt?`delivered ${Dg(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]}),p&&(0,V.jsx)(`div`,{className:`actions`,children:p})]})}var hg=80;function gg(e,t,n){return n<=0?null:Math.max(0,e-t-n)}function _g(e){return e<hg}function vg(e,t,n,r){return Math.max(0,n-r-(e?0:t))}function yg(e){return e.addressedTo===`user`?e.sessionId:e.addressedTo}function bg(e,t=null){return t===null?`#/s/${e}`:`#/s/${e}/q/${t}`}function xg(e){let t=e.match(/^#\/s\/([\w-]+)(?:\/q\/(\d+))?$/);return t?{sessionId:t[1],questionId:t[2]?Number(t[2]):null}:null}function Sg(e,t){return`#/s/${e}/m/${t}`}function Cg(e){let t=e.match(/^#\/s\/([\w-]+)\/m\/(\d+)$/);return t?{sessionId:t[1],messageId:Number(t[2])}:null}function wg(e,t,n){return e.filter(e=>e.sessionId!==t&&yg(e)===t&&(n===null||e.askedAt>=n)).sort((e,t)=>e.askedAt-t.askedAt||e.id-t.id)}function Tg(e,t){let n=[...e];for(let e of t){let t=n.length;for(;t>0&&n[t-1].at>e.at;)t--;n.splice(t,0,e)}return n}function Eg(e,t,n){return t?[...e]:e.filter(e=>e.id===n)}function Dg(e){let t=new Date(e),n=t.toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`});return t.toDateString()===new Date().toDateString()?n:`${t.toLocaleDateString([],{month:`short`,day:`numeric`})}, ${n}`}function Og(e){return typeof e==`string`?e:Array.isArray(e)?e.map(e=>e?.type===`text`?e.text:e?.type===`image`?`[image]`:``).join(`
|
|
80
|
+
`):``}function kg(e){let t=[],n=new Map;for(let r of e){let e={at:r.at};if(r.kind===`user`)t.push({...e,key:`${r.id}`,type:`user`,text:r.data.text,byLedung:r.data.from===`ledung`||!!r.data.answerTo,context:r.data.context??null});else if(r.kind===`question`)t.push({...e,key:`${r.id}`,type:`question`,questionId:r.data.questionId});else if(r.kind===`event`)t.push({...e,key:`${r.id}`,type:`event`,text:r.data.text});else if(r.kind===`shell`)t.push({...e,key:`${r.id}`,type:`shell`,block:r.data});else if(r.kind===`permission`)t.push({...e,key:`${r.id}`,type:`permission`,permissionId:r.data.permissionId,toolName:r.data.toolName,input:r.data.input});else if(r.kind===`sdk`){let i=r.data,a=i.parent_tool_use_id!=null;if(i.type===`assistant`){let o=!1;(i.message?.content??[]).forEach((i,s)=>{if(i.type===`text`&&i.text.trim()&&(t.push({...e,key:`${r.id}.${s}`,type:`assistant`,text:i.text,sub:a,...o?{}:{anchor:r.id}}),o=!0),i.type===`tool_use`){let o={...e,key:`${r.id}.${s}`,type:`tool`,name:i.name,input:i.input??{},result:null,sub:a};n.set(i.id,o),t.push(o)}})}else if(i.type===`user`&&Array.isArray(i.message?.content))for(let e of i.message.content){let t=e.type===`tool_result`?n.get(e.tool_use_id):void 0;t&&(t.result={text:Og(e.content),isError:!!e.is_error,cut:uh(e)})}else if(i.type===`system`&&i.subtype===`init`)t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Claude Code ${i.claude_code_version} · ${i.model} · ${i.cwd}`});else if(i.type===`system`&&i.subtype===`compact_boundary`)t.push({...e,key:`${r.id}`,type:`divider`,text:`${ch(i.compact_metadata)} Everything above stays here, but the session itself now only has a summary of it.`});else if(i.type===`system`&&i.subtype===`task_notification`)t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Background task ${i.status??`finished`}: ${i.summary??i.task_id??``}`});else if(i.type===`result`){let n=i.duration_ms?` in ${(i.duration_ms/1e3).toFixed(0)} s`:``;if(i.subtype===`success`)i.num_turns>0&&t.push({...e,key:`${r.id}`,type:`note`,technical:!0,text:`Turn finished${n}`});else{let n=i.subtype===`error_during_execution`?`Turn stopped`:`Turn ended: ${String(i.subtype).replace(/_/g,` `)}`;t.push({...e,key:`${r.id}`,type:`note`,technical:!1,text:n})}}}}let r=sh(t.map(e=>e.type===`assistant`?{kind:`text`,text:e.text,sub:e.sub}:e.type===`tool`?{kind:`tool`,name:e.name,sub:e.sub}:e.type===`user`||e.type===`note`?{kind:`end`}:{kind:`other`}));return t.forEach((e,t)=>{e.type===`assistant`&&r.has(t)&&(e.quiet=!0)}),t}function Ag(e){let t=new Map;for(let n of e)n.kind===`decision`&&t.set(n.data.permissionId,{...n.data,at:n.at});return t}var jg={allowed:`Allowed`,denied:`Denied`,cancelled:`Withdrawn`},Mg=(0,v.memo)(function(e){let{messages:t,permissions:n,showTechnical:r,sessionId:i,hasEarlier:a}=e,o=a?t[0]?.at??null:null,s=(0,v.useMemo)(()=>kg(t),[t]),c=e.focusQuestion??null,l=(0,v.useMemo)(()=>i?Eg(wg(Object.values(e.questions),i,o),r,c):[],[e.questions,i,o,r,c]),u=(0,v.useMemo)(()=>Tg(s,l.map(e=>({key:`q${e.id}`,at:e.askedAt,type:`question`,questionId:e.id}))),[s,l]),d=(0,v.useMemo)(()=>Ag(t),[t]),f=(0,v.useRef)(null),p=(0,v.useRef)(!0),m=(0,v.useRef)(null),h=e.focusMessage??null,g=c===null?h===null?null:`#mc-${h}`:`#qc-${c}`,_=(0,v.useRef)(null);(0,v.useLayoutEffect)(()=>{let n=f.current;if(n){if(g!==null&&m.current!==g&&t.length>0){let r=n.querySelector(g);if(r){m.current=g,p.current=!1,r.scrollIntoView({block:`center`});return}let i=t[0]?.id??null;i!==null&&a&&_.current!==i&&(_.current=i,e.onLoadEarlier())}p.current&&(n.scrollTop=n.scrollHeight)}},[u,r,g,a]),(0,v.useEffect)(()=>{p.current=m.current===null},[t.length===0]);let y=(0,v.useRef)(0);return(0,v.useEffect)(()=>{let e=f.current;if(!e)return;let t=new ResizeObserver(()=>{e.clientHeight<=0||(e.scrollTop=vg(p.current,y.current,e.scrollHeight,e.clientHeight))});return t.observe(e),()=>t.disconnect()},[]),(0,V.jsxs)(`div`,{className:`messages`,ref:f,onScroll:e=>{let t=e.currentTarget,n=gg(t.scrollHeight,t.scrollTop,t.clientHeight);n!==null&&(y.current=n,p.current=_g(n))},children:[e.hasEarlier&&(0,V.jsx)(`button`,{className:`load-earlier`,onClick:e.onLoadEarlier,children:`Load earlier messages`}),u.map(t=>(0,V.jsx)(Fg,{item:t,showTechnical:r,userName:e.userName,tint:e.tint,sessionId:i,onQuote:e.onQuote,onOpenFile:e.onOpenFile,onOpenBoardThread:e.onOpenBoardThread,onOpenQuestion:e.onOpenQuestion,titleOf:t.type===`question`||t.type===`permission`?e.titleOf:void 0,question:t.type===`question`?e.questions[t.questionId]:void 0,focused:t.type===`question`?t.questionId===c:t.type===`assistant`&&t.anchor!==void 0&&t.anchor===h,live:t.type===`permission`?n[t.permissionId]:void 0,decision:t.type===`permission`?d.get(t.permissionId):void 0},t.key))]})});function Ng(e,t){if(e===t)return!0;if(!e||!t)return!1;let n=e,r=t,i=Object.keys(n);return i.length===Object.keys(r).length&&i.every(e=>n[e]===r[e]||e===`result`&&Ng(n[e],r[e]))}function Pg(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(n=>n===`item`||n===`decision`?Ng(e[n],t[n]):e[n]===t[n])}var Fg=(0,v.memo)(function(e){let{item:t,showTechnical:n,sessionId:r}=e,i=(0,V.jsx)(`time`,{className:`time`,children:Dg(t.at)}),a=(n,r)=>e.onQuote&&(0,V.jsx)(`button`,{className:`quote-button`,title:`Quote this message in your reply`,onClick:()=>e.onQuote(n,t.at,r),children:`Quote`});switch(t.type){case`user`:{let r=t.byLedung&&!n?fh(t.text):t.text,o=r||t.context||``,s=He(t.byLedung,r,t.context,n);return s&&!s.length?null:s?.some(e=>e.type===`board`)?(0,V.jsx)(`div`,{className:`board-delivery`,children:s.map((t,n)=>t.type===`board`?(0,V.jsx)(zn,{mark:t.mark,time:i,onOpenThread:e.onOpenBoardThread},n):(0,V.jsxs)(`div`,{className:`msg delivery answer`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:`Delivered by Ledung`}),i]}),(0,V.jsx)(`div`,{className:`msg-body plain`,children:t.text})]},n))}):(0,V.jsxs)(`div`,{className:`msg ${r?`user`:`delivery`}${t.byLedung?` answer`:``}`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:t.byLedung?`Delivered by Ledung`:e.userName}),i,a(t.byLedung?`Ledung`:e.userName,o)]}),(0,V.jsx)(`div`,{className:`msg-body plain`,children:o}),t.context&&r&&(0,V.jsxs)(`details`,{className:`delivered-context`,children:[(0,V.jsxs)(`summary`,{children:[`Attached context (not from `,e.userName,`)`]}),(0,V.jsx)(`div`,{className:`plain`,children:t.context})]})]})}case`assistant`:return(t.sub||t.quiet)&&!n?null:(0,V.jsxs)(`div`,{id:t.anchor===void 0?void 0:`mc-${t.anchor}`,className:`msg assistant${t.sub?` sub`:``}${e.tint?` tinted`:``}${e.focused?` focus`:``}`,style:e.tint,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:t.sub?`Subagent`:`Claude`}),i,a(t.sub?`Subagent`:`Claude`,t.text)]}),(0,V.jsx)(`div`,{className:`msg-body`,children:(0,V.jsx)(Mf,{text:t.text,onOpenFile:e.onOpenFile})})]});case`event`:return(0,V.jsxs)(`div`,{className:`event`,children:[t.text,` `,i]});case`shell`:{let n=t.block,r=eh(n);return(0,V.jsxs)(`div`,{className:`msg user shell`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsxs)(`span`,{className:`who`,children:[e.userName,` ran`]}),i]}),(0,V.jsxs)(`pre`,{className:`shell-output`,children:[(0,V.jsxs)(`span`,{className:`shell-command`,children:[`$ `,n.command]}),n.stdout?`
|
|
81
81
|
${n.stdout.replace(/\s+$/,``)}`:``,n.stderr?(0,V.jsx)(`span`,{className:`shell-stderr`,children:`
|
|
82
|
-
${n.stderr.replace(/\s+$/,``)}`}):null]}),(0,V.jsx)(`div`,{className:`shell-footer${r.problem?` problem`:``}`,children:r.text})]})}case`question`:{let t=e.question;return t?(0,V.jsx)(
|
|
83
|
-
`)}var Ug=e=>({[e-1]:`=`,[e-2]:`=`}),Wg=(e,t)=>Array(e).fill(t);function Gg(e){let t=Math.round((e-6)/2)-1,n={width:e,sprites:[{rows:Vg,x:t-1,overWater:!0}]},r=t-4,i=t+4;return{width:e,stop:t,near:n,left:r,right:i,gathered:{width:e,sprites:[{rows:Bg,x:r,y:1,overWater:!0},{rows:Bg,x:i,y:1,overWater:!0},...n.sprites]},sideAt:t=>({width:e,sprites:[{rows:Ig,x:t}],water:Ug(t)})}}function Kg(e){return e?.sprites?.at(-1)?.x??-6}function qg(e,t,n=e.stop){let r=[];if(t>n){for(let n=t;n<e.width;n++)r.push(e.sideAt(n));t=-6}for(let i=t;i<=n;i++)r.push(e.sideAt(i));return r}function Jg(e,t=0,n=20){let r=[7,12].slice(0,Math.min(t,2)),i=6+(r.at(-1)??0),a=[];for(let e=-6;e<n+i-6;e++){let t={};for(let n of r)t[e-n-1]=`-`;a.push({width:n,sprites:[...r.map(t=>({rows:Lg,x:e-t})),{rows:Ig,x:e}],water:{...t,...Ug(e)}})}let o=Math.max(0,Math.min(a.length-1,e+6));return{scenes:[...a.slice(o),...a.slice(0,o)],loopFrom:0}}function Yg(e,t,n=20){let r=Gg(n),i=r.stop,a=[...qg(r,e),...Wg(3,{width:n,sprites:[{rows:zg,x:i}]}),...Wg(3,{width:n,sprites:[{rows:Bg,x:i}]}),...Wg(4,{width:n,sprites:[{rows:Bg,x:i}],water:{[i+1]:`(`,[i+5]:`)`}}),...Wg(4,{...r.near,water:{[i]:`(`,[i+7]:`)`}})];if(t===`fleet`)return Xg(r,a);let o=a.length;return a.push(...Zg(r,t)),{scenes:a,loopFrom:o}}function Xg(e,t=[]){let n=[...t],r=e.near.sprites;for(let t=0;t<=8;t++){let i=-4+Math.round((e.left+4)*t/8),a=e.width+Math.round((e.right+1-e.width)*t/8);n.push({width:e.width,sprites:[{rows:Lg,x:i},{rows:Rg,x:a},...r],water:{[i-1]:`-`,[a+4]:`-`}})}n.push(...Wg(3,{width:e.width,sprites:[e.gathered.sprites[0],{rows:Rg,x:e.right+1},...r]}));let i=n.length;return n.push(e.gathered),{scenes:n,loopFrom:i}}function Zg(e,t){if(t===`fleet`)return[e.gathered];if(t===`none`)return[e.near];let n=[];for(let t=-5;t<e.width+2;t++)n.push({width:e.width,sprites:[{rows:Lg,x:t},...e.near.sprites],water:{[t-1]:`-`}});return n}function Qg(e,t=20){return{scenes:Zg(Gg(t),e),loopFrom:0}}function $g(e=20){return Xg(Gg(e))}function e_(e=0,t=20){let n=Gg(t),r=n.stop,i=n.left-1,a=n.right+3,o=e=>[{rows:Lg,x:i+e},{rows:Lg,x:a+e}],s=[...Wg(3,{width:t,sprites:[n.gathered.sprites[0],n.gathered.sprites[1],{rows:Bg,x:r}],water:{[r+2]:`.`,[r+4]:`.`}}),...Wg(3,{width:t,sprites:[...o(0),{rows:zg,x:r}]}),...Wg(2,{width:t,sprites:[...o(0),{rows:Ig,x:r}]})];for(let e=1;i+e<t;e++)s.push({width:t,sprites:[...o(e),{rows:Ig,x:r+e}],water:{[i+e-1]:`-`,[a+e-1]:`-`,...Ug(r+e)}});let c=s.length;return s.push(...Jg(-6,e,t).scenes),{scenes:s,loopFrom:c}}function t_(e=20){let t=e_(0,e),n=Yg(-6,`none`,e);return{scenes:[...t.scenes.slice(0,t.loopFrom),...n.scenes],loopFrom:t.loopFrom+n.loopFrom}}function n_(e=0,t=20){let n=Gg(t).stop,r=[...Wg(3,{width:t,sprites:[{rows:Bg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Wg(3,{width:t,sprites:[{rows:zg,x:n}]}),...Wg(2,{width:t,sprites:[{rows:Ig,x:n}]})],i=r.length;return r.push(...Jg(n+1,e,t).scenes),{scenes:r,loopFrom:i}}function r_(e,t=20){let n=Gg(t),r=n.stop+1,i=e=>({width:t,...e}),a=[...qg(n,e,r),...Wg(3,i({sprites:[{rows:Ig,x:r,shear:[1,0,0]}]})),...Wg(3,i({sprites:[{rows:Ig,x:r,shear:[2,1,0]}],marks:[{x:r-1,y:2,ch:`~`},{x:r+6,y:2,ch:`~`}]})),...Wg(3,i({sprites:[{rows:Ig,x:r,y:1,shear:[2,1,0]}],water:{[r]:`*`,[r+6]:`*`}})),...Wg(3,i({sprites:[{rows:Ig,x:r,y:2,shear:[2,1,0]}],water:{[r+2]:`o`}})),...Wg(2,i({marks:[{x:r+3,y:2,ch:`o`}],water:{[r+3]:`.`}})),...Wg(2,i({marks:[{x:r+3,y:1,ch:`o`},{x:r+2,y:2,ch:`.`}]})),...Wg(2,i({marks:[{x:r+3,y:0,ch:`.`},{x:r+2,y:1,ch:`o`}]})),...Wg(2,i({marks:[{x:r+2,y:0,ch:`.`}]}))],o=a.length;return a.push(i({})),{scenes:a,loopFrom:o}}function i_(e=20){return{scenes:[{width:e}],loopFrom:0}}function a_(e=20){let t=Gg(e),n=Math.max(t.left,0),r=[];for(let i=-4;i<=n;i++)r.push({width:e,sprites:[{rows:Lg,x:i},...t.near.sprites],water:{[i-1]:`-`}});let i=r.length,a=r=>({width:e,sprites:[{rows:Lg,x:n},...t.near.sprites],marks:r?[{x:n+1,y:0,ch:`.`}]:[]});return r.push(...Wg(3,a(!0)),...Wg(3,a(!1))),{scenes:r,loopFrom:i}}function o_(e=20){let t=Gg(e),n=t.stop,r=Math.max(t.left,0),i={rows:Lg,x:r},a=[...Wg(3,{width:e,sprites:[i,{rows:Bg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Wg(3,{width:e,sprites:[i,{rows:zg,x:n}]}),...Wg(2,{width:e,sprites:[i,{rows:Ig,x:n}]})];for(let t=n+1;t<e;t++)a.push({width:e,sprites:[i,{rows:Ig,x:t}],water:Ug(t)});for(let t=r+1;t<=n+1;t++)a.push({width:e,sprites:[{rows:Lg,x:t}],water:{[t-1]:`-`}});a.push(...Wg(3,{width:e,sprites:[{rows:Bg,x:n}]}),...Wg(4,{width:e,sprites:[{rows:Bg,x:n}],water:{[n+1]:`(`,[n+5]:`)`}}));let o=a.length;return a.push(t.near),{scenes:a,loopFrom:o}}function s_(e=20){let t=Gg(e),n=[];for(let r=Math.max(t.left,0)+1;r<e;r++)n.push({width:e,sprites:[{rows:Lg,x:r},...t.near.sprites],water:{[r-1]:`-`}});let r=n.length;return n.push(t.near),{scenes:n,loopFrom:r}}var c_=[50,33,25,20,10],l_=[Ig,[` |\\ `,` |.\\ `,`\\____/`],[` |\\ `,` | \\ `,`\\_.__/`],[` | `,` |\\ `,`\\_.__/`],[` / `,` |\\ `,`\\_. _/`],[` , `,` /| `,`\\_. ./`],[` `,` , `,`\\_. /`]],u_=[Lg,[``,` |\\ `,`\\_./`],[``,` |. `,`\\_./`],[``,` | `,`\\_./`],[``,` / `,`\\_./`],[``,` , `,`\\. /`],[``,` `,` ._,`]],d_=l_.length-1,f_={ship:{stages:l_,length:6},boat:{stages:u_,length:4}},p_=(e,t)=>e.map(e=>[...e.padEnd(t)].reverse().map(e=>e===`/`?`\\`:e===`\\`?`/`:e).join(``)),m_={ship:l_.map(e=>p_(e,6)),boat:u_.map(e=>p_(e,4))},h_=[1,2,5,10,20,25],g_=(e,t=`ship`)=>h_.find(n=>n>=50/(e-f_[t].length))??25;function __(e,t,n=`ship`){let r=Math.max(0,Math.min(100,e));if(r>=100)return 100;if(r>=90)return 90+Math.floor((r-90)/2)*2;let i=g_(t,n);return Math.floor(r/i)*i}var v_=e=>e<90?0:Math.min(d_,Math.floor((e-90)/2)+1),y_=(e,t,n=`ship`)=>Math.round(e/100*(t-f_[n].length)),b_=(e,t)=>({...e>=3?{[t-3]:`.`,[t-5]:`,`}:{},...e>=5?{[t-7]:`.`}:{},...e>=d_?{[t+1]:`o`,[t+5]:`o`,[t-9]:`,`}:{}}),x_=e=>Object.fromEntries(Array.from({length:Math.max(0,e)},(e,t)=>[t,`_`])),S_={0:[` _ `,`| |`,`|_|`],1:[` `,`|`,`|`],2:[` _ `,` _|`,`|_ `],3:[` _ `,` _|`,` _|`],4:[` `,`|_|`,` |`],5:[` _ `,`|_ `,` _|`],6:[` _ `,`|_ `,`|_|`],7:[` _ `,` |`,` |`],8:[` _ `,`|_|`,`|_|`],9:[` _ `,`|_|`,` _|`],"%":[` `,`o/ `,`/o `]},C_=e=>[0,1,2].map(t=>[...e].map(e=>S_[e]?.[t]??``).join(` `));function w_(e,t,n,r,i=`ship`){let a=C_(r),o=r===`100%`?`100%`:`00%`,s=[];return C_(o)[0].length+1<=n?a.forEach((e,t)=>[...e].forEach((e,n)=>{e!==` `&&s.push({x:n,y:t,ch:e})})):o.length<=n&&(s=[...r].map((e,t)=>({x:t,y:0,ch:e}))),{scene:{width:e,sprites:[{rows:f_[i].stages[t],x:n,shear:t===4&&i===`ship`?[1,0,0]:[]}],water:{...x_(n),...t>=d_?{}:Ug(n),...b_(t,n)},marks:s},number:s}}function T_(e,t,n,r=`ship`){let i=f_[r].length,a={...t>=d_?{}:{[n+i]:`=`,[n+i+1]:`=`},...t>=3?{[n+i+2]:`.`,[n+i+4]:`,`}:{}};return{width:e,sprites:[{rows:m_[r][t],x:n,shear:t===4&&r===`ship`?[-1,0,0]:[]}],water:{...x_(n),...a}}}function E_(e,t,n=`ship`){return{width:e,sprites:[{rows:f_[n].stages[0],x:t}],water:n===`ship`?Ug(t):{[t-1]:`-`}}}var D_=(e,t,n=96)=>Math.round((e-1)/(t-1)*(n-6)),O_=(e,t,n=96)=>D_(e,t,n)+3-1;function k_(e,t,n,r,i=96){let a=r?n===`right`?Ug(e):{[e+6]:`=`,[e+6+1]:`=`}:{};for(let e=1;e<=t;e++)a[O_(e,t,i)]=`o`;return{width:i,sprites:[{rows:n===`right`?Ig:m_.ship[0],x:e}],water:a}}var A_=180;function j_(e,t){let n=t.filter(t=>t.parentId===e.id),r=n.filter(e=>e.status===`running`).length,i=n.filter(e=>e.status!==`ended`).length,a=e.clearedAt;if(e.clearDue!=null&&e.status!==`ended`)return{kind:`clearing`,clearedAt:a};let o=s();return o&&{...o,clearedAt:a};function s(){switch(e.status){case`running`:return e.paused?{kind:`stopped`,behind:c()}:{kind:`working`,followers:e.role===`manager`?r:0};case`stopping`:return{kind:`working`,followers:e.role===`manager`?r:0};case`starting`:case`waiting`:case`idle`:return{kind:`stopped`,behind:c()};case`ended`:return{kind:`sunk`};default:return null}}function c(){return r>0||e.backgroundTasks>0?`busy`:e.role===`manager`&&i>0?`fleet`:`none`}}var M_=[7,6,5,4],N_=5,P_=e=>M_[(M_.indexOf(e)+1)%M_.length],F_=new Map;function I_(e,t){let n=F_.get(e);if(n)return n;let r=()=>{try{let n=Number(localStorage.getItem(e));return M_.includes(n)?n:t}catch{return t}},i=new Set,a=r(),o={get:()=>a,set(t){a=t;try{localStorage.setItem(e,String(t))}catch{}for(let e of i)e()},subscribe(t){i.add(t);let n=n=>{n.key===e&&(a=r(),t())};return window.addEventListener(`storage`,n),()=>{i.delete(t),window.removeEventListener(`storage`,n)}}};return F_.set(e,o),o}function L_(e,t){let n=I_(e,t),r=(0,v.useSyncExternalStore)(n.subscribe,n.get);return{size:r,next:P_(r),step:()=>n.set(P_(r))}}function R_(e,t,n,r,i){let a=Kg(n?.scenes[r]);if(t?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`)return e.clearedAt!=null&&e.clearedAt!==t.clearedAt?o_(i):s_(i);switch(e.kind){case`clearing`:return a_(i);case`working`:return t?.kind===`stopped`?t.behind===`fleet`?e_(e.followers,i):n_(e.followers,i):Jg(t?a:-6,e.followers,i);case`stopped`:return t?.kind===`working`?Yg(a,e.behind,i):t?.kind===`stopped`&&t.behind!==`fleet`&&e.behind===`fleet`?$g(i):t?.kind===`stopped`&&t.behind===`fleet`&&e.behind===`none`?t_(i):Qg(e.behind,i);case`sunk`:return t&&t.kind!==`sunk`?r_(a,i):i_(i)}}var z_=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function B_({mode:e,width:t=20,sizeButton:n=!0,hideWhenSunk:r=!1,maxSize:i}){let a=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=(0,v.useRef)(null),s=(0,v.useRef)(0),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(0),{size:d,next:f,step:p}=L_(`ledung.shipSize`,N_),m=(o.current?.oneShot??!1)&&s.current<o.current.loopFrom;if(!z_(c.current,e)&&!m){let n=a&&e.kind===`working`?Jg(4,e.followers,t):R_(e,c.current,o.current,s.current,t),r=c.current?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`;o.current=n,s.current=a?n.loopFrom:0,r&&(n.oneShot=!0),c.current=r?{kind:`stopped`,behind:`none`,clearedAt:e.clearedAt}:e}(0,v.useEffect)(()=>{if(a)return;let e=setInterval(()=>{let e=o.current;e&&(s.current=s.current+1<e.scenes.length?s.current+1:e.loopFrom),u(e=>e+1)},A_);return()=>clearInterval(e)},[a]);let h=o.current;if(r&&e.kind===`sunk`&&s.current>=h.loopFrom)return null;let g=h.scenes[s.current],_=(0,V.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${i?Math.min(d,i):d}px`},"aria-hidden":`true`,children:Hg(g,a?0:l)});return n?(0,V.jsx)(`button`,{type:`button`,className:`ship-button`,title:`Ship size ${d}px: click for ${f}px`,onClick:p,children:_}):_}function V_(e,t){let n=null,r=null,i=new Map,a=!1;for(let o of e){if(o.kind===`user`&&(n=o.at,r=null,i.clear(),a=!1),o.kind!==`sdk`)continue;let e=o.data;if(e.type===`assistant`&&e.parent_tool_use_id==null)for(let n of e.message?.content??[])if(n.type===`tool_use`){let e=Ih(n.name,n.input??{});i.set(n.id,{label:e?`${n.name}: ${e}`:n.name,uacWait:t&&k(n.name,n.input??{})}),a=!1}else n.type===`text`&&n.text.trim()&&(a=!0);else if(e.type===`user`&&Array.isArray(e.message?.content))for(let t of e.message.content)t.type===`tool_result`&&i.delete(t.tool_use_id);else e.type===`result`&&e.num_turns>0&&(r=o.at,i.clear())}let o=[...i.values()].pop(),s=o?`Running ${o.label}`:a?`Writing`:`Thinking`;return{since:n,doing:s,uacWait:!!o?.uacWait,finishedAt:r}}function H_(e){let t=Math.max(0,Math.floor(e/1e3));return t<60?`${t} s`:`${Math.floor(t/60)} min ${String(t%60).padStart(2,`0`)} s`}function U_(e){return e.status===`ended`&&/exited with code [1-9]|stopped unexpectedly/.test(e.endReason??``)}function W_({session:e,sessions:t,messages:n,extra:r}){let i=(0,v.useMemo)(()=>V_(n,!!e.uac),[n,e.uac]),[a,o]=(0,v.useState)(Date.now()),s=e.status===`running`||e.status===`stopping`,c=t.filter(t=>t.parentId===e.id&&t.status===`running`).length,l=j_(e,t);(0,v.useEffect)(()=>{if(!s)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[s]);let u,d;if(e.status===`waiting`)u=`waiting`,d=`Waiting for your answer above`;else if(s){u=`working`;let t=e.status===`stopping`?`Stopping`:i.doing;d=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`working-label`,children:t}),e.status===`running`&&i.uacWait&&(0,V.jsxs)(`span`,{className:`uac-hint`,children:[` · `,`may be waiting for UAC on the PC`]}),e.status===`running`&&i.since&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,H_(a-i.since)]})]})}else if(e.status===`starting`)u=`done`,d=(0,V.jsx)(`span`,{className:`working-label`,children:`Ready`});else if(e.status===`idle`)u=`done`,d=(0,V.jsxs)(`span`,{className:`working-label`,children:[`Done`,i.finishedAt?` at ${Eg(i.finishedAt)}`:``,e.backgroundTasks>0?` · ${e.backgroundTasks} background task(s) still running`:``,c>0?` · ${c} session(s) still working`:``]});else if(e.status===`ended`){let t=U_(e);u=t?`failed`:`done`;let n=e.endedAt?` at ${Eg(e.endedAt)}`:``;d=(0,V.jsx)(`span`,{className:`working-label`,children:t?`Ended with an error${n}`:`Ended${n}${e.endReason?` · ${e.endReason.split(`
|
|
84
|
-
`)[0]}`:``}`})}else return null;return l?(0,V.jsxs)(`div`,{className:`status-line ${u}`,role:`status`,"aria-live":`polite`,children:[(0,V.jsx)(
|
|
85
|
-
`).length)=>e.length<=262144&&t<=8e3;function
|
|
86
|
-
`?(t.push(r+`</span>`.repeat(n.length)),r=n.join(``)):i.startsWith(`<span`)?(n.push(i),r+=i):(i===`</span>`&&n.pop(),r+=i));return t.push(r+`</span>`.repeat(n.length)),t}function
|
|
82
|
+
${n.stderr.replace(/\s+$/,``)}`}):null]}),(0,V.jsx)(`div`,{className:`shell-footer${r.problem?` problem`:``}`,children:r.text})]})}case`question`:{let t=e.question;return t?(0,V.jsx)(mg,{question:t,userName:e.userName,onOpenFile:e.onOpenFile,titleOf:e.titleOf,from:r&&t.sessionId!==r?e.titleOf?.(t.sessionId)??`another session`:void 0,focus:e.focused,onOpenInDesk:e.onOpenQuestion&&(()=>e.onOpenQuestion(t.id))}):null}case`divider`:return(0,V.jsxs)(`div`,{className:`divider`,children:[(0,V.jsx)(`span`,{children:t.text}),` `,i]});case`note`:return t.technical&&!n?null:(0,V.jsxs)(`div`,{className:`note${t.technical?` technical`:``}`,children:[t.text,` `,i]});case`tool`:if(Ke(t.name)&&!t.sub){let n=qe(t.input),r={kind:`out`,service:``,author:``,project:null,threadId:n.threadId,title:n.title,to:n.to||`the thread`,text:n.text,note:``};return(0,V.jsxs)(`div`,{className:`board-delivery${t.result?.isError?` failed`:``}`,children:[(0,V.jsx)(zn,{mark:r,time:i,onOpenThread:e.onOpenBoardThread}),t.result&&(0,V.jsx)(`div`,{className:`note board-result${t.result.isError?` failed`:``}`,children:t.result.text.slice(0,400)})]})}return n?(0,V.jsxs)(`details`,{className:`tool${t.result?.isError?` failed`:``}`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`span`,{className:`tool-name`,children:t.name}),` `,(0,V.jsx)(`span`,{className:`tool-summary`,children:Lh(t.name,t.input)}),` `,i]}),(0,V.jsx)(`pre`,{className:`tool-input`,children:JSON.stringify(t.input,null,2)}),t.result&&(0,V.jsx)(`pre`,{className:`tool-result`,children:t.result.text.slice(0,2e4)}),t.result&&t.result.cut>0&&(0,V.jsx)(`div`,{className:`note technical tool-cut`,children:lh(t.result.cut)})]}):null;case`permission`:{let r=e.live;if(r?.status===`pending`)return(0,V.jsx)(zh,{permission:r,managerTitle:e.titleOf?.(r.addressedTo)});let a=e.decision;if(!n&&a?.behavior!==`denied`)return null;let o=a&&a.by!==`user`&&a.by!==`simon`&&a.by!==`ledung`?` by manager "${e.titleOf?.(a.by)??`manager`}"`:``,s=a?`${jg[a.behavior]??a.behavior}${a.scope===`session`?` for this session`:``}${o}`:`Asked`;return(0,V.jsxs)(`div`,{className:`note decision ${a?.behavior??``}`,children:[s,`: `,t.toolName,` `,(0,V.jsx)(`span`,{className:`tool-summary`,children:Lh(t.toolName,t.input)}),a?.message&&a.behavior===`denied`?` (“${a.message}”)`:``,` `,i]})}}},Pg),Ig=`~-~~^~-~~~^-~~-~^~~-~^~-~~`,Lg=[` |\\ `,` |_\\ `,`\\____/`],Rg=[``,` |\\ `,`\\__/`],zg=[``,` /| `,`\\__/`],Bg=[` |\\ `,` /|_\\`,` \\__/`],Vg=[` | `,` /|\\ `,` \\_/ `],Hg=[` | `,` /|\\ `,` /_|_\\ `,` \\___/ `];function Ug(e,t){let n=e.width,r=Array.from({length:4},()=>Array(n).fill(` `));r[3]=Array.from({length:n},(e,n)=>Ig[(n+t)%26]);for(let[t,i]of Object.entries(e.water??{})){let e=Number(t);e>=0&&e<n&&(r[3][e]=i)}for(let t of e.sprites??[])t.rows.forEach((e,i)=>{let a=(t.y??0)+i;if(a>=4||a===3&&!t.overWater)return;let o=t.x+(t.shear?.[i]??0);for(let t=0;t<e.length;t++){let i=o+t;e[t]!==` `&&i>=0&&i<n&&(r[a][i]=e[t])}});for(let t of e.marks??[])t.x>=0&&t.x<n&&t.y>=0&&t.y<4&&(r[t.y][t.x]=t.ch);return r.map(e=>e.join(``)).join(`
|
|
83
|
+
`)}var Wg=e=>({[e-1]:`=`,[e-2]:`=`}),Gg=(e,t)=>Array(e).fill(t);function Kg(e){let t=Math.round((e-6)/2)-1,n={width:e,sprites:[{rows:Hg,x:t-1,overWater:!0}]},r=t-4,i=t+4;return{width:e,stop:t,near:n,left:r,right:i,gathered:{width:e,sprites:[{rows:Vg,x:r,y:1,overWater:!0},{rows:Vg,x:i,y:1,overWater:!0},...n.sprites]},sideAt:t=>({width:e,sprites:[{rows:Lg,x:t}],water:Wg(t)})}}function qg(e){return e?.sprites?.at(-1)?.x??-6}function Jg(e,t,n=e.stop){let r=[];if(t>n){for(let n=t;n<e.width;n++)r.push(e.sideAt(n));t=-6}for(let i=t;i<=n;i++)r.push(e.sideAt(i));return r}function Yg(e,t=0,n=20){let r=[7,12].slice(0,Math.min(t,2)),i=6+(r.at(-1)??0),a=[];for(let e=-6;e<n+i-6;e++){let t={};for(let n of r)t[e-n-1]=`-`;a.push({width:n,sprites:[...r.map(t=>({rows:Rg,x:e-t})),{rows:Lg,x:e}],water:{...t,...Wg(e)}})}let o=Math.max(0,Math.min(a.length-1,e+6));return{scenes:[...a.slice(o),...a.slice(0,o)],loopFrom:0}}function Xg(e,t,n=20){let r=Kg(n),i=r.stop,a=[...Jg(r,e),...Gg(3,{width:n,sprites:[{rows:Bg,x:i}]}),...Gg(3,{width:n,sprites:[{rows:Vg,x:i}]}),...Gg(4,{width:n,sprites:[{rows:Vg,x:i}],water:{[i+1]:`(`,[i+5]:`)`}}),...Gg(4,{...r.near,water:{[i]:`(`,[i+7]:`)`}})];if(t===`fleet`)return Zg(r,a);let o=a.length;return a.push(...Qg(r,t)),{scenes:a,loopFrom:o}}function Zg(e,t=[]){let n=[...t],r=e.near.sprites;for(let t=0;t<=8;t++){let i=-4+Math.round((e.left+4)*t/8),a=e.width+Math.round((e.right+1-e.width)*t/8);n.push({width:e.width,sprites:[{rows:Rg,x:i},{rows:zg,x:a},...r],water:{[i-1]:`-`,[a+4]:`-`}})}n.push(...Gg(3,{width:e.width,sprites:[e.gathered.sprites[0],{rows:zg,x:e.right+1},...r]}));let i=n.length;return n.push(e.gathered),{scenes:n,loopFrom:i}}function Qg(e,t){if(t===`fleet`)return[e.gathered];if(t===`none`)return[e.near];let n=[];for(let t=-5;t<e.width+2;t++)n.push({width:e.width,sprites:[{rows:Rg,x:t},...e.near.sprites],water:{[t-1]:`-`}});return n}function $g(e,t=20){return{scenes:Qg(Kg(t),e),loopFrom:0}}function e_(e=20){return Zg(Kg(e))}function t_(e=0,t=20){let n=Kg(t),r=n.stop,i=n.left-1,a=n.right+3,o=e=>[{rows:Rg,x:i+e},{rows:Rg,x:a+e}],s=[...Gg(3,{width:t,sprites:[n.gathered.sprites[0],n.gathered.sprites[1],{rows:Vg,x:r}],water:{[r+2]:`.`,[r+4]:`.`}}),...Gg(3,{width:t,sprites:[...o(0),{rows:Bg,x:r}]}),...Gg(2,{width:t,sprites:[...o(0),{rows:Lg,x:r}]})];for(let e=1;i+e<t;e++)s.push({width:t,sprites:[...o(e),{rows:Lg,x:r+e}],water:{[i+e-1]:`-`,[a+e-1]:`-`,...Wg(r+e)}});let c=s.length;return s.push(...Yg(-6,e,t).scenes),{scenes:s,loopFrom:c}}function n_(e=20){let t=t_(0,e),n=Xg(-6,`none`,e);return{scenes:[...t.scenes.slice(0,t.loopFrom),...n.scenes],loopFrom:t.loopFrom+n.loopFrom}}function r_(e=0,t=20){let n=Kg(t).stop,r=[...Gg(3,{width:t,sprites:[{rows:Vg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Gg(3,{width:t,sprites:[{rows:Bg,x:n}]}),...Gg(2,{width:t,sprites:[{rows:Lg,x:n}]})],i=r.length;return r.push(...Yg(n+1,e,t).scenes),{scenes:r,loopFrom:i}}function i_(e,t=20){let n=Kg(t),r=n.stop+1,i=e=>({width:t,...e}),a=[...Jg(n,e,r),...Gg(3,i({sprites:[{rows:Lg,x:r,shear:[1,0,0]}]})),...Gg(3,i({sprites:[{rows:Lg,x:r,shear:[2,1,0]}],marks:[{x:r-1,y:2,ch:`~`},{x:r+6,y:2,ch:`~`}]})),...Gg(3,i({sprites:[{rows:Lg,x:r,y:1,shear:[2,1,0]}],water:{[r]:`*`,[r+6]:`*`}})),...Gg(3,i({sprites:[{rows:Lg,x:r,y:2,shear:[2,1,0]}],water:{[r+2]:`o`}})),...Gg(2,i({marks:[{x:r+3,y:2,ch:`o`}],water:{[r+3]:`.`}})),...Gg(2,i({marks:[{x:r+3,y:1,ch:`o`},{x:r+2,y:2,ch:`.`}]})),...Gg(2,i({marks:[{x:r+3,y:0,ch:`.`},{x:r+2,y:1,ch:`o`}]})),...Gg(2,i({marks:[{x:r+2,y:0,ch:`.`}]}))],o=a.length;return a.push(i({})),{scenes:a,loopFrom:o}}function a_(e=20){return{scenes:[{width:e}],loopFrom:0}}function o_(e=20){let t=Kg(e),n=Math.max(t.left,0),r=[];for(let i=-4;i<=n;i++)r.push({width:e,sprites:[{rows:Rg,x:i},...t.near.sprites],water:{[i-1]:`-`}});let i=r.length,a=r=>({width:e,sprites:[{rows:Rg,x:n},...t.near.sprites],marks:r?[{x:n+1,y:0,ch:`.`}]:[]});return r.push(...Gg(3,a(!0)),...Gg(3,a(!1))),{scenes:r,loopFrom:i}}function s_(e=20){let t=Kg(e),n=t.stop,r=Math.max(t.left,0),i={rows:Rg,x:r},a=[...Gg(3,{width:e,sprites:[i,{rows:Vg,x:n}],water:{[n+2]:`.`,[n+4]:`.`}}),...Gg(3,{width:e,sprites:[i,{rows:Bg,x:n}]}),...Gg(2,{width:e,sprites:[i,{rows:Lg,x:n}]})];for(let t=n+1;t<e;t++)a.push({width:e,sprites:[i,{rows:Lg,x:t}],water:Wg(t)});for(let t=r+1;t<=n+1;t++)a.push({width:e,sprites:[{rows:Rg,x:t}],water:{[t-1]:`-`}});a.push(...Gg(3,{width:e,sprites:[{rows:Vg,x:n}]}),...Gg(4,{width:e,sprites:[{rows:Vg,x:n}],water:{[n+1]:`(`,[n+5]:`)`}}));let o=a.length;return a.push(t.near),{scenes:a,loopFrom:o}}function c_(e=20){let t=Kg(e),n=[];for(let r=Math.max(t.left,0)+1;r<e;r++)n.push({width:e,sprites:[{rows:Rg,x:r},...t.near.sprites],water:{[r-1]:`-`}});let r=n.length;return n.push(t.near),{scenes:n,loopFrom:r}}var l_=[50,33,25,20,10],u_=[Lg,[` |\\ `,` |.\\ `,`\\____/`],[` |\\ `,` | \\ `,`\\_.__/`],[` | `,` |\\ `,`\\_.__/`],[` / `,` |\\ `,`\\_. _/`],[` , `,` /| `,`\\_. ./`],[` `,` , `,`\\_. /`]],d_=[Rg,[``,` |\\ `,`\\_./`],[``,` |. `,`\\_./`],[``,` | `,`\\_./`],[``,` / `,`\\_./`],[``,` , `,`\\. /`],[``,` `,` ._,`]],f_=u_.length-1,p_={ship:{stages:u_,length:6},boat:{stages:d_,length:4}},m_=(e,t)=>e.map(e=>[...e.padEnd(t)].reverse().map(e=>e===`/`?`\\`:e===`\\`?`/`:e).join(``)),h_={ship:u_.map(e=>m_(e,6)),boat:d_.map(e=>m_(e,4))},g_=[1,2,5,10,20,25],__=(e,t=`ship`)=>g_.find(n=>n>=50/(e-p_[t].length))??25;function v_(e,t,n=`ship`){let r=Math.max(0,Math.min(100,e));if(r>=100)return 100;if(r>=90)return 90+Math.floor((r-90)/2)*2;let i=__(t,n);return Math.floor(r/i)*i}var y_=e=>e<90?0:Math.min(f_,Math.floor((e-90)/2)+1),b_=(e,t,n=`ship`)=>Math.round(e/100*(t-p_[n].length)),x_=(e,t)=>({...e>=3?{[t-3]:`.`,[t-5]:`,`}:{},...e>=5?{[t-7]:`.`}:{},...e>=f_?{[t+1]:`o`,[t+5]:`o`,[t-9]:`,`}:{}}),S_=e=>Object.fromEntries(Array.from({length:Math.max(0,e)},(e,t)=>[t,`_`])),C_={0:[` _ `,`| |`,`|_|`],1:[` `,`|`,`|`],2:[` _ `,` _|`,`|_ `],3:[` _ `,` _|`,` _|`],4:[` `,`|_|`,` |`],5:[` _ `,`|_ `,` _|`],6:[` _ `,`|_ `,`|_|`],7:[` _ `,` |`,` |`],8:[` _ `,`|_|`,`|_|`],9:[` _ `,`|_|`,` _|`],"%":[` `,`o/ `,`/o `]},w_=e=>[0,1,2].map(t=>[...e].map(e=>C_[e]?.[t]??``).join(` `));function T_(e,t,n,r,i=`ship`){let a=w_(r),o=r===`100%`?`100%`:`00%`,s=[];return w_(o)[0].length+1<=n?a.forEach((e,t)=>[...e].forEach((e,n)=>{e!==` `&&s.push({x:n,y:t,ch:e})})):o.length<=n&&(s=[...r].map((e,t)=>({x:t,y:0,ch:e}))),{scene:{width:e,sprites:[{rows:p_[i].stages[t],x:n,shear:t===4&&i===`ship`?[1,0,0]:[]}],water:{...S_(n),...t>=f_?{}:Wg(n),...x_(t,n)},marks:s},number:s}}function E_(e,t,n,r=`ship`){let i=p_[r].length,a={...t>=f_?{}:{[n+i]:`=`,[n+i+1]:`=`},...t>=3?{[n+i+2]:`.`,[n+i+4]:`,`}:{}};return{width:e,sprites:[{rows:h_[r][t],x:n,shear:t===4&&r===`ship`?[-1,0,0]:[]}],water:{...S_(n),...a}}}function D_(e,t,n=`ship`){return{width:e,sprites:[{rows:p_[n].stages[0],x:t}],water:n===`ship`?Wg(t):{[t-1]:`-`}}}var O_=(e,t,n=96)=>Math.round((e-1)/(t-1)*(n-6)),k_=(e,t,n=96)=>O_(e,t,n)+3-1;function A_(e,t,n,r,i=96){let a=r?n===`right`?Wg(e):{[e+6]:`=`,[e+6+1]:`=`}:{};for(let e=1;e<=t;e++)a[k_(e,t,i)]=`o`;return{width:i,sprites:[{rows:n===`right`?Lg:h_.ship[0],x:e}],water:a}}var j_=180;function M_(e,t){let n=t.filter(t=>t.parentId===e.id),r=n.filter(e=>e.status===`running`).length,i=n.filter(e=>e.status!==`ended`).length,a=e.clearedAt;if(e.clearDue!=null&&e.status!==`ended`)return{kind:`clearing`,clearedAt:a};let o=s();return o&&{...o,clearedAt:a};function s(){switch(e.status){case`running`:return e.paused?{kind:`stopped`,behind:c()}:{kind:`working`,followers:e.role===`manager`?r:0};case`stopping`:return{kind:`working`,followers:e.role===`manager`?r:0};case`starting`:case`waiting`:case`idle`:return{kind:`stopped`,behind:c()};case`ended`:return{kind:`sunk`};default:return null}}function c(){return r>0||e.backgroundTasks>0?`busy`:e.role===`manager`&&i>0?`fleet`:`none`}}var N_=[7,6,5,4],P_=5,F_=e=>N_[(N_.indexOf(e)+1)%N_.length],I_=new Map;function L_(e,t){let n=I_.get(e);if(n)return n;let r=()=>{try{let n=Number(localStorage.getItem(e));return N_.includes(n)?n:t}catch{return t}},i=new Set,a=r(),o={get:()=>a,set(t){a=t;try{localStorage.setItem(e,String(t))}catch{}for(let e of i)e()},subscribe(t){i.add(t);let n=n=>{n.key===e&&(a=r(),t())};return window.addEventListener(`storage`,n),()=>{i.delete(t),window.removeEventListener(`storage`,n)}}};return I_.set(e,o),o}function R_(e,t){let n=L_(e,t),r=(0,v.useSyncExternalStore)(n.subscribe,n.get);return{size:r,next:F_(r),step:()=>n.set(F_(r))}}function z_(e,t,n,r,i){let a=qg(n?.scenes[r]);if(t?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`)return e.clearedAt!=null&&e.clearedAt!==t.clearedAt?s_(i):c_(i);switch(e.kind){case`clearing`:return o_(i);case`working`:return t?.kind===`stopped`?t.behind===`fleet`?t_(e.followers,i):r_(e.followers,i):Yg(t?a:-6,e.followers,i);case`stopped`:return t?.kind===`working`?Xg(a,e.behind,i):t?.kind===`stopped`&&t.behind!==`fleet`&&e.behind===`fleet`?e_(i):t?.kind===`stopped`&&t.behind===`fleet`&&e.behind===`none`?n_(i):$g(e.behind,i);case`sunk`:return t&&t.kind!==`sunk`?i_(a,i):a_(i)}}var B_=(e,t)=>JSON.stringify(e)===JSON.stringify(t);function V_({mode:e,width:t=20,sizeButton:n=!0,hideWhenSunk:r=!1,maxSize:i}){let a=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,o=(0,v.useRef)(null),s=(0,v.useRef)(0),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(0),{size:d,next:f,step:p}=R_(`ledung.shipSize`,P_),m=(o.current?.oneShot??!1)&&s.current<o.current.loopFrom;if(!B_(c.current,e)&&!m){let n=a&&e.kind===`working`?Yg(4,e.followers,t):z_(e,c.current,o.current,s.current,t),r=c.current?.kind===`clearing`&&e.kind!==`clearing`&&e.kind!==`sunk`;o.current=n,s.current=a?n.loopFrom:0,r&&(n.oneShot=!0),c.current=r?{kind:`stopped`,behind:`none`,clearedAt:e.clearedAt}:e}(0,v.useEffect)(()=>{if(a)return;let e=setInterval(()=>{let e=o.current;e&&(s.current=s.current+1<e.scenes.length?s.current+1:e.loopFrom),u(e=>e+1)},j_);return()=>clearInterval(e)},[a]);let h=o.current;if(r&&e.kind===`sunk`&&s.current>=h.loopFrom)return null;let g=h.scenes[s.current],_=(0,V.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${i?Math.min(d,i):d}px`},"aria-hidden":`true`,children:Ug(g,a?0:l)});return n?(0,V.jsx)(`button`,{type:`button`,className:`ship-button`,title:`Ship size ${d}px: click for ${f}px`,onClick:p,children:_}):_}function H_(e,t){let n=null,r=null,i=new Map,a=!1;for(let o of e){if(o.kind===`user`&&(n=o.at,r=null,i.clear(),a=!1),o.kind!==`sdk`)continue;let e=o.data;if(e.type===`assistant`&&e.parent_tool_use_id==null)for(let n of e.message?.content??[])if(n.type===`tool_use`){let e=Lh(n.name,n.input??{});i.set(n.id,{label:e?`${n.name}: ${e}`:n.name,uacWait:t&&k(n.name,n.input??{})}),a=!1}else n.type===`text`&&n.text.trim()&&(a=!0);else if(e.type===`user`&&Array.isArray(e.message?.content))for(let t of e.message.content)t.type===`tool_result`&&i.delete(t.tool_use_id);else e.type===`result`&&e.num_turns>0&&(r=o.at,i.clear())}let o=[...i.values()].pop(),s=o?`Running ${o.label}`:a?`Writing`:`Thinking`;return{since:n,doing:s,uacWait:!!o?.uacWait,finishedAt:r}}function U_(e){let t=Math.max(0,Math.floor(e/1e3));return t<60?`${t} s`:`${Math.floor(t/60)} min ${String(t%60).padStart(2,`0`)} s`}function W_(e){return e.status===`ended`&&/exited with code [1-9]|stopped unexpectedly/.test(e.endReason??``)}function G_({session:e,sessions:t,messages:n,extra:r}){let i=(0,v.useMemo)(()=>H_(n,!!e.uac),[n,e.uac]),[a,o]=(0,v.useState)(Date.now()),s=e.status===`running`||e.status===`stopping`,c=t.filter(t=>t.parentId===e.id&&t.status===`running`).length,l=M_(e,t);(0,v.useEffect)(()=>{if(!s)return;let e=setInterval(()=>o(Date.now()),1e3);return()=>clearInterval(e)},[s]);let u,d;if(e.status===`waiting`)u=`waiting`,d=`Waiting for your answer above`;else if(s){u=`working`;let t=e.status===`stopping`?`Stopping`:i.doing;d=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`working-label`,children:t}),e.status===`running`&&i.uacWait&&(0,V.jsxs)(`span`,{className:`uac-hint`,children:[` · `,`may be waiting for UAC on the PC`]}),e.status===`running`&&i.since&&(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,U_(a-i.since)]})]})}else if(e.status===`starting`)u=`done`,d=(0,V.jsx)(`span`,{className:`working-label`,children:`Ready`});else if(e.status===`idle`)u=`done`,d=(0,V.jsxs)(`span`,{className:`working-label`,children:[`Done`,i.finishedAt?` at ${Dg(i.finishedAt)}`:``,e.backgroundTasks>0?` · ${e.backgroundTasks} background task(s) still running`:``,c>0?` · ${c} session(s) still working`:``]});else if(e.status===`ended`){let t=W_(e);u=t?`failed`:`done`;let n=e.endedAt?` at ${Dg(e.endedAt)}`:``;d=(0,V.jsx)(`span`,{className:`working-label`,children:t?`Ended with an error${n}`:`Ended${n}${e.endReason?` · ${e.endReason.split(`
|
|
84
|
+
`)[0]}`:``}`})}else return null;return l?(0,V.jsxs)(`div`,{className:`status-line ${u}`,role:`status`,"aria-live":`polite`,children:[(0,V.jsx)(V_,{mode:l}),d,r]}):null}var K_=`modulepreload`,q_=function(e){return`/`+e},J_={},Y_=function(e){return e.pathname.endsWith(`.css`)},X_=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},Z_=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=q_(t,n);let r=s(t),i=Y_(r);return X_(J_,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:K_,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Q_={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,py:`python`,sh:`bash`,bash:`bash`,zsh:`bash`,ps1:`powershell`,psm1:`powershell`,psd1:`powershell`,cs:`csharp`,css:`css`,html:`xml`,htm:`xml`,xml:`xml`,svg:`xml`,csproj:`xml`,yml:`yaml`,yaml:`yaml`,md:`markdown`,markdown:`markdown`,sql:`sql`,go:`go`,rs:`rust`,java:`java`,ini:`ini`,toml:`ini`,cfg:`ini`,diff:`diff`,patch:`diff`},$_={dockerfile:`dockerfile`,".gitignore":`bash`};function ev(e){let t=e.split(`/`).pop().toLowerCase();if($_[t])return $_[t];let n=t.lastIndexOf(`.`);return n===-1?null:Q_[t.slice(n+1)]??null}var tv=(e,t=e.split(`
|
|
85
|
+
`).length)=>e.length<=262144&&t<=8e3;function nv(e){let t=[],n=[],r=``;for(let i of e.split(/(<span[^>]*>|<\/span>|\n)/))i&&(i===`
|
|
86
|
+
`?(t.push(r+`</span>`.repeat(n.length)),r=n.join(``)):i.startsWith(`<span`)?(n.push(i),r+=i):(i===`</span>`&&n.pop(),r+=i));return t.push(r+`</span>`.repeat(n.length)),t}function rv(e,t){let n=ev(e.path);if(!t||!n)return null;let r=e.hunks.flatMap(e=>e.lines);if(!tv(r.map(e=>e.text).join(`
|
|
87
87
|
`),r.length))return null;let i=new Map;for(let r of e.hunks)for(let e of[r.lines.filter(e=>e.kind!==`del`),r.lines.filter(e=>e.kind===`del`)]){if(!e.length)continue;let r=t(e.map(e=>e.text).join(`
|
|
88
|
-
`),n);e.forEach((e,t)=>i.set(e,r[t]??``))}return i}var
|
|
89
|
-
`),r=
|
|
88
|
+
`),n);e.forEach((e,t)=>i.set(e,r[t]??``))}return i}var iv=null;function av(){return iv??=Z_(()=>import(`./highlightCore-Cci4B5B5.js`).then(e=>e.highlight),[]),iv}function ov(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0;return av().then(n=>e&&t({fn:n}),()=>{}),()=>{e=!1}},[]),e?.fn??null}function sv(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function cv({text:e,path:t}){let n=e.replace(/\n$/,``).split(`
|
|
89
|
+
`),r=ov(),i=ev(t),a=(0,v.useMemo)(()=>r&&i&&tv(e,n.length)?r(n.join(`
|
|
90
90
|
`),i):null,[r,i,e]);return(0,V.jsx)(`pre`,{className:`file-text numbered hl`,style:{"--ln-width":`${String(n.length).length+1}ch`},children:(0,V.jsx)(`code`,{children:a?a.map((e,t)=>(0,V.jsx)(`span`,{className:`ln-row`,dangerouslySetInnerHTML:{__html:`${e}\n`}},t)):n.map((e,t)=>(0,V.jsxs)(`span`,{className:`ln-row`,children:[e,`
|
|
91
|
-
`]},t))})})}function
|
|
91
|
+
`]},t))})})}function lv(e){let t=e.stack[e.stack.length-1],[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(!1),c=wf(t);return(0,v.useEffect)(()=>{if(s(!1),c)return;let n=!0;return r(null),a(null),R.file(e.sessionId,t,e.folder).then(e=>n&&r(e),e=>n&&a(e.message)),()=>{n=!1}},[e.sessionId,t,c,e.folder]),(0,V.jsxs)(`aside`,{className:`file-panel`,"aria-label":`File`,children:[(0,V.jsxs)(`header`,{className:`file-head`,children:[(e.stack.length>1||e.backToPane)&&(0,V.jsx)(`button`,{className:`small`,onClick:e.onBack,children:e.backToPane&&e.stack.length===1?`‹ Files`:`Back`}),(0,V.jsx)(`span`,{className:`file-path`,title:!c&&n?.path||t,children:!c&&n?.path||t}),c&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>s(!o),children:o?`Fit to panel`:`Full size`}),!c&&n&&(0,V.jsx)(Of,{text:n.content,label:`Copy all`}),(0,V.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close`,children:`Close`})]}),(0,V.jsxs)(`div`,{className:`file-body`,children:[!c&&i&&(0,V.jsx)(`p`,{className:`error`,children:i}),c&&(0,V.jsx)(Ef,{sessionId:e.sessionId,path:t,folder:e.folder,full:o,onClick:()=>s(!o)},t),!c&&!n&&!i&&(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`}),!c&&n?.kind===`markdown`&&(0,V.jsx)(Mf,{text:n.content,baseDir:sv(n.path),onOpenFile:e.onOpen,sessionId:e.sessionId}),!c&&n?.kind===`text`&&(0,V.jsx)(cv,{text:n.content,path:n.path})]})]})}var uv=300;function dv(e){let t=e.replace(/\t/g,` `).trim();return t.length>uv?`${t.slice(0,uv)}…`:t}function fv(e,t){let n=[...new Set(e.map(e=>e.commit.slice(0,7)))];return[`${e.length} line comment${e.length===1?``:`s`} on ${t} at ${n.join(`, `)}:`,...e.map((e,t)=>{let n=e.side===`old`?`-`:`+`,r=`${e.path}:${e.line}${e.side===`old`?` (old)`:``}`,i=e.body.split(`
|
|
92
92
|
`).map(e=>` ${e}`).join(`
|
|
93
|
-
`);return`${t+1}. ${r} ${n} ${
|
|
94
|
-
`)}function fv(e,t,n){let r=t.trim();return e===`accept`?`${N}\n\n${r?`${r}\n\n`:``}Notes, not blocking:\n${n}`:`${P} ${r?`${r}\n\n`:``}${n}`}function pv(e,t,n,r){let i=t.trim();return`${r?`${e}'s line comments on the changes of your session "${r}". Hand them on as a review round; each is a finding to check, not an order.`:`${e}'s line comments on your changes. Each is a finding to check, not an order.`}\n\n${i?`${i}\n\n`:``}${n}`}function mv(e,t){let n=new Map(t.map(e=>[e.id,e]));return t.filter(t=>t.status===`open`&&t.addressedTo===`user`&&t.details?.review&&(t.sessionId===e||t.aboutQuestion!==null&&n.get(t.aboutQuestion)?.sessionId===e)).sort((e,t)=>t.askedAt-e.askedAt)[0]??null}var hv=e=>`ledung.lineComments.${e}`;function gv(e,t){try{let n=JSON.parse(e.getItem(hv(t))??`[]`);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.body==`string`):[]}catch{return[]}}function _v(e,t,n){try{n.length?e.setItem(hv(t),JSON.stringify(n)):e.removeItem(hv(t))}catch{}}var vv=(e,t)=>e.path===t.path&&e.line===t.line&&e.side===t.side;function yv(e,t){let n=e.filter(e=>e.id!==t.id&&!vv(e,t));if(!t.body.trim())return n;let r=e.findIndex(e=>e.id===t.id||vv(e,t));if(r===-1)return[...n,t];let i=[...n];return i.splice(Math.min(r,i.length),0,t),i}var bv=`(max-width: 760px)`;function xv(){let[e,t]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(bv).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let e=matchMedia(bv),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Sv(e){let[t,n]=(0,v.useState)(`files`),[r,i]=(0,v.useState)(()=>gv(localStorage,e.session.id));return(0,v.useEffect)(()=>_v(localStorage,e.session.id,r),[e.session.id,r]),(0,V.jsxs)(`aside`,{className:`file-panel files-pane`,"aria-label":`Files`,hidden:e.hidden,children:[(0,V.jsxs)(`header`,{className:`file-head`,children:[(0,V.jsx)(`strong`,{children:`Files`}),(0,V.jsx)(`span`,{className:`chip test-feature`,title:`A test feature: Martin is trying it out (issue #225). It may change or go.`,children:`Test feature`}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close the Files pane`,children:`Close`})]}),(0,V.jsxs)(`div`,{className:`pane-tabs`,role:`tablist`,children:[(0,V.jsx)(`button`,{role:`tab`,"aria-selected":t===`files`,className:t===`files`?`on`:``,onClick:()=>n(`files`),children:`Files`}),(0,V.jsxs)(`button`,{role:`tab`,"aria-selected":t===`changes`,className:t===`changes`?`on`:``,onClick:()=>n(`changes`),children:[`Changes`,r.length?(0,V.jsxs)(`span`,{className:`chip draft`,children:[r.length,` draft`]}):null]})]}),(0,V.jsx)(`div`,{className:`pane-body`,hidden:t!==`files`,children:(0,V.jsx)(Cv,{session:e.session,onOpenFile:e.onOpenFile})}),(0,V.jsx)(`div`,{className:`pane-body`,hidden:t!==`changes`,children:(0,V.jsx)(Ev,{...e,drafts:r,setDrafts:i,active:t===`changes`})})]})}function Cv(e){let t=e.session.id,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(`session`),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(new Set),[f,p]=(0,v.useState)(``),m=B();(0,v.useEffect)(()=>{R.paneFolders(t).then(e=>r(e.folders),e=>a(e.message))},[t]);let h=e=>{R.tree(t,o,e).then(t=>l(n=>({...n,[e]:t})),t=>l(n=>({...n,[e]:{error:t.message}})))};(0,v.useEffect)(()=>{l({}),d(new Set),h(``)},[t,o]);let g=t=>{if(!t.dir)return e.onOpenFile(t.path,o);if(t.skipped)return;let n=new Set(u);n.has(t.path)?n.delete(t.path):(n.add(t.path),c[t.path]||h(t.path)),d(n)},_=[],y=(e,t)=>{let n=c[e];if(!(!n||`error`in n))for(let e of n.entries)_.push({e,depth:t}),e.dir&&u.has(e.path)&&y(e.path,t+1)};y(``,0);let b=f.trim().toLowerCase(),x=b?Object.values(c).flatMap(e=>`error`in e?[]:e.entries).filter(e=>e.name.toLowerCase().includes(b)).sort((e,t)=>e.path.localeCompare(t.path)):null,S=c[``],C=n?.find(e=>e.key===o);return i?(0,V.jsx)(`p`,{className:`error pane-note`,children:i}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`pane-tools`,children:[n&&n.length>1&&(0,V.jsx)(`div`,{className:`seg-control`,role:`radiogroup`,"aria-label":`Which folder`,children:n.map(e=>(0,V.jsx)(`button`,{role:`radio`,"aria-checked":o===e.key,className:o===e.key?`on`:``,onClick:()=>s(e.key),title:e.path,children:e.label},e.key))}),C&&(0,V.jsx)(`div`,{className:`muted mono pane-root`,title:C.path,children:C.path}),(0,V.jsx)(`input`,{...m,className:`pane-filter`,type:`search`,placeholder:`Filter by name…`,value:f,onChange:e=>p(e.target.value),"aria-label":`Filter files by name`})]}),(0,V.jsxs)(`div`,{className:`tree`,role:`tree`,children:[S&&`error`in S&&(0,V.jsx)(`p`,{className:`error pane-note`,children:S.error}),!S&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Loading…`}),x&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted pane-note`,children:[x.length,` match`,x.length===1?``:`es`,` in the folders opened so far.`]}),x.map(e=>(0,V.jsx)(wv,{e,depth:0,label:e.path,open:u.has(e.path),onClick:()=>g(e)},e.path))]}),!x&&_.map(({e,depth:t})=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(wv,{e,depth:t,open:u.has(e.path),onClick:()=>g(e)}),e.dir&&u.has(e.path)&&c[e.path]&&`error`in c[e.path]&&(0,V.jsx)(`p`,{className:`error pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:c[e.path].error}),e.dir&&u.has(e.path)&&!c[e.path]&&(0,V.jsx)(`p`,{className:`muted pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:`Loading…`})]},e.path)),S&&!(`error`in S)&&S.truncated&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Only the first 1000 names are shown.`})]}),(0,V.jsxs)(`p`,{className:`muted pane-foot`,children:[`Read-only. Only what is inside this folder. Names starting with . or $ are not listed`,e.session.project===`~chats`?`, nor folders where settings and sign-ins are kept`:``,`; node_modules and what .gitignore leaves out are greyed.`]})]})}function wv(e){let{e:t}=e,n=t.name.lastIndexOf(`.`),r=e.label??t.name;return(0,V.jsxs)(`button`,{role:`treeitem`,"aria-expanded":t.dir&&!t.skipped?e.open:void 0,className:`tree-row${t.skipped?` skipped`:``}${t.dir?` dir`:``}`,style:{paddingLeft:`${e.depth*14+8}px`},onClick:e.onClick,disabled:t.dir&&!!t.skipped,title:t.skipped===`heavy`?`Not listed: a heavy folder`:t.skipped===`ignored`?`Left out by .gitignore`:t.path,children:[(0,V.jsx)(`span`,{className:`tree-caret`,"aria-hidden":`true`,children:t.dir?t.skipped?`·`:e.open?`▾`:`▸`:``}),t.dir?(0,V.jsxs)(`span`,{children:[r,`/`]}):n>0&&!e.label?(0,V.jsxs)(`span`,{children:[t.name.slice(0,n),(0,V.jsx)(`span`,{className:`ext`,children:t.name.slice(n)})]}):(0,V.jsx)(`span`,{children:r}),t.skipped&&(0,V.jsx)(`span`,{className:`tree-note`,children:t.skipped===`heavy`?`not listed`:`ignored`})]})}var Tv=e=>e.kind===`del`?{line:e.old,side:`old`}:{line:e.new,side:`new`};function Ev(e){let t=e.session.id,n=xv(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(!1),g=()=>{o(null),R.changes(t).then(e=>{i(e),c(t=>Math.min(t,Math.max(0,e.files.length-1)))},e=>o(e.message))};(0,v.useEffect)(()=>{e.active&&!h.current&&(h.current=!0,g())},[e.active]);let _=r?.files??[],y=_.reduce((e,t)=>e+t.added,0),b=_.reduce((e,t)=>e+t.removed,0),x=n?_.slice(s,s+1):_,S=t=>{e.setDrafts(e=>yv(e,t)),u(null),m(null)};return a?(0,V.jsxs)(`p`,{className:`error pane-note`,children:[a,` `,(0,V.jsx)(`button`,{className:`small`,onClick:g,children:`Try again`})]}):r?(0,V.jsxs)(`div`,{className:`changes-tab`,children:[(0,V.jsxs)(`div`,{className:`changes-head`,children:[(0,V.jsx)(`span`,{children:r.problem??(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`strong`,{children:[_.length,` file`,_.length===1?``:`s`]}),` `,(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,y]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,b]}),(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,r.branch??`HEAD`,` against `,r.base,` · at `,(0,V.jsx)(`span`,{className:`mono`,children:r.head?.slice(0,7)})]})]})}),(0,V.jsx)(`button`,{className:`small`,onClick:g,title:`Read the changes again`,children:`Refresh`})]}),r.truncated&&(0,V.jsx)(`p`,{className:`warn pane-note`,children:`The diff is larger than 1 MB, so it is cut: only the files above the cut are shown, the last one perhaps in part.`}),!r.problem&&!_.length&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`No changes yet: this branch has no commits of its own. Uncommitted edits are not shown.`}),n&&_.length>0&&(0,V.jsxs)(`div`,{className:`file-step`,children:[(0,V.jsx)(`button`,{className:`small`,"aria-label":`Previous file`,disabled:s===0,onClick:()=>c(s-1),children:`‹`}),(0,V.jsx)(`select`,{value:s,onChange:e=>c(Number(e.target.value)),"aria-label":`Changed file`,children:_.map((e,t)=>(0,V.jsxs)(`option`,{value:t,children:[e.path,` · `,t+1,` of `,_.length]},e.path))}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Next file`,disabled:s>=_.length-1,onClick:()=>c(s+1),children:`›`})]}),!n&&_.length>1&&(0,V.jsx)(`ul`,{className:`changed-files`,children:_.map(n=>{let r=e.drafts.filter(e=>e.path===n.path).length;return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`button`,{className:`link mono`,onClick:()=>document.getElementById(Dv(t,n.path))?.scrollIntoView({block:`start`}),children:n.path}),r>0&&(0,V.jsx)(`span`,{className:`chip draft`,children:r}),(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,n.added]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,n.removed]})]},n.path)})}),x.map(n=>(0,V.jsx)(Ov,{sessionId:t,file:n,head:r.head??``,userName:e.userName,drafts:e.drafts.filter(e=>e.path===n.path),editing:l?.path===n.path?l.line:null,onEdit:e=>u(e?{path:n.path,line:e}:null),onSave:S,onRemove:t=>e.setDrafts(e=>e.filter(e=>e.id!==t.id)),onWhole:()=>e.onOpenFile(n.path,`session`)},n.path)),(0,V.jsx)(Av,{...e,sending:d,setSending:f,sent:p,setSent:m})]}):(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Loading the changes…`})}var Dv=(e,t)=>`diff-${e}-${t}`;function Ov(e){let t=e.file,n=av(),r=(0,v.useMemo)(()=>nv(t,n),[t,n]);return(0,V.jsxs)(`section`,{className:`diff-file`,id:Dv(e.sessionId,t.path),children:[(0,V.jsxs)(`header`,{className:`diff-file-head`,children:[(0,V.jsxs)(`span`,{className:`mono diff-path`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[t.oldPath?`${t.oldPath} → `:``,t.path]}),t.status!==`modified`&&(0,V.jsx)(`span`,{className:`chip`,children:t.status}),(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,t.added]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,t.removed]}),t.status!==`deleted`&&!t.binary&&(0,V.jsx)(`button`,{className:`small`,onClick:e.onWhole,title:`Open the whole file, read-only`,children:`Whole file`})]}),t.binary&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`A binary file: not shown.`}),!t.binary&&!t.hunks.length&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Renamed or its mode changed; no lines differ.`}),(0,V.jsxs)(`table`,{className:`diff-table`,children:[(0,V.jsxs)(`colgroup`,{children:[(0,V.jsx)(`col`,{className:`c-ln`}),(0,V.jsx)(`col`,{className:`c-ln`}),(0,V.jsx)(`col`,{})]}),(0,V.jsx)(`tbody`,{children:t.hunks.map((n,i)=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(`tr`,{className:`hunk`,children:(0,V.jsx)(`td`,{colSpan:3,className:`mono`,children:n.header})}),n.lines.map((n,i)=>{let a=Tv(n),o=e.drafts.filter(e=>vv(e,{path:t.path,...a})),s=e.editing===n;return(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`dl ${n.kind}${o.length?` commented`:``}${s?` editing`:``}`,onClick:()=>e.onEdit(s?null:n),title:`Click to comment on this line`,children:[(0,V.jsx)(`td`,{className:`ln`,children:n.old??``}),(0,V.jsx)(`td`,{className:`ln`,children:n.new??``}),(0,V.jsxs)(`td`,{className:`code hl`,children:[(0,V.jsx)(`span`,{className:`mark`,children:n.kind===`add`?`+`:n.kind===`del`?`−`:` `}),r?.has(n)?(0,V.jsx)(`span`,{dangerouslySetInnerHTML:{__html:r.get(n)}}):n.text]})]}),o.map(t=>(0,V.jsx)(`tr`,{className:`comment-row`,children:(0,V.jsx)(`td`,{colSpan:3,children:(0,V.jsxs)(`div`,{className:`line-comment`,children:[(0,V.jsxs)(`div`,{className:`line-comment-head`,children:[(0,V.jsx)(`strong`,{children:e.userName}),` `,(0,V.jsx)(`span`,{className:`chip draft`,children:`draft`}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`line `,t.line,t.side===`old`?` (old)`:``]}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onEdit(n),children:`Edit`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onRemove(t),children:`Delete`})]}),(0,V.jsx)(`div`,{className:`line-comment-body`,children:t.body})]})})},t.id)),s&&(0,V.jsx)(`tr`,{className:`comment-row`,children:(0,V.jsx)(`td`,{colSpan:3,children:(0,V.jsx)(kv,{path:t.path,line:n,head:e.head,existing:o[0]??null,onCancel:()=>e.onEdit(null),onSave:e.onSave})})})]},i)})]},i))})]})]})}function kv(e){let[t,n]=(0,v.useState)(e.existing?.body??``),r=B(),i=(0,v.useRef)(null),a=(0,v.useRef)(null);(0,v.useEffect)(()=>{i.current?.focus({preventScroll:!0}),a.current?.scrollIntoView({block:`nearest`})},[]);let o=Tv(e.line),s=av(),c=$_(e.path),l=s&&c?s(e.line.text,c)[0]??null:null,u=()=>{if(!t.trim())return e.existing?e.onSave({...e.existing,body:``}):e.onCancel();e.onSave({id:e.existing?.id??`${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,path:e.path,...o,lineText:e.line.text,commit:e.head,body:t})};return(0,V.jsxs)(`div`,{ref:a,className:`comment-editor`,role:`dialog`,"aria-label":`Comment on line ${o.line}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`comment-editor-head`,children:[(0,V.jsxs)(`strong`,{children:[`Comment on line `,o.line,o.side===`old`?` (old)`:``]}),(0,V.jsx)(`span`,{className:`muted mono`,children:e.path})]}),(0,V.jsxs)(`pre`,{className:`quoted-line hl ${e.line.kind}`,children:[e.line.kind===`add`?`+ `:e.line.kind===`del`?`− `:` `,l===null?e.line.text:(0,V.jsx)(`span`,{dangerouslySetInnerHTML:{__html:l}})]}),(0,V.jsx)(`textarea`,{...r,ref:i,className:`box`,value:t,placeholder:`What should the worker look at here?`,onChange:e=>n(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),u()),t.key===`Escape`&&(t.preventDefault(),e.onCancel())}}),(0,V.jsx)(`p`,{className:`muted`,children:`Kept as a draft until you send; nothing reaches the worker yet.`}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,onClick:u,children:e.existing?`Save comment`:`Add comment`})]})]})}function Av(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`changes`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),l=B(),u=(0,v.useMemo)(()=>mv(e.session.id,e.questions),[e.session.id,e.questions]),d=e.session.parentId?e.sessions.find(t=>t.id===e.session.parentId)??null:null,f=e.drafts.length,p=f?dv(e.drafts,e.session.title):``,m=u?fv(r,a,p):pv(e.userName,a,p,d?e.session.title:null),h=async()=>{e.setSending(!0),c(``);try{let t=e.drafts.map(({id:e,...t})=>t);await R.sendLineComments(e.session.id,{verdict:u?r:null,text:a,comments:t}),e.setDrafts(()=>[]),e.setSent(u?`Sent with your ${r===`accept`?`Accept`:`"Changes needed"`} on the review.`:`Sent to ${d?.title??e.session.title}.`),n(!1),o(``)}catch(e){c(e.message)}finally{e.setSending(!1)}};return(0,V.jsxs)(`div`,{className:`comment-bar`,children:[t&&f>0&&(0,V.jsxs)(`div`,{className:`send-panel`,children:[(0,V.jsxs)(`h4`,{children:[`Send `,f,` comment`,f===1?``:`s`]}),u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With your answer to the open review`,` `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenQuestion(u.id),children:u.details?.title??`#${u.id}`}),`.`]}),(0,V.jsxs)(`label`,{className:`radio`,children:[(0,V.jsx)(`input`,{type:`radio`,checked:r===`changes`,onChange:()=>i(`changes`)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:`As “Changes needed”`}),(0,V.jsx)(`br`,{}),(0,V.jsx)(`span`,{className:`muted`,children:`The manager hands them to the worker as a review round; each one is a finding to check, not an order.`})]})]}),(0,V.jsxs)(`label`,{className:`radio`,children:[(0,V.jsx)(`input`,{type:`radio`,checked:r===`accept`,onChange:()=>i(`accept`)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:`As notes with “Accept”`}),(0,V.jsx)(`br`,{}),(0,V.jsx)(`span`,{className:`muted`,children:`Small things the worker may take or leave; the change can go ahead.`})]})]})]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`No review is open for this session, so they go `,d?(0,V.jsxs)(V.Fragment,{children:[`to its manager `,(0,V.jsx)(`strong`,{children:d.title})]}):(0,V.jsxs)(V.Fragment,{children:[`to `,(0,V.jsx)(`strong`,{children:e.session.title}),` itself`]}),` as one message from you`,d?`, to hand on as a review round`:``,`.`]}),(0,V.jsx)(`textarea`,{...l,className:`box`,placeholder:`A note above the comments (optional)`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsxs)(`details`,{className:`send-preview`,children:[(0,V.jsx)(`summary`,{children:`What goes`}),(0,V.jsx)(`pre`,{children:m})]}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{onClick:()=>n(!1),children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,disabled:e.sending,onClick:()=>void h(),children:u?r===`accept`?`Send with Accept`:`Send changes needed`:`Send`}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:s})]})]}),(0,V.jsxs)(`div`,{className:`comment-bar-row`,children:[(0,V.jsx)(`span`,{children:f?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`strong`,{children:[f,` comment`,f===1?``:`s`]}),` `,(0,V.jsx)(`span`,{className:`chip draft`,children:`draft`})]}):(0,V.jsx)(`span`,{className:`muted`,children:e.sent??`Click a line to comment on it.`})}),(0,V.jsxs)(`button`,{className:`primary`,disabled:!f,onClick:()=>n(!t),"aria-expanded":t,children:[`Send`,u?` with review`:``,` ▾`]})]})]})}function jv(e,t){if(!t)return[];let n=new Set,r=[],i;try{i=new RegExp(t.pattern,`g`)}catch{return[]}for(let a of e)for(let e of(a??``).matchAll(i)){let i=e[0];n.has(i)||(n.add(i),r.push({id:i,url:t.url.replace(`{id}`,encodeURIComponent(i))}))}return r}function Mv(e,t){return[...e,{name:x,colours:{manager:t?.colour??null,sessions:`same`}}]}function Nv(e,t){if(!e)return;let n=Dt(t.find(t=>t.name===e.project)?.colours,e.role);if(!n)return;let r=Et[n];return{"--name-light":r.light,"--name-dark":r.dark}}function Pv(e,t){return[e,t&&S(t)].filter(Boolean).join(` - `)||`Question`}function Fv(e){let{q:t,nameOf:n}=e,r=[],i={userName:e.userName,nameOf:n,onOpenMessage:e.onOpenMessage,onOpenQuestion:e.onOpenQuestion};t.original&&r.push((0,V.jsx)(Lv,{o:t.original,nav:i,tint:e.tintOf(t.original.sessionId)},`original`)),(t.sources??[]).forEach((e,n)=>r.push((0,V.jsx)(zv,{src:e,askedAt:t.askedAt,...i},`source-${n}`)));let a=(t.sources??[]).some(e=>!(`error`in e));if(t.earlier?.length&&!a&&r.push((0,V.jsx)(Vv,{q:t,lines:t.earlier,userName:e.userName,nameOf:n,onOpen:()=>e.onOpenConversation(t.sessionId,t.id)},`earlier`)),!r.length&&t.aboutQuestion===null)return null;let o=t.aboutQuestion===null?null:t.original?(0,V.jsxs)(V.Fragment,{children:[`Your answer goes to `,(0,V.jsx)(`strong`,{children:n(t.sessionId)}),`, which passes it on to `,n(t.original.sessionId),`.`]}):(0,V.jsxs)(V.Fragment,{children:[`Asked by `,(0,V.jsx)(`strong`,{children:n(t.sessionId)}),` about question #`,t.aboutQuestion,`, which can't be shown here: it is gone, or not from one of its sessions. Your answer goes to the manager.`]});return(0,V.jsxs)(`section`,{className:`block refers`,children:[(0,V.jsx)(`h4`,{children:`What it refers to`}),o&&(0,V.jsx)(`div`,{className:`refers-note muted`,children:o}),r]})}var Iv=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function Lv({o:e,nav:t,tint:n}){let{nameOf:r}=t,i=ce(e),a=[`asked ${Eg(e.askedAt)}`,i.options.length?Iv(i.options.length,`option`):``,i.opinions.length?Iv(i.opinions.length,`opinion`):``,e.status===`open`?``:e.status].filter(Boolean).join(` · `);return(0,V.jsxs)(`details`,{className:`ref-box original name-tinted${n?` tinted`:``}`,style:n,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Original question #`,e.id]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`from `,r(e.sessionId),` · `,a]})]}),(0,V.jsx)(Rv,{o:e,nav:t})]})}function Rv({o:e,nav:t,children:n}){let{nameOf:r}=t,i=ce(e),a=r(e.sessionId),o=e=>e??a,s=t=>(0,V.jsx)(jf,{text:t,sessionId:e.sessionId});return(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`h5`,{className:`ref-title`,children:i.title}),i.issue&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`The issue`}),(0,V.jsx)(`div`,{className:`prose`,children:s(i.issue)})]}),i.options.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`Options`}),(0,V.jsx)(`ul`,{className:`ref-opts`,children:i.options.map(e=>{let t=i.opinions.filter(t=>t.pick===e.key).map(e=>o(e.who));return(0,V.jsxs)(`li`,{className:t.length?`picked`:``,children:[(0,V.jsxs)(`b`,{children:[i.structured?`${e.key} · `:``,e.label.replace(/\*\*/g,``)]}),e.detail&&(0,V.jsxs)(V.Fragment,{children:[` — `,(0,V.jsx)(`span`,{className:`prose inline`,children:s(e.detail.replace(/^[—–-]\s*/,``))})]}),e.cost&&(0,V.jsxs)(`span`,{className:`muted`,children:[` Cost: `,e.cost]}),t.length>0&&(0,V.jsxs)(`span`,{className:`ref-pick`,children:[` `,t.map(e=>`${e}'s pick`).join(`, `)]})]},e.key)})})]}),i.opinions.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`Opinions`}),(0,V.jsx)(`ul`,{className:`ref-ops`,children:i.opinions.map((e,t)=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`b`,{children:o(e.who)}),` `,e.pick?`picks ${e.pick}`:`no pick among the options`,e.why?`: `:``,e.why&&(0,V.jsx)(`span`,{className:`prose inline`,children:s(e.why)})]},t))})]}),i.evidence&&(0,V.jsxs)(`details`,{className:`ev`,children:[(0,V.jsx)(`summary`,{children:`Evidence`}),(0,V.jsx)(`div`,{className:`prose`,children:s(i.evidence)})]}),e.sources?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`What it refers to`}),e.sources.map((n,r)=>(0,V.jsx)(zv,{src:n,askedAt:e.askedAt,...t},r))]}):null,n]})}function zv({src:e,askedAt:t,...n}){let{userName:r,nameOf:i,onOpenMessage:a,onOpenQuestion:o}=n;if(`error`in e)return(0,V.jsx)(Bv,{src:e});let s=(e,t)=>(0,V.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),t()},children:e}),c=e=>(0,V.jsxs)(`div`,{className:`muted ref-cut`,children:[`Cut here: the rest is `,e,`.`]});if(e.kind===`reply`){let t=i(e.sessionId);return(0,V.jsxs)(`details`,{className:`ref-box source reply`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Reply from `,t]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· its reply of `,Eg(e.at),`, word for word`,a?` · `:``]}),a&&s(`open in its conversation`,()=>a(e.sessionId,e.messageId))]}),(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`div`,{className:`prose ref-source`,children:(0,V.jsx)(jf,{text:e.text,sessionId:e.sessionId})}),e.cut&&c(`in its conversation`)]})]})}if(e.kind===`comment`){let n=e.what===`review`?`Review`:e.what===`review comment`?`Review comment`:`Comment`,r=e.path?` · ${e.path}${e.line?`:${e.line}`:``}`:``,i=e.at?` · written ${Eg(Date.parse(e.at))}`:``;return(0,V.jsxs)(`details`,{className:`ref-box source comment`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[n,` on `,/\/pull\/\d+/.test(e.url)?`PR `:``,`#`,e.number]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,e.repo.split(`/`)[1],` · by `,e.author,i,r,` · fetched `,Eg(t),` · `]}),(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:`open on GitHub`})]}),(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`div`,{className:`prose ref-source`,children:e.text.trim()?(0,V.jsx)(jf,{text:e.text}):(0,V.jsx)(`span`,{className:`muted`,children:`(no text)`})}),e.cut&&c(`on GitHub`)]})]})}let l=e.question,u=l.answeredBy===null?null:l.answeredBy===`user`?r:i(l.answeredBy),d=l.status===`answered`?`answered${u?` by ${u}`:``} ${Eg(l.answeredAt??l.askedAt)}`:l.status===`open`?`still open when attached`:l.status,f=o?.(l.id)??null;return(0,V.jsxs)(`details`,{className:`ref-box source question`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Earlier question #`,l.id]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· from `,i(l.sessionId),` · asked `,Eg(l.askedAt),` · `,d,f?` · `:``]}),f&&s(`open it`,f)]}),(0,V.jsx)(Rv,{o:l,nav:n,children:l.answer!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`The answer`}),(0,V.jsxs)(`div`,{className:`ref-line`,children:[(0,V.jsx)(`div`,{className:`ref-who`,children:u??`Answer`}),(0,V.jsx)(`div`,{className:`plain`,children:l.answer})]})]})})]})}function Bv({src:e}){let t=e.kind===`reply`?`A session's reply`:e.kind===`comment`?`A GitHub comment`:`An earlier question`;return(0,V.jsxs)(`details`,{className:`ref-box source failed`,open:!0,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[t,` could not be attached`]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,e.named]})]}),(0,V.jsx)(`div`,{className:`ref-body`,children:(0,V.jsx)(`div`,{className:`ref-failed`,children:e.error})})]})}function Vv({q:e,lines:t,userName:n,nameOf:r,onOpen:i}){let a=r(e.sessionId),o=e=>e.kind===`reply`?a:e.kind===`user`?n:`Delivered to ${a} by Ledung`;return(0,V.jsxs)(`details`,{className:`ref-box earlier`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`strong`,{children:`Earlier in the conversation`}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· the `,t.length===1?`message`:`${t.length} messages`,` `,a,` had just before asking · `]}),(0,V.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),i()},children:`open the conversation`})]}),(0,V.jsx)(`div`,{className:`ref-body`,children:t.map((t,n)=>(0,V.jsxs)(`div`,{className:`ref-line ${t.kind}`,children:[(0,V.jsxs)(`div`,{className:`ref-who`,children:[o(t),` · `,Eg(t.at)]}),(0,V.jsx)(`div`,{className:`prose`,children:(0,V.jsx)(jf,{text:t.text,sessionId:e.sessionId})}),t.cut&&(0,V.jsx)(`div`,{className:`muted ref-cut`,children:`Cut here: the rest is in the conversation.`})]},n))})]})}var Hv=8;function Uv({review:e,sessionId:t}){let n=e=>(0,V.jsx)(`div`,{className:`issue prose`,children:(0,V.jsx)(jf,{text:e,sessionId:t})});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`What we were solving`}),n(e.solving)]}),(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`What was done`}),n(e.done)]}),e.notes&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Notes`}),n(e.notes)]})]})}function Wv(e){let{q:t,evidence:n}=e,r=n.filter(e=>e.kind!==`text`);return(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Evidence`}),r.length>0&&(0,V.jsx)(`div`,{className:`rev-thumbs`,children:r.map((n,r)=>(0,V.jsxs)(`figure`,{children:[(0,V.jsx)(Gv,{q:t,ev:n,onOpen:()=>e.onShow(r)}),(0,V.jsx)(`figcaption`,{children:n.caption})]},r))}),n.map((e,n)=>e.kind===`text`?(0,V.jsx)(qv,{q:t,n,ev:e},n):null),e.shown!==null&&r[e.shown]&&(0,V.jsx)(Kv,{q:t,images:r,at:e.shown,onShow:e.onShow})]})}function Gv({q:e,ev:t,onOpen:n}){let[r,i]=(0,v.useState)(!1);return(0,V.jsx)(`button`,{className:`rev-thumb`,"aria-label":`Open large: ${t.caption}`,onClick:n,children:r?(0,V.jsx)(`span`,{className:`rev-thumb-problem`,children:`Can't be shown`}):(0,V.jsx)(`img`,{src:wf(e.sessionId,t.file),alt:``,onError:()=>i(!0)})})}function Kv(e){let{images:t,at:n}=e,r=t[n],i=r=>e.onShow((n+r+t.length)%t.length),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>a.current?.focus(),[]),(0,V.jsxs)(`div`,{className:`rev-large`,role:`dialog`,"aria-modal":`true`,"aria-label":r.caption,onClick:t=>{t.target===t.currentTarget&&e.onShow(null)},children:[(0,V.jsxs)(`div`,{className:`rev-large-bar`,children:[(0,V.jsxs)(`span`,{className:`rev-large-caption`,children:[r.caption,` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,n+1,` / `,t.length]})]}),(0,V.jsx)(`button`,{ref:a,className:`icon`,"aria-label":`Close: back to the review`,title:`Close (Esc)`,onClick:()=>e.onShow(null),children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),(0,V.jsxs)(`div`,{className:`rev-large-stage`,children:[(0,V.jsx)(Tf,{sessionId:e.q.sessionId,path:r.file,alt:r.caption},r.file),t.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:`nav l`,onClick:()=>i(-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,V.jsx)(`button`,{className:`nav r`,onClick:()=>i(1),"aria-label":`Next screenshot`,children:`›`})]})]})]})}function qv({q:e,n:t,ev:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!0;return R.evidenceText(e.id,t).then(e=>n&&i(e.content),e=>n&&o(e.message)),()=>{n=!1}},[e.id,t]);let l=r===null?[]:r.replace(/\n$/,``).split(`
|
|
95
|
-
`),u=l.length>
|
|
96
|
-
`)}),u&&(0,V.jsx)(`button`,{className:`small rev-text-toggle`,"aria-expanded":s,onClick:()=>c(!s),children:s?`Fold`:`Show all ${l.length} lines`})]})]})}function Jv(e){let t=B(),{q:n}=e,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),[u]=(0,v.useState)(e.noteFocus);(0,v.useEffect)(()=>{e.noteFocus!==u&&l.current?.focus()},[e.noteFocus]);let d=async t=>{c(!0),o(``);try{await t(),e.onAnswered()}catch(e){o(e.message),c(!1)}},f=e=>{if(s)return;let t=ne(e,r);`problem`in t?(o(t.problem),l.current?.focus()):d(()=>R.answerQuestion(n.id,t.answer))};if(n.status===`answered`){let t=n.answer??``,r=t.startsWith(N),i=r?t.slice(N.length).trim():t.startsWith(`Changes needed:`)?t.slice(P.length).trim():t;return(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Answer`}),(0,V.jsxs)(`div`,{className:`rev-verdict ${r?`accepted`:`changes`}`,children:[(0,V.jsx)(`strong`,{children:r?`Accepted`:`Changes needed`}),i&&(0,V.jsx)(`div`,{className:`rev-verdict-text`,children:i}),(0,V.jsxs)(`div`,{className:`muted`,children:[e.answeredBy,` · `,Eg(n.answeredAt??n.askedAt),` · `,n.deliveredAt?`delivered ${Eg(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]})}return n.status===`withdrawn`?(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Withdrawn`}),(0,V.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,V.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]})})]}):(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Your answer`}),(0,V.jsx)(`label`,{className:`muted rev-box-label`,htmlFor:`rev-${n.id}`,children:`A note with Accept (optional), or what needs changing (required for Changes needed)`}),(0,V.jsx)(`textarea`,{...t,id:`rev-${n.id}`,ref:l,className:`box`,placeholder:og()?`Write here`:`N to write, Esc to leave`,value:r,onChange:e=>{i(e.target.value),o(``)}}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>f(`accept`),children:`Accept`}),(0,V.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>f(`changes`),children:`Changes needed`}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:a})]}),(0,V.jsx)(sg,{busy:s,onWithdraw:()=>void d(()=>R.withdrawQuestion(n.id))})]})}function Yv({remote:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=B(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),f=()=>void R.remoteLink().then(n,()=>n(null));if((0,v.useEffect)(f,[e?.publicName]),!t)return null;if(t.source===`config`)return(0,V.jsxs)(`p`,{className:`muted`,children:[`This relay is set in the config file (`,(0,V.jsx)(`code`,{children:`"remote"`}),`); change or remove it there.`]});let p=e=>{s(!0),l(null),e().then(()=>{i(``),d(!1),f()},e=>l(e.message)).finally(()=>s(!1))};if(t.source===`joined`){let t=e?.certificate,n=e?.state===`connected`&&t?.state===`valid`;return(0,V.jsxs)(`div`,{className:`relay-join`,children:[n&&(0,V.jsx)(`p`,{className:`remote-state connected`,children:`Connected, certificate ok. Pair your phone in Phones below.`}),!n&&t?.state===`waiting-caa`&&(0,V.jsx)(`p`,{className:`muted`,children:`The relay's admin approves this computer, which adds the CAA record; the certificate follows within a minute.`}),u?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{children:`Leave the relay? Phones stop reaching this Ledung at once; joining again needs a new code.`}),(0,V.jsx)(`button`,{className:`small danger`,disabled:o,onClick:()=>p(R.remoteLeave),children:`Leave`}),(0,V.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>d(!1),children:`Cancel`})]}):(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(!0),children:`Leave this relay`}),c&&(0,V.jsx)(`p`,{className:`restart-problem`,children:c})]})}return(0,V.jsxs)(`div`,{className:`relay-join`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Got a join code from a relay's admin? Paste it here: Ledung makes its own secret and certificate account, joins the relay and connects, with no restart.`}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`relay.example.org/ABCD-…`,spellCheck:!1,autoComplete:`off`,"aria-label":`Join code`}),(0,V.jsx)(`button`,{disabled:o||!r.trim(),onClick:()=>p(()=>R.remoteJoin(r)),children:o?`Joining…`:`Join with a code`})]}),c&&(0,V.jsx)(`p`,{className:`restart-problem`,children:c})]})}function Xv({view:e,onView:t,run:n,newComputers:r}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Qv,{view:e,onView:t,run:n}),e.relay&&e.keySha256&&(0,V.jsx)($v,{run:n,newComputers:r,tokenSet:e.tokenSet})]})}var Zv=e=>!!e.relay||!!e.keySha256;function Qv({view:e,onView:t,run:n}){let[r,i]=(0,v.useState)(e.relay??``),a=B(),[o,s]=(0,v.useState)(``);return(0,V.jsxs)(`div`,{className:`relay-admin`,children:[(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsxs)(`label`,{children:[`Relay `,(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`wss://relay.example.org`,spellCheck:!1})]}),(0,V.jsx)(`button`,{className:`small`,disabled:r.trim()===(e.relay??``),onClick:()=>void n(async()=>t(await R.setRelayAdmin({relay:r}))),children:`Save`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Admin key: `,e.keySha256?(0,V.jsxs)(V.Fragment,{children:[`made. Its SHA-256 goes in the relay's config as `,(0,V.jsx)(`code`,{children:`"adminKeySha256"`}),`: `,(0,V.jsx)(`code`,{className:`remote-record`,children:e.keySha256}),` `,(0,V.jsx)(Df,{text:e.keySha256})]}):`none yet. Ledung makes it and keeps it in its data folder; only its SHA-256 goes to the relay.`]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.makeRelayAdminKey())),children:e.keySha256?`Make a new admin key`:`Make admin key`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Cloudflare token (Zone DNS edit, for the relay's domain): `,e.tokenSet?`set. Approve writes new computers' CAA records with it.`:`none. Without one, copy each new computer's CAA record into the DNS yourself.`,` It stays on this computer and is never shown again.`]}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{type:`password`,value:o,onChange:e=>s(e.target.value),placeholder:e.tokenSet?`Replace the token`:`Paste the token`,autoComplete:`off`,"aria-label":`Cloudflare token`}),(0,V.jsx)(`button`,{className:`small`,disabled:!o.trim(),onClick:()=>void n(async()=>{t(await R.setRelayAdmin({cloudflareToken:o})),s(``)}),children:`Save token`}),e.tokenSet&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.setRelayAdmin({cloudflareToken:``}))),children:`Remove token`})]})]})}function $v({run:e,newComputers:t,tokenSet:n}){let[r,i]=(0,v.useState)(``),a=B(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),m=()=>void R.relayComputers().then(e=>{d(e.invites),p(null)},e=>p(e.message));return(0,v.useEffect)(m,[]),(0,V.jsxs)(`div`,{className:`relay-invites`,children:[(0,V.jsx)(`h4`,{children:`Invite a computer`}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`Whose computer`,"aria-label":`Owner`}),(0,V.jsx)(`input`,{...a,value:o,onChange:e=>s(e.target.value),placeholder:`Name (optional: two words and digits otherwise)`,spellCheck:!1,"aria-label":`Name`}),(0,V.jsx)(`button`,{disabled:!r.trim(),onClick:()=>void e(async()=>{l(await R.relayInvite(r,o.trim()||void 0)),i(``),s(``),m()}),children:`Invite`})]}),c&&(0,V.jsxs)(`div`,{className:`relay-code`,children:[(0,V.jsxs)(`p`,{children:[`Join code for `,c.owner,`'s computer, `,(0,V.jsx)(`b`,{children:c.host}),`. It is shown only now, works once, and runs out at `,new Date(c.expiresAt).toLocaleString(),`:`]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`code`,{className:`remote-record`,children:c.code}),` `,(0,V.jsx)(Df,{text:c.code})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`They paste it in their Ledung under Settings → Remote access → Join with a code. Then the computer shows up in Waiting for you`,n?` to approve`:` with its CAA record to add`,`.`]})]}),f&&(0,V.jsx)(`p`,{className:`restart-problem`,children:f}),u&&u.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h4`,{children:`Not used yet`}),(0,V.jsx)(`ul`,{className:`relay-list`,children:u.map(t=>(0,V.jsxs)(`li`,{children:[t.host,` for `,t.owner,`, until `,new Date(t.expiresAt).toLocaleString(),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeRelayInvite(t.id),m()}),children:`Revoke`})]},t.id))})]}),t.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[t.length,` computer`,t.length===1?``:`s`,` joined and wait`,t.length===1?`s`:``,` for the CAA record: see Waiting for you.`]})]})}function ey({computer:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))};return(0,V.jsxs)(`div`,{className:`new-computer`,children:[(0,V.jsxs)(`div`,{className:`new-computer-head`,children:[`New computer `,(0,V.jsx)(`code`,{children:e.name}),` for `,e.owner]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`It joined the relay as `,e.host,e.enrolledAt?` at ${new Date(e.enrolledAt).toLocaleString()}`:``,`. Its certificate needs this CAA record, which names its own ACME account:`]}),(0,V.jsx)(`p`,{children:(0,V.jsx)(`code`,{className:`remote-record`,children:e.record})}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[e.approvable&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.approveComputer(e.name)),title:`Writes the record through Cloudflare with the token in Settings → Relay; never changes an existing one`,children:i?`Approving…`:`Approve`}),(0,V.jsx)(Df,{text:e.record}),!e.approvable&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.computerAdded(e.name)),children:`I added it`})]}),!e.approvable&&(0,V.jsx)(`p`,{className:`muted`,children:`No Cloudflare token is set in Settings → Relay: copy the record into the DNS yourself, then press I added it.`}),n&&(0,V.jsx)(`p`,{className:`restart-problem`,children:n})]})}function ty({pairing:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))},s=new Date(e.at).toLocaleString(),{device:c}=e;return(0,V.jsxs)(`div`,{className:`new-computer`,children:[(0,V.jsx)(`div`,{className:`new-computer-head`,children:c?(0,V.jsxs)(V.Fragment,{children:[e.computer,` paired `,(0,V.jsx)(`code`,{children:c.name}),` through the link`]}):(0,V.jsxs)(V.Fragment,{children:[e.computer,` opened a pairing through the link`]})}),(0,V.jsx)(`p`,{className:`muted`,children:c?`At ${s}, from ${e.computer}'s own screen. It can look at this computer's sessions, questions and chats; it can change nothing until it sets up its passkey and logs on here with Touch ID or Windows Hello.`:`At ${s}, from ${e.computer}'s own screen: a pairing code for a browser there, good for 10 minutes. Nothing has paired with it yet.`}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[c&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(async()=>{await R.revokeDevice(c.id),await R.dismissLinkPairing(e.id)}),children:`Remove device`}),(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.dismissLinkPairing(e.id)),title:`Takes this card away; the device stays in Settings → Phones`,children:`OK`})]}),n&&(0,V.jsx)(`p`,{className:`restart-problem`,children:n})]})}var ny=e=>e.status===`open`&&e.addressedTo===`user`,ry=e=>e.status===`pending`&&e.addressedTo===`user`;function iy(e,t){return e.filter(ny).length+t.filter(ry).length}var ay=[`var(--s2)`,`var(--s4)`,`var(--s1)`,`var(--s7)`,`var(--s5)`,`var(--s3)`],oy=`var(--s-other)`;function sy(e){let[t,n]=(0,v.useState)(()=>Vf(localStorage)),r=e=>{n(e),Hf(localStorage,e)},i=t=>e.sessions.find(e=>e.id===t),a=e=>i(e)?.title??`unknown`,o=e=>{let t=i(e);return t?.role===`manager`?`Manager "${t.title}"`:t?.title??`Unknown session`},s=e=>i(e)?.project??``,c=t=>e.projects.find(e=>e.name===t),l=t=>Nv(i(t),Mv(e.projects,e.chats)),u=[...e.projects.map(e=>e.name),...e.sessions.some(e=>e.project===`~chats`)?[x]:[]],d=e=>t.mode===`all`?!t.hidden.includes(e):e===t.one,f=he(e.projects.map(e=>e.questionTiers)),p=e=>e===null?oy:ay[f.indexOf(e)%ay.length]??oy,m=he(e.projects.filter(e=>d(e.name)).map(e=>e.questionTiers)),{items:h,forYou:g,done:_,listFor:y}=Wf(e.questions,s,e=>c(e)?.questionTiers??[],d,m),b=e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&d(s(e.sessionId))).sort((e,t)=>e.at-t.at),S=t=>h.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&e.project===t).length+e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&s(e.sessionId)===t).length,C=e.questionId===null?null:h.find(t=>t.q.id===e.questionId)??null,w=(t,n,r)=>(0,V.jsxs)(`header`,{className:`desk-head`,children:[(0,V.jsx)(`button`,{className:`icon sidebar-toggle`,title:`${e.sidebarHidden?`Show`:`Hide`} the sidebar (S)`,"aria-label":`${e.sidebarHidden?`Show`:`Hide`} the sidebar`,"aria-pressed":e.sidebarHidden,onClick:e.onToggleSidebar,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,"aria-hidden":`true`,children:[(0,V.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,V.jsx)(`path`,{d:`M6 2.5v11`})]})}),(0,V.jsxs)(`div`,{className:`head-main`,children:[(0,V.jsxs)(`div`,{className:`head-text`,children:[(0,V.jsx)(`h2`,{children:`Waiting for you`}),(0,V.jsx)(`div`,{className:`muted`,children:t})]}),(0,V.jsx)(`div`,{className:`head-controls`,children:n})]}),r&&(0,V.jsxs)(`button`,{className:`small conv`,title:`Go to conversation (C): ${o(vg(r))}`,onClick:()=>e.onGoToConversation(r.id),children:[(0,V.jsx)(cy,{}),(0,V.jsx)(`span`,{className:`conv-text`,children:`Go to conversation`})]}),(0,V.jsx)(`button`,{className:`icon`,title:`Close: back to the view before`,"aria-label":`Close`,onClick:e.onClose,children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),T={props:e,nameOf:o,titleOf:a,tierColor:p,tintOf:l,settingsOf:c,header:w};if(e.questionId!==null){if(!C)return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[w(``,(0,V.jsx)(`button`,{onClick:()=>e.onOpenQuestion(null),children:`← Queue`})),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsx)(`div`,{className:`desk-body`,children:(0,V.jsxs)(`div`,{className:`empty-box`,children:[`Question #`,e.questionId,` is not here: it may be older than the recent ones Ledung keeps in view.`]})})})]});let t=y(C),n=n=>{let r=t.filter(e=>e.q.id!==n&&e.q.status===`open`)[Math.max(0,t.findIndex(e=>e.q.id===n))]??g.find(e=>e.q.id!==n);e.onOpenQuestion(r?r.q.id:null)};return C.v.review?(0,V.jsx)(py,{ctx:T,item:C,list:t,onAnswered:n},C.q.id):C.q.shots?(0,V.jsx)(my,{ctx:T,item:C,list:t,onAnswered:e.onLeaveShots},C.q.id):(0,V.jsx)(_y,{ctx:T,item:C,list:t,onAnswered:n},C.q.id)}return(0,V.jsx)(fy,{ctx:T,filter:t,setFilter:r,projectNames:u,waitingIn:S,forYou:g,done:_,permsForYou:b,tiers:m})}var cy=()=>(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z`})});function ly(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=e=>{let n=document.activeElement,r=!!n&&(n.tagName===`TEXTAREA`||n.tagName===`INPUT`||n.tagName===`SELECT`);t.current(e,r)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[])}var uy=e=>e.trim().split(`
|
|
97
|
-
`)[0]??``,dy=e=>e.replace(/\*\*|`|^#+\s*/gm,``).replace(/\s+/g,` `).trim().slice(0,180);function fy(e){let{props:t,nameOf:n,titleOf:r,tierColor:i,tintOf:a,header:o}=e.ctx,{filter:s,setFilter:c}=e,l=t=>c({...s,mode:t,one:e.projectNames.includes(s.one)?s.one:e.projectNames[0]??``}),u=()=>{let t=e.projectNames;t.length&&c({...s,mode:`one`,one:t[(t.indexOf(s.one)+1)%t.length]})};ly((n,r)=>{if(n.key===`Escape`){r?document.activeElement.blur():t.onClose();return}if(r||n.ctrlKey||n.metaKey||n.altKey)return;let i=n.key.toLowerCase();i===`s`?t.onToggleSidebar():n.key===`Enter`&&e.forYou[0]&&document.activeElement?.tagName!==`BUTTON`&&document.activeElement?.tagName!==`A`?(n.preventDefault(),t.onOpenQuestion(e.forYou[0].q.id)):/^[1-9]$/.test(n.key)&&e.forYou[Number(n.key)-1]?t.onOpenQuestion(e.forYou[Number(n.key)-1].q.id):i===`a`?l(s.mode===`all`?`one`:`all`):i===`p`&&u()});let d=e.forYou.length+e.permsForYou.length+t.newComputers.length+t.linkPairings.length,f=e.done.filter(e=>e.q.status===`answered`).length,p=(e,r)=>{let{q:i,v:o}=e,s=i.status!==`open`,c=a(i.sessionId);return(0,V.jsxs)(`div`,{className:`qrow-wrap`,children:[(0,V.jsxs)(`button`,{className:`qrow name-tinted${c?` tinted`:``}${s?` done`:``}`,style:c,onClick:()=>t.onOpenQuestion(i.id),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Pv(e.tier,e.project)}),(0,V.jsx)(`span`,{className:`place`,children:s?i.status===`answered`?`✓`:`–`:r??`·`}),(0,V.jsxs)(`span`,{className:`t`,children:[o.title,de(o.opinions)&&!s&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`split`,children:`They disagree`})]})]}),s?i.status===`answered`?(0,V.jsxs)(`span`,{className:`pill`,children:[i.answeredBy===`user`?`You`:`Manager`,` · `,Eg(i.answeredAt??i.askedAt)]}):(0,V.jsx)(`span`,{className:`pill grey`,children:`Withdrawn`}):(0,V.jsx)(`span`,{className:`when`,children:Eg(i.askedAt)}),(0,V.jsxs)(`span`,{className:`meta`,children:[(0,V.jsxs)(`span`,{children:[`#`,i.id]}),(0,V.jsx)(`span`,{children:n(i.sessionId)}),i.aboutQuestion!==null&&(0,V.jsxs)(`span`,{children:[`· about #`,i.aboutQuestion]}),!o.structured&&(0,V.jsx)(`span`,{className:`chip`,children:`plain`}),o.review&&(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),i.shots&&(0,V.jsx)(`span`,{className:`chip shot-chip`,children:fg(i)})]}),(0,V.jsx)(`span`,{className:`excerpt`,children:s?i.status===`answered`?dy(i.answer??``):i.withdrawnReason??``:dy(o.review?uy(o.review.solving):o.issue)})]}),(0,V.jsx)(`button`,{className:`icon conv-row`,title:`Go to conversation: ${n(vg(i))}`,"aria-label":`Go to conversation of question #${i.id}`,onClick:()=>t.onGoToConversation(i.id),children:(0,V.jsx)(cy,{})})]},i.id)},m=e=>(0,V.jsxs)(`div`,{className:`waiting-permission`,children:[(0,V.jsxs)(`div`,{className:`waiting-from`,children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>t.onOpenSession(e.sessionId),children:r(e.sessionId)}),(0,V.jsxs)(`span`,{className:`muted`,children:[` (`,S(t.sessions.find(t=>t.id===e.sessionId)?.project??``),`) · `,Eg(e.at)]})]}),(0,V.jsx)(Rh,{permission:e})]},e.id),h=(e,t,n)=>(0,V.jsxs)(`h3`,{className:`group-head`,style:{"--c":t},children:[(0,V.jsx)(`i`,{}),e,n!==void 0&&(0,V.jsx)(`span`,{className:`count`,children:n})]}),g=(0,V.jsxs)(`div`,{className:`filter`,children:[(0,V.jsxs)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Show`,children:[(0,V.jsx)(`button`,{className:s.mode===`one`?`on`:``,"aria-pressed":s.mode===`one`,onClick:()=>l(`one`),children:`One project`}),(0,V.jsx)(`button`,{className:s.mode===`all`?`on`:``,"aria-pressed":s.mode===`all`,onClick:()=>l(`all`),children:`All`})]}),(0,V.jsx)(`div`,{className:`projs`,children:e.projectNames.map(t=>{let n=s.mode===`all`?!s.hidden.includes(t):t===s.one;return(0,V.jsxs)(`button`,{className:`proj ${n?`on`:`off`}`,"aria-pressed":n,onClick:()=>s.mode===`one`?c({...s,one:t}):c({...s,hidden:s.hidden.includes(t)?s.hidden.filter(e=>e!==t):[...s.hidden,t]}),children:[s.mode===`all`&&(0,V.jsx)(`span`,{className:`box`,children:n?`✓`:``}),S(t),` `,(0,V.jsx)(`b`,{children:e.waitingIn(t)})]},t)})})]}),_=0;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[o((0,V.jsxs)(`span`,{className:`tally`,children:[(0,V.jsx)(`b`,{children:d}),` waiting · `,(0,V.jsx)(`b`,{children:f}),` answered`]}),g),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsxs)(`div`,{className:`desk-body`,children:[(0,V.jsxs)(`p`,{className:`lede muted`,children:[`Ordered by what each answer unblocks, and each answer takes you to the next.`,(0,V.jsxs)(`span`,{className:`kbd-hint`,children:[` `,(0,V.jsx)(`kbd`,{children:`Enter`}),` opens the first question.`]})]}),!d&&(0,V.jsxs)(`div`,{className:`empty-box`,children:[`Nothing is waiting for you`,s.mode===`one`&&s.one?` in ${s.one}`:``,`. New questions appear here as they are asked.`]}),t.newComputers.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`New computers`,`var(--warn-border)`,t.newComputers.length),t.newComputers.map(e=>(0,V.jsx)(ey,{computer:e,run:t.run},e.name))]}),t.linkPairings.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Paired through the link`,`var(--warn-border)`,t.linkPairings.length),t.linkPairings.map(e=>(0,V.jsx)(ty,{pairing:e,run:t.run},e.id))]}),e.permsForYou.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Permission prompts`,`var(--warn-border)`,e.permsForYou.length),e.permsForYou.map(m)]}),[...e.tiers,null].map(t=>{let n=e.forYou.filter(e=>e.tier===t);return n.length?(0,V.jsxs)(`div`,{className:`group`,children:[h(t??`Older, without a tier`,i(t),n.length),n.map(e=>p(e,++_))]},t??``):null}),e.done.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Answered recently`,`var(--ok)`),e.done.map(e=>p(e,null))]}),(0,V.jsxs)(`div`,{className:`keys`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Enter`}),` first question`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),`–`,(0,V.jsx)(`kbd`,{children:`9`}),` open by place`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`P`}),` next project`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`A`}),` one project / all`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(cy,{}),` on a row: its conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` hide / show sidebar`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})})]})}function py({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,tintOf:s,settingsOf:c,header:l}=e,{q:u,v:d,project:f,tier:p}=t,m=d.review,h=m.evidence??[],g=h.filter(e=>e.kind!==`text`),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(0),C=n.findIndex(e=>e.q.id===u.id),w=e=>{let t=n[C+e];C>=0&&t&&i.onOpenQuestion(t.q.id)},T=e=>{let t=_;y(e),e===null&&t!==null&&setTimeout(()=>document.querySelectorAll(`.rev-thumb`)[t]?.focus())};ly((e,t)=>{if(_!==null){if(e.key===`Escape`)T(null);else if(e.key===`ArrowRight`)T((_+1)%g.length);else if(e.key===`ArrowLeft`)T((_-1+g.length)%g.length);else if(e.key===`Tab`){let t=[...document.querySelectorAll(`.rev-large button`)];t[(t.indexOf(document.activeElement)+(e.shiftKey?-1:1)+t.length)%t.length]?.focus()}else return;e.preventDefault();return}let n=!!document.activeElement?.closest(`.rev-text-body`);if(e.key===`Escape`){t||n?document.activeElement.blur():i.onOpenQuestion(null);return}if(t||n||e.ctrlKey||e.metaKey||e.altKey)return;let r=e.key.toLowerCase();r===`s`?i.onToggleSidebar():e.key===`ArrowRight`?w(1):e.key===`ArrowLeft`?w(-1):r===`c`?i.onGoToConversation(u.id):r===`n`&&u.status===`open`&&(e.preventDefault(),x(e=>e+1))});let E=a(u.sessionId),D=c(f)?.tickets??void 0,O=e=>jv([e],D)[0]?.url,k=u.answeredBy===`user`?u.forwardedFrom===null?i.userName:`${i.userName} (passed on by the manager)`:`Manager "${o(u.answeredBy??``)}", under its standing grant`,ee=u.status===`open`?u.addressedTo===`user`?`${C+1} of ${n.length} waiting`:`Manager "${o(u.addressedTo)}" is handling it`:u.status===`answered`?`Answered`:`Withdrawn`;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[l(ee,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:C<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>w(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:C<0||C>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>w(1),children:`→`})]}),u),(0,V.jsx)(`div`,{className:`desk${_===null?``:` locked`}`,children:(0,V.jsxs)(`div`,{className:`desk-body review`,children:[(0,V.jsxs)(`div`,{className:`qhead name-tinted${s(u.sessionId)?` tinted`:``}`,style:s(u.sessionId),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Pv(p,f)}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),(0,V.jsxs)(`strong`,{children:[`#`,u.id]}),(0,V.jsx)(`span`,{className:`chip`,children:S(f)}),(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>i.onOpenSession(u.sessionId),children:E}),` · asked `,Eg(u.askedAt)]}),u.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,o(u.addressedTo),`"`]})]}),(0,V.jsx)(`h3`,{children:d.title}),d.refs.length>0&&(0,V.jsx)(`div`,{className:`refs`,children:d.refs.map(e=>{let t=O(e);return t?(0,V.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,V.jsx)(`span`,{className:`chip`,children:e},e)})})]}),u.status===`open`&&u.addressedTo!==`user`&&(0,V.jsxs)(`div`,{className:`handled`,children:[`Manager "`,o(u.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),(0,V.jsx)(Fv,{q:u,userName:i.userName,nameOf:a,tintOf:s,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null}),(0,V.jsx)(Uv,{review:m,sessionId:u.sessionId}),h.length>0&&(0,V.jsx)(Wv,{q:u,evidence:h,shown:_,onShow:T}),(0,V.jsx)(Jv,{q:u,answeredBy:k,noteFocus:b,onAnswered:()=>r(u.id)}),(0,V.jsxs)(`div`,{className:`keys`,children:[u.status===`open`&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})})]})}function my({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,header:s}=e,{q:c,v:l,project:u}=t,d=n.findIndex(e=>e.q.id===c.id),f=e=>{let t=n[d+e];d>=0&&t&&i.onOpenQuestion(t.q.id)},p=c.status===`open`?c.addressedTo===`user`?`${d+1} of ${n.length} waiting`:`Manager "${o(c.addressedTo)}" is handling it`:c.status===`answered`?`Answered`:`Withdrawn`;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[s(p,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:d<=0,"aria-label":`Previous question`,title:`Previous question`,onClick:()=>f(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:d<0||d>=n.length-1,"aria-label":`Next question`,title:`Next question`,onClick:()=>f(1),children:`→`})]}),c),(0,V.jsx)(ug,{question:{...c,shots:c.shots},title:l.title,issue:l.issue,evidence:l.evidence,options:l.options,opinions:l.opinions.map(e=>({...e,who:e.who??a(c.sessionId)})),userName:i.userName,session:{title:a(c.sessionId),project:u,onOpen:()=>i.onOpenSession(c.sessionId)},onClose:()=>i.onOpenQuestion(null),onDone:r,onToggleSidebar:i.onToggleSidebar,onGoToConversation:()=>i.onGoToConversation(c.id),withdrawnIds:i.questions.filter(e=>e.status===`withdrawn`).map(e=>e.id),refersTo:(0,V.jsx)(Fv,{q:c,userName:i.userName,nameOf:a,tintOf:e.tintOf,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null})})]})}function hy({opinions:e,whoOf:t}){let n=e.length;return n?n===1?(0,V.jsx)(`div`,{className:`legend`,children:(0,V.jsxs)(`span`,{children:[`Green border: `,t(e[0]),`'s pick`]})}):n>5?(0,V.jsx)(`div`,{className:`legend`,children:(0,V.jsxs)(`span`,{children:[n,` opinions: each option says who picked it`]})}):(0,V.jsxs)(`div`,{className:`legend`,children:[(0,V.jsxs)(`span`,{children:[`Green border in `,n,` parts, one per opinion, left to right:`]}),e.map((e,r)=>(0,V.jsxs)(`span`,{children:[(0,V.jsx)(gy,{i:r,n}),t(e)]},r)),(0,V.jsx)(`span`,{children:`Whole border: they all agree`})]}):null}var gy=({i:e,n:t})=>(0,V.jsx)(`span`,{className:`part-key`,"aria-hidden":`true`,children:Array.from({length:t},(t,n)=>(0,V.jsx)(`i`,{className:n===e?`on`:``},n))});function _y({ctx:e,item:t,list:n,onAnswered:r}){let i=B(),{props:a,nameOf:o,titleOf:s,tintOf:c,settingsOf:l,header:u}=e,{q:d,v:f,project:p,tier:m}=t,h=d.status===`open`,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(!1),D=(0,v.useRef)(null),O=(0,v.useRef)(null),k=n.findIndex(e=>e.q.id===d.id),ee=f.options.length+1,A=!d.aboutRequest;(0,v.useEffect)(()=>{g===`other`&&D.current?.focus()},[g]);let j=e=>{let t=n[k+e];k>=0&&t&&a.onOpenQuestion(t.q.id)},M=e=>{_(e),w(``)},te=async()=>{if(!h||T)return;if(!g)return w(`Pick an option first.`);if(g===`other`&&!y.trim()){w(`Write your answer in the box first.`),D.current?.focus();return}let e=g===`other`?y.trim():f.options.find(e=>e.key===g).answer,t=A&&x.trim()?`${e}\n\nNote: ${x.trim()}`:e;E(!0),w(``);try{await R.answerQuestion(d.id,t),r(d.id)}catch(e){w(e.message),E(!1)}},N=async()=>{E(!0);try{await R.withdrawQuestion(d.id),r(d.id)}catch(e){w(e.message),E(!1)}};ly((e,t)=>{if((e.ctrlKey||e.metaKey)&&e.key===`Enter`){e.preventDefault(),te();return}if(e.key===`Escape`){t?document.activeElement.blur():a.onOpenQuestion(null);return}if(t||e.ctrlKey||e.metaKey||e.altKey)return;let n=e.key.toLowerCase();if(n===`s`)a.onToggleSidebar();else if(e.key===`ArrowRight`)j(1);else if(e.key===`ArrowLeft`)j(-1);else if(n===`c`)a.onGoToConversation(d.id);else if(!h)return;else if(/^[1-9]$/.test(e.key)){let t=Number(e.key);t<=f.options.length?(e.preventDefault(),M(f.options[t-1].key)):t===ee&&(e.preventDefault(),M(`other`))}else n===`n`&&A&&(e.preventDefault(),O.current?.focus())});let P=o(d.sessionId),ne=l(p)?.tickets??void 0,re=e=>jv([e],ne)[0]?.url,ie=d.status===`answered`&&d.answer!==null?f.options.find(e=>d.answer===e.answer||d.answer.startsWith(`${e.answer}\n\nNote: `))?.key??null:null,ae=d.answeredBy===`user`?d.forwardedFrom===null?a.userName:`${a.userName} (passed on by the manager)`:`Manager "${s(d.answeredBy??``)}", under its standing grant`,oe=e=>{let t=f.options.findIndex(t=>t.key===e);return t<0?e:`${t+1} · ${f.options[t].label.replace(/\*\*/g,``)}`},se=d.status===`open`?d.addressedTo===`user`?`${k+1} of ${n.length} waiting`:`Manager "${s(d.addressedTo)}" is handling it`:d.status===`answered`?`Answered`:`Withdrawn`,ce=e=>(0,V.jsx)(jf,{text:e,sessionId:d.sessionId}),le=f.opinions,ue=le.length<=5,fe=e=>e.who??P,pe=e=>({"--i":e,"--n":le.length});return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[u(se,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>a.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:k<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>j(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:k<0||k>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>j(1),children:`→`})]}),d),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsxs)(`div`,{className:`desk-body`,children:[(0,V.jsxs)(`div`,{className:`qhead name-tinted${c(d.sessionId)?` tinted`:``}`,style:c(d.sessionId),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Pv(m,p)}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,d.id]}),(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>a.onOpenSession(d.sessionId),children:P}),` · asked `,Eg(d.askedAt)]}),d.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,s(d.addressedTo),`"`]}),!f.structured&&(0,V.jsx)(`span`,{className:`chip`,title:`Asked with text and option labels only`,children:`plain question`}),!f.structured&&(0,V.jsx)(`span`,{className:`muted touch-only`,children:`· asked with text and option labels only`})]}),(0,V.jsx)(`h3`,{children:f.title}),f.refs.length>0&&(0,V.jsx)(`div`,{className:`refs`,children:f.refs.map(e=>{let t=re(e);return t?(0,V.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,V.jsx)(`span`,{className:`chip`,children:e},e)})})]}),h&&d.addressedTo!==`user`&&(0,V.jsxs)(`div`,{className:`handled`,children:[`Manager "`,s(d.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),d.aboutRequest&&h&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. The first option allows it once; any other answer denies it, with your words as the reason.`]}),(0,V.jsx)(Fv,{q:d,userName:a.userName,nameOf:o,tintOf:c,onOpenConversation:(e,t)=>a.onGoToConversation(t,e),onOpenMessage:a.onGoToMessage,onOpenQuestion:e=>a.questions.some(t=>t.id===e)?()=>a.onOpenQuestion(e):null}),f.issue&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`The issue`}),(0,V.jsx)(`div`,{className:`issue prose`,children:ce(f.issue)})]}),f.evidence&&(0,V.jsx)(`section`,{className:`block`,children:(0,V.jsxs)(`details`,{className:`ev`,children:[(0,V.jsx)(`summary`,{children:`Evidence`}),(0,V.jsx)(`div`,{className:`prose`,children:ce(f.evidence)})]})}),d.status===`answered`&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Answer`}),(0,V.jsxs)(`div`,{className:`answered-box`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`strong`,{children:[ae,`:`]}),` `,d.answer]}),(0,V.jsxs)(`div`,{className:`muted`,children:[`answered `,Eg(d.answeredAt??d.askedAt),` · `,d.deliveredAt?`delivered ${Eg(d.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]}),d.status===`withdrawn`&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Withdrawn`}),(0,V.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,V.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,d.withdrawnReason?`: ${d.withdrawnReason}`:``]})})]}),(f.options.length>0||h)&&(0,V.jsxs)(`section`,{className:`block opts-block`,children:[(0,V.jsx)(`h4`,{children:`Options`}),f.options.length>0&&(0,V.jsx)(hy,{opinions:le,whoOf:fe}),(0,V.jsxs)(`div`,{className:`opts`,role:`radiogroup`,"aria-label":`Options`,children:[f.options.map((e,t)=>{let n=h?g===e.key:ie===e.key;return(0,V.jsxs)(`button`,{className:`opt${n?` on`:``}`,role:`radio`,"aria-checked":n,disabled:!h,onClick:()=>M(e.key),children:[(0,V.jsx)(`span`,{className:`k`,children:t+1}),(0,V.jsxs)(`span`,{className:`lab`,children:[f.structured&&(0,V.jsx)(`span`,{className:`letter`,children:e.key}),e.label.replace(/\*\*/g,``)]}),e.detail&&(0,V.jsx)(`span`,{className:`det prose`,children:ce(e.detail)}),e.cost&&(0,V.jsxs)(`span`,{className:`cost muted`,children:[(0,V.jsx)(`b`,{children:`Cost`}),` · `,e.cost]}),ue&&le.map((t,n)=>t.pick===e.key&&(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(`span`,{className:`edge${n===0?` first`:``}${n===le.length-1?` last`:``}`,style:pe(n)}),(0,V.jsx)(`span`,{className:`tag who`,style:pe(n),title:fe(t),children:fe(t)})]},n)),le.some(t=>t.pick===e.key)&&(0,V.jsxs)(`span`,{className:`picked-by${ue?` touch-only`:``}`,children:[(0,V.jsx)(`b`,{children:`Picked by`}),` `,le.filter(t=>t.pick===e.key).map(fe).join(`, `)]}),!h&&n&&(0,V.jsx)(`span`,{className:`tag answer`,children:`Answer`})]},e.key)}),h&&(0,V.jsxs)(`button`,{className:`opt${g===`other`?` on`:``}`,role:`radio`,"aria-checked":g===`other`,onClick:()=>M(`other`),children:[(0,V.jsx)(`span`,{className:`k`,children:ee}),(0,V.jsx)(`span`,{className:`lab`,children:`Other answer`}),(0,V.jsx)(`span`,{className:`det`,children:d.aboutRequest?`Deny it, saying why in your own words.`:`Say it in your own words.`})]})]}),h&&g===`other`&&(0,V.jsx)(`textarea`,{...i,ref:D,className:`box`,placeholder:`Your answer, in your own words`,value:y,onChange:e=>b(e.target.value)})]}),(f.structured||le.length>0)&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsxs)(`h4`,{children:[`Opinions`,de(le)&&(0,V.jsx)(`span`,{className:`split`,children:`They disagree`})]}),le.length?(0,V.jsx)(`div`,{className:`recs`,children:le.map((e,t)=>(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`rec-label muted`,children:[ue&&le.length>1&&(0,V.jsx)(gy,{i:t,n:le.length}),fe(e),e.who===null&&` (asker)`]}),(0,V.jsxs)(`div`,{className:`rec${e.pick?``:` empty`}`,children:[(0,V.jsx)(`div`,{className:`pick`,children:e.pick?oe(e.pick):`No pick among the options`}),(0,V.jsx)(`div`,{className:`prose`,children:e.why?ce(e.why):(0,V.jsx)(`span`,{className:`none`,children:f.structured?`No reason given.`:`Marked "(recommended)"; a plain question gives no reason.`})})]})]},t))}):(0,V.jsx)(`div`,{className:`rec empty`,children:(0,V.jsx)(`div`,{className:`none`,children:`No opinions given.`})})]}),h&&(0,V.jsxs)(`section`,{className:`block note-block`,children:[A&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`h4`,{children:[`Note `,(0,V.jsx)(`span`,{className:`opt-in`,children:`(optional, goes with the answer)`})]}),(0,V.jsx)(`textarea`,{...i,ref:O,className:`box`,placeholder:`Anything to go with the answer`,value:x,onChange:e=>S(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),(0,V.jsxs)(`span`,{className:`muted send-hint`,children:[(0,V.jsx)(`kbd`,{children:`Ctrl`}),`/`,(0,V.jsx)(`kbd`,{children:`⌘`}),`+`,(0,V.jsx)(`kbd`,{children:`Enter`}),` sends`]}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:C})]}),(0,V.jsx)(sg,{busy:T,onWithdraw:()=>void N()})]}),(0,V.jsxs)(`div`,{className:`keys`,children:[h&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),`–`,(0,V.jsx)(`kbd`,{children:ee}),` pick (`,ee,`: other)`]}),h&&A&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})}),h&&(0,V.jsxs)(`div`,{className:`send-bar`,children:[(0,V.jsx)(`span`,{className:`send-pick${g?``:` muted`}`,children:g===null?`No option picked yet`:g===`other`?`${ee} · Other answer`:oe(g)}),(0,V.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),C&&(0,V.jsx)(`span`,{className:`status`,role:`status`,children:C})]})]})}var vy=e=>Math.max(0,Math.min(100,Math.floor(Math.round((e??0)*1e4)/100)));function yy(e){if(e.holding)return`held at ${e.percent}%`;if(e.lifted)return`stop at ${e.percent}% lifted`;if(e.utilization==null)return`stop at ${e.percent}%`;let t=e.percent-vy(e.utilization);return`${Math.max(1,t)}% to stop`}var by={five_hour:`5 h`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`,seven_day_overage_included:`Weekly (incl. extra)`,overage:`Extra usage`};function xy(e,t,n){if(e==null)return``;let r=Math.ceil((e-t)/6e4),i=`${by[n]??n} limit resets`;if(r<=0)return`${i} now`;let a=Math.floor(r/1440),o=Math.floor(r%1440/60),s=r%60;return`${i} in ${(a?[`${a} d`,o?`${o} h`:``]:[o?`${o} h`:``,s?`${s} min`:``]).filter(Boolean).join(` `)}`}function Sy(e,t){let n=yy(e),r=e.holding||e.utilization==null?n[0].toUpperCase()+n.slice(1):`${vy(e.utilization)}% · ${n}`,i=xy(e.resetsAt,t,e.kind);return i?`${r} · ${i}`:r}var Cy=180;function wy({scene:e,step:t,number:n,cls:r}){let i=Hg(e,t),a=Hg({...e,sprites:[]},t),o=new Set(n.map(t=>t.y*(e.width+1)+t.x)),s=[],c=``;for(let e=0;e<i.length;e++)o.has(e)||i[e]!==a[e]&&i[e]!==`
|
|
98
|
-
`?(c&&s.push(c),c=``,s.push((0,V.jsx)(`span`,{className:r,children:i[e]},e))):c+=i[e];return c&&s.push(c),s}function Ty(e,t){let n=document.createElement(`canvas`).getContext(`2d`);return n?(n.font=`600 ${t}px ${getComputedStyle(e).fontFamily}`,n.measureText(`~`.repeat(50)).width/50):t*.6}function Ey({utilization:e,label:t,hull:n=`ship`}){let{size:r,next:i,step:a}=L_(`ledung.limitShipSize`,5),o=(0,v.useRef)(null),[s,c]=(0,v.useState)(c_.at(-1)),l=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,[u,d]=(0,v.useState)(0);(0,v.useLayoutEffect)(()=>{let e=o.current?.parentElement;if(!e||!o.current)return;let t=()=>{let t=Ty(o.current,r);c(c_.find(n=>n*t<=e.clientWidth)??c_.at(-1))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r]);let f=__(e*100,s,n),p=(0,v.useRef)(null),m=p.current??={mode:null,x:y_(f,s,n),stage:v_(f),shown:f,at:-1};m.mode===null&&f<m.shown&&!l&&(m.mode=`leaving`),m.mode===null&&(m.shown=f),(0,v.useEffect)(()=>{if(l)return;let e=setInterval(()=>d(e=>e+1),Cy);return()=>clearInterval(e)},[l]);let h=m.at!==u;m.at=u;let g,_=[],y=m.stage;if(m.mode===`leaving`)g=T_(s,m.stage,m.x,n),h&&(m.x-=2),m.x<-10&&Object.assign(m,{mode:`arriving`,x:-6,stage:0});else if(m.mode===`arriving`)g=E_(s,m.x,n),y=0,h&&(m.x+=1),m.x>=0&&Object.assign(m,{mode:null,x:0,shown:0});else{let t=y_(f,s,n);l||Math.abs(t-m.x)>s?m.x=t:h&&u%2==0&&m.x!==t&&(m.x+=Math.sign(t-m.x)),y=m.stage=v_(f),{scene:g,number:_}=w_(s,y,m.x,`${vy(e)}%`,n)}let b=y>=d_?`limit-ship-hull wreck`:y>0?`limit-ship-hull breaking`:`limit-ship-hull`;return(0,V.jsx)(`button`,{ref:o,type:`button`,className:`ship-button limit-ship`,title:`${t}: ${Math.round(e*100)}% used. Ship size ${r}px: click for ${i}px`,onClick:a,children:(0,V.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${r}px`},"aria-hidden":`true`,children:(0,V.jsx)(wy,{scene:g,step:l?0:u,number:_,cls:b})})})}var Dy=[[`five_hour`,`5-hour`],[`seven_day`,`Weekly`]],Oy=e=>Dy.find(([t])=>t===e)?.[1]??e;function ky(e){let t=e.utilization==null?``:` (now ${Math.round(e.utilization*100)}%)`,n=e.resetsAt==null?``:` until ${new Date(e.resetsAt).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}, when the window resets`;return`${Oy(e.kind)} usage${e.account==="default"?``:` of account ${e.account}`} reached the stop at ${e.percent}%${t}: new turns are held${n}.`}function Ay({stop:e,run:t}){let[n,r]=(0,v.useState)(Date.now);return(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),3e4);return()=>clearInterval(e)},[]),(0,V.jsxs)(`div`,{className:`limit-stop${e.holding?` held`:``}`,children:[(0,V.jsx)(`span`,{children:Sy(e,n)}),e.holding&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void t(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`})]})}function jy(e){let t=[`default`,...e.accounts.map(e=>e.name)];return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Usage stops`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`At this share of a plan window, Ledung holds new turns for every session and manager on the account; a running turn finishes. It lifts when the window resets, when you raise the stop, or with Lift. Once saved here, these replace the config's `,(0,V.jsx)(`code`,{children:`usageStops`}),`.`]}),t.map(n=>(0,V.jsxs)(`div`,{children:[t.length>1&&(0,V.jsx)(`strong`,{children:n==="default"?`This computer's login`:n}),Dy.map(([t,r])=>{let i=e.usageStops.find(e=>e.account===n&&e.kind===t);return(0,V.jsx)(My,{account:n,kind:t,label:r,stop:i,run:e.run},`${t}:${i?.percent??``}`)})]},n))]})}function My(e){let[t,n]=(0,v.useState)(e.stop?String(e.stop.percent):``),r=e.stop,i=()=>void e.run(()=>R.setUsageStop(e.account,e.kind,t.trim()?Number(t):null));return(0,V.jsxs)(`div`,{className:`row`,style:{display:`flex`,gap:`0.5rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,V.jsxs)(`label`,{children:[e.label,` `,(0,V.jsx)(`input`,{type:`number`,min:1,max:100,placeholder:`none`,value:t,style:{width:`5rem`},onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()}}),` %`]}),(0,V.jsx)(`button`,{className:`small`,disabled:t.trim()===(r?String(r.percent):``),onClick:i,children:`Save`}),r?.holding&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void e.run(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,V.jsx)(`span`,{className:`muted`,children:r?.holding?`Reached: work is held.`:r?.lifted?`Reached, lifted for this window.`:r?.utilization==null?``:`Now ${Math.round(r.utilization*100)}%.`})]})}var Ny=36e5,Py={five_hour:5*Ny,seven_day:168*Ny};function Fy(e,t,n,r=Date.now()){let i=Py[e];if(!i||!n||n<=r)return null;let a=r-(n-i);return a<i/10?null:t*i/Math.min(a,i)}function Iy(e,t,n,r=Date.now()){let i=Fy(e,t,n,r);return i==null?Py[e]?n?n<=r?{share:null,why:`No forecast: the window is resetting`}:{share:null,why:`No forecast yet: too little of the window has gone to tell the pace`}:{share:null,why:`No forecast: the reset time is not known yet`}:{share:null,why:`No forecast for this window`}:{share:i}}function Ly(e,t){if(!e)return null;let n=e.match(/^ps?:([^/]+)/);return n?n[1]:t.find(t=>t.id===e)?.project??null}function Ry(e,t,n,r){let i=n.find(n=>n.name===Ly(e,t));return i?{account:i.account??`default`,remember:!0}:{account:r??n[0]?.account??`default`,remember:!1}}var zy=e=>e==="default"?`Default`:e,By=e=>e&&e!=="default"?e:null;function Vy(e,t){return e.resetsAt!=null&&e.resetsAt<=t}function Hy(e,t){let n=e.seenAt??e.at,r=Math.max(0,Math.floor((t-n)/6e4));return r<1?`as of just now`:r<60?`as of ${r} min ago`:r<1440?`as of ${Math.floor(r/60)} h ago`:`as of ${new Date(n).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}`}function Uy(e,t){return t-(e.seenAt??e.at)>=36e5?Hy(e,t):null}function Wy(e){return e>=1e9?`${(e/1e9).toFixed(e>=1e10?0:1)}B`:e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(Math.round(e))}function Gy(e){return e==null?`—`:e>=100?`$${Math.round(e).toLocaleString(`en-US`)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}var Ky=e=>`${Math.round(e*100)}%`;function qy(e){let t={passing:` ✓`,failing:` ✗`,running:` …`,none:``}[e.checks],n=e.state===`open`?``:` (${e.state})`;return`PR #${e.number}${t}${n}`}var Jy=[`opus-5-5`,`sonnet-5-5`,`haiku-5-5`,`fable-5-1`,`opus-5`,`sonnet-5`,`haiku-4-5`],Yy=[`user`,`answer`,`manager`,`ledung`,`unknown`],Xy={user:`You typed`,answer:`Your answer`,manager:`A manager`,ledung:`Ledung update`,unknown:`Unknown`};function Zy(e,t){let n;return n=e===`model`?[...Jy,...t.filter(e=>!Jy.includes(e)).sort()]:e===`trigger`?Yy:[...t].sort(),t=>{if(e===`trigger`&&t===`unknown`)return`var(--s-other)`;let r=n.indexOf(t);return r>=0&&r<7?`var(--s${r+1})`:`var(--s-other)`}}function Qy({items:e}){return(0,V.jsx)(`div`,{className:`viz-legend`,children:e.map(e=>(0,V.jsxs)(`span`,{className:`viz-legend-item`,children:[(0,V.jsx)(`span`,{className:`viz-swatch${e.textured?` textured`:``}`,style:{background:e.color}}),e.label]},e.label))})}function $y({children:e}){return(0,V.jsx)(`div`,{className:`viz-tip`,role:`tooltip`,children:e})}function eb(e){let[t,n]=(0,v.useState)(null),r=e.height??160,i=e.columns.map(t=>e.series.reduce((e,n)=>e+(t.values[n.key]??0),0)),a=Math.max(1,...i);if(!e.columns.length)return(0,V.jsx)(`p`,{className:`muted`,children:e.emptyText??`Nothing in this period.`});let o=[a,a/2],s=Math.max(1,Math.ceil(e.columns.length/8));return(0,V.jsxs)(`div`,{className:`viz-bars`,style:{height:r+22},onMouseLeave:()=>n(null),children:[(0,V.jsx)(`div`,{className:`viz-grid`,style:{height:r},children:o.map(e=>(0,V.jsx)(`div`,{className:`viz-gridline`,style:{bottom:`${e/a*100}%`},children:(0,V.jsx)(`span`,{children:Wy(e)})},e))}),(0,V.jsx)(`div`,{className:`viz-cols`,style:{height:r},children:e.columns.map((r,o)=>{let c=e.series.filter(e=>(r.values[e.key]??0)>0);return(0,V.jsxs)(`div`,{className:`viz-col${t===o?` active`:``}`,onMouseEnter:()=>n(o),onClick:()=>n(t===o?null:o),children:[(0,V.jsx)(`div`,{className:`viz-stack`,style:{height:`${i[o]/a*100}%`},children:c.map(e=>(0,V.jsx)(`div`,{className:`viz-seg${r.textured?` textured`:``}`,style:{flexGrow:r.values[e.key],background:e.color}},e.key))}),t===o&&(0,V.jsxs)($y,{children:[(0,V.jsx)(`strong`,{children:r.label}),r.note&&(0,V.jsx)(`div`,{className:`muted`,children:r.note}),c.slice().reverse().map(e=>(0,V.jsxs)(`div`,{className:`viz-tip-row`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:e.color}}),` `,e.label,(0,V.jsx)(`span`,{className:`viz-tip-num`,children:Wy(r.values[e.key]??0)})]},e.key)),c.length>1&&(0,V.jsxs)(`div`,{className:`viz-tip-row total`,children:[`Total `,(0,V.jsx)(`span`,{className:`viz-tip-num`,children:Wy(i[o])})]})]}),o%s===0&&(0,V.jsx)(`span`,{className:`viz-xlabel`,children:r.short??r.label})]},o)})})]})}function tb({label:e,value:t,sub:n}){return(0,V.jsxs)(`div`,{className:`viz-tile`,children:[(0,V.jsx)(`div`,{className:`viz-tile-label`,children:e}),(0,V.jsx)(`div`,{className:`viz-tile-value`,children:t}),n&&(0,V.jsx)(`div`,{className:`viz-tile-sub`,children:n})]})}var nb={five_hour:`5-hour`,seven_day:`7-day`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_overage_included:`7-day (incl. extra)`,overage:`Extra usage`},rb={five_hour:`boat`,seven_day:`ship`},ib={allowed:{label:`OK`,icon:`●`,cls:`good`},allowed_warning:{label:`Close to the limit`,icon:`▲`,cls:`warning`},rejected:{label:`Limit reached`,icon:`■`,cls:`critical`}},ab=(e,t)=>xy(e,Date.now(),t);function ob({account:e,limits:t,stops:n=[],run:r}){let i=t.filter(t=>(t.account??`default`)===e),a=(0,V.jsxs)(`div`,{className:`limits-account-name muted`,children:[zy(e),!i.length&&` · no data yet`]});return i.length?(0,V.jsxs)(`div`,{className:`limits-account`,children:[a,(0,V.jsx)(sb,{limits:i,stops:n.filter(t=>t.account===e),run:r},e)]}):(0,V.jsx)(`div`,{className:`limits-account`,children:a})}function sb({limits:e,stops:t,run:n}){let r=Date.now();return(0,V.jsx)(`div`,{className:`limits`,children:e.map(e=>{if(Vy(e,r))return(0,V.jsxs)(`div`,{className:`limit limit-reset${rb[e.kind]?` with-ship`:``}`,title:`${nb[e.kind]??e.kind}: the window has reset since the last reading (${Hy(e,r)}). A new one comes with the next turn on this account.`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:nb[e.kind]??e.kind}),(0,V.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:(0,V.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=Uy(e,r),a=ib[e.status]??{label:e.status,icon:`●`,cls:`good`},o=e.utilization==null?void 0:rb[e.kind],s=o&&e.utilization!=null?Iy(e.kind,e.utilization,e.resetsAt):null,c=t.find(t=>t.kind===e.kind);return(0,V.jsxs)(`div`,{className:`limit${o?` with-ship`:``}`,title:`${nb[e.kind]??e.kind}: ${a.label}${e.utilization==null?``:`, ${Ky(e.utilization)} used`}${s?.share==null?``:`, about ${Ky(s.share)} by the reset at this pace`}. ${ab(e.resetsAt,e.kind)}. Reading ${Hy(e,r)}: Ledung hears the limits during a session's turn.`,children:[!o&&(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:nb[e.kind]??e.kind}),(0,V.jsxs)(`span`,{className:`limit-status ${a.cls}`,children:[a.icon,` `,e.utilization==null?a.label:Ky(e.utilization)]})]}),o&&e.utilization!=null?(0,V.jsx)(`div`,{className:`limit-ship-box`,children:(0,V.jsx)(Ey,{utilization:e.utilization,label:nb[e.kind],hull:o})}):e.utilization!=null&&(0,V.jsx)(`div`,{className:`limit-track`,children:(0,V.jsx)(`div`,{className:`limit-fill ${a.cls}`,style:{width:`${Math.min(100,e.utilization*100)}%`}})}),(0,V.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,V.jsx)(`span`,{children:c&&n?``:ab(e.resetsAt,e.kind)}),s&&(s.share==null?(0,V.jsx)(`span`,{className:`limit-forecast`,title:s.why,children:`≈ — by reset`}):(0,V.jsxs)(`span`,{className:`limit-forecast${s.share>=1?` over`:``}`,children:[`≈ `,Ky(s.share),` by reset`]}))]}),i&&(0,V.jsx)(`div`,{className:`limit-sub limit-age`,children:i}),c&&n&&(0,V.jsx)(Ay,{stop:c,run:n})]},e.kind)})})}function cb(e){let t=[...e.sessions].sort((e,t)=>(t.endedAt??t.createdAt)-(e.endedAt??e.createdAt));return(0,V.jsxs)(`div`,{className:`waiting-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsxs)(`h2`,{children:[`Archived · `,e.title]}),(0,V.jsx)(`div`,{className:`muted`,children:t.length?`${t.length} archived; nothing is deleted. Writing to one resumes it.`:`No archived sessions.`})]})}),(0,V.jsx)(`div`,{className:`waiting-list`,children:t.map(t=>{let n=e.overview?.sessions[t.id]?.total;return(0,V.jsxs)(`div`,{className:`archived-row`,children:[(0,V.jsxs)(`div`,{className:`archived-text`,children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenSession(t.id),children:t.title}),(0,V.jsxs)(`div`,{className:`muted`,children:[t.endedAt?`ended ${Eg(t.endedAt)}`:`ended`,t.endReason?` · ${t.endReason}`:``,n?` · ${Wy(n)}`:``]})]}),(0,V.jsxs)(`div`,{className:`archived-actions`,children:[t.claudeSessionId&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>e.run(()=>R.resume(t.id)),children:`Resume`}),(0,V.jsx)(`button`,{onClick:()=>e.run(()=>R.unarchive(t.id)),children:`Unarchive`})]})]},t.id)})})]})}var lb={merge:`merge`,devShip:`dev ship`,computerControl:`computer control`},ub=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),db=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function fb({away:e,onClick:t}){return(0,V.jsxs)(`button`,{className:`small away-marker`,title:`Away mode is on; open the session settings to end it`,onClick:t,children:[`Away until `,ub(e.until)]})}function pb({away:e,run:t}){let n=e.allow.length?e.allow.map(e=>lb[e]).join(`, `):`nothing`;return(0,V.jsxs)(`div`,{className:`banner away`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`strong`,{children:[`Away until `,ub(e.until)]}),` · managers may: `,n]}),(0,V.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>void t(()=>R.back()),children:`Back`})]})}function mb({initial:e,submit:t,run:n,close:r}){let[i,a]=(0,v.useState)(e.until),[o,s]=(0,v.useState)(e.allow),c=e=>s(t=>t.includes(e)?t.filter(t=>t!==e):w.filter(n=>n===e||t.includes(n)));return(0,V.jsxs)(`form`,{className:`away-form`,onSubmit:e=>{e.preventDefault(),n(async()=>{await R.away(i,o),r()})},children:[(0,V.jsxs)(`label`,{children:[`Away until `,(0,V.jsx)(`input`,{type:`time`,value:i,onChange:e=>a(e.target.value),required:!0})]}),(0,V.jsxs)(`span`,{className:`away-kinds`,children:[`Managers may:`,w.map(e=>(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:o.includes(e),onChange:()=>c(e)}),` `,lb[e]]},e))]}),(0,V.jsx)(`p`,{className:`muted`,children:`Merge and dev ship only when every floor passes. Computer control lets managers take over this computer; they are told when it ends. Everything else waits for you.`}),(0,V.jsxs)(`span`,{className:`away-actions`,children:[(0,V.jsx)(`button`,{type:`submit`,className:`primary small`,children:t}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:r,children:`Cancel`})]})]})}function hb({away:e,run:t}){let[n,r]=(0,v.useState)(!1);if(e){let i=e.allow.length?e.allow.map(e=>lb[e]).join(`, `):`nothing`;return(0,V.jsxs)(`div`,{className:`away-entry`,children:[(0,V.jsxs)(`div`,{className:`away-strip`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`strong`,{children:[`Away until `,ub(e.until)]}),` · allowed: `,i]}),(0,V.jsxs)(`span`,{className:`away-actions`,children:[(0,V.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Change the time or what managers may do, and stay away`,onClick:()=>r(!n),children:`Change…`}),(0,V.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>{r(!1),t(()=>R.back())},children:`Back`})]})]}),n&&(0,V.jsx)(mb,{initial:{until:db(e.until),allow:e.allow},submit:`Change`,run:t,close:()=>r(!1)})]})}return(0,V.jsxs)(`div`,{className:`away-entry`,children:[(0,V.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Let managers merge, dev ship or take over this computer without you while you're away`,onClick:()=>r(!n),children:`Away…`}),n&&(0,V.jsx)(mb,{initial:{until:`08:00`,allow:T},submit:`Start`,run:t,close:()=>r(!1)})]})}function gb(e,t){return!!e&&t?.role!==`manager`}var _b=45;function vb({step:e,labels:t,onPick:n,children:r}){let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,a=t.length,o=D_(e,a),[s,c]=(0,v.useState)(o),l=(0,v.useRef)(`right`),u=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(s===o)return;if(i){c(o);return}let e=setTimeout(()=>{u.current+=1,c(e=>e+Math.sign(o-e))},_b);return()=>clearTimeout(e)},[s,o,i]),s!==o&&(l.current=o>s?`right`:`left`);let d=Hg(k_(s,a,l.current,s!==o),u.current).split(`
|
|
93
|
+
`);return`${t+1}. ${r} ${n} ${dv(e.lineText)}\n${i}`})].join(`
|
|
94
|
+
`)}function pv(e,t,n){let r=t.trim();return e===`accept`?`${N}\n\n${r?`${r}\n\n`:``}Notes, not blocking:\n${n}`:`${P} ${r?`${r}\n\n`:``}${n}`}function mv(e,t,n,r){let i=t.trim();return`${r?`${e}'s line comments on the changes of your session "${r}". Hand them on as a review round; each is a finding to check, not an order.`:`${e}'s line comments on your changes. Each is a finding to check, not an order.`}\n\n${i?`${i}\n\n`:``}${n}`}function hv(e,t){let n=new Map(t.map(e=>[e.id,e]));return t.filter(t=>t.status===`open`&&t.addressedTo===`user`&&t.details?.review&&(t.sessionId===e||t.aboutQuestion!==null&&n.get(t.aboutQuestion)?.sessionId===e)).sort((e,t)=>t.askedAt-e.askedAt)[0]??null}var gv=e=>`ledung.lineComments.${e}`;function _v(e,t){try{let n=JSON.parse(e.getItem(gv(t))??`[]`);return Array.isArray(n)?n.filter(e=>e&&typeof e.id==`string`&&typeof e.body==`string`):[]}catch{return[]}}function vv(e,t,n){try{n.length?e.setItem(gv(t),JSON.stringify(n)):e.removeItem(gv(t))}catch{}}var yv=(e,t)=>e.path===t.path&&e.line===t.line&&e.side===t.side;function bv(e,t){let n=e.filter(e=>e.id!==t.id&&!yv(e,t));if(!t.body.trim())return n;let r=e.findIndex(e=>e.id===t.id||yv(e,t));if(r===-1)return[...n,t];let i=[...n];return i.splice(Math.min(r,i.length),0,t),i}var xv=`(max-width: 760px)`;function Sv(){let[e,t]=(0,v.useState)(()=>typeof matchMedia==`function`&&matchMedia(xv).matches);return(0,v.useEffect)(()=>{if(typeof matchMedia!=`function`)return;let e=matchMedia(xv),n=()=>t(e.matches);return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),e}function Cv(e){let[t,n]=(0,v.useState)(`files`),[r,i]=(0,v.useState)(()=>_v(localStorage,e.session.id));return(0,v.useEffect)(()=>vv(localStorage,e.session.id,r),[e.session.id,r]),(0,V.jsxs)(`aside`,{className:`file-panel files-pane`,"aria-label":`Files`,hidden:e.hidden,children:[(0,V.jsxs)(`header`,{className:`file-head`,children:[(0,V.jsx)(`strong`,{children:`Files`}),(0,V.jsx)(`span`,{className:`chip test-feature`,title:`A test feature: Martin is trying it out (issue #225). It may change or go.`,children:`Test feature`}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{className:`small`,onClick:e.onClose,"aria-label":`Close the Files pane`,children:`Close`})]}),(0,V.jsxs)(`div`,{className:`pane-tabs`,role:`tablist`,children:[(0,V.jsx)(`button`,{role:`tab`,"aria-selected":t===`files`,className:t===`files`?`on`:``,onClick:()=>n(`files`),children:`Files`}),(0,V.jsxs)(`button`,{role:`tab`,"aria-selected":t===`changes`,className:t===`changes`?`on`:``,onClick:()=>n(`changes`),children:[`Changes`,r.length?(0,V.jsxs)(`span`,{className:`chip draft`,children:[r.length,` draft`]}):null]})]}),(0,V.jsx)(`div`,{className:`pane-body`,hidden:t!==`files`,children:(0,V.jsx)(wv,{session:e.session,onOpenFile:e.onOpenFile})}),(0,V.jsx)(`div`,{className:`pane-body`,hidden:t!==`changes`,children:(0,V.jsx)(Dv,{...e,drafts:r,setDrafts:i,active:t===`changes`})})]})}function wv(e){let t=e.session.id,[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(`session`),[c,l]=(0,v.useState)({}),[u,d]=(0,v.useState)(new Set),[f,p]=(0,v.useState)(``),m=B();(0,v.useEffect)(()=>{R.paneFolders(t).then(e=>r(e.folders),e=>a(e.message))},[t]);let h=e=>{R.tree(t,o,e).then(t=>l(n=>({...n,[e]:t})),t=>l(n=>({...n,[e]:{error:t.message}})))};(0,v.useEffect)(()=>{l({}),d(new Set),h(``)},[t,o]);let g=t=>{if(!t.dir)return e.onOpenFile(t.path,o);if(t.skipped)return;let n=new Set(u);n.has(t.path)?n.delete(t.path):(n.add(t.path),c[t.path]||h(t.path)),d(n)},_=[],y=(e,t)=>{let n=c[e];if(!(!n||`error`in n))for(let e of n.entries)_.push({e,depth:t}),e.dir&&u.has(e.path)&&y(e.path,t+1)};y(``,0);let b=f.trim().toLowerCase(),x=b?Object.values(c).flatMap(e=>`error`in e?[]:e.entries).filter(e=>e.name.toLowerCase().includes(b)).sort((e,t)=>e.path.localeCompare(t.path)):null,S=c[``],C=n?.find(e=>e.key===o);return i?(0,V.jsx)(`p`,{className:`error pane-note`,children:i}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`pane-tools`,children:[n&&n.length>1&&(0,V.jsx)(`div`,{className:`seg-control`,role:`radiogroup`,"aria-label":`Which folder`,children:n.map(e=>(0,V.jsx)(`button`,{role:`radio`,"aria-checked":o===e.key,className:o===e.key?`on`:``,onClick:()=>s(e.key),title:e.path,children:e.label},e.key))}),C&&(0,V.jsx)(`div`,{className:`muted mono pane-root`,title:C.path,children:C.path}),(0,V.jsx)(`input`,{...m,className:`pane-filter`,type:`search`,placeholder:`Filter by name…`,value:f,onChange:e=>p(e.target.value),"aria-label":`Filter files by name`})]}),(0,V.jsxs)(`div`,{className:`tree`,role:`tree`,children:[S&&`error`in S&&(0,V.jsx)(`p`,{className:`error pane-note`,children:S.error}),!S&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Loading…`}),x&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted pane-note`,children:[x.length,` match`,x.length===1?``:`es`,` in the folders opened so far.`]}),x.map(e=>(0,V.jsx)(Tv,{e,depth:0,label:e.path,open:u.has(e.path),onClick:()=>g(e)},e.path))]}),!x&&_.map(({e,depth:t})=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(Tv,{e,depth:t,open:u.has(e.path),onClick:()=>g(e)}),e.dir&&u.has(e.path)&&c[e.path]&&`error`in c[e.path]&&(0,V.jsx)(`p`,{className:`error pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:c[e.path].error}),e.dir&&u.has(e.path)&&!c[e.path]&&(0,V.jsx)(`p`,{className:`muted pane-note`,style:{paddingLeft:`${(t+1)*14+8}px`},children:`Loading…`})]},e.path)),S&&!(`error`in S)&&S.truncated&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Only the first 1000 names are shown.`})]}),(0,V.jsxs)(`p`,{className:`muted pane-foot`,children:[`Read-only. Only what is inside this folder. Names starting with . or $ are not listed`,e.session.project===`~chats`?`, nor folders where settings and sign-ins are kept`:``,`; node_modules and what .gitignore leaves out are greyed.`]})]})}function Tv(e){let{e:t}=e,n=t.name.lastIndexOf(`.`),r=e.label??t.name;return(0,V.jsxs)(`button`,{role:`treeitem`,"aria-expanded":t.dir&&!t.skipped?e.open:void 0,className:`tree-row${t.skipped?` skipped`:``}${t.dir?` dir`:``}`,style:{paddingLeft:`${e.depth*14+8}px`},onClick:e.onClick,disabled:t.dir&&!!t.skipped,title:t.skipped===`heavy`?`Not listed: a heavy folder`:t.skipped===`ignored`?`Left out by .gitignore`:t.path,children:[(0,V.jsx)(`span`,{className:`tree-caret`,"aria-hidden":`true`,children:t.dir?t.skipped?`·`:e.open?`▾`:`▸`:``}),t.dir?(0,V.jsxs)(`span`,{children:[r,`/`]}):n>0&&!e.label?(0,V.jsxs)(`span`,{children:[t.name.slice(0,n),(0,V.jsx)(`span`,{className:`ext`,children:t.name.slice(n)})]}):(0,V.jsx)(`span`,{children:r}),t.skipped&&(0,V.jsx)(`span`,{className:`tree-note`,children:t.skipped===`heavy`?`not listed`:`ignored`})]})}var Ev=e=>e.kind===`del`?{line:e.old,side:`old`}:{line:e.new,side:`new`};function Dv(e){let t=e.session.id,n=Sv(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(0),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(null),h=(0,v.useRef)(!1),g=()=>{o(null),R.changes(t).then(e=>{i(e),c(t=>Math.min(t,Math.max(0,e.files.length-1)))},e=>o(e.message))};(0,v.useEffect)(()=>{e.active&&!h.current&&(h.current=!0,g())},[e.active]);let _=r?.files??[],y=_.reduce((e,t)=>e+t.added,0),b=_.reduce((e,t)=>e+t.removed,0),x=n?_.slice(s,s+1):_,S=t=>{e.setDrafts(e=>bv(e,t)),u(null),m(null)};return a?(0,V.jsxs)(`p`,{className:`error pane-note`,children:[a,` `,(0,V.jsx)(`button`,{className:`small`,onClick:g,children:`Try again`})]}):r?(0,V.jsxs)(`div`,{className:`changes-tab`,children:[(0,V.jsxs)(`div`,{className:`changes-head`,children:[(0,V.jsx)(`span`,{children:r.problem??(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`strong`,{children:[_.length,` file`,_.length===1?``:`s`]}),` `,(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,y]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,b]}),(0,V.jsxs)(`span`,{className:`muted`,children:[` · `,r.branch??`HEAD`,` against `,r.base,` · at `,(0,V.jsx)(`span`,{className:`mono`,children:r.head?.slice(0,7)})]})]})}),(0,V.jsx)(`button`,{className:`small`,onClick:g,title:`Read the changes again`,children:`Refresh`})]}),r.truncated&&(0,V.jsx)(`p`,{className:`warn pane-note`,children:`The diff is larger than 1 MB, so it is cut: only the files above the cut are shown, the last one perhaps in part.`}),!r.problem&&!_.length&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`No changes yet: this branch has no commits of its own. Uncommitted edits are not shown.`}),n&&_.length>0&&(0,V.jsxs)(`div`,{className:`file-step`,children:[(0,V.jsx)(`button`,{className:`small`,"aria-label":`Previous file`,disabled:s===0,onClick:()=>c(s-1),children:`‹`}),(0,V.jsx)(`select`,{value:s,onChange:e=>c(Number(e.target.value)),"aria-label":`Changed file`,children:_.map((e,t)=>(0,V.jsxs)(`option`,{value:t,children:[e.path,` · `,t+1,` of `,_.length]},e.path))}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Next file`,disabled:s>=_.length-1,onClick:()=>c(s+1),children:`›`})]}),!n&&_.length>1&&(0,V.jsx)(`ul`,{className:`changed-files`,children:_.map(n=>{let r=e.drafts.filter(e=>e.path===n.path).length;return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`button`,{className:`link mono`,onClick:()=>document.getElementById(Ov(t,n.path))?.scrollIntoView({block:`start`}),children:n.path}),r>0&&(0,V.jsx)(`span`,{className:`chip draft`,children:r}),(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,n.added]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,n.removed]})]},n.path)})}),x.map(n=>(0,V.jsx)(kv,{sessionId:t,file:n,head:r.head??``,userName:e.userName,drafts:e.drafts.filter(e=>e.path===n.path),editing:l?.path===n.path?l.line:null,onEdit:e=>u(e?{path:n.path,line:e}:null),onSave:S,onRemove:t=>e.setDrafts(e=>e.filter(e=>e.id!==t.id)),onWhole:()=>e.onOpenFile(n.path,`session`)},n.path)),(0,V.jsx)(jv,{...e,sending:d,setSending:f,sent:p,setSent:m})]}):(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Loading the changes…`})}var Ov=(e,t)=>`diff-${e}-${t}`;function kv(e){let t=e.file,n=ov(),r=(0,v.useMemo)(()=>rv(t,n),[t,n]);return(0,V.jsxs)(`section`,{className:`diff-file`,id:Ov(e.sessionId,t.path),children:[(0,V.jsxs)(`header`,{className:`diff-file-head`,children:[(0,V.jsxs)(`span`,{className:`mono diff-path`,title:t.oldPath?`${t.oldPath} → ${t.path}`:t.path,children:[t.oldPath?`${t.oldPath} → `:``,t.path]}),t.status!==`modified`&&(0,V.jsx)(`span`,{className:`chip`,children:t.status}),(0,V.jsxs)(`span`,{className:`plus`,children:[`+`,t.added]}),` `,(0,V.jsxs)(`span`,{className:`minus`,children:[`−`,t.removed]}),t.status!==`deleted`&&!t.binary&&(0,V.jsx)(`button`,{className:`small`,onClick:e.onWhole,title:`Open the whole file, read-only`,children:`Whole file`})]}),t.binary&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`A binary file: not shown.`}),!t.binary&&!t.hunks.length&&(0,V.jsx)(`p`,{className:`muted pane-note`,children:`Renamed or its mode changed; no lines differ.`}),(0,V.jsxs)(`table`,{className:`diff-table`,children:[(0,V.jsxs)(`colgroup`,{children:[(0,V.jsx)(`col`,{className:`c-ln`}),(0,V.jsx)(`col`,{className:`c-ln`}),(0,V.jsx)(`col`,{})]}),(0,V.jsx)(`tbody`,{children:t.hunks.map((n,i)=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(`tr`,{className:`hunk`,children:(0,V.jsx)(`td`,{colSpan:3,className:`mono`,children:n.header})}),n.lines.map((n,i)=>{let a=Ev(n),o=e.drafts.filter(e=>yv(e,{path:t.path,...a})),s=e.editing===n;return(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`dl ${n.kind}${o.length?` commented`:``}${s?` editing`:``}`,onClick:()=>e.onEdit(s?null:n),title:`Click to comment on this line`,children:[(0,V.jsx)(`td`,{className:`ln`,children:n.old??``}),(0,V.jsx)(`td`,{className:`ln`,children:n.new??``}),(0,V.jsxs)(`td`,{className:`code hl`,children:[(0,V.jsx)(`span`,{className:`mark`,children:n.kind===`add`?`+`:n.kind===`del`?`−`:` `}),r?.has(n)?(0,V.jsx)(`span`,{dangerouslySetInnerHTML:{__html:r.get(n)}}):n.text]})]}),o.map(t=>(0,V.jsx)(`tr`,{className:`comment-row`,children:(0,V.jsx)(`td`,{colSpan:3,children:(0,V.jsxs)(`div`,{className:`line-comment`,children:[(0,V.jsxs)(`div`,{className:`line-comment-head`,children:[(0,V.jsx)(`strong`,{children:e.userName}),` `,(0,V.jsx)(`span`,{className:`chip draft`,children:`draft`}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`line `,t.line,t.side===`old`?` (old)`:``]}),(0,V.jsx)(`span`,{className:`spacer`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onEdit(n),children:`Edit`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onRemove(t),children:`Delete`})]}),(0,V.jsx)(`div`,{className:`line-comment-body`,children:t.body})]})})},t.id)),s&&(0,V.jsx)(`tr`,{className:`comment-row`,children:(0,V.jsx)(`td`,{colSpan:3,children:(0,V.jsx)(Av,{path:t.path,line:n,head:e.head,existing:o[0]??null,onCancel:()=>e.onEdit(null),onSave:e.onSave})})})]},i)})]},i))})]})]})}function Av(e){let[t,n]=(0,v.useState)(e.existing?.body??``),r=B(),i=(0,v.useRef)(null),a=(0,v.useRef)(null);(0,v.useEffect)(()=>{i.current?.focus({preventScroll:!0}),a.current?.scrollIntoView({block:`nearest`})},[]);let o=Ev(e.line),s=ov(),c=ev(e.path),l=s&&c?s(e.line.text,c)[0]??null:null,u=()=>{if(!t.trim())return e.existing?e.onSave({...e.existing,body:``}):e.onCancel();e.onSave({id:e.existing?.id??`${Date.now().toString(36)}${Math.random().toString(36).slice(2,6)}`,path:e.path,...o,lineText:e.line.text,commit:e.head,body:t})};return(0,V.jsxs)(`div`,{ref:a,className:`comment-editor`,role:`dialog`,"aria-label":`Comment on line ${o.line}`,onClick:e=>e.stopPropagation(),children:[(0,V.jsxs)(`div`,{className:`comment-editor-head`,children:[(0,V.jsxs)(`strong`,{children:[`Comment on line `,o.line,o.side===`old`?` (old)`:``]}),(0,V.jsx)(`span`,{className:`muted mono`,children:e.path})]}),(0,V.jsxs)(`pre`,{className:`quoted-line hl ${e.line.kind}`,children:[e.line.kind===`add`?`+ `:e.line.kind===`del`?`− `:` `,l===null?e.line.text:(0,V.jsx)(`span`,{dangerouslySetInnerHTML:{__html:l}})]}),(0,V.jsx)(`textarea`,{...r,ref:i,className:`box`,value:t,placeholder:`What should the worker look at here?`,onChange:e=>n(e.target.value),onKeyDown:t=>{t.key===`Enter`&&(t.ctrlKey||t.metaKey)&&(t.preventDefault(),u()),t.key===`Escape`&&(t.preventDefault(),e.onCancel())}}),(0,V.jsx)(`p`,{className:`muted`,children:`Kept as a draft until you send; nothing reaches the worker yet.`}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,onClick:u,children:e.existing?`Save comment`:`Add comment`})]})]})}function jv(e){let[t,n]=(0,v.useState)(!1),[r,i]=(0,v.useState)(`changes`),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),l=B(),u=(0,v.useMemo)(()=>hv(e.session.id,e.questions),[e.session.id,e.questions]),d=e.session.parentId?e.sessions.find(t=>t.id===e.session.parentId)??null:null,f=e.drafts.length,p=f?fv(e.drafts,e.session.title):``,m=u?pv(r,a,p):mv(e.userName,a,p,d?e.session.title:null),h=async()=>{e.setSending(!0),c(``);try{let t=e.drafts.map(({id:e,...t})=>t);await R.sendLineComments(e.session.id,{verdict:u?r:null,text:a,comments:t}),e.setDrafts(()=>[]),e.setSent(u?`Sent with your ${r===`accept`?`Accept`:`"Changes needed"`} on the review.`:`Sent to ${d?.title??e.session.title}.`),n(!1),o(``)}catch(e){c(e.message)}finally{e.setSending(!1)}};return(0,V.jsxs)(`div`,{className:`comment-bar`,children:[t&&f>0&&(0,V.jsxs)(`div`,{className:`send-panel`,children:[(0,V.jsxs)(`h4`,{children:[`Send `,f,` comment`,f===1?``:`s`]}),u?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With your answer to the open review`,` `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenQuestion(u.id),children:u.details?.title??`#${u.id}`}),`.`]}),(0,V.jsxs)(`label`,{className:`radio`,children:[(0,V.jsx)(`input`,{type:`radio`,checked:r===`changes`,onChange:()=>i(`changes`)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:`As “Changes needed”`}),(0,V.jsx)(`br`,{}),(0,V.jsx)(`span`,{className:`muted`,children:`The manager hands them to the worker as a review round; each one is a finding to check, not an order.`})]})]}),(0,V.jsxs)(`label`,{className:`radio`,children:[(0,V.jsx)(`input`,{type:`radio`,checked:r===`accept`,onChange:()=>i(`accept`)}),` `,(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:`As notes with “Accept”`}),(0,V.jsx)(`br`,{}),(0,V.jsx)(`span`,{className:`muted`,children:`Small things the worker may take or leave; the change can go ahead.`})]})]})]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`No review is open for this session, so they go `,d?(0,V.jsxs)(V.Fragment,{children:[`to its manager `,(0,V.jsx)(`strong`,{children:d.title})]}):(0,V.jsxs)(V.Fragment,{children:[`to `,(0,V.jsx)(`strong`,{children:e.session.title}),` itself`]}),` as one message from you`,d?`, to hand on as a review round`:``,`.`]}),(0,V.jsx)(`textarea`,{...l,className:`box`,placeholder:`A note above the comments (optional)`,value:a,onChange:e=>o(e.target.value)}),(0,V.jsxs)(`details`,{className:`send-preview`,children:[(0,V.jsx)(`summary`,{children:`What goes`}),(0,V.jsx)(`pre`,{children:m})]}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{onClick:()=>n(!1),children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,disabled:e.sending,onClick:()=>void h(),children:u?r===`accept`?`Send with Accept`:`Send changes needed`:`Send`}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:s})]})]}),(0,V.jsxs)(`div`,{className:`comment-bar-row`,children:[(0,V.jsx)(`span`,{children:f?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`strong`,{children:[f,` comment`,f===1?``:`s`]}),` `,(0,V.jsx)(`span`,{className:`chip draft`,children:`draft`})]}):(0,V.jsx)(`span`,{className:`muted`,children:e.sent??`Click a line to comment on it.`})}),(0,V.jsxs)(`button`,{className:`primary`,disabled:!f,onClick:()=>n(!t),"aria-expanded":t,children:[`Send`,u?` with review`:``,` ▾`]})]})]})}function Mv(e,t){if(!t)return[];let n=new Set,r=[],i;try{i=new RegExp(t.pattern,`g`)}catch{return[]}for(let a of e)for(let e of(a??``).matchAll(i)){let i=e[0];n.has(i)||(n.add(i),r.push({id:i,url:t.url.replace(`{id}`,encodeURIComponent(i))}))}return r}function Nv(e,t){return[...e,{name:x,colours:{manager:t?.colour??null,sessions:`same`}}]}function Pv(e,t){if(!e)return;let n=Ot(t.find(t=>t.name===e.project)?.colours,e.role);if(!n)return;let r=Dt[n];return{"--name-light":r.light,"--name-dark":r.dark}}function Fv(e,t){return[e,t&&S(t)].filter(Boolean).join(` - `)||`Question`}function Iv(e){let{q:t,nameOf:n}=e,r=[],i={userName:e.userName,nameOf:n,onOpenMessage:e.onOpenMessage,onOpenQuestion:e.onOpenQuestion};t.original&&r.push((0,V.jsx)(Rv,{o:t.original,nav:i,tint:e.tintOf(t.original.sessionId)},`original`)),(t.sources??[]).forEach((e,n)=>r.push((0,V.jsx)(Bv,{src:e,askedAt:t.askedAt,...i},`source-${n}`)));let a=(t.sources??[]).some(e=>!(`error`in e));if(t.earlier?.length&&!a&&r.push((0,V.jsx)(Hv,{q:t,lines:t.earlier,userName:e.userName,nameOf:n,onOpen:()=>e.onOpenConversation(t.sessionId,t.id)},`earlier`)),!r.length&&t.aboutQuestion===null)return null;let o=t.aboutQuestion===null?null:t.original?(0,V.jsxs)(V.Fragment,{children:[`Your answer goes to `,(0,V.jsx)(`strong`,{children:n(t.sessionId)}),`, which passes it on to `,n(t.original.sessionId),`.`]}):(0,V.jsxs)(V.Fragment,{children:[`Asked by `,(0,V.jsx)(`strong`,{children:n(t.sessionId)}),` about question #`,t.aboutQuestion,`, which can't be shown here: it is gone, or not from one of its sessions. Your answer goes to the manager.`]});return(0,V.jsxs)(`section`,{className:`block refers`,children:[(0,V.jsx)(`h4`,{children:`What it refers to`}),o&&(0,V.jsx)(`div`,{className:`refers-note muted`,children:o}),r]})}var Lv=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function Rv({o:e,nav:t,tint:n}){let{nameOf:r}=t,i=ce(e),a=[`asked ${Dg(e.askedAt)}`,i.options.length?Lv(i.options.length,`option`):``,i.opinions.length?Lv(i.opinions.length,`opinion`):``,e.status===`open`?``:e.status].filter(Boolean).join(` · `);return(0,V.jsxs)(`details`,{className:`ref-box original name-tinted${n?` tinted`:``}`,style:n,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Original question #`,e.id]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`from `,r(e.sessionId),` · `,a]})]}),(0,V.jsx)(zv,{o:e,nav:t})]})}function zv({o:e,nav:t,children:n}){let{nameOf:r}=t,i=ce(e),a=r(e.sessionId),o=e=>e??a,s=t=>(0,V.jsx)(Mf,{text:t,sessionId:e.sessionId});return(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`h5`,{className:`ref-title`,children:i.title}),i.issue&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`The issue`}),(0,V.jsx)(`div`,{className:`prose`,children:s(i.issue)})]}),i.options.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`Options`}),(0,V.jsx)(`ul`,{className:`ref-opts`,children:i.options.map(e=>{let t=i.opinions.filter(t=>t.pick===e.key).map(e=>o(e.who));return(0,V.jsxs)(`li`,{className:t.length?`picked`:``,children:[(0,V.jsxs)(`b`,{children:[i.structured?`${e.key} · `:``,e.label.replace(/\*\*/g,``)]}),e.detail&&(0,V.jsxs)(V.Fragment,{children:[` — `,(0,V.jsx)(`span`,{className:`prose inline`,children:s(e.detail.replace(/^[—–-]\s*/,``))})]}),e.cost&&(0,V.jsxs)(`span`,{className:`muted`,children:[` Cost: `,e.cost]}),t.length>0&&(0,V.jsxs)(`span`,{className:`ref-pick`,children:[` `,t.map(e=>`${e}'s pick`).join(`, `)]})]},e.key)})})]}),i.opinions.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`Opinions`}),(0,V.jsx)(`ul`,{className:`ref-ops`,children:i.opinions.map((e,t)=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`b`,{children:o(e.who)}),` `,e.pick?`picks ${e.pick}`:`no pick among the options`,e.why?`: `:``,e.why&&(0,V.jsx)(`span`,{className:`prose inline`,children:s(e.why)})]},t))})]}),i.evidence&&(0,V.jsxs)(`details`,{className:`ev`,children:[(0,V.jsx)(`summary`,{children:`Evidence`}),(0,V.jsx)(`div`,{className:`prose`,children:s(i.evidence)})]}),e.sources?.length?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`What it refers to`}),e.sources.map((n,r)=>(0,V.jsx)(Bv,{src:n,askedAt:e.askedAt,...t},r))]}):null,n]})}function Bv({src:e,askedAt:t,...n}){let{userName:r,nameOf:i,onOpenMessage:a,onOpenQuestion:o}=n;if(`error`in e)return(0,V.jsx)(Vv,{src:e});let s=(e,t)=>(0,V.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),t()},children:e}),c=e=>(0,V.jsxs)(`div`,{className:`muted ref-cut`,children:[`Cut here: the rest is `,e,`.`]});if(e.kind===`reply`){let t=i(e.sessionId);return(0,V.jsxs)(`details`,{className:`ref-box source reply`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Reply from `,t]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· its reply of `,Dg(e.at),`, word for word`,a?` · `:``]}),a&&s(`open in its conversation`,()=>a(e.sessionId,e.messageId))]}),(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`div`,{className:`prose ref-source`,children:(0,V.jsx)(Mf,{text:e.text,sessionId:e.sessionId})}),e.cut&&c(`in its conversation`)]})]})}if(e.kind===`comment`){let n=e.what===`review`?`Review`:e.what===`review comment`?`Review comment`:`Comment`,r=e.path?` · ${e.path}${e.line?`:${e.line}`:``}`:``,i=e.at?` · written ${Dg(Date.parse(e.at))}`:``;return(0,V.jsxs)(`details`,{className:`ref-box source comment`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[n,` on `,/\/pull\/\d+/.test(e.url)?`PR `:``,`#`,e.number]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,e.repo.split(`/`)[1],` · by `,e.author,i,r,` · fetched `,Dg(t),` · `]}),(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:`open on GitHub`})]}),(0,V.jsxs)(`div`,{className:`ref-body`,children:[(0,V.jsx)(`div`,{className:`prose ref-source`,children:e.text.trim()?(0,V.jsx)(Mf,{text:e.text}):(0,V.jsx)(`span`,{className:`muted`,children:`(no text)`})}),e.cut&&c(`on GitHub`)]})]})}let l=e.question,u=l.answeredBy===null?null:l.answeredBy===`user`?r:i(l.answeredBy),d=l.status===`answered`?`answered${u?` by ${u}`:``} ${Dg(l.answeredAt??l.askedAt)}`:l.status===`open`?`still open when attached`:l.status,f=o?.(l.id)??null;return(0,V.jsxs)(`details`,{className:`ref-box source question`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[`Earlier question #`,l.id]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· from `,i(l.sessionId),` · asked `,Dg(l.askedAt),` · `,d,f?` · `:``]}),f&&s(`open it`,f)]}),(0,V.jsx)(zv,{o:l,nav:n,children:l.answer!==null&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h6`,{children:`The answer`}),(0,V.jsxs)(`div`,{className:`ref-line`,children:[(0,V.jsx)(`div`,{className:`ref-who`,children:u??`Answer`}),(0,V.jsx)(`div`,{className:`plain`,children:l.answer})]})]})})]})}function Vv({src:e}){let t=e.kind===`reply`?`A session's reply`:e.kind===`comment`?`A GitHub comment`:`An earlier question`;return(0,V.jsxs)(`details`,{className:`ref-box source failed`,open:!0,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsxs)(`strong`,{children:[t,` could not be attached`]}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,e.named]})]}),(0,V.jsx)(`div`,{className:`ref-body`,children:(0,V.jsx)(`div`,{className:`ref-failed`,children:e.error})})]})}function Hv({q:e,lines:t,userName:n,nameOf:r,onOpen:i}){let a=r(e.sessionId),o=e=>e.kind===`reply`?a:e.kind===`user`?n:`Delivered to ${a} by Ledung`;return(0,V.jsxs)(`details`,{className:`ref-box earlier`,children:[(0,V.jsxs)(`summary`,{children:[(0,V.jsx)(`strong`,{children:`Earlier in the conversation`}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· the `,t.length===1?`message`:`${t.length} messages`,` `,a,` had just before asking · `]}),(0,V.jsx)(`button`,{className:`link`,onClick:e=>{e.preventDefault(),i()},children:`open the conversation`})]}),(0,V.jsx)(`div`,{className:`ref-body`,children:t.map((t,n)=>(0,V.jsxs)(`div`,{className:`ref-line ${t.kind}`,children:[(0,V.jsxs)(`div`,{className:`ref-who`,children:[o(t),` · `,Dg(t.at)]}),(0,V.jsx)(`div`,{className:`prose`,children:(0,V.jsx)(Mf,{text:t.text,sessionId:e.sessionId})}),t.cut&&(0,V.jsx)(`div`,{className:`muted ref-cut`,children:`Cut here: the rest is in the conversation.`})]},n))})]})}var Uv=8;function Wv({review:e,sessionId:t}){let n=e=>(0,V.jsx)(`div`,{className:`issue prose`,children:(0,V.jsx)(Mf,{text:e,sessionId:t})});return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`What we were solving`}),n(e.solving)]}),(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`What was done`}),n(e.done)]}),e.notes&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Notes`}),n(e.notes)]})]})}function Gv(e){let{q:t,evidence:n}=e,r=n.filter(e=>e.kind!==`text`);return(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Evidence`}),r.length>0&&(0,V.jsx)(`div`,{className:`rev-thumbs`,children:r.map((n,r)=>(0,V.jsxs)(`figure`,{children:[(0,V.jsx)(Kv,{q:t,ev:n,onOpen:()=>e.onShow(r)}),(0,V.jsx)(`figcaption`,{children:n.caption})]},r))}),n.map((e,n)=>e.kind===`text`?(0,V.jsx)(Jv,{q:t,n,ev:e},n):null),e.shown!==null&&r[e.shown]&&(0,V.jsx)(qv,{q:t,images:r,at:e.shown,onShow:e.onShow})]})}function Kv({q:e,ev:t,onOpen:n}){let[r,i]=(0,v.useState)(!1);return(0,V.jsx)(`button`,{className:`rev-thumb`,"aria-label":`Open large: ${t.caption}`,onClick:n,children:r?(0,V.jsx)(`span`,{className:`rev-thumb-problem`,children:`Can't be shown`}):(0,V.jsx)(`img`,{src:Tf(e.sessionId,t.file),alt:``,onError:()=>i(!0)})})}function qv(e){let{images:t,at:n}=e,r=t[n],i=r=>e.onShow((n+r+t.length)%t.length),a=(0,v.useRef)(null);return(0,v.useEffect)(()=>a.current?.focus(),[]),(0,V.jsxs)(`div`,{className:`rev-large`,role:`dialog`,"aria-modal":`true`,"aria-label":r.caption,onClick:t=>{t.target===t.currentTarget&&e.onShow(null)},children:[(0,V.jsxs)(`div`,{className:`rev-large-bar`,children:[(0,V.jsxs)(`span`,{className:`rev-large-caption`,children:[r.caption,` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,n+1,` / `,t.length]})]}),(0,V.jsx)(`button`,{ref:a,className:`icon`,"aria-label":`Close: back to the review`,title:`Close (Esc)`,onClick:()=>e.onShow(null),children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),(0,V.jsxs)(`div`,{className:`rev-large-stage`,children:[(0,V.jsx)(Ef,{sessionId:e.q.sessionId,path:r.file,alt:r.caption},r.file),t.length>1&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:`nav l`,onClick:()=>i(-1),"aria-label":`Previous screenshot`,children:`‹`}),(0,V.jsx)(`button`,{className:`nav r`,onClick:()=>i(1),"aria-label":`Next screenshot`,children:`›`})]})]})]})}function Jv({q:e,n:t,ev:n}){let[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(!1);(0,v.useEffect)(()=>{let n=!0;return R.evidenceText(e.id,t).then(e=>n&&i(e.content),e=>n&&o(e.message)),()=>{n=!1}},[e.id,t]);let l=r===null?[]:r.replace(/\n$/,``).split(`
|
|
95
|
+
`),u=l.length>Uv;return(0,V.jsxs)(`div`,{className:`rev-text`,children:[(0,V.jsxs)(`div`,{className:`rev-text-head`,children:[(0,V.jsx)(`span`,{className:`rev-text-caption`,children:n.caption}),(0,V.jsx)(`span`,{className:`chip mono`,children:n.file.replace(/^board:[^/]+\/[^/]+\//,`board: `)}),r!==null&&(0,V.jsxs)(`span`,{className:`muted`,children:[l.length,` line`,l.length===1?``:`s`]})]}),a?(0,V.jsx)(`p`,{className:`error`,children:a}):r===null?(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`pre`,{className:`rev-text-body${s?` open`:``}`,tabIndex:s?0:void 0,children:s?r:l.slice(0,Uv).join(`
|
|
96
|
+
`)}),u&&(0,V.jsx)(`button`,{className:`small rev-text-toggle`,"aria-expanded":s,onClick:()=>c(!s),children:s?`Fold`:`Show all ${l.length} lines`})]})]})}function Yv(e){let t=B(),{q:n}=e,[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),[u]=(0,v.useState)(e.noteFocus);(0,v.useEffect)(()=>{e.noteFocus!==u&&l.current?.focus()},[e.noteFocus]);let d=async t=>{c(!0),o(``);try{await t(),e.onAnswered()}catch(e){o(e.message),c(!1)}},f=e=>{if(s)return;let t=ne(e,r);`problem`in t?(o(t.problem),l.current?.focus()):d(()=>R.answerQuestion(n.id,t.answer))};if(n.status===`answered`){let t=n.answer??``,r=t.startsWith(N),i=r?t.slice(N.length).trim():t.startsWith(`Changes needed:`)?t.slice(P.length).trim():t;return(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Answer`}),(0,V.jsxs)(`div`,{className:`rev-verdict ${r?`accepted`:`changes`}`,children:[(0,V.jsx)(`strong`,{children:r?`Accepted`:`Changes needed`}),i&&(0,V.jsx)(`div`,{className:`rev-verdict-text`,children:i}),(0,V.jsxs)(`div`,{className:`muted`,children:[e.answeredBy,` · `,Dg(n.answeredAt??n.askedAt),` · `,n.deliveredAt?`delivered ${Dg(n.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]})}return n.status===`withdrawn`?(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Withdrawn`}),(0,V.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,V.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,n.withdrawnReason?`: ${n.withdrawnReason}`:``]})})]}):(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Your answer`}),(0,V.jsx)(`label`,{className:`muted rev-box-label`,htmlFor:`rev-${n.id}`,children:`A note with Accept (optional), or what needs changing (required for Changes needed)`}),(0,V.jsx)(`textarea`,{...t,id:`rev-${n.id}`,ref:l,className:`box`,placeholder:sg()?`Write here`:`N to write, Esc to leave`,value:r,onChange:e=>{i(e.target.value),o(``)}}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{className:`allow`,disabled:s,onClick:()=>f(`accept`),children:`Accept`}),(0,V.jsx)(`button`,{className:`deny`,disabled:s,onClick:()=>f(`changes`),children:`Changes needed`}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:a})]}),(0,V.jsx)(cg,{busy:s,onWithdraw:()=>void d(()=>R.withdrawQuestion(n.id))})]})}function Xv({remote:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(``),a=B(),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(!1),f=()=>void R.remoteLink().then(n,()=>n(null));if((0,v.useEffect)(f,[e?.publicName]),!t)return null;if(t.source===`config`)return(0,V.jsxs)(`p`,{className:`muted`,children:[`This relay is set in the config file (`,(0,V.jsx)(`code`,{children:`"remote"`}),`); change or remove it there.`]});let p=e=>{s(!0),l(null),e().then(()=>{i(``),d(!1),f()},e=>l(e.message)).finally(()=>s(!1))};if(t.source===`joined`){let t=e?.certificate,n=e?.state===`connected`&&t?.state===`valid`;return(0,V.jsxs)(`div`,{className:`relay-join`,children:[n&&(0,V.jsx)(`p`,{className:`remote-state connected`,children:`Connected, certificate ok. Pair your phone in Phones below.`}),!n&&t?.state===`waiting-caa`&&(0,V.jsx)(`p`,{className:`muted`,children:`The relay's admin approves this computer, which adds the CAA record; the certificate follows within a minute.`}),u?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{children:`Leave the relay? Phones stop reaching this Ledung at once; joining again needs a new code.`}),(0,V.jsx)(`button`,{className:`small danger`,disabled:o,onClick:()=>p(R.remoteLeave),children:`Leave`}),(0,V.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>d(!1),children:`Cancel`})]}):(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(!0),children:`Leave this relay`}),c&&(0,V.jsx)(`p`,{className:`restart-problem`,children:c})]})}return(0,V.jsxs)(`div`,{className:`relay-join`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Got a join code from a relay's admin? Paste it here: Ledung makes its own secret and certificate account, joins the relay and connects, with no restart.`}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`relay.example.org/ABCD-…`,spellCheck:!1,autoComplete:`off`,"aria-label":`Join code`}),(0,V.jsx)(`button`,{disabled:o||!r.trim(),onClick:()=>p(()=>R.remoteJoin(r)),children:o?`Joining…`:`Join with a code`})]}),c&&(0,V.jsx)(`p`,{className:`restart-problem`,children:c})]})}function Zv({view:e,onView:t,run:n,newComputers:r}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)($v,{view:e,onView:t,run:n}),e.relay&&e.keySha256&&(0,V.jsx)(ey,{run:n,newComputers:r,tokenSet:e.tokenSet})]})}var Qv=e=>!!e.relay||!!e.keySha256;function $v({view:e,onView:t,run:n}){let[r,i]=(0,v.useState)(e.relay??``),a=B(),[o,s]=(0,v.useState)(``);return(0,V.jsxs)(`div`,{className:`relay-admin`,children:[(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsxs)(`label`,{children:[`Relay `,(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`wss://relay.example.org`,spellCheck:!1})]}),(0,V.jsx)(`button`,{className:`small`,disabled:r.trim()===(e.relay??``),onClick:()=>void n(async()=>t(await R.setRelayAdmin({relay:r}))),children:`Save`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Admin key: `,e.keySha256?(0,V.jsxs)(V.Fragment,{children:[`made. Its SHA-256 goes in the relay's config as `,(0,V.jsx)(`code`,{children:`"adminKeySha256"`}),`: `,(0,V.jsx)(`code`,{className:`remote-record`,children:e.keySha256}),` `,(0,V.jsx)(Of,{text:e.keySha256})]}):`none yet. Ledung makes it and keeps it in its data folder; only its SHA-256 goes to the relay.`]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.makeRelayAdminKey())),children:e.keySha256?`Make a new admin key`:`Make admin key`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Cloudflare token (Zone DNS edit, for the relay's domain): `,e.tokenSet?`set. Approve writes new computers' CAA records with it.`:`none. Without one, copy each new computer's CAA record into the DNS yourself.`,` It stays on this computer and is never shown again.`]}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{type:`password`,value:o,onChange:e=>s(e.target.value),placeholder:e.tokenSet?`Replace the token`:`Paste the token`,autoComplete:`off`,"aria-label":`Cloudflare token`}),(0,V.jsx)(`button`,{className:`small`,disabled:!o.trim(),onClick:()=>void n(async()=>{t(await R.setRelayAdmin({cloudflareToken:o})),s(``)}),children:`Save token`}),e.tokenSet&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(async()=>t(await R.setRelayAdmin({cloudflareToken:``}))),children:`Remove token`})]})]})}function ey({run:e,newComputers:t,tokenSet:n}){let[r,i]=(0,v.useState)(``),a=B(),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(null),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(null),m=()=>void R.relayComputers().then(e=>{d(e.invites),p(null)},e=>p(e.message));return(0,v.useEffect)(m,[]),(0,V.jsxs)(`div`,{className:`relay-invites`,children:[(0,V.jsx)(`h4`,{children:`Invite a computer`}),(0,V.jsxs)(`div`,{className:`relay-row`,children:[(0,V.jsx)(`input`,{...a,value:r,onChange:e=>i(e.target.value),placeholder:`Whose computer`,"aria-label":`Owner`}),(0,V.jsx)(`input`,{...a,value:o,onChange:e=>s(e.target.value),placeholder:`Name (optional: two words and digits otherwise)`,spellCheck:!1,"aria-label":`Name`}),(0,V.jsx)(`button`,{disabled:!r.trim(),onClick:()=>void e(async()=>{l(await R.relayInvite(r,o.trim()||void 0)),i(``),s(``),m()}),children:`Invite`})]}),c&&(0,V.jsxs)(`div`,{className:`relay-code`,children:[(0,V.jsxs)(`p`,{children:[`Join code for `,c.owner,`'s computer, `,(0,V.jsx)(`b`,{children:c.host}),`. It is shown only now, works once, and runs out at `,new Date(c.expiresAt).toLocaleString(),`:`]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`code`,{className:`remote-record`,children:c.code}),` `,(0,V.jsx)(Of,{text:c.code})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`They paste it in their Ledung under Settings → Remote access → Join with a code. Then the computer shows up in Waiting for you`,n?` to approve`:` with its CAA record to add`,`.`]})]}),f&&(0,V.jsx)(`p`,{className:`restart-problem`,children:f}),u&&u.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h4`,{children:`Not used yet`}),(0,V.jsx)(`ul`,{className:`relay-list`,children:u.map(t=>(0,V.jsxs)(`li`,{children:[t.host,` for `,t.owner,`, until `,new Date(t.expiresAt).toLocaleString(),` `,(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeRelayInvite(t.id),m()}),children:`Revoke`})]},t.id))})]}),t.length>0&&(0,V.jsxs)(`p`,{className:`muted`,children:[t.length,` computer`,t.length===1?``:`s`,` joined and wait`,t.length===1?`s`:``,` for the CAA record: see Waiting for you.`]})]})}function ty({computer:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))};return(0,V.jsxs)(`div`,{className:`new-computer`,children:[(0,V.jsxs)(`div`,{className:`new-computer-head`,children:[`New computer `,(0,V.jsx)(`code`,{children:e.name}),` for `,e.owner]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`It joined the relay as `,e.host,e.enrolledAt?` at ${new Date(e.enrolledAt).toLocaleString()}`:``,`. Its certificate needs this CAA record, which names its own ACME account:`]}),(0,V.jsx)(`p`,{children:(0,V.jsx)(`code`,{className:`remote-record`,children:e.record})}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[e.approvable&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.approveComputer(e.name)),title:`Writes the record through Cloudflare with the token in Settings → Relay; never changes an existing one`,children:i?`Approving…`:`Approve`}),(0,V.jsx)(Of,{text:e.record}),!e.approvable&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.computerAdded(e.name)),children:`I added it`})]}),!e.approvable&&(0,V.jsx)(`p`,{className:`muted`,children:`No Cloudflare token is set in Settings → Relay: copy the record into the DNS yourself, then press I added it.`}),n&&(0,V.jsx)(`p`,{className:`restart-problem`,children:n})]})}function ny({pairing:e,run:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=e=>{a(!0),r(null),t(()=>e().catch(e=>r(e.message))).finally(()=>a(!1))},s=new Date(e.at).toLocaleString(),{device:c}=e;return(0,V.jsxs)(`div`,{className:`new-computer`,children:[(0,V.jsx)(`div`,{className:`new-computer-head`,children:c?(0,V.jsxs)(V.Fragment,{children:[e.computer,` paired `,(0,V.jsx)(`code`,{children:c.name}),` through the link`]}):(0,V.jsxs)(V.Fragment,{children:[e.computer,` opened a pairing through the link`]})}),(0,V.jsx)(`p`,{className:`muted`,children:c?`At ${s}, from ${e.computer}'s own screen. It can look at this computer's sessions, questions and chats; it can change nothing until it sets up its passkey and logs on here with Touch ID or Windows Hello.`:`At ${s}, from ${e.computer}'s own screen: a pairing code for a browser there, good for 10 minutes. Nothing has paired with it yet.`}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[c&&(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(async()=>{await R.revokeDevice(c.id),await R.dismissLinkPairing(e.id)}),children:`Remove device`}),(0,V.jsx)(`button`,{className:`small`,disabled:i,onClick:()=>o(()=>R.dismissLinkPairing(e.id)),title:`Takes this card away; the device stays in Settings → Phones`,children:`OK`})]}),n&&(0,V.jsx)(`p`,{className:`restart-problem`,children:n})]})}var ry=e=>e.status===`open`&&e.addressedTo===`user`,iy=e=>e.status===`pending`&&e.addressedTo===`user`;function ay(e,t){return e.filter(ry).length+t.filter(iy).length}var oy=[`var(--s2)`,`var(--s4)`,`var(--s1)`,`var(--s7)`,`var(--s5)`,`var(--s3)`],sy=`var(--s-other)`;function cy(e){let[t,n]=(0,v.useState)(()=>Hf(localStorage)),r=e=>{n(e),Uf(localStorage,e)},i=t=>e.sessions.find(e=>e.id===t),a=e=>i(e)?.title??`unknown`,o=e=>{let t=i(e);return t?.role===`manager`?`Manager "${t.title}"`:t?.title??`Unknown session`},s=e=>i(e)?.project??``,c=t=>e.projects.find(e=>e.name===t),l=t=>Pv(i(t),Nv(e.projects,e.chats)),u=[...e.projects.map(e=>e.name),...e.sessions.some(e=>e.project===`~chats`)?[x]:[]],d=e=>t.mode===`all`?!t.hidden.includes(e):e===t.one,f=he(e.projects.map(e=>e.questionTiers)),p=e=>e===null?sy:oy[f.indexOf(e)%oy.length]??sy,m=he(e.projects.filter(e=>d(e.name)).map(e=>e.questionTiers)),{items:h,forYou:g,done:_,listFor:y}=Gf(e.questions,s,e=>c(e)?.questionTiers??[],d,m),b=e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&d(s(e.sessionId))).sort((e,t)=>e.at-t.at),S=t=>h.filter(e=>e.q.status===`open`&&e.q.addressedTo===`user`&&e.project===t).length+e.permissions.filter(e=>e.status===`pending`&&e.addressedTo===`user`&&s(e.sessionId)===t).length,C=e.questionId===null?null:h.find(t=>t.q.id===e.questionId)??null,w=(t,n,r)=>(0,V.jsxs)(`header`,{className:`desk-head`,children:[(0,V.jsx)(`button`,{className:`icon sidebar-toggle`,title:`${e.sidebarHidden?`Show`:`Hide`} the sidebar (S)`,"aria-label":`${e.sidebarHidden?`Show`:`Hide`} the sidebar`,"aria-pressed":e.sidebarHidden,onClick:e.onToggleSidebar,children:(0,V.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,"aria-hidden":`true`,children:[(0,V.jsx)(`rect`,{x:`1.5`,y:`2.5`,width:`13`,height:`11`,rx:`2`}),(0,V.jsx)(`path`,{d:`M6 2.5v11`})]})}),(0,V.jsxs)(`div`,{className:`head-main`,children:[(0,V.jsxs)(`div`,{className:`head-text`,children:[(0,V.jsx)(`h2`,{children:`Waiting for you`}),(0,V.jsx)(`div`,{className:`muted`,children:t})]}),(0,V.jsx)(`div`,{className:`head-controls`,children:n})]}),r&&(0,V.jsxs)(`button`,{className:`small conv`,title:`Go to conversation (C): ${o(yg(r))}`,onClick:()=>e.onGoToConversation(r.id),children:[(0,V.jsx)(ly,{}),(0,V.jsx)(`span`,{className:`conv-text`,children:`Go to conversation`})]}),(0,V.jsx)(`button`,{className:`icon`,title:`Close: back to the view before`,"aria-label":`Close`,onClick:e.onClose,children:(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,strokeLinecap:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M3.5 3.5l9 9M12.5 3.5l-9 9`})})})]}),T={props:e,nameOf:o,titleOf:a,tierColor:p,tintOf:l,settingsOf:c,header:w};if(e.questionId!==null){if(!C)return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[w(``,(0,V.jsx)(`button`,{onClick:()=>e.onOpenQuestion(null),children:`← Queue`})),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsx)(`div`,{className:`desk-body`,children:(0,V.jsxs)(`div`,{className:`empty-box`,children:[`Question #`,e.questionId,` is not here: it may be older than the recent ones Ledung keeps in view.`]})})})]});let t=y(C),n=n=>{let r=t.filter(e=>e.q.id!==n&&e.q.status===`open`)[Math.max(0,t.findIndex(e=>e.q.id===n))]??g.find(e=>e.q.id!==n);e.onOpenQuestion(r?r.q.id:null)};return C.v.review?(0,V.jsx)(my,{ctx:T,item:C,list:t,onAnswered:n},C.q.id):C.q.shots?(0,V.jsx)(hy,{ctx:T,item:C,list:t,onAnswered:e.onLeaveShots},C.q.id):(0,V.jsx)(vy,{ctx:T,item:C,list:t,onAnswered:n},C.q.id)}return(0,V.jsx)(py,{ctx:T,filter:t,setFilter:r,projectNames:u,waitingIn:S,forYou:g,done:_,permsForYou:b,tiers:m})}var ly=()=>(0,V.jsx)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,V.jsx)(`path`,{d:`M2.5 3.5h11v7h-6l-3 2.5v-2.5h-2z`})});function uy(e){let t=(0,v.useRef)(e);t.current=e,(0,v.useEffect)(()=>{let e=e=>{let n=document.activeElement,r=!!n&&(n.tagName===`TEXTAREA`||n.tagName===`INPUT`||n.tagName===`SELECT`);t.current(e,r)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[])}var dy=e=>e.trim().split(`
|
|
97
|
+
`)[0]??``,fy=e=>e.replace(/\*\*|`|^#+\s*/gm,``).replace(/\s+/g,` `).trim().slice(0,180);function py(e){let{props:t,nameOf:n,titleOf:r,tierColor:i,tintOf:a,header:o}=e.ctx,{filter:s,setFilter:c}=e,l=t=>c({...s,mode:t,one:e.projectNames.includes(s.one)?s.one:e.projectNames[0]??``}),u=()=>{let t=e.projectNames;t.length&&c({...s,mode:`one`,one:t[(t.indexOf(s.one)+1)%t.length]})};uy((n,r)=>{if(n.key===`Escape`){r?document.activeElement.blur():t.onClose();return}if(r||n.ctrlKey||n.metaKey||n.altKey)return;let i=n.key.toLowerCase();i===`s`?t.onToggleSidebar():n.key===`Enter`&&e.forYou[0]&&document.activeElement?.tagName!==`BUTTON`&&document.activeElement?.tagName!==`A`?(n.preventDefault(),t.onOpenQuestion(e.forYou[0].q.id)):/^[1-9]$/.test(n.key)&&e.forYou[Number(n.key)-1]?t.onOpenQuestion(e.forYou[Number(n.key)-1].q.id):i===`a`?l(s.mode===`all`?`one`:`all`):i===`p`&&u()});let d=e.forYou.length+e.permsForYou.length+t.newComputers.length+t.linkPairings.length,f=e.done.filter(e=>e.q.status===`answered`).length,p=(e,r)=>{let{q:i,v:o}=e,s=i.status!==`open`,c=a(i.sessionId);return(0,V.jsxs)(`div`,{className:`qrow-wrap`,children:[(0,V.jsxs)(`button`,{className:`qrow name-tinted${c?` tinted`:``}${s?` done`:``}`,style:c,onClick:()=>t.onOpenQuestion(i.id),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Fv(e.tier,e.project)}),(0,V.jsx)(`span`,{className:`place`,children:s?i.status===`answered`?`✓`:`–`:r??`·`}),(0,V.jsxs)(`span`,{className:`t`,children:[o.title,de(o.opinions)&&!s&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsx)(`span`,{className:`split`,children:`They disagree`})]})]}),s?i.status===`answered`?(0,V.jsxs)(`span`,{className:`pill`,children:[i.answeredBy===`user`?`You`:`Manager`,` · `,Dg(i.answeredAt??i.askedAt)]}):(0,V.jsx)(`span`,{className:`pill grey`,children:`Withdrawn`}):(0,V.jsx)(`span`,{className:`when`,children:Dg(i.askedAt)}),(0,V.jsxs)(`span`,{className:`meta`,children:[(0,V.jsxs)(`span`,{children:[`#`,i.id]}),(0,V.jsx)(`span`,{children:n(i.sessionId)}),i.aboutQuestion!==null&&(0,V.jsxs)(`span`,{children:[`· about #`,i.aboutQuestion]}),!o.structured&&(0,V.jsx)(`span`,{className:`chip`,children:`plain`}),o.review&&(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),i.shots&&(0,V.jsx)(`span`,{className:`chip shot-chip`,children:pg(i)})]}),(0,V.jsx)(`span`,{className:`excerpt`,children:s?i.status===`answered`?fy(i.answer??``):i.withdrawnReason??``:fy(o.review?dy(o.review.solving):o.issue)})]}),(0,V.jsx)(`button`,{className:`icon conv-row`,title:`Go to conversation: ${n(yg(i))}`,"aria-label":`Go to conversation of question #${i.id}`,onClick:()=>t.onGoToConversation(i.id),children:(0,V.jsx)(ly,{})})]},i.id)},m=e=>(0,V.jsxs)(`div`,{className:`waiting-permission`,children:[(0,V.jsxs)(`div`,{className:`waiting-from`,children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>t.onOpenSession(e.sessionId),children:r(e.sessionId)}),(0,V.jsxs)(`span`,{className:`muted`,children:[` (`,S(t.sessions.find(t=>t.id===e.sessionId)?.project??``),`) · `,Dg(e.at)]})]}),(0,V.jsx)(zh,{permission:e})]},e.id),h=(e,t,n)=>(0,V.jsxs)(`h3`,{className:`group-head`,style:{"--c":t},children:[(0,V.jsx)(`i`,{}),e,n!==void 0&&(0,V.jsx)(`span`,{className:`count`,children:n})]}),g=(0,V.jsxs)(`div`,{className:`filter`,children:[(0,V.jsxs)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Show`,children:[(0,V.jsx)(`button`,{className:s.mode===`one`?`on`:``,"aria-pressed":s.mode===`one`,onClick:()=>l(`one`),children:`One project`}),(0,V.jsx)(`button`,{className:s.mode===`all`?`on`:``,"aria-pressed":s.mode===`all`,onClick:()=>l(`all`),children:`All`})]}),(0,V.jsx)(`div`,{className:`projs`,children:e.projectNames.map(t=>{let n=s.mode===`all`?!s.hidden.includes(t):t===s.one;return(0,V.jsxs)(`button`,{className:`proj ${n?`on`:`off`}`,"aria-pressed":n,onClick:()=>s.mode===`one`?c({...s,one:t}):c({...s,hidden:s.hidden.includes(t)?s.hidden.filter(e=>e!==t):[...s.hidden,t]}),children:[s.mode===`all`&&(0,V.jsx)(`span`,{className:`box`,children:n?`✓`:``}),S(t),` `,(0,V.jsx)(`b`,{children:e.waitingIn(t)})]},t)})})]}),_=0;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[o((0,V.jsxs)(`span`,{className:`tally`,children:[(0,V.jsx)(`b`,{children:d}),` waiting · `,(0,V.jsx)(`b`,{children:f}),` answered`]}),g),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsxs)(`div`,{className:`desk-body`,children:[(0,V.jsxs)(`p`,{className:`lede muted`,children:[`Ordered by what each answer unblocks, and each answer takes you to the next.`,(0,V.jsxs)(`span`,{className:`kbd-hint`,children:[` `,(0,V.jsx)(`kbd`,{children:`Enter`}),` opens the first question.`]})]}),!d&&(0,V.jsxs)(`div`,{className:`empty-box`,children:[`Nothing is waiting for you`,s.mode===`one`&&s.one?` in ${s.one}`:``,`. New questions appear here as they are asked.`]}),t.newComputers.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`New computers`,`var(--warn-border)`,t.newComputers.length),t.newComputers.map(e=>(0,V.jsx)(ty,{computer:e,run:t.run},e.name))]}),t.linkPairings.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Paired through the link`,`var(--warn-border)`,t.linkPairings.length),t.linkPairings.map(e=>(0,V.jsx)(ny,{pairing:e,run:t.run},e.id))]}),e.permsForYou.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Permission prompts`,`var(--warn-border)`,e.permsForYou.length),e.permsForYou.map(m)]}),[...e.tiers,null].map(t=>{let n=e.forYou.filter(e=>e.tier===t);return n.length?(0,V.jsxs)(`div`,{className:`group`,children:[h(t??`Older, without a tier`,i(t),n.length),n.map(e=>p(e,++_))]},t??``):null}),e.done.length>0&&(0,V.jsxs)(V.Fragment,{children:[h(`Answered recently`,`var(--ok)`),e.done.map(e=>p(e,null))]}),(0,V.jsxs)(`div`,{className:`keys`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Enter`}),` first question`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),`–`,(0,V.jsx)(`kbd`,{children:`9`}),` open by place`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`P`}),` next project`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`A`}),` one project / all`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(ly,{}),` on a row: its conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` hide / show sidebar`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` close`]})]})]})})]})}function my({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,tintOf:s,settingsOf:c,header:l}=e,{q:u,v:d,project:f,tier:p}=t,m=d.review,h=m.evidence??[],g=h.filter(e=>e.kind!==`text`),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(0),C=n.findIndex(e=>e.q.id===u.id),w=e=>{let t=n[C+e];C>=0&&t&&i.onOpenQuestion(t.q.id)},T=e=>{let t=_;y(e),e===null&&t!==null&&setTimeout(()=>document.querySelectorAll(`.rev-thumb`)[t]?.focus())};uy((e,t)=>{if(_!==null){if(e.key===`Escape`)T(null);else if(e.key===`ArrowRight`)T((_+1)%g.length);else if(e.key===`ArrowLeft`)T((_-1+g.length)%g.length);else if(e.key===`Tab`){let t=[...document.querySelectorAll(`.rev-large button`)];t[(t.indexOf(document.activeElement)+(e.shiftKey?-1:1)+t.length)%t.length]?.focus()}else return;e.preventDefault();return}let n=!!document.activeElement?.closest(`.rev-text-body`);if(e.key===`Escape`){t||n?document.activeElement.blur():i.onOpenQuestion(null);return}if(t||n||e.ctrlKey||e.metaKey||e.altKey)return;let r=e.key.toLowerCase();r===`s`?i.onToggleSidebar():e.key===`ArrowRight`?w(1):e.key===`ArrowLeft`?w(-1):r===`c`?i.onGoToConversation(u.id):r===`n`&&u.status===`open`&&(e.preventDefault(),x(e=>e+1))});let E=a(u.sessionId),D=c(f)?.tickets??void 0,O=e=>Mv([e],D)[0]?.url,k=u.answeredBy===`user`?u.forwardedFrom===null?i.userName:`${i.userName} (passed on by the manager)`:`Manager "${o(u.answeredBy??``)}", under its standing grant`,ee=u.status===`open`?u.addressedTo===`user`?`${C+1} of ${n.length} waiting`:`Manager "${o(u.addressedTo)}" is handling it`:u.status===`answered`?`Answered`:`Withdrawn`;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[l(ee,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:C<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>w(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:C<0||C>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>w(1),children:`→`})]}),u),(0,V.jsx)(`div`,{className:`desk${_===null?``:` locked`}`,children:(0,V.jsxs)(`div`,{className:`desk-body review`,children:[(0,V.jsxs)(`div`,{className:`qhead name-tinted${s(u.sessionId)?` tinted`:``}`,style:s(u.sessionId),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Fv(p,f)}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsx)(`span`,{className:`chip review-chip`,children:`Review`}),(0,V.jsxs)(`strong`,{children:[`#`,u.id]}),(0,V.jsx)(`span`,{className:`chip`,children:S(f)}),(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>i.onOpenSession(u.sessionId),children:E}),` · asked `,Dg(u.askedAt)]}),u.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,o(u.addressedTo),`"`]})]}),(0,V.jsx)(`h3`,{children:d.title}),d.refs.length>0&&(0,V.jsx)(`div`,{className:`refs`,children:d.refs.map(e=>{let t=O(e);return t?(0,V.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,V.jsx)(`span`,{className:`chip`,children:e},e)})})]}),u.status===`open`&&u.addressedTo!==`user`&&(0,V.jsxs)(`div`,{className:`handled`,children:[`Manager "`,o(u.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),(0,V.jsx)(Iv,{q:u,userName:i.userName,nameOf:a,tintOf:s,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null}),(0,V.jsx)(Wv,{review:m,sessionId:u.sessionId}),h.length>0&&(0,V.jsx)(Gv,{q:u,evidence:h,shown:_,onShow:T}),(0,V.jsx)(Yv,{q:u,answeredBy:k,noteFocus:b,onAnswered:()=>r(u.id)}),(0,V.jsxs)(`div`,{className:`keys`,children:[u.status===`open`&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})})]})}function hy({ctx:e,item:t,list:n,onAnswered:r}){let{props:i,nameOf:a,titleOf:o,header:s}=e,{q:c,v:l,project:u}=t,d=n.findIndex(e=>e.q.id===c.id),f=e=>{let t=n[d+e];d>=0&&t&&i.onOpenQuestion(t.q.id)},p=c.status===`open`?c.addressedTo===`user`?`${d+1} of ${n.length} waiting`:`Manager "${o(c.addressedTo)}" is handling it`:c.status===`answered`?`Answered`:`Withdrawn`;return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[s(p,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>i.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:d<=0,"aria-label":`Previous question`,title:`Previous question`,onClick:()=>f(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:d<0||d>=n.length-1,"aria-label":`Next question`,title:`Next question`,onClick:()=>f(1),children:`→`})]}),c),(0,V.jsx)(dg,{question:{...c,shots:c.shots},title:l.title,issue:l.issue,evidence:l.evidence,options:l.options,opinions:l.opinions.map(e=>({...e,who:e.who??a(c.sessionId)})),userName:i.userName,session:{title:a(c.sessionId),project:u,onOpen:()=>i.onOpenSession(c.sessionId)},onClose:()=>i.onOpenQuestion(null),onDone:r,onToggleSidebar:i.onToggleSidebar,onGoToConversation:()=>i.onGoToConversation(c.id),withdrawnIds:i.questions.filter(e=>e.status===`withdrawn`).map(e=>e.id),refersTo:(0,V.jsx)(Iv,{q:c,userName:i.userName,nameOf:a,tintOf:e.tintOf,onOpenConversation:(e,t)=>i.onGoToConversation(t,e),onOpenMessage:i.onGoToMessage,onOpenQuestion:e=>i.questions.some(t=>t.id===e)?()=>i.onOpenQuestion(e):null})})]})}function gy({opinions:e,whoOf:t}){let n=e.length;return n?n===1?(0,V.jsx)(`div`,{className:`legend`,children:(0,V.jsxs)(`span`,{children:[`Green border: `,t(e[0]),`'s pick`]})}):n>5?(0,V.jsx)(`div`,{className:`legend`,children:(0,V.jsxs)(`span`,{children:[n,` opinions: each option says who picked it`]})}):(0,V.jsxs)(`div`,{className:`legend`,children:[(0,V.jsxs)(`span`,{children:[`Green border in `,n,` parts, one per opinion, left to right:`]}),e.map((e,r)=>(0,V.jsxs)(`span`,{children:[(0,V.jsx)(_y,{i:r,n}),t(e)]},r)),(0,V.jsx)(`span`,{children:`Whole border: they all agree`})]}):null}var _y=({i:e,n:t})=>(0,V.jsx)(`span`,{className:`part-key`,"aria-hidden":`true`,children:Array.from({length:t},(t,n)=>(0,V.jsx)(`i`,{className:n===e?`on`:``},n))});function vy({ctx:e,item:t,list:n,onAnswered:r}){let i=B(),{props:a,nameOf:o,titleOf:s,tintOf:c,settingsOf:l,header:u}=e,{q:d,v:f,project:p,tier:m}=t,h=d.status===`open`,[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(``),[C,w]=(0,v.useState)(``),[T,E]=(0,v.useState)(!1),D=(0,v.useRef)(null),O=(0,v.useRef)(null),k=n.findIndex(e=>e.q.id===d.id),ee=f.options.length+1,A=!d.aboutRequest;(0,v.useEffect)(()=>{g===`other`&&D.current?.focus()},[g]);let j=e=>{let t=n[k+e];k>=0&&t&&a.onOpenQuestion(t.q.id)},M=e=>{_(e),w(``)},te=async()=>{if(!h||T)return;if(!g)return w(`Pick an option first.`);if(g===`other`&&!y.trim()){w(`Write your answer in the box first.`),D.current?.focus();return}let e=g===`other`?y.trim():f.options.find(e=>e.key===g).answer,t=A&&x.trim()?`${e}\n\nNote: ${x.trim()}`:e;E(!0),w(``);try{await R.answerQuestion(d.id,t),r(d.id)}catch(e){w(e.message),E(!1)}},N=async()=>{E(!0);try{await R.withdrawQuestion(d.id),r(d.id)}catch(e){w(e.message),E(!1)}};uy((e,t)=>{if((e.ctrlKey||e.metaKey)&&e.key===`Enter`){e.preventDefault(),te();return}if(e.key===`Escape`){t?document.activeElement.blur():a.onOpenQuestion(null);return}if(t||e.ctrlKey||e.metaKey||e.altKey)return;let n=e.key.toLowerCase();if(n===`s`)a.onToggleSidebar();else if(e.key===`ArrowRight`)j(1);else if(e.key===`ArrowLeft`)j(-1);else if(n===`c`)a.onGoToConversation(d.id);else if(!h)return;else if(/^[1-9]$/.test(e.key)){let t=Number(e.key);t<=f.options.length?(e.preventDefault(),M(f.options[t-1].key)):t===ee&&(e.preventDefault(),M(`other`))}else n===`n`&&A&&(e.preventDefault(),O.current?.focus())});let P=o(d.sessionId),ne=l(p)?.tickets??void 0,re=e=>Mv([e],ne)[0]?.url,ie=d.status===`answered`&&d.answer!==null?f.options.find(e=>d.answer===e.answer||d.answer.startsWith(`${e.answer}\n\nNote: `))?.key??null:null,ae=d.answeredBy===`user`?d.forwardedFrom===null?a.userName:`${a.userName} (passed on by the manager)`:`Manager "${s(d.answeredBy??``)}", under its standing grant`,oe=e=>{let t=f.options.findIndex(t=>t.key===e);return t<0?e:`${t+1} · ${f.options[t].label.replace(/\*\*/g,``)}`},se=d.status===`open`?d.addressedTo===`user`?`${k+1} of ${n.length} waiting`:`Manager "${s(d.addressedTo)}" is handling it`:d.status===`answered`?`Answered`:`Withdrawn`,ce=e=>(0,V.jsx)(Mf,{text:e,sessionId:d.sessionId}),le=f.opinions,ue=le.length<=5,fe=e=>e.who??P,pe=e=>({"--i":e,"--n":le.length});return(0,V.jsxs)(`div`,{className:`waiting-view desk-view`,children:[u(se,(0,V.jsxs)(`div`,{className:`qbar`,children:[(0,V.jsx)(`button`,{onClick:()=>a.onOpenQuestion(null),children:`← Queue`}),(0,V.jsx)(`button`,{disabled:k<=0,"aria-label":`Previous question`,title:`Previous question (←)`,onClick:()=>j(-1),children:`←`}),(0,V.jsx)(`button`,{disabled:k<0||k>=n.length-1,"aria-label":`Next question`,title:`Next question (→)`,onClick:()=>j(1),children:`→`})]}),d),(0,V.jsx)(`div`,{className:`desk`,children:(0,V.jsxs)(`div`,{className:`desk-body`,children:[(0,V.jsxs)(`div`,{className:`qhead name-tinted${c(d.sessionId)?` tinted`:``}`,style:c(d.sessionId),children:[(0,V.jsx)(`span`,{className:`border-label`,children:Fv(m,p)}),(0,V.jsxs)(`div`,{className:`meta`,children:[(0,V.jsxs)(`strong`,{children:[`Question #`,d.id]}),(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>a.onOpenSession(d.sessionId),children:P}),` · asked `,Dg(d.askedAt)]}),d.addressedTo!==`user`&&(0,V.jsxs)(`span`,{className:`muted`,children:[`· to manager "`,s(d.addressedTo),`"`]}),!f.structured&&(0,V.jsx)(`span`,{className:`chip`,title:`Asked with text and option labels only`,children:`plain question`}),!f.structured&&(0,V.jsx)(`span`,{className:`muted touch-only`,children:`· asked with text and option labels only`})]}),(0,V.jsx)(`h3`,{children:f.title}),f.refs.length>0&&(0,V.jsx)(`div`,{className:`refs`,children:f.refs.map(e=>{let t=re(e);return t?(0,V.jsx)(`a`,{className:`chip`,href:t,target:`_blank`,rel:`noreferrer noopener`,children:e},e):(0,V.jsx)(`span`,{className:`chip`,children:e},e)})})]}),h&&d.addressedTo!==`user`&&(0,V.jsxs)(`div`,{className:`handled`,children:[`Manager "`,s(d.addressedTo),`" is handling this. Answer it here yourself and the manager is told.`]}),d.aboutRequest&&h&&(0,V.jsxs)(`p`,{className:`sensitive-note`,children:[(0,V.jsx)(`strong`,{children:`Permission request`}),`: your answer decides it. The first option allows it once; any other answer denies it, with your words as the reason.`]}),(0,V.jsx)(Iv,{q:d,userName:a.userName,nameOf:o,tintOf:c,onOpenConversation:(e,t)=>a.onGoToConversation(t,e),onOpenMessage:a.onGoToMessage,onOpenQuestion:e=>a.questions.some(t=>t.id===e)?()=>a.onOpenQuestion(e):null}),f.issue&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`The issue`}),(0,V.jsx)(`div`,{className:`issue prose`,children:ce(f.issue)})]}),f.evidence&&(0,V.jsx)(`section`,{className:`block`,children:(0,V.jsxs)(`details`,{className:`ev`,children:[(0,V.jsx)(`summary`,{children:`Evidence`}),(0,V.jsx)(`div`,{className:`prose`,children:ce(f.evidence)})]})}),d.status===`answered`&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Answer`}),(0,V.jsxs)(`div`,{className:`answered-box`,children:[(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`strong`,{children:[ae,`:`]}),` `,d.answer]}),(0,V.jsxs)(`div`,{className:`muted`,children:[`answered `,Dg(d.answeredAt??d.askedAt),` · `,d.deliveredAt?`delivered ${Dg(d.deliveredAt)}`:`not delivered yet: it goes in as soon as the session is free`]})]})]}),d.status===`withdrawn`&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsx)(`h4`,{children:`Withdrawn`}),(0,V.jsx)(`div`,{className:`answered-box withdrawn`,children:(0,V.jsxs)(`div`,{className:`muted`,children:[`Withdrawn`,d.withdrawnReason?`: ${d.withdrawnReason}`:``]})})]}),(f.options.length>0||h)&&(0,V.jsxs)(`section`,{className:`block opts-block`,children:[(0,V.jsx)(`h4`,{children:`Options`}),f.options.length>0&&(0,V.jsx)(gy,{opinions:le,whoOf:fe}),(0,V.jsxs)(`div`,{className:`opts`,role:`radiogroup`,"aria-label":`Options`,children:[f.options.map((e,t)=>{let n=h?g===e.key:ie===e.key;return(0,V.jsxs)(`button`,{className:`opt${n?` on`:``}`,role:`radio`,"aria-checked":n,disabled:!h,onClick:()=>M(e.key),children:[(0,V.jsx)(`span`,{className:`k`,children:t+1}),(0,V.jsxs)(`span`,{className:`lab`,children:[f.structured&&(0,V.jsx)(`span`,{className:`letter`,children:e.key}),e.label.replace(/\*\*/g,``)]}),e.detail&&(0,V.jsx)(`span`,{className:`det prose`,children:ce(e.detail)}),e.cost&&(0,V.jsxs)(`span`,{className:`cost muted`,children:[(0,V.jsx)(`b`,{children:`Cost`}),` · `,e.cost]}),ue&&le.map((t,n)=>t.pick===e.key&&(0,V.jsxs)(v.Fragment,{children:[(0,V.jsx)(`span`,{className:`edge${n===0?` first`:``}${n===le.length-1?` last`:``}`,style:pe(n)}),(0,V.jsx)(`span`,{className:`tag who`,style:pe(n),title:fe(t),children:fe(t)})]},n)),le.some(t=>t.pick===e.key)&&(0,V.jsxs)(`span`,{className:`picked-by${ue?` touch-only`:``}`,children:[(0,V.jsx)(`b`,{children:`Picked by`}),` `,le.filter(t=>t.pick===e.key).map(fe).join(`, `)]}),!h&&n&&(0,V.jsx)(`span`,{className:`tag answer`,children:`Answer`})]},e.key)}),h&&(0,V.jsxs)(`button`,{className:`opt${g===`other`?` on`:``}`,role:`radio`,"aria-checked":g===`other`,onClick:()=>M(`other`),children:[(0,V.jsx)(`span`,{className:`k`,children:ee}),(0,V.jsx)(`span`,{className:`lab`,children:`Other answer`}),(0,V.jsx)(`span`,{className:`det`,children:d.aboutRequest?`Deny it, saying why in your own words.`:`Say it in your own words.`})]})]}),h&&g===`other`&&(0,V.jsx)(`textarea`,{...i,ref:D,className:`box`,placeholder:`Your answer, in your own words`,value:y,onChange:e=>b(e.target.value)})]}),(f.structured||le.length>0)&&(0,V.jsxs)(`section`,{className:`block`,children:[(0,V.jsxs)(`h4`,{children:[`Opinions`,de(le)&&(0,V.jsx)(`span`,{className:`split`,children:`They disagree`})]}),le.length?(0,V.jsx)(`div`,{className:`recs`,children:le.map((e,t)=>(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`div`,{className:`rec-label muted`,children:[ue&&le.length>1&&(0,V.jsx)(_y,{i:t,n:le.length}),fe(e),e.who===null&&` (asker)`]}),(0,V.jsxs)(`div`,{className:`rec${e.pick?``:` empty`}`,children:[(0,V.jsx)(`div`,{className:`pick`,children:e.pick?oe(e.pick):`No pick among the options`}),(0,V.jsx)(`div`,{className:`prose`,children:e.why?ce(e.why):(0,V.jsx)(`span`,{className:`none`,children:f.structured?`No reason given.`:`Marked "(recommended)"; a plain question gives no reason.`})})]})]},t))}):(0,V.jsx)(`div`,{className:`rec empty`,children:(0,V.jsx)(`div`,{className:`none`,children:`No opinions given.`})})]}),h&&(0,V.jsxs)(`section`,{className:`block note-block`,children:[A&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`h4`,{children:[`Note `,(0,V.jsx)(`span`,{className:`opt-in`,children:`(optional, goes with the answer)`})]}),(0,V.jsx)(`textarea`,{...i,ref:O,className:`box`,placeholder:`Anything to go with the answer`,value:x,onChange:e=>S(e.target.value)})]}),(0,V.jsxs)(`div`,{className:`send`,children:[(0,V.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),(0,V.jsxs)(`span`,{className:`muted send-hint`,children:[(0,V.jsx)(`kbd`,{children:`Ctrl`}),`/`,(0,V.jsx)(`kbd`,{children:`⌘`}),`+`,(0,V.jsx)(`kbd`,{children:`Enter`}),` sends`]}),(0,V.jsx)(`span`,{className:`status`,role:`status`,children:C})]}),(0,V.jsx)(cg,{busy:T,onWithdraw:()=>void N()})]}),(0,V.jsxs)(`div`,{className:`keys`,children:[h&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`1`}),`–`,(0,V.jsx)(`kbd`,{children:ee}),` pick (`,ee,`: other)`]}),h&&A&&(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`N`}),` note`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`←`}),(0,V.jsx)(`kbd`,{children:`→`}),` previous / next`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`C`}),` conversation`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`Esc`}),` queue`]}),(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`kbd`,{children:`S`}),` sidebar`]})]})]})}),h&&(0,V.jsxs)(`div`,{className:`send-bar`,children:[(0,V.jsx)(`span`,{className:`send-pick${g?``:` muted`}`,children:g===null?`No option picked yet`:g===`other`?`${ee} · Other answer`:oe(g)}),(0,V.jsx)(`button`,{className:`primary`,disabled:!g||T,onClick:()=>void te(),children:`Send answer`}),C&&(0,V.jsx)(`span`,{className:`status`,role:`status`,children:C})]})]})}var yy=e=>Math.max(0,Math.min(100,Math.floor(Math.round((e??0)*1e4)/100)));function by(e){if(e.holding)return`held at ${e.percent}%`;if(e.lifted)return`stop at ${e.percent}% lifted`;if(e.utilization==null)return`stop at ${e.percent}%`;let t=e.percent-yy(e.utilization);return`${Math.max(1,t)}% to stop`}var xy={five_hour:`5 h`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`,seven_day_overage_included:`Weekly (incl. extra)`,overage:`Extra usage`};function Sy(e,t,n){if(e==null)return``;let r=Math.ceil((e-t)/6e4),i=`${xy[n]??n} limit resets`;if(r<=0)return`${i} now`;let a=Math.floor(r/1440),o=Math.floor(r%1440/60),s=r%60;return`${i} in ${(a?[`${a} d`,o?`${o} h`:``]:[o?`${o} h`:``,s?`${s} min`:``]).filter(Boolean).join(` `)}`}function Cy(e,t){let n=by(e),r=e.holding||e.utilization==null?n[0].toUpperCase()+n.slice(1):`${yy(e.utilization)}% · ${n}`,i=Sy(e.resetsAt,t,e.kind);return i?`${r} · ${i}`:r}var wy=180;function Ty({scene:e,step:t,number:n,cls:r}){let i=Ug(e,t),a=Ug({...e,sprites:[]},t),o=new Set(n.map(t=>t.y*(e.width+1)+t.x)),s=[],c=``;for(let e=0;e<i.length;e++)o.has(e)||i[e]!==a[e]&&i[e]!==`
|
|
98
|
+
`?(c&&s.push(c),c=``,s.push((0,V.jsx)(`span`,{className:r,children:i[e]},e))):c+=i[e];return c&&s.push(c),s}function Ey(e,t){let n=document.createElement(`canvas`).getContext(`2d`);return n?(n.font=`600 ${t}px ${getComputedStyle(e).fontFamily}`,n.measureText(`~`.repeat(50)).width/50):t*.6}function Dy({utilization:e,label:t,hull:n=`ship`}){let{size:r,next:i,step:a}=R_(`ledung.limitShipSize`,5),o=(0,v.useRef)(null),[s,c]=(0,v.useState)(l_.at(-1)),l=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,[u,d]=(0,v.useState)(0);(0,v.useLayoutEffect)(()=>{let e=o.current?.parentElement;if(!e||!o.current)return;let t=()=>{let t=Ey(o.current,r);c(l_.find(n=>n*t<=e.clientWidth)??l_.at(-1))};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[r]);let f=v_(e*100,s,n),p=(0,v.useRef)(null),m=p.current??={mode:null,x:b_(f,s,n),stage:y_(f),shown:f,at:-1};m.mode===null&&f<m.shown&&!l&&(m.mode=`leaving`),m.mode===null&&(m.shown=f),(0,v.useEffect)(()=>{if(l)return;let e=setInterval(()=>d(e=>e+1),wy);return()=>clearInterval(e)},[l]);let h=m.at!==u;m.at=u;let g,_=[],y=m.stage;if(m.mode===`leaving`)g=E_(s,m.stage,m.x,n),h&&(m.x-=2),m.x<-10&&Object.assign(m,{mode:`arriving`,x:-6,stage:0});else if(m.mode===`arriving`)g=D_(s,m.x,n),y=0,h&&(m.x+=1),m.x>=0&&Object.assign(m,{mode:null,x:0,shown:0});else{let t=b_(f,s,n);l||Math.abs(t-m.x)>s?m.x=t:h&&u%2==0&&m.x!==t&&(m.x+=Math.sign(t-m.x)),y=m.stage=y_(f),{scene:g,number:_}=T_(s,y,m.x,`${yy(e)}%`,n)}let b=y>=f_?`limit-ship-hull wreck`:y>0?`limit-ship-hull breaking`:`limit-ship-hull`;return(0,V.jsx)(`button`,{ref:o,type:`button`,className:`ship-button limit-ship`,title:`${t}: ${Math.round(e*100)}% used. Ship size ${r}px: click for ${i}px`,onClick:a,children:(0,V.jsx)(`pre`,{className:`sailing-ship`,style:{fontSize:`${r}px`},"aria-hidden":`true`,children:(0,V.jsx)(Ty,{scene:g,step:l?0:u,number:_,cls:b})})})}var Oy=[[`five_hour`,`5-hour`],[`seven_day`,`Weekly`]],ky=e=>Oy.find(([t])=>t===e)?.[1]??e;function Ay(e){let t=e.utilization==null?``:` (now ${Math.round(e.utilization*100)}%)`,n=e.resetsAt==null?``:` until ${new Date(e.resetsAt).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}, when the window resets`;return`${ky(e.kind)} usage${e.account==="default"?``:` of account ${e.account}`} reached the stop at ${e.percent}%${t}: new turns are held${n}.`}function jy({stop:e,run:t}){let[n,r]=(0,v.useState)(Date.now);return(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),3e4);return()=>clearInterval(e)},[]),(0,V.jsxs)(`div`,{className:`limit-stop${e.holding?` held`:``}`,children:[(0,V.jsx)(`span`,{children:Cy(e,n)}),e.holding&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void t(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`})]})}function My(e){let t=[`default`,...e.accounts.map(e=>e.name)];return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Usage stops`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`At this share of a plan window, Ledung holds new turns for every session and manager on the account; a running turn finishes. It lifts when the window resets, when you raise the stop, or with Lift. Once saved here, these replace the config's `,(0,V.jsx)(`code`,{children:`usageStops`}),`.`]}),t.map(n=>(0,V.jsxs)(`div`,{children:[t.length>1&&(0,V.jsx)(`strong`,{children:n==="default"?`This computer's login`:n}),Oy.map(([t,r])=>{let i=e.usageStops.find(e=>e.account===n&&e.kind===t);return(0,V.jsx)(Ny,{account:n,kind:t,label:r,stop:i,run:e.run},`${t}:${i?.percent??``}`)})]},n))]})}function Ny(e){let[t,n]=(0,v.useState)(e.stop?String(e.stop.percent):``),r=e.stop,i=()=>void e.run(()=>R.setUsageStop(e.account,e.kind,t.trim()?Number(t):null));return(0,V.jsxs)(`div`,{className:`row`,style:{display:`flex`,gap:`0.5rem`,alignItems:`center`,flexWrap:`wrap`},children:[(0,V.jsxs)(`label`,{children:[e.label,` `,(0,V.jsx)(`input`,{type:`number`,min:1,max:100,placeholder:`none`,value:t,style:{width:`5rem`},onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&i()}}),` %`]}),(0,V.jsx)(`button`,{className:`small`,disabled:t.trim()===(r?String(r.percent):``),onClick:i,children:`Save`}),r?.holding&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void e.run(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,V.jsx)(`span`,{className:`muted`,children:r?.holding?`Reached: work is held.`:r?.lifted?`Reached, lifted for this window.`:r?.utilization==null?``:`Now ${Math.round(r.utilization*100)}%.`})]})}var Py=36e5,Fy={five_hour:5*Py,seven_day:168*Py};function Iy(e,t,n,r=Date.now()){let i=Fy[e];if(!i||!n||n<=r)return null;let a=r-(n-i);return a<i/10?null:t*i/Math.min(a,i)}function Ly(e,t,n,r=Date.now()){let i=Iy(e,t,n,r);return i==null?Fy[e]?n?n<=r?{share:null,why:`No forecast: the window is resetting`}:{share:null,why:`No forecast yet: too little of the window has gone to tell the pace`}:{share:null,why:`No forecast: the reset time is not known yet`}:{share:null,why:`No forecast for this window`}:{share:i}}function Ry(e,t){if(!e)return null;let n=e.match(/^ps?:([^/]+)/);return n?n[1]:t.find(t=>t.id===e)?.project??null}function zy(e,t,n,r){let i=n.find(n=>n.name===Ry(e,t));return i?{account:i.account??`default`,remember:!0}:{account:r??n[0]?.account??`default`,remember:!1}}var By=e=>e==="default"?`Default`:e,Vy=e=>e&&e!=="default"?e:null;function Hy(e,t){return e.resetsAt!=null&&e.resetsAt<=t}function Uy(e,t){let n=e.seenAt??e.at,r=Math.max(0,Math.floor((t-n)/6e4));return r<1?`as of just now`:r<60?`as of ${r} min ago`:r<1440?`as of ${Math.floor(r/60)} h ago`:`as of ${new Date(n).toLocaleString([],{weekday:`short`,hour:`2-digit`,minute:`2-digit`})}`}function Wy(e,t){return t-(e.seenAt??e.at)>=36e5?Uy(e,t):null}function Gy(e){return e>=1e9?`${(e/1e9).toFixed(e>=1e10?0:1)}B`:e>=1e6?`${(e/1e6).toFixed(e>=1e7?0:1)}M`:e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(Math.round(e))}function Ky(e){return e==null?`—`:e>=100?`$${Math.round(e).toLocaleString(`en-US`)}`:e>=1?`$${e.toFixed(2)}`:`$${e.toFixed(3)}`}var qy=e=>`${Math.round(e*100)}%`;function Jy(e){let t={passing:` ✓`,failing:` ✗`,running:` …`,none:``}[e.checks],n=e.state===`open`?``:` (${e.state})`;return`PR #${e.number}${t}${n}`}var Yy=[`opus-5-5`,`sonnet-5-5`,`haiku-5-5`,`fable-5-1`,`opus-5`,`sonnet-5`,`haiku-4-5`],Xy=[`user`,`answer`,`manager`,`ledung`,`unknown`],Zy={user:`You typed`,answer:`Your answer`,manager:`A manager`,ledung:`Ledung update`,unknown:`Unknown`};function Qy(e,t){let n;return n=e===`model`?[...Yy,...t.filter(e=>!Yy.includes(e)).sort()]:e===`trigger`?Xy:[...t].sort(),t=>{if(e===`trigger`&&t===`unknown`)return`var(--s-other)`;let r=n.indexOf(t);return r>=0&&r<7?`var(--s${r+1})`:`var(--s-other)`}}function $y({items:e}){return(0,V.jsx)(`div`,{className:`viz-legend`,children:e.map(e=>(0,V.jsxs)(`span`,{className:`viz-legend-item`,children:[(0,V.jsx)(`span`,{className:`viz-swatch${e.textured?` textured`:``}`,style:{background:e.color}}),e.label]},e.label))})}function eb({children:e}){return(0,V.jsx)(`div`,{className:`viz-tip`,role:`tooltip`,children:e})}function tb(e){let[t,n]=(0,v.useState)(null),r=e.height??160,i=e.columns.map(t=>e.series.reduce((e,n)=>e+(t.values[n.key]??0),0)),a=Math.max(1,...i);if(!e.columns.length)return(0,V.jsx)(`p`,{className:`muted`,children:e.emptyText??`Nothing in this period.`});let o=[a,a/2],s=Math.max(1,Math.ceil(e.columns.length/8));return(0,V.jsxs)(`div`,{className:`viz-bars`,style:{height:r+22},onMouseLeave:()=>n(null),children:[(0,V.jsx)(`div`,{className:`viz-grid`,style:{height:r},children:o.map(e=>(0,V.jsx)(`div`,{className:`viz-gridline`,style:{bottom:`${e/a*100}%`},children:(0,V.jsx)(`span`,{children:Gy(e)})},e))}),(0,V.jsx)(`div`,{className:`viz-cols`,style:{height:r},children:e.columns.map((r,o)=>{let c=e.series.filter(e=>(r.values[e.key]??0)>0);return(0,V.jsxs)(`div`,{className:`viz-col${t===o?` active`:``}`,onMouseEnter:()=>n(o),onClick:()=>n(t===o?null:o),children:[(0,V.jsx)(`div`,{className:`viz-stack`,style:{height:`${i[o]/a*100}%`},children:c.map(e=>(0,V.jsx)(`div`,{className:`viz-seg${r.textured?` textured`:``}`,style:{flexGrow:r.values[e.key],background:e.color}},e.key))}),t===o&&(0,V.jsxs)(eb,{children:[(0,V.jsx)(`strong`,{children:r.label}),r.note&&(0,V.jsx)(`div`,{className:`muted`,children:r.note}),c.slice().reverse().map(e=>(0,V.jsxs)(`div`,{className:`viz-tip-row`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:e.color}}),` `,e.label,(0,V.jsx)(`span`,{className:`viz-tip-num`,children:Gy(r.values[e.key]??0)})]},e.key)),c.length>1&&(0,V.jsxs)(`div`,{className:`viz-tip-row total`,children:[`Total `,(0,V.jsx)(`span`,{className:`viz-tip-num`,children:Gy(i[o])})]})]}),o%s===0&&(0,V.jsx)(`span`,{className:`viz-xlabel`,children:r.short??r.label})]},o)})})]})}function nb({label:e,value:t,sub:n}){return(0,V.jsxs)(`div`,{className:`viz-tile`,children:[(0,V.jsx)(`div`,{className:`viz-tile-label`,children:e}),(0,V.jsx)(`div`,{className:`viz-tile-value`,children:t}),n&&(0,V.jsx)(`div`,{className:`viz-tile-sub`,children:n})]})}var rb={five_hour:`5-hour`,seven_day:`7-day`,seven_day_opus:`7-day Opus`,seven_day_sonnet:`7-day Sonnet`,seven_day_overage_included:`7-day (incl. extra)`,overage:`Extra usage`},ib={five_hour:`boat`,seven_day:`ship`},ab={allowed:{label:`OK`,icon:`●`,cls:`good`},allowed_warning:{label:`Close to the limit`,icon:`▲`,cls:`warning`},rejected:{label:`Limit reached`,icon:`■`,cls:`critical`}},ob=(e,t)=>Sy(e,Date.now(),t);function sb({account:e,limits:t,stops:n=[],run:r}){let i=t.filter(t=>(t.account??`default`)===e),a=(0,V.jsxs)(`div`,{className:`limits-account-name muted`,children:[By(e),!i.length&&` · no data yet`]});return i.length?(0,V.jsxs)(`div`,{className:`limits-account`,children:[a,(0,V.jsx)(cb,{limits:i,stops:n.filter(t=>t.account===e),run:r},e)]}):(0,V.jsx)(`div`,{className:`limits-account`,children:a})}function cb({limits:e,stops:t,run:n}){let r=Date.now();return(0,V.jsx)(`div`,{className:`limits`,children:e.map(e=>{if(Hy(e,r))return(0,V.jsxs)(`div`,{className:`limit limit-reset${ib[e.kind]?` with-ship`:``}`,title:`${rb[e.kind]??e.kind}: the window has reset since the last reading (${Uy(e,r)}). A new one comes with the next turn on this account.`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:rb[e.kind]??e.kind}),(0,V.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:(0,V.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=Wy(e,r),a=ab[e.status]??{label:e.status,icon:`●`,cls:`good`},o=e.utilization==null?void 0:ib[e.kind],s=o&&e.utilization!=null?Ly(e.kind,e.utilization,e.resetsAt):null,c=t.find(t=>t.kind===e.kind);return(0,V.jsxs)(`div`,{className:`limit${o?` with-ship`:``}`,title:`${rb[e.kind]??e.kind}: ${a.label}${e.utilization==null?``:`, ${qy(e.utilization)} used`}${s?.share==null?``:`, about ${qy(s.share)} by the reset at this pace`}. ${ob(e.resetsAt,e.kind)}. Reading ${Uy(e,r)}: Ledung hears the limits during a session's turn.`,children:[!o&&(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:rb[e.kind]??e.kind}),(0,V.jsxs)(`span`,{className:`limit-status ${a.cls}`,children:[a.icon,` `,e.utilization==null?a.label:qy(e.utilization)]})]}),o&&e.utilization!=null?(0,V.jsx)(`div`,{className:`limit-ship-box`,children:(0,V.jsx)(Dy,{utilization:e.utilization,label:rb[e.kind],hull:o})}):e.utilization!=null&&(0,V.jsx)(`div`,{className:`limit-track`,children:(0,V.jsx)(`div`,{className:`limit-fill ${a.cls}`,style:{width:`${Math.min(100,e.utilization*100)}%`}})}),(0,V.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,V.jsx)(`span`,{children:c&&n?``:ob(e.resetsAt,e.kind)}),s&&(s.share==null?(0,V.jsx)(`span`,{className:`limit-forecast`,title:s.why,children:`≈ — by reset`}):(0,V.jsxs)(`span`,{className:`limit-forecast${s.share>=1?` over`:``}`,children:[`≈ `,qy(s.share),` by reset`]}))]}),i&&(0,V.jsx)(`div`,{className:`limit-sub limit-age`,children:i}),c&&n&&(0,V.jsx)(jy,{stop:c,run:n})]},e.kind)})})}function lb(e){let t=[...e.sessions].sort((e,t)=>(t.endedAt??t.createdAt)-(e.endedAt??e.createdAt));return(0,V.jsxs)(`div`,{className:`waiting-view`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsxs)(`h2`,{children:[`Archived · `,e.title]}),(0,V.jsx)(`div`,{className:`muted`,children:t.length?`${t.length} archived; nothing is deleted. Writing to one resumes it.`:`No archived sessions.`})]})}),(0,V.jsx)(`div`,{className:`waiting-list`,children:t.map(t=>{let n=e.overview?.sessions[t.id]?.total;return(0,V.jsxs)(`div`,{className:`archived-row`,children:[(0,V.jsxs)(`div`,{className:`archived-text`,children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpenSession(t.id),children:t.title}),(0,V.jsxs)(`div`,{className:`muted`,children:[t.endedAt?`ended ${Dg(t.endedAt)}`:`ended`,t.endReason?` · ${t.endReason}`:``,n?` · ${Gy(n)}`:``]})]}),(0,V.jsxs)(`div`,{className:`archived-actions`,children:[t.claudeSessionId&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>e.run(()=>R.resume(t.id)),children:`Resume`}),(0,V.jsx)(`button`,{onClick:()=>e.run(()=>R.unarchive(t.id)),children:`Unarchive`})]})]},t.id)})})]})}var ub={merge:`merge`,devShip:`dev ship`,computerControl:`computer control`},db=e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,hour12:!1}),fb=e=>{let t=new Date(e);return`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`};function pb({away:e,onClick:t}){return(0,V.jsxs)(`button`,{className:`small away-marker`,title:`Away mode is on; open the session settings to end it`,onClick:t,children:[`Away until `,db(e.until)]})}function mb({away:e,run:t}){let n=e.allow.length?e.allow.map(e=>ub[e]).join(`, `):`nothing`;return(0,V.jsxs)(`div`,{className:`banner away`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`strong`,{children:[`Away until `,db(e.until)]}),` · managers may: `,n]}),(0,V.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>void t(()=>R.back()),children:`Back`})]})}function hb({initial:e,submit:t,run:n,close:r}){let[i,a]=(0,v.useState)(e.until),[o,s]=(0,v.useState)(e.allow),c=e=>s(t=>t.includes(e)?t.filter(t=>t!==e):w.filter(n=>n===e||t.includes(n)));return(0,V.jsxs)(`form`,{className:`away-form`,onSubmit:e=>{e.preventDefault(),n(async()=>{await R.away(i,o),r()})},children:[(0,V.jsxs)(`label`,{children:[`Away until `,(0,V.jsx)(`input`,{type:`time`,value:i,onChange:e=>a(e.target.value),required:!0})]}),(0,V.jsxs)(`span`,{className:`away-kinds`,children:[`Managers may:`,w.map(e=>(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:o.includes(e),onChange:()=>c(e)}),` `,ub[e]]},e))]}),(0,V.jsx)(`p`,{className:`muted`,children:`Merge and dev ship only when every floor passes. Computer control lets managers take over this computer; they are told when it ends. Everything else waits for you.`}),(0,V.jsxs)(`span`,{className:`away-actions`,children:[(0,V.jsx)(`button`,{type:`submit`,className:`primary small`,children:t}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:r,children:`Cancel`})]})]})}function gb({away:e,run:t}){let[n,r]=(0,v.useState)(!1);if(e){let i=e.allow.length?e.allow.map(e=>ub[e]).join(`, `):`nothing`;return(0,V.jsxs)(`div`,{className:`away-entry`,children:[(0,V.jsxs)(`div`,{className:`away-strip`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsxs)(`strong`,{children:[`Away until `,db(e.until)]}),` · allowed: `,i]}),(0,V.jsxs)(`span`,{className:`away-actions`,children:[(0,V.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Change the time or what managers may do, and stay away`,onClick:()=>r(!n),children:`Change…`}),(0,V.jsx)(`button`,{className:`small`,title:`End away mode now`,onClick:()=>{r(!1),t(()=>R.back())},children:`Back`})]})]}),n&&(0,V.jsx)(hb,{initial:{until:fb(e.until),allow:e.allow},submit:`Change`,run:t,close:()=>r(!1)})]})}return(0,V.jsxs)(`div`,{className:`away-entry`,children:[(0,V.jsx)(`button`,{className:`small${n?` on`:``}`,title:`Let managers merge, dev ship or take over this computer without you while you're away`,onClick:()=>r(!n),children:`Away…`}),n&&(0,V.jsx)(hb,{initial:{until:`08:00`,allow:T},submit:`Start`,run:t,close:()=>r(!1)})]})}function _b(e,t){return!!e&&t?.role!==`manager`}var vb=45;function yb({step:e,labels:t,onPick:n,children:r}){let i=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,a=t.length,o=O_(e,a),[s,c]=(0,v.useState)(o),l=(0,v.useRef)(`right`),u=(0,v.useRef)(0);(0,v.useEffect)(()=>{if(s===o)return;if(i){c(o);return}let e=setTimeout(()=>{u.current+=1,c(e=>e+Math.sign(o-e))},vb);return()=>clearTimeout(e)},[s,o,i]),s!==o&&(l.current=o>s?`right`:`left`);let d=Ug(A_(s,a,l.current,s!==o),u.current).split(`
|
|
99
99
|
`);return(0,V.jsxs)(`span`,{className:`boat-slider`,style:{"--boat-width":96,"--boat-ship":6},children:[(0,V.jsxs)(`span`,{className:`boat-track`,children:[(0,V.jsxs)(`pre`,{className:`sailing-ship`,"aria-hidden":`true`,children:[d.slice(0,3).join(`
|
|
100
100
|
`),`
|
|
101
|
-
`,(0,V.jsx)(`span`,{className:`boat-water`,children:d[3]})]}),r]}),(0,V.jsx)(`span`,{className:`boat-marks`,"aria-hidden":`true`,children:t.map((t,r)=>(0,V.jsx)(`span`,{className:r+1===e?`on`:void 0,style:{"--at":(O_(r+1,a)+.5)/96},onClick:e=>{e.preventDefault(),n(r+1)},children:t},t))})]})}var yb={workflow:`workflow`,computer:`this computer`,"workflow+computer":`workflow, changed on this computer`};function bb(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(t,e=>r(e.message))},[]);let i=(e?.groups.length??0)>1;return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Session profiles`}),(0,V.jsx)($p,{kind:`config`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`What managers and sessions get of your own Claude Code setup. A workflow's profiles file comes first; a profile of the same name in this computer's config changes it field by field. Read when each session starts.`}),n&&(0,V.jsx)(`p`,{className:`error`,children:n}),e?.groups.map(e=>(0,V.jsxs)(`div`,{className:`profiles-group`,children:[i&&(0,V.jsx)(`h4`,{children:e.workflow===null?`Chats and projects without a workflow's profiles`:`Workflow "${e.workflow}"`}),e.file&&(0,V.jsxs)(`p`,{className:`muted`,children:[`From `,(0,V.jsx)(`code`,{children:e.file})]}),e.warning&&(0,V.jsx)(`div`,{className:`board-warning`,role:`alert`,children:e.warning}),(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Profile`}),(0,V.jsx)(`th`,{children:`From`}),(0,V.jsx)(`th`,{children:`About`})]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:`full`}),(0,V.jsx)(`td`,{children:`built in`}),(0,V.jsx)(`td`,{className:`muted`,children:`Everything you have set up, as outside Ledung.`})]}),e.profiles.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:e.name}),(0,V.jsx)(`td`,{children:yb[e.source]}),(0,V.jsxs)(`td`,{className:`muted`,children:[e.about??``,e.allow.length>0&&(0,V.jsxs)(`div`,{children:[`Allows without asking: `,e.allow.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e))]}),e.mcp.length>0&&(0,V.jsxs)(`div`,{children:[`Runs MCP servers: `,e.mcp.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e))]})]})]},e.name))]})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Default for managers: `,e.defaults.manager??`full`,` · for sessions: `,e.defaults.session??`full`,e.pluginsOff.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · plugins off where installed: `,e.pluginsOff.join(`, `)]})]})]},e.workflow??``))]})}var xb={installed:`your installed Claude Code`,path:`the Claude Code the config names`,bundled:`the copy that came with Ledung`};function Sb(e){return e.filter(e=>e.status!==`ended`).map(e=>({id:e.id,title:e.title,project:e.project,runs:e.runner===`docker`?`the container's own`:e.claudeProgram?xb[e.claudeProgram.kind]:`not recorded (started before Ledung recorded it)`,path:e.runner===`docker`?null:e.claudeProgram?.path??null,version:e.claudeVersion}))}function Cb(e,t){let n=[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,`0`)).join(`:`);return e?`Checked again at ${n}: still the same.`:`Checked again at ${n}: no problem found.`}function wb(e){return e.split("`").flatMap((e,t)=>t%2?[{kind:`code`,text:e}]:e.split(/(https:\/\/[^\s,)]+[^\s,).])/).filter(Boolean).map(e=>({kind:/^https:\/\//.test(e)?`link`:`text`,text:e})))}function Tb({check:e,primary:t=!0}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=async()=>{r(!0),a(null);try{a(Cb(await e(),new Date))}catch(e){a(`Couldn't check: ${e.message}`)}finally{r(!1)}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:t?`small primary`:`small`,disabled:n,"aria-busy":n,onClick:()=>void o(),children:n?`Checking…`:`Check again`}),i&&(0,V.jsx)(`span`,{className:`muted`,role:`status`,children:i})]})}function Eb({text:e}){return(0,V.jsx)(V.Fragment,{children:wb(e).map((e,t)=>e.kind===`code`?(0,V.jsx)(`code`,{children:e.text},t):e.kind===`link`?(0,V.jsx)(`a`,{href:e.text,target:`_blank`,rel:`noreferrer`,children:e.text},t):e.text)})}function Db({looked:e}){return(0,V.jsxs)(`details`,{className:`looked`,children:[(0,V.jsxs)(`summary`,{children:[`Where Ledung looked (`,e.length,`)`]}),(0,V.jsx)(`ul`,{className:`mono`,children:e.map(e=>(0,V.jsx)(`li`,{children:e},e))})]})}var Ob=e=>e.charAt(0).toUpperCase()+e.slice(1);function kb({sessions:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=()=>R.claudeCode().then(e=>(n(e),i(null),e),e=>{throw i(e.message),e});(0,v.useEffect)(()=>{a().catch(()=>{})},[]);let o=Sb(e),s=t?.program;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Claude Code`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung runs your Claude Code: the `,(0,V.jsx)(`code`,{children:`claude`}),` on the PATH or where its installer puts it, else the Claude desktop app's own copy`,t?.required&&(0,V.jsxs)(V.Fragment,{children:[`, version `,t.required,` or newer (the one Ledung's Agent SDK was built for)`]}),`. Without it, sessions don't start. A running session keeps the program it started with.`]}),r&&(0,V.jsx)(`p`,{className:`error`,children:r}),t?.problem&&(0,V.jsx)(`div`,{className:`board-warning`,role:`alert`,children:(0,V.jsx)(Eb,{text:t.problem})}),t&&(0,V.jsx)(`table`,{className:`plain`,children:(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`New sessions run`}),(0,V.jsx)(`td`,{children:s?(0,V.jsxs)(V.Fragment,{children:[Ob(s.app?`the Claude desktop app's own Claude Code`:xb[s.kind]),` `,s.version&&(0,V.jsxs)(V.Fragment,{children:[`· `,s.version]}),(0,V.jsx)(`div`,{className:`muted mono`,children:s.path})]}):`Nothing: sessions don't start`})]}),t.installed&&t.installed.path!==s?.path&&(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Found`}),(0,V.jsxs)(`td`,{children:[Ob(t.installed.app?`the Claude desktop app's own Claude Code`:xb[t.installed.kind]),` · `,t.installed.version??`version unknown`,(0,V.jsx)(`div`,{className:`muted mono`,children:t.installed.path})]})]})]})}),t?.looked&&t.looked.length>0&&(0,V.jsx)(Db,{looked:t.looked}),(0,V.jsx)(`p`,{children:(0,V.jsx)(Tb,{primary:!1,check:async()=>!!(await a()).problem})}),o.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h4`,{children:`Running sessions`}),(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Session`}),(0,V.jsx)(`th`,{children:`Runs`}),(0,V.jsx)(`th`,{children:`Version`})]})}),(0,V.jsx)(`tbody`,{children:o.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[e.title,(0,V.jsx)(`div`,{className:`muted`,children:e.project})]}),(0,V.jsxs)(`td`,{children:[Ob(e.runs),e.path&&(0,V.jsx)(`div`,{className:`muted mono`,children:e.path})]}),(0,V.jsx)(`td`,{className:`mono`,children:e.version??``})]},e.id))})]})]})]})}function Ab(e){if(!e)return{label:`Remote: off`,detail:`Not on a relay: join one with a code below, or set "remote" in the config.`};switch(e.state){case`connected`:return{label:`Remote: connected`,detail:`Through the relay as ${e.publicName}.`};case`connecting`:return{label:`Remote: connecting…`,detail:`To the relay, as ${e.publicName}.`};case`reconnecting`:return{label:`Remote: reconnecting`,detail:e.error}}}var jb=7,Mb=864e5;function Nb(e,t){let n=e.validUntil?new Date(e.validUntil).toLocaleString():null,r=e.nextTry?new Date(e.nextTry).toLocaleTimeString():null,i=e.validUntil!==null&&e.validUntil-t<jb*Mb,a=n?` The one in use is valid until ${n}.`:``;switch(e.state){case`valid`:return{label:`Certificate valid until ${n}`,detail:i?`Fewer than ${jb} days left: it renews while Ledung is connected to the relay.`:null,warn:i,copy:!1};case`offline`:return{label:`Certificate: none yet`,detail:`Ledung orders one once it is connected to the relay.`,warn:!0,copy:!1};case`waiting-caa`:return{label:`Waiting for the CAA record`,detail:`Add this record to the DNS for the name. Ledung looks it up every minute${r?` (next at ${r})`:``} and orders as soon as it names this account.${e.error?` ${e.error}`:``}${a}`,warn:!n||i,copy:!0};case`ordering`:return{label:n?`Renewing the certificate…`:`Getting a certificate…`,detail:a.trim()||null,warn:!1,copy:!1};case`failed`:return{label:n?`Renewal failed`:`Getting a certificate failed`,detail:`${e.error??``}${r?` Trying again at ${r}.`:``}${a}`.trim()||null,warn:!0,copy:!1}}}var Pb=function(e,t){let n=e,r=Ib[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=Rb.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=Rb.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=Rb.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=Rb.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=Rb.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=Rb.getErrorCorrectPolynomial(l),d=Bb(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=Vb.getRSBlocks(e,t),i=Hb();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),Rb.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=Ub(e);break;case`Alphanumeric`:n=Wb(e);break;case`Byte`:n=Gb(e);break;case`Kanji`:n=Kb(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=Vb.getRSBlocks(e,r),n=Hb();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),Rb.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return Zb(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`<`;break;case`>`:t+=`>`;break;case`&`:t+=`&`;break;case`"`:t+=`"`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
|
|
101
|
+
`,(0,V.jsx)(`span`,{className:`boat-water`,children:d[3]})]}),r]}),(0,V.jsx)(`span`,{className:`boat-marks`,"aria-hidden":`true`,children:t.map((t,r)=>(0,V.jsx)(`span`,{className:r+1===e?`on`:void 0,style:{"--at":(k_(r+1,a)+.5)/96},onClick:e=>{e.preventDefault(),n(r+1)},children:t},t))})]})}var bb={workflow:`workflow`,computer:`this computer`,"workflow+computer":`workflow, changed on this computer`};function xb(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.profiles().then(t,e=>r(e.message))},[]);let i=(e?.groups.length??0)>1;return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Session profiles`}),(0,V.jsx)(em,{kind:`config`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`What managers and sessions get of your own Claude Code setup. A workflow's profiles file comes first; a profile of the same name in this computer's config changes it field by field. Read when each session starts.`}),n&&(0,V.jsx)(`p`,{className:`error`,children:n}),e?.groups.map(e=>(0,V.jsxs)(`div`,{className:`profiles-group`,children:[i&&(0,V.jsx)(`h4`,{children:e.workflow===null?`Chats and projects without a workflow's profiles`:`Workflow "${e.workflow}"`}),e.file&&(0,V.jsxs)(`p`,{className:`muted`,children:[`From `,(0,V.jsx)(`code`,{children:e.file})]}),e.warning&&(0,V.jsx)(`div`,{className:`board-warning`,role:`alert`,children:e.warning}),(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Profile`}),(0,V.jsx)(`th`,{children:`From`}),(0,V.jsx)(`th`,{children:`About`})]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:`full`}),(0,V.jsx)(`td`,{children:`built in`}),(0,V.jsx)(`td`,{className:`muted`,children:`Everything you have set up, as outside Ledung.`})]}),e.profiles.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:e.name}),(0,V.jsx)(`td`,{children:bb[e.source]}),(0,V.jsxs)(`td`,{className:`muted`,children:[e.about??``,e.allow.length>0&&(0,V.jsxs)(`div`,{children:[`Allows without asking: `,e.allow.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e))]}),e.mcp.length>0&&(0,V.jsxs)(`div`,{children:[`Runs MCP servers: `,e.mcp.map((e,t)=>(0,V.jsxs)(`span`,{children:[t?`, `:``,(0,V.jsx)(`code`,{children:e})]},e))]})]})]},e.name))]})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Default for managers: `,e.defaults.manager??`full`,` · for sessions: `,e.defaults.session??`full`,e.pluginsOff.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · plugins off where installed: `,e.pluginsOff.join(`, `)]})]})]},e.workflow??``))]})}var Sb={installed:`your installed Claude Code`,path:`the Claude Code the config names`,bundled:`the copy that came with Ledung`};function Cb(e){return e.filter(e=>e.status!==`ended`).map(e=>({id:e.id,title:e.title,project:e.project,runs:e.runner===`docker`?`the container's own`:e.claudeProgram?Sb[e.claudeProgram.kind]:`not recorded (started before Ledung recorded it)`,path:e.runner===`docker`?null:e.claudeProgram?.path??null,version:e.claudeVersion}))}function wb(e,t){let n=[t.getHours(),t.getMinutes(),t.getSeconds()].map(e=>String(e).padStart(2,`0`)).join(`:`);return e?`Checked again at ${n}: still the same.`:`Checked again at ${n}: no problem found.`}function Tb(e){return e.split("`").flatMap((e,t)=>t%2?[{kind:`code`,text:e}]:e.split(/(https:\/\/[^\s,)]+[^\s,).])/).filter(Boolean).map(e=>({kind:/^https:\/\//.test(e)?`link`:`text`,text:e})))}function Eb({check:e,primary:t=!0}){let[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null),o=async()=>{r(!0),a(null);try{a(wb(await e(),new Date))}catch(e){a(`Couldn't check: ${e.message}`)}finally{r(!1)}};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`button`,{className:t?`small primary`:`small`,disabled:n,"aria-busy":n,onClick:()=>void o(),children:n?`Checking…`:`Check again`}),i&&(0,V.jsx)(`span`,{className:`muted`,role:`status`,children:i})]})}function Db({text:e}){return(0,V.jsx)(V.Fragment,{children:Tb(e).map((e,t)=>e.kind===`code`?(0,V.jsx)(`code`,{children:e.text},t):e.kind===`link`?(0,V.jsx)(`a`,{href:e.text,target:`_blank`,rel:`noreferrer`,children:e.text},t):e.text)})}function Ob({looked:e}){return(0,V.jsxs)(`details`,{className:`looked`,children:[(0,V.jsxs)(`summary`,{children:[`Where Ledung looked (`,e.length,`)`]}),(0,V.jsx)(`ul`,{className:`mono`,children:e.map(e=>(0,V.jsx)(`li`,{children:e},e))})]})}var kb=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ab({sessions:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=()=>R.claudeCode().then(e=>(n(e),i(null),e),e=>{throw i(e.message),e});(0,v.useEffect)(()=>{a().catch(()=>{})},[]);let o=Cb(e),s=t?.program;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Claude Code`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung runs your Claude Code: the `,(0,V.jsx)(`code`,{children:`claude`}),` on the PATH or where its installer puts it, else the Claude desktop app's own copy`,t?.required&&(0,V.jsxs)(V.Fragment,{children:[`, version `,t.required,` or newer (the one Ledung's Agent SDK was built for)`]}),`. Without it, sessions don't start. A running session keeps the program it started with.`]}),r&&(0,V.jsx)(`p`,{className:`error`,children:r}),t?.problem&&(0,V.jsx)(`div`,{className:`board-warning`,role:`alert`,children:(0,V.jsx)(Db,{text:t.problem})}),t&&(0,V.jsx)(`table`,{className:`plain`,children:(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`New sessions run`}),(0,V.jsx)(`td`,{children:s?(0,V.jsxs)(V.Fragment,{children:[kb(s.app?`the Claude desktop app's own Claude Code`:Sb[s.kind]),` `,s.version&&(0,V.jsxs)(V.Fragment,{children:[`· `,s.version]}),(0,V.jsx)(`div`,{className:`muted mono`,children:s.path})]}):`Nothing: sessions don't start`})]}),t.installed&&t.installed.path!==s?.path&&(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Found`}),(0,V.jsxs)(`td`,{children:[kb(t.installed.app?`the Claude desktop app's own Claude Code`:Sb[t.installed.kind]),` · `,t.installed.version??`version unknown`,(0,V.jsx)(`div`,{className:`muted mono`,children:t.installed.path})]})]})]})}),t?.looked&&t.looked.length>0&&(0,V.jsx)(Ob,{looked:t.looked}),(0,V.jsx)(`p`,{children:(0,V.jsx)(Eb,{primary:!1,check:async()=>!!(await a()).problem})}),o.length>0&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h4`,{children:`Running sessions`}),(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Session`}),(0,V.jsx)(`th`,{children:`Runs`}),(0,V.jsx)(`th`,{children:`Version`})]})}),(0,V.jsx)(`tbody`,{children:o.map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[e.title,(0,V.jsx)(`div`,{className:`muted`,children:e.project})]}),(0,V.jsxs)(`td`,{children:[kb(e.runs),e.path&&(0,V.jsx)(`div`,{className:`muted mono`,children:e.path})]}),(0,V.jsx)(`td`,{className:`mono`,children:e.version??``})]},e.id))})]})]})]})}function jb(e){if(!e)return{label:`Remote: off`,detail:`Not on a relay: join one with a code below, or set "remote" in the config.`};switch(e.state){case`connected`:return{label:`Remote: connected`,detail:`Through the relay as ${e.publicName}.`};case`connecting`:return{label:`Remote: connecting…`,detail:`To the relay, as ${e.publicName}.`};case`reconnecting`:return{label:`Remote: reconnecting`,detail:e.error}}}var Mb=7,Nb=864e5;function Pb(e,t){let n=e.validUntil?new Date(e.validUntil).toLocaleString():null,r=e.nextTry?new Date(e.nextTry).toLocaleTimeString():null,i=e.validUntil!==null&&e.validUntil-t<Mb*Nb,a=n?` The one in use is valid until ${n}.`:``;switch(e.state){case`valid`:return{label:`Certificate valid until ${n}`,detail:i?`Fewer than ${Mb} days left: it renews while Ledung is connected to the relay.`:null,warn:i,copy:!1};case`offline`:return{label:`Certificate: none yet`,detail:`Ledung orders one once it is connected to the relay.`,warn:!0,copy:!1};case`waiting-caa`:return{label:`Waiting for the CAA record`,detail:`Add this record to the DNS for the name. Ledung looks it up every minute${r?` (next at ${r})`:``} and orders as soon as it names this account.${e.error?` ${e.error}`:``}${a}`,warn:!n||i,copy:!0};case`ordering`:return{label:n?`Renewing the certificate…`:`Getting a certificate…`,detail:a.trim()||null,warn:!1,copy:!1};case`failed`:return{label:n?`Renewal failed`:`Getting a certificate failed`,detail:`${e.error??``}${r?` Trying again at ${r}.`:``}${a}`.trim()||null,warn:!0,copy:!1}}}var Fb=function(e,t){let n=e,r=Lb[t],i=null,a=0,o=null,s=[],c={},l=function(e,t){a=n*4+17,i=function(e){let t=Array(e);for(let n=0;n<e;n+=1){t[n]=Array(e);for(let r=0;r<e;r+=1)t[n][r]=null}return t}(a),u(0,0),u(a-7,0),u(0,a-7),p(),f(),h(e,t),n>=7&&m(e),o??=v(n,r,s),g(o,t)},u=function(e,t){for(let n=-1;n<=7;n+=1)if(!(e+n<=-1||a<=e+n))for(let r=-1;r<=7;r+=1)t+r<=-1||a<=t+r||(0<=n&&n<=6&&(r==0||r==6)||0<=r&&r<=6&&(n==0||n==6)||2<=n&&n<=4&&2<=r&&r<=4?i[e+n][t+r]=!0:i[e+n][t+r]=!1)},d=function(){let e=0,t=0;for(let n=0;n<8;n+=1){l(!0,n);let r=zb.getLostPoint(c);(n==0||e>r)&&(e=r,t=n)}return t},f=function(){for(let e=8;e<a-8;e+=1)i[e][6]??(i[e][6]=e%2==0);for(let e=8;e<a-8;e+=1)i[6][e]??(i[6][e]=e%2==0)},p=function(){let e=zb.getPatternPosition(n);for(let t=0;t<e.length;t+=1)for(let n=0;n<e.length;n+=1){let r=e[t],a=e[n];if(i[r][a]==null)for(let e=-2;e<=2;e+=1)for(let t=-2;t<=2;t+=1)e==-2||e==2||t==-2||t==2||e==0&&t==0?i[r+e][a+t]=!0:i[r+e][a+t]=!1}},m=function(e){let t=zb.getBCHTypeNumber(n);for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[Math.floor(n/3)][n%3+a-8-3]=r}for(let n=0;n<18;n+=1){let r=!e&&(t>>n&1)==1;i[n%3+a-8-3][Math.floor(n/3)]=r}},h=function(e,t){let n=r<<3|t,o=zb.getBCHTypeInfo(n);for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<6?i[t][8]=n:t<8?i[t+1][8]=n:i[a-15+t][8]=n}for(let t=0;t<15;t+=1){let n=!e&&(o>>t&1)==1;t<8?i[8][a-t-1]=n:t<9?i[8][15-t-1+1]=n:i[8][15-t-1]=n}i[a-8][8]=!e},g=function(e,t){let n=-1,r=a-1,o=7,s=0,c=zb.getMaskFunction(t);for(let t=a-1;t>0;t-=2)for(t==6&&--t;;){for(let n=0;n<2;n+=1)if(i[r][t-n]==null){let a=!1;s<e.length&&(a=(e[s]>>>o&1)==1),c(r,t-n)&&(a=!a),i[r][t-n]=a,--o,o==-1&&(s+=1,o=7)}if(r+=n,r<0||a<=r){r-=n,n=-n;break}}},_=function(e,t){let n=0,r=0,i=0,a=Array(t.length),o=Array(t.length);for(let s=0;s<t.length;s+=1){let c=t[s].dataCount,l=t[s].totalCount-c;r=Math.max(r,c),i=Math.max(i,l),a[s]=Array(c);for(let t=0;t<a[s].length;t+=1)a[s][t]=255&e.getBuffer()[t+n];n+=c;let u=zb.getErrorCorrectPolynomial(l),d=Vb(a[s],u.getLength()-1).mod(u);o[s]=Array(u.getLength()-1);for(let e=0;e<o[s].length;e+=1){let t=e+d.getLength()-o[s].length;o[s][e]=t>=0?d.getAt(t):0}}let s=0;for(let e=0;e<t.length;e+=1)s+=t[e].totalCount;let c=Array(s),l=0;for(let e=0;e<r;e+=1)for(let n=0;n<t.length;n+=1)e<a[n].length&&(c[l]=a[n][e],l+=1);for(let e=0;e<i;e+=1)for(let n=0;n<t.length;n+=1)e<o[n].length&&(c[l]=o[n][e],l+=1);return c},v=function(e,t,n){let r=Hb.getRSBlocks(e,t),i=Ub();for(let t=0;t<n.length;t+=1){let r=n[t];i.put(r.getMode(),4),i.put(r.getLength(),zb.getLengthInBits(r.getMode(),e)),r.write(i)}let a=0;for(let e=0;e<r.length;e+=1)a+=r[e].dataCount;if(i.getLengthInBits()>a*8)throw`code length overflow. (`+i.getLengthInBits()+`>`+a*8+`)`;for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(236,8),i.getLengthInBits()>=a*8));)i.put(17,8);return _(i,r)};c.addData=function(e,t){t||=`Byte`;let n=null;switch(t){case`Numeric`:n=Wb(e);break;case`Alphanumeric`:n=Gb(e);break;case`Byte`:n=Kb(e);break;case`Kanji`:n=qb(e);break;default:throw`mode:`+t}s.push(n),o=null},c.isDark=function(e,t){if(e<0||a<=e||t<0||a<=t)throw e+`,`+t;return i[e][t]},c.getModuleCount=function(){return a},c.make=function(){if(n<1){let e=1;for(;e<40;e++){let t=Hb.getRSBlocks(e,r),n=Ub();for(let t=0;t<s.length;t++){let r=s[t];n.put(r.getMode(),4),n.put(r.getLength(),zb.getLengthInBits(r.getMode(),e)),r.write(n)}let i=0;for(let e=0;e<t.length;e++)i+=t[e].dataCount;if(n.getLengthInBits()<=i*8)break}n=e}l(!1,d())},c.createTableTag=function(e,t){e||=2,t=t===void 0?e*4:t;let n=``;n+=`<table style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: `+t+`px;`,n+=`">`,n+=`<tbody>`;for(let t=0;t<c.getModuleCount();t+=1){n+=`<tr>`;for(let r=0;r<c.getModuleCount();r+=1)n+=`<td style="`,n+=` border-width: 0px; border-style: none;`,n+=` border-collapse: collapse;`,n+=` padding: 0px; margin: 0px;`,n+=` width: `+e+`px;`,n+=` height: `+e+`px;`,n+=` background-color: `,n+=c.isDark(t,r)?`#000000`:`#ffffff`,n+=`;`,n+=`"/>`;n+=`</tr>`}return n+=`</tbody>`,n+=`</table>`,n},c.createSvgTag=function(e,t,n,r){let i={};typeof arguments[0]==`object`&&(i=arguments[0],e=i.cellSize,t=i.margin,n=i.alt,r=i.title),e||=2,t=t===void 0?e*4:t,n=typeof n==`string`?{text:n}:n||{},n.text=n.text||null,n.id=n.text?n.id||`qrcode-description`:null,r=typeof r==`string`?{text:r}:r||{},r.text=r.text||null,r.id=r.text?r.id||`qrcode-title`:null;let a=c.getModuleCount()*e+t*2,o,s,l,u,d=``,f;for(f=`l`+e+`,0 0,`+e+` -`+e+`,0 0,-`+e+`z `,d+=`<svg version="1.1" xmlns="http://www.w3.org/2000/svg"`,d+=i.scalable?``:` width="`+a+`px" height="`+a+`px"`,d+=` viewBox="0 0 `+a+` `+a+`" `,d+=` preserveAspectRatio="xMinYMin meet"`,d+=r.text||n.text?` role="img" aria-labelledby="`+y([r.id,n.id].join(` `).trim())+`"`:``,d+=`>`,d+=r.text?`<title id="`+y(r.id)+`">`+y(r.text)+`</title>`:``,d+=n.text?`<description id="`+y(n.id)+`">`+y(n.text)+`</description>`:``,d+=`<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>`,d+=`<path d="`,l=0;l<c.getModuleCount();l+=1)for(u=l*e+t,o=0;o<c.getModuleCount();o+=1)c.isDark(l,o)&&(s=o*e+t,d+=`M`+s+`,`+u+f);return d+=`" stroke="transparent" fill="black"/>`,d+=`</svg>`,d},c.createDataURL=function(e,t){e||=2,t=t===void 0?e*4:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t;return Qb(n,n,function(t,n){if(r<=t&&t<i&&r<=n&&n<i){let i=Math.floor((t-r)/e),a=Math.floor((n-r)/e);return+!c.isDark(a,i)}return 1})},c.createImgTag=function(e,t,n){e||=2,t=t===void 0?e*4:t;let r=c.getModuleCount()*e+t*2,i=``;return i+=`<img`,i+=` src="`,i+=c.createDataURL(e,t),i+=`"`,i+=` width="`,i+=r,i+=`"`,i+=` height="`,i+=r,i+=`"`,n&&(i+=` alt="`,i+=y(n),i+=`"`),i+=`/>`,i};let y=function(e){let t=``;for(let n=0;n<e.length;n+=1){let r=e.charAt(n);switch(r){case`<`:t+=`<`;break;case`>`:t+=`>`;break;case`&`:t+=`&`;break;case`"`:t+=`"`;break;default:t+=r}}return t},b=function(e){e=e===void 0?2:e;let t=c.getModuleCount()*1+e*2,n=e,r=t-e,i,a,o,s,l,u={"██":`█`,"█ ":`▀`," █":`▄`," ":` `},d={"██":`▀`,"█ ":`▀`," █":` `," ":` `},f=``;for(i=0;i<t;i+=2){for(o=Math.floor((i-n)/1),s=Math.floor((i+1-n)/1),a=0;a<t;a+=1)l=`█`,n<=a&&a<r&&n<=i&&i<r&&c.isDark(o,Math.floor((a-n)/1))&&(l=` `),n<=a&&a<r&&n<=i+1&&i+1<r&&c.isDark(s,Math.floor((a-n)/1))?l+=` `:l+=`█`,f+=e<1&&i+1>=r?d[l]:u[l];f+=`
|
|
102
102
|
`}return t%2&&e>0?f.substring(0,f.length-t-1)+Array(t+1).join(`▀`):f.substring(0,f.length-1)};return c.createASCII=function(e,t){if(e||=1,e<2)return b(t);--e,t=t===void 0?e*2:t;let n=c.getModuleCount()*e+t*2,r=t,i=n-t,a,o,s,l,u=Array(e+1).join(`██`),d=Array(e+1).join(` `),f=``,p=``;for(a=0;a<n;a+=1){for(s=Math.floor((a-r)/e),p=``,o=0;o<n;o+=1)l=1,r<=o&&o<i&&r<=a&&a<i&&c.isDark(s,Math.floor((o-r)/e))&&(l=0),p+=l?u:d;for(s=0;s<e;s+=1)f+=p+`
|
|
103
|
-
`}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};Pb.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},Pb.createStringToBytes=function(e,t){let n=function(){let n=Yb(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var Fb={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Ib={L:1,M:0,Q:3,H:2},Lb={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Rb=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Lb.PATTERN000:return function(e,t){return(e+t)%2==0};case Lb.PATTERN001:return function(e,t){return e%2==0};case Lb.PATTERN010:return function(e,t){return t%3==0};case Lb.PATTERN011:return function(e,t){return(e+t)%3==0};case Lb.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Lb.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Lb.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Lb.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Bb([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Bb([1,zb.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Fb.MODE_NUMBER:return 10;case Fb.MODE_ALPHA_NUM:return 9;case Fb.MODE_8BIT_BYTE:return 8;case Fb.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Fb.MODE_NUMBER:return 12;case Fb.MODE_ALPHA_NUM:return 11;case Fb.MODE_8BIT_BYTE:return 16;case Fb.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Fb.MODE_NUMBER:return 14;case Fb.MODE_ALPHA_NUM:return 13;case Fb.MODE_8BIT_BYTE:return 16;case Fb.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),zb=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Bb=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=zb.gexp(zb.glog(r.getAt(n))+zb.glog(e.getAt(i)));return Bb(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=zb.glog(r.getAt(0))-zb.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=zb.gexp(zb.glog(e.getAt(r))+t);return Bb(n,0).mod(e)},r},Vb=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case Ib.L:return e[(t-1)*4+0];case Ib.M:return e[(t-1)*4+1];case Ib.Q:return e[(t-1)*4+2];case Ib.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),Hb=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},Ub=function(e){let t=Fb.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},Wb=function(e){let t=Fb.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},Gb=function(e){let t=Fb.MODE_8BIT_BYTE,n=Pb.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},Kb=function(e){let t=Fb.MODE_KANJI,n=Pb.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},qb=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},Jb=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},Yb=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},Xb=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=qb(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},Zb=function(e,t,n){let r=Xb(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=qb();r.write(i);let a=Jb(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};Pb.stringToBytes;var Qb=/^[0-9A-Z $%*+\-./:]*$/,$b=.3,ex=e=>e.toUpperCase();function tx(e){let t=Pb(0,`H`);t.addData(e,Qb.test(e)?`Alphanumeric`:`Byte`),t.make();let n=t.getModuleCount(),r=Math.floor(n*$b);r%2==0&&r--;let i=(n-r)/2,a=(e,t)=>e>=i&&e<i+r&&t>=i&&t<i+r;return{n,dark:(e,n)=>!a(e,n)&&t.isDark(e,n),logo:{from:i,size:r}}}function nx(e){return e.secure&&e.serviceWorker&&e.pushManager?`yes`:/iPhone|iPad|iPod/.test(e.userAgent)&&!e.standalone?`home-screen`:`no`}var rx=()=>nx({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,userAgent:navigator.userAgent,standalone:navigator.standalone===!0||matchMedia(`(display-mode: standalone)`).matches});function ix(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}function ax(e,t){return!e||e.byteLength!==t.length?!1:new Uint8Array(e).every((e,n)=>e===t[n])}async function ox(){return await navigator.serviceWorker.register(`/sw.js`,{scope:`/`}),navigator.serviceWorker.ready}async function sx(){if((Notification.permission===`granted`?`granted`:await Notification.requestPermission())!==`granted`)throw Error(`Notifications are blocked for Ledung here. Allow them in the settings for it, then switch this on again.`);let{publicKey:e}=await R.pushState(),t=await ox(),n=ix(e),r=await t.pushManager.getSubscription();r&&!ax(r.options.applicationServerKey,n)&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:n}),await R.pushOn(r.toJSON())}async function cx(){await R.pushOff(),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe()}async function lx(){let{on:e}=await R.pushState();return e?!!await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription():!1}function ux(e){return e?`Pushes for this computer come through the first tab: on the phone, switch on push notifications in Settings there, under Phones. They say this computer's name, and tapping one opens this tab.`:`Pushes for this computer come through the first tab once the two computers are linked (Settings → Linked computers); then, on the phone, switch them on in Settings there, under Phones.`}var dx=e=>e?new Date(e).toLocaleString():`never`;function fx({text:e}){let{n:t,dark:n,logo:r}=tx(e),i=[];for(let e=0;e<t;e++)for(let r=0;r<t;r++)n(e,r)&&i.push(`M${r+4},${e+4}h1v1h-1z`);let a=r.from+4+.5,o=r.size-1;return(0,V.jsxs)(`svg`,{className:`qr`,viewBox:`0 0 ${t+8} ${t+8}`,width:220,height:220,role:`img`,"aria-label":`QR code of the pairing link`,children:[(0,V.jsx)(`rect`,{width:t+8,height:t+8,fill:`#fff`}),(0,V.jsx)(`path`,{d:i.join(``),fill:`#000`}),(0,V.jsx)(`image`,{href:`/icon.svg?v=2`,x:a,y:a,width:o,height:o})]})}function px({run:e,linked:t=!1}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.thisDevice().then(r,()=>r({remote:!1}))},[]),n?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Phones`}),n.remote?(0,V.jsx)(mx,{device:n.device,mayAddPasskey:n.mayAddPasskey,unlockedUntil:n.unlockedUntil,linked:t,run:e,onChange:()=>R.thisDevice().then(r)}):(0,V.jsx)(vx,{run:e})]}):null}function mx(e){let{device:t,unlockedUntil:n}=e,[r,i]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),15e3);return()=>clearInterval(e)},[]);let a=n!==null&&n>r,o=t.kind===`computer`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`This device is paired as `,(0,V.jsx)(`b`,{children:t.name}),o?`, a computer`:``,`. Devices are listed and removed in Settings on the computer Ledung runs on.`]}),t.passkey&&o?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call from here asks for it (Touch ID or Windows Hello) each time.`}),(0,V.jsx)(`p`,{children:a?(0,V.jsx)(V.Fragment,{children:`🔓 Logged on: changes need nothing more until you log out, or until 14 days without use.`}):(0,V.jsx)(V.Fragment,{children:`🔒 Logged off: from here you can look, not change anything. Log on with the passkey; it lasts until you log out.`})}),a?(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.logOutDevice(),e.onChange()}),children:`Log out`}):(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Log on`}),Vt()&&(0,V.jsx)(gx,{linked:e.linked})]}):t.passkey?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call or writing to a manager from here asks for it (Face ID or fingerprint) each time.`}),(0,V.jsx)(`p`,{children:a?(0,V.jsxs)(V.Fragment,{children:[`🔓 Unlocked for changes until `,new Date(n).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),`.`]}):(0,V.jsx)(V.Fragment,{children:`🔒 Locked: from here you can look, not change anything. Unlocking takes the passkey once and lasts 30 minutes.`})}),!a&&(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Unlock`}),Vt()?(0,V.jsx)(gx,{linked:e.linked}):(0,V.jsx)(_x,{run:e.run,onChange:e.onChange})]}):e.mayAddPasskey&&Vt()?(0,V.jsx)(hx,{run:e.run,onChange:e.onChange}):e.mayAddPasskey?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look, and every change waits for the computer. This is possible in the first 10 minutes after pairing.`}),(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.addPasskey(),e.onChange()}),children:`Set up passkey`})]}):(0,V.jsx)(`p`,{className:`muted`,children:`No passkey: this device can only look; changes wait for the computer. To add one, pair this device again from Settings on the computer.`})]})}function hx({run:e,onChange:t}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{R.thisDevice().then(e=>{e.remote&&e.device.passkey&&t()},()=>{}),Date.now()>n.expiresAt&&r(null)},2e3);return()=>clearInterval(e)},[n,t]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look. It is made in a window of its own (here inside another computer's page the browser may not make one), and works here afterwards. This is possible in the first 10 minutes after pairing.`}),n?(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`a`,{className:`button-link`,href:n.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open the passkey window`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`· then come back here`})]}):(0,V.jsx)(`button`,{onClick:()=>void e(async()=>r(await R.passkeyEnrolLink())),children:`Set up passkey`})]})}function gx({linked:e}){return(0,V.jsx)(`p`,{className:`muted push-switch framed-push`,children:ux(e)})}function _x({run:e,onChange:t}){let n=rx(),[r,i]=(0,v.useState)(null);if((0,v.useEffect)(()=>{n===`yes`&&lx().then(i,()=>i(!1))},[n]),n===`home-screen`)return(0,V.jsx)(`p`,{className:`muted push-switch`,children:`Push notifications on an iPhone need Ledung on the Home Screen: Share → Add to Home Screen, then open it from there and switch them on here.`});if(n===`no`)return(0,V.jsx)(`p`,{className:`muted push-switch`,children:`This browser can't get push notifications.`});if(r===null)return null;let a=n=>void e(async()=>{try{await(n?sx():cx()),i(n)}finally{t()}});return(0,V.jsxs)(`div`,{className:`push-switch`,children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`A notification on this phone when something new waits for you, even with Ledung closed`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>a(e.target.checked)}),` Push notifications to this phone`]}),(0,V.jsx)(`p`,{className:`muted`,children:`When something new waits for you on this computer. It says which computer and what kind of item, never the text: that loads when you open it.`})]})}function vx({run:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(Date.now()),s=()=>R.devices().then(e=>{n(e),i(t=>t&&e.devices.length>t.before?null:t)},()=>{});if((0,v.useEffect)(()=>{s()},[]),(0,v.useEffect)(()=>{if(!r)return;let e=setInterval(()=>{o(Date.now()),s()},2e3);return()=>clearInterval(e)},[r]),!t)return null;if(!t.publicName)return(0,V.jsx)(`p`,{className:`muted`,children:`Reaching Ledung from a phone anywhere needs a relay: set "remote" with its "publicName" in the config. Then phones are paired here.`});let c=r&&r.expiresAt>a?r:null;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Phones, and other computers' Ledung pages (their tab for this computer), that reach this Ledung at https://`,t.publicName,`. Only a paired device gets in there; the sign-in link does not work there. A phone unlocks for 30 minutes at a time; a computer stays logged on until it logs out.`]}),t.devices.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`No paired devices.`}),t.devices.map(t=>(0,V.jsxs)(`div`,{className:`device-row`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{children:t.name}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,t.kind===`computer`?`computer`:`phone`,` · paired `,t.pairedVia?`through the link from ${t.pairedVia} `:``,dx(t.createdAt),` · last used `,dx(t.lastUsedAt),` · `,t.passkey?`passkey added ${dx(t.passkeyAt)}`:`no passkey`]})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeDevice(t.id),await s()}),children:`Revoke`})]},t.id)),c?(0,V.jsxs)(`div`,{className:`pairing`,children:[c.kind===`phone`&&(0,V.jsx)(fx,{text:ex(c.url)}),c.kind===`computer`?(0,V.jsxs)(`p`,{className:`muted`,children:[`On the other computer, click this computer's tab and type the code, or the link, into the field there. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey there and log on: it stays logged on until you log out.`]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`Scan it with the phone, or open this link on it. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey on the phone, in its Settings → Remote & devices → Phones.`]}),c.kind===`computer`&&(0,V.jsx)(`p`,{className:`pair-code`,children:(0,V.jsx)(`b`,{children:new URL(c.url).pathname.split(`/`).pop().toUpperCase()})}),(0,V.jsx)(`code`,{className:`pair-link`,children:c.url})]}):(0,V.jsx)(`p`,{className:`device-pair-buttons`,children:[`phone`,`computer`].map(n=>(0,V.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.pairDevice(n);o(Date.now()),i({...e,before:t.devices.length})}),children:n===`phone`?`Pair a phone`:`Pair a computer`},n))})]})}var yx=e=>e?new Date(e).toLocaleString():`never`;function bx({run:e}){let t=B(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(Date.now()),f=()=>R.links().then(e=>{r(e),a(t=>t&&e.links.length>t.before?null:t)},()=>r(null));if((0,v.useEffect)(()=>{f()},[]),(0,v.useEffect)(()=>{if(!i)return;let e=setInterval(()=>{d(Date.now()),f()},2e3);return()=>clearInterval(e)},[i]),!n)return null;let p=i&&i.expiresAt>u?i:null;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Linked computers`}),n.problem?(0,V.jsx)(`p`,{className:`muted`,children:n.problem}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Your other computers' Ledungs this one is linked with. Their managers will reach this computer's managers as if they ran here; the link goes end to end through the relay, which can't read it.`}),n.links.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`No linked computers.`}),n.links.map(t=>(0,V.jsxs)(`div`,{className:`device-row`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{children:t.name}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,t.publicName,` · linked `,yx(t.linkedAt),` · last heard from `,yx(t.lastUsedAt)]})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.unlink(t.id),await f()}),children:`Unlink`})]},t.id)),p?(0,V.jsxs)(`div`,{className:`pairing`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Paste this in Settings → Linked computers on the other computer. It works once, for `,Math.max(0,Math.ceil((p.expiresAt-u)/6e4)),` more minute(s).`]}),(0,V.jsx)(`code`,{className:`pair-link`,children:p.code}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void navigator.clipboard?.writeText(p.code),children:`Copy`})]}):(0,V.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.linkCode();d(Date.now()),a({...e,before:n.links.length})}),children:`Link a computer`}),(0,V.jsxs)(`div`,{className:`link-join`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Or link with a code made on the other computer:`}),(0,V.jsx)(`input`,{type:`text`,...t,value:o,placeholder:`name.example.com/…`,"aria-label":`Link code from the other computer`,onChange:e=>s(e.target.value)}),(0,V.jsx)(`input`,{type:`text`,...t,value:c,maxLength:40,placeholder:`Its name here, e.g. PC`,"aria-label":`Name for the other computer`,onChange:e=>l(e.target.value)}),(0,V.jsx)(`button`,{disabled:!o.trim(),onClick:()=>void e(async()=>{await R.joinLink(o.trim(),c.trim()),s(``),l(``),await f()}),children:`Link`})]})]})]})}function xx({computers:e,run:t}){return e.length?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Computers`}),(0,V.jsx)(`p`,{className:`muted`,children:e.length>1?`The tabs at the top of the page, this computer first. A name or colour changed here is this Ledung's; the config's are where they start.`:`Tabs show at the top of the page when the config lists more than one computer. The name is also the remote frame's label.`}),e.map(e=>(0,V.jsx)(Sx,{computer:e,run:t},e.id))]}):null}function Sx({computer:e,run:t}){let n=B(),[r,i]=(0,v.useState)(e.name);(0,v.useEffect)(()=>i(e.name),[e.name]);let a=e.name!==e.config.name||e.colour!==e.config.colour,o=r.trim()!==e.name,s=()=>t(()=>R.editComputer(e.id,{name:r.trim()||null})),c=e.here?`${e.name} (this computer)`:e.name;return(0,V.jsxs)(`div`,{className:`computer-row`,role:`group`,"aria-label":`Computer ${c}`,children:[(0,V.jsxs)(`div`,{className:`computer-name`,children:[(0,V.jsx)(`input`,{type:`text`,...n,value:r,maxLength:24,"aria-label":`Name of ${c}`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o&&s()}}),o&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void s(),children:`Save`}),e.here&&(0,V.jsx)(`span`,{className:`muted`,children:`This computer`}),a&&!o&&(0,V.jsx)(`button`,{className:`small`,title:`Back to ${e.config.name} in ${Et[e.config.colour].label.toLowerCase()}, as the config has it`,onClick:()=>void t(()=>R.editComputer(e.id,{name:null,colour:null})),children:`Use the config's`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:Ot.map(n=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${e.colour===n?` on`:``}`,"aria-pressed":e.colour===n,title:Et[n].label,"aria-label":`${c}: ${Et[n].label}`,onClick:()=>void t(()=>R.editComputer(e.id,{colour:n})),children:(0,V.jsx)(fp,{colour:n,children:`●`})},n))})]})}function Cx(e){let t=/^(\d+)\.(\d+)\.0$/.exec(e);return t?t[2]===`0`?`v${t[1]}`:`v${t[1]}.${t[2]}`:`v${e}`}var wx=new Set,Tx=ft(localStorage),Ex=e=>{Tx=e;for(let e of wx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.statusDot`||e.key===null)&&Ex(ft(localStorage))});var Dx=e=>(wx.add(e),()=>{wx.delete(e)}),Ox=()=>Tx;function kx(){return[(0,v.useSyncExternalStore)(Dx,Ox),e=>{pt(un,e),Ex(e)}]}var Ax=new Set,jx=St(localStorage),Mx=e=>{jx=e;for(let e of Ax)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.compactSidebar`||e.key===null)&&Mx(St(localStorage))});var Nx=e=>(Ax.add(e),()=>{Ax.delete(e)}),Px=()=>jx;function Fx(){return[(0,v.useSyncExternalStore)(Nx,Px),e=>{Ct(un,e),Mx(e)}]}var Ix=new Set,Lx=gt(localStorage),Rx=e=>{Lx=e;for(let e of Ix)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.archivedLink`||e.key===null)&&Rx(gt(localStorage))});var zx=e=>(Ix.add(e),()=>{Ix.delete(e)}),Bx=()=>Lx;function Vx(){return[(0,v.useSyncExternalStore)(zx,Bx),e=>{_t(un,e),Rx(e)}]}var Hx=`ledung.installDismissed`,Ux=(e,t)=>/Macintosh/.test(e)&&/Safari\//.test(e)&&!/Chrome|Chromium|CriOS|Edg|OPR|Firefox|FxiOS/.test(e)&&t<=1,Wx=(e,t)=>/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&t>1,Gx=e=>/Chrome|Chromium|Edg\//.test(e);function Kx(e){return e.standalone||e.installed?{kind:`none`}:e.framed?{kind:`none`,reason:`Install this computer's own page, opened in a tab of its own.`}:e.offer?{kind:`button`}:e.refused?{kind:`none`,reason:`Refused for now. Reload the page to be offered it again.`}:Ux(e.userAgent,e.maxTouchPoints)?{kind:`dock`}:Wx(e.userAgent,e.maxTouchPoints)?{kind:`none`,reason:`On an iPhone or iPad, use Share → Add to Home Screen in Safari.`}:e.secure?Gx(e.userAgent)?{kind:`none`,reason:`The browser isn't offering to install this page: it is installed already, or not allowed here. The install icon in the address bar says which.`}:{kind:`none`,reason:`This browser can't install pages as apps; Edge, Chrome and Safari on macOS can.`}:{kind:`none`,reason:`Browsers offer installing only a page at 127.0.0.1 or over HTTPS; this one is plain http.`}}function qx(e){try{return e.getItem(Hx)===`1`}catch{return!1}}function Jx(e){try{e.setItem(Hx,`1`)}catch{}}var Yx=(e,t)=>!t&&e.kind!==`none`,Xx=matchMedia(`(display-mode: standalone)`),Zx=null,Qx=!1,$x=!1,eS=qx(localStorage),tS=new Set,nS=()=>Kx({standalone:Xx.matches||navigator.standalone===!0,installed:Qx,offer:Zx!==null,refused:$x,framed:Vt(),secure:window.isSecureContext,userAgent:navigator.userAgent,maxTouchPoints:navigator.maxTouchPoints??0}),rS={install:nS(),notice:!1},iS=()=>{let e=nS();rS={install:e,notice:Yx(e,eS)};for(let e of tS)e()};rS.notice=Yx(rS.install,eS),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),Zx=e,$x=!1,iS()}),window.addEventListener(`appinstalled`,()=>{Qx=!0,Zx=null,iS()}),Xx.addEventListener(`change`,iS),window.addEventListener(`storage`,e=>{(e.key===`ledung.installDismissed`||e.key===null)&&(eS=qx(localStorage),iS())});var aS=e=>(tS.add(e),()=>{tS.delete(e)}),oS=()=>rS;async function sS(){let e=Zx;e&&(Zx=null,await e.prompt(),(await e.userChoice).outcome===`accepted`?Qx=!0:$x=!0,iS())}var cS=()=>{Jx(localStorage),eS=!0,iS()};function lS(){return{...(0,v.useSyncExternalStore)(aS,oS),onInstall:sS,onDismiss:cS}}var uS=(0,V.jsxs)(V.Fragment,{children:[`In Safari, choose `,(0,V.jsx)(`b`,{children:`File → Add to Dock`}),`.`]});function dS({app:e,run:t}){return(0,V.jsxs)(`div`,{className:`banner install`,children:[(0,V.jsxs)(`span`,{children:[`Ledung can run as an app, in a window of its own.`,e.install.kind===`dock`&&(0,V.jsxs)(V.Fragment,{children:[` `,uS]})]}),e.install.kind===`button`&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void t(e.onInstall),children:`Install as app`}),(0,V.jsx)(`button`,{className:`small`,onClick:e.onDismiss,children:`Not now`})]})}function fS({run:e}){let t=lS(),{install:n}=t;return n.kind===`none`&&!n.reason?null:(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`App`}),(0,V.jsx)($p,{kind:`browser`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`Ledung in a window of its own, with its own icon, instead of a browser tab.`}),n.kind===`button`&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>void e(t.onInstall),children:`Install as app`}),n.kind===`dock`&&(0,V.jsx)(`p`,{children:uS}),n.kind===`none`&&(0,V.jsx)(`p`,{className:`muted`,children:n.reason})]})}function pS(e,t){return!!e&&!t&&e.available&&!e.asked&&e.places.length>0&&!e.places.some(e=>e.present)}function mS(e){let t=e.places.map(e=>e.label);return t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}function hS(e){return e.kind===`mac`?`Add a Ledung icon to ${mS(e)}?`:`Add a Ledung icon to your ${mS(e)}?`}var gS={desktop:`on your Desktop`,"start-menu":`in the Start menu`,applications:`in Applications`};function _S(e){let t=e.places.map(e=>gS[e.id]??`in ${e.label}`);return`A Ledung icon ${t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}.`}var vS=`It opens this page, and starts Ledung first if it isn't running.`,yS=null,bS=null,xS=new Set,SS=e=>{yS=e;for(let e of xS)e()};function CS(){return bS??=R.shortcuts().then(SS,()=>SS(null)),bS}var wS=e=>(xS.add(e),()=>{xS.delete(e)});function TS(){return(0,v.useEffect)(()=>void CS(),[]),{view:(0,v.useSyncExternalStore)(wS,()=>yS),act:async e=>SS(await R.shortcutsAct(e))}}function ES({run:e}){let{view:t,act:n}=TS(),[r,i]=(0,v.useState)(!1);if(!t||!pS(t,Vt()))return null;let a=t=>e(async()=>{await n(t),r&&await n(`sign-in-on`)});return(0,V.jsxs)(`div`,{className:`banner install`,children:[(0,V.jsxs)(`span`,{children:[hS(t),` `,vS]}),t.signIn.available&&!t.signIn.on&&(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` `,t.signIn.label]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void a(`add`),children:`Yes`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void a(`decline`),children:`No`})]})}function DS({run:e}){let{view:t,act:n}=TS();if(!t)return null;let r=t.places.filter(e=>!e.present),i=t.places.filter(e=>e.present);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Shortcuts`}),t.available?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[_S(t),` `,vS,` Ledung then runs in the background, with no window; Stop Ledung below stops it.`]}),(0,V.jsx)(`ul`,{className:`shortcut-places`,children:t.places.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`b`,{children:e.label}),` `,(0,V.jsx)(`span`,{className:`muted`,children:e.present?`added`:`not there`})]},e.id))}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[r.length>0&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void e(()=>n(`add`)),children:`Add shortcuts`}),i.length>0&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(()=>n(`remove`)),children:`Remove`})]})]}):(0,V.jsx)(`p`,{className:`muted`,children:t.reason})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Start at sign-in`}),t.signIn.available?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:t.signIn.file??void 0,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:t.signIn.on,onChange:t=>void e(()=>n(t.target.checked?`sign-in-on`:`sign-in-off`))}),` `,t.signIn.label]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung starts in the background, without opening its page; open it with the icon or the `,(0,V.jsx)(`code`,{children:`ledung`}),` command. Only for you, and no administrator rights are needed.`]})]}):(0,V.jsx)(`p`,{className:`muted`,children:t.signIn.reason})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Log`}),(0,V.jsxs)(`p`,{className:`muted`,children:[t.log.active?`This Ledung runs in the background; what it says goes to`:`Started in the background, Ledung writes what it says to`,` `,(0,V.jsx)(`code`,{children:t.log.file}),t.log.active?`.`:`. This one was started in a terminal or window, so it says it there.`]})]})]})}function OS(){let{view:e}=TS(),[t,n]=(0,v.useState)(`idle`);return!e||Vt()?null:(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Stop Ledung`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Stops Ledung and its sessions; resume a session after the next start to continue it. Start Ledung again with its icon or the `,(0,V.jsx)(`code`,{children:`ledung`}),` command.`]}),t===`stopped`?(0,V.jsx)(`p`,{children:`Ledung has stopped. This page stays as it was until Ledung runs again.`}):t===`confirming`?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Running sessions stop.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:async()=>{try{await R.stopLedung(),n(`stopped`)}catch{n(`failed`)}},children:`Stop Ledung`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(`idle`),children:`Cancel`})]}):(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[t===`failed`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`Ledung refused to stop.`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(`confirming`),children:`Stop Ledung`})]})]})}function kS(e){return e===`token`?`Signed in with a long-lived token`:e===`login`?`Signed in with /login`:e===`key`?`Signed in with an API key`:e===`other`?`Signed in`:`Not signed in, or not checked yet`}function AS(e){return!e||!e.email&&!e.organization?`not seen yet: shown after its first session starts`:[e.email,e.organization,e.plan].filter(Boolean).join(` · `)+(e.seenAt?` (seen ${Eg(e.seenAt)})`:``)}function jS({text:e}){return(0,V.jsxs)(`div`,{className:`sign-in-command`,children:[(0,V.jsx)(`code`,{className:`remote-record`,children:e}),` `,(0,V.jsx)(Df,{text:e})]})}function MS({command:e}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With a long-lived token: get one with `,(0,V.jsx)(`span`,{className:`mono`,children:`claude setup-token`}),`, then run this in your own terminal on this computer and paste it. It goes straight into Claude Code's sign-in; Ledung never receives it.`]}),(0,V.jsx)(jS,{text:e})]})}function NS(e){let t=B(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),c=t=>[...e.projects.filter(e=>e.account===t).map(e=>e.name),...e.choices.chats===t?[`chats`]:[]].join(`, `)||`no project`,l=t=>(0,V.jsxs)(`select`,{value:e.choices[t]??``,onChange:n=>void e.run(()=>R.setAccountChoices({[t]:n.target.value||null})),children:[(0,V.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(e=>(0,V.jsxs)(`option`,{value:e.name,children:[e.name,e.email?` (${e.email})`:``]},e.name))]});return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Accounts`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Each project uses one account, for its manager and all its sessions; chats use the one chosen below. Ledung never moves work between accounts. Accounts can also be listed under `,(0,V.jsx)(`span`,{className:`mono`,children:`claudeAccounts`}),` in the config file (see ledung.config.example.json).`]}),e.configFileProblems.map(e=>(0,V.jsx)(`div`,{className:`banner`,children:e},e)),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Account`}),(0,V.jsx)(`th`,{children:`Logged in as`}),(0,V.jsx)(`th`,{children:`Used by`}),(0,V.jsx)(`th`,{})]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:`default`}),(0,V.jsx)(`div`,{className:`muted`,children:`this computer's own Claude Code login`})]}),(0,V.jsxs)(`td`,{children:[AS(e.defaultIdentity),(0,V.jsx)(`div`,{className:`muted`,children:kS(e.defaultIdentity?.signInKind)})]}),(0,V.jsx)(`td`,{children:c(null)}),(0,V.jsx)(`td`,{})]}),e.accounts.map(t=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:t.name}),t.whatItIsFor&&(0,V.jsx)(`div`,{children:t.whatItIsFor}),t.inConfigFile&&(0,V.jsx)(`div`,{className:`muted`,children:`set in the config file: to remove it for good, take it out there too, or it comes back at the next start`}),(0,V.jsxs)(`div`,{className:`muted`,children:[`sign-in folder `,(0,V.jsx)(`span`,{className:`mono`,children:t.configDir})]}),(0,V.jsxs)(`div`,{className:`muted`,children:[`in containers `,(0,V.jsx)(`span`,{className:`mono`,children:t.containerDir??`~/.ledung-accounts/${t.name}`})]})]}),(0,V.jsxs)(`td`,{children:[AS(t),(0,V.jsx)(`div`,{className:`muted`,children:kS(t.signInKind)})]}),(0,V.jsx)(`td`,{children:c(t.name)}),(0,V.jsxs)(`td`,{className:`account-actions`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:e.remote,title:e.remote?`Only on the computer Ledung runs on`:`Show ${t.configDir}`,onClick:()=>void e.run(()=>R.openAccountFolder(t.name)),children:`Open folder`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>R.removeAccount(t.name)),children:`Remove`})]})]}),(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:4,children:(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`muted`,children:`Sign in, or change how it is signed in`}),t.loginCommand&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]}),(0,V.jsx)(jS,{text:t.loginCommand})]}),t.tokenCommand&&(0,V.jsx)(MS,{command:t.tokenCommand}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Either one replaces the sign-in that is there. For a project in a container, sign in inside the container with `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]})]})})})]},t.name))]})]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>R.checkSignIn()),children:`Check again`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`after signing in from a terminal, to see it here`})]}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Account for chats `,(0,V.jsx)(`span`,{className:`muted`,children:`(new chats run on it; a running chat keeps its account until it restarts)`}),l(`chats`)]}),(0,V.jsxs)(`label`,{children:[`Account for new projects `,(0,V.jsx)(`span`,{className:`muted`,children:`(chosen for you in Add project)`}),l(`newProjects`)]})]}),(0,V.jsx)(`h4`,{children:`Add an account`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Name `,(0,V.jsx)(`span`,{className:`muted`,children:`(e.g. personal, work)`}),(0,V.jsx)(`input`,{...t,value:n,onChange:e=>r(e.target.value),maxLength:32})]}),(0,V.jsxs)(`label`,{children:[`Sign-in folder in containers `,(0,V.jsx)(`span`,{className:`muted`,children:`(optional; default ~/.ledung-accounts/<name> in the container user's home, or a mounted folder so the sign-in survives a rebuild)`}),(0,V.jsx)(`input`,{...t,value:i,onChange:e=>a(e.target.value),className:`mono`,placeholder:`~/.ledung-accounts/name`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung makes a folder for this account's Claude Code sign-in, and only that: conversations, memory, skills and settings stay the same for every account, so moving a project to another account changes only whose plan and limits it uses. After adding it, sign in once with Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),` as shown (for a container project, inside the container), or put in a long-lived token with the command shown. Ledung never sees or keeps a sign-in token.`]}),(0,V.jsx)(`button`,{className:`primary`,disabled:!n.trim(),onClick:()=>void e.run(async()=>{s(await R.addAccount({name:n.trim(),...i.trim()?{containerDir:i.trim()}:{}})),a(``),r(``)}),children:`Add account`})]}),o&&(0,V.jsxs)(`div`,{className:`banner`,children:[`Added `,(0,V.jsx)(`strong`,{children:o.name}),`. Choose it in a project's settings (⚙ next to the project), or above for chats and new projects.`,` `,`Now sign in once. With Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),` and sign in with this account.`,o.loginCommand&&(0,V.jsx)(jS,{text:o.loginCommand}),`For a container project, the same inside the container:`,(0,V.jsx)(`pre`,{className:`mono`,children:`docker exec -it <container> sh -c 'CLAUDE_SECURESTORAGE_CONFIG_DIR=${(o.containerDir??`~/.ledung-accounts/${o.name}`).replace(/^~\//,`$HOME/`)} exec claude'`}),o.tokenCommand&&(0,V.jsx)(MS,{command:o.tokenCommand})]})]})]})}var PS=4e3,FS=[`Ctrl`,`Alt`,`Shift`,`Cmd`],IS=/^(?:(?:Ctrl|Alt|Shift|Cmd)\+)+(?:[A-Z]|[0-9])$/;function LS(e){let t=/^(?:Key([A-Z])|Digit([0-9]))$/.exec(e.code);if(!t)return null;let n=[e.ctrlKey&&`Ctrl`,e.altKey&&`Alt`,e.shiftKey&&`Shift`,e.metaKey&&`Cmd`].filter(Boolean);return n.length?`${n.join(`+`)}+${t[1]??t[2]}`:null}function RS(e){if(!IS.test(e))return!1;let t=e.split(`+`).slice(0,-1);return t.every((e,n)=>n===0||FS.indexOf(e)>FS.indexOf(t[n-1]))}function zS(e,t){if(!t)return e;let n={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Cmd:`⌘`},r=e.split(`+`);return r.slice(0,-1).map(e=>n[e]??e).join(``)+r[r.length-1]}function BS(e,t,n){if(!RS(e))return{refused:`A keybind is Ctrl, Alt or Cmd with a letter or a digit.`};let r=new Set(e.split(`+`).slice(0,-1)),i=e.split(`+`).pop(),a=/^[0-9]$/.test(i),o=t.find(t=>t.key===e&&t.id!==n);return o?{refused:`“${o.name}” has this keybind.`}:!r.has(`Ctrl`)&&!r.has(`Alt`)&&!r.has(`Cmd`)?{refused:`Shift alone types; add Ctrl or Alt.`}:r.has(`Cmd`)?{refused:`Cmd keys belong to the browser and the Mac, and Windows has none.`}:r.has(`Ctrl`)&&r.has(`Alt`)?{refused:`Ctrl+Alt is AltGr on Windows, which types @, { and [ on many keyboards.`}:e===`Ctrl+O`?{refused:`Ctrl+O shows and hides tool calls in Ledung.`}:r.has(`Ctrl`)&&!a?{refused:`${e} is the browser's or the message box's (new tab, copy, find, developer tools…).`}:r.has(`Ctrl`)&&!r.has(`Shift`)?{warning:`On Windows and Linux ${e} switches browser tabs: there it does nothing.`}:r.has(`Alt`)&&!r.has(`Shift`)&&[`D`,`E`,`F`].includes(i)?{refused:`${e} opens the browser's menu or address bar on Windows.`}:r.has(`Alt`)?{warning:`On a Mac ⌥ types a character with this key (⌥2 is @ on a Swedish keyboard): the keybind takes it away there.${a&&!r.has(`Shift`)?` On Linux Alt+1–9 switch browser tabs.`:``}`}:null}function VS(e,t,n=3){let r=[];for(let i of`123456789`){let a=`Ctrl+Shift+${i}`;if(BS(a,e,t)||r.push(a),r.length===n)break}return r}function HS(e,t){return e.filter(e=>e.project===null||e.project===t)}var US=[`issue`,`branch`,`pr`,`project`,`session`];function WS(e,t){let n=t.branch?/(?:^|[/_-])(\d+)(?=$|[/_-])/.exec(t.branch)?.[1]:void 0,r={issue:t.tickets[0]?.id??(n?`#${n}`:void 0),branch:t.branch??void 0,pr:t.pr?`#${t.pr.number}`:void 0,project:S(t.project),session:t.title},i=[];return{text:e.replace(/\{(issue|branch|pr|project|session)\}/g,(e,t)=>{let n=r[t];return n===void 0?(i.includes(t)||i.push(t),e):n}),missing:i}}function GS(e,t,n){return!(n?!e.send:e.send)||t.missing.length||t.text.trimStart().startsWith(`!`)?`insert`:`send`}function KS(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function qS(e){if(e.length>50)return`At most 50 macros.`;let t=new Set,n=new Map;for(let r of e){if(!/^[a-z0-9-]{1,40}$/.test(r.id)||t.has(r.id))return`A macro has no id of its own.`;t.add(r.id);let e=r.name.trim();if(!e||e.length>40)return`A macro's name is 1 to 40 characters.`;if(!r.text.trim()||r.text.length>4e3)return`“${e}”: the text is 1 to ${PS} characters.`;if(!r.chip&&!r.key)return`“${e}” has neither a chip nor a keybind, so nothing could use it.`;if(r.key!==null){let t=BS(r.key,[],null);if(t&&`refused`in t)return`“${e}”: ${t.refused}`;let i=n.get(r.key);if(i)return`“${e}” and “${i}” have the same keybind.`;n.set(r.key,e)}}return null}var JS=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);function YS(e,t){let n=e.send?`Sends`:`Puts in the message box`,r=e.key?` · ${zS(e.key,t)}`:``;return`${n}: ${e.text}${r}\nShift+click: ${e.send?`put it in the message box`:`send it`}`}function XS(e){let t=e.macros.filter(e=>e.chip),n=e.macros.filter(e=>!e.chip),r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(t.length),[s,c]=(0,v.useState)(!1),l=JS();if((0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=[...e.children],n=t[0]?.offsetTop??0;o(t.filter(e=>e.offsetTop===n).length)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t.map(e=>e.id+e.name).join(`|`)]),(0,v.useEffect)(()=>{if(!s)return;let e=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!i.current?.contains(e.target))&&c(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[s]),!e.macros.length)return null;let u=[...t.slice(a),...n],d=(t,n)=>{c(!1),e.onUse(t,n)};return(0,V.jsxs)(`span`,{className:`macro-bar`,ref:i,children:[(0,V.jsx)(`span`,{className:`macro-chips`,ref:r,children:t.map((e,t)=>(0,V.jsxs)(`button`,{className:`board-chip macro-chip`,title:YS(e,l),tabIndex:t<a?0:-1,"aria-hidden":t<a?void 0:!0,onClick:t=>d(e,t.shiftKey),children:[e.name,e.send&&(0,V.jsx)(`span`,{className:`macro-send`,"aria-label":`sends`,children:` ↵`})]},e.id))}),(0,V.jsx)(`button`,{className:`board-chip macro-chip macro-more${s?` on`:``}`,"aria-expanded":s,"aria-haspopup":`menu`,title:u.length?`${u.length} more macro${u.length===1?``:`s`}`:`Edit macros`,onClick:()=>c(e=>!e),children:u.length?`+${u.length}`:`+`}),s&&(0,V.jsxs)(`div`,{className:`macro-menu`,role:`menu`,children:[u.map(e=>(0,V.jsxs)(`button`,{role:`menuitem`,title:YS(e,l),onClick:t=>d(e,t.shiftKey),children:[(0,V.jsxs)(`span`,{children:[e.name,e.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}),e.key?(0,V.jsx)(`kbd`,{children:zS(e.key,l)}):(0,V.jsx)(`span`,{})]},e.id)),u.length>0&&(0,V.jsx)(`hr`,{}),(0,V.jsx)(`button`,{role:`menuitem`,className:`muted`,onClick:()=>{c(!1),e.onEdit()},children:`Edit macros…`})]})]})}var ZS=()=>`m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,QS=(e,t)=>e!==null&&e!==`~chats`&&!t.some(t=>t.name===e),$S=(e,t)=>e===null?`Global`:`${S(e)}${QS(e,t)?` (removed)`:``}`;function eC(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=JS(),o=t=>e.run(()=>R.setMacros(t)),s=t&&e.macros.some(e=>e.id===t.id)?t.id:null;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`div`,{className:`settings-h`,children:(0,V.jsx)(`h3`,{children:`Macros`})}),(0,V.jsx)(`p`,{className:`muted`,children:`Text you send often, as a chip in a session's info bar, a keybind, or both. Kept by Ledung, so your phone and other browsers have them too.`}),e.macros.length>0&&(0,V.jsx)(`ul`,{className:`macro-list`,children:e.macros.map((t,c)=>(0,V.jsxs)(`li`,{className:`${t.id===s?`on`:``}${r===c?` dragged`:``}`,draggable:!0,onDragStart:()=>i(c),onDragEnd:()=>i(null),onDragOver:e=>e.preventDefault(),onDrop:t=>{t.preventDefault(),r!==null&&r!==c&&o(KS(e.macros,r,c)),i(null)},children:[t.chip?(0,V.jsxs)(`span`,{className:`board-chip macro-chip static`,children:[t.name,t.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}):(0,V.jsxs)(`span`,{className:`macro-keyonly`,title:`No chip: this one is on its keybind only`,children:[t.name,t.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`· keybind only`})]}),(0,V.jsx)(`span`,{className:`mono macro-text`,title:t.text,children:t.text}),(0,V.jsx)(`span`,{className:`muted macro-what`,children:t.send?`Sends`:`Inserts`}),t.key?(0,V.jsx)(`kbd`,{children:zS(t.key,a)}):(0,V.jsx)(`span`,{className:`muted macro-nokey`,children:`no key`}),(0,V.jsx)(`span`,{className:`chip macro-scope`,title:$S(t.project,e.projects),children:$S(t.project,e.projects)}),(0,V.jsx)(`span`,{className:`macro-move`,title:`Drag to reorder`,"aria-hidden":!0,children:`⋮⋮`}),(0,V.jsxs)(`span`,{className:`macro-row-buttons`,children:[c>0&&(0,V.jsx)(`button`,{className:`small macro-up`,title:`Move up`,"aria-label":`Move ${t.name} up`,onClick:()=>void o(KS(e.macros,c,c-1)),children:`↑`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n({...t}),children:`Edit`})]})]},t.id))}),t?(0,V.jsx)(tC,{draft:t,macros:e.macros,projects:e.projects,mac:a,isNew:!s,onCancel:()=>n(null),onSave:async t=>{let r=s?e.macros.map(e=>e.id===t.id?t:e):[...e.macros,t];await o(r),n(null)},onDelete:s?async()=>{await o(e.macros.filter(e=>e.id!==t.id)),n(null)}:void 0},t.id):(0,V.jsx)(`button`,{className:`primary`,onClick:()=>n({id:ZS(),name:``,text:``,send:!1,key:null,chip:!0,project:null}),children:`Add macro`})]})}function tC(e){let[t,n]=(0,v.useState)(e.draft),[r,i]=(0,v.useState)(e.draft.key!==null),[a,o]=(0,v.useState)(!1),s=B(),c=e=>n(t=>({...t,...e})),l=r?t.key:null,u=l?BS(l,e.macros,t.id):null,d={...t,key:l},f=qS([d]),p=VS(e.macros,t.id),m=!t.name.trim()||!t.text.trim()||r&&!t.key||!!u&&`refused`in u||!!f;return(0,V.jsxs)(`div`,{className:`form macro-form`,children:[(0,V.jsx)(`h4`,{children:e.isNew?`New macro`:`Edit “${e.draft.name}”`}),(0,V.jsxs)(`label`,{children:[`Name`,(0,V.jsx)(`input`,{...s,value:t.name,maxLength:40,placeholder:`Run checks`,onChange:e=>c({name:e.target.value})})]}),(0,V.jsxs)(`label`,{children:[`Text`,(0,V.jsx)(`textarea`,{...s,rows:3,value:t.text,placeholder:`Run the checks and tell me what fails.`,onChange:e=>c({text:e.target.value})}),(0,V.jsxs)(`span`,{className:`muted macro-hint`,children:[`Placeholders: `,US.map(e=>(0,V.jsxs)(`code`,{children:[`{${e}}`,` `]},e)),`filled from the session. One it has no value for is not sent: the text goes into the message box instead.`]})]}),(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`When used`}),(0,V.jsxs)(`span`,{className:`segmented macro-seg`,children:[(0,V.jsx)(`button`,{className:`small${t.send?``:` on`}`,"aria-pressed":!t.send,onClick:()=>c({send:!1}),children:`Put it in the message box`}),(0,V.jsx)(`button`,{className:`small${t.send?` on`:``}`,"aria-pressed":t.send,onClick:()=>c({send:!0}),children:`Send it at once`})]}),(0,V.jsx)(`span`,{className:`muted macro-hint`,children:`Shift+click a chip for the other one. A text starting with ! always goes into the box.`})]}),(0,V.jsxs)(`label`,{children:[`Where`,(0,V.jsxs)(`select`,{value:t.project??``,onChange:e=>c({project:e.target.value||null}),children:[(0,V.jsx)(`option`,{value:``,children:`Global (every project)`}),e.projects.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.name},e.name)),QS(e.draft.project,e.projects)&&(0,V.jsx)(`option`,{value:e.draft.project,children:$S(e.draft.project,e.projects)}),(0,V.jsx)(`option`,{value:x,children:`Chats`})]})]}),(0,V.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:t.chip,onChange:e=>c({chip:e.target.checked})}),` Show as a chip in the info bar`]}),(0,V.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>{i(e.target.checked),e.target.checked&&!t.key&&c({key:p[0]??null})}}),` Keybind`]}),r&&(0,V.jsxs)(`div`,{className:`macro-sub`,children:[(0,V.jsxs)(`span`,{className:`macro-keyrow`,children:[(0,V.jsx)(`input`,{...s,className:`mono macro-keyin${u&&`refused`in u?` bad`:``}`,readOnly:!0,"aria-label":`Keybind`,value:a?`Press the keys…`:t.key?zS(t.key,e.mac):``,onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{if(e.key===`Tab`||e.key===`Escape`)return;e.preventDefault();let t=LS(e.nativeEvent);t&&(c({key:t}),e.target.blur())}}),(0,V.jsx)(`span`,{className:`muted macro-hint`,children:a?`Ctrl, Alt or Cmd with a letter or a digit`:`Click the box, then press the keys.`})]}),u&&`refused`in u&&(0,V.jsx)(`span`,{className:`macro-conflict`,role:`alert`,children:u.refused}),u&&`warning`in u&&(0,V.jsx)(`span`,{className:`macro-warning`,children:u.warning}),u&&p.length>0&&(0,V.jsxs)(`span`,{className:`macro-hint`,children:[`Free: `,p.map(t=>(0,V.jsx)(`button`,{className:`link macro-free`,onClick:()=>c({key:t}),children:(0,V.jsx)(`kbd`,{children:zS(t,e.mac)})},t))]}),!u&&(0,V.jsx)(`span`,{className:`muted macro-hint`,children:`Works in the message box too. A phone has no keys: there it is in the info bar's + menu.`})]}),!t.chip&&!r&&(0,V.jsx)(`span`,{className:`macro-conflict`,children:`With neither a chip nor a keybind nothing could use it.`}),(0,V.jsxs)(`div`,{className:`macro-keyrow`,children:[(0,V.jsx)(`button`,{className:`primary`,disabled:m,onClick:()=>void e.onSave(d),children:`Save`}),(0,V.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),e.onDelete&&(0,V.jsx)(`button`,{className:`deny macro-delete`,onClick:()=>void e.onDelete(),children:`Delete`})]})]})}function nC(e){let t=Bp(im),n=xp(e.view,t),r={update:Mp(e.update.view),remote:Ap(e.remote),notifications:e.notify.possible&&!e.notify.on&&!Vt()?`off`:``};return(0,V.jsx)(em,{groups:gp,current:n,words:r,narrow:t,onOpen:t=>e.onOpen(t===null?`settings`:vp(t)),children:n!==null&&(0,V.jsx)(rC,{group:n,...e})})}function rC(e){switch(e.group){case`update`:{let t=jp(e.update.view);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Update Ledung`}),t.update&&(0,V.jsx)(`p`,{className:`muted`,children:t.update}),(0,V.jsx)(hC,{update:e.update})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Restart Ledung`}),(0,V.jsx)(`p`,{className:`muted`,children:t.restart}),!!e.config?.restartFor.length&&(0,V.jsx)(`p`,{className:`config-restart`,children:aC(e.config)}),e.canRestart?(0,V.jsx)(Qp,{hellos:e.hellos}):(0,V.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]}),(0,V.jsx)(OS,{}),(0,V.jsx)(DS,{run:e.run})]})}case`claude`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(NS,{accounts:e.accounts,choices:e.accountChoices,defaultIdentity:e.defaultIdentity,configFileProblems:e.accountProblems,projects:e.projects,run:e.run,remote:e.throughPublicName}),(0,V.jsx)(jy,{accounts:e.accounts,usageStops:e.usageStops,run:e.run}),(0,V.jsx)(kb,{sessions:e.sessions}),(0,V.jsx)(Ff,{accounts:e.accounts,run:e.run})]});case`sessions`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(dp,{run:e.run}),(0,V.jsx)(bb,{})]});case`macros`:return(0,V.jsx)(eC,{macros:e.macros,projects:e.projects,run:e.run});case`remote`:return(0,V.jsx)(iC,{...e});case`look`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Appearance`}),(0,V.jsx)($p,{kind:`browser`})]}),(0,V.jsx)(fC,{})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Typing`}),(0,V.jsx)($p,{kind:`browser`})]}),(0,V.jsx)(cC,{})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Sidebar`}),(0,V.jsx)($p,{kind:`browser`})]}),(0,V.jsx)(lC,{}),(0,V.jsx)(uC,{}),(0,V.jsx)(dC,{})]}),(0,V.jsx)(fS,{run:e.run})]});case`notifications`:return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Notifications`}),(0,V.jsx)($p,{kind:`browser`})]}),(0,V.jsx)(sC,{notify:e.notify,linked:e.computers.some(e=>e.linked)})]});case`config`:return e.config?(0,V.jsx)(oC,{config:e.config}):(0,V.jsx)(`p`,{className:`muted`,children:`…`});default:return(0,V.jsx)(yC,{source:e.source,update:e.update})}}function iC(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.relayAdmin().then(n,()=>n(null))},[]);let a=kp({remote:e.remote,relaySetUp:t?Zv(t):null,boardConfigured:!!e.board?.configured}),o=t&&(0,V.jsx)(Xv,{view:t,onView:n,run:e.run,newComputers:e.newComputers}),s=e.projects[0]?.name,c=[{id:`remote`,name:`Remote access`,state:a.remote,why:`Reach this Ledung from your phone, anywhere, through a relay.`,form:(0,V.jsx)(_C,{remote:e.remote}),primary:!0},{id:`phones`,name:`Phones`,state:a.phones,why:``},{id:`linked`,name:`Linked computers`,state:a.linked,why:``},{id:`relay`,name:`Run a relay`,state:a.relay,why:`Only if you host a relay for other people.`,form:o},{id:`board`,name:`Message board`,state:a.board,why:s?`Off in every project; turn it on in a project's tab.`:`Off; each project turns it on in its own tab.`,go:s?{label:`Projects ›`,view:Tp(s,`board`)}:void 0}].filter(e=>e.state===`off`||e.state===`needs`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(xx,{computers:e.computers,run:e.run}),a.remote===`on`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Remote access`}),(0,V.jsx)(_C,{remote:e.remote})]}),a.phones===`on`&&(0,V.jsx)(px,{run:e.run,linked:e.computers.some(e=>e.linked)},e.remote?.publicName??`none`),a.linked===`on`&&(0,V.jsx)(bx,{run:e.run},`linked-${e.remote?.publicName??`none`}-${e.remote?.tls??``}`),a.relay===`on`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Relay`}),o]}),a.board===`on`&&(0,V.jsx)(Tn,{board:e.board}),c.length>0&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),c.map(t=>r===t.id&&t.state===`off`&&t.form?(0,V.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":t.name,children:[(0,V.jsxs)(`h4`,{children:[(0,V.jsx)(`span`,{children:t.name}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Close ${t.name}`,title:`Close`,onClick:()=>i(null),children:`✕`})]}),t.form]},t.id):(0,V.jsxs)(`div`,{className:`offline${t.state===`needs`?` needs`:``}`,children:[(0,V.jsx)(`span`,{className:`offline-name`,children:t.name}),(0,V.jsx)(`span`,{className:`offline-why`,children:t.state===`needs`?`Needs remote access first.`:t.why}),t.state===`off`&&t.form&&(0,V.jsx)(`button`,{className:`small${t.primary?` primary`:``}`,onClick:()=>i(t.id),children:`Set up ›`}),t.state===`off`&&t.go&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(t.go.view),children:t.go.label})]},t.id))]})]})}function aC(e){return`Restart Ledung to apply: ${e.restartFor.join(`, `)}`}function oC(e){let t=e.config,n=new Date(t.readAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Config file`}),(0,V.jsx)($p,{kind:`config`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung reads `,(0,V.jsx)(`code`,{children:t.file}),` again whenever it changes. Most settings apply at once, to new and resumed sessions; running sessions keep what they started with. A few, such as the port and the network, need Restart Ledung.`]}),(0,V.jsx)(`p`,{children:t.reloaded?`Last reloaded ${n}.`:`Read at start, ${n}; not changed since.`}),t.problem&&(0,V.jsxs)(`p`,{className:`config-problem`,role:`alert`,children:[`The last change was not applied, the settings in use stay: `,t.problem]}),!!t.restartFor.length&&(0,V.jsx)(`p`,{className:`config-restart`,children:aC(t)})]})}function sC({notify:e,linked:t}){return Vt()?(0,V.jsx)(gx,{linked:t}):e.possible?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`A browser notification when something new needs your answer and this page is in the background`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.on,onChange:t=>void e.set(t.target.checked)}),` Send notifications when an agent is waiting for you`]}),(0,V.jsx)(`p`,{className:`muted`,children:`While a Ledung page is open in this browser.`}),e.denied&&(0,V.jsx)(`p`,{className:`muted`,children:`The browser blocks notifications for this page. Allow them in the browser's site settings (the icon left of the address), then switch this on again.`})]}):(0,V.jsx)(`p`,{className:`muted`,children:`Notifications work when this page is opened on this computer at 127.0.0.1.`})}function cC(){let[e,t]=_n();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`Off: the browser doesn't correct words as you type. Spell checking and automatic capitals are left to the browser either way`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Autocorrect`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: words stay as you type them in the message box, answers and every other text field. Spell checking and capitals are the browser's own either way.`})]})}function lC(){let[e,t]=kx();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`The coloured dot left of each session in the sidebar; the ship shows much the same`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Status dot`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: no dot on the session rows; hover a row for its status, and an ended session's name is faded.`})]})}function uC(){let[e,t]=Vx();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`The Archived (N) entry under each project in the sidebar, which opens its archived sessions`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Show "Archived" in the sidebar`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: no Archived entry under the projects; switch it back on to open their archived sessions.`})]})}function dC(){let[e,t]=Fx(),n=bt.find(t=>t.step===e).label;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`compact-slider`,title:`Less padding and fewer rows on each session in the sidebar; the ship always stays`,children:[(0,V.jsx)(`span`,{children:`Compact sidebar`}),(0,V.jsx)(vb,{step:e,labels:bt.map(e=>e.label),onPick:e=>t(e),children:(0,V.jsx)(`input`,{type:`range`,min:1,max:bt.length,step:1,value:e,list:`compact-steps`,"aria-valuetext":n,onChange:e=>t(Number(e.target.value))})})]}),(0,V.jsx)(`datalist`,{id:`compact-steps`,children:bt.map(e=>(0,V.jsx)(`option`,{value:e.step,label:e.label},e.step))}),(0,V.jsx)(`p`,{className:`muted`,children:`Each step takes more off the session cards: tighter padding and no date and time, then only the name, the ship and the badge, with a small "+" for a new session. Hover a card for what it no longer shows.`})]})}function fC(){let[e,t]=(0,v.useState)(()=>ot(localStorage)),n=e=>{t(e),st(un,e),ct(document.documentElement,e)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Colour scheme`,children:rt.map(t=>(0,V.jsx)(`button`,{className:e===t.id?`on`:``,"aria-pressed":e===t.id,onClick:()=>n(t.id),children:t.label},t.id))}),(0,V.jsx)(`p`,{className:`muted`,children:`System follows the computer's light or dark setting.`})]})}var pC=e=>e?e.slice(0,7):`unknown commit`,mC={waiting:`○`,running:`…`,done:`✓`,failed:`✗`};function hC({update:e}){let{view:t,error:n,act:r}=e,[i,a]=(0,v.useState)(!1);if(n)return(0,V.jsx)(`p`,{className:`restart-problem`,children:n});if(!t)return(0,V.jsx)(`p`,{className:`muted`,children:`…`});if(t.npm)return(0,V.jsx)(gC,{update:e});if(!t.available)return(0,V.jsx)(`p`,{className:`muted`,children:t.reason});let o=t.checking||t.updating||t.restarting,s=t.check,c=!!s&&!s.upToDate&&!t.updating&&!t.restarting;return(0,V.jsxs)(`div`,{className:`update-panel`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Running `,t.running?.commit?(0,V.jsx)(`code`,{children:pC(t.running.commit)}):`an unknown commit (its source is not a git clone)`,`, built from `,(0,V.jsx)(`code`,{children:t.running?.source}),`.`]}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>{a(!1),r(R.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),s&&!t.checking&&(s.upToDate?(0,V.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,pC(s.latest),`)`]}):(0,V.jsxs)(`span`,{children:[s.behind,` new change`,s.behind===1?``:`s`,` on main (`,pC(s.latest),`)`,s.commitKnown?``:`, counted from the source folder`]}))]}),t.checkError&&(0,V.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!s.upToDate&&s.changes.length>0&&(0,V.jsx)(`ul`,{className:`update-changes`,children:s.changes.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))}),c&&!t.canRestart&&(0,V.jsx)(`p`,{className:`muted`,children:`Updating ends in a restart, and this Ledung was started by an older launcher. Restart it once from its console window first.`}),c&&t.canRestart&&(i?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Pull main, npm install, npm run release, then restart. Sessions keep running.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{a(!1),r(R.update)},children:`Update now`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>a(!1),children:`Cancel`})]}):(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>a(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,V.jsx)(`ol`,{className:`update-steps`,children:t.steps.map(e=>(0,V.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,V.jsx)(`span`,{className:`update-mark`,children:mC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,V.jsx)(`pre`,{className:`update-output`,children:e.output})]},e.label))}),t.refused&&(0,V.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,V.jsx)(`p`,{className:`muted`,children:`The new release is built. Restarting into it…`})]})}function gC({update:e}){let{view:t,act:n}=e,[r,i]=(0,v.useState)(!1);if(!t?.npm)return null;let a=t.checking||t.updating||t.restarting,o=t.npmCheck&&t.npmCheck.channel===(t.channel??`public`)?t.npmCheck:null,s=!!o?.offered&&!o.upToDate&&!t.updating&&!t.restarting,c=bC[t.channel??`public`];return(0,V.jsxs)(`div`,{className:`update-panel`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Running Ledung `,(0,V.jsx)(`code`,{children:Cx(t.npm.version)}),`, installed from npm, on the `,c,` channel (Settings → About).`]}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:a,onClick:()=>{i(!1),n(R.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),o&&!t.checking&&(o.offered?o.upToDate?(0,V.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,c,`: `,Cx(o.offered),`)`]}):(0,V.jsxs)(`span`,{children:[Cx(o.offered),` is out on `,c]}):(0,V.jsxs)(`span`,{children:[`npm has no `,c,` version yet`]}))]}),t.checkError&&(0,V.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!t.canRestart&&(0,V.jsx)(`p`,{className:`muted`,children:t.reason}),s&&t.canRestart&&(r?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsxs)(`span`,{className:`muted`,children:[`npm install -g ledung@`,o.offered,`, then restart. Sessions keep running.`]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{i(!1),n(R.update)},children:`Update now`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(!1),children:`Cancel`})]}):(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>i(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,V.jsx)(`ol`,{className:`update-steps`,children:t.steps.map((e,t)=>(0,V.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,V.jsx)(`span`,{className:`update-mark`,children:mC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,V.jsx)(`pre`,{className:`update-output`,children:e.output})]},t))}),t.refused&&(0,V.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,V.jsx)(`p`,{className:`muted`,children:`The new version is installed. Restarting into it…`}),!t.steps.length&&!s&&(0,V.jsx)(`p`,{className:`muted`,children:t.reason})]})}function _C(e){let t=Ab(e.remote);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`remote-state ${e.remote?.state??`off`}`,children:t.label}),t.detail&&(0,V.jsx)(`p`,{className:`muted`,children:t.detail}),e.remote?.tls&&(0,V.jsx)(`p`,{className:`remote-tls`,children:e.remote.tls}),e.remote?.certificate&&(0,V.jsx)(vC,{cert:e.remote.certificate}),(0,V.jsx)(Yv,{remote:e.remote})]})}function vC({cert:e}){let t=Nb(e,Date.now()),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{className:`remote-certificate`,children:[(0,V.jsx)(`p`,{className:t.warn?`remote-tls`:`remote-state connected`,children:t.label}),t.detail&&(0,V.jsx)(`p`,{className:`muted`,children:t.detail}),t.copy&&e.accountUrl&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`ACME account (`,e.acme,`): `,(0,V.jsx)(`code`,{children:e.accountUrl}),` `,(0,V.jsx)(Df,{text:e.accountUrl})]}),e.record&&(0,V.jsxs)(`p`,{className:`muted`,children:[`CAA record: `,(0,V.jsx)(`code`,{className:`remote-record`,children:e.record}),` `,(0,V.jsx)(Df,{text:e.record})]}),(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small`,disabled:n,onClick:()=>{r(!0),a(null),R.certificateCheck().catch(e=>a(e.message)).finally(()=>r(!1))},children:n?`Checking…`:`Check now`})})]}),i&&(0,V.jsx)(`p`,{className:`restart-problem`,children:i})]})}function yC({source:e,update:t}){return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`About`}),(0,V.jsx)(`p`,{className:`muted`,children:`Ledung is free software under the GNU Affero General Public License, version 3, with an additional permission for Anthropic's software; a commercial license is also available.`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`It runs Anthropic's Claude Agent SDK and Claude Code, installed from npm under `,(0,V.jsx)(`a`,{href:`https://code.claude.com/docs/en/legal-and-compliance`,target:`_blank`,rel:`noreferrer`,children:`Anthropic's own terms`}),`. They are not covered by Ledung's license.`]}),e&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Running `,(0,V.jsx)(`code`,{children:e.version}),`. `,(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:`Source`})]}),t.view&&(0,V.jsx)(xC,{update:t})]})}var bC={public:`Public`,dev:`Dev`};function xC({update:e}){let t=e.view,n=t.channel??`public`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Update channel`}),(0,V.jsx)(`div`,{className:`restart-confirm`,role:`radiogroup`,"aria-label":`Update channel`,children:[`public`,`dev`].map(r=>(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`radio`,name:`update-channel`,checked:n===r,disabled:t.updating||t.restarting,onChange:()=>e.act(()=>R.updateChannel(r))}),` `,bC[r]]},r))}),(0,V.jsxs)(`p`,{className:`muted`,children:[n===`dev`?`Dev: updates to dev builds, made after changes are merged and before a public release, as well as public releases.`:`Public: updates to public releases only, as npm install -g ledung gets them.`,` `,t.npm?`Check for updates is under Update & restart.`:`This Ledung updates from main in the folder it was built from, so the channel applies only once it is installed from npm.`]})]})}var SC=(e,t)=>`bt:${e}#${t}`;function CC(e){let t=/^bt:([^#]+)#(.+)$/.exec(e??``);return t?{repo:t[1],id:t[2]}:null}var wC=(e,t)=>`#/board/${e}/${encodeURIComponent(t)}`;function TC(e){let t=/^#\/board\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/([^/]+)$/.exec(e);if(!t)return null;try{return{repo:t[1],id:decodeURIComponent(t[2])}}catch{return null}}function EC(e,t){return e.mine?`this Ledung's manager of project ${e.fromProject??`unknown`}`:e.viaLedung?`@${e.author}'s Ledung${e.fromProject?`, project ${e.fromProject}`:``}`:`typed on ${t} by @${e.author}`}function DC(e){let t=e.deliveries.map(t=>{switch(t.kind){case`wake`:return{text:`woke ${t.project}`,level:`ok`,project:t.project};case`quiet`:return{text:`quiet to ${t.project}`,level:`quiet`,project:t.project};case`channel`:return{text:`channel, ${t.project}`,level:`quiet`,project:t.project};case`ignored`:return{text:`not delivered to ${t.project}: its allowlist does not name @${e.author}`,level:`warn`,project:t.project}}});return t.length?t:e.status===`sent`?[{text:`sent from this Ledung`,level:`none`}]:e.status===`ignored`?[{text:`not delivered: no project here allows @${e.author}; only the id was kept, not the text`,level:`warn`}]:e.status===`quiet`?[{text:`not delivered: it reached no manager (no front desk, or the project's board is off)`,level:`warn`}]:[{text:`not for this Ledung`,level:`none`}]}var OC={project:``,repo:``,unreadOnly:!1,notDelivered:!1},kC=e=>e.dropped+e.refused+e.unsent>0,AC=(e,t=``)=>t?e.unread[t]??0:Object.values(e.unread).reduce((e,t)=>e+t,0);function jC(e,t){return e.filter(e=>(!t.repo||e.repo===t.repo)&&(!t.project||e.projects.includes(t.project))&&(!t.unreadOnly||AC(e,t.project)>0)&&(!t.notDelivered||kC(e)))}var MC=e=>e&&/^https:\/\//.test(e)?e:null;function NC(e,t){let[n,r]=(0,v.useState)({data:null,error:null});return(0,v.useEffect)(()=>{let t=!0;return e().then(e=>t&&r({data:e,error:null}),e=>t&&r(t=>({data:t.data,error:e.message}))),()=>{t=!1}},t),n}var PC=OC,FC=e=>e.length>4?`${e.slice(0,4).join(`, `)} +${e.length-4}`:e.join(`, `);function IC(e){let{data:t,error:n}=NC(()=>R.boardThreads(),[e.board]),[r,i]=(0,v.useState)(PC),a=e=>i(t=>PC={...t,...e}),o=(0,v.useMemo)(()=>Object.keys(e.board?.projects??{}).filter(t=>e.board.projects[t].repo).sort(),[e.board]),s=(e.board?.boards??[]).map(e=>e.repo),c=(0,v.useMemo)(()=>jC(t?.threads??[],r),[t,r]),l=r.project||r.repo||r.unreadOnly||r.notDelivered;return(0,V.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,V.jsxs)(`header`,{className:`session-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Board`}),(0,V.jsx)(`div`,{className:`muted`,children:`Read-only. The managers' messages with other people's Ledungs, newest first. Looking here posts nothing and marks nothing read.`})]}),(0,V.jsx)(`div`,{className:`session-corner`,children:(0,V.jsx)(`button`,{className:`small`,onClick:e.onOpenSettings,children:`Board settings`})})]}),(0,V.jsxs)(`div`,{className:`board-filters`,role:`group`,"aria-label":`Filter threads`,children:[o.length>1&&(0,V.jsxs)(`label`,{children:[`Project`,(0,V.jsxs)(`select`,{value:r.project,onChange:e=>a({project:e.target.value}),children:[(0,V.jsx)(`option`,{value:``,children:`All projects`}),o.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),s.length>1&&(0,V.jsxs)(`label`,{children:[`Board`,(0,V.jsxs)(`select`,{value:r.repo,onChange:e=>a({repo:e.target.value}),children:[(0,V.jsx)(`option`,{value:``,children:`All boards`}),s.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.unreadOnly,onChange:e=>a({unreadOnly:e.target.checked})}),` Unread only`]}),(0,V.jsxs)(`label`,{className:`toggle`,title:`Threads with a post that reached no manager: dropped (sender not allowed), refused by a project's allowlist, or for nobody's inbox`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.notDelivered,onChange:e=>a({notDelivered:e.target.checked})}),` Not delivered`]}),l&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>{PC=OC,i(OC)},children:`Clear filters`})]}),(0,V.jsxs)(`div`,{className:`waiting-list board-list`,children:[n&&(0,V.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,V.jsx)(`p`,{className:`muted`,children:`Reading the board…`}),t&&c.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:l?`No thread matches these filters.`:`No threads yet. Posts from the board appear here once Ledung has seen them.`}),c.map(t=>(0,V.jsx)(LC,{t,filters:r,onOpen:e.onOpen,showRepo:s.length>1},`${t.repo}#${t.id}`)),t?.truncated&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Only the `,t.threads.length,` most recent threads are listed.`]})]})]})}function LC({t:e,filters:t,onOpen:n,showRepo:r}){let i=AC(e,t.project),a=[e.dropped?`${e.dropped} dropped (sender not allowed)`:``,e.refused?`${e.refused} refused by a project's allowlist`:``,e.unsent?`${e.unsent} reached no manager`:``].filter(Boolean),o=e.last,s=o?o.mine?`${o.fromProject??`this Ledung`}`:o.viaLedung?`@${o.author}'s Ledung`:`@${o.author}`:``;return(0,V.jsxs)(`button`,{className:`board-thread-card${i?` unread`:``}`,onClick:()=>n(SC(e.repo,e.id)),children:[(0,V.jsxs)(`span`,{className:`board-thread-top`,children:[(0,V.jsxs)(`span`,{className:`board-thread-title`,children:[i>0&&(0,V.jsx)(`span`,{className:`unread-dot`,"aria-label":`unread`}),e.onlyDropped?`Thread ${e.id} (dropped posts only)`:e.title]}),(0,V.jsx)(`span`,{className:`muted board-thread-time`,children:Eg(e.updatedAt)})]}),(0,V.jsxs)(`span`,{className:`board-thread-meta muted`,children:[(0,V.jsx)(`span`,{className:`mono`,children:r?`${e.repo} #${e.id}`:`#${e.id}`}),e.participants.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,FC(e.participants)]})]}),(0,V.jsxs)(`span`,{className:`board-thread-chips`,children:[i>0&&(0,V.jsxs)(`span`,{className:`chip accent`,children:[i,` unread`]}),e.projects.map(e=>(0,V.jsx)(`span`,{className:`chip`,children:e},e)),a.map(e=>(0,V.jsx)(`span`,{className:`chip warn`,children:e},e))]}),o&&(0,V.jsxs)(`span`,{className:`board-thread-last`,children:[(0,V.jsxs)(`strong`,{children:[s,`:`]}),` `,o.text||`(empty)`]})]})}function RC(e){let{data:t,error:n}=NC(()=>R.boardThread(e.repo,e.id),[e.repo,e.id,e.board]),r=t=>e.projects.find(e=>e.name===t)?.managerId??null,i=MC(t?.url??null);return(0,V.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,V.jsxs)(`header`,{className:`session-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:t&&!t.missing?t.title:`Thread ${e.id}`}),(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsxs)(`span`,{className:`mono`,children:[e.repo,` #`,e.id]}),t&&t.participants.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,FC(t.participants)]})]})]}),(0,V.jsx)(`div`,{className:`session-corner`,children:(0,V.jsx)(`button`,{className:`small`,onClick:e.onBack,children:`← Board`})})]}),(0,V.jsxs)(`div`,{className:`waiting-list board-thread-page`,children:[(0,V.jsxs)(`p`,{className:`muted board-readonly`,children:[`Read-only: nothing is posted from here and opening this does not mark anything read.`,i&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[`Open the thread on `,t?.service??`the board`]}),`.`]})]}),n&&(0,V.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,V.jsx)(`p`,{className:`muted`,children:`Reading the thread…`}),t?.missing&&(0,V.jsx)(`p`,{className:`muted`,children:`Ledung holds no posts of this thread. It may be older than the board's first check here, or on a board no project here uses.`}),t?.truncated&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Only the latest `,t.posts.length,` posts are shown.`]}),t?.posts.map(n=>(0,V.jsx)(BC,{p:n,service:t.service,managerOf:r,onOpen:e.onOpen},n.id))]})]})}function zC({files:e}){return(0,V.jsx)(`ul`,{className:`board-attachments`,children:e.map((e,t)=>{let n=e.size>=1048576?`${(e.size/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e.size/1024))} KB`,r=`${e.name} · ${e.kind===`text`?`text`:e.kind.toUpperCase()} · ${n}`;if(e.file&&e.kind!==`text`){let n=wf(``,e.file);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsx)(`img`,{src:n,alt:e.name})}),(0,V.jsx)(`span`,{children:r})]},t)}let i=e.pruned?`pruned`:e.error?`not fetched: ${e.error}`:`in the board cache`;return(0,V.jsx)(`li`,{className:`muted`,children:(0,V.jsxs)(`span`,{children:[r,` · `,i]})},t)})})}function BC({p:e,service:t,managerOf:n,onOpen:r}){let i=e.mine?`out`:e.viaLedung?`ledung`:`typed`,a=e.deliveries.some(e=>!e.read),o=MC(e.url);return(0,V.jsxs)(`div`,{className:`msg board-post board-post-card ${i}${e.text===null?` dropped`:``}${a?` unread`:``}`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:EC(e,t)}),a&&(0,V.jsx)(`span`,{className:`chip accent`,children:`unread`}),(0,V.jsx)(`time`,{className:`time`,children:Eg(e.at)}),o&&(0,V.jsxs)(`a`,{className:`board-post-link`,href:o,target:`_blank`,rel:`noopener noreferrer`,children:[`on `,t]})]}),e.recipients.length>0&&(0,V.jsxs)(`div`,{className:`board-thread`,children:[`To `,e.recipients.join(`, `)]}),e.text===null?(0,V.jsxs)(`div`,{className:`msg-body muted`,children:[`Dropped: no project here allows @`,e.author,`, so Ledung kept only that this post exists, not its text.`]}):(0,V.jsx)(`div`,{className:`msg-body plain`,children:e.text}),e.attachments.length>0&&(0,V.jsx)(zC,{files:e.attachments}),(0,V.jsx)(`ul`,{className:`board-delivery-list`,children:DC(e).map((e,t)=>{let i=e.project?n(e.project):null;return(0,V.jsxs)(`li`,{className:`delivery-${e.level}`,children:[e.text,i&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`button`,{className:`link`,onClick:()=>r(i),children:[e.project,`'s manager chat`]})]})]},t)})})]})}var VC=80;function HC({value:e,onSave:t,onDone:n,label:r}){let i=B(),[a,o]=(0,v.useState)(e),s=a.replace(/\s+/g,` `).trim();return(0,V.jsx)(`input`,{...i,className:`name-editor`,"aria-label":r,autoFocus:!0,maxLength:VC,value:a,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onClick:e=>e.stopPropagation(),onBlur:n,onKeyDown:r=>{if(r.stopPropagation(),r.key===`Escape`)n();else if(r.key===`Enter`&&!r.nativeEvent.isComposing){if(r.preventDefault(),!s)return;s===e?n():t(s).then(n)}}})}function UC(e,t){return WC(e)-WC(t)||(e.position!==null&&t.position!==null?e.position-t.position:t.createdAt-e.createdAt)}function WC(e){return e.position===null?e.status===`ended`?2:0:1}function GC(e,t,n){let r=e.indexOf(t);if(r<0)return e;let i=e.filter(e=>e!==t),a=Math.max(0,Math.min(i.length,n>r?n-1:n));return[...i.slice(0,a),t,...i.slice(a)]}function KC(e,t){let n=e.findIndex(e=>t<e);return n<0?e.length:n}function qC(e,t,n){let r=e.indexOf(t);return n===r||n===r+1}var JC=5,YC=450,XC=8,ZC=28;function QC(e){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(!1),s=(0,v.useRef)(e);s.current=e;let c=(0,v.useRef)(null),l=e=>[...t.current?.querySelectorAll(`[data-drag]`)??[]].filter(t=>t.dataset.drag===e),u=(e,t)=>t===`projects`?e.closest(`.project-group`)??e:e,d=(e,n,r)=>{let i=l(e.group),a=i.find(t=>t.dataset.dragId===e.id),o=(e.group===`projects`?t.current:a?.closest(`.project-group`))?.getBoundingClientRect();if(!o||n<o.left||n>o.right||r<o.top||r>o.bottom)return null;let s=KC(i.map(t=>{let n=u(t,e.group).getBoundingClientRect();return n.top+n.height/2}),r);return qC(i.map(e=>e.dataset.dragId),e.id,s)?null:s},f=e=>{let t=a.current;i.current?.timer&&clearTimeout(i.current.timer),i.current=null,a.current=null,c.current?.(),c.current=null,document.body.classList.remove(`sidebar-dragging`),r(null),t&&(o.current=!0,setTimeout(()=>{o.current=!1},0),e&&t.slot!==null&&s.current(t.group,GC(l(t.group).map(e=>e.dataset.dragId),t.id,t.slot)))},p=e=>{a.current={group:e.group,id:e.id,slot:null},document.body.classList.add(`sidebar-dragging`),r(a.current),e.touch&&navigator.vibrate?.(10)},m=e=>{let n=t.current;if(!n)return;let r=n.scrollHeight>n.clientHeight?n:n.closest(`.sidebar`);if(!r)return;let i=r.getBoundingClientRect();e<i.top+ZC?r.scrollBy(0,-10):e>i.bottom-ZC&&r.scrollBy(0,10)};return(0,v.useEffect)(()=>{let e=t.current;if(!e)return;let n=e=>{a.current&&e.preventDefault()};return e.addEventListener(`touchmove`,n,{passive:!1}),()=>{e.removeEventListener(`touchmove`,n),c.current?.()}},[]),{nav:t,drag:n,handlers:{onPointerDown:e=>{if(e.button!==0||i.current)return;let n=e.target.closest(`[data-drag]`);if(!n||!t.current?.contains(n))return;let o=e.pointerType===`touch`,s={pointerId:e.pointerId,x:e.clientX,y:e.clientY,group:n.dataset.drag,id:n.dataset.dragId,touch:o,timer:null};if(i.current=s,o)s.timer=window.setTimeout(()=>{s.timer=null,i.current===s&&p(s)},YC);else try{n.setPointerCapture(e.pointerId)}catch{}let l=e=>{if(e.pointerId!==s.pointerId)return;let t=Math.hypot(e.clientX-s.x,e.clientY-s.y);if(!a.current){if(s.touch){t>XC&&f(!1);return}if(t<JC)return;p(s)}let n=a.current,i=d(n,e.clientX,e.clientY);i!==n.slot&&(a.current={...n,slot:i},r(a.current)),m(e.clientY)},u=e=>{e.pointerId===s.pointerId&&f(!0)},h=e=>{e.pointerId===s.pointerId&&f(!1)},g=e=>{e.key===`Escape`&&a.current&&(e.preventDefault(),e.stopPropagation(),f(!1))};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,h),document.addEventListener(`keydown`,g,!0),c.current=()=>{window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,h),document.removeEventListener(`keydown`,g,!0)}},onClickCapture:e=>{o.current&&(e.preventDefault(),e.stopPropagation())},onContextMenu:e=>{(i.current?.touch||a.current)&&e.preventDefault()}}}}var $C=`ledung.sidebar.folded`,ew=`ledung.sidebar.foldedSessions`,tw=(e,t,n)=>({count:(e?.count??0)+1,pending:(e?.pending??0)+(n[t.s.id]??0),working:(e?.working??!1)||ut(t.s)===`running`});function nw(e,t){let n=[],r=null,i=null,a=null;return e.forEach((o,s)=>{o.depth===0&&(i=o.s.id,a=null);let c=t.folded||o.depth>0&&i!==null&&t.foldedSessions.includes(i),l=o.depth===0&&e[s+1]?.depth===1;if(!c||o.s.id===t.openId){let e={...o,...c?{drag:null}:{},folds:l,folded:l&&t.foldedSessions.includes(o.s.id),hidden:null};n.push(e),o.depth===0&&(a=e)}else t.folded?r=tw(r,o,t.pending):a&&(a.hidden=tw(a.hidden,o,t.pending))}),t.folded&&!r&&(r={count:0,pending:0,working:!1}),{rows:n,project:r}}function rw(e,t){try{let n=JSON.parse(e.getItem(t)??`[]`);return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function iw(e,t,n){try{n.length?e.setItem(t,JSON.stringify(n)):e.removeItem(t)}catch{}}var aw=e=>rw(e,$C),ow=(e,t)=>iw(e,$C,t),sw=e=>rw(e,ew),cw=(e,t)=>iw(e,ew,t);function lw(e,t,n=()=>!0){let r=e.filter(e=>e!==t&&n(e));return e.includes(t)?r:[...r,t]}function uw(e,t){let n=[e.container,e.host===`github.com`?null:e.host].filter(Boolean).join(`, `),r=e=>e.toLocaleString(`en-US`),i=e.polling===`slow`?` · PRs checked every 10 min`:e.polling===`stopped`?` · PRs not checked until then`:``;return`GitHub${n?` (${n})`:``}: ${r(e.remaining)} of ${r(e.limit)} left until ${t(e.resetAt)}${i}`}function dw(e,t){return e.filter(e=>e.resetAt>t)}function fw(e){return e.polling===`stopped`?`critical`:e.polling===`slow`?`warning`:``}var pw=[`settings`,`accounts`,`add`,`chats`],mw=e=>!!e&&(pw.includes(e)||/^(settings|chats):/.test(e));function hw(e,t,n){return mw(n)?mw(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function gw(e){return e.depth>0&&!e.root?{back:e.depth}:{start:!0}}var _w=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing,vw=e=>e===null?`phone-list`:`phone-pane`;function yw(e){return e?.ledungFromList===!0?{back:1}:{open:null}}var bw=e=>e?null:`overview`,xw=e=>`ledung.draft.${e}`;function Sw(e,t){try{return e.getItem(xw(t))??``}catch{return``}}function Cw(e,t,n){try{n?e.setItem(xw(t),n):e.removeItem(xw(t))}catch{}}function ww(e,t=localStorage){let[n,r]=(0,v.useState)(()=>Sw(t,e)),i=(0,v.useRef)(n),a=(0,v.useRef)(n);(0,v.useEffect)(()=>{i.current=n});let o=(0,v.useCallback)(()=>{i.current!==a.current&&(a.current=i.current,Cw(t,e,i.current))},[t,e]);return(0,v.useEffect)(()=>{if(n===a.current)return;let e=setTimeout(o,300);return()=>clearTimeout(e)},[n,o]),(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`hidden`&&o()};return window.addEventListener(`pagehide`,o),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`pagehide`,o),document.removeEventListener(`visibilitychange`,e),o()}},[o]),[n,r]}function Tw(e){let t=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{t.current=e}),(0,v.useCallback)((...e)=>t.current(...e),[])}function Ew(e){let t=e.status===`ended`,n=!t&&e.status!==`stopping`;return{menu:[...e.role===`manager`?[`away`]:[],`permissions`,...e.role===`session`?[`priority`]:[],`toolCalls`,`usage`,...n?[`pause`,`stop`]:[],...e.claudeVersion?[`version`]:[]],header:[...e.status===`queued`?[`startNow`]:[],...e.clearDue!=null&&!t?[`clear`]:[],...e.compacting&&!t?[`compacting`]:[],...t&&e.claudeSessionId?[`resume`]:[],...t&&e.role===`session`?[`archive`]:[]]}}var Dw=e=>e.status!==`ended`&&e.status!==`stopping`,Ow={connected:`connected`,failed:`failed`,"needs-auth":`needs sign-in`,pending:`starting`,disabled:`disabled`},kw=e=>e.status===`running`||e.status===`waiting`,Aw=e=>e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&!e.isComposing&&(/^[a-z]$/i.test(e.key)?e.key.toLowerCase()===`o`:e.code===`KeyO`),jw=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing;function Mw(e){return`${e<10?e.toFixed(1):Math.round(e)} ${e>=.95&&e<1.05?`core`:`cores`}`}function Nw(e){return e>=1024**3?`${(e/1024**3).toFixed(e>=10*1024**3?0:1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} KB`}function Pw(e){let t=Math.round(e/1e3);return t<60?`${t} s`:t<3600?`${Math.round(t/60)} min`:`${(t/3600).toFixed(1)} h`}var Fw={normal:`Normal`,high:`High`,critical:`Critical`};function Iw({label:e,used:t,total:n,text:r}){let i=n>0?t/n:0,a=i>=.95?`critical`:i>=.8?`warning`:`good`,o={good:`●`,warning:`▲`,critical:`■`}[a];return(0,V.jsxs)(`div`,{className:`limit`,title:`${e}: ${r}${a===`good`?``:a===`warning`?` (busy)`:` (full)`}`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:e}),(0,V.jsxs)(`span`,{className:`limit-status ${a}`,children:[o,` `,Math.round(i*100),`%`]})]}),(0,V.jsx)(`div`,{className:`limit-track`,children:(0,V.jsx)(`div`,{className:`limit-fill ${a}`,style:{width:`${Math.min(100,i*100)}%`}})}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:r})]})}function Lw(e){let t=e.machine,[n,r]=(0,v.useState)(``);if((0,v.useEffect)(()=>r(t?String(t.limit):``),[t?.limit]),!t)return null;let i=()=>{let i=Number(n);i!==t.limit&&e.run(()=>R.setLimit(i)).finally(()=>r(String(t.limit)))},a=t=>e.sessions.find(e=>e.id===t)?.title??`a session`;return(0,V.jsxs)(`section`,{className:`machine`,"aria-label":`Machine`,children:[(0,V.jsxs)(`div`,{className:`limits`,children:[(0,V.jsx)(Iw,{label:`CPU`,used:t.cores,total:t.cpus,text:`${Mw(t.cores)} of ${t.cpus}`}),(0,V.jsx)(Iw,{label:`Memory`,used:t.memUsed,total:t.memTotal,text:`${Nw(t.memUsed)} of ${Nw(t.memTotal)}`}),t.docker&&(0,V.jsx)(Iw,{label:`Docker memory`,used:t.docker.memUsed,total:t.docker.memTotal,text:`${Nw(t.docker.memUsed)} of ${Nw(t.docker.memTotal)} · ${Mw(t.docker.cores)}`})]}),(0,V.jsxs)(`div`,{className:`machine-working`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t.working}),` of `]}),(0,V.jsx)(`input`,{type:`number`,min:1,max:100,value:n,"aria-label":`How many sessions may work at once`,title:`How many sessions may work at the same time. Managers don't count.`,onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>e.key===`Enter`&&e.target.blur()}),(0,V.jsxs)(`span`,{children:[` working`,t.line.length?` · ${t.line.length} waiting`:``]})]}),t.line.length>0&&(0,V.jsx)(`ol`,{className:`machine-line`,children:t.line.map(t=>{let n=e.sessions.find(e=>e.id===t);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpen(t),children:a(t)}),n&&n.priority!==`normal`&&(0,V.jsx)(`span`,{className:`chip prio-${n.priority}`,children:Fw[n.priority]}),(0,V.jsx)(`button`,{className:`small`,title:`Start this turn now, above the limit`,onClick:()=>void e.run(()=>R.startNow(t)),children:`Start now`})]},t)})})]})}function Rw({sessionId:e}){let[t,n]=(0,v.useState)(null);if((0,v.useEffect)(()=>{let t=!0,r=()=>R.turns(e).then(e=>t&&n(e),()=>{});r();let i=setInterval(r,15e3);return()=>{t=!1,clearInterval(i)}},[e]),!t)return null;if(!t.length)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Machine use per turn`}),(0,V.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`})]});let r=t.slice(-60);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`CPU per turn`}),(0,V.jsx)(zw,{values:r.map(e=>({value:e.peakCores,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Mw(e.peakCores)}, average ${Mw(e.avgCores)}`})),format:Mw}),(0,V.jsx)(`h3`,{children:`Memory per turn`}),(0,V.jsx)(zw,{values:r.map(e=>({value:e.peakMem,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Nw(e.peakMem)}`})),format:Nw}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain calls`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Started`}),(0,V.jsx)(`th`,{className:`num`,children:`Took`}),(0,V.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,V.jsx)(`th`,{children:`Commands`})]})}),(0,V.jsx)(`tbody`,{children:t.slice().reverse().map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:new Date(e.startedAt).toLocaleTimeString()}),(0,V.jsx)(`td`,{className:`num`,children:Pw(e.durationMs)}),(0,V.jsx)(`td`,{className:`num`,children:e.avgCores.toFixed(2)}),(0,V.jsx)(`td`,{className:`num`,children:e.peakCores.toFixed(2)}),(0,V.jsx)(`td`,{className:`num`,children:Nw(e.peakMem)}),(0,V.jsx)(`td`,{className:`mono`,children:e.commands.join(`, `)||(0,V.jsx)(`span`,{className:`muted`,children:`none`})})]},e.startedAt))})]})})]})}function zw({values:e,format:t}){let n=Math.max(...e.map(e=>e.value),0);return(0,V.jsxs)(`div`,{className:`mini-bars`,role:`img`,"aria-label":`Highest: ${t(n)}`,children:[(0,V.jsx)(`span`,{className:`mini-max muted`,children:t(n)}),e.map((e,t)=>(0,V.jsx)(`div`,{className:`mini-col`,title:e.label,children:(0,V.jsx)(`div`,{className:`mini-bar`,style:{height:`${n>0?Math.max(2,e.value/n*100):0}%`}})},t))]})}function Bw(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.typicalCosts(30).then(t,()=>t([]))},[]),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h2`,{children:`Typical machine use per turn`}),(0,V.jsx)(`p`,{className:`muted`,children:`Last 30 days, sessions only (not managers): what a turn that ran each kind of command usually used. Ledung learns these; they don't decide anything yet.`}),e?e.length?(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Project`}),(0,V.jsx)(`th`,{children:`Command`}),(0,V.jsx)(`th`,{className:`num`,children:`Turns`}),(0,V.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,V.jsx)(`th`,{className:`num`,children:`Duration`})]})}),(0,V.jsx)(`tbody`,{children:e.slice(0,50).map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:S(e.project)}),(0,V.jsx)(`td`,{className:`mono`,children:e.command||(0,V.jsx)(`span`,{className:`muted`,children:`no commands`})}),(0,V.jsx)(`td`,{className:`num`,children:e.turns}),(0,V.jsx)(`td`,{className:`num`,children:Mw(e.avgCores)}),(0,V.jsx)(`td`,{className:`num`,children:Mw(e.peakCores)}),(0,V.jsx)(`td`,{className:`num`,children:Nw(e.peakMem)}),(0,V.jsx)(`td`,{className:`num`,children:Pw(e.durationMs)})]},`${e.project} ${e.command}`))})]})}):(0,V.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`}):(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})]})}function Vw(e,t){let n=e=>`${Math.round(e/1e3)}k`;return`${n(e)}${t?` of ${n(t)}`:``}`}var Hw={...lt,waiting:`Needs an answer`};function Uw(e){return e.contextTokens&&e.contextWindow?e.contextTokens/e.contextWindow:null}function Ww(e){let t=new Set(e.sessions.map(e=>e.id)),n=e=>e.status!==`ended`,r=e.sessions.filter(r=>(!r.parentId||!t.has(r.parentId))&&(n(r)||e.sessions.some(e=>e.parentId===r.id&&n(e)))),i=(e,t)=>Number(t.role===`manager`)-Number(e.role===`manager`)||t.createdAt-e.createdAt,a=r.sort(i).flatMap(t=>[t,...e.sessions.filter(e=>e.parentId===t.id&&n(e)).sort(i)]),o=e.sessions.filter(e=>e.status===`ended`).length;return(0,V.jsx)(`div`,{className:`overview`,children:(0,V.jsxs)(`div`,{className:`overview-list`,children:[(0,V.jsxs)(`div`,{className:`muted`,children:[e.overview?`${Wy(e.overview.todayTokens)} tokens today`:``,o?` · ${o} ended session${o===1?``:`s`} not shown`:``]}),!a.length&&(0,V.jsx)(`p`,{className:`muted`,children:`No sessions are running.`}),a.map(n=>{let r=e.overview?.sessions[n.id],i=Uw(n),a=!!n.parentId&&t.has(n.parentId);return(0,V.jsxs)(`div`,{role:`button`,tabIndex:0,className:`overview-card${a?` child`:``}`,onClick:()=>e.onOpenSession(n.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onOpenSession(n.id))},children:[(0,V.jsxs)(`div`,{className:`overview-top`,children:[(0,V.jsx)(`span`,{className:`dot ${ut(n)}`}),(0,V.jsxs)(`span`,{className:`overview-title`,children:[n.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,n.title]}),e.waitingBySession[n.id]?(0,V.jsx)(`span`,{className:`badge`,children:e.waitingBySession[n.id]}):null]}),(0,V.jsxs)(`div`,{className:`overview-facts`,children:[(0,V.jsxs)(`span`,{children:[Hw[n.status],e.machine&&e.machine.line.includes(n.id)?`: number ${e.machine.line.indexOf(n.id)+1}`:``,n.paused?` · paused`:``]}),n.priority!==`normal`&&(0,V.jsx)(`span`,{className:`chip prio-${n.priority}`,title:n.priorityNote??void 0,children:Fw[n.priority]}),e.machine?.sessions[n.id]&&(0,V.jsxs)(`span`,{title:`CPU and memory of everything this session runs`,children:[Mw(e.machine.sessions[n.id].cores),` · `,Nw(e.machine.sessions[n.id].memBytes)]}),(0,V.jsx)(`span`,{children:S(n.project)}),n.branch&&(0,V.jsx)(`span`,{className:`mono`,children:n.branch}),n.pr&&(0,V.jsx)(`a`,{href:n.pr.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),title:`${n.pr.title} — checks ${n.pr.checks}`,children:qy(n.pr)}),n.tickets.map(e=>(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:e.id},e.id)),r&&(0,V.jsxs)(`span`,{title:`Tokens today / in total`,children:[Wy(r.today),` today · `,Wy(r.total),` total · `,Gy(r.costTotal)]}),n.contextTokens!=null&&(0,V.jsxs)(`span`,{className:i!=null&&i>.8?`ctx-high`:``,title:`How full the context window is, and its size in tokens`,children:[`context `,i==null?``:`${Ky(i)} · `,Vw(n.contextTokens,n.contextWindow)]}),n.backgroundTasks>0&&(0,V.jsxs)(`span`,{children:[n.backgroundTasks,` in background`]})]}),r?.lastReply&&(0,V.jsxs)(`div`,{className:`overview-last`,children:[(0,V.jsx)(`span`,{className:`muted`,children:r.lastReplyAt?Eg(r.lastReplyAt):``}),` `,r.lastReply.split(`
|
|
104
|
-
`)[0]]})]},n.id)})]})})}function Gw({sessionId:e,onClose:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0,n=()=>R.sessionUsage(e).then(e=>t&&r(e),e=>t&&a(e.message));n();let i=setInterval(n,15e3);return()=>{t=!1,clearInterval(i)}},[e]);let o=(0,v.useMemo)(()=>Zy(`model`,n?.models??[]),[n?.models]),s=n?.totals,c=n?n.calls.slice(-120):[];return(0,V.jsxs)(`aside`,{className:`file-panel`,"aria-label":`Usage`,children:[(0,V.jsxs)(`header`,{className:`file-head`,children:[(0,V.jsx)(`span`,{className:`file-path`,children:`Usage of this session`}),(0,V.jsx)(`button`,{className:`small`,onClick:t,children:`Close`})]}),(0,V.jsxs)(`div`,{className:`file-body`,children:[i&&(0,V.jsx)(`p`,{className:`error`,children:i}),!n&&!i&&(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`}),n&&s&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`tiles`,children:[(0,V.jsx)(tb,{label:`Tokens`,value:Wy(s.tokens),sub:`${s.calls} model calls`}),(0,V.jsx)(tb,{label:`API-equivalent cost`,value:Gy(s.cost)}),(0,V.jsx)(tb,{label:`Cache read share`,value:s.tokens?Ky(s.cacheRead/s.tokens):`—`}),(0,V.jsx)(tb,{label:`In subagents`,value:s.tokens?Ky(s.subagentTokens/s.tokens):`—`})]}),(0,V.jsx)(`h3`,{children:`Tokens per model call`}),(0,V.jsx)(Qy,{items:[...n.models.map(e=>({label:e,color:o(e)})),...n.calls.some(e=>e.subagent)?[{label:`subagent call`,color:`var(--s-other)`,textured:!0}]:[]]}),(0,V.jsx)(eb,{height:120,columns:c.map(e=>({label:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),short:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),values:{[e.model]:e.tokens},textured:!!e.subagent,note:[e.compaction?`Compaction`:``,e.subagent?`Subagent: ${e.subagent}`:``,`Started by: ${Xy[e.trigger]??e.trigger}`].filter(Boolean).join(` · `)})),series:n.models.map(e=>({key:e,label:e,color:o(e)})),emptyText:`No model calls recorded yet.`}),(0,V.jsx)(Rw,{sessionId:e}),(0,V.jsx)(`h3`,{children:`Model calls`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain calls`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Time`}),(0,V.jsx)(`th`,{children:`Model`}),(0,V.jsx)(`th`,{className:`num`,children:`Input`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache write`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache read`}),(0,V.jsx)(`th`,{className:`num`,children:`Output`}),(0,V.jsx)(`th`,{className:`num`,children:`Thinking`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache %`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,children:`Running`}),(0,V.jsx)(`th`,{children:`Who`})]})}),(0,V.jsx)(`tbody`,{children:(()=>{let e=0;return n.calls.map((t,n)=>(e+=t.cost??0,(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:new Date(t.at).toLocaleTimeString()}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:o(t.model)}}),` `,t.model]}),(0,V.jsx)(`td`,{className:`num`,children:Wy(t.input)}),(0,V.jsx)(`td`,{className:`num`,children:Wy(t.cacheWrite)}),(0,V.jsx)(`td`,{className:`num`,children:Wy(t.cacheRead)}),(0,V.jsx)(`td`,{className:`num`,children:Wy(t.output)}),(0,V.jsx)(`td`,{className:`num muted`,children:t.thinking?`~${Wy(t.thinking)}`:``}),(0,V.jsx)(`td`,{className:`num strong`,children:Wy(t.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:t.tokens?Ky(t.cacheRead/t.tokens):``}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:Gy(e)}),(0,V.jsx)(`td`,{className:`muted nowrap`,children:t.subagent?`subagent: ${t.subagent}`:Xy[t.trigger]??t.trigger})]},n)))})()})]})})]})]})]})}var Kw=864e5,qw=Kw;function Jw(e,t){return t.fingerprint??`${e.login}/${e.computerId}/${t.label}`}var Yw=e=>e.input+e.cacheWrite+e.cacheRead+e.output;function Xw(e){return e.entries.find(e=>e.own)?.login??null}function Zw(e,t){let n=Xw(e);return e.entries.flatMap(e=>e.state===`ok`&&e.file&&(!t||e.file.login===n)?[e.file]:[])}function Qw(e){return e.flatMap(e=>e.accounts.map(t=>({file:e,account:t,key:Jw(e,t)})))}function $w(e,t,n){if(e===`all`)return null;let r;if(e===`week`){let e=Qw(t).flatMap(({account:e})=>e.limits.filter(e=>e.kind===`seven_day`&&e.resetsAt&&e.resetsAt>n).map(e=>e.resetsAt-Py.seven_day));r=e.length?Math.min(...e):n-6*Kw}else r=n-(Number(e.replace(`d`,``))-1)*Kw;return eT(r)}function eT(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function tT(e,t,n){let r=e=>!n||n(e.model),i=e.hourly.filter(r),a=i.length?Math.min(...i.map(e=>e.t)):1/0,o=0;for(let e of i)e.t+36e5>t&&(o+=e.cost);let s=eT(t),c=Number.isFinite(a)?eT(a):null;for(let t of e.daily)!r(t)||t.t<s||c&&t.t>=c||(o+=t.cost);return o}function nT(e){let t=/^seven_day_(opus|sonnet|haiku|fable)$/.exec(e)?.[1];return t?e=>e.toLowerCase().includes(t):void 0}var rT=[`five_hour`,`seven_day`,`seven_day_opus`,`seven_day_sonnet`];function iT(e,t){let n=new Map;for(let t of Qw(e)){let e=n.get(t.key);e?e.push(t):n.set(t.key,[t])}let r=[];for(let[e,i]of n){let n=[...i].sort((e,t)=>t.file.asOf-e.file.asOf)[0],a=[...new Set(i.flatMap(e=>e.account.limits.map(e=>e.kind)))].filter(e=>e!==`overage`&&e!==`seven_day_overage_included`).sort((e,t)=>(rT.indexOf(e)+1||99)-(rT.indexOf(t)+1||99)||e.localeCompare(t)).map(e=>{let n=i.flatMap(t=>t.account.limits.filter(t=>t.kind===e)).sort((e,t)=>t.seenAt-e.seenAt)[0],r=n?{...n,at:n.seenAt}:null,a=r?Vy(r,t):!1,o=Py[e]??Py.seven_day,s=r?.resetsAt&&!a?r.resetsAt-o:t-o,c=i.map(t=>({computer:t.file.computer,computerId:t.file.computerId,login:t.file.login,cost:tT(t.account,s,nT(e))})),l=c.reduce((e,t)=>e+t.cost,0);return{kind:e,reading:r,reset:a,pace:r&&!a&&r.utilization!=null?Fy(e.startsWith(`seven_day`)?`seven_day`:e,r.utilization,r.resetsAt,t):null,shares:c.filter(e=>e.cost>0).map(e=>({...e,share:e.cost/l})).sort((e,t)=>t.cost-e.cost)}});r.push({fingerprint:e,label:n.account.label,rows:a,people:[...new Set(i.map(e=>e.file.login))].sort(),computers:[...new Set(i.map(e=>e.file.computer))].sort()})}return r.sort((e,t)=>e.label.localeCompare(t.label))}function aT(e,t,n){return e===`person`?t.file.login:e===`account`?t.account.label:e===`computer`?t.file.computer:e===`model`?n.model:n.project}function oT(e,t,n,r){let i=new Map,a=new Set;for(let r of Qw(e))for(let e of r.account.daily){if(n&&e.t<n)continue;let o=aT(t,r,e);a.add(o);let s=i.get(e.t)??Object.create(null);s[o]=(s[o]??0)+Yw(e),i.set(e.t,s)}let o=n??[...i.keys()].sort()[0],s=eT(r),c=[];if(o)for(let e=new Date(`${o}T12:00:00`);eT(e.getTime())<=s;e.setDate(e.getDate()+1)){let t=eT(e.getTime());c.push({day:t,values:i.get(t)??Object.create(null)})}return{keys:[...a].sort(),columns:c}}function sT(e,t,n){return Qw(e).map(({file:e,account:r,key:i})=>{let a=r.daily.filter(e=>!t||e.t>=t);return{login:e.login,account:r.label,fingerprint:i,computer:e.computer,computerId:e.computerId,tokens:a.reduce((e,t)=>e+Yw(t),0),cost:a.reduce((e,t)=>e+t.cost,0),asOf:e.asOf,stale:n-e.asOf>qw}}).sort((e,t)=>e.login.localeCompare(t.login)||e.account.localeCompare(t.account)||e.computer.localeCompare(t.computer))}var cT=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]],lT=[[`person`,`person`],[`account`,`account`],[`computer`,`computer`],[`model`,`model`],[`project`,`project`]],uT={five_hour:`5-hour`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`},dT={allowed:{cls:`good`,icon:`●`,label:`OK`},allowed_warning:{cls:`warning`,icon:`▲`,label:`Close to the limit`},rejected:{cls:`critical`,icon:`■`,label:`Limit reached`}};function fT(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function pT(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0,n=()=>R.sharedUsage().then(n=>e&&(t(n),r(null)),t=>e&&r(t.message));n();let i=setInterval(n,6e4);return()=>{e=!1,clearInterval(i)}},[]),n&&!e?(0,V.jsx)(`p`,{className:`error`,children:n}):e?(0,V.jsx)(mT,{view:e,now:Date.now()}):(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})}function mT({view:e,now:t,initialMine:n=!1}){let[r,i]=(0,v.useState)(n),[a,o]=(0,v.useState)(`week`),[s,c]=(0,v.useState)(`person`),l=Xw(e),u=(0,v.useMemo)(()=>Zw(e,r),[e,r]),d=$w(a,u,t),f=(0,v.useMemo)(()=>iT(u,t),[u,t]),p=(0,v.useMemo)(()=>oT(u,s,d,t),[u,s,d,t]),m=(0,v.useMemo)(()=>sT(u,d,t),[u,d,t]),h=Zy(`project`,[...new Set(Zw(e,!1).map(e=>e.computerId))]),g=Zy(s===`model`?`model`:`project`,p.keys);if(!e.repo)return(0,V.jsx)(`p`,{className:`muted`,children:`Nothing is published here yet. Switch on Publish usage in Settings to share this computer's usage and read everyone else's.`});let _=p.keys.map(e=>({key:e,label:e,color:g(e)})),y=p.columns.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`}),values:e.values}));return(0,V.jsxs)(`div`,{className:`shared-usage`,children:[(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`label`,{children:[`Period `,(0,V.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),children:cT.map(([e,t])=>(0,V.jsx)(`option`,{value:e,children:t},e))})]}),(0,V.jsxs)(`label`,{className:`shared-mine`,title:l?`Only ${l}'s own computers`:`Mine needs this computer to publish its usage too`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!l,onChange:e=>i(e.target.checked)}),` Mine`]})]}),e.error&&(0,V.jsxs)(`p`,{className:`error`,children:[`Could not read the shared usage just now: `,e.error,e.entries.length?` Showing the last files read.`:``]}),e.entries.filter(e=>e.state!==`ok`&&(!r||e.login===l)).map(e=>(0,V.jsxs)(`p`,{className:`shared-note warning`,children:[e.computer??`A computer`,e.login?` (${e.login})`:``,e.state===`newer`?` publishes usage in a newer format: update Ledung to see it.`:` published a usage file Ledung cannot read${e.reason?` (${e.reason})`:``}.`]},e.id)),!u.length&&(0,V.jsx)(`p`,{className:`muted`,children:r?`None of your computers has published yet.`:`No computer has published yet.`}),f.length>0&&(0,V.jsx)(`div`,{className:`shared-cards`,children:f.map(e=>(0,V.jsx)(hT,{card:e,now:t,color:h},e.fingerprint))}),u.length>0&&(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsxs)(`div`,{className:`viz-card-head`,children:[(0,V.jsx)(`h3`,{children:`Daily tokens`}),(0,V.jsxs)(`div`,{className:`seg-control shared-stack`,role:`group`,"aria-label":`Stack by`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`by`}),lT.map(([e,t])=>(0,V.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:t},e))]})]}),(0,V.jsx)(Qy,{items:_}),(0,V.jsx)(eb,{columns:y,series:_})]}),m.length>0&&(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Who's who`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Person`}),(0,V.jsx)(`th`,{children:`Account`}),(0,V.jsx)(`th`,{children:`Computer`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{children:`Last published`})]})}),(0,V.jsx)(`tbody`,{children:m.map((e,n)=>{let r=m[n-1],i=r?.login===e.login;return(0,V.jsxs)(`tr`,{className:e.stale?`shared-stale`:``,children:[(0,V.jsx)(`td`,{children:i?``:e.login}),(0,V.jsx)(`td`,{children:i&&r?.fingerprint===e.fingerprint?``:e.account}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:h(e.computerId)}}),` `,e.computer]}),(0,V.jsx)(`td`,{className:`num`,children:Wy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(e.cost)}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[Hy({at:e.asOf,resetsAt:null},t).replace(/^as of /,``),e.stale&&(0,V.jsx)(`span`,{className:`shared-stale-mark`,title:`No publish for over a day`,children:` · stale`})]})]},`${e.computerId}-${e.fingerprint}`)})})]})})]})]})}function hT({card:e,now:t,color:n}){return(0,V.jsxs)(`section`,{className:`card viz-card shared-card`,children:[(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`div`,{className:`muted shared-card-who`,children:[e.people.join(`, `),` · `,e.computers.length,` computer`,e.computers.length===1?``:`s`]}),!e.rows.some(e=>e.reading)&&(0,V.jsx)(`div`,{className:`muted`,children:`no data yet`}),e.rows.map(e=>{let r=fT(uT,e.kind)??e.kind;if(!e.reading)return null;if(e.reset)return(0,V.jsxs)(`div`,{className:`shared-limit limit-reset`,title:`${r}: the window has reset since the last reading (${Hy(e.reading,t)}).`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:r}),(0,V.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:(0,V.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=e.reading.utilization,a=Uy(e.reading,t),o=Math.min(100,(i??0)*100),s=fT(dT,e.reading.status)??{cls:`good`,icon:`●`,label:e.reading.status},c=e.shares.map(e=>`${e.computer} (${e.login}): ${Ky(e.share)}, ${Gy(e.cost)}`).join(`
|
|
105
|
-
`);return(0,V.jsxs)(`div`,{className:`shared-limit`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:r}),(0,V.jsxs)(`span`,{className:`limit-status ${s.cls}`,title:s.label,children:[s.icon,` `,i==null?s.label:Ky(i)]})]}),(0,V.jsx)(`div`,{className:`limit-track shared-track`,title:c||`No use recorded in this window`,children:(0,V.jsx)(`div`,{className:`shared-fill`,style:{width:`${o}%`},children:e.shares.length?e.shares.map(e=>(0,V.jsx)(`div`,{className:`shared-seg`,style:{flexGrow:e.share,background:n(e.computerId)}},e.computerId)):(0,V.jsx)(`div`,{className:`shared-seg limit-fill ${s.cls}`,style:{flexGrow:1}})})}),(0,V.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,V.jsx)(`span`,{children:e.shares.map(e=>`${e.computer} ${Ky(e.share)}`).join(` · `)}),(0,V.jsxs)(`span`,{className:`limit-forecast${e.pace!=null&&e.pace>=1?` over`:``}`,children:[`≈ `,e.pace==null?`—`:Ky(e.pace),` by reset`]})]}),a&&(0,V.jsx)(`div`,{className:`limit-sub limit-age`,children:a})]},e.kind)})]})}function gT(){return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(pT,{})})}var _T=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]];function vT(e){return new Date(`${e}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`})}var yT=[[`computer`,`This computer`],[`shared`,`Shared`],[`sessions`,`Sessions`]];function bT(e){let[t,n]=(0,v.useState)(`computer`),r=e.sessionsOpen?`sessions`:t,i=t=>{t===`sessions`?e.sessionsOpen||e.onSessions(!0):(n(t),e.sessionsOpen&&e.onSessions(!1))};return(0,V.jsxs)(`div`,{className:`usage`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsx)(`div`,{className:`session-head-text`,children:(0,V.jsx)(`h2`,{children:`Usage`})})}),(0,V.jsx)(`div`,{className:`pane-tabs`,role:`tablist`,"aria-label":`Usage`,children:yT.map(([e,t])=>(0,V.jsx)(`button`,{role:`tab`,"aria-selected":r===e,className:r===e?`on`:``,onClick:()=>i(e),children:t},e))}),r===`computer`?(0,V.jsx)(xT,{onOpenSession:e.onOpenSession}):r===`shared`?(0,V.jsx)(gT,{}):(0,V.jsx)(Ww,{sessions:e.sessions,overview:e.overview,machine:e.machine,waitingBySession:e.waitingBySession,onOpenSession:e.onOpenSession})]})}function xT({onOpenSession:e}){let[t,n]=(0,v.useState)({period:`week`}),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(`model`),[l,u]=(0,v.useState)({});(0,v.useEffect)(()=>{let e=!0;R.usage(t).then(t=>e&&i(t),t=>e&&o(t.message));let n=setInterval(()=>R.usage(t).then(t=>e&&i(t),()=>{}),3e4);return()=>{e=!1,clearInterval(n)}},[t]);let d=(0,v.useMemo)(()=>({model:Zy(`model`,r?.options.models??[]),project:Zy(`project`,r?.options.projects??[]),trigger:Zy(`trigger`,Yy)}),[r?.options.models,r?.options.projects]);if(a)return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(`p`,{className:`error`,children:a})});if(!r)return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})});let f=e=>n(t=>({...t,...e})),p=r.totals,m=(s===`model`?r.models:s===`project`?[...new Set(r.daily.flatMap(e=>Object.keys(e.byProject)))].sort():Yy.filter(e=>r.daily.some(t=>t.byTrigger[e]))).map(e=>({key:e,label:s===`trigger`?Xy[e]??e:e,color:d[s](e)})),h=r.daily.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:vT(e.day),values:s===`model`?e.byModel:s===`project`?e.byProject:e.byTrigger})),g=t.project||t.model||t.branch||t.role||t.trigger||t.account;return(0,V.jsxs)(`div`,{className:`usage-body`,children:[(0,V.jsxs)(`div`,{className:`muted`,children:[`Since `,new Date(r.since||Date.now()).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`}),r.since===0?` (all time)`:``]}),(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`label`,{children:[`Period `,(0,V.jsx)(`select`,{value:t.period,onChange:e=>f({period:e.target.value}),children:_T.map(([e,t])=>(0,V.jsx)(`option`,{value:e,children:t},e))})]}),(0,V.jsxs)(`label`,{children:[`Project `,(0,V.jsxs)(`select`,{value:t.project??``,onChange:e=>f({project:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.projects.map(e=>(0,V.jsx)(`option`,{value:e,children:S(e)},e))]})]}),(r.options.accounts?.length??0)>1&&(0,V.jsxs)(`label`,{children:[`Account `,(0,V.jsxs)(`select`,{value:t.account??``,onChange:e=>f({account:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.accounts.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Model `,(0,V.jsxs)(`select`,{value:t.model??``,onChange:e=>f({model:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.models.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Branch `,(0,V.jsxs)(`select`,{value:t.branch??``,onChange:e=>f({branch:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.branches.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Role `,(0,V.jsxs)(`select`,{value:t.role??``,onChange:e=>f({role:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),(0,V.jsx)(`option`,{value:`manager`,children:`Managers`}),(0,V.jsx)(`option`,{value:`session`,children:`Sessions`})]})]}),(0,V.jsxs)(`label`,{children:[`Started by `,(0,V.jsxs)(`select`,{value:t.trigger??``,onChange:e=>f({trigger:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),Yy.map(e=>(0,V.jsx)(`option`,{value:e,children:Xy[e]},e))]})]}),g&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>n({period:t.period}),children:`Clear filters`})]}),(0,V.jsxs)(`div`,{className:`tiles`,children:[(0,V.jsx)(tb,{label:`Tokens`,value:Wy(p.tokens),sub:`${Wy(p.output)} output`}),(0,V.jsx)(tb,{label:`API-equivalent cost`,value:Gy(p.cost),sub:`not what a plan charges`}),(0,V.jsx)(tb,{label:`Model calls`,value:p.calls.toLocaleString(),sub:`${p.sessions} session${p.sessions===1?``:`s`}`}),(0,V.jsx)(tb,{label:`Cache read share`,value:p.tokens?Ky(p.cacheRead/p.tokens):`—`,sub:`higher is cheaper`}),(0,V.jsx)(tb,{label:`In subagents`,value:p.tokens?Ky(p.subagentTokens/p.tokens):`—`})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsxs)(`div`,{className:`viz-card-head`,children:[(0,V.jsx)(`h3`,{children:`Daily tokens`}),(0,V.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Split by`,children:[`model`,`project`,`trigger`].map(e=>(0,V.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:e===`trigger`?`started by`:`by ${e}`},e))})]}),(0,V.jsx)(Qy,{items:m}),(0,V.jsx)(eb,{columns:h,series:m})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Project × model`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`matrix`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Project`}),r.models.map(e=>(0,V.jsxs)(`th`,{className:`num`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:d.model(e)}}),` `,e]},e)),(0,V.jsx)(`th`,{className:`num`,children:`Total`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,title:`Share of tokens used by subagents`,children:`Sub`})]})}),(0,V.jsx)(`tbody`,{children:r.matrix.map(e=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`matrix-row`,children:[(0,V.jsxs)(`td`,{children:[e.roles.length>1&&(0,V.jsx)(`button`,{className:`caret`,"aria-label":`Show roles`,onClick:()=>u(t=>({...t,[e.project]:!t[e.project]})),children:l[e.project]?`▾`:`▸`}),(0,V.jsx)(`button`,{className:`link`,onClick:()=>f({project:e.project}),children:S(e.project)})]}),r.models.map(t=>(0,V.jsx)(`td`,{className:`num`,children:e.byModel[t]?Wy(e.byModel[t]):``},t)),(0,V.jsx)(`td`,{className:`num strong`,children:Wy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(e.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:e.subagentShare?Ky(e.subagentShare):``})]}),l[e.project]&&e.roles.map(e=>(0,V.jsxs)(`tr`,{className:`matrix-sub`,children:[(0,V.jsxs)(`td`,{children:[`↳ `,e.role===`manager`?`managers`:`sessions`]}),r.models.map(t=>(0,V.jsx)(`td`,{className:`num`,children:e.byModel[t]?Wy(e.byModel[t]):``},t)),(0,V.jsx)(`td`,{className:`num`,children:Wy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(e.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:e.subagentShare?Ky(e.subagentShare):``})]},e.role))]},e.project))})]})})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Recent sessions`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Last call`}),(0,V.jsx)(`th`,{children:`Session`}),(0,V.jsx)(`th`,{children:`Project`}),(0,V.jsx)(`th`,{children:`Branch`}),(0,V.jsx)(`th`,{children:`Models`}),(0,V.jsx)(`th`,{className:`num`,children:`Calls`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,children:`Sub`})]})}),(0,V.jsx)(`tbody`,{children:r.recent.map(t=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:Eg(t.lastAt)}),(0,V.jsx)(`td`,{children:(0,V.jsxs)(`button`,{className:`link`,onClick:()=>e(t.sessionId),children:[t.role===`manager`?`Manager · `:``,t.title]})}),(0,V.jsx)(`td`,{children:S(t.project)}),(0,V.jsx)(`td`,{className:`muted`,children:t.branch??``}),(0,V.jsx)(`td`,{className:`muted`,children:t.models.join(`, `)}),(0,V.jsx)(`td`,{className:`num`,children:t.calls}),(0,V.jsx)(`td`,{className:`num`,children:Wy(t.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:t.subagentShare?Ky(t.subagentShare):``})]},t.sessionId))})]})})]}),(0,V.jsx)(Bw,{})]})}function ST(e){try{return sm(localStorage.getItem(`ledung.sidebar.${e}`))}catch{return null}}function CT(e,t){try{t==null?localStorage.removeItem(`ledung.sidebar.${e}`):localStorage.setItem(`ledung.sidebar.${e}`,String(t))}catch{}}function wT(){let[e,t]=(0,v.useState)(()=>window.matchMedia(im).matches),[n,r]=(0,v.useState)({w:window.innerWidth,h:window.innerHeight}),[i,a]=(0,v.useState)(()=>({width:ST(`width`),height:ST(`height`)})),o=e?`height`:`width`;(0,v.useEffect)(()=>{let e=window.matchMedia(im),n=()=>{t(e.matches),r({w:window.innerWidth,h:window.innerHeight})};return e.addEventListener(`change`,n),window.addEventListener(`resize`,n),()=>{e.removeEventListener(`change`,n),window.removeEventListener(`resize`,n)}},[]);let{min:s,max:c,def:l}=am(o,e?n.h:n.w),u=om(i[o]??l,s,c);(0,v.useEffect)(()=>{document.querySelector(`.app`)?.style.setProperty(e?`--sidebar-h`:`--sidebar-w`,`${u}px`)},[u,e]);let d=e=>{CT(o,e),a(t=>({...t,[o]:e}))};return(0,V.jsx)(`div`,{className:`sidebar-resizer ${e?`horizontal`:`vertical`}`,role:`separator`,"aria-label":`Resize the sidebar`,"aria-orientation":e?`horizontal`:`vertical`,"aria-valuenow":u,"aria-valuemin":s,"aria-valuemax":c,tabIndex:0,title:`Drag to resize, double-click to reset`,onPointerDown:e=>{e.button===0&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:t=>{if(!t.currentTarget.hasPointerCapture(t.pointerId))return;let n=t.currentTarget.parentElement.getBoundingClientRect();d(om(e?t.clientY-n.top:t.clientX-n.left,s,c))},onDoubleClick:()=>d(null),onKeyDown:e=>{let t=cm(e.key,o,u,s,c);t!=null&&(e.preventDefault(),d(t))}})}var TT=`ledung.composer.height`,ET=.75;function DT(e,t,n,r,i,a){return Math.ceil(Math.max(e,t*n+r+i,a))}function OT(e,t,n){return{min:e,max:Math.max(e,Math.floor(t*ET-n))}}function kT(e,t,n,r,i){return om(e+(t-n),r,i)}function AT(e,t,n,r){return e===`ArrowUp`?om(t+20,n,r):e===`ArrowDown`?om(t-20,n,r):e===`Home`?n:e===`End`?r:null}function jT(e){try{return sm(e.getItem(TT))}catch{return null}}function MT(e,t){try{t==null?e.removeItem(TT):e.setItem(TT,String(t))}catch{}}function NT(){try{return localStorage}catch{return null}}function PT(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),[n,r]=(0,v.useState)(()=>{let e=NT();return e?jT(e):null}),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{let n=e.current,r=t.current,i=n?.parentElement;if(!n||!r||!i)return null;let a=getComputedStyle(n),o=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)+parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),s=getComputedStyle(r),c=parseFloat(s.lineHeight)||parseFloat(s.fontSize)*1.2,l=n.querySelector(`.composer-buttons`)?.offsetHeight??0;return OT(DT(parseFloat(s.minHeight)||0,c,r.rows,parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),l),i.clientHeight,o)},[]);(0,v.useLayoutEffect)(()=>{let t=e.current?.parentElement;if(!t)return;let n=()=>a(o());n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[o]);let s=n==null?null:i?om(n,i.min,i.max):n,c=e=>{let t=NT();t&&MT(t,e),r(e)},l=(0,v.useRef)(null),u=e=>{e.button===0&&t.current&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),l.current={y:e.clientY,h:t.current.offsetHeight},a(o()))},d=e=>{let t=l.current;t&&i&&e.currentTarget.hasPointerCapture(e.pointerId)&&c(kT(t.h,t.y,e.clientY,i.min,i.max))},f=()=>{l.current=null},p=(0,V.jsx)(`div`,{className:`composer-grip`,role:`separator`,"aria-label":`Resize the message box`,"aria-orientation":`horizontal`,"aria-valuenow":s??void 0,"aria-valuemin":i?.min,"aria-valuemax":i?.max,tabIndex:0,title:`Drag up to make the message box taller, double-click to reset`,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerCancel:f,onDoubleClick:()=>c(null),onKeyDown:e=>{let n=o();if(!n||!t.current)return;let r=AT(e.key,t.current.offsetHeight,n.min,n.max);r!=null&&(e.preventDefault(),c(r))}});return{box:e,area:t,style:s==null?void 0:{height:s},grip:p}}function FT(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length?[...e,...r].sort((e,t)=>e.id-t.id):e}async function IT(e,t){let n=[];for(let r=e;;){let e=await t(r);n.push(...e);let i=e.at(-1)?.id??r;if(e.length<500||i<=r)return n;r=i}}function LT(e){let[t,n]=(0,v.useState)(`connecting`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(0),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(`you`),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)({}),[O,k]=(0,v.useState)([]),[ee,A]=(0,v.useState)([]),[j,M]=(0,v.useState)([]),[te,N]=(0,v.useState)([]),[P,ne]=(0,v.useState)(null),[re,ie]=(0,v.useState)([]),[ae,oe]=(0,v.useState)([]),[se,ce]=(0,v.useState)(null),[le,ue]=(0,v.useState)(null),[de,fe]=(0,v.useState)(null),[pe,me]=(0,v.useState)([]),[he,F]=(0,v.useState)({chats:null,newProjects:null}),[I,ge]=(0,v.useState)([`full`]),[_e,ve]=(0,v.useState)(null),[ye,be]=(0,v.useState)(`Git Bash`),[xe,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)(null),[Te,De]=(0,v.useState)([]),[Oe,ke]=(0,v.useState)(null),[Me,Ne]=(0,v.useState)(null),[Pe,L]=(0,v.useState)([]),[Fe,Ie]=(0,v.useState)([]),[Le,Re]=(0,v.useState)([]),[ze,Be]=(0,v.useState)(!1),[Ve,He]=(0,v.useState)(null),Ue=(0,v.useRef)(null),We=(0,v.useRef)(e);We.current=e;let Ge=(0,v.useRef)({sessionId:null,messages:[]});Ge.current.messages=d;let Ke=(0,v.useCallback)(async e=>{let t=await R.messages(e);We.current===e&&(Ge.current={sessionId:e,messages:t},f(t),m(t.length>=500))},[]),qe=(0,v.useCallback)(async e=>{let t=Ge.current,n=t.messages.at(-1);if(t.sessionId!==e||!n)return Ke(e);let r=await IT(n.id,t=>R.messagesAfter(e,t));We.current===e&&f(e=>FT(e,r))},[Ke]),Je=(0,v.useCallback)(async()=>{let e=We.current,t=d[0];if(!e||!t)return;let n=await R.messages(e,t.id);We.current===e&&(f(e=>[...n,...e]),m(n.length>=500))},[d]);return(0,v.useEffect)(()=>{Ge.current={sessionId:null,messages:[]},f([]),m(!1),e&&Ke(e).catch(()=>{})},[e,Ke]),(0,v.useEffect)(()=>{let e=null,t=500,r=!1,a,s=()=>{n(`connecting`),e=je(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws`),e.onopen=()=>{t=500,n(`open`)},e.onclose=()=>{n(`closed`),r||(a=setTimeout(s,t=Math.min(t*2,1e4)))},e.onmessage=e=>{let t=JSON.parse(e.data);switch(t.type){case`hello`:Ue.current===null?Ue.current=t.build:Ue.current!==t.build&&x(!0),Ee(t.pageKey??null),y(e=>e+1),i(!0),g(t.canRestart),C(t.userName),T(t.source??null),D(Object.fromEntries(t.questions.map(e=>[e.id,e]))),k(t.limits),A(t.usageStops??[]),M(t.macros??[]),fe(t.away??null),o(t.sessions),c(t.projects),we(t.board??null),De(t.github??[]),ge(t.profiles??[`full`]),ve(t.lockdownB??null),be(t.bangShell??`Git Bash`),ke(t.remote??null),Ne(t.chats??null),L(t.computers??[]),Ie(t.newComputers??[]),Re(t.linkPairings??[]),Be(t.throughPublicName??!1),He(t.config??null),u(Object.fromEntries(t.permissions.map(e=>[e.id,e]))),We.current&&qe(We.current).catch(()=>{}),R.machine().then(ue,()=>{}),R.accounts().then(e=>{me(e.accounts),Se(e.defaultIdentity),F(e.choices),N(e.signedOut??[]),ne(e.claudeProblem??null),ie(e.claudeLooked??[]),oe(e.configFileProblems??[])},()=>{});break;case`session`:o(e=>e.findIndex(e=>e.id===t.session.id)===-1?[t.session,...e]:e.map(e=>e.id===t.session.id?t.session:e));break;case`limits`:k(t.limits);break;case`macros`:M(t.macros);break;case`usageStops`:A(t.usageStops);break;case`config`:He(t.config);break;case`projects`:c(t.projects);break;case`accounts`:me(t.accounts),Se(t.defaultIdentity),F(t.choices),N(t.signedOut??[]),ne(t.claudeProblem??null),ie(t.claudeLooked??[]),oe(t.configFileProblems??[]);break;case`board`:we(t.board);break;case`github`:De(t.github);break;case`remote`:ke(t.remote);break;case`newComputers`:Ie(t.computers);break;case`linkPairings`:Re(t.pairings);break;case`chats`:Ne(t.chats);break;case`computers`:L(t.computers);break;case`machine`:ue(t.machine);break;case`away`:fe(t.away);break;case`question`:D(e=>({...e,[t.question.id]:t.question}));break;case`permission`:u(e=>({...e,[t.permission.id]:t.permission}));break;case`message`:t.message.sessionId===We.current&&f(e=>e.some(e=>e.id===t.message.id)?e:[...e,t.message])}}};return s(),Ae(()=>{r||(clearTimeout(a),e&&(e.onopen=e.onclose=e.onmessage=null,e.close()),t=500,s())}),()=>{r=!0,Ae(null),clearTimeout(a),e?.close()}},[qe]),(0,v.useEffect)(()=>{let e=!0,t=()=>R.overview().then(t=>e&&ce(t),()=>{});t();let n=setInterval(t,2e4);return()=>{e=!1,clearInterval(n)}},[]),{connection:t,loaded:r,canRestart:h,hellos:_,updated:b,userName:S,source:w,questions:E,limits:O,usageStops:ee,macros:j,signedOut:te,claudeProblem:P,claudeLooked:re,accountProblems:ae,overview:se,machine:le,away:de,accounts:pe,accountChoices:he,defaultIdentity:xe,board:Ce,github:Te,remote:Oe,computers:Pe,newComputers:Fe,linkPairings:Le,throughPublicName:ze,configStatus:Ve,chats:Me,profiles:I,lockdownB:_e,bangShell:ye,sessions:a,projects:s,permissions:l,messages:d,hasEarlier:p,loadEarlier:Je}}var RT=(e,t=140)=>{let n=e.split(`
|
|
106
|
-
`).map(e=>e.trim()).find(Boolean)??``;return n.length>t?`${n.slice(0,t-1)}…`:n},zT=e=>typeof e==`string`?e:``;function BT(e){let t=e.input.questions;return RT(zT(Array.isArray(t)?t[0]?.question:void 0)||e.title||zT(e.input.command)||zT(e.input.file_path)||e.reason||``)}function VT(e,t,n){return[...e.filter(ny).map(e=>({id:`q${e.id}`,sessionId:e.sessionId,title:`Question from ${n(e.sessionId)}`,body:RT(e.question)})),...t.filter(ry).map(e=>{let t=BT(e);return{id:`p${e.id}`,sessionId:e.sessionId,title:e.toolName===`AskUserQuestion`?`Question from ${n(e.sessionId)}`:`Permission: ${e.toolName} in ${n(e.sessionId)}`,body:e.sensitive?`Sensitive${t?`: ${t}`:``}`:t}})]}var HT={five_hour:`5-hour`,seven_day:`weekly`};function UT(e){return e.filter(e=>e.holding).map(e=>({id:`stop:${e.account}:${e.kind}:${e.resetsAt??``}`,sessionId:`settings`,title:`Usage stop reached: ${HT[e.kind]??e.kind} ${e.percent}%`,body:`New turns${e.account==="default"?``:` on account ${e.account}`} are held until you lift it in Settings${e.resetsAt?` or the window resets`:``}.`}))}function WT(e,t){let n=new Set(t.map(e=>e.id));return e?{show:t.filter(t=>!e.has(t.id)),close:[...e].filter(e=>!n.has(e)),open:n}:{show:[],close:[],open:n}}var GT=()=>window.isSecureContext&&`Notification`in window,KT=`ledung.notify`,qT=()=>{try{return localStorage.getItem(KT)===`1`}catch{return!1}};function JT(e){let t=GT(),[n,r]=(0,v.useState)(qT),[i,a]=(0,v.useState)(t?Notification.permission:`default`),o=t&&n&&i===`granted`,s=(0,v.useRef)(null),c=(0,v.useRef)(new Map),l=(0,v.useRef)(e.onOpenSession);return l.current=e.onOpenSession,(0,v.useEffect)(()=>{if(!e.loaded)return;let t=WT(s.current,[...VT(e.questions,e.permissions,t=>e.sessions.find(e=>e.id===t)?.title??`a session`),...UT(e.usageStops)]);s.current=t.open;for(let e of t.close)c.current.get(e)?.close(),c.current.delete(e);if(!(!o||!document.hidden&&document.hasFocus()))for(let e of t.show)try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),l.current(e.sessionId),t.close()},t.onclose=()=>{c.current.get(e.id)===t&&c.current.delete(e.id)},c.current.set(e.id,t)}catch{}},[e.loaded,e.questions,e.permissions,e.sessions,e.usageStops,o]),{possible:t,on:o,denied:t&&i===`denied`,set:async e=>{if(!e){r(!1);try{localStorage.setItem(KT,`0`)}catch{}return}let t=Notification.permission===`granted`?`granted`:await Notification.requestPermission();a(t);let n=t===`granted`;r(n);try{localStorage.setItem(KT,n?`1`:`0`)}catch{}}}}function YT(e,t){return e.key!==`Enter`||e.isComposing?!1:t?e.ctrlKey||e.metaKey:!e.shiftKey}var XT=80;function ZT(e,t,n){if(Math.abs(n-1)>.01)return 0;let r=Math.round(e-t);return r>=XT?r:0}var QT=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function $T(e){if(!e)return!1;if(e.isContentEditable)return!0;let t=e.tagName.toUpperCase();return e.readOnly||e.disabled?!1:t===`TEXTAREA`||t===`INPUT`&&!QT.has((e.type??`text`).toLowerCase())}var eE=400;function tE(e){let t=e.visualViewport;if(!t)return;let n=e.document,r=n.documentElement,i=0,a=()=>{let a=$T(n.activeElement)?ZT(r.clientHeight,t.height,t.scale):0;a!==i&&(i=a,a?r.style.setProperty(`--kb`,`${a}px`):r.style.removeProperty(`--kb`)),a&&(e.scrollY>0||t.offsetTop>0)&&e.scrollTo(0,0)},o=()=>{e.setTimeout(a,0),e.setTimeout(a,eE)};t.addEventListener(`resize`,a),t.addEventListener(`scroll`,a),n.addEventListener(`focusin`,o),n.addEventListener(`focusout`,o),n.addEventListener(`visibilitychange`,o);for(let t of[`resize`,`orientationchange`,`focus`,`pageshow`])e.addEventListener(t,o);a()}var nE=(0,V.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,"aria-hidden":`true`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,V.jsx)(`path`,{d:`M1.5 8h13M8 1.5c2 2 2.6 4 2.6 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.4 5.5 5.4 8S6 12.5 8 14.5`})]});function rE(e){return(0,V.jsxs)(V.Fragment,{children:[nE,`Remote`,e&&(0,V.jsxs)(`span`,{className:`long`,children:[`\xA0`,`· `,e]})]})}function iE({frame:e,shown:t=null,onShow:n,waiting:r=0}){let{tabs:i,remote:a,here:o}=e;return i?(0,V.jsxs)(`nav`,{className:`ctabs`,"aria-label":`Computers`,children:[i.map(e=>{let i=Ut(e,t,r),a=i?(0,V.jsx)(`span`,{className:`badge`,title:`${i} waiting for you on ${e.name}`,"aria-label":`${i} waiting for you`,children:i}):null,o=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`sw`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`nm`,children:e.name}),a]}),s=e.here?t===null:t===e.id;return e.here?s||!n?(0,V.jsx)(`span`,{className:`ctab on`,style:Bt(e),"aria-current":`page`,children:o},e.id):(0,V.jsx)(`button`,{type:`button`,className:`ctab`,style:Bt(e),onClick:()=>n(null),children:o},e.id):e.url?(0,V.jsx)(`a`,{className:`ctab${s?` on`:``}`,style:Bt(e),href:e.url,target:`_blank`,rel:`noopener noreferrer`,title:`${e.name}'s Ledung, ${new URL(e.url).host}`,"aria-current":s?`page`:void 0,onClick:t=>{n&&Ht(t)&&(t.preventDefault(),n(e.id))},children:o},e.id):null}),(0,V.jsx)(`span`,{className:`spacer`}),a&&(0,V.jsx)(`span`,{className:`remote-tag`,role:`status`,children:rE(o?.name)})]}):a?(0,V.jsx)(`div`,{className:`remote-band`,role:`status`,children:rE(o?.name)}):null}function aE({computers:e,opened:t,shown:n,throughPublicName:r=!1,framed:i=!1}){let[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)({}),l=(0,v.useRef)({}),u=(0,v.useRef)({}),d=e.filter(e=>!e.here&&e.url&&t.includes(e.id));(0,v.useEffect)(()=>{let e=e=>{for(let t of d)tn({data:e.data,origin:e.origin,fromFrame:e.source===l.current[t.id]?.contentWindow},{id:t.id,url:t.url},localStorage,t=>e.source.postMessage(t,e.origin))&&(clearTimeout(u.current[t.id]),c(e=>({...e,[t.id]:`paired`})))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)}),(0,v.useEffect)(()=>()=>Object.values(u.current).forEach(clearTimeout),[]);let f=e=>{clearTimeout(u.current[e.id]),c(t=>({...t,[e.id]:`unknown`})),l.current[e.id]?.contentWindow?.postMessage(Ft(),new URL(e.url).origin),u.current[e.id]=setTimeout(()=>c(t=>({...t,[e.id]:`not-paired`})),jt)};return d.length?(0,V.jsx)(V.Fragment,{children:d.map(e=>(0,V.jsxs)(`div`,{className:`cframe-box`,hidden:n!==e.id,children:[Pt(e,r,i,s[e.id]??`unknown`)&&!a[e.id]&&(0,V.jsx)(oE,{computer:e,onCode:t=>o(n=>({...n,[e.id]:t}))}),a[e.id]?(0,V.jsx)(`iframe`,{className:`cframe`,style:Bt(e),src:a[e.id],title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`},`pairing`):(0,V.jsx)(`iframe`,{className:`cframe`,style:Bt(e),src:e.url,title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`,ref:t=>{l.current[e.id]=t},onLoad:()=>f(e)},`page`)]},e.id))}):null}function oE({computer:e,onCode:t}){let[n,r]=(0,v.useState)(`offer`),[i,a]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{className:`cframe-bar`,style:Bt(e),role:n===`offer`?void 0:`alertdialog`,"aria-label":`Pair through the link with ${e.name}`,children:[n===`offer`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{children:[`Not paired with `,e.name,` in this tab? It is linked with this computer.`]}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:()=>r(`confirm`),children:`Pair through the link`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{children:[`Pair this browser with `,(0,V.jsx)(`b`,{children:e.name}),` through the link? It can then look at `,e.name,`'s sessions, and change nothing until it sets up its passkey and logs on there with Touch ID or Windows Hello. `,e.name,` shows the pairing.`]}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>{r(`busy`),a(null),R.linkDevicePair(e.id).then(({url:e})=>t(e),e=>{a(e.message),r(`offer`)})},children:n===`busy`?`Pairing…`:`Pair`}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>r(`offer`),children:`Cancel`})]}),i&&(0,V.jsx)(`span`,{className:`restart-problem`,children:i})]})}function sE(e,t){(0,v.useEffect)(()=>{if(t)return;let n=()=>{let t=zt(location.hash);t&&(history.replaceState(history.state,``,location.pathname+location.search),e(t))};return n(),window.addEventListener(`hashchange`,n),()=>window.removeEventListener(`hashchange`,n)},[])}var cE=`Removed projects`;function lE(e,t,n){return t===cE?!n.has(e.project)&&e.project!==`~chats`:e.project===t}var uE=Vt();uE&&window.addEventListener(`message`,e=>{let t=It(e.data,e.source===window.parent);t&&window.parent.postMessage(t,e.origin)});var dE={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`},fE={default:`Every action that needs permission asks you.`,acceptEdits:`File edits go through; commands still ask you.`,auto:`Routine actions are approved automatically; you are asked about the rest.`,plan:`Read-only: Claude plans but changes nothing.`},pE=[`waiting`,`usage`,`overview`,`board`,`settings`,`add`,`accounts`,`chat`,`chats`],mE=e=>!!e&&!pE.includes(e)&&!e.includes(`:`);function hE(){let e=location.hash.match(/^#\/waiting\/q\/(\d+)$/);if(e)return`q:${e[1]}`;let t=TC(location.hash);if(t)return SC(t.repo,t.id);let n=location.hash.match(/^#\/(waiting|usage|overview|board|settings|add|accounts|chat|chats)$/);if(n)return n[1];let r=location.hash.match(/^#\/(settings|chats)\/([a-z]+)$/);if(r)return`${r[1]}:${r[2]}`;let i=location.hash.match(/^#\/ps\/([^/]+)\/([a-z]+)$/);if(i)return`ps:${decodeURIComponent(i[1])}/${i[2]}`;let a=location.hash.match(/^#\/(p|ps|a)\/(.+)$/);return a?`${a[1]}:${decodeURIComponent(a[2])}`:(bg(location.hash)??Sg(location.hash))?.sessionId??null}function gE(e){if(!e)return``;if(pE.includes(e))return`#/${e}`;let t=CC(e);if(t)return wC(t.repo,t.id);if(e.startsWith(`q:`))return`#/waiting/q/${e.slice(2)}`;if(e.startsWith(`settings:`))return`#/settings/${e.slice(9)}`;if(e.startsWith(`chats:`))return`#/chats/${e.slice(6)}`;let n=wp(e);if(n?.project!=null&&n.group)return`#/ps/${encodeURIComponent(n.project)}/${n.group}`;let r=e.match(/^(p|ps|a):(.+)$/);return r?`#/${r[1]}/${encodeURIComponent(r[2])}`:`#/s/${e}`}var _E=()=>history.state??{},vE=()=>Number(_E().ledungDesk??0),yE=()=>_E().ledungDeskRoot===!0;function bE(e){Kh(e)&&_E().ledungDesk===void 0&&history.replaceState({..._E(),ledungDesk:0,ledungDeskRoot:!0},``)}function xE(){let e=history.state??{};return{depth:Number(e.ledungSettings??0),root:e.ledungSettingsRoot===!0}}function SE(e){mw(e)&&(history.state??{}).ledungSettings===void 0&&history.replaceState({...history.state??{},ledungSettings:1,ledungSettingsRoot:!0},``)}var CE=`ledung.waitingSidebar`;function wE(e){try{return localStorage.getItem(`ledung.technical.${e}`)===`1`}catch{return!1}}function TE(){let[e,t]=(0,v.useState)(hE()),[n,r]=(0,v.useState)(location.hash),i=LT(mE(e)?e:null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)([]);sE(e=>{c(e),u(t=>t.includes(e)?t:[...t,e])},uE),(0,v.useEffect)(()=>{bE(hE()),SE(hE());let e=()=>{bE(hE()),SE(hE()),t(hE()),r(location.hash)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let d=n=>{let i=gE(n);if(i!==location.hash){let t=qh(e,{depth:vE(),root:yE()},n),r=hw(e,xE(),n);location.hash=i,history.replaceState({...history.state??{},ledungDesk:t.depth,ledungDeskRoot:t.root,ledungSettings:r.depth,ledungSettingsRoot:r.root,ledungFromList:e===null},``)}t(n),r(location.hash)},f=e=>{history.replaceState(history.state,``,gE(e)),t(e),r(location.hash)},p=(n,a)=>{let o=i.questions[n];if(!o)return;let s=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0,c=a??vg(o);location.hash=yg(c,n),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:s},``),t(c),r(location.hash)},m=(n,a)=>{let o=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0;location.hash=xg(n,a),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:o},``),t(n),r(location.hash)},h=()=>{let e=vE();e>0&&!yE()?history.go(-e):d(bw(window.matchMedia(im).matches))},g=()=>{`back`in yw(history.state)?history.back():d(null)},_=()=>{`back`in Jh(vE())?history.back():d(`waiting`)},y=()=>{let e=gw(xE());`back`in e?history.go(-e.back):d(null)},b=mw(e),x=(0,v.useRef)(y);x.current=y,(0,v.useEffect)(()=>{if(!b)return;let e=e=>{_w(e)&&(e.preventDefault(),x.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[b]),(0,v.useEffect)(()=>{let e=e=>{if(e.button!==3&&e.button!==4)return;let t=location.href,n=e.button===3;setTimeout(()=>{location.href===t&&(n?history.back():history.forward())},100)};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let[C,w]=(0,v.useState)(()=>{try{return localStorage.getItem(CE)===`hidden`}catch{return!1}}),T=()=>{w(!C);try{localStorage.setItem(CE,C?`shown`:`hidden`)}catch{}},E=Kh(e)&&C,D=(0,v.useMemo)(()=>Object.values(i.questions).sort((e,t)=>t.id-e.id),[i.questions]),O=(0,v.useMemo)(()=>Object.values(i.permissions),[i.permissions]),k=iy(D,O)+i.newComputers.length+i.linkPairings.length,ee=lS(),A=JT({loaded:i.loaded,questions:D,permissions:O,sessions:i.sessions,usageStops:i.usageStops,onOpenSession:d});(0,v.useEffect)(()=>{document.title=k?`(${k}) Project Ledung`:`Project Ledung`},[k]);let j=(0,v.useMemo)(()=>{let e={};for(let t of O)t.status===`pending`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);for(let t of D)t.status===`open`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);return e},[O,D]),M=i.sessions.find(t=>t.id===e)??null,te=Op(e),N=te?.startsWith(`ps:`)?i.projects.find(e=>e.name===te.slice(3)):void 0,P=te===`ledung`?t=>(0,V.jsx)(nC,{view:e,update:t,run:oe,board:i.board,remote:i.remote,throughPublicName:i.throughPublicName,newComputers:i.newComputers,projects:i.projects,computers:i.computers,sessions:i.sessions,accounts:i.accounts,accountChoices:i.accountChoices,defaultIdentity:i.defaultIdentity,accountProblems:i.accountProblems,usageStops:i.usageStops,macros:i.macros,canRestart:i.canRestart,source:i.source,config:i.configStatus,hellos:i.hellos,notify:A,onOpen:d}):te===`add`?()=>(0,V.jsx)(qm,{run:oe,accounts:i.accounts,defaultAccount:i.accountChoices.newProjects,profiles:i.profiles,lockdownB:i.lockdownB,onAdded:e=>d(e.managerId??`p:${e.name}`)}):te===`chats`?()=>(0,V.jsx)(Qm,{view:e,chats:i.chats,run:oe,onOpen:d}):N?()=>(0,V.jsx)(Jm,{view:e,board:i.board,projects:i.projects,project:N,run:oe,accounts:i.accounts,profiles:N.profileNames??i.profiles,lockdownB:i.lockdownB,onOpen:d,onRemoved:()=>d(null),onRenamed:f},N.name):null,[ne,re]=(0,v.useState)(()=>{try{return localStorage.getItem(`ledung.limitAccount`)}catch{return null}}),ie=Ry(e,i.sessions,i.projects,ne),ae=ie.account;(0,v.useEffect)(()=>{if(ie.remember&&ie.account!==ne){re(ie.account);try{localStorage.setItem(`ledung.limitAccount`,ie.account)}catch{}}},[ie.remember,ie.account,ne]);let oe=async e=>{o(null);try{await e()}catch(e){o(e.message)}},se=(0,V.jsxs)(V.Fragment,{children:[i.updated&&(0,V.jsxs)(`div`,{className:`banner updated`,children:[(0,V.jsx)(`span`,{children:`Ledung was updated — reload`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>location.reload(),children:`Reload`})]}),i.away&&gb(i.away,M)&&(0,V.jsx)(pb,{away:i.away,run:oe}),ee.notice&&(0,V.jsx)(dS,{app:ee,run:oe}),(0,V.jsx)(ES,{run:oe}),i.usageStops.filter(e=>e.holding).map(e=>(0,V.jsxs)(`div`,{className:`banner updated`,children:[(0,V.jsx)(`span`,{children:ky(e)}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void oe(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(bp(`usageStop`)),children:`Settings`})]},`${e.account}:${e.kind}`)),i.claudeProblem&&(0,V.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,V.jsx)(`span`,{children:(0,V.jsx)(Eb,{text:i.claudeProblem})}),(0,V.jsx)(Tb,{check:async()=>!!(await R.checkSignIn()).claudeProblem}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(bp(`claudeProblem`)),children:`Settings`}),i.claudeLooked.length>0&&(0,V.jsx)(Db,{looked:i.claudeLooked})]}),i.configStatus?.problem&&(0,V.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,V.jsxs)(`span`,{children:[`The config file was changed but not applied: `,i.configStatus.problem]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(bp(`configProblem`)),children:`Settings`})]}),i.signedOut.map(e=>(0,V.jsxs)(`div`,{className:`banner updated signin`,children:[(0,V.jsx)(`span`,{children:e.help.split("`").map((e,t)=>t%2?(0,V.jsx)(`code`,{children:e},t):e)}),(0,V.jsx)(Tb,{check:async()=>!!(await R.checkSignIn()).signedOut?.some(t=>t.account===e.account)}),e.account!=="default"&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(`settings:claude`),children:`Accounts`})]},`signin:${e.account}`)),a&&(0,V.jsxs)(`div`,{className:`banner error`,onClick:()=>o(null),children:[a,` `,(0,V.jsx)(`span`,{className:`muted`,children:`(click to dismiss)`})]})]}),ce=At(i.computers,i.throughPublicName,uE),le=Rt(i.computers,s);return(0,V.jsxs)(`div`,{className:`page${ce.remote?` remote`:``}`,style:Bt(ce.here),children:[(0,V.jsx)(iE,{frame:ce,shown:le,onShow:e=>{c(e),e&&!l.includes(e)&&u(t=>[...t,e])},waiting:k}),(0,V.jsx)(aE,{computers:i.computers,opened:l,shown:le,throughPublicName:i.throughPublicName,framed:uE}),(0,V.jsxs)(`div`,{className:`app ${vw(e)}${E?` no-sidebar`:``}`,hidden:le!==null,children:[e===null&&(0,V.jsx)(`div`,{className:`phone-banners`,children:se}),(0,V.jsx)(EE,{sessions:i.sessions,projects:i.projects,chats:i.chats,pending:j,waiting:k,limits:i.limits,usageStops:i.usageStops,github:i.github,stripAccount:ae,overview:i.overview,machine:i.machine,run:oe,openId:e,onOpen:d,onCloseSettings:y,profiles:i.profiles,onStart:(e,t)=>oe(async()=>d((await R.start(e,t)).id)),connection:i.connection,board:i.board}),!E&&(0,V.jsx)(wT,{}),(0,V.jsxs)(`main`,{className:`main`,children:[se,e!==null&&!M&&(0,V.jsx)(`div`,{className:`phone-bar`,children:(0,V.jsx)(`button`,{className:`phone-back`,onClick:g,children:`← List`})}),e===`usage`||e===`overview`?(0,V.jsx)(bT,{sessionsOpen:e===`overview`,onSessions:e=>d(e?`overview`:`usage`),sessions:i.sessions,overview:i.overview,machine:i.machine,waitingBySession:j,onOpenSession:d}):Kh(e)?(0,V.jsx)(sy,{questions:D,permissions:O,sessions:i.sessions,projects:i.projects,chats:i.chats,userName:i.userName,questionId:e?.startsWith(`q:`)?Number(e.slice(2)):null,onOpenQuestion:e=>d(e===null?`waiting`:`q:${e}`),onOpenSession:d,onGoToConversation:p,onGoToMessage:m,onClose:h,onLeaveShots:_,sidebarHidden:C,onToggleSidebar:T,newComputers:i.newComputers,linkPairings:i.linkPairings,run:oe}):e===`board`?(0,V.jsx)(IC,{board:i.board,onOpen:d,onOpenSettings:()=>d(`settings`)}):CC(e)?(0,V.jsx)(RC,{repo:CC(e).repo,id:CC(e).id,board:i.board,projects:i.projects,onOpen:d,onBack:()=>d(`board`)},e):P?(0,V.jsx)(Vp,{view:e,projects:i.projects,source:i.source,canRestart:i.canRestart,hellos:i.hellos,onOpen:d,children:P}):e===`chat`?(0,V.jsx)(Zm,{chats:i.chats,profiles:i.profiles,run:oe,onStarted:d}):e?.startsWith(`a:`)?(0,V.jsx)(cb,{title:S(e.slice(2)),sessions:i.sessions.filter(t=>t.archivedAt&&lE(t,e.slice(2),new Set(i.projects.map(e=>e.name)))),overview:i.overview,run:oe,onOpenSession:d},e):e?.startsWith(`p:`)&&i.projects.some(t=>t.name===e.slice(2))?(0,V.jsx)(Ym,{project:i.projects.find(t=>t.name===e.slice(2)),run:oe,onStarted:d},e):M?(0,V.jsx)(DE,{session:M,ledung:i,pendingCount:j[M.id]??0,run:oe,focusQuestion:bg(n)?.questionId??null,focusMessage:Sg(n)?.messageId??null,cameFrom:_E().ledungFrom??null,onOpenQuestion:e=>d(`q:${e}`),onOpenBoardThread:(e,t)=>d(SC(e,t)),onBack:g},M.id):(0,V.jsxs)(`div`,{className:`empty`,children:[(0,V.jsx)(`h1`,{children:`Project Ledung`}),(0,V.jsx)(`p`,{children:i.projects.length?`Open a project on the left to talk to its manager.`:`No projects yet. Add one to start talking to its manager.`}),(0,V.jsxs)(`div`,{className:`empty-actions`,children:[!i.projects.length&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>d(`add`),children:`Add a project`}),(0,V.jsx)(`button`,{onClick:()=>d(`chat`),children:`New chat`}),(0,V.jsx)(`button`,{onClick:()=>d(`settings`),children:`Settings`})]})]})]})]})]})}function EE(e){let t=e.sessions.filter(e=>!e.archivedAt),n=e=>t.filter(t=>t.parentId===e).sort(UC),r=new Set(e.projects.map(e=>e.name)),i=(e,t,r)=>[{s:e,depth:0,drag:t},...n(e.id).map(t=>({s:t,depth:1,drag:r?`c:${e.id}`:null}))],a=(e,n,r)=>{let a=new Set(t.filter(e).map(e=>e.id)),o=n?t.find(e=>e.id===n):void 0,s=t.filter(t=>e(t)&&t.id!==n&&(!t.parentId||!a.has(t.parentId))).sort(UC);return[...o?i(o,null,!!r):[],...s.flatMap(e=>i(e,r?`t:${r}`:null,!!r))]},o=[{name:x,project:null,rows:a(e=>e.project===x,null,x)},...e.projects.map(e=>({name:e.name,project:e,rows:a(t=>t.project===e.name,e.managerId,e.name)})),{name:cE,project:null,rows:a(e=>!r.has(e.project)&&e.project!==`~chats`,null,null)}].map(t=>({...t,archived:e.sessions.filter(e=>e.archivedAt&&lE(e,t.name,r)).length})).filter(e=>e.project||e.name===`~chats`||e.rows.length||e.archived),[s,c]=(0,v.useState)(()=>aw(localStorage)),[l,u]=(0,v.useState)(()=>sw(localStorage)),d=e=>c(t=>{let n=lw(t,e,e=>e===cE||e===`~chats`||r.has(e));return ow(localStorage,n),n}),f=e=>u(n=>{let r=lw(n,e,e=>t.some(t=>t.id===e));return cw(localStorage,r),r}),p=(e,t)=>e&&e.count>0&&(0,V.jsxs)(`span`,{className:`hidden-count${e.working?` working`:``}`,title:`${e.count} ${t} hidden${e.working?`, at least one working`:``}`,children:[e.working&&(0,V.jsx)(`span`,{className:`dot running`}),`+`,e.count]}),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),S=(t,n)=>{if(n.length<=1)return e.onStart(t);b(``),h(m===t?null:t)},{nav:C,drag:w,handlers:T}=QC((t,n)=>void e.run(()=>t===`projects`?R.orderProjects(n):R.orderSessions(n))),E=e=>{if(!w||w.slot===null||w.group===`projects`)return null;let t=e.filter(e=>e.drag===w.group);return t.length?w.slot<t.length?{before:t[w.slot].s.id}:{after:w.group.startsWith(`t:`)?e[e.length-1].s.id:t[t.length-1].s.id}:null},D=o.filter(e=>e.project).map(e=>e.name),O=w?.group===`projects`&&w.slot!==null?w.slot<D.length?{before:D[w.slot]}:{after:D[D.length-1]}:null,k=(0,V.jsx)(`div`,{className:`drop-marker${w?.group.startsWith(`c:`)?` child`:``}`,"aria-hidden":`true`}),[ee]=kx(),[A]=Fx(),j=wt(A),[M]=Vx(),te=({s:t,depth:n,drag:r,hidden:i,folds:a,folded:o})=>{let s=`${Eg(t.createdAt)}${t.backgroundTasks>0?` · ${t.backgroundTasks} in background`:``}`,c=(()=>{let n=e.overview?.sessions[t.id]?.today??0,r=t.role===`manager`?e.sessions.filter(e=>e.parentId===t.id).reduce((t,n)=>t+(e.overview?.sessions[n.id]?.today??0),n):n,i=Uw(t),a=t.status===`ended`?void 0:e.machine?.sessions[t.id],o=e.machine?.line.indexOf(t.id)??-1;return[t.project===`~chats`&&t.workDir?`in ${t.workDir.split(/[\\/]/).filter(Boolean).pop()}`:``,o>=0?`number ${o+1} in line`:``,t.paused?`paused`:``,t.priority===`normal`?``:Fw[t.priority].toLowerCase(),a&&(a.cores>=.05||a.memBytes>0)?`${Mw(a.cores)} · ${Nw(a.memBytes)}`:``,r?`${Wy(r)}${t.role===`manager`&&r!==n?` team`:``} today`:``,i!=null&&t.status!==`ended`?`ctx ${Ky(i)}`:``,t.pr?qy(t.pr):t.branch??``].filter(Boolean).join(` · `)})();return(0,V.jsxs)(`div`,{className:`session-row`,children:[a&&(0,V.jsx)(`button`,{className:`fold-caret session-caret`,"aria-expanded":!o,"aria-label":`${o?`Unfold`:`Fold`} the sessions of ${t.title}`,title:o?`Show the sessions it runs`:`Fold the sessions it runs away`,onClick:()=>f(t.id),children:o?`▸`:`▾`}),g===t.id?(0,V.jsx)(`div`,{className:`session-item renaming${t.id===e.openId?` open`:``}${n?` child`:``}`,children:(0,V.jsx)(HC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>_(null),onSave:n=>e.run(()=>R.rename(t.id,n))})}):(0,V.jsxs)(`button`,{className:`session-item${t.id===e.openId?` open`:``}${n?` child`:``}${w?.id===t.id?` dragging`:``}${mt(ee,t).ended?` ended-row`:``}`,title:Tt(A,mt(ee,t).tooltip,s,c),onClick:()=>e.onOpen(t.id),onDoubleClick:()=>_(t.id),"data-drag":r??void 0,"data-drag-id":r?t.id:void 0,children:[mt(ee,t).dot&&(0,V.jsx)(`span`,{className:`dot ${ut(t)}`,title:lt[t.status]}),(0,V.jsxs)(`span`,{className:`session-text`,children:[(0,V.jsxs)(`span`,{className:`session-title`,children:[t.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,(0,V.jsx)(fp,{colour:hp(t,Mv(e.projects,e.chats)),children:t.title})]}),j.time&&(0,V.jsx)(`span`,{className:`session-sub`,children:s}),j.usage&&c&&(0,V.jsx)(`span`,{className:`session-sub usage-line`,children:c})]}),(()=>{let n=j_(t,e.sessions);return n&&(0,V.jsx)(`span`,{className:`session-ship ${ut(t)}`,children:(0,V.jsx)(B_,{mode:n,width:10,sizeButton:!1,hideWhenSunk:!0,maxSize:j.shipMax})})})(),p(i,i?.count===1?`sub-session`:`sub-sessions`),(e.pending[t.id]??0)+(i?.pending??0)?(0,V.jsx)(`span`,{className:`badge`,children:(e.pending[t.id]??0)+(i?.pending??0)}):null]})]})},N=Fe(e.connection);return(0,V.jsxs)(`aside`,{className:`sidebar`,children:[(0,V.jsx)(ob,{account:e.stripAccount,limits:e.limits,stops:e.usageStops,run:e.run}),dw(e.github,Date.now()).map(e=>(0,V.jsx)(`div`,{className:`github-budget muted ${fw(e)}`,title:`What is left of the GitHub budget Ledung's pull request checks use (the worst of GitHub's readings). Under 20 % left they run every 10 minutes, under 5 % not until the reset.`,children:uw(e,e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}))},`${e.container??``} ${e.host}`)),(0,V.jsx)(Lw,{machine:e.machine,sessions:e.sessions,onOpen:e.onOpen,run:e.run}),(0,V.jsxs)(`button`,{className:`waiting-entry${Kh(e.openId)?` open`:``}${e.waiting?` has-items`:``}`,onClick:()=>e.onOpen(`waiting`),children:[(0,V.jsx)(`span`,{children:`Waiting for you`}),e.waiting?(0,V.jsx)(`span`,{className:`badge`,children:e.waiting}):(0,V.jsx)(`span`,{className:`muted`,children:`nothing`})]}),(0,V.jsxs)(`nav`,{className:`session-list`,"data-compact":A>1?A:void 0,ref:C,...T,children:[!e.projects.length&&(0,V.jsx)(`p`,{className:`muted project-empty`,children:`No projects yet. Add one in Settings (⚙ below).`}),o.map(t=>({...t,isFolded:s.includes(t.name),view:nw(t.rows,{foldedSessions:l,folded:s.includes(t.name),openId:e.openId,pending:e.pending})})).map(t=>(0,V.jsxs)(v.Fragment,{children:[O?.before===t.name&&k,(0,V.jsx)(`div`,{className:`project-group${w?.group===`projects`&&w.id===t.name?` dragging`:``}`,children:(0,V.jsxs)($f,{level:qf(t.project),children:[(0,V.jsxs)(`div`,{className:`project-row`,children:[(0,V.jsx)(`button`,{className:`fold-caret`,"aria-expanded":!t.isFolded,"aria-label":`${t.isFolded?`Unfold`:`Fold`} ${t.name}`,title:t.isFolded?`Show its sessions`:`Fold its sessions away`,onClick:()=>d(t.name),children:t.isFolded?`▸`:`▾`}),t.project?(0,V.jsx)(`button`,{className:`project-name${e.openId===`p:${t.name}`||t.project.managerId&&e.openId===t.project.managerId?` open`:``}`,title:`${t.project.where}${t.project.managerId?``:` · manager not started yet`}`,onClick:()=>e.onOpen(t.project.managerId??`p:${t.name}`),"data-drag":`projects`,"data-drag-id":t.name,children:(()=>{let e=By(t.project.account),n=(0,V.jsx)(fp,{colour:t.project.colours.manager,children:t.name});return e?(0,V.jsxs)(`span`,{className:`project-name-stack`,children:[(0,V.jsx)(`span`,{className:`project-account`,title:`Runs on the Claude account ${e}`,children:e}),(0,V.jsx)(`span`,{className:`project-name-text`,children:n})]}):n})()}):t.name===`~chats`?(0,V.jsx)(`button`,{className:`project-name${e.openId===`chat`?` open`:``}`,title:`Sessions of your own with no project, workflow or manager`,onClick:()=>e.onOpen(`chat`),children:(0,V.jsx)(fp,{colour:e.chats?.colour??null,children:`Chats`})}):(0,V.jsx)(`span`,{className:`project-name muted`,children:t.name}),p(t.view.project,t.view.project?.count===1?`session`:`sessions`),t.view.project?.pending?(0,V.jsx)(`span`,{className:`badge`,children:t.view.project.pending}):null,t.name===`~chats`&&(0,V.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,V.jsx)(`button`,{className:`mini`,title:`New chat`,"aria-label":`New chat`,onClick:()=>e.onOpen(`chat`),children:`+`}):(0,V.jsx)(`button`,{className:`small`,title:`A Claude Code session of your own, with no project`,onClick:()=>e.onOpen(`chat`),children:`+ Chat`}),(0,V.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${Op(e.openId)===`chats`?` on`:``}`,title:`Chats settings`,"aria-label":`Settings of chats`,onClick:()=>e.onOpen(`chats`),children:`⚙`})]}),t.project&&(0,V.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,V.jsx)(`button`,{className:`mini`,title:`New session in ${t.name}`,"aria-label":`New session in ${t.name}`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+`}):(0,V.jsx)(`button`,{className:`small`,title:`A session of your own in this project, outside its manager`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+ Session`}),(0,V.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${Op(e.openId)===`ps:${t.name}`?` on`:``}`,title:`Project settings`,"aria-label":`Settings of ${t.name}`,onClick:()=>e.onOpen(`ps:${t.name}`),children:`⚙`})]})]}),t.project&&m===t.name&&(0,V.jsxs)(`div`,{className:`start-row`,children:[(0,V.jsxs)(`select`,{"aria-label":`Profile for a new session in ${t.name}`,value:y,onChange:e=>b(e.target.value),title:`Its session profile: what it gets of your own plugins, MCP servers, tools and settings`,children:[(0,V.jsx)(`option`,{value:``,children:t.project.profiles.session?`Project's: ${t.project.profiles.session}`:`Project's profile`}),(t.project.profileNames??e.profiles).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{h(null),e.onStart(t.name,y||void 0)},children:`Start`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>h(null),children:`Cancel`})]}),(()=>{let e=E(t.view.rows);return t.view.rows.map(t=>(0,V.jsxs)(v.Fragment,{children:[e?.before===t.s.id&&k,te(t),e?.after===t.s.id&&k]},t.s.id))})(),vt(M,t.archived,t.isFolded)&&(0,V.jsxs)(`button`,{className:`archived-link${e.openId===`a:${t.name}`?` open`:``}`,onClick:()=>e.onOpen(`a:${t.name}`),children:[`Archived (`,t.archived,`)`]})]})}),O?.after===t.name&&k]},t.name))]}),(0,V.jsxs)(`div`,{className:`connection ${e.connection}`,children:[(0,V.jsx)(`button`,{className:`icon settings-cog${mw(e.openId)?` on`:``}`,title:mw(e.openId)?`Close settings (Esc)`:`Settings: accounts, restart Ledung, add a project`,"aria-label":mw(e.openId)?`Close settings`:`Settings`,"aria-pressed":mw(e.openId),onClick:()=>mw(e.openId)?e.onCloseSettings():e.onOpen(`settings`),children:`⚙`}),(0,V.jsxs)(`span`,{className:`footer-chips`,children:[(0,V.jsxs)(`button`,{className:`board-chip usage-chip${Ie(e.board)?``:` ${N.className}`}${e.openId===`usage`||e.openId===`overview`?` on`:``}`,title:`${Ie(e.board)?``:`${N.text} `}Usage: tokens per day, project and model, shared usage, and every live session`,"aria-pressed":e.openId===`usage`||e.openId===`overview`,onClick:()=>e.onOpen(`usage`),children:[`Usage`,e.overview?` · ${Wy(e.overview.todayTokens)} today`:``]}),(0,V.jsx)(yn,{board:e.board,open:e.openId===`board`||!!CC(e.openId),connection:N,onClick:()=>e.onOpen(`board`)})]})]})]})}function DE(e){let{session:t,ledung:n,run:r}=e,[i,a]=(0,v.useState)(()=>wE(t.id)),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>p(!1),[t.id]);let m=(0,v.useRef)(null),h=(0,v.useCallback)((e,t,n)=>{let r=n.length>2e3?`${n.slice(0,2e3)}…`:n;m.current?.(`> ${e}, ${Eg(t)}:\n${r.split(`
|
|
103
|
+
`}return f.substring(0,f.length-1)},c.renderTo2dContext=function(e,t){t||=2;let n=c.getModuleCount();for(let r=0;r<n;r++)for(let i=0;i<n;i++)e.fillStyle=c.isDark(r,i)?`black`:`white`,e.fillRect(i*t,r*t,t,t)},c};Fb.stringToBytes=function(e){let t=[];for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);t.push(r&255)}return t},Fb.createStringToBytes=function(e,t){let n=function(){let n=Xb(e),r=function(){let e=n.read();if(e==-1)throw`eof`;return e},i=0,a={};for(;;){let e=n.read();if(e==-1)break;let t=r(),o=r(),s=r(),c=String.fromCharCode(e<<8|t);a[c]=o<<8|s,i+=1}if(i!=t)throw i+` != `+t;return a}();return function(e){let t=[];for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r);if(i<128)t.push(i);else{let i=n[e.charAt(r)];typeof i==`number`?(i&255)==i?t.push(i):(t.push(i>>>8),t.push(i&255)):t.push(63)}}return t}};var Ib={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Lb={L:1,M:0,Q:3,H:2},Rb={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},zb=function(){let e=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],t=1335,n=7973,r={},i=function(e){let t=0;for(;e!=0;)t+=1,e>>>=1;return t};return r.getBCHTypeInfo=function(e){let n=e<<10;for(;i(n)-i(t)>=0;)n^=t<<i(n)-i(t);return(e<<10|n)^21522},r.getBCHTypeNumber=function(e){let t=e<<12;for(;i(t)-i(n)>=0;)t^=n<<i(t)-i(n);return e<<12|t},r.getPatternPosition=function(t){return e[t-1]},r.getMaskFunction=function(e){switch(e){case Rb.PATTERN000:return function(e,t){return(e+t)%2==0};case Rb.PATTERN001:return function(e,t){return e%2==0};case Rb.PATTERN010:return function(e,t){return t%3==0};case Rb.PATTERN011:return function(e,t){return(e+t)%3==0};case Rb.PATTERN100:return function(e,t){return(Math.floor(e/2)+Math.floor(t/3))%2==0};case Rb.PATTERN101:return function(e,t){return e*t%2+e*t%3==0};case Rb.PATTERN110:return function(e,t){return(e*t%2+e*t%3)%2==0};case Rb.PATTERN111:return function(e,t){return(e*t%3+(e+t)%2)%2==0};default:throw`bad maskPattern:`+e}},r.getErrorCorrectPolynomial=function(e){let t=Vb([1],0);for(let n=0;n<e;n+=1)t=t.multiply(Vb([1,Bb.gexp(n)],0));return t},r.getLengthInBits=function(e,t){if(1<=t&&t<10)switch(e){case Ib.MODE_NUMBER:return 10;case Ib.MODE_ALPHA_NUM:return 9;case Ib.MODE_8BIT_BYTE:return 8;case Ib.MODE_KANJI:return 8;default:throw`mode:`+e}else if(t<27)switch(e){case Ib.MODE_NUMBER:return 12;case Ib.MODE_ALPHA_NUM:return 11;case Ib.MODE_8BIT_BYTE:return 16;case Ib.MODE_KANJI:return 10;default:throw`mode:`+e}else if(t<41)switch(e){case Ib.MODE_NUMBER:return 14;case Ib.MODE_ALPHA_NUM:return 13;case Ib.MODE_8BIT_BYTE:return 16;case Ib.MODE_KANJI:return 12;default:throw`mode:`+e}else throw`type:`+t},r.getLostPoint=function(e){let t=e.getModuleCount(),n=0;for(let r=0;r<t;r+=1)for(let i=0;i<t;i+=1){let a=0,o=e.isDark(r,i);for(let n=-1;n<=1;n+=1)if(!(r+n<0||t<=r+n))for(let s=-1;s<=1;s+=1)i+s<0||t<=i+s||(n!=0||s!=0)&&o==e.isDark(r+n,i+s)&&(a+=1);a>5&&(n+=3+a-5)}for(let r=0;r<t-1;r+=1)for(let i=0;i<t-1;i+=1){let t=0;e.isDark(r,i)&&(t+=1),e.isDark(r+1,i)&&(t+=1),e.isDark(r,i+1)&&(t+=1),e.isDark(r+1,i+1)&&(t+=1),(t==0||t==4)&&(n+=3)}for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(r,i)&&!e.isDark(r,i+1)&&e.isDark(r,i+2)&&e.isDark(r,i+3)&&e.isDark(r,i+4)&&!e.isDark(r,i+5)&&e.isDark(r,i+6)&&(n+=40);for(let r=0;r<t;r+=1)for(let i=0;i<t-6;i+=1)e.isDark(i,r)&&!e.isDark(i+1,r)&&e.isDark(i+2,r)&&e.isDark(i+3,r)&&e.isDark(i+4,r)&&!e.isDark(i+5,r)&&e.isDark(i+6,r)&&(n+=40);let r=0;for(let n=0;n<t;n+=1)for(let i=0;i<t;i+=1)e.isDark(i,n)&&(r+=1);let i=Math.abs(100*r/t/t-50)/5;return n+=i*10,n},r}(),Bb=function(){let e=Array(256),t=Array(256);for(let t=0;t<8;t+=1)e[t]=1<<t;for(let t=8;t<256;t+=1)e[t]=e[t-4]^e[t-5]^e[t-6]^e[t-8];for(let n=0;n<255;n+=1)t[e[n]]=n;let n={};return n.glog=function(e){if(e<1)throw`glog(`+e+`)`;return t[e]},n.gexp=function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return e[t]},n}(),Vb=function(e,t){if(e.length===void 0)throw e.length+`/`+t;let n=function(){let n=0;for(;n<e.length&&e[n]==0;)n+=1;let r=Array(e.length-n+t);for(let t=0;t<e.length-n;t+=1)r[t]=e[t+n];return r}(),r={};return r.getAt=function(e){return n[e]},r.getLength=function(){return n.length},r.multiply=function(e){let t=Array(r.getLength()+e.getLength()-1);for(let n=0;n<r.getLength();n+=1)for(let i=0;i<e.getLength();i+=1)t[n+i]^=Bb.gexp(Bb.glog(r.getAt(n))+Bb.glog(e.getAt(i)));return Vb(t,0)},r.mod=function(e){if(r.getLength()-e.getLength()<0)return r;let t=Bb.glog(r.getAt(0))-Bb.glog(e.getAt(0)),n=Array(r.getLength());for(let e=0;e<r.getLength();e+=1)n[e]=r.getAt(e);for(let r=0;r<e.getLength();r+=1)n[r]^=Bb.gexp(Bb.glog(e.getAt(r))+t);return Vb(n,0).mod(e)},r},Hb=function(){let e=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t=function(e,t){let n={};return n.totalCount=e,n.dataCount=t,n},n={},r=function(t,n){switch(n){case Lb.L:return e[(t-1)*4+0];case Lb.M:return e[(t-1)*4+1];case Lb.Q:return e[(t-1)*4+2];case Lb.H:return e[(t-1)*4+3];default:return}};return n.getRSBlocks=function(e,n){let i=r(e,n);if(i===void 0)throw`bad rs block @ typeNumber:`+e+`/errorCorrectionLevel:`+n;let a=i.length/3,o=[];for(let e=0;e<a;e+=1){let n=i[e*3+0],r=i[e*3+1],a=i[e*3+2];for(let e=0;e<n;e+=1)o.push(t(r,a))}return o},n}(),Ub=function(){let e=[],t=0,n={};return n.getBuffer=function(){return e},n.getAt=function(t){let n=Math.floor(t/8);return(e[n]>>>7-t%8&1)==1},n.put=function(e,t){for(let r=0;r<t;r+=1)n.putBit((e>>>t-r-1&1)==1)},n.getLengthInBits=function(){return t},n.putBit=function(n){let r=Math.floor(t/8);e.length<=r&&e.push(0),n&&(e[r]|=128>>>t%8),t+=1},n},Wb=function(e){let t=Ib.MODE_NUMBER,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+2<t.length;)e.put(i(t.substring(r,r+3)),10),r+=3;r<t.length&&(t.length-r==1?e.put(i(t.substring(r,r+1)),4):t.length-r==2&&e.put(i(t.substring(r,r+2)),7))};let i=function(e){let t=0;for(let n=0;n<e.length;n+=1)t=t*10+a(e.charAt(n));return t},a=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;throw`illegal char :`+e};return r},Gb=function(e){let t=Ib.MODE_ALPHA_NUM,n=e,r={};r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){let t=n,r=0;for(;r+1<t.length;)e.put(i(t.charAt(r))*45+i(t.charAt(r+1)),11),r+=2;r<t.length&&e.put(i(t.charAt(r)),6)};let i=function(e){if(`0`<=e&&e<=`9`)return e.charCodeAt(0)-48;if(`A`<=e&&e<=`Z`)return e.charCodeAt(0)-65+10;switch(e){case` `:return 36;case`$`:return 37;case`%`:return 38;case`*`:return 39;case`+`:return 40;case`-`:return 41;case`.`:return 42;case`/`:return 43;case`:`:return 44;default:throw`illegal char :`+e}};return r},Kb=function(e){let t=Ib.MODE_8BIT_BYTE,n=Fb.stringToBytes(e),r={};return r.getMode=function(){return t},r.getLength=function(e){return n.length},r.write=function(e){for(let t=0;t<n.length;t+=1)e.put(n[t],8)},r},qb=function(e){let t=Ib.MODE_KANJI,n=Fb.stringToBytes;(function(e,t){let r=n(e);if(r.length!=2||(r[0]<<8|r[1])!=t)throw`sjis not supported.`})(`友`,38726);let r=n(e),i={};return i.getMode=function(){return t},i.getLength=function(e){return~~(r.length/2)},i.write=function(e){let t=r,n=0;for(;n+1<t.length;){let r=(255&t[n])<<8|255&t[n+1];if(33088<=r&&r<=40956)r-=33088;else if(57408<=r&&r<=60351)r-=49472;else throw`illegal char at `+(n+1)+`/`+r;r=(r>>>8&255)*192+(r&255),e.put(r,13),n+=2}if(n<t.length)throw`illegal char at `+(n+1)},i},Jb=function(){let e=[],t={};return t.writeByte=function(t){e.push(t&255)},t.writeShort=function(e){t.writeByte(e),t.writeByte(e>>>8)},t.writeBytes=function(e,n,r){n||=0,r||=e.length;for(let i=0;i<r;i+=1)t.writeByte(e[i+n])},t.writeString=function(e){for(let n=0;n<e.length;n+=1)t.writeByte(e.charCodeAt(n))},t.toByteArray=function(){return e},t.toString=function(){let t=``;t+=`[`;for(let n=0;n<e.length;n+=1)n>0&&(t+=`,`),t+=e[n];return t+=`]`,t},t},Yb=function(){let e=0,t=0,n=0,r=``,i={},a=function(e){r+=String.fromCharCode(o(e&63))},o=function(e){if(e<0)throw`n:`+e;if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e==62)return 43;if(e==63)return 47;throw`n:`+e};return i.writeByte=function(r){for(e=e<<8|r&255,t+=8,n+=1;t>=6;)a(e>>>t-6),t-=6},i.flush=function(){if(t>0&&(a(e<<6-t),e=0,t=0),n%3!=0){let e=3-n%3;for(let t=0;t<e;t+=1)r+=`=`}},i.toString=function(){return r},i},Xb=function(e){let t=e,n=0,r=0,i=0,a={};a.read=function(){for(;i<8;){if(n>=t.length){if(i==0)return-1;throw`unexpected end of file./`+i}let e=t.charAt(n);if(n+=1,e==`=`)return i=0,-1;e.match(/^\s$/)||(r=r<<6|o(e.charCodeAt(0)),i+=6)}let e=r>>>i-8&255;return i-=8,e};let o=function(e){if(65<=e&&e<=90)return e-65;if(97<=e&&e<=122)return e-97+26;if(48<=e&&e<=57)return e-48+52;if(e==43)return 62;if(e==47)return 63;throw`c:`+e};return a},Zb=function(e,t){let n=e,r=t,i=Array(e*t),a={};a.setPixel=function(e,t,r){i[t*n+e]=r},a.write=function(e){e.writeString(`GIF87a`),e.writeShort(n),e.writeShort(r),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeString(`,`),e.writeShort(0),e.writeShort(0),e.writeShort(n),e.writeShort(r),e.writeByte(0);let t=s(2);e.writeByte(2);let i=0;for(;t.length-i>255;)e.writeByte(255),e.writeBytes(t,i,255),i+=255;e.writeByte(t.length-i),e.writeBytes(t,i,t.length-i),e.writeByte(0),e.writeString(`;`)};let o=function(e){let t=e,n=0,r=0,i={};return i.write=function(e,i){if(e>>>i)throw`length over`;for(;n+i>=8;)t.writeByte(255&(e<<n|r)),i-=8-n,e>>>=8-n,r=0,n=0;r=e<<n|r,n+=i},i.flush=function(){n>0&&t.writeByte(r)},i},s=function(e){let t=1<<e,n=(1<<e)+1,r=e+1,a=c();for(let e=0;e<t;e+=1)a.add(String.fromCharCode(e));a.add(String.fromCharCode(t)),a.add(String.fromCharCode(n));let s=Jb(),l=o(s);l.write(t,r);let u=0,d=String.fromCharCode(i[u]);for(u+=1;u<i.length;){let e=String.fromCharCode(i[u]);u+=1,a.contains(d+e)?d+=e:(l.write(a.indexOf(d),r),a.size()<4095&&(a.size()==1<<r&&(r+=1),a.add(d+e)),d=e)}return l.write(a.indexOf(d),r),l.write(n,r),l.flush(),s.toByteArray()},c=function(){let e={},t=0,n={};return n.add=function(r){if(n.contains(r))throw`dup key:`+r;e[r]=t,t+=1},n.size=function(){return t},n.indexOf=function(t){return e[t]},n.contains=function(t){return e[t]!==void 0},n};return a},Qb=function(e,t,n){let r=Zb(e,t);for(let i=0;i<t;i+=1)for(let t=0;t<e;t+=1)r.setPixel(t,i,n(t,i));let i=Jb();r.write(i);let a=Yb(),o=i.toByteArray();for(let e=0;e<o.length;e+=1)a.writeByte(o[e]);return a.flush(),`data:image/gif;base64,`+a};Fb.stringToBytes;var $b=/^[0-9A-Z $%*+\-./:]*$/,ex=.3,tx=e=>e.toUpperCase();function nx(e){let t=Fb(0,`H`);t.addData(e,$b.test(e)?`Alphanumeric`:`Byte`),t.make();let n=t.getModuleCount(),r=Math.floor(n*ex);r%2==0&&r--;let i=(n-r)/2,a=(e,t)=>e>=i&&e<i+r&&t>=i&&t<i+r;return{n,dark:(e,n)=>!a(e,n)&&t.isDark(e,n),logo:{from:i,size:r}}}function rx(e){return e.secure&&e.serviceWorker&&e.pushManager?`yes`:/iPhone|iPad|iPod/.test(e.userAgent)&&!e.standalone?`home-screen`:`no`}var ix=()=>rx({secure:window.isSecureContext,serviceWorker:`serviceWorker`in navigator,pushManager:`PushManager`in window,userAgent:navigator.userAgent,standalone:navigator.standalone===!0||matchMedia(`(display-mode: standalone)`).matches});function ax(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(Math.ceil(e.length/4)*4,`=`);return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}function ox(e,t){return!e||e.byteLength!==t.length?!1:new Uint8Array(e).every((e,n)=>e===t[n])}async function sx(){return await navigator.serviceWorker.register(`/sw.js`,{scope:`/`}),navigator.serviceWorker.ready}async function cx(){if((Notification.permission===`granted`?`granted`:await Notification.requestPermission())!==`granted`)throw Error(`Notifications are blocked for Ledung here. Allow them in the settings for it, then switch this on again.`);let{publicKey:e}=await R.pushState(),t=await sx(),n=ax(e),r=await t.pushManager.getSubscription();r&&!ox(r.options.applicationServerKey,n)&&(await r.unsubscribe(),r=null),r??=await t.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:n}),await R.pushOn(r.toJSON())}async function lx(){await R.pushOff(),await(await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription())?.unsubscribe()}async function ux(){let{on:e}=await R.pushState();return e?!!await(await navigator.serviceWorker.getRegistration(`/`))?.pushManager.getSubscription():!1}function dx(e){return e?`Pushes for this computer come through the first tab: on the phone, switch on push notifications in Settings there, under Phones. They say this computer's name, and tapping one opens this tab.`:`Pushes for this computer come through the first tab once the two computers are linked (Settings → Linked computers); then, on the phone, switch them on in Settings there, under Phones.`}var fx=e=>e?new Date(e).toLocaleString():`never`;function px({text:e}){let{n:t,dark:n,logo:r}=nx(e),i=[];for(let e=0;e<t;e++)for(let r=0;r<t;r++)n(e,r)&&i.push(`M${r+4},${e+4}h1v1h-1z`);let a=r.from+4+.5,o=r.size-1;return(0,V.jsxs)(`svg`,{className:`qr`,viewBox:`0 0 ${t+8} ${t+8}`,width:220,height:220,role:`img`,"aria-label":`QR code of the pairing link`,children:[(0,V.jsx)(`rect`,{width:t+8,height:t+8,fill:`#fff`}),(0,V.jsx)(`path`,{d:i.join(``),fill:`#000`}),(0,V.jsx)(`image`,{href:`/icon.svg?v=2`,x:a,y:a,width:o,height:o})]})}function mx({run:e,linked:t=!1}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.thisDevice().then(r,()=>r({remote:!1}))},[]),n?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Phones`}),n.remote?(0,V.jsx)(hx,{device:n.device,mayAddPasskey:n.mayAddPasskey,unlockedUntil:n.unlockedUntil,linked:t,run:e,onChange:()=>R.thisDevice().then(r)}):(0,V.jsx)(yx,{run:e})]}):null}function hx(e){let{device:t,unlockedUntil:n}=e,[r,i]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>i(Date.now()),15e3);return()=>clearInterval(e)},[]);let a=n!==null&&n>r,o=t.kind===`computer`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`This device is paired as `,(0,V.jsx)(`b`,{children:t.name}),o?`, a computer`:``,`. Devices are listed and removed in Settings on the computer Ledung runs on.`]}),t.passkey&&o?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call from here asks for it (Touch ID or Windows Hello) each time.`}),(0,V.jsx)(`p`,{children:a?(0,V.jsx)(V.Fragment,{children:`🔓 Logged on: changes need nothing more until you log out, or until 14 days without use.`}):(0,V.jsx)(V.Fragment,{children:`🔒 Logged off: from here you can look, not change anything. Log on with the passkey; it lasts until you log out.`})}),a?(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.logOutDevice(),e.onChange()}),children:`Log out`}):(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Log on`}),Ht()&&(0,V.jsx)(_x,{linked:e.linked})]}):t.passkey?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Its passkey is set up: allowing a sensitive call or writing to a manager from here asks for it (Face ID or fingerprint) each time.`}),(0,V.jsx)(`p`,{children:a?(0,V.jsxs)(V.Fragment,{children:[`🔓 Unlocked for changes until `,new Date(n).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),`.`]}):(0,V.jsx)(V.Fragment,{children:`🔒 Locked: from here you can look, not change anything. Unlocking takes the passkey once and lasts 30 minutes.`})}),!a&&(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.unlockDevice(),e.onChange()}),children:`Unlock`}),Ht()?(0,V.jsx)(_x,{linked:e.linked}):(0,V.jsx)(vx,{run:e.run,onChange:e.onChange})]}):e.mayAddPasskey&&Ht()?(0,V.jsx)(gx,{run:e.run,onChange:e.onChange}):e.mayAddPasskey?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look, and every change waits for the computer. This is possible in the first 10 minutes after pairing.`}),(0,V.jsx)(`button`,{onClick:()=>void e.run(async()=>{await R.addPasskey(),e.onChange()}),children:`Set up passkey`})]}):(0,V.jsx)(`p`,{className:`muted`,children:`No passkey: this device can only look; changes wait for the computer. To add one, pair this device again from Settings on the computer.`})]})}function gx({run:e,onChange:t}){let[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{if(!n)return;let e=setInterval(()=>{R.thisDevice().then(e=>{e.remote&&e.device.passkey&&t()},()=>{}),Date.now()>n.expiresAt&&r(null)},2e3);return()=>clearInterval(e)},[n,t]),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Set up a passkey now: without it this device can only look. It is made in a window of its own (here inside another computer's page the browser may not make one), and works here afterwards. This is possible in the first 10 minutes after pairing.`}),n?(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`a`,{className:`button-link`,href:n.url,target:`_blank`,rel:`noopener noreferrer`,children:`Open the passkey window`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`· then come back here`})]}):(0,V.jsx)(`button`,{onClick:()=>void e(async()=>r(await R.passkeyEnrolLink())),children:`Set up passkey`})]})}function _x({linked:e}){return(0,V.jsx)(`p`,{className:`muted push-switch framed-push`,children:dx(e)})}function vx({run:e,onChange:t}){let n=ix(),[r,i]=(0,v.useState)(null);if((0,v.useEffect)(()=>{n===`yes`&&ux().then(i,()=>i(!1))},[n]),n===`home-screen`)return(0,V.jsx)(`p`,{className:`muted push-switch`,children:`Push notifications on an iPhone need Ledung on the Home Screen: Share → Add to Home Screen, then open it from there and switch them on here.`});if(n===`no`)return(0,V.jsx)(`p`,{className:`muted push-switch`,children:`This browser can't get push notifications.`});if(r===null)return null;let a=n=>void e(async()=>{try{await(n?cx():lx()),i(n)}finally{t()}});return(0,V.jsxs)(`div`,{className:`push-switch`,children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`A notification on this phone when something new waits for you, even with Ledung closed`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>a(e.target.checked)}),` Push notifications to this phone`]}),(0,V.jsx)(`p`,{className:`muted`,children:`When something new waits for you on this computer. It says which computer and what kind of item, never the text: that loads when you open it.`})]})}function yx({run:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(Date.now()),s=()=>R.devices().then(e=>{n(e),i(t=>t&&e.devices.length>t.before?null:t)},()=>{});if((0,v.useEffect)(()=>{s()},[]),(0,v.useEffect)(()=>{if(!r)return;let e=setInterval(()=>{o(Date.now()),s()},2e3);return()=>clearInterval(e)},[r]),!t)return null;if(!t.publicName)return(0,V.jsx)(`p`,{className:`muted`,children:`Reaching Ledung from a phone anywhere needs a relay: set "remote" with its "publicName" in the config. Then phones are paired here.`});let c=r&&r.expiresAt>a?r:null;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Phones, and other computers' Ledung pages (their tab for this computer), that reach this Ledung at https://`,t.publicName,`. Only a paired device gets in there; the sign-in link does not work there. A phone unlocks for 30 minutes at a time; a computer stays logged on until it logs out.`]}),t.devices.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`No paired devices.`}),t.devices.map(t=>(0,V.jsxs)(`div`,{className:`device-row`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{children:t.name}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,t.kind===`computer`?`computer`:`phone`,` · paired `,t.pairedVia?`through the link from ${t.pairedVia} `:``,fx(t.createdAt),` · last used `,fx(t.lastUsedAt),` · `,t.passkey?`passkey added ${fx(t.passkeyAt)}`:`no passkey`]})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.revokeDevice(t.id),await s()}),children:`Revoke`})]},t.id)),c?(0,V.jsxs)(`div`,{className:`pairing`,children:[c.kind===`phone`&&(0,V.jsx)(px,{text:tx(c.url)}),c.kind===`computer`?(0,V.jsxs)(`p`,{className:`muted`,children:[`On the other computer, click this computer's tab and type the code, or the link, into the field there. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey there and log on: it stays logged on until you log out.`]}):(0,V.jsxs)(`p`,{className:`muted`,children:[`Scan it with the phone, or open this link on it. It works once, for `,Math.max(0,Math.ceil((c.expiresAt-a)/6e4)),` more minute(s). Then set up the passkey on the phone, in its Settings → Remote & devices → Phones.`]}),c.kind===`computer`&&(0,V.jsx)(`p`,{className:`pair-code`,children:(0,V.jsx)(`b`,{children:new URL(c.url).pathname.split(`/`).pop().toUpperCase()})}),(0,V.jsx)(`code`,{className:`pair-link`,children:c.url})]}):(0,V.jsx)(`p`,{className:`device-pair-buttons`,children:[`phone`,`computer`].map(n=>(0,V.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.pairDevice(n);o(Date.now()),i({...e,before:t.devices.length})}),children:n===`phone`?`Pair a phone`:`Pair a computer`},n))})]})}var bx=e=>e?new Date(e).toLocaleString():`never`;function xx({run:e}){let t=B(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(Date.now()),f=()=>R.links().then(e=>{r(e),a(t=>t&&e.links.length>t.before?null:t)},()=>r(null));if((0,v.useEffect)(()=>{f()},[]),(0,v.useEffect)(()=>{if(!i)return;let e=setInterval(()=>{d(Date.now()),f()},2e3);return()=>clearInterval(e)},[i]),!n)return null;let p=i&&i.expiresAt>u?i:null;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Linked computers`}),n.problem?(0,V.jsx)(`p`,{className:`muted`,children:n.problem}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`muted`,children:`Your other computers' Ledungs this one is linked with. Their managers will reach this computer's managers as if they ran here; the link goes end to end through the relay, which can't read it.`}),n.links.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:`No linked computers.`}),n.links.map(t=>(0,V.jsxs)(`div`,{className:`device-row`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`b`,{children:t.name}),` `,(0,V.jsxs)(`span`,{className:`muted`,children:[`· `,t.publicName,` · linked `,bx(t.linkedAt),` · last heard from `,bx(t.lastUsedAt)]})]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(async()=>{await R.unlink(t.id),await f()}),children:`Unlink`})]},t.id)),p?(0,V.jsxs)(`div`,{className:`pairing`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Paste this in Settings → Linked computers on the other computer. It works once, for `,Math.max(0,Math.ceil((p.expiresAt-u)/6e4)),` more minute(s).`]}),(0,V.jsx)(`code`,{className:`pair-link`,children:p.code}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void navigator.clipboard?.writeText(p.code),children:`Copy`})]}):(0,V.jsx)(`button`,{onClick:()=>void e(async()=>{let e=await R.linkCode();d(Date.now()),a({...e,before:n.links.length})}),children:`Link a computer`}),(0,V.jsxs)(`div`,{className:`link-join`,children:[(0,V.jsx)(`p`,{className:`muted`,children:`Or link with a code made on the other computer:`}),(0,V.jsx)(`input`,{type:`text`,...t,value:o,placeholder:`name.example.com/…`,"aria-label":`Link code from the other computer`,onChange:e=>s(e.target.value)}),(0,V.jsx)(`input`,{type:`text`,...t,value:c,maxLength:40,placeholder:`Its name here, e.g. PC`,"aria-label":`Name for the other computer`,onChange:e=>l(e.target.value)}),(0,V.jsx)(`button`,{disabled:!o.trim(),onClick:()=>void e(async()=>{await R.joinLink(o.trim(),c.trim()),s(``),l(``),await f()}),children:`Link`})]})]})]})}function Sx({computers:e,run:t}){return e.length?(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Computers`}),(0,V.jsx)(`p`,{className:`muted`,children:e.length>1?`The tabs at the top of the page, this computer first. A name or colour changed here is this Ledung's; the config's are where they start.`:`Tabs show at the top of the page when the config lists more than one computer. The name is also the remote frame's label.`}),e.map(e=>(0,V.jsx)(Cx,{computer:e,run:t},e.id))]}):null}function Cx({computer:e,run:t}){let n=B(),[r,i]=(0,v.useState)(e.name);(0,v.useEffect)(()=>i(e.name),[e.name]);let a=e.name!==e.config.name||e.colour!==e.config.colour,o=r.trim()!==e.name,s=()=>t(()=>R.editComputer(e.id,{name:r.trim()||null})),c=e.here?`${e.name} (this computer)`:e.name;return(0,V.jsxs)(`div`,{className:`computer-row`,role:`group`,"aria-label":`Computer ${c}`,children:[(0,V.jsxs)(`div`,{className:`computer-name`,children:[(0,V.jsx)(`input`,{type:`text`,...n,value:r,maxLength:24,"aria-label":`Name of ${c}`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&o&&s()}}),o&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void s(),children:`Save`}),e.here&&(0,V.jsx)(`span`,{className:`muted`,children:`This computer`}),a&&!o&&(0,V.jsx)(`button`,{className:`small`,title:`Back to ${e.config.name} in ${Dt[e.config.colour].label.toLowerCase()}, as the config has it`,onClick:()=>void t(()=>R.editComputer(e.id,{name:null,colour:null})),children:`Use the config's`})]}),(0,V.jsx)(`div`,{className:`swatches`,children:kt.map(n=>(0,V.jsx)(`button`,{type:`button`,className:`swatch${e.colour===n?` on`:``}`,"aria-pressed":e.colour===n,title:Dt[n].label,"aria-label":`${c}: ${Dt[n].label}`,onClick:()=>void t(()=>R.editComputer(e.id,{colour:n})),children:(0,V.jsx)(pp,{colour:n,children:`●`})},n))})]})}function wx(e){let t=/^(\d+)\.(\d+)\.0$/.exec(e);return t?t[2]===`0`?`v${t[1]}`:`v${t[1]}.${t[2]}`:`v${e}`}var Tx=new Set,Ex=ft(localStorage),Dx=e=>{Ex=e;for(let e of Tx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.statusDot`||e.key===null)&&Dx(ft(localStorage))});var Ox=e=>(Tx.add(e),()=>{Tx.delete(e)}),kx=()=>Ex;function Ax(){return[(0,v.useSyncExternalStore)(Ox,kx),e=>{pt(dn,e),Dx(e)}]}var jx=new Set,Mx=Ct(localStorage),Nx=e=>{Mx=e;for(let e of jx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.compactSidebar`||e.key===null)&&Nx(Ct(localStorage))});var Px=e=>(jx.add(e),()=>{jx.delete(e)}),Fx=()=>Mx;function Ix(){return[(0,v.useSyncExternalStore)(Px,Fx),e=>{wt(dn,e),Nx(e)}]}var Lx=new Set,Rx=gt(localStorage),zx=e=>{Rx=e;for(let e of Lx)e()};window.addEventListener(`storage`,e=>{(e.key===`ledung.archivedLink`||e.key===null)&&zx(gt(localStorage))});var Bx=e=>(Lx.add(e),()=>{Lx.delete(e)}),Vx=()=>Rx;function Hx(){return[(0,v.useSyncExternalStore)(Bx,Vx),e=>{_t(dn,e),zx(e)}]}var Ux=`ledung.installDismissed`,Wx=(e,t)=>/Macintosh/.test(e)&&/Safari\//.test(e)&&!/Chrome|Chromium|CriOS|Edg|OPR|Firefox|FxiOS/.test(e)&&t<=1,Gx=(e,t)=>/iPhone|iPad|iPod/.test(e)||/Macintosh/.test(e)&&t>1,Kx=e=>/Chrome|Chromium|Edg\//.test(e);function qx(e){return e.standalone||e.installed?{kind:`none`}:e.framed?{kind:`none`,reason:`Install this computer's own page, opened in a tab of its own.`}:e.offer?{kind:`button`}:e.refused?{kind:`none`,reason:`Refused for now. Reload the page to be offered it again.`}:Wx(e.userAgent,e.maxTouchPoints)?{kind:`dock`}:Gx(e.userAgent,e.maxTouchPoints)?{kind:`none`,reason:`On an iPhone or iPad, use Share → Add to Home Screen in Safari.`}:e.secure?Kx(e.userAgent)?{kind:`none`,reason:`The browser isn't offering to install this page: it is installed already, or not allowed here. The install icon in the address bar says which.`}:{kind:`none`,reason:`This browser can't install pages as apps; Edge, Chrome and Safari on macOS can.`}:{kind:`none`,reason:`Browsers offer installing only a page at 127.0.0.1 or over HTTPS; this one is plain http.`}}function Jx(e){try{return e.getItem(Ux)===`1`}catch{return!1}}function Yx(e){try{e.setItem(Ux,`1`)}catch{}}var Xx=(e,t)=>!t&&e.kind!==`none`,Zx=matchMedia(`(display-mode: standalone)`),Qx=null,$x=!1,eS=!1,tS=Jx(localStorage),nS=new Set,rS=()=>qx({standalone:Zx.matches||navigator.standalone===!0,installed:$x,offer:Qx!==null,refused:eS,framed:Ht(),secure:window.isSecureContext,userAgent:navigator.userAgent,maxTouchPoints:navigator.maxTouchPoints??0}),iS={install:rS(),notice:!1},aS=()=>{let e=rS();iS={install:e,notice:Xx(e,tS)};for(let e of nS)e()};iS.notice=Xx(iS.install,tS),window.addEventListener(`beforeinstallprompt`,e=>{e.preventDefault(),Qx=e,eS=!1,aS()}),window.addEventListener(`appinstalled`,()=>{$x=!0,Qx=null,aS()}),Zx.addEventListener(`change`,aS),window.addEventListener(`storage`,e=>{(e.key===`ledung.installDismissed`||e.key===null)&&(tS=Jx(localStorage),aS())});var oS=e=>(nS.add(e),()=>{nS.delete(e)}),sS=()=>iS;async function cS(){let e=Qx;e&&(Qx=null,await e.prompt(),(await e.userChoice).outcome===`accepted`?$x=!0:eS=!0,aS())}var lS=()=>{Yx(localStorage),tS=!0,aS()};function uS(){return{...(0,v.useSyncExternalStore)(oS,sS),onInstall:cS,onDismiss:lS}}var dS=(0,V.jsxs)(V.Fragment,{children:[`In Safari, choose `,(0,V.jsx)(`b`,{children:`File → Add to Dock`}),`.`]});function fS({app:e,run:t}){return(0,V.jsxs)(`div`,{className:`banner install`,children:[(0,V.jsxs)(`span`,{children:[`Ledung can run as an app, in a window of its own.`,e.install.kind===`dock`&&(0,V.jsxs)(V.Fragment,{children:[` `,dS]})]}),e.install.kind===`button`&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void t(e.onInstall),children:`Install as app`}),(0,V.jsx)(`button`,{className:`small`,onClick:e.onDismiss,children:`Not now`})]})}function pS({run:e}){let t=uS(),{install:n}=t;return n.kind===`none`&&!n.reason?null:(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`App`}),(0,V.jsx)(em,{kind:`browser`})]}),(0,V.jsx)(`p`,{className:`muted`,children:`Ledung in a window of its own, with its own icon, instead of a browser tab.`}),n.kind===`button`&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>void e(t.onInstall),children:`Install as app`}),n.kind===`dock`&&(0,V.jsx)(`p`,{children:dS}),n.kind===`none`&&(0,V.jsx)(`p`,{className:`muted`,children:n.reason})]})}function mS(e,t){return!!e&&!t&&e.available&&!e.asked&&e.places.length>0&&!e.places.some(e=>e.present)}function hS(e){let t=e.places.map(e=>e.label);return t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}function gS(e){return e.kind===`mac`?`Add a Ledung icon to ${hS(e)}?`:`Add a Ledung icon to your ${hS(e)}?`}var _S={desktop:`on your Desktop`,"start-menu":`in the Start menu`,applications:`in Applications`};function vS(e){let t=e.places.map(e=>_S[e.id]??`in ${e.label}`);return`A Ledung icon ${t.length>1?`${t.slice(0,-1).join(`, `)} and ${t[t.length-1]}`:t[0]??``}.`}var yS=`It opens this page, and starts Ledung first if it isn't running.`,bS=null,xS=null,SS=new Set,CS=e=>{bS=e;for(let e of SS)e()};function wS(){return xS??=R.shortcuts().then(CS,()=>CS(null)),xS}var TS=e=>(SS.add(e),()=>{SS.delete(e)});function ES(){return(0,v.useEffect)(()=>void wS(),[]),{view:(0,v.useSyncExternalStore)(TS,()=>bS),act:async e=>CS(await R.shortcutsAct(e))}}function DS({run:e}){let{view:t,act:n}=ES(),[r,i]=(0,v.useState)(!1);if(!t||!mS(t,Ht()))return null;let a=t=>e(async()=>{await n(t),r&&await n(`sign-in-on`)});return(0,V.jsxs)(`div`,{className:`banner install`,children:[(0,V.jsxs)(`span`,{children:[gS(t),` `,yS]}),t.signIn.available&&!t.signIn.on&&(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>i(e.target.checked)}),` `,t.signIn.label]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void a(`add`),children:`Yes`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void a(`decline`),children:`No`})]})}function OS({run:e}){let{view:t,act:n}=ES();if(!t)return null;let r=t.places.filter(e=>!e.present),i=t.places.filter(e=>e.present);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Shortcuts`}),t.available?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[vS(t),` `,yS,` Ledung then runs in the background, with no window; Stop Ledung below stops it.`]}),(0,V.jsx)(`ul`,{className:`shortcut-places`,children:t.places.map(e=>(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`b`,{children:e.label}),` `,(0,V.jsx)(`span`,{className:`muted`,children:e.present?`added`:`not there`})]},e.id))}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[r.length>0&&(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void e(()=>n(`add`)),children:`Add shortcuts`}),i.length>0&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e(()=>n(`remove`)),children:`Remove`})]})]}):(0,V.jsx)(`p`,{className:`muted`,children:t.reason})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Start at sign-in`}),t.signIn.available?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:t.signIn.file??void 0,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:t.signIn.on,onChange:t=>void e(()=>n(t.target.checked?`sign-in-on`:`sign-in-off`))}),` `,t.signIn.label]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung starts in the background, without opening its page; open it with the icon or the `,(0,V.jsx)(`code`,{children:`ledung`}),` command. Only for you, and no administrator rights are needed.`]})]}):(0,V.jsx)(`p`,{className:`muted`,children:t.signIn.reason})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Log`}),(0,V.jsxs)(`p`,{className:`muted`,children:[t.log.active?`This Ledung runs in the background; what it says goes to`:`Started in the background, Ledung writes what it says to`,` `,(0,V.jsx)(`code`,{children:t.log.file}),t.log.active?`.`:`. This one was started in a terminal or window, so it says it there.`]})]})]})}function kS(){let{view:e}=ES(),[t,n]=(0,v.useState)(`idle`);return!e||Ht()?null:(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Stop Ledung`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Stops Ledung and its sessions; resume a session after the next start to continue it. Start Ledung again with its icon or the `,(0,V.jsx)(`code`,{children:`ledung`}),` command.`]}),t===`stopped`?(0,V.jsx)(`p`,{children:`Ledung has stopped. This page stays as it was until Ledung runs again.`}):t===`confirming`?(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Running sessions stop.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:async()=>{try{await R.stopLedung(),n(`stopped`)}catch{n(`failed`)}},children:`Stop Ledung`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(`idle`),children:`Cancel`})]}):(0,V.jsxs)(`span`,{className:`restart-confirm`,children:[t===`failed`&&(0,V.jsx)(`span`,{className:`restart-problem`,children:`Ledung refused to stop.`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n(`confirming`),children:`Stop Ledung`})]})]})}function AS(e){return e===`token`?`Signed in with a long-lived token`:e===`login`?`Signed in with /login`:e===`key`?`Signed in with an API key`:e===`other`?`Signed in`:`Not signed in, or not checked yet`}function jS(e){return!e||!e.email&&!e.organization?`not seen yet: shown after its first session starts`:[e.email,e.organization,e.plan].filter(Boolean).join(` · `)+(e.seenAt?` (seen ${Dg(e.seenAt)})`:``)}function MS({text:e}){return(0,V.jsxs)(`div`,{className:`sign-in-command`,children:[(0,V.jsx)(`code`,{className:`remote-record`,children:e}),` `,(0,V.jsx)(Of,{text:e})]})}function NS({command:e}){return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With a long-lived token: get one with `,(0,V.jsx)(`span`,{className:`mono`,children:`claude setup-token`}),`, then run this in your own terminal on this computer and paste it. It goes straight into Claude Code's sign-in; Ledung never receives it.`]}),(0,V.jsx)(MS,{text:e})]})}function PS(e){let t=B(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(null),c=t=>[...e.projects.filter(e=>e.account===t).map(e=>e.name),...e.choices.chats===t?[`chats`]:[]].join(`, `)||`no project`,l=t=>(0,V.jsxs)(`select`,{value:e.choices[t]??``,onChange:n=>void e.run(()=>R.setAccountChoices({[t]:n.target.value||null})),children:[(0,V.jsx)(`option`,{value:``,children:`default: this computer's own login`}),e.accounts.map(e=>(0,V.jsxs)(`option`,{value:e.name,children:[e.name,e.email?` (${e.email})`:``]},e.name))]});return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Accounts`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Each project uses one account, for its manager and all its sessions; chats use the one chosen below. Ledung never moves work between accounts. Accounts can also be listed under `,(0,V.jsx)(`span`,{className:`mono`,children:`claudeAccounts`}),` in the config file (see ledung.config.example.json).`]}),e.configFileProblems.map(e=>(0,V.jsx)(`div`,{className:`banner`,children:e},e)),(0,V.jsxs)(`div`,{children:[(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Account`}),(0,V.jsx)(`th`,{children:`Logged in as`}),(0,V.jsx)(`th`,{children:`Used by`}),(0,V.jsx)(`th`,{})]})}),(0,V.jsxs)(`tbody`,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:`default`}),(0,V.jsx)(`div`,{className:`muted`,children:`this computer's own Claude Code login`})]}),(0,V.jsxs)(`td`,{children:[jS(e.defaultIdentity),(0,V.jsx)(`div`,{className:`muted`,children:AS(e.defaultIdentity?.signInKind)})]}),(0,V.jsx)(`td`,{children:c(null)}),(0,V.jsx)(`td`,{})]}),e.accounts.map(t=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{children:[(0,V.jsxs)(`td`,{children:[(0,V.jsx)(`strong`,{children:t.name}),t.whatItIsFor&&(0,V.jsx)(`div`,{children:t.whatItIsFor}),t.inConfigFile&&(0,V.jsx)(`div`,{className:`muted`,children:`set in the config file: to remove it for good, take it out there too, or it comes back at the next start`}),(0,V.jsxs)(`div`,{className:`muted`,children:[`sign-in folder `,(0,V.jsx)(`span`,{className:`mono`,children:t.configDir})]}),(0,V.jsxs)(`div`,{className:`muted`,children:[`in containers `,(0,V.jsx)(`span`,{className:`mono`,children:t.containerDir??`~/.ledung-accounts/${t.name}`})]})]}),(0,V.jsxs)(`td`,{children:[jS(t),(0,V.jsx)(`div`,{className:`muted`,children:AS(t.signInKind)})]}),(0,V.jsx)(`td`,{children:c(t.name)}),(0,V.jsxs)(`td`,{className:`account-actions`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:e.remote,title:e.remote?`Only on the computer Ledung runs on`:`Show ${t.configDir}`,onClick:()=>void e.run(()=>R.openAccountFolder(t.name)),children:`Open folder`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>R.removeAccount(t.name)),children:`Remove`})]})]}),(0,V.jsx)(`tr`,{children:(0,V.jsx)(`td`,{colSpan:4,children:(0,V.jsxs)(`details`,{children:[(0,V.jsx)(`summary`,{className:`muted`,children:`Sign in, or change how it is signed in`}),t.loginCommand&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`With Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]}),(0,V.jsx)(MS,{text:t.loginCommand})]}),t.tokenCommand&&(0,V.jsx)(NS,{command:t.tokenCommand}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Either one replaces the sign-in that is there. For a project in a container, sign in inside the container with `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`.`]})]})})})]},t.name))]})]}),(0,V.jsxs)(`p`,{children:[(0,V.jsx)(`button`,{className:`small`,onClick:()=>void e.run(()=>R.checkSignIn()),children:`Check again`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`after signing in from a terminal, to see it here`})]}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Account for chats `,(0,V.jsx)(`span`,{className:`muted`,children:`(new chats run on it; a running chat keeps its account until it restarts)`}),l(`chats`)]}),(0,V.jsxs)(`label`,{children:[`Account for new projects `,(0,V.jsx)(`span`,{className:`muted`,children:`(chosen for you in Add project)`}),l(`newProjects`)]})]}),(0,V.jsx)(`h4`,{children:`Add an account`}),(0,V.jsxs)(`div`,{className:`form`,children:[(0,V.jsxs)(`label`,{children:[`Name `,(0,V.jsx)(`span`,{className:`muted`,children:`(e.g. personal, work)`}),(0,V.jsx)(`input`,{...t,value:n,onChange:e=>r(e.target.value),maxLength:32})]}),(0,V.jsxs)(`label`,{children:[`Sign-in folder in containers `,(0,V.jsx)(`span`,{className:`muted`,children:`(optional; default ~/.ledung-accounts/<name> in the container user's home, or a mounted folder so the sign-in survives a rebuild)`}),(0,V.jsx)(`input`,{...t,value:i,onChange:e=>a(e.target.value),className:`mono`,placeholder:`~/.ledung-accounts/name`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung makes a folder for this account's Claude Code sign-in, and only that: conversations, memory, skills and settings stay the same for every account, so moving a project to another account changes only whose plan and limits it uses. After adding it, sign in once with Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),` as shown (for a container project, inside the container), or put in a long-lived token with the command shown. Ledung never sees or keeps a sign-in token.`]}),(0,V.jsx)(`button`,{className:`primary`,disabled:!n.trim(),onClick:()=>void e.run(async()=>{s(await R.addAccount({name:n.trim(),...i.trim()?{containerDir:i.trim()}:{}})),a(``),r(``)}),children:`Add account`})]}),o&&(0,V.jsxs)(`div`,{className:`banner`,children:[`Added `,(0,V.jsx)(`strong`,{children:o.name}),`. Choose it in a project's settings (⚙ next to the project), or above for chats and new projects.`,` `,`Now sign in once. With Claude Code's own `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),`: run this in a terminal on this computer, then type `,(0,V.jsx)(`span`,{className:`mono`,children:`/login`}),` and sign in with this account.`,o.loginCommand&&(0,V.jsx)(MS,{text:o.loginCommand}),`For a container project, the same inside the container:`,(0,V.jsx)(`pre`,{className:`mono`,children:`docker exec -it <container> sh -c 'CLAUDE_SECURESTORAGE_CONFIG_DIR=${(o.containerDir??`~/.ledung-accounts/${o.name}`).replace(/^~\//,`$HOME/`)} exec claude'`}),o.tokenCommand&&(0,V.jsx)(NS,{command:o.tokenCommand})]})]})]})}var FS=4e3,IS=[`Ctrl`,`Alt`,`Shift`,`Cmd`],LS=/^(?:(?:Ctrl|Alt|Shift|Cmd)\+)+(?:[A-Z]|[0-9])$/;function RS(e){let t=/^(?:Key([A-Z])|Digit([0-9]))$/.exec(e.code);if(!t)return null;let n=[e.ctrlKey&&`Ctrl`,e.altKey&&`Alt`,e.shiftKey&&`Shift`,e.metaKey&&`Cmd`].filter(Boolean);return n.length?`${n.join(`+`)}+${t[1]??t[2]}`:null}function zS(e){if(!LS.test(e))return!1;let t=e.split(`+`).slice(0,-1);return t.every((e,n)=>n===0||IS.indexOf(e)>IS.indexOf(t[n-1]))}function BS(e,t){if(!t)return e;let n={Ctrl:`⌃`,Alt:`⌥`,Shift:`⇧`,Cmd:`⌘`},r=e.split(`+`);return r.slice(0,-1).map(e=>n[e]??e).join(``)+r[r.length-1]}function VS(e,t,n){if(!zS(e))return{refused:`A keybind is Ctrl, Alt or Cmd with a letter or a digit.`};let r=new Set(e.split(`+`).slice(0,-1)),i=e.split(`+`).pop(),a=/^[0-9]$/.test(i),o=t.find(t=>t.key===e&&t.id!==n);return o?{refused:`“${o.name}” has this keybind.`}:!r.has(`Ctrl`)&&!r.has(`Alt`)&&!r.has(`Cmd`)?{refused:`Shift alone types; add Ctrl or Alt.`}:r.has(`Cmd`)?{refused:`Cmd keys belong to the browser and the Mac, and Windows has none.`}:r.has(`Ctrl`)&&r.has(`Alt`)?{refused:`Ctrl+Alt is AltGr on Windows, which types @, { and [ on many keyboards.`}:e===`Ctrl+O`?{refused:`Ctrl+O shows and hides tool calls in Ledung.`}:r.has(`Ctrl`)&&!a?{refused:`${e} is the browser's or the message box's (new tab, copy, find, developer tools…).`}:r.has(`Ctrl`)&&!r.has(`Shift`)?{warning:`On Windows and Linux ${e} switches browser tabs: there it does nothing.`}:r.has(`Alt`)&&!r.has(`Shift`)&&[`D`,`E`,`F`].includes(i)?{refused:`${e} opens the browser's menu or address bar on Windows.`}:r.has(`Alt`)?{warning:`On a Mac ⌥ types a character with this key (⌥2 is @ on a Swedish keyboard): the keybind takes it away there.${a&&!r.has(`Shift`)?` On Linux Alt+1–9 switch browser tabs.`:``}`}:null}function HS(e,t,n=3){let r=[];for(let i of`123456789`){let a=`Ctrl+Shift+${i}`;if(VS(a,e,t)||r.push(a),r.length===n)break}return r}function US(e,t){return e.filter(e=>e.project===null||e.project===t)}var WS=[`issue`,`branch`,`pr`,`project`,`session`];function GS(e,t){let n=t.branch?/(?:^|[/_-])(\d+)(?=$|[/_-])/.exec(t.branch)?.[1]:void 0,r={issue:t.tickets[0]?.id??(n?`#${n}`:void 0),branch:t.branch??void 0,pr:t.pr?`#${t.pr.number}`:void 0,project:S(t.project),session:t.title},i=[];return{text:e.replace(/\{(issue|branch|pr|project|session)\}/g,(e,t)=>{let n=r[t];return n===void 0?(i.includes(t)||i.push(t),e):n}),missing:i}}function KS(e,t,n){return!(n?!e.send:e.send)||t.missing.length||t.text.trimStart().startsWith(`!`)?`insert`:`send`}function qS(e,t,n){let r=e.slice(),[i]=r.splice(t,1);return r.splice(n,0,i),r}function JS(e){if(e.length>50)return`At most 50 macros.`;let t=new Set,n=new Map;for(let r of e){if(!/^[a-z0-9-]{1,40}$/.test(r.id)||t.has(r.id))return`A macro has no id of its own.`;t.add(r.id);let e=r.name.trim();if(!e||e.length>40)return`A macro's name is 1 to 40 characters.`;if(!r.text.trim()||r.text.length>4e3)return`“${e}”: the text is 1 to ${FS} characters.`;if(!r.chip&&!r.key)return`“${e}” has neither a chip nor a keybind, so nothing could use it.`;if(r.key!==null){let t=VS(r.key,[],null);if(t&&`refused`in t)return`“${e}”: ${t.refused}`;let i=n.get(r.key);if(i)return`“${e}” and “${i}” have the same keybind.`;n.set(r.key,e)}}return null}var YS=()=>typeof navigator<`u`&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent);function XS(e,t){let n=e.send?`Sends`:`Puts in the message box`,r=e.key?` · ${BS(e.key,t)}`:``;return`${n}: ${e.text}${r}\nShift+click: ${e.send?`put it in the message box`:`send it`}`}function ZS(e){let t=e.macros.filter(e=>e.chip),n=e.macros.filter(e=>!e.chip),r=(0,v.useRef)(null),i=(0,v.useRef)(null),[a,o]=(0,v.useState)(t.length),[s,c]=(0,v.useState)(!1),l=YS();if((0,v.useLayoutEffect)(()=>{let e=r.current;if(!e)return;let t=()=>{let t=[...e.children],n=t[0]?.offsetTop??0;o(t.filter(e=>e.offsetTop===n).length)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[t.map(e=>e.id+e.name).join(`|`)]),(0,v.useEffect)(()=>{if(!s)return;let e=e=>{(e instanceof KeyboardEvent?e.key===`Escape`:!i.current?.contains(e.target))&&c(!1)};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,e)}},[s]),!e.macros.length)return null;let u=[...t.slice(a),...n],d=(t,n)=>{c(!1),e.onUse(t,n)};return(0,V.jsxs)(`span`,{className:`macro-bar`,ref:i,children:[(0,V.jsx)(`span`,{className:`macro-chips`,ref:r,children:t.map((e,t)=>(0,V.jsxs)(`button`,{className:`board-chip macro-chip`,title:XS(e,l),tabIndex:t<a?0:-1,"aria-hidden":t<a?void 0:!0,onClick:t=>d(e,t.shiftKey),children:[e.name,e.send&&(0,V.jsx)(`span`,{className:`macro-send`,"aria-label":`sends`,children:` ↵`})]},e.id))}),(0,V.jsx)(`button`,{className:`board-chip macro-chip macro-more${s?` on`:``}`,"aria-expanded":s,"aria-haspopup":`menu`,title:u.length?`${u.length} more macro${u.length===1?``:`s`}`:`Edit macros`,onClick:()=>c(e=>!e),children:u.length?`+${u.length}`:`+`}),s&&(0,V.jsxs)(`div`,{className:`macro-menu`,role:`menu`,children:[u.map(e=>(0,V.jsxs)(`button`,{role:`menuitem`,title:XS(e,l),onClick:t=>d(e,t.shiftKey),children:[(0,V.jsxs)(`span`,{children:[e.name,e.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}),e.key?(0,V.jsx)(`kbd`,{children:BS(e.key,l)}):(0,V.jsx)(`span`,{})]},e.id)),u.length>0&&(0,V.jsx)(`hr`,{}),(0,V.jsx)(`button`,{role:`menuitem`,className:`muted`,onClick:()=>{c(!1),e.onEdit()},children:`Edit macros…`})]})]})}var QS=()=>`m-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,$S=(e,t)=>e!==null&&e!==`~chats`&&!t.some(t=>t.name===e),eC=(e,t)=>e===null?`Global`:`${S(e)}${$S(e,t)?` (removed)`:``}`;function tC(e){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),a=YS(),o=t=>e.run(()=>R.setMacros(t)),s=t&&e.macros.some(e=>e.id===t.id)?t.id:null;return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`div`,{className:`settings-h`,children:(0,V.jsx)(`h3`,{children:`Macros`})}),(0,V.jsx)(`p`,{className:`muted`,children:`Text you send often, as a chip in a session's info bar, a keybind, or both. Kept by Ledung, so your phone and other browsers have them too.`}),e.macros.length>0&&(0,V.jsx)(`ul`,{className:`macro-list`,children:e.macros.map((t,c)=>(0,V.jsxs)(`li`,{className:`${t.id===s?`on`:``}${r===c?` dragged`:``}`,draggable:!0,onDragStart:()=>i(c),onDragEnd:()=>i(null),onDragOver:e=>e.preventDefault(),onDrop:t=>{t.preventDefault(),r!==null&&r!==c&&o(qS(e.macros,r,c)),i(null)},children:[t.chip?(0,V.jsxs)(`span`,{className:`board-chip macro-chip static`,children:[t.name,t.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`})]}):(0,V.jsxs)(`span`,{className:`macro-keyonly`,title:`No chip: this one is on its keybind only`,children:[t.name,t.send&&(0,V.jsx)(`span`,{className:`macro-send`,children:` ↵`}),` `,(0,V.jsx)(`span`,{className:`muted`,children:`· keybind only`})]}),(0,V.jsx)(`span`,{className:`mono macro-text`,title:t.text,children:t.text}),(0,V.jsx)(`span`,{className:`muted macro-what`,children:t.send?`Sends`:`Inserts`}),t.key?(0,V.jsx)(`kbd`,{children:BS(t.key,a)}):(0,V.jsx)(`span`,{className:`muted macro-nokey`,children:`no key`}),(0,V.jsx)(`span`,{className:`chip macro-scope`,title:eC(t.project,e.projects),children:eC(t.project,e.projects)}),(0,V.jsx)(`span`,{className:`macro-move`,title:`Drag to reorder`,"aria-hidden":!0,children:`⋮⋮`}),(0,V.jsxs)(`span`,{className:`macro-row-buttons`,children:[c>0&&(0,V.jsx)(`button`,{className:`small macro-up`,title:`Move up`,"aria-label":`Move ${t.name} up`,onClick:()=>void o(qS(e.macros,c,c-1)),children:`↑`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>n({...t}),children:`Edit`})]})]},t.id))}),t?(0,V.jsx)(nC,{draft:t,macros:e.macros,projects:e.projects,mac:a,isNew:!s,onCancel:()=>n(null),onSave:async t=>{let r=s?e.macros.map(e=>e.id===t.id?t:e):[...e.macros,t];await o(r),n(null)},onDelete:s?async()=>{await o(e.macros.filter(e=>e.id!==t.id)),n(null)}:void 0},t.id):(0,V.jsx)(`button`,{className:`primary`,onClick:()=>n({id:QS(),name:``,text:``,send:!1,key:null,chip:!0,project:null}),children:`Add macro`})]})}function nC(e){let[t,n]=(0,v.useState)(e.draft),[r,i]=(0,v.useState)(e.draft.key!==null),[a,o]=(0,v.useState)(!1),s=B(),c=e=>n(t=>({...t,...e})),l=r?t.key:null,u=l?VS(l,e.macros,t.id):null,d={...t,key:l},f=JS([d]),p=HS(e.macros,t.id),m=!t.name.trim()||!t.text.trim()||r&&!t.key||!!u&&`refused`in u||!!f;return(0,V.jsxs)(`div`,{className:`form macro-form`,children:[(0,V.jsx)(`h4`,{children:e.isNew?`New macro`:`Edit “${e.draft.name}”`}),(0,V.jsxs)(`label`,{children:[`Name`,(0,V.jsx)(`input`,{...s,value:t.name,maxLength:40,placeholder:`Run checks`,onChange:e=>c({name:e.target.value})})]}),(0,V.jsxs)(`label`,{children:[`Text`,(0,V.jsx)(`textarea`,{...s,rows:3,value:t.text,placeholder:`Run the checks and tell me what fails.`,onChange:e=>c({text:e.target.value})}),(0,V.jsxs)(`span`,{className:`muted macro-hint`,children:[`Placeholders: `,WS.map(e=>(0,V.jsxs)(`code`,{children:[`{${e}}`,` `]},e)),`filled from the session. One it has no value for is not sent: the text goes into the message box instead.`]})]}),(0,V.jsxs)(`div`,{className:`field`,children:[(0,V.jsx)(`span`,{children:`When used`}),(0,V.jsxs)(`span`,{className:`segmented macro-seg`,children:[(0,V.jsx)(`button`,{className:`small${t.send?``:` on`}`,"aria-pressed":!t.send,onClick:()=>c({send:!1}),children:`Put it in the message box`}),(0,V.jsx)(`button`,{className:`small${t.send?` on`:``}`,"aria-pressed":t.send,onClick:()=>c({send:!0}),children:`Send it at once`})]}),(0,V.jsx)(`span`,{className:`muted macro-hint`,children:`Shift+click a chip for the other one. A text starting with ! always goes into the box.`})]}),(0,V.jsxs)(`label`,{children:[`Where`,(0,V.jsxs)(`select`,{value:t.project??``,onChange:e=>c({project:e.target.value||null}),children:[(0,V.jsx)(`option`,{value:``,children:`Global (every project)`}),e.projects.map(e=>(0,V.jsx)(`option`,{value:e.name,children:e.name},e.name)),$S(e.draft.project,e.projects)&&(0,V.jsx)(`option`,{value:e.draft.project,children:eC(e.draft.project,e.projects)}),(0,V.jsx)(`option`,{value:x,children:`Chats`})]})]}),(0,V.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:t.chip,onChange:e=>c({chip:e.target.checked})}),` Show as a chip in the info bar`]}),(0,V.jsxs)(`label`,{className:`toggle macro-switch`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,onChange:e=>{i(e.target.checked),e.target.checked&&!t.key&&c({key:p[0]??null})}}),` Keybind`]}),r&&(0,V.jsxs)(`div`,{className:`macro-sub`,children:[(0,V.jsxs)(`span`,{className:`macro-keyrow`,children:[(0,V.jsx)(`input`,{...s,className:`mono macro-keyin${u&&`refused`in u?` bad`:``}`,readOnly:!0,"aria-label":`Keybind`,value:a?`Press the keys…`:t.key?BS(t.key,e.mac):``,onFocus:()=>o(!0),onBlur:()=>o(!1),onKeyDown:e=>{if(e.key===`Tab`||e.key===`Escape`)return;e.preventDefault();let t=RS(e.nativeEvent);t&&(c({key:t}),e.target.blur())}}),(0,V.jsx)(`span`,{className:`muted macro-hint`,children:a?`Ctrl, Alt or Cmd with a letter or a digit`:`Click the box, then press the keys.`})]}),u&&`refused`in u&&(0,V.jsx)(`span`,{className:`macro-conflict`,role:`alert`,children:u.refused}),u&&`warning`in u&&(0,V.jsx)(`span`,{className:`macro-warning`,children:u.warning}),u&&p.length>0&&(0,V.jsxs)(`span`,{className:`macro-hint`,children:[`Free: `,p.map(t=>(0,V.jsx)(`button`,{className:`link macro-free`,onClick:()=>c({key:t}),children:(0,V.jsx)(`kbd`,{children:BS(t,e.mac)})},t))]}),!u&&(0,V.jsx)(`span`,{className:`muted macro-hint`,children:`Works in the message box too. A phone has no keys: there it is in the info bar's + menu.`})]}),!t.chip&&!r&&(0,V.jsx)(`span`,{className:`macro-conflict`,children:`With neither a chip nor a keybind nothing could use it.`}),(0,V.jsxs)(`div`,{className:`macro-keyrow`,children:[(0,V.jsx)(`button`,{className:`primary`,disabled:m,onClick:()=>void e.onSave(d),children:`Save`}),(0,V.jsx)(`button`,{onClick:e.onCancel,children:`Cancel`}),e.onDelete&&(0,V.jsx)(`button`,{className:`deny macro-delete`,onClick:()=>void e.onDelete(),children:`Delete`})]})]})}function rC(e){let t=Vp(am),n=Sp(e.view,t),r={update:Np(e.update.view),remote:jp(e.remote),notifications:e.notify.possible&&!e.notify.on&&!Ht()?`off`:``};return(0,V.jsx)(tm,{groups:_p,current:n,words:r,narrow:t,onOpen:t=>e.onOpen(t===null?`settings`:yp(t)),children:n!==null&&(0,V.jsx)(iC,{group:n,...e})})}function iC(e){switch(e.group){case`update`:{let t=Mp(e.update.view);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Update Ledung`}),t.update&&(0,V.jsx)(`p`,{className:`muted`,children:t.update}),(0,V.jsx)(gC,{update:e.update})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Restart Ledung`}),(0,V.jsx)(`p`,{className:`muted`,children:t.restart}),!!e.config?.restartFor.length&&(0,V.jsx)(`p`,{className:`config-restart`,children:oC(e.config)}),e.canRestart?(0,V.jsx)($p,{hellos:e.hellos}):(0,V.jsx)(`span`,{className:`muted`,title:`This Ledung was started by an older launcher. Restart it once from its console window (Ctrl+C, then Ledung.cmd).`,children:`Restart: from console`})]}),(0,V.jsx)(kS,{}),(0,V.jsx)(OS,{run:e.run})]})}case`claude`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(PS,{accounts:e.accounts,choices:e.accountChoices,defaultIdentity:e.defaultIdentity,configFileProblems:e.accountProblems,projects:e.projects,run:e.run,remote:e.throughPublicName}),(0,V.jsx)(My,{accounts:e.accounts,usageStops:e.usageStops,run:e.run}),(0,V.jsx)(Ab,{sessions:e.sessions}),(0,V.jsx)(If,{accounts:e.accounts,run:e.run})]});case`sessions`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(fp,{run:e.run}),(0,V.jsx)(xb,{})]});case`macros`:return(0,V.jsx)(tC,{macros:e.macros,projects:e.projects,run:e.run});case`remote`:return(0,V.jsx)(aC,{...e});case`look`:return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Appearance`}),(0,V.jsx)(em,{kind:`browser`})]}),(0,V.jsx)(pC,{})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Typing`}),(0,V.jsx)(em,{kind:`browser`})]}),(0,V.jsx)(lC,{})]}),(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Sidebar`}),(0,V.jsx)(em,{kind:`browser`})]}),(0,V.jsx)(uC,{}),(0,V.jsx)(dC,{}),(0,V.jsx)(fC,{})]}),(0,V.jsx)(pS,{run:e.run})]});case`notifications`:return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Notifications`}),(0,V.jsx)(em,{kind:`browser`})]}),(0,V.jsx)(cC,{notify:e.notify,linked:e.computers.some(e=>e.linked)})]});case`config`:return e.config?(0,V.jsx)(sC,{config:e.config}):(0,V.jsx)(`p`,{className:`muted`,children:`…`});default:return(0,V.jsx)(bC,{source:e.source,update:e.update})}}function aC(e){let[t,n]=(0,v.useState)(void 0),[r,i]=(0,v.useState)(null);(0,v.useEffect)(()=>{R.relayAdmin().then(n,()=>n(null))},[]);let a=Ap({remote:e.remote,relaySetUp:t?Qv(t):null,boardConfigured:!!e.board?.configured}),o=t&&(0,V.jsx)(Zv,{view:t,onView:n,run:e.run,newComputers:e.newComputers}),s=e.projects[0]?.name,c=[{id:`remote`,name:`Remote access`,state:a.remote,why:`Reach this Ledung from your phone, anywhere, through a relay.`,form:(0,V.jsx)(vC,{remote:e.remote}),primary:!0},{id:`phones`,name:`Phones`,state:a.phones,why:``},{id:`linked`,name:`Linked computers`,state:a.linked,why:``},{id:`relay`,name:`Run a relay`,state:a.relay,why:`Only if you host a relay for other people.`,form:o},{id:`board`,name:`Message board`,state:a.board,why:s?`Off in every project; turn it on in a project's tab.`:`Off; each project turns it on in its own tab.`,go:s?{label:`Projects ›`,view:Ep(s,`board`)}:void 0}].filter(e=>e.state===`off`||e.state===`needs`);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(Sx,{computers:e.computers,run:e.run}),a.remote===`on`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Remote access`}),(0,V.jsx)(vC,{remote:e.remote})]}),a.phones===`on`&&(0,V.jsx)(mx,{run:e.run,linked:e.computers.some(e=>e.linked)},e.remote?.publicName??`none`),a.linked===`on`&&(0,V.jsx)(xx,{run:e.run},`linked-${e.remote?.publicName??`none`}-${e.remote?.tls??``}`),a.relay===`on`&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Relay`}),o]}),a.board===`on`&&(0,V.jsx)(En,{board:e.board}),c.length>0&&(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`Not set up`}),c.map(t=>r===t.id&&t.state===`off`&&t.form?(0,V.jsxs)(`div`,{className:`offline-open`,role:`group`,"aria-label":t.name,children:[(0,V.jsxs)(`h4`,{children:[(0,V.jsx)(`span`,{children:t.name}),(0,V.jsx)(`button`,{className:`small`,"aria-label":`Close ${t.name}`,title:`Close`,onClick:()=>i(null),children:`✕`})]}),t.form]},t.id):(0,V.jsxs)(`div`,{className:`offline${t.state===`needs`?` needs`:``}`,children:[(0,V.jsx)(`span`,{className:`offline-name`,children:t.name}),(0,V.jsx)(`span`,{className:`offline-why`,children:t.state===`needs`?`Needs remote access first.`:t.why}),t.state===`off`&&t.form&&(0,V.jsx)(`button`,{className:`small${t.primary?` primary`:``}`,onClick:()=>i(t.id),children:`Set up ›`}),t.state===`off`&&t.go&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>e.onOpen(t.go.view),children:t.go.label})]},t.id))]})]})}function oC(e){return`Restart Ledung to apply: ${e.restartFor.join(`, `)}`}function sC(e){let t=e.config,n=new Date(t.readAt).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`});return(0,V.jsxs)(`section`,{children:[(0,V.jsxs)(`div`,{className:`settings-h`,children:[(0,V.jsx)(`h3`,{children:`Config file`}),(0,V.jsx)(em,{kind:`config`})]}),(0,V.jsxs)(`p`,{className:`muted`,children:[`Ledung reads `,(0,V.jsx)(`code`,{children:t.file}),` again whenever it changes. Most settings apply at once, to new and resumed sessions; running sessions keep what they started with. A few, such as the port and the network, need Restart Ledung.`]}),(0,V.jsx)(`p`,{children:t.reloaded?`Last reloaded ${n}.`:`Read at start, ${n}; not changed since.`}),t.problem&&(0,V.jsxs)(`p`,{className:`config-problem`,role:`alert`,children:[`The last change was not applied, the settings in use stay: `,t.problem]}),!!t.restartFor.length&&(0,V.jsx)(`p`,{className:`config-restart`,children:oC(t)})]})}function cC({notify:e,linked:t}){return Ht()?(0,V.jsx)(_x,{linked:t}):e.possible?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`A browser notification when something new needs your answer and this page is in the background`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.on,onChange:t=>void e.set(t.target.checked)}),` Send notifications when an agent is waiting for you`]}),(0,V.jsx)(`p`,{className:`muted`,children:`While a Ledung page is open in this browser.`}),e.denied&&(0,V.jsx)(`p`,{className:`muted`,children:`The browser blocks notifications for this page. Allow them in the browser's site settings (the icon left of the address), then switch this on again.`})]}):(0,V.jsx)(`p`,{className:`muted`,children:`Notifications work when this page is opened on this computer at 127.0.0.1.`})}function lC(){let[e,t]=vn();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`Off: the browser doesn't correct words as you type. Spell checking and automatic capitals are left to the browser either way`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Autocorrect`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: words stay as you type them in the message box, answers and every other text field. Spell checking and capitals are the browser's own either way.`})]})}function uC(){let[e,t]=Ax();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`The coloured dot left of each session in the sidebar; the ship shows much the same`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Status dot`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: no dot on the session rows; hover a row for its status, and an ended session's name is faded.`})]})}function dC(){let[e,t]=Hx();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`toggle`,title:`The Archived (N) entry under each project in the sidebar, which opens its archived sessions`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e,onChange:e=>t(e.target.checked)}),` Show "Archived" in the sidebar`]}),(0,V.jsx)(`p`,{className:`muted`,children:`Off: no Archived entry under the projects; switch it on to open their archived sessions.`})]})}function fC(){let[e,t]=Ix(),n=xt.find(t=>t.step===e).label;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`label`,{className:`compact-slider`,title:`Less padding and fewer rows on each session in the sidebar; the ship always stays`,children:[(0,V.jsx)(`span`,{children:`Compact sidebar`}),(0,V.jsx)(yb,{step:e,labels:xt.map(e=>e.label),onPick:e=>t(e),children:(0,V.jsx)(`input`,{type:`range`,min:1,max:xt.length,step:1,value:e,list:`compact-steps`,"aria-valuetext":n,onChange:e=>t(Number(e.target.value))})})]}),(0,V.jsx)(`datalist`,{id:`compact-steps`,children:xt.map(e=>(0,V.jsx)(`option`,{value:e.step,label:e.label},e.step))}),(0,V.jsx)(`p`,{className:`muted`,children:`Each step takes more off the session cards: tighter padding and no date and time, then only the name, the ship and the badge, with a small "+" for a new session. Hover a card for what it no longer shows.`})]})}function pC(){let[e,t]=(0,v.useState)(()=>ot(localStorage)),n=e=>{t(e),st(dn,e),ct(document.documentElement,e)};return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Colour scheme`,children:rt.map(t=>(0,V.jsx)(`button`,{className:e===t.id?`on`:``,"aria-pressed":e===t.id,onClick:()=>n(t.id),children:t.label},t.id))}),(0,V.jsx)(`p`,{className:`muted`,children:`System follows the computer's light or dark setting.`})]})}var mC=e=>e?e.slice(0,7):`unknown commit`,hC={waiting:`○`,running:`…`,done:`✓`,failed:`✗`};function gC({update:e}){let{view:t,error:n,act:r}=e,[i,a]=(0,v.useState)(!1);if(n)return(0,V.jsx)(`p`,{className:`restart-problem`,children:n});if(!t)return(0,V.jsx)(`p`,{className:`muted`,children:`…`});if(t.npm)return(0,V.jsx)(_C,{update:e});if(!t.available)return(0,V.jsx)(`p`,{className:`muted`,children:t.reason});let o=t.checking||t.updating||t.restarting,s=t.check,c=!!s&&!s.upToDate&&!t.updating&&!t.restarting;return(0,V.jsxs)(`div`,{className:`update-panel`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Running `,t.running?.commit?(0,V.jsx)(`code`,{children:mC(t.running.commit)}):`an unknown commit (its source is not a git clone)`,`, built from `,(0,V.jsx)(`code`,{children:t.running?.source}),`.`]}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:o,onClick:()=>{a(!1),r(R.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),s&&!t.checking&&(s.upToDate?(0,V.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,mC(s.latest),`)`]}):(0,V.jsxs)(`span`,{children:[s.behind,` new change`,s.behind===1?``:`s`,` on main (`,mC(s.latest),`)`,s.commitKnown?``:`, counted from the source folder`]}))]}),t.checkError&&(0,V.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!s.upToDate&&s.changes.length>0&&(0,V.jsx)(`ul`,{className:`update-changes`,children:s.changes.map((e,t)=>(0,V.jsx)(`li`,{children:e},t))}),c&&!t.canRestart&&(0,V.jsx)(`p`,{className:`muted`,children:`Updating ends in a restart, and this Ledung was started by an older launcher. Restart it once from its console window first.`}),c&&t.canRestart&&(i?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`Pull main, npm install, npm run release, then restart. Sessions keep running.`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{a(!1),r(R.update)},children:`Update now`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>a(!1),children:`Cancel`})]}):(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>a(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,V.jsx)(`ol`,{className:`update-steps`,children:t.steps.map(e=>(0,V.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,V.jsx)(`span`,{className:`update-mark`,children:hC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,V.jsx)(`pre`,{className:`update-output`,children:e.output})]},e.label))}),t.refused&&(0,V.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,V.jsx)(`p`,{className:`muted`,children:`The new release is built. Restarting into it…`})]})}function _C({update:e}){let{view:t,act:n}=e,[r,i]=(0,v.useState)(!1);if(!t?.npm)return null;let a=t.checking||t.updating||t.restarting,o=t.npmCheck&&t.npmCheck.channel===(t.channel??`public`)?t.npmCheck:null,s=!!o?.offered&&!o.upToDate&&!t.updating&&!t.restarting,c=xC[t.channel??`public`];return(0,V.jsxs)(`div`,{className:`update-panel`,children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`Running Ledung `,(0,V.jsx)(`code`,{children:wx(t.npm.version)}),`, installed from npm, on the `,c,` channel (Settings → About).`]}),(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsx)(`button`,{className:`small`,disabled:a,onClick:()=>{i(!1),n(R.updateCheck)},children:t.checking?`Checking…`:`Check for updates`}),o&&!t.checking&&(o.offered?o.upToDate?(0,V.jsxs)(`span`,{className:`update-ok`,children:[`Up to date (`,c,`: `,wx(o.offered),`)`]}):(0,V.jsxs)(`span`,{children:[wx(o.offered),` is out on `,c]}):(0,V.jsxs)(`span`,{children:[`npm has no `,c,` version yet`]}))]}),t.checkError&&(0,V.jsx)(`pre`,{className:`update-output restart-problem`,children:t.checkError}),s&&!t.canRestart&&(0,V.jsx)(`p`,{className:`muted`,children:t.reason}),s&&t.canRestart&&(r?(0,V.jsxs)(`div`,{className:`restart-confirm`,children:[(0,V.jsxs)(`span`,{className:`muted`,children:[`npm install -g ledung@`,o.offered,`, then restart. Sessions keep running.`]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{i(!1),n(R.update)},children:`Update now`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>i(!1),children:`Cancel`})]}):(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>i(!0),children:`Update Ledung`})})),t.steps.length>0&&(0,V.jsx)(`ol`,{className:`update-steps`,children:t.steps.map((e,t)=>(0,V.jsxs)(`li`,{className:`update-step ${e.state}`,children:[(0,V.jsx)(`span`,{className:`update-mark`,children:hC[e.state]}),` `,e.label,e.state===`failed`&&e.output&&(0,V.jsx)(`pre`,{className:`update-output`,children:e.output})]},t))}),t.refused&&(0,V.jsx)(`p`,{className:`restart-problem`,children:t.refused}),t.restarting&&(0,V.jsx)(`p`,{className:`muted`,children:`The new version is installed. Restarting into it…`}),!t.steps.length&&!s&&(0,V.jsx)(`p`,{className:`muted`,children:t.reason})]})}function vC(e){let t=jb(e.remote);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`p`,{className:`remote-state ${e.remote?.state??`off`}`,children:t.label}),t.detail&&(0,V.jsx)(`p`,{className:`muted`,children:t.detail}),e.remote?.tls&&(0,V.jsx)(`p`,{className:`remote-tls`,children:e.remote.tls}),e.remote?.certificate&&(0,V.jsx)(yC,{cert:e.remote.certificate}),(0,V.jsx)(Xv,{remote:e.remote})]})}function yC({cert:e}){let t=Pb(e,Date.now()),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{className:`remote-certificate`,children:[(0,V.jsx)(`p`,{className:t.warn?`remote-tls`:`remote-state connected`,children:t.label}),t.detail&&(0,V.jsx)(`p`,{className:`muted`,children:t.detail}),t.copy&&e.accountUrl&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`p`,{className:`muted`,children:[`ACME account (`,e.acme,`): `,(0,V.jsx)(`code`,{children:e.accountUrl}),` `,(0,V.jsx)(Of,{text:e.accountUrl})]}),e.record&&(0,V.jsxs)(`p`,{className:`muted`,children:[`CAA record: `,(0,V.jsx)(`code`,{className:`remote-record`,children:e.record}),` `,(0,V.jsx)(Of,{text:e.record})]}),(0,V.jsx)(`div`,{className:`restart-confirm`,children:(0,V.jsx)(`button`,{className:`small`,disabled:n,onClick:()=>{r(!0),a(null),R.certificateCheck().catch(e=>a(e.message)).finally(()=>r(!1))},children:n?`Checking…`:`Check now`})})]}),i&&(0,V.jsx)(`p`,{className:`restart-problem`,children:i})]})}function bC({source:e,update:t}){return(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h3`,{children:`About`}),(0,V.jsx)(`p`,{className:`muted`,children:`Ledung is free software under the GNU Affero General Public License, version 3, with an additional permission for Anthropic's software; a commercial license is also available.`}),(0,V.jsxs)(`p`,{className:`muted`,children:[`It runs Anthropic's Claude Agent SDK and Claude Code, installed from npm under `,(0,V.jsx)(`a`,{href:`https://code.claude.com/docs/en/legal-and-compliance`,target:`_blank`,rel:`noreferrer`,children:`Anthropic's own terms`}),`. They are not covered by Ledung's license.`]}),e&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Running `,(0,V.jsx)(`code`,{children:e.version}),`. `,(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,children:`Source`})]}),t.view&&(0,V.jsx)(SC,{update:t})]})}var xC={public:`Public`,dev:`Dev`};function SC({update:e}){let t=e.view,n=t.channel??`public`;return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Update channel`}),(0,V.jsx)(`div`,{className:`restart-confirm`,role:`radiogroup`,"aria-label":`Update channel`,children:[`public`,`dev`].map(r=>(0,V.jsxs)(`label`,{children:[(0,V.jsx)(`input`,{type:`radio`,name:`update-channel`,checked:n===r,disabled:t.updating||t.restarting,onChange:()=>e.act(()=>R.updateChannel(r))}),` `,xC[r]]},r))}),(0,V.jsxs)(`p`,{className:`muted`,children:[n===`dev`?`Dev: updates to dev builds, made after changes are merged and before a public release, as well as public releases.`:`Public: updates to public releases only, as npm install -g ledung gets them.`,` `,t.npm?`Check for updates is under Update & restart.`:`This Ledung updates from main in the folder it was built from, so the channel applies only once it is installed from npm.`]})]})}var CC=(e,t)=>`bt:${e}#${t}`;function wC(e){let t=/^bt:([^#]+)#(.+)$/.exec(e??``);return t?{repo:t[1],id:t[2]}:null}var TC=(e,t)=>`#/board/${e}/${encodeURIComponent(t)}`;function EC(e){let t=/^#\/board\/([A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+)\/([^/]+)$/.exec(e);if(!t)return null;try{return{repo:t[1],id:decodeURIComponent(t[2])}}catch{return null}}function DC(e,t){return e.mine?`this Ledung's manager of project ${e.fromProject??`unknown`}`:e.viaLedung?`@${e.author}'s Ledung${e.fromProject?`, project ${e.fromProject}`:``}`:`typed on ${t} by @${e.author}`}function OC(e){let t=e.deliveries.map(t=>{switch(t.kind){case`wake`:return{text:`woke ${t.project}`,level:`ok`,project:t.project};case`quiet`:return{text:`quiet to ${t.project}`,level:`quiet`,project:t.project};case`channel`:return{text:`channel, ${t.project}`,level:`quiet`,project:t.project};case`ignored`:return{text:`not delivered to ${t.project}: its allowlist does not name @${e.author}`,level:`warn`,project:t.project}}});return t.length?t:e.status===`sent`?[{text:`sent from this Ledung`,level:`none`}]:e.status===`ignored`?[{text:`not delivered: no project here allows @${e.author}; only the id was kept, not the text`,level:`warn`}]:e.status===`quiet`?[{text:`not delivered: it reached no manager (no front desk, or the project's board is off)`,level:`warn`}]:[{text:`not for this Ledung`,level:`none`}]}var kC={project:``,repo:``,unreadOnly:!1,notDelivered:!1},AC=e=>e.dropped+e.refused+e.unsent>0,jC=(e,t=``)=>t?e.unread[t]??0:Object.values(e.unread).reduce((e,t)=>e+t,0);function MC(e,t){return e.filter(e=>(!t.repo||e.repo===t.repo)&&(!t.project||e.projects.includes(t.project))&&(!t.unreadOnly||jC(e,t.project)>0)&&(!t.notDelivered||AC(e)))}var NC=e=>e&&/^https:\/\//.test(e)?e:null;function PC(e,t){let[n,r]=(0,v.useState)({data:null,error:null});return(0,v.useEffect)(()=>{let t=!0;return e().then(e=>t&&r({data:e,error:null}),e=>t&&r(t=>({data:t.data,error:e.message}))),()=>{t=!1}},t),n}var FC=kC,IC=e=>e.length>4?`${e.slice(0,4).join(`, `)} +${e.length-4}`:e.join(`, `);function LC(e){let{data:t,error:n}=PC(()=>R.boardThreads(),[e.board]),[r,i]=(0,v.useState)(FC),a=e=>i(t=>FC={...t,...e}),o=(0,v.useMemo)(()=>Object.keys(e.board?.projects??{}).filter(t=>e.board.projects[t].repo).sort(),[e.board]),s=(e.board?.boards??[]).map(e=>e.repo),c=(0,v.useMemo)(()=>MC(t?.threads??[],r),[t,r]),l=r.project||r.repo||r.unreadOnly||r.notDelivered;return(0,V.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,V.jsxs)(`header`,{className:`session-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:`Board`}),(0,V.jsx)(`div`,{className:`muted`,children:`Read-only. The managers' messages with other people's Ledungs, newest first. Looking here posts nothing and marks nothing read.`})]}),(0,V.jsx)(`div`,{className:`session-corner`,children:(0,V.jsx)(`button`,{className:`small`,onClick:e.onOpenSettings,children:`Board settings`})})]}),(0,V.jsxs)(`div`,{className:`board-filters`,role:`group`,"aria-label":`Filter threads`,children:[o.length>1&&(0,V.jsxs)(`label`,{children:[`Project`,(0,V.jsxs)(`select`,{value:r.project,onChange:e=>a({project:e.target.value}),children:[(0,V.jsx)(`option`,{value:``,children:`All projects`}),o.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),s.length>1&&(0,V.jsxs)(`label`,{children:[`Board`,(0,V.jsxs)(`select`,{value:r.repo,onChange:e=>a({repo:e.target.value}),children:[(0,V.jsx)(`option`,{value:``,children:`All boards`}),s.map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]})]}),(0,V.jsxs)(`label`,{className:`toggle`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.unreadOnly,onChange:e=>a({unreadOnly:e.target.checked})}),` Unread only`]}),(0,V.jsxs)(`label`,{className:`toggle`,title:`Threads with a post that reached no manager: dropped (sender not allowed), refused by a project's allowlist, or for nobody's inbox`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r.notDelivered,onChange:e=>a({notDelivered:e.target.checked})}),` Not delivered`]}),l&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>{FC=kC,i(kC)},children:`Clear filters`})]}),(0,V.jsxs)(`div`,{className:`waiting-list board-list`,children:[n&&(0,V.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,V.jsx)(`p`,{className:`muted`,children:`Reading the board…`}),t&&c.length===0&&(0,V.jsx)(`p`,{className:`muted`,children:l?`No thread matches these filters.`:`No threads yet. Posts from the board appear here once Ledung has seen them.`}),c.map(t=>(0,V.jsx)(RC,{t,filters:r,onOpen:e.onOpen,showRepo:s.length>1},`${t.repo}#${t.id}`)),t?.truncated&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Only the `,t.threads.length,` most recent threads are listed.`]})]})]})}function RC({t:e,filters:t,onOpen:n,showRepo:r}){let i=jC(e,t.project),a=[e.dropped?`${e.dropped} dropped (sender not allowed)`:``,e.refused?`${e.refused} refused by a project's allowlist`:``,e.unsent?`${e.unsent} reached no manager`:``].filter(Boolean),o=e.last,s=o?o.mine?`${o.fromProject??`this Ledung`}`:o.viaLedung?`@${o.author}'s Ledung`:`@${o.author}`:``;return(0,V.jsxs)(`button`,{className:`board-thread-card${i?` unread`:``}`,onClick:()=>n(CC(e.repo,e.id)),children:[(0,V.jsxs)(`span`,{className:`board-thread-top`,children:[(0,V.jsxs)(`span`,{className:`board-thread-title`,children:[i>0&&(0,V.jsx)(`span`,{className:`unread-dot`,"aria-label":`unread`}),e.onlyDropped?`Thread ${e.id} (dropped posts only)`:e.title]}),(0,V.jsx)(`span`,{className:`muted board-thread-time`,children:Dg(e.updatedAt)})]}),(0,V.jsxs)(`span`,{className:`board-thread-meta muted`,children:[(0,V.jsx)(`span`,{className:`mono`,children:r?`${e.repo} #${e.id}`:`#${e.id}`}),e.participants.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,IC(e.participants)]})]}),(0,V.jsxs)(`span`,{className:`board-thread-chips`,children:[i>0&&(0,V.jsxs)(`span`,{className:`chip accent`,children:[i,` unread`]}),e.projects.map(e=>(0,V.jsx)(`span`,{className:`chip`,children:e},e)),a.map(e=>(0,V.jsx)(`span`,{className:`chip warn`,children:e},e))]}),o&&(0,V.jsxs)(`span`,{className:`board-thread-last`,children:[(0,V.jsxs)(`strong`,{children:[s,`:`]}),` `,o.text||`(empty)`]})]})}function zC(e){let{data:t,error:n}=PC(()=>R.boardThread(e.repo,e.id),[e.repo,e.id,e.board]),r=t=>e.projects.find(e=>e.name===t)?.managerId??null,i=NC(t?.url??null);return(0,V.jsxs)(`div`,{className:`waiting-view board-view`,children:[(0,V.jsxs)(`header`,{className:`session-head`,children:[(0,V.jsxs)(`div`,{className:`session-head-text`,children:[(0,V.jsx)(`h2`,{children:t&&!t.missing?t.title:`Thread ${e.id}`}),(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsxs)(`span`,{className:`mono`,children:[e.repo,` #`,e.id]}),t&&t.participants.length>0&&(0,V.jsxs)(V.Fragment,{children:[` · `,IC(t.participants)]})]})]}),(0,V.jsx)(`div`,{className:`session-corner`,children:(0,V.jsx)(`button`,{className:`small`,onClick:e.onBack,children:`← Board`})})]}),(0,V.jsxs)(`div`,{className:`waiting-list board-thread-page`,children:[(0,V.jsxs)(`p`,{className:`muted board-readonly`,children:[`Read-only: nothing is posted from here and opening this does not mark anything read.`,i&&(0,V.jsxs)(V.Fragment,{children:[` `,(0,V.jsxs)(`a`,{href:i,target:`_blank`,rel:`noopener noreferrer`,children:[`Open the thread on `,t?.service??`the board`]}),`.`]})]}),n&&(0,V.jsx)(`p`,{className:`board-error`,children:n}),!t&&!n&&(0,V.jsx)(`p`,{className:`muted`,children:`Reading the thread…`}),t?.missing&&(0,V.jsx)(`p`,{className:`muted`,children:`Ledung holds no posts of this thread. It may be older than the board's first check here, or on a board no project here uses.`}),t?.truncated&&(0,V.jsxs)(`p`,{className:`muted`,children:[`Only the latest `,t.posts.length,` posts are shown.`]}),t?.posts.map(n=>(0,V.jsx)(VC,{p:n,service:t.service,managerOf:r,onOpen:e.onOpen},n.id))]})]})}function BC({files:e}){return(0,V.jsx)(`ul`,{className:`board-attachments`,children:e.map((e,t)=>{let n=e.size>=1048576?`${(e.size/1048576).toFixed(1)} MB`:`${Math.max(1,Math.round(e.size/1024))} KB`,r=`${e.name} · ${e.kind===`text`?`text`:e.kind.toUpperCase()} · ${n}`;if(e.file&&e.kind!==`text`){let n=Tf(``,e.file);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,children:(0,V.jsx)(`img`,{src:n,alt:e.name})}),(0,V.jsx)(`span`,{children:r})]},t)}let i=e.pruned?`pruned`:e.error?`not fetched: ${e.error}`:`in the board cache`;return(0,V.jsx)(`li`,{className:`muted`,children:(0,V.jsxs)(`span`,{children:[r,` · `,i]})},t)})})}function VC({p:e,service:t,managerOf:n,onOpen:r}){let i=e.mine?`out`:e.viaLedung?`ledung`:`typed`,a=e.deliveries.some(e=>!e.read),o=NC(e.url);return(0,V.jsxs)(`div`,{className:`msg board-post board-post-card ${i}${e.text===null?` dropped`:``}${a?` unread`:``}`,children:[(0,V.jsxs)(`div`,{className:`msg-meta`,children:[(0,V.jsx)(`span`,{className:`who`,children:DC(e,t)}),a&&(0,V.jsx)(`span`,{className:`chip accent`,children:`unread`}),(0,V.jsx)(`time`,{className:`time`,children:Dg(e.at)}),o&&(0,V.jsxs)(`a`,{className:`board-post-link`,href:o,target:`_blank`,rel:`noopener noreferrer`,children:[`on `,t]})]}),e.recipients.length>0&&(0,V.jsxs)(`div`,{className:`board-thread`,children:[`To `,e.recipients.join(`, `)]}),e.text===null?(0,V.jsxs)(`div`,{className:`msg-body muted`,children:[`Dropped: no project here allows @`,e.author,`, so Ledung kept only that this post exists, not its text.`]}):(0,V.jsx)(`div`,{className:`msg-body plain`,children:e.text}),e.attachments.length>0&&(0,V.jsx)(BC,{files:e.attachments}),(0,V.jsx)(`ul`,{className:`board-delivery-list`,children:OC(e).map((e,t)=>{let i=e.project?n(e.project):null;return(0,V.jsxs)(`li`,{className:`delivery-${e.level}`,children:[e.text,i&&(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`button`,{className:`link`,onClick:()=>r(i),children:[e.project,`'s manager chat`]})]})]},t)})})]})}var HC=80;function UC({value:e,onSave:t,onDone:n,label:r}){let i=B(),[a,o]=(0,v.useState)(e),s=a.replace(/\s+/g,` `).trim();return(0,V.jsx)(`input`,{...i,className:`name-editor`,"aria-label":r,autoFocus:!0,maxLength:HC,value:a,onFocus:e=>e.currentTarget.select(),onChange:e=>o(e.target.value),onClick:e=>e.stopPropagation(),onBlur:n,onKeyDown:r=>{if(r.stopPropagation(),r.key===`Escape`)n();else if(r.key===`Enter`&&!r.nativeEvent.isComposing){if(r.preventDefault(),!s)return;s===e?n():t(s).then(n)}}})}function WC(e,t){return GC(e)-GC(t)||(e.position!==null&&t.position!==null?e.position-t.position:t.createdAt-e.createdAt)}function GC(e){return e.position===null?e.status===`ended`?2:0:1}function KC(e,t,n){let r=e.indexOf(t);if(r<0)return e;let i=e.filter(e=>e!==t),a=Math.max(0,Math.min(i.length,n>r?n-1:n));return[...i.slice(0,a),t,...i.slice(a)]}function qC(e,t){let n=e.findIndex(e=>t<e);return n<0?e.length:n}function JC(e,t,n){let r=e.indexOf(t);return n===r||n===r+1}var YC=5,XC=450,ZC=8,QC=28;function $C(e){let t=(0,v.useRef)(null),[n,r]=(0,v.useState)(null),i=(0,v.useRef)(null),a=(0,v.useRef)(null),o=(0,v.useRef)(!1),s=(0,v.useRef)(e);s.current=e;let c=(0,v.useRef)(null),l=e=>[...t.current?.querySelectorAll(`[data-drag]`)??[]].filter(t=>t.dataset.drag===e),u=(e,t)=>t===`projects`?e.closest(`.project-group`)??e:e,d=(e,n,r)=>{let i=l(e.group),a=i.find(t=>t.dataset.dragId===e.id),o=(e.group===`projects`?t.current:a?.closest(`.project-group`))?.getBoundingClientRect();if(!o||n<o.left||n>o.right||r<o.top||r>o.bottom)return null;let s=qC(i.map(t=>{let n=u(t,e.group).getBoundingClientRect();return n.top+n.height/2}),r);return JC(i.map(e=>e.dataset.dragId),e.id,s)?null:s},f=e=>{let t=a.current;i.current?.timer&&clearTimeout(i.current.timer),i.current=null,a.current=null,c.current?.(),c.current=null,document.body.classList.remove(`sidebar-dragging`),r(null),t&&(o.current=!0,setTimeout(()=>{o.current=!1},0),e&&t.slot!==null&&s.current(t.group,KC(l(t.group).map(e=>e.dataset.dragId),t.id,t.slot)))},p=e=>{a.current={group:e.group,id:e.id,slot:null},document.body.classList.add(`sidebar-dragging`),r(a.current),e.touch&&navigator.vibrate?.(10)},m=e=>{let n=t.current;if(!n)return;let r=n.scrollHeight>n.clientHeight?n:n.closest(`.sidebar`);if(!r)return;let i=r.getBoundingClientRect();e<i.top+QC?r.scrollBy(0,-10):e>i.bottom-QC&&r.scrollBy(0,10)};return(0,v.useEffect)(()=>{let e=t.current;if(!e)return;let n=e=>{a.current&&e.preventDefault()};return e.addEventListener(`touchmove`,n,{passive:!1}),()=>{e.removeEventListener(`touchmove`,n),c.current?.()}},[]),{nav:t,drag:n,handlers:{onPointerDown:e=>{if(e.button!==0||i.current)return;let n=e.target.closest(`[data-drag]`);if(!n||!t.current?.contains(n))return;let o=e.pointerType===`touch`,s={pointerId:e.pointerId,x:e.clientX,y:e.clientY,group:n.dataset.drag,id:n.dataset.dragId,touch:o,timer:null};if(i.current=s,o)s.timer=window.setTimeout(()=>{s.timer=null,i.current===s&&p(s)},XC);else try{n.setPointerCapture(e.pointerId)}catch{}let l=e=>{if(e.pointerId!==s.pointerId)return;let t=Math.hypot(e.clientX-s.x,e.clientY-s.y);if(!a.current){if(s.touch){t>ZC&&f(!1);return}if(t<YC)return;p(s)}let n=a.current,i=d(n,e.clientX,e.clientY);i!==n.slot&&(a.current={...n,slot:i},r(a.current)),m(e.clientY)},u=e=>{e.pointerId===s.pointerId&&f(!0)},h=e=>{e.pointerId===s.pointerId&&f(!1)},g=e=>{e.key===`Escape`&&a.current&&(e.preventDefault(),e.stopPropagation(),f(!1))};window.addEventListener(`pointermove`,l),window.addEventListener(`pointerup`,u),window.addEventListener(`pointercancel`,h),document.addEventListener(`keydown`,g,!0),c.current=()=>{window.removeEventListener(`pointermove`,l),window.removeEventListener(`pointerup`,u),window.removeEventListener(`pointercancel`,h),document.removeEventListener(`keydown`,g,!0)}},onClickCapture:e=>{o.current&&(e.preventDefault(),e.stopPropagation())},onContextMenu:e=>{(i.current?.touch||a.current)&&e.preventDefault()}}}}var ew=`ledung.sidebar.folded`,tw=`ledung.sidebar.foldedSessions`,nw=(e,t,n)=>({count:(e?.count??0)+1,pending:(e?.pending??0)+(n[t.s.id]??0),working:(e?.working??!1)||ut(t.s)===`running`});function rw(e,t){let n=[],r=null,i=null,a=null;return e.forEach((o,s)=>{o.depth===0&&(i=o.s.id,a=null);let c=t.folded||o.depth>0&&i!==null&&t.foldedSessions.includes(i),l=o.depth===0&&e[s+1]?.depth===1;if(!c||o.s.id===t.openId){let e={...o,...c?{drag:null}:{},folds:l,folded:l&&t.foldedSessions.includes(o.s.id),hidden:null};n.push(e),o.depth===0&&(a=e)}else t.folded?r=nw(r,o,t.pending):a&&(a.hidden=nw(a.hidden,o,t.pending))}),t.folded&&!r&&(r={count:0,pending:0,working:!1}),{rows:n,project:r}}function iw(e,t){try{let n=JSON.parse(e.getItem(t)??`[]`);return Array.isArray(n)?n.filter(e=>typeof e==`string`):[]}catch{return[]}}function aw(e,t,n){try{n.length?e.setItem(t,JSON.stringify(n)):e.removeItem(t)}catch{}}var ow=e=>iw(e,ew),sw=(e,t)=>aw(e,ew,t),cw=e=>iw(e,tw),lw=(e,t)=>aw(e,tw,t);function uw(e,t,n=()=>!0){let r=e.filter(e=>e!==t&&n(e));return e.includes(t)?r:[...r,t]}function dw(e,t){let n=[e.container,e.host===`github.com`?null:e.host].filter(Boolean).join(`, `),r=e=>e.toLocaleString(`en-US`),i=e.polling===`slow`?` · PRs checked every 10 min`:e.polling===`stopped`?` · PRs not checked until then`:``;return`GitHub${n?` (${n})`:``}: ${r(e.remaining)} of ${r(e.limit)} left until ${t(e.resetAt)}${i}`}function fw(e,t){return e.filter(e=>e.resetAt>t)}function pw(e){return e.polling===`stopped`?`critical`:e.polling===`slow`?`warning`:``}var mw=[`settings`,`accounts`,`add`,`chats`],hw=e=>!!e&&(mw.includes(e)||/^(settings|chats):/.test(e));function gw(e,t,n){return hw(n)?hw(e)?{depth:t.depth+1,root:t.root}:{depth:1,root:!1}:{depth:0,root:!1}}function _w(e){return e.depth>0&&!e.root?{back:e.depth}:{start:!0}}var vw=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing,yw=e=>e===null?`phone-list`:`phone-pane`;function bw(e){return e?.ledungFromList===!0?{back:1}:{open:null}}var xw=e=>e?null:`overview`,Sw=e=>`ledung.draft.${e}`;function Cw(e,t){try{return e.getItem(Sw(t))??``}catch{return``}}function ww(e,t,n){try{n?e.setItem(Sw(t),n):e.removeItem(Sw(t))}catch{}}function Tw(e,t=localStorage){let[n,r]=(0,v.useState)(()=>Cw(t,e)),i=(0,v.useRef)(n),a=(0,v.useRef)(n);(0,v.useEffect)(()=>{i.current=n});let o=(0,v.useCallback)(()=>{i.current!==a.current&&(a.current=i.current,ww(t,e,i.current))},[t,e]);return(0,v.useEffect)(()=>{if(n===a.current)return;let e=setTimeout(o,300);return()=>clearTimeout(e)},[n,o]),(0,v.useEffect)(()=>{let e=()=>{document.visibilityState===`hidden`&&o()};return window.addEventListener(`pagehide`,o),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`pagehide`,o),document.removeEventListener(`visibilitychange`,e),o()}},[o]),[n,r]}function Ew(e){let t=(0,v.useRef)(e);return(0,v.useLayoutEffect)(()=>{t.current=e}),(0,v.useCallback)((...e)=>t.current(...e),[])}function Dw(e){let t=e.status===`ended`,n=!t&&e.status!==`stopping`;return{menu:[...e.role===`manager`?[`away`]:[],`permissions`,...e.role===`session`?[`priority`]:[],`toolCalls`,`usage`,...n?[`pause`,`stop`]:[],...e.claudeVersion?[`version`]:[]],header:[...e.status===`queued`?[`startNow`]:[],...e.clearDue!=null&&!t?[`clear`]:[],...e.compacting&&!t?[`compacting`]:[],...t&&e.claudeSessionId?[`resume`]:[],...t&&e.role===`session`?[`archive`]:[]]}}var Ow=e=>e.status!==`ended`&&e.status!==`stopping`,kw={connected:`connected`,failed:`failed`,"needs-auth":`needs sign-in`,pending:`starting`,disabled:`disabled`},Aw=e=>e.status===`running`||e.status===`waiting`,jw=e=>e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey&&!e.isComposing&&(/^[a-z]$/i.test(e.key)?e.key.toLowerCase()===`o`:e.code===`KeyO`),Mw=e=>e.key===`Escape`&&!e.defaultPrevented&&!e.isComposing;function Nw(e){return`${e<10?e.toFixed(1):Math.round(e)} ${e>=.95&&e<1.05?`core`:`cores`}`}function Pw(e){return e>=1024**3?`${(e/1024**3).toFixed(e>=10*1024**3?0:1)} GB`:e>=1024**2?`${Math.round(e/1024**2)} MB`:`${Math.round(e/1024)} KB`}function Fw(e){let t=Math.round(e/1e3);return t<60?`${t} s`:t<3600?`${Math.round(t/60)} min`:`${(t/3600).toFixed(1)} h`}var Iw={normal:`Normal`,high:`High`,critical:`Critical`};function Lw({label:e,used:t,total:n,text:r}){let i=n>0?t/n:0,a=i>=.95?`critical`:i>=.8?`warning`:`good`,o={good:`●`,warning:`▲`,critical:`■`}[a];return(0,V.jsxs)(`div`,{className:`limit`,title:`${e}: ${r}${a===`good`?``:a===`warning`?` (busy)`:` (full)`}`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:e}),(0,V.jsxs)(`span`,{className:`limit-status ${a}`,children:[o,` `,Math.round(i*100),`%`]})]}),(0,V.jsx)(`div`,{className:`limit-track`,children:(0,V.jsx)(`div`,{className:`limit-fill ${a}`,style:{width:`${Math.min(100,i*100)}%`}})}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:r})]})}function Rw(e){let t=e.machine,[n,r]=(0,v.useState)(``);if((0,v.useEffect)(()=>r(t?String(t.limit):``),[t?.limit]),!t)return null;let i=()=>{let i=Number(n);i!==t.limit&&e.run(()=>R.setLimit(i)).finally(()=>r(String(t.limit)))},a=t=>e.sessions.find(e=>e.id===t)?.title??`a session`;return(0,V.jsxs)(`section`,{className:`machine`,"aria-label":`Machine`,children:[(0,V.jsxs)(`div`,{className:`limits`,children:[(0,V.jsx)(Lw,{label:`CPU`,used:t.cores,total:t.cpus,text:`${Nw(t.cores)} of ${t.cpus}`}),(0,V.jsx)(Lw,{label:`Memory`,used:t.memUsed,total:t.memTotal,text:`${Pw(t.memUsed)} of ${Pw(t.memTotal)}`}),t.docker&&(0,V.jsx)(Lw,{label:`Docker memory`,used:t.docker.memUsed,total:t.docker.memTotal,text:`${Pw(t.docker.memUsed)} of ${Pw(t.docker.memTotal)} · ${Nw(t.docker.cores)}`})]}),(0,V.jsxs)(`div`,{className:`machine-working`,children:[(0,V.jsxs)(`span`,{children:[(0,V.jsx)(`strong`,{children:t.working}),` of `]}),(0,V.jsx)(`input`,{type:`number`,min:1,max:100,value:n,"aria-label":`How many sessions may work at once`,title:`How many sessions may work at the same time. Managers don't count.`,onChange:e=>r(e.target.value),onBlur:i,onKeyDown:e=>e.key===`Enter`&&e.target.blur()}),(0,V.jsxs)(`span`,{children:[` working`,t.line.length?` · ${t.line.length} waiting`:``]})]}),t.line.length>0&&(0,V.jsx)(`ol`,{className:`machine-line`,children:t.line.map(t=>{let n=e.sessions.find(e=>e.id===t);return(0,V.jsxs)(`li`,{children:[(0,V.jsx)(`button`,{className:`link`,onClick:()=>e.onOpen(t),children:a(t)}),n&&n.priority!==`normal`&&(0,V.jsx)(`span`,{className:`chip prio-${n.priority}`,children:Iw[n.priority]}),(0,V.jsx)(`button`,{className:`small`,title:`Start this turn now, above the limit`,onClick:()=>void e.run(()=>R.startNow(t)),children:`Start now`})]},t)})})]})}function zw({sessionId:e}){let[t,n]=(0,v.useState)(null);if((0,v.useEffect)(()=>{let t=!0,r=()=>R.turns(e).then(e=>t&&n(e),()=>{});r();let i=setInterval(r,15e3);return()=>{t=!1,clearInterval(i)}},[e]),!t)return null;if(!t.length)return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`Machine use per turn`}),(0,V.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`})]});let r=t.slice(-60);return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`h3`,{children:`CPU per turn`}),(0,V.jsx)(Bw,{values:r.map(e=>({value:e.peakCores,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Nw(e.peakCores)}, average ${Nw(e.avgCores)}`})),format:Nw}),(0,V.jsx)(`h3`,{children:`Memory per turn`}),(0,V.jsx)(Bw,{values:r.map(e=>({value:e.peakMem,label:`${new Date(e.startedAt).toLocaleTimeString()}: peak ${Pw(e.peakMem)}`})),format:Pw}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain calls`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Started`}),(0,V.jsx)(`th`,{className:`num`,children:`Took`}),(0,V.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,V.jsx)(`th`,{children:`Commands`})]})}),(0,V.jsx)(`tbody`,{children:t.slice().reverse().map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:new Date(e.startedAt).toLocaleTimeString()}),(0,V.jsx)(`td`,{className:`num`,children:Fw(e.durationMs)}),(0,V.jsx)(`td`,{className:`num`,children:e.avgCores.toFixed(2)}),(0,V.jsx)(`td`,{className:`num`,children:e.peakCores.toFixed(2)}),(0,V.jsx)(`td`,{className:`num`,children:Pw(e.peakMem)}),(0,V.jsx)(`td`,{className:`mono`,children:e.commands.join(`, `)||(0,V.jsx)(`span`,{className:`muted`,children:`none`})})]},e.startedAt))})]})})]})}function Bw({values:e,format:t}){let n=Math.max(...e.map(e=>e.value),0);return(0,V.jsxs)(`div`,{className:`mini-bars`,role:`img`,"aria-label":`Highest: ${t(n)}`,children:[(0,V.jsx)(`span`,{className:`mini-max muted`,children:t(n)}),e.map((e,t)=>(0,V.jsx)(`div`,{className:`mini-col`,title:e.label,children:(0,V.jsx)(`div`,{className:`mini-bar`,style:{height:`${n>0?Math.max(2,e.value/n*100):0}%`}})},t))]})}function Vw(){let[e,t]=(0,v.useState)(null);return(0,v.useEffect)(()=>{R.typicalCosts(30).then(t,()=>t([]))},[]),(0,V.jsxs)(`section`,{children:[(0,V.jsx)(`h2`,{children:`Typical machine use per turn`}),(0,V.jsx)(`p`,{className:`muted`,children:`Last 30 days, sessions only (not managers): what a turn that ran each kind of command usually used. Ledung learns these; they don't decide anything yet.`}),e?e.length?(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Project`}),(0,V.jsx)(`th`,{children:`Command`}),(0,V.jsx)(`th`,{className:`num`,children:`Turns`}),(0,V.jsx)(`th`,{className:`num`,children:`Avg CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak CPU`}),(0,V.jsx)(`th`,{className:`num`,children:`Peak memory`}),(0,V.jsx)(`th`,{className:`num`,children:`Duration`})]})}),(0,V.jsx)(`tbody`,{children:e.slice(0,50).map(e=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{children:S(e.project)}),(0,V.jsx)(`td`,{className:`mono`,children:e.command||(0,V.jsx)(`span`,{className:`muted`,children:`no commands`})}),(0,V.jsx)(`td`,{className:`num`,children:e.turns}),(0,V.jsx)(`td`,{className:`num`,children:Nw(e.avgCores)}),(0,V.jsx)(`td`,{className:`num`,children:Nw(e.peakCores)}),(0,V.jsx)(`td`,{className:`num`,children:Pw(e.peakMem)}),(0,V.jsx)(`td`,{className:`num`,children:Fw(e.durationMs)})]},`${e.project} ${e.command}`))})]})}):(0,V.jsx)(`p`,{className:`muted`,children:`No turns measured yet.`}):(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})]})}function Hw(e,t){let n=e=>`${Math.round(e/1e3)}k`;return`${n(e)}${t?` of ${n(t)}`:``}`}var Uw={...lt,waiting:`Needs an answer`};function Ww(e){return e.contextTokens&&e.contextWindow?e.contextTokens/e.contextWindow:null}function Gw(e){let t=new Set(e.sessions.map(e=>e.id)),n=e=>e.status!==`ended`,r=e.sessions.filter(r=>(!r.parentId||!t.has(r.parentId))&&(n(r)||e.sessions.some(e=>e.parentId===r.id&&n(e)))),i=(e,t)=>Number(t.role===`manager`)-Number(e.role===`manager`)||t.createdAt-e.createdAt,a=r.sort(i).flatMap(t=>[t,...e.sessions.filter(e=>e.parentId===t.id&&n(e)).sort(i)]),o=e.sessions.filter(e=>e.status===`ended`).length;return(0,V.jsx)(`div`,{className:`overview`,children:(0,V.jsxs)(`div`,{className:`overview-list`,children:[(0,V.jsxs)(`div`,{className:`muted`,children:[e.overview?`${Gy(e.overview.todayTokens)} tokens today`:``,o?` · ${o} ended session${o===1?``:`s`} not shown`:``]}),!a.length&&(0,V.jsx)(`p`,{className:`muted`,children:`No sessions are running.`}),a.map(n=>{let r=e.overview?.sessions[n.id],i=Ww(n),a=!!n.parentId&&t.has(n.parentId);return(0,V.jsxs)(`div`,{role:`button`,tabIndex:0,className:`overview-card${a?` child`:``}`,onClick:()=>e.onOpenSession(n.id),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),e.onOpenSession(n.id))},children:[(0,V.jsxs)(`div`,{className:`overview-top`,children:[(0,V.jsx)(`span`,{className:`dot ${ut(n)}`}),(0,V.jsxs)(`span`,{className:`overview-title`,children:[n.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,n.title]}),e.waitingBySession[n.id]?(0,V.jsx)(`span`,{className:`badge`,children:e.waitingBySession[n.id]}):null]}),(0,V.jsxs)(`div`,{className:`overview-facts`,children:[(0,V.jsxs)(`span`,{children:[Uw[n.status],e.machine&&e.machine.line.includes(n.id)?`: number ${e.machine.line.indexOf(n.id)+1}`:``,n.paused?` · paused`:``]}),n.priority!==`normal`&&(0,V.jsx)(`span`,{className:`chip prio-${n.priority}`,title:n.priorityNote??void 0,children:Iw[n.priority]}),e.machine?.sessions[n.id]&&(0,V.jsxs)(`span`,{title:`CPU and memory of everything this session runs`,children:[Nw(e.machine.sessions[n.id].cores),` · `,Pw(e.machine.sessions[n.id].memBytes)]}),(0,V.jsx)(`span`,{children:S(n.project)}),n.branch&&(0,V.jsx)(`span`,{className:`mono`,children:n.branch}),n.pr&&(0,V.jsx)(`a`,{href:n.pr.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),title:`${n.pr.title} — checks ${n.pr.checks}`,children:Jy(n.pr)}),n.tickets.map(e=>(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,onClick:e=>e.stopPropagation(),children:e.id},e.id)),r&&(0,V.jsxs)(`span`,{title:`Tokens today / in total`,children:[Gy(r.today),` today · `,Gy(r.total),` total · `,Ky(r.costTotal)]}),n.contextTokens!=null&&(0,V.jsxs)(`span`,{className:i!=null&&i>.8?`ctx-high`:``,title:`How full the context window is, and its size in tokens`,children:[`context `,i==null?``:`${qy(i)} · `,Hw(n.contextTokens,n.contextWindow)]}),n.backgroundTasks>0&&(0,V.jsxs)(`span`,{children:[n.backgroundTasks,` in background`]})]}),r?.lastReply&&(0,V.jsxs)(`div`,{className:`overview-last`,children:[(0,V.jsx)(`span`,{className:`muted`,children:r.lastReplyAt?Dg(r.lastReplyAt):``}),` `,r.lastReply.split(`
|
|
104
|
+
`)[0]]})]},n.id)})]})})}function Kw({sessionId:e,onClose:t}){let[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0,n=()=>R.sessionUsage(e).then(e=>t&&r(e),e=>t&&a(e.message));n();let i=setInterval(n,15e3);return()=>{t=!1,clearInterval(i)}},[e]);let o=(0,v.useMemo)(()=>Qy(`model`,n?.models??[]),[n?.models]),s=n?.totals,c=n?n.calls.slice(-120):[];return(0,V.jsxs)(`aside`,{className:`file-panel`,"aria-label":`Usage`,children:[(0,V.jsxs)(`header`,{className:`file-head`,children:[(0,V.jsx)(`span`,{className:`file-path`,children:`Usage of this session`}),(0,V.jsx)(`button`,{className:`small`,onClick:t,children:`Close`})]}),(0,V.jsxs)(`div`,{className:`file-body`,children:[i&&(0,V.jsx)(`p`,{className:`error`,children:i}),!n&&!i&&(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`}),n&&s&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`div`,{className:`tiles`,children:[(0,V.jsx)(nb,{label:`Tokens`,value:Gy(s.tokens),sub:`${s.calls} model calls`}),(0,V.jsx)(nb,{label:`API-equivalent cost`,value:Ky(s.cost)}),(0,V.jsx)(nb,{label:`Cache read share`,value:s.tokens?qy(s.cacheRead/s.tokens):`—`}),(0,V.jsx)(nb,{label:`In subagents`,value:s.tokens?qy(s.subagentTokens/s.tokens):`—`})]}),(0,V.jsx)(`h3`,{children:`Tokens per model call`}),(0,V.jsx)($y,{items:[...n.models.map(e=>({label:e,color:o(e)})),...n.calls.some(e=>e.subagent)?[{label:`subagent call`,color:`var(--s-other)`,textured:!0}]:[]]}),(0,V.jsx)(tb,{height:120,columns:c.map(e=>({label:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`,second:`2-digit`}),short:new Date(e.at).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}),values:{[e.model]:e.tokens},textured:!!e.subagent,note:[e.compaction?`Compaction`:``,e.subagent?`Subagent: ${e.subagent}`:``,`Started by: ${Zy[e.trigger]??e.trigger}`].filter(Boolean).join(` · `)})),series:n.models.map(e=>({key:e,label:e,color:o(e)})),emptyText:`No model calls recorded yet.`}),(0,V.jsx)(zw,{sessionId:e}),(0,V.jsx)(`h3`,{children:`Model calls`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain calls`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Time`}),(0,V.jsx)(`th`,{children:`Model`}),(0,V.jsx)(`th`,{className:`num`,children:`Input`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache write`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache read`}),(0,V.jsx)(`th`,{className:`num`,children:`Output`}),(0,V.jsx)(`th`,{className:`num`,children:`Thinking`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cache %`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,children:`Running`}),(0,V.jsx)(`th`,{children:`Who`})]})}),(0,V.jsx)(`tbody`,{children:(()=>{let e=0;return n.calls.map((t,n)=>(e+=t.cost??0,(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:new Date(t.at).toLocaleTimeString()}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:o(t.model)}}),` `,t.model]}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.input)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.cacheWrite)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.cacheRead)}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.output)}),(0,V.jsx)(`td`,{className:`num muted`,children:t.thinking?`~${Gy(t.thinking)}`:``}),(0,V.jsx)(`td`,{className:`num strong`,children:Gy(t.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:t.tokens?qy(t.cacheRead/t.tokens):``}),(0,V.jsx)(`td`,{className:`num`,children:Ky(t.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:Ky(e)}),(0,V.jsx)(`td`,{className:`muted nowrap`,children:t.subagent?`subagent: ${t.subagent}`:Zy[t.trigger]??t.trigger})]},n)))})()})]})})]})]})]})}var qw=864e5,Jw=qw;function Yw(e,t){return t.fingerprint??`${e.login}/${e.computerId}/${t.label}`}var Xw=e=>e.input+e.cacheWrite+e.cacheRead+e.output;function Zw(e){return e.entries.find(e=>e.own)?.login??null}function Qw(e,t){let n=Zw(e);return e.entries.flatMap(e=>e.state===`ok`&&e.file&&(!t||e.file.login===n)?[e.file]:[])}function $w(e){return e.flatMap(e=>e.accounts.map(t=>({file:e,account:t,key:Yw(e,t)})))}function eT(e,t,n){if(e===`all`)return null;let r;if(e===`week`){let e=$w(t).flatMap(({account:e})=>e.limits.filter(e=>e.kind===`seven_day`&&e.resetsAt&&e.resetsAt>n).map(e=>e.resetsAt-Fy.seven_day));r=e.length?Math.min(...e):n-6*qw}else r=n-(Number(e.replace(`d`,``))-1)*qw;return tT(r)}function tT(e){let t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,`0`)}-${String(t.getDate()).padStart(2,`0`)}`}function nT(e,t,n){let r=e=>!n||n(e.model),i=e.hourly.filter(r),a=i.length?Math.min(...i.map(e=>e.t)):1/0,o=0;for(let e of i)e.t+36e5>t&&(o+=e.cost);let s=tT(t),c=Number.isFinite(a)?tT(a):null;for(let t of e.daily)!r(t)||t.t<s||c&&t.t>=c||(o+=t.cost);return o}function rT(e){let t=/^seven_day_(opus|sonnet|haiku|fable)$/.exec(e)?.[1];return t?e=>e.toLowerCase().includes(t):void 0}var iT=[`five_hour`,`seven_day`,`seven_day_opus`,`seven_day_sonnet`];function aT(e,t){let n=new Map;for(let t of $w(e)){let e=n.get(t.key);e?e.push(t):n.set(t.key,[t])}let r=[];for(let[e,i]of n){let n=[...i].sort((e,t)=>t.file.asOf-e.file.asOf)[0],a=[...new Set(i.flatMap(e=>e.account.limits.map(e=>e.kind)))].filter(e=>e!==`overage`&&e!==`seven_day_overage_included`).sort((e,t)=>(iT.indexOf(e)+1||99)-(iT.indexOf(t)+1||99)||e.localeCompare(t)).map(e=>{let n=i.flatMap(t=>t.account.limits.filter(t=>t.kind===e)).sort((e,t)=>t.seenAt-e.seenAt)[0],r=n?{...n,at:n.seenAt}:null,a=r?Hy(r,t):!1,o=Fy[e]??Fy.seven_day,s=r?.resetsAt&&!a?r.resetsAt-o:t-o,c=i.map(t=>({computer:t.file.computer,computerId:t.file.computerId,login:t.file.login,cost:nT(t.account,s,rT(e))})),l=c.reduce((e,t)=>e+t.cost,0);return{kind:e,reading:r,reset:a,pace:r&&!a&&r.utilization!=null?Iy(e.startsWith(`seven_day`)?`seven_day`:e,r.utilization,r.resetsAt,t):null,shares:c.filter(e=>e.cost>0).map(e=>({...e,share:e.cost/l})).sort((e,t)=>t.cost-e.cost)}});r.push({fingerprint:e,label:n.account.label,rows:a,people:[...new Set(i.map(e=>e.file.login))].sort(),computers:[...new Set(i.map(e=>e.file.computer))].sort()})}return r.sort((e,t)=>e.label.localeCompare(t.label))}function oT(e,t,n){return e===`person`?t.file.login:e===`account`?t.account.label:e===`computer`?t.file.computer:e===`model`?n.model:n.project}function sT(e,t,n,r){let i=new Map,a=new Set;for(let r of $w(e))for(let e of r.account.daily){if(n&&e.t<n)continue;let o=oT(t,r,e);a.add(o);let s=i.get(e.t)??Object.create(null);s[o]=(s[o]??0)+Xw(e),i.set(e.t,s)}let o=n??[...i.keys()].sort()[0],s=tT(r),c=[];if(o)for(let e=new Date(`${o}T12:00:00`);tT(e.getTime())<=s;e.setDate(e.getDate()+1)){let t=tT(e.getTime());c.push({day:t,values:i.get(t)??Object.create(null)})}return{keys:[...a].sort(),columns:c}}function cT(e,t,n){return $w(e).map(({file:e,account:r,key:i})=>{let a=r.daily.filter(e=>!t||e.t>=t);return{login:e.login,account:r.label,fingerprint:i,computer:e.computer,computerId:e.computerId,tokens:a.reduce((e,t)=>e+Xw(t),0),cost:a.reduce((e,t)=>e+t.cost,0),asOf:e.asOf,stale:n-e.asOf>Jw}}).sort((e,t)=>e.login.localeCompare(t.login)||e.account.localeCompare(t.account)||e.computer.localeCompare(t.computer))}var lT=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]],uT=[[`person`,`person`],[`account`,`account`],[`computer`,`computer`],[`model`,`model`],[`project`,`project`]],dT={five_hour:`5-hour`,seven_day:`Weekly`,seven_day_opus:`Weekly Opus`,seven_day_sonnet:`Weekly Sonnet`},fT={allowed:{cls:`good`,icon:`●`,label:`OK`},allowed_warning:{cls:`warning`,icon:`▲`,label:`Close to the limit`},rejected:{cls:`critical`,icon:`■`,label:`Limit reached`}};function pT(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function mT(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=!0,n=()=>R.sharedUsage().then(n=>e&&(t(n),r(null)),t=>e&&r(t.message));n();let i=setInterval(n,6e4);return()=>{e=!1,clearInterval(i)}},[]),n&&!e?(0,V.jsx)(`p`,{className:`error`,children:n}):e?(0,V.jsx)(hT,{view:e,now:Date.now()}):(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})}function hT({view:e,now:t,initialMine:n=!1}){let[r,i]=(0,v.useState)(n),[a,o]=(0,v.useState)(`week`),[s,c]=(0,v.useState)(`person`),l=Zw(e),u=(0,v.useMemo)(()=>Qw(e,r),[e,r]),d=eT(a,u,t),f=(0,v.useMemo)(()=>aT(u,t),[u,t]),p=(0,v.useMemo)(()=>sT(u,s,d,t),[u,s,d,t]),m=(0,v.useMemo)(()=>cT(u,d,t),[u,d,t]),h=Qy(`project`,[...new Set(Qw(e,!1).map(e=>e.computerId))]),g=Qy(s===`model`?`model`:`project`,p.keys);if(!e.repo)return(0,V.jsx)(`p`,{className:`muted`,children:`Nothing is published here yet. Switch on Publish usage in Settings to share this computer's usage and read everyone else's.`});let _=p.keys.map(e=>({key:e,label:e,color:g(e)})),y=p.columns.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`}),values:e.values}));return(0,V.jsxs)(`div`,{className:`shared-usage`,children:[(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`label`,{children:[`Period `,(0,V.jsx)(`select`,{value:a,onChange:e=>o(e.target.value),children:lT.map(([e,t])=>(0,V.jsx)(`option`,{value:e,children:t},e))})]}),(0,V.jsxs)(`label`,{className:`shared-mine`,title:l?`Only ${l}'s own computers`:`Mine needs this computer to publish its usage too`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:r,disabled:!l,onChange:e=>i(e.target.checked)}),` Mine`]})]}),e.error&&(0,V.jsxs)(`p`,{className:`error`,children:[`Could not read the shared usage just now: `,e.error,e.entries.length?` Showing the last files read.`:``]}),e.entries.filter(e=>e.state!==`ok`&&(!r||e.login===l)).map(e=>(0,V.jsxs)(`p`,{className:`shared-note warning`,children:[e.computer??`A computer`,e.login?` (${e.login})`:``,e.state===`newer`?` publishes usage in a newer format: update Ledung to see it.`:` published a usage file Ledung cannot read${e.reason?` (${e.reason})`:``}.`]},e.id)),!u.length&&(0,V.jsx)(`p`,{className:`muted`,children:r?`None of your computers has published yet.`:`No computer has published yet.`}),f.length>0&&(0,V.jsx)(`div`,{className:`shared-cards`,children:f.map(e=>(0,V.jsx)(gT,{card:e,now:t,color:h},e.fingerprint))}),u.length>0&&(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsxs)(`div`,{className:`viz-card-head`,children:[(0,V.jsx)(`h3`,{children:`Daily tokens`}),(0,V.jsxs)(`div`,{className:`seg-control shared-stack`,role:`group`,"aria-label":`Stack by`,children:[(0,V.jsx)(`span`,{className:`muted`,children:`by`}),uT.map(([e,t])=>(0,V.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:t},e))]})]}),(0,V.jsx)($y,{items:_}),(0,V.jsx)(tb,{columns:y,series:_})]}),m.length>0&&(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Who's who`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Person`}),(0,V.jsx)(`th`,{children:`Account`}),(0,V.jsx)(`th`,{children:`Computer`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{children:`Last published`})]})}),(0,V.jsx)(`tbody`,{children:m.map((e,n)=>{let r=m[n-1],i=r?.login===e.login;return(0,V.jsxs)(`tr`,{className:e.stale?`shared-stale`:``,children:[(0,V.jsx)(`td`,{children:i?``:e.login}),(0,V.jsx)(`td`,{children:i&&r?.fingerprint===e.fingerprint?``:e.account}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:h(e.computerId)}}),` `,e.computer]}),(0,V.jsx)(`td`,{className:`num`,children:Gy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Ky(e.cost)}),(0,V.jsxs)(`td`,{className:`nowrap`,children:[Uy({at:e.asOf,resetsAt:null},t).replace(/^as of /,``),e.stale&&(0,V.jsx)(`span`,{className:`shared-stale-mark`,title:`No publish for over a day`,children:` · stale`})]})]},`${e.computerId}-${e.fingerprint}`)})})]})})]})]})}function gT({card:e,now:t,color:n}){return(0,V.jsxs)(`section`,{className:`card viz-card shared-card`,children:[(0,V.jsx)(`h3`,{children:e.label}),(0,V.jsxs)(`div`,{className:`muted shared-card-who`,children:[e.people.join(`, `),` · `,e.computers.length,` computer`,e.computers.length===1?``:`s`]}),!e.rows.some(e=>e.reading)&&(0,V.jsx)(`div`,{className:`muted`,children:`no data yet`}),e.rows.map(e=>{let r=pT(dT,e.kind)??e.kind;if(!e.reading)return null;if(e.reset)return(0,V.jsxs)(`div`,{className:`shared-limit limit-reset`,title:`${r}: the window has reset since the last reading (${Uy(e.reading,t)}).`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:r}),(0,V.jsx)(`span`,{className:`limit-status`,children:`reset`})]}),(0,V.jsx)(`div`,{className:`limit-sub muted`,children:(0,V.jsx)(`span`,{children:`no reading since the reset`})})]},e.kind);let i=e.reading.utilization,a=Wy(e.reading,t),o=Math.min(100,(i??0)*100),s=pT(fT,e.reading.status)??{cls:`good`,icon:`●`,label:e.reading.status},c=e.shares.map(e=>`${e.computer} (${e.login}): ${qy(e.share)}, ${Ky(e.cost)}`).join(`
|
|
105
|
+
`);return(0,V.jsxs)(`div`,{className:`shared-limit`,children:[(0,V.jsxs)(`div`,{className:`limit-head`,children:[(0,V.jsx)(`span`,{children:r}),(0,V.jsxs)(`span`,{className:`limit-status ${s.cls}`,title:s.label,children:[s.icon,` `,i==null?s.label:qy(i)]})]}),(0,V.jsx)(`div`,{className:`limit-track shared-track`,title:c||`No use recorded in this window`,children:(0,V.jsx)(`div`,{className:`shared-fill`,style:{width:`${o}%`},children:e.shares.length?e.shares.map(e=>(0,V.jsx)(`div`,{className:`shared-seg`,style:{flexGrow:e.share,background:n(e.computerId)}},e.computerId)):(0,V.jsx)(`div`,{className:`shared-seg limit-fill ${s.cls}`,style:{flexGrow:1}})})}),(0,V.jsxs)(`div`,{className:`limit-sub muted`,children:[(0,V.jsx)(`span`,{children:e.shares.map(e=>`${e.computer} ${qy(e.share)}`).join(` · `)}),(0,V.jsxs)(`span`,{className:`limit-forecast${e.pace!=null&&e.pace>=1?` over`:``}`,children:[`≈ `,e.pace==null?`—`:qy(e.pace),` by reset`]})]}),a&&(0,V.jsx)(`div`,{className:`limit-sub limit-age`,children:a})]},e.kind)})]})}function _T(){return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(mT,{})})}var vT=[[`week`,`Since weekly reset`],[`7d`,`7 days`],[`30d`,`30 days`],[`90d`,`90 days`],[`all`,`All time`]];function yT(e){return new Date(`${e}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`})}var bT=[[`computer`,`This computer`],[`shared`,`Shared`],[`sessions`,`Sessions`]];function xT(e){let[t,n]=(0,v.useState)(`computer`),r=e.sessionsOpen?`sessions`:t,i=t=>{t===`sessions`?e.sessionsOpen||e.onSessions(!0):(n(t),e.sessionsOpen&&e.onSessions(!1))};return(0,V.jsxs)(`div`,{className:`usage`,children:[(0,V.jsx)(`header`,{className:`session-head`,children:(0,V.jsx)(`div`,{className:`session-head-text`,children:(0,V.jsx)(`h2`,{children:`Usage`})})}),(0,V.jsx)(`div`,{className:`pane-tabs`,role:`tablist`,"aria-label":`Usage`,children:bT.map(([e,t])=>(0,V.jsx)(`button`,{role:`tab`,"aria-selected":r===e,className:r===e?`on`:``,onClick:()=>i(e),children:t},e))}),r===`computer`?(0,V.jsx)(ST,{onOpenSession:e.onOpenSession}):r===`shared`?(0,V.jsx)(_T,{}):(0,V.jsx)(Gw,{sessions:e.sessions,overview:e.overview,machine:e.machine,waitingBySession:e.waitingBySession,onOpenSession:e.onOpenSession})]})}function ST({onOpenSession:e}){let[t,n]=(0,v.useState)({period:`week`}),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(`model`),[l,u]=(0,v.useState)({});(0,v.useEffect)(()=>{let e=!0;R.usage(t).then(t=>e&&i(t),t=>e&&o(t.message));let n=setInterval(()=>R.usage(t).then(t=>e&&i(t),()=>{}),3e4);return()=>{e=!1,clearInterval(n)}},[t]);let d=(0,v.useMemo)(()=>({model:Qy(`model`,r?.options.models??[]),project:Qy(`project`,r?.options.projects??[]),trigger:Qy(`trigger`,Xy)}),[r?.options.models,r?.options.projects]);if(a)return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(`p`,{className:`error`,children:a})});if(!r)return(0,V.jsx)(`div`,{className:`usage-body`,children:(0,V.jsx)(`p`,{className:`muted`,children:`Loading…`})});let f=e=>n(t=>({...t,...e})),p=r.totals,m=(s===`model`?r.models:s===`project`?[...new Set(r.daily.flatMap(e=>Object.keys(e.byProject)))].sort():Xy.filter(e=>r.daily.some(t=>t.byTrigger[e]))).map(e=>({key:e,label:s===`trigger`?Zy[e]??e:e,color:d[s](e)})),h=r.daily.map(e=>({label:new Date(`${e.day}T12:00:00`).toLocaleDateString([],{weekday:`short`,day:`numeric`,month:`short`}),short:yT(e.day),values:s===`model`?e.byModel:s===`project`?e.byProject:e.byTrigger})),g=t.project||t.model||t.branch||t.role||t.trigger||t.account;return(0,V.jsxs)(`div`,{className:`usage-body`,children:[(0,V.jsxs)(`div`,{className:`muted`,children:[`Since `,new Date(r.since||Date.now()).toLocaleString([],{dateStyle:`medium`,timeStyle:`short`}),r.since===0?` (all time)`:``]}),(0,V.jsxs)(`div`,{className:`filters`,children:[(0,V.jsxs)(`label`,{children:[`Period `,(0,V.jsx)(`select`,{value:t.period,onChange:e=>f({period:e.target.value}),children:vT.map(([e,t])=>(0,V.jsx)(`option`,{value:e,children:t},e))})]}),(0,V.jsxs)(`label`,{children:[`Project `,(0,V.jsxs)(`select`,{value:t.project??``,onChange:e=>f({project:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.projects.map(e=>(0,V.jsx)(`option`,{value:e,children:S(e)},e))]})]}),(r.options.accounts?.length??0)>1&&(0,V.jsxs)(`label`,{children:[`Account `,(0,V.jsxs)(`select`,{value:t.account??``,onChange:e=>f({account:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.accounts.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Model `,(0,V.jsxs)(`select`,{value:t.model??``,onChange:e=>f({model:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.models.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Branch `,(0,V.jsxs)(`select`,{value:t.branch??``,onChange:e=>f({branch:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),r.options.branches.map(e=>(0,V.jsx)(`option`,{children:e},e))]})]}),(0,V.jsxs)(`label`,{children:[`Role `,(0,V.jsxs)(`select`,{value:t.role??``,onChange:e=>f({role:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),(0,V.jsx)(`option`,{value:`manager`,children:`Managers`}),(0,V.jsx)(`option`,{value:`session`,children:`Sessions`})]})]}),(0,V.jsxs)(`label`,{children:[`Started by `,(0,V.jsxs)(`select`,{value:t.trigger??``,onChange:e=>f({trigger:e.target.value||void 0}),children:[(0,V.jsx)(`option`,{value:``,children:`All`}),Xy.map(e=>(0,V.jsx)(`option`,{value:e,children:Zy[e]},e))]})]}),g&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>n({period:t.period}),children:`Clear filters`})]}),(0,V.jsxs)(`div`,{className:`tiles`,children:[(0,V.jsx)(nb,{label:`Tokens`,value:Gy(p.tokens),sub:`${Gy(p.output)} output`}),(0,V.jsx)(nb,{label:`API-equivalent cost`,value:Ky(p.cost),sub:`not what a plan charges`}),(0,V.jsx)(nb,{label:`Model calls`,value:p.calls.toLocaleString(),sub:`${p.sessions} session${p.sessions===1?``:`s`}`}),(0,V.jsx)(nb,{label:`Cache read share`,value:p.tokens?qy(p.cacheRead/p.tokens):`—`,sub:`higher is cheaper`}),(0,V.jsx)(nb,{label:`In subagents`,value:p.tokens?qy(p.subagentTokens/p.tokens):`—`})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsxs)(`div`,{className:`viz-card-head`,children:[(0,V.jsx)(`h3`,{children:`Daily tokens`}),(0,V.jsx)(`div`,{className:`seg-control`,role:`group`,"aria-label":`Split by`,children:[`model`,`project`,`trigger`].map(e=>(0,V.jsx)(`button`,{className:s===e?`on`:``,onClick:()=>c(e),children:e===`trigger`?`started by`:`by ${e}`},e))})]}),(0,V.jsx)($y,{items:m}),(0,V.jsx)(tb,{columns:h,series:m})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Project × model`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`matrix`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Project`}),r.models.map(e=>(0,V.jsxs)(`th`,{className:`num`,children:[(0,V.jsx)(`span`,{className:`viz-swatch`,style:{background:d.model(e)}}),` `,e]},e)),(0,V.jsx)(`th`,{className:`num`,children:`Total`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,title:`Share of tokens used by subagents`,children:`Sub`})]})}),(0,V.jsx)(`tbody`,{children:r.matrix.map(e=>(0,V.jsxs)(v.Fragment,{children:[(0,V.jsxs)(`tr`,{className:`matrix-row`,children:[(0,V.jsxs)(`td`,{children:[e.roles.length>1&&(0,V.jsx)(`button`,{className:`caret`,"aria-label":`Show roles`,onClick:()=>u(t=>({...t,[e.project]:!t[e.project]})),children:l[e.project]?`▾`:`▸`}),(0,V.jsx)(`button`,{className:`link`,onClick:()=>f({project:e.project}),children:S(e.project)})]}),r.models.map(t=>(0,V.jsx)(`td`,{className:`num`,children:e.byModel[t]?Gy(e.byModel[t]):``},t)),(0,V.jsx)(`td`,{className:`num strong`,children:Gy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Ky(e.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:e.subagentShare?qy(e.subagentShare):``})]}),l[e.project]&&e.roles.map(e=>(0,V.jsxs)(`tr`,{className:`matrix-sub`,children:[(0,V.jsxs)(`td`,{children:[`↳ `,e.role===`manager`?`managers`:`sessions`]}),r.models.map(t=>(0,V.jsx)(`td`,{className:`num`,children:e.byModel[t]?Gy(e.byModel[t]):``},t)),(0,V.jsx)(`td`,{className:`num`,children:Gy(e.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Ky(e.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:e.subagentShare?qy(e.subagentShare):``})]},e.role))]},e.project))})]})})]}),(0,V.jsxs)(`section`,{className:`card viz-card`,children:[(0,V.jsx)(`h3`,{children:`Recent sessions`}),(0,V.jsx)(`div`,{className:`table-scroll`,children:(0,V.jsxs)(`table`,{className:`plain`,children:[(0,V.jsx)(`thead`,{children:(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`th`,{children:`Last call`}),(0,V.jsx)(`th`,{children:`Session`}),(0,V.jsx)(`th`,{children:`Project`}),(0,V.jsx)(`th`,{children:`Branch`}),(0,V.jsx)(`th`,{children:`Models`}),(0,V.jsx)(`th`,{className:`num`,children:`Calls`}),(0,V.jsx)(`th`,{className:`num`,children:`Tokens`}),(0,V.jsx)(`th`,{className:`num`,children:`Cost`}),(0,V.jsx)(`th`,{className:`num`,children:`Sub`})]})}),(0,V.jsx)(`tbody`,{children:r.recent.map(t=>(0,V.jsxs)(`tr`,{children:[(0,V.jsx)(`td`,{className:`nowrap`,children:Dg(t.lastAt)}),(0,V.jsx)(`td`,{children:(0,V.jsxs)(`button`,{className:`link`,onClick:()=>e(t.sessionId),children:[t.role===`manager`?`Manager · `:``,t.title]})}),(0,V.jsx)(`td`,{children:S(t.project)}),(0,V.jsx)(`td`,{className:`muted`,children:t.branch??``}),(0,V.jsx)(`td`,{className:`muted`,children:t.models.join(`, `)}),(0,V.jsx)(`td`,{className:`num`,children:t.calls}),(0,V.jsx)(`td`,{className:`num`,children:Gy(t.tokens)}),(0,V.jsx)(`td`,{className:`num`,children:Ky(t.cost)}),(0,V.jsx)(`td`,{className:`num muted`,children:t.subagentShare?qy(t.subagentShare):``})]},t.sessionId))})]})})]}),(0,V.jsx)(Vw,{})]})}function CT(e){try{return cm(localStorage.getItem(`ledung.sidebar.${e}`))}catch{return null}}function wT(e,t){try{t==null?localStorage.removeItem(`ledung.sidebar.${e}`):localStorage.setItem(`ledung.sidebar.${e}`,String(t))}catch{}}function TT(){let[e,t]=(0,v.useState)(()=>window.matchMedia(am).matches),[n,r]=(0,v.useState)({w:window.innerWidth,h:window.innerHeight}),[i,a]=(0,v.useState)(()=>({width:CT(`width`),height:CT(`height`)})),o=e?`height`:`width`;(0,v.useEffect)(()=>{let e=window.matchMedia(am),n=()=>{t(e.matches),r({w:window.innerWidth,h:window.innerHeight})};return e.addEventListener(`change`,n),window.addEventListener(`resize`,n),()=>{e.removeEventListener(`change`,n),window.removeEventListener(`resize`,n)}},[]);let{min:s,max:c,def:l}=om(o,e?n.h:n.w),u=sm(i[o]??l,s,c);(0,v.useEffect)(()=>{document.querySelector(`.app`)?.style.setProperty(e?`--sidebar-h`:`--sidebar-w`,`${u}px`)},[u,e]);let d=e=>{wT(o,e),a(t=>({...t,[o]:e}))};return(0,V.jsx)(`div`,{className:`sidebar-resizer ${e?`horizontal`:`vertical`}`,role:`separator`,"aria-label":`Resize the sidebar`,"aria-orientation":e?`horizontal`:`vertical`,"aria-valuenow":u,"aria-valuemin":s,"aria-valuemax":c,tabIndex:0,title:`Drag to resize, double-click to reset`,onPointerDown:e=>{e.button===0&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault())},onPointerMove:t=>{if(!t.currentTarget.hasPointerCapture(t.pointerId))return;let n=t.currentTarget.parentElement.getBoundingClientRect();d(sm(e?t.clientY-n.top:t.clientX-n.left,s,c))},onDoubleClick:()=>d(null),onKeyDown:e=>{let t=lm(e.key,o,u,s,c);t!=null&&(e.preventDefault(),d(t))}})}var ET=`ledung.composer.height`,DT=.75;function OT(e,t,n,r,i,a){return Math.ceil(Math.max(e,t*n+r+i,a))}function kT(e,t,n){return{min:e,max:Math.max(e,Math.floor(t*DT-n))}}function AT(e,t,n,r,i){return sm(e+(t-n),r,i)}function jT(e,t,n,r){return e===`ArrowUp`?sm(t+20,n,r):e===`ArrowDown`?sm(t-20,n,r):e===`Home`?n:e===`End`?r:null}function MT(e){try{return cm(e.getItem(ET))}catch{return null}}function NT(e,t){try{t==null?e.removeItem(ET):e.setItem(ET,String(t))}catch{}}function PT(){try{return localStorage}catch{return null}}function FT(){let e=(0,v.useRef)(null),t=(0,v.useRef)(null),[n,r]=(0,v.useState)(()=>{let e=PT();return e?MT(e):null}),[i,a]=(0,v.useState)(null),o=(0,v.useCallback)(()=>{let n=e.current,r=t.current,i=n?.parentElement;if(!n||!r||!i)return null;let a=getComputedStyle(n),o=parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)+parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),s=getComputedStyle(r),c=parseFloat(s.lineHeight)||parseFloat(s.fontSize)*1.2,l=n.querySelector(`.composer-buttons`)?.offsetHeight??0;return kT(OT(parseFloat(s.minHeight)||0,c,r.rows,parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),parseFloat(s.borderTopWidth)+parseFloat(s.borderBottomWidth),l),i.clientHeight,o)},[]);(0,v.useLayoutEffect)(()=>{let t=e.current?.parentElement;if(!t)return;let n=()=>a(o());n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[o]);let s=n==null?null:i?sm(n,i.min,i.max):n,c=e=>{let t=PT();t&&NT(t,e),r(e)},l=(0,v.useRef)(null),u=e=>{e.button===0&&t.current&&(e.currentTarget.setPointerCapture(e.pointerId),e.preventDefault(),l.current={y:e.clientY,h:t.current.offsetHeight},a(o()))},d=e=>{let t=l.current;t&&i&&e.currentTarget.hasPointerCapture(e.pointerId)&&c(AT(t.h,t.y,e.clientY,i.min,i.max))},f=()=>{l.current=null},p=(0,V.jsx)(`div`,{className:`composer-grip`,role:`separator`,"aria-label":`Resize the message box`,"aria-orientation":`horizontal`,"aria-valuenow":s??void 0,"aria-valuemin":i?.min,"aria-valuemax":i?.max,tabIndex:0,title:`Drag up to make the message box taller, double-click to reset`,onPointerDown:u,onPointerMove:d,onPointerUp:f,onPointerCancel:f,onDoubleClick:()=>c(null),onKeyDown:e=>{let n=o();if(!n||!t.current)return;let r=jT(e.key,t.current.offsetHeight,n.min,n.max);r!=null&&(e.preventDefault(),c(r))}});return{box:e,area:t,style:s==null?void 0:{height:s},grip:p}}function IT(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.id));return r.length?[...e,...r].sort((e,t)=>e.id-t.id):e}async function LT(e,t){let n=[];for(let r=e;;){let e=await t(r);n.push(...e);let i=e.at(-1)?.id??r;if(e.length<500||i<=r)return n;r=i}}function RT(e){let[t,n]=(0,v.useState)(`connecting`),[r,i]=(0,v.useState)(!1),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)({}),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(0),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(`you`),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)({}),[O,k]=(0,v.useState)([]),[ee,A]=(0,v.useState)([]),[j,M]=(0,v.useState)([]),[te,N]=(0,v.useState)([]),[P,ne]=(0,v.useState)(null),[re,ie]=(0,v.useState)([]),[ae,oe]=(0,v.useState)([]),[se,ce]=(0,v.useState)(null),[le,ue]=(0,v.useState)(null),[de,fe]=(0,v.useState)(null),[pe,me]=(0,v.useState)([]),[he,F]=(0,v.useState)({chats:null,newProjects:null}),[I,ge]=(0,v.useState)([`full`]),[_e,ve]=(0,v.useState)(null),[ye,be]=(0,v.useState)(`Git Bash`),[xe,Se]=(0,v.useState)(null),[Ce,we]=(0,v.useState)(null),[Te,De]=(0,v.useState)([]),[Oe,ke]=(0,v.useState)(null),[Me,Ne]=(0,v.useState)(null),[Pe,L]=(0,v.useState)([]),[Fe,Ie]=(0,v.useState)([]),[Le,Re]=(0,v.useState)([]),[ze,Be]=(0,v.useState)(!1),[Ve,He]=(0,v.useState)(null),Ue=(0,v.useRef)(null),We=(0,v.useRef)(e);We.current=e;let Ge=(0,v.useRef)({sessionId:null,messages:[]});Ge.current.messages=d;let Ke=(0,v.useCallback)(async e=>{let t=await R.messages(e);We.current===e&&(Ge.current={sessionId:e,messages:t},f(t),m(t.length>=500))},[]),qe=(0,v.useCallback)(async e=>{let t=Ge.current,n=t.messages.at(-1);if(t.sessionId!==e||!n)return Ke(e);let r=await LT(n.id,t=>R.messagesAfter(e,t));We.current===e&&f(e=>IT(e,r))},[Ke]),Je=(0,v.useCallback)(async()=>{let e=We.current,t=d[0];if(!e||!t)return;let n=await R.messages(e,t.id);We.current===e&&(f(e=>[...n,...e]),m(n.length>=500))},[d]);return(0,v.useEffect)(()=>{Ge.current={sessionId:null,messages:[]},f([]),m(!1),e&&Ke(e).catch(()=>{})},[e,Ke]),(0,v.useEffect)(()=>{let e=null,t=500,r=!1,a,s=()=>{n(`connecting`),e=je(`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws`),e.onopen=()=>{t=500,n(`open`)},e.onclose=()=>{n(`closed`),r||(a=setTimeout(s,t=Math.min(t*2,1e4)))},e.onmessage=e=>{let t=JSON.parse(e.data);switch(t.type){case`hello`:Ue.current===null?Ue.current=t.build:Ue.current!==t.build&&x(!0),Ee(t.pageKey??null),y(e=>e+1),i(!0),g(t.canRestart),C(t.userName),T(t.source??null),D(Object.fromEntries(t.questions.map(e=>[e.id,e]))),k(t.limits),A(t.usageStops??[]),M(t.macros??[]),fe(t.away??null),o(t.sessions),c(t.projects),we(t.board??null),De(t.github??[]),ge(t.profiles??[`full`]),ve(t.lockdownB??null),be(t.bangShell??`Git Bash`),ke(t.remote??null),Ne(t.chats??null),L(t.computers??[]),Ie(t.newComputers??[]),Re(t.linkPairings??[]),Be(t.throughPublicName??!1),He(t.config??null),u(Object.fromEntries(t.permissions.map(e=>[e.id,e]))),We.current&&qe(We.current).catch(()=>{}),R.machine().then(ue,()=>{}),R.accounts().then(e=>{me(e.accounts),Se(e.defaultIdentity),F(e.choices),N(e.signedOut??[]),ne(e.claudeProblem??null),ie(e.claudeLooked??[]),oe(e.configFileProblems??[])},()=>{});break;case`session`:o(e=>e.findIndex(e=>e.id===t.session.id)===-1?[t.session,...e]:e.map(e=>e.id===t.session.id?t.session:e));break;case`limits`:k(t.limits);break;case`macros`:M(t.macros);break;case`usageStops`:A(t.usageStops);break;case`config`:He(t.config);break;case`projects`:c(t.projects);break;case`accounts`:me(t.accounts),Se(t.defaultIdentity),F(t.choices),N(t.signedOut??[]),ne(t.claudeProblem??null),ie(t.claudeLooked??[]),oe(t.configFileProblems??[]);break;case`board`:we(t.board);break;case`github`:De(t.github);break;case`remote`:ke(t.remote);break;case`newComputers`:Ie(t.computers);break;case`linkPairings`:Re(t.pairings);break;case`chats`:Ne(t.chats);break;case`computers`:L(t.computers);break;case`machine`:ue(t.machine);break;case`away`:fe(t.away);break;case`question`:D(e=>({...e,[t.question.id]:t.question}));break;case`permission`:u(e=>({...e,[t.permission.id]:t.permission}));break;case`message`:t.message.sessionId===We.current&&f(e=>e.some(e=>e.id===t.message.id)?e:[...e,t.message])}}};return s(),Ae(()=>{r||(clearTimeout(a),e&&(e.onopen=e.onclose=e.onmessage=null,e.close()),t=500,s())}),()=>{r=!0,Ae(null),clearTimeout(a),e?.close()}},[qe]),(0,v.useEffect)(()=>{let e=!0,t=()=>R.overview().then(t=>e&&ce(t),()=>{});t();let n=setInterval(t,2e4);return()=>{e=!1,clearInterval(n)}},[]),{connection:t,loaded:r,canRestart:h,hellos:_,updated:b,userName:S,source:w,questions:E,limits:O,usageStops:ee,macros:j,signedOut:te,claudeProblem:P,claudeLooked:re,accountProblems:ae,overview:se,machine:le,away:de,accounts:pe,accountChoices:he,defaultIdentity:xe,board:Ce,github:Te,remote:Oe,computers:Pe,newComputers:Fe,linkPairings:Le,throughPublicName:ze,configStatus:Ve,chats:Me,profiles:I,lockdownB:_e,bangShell:ye,sessions:a,projects:s,permissions:l,messages:d,hasEarlier:p,loadEarlier:Je}}var zT=(e,t=140)=>{let n=e.split(`
|
|
106
|
+
`).map(e=>e.trim()).find(Boolean)??``;return n.length>t?`${n.slice(0,t-1)}…`:n},BT=e=>typeof e==`string`?e:``;function VT(e){let t=e.input.questions;return zT(BT(Array.isArray(t)?t[0]?.question:void 0)||e.title||BT(e.input.command)||BT(e.input.file_path)||e.reason||``)}function HT(e,t,n){return[...e.filter(ry).map(e=>({id:`q${e.id}`,sessionId:e.sessionId,title:`Question from ${n(e.sessionId)}`,body:zT(e.question)})),...t.filter(iy).map(e=>{let t=VT(e);return{id:`p${e.id}`,sessionId:e.sessionId,title:e.toolName===`AskUserQuestion`?`Question from ${n(e.sessionId)}`:`Permission: ${e.toolName} in ${n(e.sessionId)}`,body:e.sensitive?`Sensitive${t?`: ${t}`:``}`:t}})]}var UT={five_hour:`5-hour`,seven_day:`weekly`};function WT(e){return e.filter(e=>e.holding).map(e=>({id:`stop:${e.account}:${e.kind}:${e.resetsAt??``}`,sessionId:`settings`,title:`Usage stop reached: ${UT[e.kind]??e.kind} ${e.percent}%`,body:`New turns${e.account==="default"?``:` on account ${e.account}`} are held until you lift it in Settings${e.resetsAt?` or the window resets`:``}.`}))}function GT(e,t){let n=new Set(t.map(e=>e.id));return e?{show:t.filter(t=>!e.has(t.id)),close:[...e].filter(e=>!n.has(e)),open:n}:{show:[],close:[],open:n}}var KT=()=>window.isSecureContext&&`Notification`in window,qT=`ledung.notify`,JT=()=>{try{return localStorage.getItem(qT)===`1`}catch{return!1}};function YT(e){let t=KT(),[n,r]=(0,v.useState)(JT),[i,a]=(0,v.useState)(t?Notification.permission:`default`),o=t&&n&&i===`granted`,s=(0,v.useRef)(null),c=(0,v.useRef)(new Map),l=(0,v.useRef)(e.onOpenSession);return l.current=e.onOpenSession,(0,v.useEffect)(()=>{if(!e.loaded)return;let t=GT(s.current,[...HT(e.questions,e.permissions,t=>e.sessions.find(e=>e.id===t)?.title??`a session`),...WT(e.usageStops)]);s.current=t.open;for(let e of t.close)c.current.get(e)?.close(),c.current.delete(e);if(!(!o||!document.hidden&&document.hasFocus()))for(let e of t.show)try{let t=new Notification(e.title,{body:e.body,tag:e.id});t.onclick=()=>{window.focus(),l.current(e.sessionId),t.close()},t.onclose=()=>{c.current.get(e.id)===t&&c.current.delete(e.id)},c.current.set(e.id,t)}catch{}},[e.loaded,e.questions,e.permissions,e.sessions,e.usageStops,o]),{possible:t,on:o,denied:t&&i===`denied`,set:async e=>{if(!e){r(!1);try{localStorage.setItem(qT,`0`)}catch{}return}let t=Notification.permission===`granted`?`granted`:await Notification.requestPermission();a(t);let n=t===`granted`;r(n);try{localStorage.setItem(qT,n?`1`:`0`)}catch{}}}}function XT(e,t){return e.key!==`Enter`||e.isComposing?!1:t?e.ctrlKey||e.metaKey:!e.shiftKey}var ZT=80;function QT(e,t,n){if(Math.abs(n-1)>.01)return 0;let r=Math.round(e-t);return r>=ZT?r:0}var $T=new Set([`button`,`checkbox`,`color`,`file`,`hidden`,`image`,`radio`,`range`,`reset`,`submit`]);function eE(e){if(!e)return!1;if(e.isContentEditable)return!0;let t=e.tagName.toUpperCase();return e.readOnly||e.disabled?!1:t===`TEXTAREA`||t===`INPUT`&&!$T.has((e.type??`text`).toLowerCase())}var tE=400;function nE(e){let t=e.visualViewport;if(!t)return;let n=e.document,r=n.documentElement,i=0,a=()=>{let a=eE(n.activeElement)?QT(r.clientHeight,t.height,t.scale):0;a!==i&&(i=a,a?r.style.setProperty(`--kb`,`${a}px`):r.style.removeProperty(`--kb`)),a&&(e.scrollY>0||t.offsetTop>0)&&e.scrollTo(0,0)},o=()=>{e.setTimeout(a,0),e.setTimeout(a,tE)};t.addEventListener(`resize`,a),t.addEventListener(`scroll`,a),n.addEventListener(`focusin`,o),n.addEventListener(`focusout`,o),n.addEventListener(`visibilitychange`,o);for(let t of[`resize`,`orientationchange`,`focus`,`pageshow`])e.addEventListener(t,o);a()}var rE=(0,V.jsxs)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.6`,"aria-hidden":`true`,children:[(0,V.jsx)(`circle`,{cx:`8`,cy:`8`,r:`6.5`}),(0,V.jsx)(`path`,{d:`M1.5 8h13M8 1.5c2 2 2.6 4 2.6 6.5S10 12.5 8 14.5M8 1.5C6 3.5 5.4 5.5 5.4 8S6 12.5 8 14.5`})]});function iE(e){return(0,V.jsxs)(V.Fragment,{children:[rE,`Remote`,e&&(0,V.jsxs)(`span`,{className:`long`,children:[`\xA0`,`· `,e]})]})}function aE({frame:e,shown:t=null,onShow:n,waiting:r=0}){let{tabs:i,remote:a,here:o}=e;return i?(0,V.jsxs)(`nav`,{className:`ctabs`,"aria-label":`Computers`,children:[i.map(e=>{let i=Wt(e,t,r),a=i?(0,V.jsx)(`span`,{className:`badge`,title:`${i} waiting for you on ${e.name}`,"aria-label":`${i} waiting for you`,children:i}):null,o=(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(`span`,{className:`sw`,"aria-hidden":`true`}),(0,V.jsx)(`span`,{className:`nm`,children:e.name}),a]}),s=e.here?t===null:t===e.id;return e.here?s||!n?(0,V.jsx)(`span`,{className:`ctab on`,style:Vt(e),"aria-current":`page`,children:o},e.id):(0,V.jsx)(`button`,{type:`button`,className:`ctab`,style:Vt(e),onClick:()=>n(null),children:o},e.id):e.url?(0,V.jsx)(`a`,{className:`ctab${s?` on`:``}`,style:Vt(e),href:e.url,target:`_blank`,rel:`noopener noreferrer`,title:`${e.name}'s Ledung, ${new URL(e.url).host}`,"aria-current":s?`page`:void 0,onClick:t=>{n&&Ut(t)&&(t.preventDefault(),n(e.id))},children:o},e.id):null}),(0,V.jsx)(`span`,{className:`spacer`}),a&&(0,V.jsx)(`span`,{className:`remote-tag`,role:`status`,children:iE(o?.name)})]}):a?(0,V.jsx)(`div`,{className:`remote-band`,role:`status`,children:iE(o?.name)}):null}function oE({computers:e,opened:t,shown:n,throughPublicName:r=!1,framed:i=!1}){let[a,o]=(0,v.useState)({}),[s,c]=(0,v.useState)({}),l=(0,v.useRef)({}),u=(0,v.useRef)({}),d=e.filter(e=>!e.here&&e.url&&t.includes(e.id));(0,v.useEffect)(()=>{let e=e=>{for(let t of d)nn({data:e.data,origin:e.origin,fromFrame:e.source===l.current[t.id]?.contentWindow},{id:t.id,url:t.url},localStorage,t=>e.source.postMessage(t,e.origin))&&(clearTimeout(u.current[t.id]),c(e=>({...e,[t.id]:`paired`})))};return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)}),(0,v.useEffect)(()=>()=>Object.values(u.current).forEach(clearTimeout),[]);let f=e=>{clearTimeout(u.current[e.id]),c(t=>({...t,[e.id]:`unknown`})),l.current[e.id]?.contentWindow?.postMessage(It(),new URL(e.url).origin),u.current[e.id]=setTimeout(()=>c(t=>({...t,[e.id]:`not-paired`})),Mt)};return d.length?(0,V.jsx)(V.Fragment,{children:d.map(e=>(0,V.jsxs)(`div`,{className:`cframe-box`,hidden:n!==e.id,children:[Ft(e,r,i,s[e.id]??`unknown`)&&!a[e.id]&&(0,V.jsx)(sE,{computer:e,onCode:t=>o(n=>({...n,[e.id]:t}))}),a[e.id]?(0,V.jsx)(`iframe`,{className:`cframe`,style:Vt(e),src:a[e.id],title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`},`pairing`):(0,V.jsx)(`iframe`,{className:`cframe`,style:Vt(e),src:e.url,title:`${e.name}'s Ledung`,allow:`publickey-credentials-get; publickey-credentials-create`,ref:t=>{l.current[e.id]=t},onLoad:()=>f(e)},`page`)]},e.id))}):null}function sE({computer:e,onCode:t}){let[n,r]=(0,v.useState)(`offer`),[i,a]=(0,v.useState)(null);return(0,V.jsxs)(`div`,{className:`cframe-bar`,style:Vt(e),role:n===`offer`?void 0:`alertdialog`,"aria-label":`Pair through the link with ${e.name}`,children:[n===`offer`?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{children:[`Not paired with `,e.name,` in this tab? It is linked with this computer.`]}),(0,V.jsx)(`button`,{type:`button`,className:`small`,onClick:()=>r(`confirm`),children:`Pair through the link`})]}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(`span`,{children:[`Pair this browser with `,(0,V.jsx)(`b`,{children:e.name}),` through the link? It can then look at `,e.name,`'s sessions, and change nothing until it sets up its passkey and logs on there with Touch ID or Windows Hello. `,e.name,` shows the pairing.`]}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>{r(`busy`),a(null),R.linkDevicePair(e.id).then(({url:e})=>t(e),e=>{a(e.message),r(`offer`)})},children:n===`busy`?`Pairing…`:`Pair`}),(0,V.jsx)(`button`,{type:`button`,className:`small`,disabled:n===`busy`,onClick:()=>r(`offer`),children:`Cancel`})]}),i&&(0,V.jsx)(`span`,{className:`restart-problem`,children:i})]})}function cE(e,t){(0,v.useEffect)(()=>{if(t)return;let n=()=>{let t=Bt(location.hash);t&&(history.replaceState(history.state,``,location.pathname+location.search),e(t))};return n(),window.addEventListener(`hashchange`,n),()=>window.removeEventListener(`hashchange`,n)},[])}var lE=`Removed projects`;function uE(e,t,n){return t===lE?!n.has(e.project)&&e.project!==`~chats`:e.project===t}var dE=Ht();dE&&window.addEventListener(`message`,e=>{let t=Lt(e.data,e.source===window.parent);t&&window.parent.postMessage(t,e.origin)});var fE={default:`Ask`,acceptEdits:`Accept edits`,auto:`Auto`,plan:`Plan`},pE={default:`Every action that needs permission asks you.`,acceptEdits:`File edits go through; commands still ask you.`,auto:`Routine actions are approved automatically; you are asked about the rest.`,plan:`Read-only: Claude plans but changes nothing.`},mE=[`waiting`,`usage`,`overview`,`board`,`settings`,`add`,`accounts`,`chat`,`chats`],hE=e=>!!e&&!mE.includes(e)&&!e.includes(`:`);function gE(){let e=location.hash.match(/^#\/waiting\/q\/(\d+)$/);if(e)return`q:${e[1]}`;let t=EC(location.hash);if(t)return CC(t.repo,t.id);let n=location.hash.match(/^#\/(waiting|usage|overview|board|settings|add|accounts|chat|chats)$/);if(n)return n[1];let r=location.hash.match(/^#\/(settings|chats)\/([a-z]+)$/);if(r)return`${r[1]}:${r[2]}`;let i=location.hash.match(/^#\/ps\/([^/]+)\/([a-z]+)$/);if(i)return`ps:${decodeURIComponent(i[1])}/${i[2]}`;let a=location.hash.match(/^#\/(p|ps|a)\/(.+)$/);return a?`${a[1]}:${decodeURIComponent(a[2])}`:(xg(location.hash)??Cg(location.hash))?.sessionId??null}function _E(e){if(!e)return``;if(mE.includes(e))return`#/${e}`;let t=wC(e);if(t)return TC(t.repo,t.id);if(e.startsWith(`q:`))return`#/waiting/q/${e.slice(2)}`;if(e.startsWith(`settings:`))return`#/settings/${e.slice(9)}`;if(e.startsWith(`chats:`))return`#/chats/${e.slice(6)}`;let n=Tp(e);if(n?.project!=null&&n.group)return`#/ps/${encodeURIComponent(n.project)}/${n.group}`;let r=e.match(/^(p|ps|a):(.+)$/);return r?`#/${r[1]}/${encodeURIComponent(r[2])}`:`#/s/${e}`}var vE=()=>history.state??{},yE=()=>Number(vE().ledungDesk??0),bE=()=>vE().ledungDeskRoot===!0;function xE(e){qh(e)&&vE().ledungDesk===void 0&&history.replaceState({...vE(),ledungDesk:0,ledungDeskRoot:!0},``)}function SE(){let e=history.state??{};return{depth:Number(e.ledungSettings??0),root:e.ledungSettingsRoot===!0}}function CE(e){hw(e)&&(history.state??{}).ledungSettings===void 0&&history.replaceState({...history.state??{},ledungSettings:1,ledungSettingsRoot:!0},``)}var wE=`ledung.waitingSidebar`;function TE(e){try{return localStorage.getItem(`ledung.technical.${e}`)===`1`}catch{return!1}}function EE(){let[e,t]=(0,v.useState)(gE()),[n,r]=(0,v.useState)(location.hash),i=RT(hE(e)?e:null),[a,o]=(0,v.useState)(null),[s,c]=(0,v.useState)(null),[l,u]=(0,v.useState)([]);cE(e=>{c(e),u(t=>t.includes(e)?t:[...t,e])},dE),(0,v.useEffect)(()=>{xE(gE()),CE(gE());let e=()=>{xE(gE()),CE(gE()),t(gE()),r(location.hash)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},[]);let d=n=>{let i=_E(n);if(i!==location.hash){let t=Jh(e,{depth:yE(),root:bE()},n),r=gw(e,SE(),n);location.hash=i,history.replaceState({...history.state??{},ledungDesk:t.depth,ledungDeskRoot:t.root,ledungSettings:r.depth,ledungSettingsRoot:r.root,ledungFromList:e===null},``)}t(n),r(location.hash)},f=e=>{history.replaceState(history.state,``,_E(e)),t(e),r(location.hash)},p=(n,a)=>{let o=i.questions[n];if(!o)return;let s=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0,c=a??yg(o);location.hash=bg(c,n),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:s},``),t(c),r(location.hash)},m=(n,a)=>{let o=e===`waiting`?`queue`:e?.startsWith(`q:`)?i.questions[Number(e.slice(2))]?.shots?`shots`:`question`:void 0;location.hash=Sg(n,a),history.replaceState({...history.state??{},ledungDesk:0,ledungDeskRoot:!1,ledungFrom:o},``),t(n),r(location.hash)},h=()=>{let e=yE();e>0&&!bE()?history.go(-e):d(xw(window.matchMedia(am).matches))},g=()=>{`back`in bw(history.state)?history.back():d(null)},_=()=>{`back`in Yh(yE())?history.back():d(`waiting`)},y=()=>{let e=_w(SE());`back`in e?history.go(-e.back):d(null)},b=hw(e),x=(0,v.useRef)(y);x.current=y,(0,v.useEffect)(()=>{if(!b)return;let e=e=>{vw(e)&&(e.preventDefault(),x.current())};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[b]),(0,v.useEffect)(()=>{let e=e=>{if(e.button!==3&&e.button!==4)return;let t=location.href,n=e.button===3;setTimeout(()=>{location.href===t&&(n?history.back():history.forward())},100)};return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[]);let[C,w]=(0,v.useState)(()=>{try{return localStorage.getItem(wE)===`hidden`}catch{return!1}}),T=()=>{w(!C);try{localStorage.setItem(wE,C?`shown`:`hidden`)}catch{}},E=qh(e)&&C,D=(0,v.useMemo)(()=>Object.values(i.questions).sort((e,t)=>t.id-e.id),[i.questions]),O=(0,v.useMemo)(()=>Object.values(i.permissions),[i.permissions]),k=ay(D,O)+i.newComputers.length+i.linkPairings.length,ee=uS(),A=YT({loaded:i.loaded,questions:D,permissions:O,sessions:i.sessions,usageStops:i.usageStops,onOpenSession:d});(0,v.useEffect)(()=>{document.title=k?`(${k}) Project Ledung`:`Project Ledung`},[k]);let j=(0,v.useMemo)(()=>{let e={};for(let t of O)t.status===`pending`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);for(let t of D)t.status===`open`&&(e[t.sessionId]=(e[t.sessionId]??0)+1);return e},[O,D]),M=i.sessions.find(t=>t.id===e)??null,te=kp(e),N=te?.startsWith(`ps:`)?i.projects.find(e=>e.name===te.slice(3)):void 0,P=te===`ledung`?t=>(0,V.jsx)(rC,{view:e,update:t,run:oe,board:i.board,remote:i.remote,throughPublicName:i.throughPublicName,newComputers:i.newComputers,projects:i.projects,computers:i.computers,sessions:i.sessions,accounts:i.accounts,accountChoices:i.accountChoices,defaultIdentity:i.defaultIdentity,accountProblems:i.accountProblems,usageStops:i.usageStops,macros:i.macros,canRestart:i.canRestart,source:i.source,config:i.configStatus,hellos:i.hellos,notify:A,onOpen:d}):te===`add`?()=>(0,V.jsx)(Jm,{run:oe,accounts:i.accounts,defaultAccount:i.accountChoices.newProjects,profiles:i.profiles,lockdownB:i.lockdownB,onAdded:e=>d(e.managerId??`p:${e.name}`)}):te===`chats`?()=>(0,V.jsx)($m,{view:e,chats:i.chats,run:oe,onOpen:d}):N?()=>(0,V.jsx)(Ym,{view:e,board:i.board,projects:i.projects,project:N,run:oe,accounts:i.accounts,profiles:N.profileNames??i.profiles,lockdownB:i.lockdownB,onOpen:d,onRemoved:()=>d(null),onRenamed:f},N.name):null,[ne,re]=(0,v.useState)(()=>{try{return localStorage.getItem(`ledung.limitAccount`)}catch{return null}}),ie=zy(e,i.sessions,i.projects,ne),ae=ie.account;(0,v.useEffect)(()=>{if(ie.remember&&ie.account!==ne){re(ie.account);try{localStorage.setItem(`ledung.limitAccount`,ie.account)}catch{}}},[ie.remember,ie.account,ne]);let oe=async e=>{o(null);try{await e()}catch(e){o(e.message)}},se=(0,V.jsxs)(V.Fragment,{children:[i.updated&&(0,V.jsxs)(`div`,{className:`banner updated`,children:[(0,V.jsx)(`span`,{children:`Ledung was updated — reload`}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>location.reload(),children:`Reload`})]}),i.away&&_b(i.away,M)&&(0,V.jsx)(mb,{away:i.away,run:oe}),ee.notice&&(0,V.jsx)(fS,{app:ee,run:oe}),(0,V.jsx)(DS,{run:oe}),i.usageStops.filter(e=>e.holding).map(e=>(0,V.jsxs)(`div`,{className:`banner updated`,children:[(0,V.jsx)(`span`,{children:Ay(e)}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void oe(()=>R.liftUsageStop(e.account,e.kind)),children:`Lift`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(xp(`usageStop`)),children:`Settings`})]},`${e.account}:${e.kind}`)),i.claudeProblem&&(0,V.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,V.jsx)(`span`,{children:(0,V.jsx)(Db,{text:i.claudeProblem})}),(0,V.jsx)(Eb,{check:async()=>!!(await R.checkSignIn()).claudeProblem}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(xp(`claudeProblem`)),children:`Settings`}),i.claudeLooked.length>0&&(0,V.jsx)(Ob,{looked:i.claudeLooked})]}),i.configStatus?.problem&&(0,V.jsxs)(`div`,{className:`banner updated signin`,role:`alert`,children:[(0,V.jsxs)(`span`,{children:[`The config file was changed but not applied: `,i.configStatus.problem]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(xp(`configProblem`)),children:`Settings`})]}),i.signedOut.map(e=>(0,V.jsxs)(`div`,{className:`banner updated signin`,children:[(0,V.jsx)(`span`,{children:e.help.split("`").map((e,t)=>t%2?(0,V.jsx)(`code`,{children:e},t):e)}),(0,V.jsx)(Eb,{check:async()=>!!(await R.checkSignIn()).signedOut?.some(t=>t.account===e.account)}),e.account!=="default"&&(0,V.jsx)(`button`,{className:`small`,onClick:()=>d(`settings:claude`),children:`Accounts`})]},`signin:${e.account}`)),a&&(0,V.jsxs)(`div`,{className:`banner error`,onClick:()=>o(null),children:[a,` `,(0,V.jsx)(`span`,{className:`muted`,children:`(click to dismiss)`})]})]}),ce=jt(i.computers,i.throughPublicName,dE),le=zt(i.computers,s);return(0,V.jsxs)(`div`,{className:`page${ce.remote?` remote`:``}`,style:Vt(ce.here),children:[(0,V.jsx)(aE,{frame:ce,shown:le,onShow:e=>{c(e),e&&!l.includes(e)&&u(t=>[...t,e])},waiting:k}),(0,V.jsx)(oE,{computers:i.computers,opened:l,shown:le,throughPublicName:i.throughPublicName,framed:dE}),(0,V.jsxs)(`div`,{className:`app ${yw(e)}${E?` no-sidebar`:``}`,hidden:le!==null,children:[e===null&&(0,V.jsx)(`div`,{className:`phone-banners`,children:se}),(0,V.jsx)(DE,{sessions:i.sessions,projects:i.projects,chats:i.chats,pending:j,waiting:k,limits:i.limits,usageStops:i.usageStops,github:i.github,stripAccount:ae,overview:i.overview,machine:i.machine,run:oe,openId:e,onOpen:d,onCloseSettings:y,profiles:i.profiles,onStart:(e,t)=>oe(async()=>d((await R.start(e,t)).id)),connection:i.connection,board:i.board}),!E&&(0,V.jsx)(TT,{}),(0,V.jsxs)(`main`,{className:`main`,children:[se,e!==null&&!M&&(0,V.jsx)(`div`,{className:`phone-bar`,children:(0,V.jsx)(`button`,{className:`phone-back`,onClick:g,children:`← List`})}),e===`usage`||e===`overview`?(0,V.jsx)(xT,{sessionsOpen:e===`overview`,onSessions:e=>d(e?`overview`:`usage`),sessions:i.sessions,overview:i.overview,machine:i.machine,waitingBySession:j,onOpenSession:d}):qh(e)?(0,V.jsx)(cy,{questions:D,permissions:O,sessions:i.sessions,projects:i.projects,chats:i.chats,userName:i.userName,questionId:e?.startsWith(`q:`)?Number(e.slice(2)):null,onOpenQuestion:e=>d(e===null?`waiting`:`q:${e}`),onOpenSession:d,onGoToConversation:p,onGoToMessage:m,onClose:h,onLeaveShots:_,sidebarHidden:C,onToggleSidebar:T,newComputers:i.newComputers,linkPairings:i.linkPairings,run:oe}):e===`board`?(0,V.jsx)(LC,{board:i.board,onOpen:d,onOpenSettings:()=>d(`settings`)}):wC(e)?(0,V.jsx)(zC,{repo:wC(e).repo,id:wC(e).id,board:i.board,projects:i.projects,onOpen:d,onBack:()=>d(`board`)},e):P?(0,V.jsx)(Hp,{view:e,projects:i.projects,source:i.source,canRestart:i.canRestart,hellos:i.hellos,onOpen:d,children:P}):e===`chat`?(0,V.jsx)(Qm,{chats:i.chats,profiles:i.profiles,run:oe,onStarted:d}):e?.startsWith(`a:`)?(0,V.jsx)(lb,{title:S(e.slice(2)),sessions:i.sessions.filter(t=>t.archivedAt&&uE(t,e.slice(2),new Set(i.projects.map(e=>e.name)))),overview:i.overview,run:oe,onOpenSession:d},e):e?.startsWith(`p:`)&&i.projects.some(t=>t.name===e.slice(2))?(0,V.jsx)(Xm,{project:i.projects.find(t=>t.name===e.slice(2)),run:oe,onStarted:d},e):M?(0,V.jsx)(OE,{session:M,ledung:i,pendingCount:j[M.id]??0,run:oe,focusQuestion:xg(n)?.questionId??null,focusMessage:Cg(n)?.messageId??null,cameFrom:vE().ledungFrom??null,onOpenQuestion:e=>d(`q:${e}`),onOpenBoardThread:(e,t)=>d(CC(e,t)),onBack:g},M.id):(0,V.jsxs)(`div`,{className:`empty`,children:[(0,V.jsx)(`h1`,{children:`Project Ledung`}),(0,V.jsx)(`p`,{children:i.projects.length?`Open a project on the left to talk to its manager.`:`No projects yet. Add one to start talking to its manager.`}),(0,V.jsxs)(`div`,{className:`empty-actions`,children:[!i.projects.length&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>d(`add`),children:`Add a project`}),(0,V.jsx)(`button`,{onClick:()=>d(`chat`),children:`New chat`}),(0,V.jsx)(`button`,{onClick:()=>d(`settings`),children:`Settings`})]})]})]})]})]})}function DE(e){let t=e.sessions.filter(e=>!e.archivedAt),n=e=>t.filter(t=>t.parentId===e).sort(WC),r=new Set(e.projects.map(e=>e.name)),i=(e,t,r)=>[{s:e,depth:0,drag:t},...n(e.id).map(t=>({s:t,depth:1,drag:r?`c:${e.id}`:null}))],a=(e,n,r)=>{let a=new Set(t.filter(e).map(e=>e.id)),o=n?t.find(e=>e.id===n):void 0,s=t.filter(t=>e(t)&&t.id!==n&&(!t.parentId||!a.has(t.parentId))).sort(WC);return[...o?i(o,null,!!r):[],...s.flatMap(e=>i(e,r?`t:${r}`:null,!!r))]},o=[{name:x,project:null,rows:a(e=>e.project===x,null,x)},...e.projects.map(e=>({name:e.name,project:e,rows:a(t=>t.project===e.name,e.managerId,e.name)})),{name:lE,project:null,rows:a(e=>!r.has(e.project)&&e.project!==`~chats`,null,null)}].map(t=>({...t,archived:e.sessions.filter(e=>e.archivedAt&&uE(e,t.name,r)).length})).filter(e=>e.project||e.name===`~chats`||e.rows.length||e.archived),[s,c]=(0,v.useState)(()=>ow(localStorage)),[l,u]=(0,v.useState)(()=>cw(localStorage)),d=e=>c(t=>{let n=uw(t,e,e=>e===lE||e===`~chats`||r.has(e));return sw(localStorage,n),n}),f=e=>u(n=>{let r=uw(n,e,e=>t.some(t=>t.id===e));return lw(localStorage,r),r}),p=(e,t)=>e&&e.count>0&&(0,V.jsxs)(`span`,{className:`hidden-count${e.working?` working`:``}`,title:`${e.count} ${t} hidden${e.working?`, at least one working`:``}`,children:[e.working&&(0,V.jsx)(`span`,{className:`dot running`}),`+`,e.count]}),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)(null),[y,b]=(0,v.useState)(``),S=(t,n)=>{if(n.length<=1)return e.onStart(t);b(``),h(m===t?null:t)},{nav:C,drag:w,handlers:T}=$C((t,n)=>void e.run(()=>t===`projects`?R.orderProjects(n):R.orderSessions(n))),E=e=>{if(!w||w.slot===null||w.group===`projects`)return null;let t=e.filter(e=>e.drag===w.group);return t.length?w.slot<t.length?{before:t[w.slot].s.id}:{after:w.group.startsWith(`t:`)?e[e.length-1].s.id:t[t.length-1].s.id}:null},D=o.filter(e=>e.project).map(e=>e.name),O=w?.group===`projects`&&w.slot!==null?w.slot<D.length?{before:D[w.slot]}:{after:D[D.length-1]}:null,k=(0,V.jsx)(`div`,{className:`drop-marker${w?.group.startsWith(`c:`)?` child`:``}`,"aria-hidden":`true`}),[ee]=Ax(),[A]=Ix(),j=Tt(A),[M]=Hx(),te=({s:t,depth:n,drag:r,hidden:i,folds:a,folded:o})=>{let s=`${Dg(t.createdAt)}${t.backgroundTasks>0?` · ${t.backgroundTasks} in background`:``}`,c=(()=>{let n=e.overview?.sessions[t.id]?.today??0,r=t.role===`manager`?e.sessions.filter(e=>e.parentId===t.id).reduce((t,n)=>t+(e.overview?.sessions[n.id]?.today??0),n):n,i=Ww(t),a=t.status===`ended`?void 0:e.machine?.sessions[t.id],o=e.machine?.line.indexOf(t.id)??-1;return[t.project===`~chats`&&t.workDir?`in ${t.workDir.split(/[\\/]/).filter(Boolean).pop()}`:``,o>=0?`number ${o+1} in line`:``,t.paused?`paused`:``,t.priority===`normal`?``:Iw[t.priority].toLowerCase(),a&&(a.cores>=.05||a.memBytes>0)?`${Nw(a.cores)} · ${Pw(a.memBytes)}`:``,r?`${Gy(r)}${t.role===`manager`&&r!==n?` team`:``} today`:``,i!=null&&t.status!==`ended`?`ctx ${qy(i)}`:``,t.pr?Jy(t.pr):t.branch??``].filter(Boolean).join(` · `)})();return(0,V.jsxs)(`div`,{className:`session-row`,children:[a&&(0,V.jsx)(`button`,{className:`fold-caret session-caret`,"aria-expanded":!o,"aria-label":`${o?`Unfold`:`Fold`} the sessions of ${t.title}`,title:o?`Show the sessions it runs`:`Fold the sessions it runs away`,onClick:()=>f(t.id),children:o?`▸`:`▾`}),g===t.id?(0,V.jsx)(`div`,{className:`session-item renaming${t.id===e.openId?` open`:``}${n?` child`:``}`,children:(0,V.jsx)(UC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>_(null),onSave:n=>e.run(()=>R.rename(t.id,n))})}):(0,V.jsxs)(`button`,{className:`session-item${t.id===e.openId?` open`:``}${n?` child`:``}${w?.id===t.id?` dragging`:``}${mt(ee,t).ended?` ended-row`:``}`,title:Et(A,mt(ee,t).tooltip,s,c),onClick:()=>e.onOpen(t.id),onDoubleClick:()=>_(t.id),"data-drag":r??void 0,"data-drag-id":r?t.id:void 0,children:[mt(ee,t).dot&&(0,V.jsx)(`span`,{className:`dot ${ut(t)}`,title:lt[t.status]}),(0,V.jsxs)(`span`,{className:`session-text`,children:[(0,V.jsxs)(`span`,{className:`session-title`,children:[t.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,(0,V.jsx)(pp,{colour:gp(t,Nv(e.projects,e.chats)),children:t.title})]}),j.time&&(0,V.jsx)(`span`,{className:`session-sub`,children:s}),j.usage&&c&&(0,V.jsx)(`span`,{className:`session-sub usage-line`,children:c})]}),(()=>{let n=M_(t,e.sessions);return n&&(0,V.jsx)(`span`,{className:`session-ship ${ut(t)}`,children:(0,V.jsx)(V_,{mode:n,width:10,sizeButton:!1,hideWhenSunk:!0,maxSize:j.shipMax})})})(),p(i,i?.count===1?`sub-session`:`sub-sessions`),(e.pending[t.id]??0)+(i?.pending??0)?(0,V.jsx)(`span`,{className:`badge`,children:(e.pending[t.id]??0)+(i?.pending??0)}):null]})]})},N=Fe(e.connection);return(0,V.jsxs)(`aside`,{className:`sidebar`,children:[(0,V.jsx)(sb,{account:e.stripAccount,limits:e.limits,stops:e.usageStops,run:e.run}),fw(e.github,Date.now()).map(e=>(0,V.jsx)(`div`,{className:`github-budget muted ${pw(e)}`,title:`What is left of the GitHub budget Ledung's pull request checks use (the worst of GitHub's readings). Under 20 % left they run every 10 minutes, under 5 % not until the reset.`,children:dw(e,e=>new Date(e).toLocaleTimeString([],{hour:`2-digit`,minute:`2-digit`}))},`${e.container??``} ${e.host}`)),(0,V.jsx)(Rw,{machine:e.machine,sessions:e.sessions,onOpen:e.onOpen,run:e.run}),(0,V.jsxs)(`button`,{className:`waiting-entry${qh(e.openId)?` open`:``}${e.waiting?` has-items`:``}`,onClick:()=>e.onOpen(`waiting`),children:[(0,V.jsx)(`span`,{children:`Waiting for you`}),e.waiting?(0,V.jsx)(`span`,{className:`badge`,children:e.waiting}):(0,V.jsx)(`span`,{className:`muted`,children:`nothing`})]}),(0,V.jsxs)(`nav`,{className:`session-list`,"data-compact":A>1?A:void 0,ref:C,...T,children:[!e.projects.length&&(0,V.jsx)(`p`,{className:`muted project-empty`,children:`No projects yet. Add one in Settings (⚙ below).`}),o.map(t=>({...t,isFolded:s.includes(t.name),view:rw(t.rows,{foldedSessions:l,folded:s.includes(t.name),openId:e.openId,pending:e.pending})})).map(t=>(0,V.jsxs)(v.Fragment,{children:[O?.before===t.name&&k,(0,V.jsx)(`div`,{className:`project-group${w?.group===`projects`&&w.id===t.name?` dragging`:``}`,children:(0,V.jsxs)(ep,{level:Jf(t.project),children:[(0,V.jsxs)(`div`,{className:`project-row`,children:[(0,V.jsx)(`button`,{className:`fold-caret`,"aria-expanded":!t.isFolded,"aria-label":`${t.isFolded?`Unfold`:`Fold`} ${t.name}`,title:t.isFolded?`Show its sessions`:`Fold its sessions away`,onClick:()=>d(t.name),children:t.isFolded?`▸`:`▾`}),t.project?(0,V.jsx)(`button`,{className:`project-name${e.openId===`p:${t.name}`||t.project.managerId&&e.openId===t.project.managerId?` open`:``}`,title:`${t.project.where}${t.project.managerId?``:` · manager not started yet`}`,onClick:()=>e.onOpen(t.project.managerId??`p:${t.name}`),"data-drag":`projects`,"data-drag-id":t.name,children:(()=>{let e=Vy(t.project.account),n=(0,V.jsx)(pp,{colour:t.project.colours.manager,children:t.name});return e?(0,V.jsxs)(`span`,{className:`project-name-stack`,children:[(0,V.jsx)(`span`,{className:`project-account`,title:`Runs on the Claude account ${e}`,children:e}),(0,V.jsx)(`span`,{className:`project-name-text`,children:n})]}):n})()}):t.name===`~chats`?(0,V.jsx)(`button`,{className:`project-name${e.openId===`chat`?` open`:``}`,title:`Sessions of your own with no project, workflow or manager`,onClick:()=>e.onOpen(`chat`),children:(0,V.jsx)(pp,{colour:e.chats?.colour??null,children:`Chats`})}):(0,V.jsx)(`span`,{className:`project-name muted`,children:t.name}),p(t.view.project,t.view.project?.count===1?`session`:`sessions`),t.view.project?.pending?(0,V.jsx)(`span`,{className:`badge`,children:t.view.project.pending}):null,t.name===`~chats`&&(0,V.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,V.jsx)(`button`,{className:`mini`,title:`New chat`,"aria-label":`New chat`,onClick:()=>e.onOpen(`chat`),children:`+`}):(0,V.jsx)(`button`,{className:`small`,title:`A Claude Code session of your own, with no project`,onClick:()=>e.onOpen(`chat`),children:`+ Chat`}),(0,V.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${kp(e.openId)===`chats`?` on`:``}`,title:`Chats settings`,"aria-label":`Settings of chats`,onClick:()=>e.onOpen(`chats`),children:`⚙`})]}),t.project&&(0,V.jsxs)(`span`,{className:`project-actions`,children:[j.plusOnly?(0,V.jsx)(`button`,{className:`mini`,title:`New session in ${t.name}`,"aria-label":`New session in ${t.name}`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+`}):(0,V.jsx)(`button`,{className:`small`,title:`A session of your own in this project, outside its manager`,onClick:()=>S(t.name,t.project?.profileNames??e.profiles),children:`+ Session`}),(0,V.jsx)(`button`,{className:`${j.plusOnly?`mini cog`:`small`}${kp(e.openId)===`ps:${t.name}`?` on`:``}`,title:`Project settings`,"aria-label":`Settings of ${t.name}`,onClick:()=>e.onOpen(`ps:${t.name}`),children:`⚙`})]})]}),t.project&&m===t.name&&(0,V.jsxs)(`div`,{className:`start-row`,children:[(0,V.jsxs)(`select`,{"aria-label":`Profile for a new session in ${t.name}`,value:y,onChange:e=>b(e.target.value),title:`Its session profile: what it gets of your own plugins, MCP servers, tools and settings`,children:[(0,V.jsx)(`option`,{value:``,children:t.project.profiles.session?`Project's: ${t.project.profiles.session}`:`Project's profile`}),(t.project.profileNames??e.profiles).map(e=>(0,V.jsx)(`option`,{value:e,children:e},e))]}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>{h(null),e.onStart(t.name,y||void 0)},children:`Start`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>h(null),children:`Cancel`})]}),(()=>{let e=E(t.view.rows);return t.view.rows.map(t=>(0,V.jsxs)(v.Fragment,{children:[e?.before===t.s.id&&k,te(t),e?.after===t.s.id&&k]},t.s.id))})(),vt(M,t.archived,t.isFolded)&&(0,V.jsxs)(`button`,{className:`archived-link${e.openId===`a:${t.name}`?` open`:``}`,onClick:()=>e.onOpen(`a:${t.name}`),children:[`Archived (`,t.archived,`)`]})]})}),O?.after===t.name&&k]},t.name))]}),(0,V.jsxs)(`div`,{className:`connection ${e.connection}`,children:[(0,V.jsx)(`button`,{className:`icon settings-cog${hw(e.openId)?` on`:``}`,title:hw(e.openId)?`Close settings (Esc)`:`Settings: accounts, restart Ledung, add a project`,"aria-label":hw(e.openId)?`Close settings`:`Settings`,"aria-pressed":hw(e.openId),onClick:()=>hw(e.openId)?e.onCloseSettings():e.onOpen(`settings`),children:`⚙`}),(0,V.jsxs)(`span`,{className:`footer-chips`,children:[(0,V.jsxs)(`button`,{className:`board-chip usage-chip${Ie(e.board)?``:` ${N.className}`}${e.openId===`usage`||e.openId===`overview`?` on`:``}`,title:`${Ie(e.board)?``:`${N.text} `}Usage: tokens per day, project and model, shared usage, and every live session`,"aria-pressed":e.openId===`usage`||e.openId===`overview`,onClick:()=>e.onOpen(`usage`),children:[`Usage`,e.overview?` · ${Gy(e.overview.todayTokens)} today`:``]}),(0,V.jsx)(bn,{board:e.board,open:e.openId===`board`||!!wC(e.openId),connection:N,onClick:()=>e.onOpen(`board`)})]})]})]})}function OE(e){let{session:t,ledung:n,run:r}=e,[i,a]=(0,v.useState)(()=>TE(t.id)),[o,s]=(0,v.useState)([]),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1);(0,v.useEffect)(()=>p(!1),[t.id]);let m=(0,v.useRef)(null),h=(0,v.useCallback)((e,t,n)=>{let r=n.length>2e3?`${n.slice(0,2e3)}…`:n;m.current?.(`> ${e}, ${Dg(t)}:\n${r.split(`
|
|
107
107
|
`).map(e=>`> ${e}`).join(`
|
|
108
|
-
`)}\n\n`)},[]),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{l(!1),_(!1),b(null),s(t=>[...t,e])},[]),S=(0,v.useMemo)(()=>Object.values(n.questions),[n.questions]),C=()=>{l(!1),s([]),b(null),_(e=>!e)},w=t.status===`ended`,T=Ew(t),E=qf(n.projects.find(e=>e.name===t.project)),D=(0,v.useMemo)(()=>Nv(t,Mv(n.projects,n.chats)),[t.project,t.role,n.projects,n.chats]),O=(0,v.useCallback)(()=>r(n.loadEarlier),[n.loadEarlier]),k=(0,v.useCallback)(e=>n.sessions.find(t=>t.id===e)?.title??`unknown`,[n.sessions]),ee=Tw(e.onOpenQuestion),A=n.board?.projects[t.project]?.repo,j=Tw(t=>e.onOpenBoardThread(A,t)),M=()=>{a(e=>{try{localStorage.setItem(`ledung.technical.${t.id}`,e?`0`:`1`)}catch{}return!e})},te=!(t.status===`stopping`||t.status===`ended`&&!t.claudeSessionId),N=(0,v.useMemo)(()=>te?HS(n.macros??[],t.project):[],[n.macros,t.project,te]),P=Tw((e,n)=>{let i=WS(e.text,t);GS(e,i,n)===`send`?r(()=>R.send(t.id,i.text)):m.current?.(i.text)});return(0,v.useEffect)(()=>{let e=N.filter(e=>e.key);if(!e.length)return;let t=t=>{if(t.repeat||t.isComposing||t.defaultPrevented)return;let n=LS(t),r=n&&e.find(e=>e.key===n);r&&(t.preventDefault(),P(r,!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[N]),(0,v.useEffect)(()=>{let e=e=>{Aw(e)&&(e.preventDefault(),M())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.id]),(0,V.jsxs)($f,{level:E,fill:!0,children:[(0,V.jsxs)(`header`,{className:`session-head${u?` details`:``}`,children:[(0,V.jsx)(`button`,{className:`phone-back`,"aria-label":`Back to the list`,title:`Back to the list`,onClick:e.onBack,children:`←`}),(0,V.jsxs)(`div`,{className:`session-head-text`,onClick:e=>{e.target.closest(`a, button`)||d(e=>!e)},children:[(0,V.jsxs)(`h2`,{children:[(0,V.jsx)(`span`,{className:`dot ${ut(t)} phone-dot`,title:lt[t.status]}),t.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,f?(0,V.jsx)(HC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>p(!1),onSave:e=>r(()=>R.rename(t.id,e))}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(fp,{colour:hp(t,Mv(n.projects,n.chats)),children:t.title}),(0,V.jsx)(`button`,{className:`icon rename`,title:`Rename`,"aria-label":`Rename ${t.title}`,onClick:()=>p(!0),children:`✎`})]})]}),t.parentId&&(0,V.jsxs)(`div`,{className:`muted started-by`,children:[`Started by`,` `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>location.hash=`#/s/${t.parentId}`,children:n.sessions.find(e=>e.id===t.parentId)?.title??`a manager`})]}),(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsx)(`span`,{className:`dot ${ut(t)}`}),` `,lt[t.status],t.status===`queued`&&n.machine&&n.machine.line.includes(t.id)?`: number ${n.machine.line.indexOf(t.id)+1} in line`:``,t.paused?` · Paused`:``,t.priority===`normal`?null:(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip prio-${t.priority}`,title:t.priorityNote??void 0,children:Fw[t.priority]})]}),n.machine?.sessions[t.id]&&!w?` · ${Mw(n.machine.sessions[t.id].cores)} · ${Nw(n.machine.sessions[t.id].memBytes)}`:``,t.status===`ended`&&t.endReason?` · ${t.endReason}`:``,` · `,t.project===`~chats`?`Chat`:t.project,E?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`span`,{className:`chip lock ${E.toLowerCase()}`,title:Gf[E],children:[`Lockdown `,E]})]}):null,t.workDir?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`span`,{className:`mono`,title:t.project===`~chats`?`Works in ${t.workDir}`:`Works in ${t.workDir}, not the project folder`,children:[`in `,t.workDir.split(/[\\/]/).filter(Boolean).pop()]})]}):null,t.account?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip`,title:`The Claude account this session runs under`,children:t.account})]}):null,t.model?` · ${t.model}`:``,t.profile&&t.profile!==`full`?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip`,title:`Its session profile: what it gets of your own plugins, MCP servers and tools`,children:t.profile})]}):null,t.backgroundTasks>0?` · ${t.backgroundTasks} background task(s)`:``,t.branch?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`mono`,children:t.branch})]}):null,t.pr?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`a`,{href:t.pr.url,target:`_blank`,rel:`noreferrer noopener`,title:`${t.pr.title} — checks ${t.pr.checks}`,children:qy(t.pr)})]}):null,t.tickets.map(e=>(0,V.jsxs)(`span`,{children:[` · `,(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id})]},e.id)),t.remoteControl?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(NE,{rc:t.remoteControl})]}):null]})]}),(0,V.jsx)(OE,{before:(0,V.jsx)(`button`,{className:`small files-toggle${g?` on`:``}`,"aria-pressed":g,title:`This session's files and what it changed (a test feature)`,onClick:C,children:`Files`}),session:t,project:n.projects.find(e=>e.name===t.project)??null,away:n.away,run:r,showTechnical:i,onToggleTechnical:M,usage:n.overview?.sessions[t.id]?.total??null,showUsage:c,onToggleUsage:()=>{s([]),_(!1),b(null),l(e=>!e)}}),T.header.length>0&&(0,V.jsxs)(`div`,{className:`session-actions`,children:[T.header.includes(`startNow`)&&(0,V.jsx)(`button`,{className:`primary`,title:`Start this turn now, above the limit on working sessions`,onClick:()=>r(()=>R.startNow(t.id)),children:`Start now`}),T.header.includes(`clear`)&&(0,V.jsx)(jE,{due:t.clearDue,onCancel:()=>r(()=>R.cancelClear(t.id))}),T.header.includes(`compacting`)&&(0,V.jsx)(ME,{compacting:t.compacting,by:t.compacting.requester===t.id?`the session itself`:`manager "${n.sessions.find(e=>e.id===t.compacting.requester)?.title??`a manager`}"`}),T.header.includes(`resume`)&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>r(()=>R.resume(t.id)),children:`Resume`}),T.header.includes(`archive`)&&(t.archivedAt?(0,V.jsx)(`button`,{title:`Back into the sidebar, still ended`,onClick:()=>r(()=>R.unarchive(t.id)),children:`Unarchive`}):(0,V.jsx)(`button`,{title:`Out of the sidebar, listed under the project's Archived; nothing is deleted`,onClick:()=>r(()=>R.archive(t.id)),children:`Archive`}))]})]}),e.cameFrom&&(0,V.jsxs)(`div`,{className:`came-from`,children:[(0,V.jsxs)(`button`,{className:`small`,onClick:()=>history.back(),children:[`← Back to `,e.cameFrom===`question`?`the question`:e.cameFrom===`shots`?`the screenshots`:`the queue`]}),(0,V.jsx)(`span`,{className:`muted`,children:`You came from Waiting for you; the browser's Back goes there too.`})]}),(0,V.jsxs)(`div`,{className:`session-body`,children:[(0,V.jsxs)(`div`,{className:`chat-column`,children:[(0,V.jsx)(jg,{messages:n.messages,permissions:n.permissions,showTechnical:i,hasEarlier:n.hasEarlier,onLoadEarlier:O,onOpenFile:x,questions:n.questions,userName:n.userName,onQuote:h,titleOf:k,sessionId:t.id,focusQuestion:e.focusQuestion,focusMessage:e.focusMessage??null,onOpenQuestion:ee,onOpenBoardThread:A?j:void 0,tint:D}),(0,V.jsx)(W_,{session:t,sessions:n.sessions,messages:n.messages,extra:(0,V.jsx)(XS,{macros:N,onUse:P,onEdit:()=>location.hash=`#/settings/macros`},t.id)},t.id),(0,V.jsx)(AE,{session:t,tint:D,run:r,quoteInto:m,bangShell:n.bangShell})]}),c&&(0,V.jsx)(Gw,{sessionId:t.id,onClose:()=>l(!1)}),o.length>0&&(0,V.jsx)(cv,{sessionId:t.id,stack:o,onOpen:x,onBack:()=>s(e=>e.slice(0,-1)),onClose:()=>s([])}),g&&(0,V.jsx)(Sv,{session:t,sessions:n.sessions,questions:S,userName:n.userName,hidden:y!==null,onOpenFile:(e,t)=>b({stack:[e],folder:t}),onOpenQuestion:e.onOpenQuestion,onClose:()=>_(!1)}),g&&y&&(0,V.jsx)(cv,{sessionId:t.id,stack:y.stack,folder:y.folder,backToPane:!0,onOpen:e=>b(t=>t&&{...t,stack:[...t.stack,e]}),onBack:()=>b(e=>e&&e.stack.length>1?{...e,stack:e.stack.slice(0,-1)}:null),onClose:()=>{b(null),_(!1)}})]})]})}function OE(e){let{session:t,run:n}=e,[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=Ew(t).menu,l=t.status===`ended`,u=e=>()=>{i(!1),e()};return(0,v.useEffect)(()=>{if(!r)return;o.current?.querySelector(`select:not(:disabled), input, button`)?.focus();let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{jw(e)&&(e.preventDefault(),i(!1),s.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[r]),(0,V.jsxs)(`div`,{className:`session-corner`,ref:a,children:[e.before,t.role===`manager`&&e.away&&(0,V.jsx)(fb,{away:e.away,onClick:()=>i(!0)}),(0,V.jsx)(`button`,{ref:s,className:`icon settings-cog${r?` on`:``}`,title:`Session settings: ${t.role===`manager`?`away, `:``}permissions, tool calls, usage, pause and stop`,"aria-label":`Session settings`,"aria-haspopup":`dialog`,"aria-expanded":r,"aria-controls":r?`session-menu`:void 0,onClick:()=>i(!r),children:`⚙`}),r&&(0,V.jsxs)(`div`,{className:`session-menu`,id:`session-menu`,role:`dialog`,"aria-label":`Session settings`,ref:o,children:[c.includes(`away`)&&(0,V.jsxs)(`div`,{className:`menu-row away-row`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Away`}),(0,V.jsx)(hb,{away:e.away,run:n})]}),c.includes(`permissions`)&&(0,V.jsxs)(`label`,{className:`mode menu-row`,title:fE[t.permissionMode],children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Permissions`}),(0,V.jsx)(`select`,{value:t.permissionMode,disabled:l||t.status===`stopping`,onChange:e=>n(()=>R.setPermissionMode(t.id,e.target.value)),children:b.map(e=>(0,V.jsx)(`option`,{value:e,title:fE[e],children:dE[e]},e))})]}),c.includes(`priority`)&&(0,V.jsxs)(`label`,{className:`mode menu-row`,title:t.priorityNote??`Who goes first when sessions wait for a free place`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Priority`}),(0,V.jsx)(`select`,{value:t.priority,disabled:l,onChange:e=>n(()=>R.setPriority(t.id,e.target.value)),children:C.map(e=>(0,V.jsx)(`option`,{value:e,children:Fw[e]},e))})]}),c.includes(`toolCalls`)&&(0,V.jsxs)(`label`,{className:`toggle menu-row`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.showTechnical,onChange:e.onToggleTechnical}),` Show tool calls`,(0,V.jsx)(`kbd`,{title:`Works anywhere on this page, the message box included`,children:`Ctrl+O`})]}),c.includes(`usage`)&&(0,V.jsxs)(`button`,{className:`menu-row${e.showUsage?` on`:``}`,onClick:u(e.onToggleUsage),children:[`Usage`,e.usage==null?``:` · ${Wy(e.usage)}`]}),(c.includes(`pause`)||c.includes(`stop`))&&(0,V.jsxs)(`div`,{className:`menu-row menu-buttons`,children:[c.includes(`pause`)&&(0,V.jsx)(`button`,{title:t.paused?`Let it go on`:`The command running now finishes; the next tool call waits, and no new turn starts`,onClick:u(()=>void n(()=>R.setPaused(t.id,!t.paused))),children:t.paused?`Resume`:`Pause`}),c.includes(`stop`)&&(0,V.jsx)(`button`,{onClick:u(()=>void n(()=>R.stop(t.id))),children:`Stop`})]}),Dw(t)&&(0,V.jsx)(kE,{sessionId:t.id}),c.includes(`version`)&&(0,V.jsxs)(`div`,{className:`menu-row menu-info`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Claude Code`}),(0,V.jsx)(`span`,{className:`mono`,children:t.claudeVersion})]})]})]})}function kE({sessionId:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0;return R.mcpServers(e).then(e=>t&&n(e),e=>t&&i(e.message)),()=>{t=!1}},[e]);let s=async t=>{o(t),i(null);try{n(await R.reconnectMcp(e,t))}catch(e){i(e.message)}finally{o(null)}};return(0,V.jsxs)(`div`,{className:`menu-row mcp-row`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`MCP servers`}),t===null&&!r&&(0,V.jsx)(`span`,{className:`muted`,children:`Asking Claude Code…`}),t?.length===0&&(0,V.jsx)(`span`,{className:`muted`,children:`None.`}),!!t?.length&&(0,V.jsx)(`ul`,{className:`mcp-servers`,children:t.map(e=>(0,V.jsxs)(`li`,{title:[e.version,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.error].filter(Boolean).join(` · `)||void 0,children:[(0,V.jsx)(`span`,{className:`dot mcp-${e.status}`}),(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`muted`,children:Ow[e.status]??e.status}),e.canReconnect?(0,V.jsx)(`button`,{className:`small`,disabled:a!==null,onClick:()=>void s(e.name),children:a===e.name?`Reconnecting…`:`Reconnect`}):(0,V.jsx)(`span`,{className:`muted`,title:`Ledung's own tool server, inside Ledung`,children:`Ledung's`})]},e.name))}),r&&(0,V.jsx)(`span`,{className:`error`,children:r})]})}function AE({session:e,tint:t,run:n,quoteInto:r,bangShell:i}){let a=B(),[o,s]=ww(e.id),c=e.status===`ended`&&!!e.claudeSessionId,l=e.status===`ended`&&!c||e.status===`stopping`,u=kw(e),{box:d,area:f,style:p,grip:m}=PT();(0,v.useEffect)(()=>(r.current=e=>{s(t=>t.trim()?`${t.trimEnd()}\n\n${e}`:e),f.current?.focus()},()=>{r.current=null}),[]),(0,v.useEffect)(()=>{e.project===`~chats`&&e.title===`New chat`&&!e.claudeSessionId&&f.current?.focus()},[e.id]);let[h,g]=(0,v.useState)(null),_=eh(o),y=async(t,r)=>{let i=o;s(``),g(null),await n(async()=>{try{await R.shell(e.id,t,r)}catch(e){throw s(i),e}})},b=async()=>{let t=o;t.trim()&&(_?await n(async()=>{let t=await R.shellCheck(e.id,_);if(t.refused)throw Error(t.refused);t.rule?g({command:_,rule:t.rule}):await y(_,!1)}):(s(``),await n(async()=>{try{await R.send(e.id,t)}catch(e){throw s(t),e}})))};return(0,V.jsxs)(`div`,{className:`composer${t?` tinted`:``}`,style:t,ref:d,children:[m,(e.shell||h||_)&&(0,V.jsxs)(`div`,{className:`bang-strips`,children:[e.shell&&(0,V.jsxs)(`div`,{className:`bang-running`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[`Running `,(0,V.jsxs)(`code`,{children:[`!`,e.shell.command]}),`…`]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(()=>R.shellStop(e.id)),children:`Stop`})]}),h&&(0,V.jsxs)(`div`,{className:`bang-ask`,role:`alert`,children:[(0,V.jsx)(`span`,{children:th(h.rule)}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void y(h.command,!0),children:`Run`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>g(null),children:`Cancel`})]}),_&&!h&&(0,V.jsx)(`div`,{className:`bang-hint muted`,children:nh(i,e.runner)})]}),(0,V.jsx)(`textarea`,{...a,ref:f,style:p,value:o,disabled:l,placeholder:l?`This session has ended.`:c?`This session has ended; sending a message resumes it.`:og()?`Message Claude`:`Message Claude (Enter to send, Shift+Enter for a new line)`,onChange:e=>{s(e.target.value),g(null)},onKeyDown:e=>{YT({key:e.key,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,isComposing:e.nativeEvent.isComposing},og())&&(e.preventDefault(),b())},rows:3}),(0,V.jsxs)(`div`,{className:`composer-buttons`,children:[(0,V.jsx)(`button`,{className:`stop-sign`,"aria-label":`Interrupt`,title:u?`Interrupt`:`Interrupt: nothing to interrupt now`,disabled:!u,onClick:()=>void n(()=>R.interrupt(e.id)),children:`STOP`}),(0,V.jsx)(`button`,{className:`primary`,disabled:l||!o.trim()||!!_&&!!e.shell,onClick:()=>void b(),children:_?`Run`:`Send`})]})]})}function jE({due:e,onCancel:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),500);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.ceil((e-n)/1e3));return(0,V.jsxs)(`span`,{className:`clear-countdown`,role:`status`,children:[i>0?`Clearing the conversation in ${i} s`:`Clearing the conversation…`,` `,(0,V.jsx)(`button`,{className:`primary`,title:`Keep the conversation; whoever asked for the clear is told`,onClick:t,children:`Cancel clear`})]})}function ME({compacting:e,by:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.floor((n-e.startedAt)/1e3)),a=`${Math.floor(i/60)}:${String(i%60).padStart(2,`0`)}`,o=`Compact requested by ${t}${e.note?`. Note for the summary: ${e.note}`:``}`;return(0,V.jsxs)(`span`,{className:`compacting`,role:`status`,title:o,children:[`Compacting… `,a,e.note&&(0,V.jsxs)(`span`,{className:`compacting-note`,children:[`Note from `,t,`: `,e.note]})]})}function NE({rc:e}){if(e.state===`unavailable`)return(0,V.jsx)(`span`,{title:e.error??void 0,children:`Remote Control unavailable`});if(!e.url)return(0,V.jsx)(`span`,{children:`Remote Control starting…`});let t=e.bridge?` (bridge ${e.bridge})`:``;return(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,title:`Remote Control on${t}: this manager in the Claude app or on claude.ai`,children:`Remote Control`})}var PE=e=>e?.name===`NotAllowedError`?Error(ye):e;function FE(e){return e.failed?{title:e.failed===`The passkey check was cancelled.`?`The passkey check was cancelled`:`The passkey check didn't go through`,body:[...e.failed===`The passkey check was cancelled.`?[]:[e.failed],`Nothing was changed. Try again to get the Face ID or fingerprint prompt back.`],go:`Try again`}:e.kind===`unlock`?{title:`Unlock this device`,body:[`This device is locked. Next comes a Face ID, fingerprint, Touch ID or Windows Hello check that unlocks it for changes: for 30 minutes on a phone; a computer stays logged on until you log out.`,`A sensitive permission is also signed on its own, so then a second check follows straight after the first.`],go:`Continue`}:{title:`Sign with your passkey`,body:[`Sensitive permissions are signed one by one: next comes a Face ID or fingerprint check for this one.`,`When this device is locked it asks twice: first to unlock it, then to sign.`],go:`Continue`}}var IE=e=>{let t=``;for(let n of new Uint8Array(e))t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)},LE=e=>{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)+`=`.repeat((4-e.length%4)%4)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n};async function RE(e){let t=await navigator.credentials.get({publicKey:{challenge:LE(e.challenge),rpId:e.rpId,timeout:e.timeout,userVerification:`required`,allowCredentials:(e.allowCredentials??[]).map(e=>({type:`public-key`,id:LE(e.id)}))}}).catch(e=>{throw PE(e)});if(!t)throw Error(ye);let n=t.response,r={id:t.id,rawId:IE(t.rawId),type:t.type,clientExtensionResults:{},response:{clientDataJSON:IE(n.clientDataJSON),authenticatorData:IE(n.authenticatorData),signature:IE(n.signature),...n.userHandle?{userHandle:IE(n.userHandle)}:{}}};return IE(new TextEncoder().encode(JSON.stringify(r)))}async function zE(e){let t=e.user,n=await navigator.credentials.create({publicKey:{challenge:LE(e.challenge),rp:e.rp,user:{id:LE(t.id),name:t.name,displayName:t.displayName},pubKeyCredParams:e.pubKeyCredParams,timeout:e.timeout,attestation:`none`,authenticatorSelection:{residentKey:`discouraged`,userVerification:`required`}}});if(!n)throw Error(`Setting up the passkey was cancelled.`);let r=n.response;return{id:n.id,rawId:IE(n.rawId),type:n.type,clientExtensionResults:{},response:{clientDataJSON:IE(r.clientDataJSON),attestationObject:IE(r.attestationObject),transports:r.getTransports?.()??[]}}}var BE={sign:RE,create:zE};function VE(){let[e,t]=(0,v.useState)([]);(0,v.useEffect)(()=>(xe(e=>new Promise(n=>t(t=>[...t,{step:e,answer:n}]))),()=>xe(null)),[]);let n=e[0];if(!n)return null;let r=FE(n.step),i=e=>{t(e=>e.slice(1)),n.answer(e)};return(0,V.jsx)(`div`,{className:`passkey-backdrop`,children:(0,V.jsxs)(`div`,{className:`passkey-dialog`,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`passkey-title`,children:[(0,V.jsx)(`h3`,{id:`passkey-title`,children:r.title}),r.body.map(e=>(0,V.jsx)(`p`,{children:e},e)),(0,V.jsxs)(`div`,{className:`passkey-actions`,children:[(0,V.jsx)(`button`,{onClick:()=>i(!1),children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,autoFocus:!0,onClick:()=>i(!0),children:r.go})]})]})})}_e(BE),ct(document.documentElement,ot(localStorage)),window.addEventListener(`storage`,e=>{e.key===`ledung.theme`?ct(document.documentElement,at(e.newValue)):e.key===null&&ct(document.documentElement,ot(localStorage))}),dn(),tE(window),(0,y.createRoot)(document.getElementById(`root`)).render((0,V.jsxs)(v.StrictMode,{children:[(0,V.jsx)(TE,{}),(0,V.jsx)(VE,{})]}));export{o as n,l as r,tv as t};
|
|
108
|
+
`)}\n\n`)},[]),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),x=(0,v.useCallback)(e=>{l(!1),_(!1),b(null),s(t=>[...t,e])},[]),S=(0,v.useMemo)(()=>Object.values(n.questions),[n.questions]),C=()=>{l(!1),s([]),b(null),_(e=>!e)},w=t.status===`ended`,T=Dw(t),E=Jf(n.projects.find(e=>e.name===t.project)),D=(0,v.useMemo)(()=>Pv(t,Nv(n.projects,n.chats)),[t.project,t.role,n.projects,n.chats]),O=(0,v.useCallback)(()=>r(n.loadEarlier),[n.loadEarlier]),k=(0,v.useCallback)(e=>n.sessions.find(t=>t.id===e)?.title??`unknown`,[n.sessions]),ee=Ew(e.onOpenQuestion),A=n.board?.projects[t.project]?.repo,j=Ew(t=>e.onOpenBoardThread(A,t)),M=()=>{a(e=>{try{localStorage.setItem(`ledung.technical.${t.id}`,e?`0`:`1`)}catch{}return!e})},te=!(t.status===`stopping`||t.status===`ended`&&!t.claudeSessionId),N=(0,v.useMemo)(()=>te?US(n.macros??[],t.project):[],[n.macros,t.project,te]),P=Ew((e,n)=>{let i=GS(e.text,t);KS(e,i,n)===`send`?r(()=>R.send(t.id,i.text)):m.current?.(i.text)});return(0,v.useEffect)(()=>{let e=N.filter(e=>e.key);if(!e.length)return;let t=t=>{if(t.repeat||t.isComposing||t.defaultPrevented)return;let n=RS(t),r=n&&e.find(e=>e.key===n);r&&(t.preventDefault(),P(r,!1))};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[N]),(0,v.useEffect)(()=>{let e=e=>{jw(e)&&(e.preventDefault(),M())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t.id]),(0,V.jsxs)(ep,{level:E,fill:!0,children:[(0,V.jsxs)(`header`,{className:`session-head${u?` details`:``}`,children:[(0,V.jsx)(`button`,{className:`phone-back`,"aria-label":`Back to the list`,title:`Back to the list`,onClick:e.onBack,children:`←`}),(0,V.jsxs)(`div`,{className:`session-head-text`,onClick:e=>{e.target.closest(`a, button`)||d(e=>!e)},children:[(0,V.jsxs)(`h2`,{children:[(0,V.jsx)(`span`,{className:`dot ${ut(t)} phone-dot`,title:lt[t.status]}),t.role===`manager`&&(0,V.jsx)(`span`,{className:`chip`,children:`Manager`}),` `,f?(0,V.jsx)(UC,{value:t.title,label:`New name for ${t.title}`,onDone:()=>p(!1),onSave:e=>r(()=>R.rename(t.id,e))}):(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(pp,{colour:gp(t,Nv(n.projects,n.chats)),children:t.title}),(0,V.jsx)(`button`,{className:`icon rename`,title:`Rename`,"aria-label":`Rename ${t.title}`,onClick:()=>p(!0),children:`✎`})]})]}),t.parentId&&(0,V.jsxs)(`div`,{className:`muted started-by`,children:[`Started by`,` `,(0,V.jsx)(`button`,{className:`link`,onClick:()=>location.hash=`#/s/${t.parentId}`,children:n.sessions.find(e=>e.id===t.parentId)?.title??`a manager`})]}),(0,V.jsxs)(`div`,{className:`muted`,children:[(0,V.jsx)(`span`,{className:`dot ${ut(t)}`}),` `,lt[t.status],t.status===`queued`&&n.machine&&n.machine.line.includes(t.id)?`: number ${n.machine.line.indexOf(t.id)+1} in line`:``,t.paused?` · Paused`:``,t.priority===`normal`?null:(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip prio-${t.priority}`,title:t.priorityNote??void 0,children:Iw[t.priority]})]}),n.machine?.sessions[t.id]&&!w?` · ${Nw(n.machine.sessions[t.id].cores)} · ${Pw(n.machine.sessions[t.id].memBytes)}`:``,t.status===`ended`&&t.endReason?` · ${t.endReason}`:``,` · `,t.project===`~chats`?`Chat`:t.project,E?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`span`,{className:`chip lock ${E.toLowerCase()}`,title:Kf[E],children:[`Lockdown `,E]})]}):null,t.workDir?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsxs)(`span`,{className:`mono`,title:t.project===`~chats`?`Works in ${t.workDir}`:`Works in ${t.workDir}, not the project folder`,children:[`in `,t.workDir.split(/[\\/]/).filter(Boolean).pop()]})]}):null,t.account?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip`,title:`The Claude account this session runs under`,children:t.account})]}):null,t.model?` · ${t.model}`:``,t.profile&&t.profile!==`full`?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`chip`,title:`Its session profile: what it gets of your own plugins, MCP servers and tools`,children:t.profile})]}):null,t.backgroundTasks>0?` · ${t.backgroundTasks} background task(s)`:``,t.branch?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`span`,{className:`mono`,children:t.branch})]}):null,t.pr?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(`a`,{href:t.pr.url,target:`_blank`,rel:`noreferrer noopener`,title:`${t.pr.title} — checks ${t.pr.checks}`,children:Jy(t.pr)})]}):null,t.tickets.map(e=>(0,V.jsxs)(`span`,{children:[` · `,(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,children:e.id})]},e.id)),t.remoteControl?(0,V.jsxs)(V.Fragment,{children:[` · `,(0,V.jsx)(PE,{rc:t.remoteControl})]}):null]})]}),(0,V.jsx)(kE,{before:(0,V.jsx)(`button`,{className:`small files-toggle${g?` on`:``}`,"aria-pressed":g,title:`This session's files and what it changed (a test feature)`,onClick:C,children:`Files`}),session:t,project:n.projects.find(e=>e.name===t.project)??null,away:n.away,run:r,showTechnical:i,onToggleTechnical:M,usage:n.overview?.sessions[t.id]?.total??null,showUsage:c,onToggleUsage:()=>{s([]),_(!1),b(null),l(e=>!e)}}),T.header.length>0&&(0,V.jsxs)(`div`,{className:`session-actions`,children:[T.header.includes(`startNow`)&&(0,V.jsx)(`button`,{className:`primary`,title:`Start this turn now, above the limit on working sessions`,onClick:()=>r(()=>R.startNow(t.id)),children:`Start now`}),T.header.includes(`clear`)&&(0,V.jsx)(ME,{due:t.clearDue,onCancel:()=>r(()=>R.cancelClear(t.id))}),T.header.includes(`compacting`)&&(0,V.jsx)(NE,{compacting:t.compacting,by:t.compacting.requester===t.id?`the session itself`:`manager "${n.sessions.find(e=>e.id===t.compacting.requester)?.title??`a manager`}"`}),T.header.includes(`resume`)&&(0,V.jsx)(`button`,{className:`primary`,onClick:()=>r(()=>R.resume(t.id)),children:`Resume`}),T.header.includes(`archive`)&&(t.archivedAt?(0,V.jsx)(`button`,{title:`Back into the sidebar, still ended`,onClick:()=>r(()=>R.unarchive(t.id)),children:`Unarchive`}):(0,V.jsx)(`button`,{title:`Out of the sidebar, listed under the project's Archived; nothing is deleted`,onClick:()=>r(()=>R.archive(t.id)),children:`Archive`}))]})]}),e.cameFrom&&(0,V.jsxs)(`div`,{className:`came-from`,children:[(0,V.jsxs)(`button`,{className:`small`,onClick:()=>history.back(),children:[`← Back to `,e.cameFrom===`question`?`the question`:e.cameFrom===`shots`?`the screenshots`:`the queue`]}),(0,V.jsx)(`span`,{className:`muted`,children:`You came from Waiting for you; the browser's Back goes there too.`})]}),(0,V.jsxs)(`div`,{className:`session-body`,children:[(0,V.jsxs)(`div`,{className:`chat-column`,children:[(0,V.jsx)(Mg,{messages:n.messages,permissions:n.permissions,showTechnical:i,hasEarlier:n.hasEarlier,onLoadEarlier:O,onOpenFile:x,questions:n.questions,userName:n.userName,onQuote:h,titleOf:k,sessionId:t.id,focusQuestion:e.focusQuestion,focusMessage:e.focusMessage??null,onOpenQuestion:ee,onOpenBoardThread:A?j:void 0,tint:D}),(0,V.jsx)(G_,{session:t,sessions:n.sessions,messages:n.messages,extra:(0,V.jsx)(ZS,{macros:N,onUse:P,onEdit:()=>location.hash=`#/settings/macros`},t.id)},t.id),(0,V.jsx)(jE,{session:t,tint:D,run:r,quoteInto:m,bangShell:n.bangShell})]}),c&&(0,V.jsx)(Kw,{sessionId:t.id,onClose:()=>l(!1)}),o.length>0&&(0,V.jsx)(lv,{sessionId:t.id,stack:o,onOpen:x,onBack:()=>s(e=>e.slice(0,-1)),onClose:()=>s([])}),g&&(0,V.jsx)(Cv,{session:t,sessions:n.sessions,questions:S,userName:n.userName,hidden:y!==null,onOpenFile:(e,t)=>b({stack:[e],folder:t}),onOpenQuestion:e.onOpenQuestion,onClose:()=>_(!1)}),g&&y&&(0,V.jsx)(lv,{sessionId:t.id,stack:y.stack,folder:y.folder,backToPane:!0,onOpen:e=>b(t=>t&&{...t,stack:[...t.stack,e]}),onBack:()=>b(e=>e&&e.stack.length>1?{...e,stack:e.stack.slice(0,-1)}:null),onClose:()=>{b(null),_(!1)}})]})]})}function kE(e){let{session:t,run:n}=e,[r,i]=(0,v.useState)(!1),a=(0,v.useRef)(null),o=(0,v.useRef)(null),s=(0,v.useRef)(null),c=Dw(t).menu,l=t.status===`ended`,u=e=>()=>{i(!1),e()};return(0,v.useEffect)(()=>{if(!r)return;o.current?.querySelector(`select:not(:disabled), input, button`)?.focus();let e=e=>{a.current?.contains(e.target)||i(!1)},t=e=>{Mw(e)&&(e.preventDefault(),i(!1),s.current?.focus())};return document.addEventListener(`pointerdown`,e),document.addEventListener(`keydown`,t,!0),()=>{document.removeEventListener(`pointerdown`,e),document.removeEventListener(`keydown`,t,!0)}},[r]),(0,V.jsxs)(`div`,{className:`session-corner`,ref:a,children:[e.before,t.role===`manager`&&e.away&&(0,V.jsx)(pb,{away:e.away,onClick:()=>i(!0)}),(0,V.jsx)(`button`,{ref:s,className:`icon settings-cog${r?` on`:``}`,title:`Session settings: ${t.role===`manager`?`away, `:``}permissions, tool calls, usage, pause and stop`,"aria-label":`Session settings`,"aria-haspopup":`dialog`,"aria-expanded":r,"aria-controls":r?`session-menu`:void 0,onClick:()=>i(!r),children:`⚙`}),r&&(0,V.jsxs)(`div`,{className:`session-menu`,id:`session-menu`,role:`dialog`,"aria-label":`Session settings`,ref:o,children:[c.includes(`away`)&&(0,V.jsxs)(`div`,{className:`menu-row away-row`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Away`}),(0,V.jsx)(gb,{away:e.away,run:n})]}),c.includes(`permissions`)&&(0,V.jsxs)(`label`,{className:`mode menu-row`,title:pE[t.permissionMode],children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Permissions`}),(0,V.jsx)(`select`,{value:t.permissionMode,disabled:l||t.status===`stopping`,onChange:e=>n(()=>R.setPermissionMode(t.id,e.target.value)),children:b.map(e=>(0,V.jsx)(`option`,{value:e,title:pE[e],children:fE[e]},e))})]}),c.includes(`priority`)&&(0,V.jsxs)(`label`,{className:`mode menu-row`,title:t.priorityNote??`Who goes first when sessions wait for a free place`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Priority`}),(0,V.jsx)(`select`,{value:t.priority,disabled:l,onChange:e=>n(()=>R.setPriority(t.id,e.target.value)),children:C.map(e=>(0,V.jsx)(`option`,{value:e,children:Iw[e]},e))})]}),c.includes(`toolCalls`)&&(0,V.jsxs)(`label`,{className:`toggle menu-row`,children:[(0,V.jsx)(`input`,{type:`checkbox`,checked:e.showTechnical,onChange:e.onToggleTechnical}),` Show tool calls`,(0,V.jsx)(`kbd`,{title:`Works anywhere on this page, the message box included`,children:`Ctrl+O`})]}),c.includes(`usage`)&&(0,V.jsxs)(`button`,{className:`menu-row${e.showUsage?` on`:``}`,onClick:u(e.onToggleUsage),children:[`Usage`,e.usage==null?``:` · ${Gy(e.usage)}`]}),(c.includes(`pause`)||c.includes(`stop`))&&(0,V.jsxs)(`div`,{className:`menu-row menu-buttons`,children:[c.includes(`pause`)&&(0,V.jsx)(`button`,{title:t.paused?`Let it go on`:`The command running now finishes; the next tool call waits, and no new turn starts`,onClick:u(()=>void n(()=>R.setPaused(t.id,!t.paused))),children:t.paused?`Resume`:`Pause`}),c.includes(`stop`)&&(0,V.jsx)(`button`,{onClick:u(()=>void n(()=>R.stop(t.id))),children:`Stop`})]}),Ow(t)&&(0,V.jsx)(AE,{sessionId:t.id}),c.includes(`version`)&&(0,V.jsxs)(`div`,{className:`menu-row menu-info`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`Claude Code`}),(0,V.jsx)(`span`,{className:`mono`,children:t.claudeVersion})]})]})]})}function AE({sessionId:e}){let[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)(null);(0,v.useEffect)(()=>{let t=!0;return R.mcpServers(e).then(e=>t&&n(e),e=>t&&i(e.message)),()=>{t=!1}},[e]);let s=async t=>{o(t),i(null);try{n(await R.reconnectMcp(e,t))}catch(e){i(e.message)}finally{o(null)}};return(0,V.jsxs)(`div`,{className:`menu-row mcp-row`,children:[(0,V.jsx)(`span`,{className:`menu-label`,children:`MCP servers`}),t===null&&!r&&(0,V.jsx)(`span`,{className:`muted`,children:`Asking Claude Code…`}),t?.length===0&&(0,V.jsx)(`span`,{className:`muted`,children:`None.`}),!!t?.length&&(0,V.jsx)(`ul`,{className:`mcp-servers`,children:t.map(e=>(0,V.jsxs)(`li`,{title:[e.version,e.tools?`${e.tools} tool${e.tools===1?``:`s`}`:``,e.error].filter(Boolean).join(` · `)||void 0,children:[(0,V.jsx)(`span`,{className:`dot mcp-${e.status}`}),(0,V.jsx)(`span`,{className:`mono`,children:e.name}),(0,V.jsx)(`span`,{className:`muted`,children:kw[e.status]??e.status}),e.canReconnect?(0,V.jsx)(`button`,{className:`small`,disabled:a!==null,onClick:()=>void s(e.name),children:a===e.name?`Reconnecting…`:`Reconnect`}):(0,V.jsx)(`span`,{className:`muted`,title:`Ledung's own tool server, inside Ledung`,children:`Ledung's`})]},e.name))}),r&&(0,V.jsx)(`span`,{className:`error`,children:r})]})}function jE({session:e,tint:t,run:n,quoteInto:r,bangShell:i}){let a=B(),[o,s]=Tw(e.id),c=e.status===`ended`&&!!e.claudeSessionId,l=e.status===`ended`&&!c||e.status===`stopping`,u=Aw(e),{box:d,area:f,style:p,grip:m}=FT();(0,v.useEffect)(()=>(r.current=e=>{s(t=>t.trim()?`${t.trimEnd()}\n\n${e}`:e),f.current?.focus()},()=>{r.current=null}),[]),(0,v.useEffect)(()=>{e.project===`~chats`&&e.title===`New chat`&&!e.claudeSessionId&&f.current?.focus()},[e.id]);let[h,g]=(0,v.useState)(null),_=th(o),y=async(t,r)=>{let i=o;s(``),g(null),await n(async()=>{try{await R.shell(e.id,t,r)}catch(e){throw s(i),e}})},b=async()=>{let t=o;t.trim()&&(_?await n(async()=>{let t=await R.shellCheck(e.id,_);if(t.refused)throw Error(t.refused);t.rule?g({command:_,rule:t.rule}):await y(_,!1)}):(s(``),await n(async()=>{try{await R.send(e.id,t)}catch(e){throw s(t),e}})))};return(0,V.jsxs)(`div`,{className:`composer${t?` tinted`:``}`,style:t,ref:d,children:[m,(e.shell||h||_)&&(0,V.jsxs)(`div`,{className:`bang-strips`,children:[e.shell&&(0,V.jsxs)(`div`,{className:`bang-running`,role:`status`,children:[(0,V.jsxs)(`span`,{children:[`Running `,(0,V.jsxs)(`code`,{children:[`!`,e.shell.command]}),`…`]}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>void n(()=>R.shellStop(e.id)),children:`Stop`})]}),h&&(0,V.jsxs)(`div`,{className:`bang-ask`,role:`alert`,children:[(0,V.jsx)(`span`,{children:nh(h.rule)}),(0,V.jsx)(`button`,{className:`small primary`,onClick:()=>void y(h.command,!0),children:`Run`}),(0,V.jsx)(`button`,{className:`small`,onClick:()=>g(null),children:`Cancel`})]}),_&&!h&&(0,V.jsx)(`div`,{className:`bang-hint muted`,children:rh(i,e.runner)})]}),(0,V.jsx)(`textarea`,{...a,ref:f,style:p,value:o,disabled:l,placeholder:l?`This session has ended.`:c?`This session has ended; sending a message resumes it.`:sg()?`Message Claude`:`Message Claude (Enter to send, Shift+Enter for a new line)`,onChange:e=>{s(e.target.value),g(null)},onKeyDown:e=>{XT({key:e.key,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,isComposing:e.nativeEvent.isComposing},sg())&&(e.preventDefault(),b())},rows:3}),(0,V.jsxs)(`div`,{className:`composer-buttons`,children:[(0,V.jsx)(`button`,{className:`stop-sign`,"aria-label":`Interrupt`,title:u?`Interrupt`:`Interrupt: nothing to interrupt now`,disabled:!u,onClick:()=>void n(()=>R.interrupt(e.id)),children:`STOP`}),(0,V.jsx)(`button`,{className:`primary`,disabled:l||!o.trim()||!!_&&!!e.shell,onClick:()=>void b(),children:_?`Run`:`Send`})]})]})}function ME({due:e,onCancel:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),500);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.ceil((e-n)/1e3));return(0,V.jsxs)(`span`,{className:`clear-countdown`,role:`status`,children:[i>0?`Clearing the conversation in ${i} s`:`Clearing the conversation…`,` `,(0,V.jsx)(`button`,{className:`primary`,title:`Keep the conversation; whoever asked for the clear is told`,onClick:t,children:`Cancel clear`})]})}function NE({compacting:e,by:t}){let[n,r]=(0,v.useState)(Date.now());(0,v.useEffect)(()=>{let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);let i=Math.max(0,Math.floor((n-e.startedAt)/1e3)),a=`${Math.floor(i/60)}:${String(i%60).padStart(2,`0`)}`,o=`Compact requested by ${t}${e.note?`. Note for the summary: ${e.note}`:``}`;return(0,V.jsxs)(`span`,{className:`compacting`,role:`status`,title:o,children:[`Compacting… `,a,e.note&&(0,V.jsxs)(`span`,{className:`compacting-note`,children:[`Note from `,t,`: `,e.note]})]})}function PE({rc:e}){if(e.state===`unavailable`)return(0,V.jsx)(`span`,{title:e.error??void 0,children:`Remote Control unavailable`});if(!e.url)return(0,V.jsx)(`span`,{children:`Remote Control starting…`});let t=e.bridge?` (bridge ${e.bridge})`:``;return(0,V.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,title:`Remote Control on${t}: this manager in the Claude app or on claude.ai`,children:`Remote Control`})}var FE=e=>e?.name===`NotAllowedError`?Error(ye):e;function IE(e){return e.failed?{title:e.failed===`The passkey check was cancelled.`?`The passkey check was cancelled`:`The passkey check didn't go through`,body:[...e.failed===`The passkey check was cancelled.`?[]:[e.failed],`Nothing was changed. Try again to get the Face ID or fingerprint prompt back.`],go:`Try again`}:e.kind===`unlock`?{title:`Unlock this device`,body:[`This device is locked. Next comes a Face ID, fingerprint, Touch ID or Windows Hello check that unlocks it for changes: for 30 minutes on a phone; a computer stays logged on until you log out.`,`A sensitive permission is also signed on its own, so then a second check follows straight after the first.`],go:`Continue`}:{title:`Sign with your passkey`,body:[`Sensitive permissions are signed one by one: next comes a Face ID or fingerprint check for this one.`,`When this device is locked it asks twice: first to unlock it, then to sign.`],go:`Continue`}}var LE=e=>{let t=``;for(let n of new Uint8Array(e))t+=String.fromCharCode(n);return btoa(t).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)},RE=e=>{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)+`=`.repeat((4-e.length%4)%4)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n};async function zE(e){let t=await navigator.credentials.get({publicKey:{challenge:RE(e.challenge),rpId:e.rpId,timeout:e.timeout,userVerification:`required`,allowCredentials:(e.allowCredentials??[]).map(e=>({type:`public-key`,id:RE(e.id)}))}}).catch(e=>{throw FE(e)});if(!t)throw Error(ye);let n=t.response,r={id:t.id,rawId:LE(t.rawId),type:t.type,clientExtensionResults:{},response:{clientDataJSON:LE(n.clientDataJSON),authenticatorData:LE(n.authenticatorData),signature:LE(n.signature),...n.userHandle?{userHandle:LE(n.userHandle)}:{}}};return LE(new TextEncoder().encode(JSON.stringify(r)))}async function BE(e){let t=e.user,n=await navigator.credentials.create({publicKey:{challenge:RE(e.challenge),rp:e.rp,user:{id:RE(t.id),name:t.name,displayName:t.displayName},pubKeyCredParams:e.pubKeyCredParams,timeout:e.timeout,attestation:`none`,authenticatorSelection:{residentKey:`discouraged`,userVerification:`required`}}});if(!n)throw Error(`Setting up the passkey was cancelled.`);let r=n.response;return{id:n.id,rawId:LE(n.rawId),type:n.type,clientExtensionResults:{},response:{clientDataJSON:LE(r.clientDataJSON),attestationObject:LE(r.attestationObject),transports:r.getTransports?.()??[]}}}var VE={sign:zE,create:BE};function HE(){let[e,t]=(0,v.useState)([]);(0,v.useEffect)(()=>(xe(e=>new Promise(n=>t(t=>[...t,{step:e,answer:n}]))),()=>xe(null)),[]);let n=e[0];if(!n)return null;let r=IE(n.step),i=e=>{t(e=>e.slice(1)),n.answer(e)};return(0,V.jsx)(`div`,{className:`passkey-backdrop`,children:(0,V.jsxs)(`div`,{className:`passkey-dialog`,role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`passkey-title`,children:[(0,V.jsx)(`h3`,{id:`passkey-title`,children:r.title}),r.body.map(e=>(0,V.jsx)(`p`,{children:e},e)),(0,V.jsxs)(`div`,{className:`passkey-actions`,children:[(0,V.jsx)(`button`,{onClick:()=>i(!1),children:`Cancel`}),(0,V.jsx)(`button`,{className:`primary`,autoFocus:!0,onClick:()=>i(!0),children:r.go})]})]})})}_e(VE),ct(document.documentElement,ot(localStorage)),window.addEventListener(`storage`,e=>{e.key===`ledung.theme`?ct(document.documentElement,at(e.newValue)):e.key===null&&ct(document.documentElement,ot(localStorage))}),fn(),nE(window),(0,y.createRoot)(document.getElementById(`root`)).render((0,V.jsxs)(v.StrictMode,{children:[(0,V.jsx)(EE,{}),(0,V.jsx)(HE,{})]}));export{o as n,l as r,nv as t};
|