vibe-coding-master 0.7.44 → 0.7.46

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.
@@ -48,7 +48,7 @@ Error generating stack: `+a.message+`
48
48
  `+a.stack}}var Rt=Object.prototype.hasOwnProperty,jt=t.unstable_scheduleCallback,re=t.unstable_cancelCallback,ve=t.unstable_shouldYield,ke=t.unstable_requestPaint,nt=t.unstable_now,ot=t.unstable_getCurrentPriorityLevel,ce=t.unstable_ImmediatePriority,Se=t.unstable_UserBlockingPriority,Ee=t.unstable_NormalPriority,Oe=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,yt=t.log,Pe=t.unstable_setDisableYieldValue,wt=null,bt=null;function Nt(e){if(typeof yt=="function"&&Pe(e),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(wt,e)}catch{}}var it=Math.clz32?Math.clz32:Cr,Wt=Math.log,rn=Math.LN2;function Cr(e){return e>>>=0,e===0?32:31-(Wt(e)/rn|0)|0}var mi=256,gi=262144,Pi=4194304;function zn(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Fi(e,n,i){var a=e.pendingLanes;if(a===0)return 0;var p=0,x=e.suspendedLanes,B=e.pingedLanes;e=e.warmLanes;var F=a&134217727;return F!==0?(a=F&~x,a!==0?p=zn(a):(B&=F,B!==0?p=zn(B):i||(i=F&~e,i!==0&&(p=zn(i))))):(F=a&~x,F!==0?p=zn(F):B!==0?p=zn(B):i||(i=a&~e,i!==0&&(p=zn(i)))),p===0?0:n!==0&&n!==p&&(n&x)===0&&(x=p&-p,i=n&-n,x>=i||x===32&&(i&4194048)!==0)?n:p}function Jn(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function si(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 sn(){var e=Pi;return Pi<<=1,(Pi&62914560)===0&&(Pi=4194304),e}function ai(e){for(var n=[],i=0;31>i;i++)n.push(e);return n}function In(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qi(e,n,i,a,p,x){var B=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var F=e.entanglements,X=e.expirationTimes,ae=e.hiddenUpdates;for(i=B&~i;0<i;){var de=31-it(i),_e=1<<de;F[de]=0,X[de]=-1;var oe=ae[de];if(oe!==null)for(ae[de]=null,de=0;de<oe.length;de++){var ue=oe[de];ue!==null&&(ue.lane&=-536870913)}i&=~_e}a!==0&&_i(e,a,0),x!==0&&p===0&&e.tag!==0&&(e.suspendedLanes|=x&~(B&~n))}function _i(e,n,i){e.pendingLanes|=n,e.suspendedLanes&=~n;var a=31-it(n);e.entangledLanes|=n,e.entanglements[a]=e.entanglements[a]|1073741824|i&261930}function vi(e,n){var i=e.entangledLanes|=n;for(e=e.entanglements;i;){var a=31-it(i),p=1<<a;p&n|e[a]&n&&(e[a]|=n),i&=~p}}function yi(e,n){var i=n&-n;return i=(i&42)!==0?1:wn(i),(i&(e.suspendedLanes|n))!==0?0:i}function wn(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 Pt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function li(){var e=Y.p;return e!==0?e:(e=window.event,e===void 0?32:Am(e.type))}function hn(e,n){var i=Y.p;try{return Y.p=e,n()}finally{Y.p=i}}var Kt=Math.random().toString(36).slice(2),mt="__reactFiber$"+Kt,ct="__reactProps$"+Kt,Ht="__reactContainer$"+Kt,$i="__reactEvents$"+Kt,Ge="__reactListeners$"+Kt,Un="__reactHandles$"+Kt,dl="__reactResources$"+Kt,wr="__reactMarker$"+Kt;function es(e){delete e[mt],delete e[ct],delete e[$i],delete e[Ge],delete e[Un]}function xn(e){var n=e[mt];if(n)return n;for(var i=e.parentNode;i;){if(n=i[Ht]||i[mt]){if(i=n.alternate,n.child!==null||i!==null&&i.child!==null)for(e=hm(e);e!==null;){if(i=e[mt])return i;e=hm(e)}return n}e=i,i=e.parentNode}return null}function Si(e){if(e=e[mt]||e[Ht]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function xr(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(l(33))}function Gi(e){var n=e[dl];return n||(n=e[dl]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function kt(e){e[wr]=!0}var pl=new Set,Vi={};function oi(e,n){fn(e,n),fn(e+"Capture",n)}function fn(e,n){for(Vi[e]=n,e=0;e<n.length;e++)pl.add(n[e])}var ml=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]*$"),ts={},Qs={};function gl(e){return Rt.call(Qs,e)?!0:Rt.call(ts,e)?!1:ml.test(e)?Qs[e]=!0:(ts[e]=!0,!1)}function Er(e,n,i){if(gl(n))if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var a=n.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+i)}}function bi(e,n,i){if(i===null)e.removeAttribute(n);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+i)}}function Pn(e,n,i,a){if(a===null)e.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(n,i,""+a)}}function Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Z(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function dn(e,n,i){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var p=a.get,x=a.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return p.call(this)},set:function(B){i=""+B,x.call(this,B)}}),Object.defineProperty(e,n,{enumerable:a.enumerable}),{getValue:function(){return i},setValue:function(B){i=""+B},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function kr(e){if(!e._valueTracker){var n=Z(e)?"checked":"value";e._valueTracker=dn(e,n,""+e[n])}}function Js(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var i=n.getValue(),a="";return e&&(a=Z(e)?e.checked?"true":"false":e.value),e=a,e!==i?(n.setValue(e),!0):!1}function ns(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Wo=/[\n"\\]/g;function pn(e){return e.replace(Wo,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function is(e,n,i,a,p,x,B,F){e.name="",B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?e.type=B:e.removeAttribute("type"),n!=null?B==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Yt(n)):e.value!==""+Yt(n)&&(e.value=""+Yt(n)):B!=="submit"&&B!=="reset"||e.removeAttribute("value"),n!=null?Zs(e,B,Yt(n)):i!=null?Zs(e,B,Yt(i)):a!=null&&e.removeAttribute("value"),p==null&&x!=null&&(e.defaultChecked=!!x),p!=null&&(e.checked=p&&typeof p!="function"&&typeof p!="symbol"),F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?e.name=""+Yt(F):e.removeAttribute("name")}function _l(e,n,i,a,p,x,B,F){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.type=x),n!=null||i!=null){if(!(x!=="submit"&&x!=="reset"||n!=null)){kr(e);return}i=i!=null?""+Yt(i):"",n=n!=null?""+Yt(n):i,F||n===e.value||(e.value=n),e.defaultValue=n}a=a??p,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=F?e.checked:!!a,e.defaultChecked=!!a,B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"&&(e.name=B),kr(e)}function Zs(e,n,i){n==="number"&&ns(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Zn(e,n,i,a){if(e=e.options,n){n={};for(var p=0;p<i.length;p++)n["$"+i[p]]=!0;for(i=0;i<e.length;i++)p=n.hasOwnProperty("$"+e[i].value),e[i].selected!==p&&(e[i].selected=p),p&&a&&(e[i].defaultSelected=!0)}else{for(i=""+Yt(i),n=null,p=0;p<e.length;p++){if(e[p].value===i){e[p].selected=!0,a&&(e[p].defaultSelected=!0);return}n!==null||e[p].disabled||(n=e[p])}n!==null&&(n.selected=!0)}}function Ft(e,n,i){if(n!=null&&(n=""+Yt(n),n!==e.value&&(e.value=n),i==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=i!=null?""+Yt(i):""}function Fn(e,n,i,a){if(n==null){if(a!=null){if(i!=null)throw Error(l(92));if(K(a)){if(1<a.length)throw Error(l(93));a=a[0]}i=a}i==null&&(i=""),n=i}i=Yt(n),e.defaultValue=i,a=e.textContent,a===i&&a!==""&&a!==null&&(e.value=a),kr(e)}function Ci(e,n){if(n){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=n;return}}e.textContent=n}var vl=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 rs(e,n,i){var a=n.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?a?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":a?e.setProperty(n,i):typeof i!="number"||i===0||vl.has(n)?n==="float"?e.cssFloat=i:e[n]=(""+i).trim():e[n]=i+"px"}function yl(e,n,i){if(n!=null&&typeof n!="object")throw Error(l(62));if(e=e.style,i!=null){for(var a in i)!i.hasOwnProperty(a)||n!=null&&n.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var p in n)a=n[p],n.hasOwnProperty(p)&&i[p]!==a&&rs(e,p,a)}else for(var x in n)n.hasOwnProperty(x)&&rs(e,x,n[x])}function ea(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 Ko=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Yo=/^[\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 ss(e){return Yo.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Xt(){}var Ar=null;function Tr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var En=null,Wi=null;function ta(e){var n=Si(e);if(n&&(e=n.stateNode)){var i=e[ct]||null;e:switch(e=n.stateNode,n.type){case"input":if(is(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),n=i.name,i.type==="radio"&&n!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+pn(""+n)+'"][type="radio"]'),n=0;n<i.length;n++){var a=i[n];if(a!==e&&a.form===e.form){var p=a[ct]||null;if(!p)throw Error(l(90));is(a,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(n=0;n<i.length;n++)a=i[n],a.form===e.form&&Js(a)}break e;case"textarea":Ft(e,i.value,i.defaultValue);break e;case"select":n=i.value,n!=null&&Zn(e,!!i.multiple,n,!1)}}}var Rr=!1;function na(e,n,i){if(Rr)return e(n,i);Rr=!0;try{var a=e(n);return a}finally{if(Rr=!1,(En!==null||Wi!==null)&&(no(),En&&(n=En,e=Wi,Wi=En=null,ta(n),e)))for(n=0;n<e.length;n++)ta(e[n])}}function Ki(e,n){var i=e.stateNode;if(i===null)return null;var a=i[ct]||null;if(a===null)return null;i=a[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(l(231,n,typeof i));return i}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),as=!1;if(Qt)try{var kn={};Object.defineProperty(kn,"passive",{get:function(){as=!0}}),window.addEventListener("test",kn,kn),window.removeEventListener("test",kn,kn)}catch{as=!1}var an=null,ia=null,ls=null;function ra(){if(ls)return ls;var e,n=ia,i=n.length,a,p="value"in an?an.value:an.textContent,x=p.length;for(e=0;e<i&&n[e]===p[e];e++);var B=i-e;for(a=1;a<=B&&n[i-a]===p[x-a];a++);return ls=p.slice(e,1<a?1-a:void 0)}function os(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Jt(){return!0}function cs(){return!1}function It(e){function n(i,a,p,x,B){this._reactName=i,this._targetInst=p,this.type=a,this.nativeEvent=x,this.target=B,this.currentTarget=null;for(var F in e)e.hasOwnProperty(F)&&(i=e[F],this[F]=i?i(x):x[F]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Jt:cs,this.isPropagationStopped=cs,this}return h(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Jt)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Jt)},persist:function(){},isPersistent:Jt}),n}var ei={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},us=It(ei),Te=h({},ei,{view:0,detail:0}),Xo=It(Te),sa,aa,Dr,ln=h({},Te,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Zo,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!==Dr&&(Dr&&e.type==="mousemove"?(sa=e.screenX-Dr.screenX,aa=e.screenY-Dr.screenY):aa=sa=0,Dr=e),sa)},movementY:function(e){return"movementY"in e?e.movementY:aa}}),hs=It(ln),Sl=h({},ln,{dataTransfer:0}),la=It(Sl),Qo=h({},Te,{relatedTarget:0}),G=It(Qo),fe=h({},ei,{animationName:0,elapsedTime:0,pseudoElement:0}),Ye=It(fe),on=h({},ei,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),wi=It(on),Jo=h({},ei,{data:0}),lf=It(Jo),Gv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vv={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"},Wv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kv(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Wv[e])?!!n[e]:!1}function Zo(){return Kv}var Yv=h({},Te,{key:function(e){if(e.key){var n=Gv[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=os(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Zo,charCode:function(e){return e.type==="keypress"?os(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?os(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xv=It(Yv),Qv=h({},ln,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),of=It(Qv),Jv=h({},Te,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Zo}),Zv=It(Jv),ey=h({},ei,{propertyName:0,elapsedTime:0,pseudoElement:0}),ty=It(ey),ny=h({},ln,{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}),iy=It(ny),ry=h({},ei,{newState:0,oldState:0}),sy=It(ry),ay=[9,13,27,32],ec=Qt&&"CompositionEvent"in window,oa=null;Qt&&"documentMode"in document&&(oa=document.documentMode);var ly=Qt&&"TextEvent"in window&&!oa,cf=Qt&&(!ec||oa&&8<oa&&11>=oa),uf=" ",hf=!1;function ff(e,n){switch(e){case"keyup":return ay.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function df(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var fs=!1;function oy(e,n){switch(e){case"compositionend":return df(n);case"keypress":return n.which!==32?null:(hf=!0,uf);case"textInput":return e=n.data,e===uf&&hf?null:e;default:return null}}function cy(e,n){if(fs)return e==="compositionend"||!ec&&ff(e,n)?(e=ra(),ls=ia=an=null,fs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return cf&&n.locale!=="ko"?null:n.data;default:return null}}var uy={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 pf(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!uy[e.type]:n==="textarea"}function mf(e,n,i,a){En?Wi?Wi.push(a):Wi=[a]:En=a,n=co(n,"onChange"),0<n.length&&(i=new us("onChange","change",null,i,a),e.push({event:i,listeners:n}))}var ca=null,ua=null;function hy(e){Qp(e,0)}function bl(e){var n=xr(e);if(Js(n))return e}function gf(e,n){if(e==="change")return n}var _f=!1;if(Qt){var tc;if(Qt){var nc="oninput"in document;if(!nc){var vf=document.createElement("div");vf.setAttribute("oninput","return;"),nc=typeof vf.oninput=="function"}tc=nc}else tc=!1;_f=tc&&(!document.documentMode||9<document.documentMode)}function yf(){ca&&(ca.detachEvent("onpropertychange",Sf),ua=ca=null)}function Sf(e){if(e.propertyName==="value"&&bl(ua)){var n=[];mf(n,ua,e,Tr(e)),na(hy,n)}}function fy(e,n,i){e==="focusin"?(yf(),ca=n,ua=i,ca.attachEvent("onpropertychange",Sf)):e==="focusout"&&yf()}function dy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return bl(ua)}function py(e,n){if(e==="click")return bl(n)}function my(e,n){if(e==="input"||e==="change")return bl(n)}function gy(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var An=typeof Object.is=="function"?Object.is:gy;function ha(e,n){if(An(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var i=Object.keys(e),a=Object.keys(n);if(i.length!==a.length)return!1;for(a=0;a<i.length;a++){var p=i[a];if(!Rt.call(n,p)||!An(e[p],n[p]))return!1}return!0}function bf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cf(e,n){var i=bf(e);e=0;for(var a;i;){if(i.nodeType===3){if(a=e+i.textContent.length,e<=n&&a>=n)return{node:i,offset:n-e};e=a}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=bf(i)}}function wf(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?wf(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function xf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ns(e.document);n instanceof e.HTMLIFrameElement;){try{var i=typeof n.contentWindow.location.href=="string"}catch{i=!1}if(i)e=n.contentWindow;else break;n=ns(e.document)}return n}function ic(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var _y=Qt&&"documentMode"in document&&11>=document.documentMode,ds=null,rc=null,fa=null,sc=!1;function Ef(e,n,i){var a=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;sc||ds==null||ds!==ns(a)||(a=ds,"selectionStart"in a&&ic(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),fa&&ha(fa,a)||(fa=a,a=co(rc,"onSelect"),0<a.length&&(n=new us("onSelect","select",null,n,i),e.push({event:n,listeners:a}),n.target=ds)))}function Mr(e,n){var i={};return i[e.toLowerCase()]=n.toLowerCase(),i["Webkit"+e]="webkit"+n,i["Moz"+e]="moz"+n,i}var ps={animationend:Mr("Animation","AnimationEnd"),animationiteration:Mr("Animation","AnimationIteration"),animationstart:Mr("Animation","AnimationStart"),transitionrun:Mr("Transition","TransitionRun"),transitionstart:Mr("Transition","TransitionStart"),transitioncancel:Mr("Transition","TransitionCancel"),transitionend:Mr("Transition","TransitionEnd")},ac={},kf={};Qt&&(kf=document.createElement("div").style,"AnimationEvent"in window||(delete ps.animationend.animation,delete ps.animationiteration.animation,delete ps.animationstart.animation),"TransitionEvent"in window||delete ps.transitionend.transition);function Lr(e){if(ac[e])return ac[e];if(!ps[e])return e;var n=ps[e],i;for(i in n)if(n.hasOwnProperty(i)&&i in kf)return ac[e]=n[i];return e}var Af=Lr("animationend"),Tf=Lr("animationiteration"),Rf=Lr("animationstart"),vy=Lr("transitionrun"),yy=Lr("transitionstart"),Sy=Lr("transitioncancel"),Df=Lr("transitionend"),Mf=new Map,lc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");lc.push("scrollEnd");function ti(e,n){Mf.set(e,n),oi(n,[e])}var Cl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qn=[],ms=0,oc=0;function wl(){for(var e=ms,n=oc=ms=0;n<e;){var i=qn[n];qn[n++]=null;var a=qn[n];qn[n++]=null;var p=qn[n];qn[n++]=null;var x=qn[n];if(qn[n++]=null,a!==null&&p!==null){var B=a.pending;B===null?p.next=p:(p.next=B.next,B.next=p),a.pending=p}x!==0&&Lf(i,p,x)}}function xl(e,n,i,a){qn[ms++]=e,qn[ms++]=n,qn[ms++]=i,qn[ms++]=a,oc|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function cc(e,n,i,a){return xl(e,n,i,a),El(e)}function Or(e,n){return xl(e,null,null,n),El(e)}function Lf(e,n,i){e.lanes|=i;var a=e.alternate;a!==null&&(a.lanes|=i);for(var p=!1,x=e.return;x!==null;)x.childLanes|=i,a=x.alternate,a!==null&&(a.childLanes|=i),x.tag===22&&(e=x.stateNode,e===null||e._visibility&1||(p=!0)),e=x,x=x.return;return e.tag===3?(x=e.stateNode,p&&n!==null&&(p=31-it(i),e=x.hiddenUpdates,a=e[p],a===null?e[p]=[n]:a.push(n),n.lane=i|536870912),x):null}function El(e){if(50<Ba)throw Ba=0,vu=null,Error(l(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var gs={};function by(e,n,i,a){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Tn(e,n,i,a){return new by(e,n,i,a)}function uc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function xi(e,n){var i=e.alternate;return i===null?(i=Tn(e.tag,n,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=n,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,n=e.dependencies,i.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Of(e,n){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,n=i.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function kl(e,n,i,a,p,x){var B=0;if(a=e,typeof e=="function")uc(e)&&(B=1);else if(typeof e=="string")B=k0(e,i,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case M:return e=Tn(31,i,n,p),e.elementType=M,e.lanes=x,e;case k:return Br(i.children,p,x,n);case y:B=8,p|=24;break;case _:return e=Tn(12,i,n,p|2),e.elementType=_,e.lanes=x,e;case O:return e=Tn(13,i,n,p),e.elementType=O,e.lanes=x,e;case R:return e=Tn(19,i,n,p),e.elementType=R,e.lanes=x,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case b:B=10;break e;case v:B=9;break e;case E:B=11;break e;case D:B=14;break e;case A:B=16,a=null;break e}B=29,i=Error(l(130,e===null?"null":typeof e,"")),a=null}return n=Tn(B,i,n,p),n.elementType=e,n.type=a,n.lanes=x,n}function Br(e,n,i,a){return e=Tn(7,e,a,n),e.lanes=i,e}function hc(e,n,i){return e=Tn(6,e,null,n),e.lanes=i,e}function Bf(e){var n=Tn(18,null,null,0);return n.stateNode=e,n}function fc(e,n,i){return n=Tn(4,e.children!==null?e.children:[],e.key,n),n.lanes=i,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var jf=new WeakMap;function $n(e,n){if(typeof e=="object"&&e!==null){var i=jf.get(e);return i!==void 0?i:(n={value:e,source:n,stack:Ct(n)},jf.set(e,n),n)}return{value:e,source:n,stack:Ct(n)}}var _s=[],vs=0,Al=null,da=0,Gn=[],Vn=0,Yi=null,ci=1,ui="";function Ei(e,n){_s[vs++]=da,_s[vs++]=Al,Al=e,da=n}function Nf(e,n,i){Gn[Vn++]=ci,Gn[Vn++]=ui,Gn[Vn++]=Yi,Yi=e;var a=ci;e=ui;var p=32-it(a)-1;a&=~(1<<p),i+=1;var x=32-it(n)+p;if(30<x){var B=p-p%5;x=(a&(1<<B)-1).toString(32),a>>=B,p-=B,ci=1<<32-it(n)+p|i<<p|a,ui=x+e}else ci=1<<x|i<<p|a,ui=e}function dc(e){e.return!==null&&(Ei(e,1),Nf(e,1,0))}function pc(e){for(;e===Al;)Al=_s[--vs],_s[vs]=null,da=_s[--vs],_s[vs]=null;for(;e===Yi;)Yi=Gn[--Vn],Gn[Vn]=null,ui=Gn[--Vn],Gn[Vn]=null,ci=Gn[--Vn],Gn[Vn]=null}function Hf(e,n){Gn[Vn++]=ci,Gn[Vn++]=ui,Gn[Vn++]=Yi,ci=n.id,ui=n.overflow,Yi=e}var qt=null,_t=null,Je=!1,Xi=null,Wn=!1,mc=Error(l(519));function Qi(e){var n=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pa($n(n,e)),mc}function zf(e){var n=e.stateNode,i=e.type,a=e.memoizedProps;switch(n[mt]=e,n[ct]=a,i){case"dialog":We("cancel",n),We("close",n);break;case"iframe":case"object":case"embed":We("load",n);break;case"video":case"audio":for(i=0;i<Na.length;i++)We(Na[i],n);break;case"source":We("error",n);break;case"img":case"image":case"link":We("error",n),We("load",n);break;case"details":We("toggle",n);break;case"input":We("invalid",n),_l(n,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":We("invalid",n);break;case"textarea":We("invalid",n),Fn(n,a.value,a.defaultValue,a.children)}i=a.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||n.textContent===""+i||a.suppressHydrationWarning===!0||tm(n.textContent,i)?(a.popover!=null&&(We("beforetoggle",n),We("toggle",n)),a.onScroll!=null&&We("scroll",n),a.onScrollEnd!=null&&We("scrollend",n),a.onClick!=null&&(n.onclick=Xt),n=!0):n=!1,n||Qi(e,!0)}function If(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 31:case 13:Wn=!1;return;case 27:case 3:Wn=!0;return;default:qt=qt.return}}function ys(e){if(e!==qt)return!1;if(!Je)return If(e),Je=!0,!1;var n=e.tag,i;if((i=n!==3&&n!==27)&&((i=n===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Ou(e.type,e.memoizedProps)),i=!i),i&&_t&&Qi(e),If(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));_t=um(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));_t=um(e)}else n===27?(n=_t,hr(e.type)?(e=zu,zu=null,_t=e):_t=n):_t=qt?Yn(e.stateNode.nextSibling):null;return!0}function jr(){_t=qt=null,Je=!1}function gc(){var e=Xi;return e!==null&&(vn===null?vn=e:vn.push.apply(vn,e),Xi=null),e}function pa(e){Xi===null?Xi=[e]:Xi.push(e)}var _c=N(null),Nr=null,ki=null;function Ji(e,n,i){I(_c,n._currentValue),n._currentValue=i}function Ai(e){e._currentValue=_c.current,q(_c)}function vc(e,n,i){for(;e!==null;){var a=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,a!==null&&(a.childLanes|=n)):a!==null&&(a.childLanes&n)!==n&&(a.childLanes|=n),e===i)break;e=e.return}}function yc(e,n,i,a){var p=e.child;for(p!==null&&(p.return=e);p!==null;){var x=p.dependencies;if(x!==null){var B=p.child;x=x.firstContext;e:for(;x!==null;){var F=x;x=p;for(var X=0;X<n.length;X++)if(F.context===n[X]){x.lanes|=i,F=x.alternate,F!==null&&(F.lanes|=i),vc(x.return,i,e),a||(B=null);break e}x=F.next}}else if(p.tag===18){if(B=p.return,B===null)throw Error(l(341));B.lanes|=i,x=B.alternate,x!==null&&(x.lanes|=i),vc(B,i,e),B=null}else B=p.child;if(B!==null)B.return=p;else for(B=p;B!==null;){if(B===e){B=null;break}if(p=B.sibling,p!==null){p.return=B.return,B=p;break}B=B.return}p=B}}function Ss(e,n,i,a){e=null;for(var p=n,x=!1;p!==null;){if(!x){if((p.flags&524288)!==0)x=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var B=p.alternate;if(B===null)throw Error(l(387));if(B=B.memoizedProps,B!==null){var F=p.type;An(p.pendingProps.value,B.value)||(e!==null?e.push(F):e=[F])}}else if(p===Q.current){if(B=p.alternate,B===null)throw Error(l(387));B.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(e!==null?e.push(Pa):e=[Pa])}p=p.return}e!==null&&yc(n,e,i,a),n.flags|=262144}function Tl(e){for(e=e.firstContext;e!==null;){if(!An(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hr(e){Nr=e,ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $t(e){return Uf(Nr,e)}function Rl(e,n){return Nr===null&&Hr(e),Uf(e,n)}function Uf(e,n){var i=n._currentValue;if(n={context:n,memoizedValue:i,next:null},ki===null){if(e===null)throw Error(l(308));ki=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else ki=ki.next=n;return i}var Cy=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(i,a){e.push(a)}};this.abort=function(){n.aborted=!0,e.forEach(function(i){return i()})}},wy=t.unstable_scheduleCallback,xy=t.unstable_NormalPriority,Dt={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sc(){return{controller:new Cy,data:new Map,refCount:0}}function ma(e){e.refCount--,e.refCount===0&&wy(xy,function(){e.controller.abort()})}var ga=null,bc=0,bs=0,Cs=null;function Ey(e,n){if(ga===null){var i=ga=[];bc=0,bs=xu(),Cs={status:"pending",value:void 0,then:function(a){i.push(a)}}}return bc++,n.then(Pf,Pf),n}function Pf(){if(--bc===0&&ga!==null){Cs!==null&&(Cs.status="fulfilled");var e=ga;ga=null,bs=0,Cs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function ky(e,n){var i=[],a={status:"pending",value:null,reason:null,then:function(p){i.push(p)}};return e.then(function(){a.status="fulfilled",a.value=n;for(var p=0;p<i.length;p++)(0,i[p])(n)},function(p){for(a.status="rejected",a.reason=p,p=0;p<i.length;p++)(0,i[p])(void 0)}),a}var Ff=V.S;V.S=function(e,n){Ep=nt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Ey(e,n),Ff!==null&&Ff(e,n)};var zr=N(null);function Cc(){var e=zr.current;return e!==null?e:dt.pooledCache}function Dl(e,n){n===null?I(zr,zr.current):I(zr,n.pool)}function qf(){var e=Cc();return e===null?null:{parent:Dt._currentValue,pool:e}}var ws=Error(l(460)),wc=Error(l(474)),Ml=Error(l(542)),Ll={then:function(){}};function $f(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Gf(e,n,i){switch(i=e[i],i===void 0?e.push(n):i!==n&&(n.then(Xt,Xt),n=i),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Wf(e),e;default:if(typeof n.status=="string")n.then(Xt,Xt);else{if(e=dt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=n,e.status="pending",e.then(function(a){if(n.status==="pending"){var p=n;p.status="fulfilled",p.value=a}},function(a){if(n.status==="pending"){var p=n;p.status="rejected",p.reason=a}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Wf(e),e}throw Ur=n,ws}}function Ir(e){try{var n=e._init;return n(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Ur=i,ws):i}}var Ur=null;function Vf(){if(Ur===null)throw Error(l(459));var e=Ur;return Ur=null,e}function Wf(e){if(e===ws||e===Ml)throw Error(l(483))}var xs=null,_a=0;function Ol(e){var n=_a;return _a+=1,xs===null&&(xs=[]),Gf(xs,e,n)}function va(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Bl(e,n){throw n.$$typeof===S?Error(l(525)):(e=Object.prototype.toString.call(n),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Kf(e){function n(ne,J){if(e){var se=ne.deletions;se===null?(ne.deletions=[J],ne.flags|=16):se.push(J)}}function i(ne,J){if(!e)return null;for(;J!==null;)n(ne,J),J=J.sibling;return null}function a(ne){for(var J=new Map;ne!==null;)ne.key!==null?J.set(ne.key,ne):J.set(ne.index,ne),ne=ne.sibling;return J}function p(ne,J){return ne=xi(ne,J),ne.index=0,ne.sibling=null,ne}function x(ne,J,se){return ne.index=se,e?(se=ne.alternate,se!==null?(se=se.index,se<J?(ne.flags|=67108866,J):se):(ne.flags|=67108866,J)):(ne.flags|=1048576,J)}function B(ne){return e&&ne.alternate===null&&(ne.flags|=67108866),ne}function F(ne,J,se,me){return J===null||J.tag!==6?(J=hc(se,ne.mode,me),J.return=ne,J):(J=p(J,se),J.return=ne,J)}function X(ne,J,se,me){var Me=se.type;return Me===k?de(ne,J,se.props.children,me,se.key):J!==null&&(J.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===A&&Ir(Me)===J.type)?(J=p(J,se.props),va(J,se),J.return=ne,J):(J=kl(se.type,se.key,se.props,null,ne.mode,me),va(J,se),J.return=ne,J)}function ae(ne,J,se,me){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=fc(se,ne.mode,me),J.return=ne,J):(J=p(J,se.children||[]),J.return=ne,J)}function de(ne,J,se,me,Me){return J===null||J.tag!==7?(J=Br(se,ne.mode,me,Me),J.return=ne,J):(J=p(J,se),J.return=ne,J)}function _e(ne,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=hc(""+J,ne.mode,se),J.return=ne,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case w:return se=kl(J.type,J.key,J.props,null,ne.mode,se),va(se,J),se.return=ne,se;case T:return J=fc(J,ne.mode,se),J.return=ne,J;case A:return J=Ir(J),_e(ne,J,se)}if(K(J)||U(J))return J=Br(J,ne.mode,se,null),J.return=ne,J;if(typeof J.then=="function")return _e(ne,Ol(J),se);if(J.$$typeof===b)return _e(ne,Rl(ne,J),se);Bl(ne,J)}return null}function oe(ne,J,se,me){var Me=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Me!==null?null:F(ne,J,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return se.key===Me?X(ne,J,se,me):null;case T:return se.key===Me?ae(ne,J,se,me):null;case A:return se=Ir(se),oe(ne,J,se,me)}if(K(se)||U(se))return Me!==null?null:de(ne,J,se,me,null);if(typeof se.then=="function")return oe(ne,J,Ol(se),me);if(se.$$typeof===b)return oe(ne,J,Rl(ne,se),me);Bl(ne,se)}return null}function ue(ne,J,se,me,Me){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return ne=ne.get(se)||null,F(J,ne,""+me,Me);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case w:return ne=ne.get(me.key===null?se:me.key)||null,X(J,ne,me,Me);case T:return ne=ne.get(me.key===null?se:me.key)||null,ae(J,ne,me,Me);case A:return me=Ir(me),ue(ne,J,se,me,Me)}if(K(me)||U(me))return ne=ne.get(se)||null,de(J,ne,me,Me,null);if(typeof me.then=="function")return ue(ne,J,se,Ol(me),Me);if(me.$$typeof===b)return ue(ne,J,se,Rl(J,me),Me);Bl(J,me)}return null}function Ae(ne,J,se,me){for(var Me=null,et=null,Re=J,Fe=J=0,Qe=null;Re!==null&&Fe<se.length;Fe++){Re.index>Fe?(Qe=Re,Re=null):Qe=Re.sibling;var tt=oe(ne,Re,se[Fe],me);if(tt===null){Re===null&&(Re=Qe);break}e&&Re&&tt.alternate===null&&n(ne,Re),J=x(tt,J,Fe),et===null?Me=tt:et.sibling=tt,et=tt,Re=Qe}if(Fe===se.length)return i(ne,Re),Je&&Ei(ne,Fe),Me;if(Re===null){for(;Fe<se.length;Fe++)Re=_e(ne,se[Fe],me),Re!==null&&(J=x(Re,J,Fe),et===null?Me=Re:et.sibling=Re,et=Re);return Je&&Ei(ne,Fe),Me}for(Re=a(Re);Fe<se.length;Fe++)Qe=ue(Re,ne,Fe,se[Fe],me),Qe!==null&&(e&&Qe.alternate!==null&&Re.delete(Qe.key===null?Fe:Qe.key),J=x(Qe,J,Fe),et===null?Me=Qe:et.sibling=Qe,et=Qe);return e&&Re.forEach(function(gr){return n(ne,gr)}),Je&&Ei(ne,Fe),Me}function je(ne,J,se,me){if(se==null)throw Error(l(151));for(var Me=null,et=null,Re=J,Fe=J=0,Qe=null,tt=se.next();Re!==null&&!tt.done;Fe++,tt=se.next()){Re.index>Fe?(Qe=Re,Re=null):Qe=Re.sibling;var gr=oe(ne,Re,tt.value,me);if(gr===null){Re===null&&(Re=Qe);break}e&&Re&&gr.alternate===null&&n(ne,Re),J=x(gr,J,Fe),et===null?Me=gr:et.sibling=gr,et=gr,Re=Qe}if(tt.done)return i(ne,Re),Je&&Ei(ne,Fe),Me;if(Re===null){for(;!tt.done;Fe++,tt=se.next())tt=_e(ne,tt.value,me),tt!==null&&(J=x(tt,J,Fe),et===null?Me=tt:et.sibling=tt,et=tt);return Je&&Ei(ne,Fe),Me}for(Re=a(Re);!tt.done;Fe++,tt=se.next())tt=ue(Re,ne,Fe,tt.value,me),tt!==null&&(e&&tt.alternate!==null&&Re.delete(tt.key===null?Fe:tt.key),J=x(tt,J,Fe),et===null?Me=tt:et.sibling=tt,et=tt);return e&&Re.forEach(function(H0){return n(ne,H0)}),Je&&Ei(ne,Fe),Me}function ft(ne,J,se,me){if(typeof se=="object"&&se!==null&&se.type===k&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case w:e:{for(var Me=se.key;J!==null;){if(J.key===Me){if(Me=se.type,Me===k){if(J.tag===7){i(ne,J.sibling),me=p(J,se.props.children),me.return=ne,ne=me;break e}}else if(J.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===A&&Ir(Me)===J.type){i(ne,J.sibling),me=p(J,se.props),va(me,se),me.return=ne,ne=me;break e}i(ne,J);break}else n(ne,J);J=J.sibling}se.type===k?(me=Br(se.props.children,ne.mode,me,se.key),me.return=ne,ne=me):(me=kl(se.type,se.key,se.props,null,ne.mode,me),va(me,se),me.return=ne,ne=me)}return B(ne);case T:e:{for(Me=se.key;J!==null;){if(J.key===Me)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){i(ne,J.sibling),me=p(J,se.children||[]),me.return=ne,ne=me;break e}else{i(ne,J);break}else n(ne,J);J=J.sibling}me=fc(se,ne.mode,me),me.return=ne,ne=me}return B(ne);case A:return se=Ir(se),ft(ne,J,se,me)}if(K(se))return Ae(ne,J,se,me);if(U(se)){if(Me=U(se),typeof Me!="function")throw Error(l(150));return se=Me.call(se),je(ne,J,se,me)}if(typeof se.then=="function")return ft(ne,J,Ol(se),me);if(se.$$typeof===b)return ft(ne,J,Rl(ne,se),me);Bl(ne,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(i(ne,J.sibling),me=p(J,se),me.return=ne,ne=me):(i(ne,J),me=hc(se,ne.mode,me),me.return=ne,ne=me),B(ne)):i(ne,J)}return function(ne,J,se,me){try{_a=0;var Me=ft(ne,J,se,me);return xs=null,Me}catch(Re){if(Re===ws||Re===Ml)throw Re;var et=Tn(29,Re,null,ne.mode);return et.lanes=me,et.return=ne,et}finally{}}}var Pr=Kf(!0),Yf=Kf(!1),Zi=!1;function xc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ec(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function er(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function tr(e,n,i){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(rt&2)!==0){var p=a.pending;return p===null?n.next=n:(n.next=p.next,p.next=n),a.pending=n,n=El(e),Lf(e,null,i),n}return xl(e,a,n,i),El(e)}function ya(e,n,i){if(n=n.updateQueue,n!==null&&(n=n.shared,(i&4194048)!==0)){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,vi(e,i)}}function kc(e,n){var i=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,i===a)){var p=null,x=null;if(i=i.firstBaseUpdate,i!==null){do{var B={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};x===null?p=x=B:x=x.next=B,i=i.next}while(i!==null);x===null?p=x=n:x=x.next=n}else p=x=n;i={baseState:a.baseState,firstBaseUpdate:p,lastBaseUpdate:x,shared:a.shared,callbacks:a.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=n:e.next=n,i.lastBaseUpdate=n}var Ac=!1;function Sa(){if(Ac){var e=Cs;if(e!==null)throw e}}function ba(e,n,i,a){Ac=!1;var p=e.updateQueue;Zi=!1;var x=p.firstBaseUpdate,B=p.lastBaseUpdate,F=p.shared.pending;if(F!==null){p.shared.pending=null;var X=F,ae=X.next;X.next=null,B===null?x=ae:B.next=ae,B=X;var de=e.alternate;de!==null&&(de=de.updateQueue,F=de.lastBaseUpdate,F!==B&&(F===null?de.firstBaseUpdate=ae:F.next=ae,de.lastBaseUpdate=X))}if(x!==null){var _e=p.baseState;B=0,de=ae=X=null,F=x;do{var oe=F.lane&-536870913,ue=oe!==F.lane;if(ue?(Xe&oe)===oe:(a&oe)===oe){oe!==0&&oe===bs&&(Ac=!0),de!==null&&(de=de.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var Ae=e,je=F;oe=n;var ft=i;switch(je.tag){case 1:if(Ae=je.payload,typeof Ae=="function"){_e=Ae.call(ft,_e,oe);break e}_e=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=je.payload,oe=typeof Ae=="function"?Ae.call(ft,_e,oe):Ae,oe==null)break e;_e=h({},_e,oe);break e;case 2:Zi=!0}}oe=F.callback,oe!==null&&(e.flags|=64,ue&&(e.flags|=8192),ue=p.callbacks,ue===null?p.callbacks=[oe]:ue.push(oe))}else ue={lane:oe,tag:F.tag,payload:F.payload,callback:F.callback,next:null},de===null?(ae=de=ue,X=_e):de=de.next=ue,B|=oe;if(F=F.next,F===null){if(F=p.shared.pending,F===null)break;ue=F,F=ue.next,ue.next=null,p.lastBaseUpdate=ue,p.shared.pending=null}}while(!0);de===null&&(X=_e),p.baseState=X,p.firstBaseUpdate=ae,p.lastBaseUpdate=de,x===null&&(p.shared.lanes=0),ar|=B,e.lanes=B,e.memoizedState=_e}}function Xf(e,n){if(typeof e!="function")throw Error(l(191,e));e.call(n)}function Qf(e,n){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Xf(i[e],n)}var Es=N(null),jl=N(0);function Jf(e,n){e=Ni,I(jl,e),I(Es,n),Ni=e|n.baseLanes}function Tc(){I(jl,Ni),I(Es,Es.current)}function Rc(){Ni=jl.current,q(Es),q(jl)}var Rn=N(null),Kn=null;function nr(e){var n=e.alternate;I(At,At.current&1),I(Rn,e),Kn===null&&(n===null||Es.current!==null||n.memoizedState!==null)&&(Kn=e)}function Dc(e){I(At,At.current),I(Rn,e),Kn===null&&(Kn=e)}function Zf(e){e.tag===22?(I(At,At.current),I(Rn,e),Kn===null&&(Kn=e)):ir()}function ir(){I(At,At.current),I(Rn,Rn.current)}function Dn(e){q(Rn),Kn===e&&(Kn=null),q(At)}var At=N(0);function Nl(e){for(var n=e;n!==null;){if(n.tag===13){var i=n.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||Nu(i)||Hu(i)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Ti=0,Ue=null,ut=null,Mt=null,Hl=!1,ks=!1,Fr=!1,zl=0,Ca=0,As=null,Ay=0;function xt(){throw Error(l(321))}function Mc(e,n){if(n===null)return!1;for(var i=0;i<n.length&&i<e.length;i++)if(!An(e[i],n[i]))return!1;return!0}function Lc(e,n,i,a,p,x){return Ti=x,Ue=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=e===null||e.memoizedState===null?Nd:Wc,Fr=!1,x=i(a,p),Fr=!1,ks&&(x=td(n,i,a,p)),ed(e),x}function ed(e){V.H=Ea;var n=ut!==null&&ut.next!==null;if(Ti=0,Mt=ut=Ue=null,Hl=!1,Ca=0,As=null,n)throw Error(l(300));e===null||Lt||(e=e.dependencies,e!==null&&Tl(e)&&(Lt=!0))}function td(e,n,i,a){Ue=e;var p=0;do{if(ks&&(As=null),Ca=0,ks=!1,25<=p)throw Error(l(301));if(p+=1,Mt=ut=null,e.updateQueue!=null){var x=e.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}V.H=Hd,x=n(i,a)}while(ks);return x}function Ty(){var e=V.H,n=e.useState()[0];return n=typeof n.then=="function"?wa(n):n,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Ue.flags|=1024),n}function Oc(){var e=zl!==0;return zl=0,e}function Bc(e,n,i){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~i}function jc(e){if(Hl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}Hl=!1}Ti=0,Mt=ut=Ue=null,ks=!1,Ca=zl=0,As=null}function cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?Ue.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function Tt(){if(ut===null){var e=Ue.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var n=Mt===null?Ue.memoizedState:Mt.next;if(n!==null)Mt=n,ut=e;else{if(e===null)throw Ue.alternate===null?Error(l(467)):Error(l(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Mt===null?Ue.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Il(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wa(e){var n=Ca;return Ca+=1,As===null&&(As=[]),e=Gf(As,e,n),n=Ue,(Mt===null?n.memoizedState:Mt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?Nd:Wc),e}function Ul(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wa(e);if(e.$$typeof===b)return $t(e)}throw Error(l(438,String(e)))}function Nc(e){var n=null,i=Ue.updateQueue;if(i!==null&&(n=i.memoCache),n==null){var a=Ue.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(n={data:a.data.map(function(p){return p.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),i===null&&(i=Il(),Ue.updateQueue=i),i.memoCache=n,i=n.data[n.index],i===void 0)for(i=n.data[n.index]=Array(e),a=0;a<e;a++)i[a]=L;return n.index++,i}function Ri(e,n){return typeof n=="function"?n(e):n}function Pl(e){var n=Tt();return Hc(n,ut,e)}function Hc(e,n,i){var a=e.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=i;var p=e.baseQueue,x=a.pending;if(x!==null){if(p!==null){var B=p.next;p.next=x.next,x.next=B}n.baseQueue=p=x,a.pending=null}if(x=e.baseState,p===null)e.memoizedState=x;else{n=p.next;var F=B=null,X=null,ae=n,de=!1;do{var _e=ae.lane&-536870913;if(_e!==ae.lane?(Xe&_e)===_e:(Ti&_e)===_e){var oe=ae.revertLane;if(oe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),_e===bs&&(de=!0);else if((Ti&oe)===oe){ae=ae.next,oe===bs&&(de=!0);continue}else _e={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=_e,B=x):X=X.next=_e,Ue.lanes|=oe,ar|=oe;_e=ae.action,Fr&&i(x,_e),x=ae.hasEagerState?ae.eagerState:i(x,_e)}else oe={lane:_e,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},X===null?(F=X=oe,B=x):X=X.next=oe,Ue.lanes|=_e,ar|=_e;ae=ae.next}while(ae!==null&&ae!==n);if(X===null?B=x:X.next=F,!An(x,e.memoizedState)&&(Lt=!0,de&&(i=Cs,i!==null)))throw i;e.memoizedState=x,e.baseState=B,e.baseQueue=X,a.lastRenderedState=x}return p===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function zc(e){var n=Tt(),i=n.queue;if(i===null)throw Error(l(311));i.lastRenderedReducer=e;var a=i.dispatch,p=i.pending,x=n.memoizedState;if(p!==null){i.pending=null;var B=p=p.next;do x=e(x,B.action),B=B.next;while(B!==p);An(x,n.memoizedState)||(Lt=!0),n.memoizedState=x,n.baseQueue===null&&(n.baseState=x),i.lastRenderedState=x}return[x,a]}function nd(e,n,i){var a=Ue,p=Tt(),x=Je;if(x){if(i===void 0)throw Error(l(407));i=i()}else i=n();var B=!An((ut||p).memoizedState,i);if(B&&(p.memoizedState=i,Lt=!0),p=p.queue,Pc(sd.bind(null,a,p,e),[e]),p.getSnapshot!==n||B||Mt!==null&&Mt.memoizedState.tag&1){if(a.flags|=2048,Ts(9,{destroy:void 0},rd.bind(null,a,p,i,n),null),dt===null)throw Error(l(349));x||(Ti&127)!==0||id(a,n,i)}return i}function id(e,n,i){e.flags|=16384,e={getSnapshot:n,value:i},n=Ue.updateQueue,n===null?(n=Il(),Ue.updateQueue=n,n.stores=[e]):(i=n.stores,i===null?n.stores=[e]:i.push(e))}function rd(e,n,i,a){n.value=i,n.getSnapshot=a,ad(n)&&ld(e)}function sd(e,n,i){return i(function(){ad(n)&&ld(e)})}function ad(e){var n=e.getSnapshot;e=e.value;try{var i=n();return!An(e,i)}catch{return!0}}function ld(e){var n=Or(e,2);n!==null&&yn(n,e,2)}function Ic(e){var n=cn();if(typeof e=="function"){var i=e;if(e=i(),Fr){Nt(!0);try{i()}finally{Nt(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:e},n}function od(e,n,i,a){return e.baseState=i,Hc(e,ut,typeof a=="function"?a:Ri)}function Ry(e,n,i,a,p){if($l(e))throw Error(l(485));if(e=n.action,e!==null){var x={payload:p,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){x.listeners.push(B)}};V.T!==null?i(!0):x.isTransition=!1,a(x),i=n.pending,i===null?(x.next=n.pending=x,cd(n,x)):(x.next=i.next,n.pending=i.next=x)}}function cd(e,n){var i=n.action,a=n.payload,p=e.state;if(n.isTransition){var x=V.T,B={};V.T=B;try{var F=i(p,a),X=V.S;X!==null&&X(B,F),ud(e,n,F)}catch(ae){Uc(e,n,ae)}finally{x!==null&&B.types!==null&&(x.types=B.types),V.T=x}}else try{x=i(p,a),ud(e,n,x)}catch(ae){Uc(e,n,ae)}}function ud(e,n,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(a){hd(e,n,a)},function(a){return Uc(e,n,a)}):hd(e,n,i)}function hd(e,n,i){n.status="fulfilled",n.value=i,fd(n),e.state=i,n=e.pending,n!==null&&(i=n.next,i===n?e.pending=null:(i=i.next,n.next=i,cd(e,i)))}function Uc(e,n,i){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do n.status="rejected",n.reason=i,fd(n),n=n.next;while(n!==a)}e.action=null}function fd(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function dd(e,n){return n}function pd(e,n){if(Je){var i=dt.formState;if(i!==null){e:{var a=Ue;if(Je){if(_t){t:{for(var p=_t,x=Wn;p.nodeType!==8;){if(!x){p=null;break t}if(p=Yn(p.nextSibling),p===null){p=null;break t}}x=p.data,p=x==="F!"||x==="F"?p:null}if(p){_t=Yn(p.nextSibling),a=p.data==="F!";break e}}Qi(a)}a=!1}a&&(n=i[0])}}return i=cn(),i.memoizedState=i.baseState=n,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dd,lastRenderedState:n},i.queue=a,i=Od.bind(null,Ue,a),a.dispatch=i,a=Ic(!1),x=Vc.bind(null,Ue,!1,a.queue),a=cn(),p={state:n,dispatch:null,action:e,pending:null},a.queue=p,i=Ry.bind(null,Ue,p,x,i),p.dispatch=i,a.memoizedState=e,[n,i,!1]}function md(e){var n=Tt();return gd(n,ut,e)}function gd(e,n,i){if(n=Hc(e,n,dd)[0],e=Pl(Ri)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var a=wa(n)}catch(B){throw B===ws?Ml:B}else a=n;n=Tt();var p=n.queue,x=p.dispatch;return i!==n.memoizedState&&(Ue.flags|=2048,Ts(9,{destroy:void 0},Dy.bind(null,p,i),null)),[a,x,e]}function Dy(e,n){e.action=n}function _d(e){var n=Tt(),i=ut;if(i!==null)return gd(n,i,e);Tt(),n=n.memoizedState,i=Tt();var a=i.queue.dispatch;return i.memoizedState=e,[n,a,!1]}function Ts(e,n,i,a){return e={tag:e,create:i,deps:a,inst:n,next:null},n=Ue.updateQueue,n===null&&(n=Il(),Ue.updateQueue=n),i=n.lastEffect,i===null?n.lastEffect=e.next=e:(a=i.next,i.next=e,e.next=a,n.lastEffect=e),e}function vd(){return Tt().memoizedState}function Fl(e,n,i,a){var p=cn();Ue.flags|=e,p.memoizedState=Ts(1|n,{destroy:void 0},i,a===void 0?null:a)}function ql(e,n,i,a){var p=Tt();a=a===void 0?null:a;var x=p.memoizedState.inst;ut!==null&&a!==null&&Mc(a,ut.memoizedState.deps)?p.memoizedState=Ts(n,x,i,a):(Ue.flags|=e,p.memoizedState=Ts(1|n,x,i,a))}function yd(e,n){Fl(8390656,8,e,n)}function Pc(e,n){ql(2048,8,e,n)}function My(e){Ue.flags|=4;var n=Ue.updateQueue;if(n===null)n=Il(),Ue.updateQueue=n,n.events=[e];else{var i=n.events;i===null?n.events=[e]:i.push(e)}}function Sd(e){var n=Tt().memoizedState;return My({ref:n,nextImpl:e}),function(){if((rt&2)!==0)throw Error(l(440));return n.impl.apply(void 0,arguments)}}function bd(e,n){return ql(4,2,e,n)}function Cd(e,n){return ql(4,4,e,n)}function wd(e,n){if(typeof n=="function"){e=e();var i=n(e);return function(){typeof i=="function"?i():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function xd(e,n,i){i=i!=null?i.concat([e]):null,ql(4,4,wd.bind(null,n,e),i)}function Fc(){}function Ed(e,n){var i=Tt();n=n===void 0?null:n;var a=i.memoizedState;return n!==null&&Mc(n,a[1])?a[0]:(i.memoizedState=[e,n],e)}function kd(e,n){var i=Tt();n=n===void 0?null:n;var a=i.memoizedState;if(n!==null&&Mc(n,a[1]))return a[0];if(a=e(),Fr){Nt(!0);try{e()}finally{Nt(!1)}}return i.memoizedState=[a,n],a}function qc(e,n,i){return i===void 0||(Ti&1073741824)!==0&&(Xe&261930)===0?e.memoizedState=n:(e.memoizedState=i,e=Ap(),Ue.lanes|=e,ar|=e,i)}function Ad(e,n,i,a){return An(i,n)?i:Es.current!==null?(e=qc(e,i,a),An(e,n)||(Lt=!0),e):(Ti&42)===0||(Ti&1073741824)!==0&&(Xe&261930)===0?(Lt=!0,e.memoizedState=i):(e=Ap(),Ue.lanes|=e,ar|=e,n)}function Td(e,n,i,a,p){var x=Y.p;Y.p=x!==0&&8>x?x:8;var B=V.T,F={};V.T=F,Vc(e,!1,n,i);try{var X=p(),ae=V.S;if(ae!==null&&ae(F,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var de=ky(X,a);xa(e,n,de,On(e))}else xa(e,n,a,On(e))}catch(_e){xa(e,n,{then:function(){},status:"rejected",reason:_e},On())}finally{Y.p=x,B!==null&&F.types!==null&&(B.types=F.types),V.T=B}}function Ly(){}function $c(e,n,i,a){if(e.tag!==5)throw Error(l(476));var p=Rd(e).queue;Td(e,p,n,te,i===null?Ly:function(){return Dd(e),i(a)})}function Rd(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:te},next:null};var i={};return n.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Dd(e){var n=Rd(e);n.next===null&&(n=e.alternate.memoizedState),xa(e,n.next.queue,{},On())}function Gc(){return $t(Pa)}function Md(){return Tt().memoizedState}function Ld(){return Tt().memoizedState}function Oy(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var i=On();e=er(i);var a=tr(n,e,i);a!==null&&(yn(a,n,i),ya(a,n,i)),n={cache:Sc()},e.payload=n;return}n=n.return}}function By(e,n,i){var a=On();i={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},$l(e)?Bd(n,i):(i=cc(e,n,i,a),i!==null&&(yn(i,e,a),jd(i,n,a)))}function Od(e,n,i){var a=On();xa(e,n,i,a)}function xa(e,n,i,a){var p={lane:a,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if($l(e))Bd(n,p);else{var x=e.alternate;if(e.lanes===0&&(x===null||x.lanes===0)&&(x=n.lastRenderedReducer,x!==null))try{var B=n.lastRenderedState,F=x(B,i);if(p.hasEagerState=!0,p.eagerState=F,An(F,B))return xl(e,n,p,0),dt===null&&wl(),!1}catch{}finally{}if(i=cc(e,n,p,a),i!==null)return yn(i,e,a),jd(i,n,a),!0}return!1}function Vc(e,n,i,a){if(a={lane:2,revertLane:xu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},$l(e)){if(n)throw Error(l(479))}else n=cc(e,i,a,2),n!==null&&yn(n,e,2)}function $l(e){var n=e.alternate;return e===Ue||n!==null&&n===Ue}function Bd(e,n){ks=Hl=!0;var i=e.pending;i===null?n.next=n:(n.next=i.next,i.next=n),e.pending=n}function jd(e,n,i){if((i&4194048)!==0){var a=n.lanes;a&=e.pendingLanes,i|=a,n.lanes=i,vi(e,i)}}var Ea={readContext:$t,use:Ul,useCallback:xt,useContext:xt,useEffect:xt,useImperativeHandle:xt,useLayoutEffect:xt,useInsertionEffect:xt,useMemo:xt,useReducer:xt,useRef:xt,useState:xt,useDebugValue:xt,useDeferredValue:xt,useTransition:xt,useSyncExternalStore:xt,useId:xt,useHostTransitionStatus:xt,useFormState:xt,useActionState:xt,useOptimistic:xt,useMemoCache:xt,useCacheRefresh:xt};Ea.useEffectEvent=xt;var Nd={readContext:$t,use:Ul,useCallback:function(e,n){return cn().memoizedState=[e,n===void 0?null:n],e},useContext:$t,useEffect:yd,useImperativeHandle:function(e,n,i){i=i!=null?i.concat([e]):null,Fl(4194308,4,wd.bind(null,n,e),i)},useLayoutEffect:function(e,n){return Fl(4194308,4,e,n)},useInsertionEffect:function(e,n){Fl(4,2,e,n)},useMemo:function(e,n){var i=cn();n=n===void 0?null:n;var a=e();if(Fr){Nt(!0);try{e()}finally{Nt(!1)}}return i.memoizedState=[a,n],a},useReducer:function(e,n,i){var a=cn();if(i!==void 0){var p=i(n);if(Fr){Nt(!0);try{i(n)}finally{Nt(!1)}}}else p=n;return a.memoizedState=a.baseState=p,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:p},a.queue=e,e=e.dispatch=By.bind(null,Ue,e),[a.memoizedState,e]},useRef:function(e){var n=cn();return e={current:e},n.memoizedState=e},useState:function(e){e=Ic(e);var n=e.queue,i=Od.bind(null,Ue,n);return n.dispatch=i,[e.memoizedState,i]},useDebugValue:Fc,useDeferredValue:function(e,n){var i=cn();return qc(i,e,n)},useTransition:function(){var e=Ic(!1);return e=Td.bind(null,Ue,e.queue,!0,!1),cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,i){var a=Ue,p=cn();if(Je){if(i===void 0)throw Error(l(407));i=i()}else{if(i=n(),dt===null)throw Error(l(349));(Xe&127)!==0||id(a,n,i)}p.memoizedState=i;var x={value:i,getSnapshot:n};return p.queue=x,yd(sd.bind(null,a,x,e),[e]),a.flags|=2048,Ts(9,{destroy:void 0},rd.bind(null,a,x,i,n),null),i},useId:function(){var e=cn(),n=dt.identifierPrefix;if(Je){var i=ui,a=ci;i=(a&~(1<<32-it(a)-1)).toString(32)+i,n="_"+n+"R_"+i,i=zl++,0<i&&(n+="H"+i.toString(32)),n+="_"}else i=Ay++,n="_"+n+"r_"+i.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Gc,useFormState:pd,useActionState:pd,useOptimistic:function(e){var n=cn();n.memoizedState=n.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=i,n=Vc.bind(null,Ue,!0,i),i.dispatch=n,[e,n]},useMemoCache:Nc,useCacheRefresh:function(){return cn().memoizedState=Oy.bind(null,Ue)},useEffectEvent:function(e){var n=cn(),i={impl:e};return n.memoizedState=i,function(){if((rt&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}},Wc={readContext:$t,use:Ul,useCallback:Ed,useContext:$t,useEffect:Pc,useImperativeHandle:xd,useInsertionEffect:bd,useLayoutEffect:Cd,useMemo:kd,useReducer:Pl,useRef:vd,useState:function(){return Pl(Ri)},useDebugValue:Fc,useDeferredValue:function(e,n){var i=Tt();return Ad(i,ut.memoizedState,e,n)},useTransition:function(){var e=Pl(Ri)[0],n=Tt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:nd,useId:Md,useHostTransitionStatus:Gc,useFormState:md,useActionState:md,useOptimistic:function(e,n){var i=Tt();return od(i,ut,e,n)},useMemoCache:Nc,useCacheRefresh:Ld};Wc.useEffectEvent=Sd;var Hd={readContext:$t,use:Ul,useCallback:Ed,useContext:$t,useEffect:Pc,useImperativeHandle:xd,useInsertionEffect:bd,useLayoutEffect:Cd,useMemo:kd,useReducer:zc,useRef:vd,useState:function(){return zc(Ri)},useDebugValue:Fc,useDeferredValue:function(e,n){var i=Tt();return ut===null?qc(i,e,n):Ad(i,ut.memoizedState,e,n)},useTransition:function(){var e=zc(Ri)[0],n=Tt().memoizedState;return[typeof e=="boolean"?e:wa(e),n]},useSyncExternalStore:nd,useId:Md,useHostTransitionStatus:Gc,useFormState:_d,useActionState:_d,useOptimistic:function(e,n){var i=Tt();return ut!==null?od(i,ut,e,n):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:Nc,useCacheRefresh:Ld};Hd.useEffectEvent=Sd;function Kc(e,n,i,a){n=e.memoizedState,i=i(a,n),i=i==null?n:h({},n,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Yc={enqueueSetState:function(e,n,i){e=e._reactInternals;var a=On(),p=er(a);p.payload=n,i!=null&&(p.callback=i),n=tr(e,p,a),n!==null&&(yn(n,e,a),ya(n,e,a))},enqueueReplaceState:function(e,n,i){e=e._reactInternals;var a=On(),p=er(a);p.tag=1,p.payload=n,i!=null&&(p.callback=i),n=tr(e,p,a),n!==null&&(yn(n,e,a),ya(n,e,a))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var i=On(),a=er(i);a.tag=2,n!=null&&(a.callback=n),n=tr(e,a,i),n!==null&&(yn(n,e,i),ya(n,e,i))}};function zd(e,n,i,a,p,x,B){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,x,B):n.prototype&&n.prototype.isPureReactComponent?!ha(i,a)||!ha(p,x):!0}function Id(e,n,i,a){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(i,a),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(i,a),n.state!==e&&Yc.enqueueReplaceState(n,n.state,null)}function qr(e,n){var i=n;if("ref"in n){i={};for(var a in n)a!=="ref"&&(i[a]=n[a])}if(e=e.defaultProps){i===n&&(i=h({},i));for(var p in e)i[p]===void 0&&(i[p]=e[p])}return i}function Ud(e){Cl(e)}function Pd(e){console.error(e)}function Fd(e){Cl(e)}function Gl(e,n){try{var i=e.onUncaughtError;i(n.value,{componentStack:n.stack})}catch(a){setTimeout(function(){throw a})}}function qd(e,n,i){try{var a=e.onCaughtError;a(i.value,{componentStack:i.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Xc(e,n,i){return i=er(i),i.tag=3,i.payload={element:null},i.callback=function(){Gl(e,n)},i}function $d(e){return e=er(e),e.tag=3,e}function Gd(e,n,i,a){var p=i.type.getDerivedStateFromError;if(typeof p=="function"){var x=a.value;e.payload=function(){return p(x)},e.callback=function(){qd(n,i,a)}}var B=i.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(e.callback=function(){qd(n,i,a),typeof p!="function"&&(lr===null?lr=new Set([this]):lr.add(this));var F=a.stack;this.componentDidCatch(a.value,{componentStack:F!==null?F:""})})}function jy(e,n,i,a,p){if(i.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(n=i.alternate,n!==null&&Ss(n,i,p,!0),i=Rn.current,i!==null){switch(i.tag){case 31:case 13:return Kn===null?io():i.alternate===null&&Et===0&&(Et=3),i.flags&=-257,i.flags|=65536,i.lanes=p,a===Ll?i.flags|=16384:(n=i.updateQueue,n===null?i.updateQueue=new Set([a]):n.add(a),bu(e,a,p)),!1;case 22:return i.flags|=65536,a===Ll?i.flags|=16384:(n=i.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([a])},i.updateQueue=n):(i=n.retryQueue,i===null?n.retryQueue=new Set([a]):i.add(a)),bu(e,a,p)),!1}throw Error(l(435,i.tag))}return bu(e,a,p),io(),!1}if(Je)return n=Rn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=p,a!==mc&&(e=Error(l(422),{cause:a}),pa($n(e,i)))):(a!==mc&&(n=Error(l(423),{cause:a}),pa($n(n,i))),e=e.current.alternate,e.flags|=65536,p&=-p,e.lanes|=p,a=$n(a,i),p=Xc(e.stateNode,a,p),kc(e,p),Et!==4&&(Et=2)),!1;var x=Error(l(520),{cause:a});if(x=$n(x,i),Oa===null?Oa=[x]:Oa.push(x),Et!==4&&(Et=2),n===null)return!0;a=$n(a,i),i=n;do{switch(i.tag){case 3:return i.flags|=65536,e=p&-p,i.lanes|=e,e=Xc(i.stateNode,a,e),kc(i,e),!1;case 1:if(n=i.type,x=i.stateNode,(i.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(lr===null||!lr.has(x))))return i.flags|=65536,p&=-p,i.lanes|=p,p=$d(p),Gd(p,e,i,a),kc(i,p),!1}i=i.return}while(i!==null);return!1}var Qc=Error(l(461)),Lt=!1;function Gt(e,n,i,a){n.child=e===null?Yf(n,null,i,a):Pr(n,e.child,i,a)}function Vd(e,n,i,a,p){i=i.render;var x=n.ref;if("ref"in a){var B={};for(var F in a)F!=="ref"&&(B[F]=a[F])}else B=a;return Hr(n),a=Lc(e,n,i,B,x,p),F=Oc(),e!==null&&!Lt?(Bc(e,n,p),Di(e,n,p)):(Je&&F&&dc(n),n.flags|=1,Gt(e,n,a,p),n.child)}function Wd(e,n,i,a,p){if(e===null){var x=i.type;return typeof x=="function"&&!uc(x)&&x.defaultProps===void 0&&i.compare===null?(n.tag=15,n.type=x,Kd(e,n,x,a,p)):(e=kl(i.type,null,a,n,n.mode,p),e.ref=n.ref,e.return=n,n.child=e)}if(x=e.child,!su(e,p)){var B=x.memoizedProps;if(i=i.compare,i=i!==null?i:ha,i(B,a)&&e.ref===n.ref)return Di(e,n,p)}return n.flags|=1,e=xi(x,a),e.ref=n.ref,e.return=n,n.child=e}function Kd(e,n,i,a,p){if(e!==null){var x=e.memoizedProps;if(ha(x,a)&&e.ref===n.ref)if(Lt=!1,n.pendingProps=a=x,su(e,p))(e.flags&131072)!==0&&(Lt=!0);else return n.lanes=e.lanes,Di(e,n,p)}return Jc(e,n,i,a,p)}function Yd(e,n,i,a){var p=a.children,x=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((n.flags&128)!==0){if(x=x!==null?x.baseLanes|i:i,e!==null){for(a=n.child=e.child,p=0;a!==null;)p=p|a.lanes|a.childLanes,a=a.sibling;a=p&~x}else a=0,n.child=null;return Xd(e,n,x,i,a)}if((i&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Dl(n,x!==null?x.cachePool:null),x!==null?Jf(n,x):Tc(),Zf(n);else return a=n.lanes=536870912,Xd(e,n,x!==null?x.baseLanes|i:i,i,a)}else x!==null?(Dl(n,x.cachePool),Jf(n,x),ir(),n.memoizedState=null):(e!==null&&Dl(n,null),Tc(),ir());return Gt(e,n,p,i),n.child}function ka(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Xd(e,n,i,a,p){var x=Cc();return x=x===null?null:{parent:Dt._currentValue,pool:x},n.memoizedState={baseLanes:i,cachePool:x},e!==null&&Dl(n,null),Tc(),Zf(n),e!==null&&Ss(e,n,a,!0),n.childLanes=p,null}function Vl(e,n){return n=Kl({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Qd(e,n,i){return Pr(n,e.child,null,i),e=Vl(n,n.pendingProps),e.flags|=2,Dn(n),n.memoizedState=null,e}function Ny(e,n,i){var a=n.pendingProps,p=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Je){if(a.mode==="hidden")return e=Vl(n,a),n.lanes=536870912,ka(null,e);if(Dc(n),(e=_t)?(e=cm(e,Wn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Bf(e),i.return=n,n.child=i,qt=n,_t=null)):e=null,e===null)throw Qi(n);return n.lanes=536870912,null}return Vl(n,a)}var x=e.memoizedState;if(x!==null){var B=x.dehydrated;if(Dc(n),p)if(n.flags&256)n.flags&=-257,n=Qd(e,n,i);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(l(558));else if(Lt||Ss(e,n,i,!1),p=(i&e.childLanes)!==0,Lt||p){if(a=dt,a!==null&&(B=yi(a,i),B!==0&&B!==x.retryLane))throw x.retryLane=B,Or(e,B),yn(a,e,B),Qc;io(),n=Qd(e,n,i)}else e=x.treeContext,_t=Yn(B.nextSibling),qt=n,Je=!0,Xi=null,Wn=!1,e!==null&&Hf(n,e),n=Vl(n,a),n.flags|=4096;return n}return e=xi(e.child,{mode:a.mode,children:a.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Wl(e,n){var i=n.ref;if(i===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(l(284));(e===null||e.ref!==i)&&(n.flags|=4194816)}}function Jc(e,n,i,a,p){return Hr(n),i=Lc(e,n,i,a,void 0,p),a=Oc(),e!==null&&!Lt?(Bc(e,n,p),Di(e,n,p)):(Je&&a&&dc(n),n.flags|=1,Gt(e,n,i,p),n.child)}function Jd(e,n,i,a,p,x){return Hr(n),n.updateQueue=null,i=td(n,a,i,p),ed(e),a=Oc(),e!==null&&!Lt?(Bc(e,n,x),Di(e,n,x)):(Je&&a&&dc(n),n.flags|=1,Gt(e,n,i,x),n.child)}function Zd(e,n,i,a,p){if(Hr(n),n.stateNode===null){var x=gs,B=i.contextType;typeof B=="object"&&B!==null&&(x=$t(B)),x=new i(a,x),n.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Yc,n.stateNode=x,x._reactInternals=n,x=n.stateNode,x.props=a,x.state=n.memoizedState,x.refs={},xc(n),B=i.contextType,x.context=typeof B=="object"&&B!==null?$t(B):gs,x.state=n.memoizedState,B=i.getDerivedStateFromProps,typeof B=="function"&&(Kc(n,i,B,a),x.state=n.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(B=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),B!==x.state&&Yc.enqueueReplaceState(x,x.state,null),ba(n,a,x,p),Sa(),x.state=n.memoizedState),typeof x.componentDidMount=="function"&&(n.flags|=4194308),a=!0}else if(e===null){x=n.stateNode;var F=n.memoizedProps,X=qr(i,F);x.props=X;var ae=x.context,de=i.contextType;B=gs,typeof de=="object"&&de!==null&&(B=$t(de));var _e=i.getDerivedStateFromProps;de=typeof _e=="function"||typeof x.getSnapshotBeforeUpdate=="function",F=n.pendingProps!==F,de||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(F||ae!==B)&&Id(n,x,a,B),Zi=!1;var oe=n.memoizedState;x.state=oe,ba(n,a,x,p),Sa(),ae=n.memoizedState,F||oe!==ae||Zi?(typeof _e=="function"&&(Kc(n,i,_e,a),ae=n.memoizedState),(X=Zi||zd(n,i,X,a,oe,ae,B))?(de||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(n.flags|=4194308)):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=a,n.memoizedState=ae),x.props=a,x.state=ae,x.context=B,a=X):(typeof x.componentDidMount=="function"&&(n.flags|=4194308),a=!1)}else{x=n.stateNode,Ec(e,n),B=n.memoizedProps,de=qr(i,B),x.props=de,_e=n.pendingProps,oe=x.context,ae=i.contextType,X=gs,typeof ae=="object"&&ae!==null&&(X=$t(ae)),F=i.getDerivedStateFromProps,(ae=typeof F=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(B!==_e||oe!==X)&&Id(n,x,a,X),Zi=!1,oe=n.memoizedState,x.state=oe,ba(n,a,x,p),Sa();var ue=n.memoizedState;B!==_e||oe!==ue||Zi||e!==null&&e.dependencies!==null&&Tl(e.dependencies)?(typeof F=="function"&&(Kc(n,i,F,a),ue=n.memoizedState),(de=Zi||zd(n,i,de,a,oe,ue,X)||e!==null&&e.dependencies!==null&&Tl(e.dependencies))?(ae||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(a,ue,X),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(a,ue,X)),typeof x.componentDidUpdate=="function"&&(n.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof x.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),n.memoizedProps=a,n.memoizedState=ue),x.props=a,x.state=ue,x.context=X,a=de):(typeof x.componentDidUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||B===e.memoizedProps&&oe===e.memoizedState||(n.flags|=1024),a=!1)}return x=a,Wl(e,n),a=(n.flags&128)!==0,x||a?(x=n.stateNode,i=a&&typeof i.getDerivedStateFromError!="function"?null:x.render(),n.flags|=1,e!==null&&a?(n.child=Pr(n,e.child,null,p),n.child=Pr(n,null,i,p)):Gt(e,n,i,p),n.memoizedState=x.state,e=n.child):e=Di(e,n,p),e}function ep(e,n,i,a){return jr(),n.flags|=256,Gt(e,n,i,a),n.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function eu(e){return{baseLanes:e,cachePool:qf()}}function tu(e,n,i){return e=e!==null?e.childLanes&~i:0,n&&(e|=Ln),e}function tp(e,n,i){var a=n.pendingProps,p=!1,x=(n.flags&128)!==0,B;if((B=x)||(B=e!==null&&e.memoizedState===null?!1:(At.current&2)!==0),B&&(p=!0,n.flags&=-129),B=(n.flags&32)!==0,n.flags&=-33,e===null){if(Je){if(p?nr(n):ir(),(e=_t)?(e=cm(e,Wn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Yi!==null?{id:ci,overflow:ui}:null,retryLane:536870912,hydrationErrors:null},i=Bf(e),i.return=n,n.child=i,qt=n,_t=null)):e=null,e===null)throw Qi(n);return Hu(e)?n.lanes=32:n.lanes=536870912,null}var F=a.children;return a=a.fallback,p?(ir(),p=n.mode,F=Kl({mode:"hidden",children:F},p),a=Br(a,p,i,null),F.return=n,a.return=n,F.sibling=a,n.child=F,a=n.child,a.memoizedState=eu(i),a.childLanes=tu(e,B,i),n.memoizedState=Zc,ka(null,a)):(nr(n),nu(n,F))}var X=e.memoizedState;if(X!==null&&(F=X.dehydrated,F!==null)){if(x)n.flags&256?(nr(n),n.flags&=-257,n=iu(e,n,i)):n.memoizedState!==null?(ir(),n.child=e.child,n.flags|=128,n=null):(ir(),F=a.fallback,p=n.mode,a=Kl({mode:"visible",children:a.children},p),F=Br(F,p,i,null),F.flags|=2,a.return=n,F.return=n,a.sibling=F,n.child=a,Pr(n,e.child,null,i),a=n.child,a.memoizedState=eu(i),a.childLanes=tu(e,B,i),n.memoizedState=Zc,n=ka(null,a));else if(nr(n),Hu(F)){if(B=F.nextSibling&&F.nextSibling.dataset,B)var ae=B.dgst;B=ae,a=Error(l(419)),a.stack="",a.digest=B,pa({value:a,source:null,stack:null}),n=iu(e,n,i)}else if(Lt||Ss(e,n,i,!1),B=(i&e.childLanes)!==0,Lt||B){if(B=dt,B!==null&&(a=yi(B,i),a!==0&&a!==X.retryLane))throw X.retryLane=a,Or(e,a),yn(B,e,a),Qc;Nu(F)||io(),n=iu(e,n,i)}else Nu(F)?(n.flags|=192,n.child=e.child,n=null):(e=X.treeContext,_t=Yn(F.nextSibling),qt=n,Je=!0,Xi=null,Wn=!1,e!==null&&Hf(n,e),n=nu(n,a.children),n.flags|=4096);return n}return p?(ir(),F=a.fallback,p=n.mode,X=e.child,ae=X.sibling,a=xi(X,{mode:"hidden",children:a.children}),a.subtreeFlags=X.subtreeFlags&65011712,ae!==null?F=xi(ae,F):(F=Br(F,p,i,null),F.flags|=2),F.return=n,a.return=n,a.sibling=F,n.child=a,ka(null,a),a=n.child,F=e.child.memoizedState,F===null?F=eu(i):(p=F.cachePool,p!==null?(X=Dt._currentValue,p=p.parent!==X?{parent:X,pool:X}:p):p=qf(),F={baseLanes:F.baseLanes|i,cachePool:p}),a.memoizedState=F,a.childLanes=tu(e,B,i),n.memoizedState=Zc,ka(e.child,a)):(nr(n),i=e.child,e=i.sibling,i=xi(i,{mode:"visible",children:a.children}),i.return=n,i.sibling=null,e!==null&&(B=n.deletions,B===null?(n.deletions=[e],n.flags|=16):B.push(e)),n.child=i,n.memoizedState=null,i)}function nu(e,n){return n=Kl({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Kl(e,n){return e=Tn(22,e,null,n),e.lanes=0,e}function iu(e,n,i){return Pr(n,e.child,null,i),e=nu(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function np(e,n,i){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n),vc(e.return,n,i)}function ru(e,n,i,a,p,x){var B=e.memoizedState;B===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:a,tail:i,tailMode:p,treeForkCount:x}:(B.isBackwards=n,B.rendering=null,B.renderingStartTime=0,B.last=a,B.tail=i,B.tailMode=p,B.treeForkCount=x)}function ip(e,n,i){var a=n.pendingProps,p=a.revealOrder,x=a.tail;a=a.children;var B=At.current,F=(B&2)!==0;if(F?(B=B&1|2,n.flags|=128):B&=1,I(At,B),Gt(e,n,a,i),a=Je?da:0,!F&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&np(e,i,n);else if(e.tag===19)np(e,i,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(p){case"forwards":for(i=n.child,p=null;i!==null;)e=i.alternate,e!==null&&Nl(e)===null&&(p=i),i=i.sibling;i=p,i===null?(p=n.child,n.child=null):(p=i.sibling,i.sibling=null),ru(n,!1,p,i,x,a);break;case"backwards":case"unstable_legacy-backwards":for(i=null,p=n.child,n.child=null;p!==null;){if(e=p.alternate,e!==null&&Nl(e)===null){n.child=p;break}e=p.sibling,p.sibling=i,i=p,p=e}ru(n,!0,i,null,x,a);break;case"together":ru(n,!1,null,null,void 0,a);break;default:n.memoizedState=null}return n.child}function Di(e,n,i){if(e!==null&&(n.dependencies=e.dependencies),ar|=n.lanes,(i&n.childLanes)===0)if(e!==null){if(Ss(e,n,i,!1),(i&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(l(153));if(n.child!==null){for(e=n.child,i=xi(e,e.pendingProps),n.child=i,i.return=n;e.sibling!==null;)e=e.sibling,i=i.sibling=xi(e,e.pendingProps),i.return=n;i.sibling=null}return n.child}function su(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Tl(e)))}function Hy(e,n,i){switch(n.tag){case 3:$(n,n.stateNode.containerInfo),Ji(n,Dt,e.memoizedState.cache),jr();break;case 27:case 5:le(n);break;case 4:$(n,n.stateNode.containerInfo);break;case 10:Ji(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Dc(n),null;break;case 13:var a=n.memoizedState;if(a!==null)return a.dehydrated!==null?(nr(n),n.flags|=128,null):(i&n.child.childLanes)!==0?tp(e,n,i):(nr(n),e=Di(e,n,i),e!==null?e.sibling:null);nr(n);break;case 19:var p=(e.flags&128)!==0;if(a=(i&n.childLanes)!==0,a||(Ss(e,n,i,!1),a=(i&n.childLanes)!==0),p){if(a)return ip(e,n,i);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),I(At,At.current),a)break;return null;case 22:return n.lanes=0,Yd(e,n,i,n.pendingProps);case 24:Ji(n,Dt,e.memoizedState.cache)}return Di(e,n,i)}function rp(e,n,i){if(e!==null)if(e.memoizedProps!==n.pendingProps)Lt=!0;else{if(!su(e,i)&&(n.flags&128)===0)return Lt=!1,Hy(e,n,i);Lt=(e.flags&131072)!==0}else Lt=!1,Je&&(n.flags&1048576)!==0&&Nf(n,da,n.index);switch(n.lanes=0,n.tag){case 16:e:{var a=n.pendingProps;if(e=Ir(n.elementType),n.type=e,typeof e=="function")uc(e)?(a=qr(e,a),n.tag=1,n=Zd(null,n,e,a,i)):(n.tag=0,n=Jc(null,n,e,a,i));else{if(e!=null){var p=e.$$typeof;if(p===E){n.tag=11,n=Vd(null,n,e,a,i);break e}else if(p===D){n.tag=14,n=Wd(null,n,e,a,i);break e}}throw n=W(e)||e,Error(l(306,n,""))}}return n;case 0:return Jc(e,n,n.type,n.pendingProps,i);case 1:return a=n.type,p=qr(a,n.pendingProps),Zd(e,n,a,p,i);case 3:e:{if($(n,n.stateNode.containerInfo),e===null)throw Error(l(387));a=n.pendingProps;var x=n.memoizedState;p=x.element,Ec(e,n),ba(n,a,null,i);var B=n.memoizedState;if(a=B.cache,Ji(n,Dt,a),a!==x.cache&&yc(n,[Dt],i,!0),Sa(),a=B.element,x.isDehydrated)if(x={element:a,isDehydrated:!1,cache:B.cache},n.updateQueue.baseState=x,n.memoizedState=x,n.flags&256){n=ep(e,n,a,i);break e}else if(a!==p){p=$n(Error(l(424)),n),pa(p),n=ep(e,n,a,i);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(_t=Yn(e.firstChild),qt=n,Je=!0,Xi=null,Wn=!0,i=Yf(n,null,a,i),n.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(jr(),a===p){n=Di(e,n,i);break e}Gt(e,n,a,i)}n=n.child}return n;case 26:return Wl(e,n),e===null?(i=mm(n.type,null,n.pendingProps,null))?n.memoizedState=i:Je||(i=n.type,e=n.pendingProps,a=uo(ge.current).createElement(i),a[mt]=n,a[ct]=e,Vt(a,i,e),kt(a),n.stateNode=a):n.memoizedState=mm(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return le(n),e===null&&Je&&(a=n.stateNode=fm(n.type,n.pendingProps,ge.current),qt=n,Wn=!0,p=_t,hr(n.type)?(zu=p,_t=Yn(a.firstChild)):_t=p),Gt(e,n,n.pendingProps.children,i),Wl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Je&&((p=a=_t)&&(a=d0(a,n.type,n.pendingProps,Wn),a!==null?(n.stateNode=a,qt=n,_t=Yn(a.firstChild),Wn=!1,p=!0):p=!1),p||Qi(n)),le(n),p=n.type,x=n.pendingProps,B=e!==null?e.memoizedProps:null,a=x.children,Ou(p,x)?a=null:B!==null&&Ou(p,B)&&(n.flags|=32),n.memoizedState!==null&&(p=Lc(e,n,Ty,null,null,i),Pa._currentValue=p),Wl(e,n),Gt(e,n,a,i),n.child;case 6:return e===null&&Je&&((e=i=_t)&&(i=p0(i,n.pendingProps,Wn),i!==null?(n.stateNode=i,qt=n,_t=null,e=!0):e=!1),e||Qi(n)),null;case 13:return tp(e,n,i);case 4:return $(n,n.stateNode.containerInfo),a=n.pendingProps,e===null?n.child=Pr(n,null,a,i):Gt(e,n,a,i),n.child;case 11:return Vd(e,n,n.type,n.pendingProps,i);case 7:return Gt(e,n,n.pendingProps,i),n.child;case 8:return Gt(e,n,n.pendingProps.children,i),n.child;case 12:return Gt(e,n,n.pendingProps.children,i),n.child;case 10:return a=n.pendingProps,Ji(n,n.type,a.value),Gt(e,n,a.children,i),n.child;case 9:return p=n.type._context,a=n.pendingProps.children,Hr(n),p=$t(p),a=a(p),n.flags|=1,Gt(e,n,a,i),n.child;case 14:return Wd(e,n,n.type,n.pendingProps,i);case 15:return Kd(e,n,n.type,n.pendingProps,i);case 19:return ip(e,n,i);case 31:return Ny(e,n,i);case 22:return Yd(e,n,i,n.pendingProps);case 24:return Hr(n),a=$t(Dt),e===null?(p=Cc(),p===null&&(p=dt,x=Sc(),p.pooledCache=x,x.refCount++,x!==null&&(p.pooledCacheLanes|=i),p=x),n.memoizedState={parent:a,cache:p},xc(n),Ji(n,Dt,p)):((e.lanes&i)!==0&&(Ec(e,n),ba(n,null,null,i),Sa()),p=e.memoizedState,x=n.memoizedState,p.parent!==a?(p={parent:a,cache:a},n.memoizedState=p,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=p),Ji(n,Dt,a)):(a=x.cache,Ji(n,Dt,a),a!==p.cache&&yc(n,[Dt],i,!0))),Gt(e,n,n.pendingProps.children,i),n.child;case 29:throw n.pendingProps}throw Error(l(156,n.tag))}function Mi(e){e.flags|=4}function au(e,n,i,a,p){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(p&335544128)===p)if(e.stateNode.complete)e.flags|=8192;else if(Mp())e.flags|=8192;else throw Ur=Ll,wc}else e.flags&=-16777217}function sp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sm(n))if(Mp())e.flags|=8192;else throw Ur=Ll,wc}function Yl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?sn():536870912,e.lanes|=n,Ls|=n)}function Aa(e,n){if(!Je)switch(e.tailMode){case"hidden":n=e.tail;for(var i=null;n!==null;)n.alternate!==null&&(i=n),n=n.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function vt(e){var n=e.alternate!==null&&e.alternate.child===e.child,i=0,a=0;if(n)for(var p=e.child;p!==null;)i|=p.lanes|p.childLanes,a|=p.subtreeFlags&65011712,a|=p.flags&65011712,p.return=e,p=p.sibling;else for(p=e.child;p!==null;)i|=p.lanes|p.childLanes,a|=p.subtreeFlags,a|=p.flags,p.return=e,p=p.sibling;return e.subtreeFlags|=a,e.childLanes=i,n}function zy(e,n,i){var a=n.pendingProps;switch(pc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(n),null;case 1:return vt(n),null;case 3:return i=n.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),n.memoizedState.cache!==a&&(n.flags|=2048),Ai(Dt),he(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ys(n)?Mi(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,gc())),vt(n),null;case 26:var p=n.type,x=n.memoizedState;return e===null?(Mi(n),x!==null?(vt(n),sp(n,x)):(vt(n),au(n,p,null,a,i))):x?x!==e.memoizedState?(Mi(n),vt(n),sp(n,x)):(vt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==a&&Mi(n),vt(n),au(n,p,e,a,i)),null;case 27:if(xe(n),i=ge.current,p=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Mi(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return vt(n),null}e=ie.current,ys(n)?zf(n):(e=fm(p,a,i),n.stateNode=e,Mi(n))}return vt(n),null;case 5:if(xe(n),p=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==a&&Mi(n);else{if(!a){if(n.stateNode===null)throw Error(l(166));return vt(n),null}if(x=ie.current,ys(n))zf(n);else{var B=uo(ge.current);switch(x){case 1:x=B.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:x=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":x=B.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":x=B.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":x=B.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof a.is=="string"?B.createElement("select",{is:a.is}):B.createElement("select"),a.multiple?x.multiple=!0:a.size&&(x.size=a.size);break;default:x=typeof a.is=="string"?B.createElement(p,{is:a.is}):B.createElement(p)}}x[mt]=n,x[ct]=a;e:for(B=n.child;B!==null;){if(B.tag===5||B.tag===6)x.appendChild(B.stateNode);else if(B.tag!==4&&B.tag!==27&&B.child!==null){B.child.return=B,B=B.child;continue}if(B===n)break e;for(;B.sibling===null;){if(B.return===null||B.return===n)break e;B=B.return}B.sibling.return=B.return,B=B.sibling}n.stateNode=x;e:switch(Vt(x,p,a),p){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&Mi(n)}}return vt(n),au(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,i),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==a&&Mi(n);else{if(typeof a!="string"&&n.stateNode===null)throw Error(l(166));if(e=ge.current,ys(n)){if(e=n.stateNode,i=n.memoizedProps,a=null,p=qt,p!==null)switch(p.tag){case 27:case 5:a=p.memoizedProps}e[mt]=n,e=!!(e.nodeValue===i||a!==null&&a.suppressHydrationWarning===!0||tm(e.nodeValue,i)),e||Qi(n,!0)}else e=uo(e).createTextNode(a),e[mt]=n,n.stateNode=e}return vt(n),null;case 31:if(i=n.memoizedState,e===null||e.memoizedState!==null){if(a=ys(n),i!==null){if(e===null){if(!a)throw Error(l(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[mt]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),e=!1}else i=gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return n.flags&256?(Dn(n),n):(Dn(n),null);if((n.flags&128)!==0)throw Error(l(558))}return vt(n),null;case 13:if(a=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(p=ys(n),a!==null&&a.dehydrated!==null){if(e===null){if(!p)throw Error(l(318));if(p=n.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));p[mt]=n}else jr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),p=!1}else p=gc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=p),p=!0;if(!p)return n.flags&256?(Dn(n),n):(Dn(n),null)}return Dn(n),(n.flags&128)!==0?(n.lanes=i,n):(i=a!==null,e=e!==null&&e.memoizedState!==null,i&&(a=n.child,p=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(p=a.alternate.memoizedState.cachePool.pool),x=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(x=a.memoizedState.cachePool.pool),x!==p&&(a.flags|=2048)),i!==e&&i&&(n.child.flags|=8192),Yl(n,n.updateQueue),vt(n),null);case 4:return he(),e===null&&Tu(n.stateNode.containerInfo),vt(n),null;case 10:return Ai(n.type),vt(n),null;case 19:if(q(At),a=n.memoizedState,a===null)return vt(n),null;if(p=(n.flags&128)!==0,x=a.rendering,x===null)if(p)Aa(a,!1);else{if(Et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(x=Nl(e),x!==null){for(n.flags|=128,Aa(a,!1),e=x.updateQueue,n.updateQueue=e,Yl(n,e),n.subtreeFlags=0,e=i,i=n.child;i!==null;)Of(i,e),i=i.sibling;return I(At,At.current&1|2),Je&&Ei(n,a.treeForkCount),n.child}e=e.sibling}a.tail!==null&&nt()>eo&&(n.flags|=128,p=!0,Aa(a,!1),n.lanes=4194304)}else{if(!p)if(e=Nl(x),e!==null){if(n.flags|=128,p=!0,e=e.updateQueue,n.updateQueue=e,Yl(n,e),Aa(a,!0),a.tail===null&&a.tailMode==="hidden"&&!x.alternate&&!Je)return vt(n),null}else 2*nt()-a.renderingStartTime>eo&&i!==536870912&&(n.flags|=128,p=!0,Aa(a,!1),n.lanes=4194304);a.isBackwards?(x.sibling=n.child,n.child=x):(e=a.last,e!==null?e.sibling=x:n.child=x,a.last=x)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=nt(),e.sibling=null,i=At.current,I(At,p?i&1|2:i&1),Je&&Ei(n,a.treeForkCount),e):(vt(n),null);case 22:case 23:return Dn(n),Rc(),a=n.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(n.flags|=8192):a&&(n.flags|=8192),a?(i&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),i=n.updateQueue,i!==null&&Yl(n,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),a=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(a=n.memoizedState.cachePool.pool),a!==i&&(n.flags|=2048),e!==null&&q(zr),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),n.memoizedState.cache!==i&&(n.flags|=2048),Ai(Dt),vt(n),null;case 25:return null;case 30:return null}throw Error(l(156,n.tag))}function Iy(e,n){switch(pc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Ai(Dt),he(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return xe(n),null;case 31:if(n.memoizedState!==null){if(Dn(n),n.alternate===null)throw Error(l(340));jr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Dn(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(l(340));jr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return q(At),null;case 4:return he(),null;case 10:return Ai(n.type),null;case 22:case 23:return Dn(n),Rc(),e!==null&&q(zr),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Ai(Dt),null;case 25:return null;default:return null}}function ap(e,n){switch(pc(n),n.tag){case 3:Ai(Dt),he();break;case 26:case 27:case 5:xe(n);break;case 4:he();break;case 31:n.memoizedState!==null&&Dn(n);break;case 13:Dn(n);break;case 19:q(At);break;case 10:Ai(n.type);break;case 22:case 23:Dn(n),Rc(),e!==null&&q(zr);break;case 24:Ai(Dt)}}function Ta(e,n){try{var i=n.updateQueue,a=i!==null?i.lastEffect:null;if(a!==null){var p=a.next;i=p;do{if((i.tag&e)===e){a=void 0;var x=i.create,B=i.inst;a=x(),B.destroy=a}i=i.next}while(i!==p)}}catch(F){at(n,n.return,F)}}function rr(e,n,i){try{var a=n.updateQueue,p=a!==null?a.lastEffect:null;if(p!==null){var x=p.next;a=x;do{if((a.tag&e)===e){var B=a.inst,F=B.destroy;if(F!==void 0){B.destroy=void 0,p=n;var X=i,ae=F;try{ae()}catch(de){at(p,X,de)}}}a=a.next}while(a!==x)}}catch(de){at(n,n.return,de)}}function lp(e){var n=e.updateQueue;if(n!==null){var i=e.stateNode;try{Qf(n,i)}catch(a){at(e,e.return,a)}}}function op(e,n,i){i.props=qr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(a){at(e,n,a)}}function Ra(e,n){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof i=="function"?e.refCleanup=i(a):i.current=a}}catch(p){at(e,n,p)}}function hi(e,n){var i=e.ref,a=e.refCleanup;if(i!==null)if(typeof a=="function")try{a()}catch(p){at(e,n,p)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(p){at(e,n,p)}else i.current=null}function cp(e){var n=e.type,i=e.memoizedProps,a=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":i.autoFocus&&a.focus();break e;case"img":i.src?a.src=i.src:i.srcSet&&(a.srcset=i.srcSet)}}catch(p){at(e,e.return,p)}}function lu(e,n,i){try{var a=e.stateNode;l0(a,e.type,i,n),a[ct]=n}catch(p){at(e,e.return,p)}}function up(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&hr(e.type)||e.tag===4}function ou(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||up(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&&hr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,n):(n=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,n.appendChild(e),i=i._reactRootContainer,i!=null||n.onclick!==null||(n.onclick=Xt));else if(a!==4&&(a===27&&hr(e.type)&&(i=e.stateNode,n=null),e=e.child,e!==null))for(cu(e,n,i),e=e.sibling;e!==null;)cu(e,n,i),e=e.sibling}function Xl(e,n,i){var a=e.tag;if(a===5||a===6)e=e.stateNode,n?i.insertBefore(e,n):i.appendChild(e);else if(a!==4&&(a===27&&hr(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Xl(e,n,i),e=e.sibling;e!==null;)Xl(e,n,i),e=e.sibling}function hp(e){var n=e.stateNode,i=e.memoizedProps;try{for(var a=e.type,p=n.attributes;p.length;)n.removeAttributeNode(p[0]);Vt(n,a,i),n[mt]=e,n[ct]=i}catch(x){at(e,e.return,x)}}var Li=!1,Ot=!1,uu=!1,fp=typeof WeakSet=="function"?WeakSet:Set,Ut=null;function Uy(e,n){if(e=e.containerInfo,Mu=vo,e=xf(e),ic(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var a=i.getSelection&&i.getSelection();if(a&&a.rangeCount!==0){i=a.anchorNode;var p=a.anchorOffset,x=a.focusNode;a=a.focusOffset;try{i.nodeType,x.nodeType}catch{i=null;break e}var B=0,F=-1,X=-1,ae=0,de=0,_e=e,oe=null;t:for(;;){for(var ue;_e!==i||p!==0&&_e.nodeType!==3||(F=B+p),_e!==x||a!==0&&_e.nodeType!==3||(X=B+a),_e.nodeType===3&&(B+=_e.nodeValue.length),(ue=_e.firstChild)!==null;)oe=_e,_e=ue;for(;;){if(_e===e)break t;if(oe===i&&++ae===p&&(F=B),oe===x&&++de===a&&(X=B),(ue=_e.nextSibling)!==null)break;_e=oe,oe=_e.parentNode}_e=ue}i=F===-1||X===-1?null:{start:F,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(Lu={focusedElem:e,selectionRange:i},vo=!1,Ut=n;Ut!==null;)if(n=Ut,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Ut=e;else for(;Ut!==null;){switch(n=Ut,x=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)p=e[i],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&x!==null){e=void 0,i=n,p=x.memoizedProps,x=x.memoizedState,a=i.stateNode;try{var Ae=qr(i.type,p);e=a.getSnapshotBeforeUpdate(Ae,x),a.__reactInternalSnapshotBeforeUpdate=e}catch(je){at(i,i.return,je)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,i=e.nodeType,i===9)ju(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":ju(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=n.sibling,e!==null){e.return=n.return,Ut=e;break}Ut=n.return}}function dp(e,n,i){var a=i.flags;switch(i.tag){case 0:case 11:case 15:Bi(e,i),a&4&&Ta(5,i);break;case 1:if(Bi(e,i),a&4)if(e=i.stateNode,n===null)try{e.componentDidMount()}catch(B){at(i,i.return,B)}else{var p=qr(i.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(p,n,e.__reactInternalSnapshotBeforeUpdate)}catch(B){at(i,i.return,B)}}a&64&&lp(i),a&512&&Ra(i,i.return);break;case 3:if(Bi(e,i),a&64&&(e=i.updateQueue,e!==null)){if(n=null,i.child!==null)switch(i.child.tag){case 27:case 5:n=i.child.stateNode;break;case 1:n=i.child.stateNode}try{Qf(e,n)}catch(B){at(i,i.return,B)}}break;case 27:n===null&&a&4&&hp(i);case 26:case 5:Bi(e,i),n===null&&a&4&&cp(i),a&512&&Ra(i,i.return);break;case 12:Bi(e,i);break;case 31:Bi(e,i),a&4&&gp(e,i);break;case 13:Bi(e,i),a&4&&_p(e,i),a&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Yy.bind(null,i),m0(e,i))));break;case 22:if(a=i.memoizedState!==null||Li,!a){n=n!==null&&n.memoizedState!==null||Ot,p=Li;var x=Ot;Li=a,(Ot=n)&&!x?ji(e,i,(i.subtreeFlags&8772)!==0):Bi(e,i),Li=p,Ot=x}break;case 30:break;default:Bi(e,i)}}function pp(e){var n=e.alternate;n!==null&&(e.alternate=null,pp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&es(n)),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 St=null,mn=!1;function Oi(e,n,i){for(i=i.child;i!==null;)mp(e,n,i),i=i.sibling}function mp(e,n,i){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(wt,i)}catch{}switch(i.tag){case 26:Ot||hi(i,n),Oi(e,n,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Ot||hi(i,n);var a=St,p=mn;hr(i.type)&&(St=i.stateNode,mn=!1),Oi(e,n,i),za(i.stateNode),St=a,mn=p;break;case 5:Ot||hi(i,n);case 6:if(a=St,p=mn,St=null,Oi(e,n,i),St=a,mn=p,St!==null)if(mn)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(i.stateNode)}catch(x){at(i,n,x)}else try{St.removeChild(i.stateNode)}catch(x){at(i,n,x)}break;case 18:St!==null&&(mn?(e=St,lm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Us(e)):lm(St,i.stateNode));break;case 4:a=St,p=mn,St=i.stateNode.containerInfo,mn=!0,Oi(e,n,i),St=a,mn=p;break;case 0:case 11:case 14:case 15:rr(2,i,n),Ot||rr(4,i,n),Oi(e,n,i);break;case 1:Ot||(hi(i,n),a=i.stateNode,typeof a.componentWillUnmount=="function"&&op(i,n,a)),Oi(e,n,i);break;case 21:Oi(e,n,i);break;case 22:Ot=(a=Ot)||i.memoizedState!==null,Oi(e,n,i),Ot=a;break;default:Oi(e,n,i)}}function gp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Us(e)}catch(i){at(n,n.return,i)}}}function _p(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Us(e)}catch(i){at(n,n.return,i)}}function Py(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new fp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new fp),n;default:throw Error(l(435,e.tag))}}function Ql(e,n){var i=Py(e);n.forEach(function(a){if(!i.has(a)){i.add(a);var p=Xy.bind(null,e,a);a.then(p,p)}})}function gn(e,n){var i=n.deletions;if(i!==null)for(var a=0;a<i.length;a++){var p=i[a],x=e,B=n,F=B;e:for(;F!==null;){switch(F.tag){case 27:if(hr(F.type)){St=F.stateNode,mn=!1;break e}break;case 5:St=F.stateNode,mn=!1;break e;case 3:case 4:St=F.stateNode.containerInfo,mn=!0;break e}F=F.return}if(St===null)throw Error(l(160));mp(x,B,p),St=null,mn=!1,x=p.alternate,x!==null&&(x.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)vp(n,e),n=n.sibling}var ni=null;function vp(e,n){var i=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gn(n,e),_n(e),a&4&&(rr(3,e,e.return),Ta(3,e),rr(5,e,e.return));break;case 1:gn(n,e),_n(e),a&512&&(Ot||i===null||hi(i,i.return)),a&64&&Li&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?a:i.concat(a))));break;case 26:var p=ni;if(gn(n,e),_n(e),a&512&&(Ot||i===null||hi(i,i.return)),a&4){var x=i!==null?i.memoizedState:null;if(a=e.memoizedState,i===null)if(a===null)if(e.stateNode===null){e:{a=e.type,i=e.memoizedProps,p=p.ownerDocument||p;t:switch(a){case"title":x=p.getElementsByTagName("title")[0],(!x||x[wr]||x[mt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=p.createElement(a),p.head.insertBefore(x,p.querySelector("head > title"))),Vt(x,a,i),x[mt]=e,kt(x),a=x;break e;case"link":var B=vm("link","href",p).get(a+(i.href||""));if(B){for(var F=0;F<B.length;F++)if(x=B[F],x.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&x.getAttribute("rel")===(i.rel==null?null:i.rel)&&x.getAttribute("title")===(i.title==null?null:i.title)&&x.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){B.splice(F,1);break t}}x=p.createElement(a),Vt(x,a,i),p.head.appendChild(x);break;case"meta":if(B=vm("meta","content",p).get(a+(i.content||""))){for(F=0;F<B.length;F++)if(x=B[F],x.getAttribute("content")===(i.content==null?null:""+i.content)&&x.getAttribute("name")===(i.name==null?null:i.name)&&x.getAttribute("property")===(i.property==null?null:i.property)&&x.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&x.getAttribute("charset")===(i.charSet==null?null:i.charSet)){B.splice(F,1);break t}}x=p.createElement(a),Vt(x,a,i),p.head.appendChild(x);break;default:throw Error(l(468,a))}x[mt]=e,kt(x),a=x}e.stateNode=a}else ym(p,e.type,e.stateNode);else e.stateNode=_m(p,a,e.memoizedProps);else x!==a?(x===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):x.count--,a===null?ym(p,e.type,e.stateNode):_m(p,a,e.memoizedProps)):a===null&&e.stateNode!==null&&lu(e,e.memoizedProps,i.memoizedProps)}break;case 27:gn(n,e),_n(e),a&512&&(Ot||i===null||hi(i,i.return)),i!==null&&a&4&&lu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(gn(n,e),_n(e),a&512&&(Ot||i===null||hi(i,i.return)),e.flags&32){p=e.stateNode;try{Ci(p,"")}catch(Ae){at(e,e.return,Ae)}}a&4&&e.stateNode!=null&&(p=e.memoizedProps,lu(e,p,i!==null?i.memoizedProps:p)),a&1024&&(uu=!0);break;case 6:if(gn(n,e),_n(e),a&4){if(e.stateNode===null)throw Error(l(162));a=e.memoizedProps,i=e.stateNode;try{i.nodeValue=a}catch(Ae){at(e,e.return,Ae)}}break;case 3:if(po=null,p=ni,ni=ho(n.containerInfo),gn(n,e),ni=p,_n(e),a&4&&i!==null&&i.memoizedState.isDehydrated)try{Us(n.containerInfo)}catch(Ae){at(e,e.return,Ae)}uu&&(uu=!1,yp(e));break;case 4:a=ni,ni=ho(e.stateNode.containerInfo),gn(n,e),_n(e),ni=a;break;case 12:gn(n,e),_n(e);break;case 31:gn(n,e),_n(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ql(e,a)));break;case 13:gn(n,e),_n(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Zl=nt()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ql(e,a)));break;case 22:p=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,ae=Li,de=Ot;if(Li=ae||p,Ot=de||X,gn(n,e),Ot=de,Li=ae,_n(e),a&8192)e:for(n=e.stateNode,n._visibility=p?n._visibility&-2:n._visibility|1,p&&(i===null||X||Li||Ot||$r(e)),i=null,n=e;;){if(n.tag===5||n.tag===26){if(i===null){X=i=n;try{if(x=X.stateNode,p)B=x.style,typeof B.setProperty=="function"?B.setProperty("display","none","important"):B.display="none";else{F=X.stateNode;var _e=X.memoizedProps.style,oe=_e!=null&&_e.hasOwnProperty("display")?_e.display:null;F.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Ae){at(X,X.return,Ae)}}}else if(n.tag===6){if(i===null){X=n;try{X.stateNode.nodeValue=p?"":X.memoizedProps}catch(Ae){at(X,X.return,Ae)}}}else if(n.tag===18){if(i===null){X=n;try{var ue=X.stateNode;p?om(ue,!0):om(X.stateNode,!1)}catch(Ae){at(X,X.return,Ae)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;i===n&&(i=null),n=n.return}i===n&&(i=null),n.sibling.return=n.return,n=n.sibling}a&4&&(a=e.updateQueue,a!==null&&(i=a.retryQueue,i!==null&&(a.retryQueue=null,Ql(e,i))));break;case 19:gn(n,e),_n(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ql(e,a)));break;case 30:break;case 21:break;default:gn(n,e),_n(e)}}function _n(e){var n=e.flags;if(n&2){try{for(var i,a=e.return;a!==null;){if(up(a)){i=a;break}a=a.return}if(i==null)throw Error(l(160));switch(i.tag){case 27:var p=i.stateNode,x=ou(e);Xl(e,x,p);break;case 5:var B=i.stateNode;i.flags&32&&(Ci(B,""),i.flags&=-33);var F=ou(e);Xl(e,F,B);break;case 3:case 4:var X=i.stateNode.containerInfo,ae=ou(e);cu(e,ae,X);break;default:throw Error(l(161))}}catch(de){at(e,e.return,de)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function yp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;yp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Bi(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)dp(e,n.alternate,n),n=n.sibling}function $r(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:rr(4,n,n.return),$r(n);break;case 1:hi(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&op(n,n.return,i),$r(n);break;case 27:za(n.stateNode);case 26:case 5:hi(n,n.return),$r(n);break;case 22:n.memoizedState===null&&$r(n);break;case 30:$r(n);break;default:$r(n)}e=e.sibling}}function ji(e,n,i){for(i=i&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var a=n.alternate,p=e,x=n,B=x.flags;switch(x.tag){case 0:case 11:case 15:ji(p,x,i),Ta(4,x);break;case 1:if(ji(p,x,i),a=x,p=a.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ae){at(a,a.return,ae)}if(a=x,p=a.updateQueue,p!==null){var F=a.stateNode;try{var X=p.shared.hiddenCallbacks;if(X!==null)for(p.shared.hiddenCallbacks=null,p=0;p<X.length;p++)Xf(X[p],F)}catch(ae){at(a,a.return,ae)}}i&&B&64&&lp(x),Ra(x,x.return);break;case 27:hp(x);case 26:case 5:ji(p,x,i),i&&a===null&&B&4&&cp(x),Ra(x,x.return);break;case 12:ji(p,x,i);break;case 31:ji(p,x,i),i&&B&4&&gp(p,x);break;case 13:ji(p,x,i),i&&B&4&&_p(p,x);break;case 22:x.memoizedState===null&&ji(p,x,i),Ra(x,x.return);break;case 30:break;default:ji(p,x,i)}n=n.sibling}}function hu(e,n){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&ma(i))}function fu(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ma(e))}function ii(e,n,i,a){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Sp(e,n,i,a),n=n.sibling}function Sp(e,n,i,a){var p=n.flags;switch(n.tag){case 0:case 11:case 15:ii(e,n,i,a),p&2048&&Ta(9,n);break;case 1:ii(e,n,i,a);break;case 3:ii(e,n,i,a),p&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ma(e)));break;case 12:if(p&2048){ii(e,n,i,a),e=n.stateNode;try{var x=n.memoizedProps,B=x.id,F=x.onPostCommit;typeof F=="function"&&F(B,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){at(n,n.return,X)}}else ii(e,n,i,a);break;case 31:ii(e,n,i,a);break;case 13:ii(e,n,i,a);break;case 23:break;case 22:x=n.stateNode,B=n.alternate,n.memoizedState!==null?x._visibility&2?ii(e,n,i,a):Da(e,n):x._visibility&2?ii(e,n,i,a):(x._visibility|=2,Rs(e,n,i,a,(n.subtreeFlags&10256)!==0||!1)),p&2048&&hu(B,n);break;case 24:ii(e,n,i,a),p&2048&&fu(n.alternate,n);break;default:ii(e,n,i,a)}}function Rs(e,n,i,a,p){for(p=p&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var x=e,B=n,F=i,X=a,ae=B.flags;switch(B.tag){case 0:case 11:case 15:Rs(x,B,F,X,p),Ta(8,B);break;case 23:break;case 22:var de=B.stateNode;B.memoizedState!==null?de._visibility&2?Rs(x,B,F,X,p):Da(x,B):(de._visibility|=2,Rs(x,B,F,X,p)),p&&ae&2048&&hu(B.alternate,B);break;case 24:Rs(x,B,F,X,p),p&&ae&2048&&fu(B.alternate,B);break;default:Rs(x,B,F,X,p)}n=n.sibling}}function Da(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var i=e,a=n,p=a.flags;switch(a.tag){case 22:Da(i,a),p&2048&&hu(a.alternate,a);break;case 24:Da(i,a),p&2048&&fu(a.alternate,a);break;default:Da(i,a)}n=n.sibling}}var Ma=8192;function Ds(e,n,i){if(e.subtreeFlags&Ma)for(e=e.child;e!==null;)bp(e,n,i),e=e.sibling}function bp(e,n,i){switch(e.tag){case 26:Ds(e,n,i),e.flags&Ma&&e.memoizedState!==null&&A0(i,ni,e.memoizedState,e.memoizedProps);break;case 5:Ds(e,n,i);break;case 3:case 4:var a=ni;ni=ho(e.stateNode.containerInfo),Ds(e,n,i),ni=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Ma,Ma=16777216,Ds(e,n,i),Ma=a):Ds(e,n,i));break;default:Ds(e,n,i)}}function Cp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function La(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];Ut=a,xp(a,e)}Cp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wp(e),e=e.sibling}function wp(e){switch(e.tag){case 0:case 11:case 15:La(e),e.flags&2048&&rr(9,e,e.return);break;case 3:La(e);break;case 12:La(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Jl(e)):La(e);break;default:La(e)}}function Jl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];Ut=a,xp(a,e)}Cp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:rr(8,n,n.return),Jl(n);break;case 22:i=n.stateNode,i._visibility&2&&(i._visibility&=-3,Jl(n));break;default:Jl(n)}e=e.sibling}}function xp(e,n){for(;Ut!==null;){var i=Ut;switch(i.tag){case 0:case 11:case 15:rr(8,i,n);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var a=i.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:ma(i.memoizedState.cache)}if(a=i.child,a!==null)a.return=i,Ut=a;else e:for(i=e;Ut!==null;){a=Ut;var p=a.sibling,x=a.return;if(pp(a),a===i){Ut=null;break e}if(p!==null){p.return=x,Ut=p;break e}Ut=x}}}var Fy={getCacheForType:function(e){var n=$t(Dt),i=n.data.get(e);return i===void 0&&(i=e(),n.data.set(e,i)),i},cacheSignal:function(){return $t(Dt).controller.signal}},qy=typeof WeakMap=="function"?WeakMap:Map,rt=0,dt=null,Ve=null,Xe=0,st=0,Mn=null,sr=!1,Ms=!1,du=!1,Ni=0,Et=0,ar=0,Gr=0,pu=0,Ln=0,Ls=0,Oa=null,vn=null,mu=!1,Zl=0,Ep=0,eo=1/0,to=null,lr=null,zt=0,or=null,Os=null,Hi=0,gu=0,_u=null,kp=null,Ba=0,vu=null;function On(){return(rt&2)!==0&&Xe!==0?Xe&-Xe:V.T!==null?xu():li()}function Ap(){if(Ln===0)if((Xe&536870912)===0||Je){var e=gi;gi<<=1,(gi&3932160)===0&&(gi=262144),Ln=e}else Ln=536870912;return e=Rn.current,e!==null&&(e.flags|=32),Ln}function yn(e,n,i){(e===dt&&(st===2||st===9)||e.cancelPendingCommit!==null)&&(Bs(e,0),cr(e,Xe,Ln,!1)),In(e,i),((rt&2)===0||e!==dt)&&(e===dt&&((rt&2)===0&&(Gr|=i),Et===4&&cr(e,Xe,Ln,!1)),fi(e))}function Tp(e,n,i){if((rt&6)!==0)throw Error(l(327));var a=!i&&(n&127)===0&&(n&e.expiredLanes)===0||Jn(e,n),p=a?Vy(e,n):Su(e,n,!0),x=a;do{if(p===0){Ms&&!a&&cr(e,n,0,!1);break}else{if(i=e.current.alternate,x&&!$y(i)){p=Su(e,n,!1),x=!1;continue}if(p===2){if(x=n,e.errorRecoveryDisabledLanes&x)var B=0;else B=e.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){n=B;e:{var F=e;p=Oa;var X=F.current.memoizedState.isDehydrated;if(X&&(Bs(F,B).flags|=256),B=Su(F,B,!1),B!==2){if(du&&!X){F.errorRecoveryDisabledLanes|=x,Gr|=x,p=4;break e}x=vn,vn=p,x!==null&&(vn===null?vn=x:vn.push.apply(vn,x))}p=B}if(x=!1,p!==2)continue}}if(p===1){Bs(e,0),cr(e,n,0,!0);break}e:{switch(a=e,x=p,x){case 0:case 1:throw Error(l(345));case 4:if((n&4194048)!==n)break;case 6:cr(a,n,Ln,!sr);break e;case 2:vn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((n&62914560)===n&&(p=Zl+300-nt(),10<p)){if(cr(a,n,Ln,!sr),Fi(a,0,!0)!==0)break e;Hi=n,a.timeoutHandle=sm(Rp.bind(null,a,i,vn,to,mu,n,Ln,Gr,Ls,sr,x,"Throttled",-0,0),p);break e}Rp(a,i,vn,to,mu,n,Ln,Gr,Ls,sr,x,null,-0,0)}}break}while(!0);fi(e)}function Rp(e,n,i,a,p,x,B,F,X,ae,de,_e,oe,ue){if(e.timeoutHandle=-1,_e=n.subtreeFlags,_e&8192||(_e&16785408)===16785408){_e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},bp(n,x,_e);var Ae=(x&62914560)===x?Zl-nt():(x&4194048)===x?Ep-nt():0;if(Ae=T0(_e,Ae),Ae!==null){Hi=x,e.cancelPendingCommit=Ae(Hp.bind(null,e,n,x,i,a,p,B,F,X,de,_e,null,oe,ue)),cr(e,x,B,!ae);return}}Hp(e,n,x,i,a,p,B,F,X)}function $y(e){for(var n=e;;){var i=n.tag;if((i===0||i===11||i===15)&&n.flags&16384&&(i=n.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var a=0;a<i.length;a++){var p=i[a],x=p.getSnapshot;p=p.value;try{if(!An(x(),p))return!1}catch{return!1}}if(i=n.child,n.subtreeFlags&16384&&i!==null)i.return=n,n=i;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function cr(e,n,i,a){n&=~pu,n&=~Gr,e.suspendedLanes|=n,e.pingedLanes&=~n,a&&(e.warmLanes|=n),a=e.expirationTimes;for(var p=n;0<p;){var x=31-it(p),B=1<<x;a[x]=-1,p&=~B}i!==0&&_i(e,i,n)}function no(){return(rt&6)===0?(ja(0),!1):!0}function yu(){if(Ve!==null){if(st===0)var e=Ve.return;else e=Ve,ki=Nr=null,jc(e),xs=null,_a=0,e=Ve;for(;e!==null;)ap(e.alternate,e),e=e.return;Ve=null}}function Bs(e,n){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,u0(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Hi=0,yu(),dt=e,Ve=i=xi(e.current,null),Xe=n,st=0,Mn=null,sr=!1,Ms=Jn(e,n),du=!1,Ls=Ln=pu=Gr=ar=Et=0,vn=Oa=null,mu=!1,(n&8)!==0&&(n|=n&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=n;0<a;){var p=31-it(a),x=1<<p;n|=e[p],a&=~x}return Ni=n,wl(),i}function Dp(e,n){Ue=null,V.H=Ea,n===ws||n===Ml?(n=Vf(),st=3):n===wc?(n=Vf(),st=4):st=n===Qc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Mn=n,Ve===null&&(Et=1,Gl(e,$n(n,e.current)))}function Mp(){var e=Rn.current;return e===null?!0:(Xe&4194048)===Xe?Kn===null:(Xe&62914560)===Xe||(Xe&536870912)!==0?e===Kn:!1}function Lp(){var e=V.H;return V.H=Ea,e===null?Ea:e}function Op(){var e=V.A;return V.A=Fy,e}function io(){Et=4,sr||(Xe&4194048)!==Xe&&Rn.current!==null||(Ms=!0),(ar&134217727)===0&&(Gr&134217727)===0||dt===null||cr(dt,Xe,Ln,!1)}function Su(e,n,i){var a=rt;rt|=2;var p=Lp(),x=Op();(dt!==e||Xe!==n)&&(to=null,Bs(e,n)),n=!1;var B=Et;e:do try{if(st!==0&&Ve!==null){var F=Ve,X=Mn;switch(st){case 8:yu(),B=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(n=!0);var ae=st;if(st=0,Mn=null,js(e,F,X,ae),i&&Ms){B=0;break e}break;default:ae=st,st=0,Mn=null,js(e,F,X,ae)}}Gy(),B=Et;break}catch(de){Dp(e,de)}while(!0);return n&&e.shellSuspendCounter++,ki=Nr=null,rt=a,V.H=p,V.A=x,Ve===null&&(dt=null,Xe=0,wl()),B}function Gy(){for(;Ve!==null;)Bp(Ve)}function Vy(e,n){var i=rt;rt|=2;var a=Lp(),p=Op();dt!==e||Xe!==n?(to=null,eo=nt()+500,Bs(e,n)):Ms=Jn(e,n);e:do try{if(st!==0&&Ve!==null){n=Ve;var x=Mn;t:switch(st){case 1:st=0,Mn=null,js(e,n,x,1);break;case 2:case 9:if($f(x)){st=0,Mn=null,jp(n);break}n=function(){st!==2&&st!==9||dt!==e||(st=7),fi(e)},x.then(n,n);break e;case 3:st=7;break e;case 4:st=5;break e;case 7:$f(x)?(st=0,Mn=null,jp(n)):(st=0,Mn=null,js(e,n,x,7));break;case 5:var B=null;switch(Ve.tag){case 26:B=Ve.memoizedState;case 5:case 27:var F=Ve;if(B?Sm(B):F.stateNode.complete){st=0,Mn=null;var X=F.sibling;if(X!==null)Ve=X;else{var ae=F.return;ae!==null?(Ve=ae,ro(ae)):Ve=null}break t}}st=0,Mn=null,js(e,n,x,5);break;case 6:st=0,Mn=null,js(e,n,x,6);break;case 8:yu(),Et=6;break e;default:throw Error(l(462))}}Wy();break}catch(de){Dp(e,de)}while(!0);return ki=Nr=null,V.H=a,V.A=p,rt=i,Ve!==null?0:(dt=null,Xe=0,wl(),Et)}function Wy(){for(;Ve!==null&&!ve();)Bp(Ve)}function Bp(e){var n=rp(e.alternate,e,Ni);e.memoizedProps=e.pendingProps,n===null?ro(e):Ve=n}function jp(e){var n=e,i=n.alternate;switch(n.tag){case 15:case 0:n=Jd(i,n,n.pendingProps,n.type,void 0,Xe);break;case 11:n=Jd(i,n,n.pendingProps,n.type.render,n.ref,Xe);break;case 5:jc(n);default:ap(i,n),n=Ve=Of(n,Ni),n=rp(i,n,Ni)}e.memoizedProps=e.pendingProps,n===null?ro(e):Ve=n}function js(e,n,i,a){ki=Nr=null,jc(n),xs=null,_a=0;var p=n.return;try{if(jy(e,p,n,i,Xe)){Et=1,Gl(e,$n(i,e.current)),Ve=null;return}}catch(x){if(p!==null)throw Ve=p,x;Et=1,Gl(e,$n(i,e.current)),Ve=null;return}n.flags&32768?(Je||a===1?e=!0:Ms||(Xe&536870912)!==0?e=!1:(sr=e=!0,(a===2||a===9||a===3||a===6)&&(a=Rn.current,a!==null&&a.tag===13&&(a.flags|=16384))),Np(n,e)):ro(n)}function ro(e){var n=e;do{if((n.flags&32768)!==0){Np(n,sr);return}e=n.return;var i=zy(n.alternate,n,Ni);if(i!==null){Ve=i;return}if(n=n.sibling,n!==null){Ve=n;return}Ve=n=e}while(n!==null);Et===0&&(Et=5)}function Np(e,n){do{var i=Iy(e.alternate,e);if(i!==null){i.flags&=32767,Ve=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!n&&(e=e.sibling,e!==null)){Ve=e;return}Ve=e=i}while(e!==null);Et=6,Ve=null}function Hp(e,n,i,a,p,x,B,F,X){e.cancelPendingCommit=null;do so();while(zt!==0);if((rt&6)!==0)throw Error(l(327));if(n!==null){if(n===e.current)throw Error(l(177));if(x=n.lanes|n.childLanes,x|=oc,qi(e,i,x,B,F,X),e===dt&&(Ve=dt=null,Xe=0),Os=n,or=e,Hi=i,gu=x,_u=p,kp=a,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Qy(Ee,function(){return Fp(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||a){a=V.T,V.T=null,p=Y.p,Y.p=2,B=rt,rt|=4;try{Uy(e,n,i)}finally{rt=B,Y.p=p,V.T=a}}zt=1,zp(),Ip(),Up()}}function zp(){if(zt===1){zt=0;var e=or,n=Os,i=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var p=rt;rt|=4;try{vp(n,e);var x=Lu,B=xf(e.containerInfo),F=x.focusedElem,X=x.selectionRange;if(B!==F&&F&&F.ownerDocument&&wf(F.ownerDocument.documentElement,F)){if(X!==null&&ic(F)){var ae=X.start,de=X.end;if(de===void 0&&(de=ae),"selectionStart"in F)F.selectionStart=ae,F.selectionEnd=Math.min(de,F.value.length);else{var _e=F.ownerDocument||document,oe=_e&&_e.defaultView||window;if(oe.getSelection){var ue=oe.getSelection(),Ae=F.textContent.length,je=Math.min(X.start,Ae),ft=X.end===void 0?je:Math.min(X.end,Ae);!ue.extend&&je>ft&&(B=ft,ft=je,je=B);var ne=Cf(F,je),J=Cf(F,ft);if(ne&&J&&(ue.rangeCount!==1||ue.anchorNode!==ne.node||ue.anchorOffset!==ne.offset||ue.focusNode!==J.node||ue.focusOffset!==J.offset)){var se=_e.createRange();se.setStart(ne.node,ne.offset),ue.removeAllRanges(),je>ft?(ue.addRange(se),ue.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),ue.addRange(se))}}}}for(_e=[],ue=F;ue=ue.parentNode;)ue.nodeType===1&&_e.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof F.focus=="function"&&F.focus(),F=0;F<_e.length;F++){var me=_e[F];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}vo=!!Mu,Lu=Mu=null}finally{rt=p,Y.p=a,V.T=i}}e.current=n,zt=2}}function Ip(){if(zt===2){zt=0;var e=or,n=Os,i=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||i){i=V.T,V.T=null;var a=Y.p;Y.p=2;var p=rt;rt|=4;try{dp(e,n.alternate,n)}finally{rt=p,Y.p=a,V.T=i}}zt=3}}function Up(){if(zt===4||zt===3){zt=0,ke();var e=or,n=Os,i=Hi,a=kp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?zt=5:(zt=0,Os=or=null,Pp(e,e.pendingLanes));var p=e.pendingLanes;if(p===0&&(lr=null),Pt(i),n=n.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(wt,n,void 0,(n.current.flags&128)===128)}catch{}if(a!==null){n=V.T,p=Y.p,Y.p=2,V.T=null;try{for(var x=e.onRecoverableError,B=0;B<a.length;B++){var F=a[B];x(F.value,{componentStack:F.stack})}}finally{V.T=n,Y.p=p}}(Hi&3)!==0&&so(),fi(e),p=e.pendingLanes,(i&261930)!==0&&(p&42)!==0?e===vu?Ba++:(Ba=0,vu=e):Ba=0,ja(0)}}function Pp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ma(n)))}function so(){return zp(),Ip(),Up(),Fp()}function Fp(){if(zt!==5)return!1;var e=or,n=gu;gu=0;var i=Pt(Hi),a=V.T,p=Y.p;try{Y.p=32>i?32:i,V.T=null,i=_u,_u=null;var x=or,B=Hi;if(zt=0,Os=or=null,Hi=0,(rt&6)!==0)throw Error(l(331));var F=rt;if(rt|=4,wp(x.current),Sp(x,x.current,B,i),rt=F,ja(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(wt,x)}catch{}return!0}finally{Y.p=p,V.T=a,Pp(e,n)}}function qp(e,n,i){n=$n(i,n),n=Xc(e.stateNode,n,2),e=tr(e,n,2),e!==null&&(In(e,2),fi(e))}function at(e,n,i){if(e.tag===3)qp(e,e,i);else for(;n!==null;){if(n.tag===3){qp(n,e,i);break}else if(n.tag===1){var a=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(lr===null||!lr.has(a))){e=$n(i,e),i=$d(2),a=tr(n,i,2),a!==null&&(Gd(i,a,n,e),In(a,2),fi(a));break}}n=n.return}}function bu(e,n,i){var a=e.pingCache;if(a===null){a=e.pingCache=new qy;var p=new Set;a.set(n,p)}else p=a.get(n),p===void 0&&(p=new Set,a.set(n,p));p.has(i)||(du=!0,p.add(i),e=Ky.bind(null,e,n,i),n.then(e,e))}function Ky(e,n,i){var a=e.pingCache;a!==null&&a.delete(n),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,dt===e&&(Xe&i)===i&&(Et===4||Et===3&&(Xe&62914560)===Xe&&300>nt()-Zl?(rt&2)===0&&Bs(e,0):pu|=i,Ls===Xe&&(Ls=0)),fi(e)}function $p(e,n){n===0&&(n=sn()),e=Or(e,n),e!==null&&(In(e,n),fi(e))}function Yy(e){var n=e.memoizedState,i=0;n!==null&&(i=n.retryLane),$p(e,i)}function Xy(e,n){var i=0;switch(e.tag){case 31:case 13:var a=e.stateNode,p=e.memoizedState;p!==null&&(i=p.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(l(314))}a!==null&&a.delete(n),$p(e,i)}function Qy(e,n){return jt(e,n)}var ao=null,Ns=null,Cu=!1,lo=!1,wu=!1,ur=0;function fi(e){e!==Ns&&e.next===null&&(Ns===null?ao=Ns=e:Ns=Ns.next=e),lo=!0,Cu||(Cu=!0,Zy())}function ja(e,n){if(!wu&&lo){wu=!0;do for(var i=!1,a=ao;a!==null;){if(e!==0){var p=a.pendingLanes;if(p===0)var x=0;else{var B=a.suspendedLanes,F=a.pingedLanes;x=(1<<31-it(42|e)+1)-1,x&=p&~(B&~F),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(i=!0,Kp(a,x))}else x=Xe,x=Fi(a,a===dt?x:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(x&3)===0||Jn(a,x)||(i=!0,Kp(a,x));a=a.next}while(i);wu=!1}}function Jy(){Gp()}function Gp(){lo=Cu=!1;var e=0;ur!==0&&c0()&&(e=ur);for(var n=nt(),i=null,a=ao;a!==null;){var p=a.next,x=Vp(a,n);x===0?(a.next=null,i===null?ao=p:i.next=p,p===null&&(Ns=i)):(i=a,(e!==0||(x&3)!==0)&&(lo=!0)),a=p}zt!==0&&zt!==5||ja(e),ur!==0&&(ur=0)}function Vp(e,n){for(var i=e.suspendedLanes,a=e.pingedLanes,p=e.expirationTimes,x=e.pendingLanes&-62914561;0<x;){var B=31-it(x),F=1<<B,X=p[B];X===-1?((F&i)===0||(F&a)!==0)&&(p[B]=si(F,n)):X<=n&&(e.expiredLanes|=F),x&=~F}if(n=dt,i=Xe,i=Fi(e,e===n?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,i===0||e===n&&(st===2||st===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&re(a),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Jn(e,i)){if(n=i&-i,n===e.callbackPriority)return n;switch(a!==null&&re(a),Pt(i)){case 2:case 8:i=Se;break;case 32:i=Ee;break;case 268435456:i=Ne;break;default:i=Ee}return a=Wp.bind(null,e),i=jt(i,a),e.callbackPriority=n,e.callbackNode=i,n}return a!==null&&a!==null&&re(a),e.callbackPriority=2,e.callbackNode=null,2}function Wp(e,n){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(so()&&e.callbackNode!==i)return null;var a=Xe;return a=Fi(e,e===dt?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Tp(e,a,n),Vp(e,nt()),e.callbackNode!=null&&e.callbackNode===i?Wp.bind(null,e):null)}function Kp(e,n){if(so())return null;Tp(e,n,!0)}function Zy(){h0(function(){(rt&6)!==0?jt(ce,Jy):Gp()})}function xu(){if(ur===0){var e=bs;e===0&&(e=mi,mi<<=1,(mi&261888)===0&&(mi=256)),ur=e}return ur}function Yp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ss(""+e)}function Xp(e,n){var i=n.ownerDocument.createElement("input");return i.name=n.name,i.value=n.value,e.id&&i.setAttribute("form",e.id),n.parentNode.insertBefore(i,n),e=new FormData(e),i.parentNode.removeChild(i),e}function e0(e,n,i,a,p){if(n==="submit"&&i&&i.stateNode===p){var x=Yp((p[ct]||null).action),B=a.submitter;B&&(n=(n=B[ct]||null)?Yp(n.formAction):B.getAttribute("formAction"),n!==null&&(x=n,B=null));var F=new us("action","action",null,a,p);e.push({event:F,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(ur!==0){var X=B?Xp(p,B):new FormData(p);$c(i,{pending:!0,data:X,method:p.method,action:x},null,X)}}else typeof x=="function"&&(F.preventDefault(),X=B?Xp(p,B):new FormData(p),$c(i,{pending:!0,data:X,method:p.method,action:x},x,X))},currentTarget:p}]})}}for(var Eu=0;Eu<lc.length;Eu++){var ku=lc[Eu],t0=ku.toLowerCase(),n0=ku[0].toUpperCase()+ku.slice(1);ti(t0,"on"+n0)}ti(Af,"onAnimationEnd"),ti(Tf,"onAnimationIteration"),ti(Rf,"onAnimationStart"),ti("dblclick","onDoubleClick"),ti("focusin","onFocus"),ti("focusout","onBlur"),ti(vy,"onTransitionRun"),ti(yy,"onTransitionStart"),ti(Sy,"onTransitionCancel"),ti(Df,"onTransitionEnd"),fn("onMouseEnter",["mouseout","mouseover"]),fn("onMouseLeave",["mouseout","mouseover"]),fn("onPointerEnter",["pointerout","pointerover"]),fn("onPointerLeave",["pointerout","pointerover"]),oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Na="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(" "),i0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Na));function Qp(e,n){n=(n&4)!==0;for(var i=0;i<e.length;i++){var a=e[i],p=a.event;a=a.listeners;e:{var x=void 0;if(n)for(var B=a.length-1;0<=B;B--){var F=a[B],X=F.instance,ae=F.currentTarget;if(F=F.listener,X!==x&&p.isPropagationStopped())break e;x=F,p.currentTarget=ae;try{x(p)}catch(de){Cl(de)}p.currentTarget=null,x=X}else for(B=0;B<a.length;B++){if(F=a[B],X=F.instance,ae=F.currentTarget,F=F.listener,X!==x&&p.isPropagationStopped())break e;x=F,p.currentTarget=ae;try{x(p)}catch(de){Cl(de)}p.currentTarget=null,x=X}}}}function We(e,n){var i=n[$i];i===void 0&&(i=n[$i]=new Set);var a=e+"__bubble";i.has(a)||(Jp(n,e,2,!1),i.add(a))}function Au(e,n,i){var a=0;n&&(a|=4),Jp(i,e,a,n)}var oo="_reactListening"+Math.random().toString(36).slice(2);function Tu(e){if(!e[oo]){e[oo]=!0,pl.forEach(function(i){i!=="selectionchange"&&(i0.has(i)||Au(i,!1,e),Au(i,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[oo]||(n[oo]=!0,Au("selectionchange",!1,n))}}function Jp(e,n,i,a){switch(Am(n)){case 2:var p=M0;break;case 8:p=L0;break;default:p=qu}i=p.bind(null,n,i,e),p=void 0,!as||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),a?p!==void 0?e.addEventListener(n,i,{capture:!0,passive:p}):e.addEventListener(n,i,!0):p!==void 0?e.addEventListener(n,i,{passive:p}):e.addEventListener(n,i,!1)}function Ru(e,n,i,a,p){var x=a;if((n&1)===0&&(n&2)===0&&a!==null)e:for(;;){if(a===null)return;var B=a.tag;if(B===3||B===4){var F=a.stateNode.containerInfo;if(F===p)break;if(B===4)for(B=a.return;B!==null;){var X=B.tag;if((X===3||X===4)&&B.stateNode.containerInfo===p)return;B=B.return}for(;F!==null;){if(B=xn(F),B===null)return;if(X=B.tag,X===5||X===6||X===26||X===27){a=x=B;continue e}F=F.parentNode}}a=a.return}na(function(){var ae=x,de=Tr(i),_e=[];e:{var oe=Mf.get(e);if(oe!==void 0){var ue=us,Ae=e;switch(e){case"keypress":if(os(i)===0)break e;case"keydown":case"keyup":ue=Xv;break;case"focusin":Ae="focus",ue=G;break;case"focusout":Ae="blur",ue=G;break;case"beforeblur":case"afterblur":ue=G;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ue=hs;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ue=la;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ue=Zv;break;case Af:case Tf:case Rf:ue=Ye;break;case Df:ue=ty;break;case"scroll":case"scrollend":ue=Xo;break;case"wheel":ue=iy;break;case"copy":case"cut":case"paste":ue=wi;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ue=of;break;case"toggle":case"beforetoggle":ue=sy}var je=(n&4)!==0,ft=!je&&(e==="scroll"||e==="scrollend"),ne=je?oe!==null?oe+"Capture":null:oe;je=[];for(var J=ae,se;J!==null;){var me=J;if(se=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||se===null||ne===null||(me=Ki(J,ne),me!=null&&je.push(Ha(J,me,se))),ft)break;J=J.return}0<je.length&&(oe=new ue(oe,Ae,null,i,de),_e.push({event:oe,listeners:je}))}}if((n&7)===0){e:{if(oe=e==="mouseover"||e==="pointerover",ue=e==="mouseout"||e==="pointerout",oe&&i!==Ar&&(Ae=i.relatedTarget||i.fromElement)&&(xn(Ae)||Ae[Ht]))break e;if((ue||oe)&&(oe=de.window===de?de:(oe=de.ownerDocument)?oe.defaultView||oe.parentWindow:window,ue?(Ae=i.relatedTarget||i.toElement,ue=ae,Ae=Ae?xn(Ae):null,Ae!==null&&(ft=m(Ae),je=Ae.tag,Ae!==ft||je!==5&&je!==27&&je!==6)&&(Ae=null)):(ue=null,Ae=ae),ue!==Ae)){if(je=hs,me="onMouseLeave",ne="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(je=of,me="onPointerLeave",ne="onPointerEnter",J="pointer"),ft=ue==null?oe:xr(ue),se=Ae==null?oe:xr(Ae),oe=new je(me,J+"leave",ue,i,de),oe.target=ft,oe.relatedTarget=se,me=null,xn(de)===ae&&(je=new je(ne,J+"enter",Ae,i,de),je.target=se,je.relatedTarget=ft,me=je),ft=me,ue&&Ae)t:{for(je=r0,ne=ue,J=Ae,se=0,me=ne;me;me=je(me))se++;me=0;for(var Me=J;Me;Me=je(Me))me++;for(;0<se-me;)ne=je(ne),se--;for(;0<me-se;)J=je(J),me--;for(;se--;){if(ne===J||J!==null&&ne===J.alternate){je=ne;break t}ne=je(ne),J=je(J)}je=null}else je=null;ue!==null&&Zp(_e,oe,ue,je,!1),Ae!==null&&ft!==null&&Zp(_e,ft,Ae,je,!0)}}e:{if(oe=ae?xr(ae):window,ue=oe.nodeName&&oe.nodeName.toLowerCase(),ue==="select"||ue==="input"&&oe.type==="file")var et=gf;else if(pf(oe))if(_f)et=my;else{et=dy;var Re=fy}else ue=oe.nodeName,!ue||ue.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&ea(ae.elementType)&&(et=gf):et=py;if(et&&(et=et(e,ae))){mf(_e,et,i,de);break e}Re&&Re(e,oe,ae),e==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&Zs(oe,"number",oe.value)}switch(Re=ae?xr(ae):window,e){case"focusin":(pf(Re)||Re.contentEditable==="true")&&(ds=Re,rc=ae,fa=null);break;case"focusout":fa=rc=ds=null;break;case"mousedown":sc=!0;break;case"contextmenu":case"mouseup":case"dragend":sc=!1,Ef(_e,i,de);break;case"selectionchange":if(_y)break;case"keydown":case"keyup":Ef(_e,i,de)}var Fe;if(ec)e:{switch(e){case"compositionstart":var Qe="onCompositionStart";break e;case"compositionend":Qe="onCompositionEnd";break e;case"compositionupdate":Qe="onCompositionUpdate";break e}Qe=void 0}else fs?ff(e,i)&&(Qe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Qe="onCompositionStart");Qe&&(cf&&i.locale!=="ko"&&(fs||Qe!=="onCompositionStart"?Qe==="onCompositionEnd"&&fs&&(Fe=ra()):(an=de,ia="value"in an?an.value:an.textContent,fs=!0)),Re=co(ae,Qe),0<Re.length&&(Qe=new lf(Qe,e,null,i,de),_e.push({event:Qe,listeners:Re}),Fe?Qe.data=Fe:(Fe=df(i),Fe!==null&&(Qe.data=Fe)))),(Fe=ly?oy(e,i):cy(e,i))&&(Qe=co(ae,"onBeforeInput"),0<Qe.length&&(Re=new lf("onBeforeInput","beforeinput",null,i,de),_e.push({event:Re,listeners:Qe}),Re.data=Fe)),e0(_e,e,ae,i,de)}Qp(_e,n)})}function Ha(e,n,i){return{instance:e,listener:n,currentTarget:i}}function co(e,n){for(var i=n+"Capture",a=[];e!==null;){var p=e,x=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||x===null||(p=Ki(e,i),p!=null&&a.unshift(Ha(e,p,x)),p=Ki(e,n),p!=null&&a.push(Ha(e,p,x))),e.tag===3)return a;e=e.return}return[]}function r0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Zp(e,n,i,a,p){for(var x=n._reactName,B=[];i!==null&&i!==a;){var F=i,X=F.alternate,ae=F.stateNode;if(F=F.tag,X!==null&&X===a)break;F!==5&&F!==26&&F!==27||ae===null||(X=ae,p?(ae=Ki(i,x),ae!=null&&B.unshift(Ha(i,ae,X))):p||(ae=Ki(i,x),ae!=null&&B.push(Ha(i,ae,X)))),i=i.return}B.length!==0&&e.push({event:n,listeners:B})}var s0=/\r\n?/g,a0=/\u0000|\uFFFD/g;function em(e){return(typeof e=="string"?e:""+e).replace(s0,`
49
49
  `).replace(a0,"")}function tm(e,n){return n=em(n),em(e)===n}function ht(e,n,i,a,p,x){switch(i){case"children":typeof a=="string"?n==="body"||n==="textarea"&&a===""||Ci(e,a):(typeof a=="number"||typeof a=="bigint")&&n!=="body"&&Ci(e,""+a);break;case"className":bi(e,"class",a);break;case"tabIndex":bi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":bi(e,i,a);break;case"style":yl(e,a,x);break;case"data":if(n!=="object"){bi(e,"data",a);break}case"src":case"href":if(a===""&&(n!=="a"||i!=="href")){e.removeAttribute(i);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=ss(""+a),e.setAttribute(i,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(i,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(i==="formAction"?(n!=="input"&&ht(e,n,"name",p.name,p,null),ht(e,n,"formEncType",p.formEncType,p,null),ht(e,n,"formMethod",p.formMethod,p,null),ht(e,n,"formTarget",p.formTarget,p,null)):(ht(e,n,"encType",p.encType,p,null),ht(e,n,"method",p.method,p,null),ht(e,n,"target",p.target,p,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(i);break}a=ss(""+a),e.setAttribute(i,a);break;case"onClick":a!=null&&(e.onclick=Xt);break;case"onScroll":a!=null&&We("scroll",e);break;case"onScrollEnd":a!=null&&We("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(p.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}i=ss(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""+a):e.removeAttribute(i);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":a===!0?e.setAttribute(i,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(i,a):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(i,a):e.removeAttribute(i);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(i):e.setAttribute(i,a);break;case"popover":We("beforetoggle",e),We("toggle",e),Er(e,"popover",a);break;case"xlinkActuate":Pn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Pn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Pn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Pn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Pn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Pn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Pn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Pn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Pn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":Er(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ko.get(i)||i,Er(e,i,a))}}function Du(e,n,i,a,p,x){switch(i){case"style":yl(e,a,x);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(l(61));if(i=a.__html,i!=null){if(p.children!=null)throw Error(l(60));e.innerHTML=i}}break;case"children":typeof a=="string"?Ci(e,a):(typeof a=="number"||typeof a=="bigint")&&Ci(e,""+a);break;case"onScroll":a!=null&&We("scroll",e);break;case"onScrollEnd":a!=null&&We("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Xt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vi.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(p=i.endsWith("Capture"),n=i.slice(2,p?i.length-7:void 0),x=e[ct]||null,x=x!=null?x[i]:null,typeof x=="function"&&e.removeEventListener(n,x,p),typeof a=="function")){typeof x!="function"&&x!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(n,a,p);break e}i in e?e[i]=a:a===!0?e.setAttribute(i,""):Er(e,i,a)}}}function Vt(e,n,i){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",e),We("load",e);var a=!1,p=!1,x;for(x in i)if(i.hasOwnProperty(x)){var B=i[x];if(B!=null)switch(x){case"src":a=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ht(e,n,x,B,i,null)}}p&&ht(e,n,"srcSet",i.srcSet,i,null),a&&ht(e,n,"src",i.src,i,null);return;case"input":We("invalid",e);var F=x=B=p=null,X=null,ae=null;for(a in i)if(i.hasOwnProperty(a)){var de=i[a];if(de!=null)switch(a){case"name":p=de;break;case"type":B=de;break;case"checked":X=de;break;case"defaultChecked":ae=de;break;case"value":x=de;break;case"defaultValue":F=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(l(137,n));break;default:ht(e,n,a,de,i,null)}}_l(e,x,F,X,ae,B,p,!1);return;case"select":We("invalid",e),a=B=x=null;for(p in i)if(i.hasOwnProperty(p)&&(F=i[p],F!=null))switch(p){case"value":x=F;break;case"defaultValue":B=F;break;case"multiple":a=F;default:ht(e,n,p,F,i,null)}n=x,i=B,e.multiple=!!a,n!=null?Zn(e,!!a,n,!1):i!=null&&Zn(e,!!a,i,!0);return;case"textarea":We("invalid",e),x=p=a=null;for(B in i)if(i.hasOwnProperty(B)&&(F=i[B],F!=null))switch(B){case"value":a=F;break;case"defaultValue":p=F;break;case"children":x=F;break;case"dangerouslySetInnerHTML":if(F!=null)throw Error(l(91));break;default:ht(e,n,B,F,i,null)}Fn(e,a,p,x);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(a=i[X],a!=null))switch(X){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:ht(e,n,X,a,i,null)}return;case"dialog":We("beforetoggle",e),We("toggle",e),We("cancel",e),We("close",e);break;case"iframe":case"object":We("load",e);break;case"video":case"audio":for(a=0;a<Na.length;a++)We(Na[a],e);break;case"image":We("error",e),We("load",e);break;case"details":We("toggle",e);break;case"embed":case"source":case"link":We("error",e),We("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(ae in i)if(i.hasOwnProperty(ae)&&(a=i[ae],a!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,n));default:ht(e,n,ae,a,i,null)}return;default:if(ea(n)){for(de in i)i.hasOwnProperty(de)&&(a=i[de],a!==void 0&&Du(e,n,de,a,i,void 0));return}}for(F in i)i.hasOwnProperty(F)&&(a=i[F],a!=null&&ht(e,n,F,a,i,null))}function l0(e,n,i,a){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,x=null,B=null,F=null,X=null,ae=null,de=null;for(ue in i){var _e=i[ue];if(i.hasOwnProperty(ue)&&_e!=null)switch(ue){case"checked":break;case"value":break;case"defaultValue":X=_e;default:a.hasOwnProperty(ue)||ht(e,n,ue,null,a,_e)}}for(var oe in a){var ue=a[oe];if(_e=i[oe],a.hasOwnProperty(oe)&&(ue!=null||_e!=null))switch(oe){case"type":x=ue;break;case"name":p=ue;break;case"checked":ae=ue;break;case"defaultChecked":de=ue;break;case"value":B=ue;break;case"defaultValue":F=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,n));break;default:ue!==_e&&ht(e,n,oe,ue,a,_e)}}is(e,B,F,X,ae,de,x,p);return;case"select":ue=B=F=oe=null;for(x in i)if(X=i[x],i.hasOwnProperty(x)&&X!=null)switch(x){case"value":break;case"multiple":ue=X;default:a.hasOwnProperty(x)||ht(e,n,x,null,a,X)}for(p in a)if(x=a[p],X=i[p],a.hasOwnProperty(p)&&(x!=null||X!=null))switch(p){case"value":oe=x;break;case"defaultValue":F=x;break;case"multiple":B=x;default:x!==X&&ht(e,n,p,x,a,X)}n=F,i=B,a=ue,oe!=null?Zn(e,!!i,oe,!1):!!a!=!!i&&(n!=null?Zn(e,!!i,n,!0):Zn(e,!!i,i?[]:"",!1));return;case"textarea":ue=oe=null;for(F in i)if(p=i[F],i.hasOwnProperty(F)&&p!=null&&!a.hasOwnProperty(F))switch(F){case"value":break;case"children":break;default:ht(e,n,F,null,a,p)}for(B in a)if(p=a[B],x=i[B],a.hasOwnProperty(B)&&(p!=null||x!=null))switch(B){case"value":oe=p;break;case"defaultValue":ue=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==x&&ht(e,n,B,p,a,x)}Ft(e,oe,ue);return;case"option":for(var Ae in i)if(oe=i[Ae],i.hasOwnProperty(Ae)&&oe!=null&&!a.hasOwnProperty(Ae))switch(Ae){case"selected":e.selected=!1;break;default:ht(e,n,Ae,null,a,oe)}for(X in a)if(oe=a[X],ue=i[X],a.hasOwnProperty(X)&&oe!==ue&&(oe!=null||ue!=null))switch(X){case"selected":e.selected=oe&&typeof oe!="function"&&typeof oe!="symbol";break;default:ht(e,n,X,oe,a,ue)}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 je in i)oe=i[je],i.hasOwnProperty(je)&&oe!=null&&!a.hasOwnProperty(je)&&ht(e,n,je,null,a,oe);for(ae in a)if(oe=a[ae],ue=i[ae],a.hasOwnProperty(ae)&&oe!==ue&&(oe!=null||ue!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(l(137,n));break;default:ht(e,n,ae,oe,a,ue)}return;default:if(ea(n)){for(var ft in i)oe=i[ft],i.hasOwnProperty(ft)&&oe!==void 0&&!a.hasOwnProperty(ft)&&Du(e,n,ft,void 0,a,oe);for(de in a)oe=a[de],ue=i[de],!a.hasOwnProperty(de)||oe===ue||oe===void 0&&ue===void 0||Du(e,n,de,oe,a,ue);return}}for(var ne in i)oe=i[ne],i.hasOwnProperty(ne)&&oe!=null&&!a.hasOwnProperty(ne)&&ht(e,n,ne,null,a,oe);for(_e in a)oe=a[_e],ue=i[_e],!a.hasOwnProperty(_e)||oe===ue||oe==null&&ue==null||ht(e,n,_e,oe,a,ue)}function nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,i=performance.getEntriesByType("resource"),a=0;a<i.length;a++){var p=i[a],x=p.transferSize,B=p.initiatorType,F=p.duration;if(x&&F&&nm(B)){for(B=0,F=p.responseEnd,a+=1;a<i.length;a++){var X=i[a],ae=X.startTime;if(ae>F)break;var de=X.transferSize,_e=X.initiatorType;de&&nm(_e)&&(X=X.responseEnd,B+=de*(X<F?1:(F-ae)/(X-ae)))}if(--a,n+=8*(x+B)/(p.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Mu=null,Lu=null;function uo(e){return e.nodeType===9?e:e.ownerDocument}function im(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 rm(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Ou(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Bu=null;function c0(){var e=window.event;return e&&e.type==="popstate"?e===Bu?!1:(Bu=e,!0):(Bu=null,!1)}var sm=typeof setTimeout=="function"?setTimeout:void 0,u0=typeof clearTimeout=="function"?clearTimeout:void 0,am=typeof Promise=="function"?Promise:void 0,h0=typeof queueMicrotask=="function"?queueMicrotask:typeof am<"u"?function(e){return am.resolve(null).then(e).catch(f0)}:sm;function f0(e){setTimeout(function(){throw e})}function hr(e){return e==="head"}function lm(e,n){var i=n,a=0;do{var p=i.nextSibling;if(e.removeChild(i),p&&p.nodeType===8)if(i=p.data,i==="/$"||i==="/&"){if(a===0){e.removeChild(p),Us(n);return}a--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")a++;else if(i==="html")za(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,za(i);for(var x=i.firstChild;x;){var B=x.nextSibling,F=x.nodeName;x[wr]||F==="SCRIPT"||F==="STYLE"||F==="LINK"&&x.rel.toLowerCase()==="stylesheet"||i.removeChild(x),x=B}}else i==="body"&&za(e.ownerDocument.body);i=p}while(i);Us(n)}function om(e,n){var i=e;e=0;do{var a=i.nextSibling;if(i.nodeType===1?n?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(n?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),a&&a.nodeType===8)if(i=a.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=a}while(i)}function ju(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var i=n;switch(n=n.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":ju(i),es(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function d0(e,n,i,a){for(;e.nodeType===1;){var p=i;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[wr])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(x=e.getAttribute("rel"),x==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(x!==p.rel||e.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||e.getAttribute("title")!==(p.title==null?null:p.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(x=e.getAttribute("src"),(x!==(p.src==null?null:p.src)||e.getAttribute("type")!==(p.type==null?null:p.type)||e.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&x&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var x=p.name==null?null:""+p.name;if(p.type==="hidden"&&e.getAttribute("name")===x)return e}else return e;if(e=Yn(e.nextSibling),e===null)break}return null}function p0(e,n,i){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Yn(e.nextSibling),e===null))return null;return e}function cm(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Yn(e.nextSibling),e===null))return null;return e}function Nu(e){return e.data==="$?"||e.data==="$~"}function Hu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function m0(e,n){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||i.readyState!=="loading")n();else{var a=function(){n(),i.removeEventListener("DOMContentLoaded",a)};i.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function Yn(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var zu=null;function um(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(n===0)return Yn(e.nextSibling);n--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||n++}e=e.nextSibling}return null}function hm(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(n===0)return e;n--}else i!=="/$"&&i!=="/&"||n++}e=e.previousSibling}return null}function fm(e,n,i){switch(n=uo(i),e){case"html":if(e=n.documentElement,!e)throw Error(l(452));return e;case"head":if(e=n.head,!e)throw Error(l(453));return e;case"body":if(e=n.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function za(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);es(e)}var Xn=new Map,dm=new Set;function ho(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var zi=Y.d;Y.d={f:g0,r:_0,D:v0,C:y0,L:S0,m:b0,X:w0,S:C0,M:x0};function g0(){var e=zi.f(),n=no();return e||n}function _0(e){var n=Si(e);n!==null&&n.tag===5&&n.type==="form"?Dd(n):zi.r(e)}var Hs=typeof document>"u"?null:document;function pm(e,n,i){var a=Hs;if(a&&typeof n=="string"&&n){var p=pn(n);p='link[rel="'+e+'"][href="'+p+'"]',typeof i=="string"&&(p+='[crossorigin="'+i+'"]'),dm.has(p)||(dm.add(p),e={rel:e,crossOrigin:i,href:n},a.querySelector(p)===null&&(n=a.createElement("link"),Vt(n,"link",e),kt(n),a.head.appendChild(n)))}}function v0(e){zi.D(e),pm("dns-prefetch",e,null)}function y0(e,n){zi.C(e,n),pm("preconnect",e,n)}function S0(e,n,i){zi.L(e,n,i);var a=Hs;if(a&&e&&n){var p='link[rel="preload"][as="'+pn(n)+'"]';n==="image"&&i&&i.imageSrcSet?(p+='[imagesrcset="'+pn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(p+='[imagesizes="'+pn(i.imageSizes)+'"]')):p+='[href="'+pn(e)+'"]';var x=p;switch(n){case"style":x=zs(e);break;case"script":x=Is(e)}Xn.has(x)||(e=h({rel:"preload",href:n==="image"&&i&&i.imageSrcSet?void 0:e,as:n},i),Xn.set(x,e),a.querySelector(p)!==null||n==="style"&&a.querySelector(Ia(x))||n==="script"&&a.querySelector(Ua(x))||(n=a.createElement("link"),Vt(n,"link",e),kt(n),a.head.appendChild(n)))}}function b0(e,n){zi.m(e,n);var i=Hs;if(i&&e){var a=n&&typeof n.as=="string"?n.as:"script",p='link[rel="modulepreload"][as="'+pn(a)+'"][href="'+pn(e)+'"]',x=p;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=Is(e)}if(!Xn.has(x)&&(e=h({rel:"modulepreload",href:e},n),Xn.set(x,e),i.querySelector(p)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(Ua(x)))return}a=i.createElement("link"),Vt(a,"link",e),kt(a),i.head.appendChild(a)}}}function C0(e,n,i){zi.S(e,n,i);var a=Hs;if(a&&e){var p=Gi(a).hoistableStyles,x=zs(e);n=n||"default";var B=p.get(x);if(!B){var F={loading:0,preload:null};if(B=a.querySelector(Ia(x)))F.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":n},i),(i=Xn.get(x))&&Iu(e,i);var X=B=a.createElement("link");kt(X),Vt(X,"link",e),X._p=new Promise(function(ae,de){X.onload=ae,X.onerror=de}),X.addEventListener("load",function(){F.loading|=1}),X.addEventListener("error",function(){F.loading|=2}),F.loading|=4,fo(B,n,a)}B={type:"stylesheet",instance:B,count:1,state:F},p.set(x,B)}}}function w0(e,n){zi.X(e,n);var i=Hs;if(i&&e){var a=Gi(i).hoistableScripts,p=Is(e),x=a.get(p);x||(x=i.querySelector(Ua(p)),x||(e=h({src:e,async:!0},n),(n=Xn.get(p))&&Uu(e,n),x=i.createElement("script"),kt(x),Vt(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},a.set(p,x))}}function x0(e,n){zi.M(e,n);var i=Hs;if(i&&e){var a=Gi(i).hoistableScripts,p=Is(e),x=a.get(p);x||(x=i.querySelector(Ua(p)),x||(e=h({src:e,async:!0,type:"module"},n),(n=Xn.get(p))&&Uu(e,n),x=i.createElement("script"),kt(x),Vt(x,"link",e),i.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},a.set(p,x))}}function mm(e,n,i,a){var p=(p=ge.current)?ho(p):null;if(!p)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(n=zs(i.href),i=Gi(p).hoistableStyles,a=i.get(n),a||(a={type:"style",instance:null,count:0,state:null},i.set(n,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=zs(i.href);var x=Gi(p).hoistableStyles,B=x.get(e);if(B||(p=p.ownerDocument||p,B={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(e,B),(x=p.querySelector(Ia(e)))&&!x._p&&(B.instance=x,B.state.loading=5),Xn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Xn.set(e,i),x||E0(p,e,i,B.state))),n&&a===null)throw Error(l(528,""));return B}if(n&&a!==null)throw Error(l(529,""));return null;case"script":return n=i.async,i=i.src,typeof i=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Is(i),i=Gi(p).hoistableScripts,a=i.get(n),a||(a={type:"script",instance:null,count:0,state:null},i.set(n,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function zs(e){return'href="'+pn(e)+'"'}function Ia(e){return'link[rel="stylesheet"]['+e+"]"}function gm(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function E0(e,n,i,a){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?a.loading=1:(n=e.createElement("link"),a.preload=n,n.addEventListener("load",function(){return a.loading|=1}),n.addEventListener("error",function(){return a.loading|=2}),Vt(n,"link",i),kt(n),e.head.appendChild(n))}function Is(e){return'[src="'+pn(e)+'"]'}function Ua(e){return"script[async]"+e}function _m(e,n,i){if(n.count++,n.instance===null)switch(n.type){case"style":var a=e.querySelector('style[data-href~="'+pn(i.href)+'"]');if(a)return n.instance=a,kt(a),a;var p=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),kt(a),Vt(a,"style",p),fo(a,i.precedence,e),n.instance=a;case"stylesheet":p=zs(i.href);var x=e.querySelector(Ia(p));if(x)return n.state.loading|=4,n.instance=x,kt(x),x;a=gm(i),(p=Xn.get(p))&&Iu(a,p),x=(e.ownerDocument||e).createElement("link"),kt(x);var B=x;return B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),Vt(x,"link",a),n.state.loading|=4,fo(x,i.precedence,e),n.instance=x;case"script":return x=Is(i.src),(p=e.querySelector(Ua(x)))?(n.instance=p,kt(p),p):(a=i,(p=Xn.get(x))&&(a=h({},i),Uu(a,p)),e=e.ownerDocument||e,p=e.createElement("script"),kt(p),Vt(p,"link",a),e.head.appendChild(p),n.instance=p);case"void":return null;default:throw Error(l(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(a=n.instance,n.state.loading|=4,fo(a,i.precedence,e));return n.instance}function fo(e,n,i){for(var a=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=a.length?a[a.length-1]:null,x=p,B=0;B<a.length;B++){var F=a[B];if(F.dataset.precedence===n)x=F;else if(x!==p)break}x?x.parentNode.insertBefore(e,x.nextSibling):(n=i.nodeType===9?i.head:i,n.insertBefore(e,n.firstChild))}function Iu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Uu(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var po=null;function vm(e,n,i){if(po===null){var a=new Map,p=po=new Map;p.set(i,a)}else p=po,a=p.get(i),a||(a=new Map,p.set(i,a));if(a.has(e))return a;for(a.set(e,null),i=i.getElementsByTagName(e),p=0;p<i.length;p++){var x=i[p];if(!(x[wr]||x[mt]||e==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var B=x.getAttribute(n)||"";B=e+B;var F=a.get(B);F?F.push(x):a.set(B,[x])}}return a}function ym(e,n,i){e=e.ownerDocument||e,e.head.insertBefore(i,n==="title"?e.querySelector("head > title"):null)}function k0(e,n,i){if(i===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Sm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function A0(e,n,i,a){if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=zs(a.href),x=n.querySelector(Ia(p));if(x){n=x._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=mo.bind(e),n.then(e,e)),i.state.loading|=4,i.instance=x,kt(x);return}x=n.ownerDocument||n,a=gm(a),(p=Xn.get(p))&&Iu(a,p),x=x.createElement("link"),kt(x);var B=x;B._p=new Promise(function(F,X){B.onload=F,B.onerror=X}),Vt(x,"link",a),i.instance=x}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,n),(n=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=mo.bind(e),n.addEventListener("load",i),n.addEventListener("error",i))}}var Pu=0;function T0(e,n){return e.stylesheets&&e.count===0&&_o(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var a=setTimeout(function(){if(e.stylesheets&&_o(e,e.stylesheets),e.unsuspend){var x=e.unsuspend;e.unsuspend=null,x()}},6e4+n);0<e.imgBytes&&Pu===0&&(Pu=62500*o0());var p=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&_o(e,e.stylesheets),e.unsuspend)){var x=e.unsuspend;e.unsuspend=null,x()}},(e.imgBytes>Pu?50:800)+n);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(p)}}:null}function mo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)_o(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var go=null;function _o(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,go=new Map,n.forEach(R0,e),go=null,mo.call(e))}function R0(e,n){if(!(n.state.loading&4)){var i=go.get(e);if(i)var a=i.get(null);else{i=new Map,go.set(e,i);for(var p=e.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<p.length;x++){var B=p[x];(B.nodeName==="LINK"||B.getAttribute("media")!=="not all")&&(i.set(B.dataset.precedence,B),a=B)}a&&i.set(null,a)}p=n.instance,B=p.getAttribute("data-precedence"),x=i.get(B)||a,x===a&&i.set(null,p),i.set(B,p),this.count++,a=mo.bind(this),p.addEventListener("load",a),p.addEventListener("error",a),x?x.parentNode.insertBefore(p,x.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(p,e.firstChild)),n.state.loading|=4}}var Pa={$$typeof:b,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function D0(e,n,i,a,p,x,B,F,X){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=ai(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ai(0),this.hiddenUpdates=ai(null),this.identifierPrefix=a,this.onUncaughtError=p,this.onCaughtError=x,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function bm(e,n,i,a,p,x,B,F,X,ae,de,_e){return e=new D0(e,n,i,B,X,ae,de,_e,F),n=1,x===!0&&(n|=24),x=Tn(3,null,null,n),e.current=x,x.stateNode=e,n=Sc(),n.refCount++,e.pooledCache=n,n.refCount++,x.memoizedState={element:a,isDehydrated:i,cache:n},xc(x),e}function Cm(e){return e?(e=gs,e):gs}function wm(e,n,i,a,p,x){p=Cm(p),a.context===null?a.context=p:a.pendingContext=p,a=er(n),a.payload={element:i},x=x===void 0?null:x,x!==null&&(a.callback=x),i=tr(e,a,n),i!==null&&(yn(i,e,n),ya(i,e,n))}function xm(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<n?i:n}}function Fu(e,n){xm(e,n),(e=e.alternate)&&xm(e,n)}function Em(e){if(e.tag===13||e.tag===31){var n=Or(e,67108864);n!==null&&yn(n,e,67108864),Fu(e,67108864)}}function km(e){if(e.tag===13||e.tag===31){var n=On();n=wn(n);var i=Or(e,n);i!==null&&yn(i,e,n),Fu(e,n)}}var vo=!0;function M0(e,n,i,a){var p=V.T;V.T=null;var x=Y.p;try{Y.p=2,qu(e,n,i,a)}finally{Y.p=x,V.T=p}}function L0(e,n,i,a){var p=V.T;V.T=null;var x=Y.p;try{Y.p=8,qu(e,n,i,a)}finally{Y.p=x,V.T=p}}function qu(e,n,i,a){if(vo){var p=$u(a);if(p===null)Ru(e,n,a,yo,i),Tm(e,a);else if(B0(p,e,n,i,a))a.stopPropagation();else if(Tm(e,a),n&4&&-1<O0.indexOf(e)){for(;p!==null;){var x=Si(p);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var B=zn(x.pendingLanes);if(B!==0){var F=x;for(F.pendingLanes|=2,F.entangledLanes|=2;B;){var X=1<<31-it(B);F.entanglements[1]|=X,B&=~X}fi(x),(rt&6)===0&&(eo=nt()+500,ja(0))}}break;case 31:case 13:F=Or(x,2),F!==null&&yn(F,x,2),no(),Fu(x,2)}if(x=$u(a),x===null&&Ru(e,n,a,yo,i),x===p)break;p=x}p!==null&&a.stopPropagation()}else Ru(e,n,a,null,i)}}function $u(e){return e=Tr(e),Gu(e)}var yo=null;function Gu(e){if(yo=null,e=xn(e),e!==null){var n=m(e);if(n===null)e=null;else{var i=n.tag;if(i===13){if(e=f(n),e!==null)return e;e=null}else if(i===31){if(e=o(n),e!==null)return e;e=null}else if(i===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return yo=e,null}function Am(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ot()){case ce:return 2;case Se:return 8;case Ee:case Oe:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var Vu=!1,fr=null,dr=null,pr=null,Fa=new Map,qa=new Map,mr=[],O0="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 Tm(e,n){switch(e){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":dr=null;break;case"mouseover":case"mouseout":pr=null;break;case"pointerover":case"pointerout":Fa.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":qa.delete(n.pointerId)}}function $a(e,n,i,a,p,x){return e===null||e.nativeEvent!==x?(e={blockedOn:n,domEventName:i,eventSystemFlags:a,nativeEvent:x,targetContainers:[p]},n!==null&&(n=Si(n),n!==null&&Em(n)),e):(e.eventSystemFlags|=a,n=e.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),e)}function B0(e,n,i,a,p){switch(n){case"focusin":return fr=$a(fr,e,n,i,a,p),!0;case"dragenter":return dr=$a(dr,e,n,i,a,p),!0;case"mouseover":return pr=$a(pr,e,n,i,a,p),!0;case"pointerover":var x=p.pointerId;return Fa.set(x,$a(Fa.get(x)||null,e,n,i,a,p)),!0;case"gotpointercapture":return x=p.pointerId,qa.set(x,$a(qa.get(x)||null,e,n,i,a,p)),!0}return!1}function Rm(e){var n=xn(e.target);if(n!==null){var i=m(n);if(i!==null){if(n=i.tag,n===13){if(n=f(i),n!==null){e.blockedOn=n,hn(e.priority,function(){km(i)});return}}else if(n===31){if(n=o(i),n!==null){e.blockedOn=n,hn(e.priority,function(){km(i)});return}}else if(n===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function So(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var i=$u(e.nativeEvent);if(i===null){i=e.nativeEvent;var a=new i.constructor(i.type,i);Ar=a,i.target.dispatchEvent(a),Ar=null}else return n=Si(i),n!==null&&Em(n),e.blockedOn=i,!1;n.shift()}return!0}function Dm(e,n,i){So(e)&&i.delete(n)}function j0(){Vu=!1,fr!==null&&So(fr)&&(fr=null),dr!==null&&So(dr)&&(dr=null),pr!==null&&So(pr)&&(pr=null),Fa.forEach(Dm),qa.forEach(Dm)}function bo(e,n){e.blockedOn===n&&(e.blockedOn=null,Vu||(Vu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,j0)))}var Co=null;function Mm(e){Co!==e&&(Co=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Co===e&&(Co=null);for(var n=0;n<e.length;n+=3){var i=e[n],a=e[n+1],p=e[n+2];if(typeof a!="function"){if(Gu(a||i)===null)continue;break}var x=Si(i);x!==null&&(e.splice(n,3),n-=3,$c(x,{pending:!0,data:p,method:i.method,action:a},a,p))}}))}function Us(e){function n(X){return bo(X,e)}fr!==null&&bo(fr,e),dr!==null&&bo(dr,e),pr!==null&&bo(pr,e),Fa.forEach(n),qa.forEach(n);for(var i=0;i<mr.length;i++){var a=mr[i];a.blockedOn===e&&(a.blockedOn=null)}for(;0<mr.length&&(i=mr[0],i.blockedOn===null);)Rm(i),i.blockedOn===null&&mr.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(a=0;a<i.length;a+=3){var p=i[a],x=i[a+1],B=p[ct]||null;if(typeof x=="function")B||Mm(i);else if(B){var F=null;if(x&&x.hasAttribute("formAction")){if(p=x,B=x[ct]||null)F=B.formAction;else if(Gu(p)!==null)continue}else F=B.action;typeof F=="function"?i[a+1]=F:(i.splice(a,3),a-=3),Mm(i)}}}function Lm(){function e(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(B){return p=B})},focusReset:"manual",scroll:"manual"})}function n(){p!==null&&(p(),p=null),a||setTimeout(i,20)}function i(){if(!a&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,p=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(i,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),p!==null&&(p(),p=null)}}}function Wu(e){this._internalRoot=e}wo.prototype.render=Wu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(l(409));var i=n.current,a=On();wm(i,a,e,n,null,null)},wo.prototype.unmount=Wu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;wm(e.current,2,null,e,null,null),no(),n[Ht]=null}};function wo(e){this._internalRoot=e}wo.prototype.unstable_scheduleHydration=function(e){if(e){var n=li();e={blockedOn:null,target:e,priority:n};for(var i=0;i<mr.length&&n!==0&&n<mr[i].priority;i++);mr.splice(i,0,e),i===0&&Rm(e)}};var Om=r.version;if(Om!=="19.2.6")throw Error(l(527,Om,"19.2.6"));Y.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=u(n),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var N0={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var xo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!xo.isDisabled&&xo.supportsFiber)try{wt=xo.inject(N0),bt=xo}catch{}}return Va.createRoot=function(e,n){if(!d(e))throw Error(l(299));var i=!1,a="",p=Ud,x=Pd,B=Fd;return n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(p=n.onUncaughtError),n.onCaughtError!==void 0&&(x=n.onCaughtError),n.onRecoverableError!==void 0&&(B=n.onRecoverableError)),n=bm(e,1,!1,null,null,i,a,null,p,x,B,Lm),e[Ht]=n.current,Tu(e),new Wu(n)},Va.hydrateRoot=function(e,n,i){if(!d(e))throw Error(l(299));var a=!1,p="",x=Ud,B=Pd,F=Fd,X=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onUncaughtError!==void 0&&(x=i.onUncaughtError),i.onCaughtError!==void 0&&(B=i.onCaughtError),i.onRecoverableError!==void 0&&(F=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),n=bm(e,1,!0,n,i??null,a,p,X,x,B,F,Lm),n.context=Cm(null),i=n.current,a=On(),a=wn(a),p=er(a),p.callback=null,tr(i,p,a),i=a,n.current.lanes=i,In(n,i),fi(n),e[Ht]=n.current,Tu(e),new wo(n)},Va.version="19.2.6",Va}var $m;function K0(){if($m)return Xu.exports;$m=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(r){console.error(r)}}return t(),Xu.exports=W0(),Xu.exports}var Y0=K0();const Qr=function(t,r){let d=t;const m=Za[r];let f=null,o=0,c=null;const u=[],g={},h=function(D,A){o=d*4+17,f=(function(M){const L=new Array(M);for(let H=0;H<M;H+=1){L[H]=new Array(M);for(let U=0;U<M;U+=1)L[H][U]=null}return L})(o),S(0,0),S(o-7,0),S(0,o-7),k(),T(),_(D,A),d>=7&&y(D),c==null&&(c=E(d,m,u)),v(c,A)},S=function(D,A){for(let M=-1;M<=7;M+=1)if(!(D+M<=-1||o<=D+M))for(let L=-1;L<=7;L+=1)A+L<=-1||o<=A+L||(0<=M&&M<=6&&(L==0||L==6)||0<=L&&L<=6&&(M==0||M==6)||2<=M&&M<=4&&2<=L&&L<=4?f[D+M][A+L]=!0:f[D+M][A+L]=!1)},w=function(){let D=0,A=0;for(let M=0;M<8;M+=1){h(!0,M);const L=vr.getLostPoint(g);(M==0||D>L)&&(D=L,A=M)}return A},T=function(){for(let D=8;D<o-8;D+=1)f[D][6]==null&&(f[D][6]=D%2==0);for(let D=8;D<o-8;D+=1)f[6][D]==null&&(f[6][D]=D%2==0)},k=function(){const D=vr.getPatternPosition(d);for(let A=0;A<D.length;A+=1)for(let M=0;M<D.length;M+=1){const L=D[A],H=D[M];if(f[L][H]==null)for(let U=-2;U<=2;U+=1)for(let P=-2;P<=2;P+=1)U==-2||U==2||P==-2||P==2||U==0&&P==0?f[L+U][H+P]=!0:f[L+U][H+P]=!1}},y=function(D){const A=vr.getBCHTypeNumber(d);for(let M=0;M<18;M+=1){const L=!D&&(A>>M&1)==1;f[Math.floor(M/3)][M%3+o-8-3]=L}for(let M=0;M<18;M+=1){const L=!D&&(A>>M&1)==1;f[M%3+o-8-3][Math.floor(M/3)]=L}},_=function(D,A){const M=m<<3|A,L=vr.getBCHTypeInfo(M);for(let H=0;H<15;H+=1){const U=!D&&(L>>H&1)==1;H<6?f[H][8]=U:H<8?f[H+1][8]=U:f[o-15+H][8]=U}for(let H=0;H<15;H+=1){const U=!D&&(L>>H&1)==1;H<8?f[8][o-H-1]=U:H<9?f[8][15-H-1+1]=U:f[8][15-H-1]=U}f[o-8][8]=!D},v=function(D,A){let M=-1,L=o-1,H=7,U=0;const P=vr.getMaskFunction(A);for(let W=o-1;W>0;W-=2)for(W==6&&(W-=1);;){for(let K=0;K<2;K+=1)if(f[L][W-K]==null){let V=!1;U<D.length&&(V=(D[U]>>>H&1)==1),P(L,W-K)&&(V=!V),f[L][W-K]=V,H-=1,H==-1&&(U+=1,H=7)}if(L+=M,L<0||o<=L){L-=M,M=-M;break}}},b=function(D,A){let M=0,L=0,H=0;const U=new Array(A.length),P=new Array(A.length);for(let Y=0;Y<A.length;Y+=1){const te=A[Y].dataCount,z=A[Y].totalCount-te;L=Math.max(L,te),H=Math.max(H,z),U[Y]=new Array(te);for(let I=0;I<U[Y].length;I+=1)U[Y][I]=255&D.getBuffer()[I+M];M+=te;const j=vr.getErrorCorrectPolynomial(z),q=rl(U[Y],j.getLength()-1).mod(j);P[Y]=new Array(j.getLength()-1);for(let I=0;I<P[Y].length;I+=1){const ie=I+q.getLength()-P[Y].length;P[Y][I]=ie>=0?q.getAt(ie):0}}let W=0;for(let Y=0;Y<A.length;Y+=1)W+=A[Y].totalCount;const K=new Array(W);let V=0;for(let Y=0;Y<L;Y+=1)for(let te=0;te<A.length;te+=1)Y<U[te].length&&(K[V]=U[te][Y],V+=1);for(let Y=0;Y<H;Y+=1)for(let te=0;te<A.length;te+=1)Y<P[te].length&&(K[V]=P[te][Y],V+=1);return K},E=function(D,A,M){const L=Gm.getRSBlocks(D,A),H=Vm();for(let P=0;P<M.length;P+=1){const W=M[P];H.put(W.getMode(),4),H.put(W.getLength(),vr.getLengthInBits(W.getMode(),D)),W.write(H)}let U=0;for(let P=0;P<L.length;P+=1)U+=L[P].dataCount;if(H.getLengthInBits()>U*8)throw"code length overflow. ("+H.getLengthInBits()+">"+U*8+")";for(H.getLengthInBits()+4<=U*8&&H.put(0,4);H.getLengthInBits()%8!=0;)H.putBit(!1);for(;!(H.getLengthInBits()>=U*8||(H.put(236,8),H.getLengthInBits()>=U*8));)H.put(17,8);return b(H,L)};g.addData=function(D,A){A=A||"Byte";let M=null;switch(A){case"Numeric":M=X0(D);break;case"Alphanumeric":M=Q0(D);break;case"Byte":M=J0(D);break;case"Kanji":M=Z0(D);break;default:throw"mode:"+A}u.push(M),c=null},g.isDark=function(D,A){if(D<0||o<=D||A<0||o<=A)throw D+","+A;return f[D][A]},g.getModuleCount=function(){return o},g.make=function(){if(d<1){let D=1;for(;D<40;D++){const A=Gm.getRSBlocks(D,m),M=Vm();for(let H=0;H<u.length;H++){const U=u[H];M.put(U.getMode(),4),M.put(U.getLength(),vr.getLengthInBits(U.getMode(),D)),U.write(M)}let L=0;for(let H=0;H<A.length;H++)L+=A[H].dataCount;if(M.getLengthInBits()<=L*8)break}d=D}h(!1,w())},g.createTableTag=function(D,A){D=D||2,A=typeof A>"u"?D*4:A;let M="";M+='<table style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: "+A+"px;",M+='">',M+="<tbody>";for(let L=0;L<g.getModuleCount();L+=1){M+="<tr>";for(let H=0;H<g.getModuleCount();H+=1)M+='<td style="',M+=" border-width: 0px; border-style: none;",M+=" border-collapse: collapse;",M+=" padding: 0px; margin: 0px;",M+=" width: "+D+"px;",M+=" height: "+D+"px;",M+=" background-color: ",M+=g.isDark(L,H)?"#000000":"#ffffff",M+=";",M+='"/>';M+="</tr>"}return M+="</tbody>",M+="</table>",M},g.createSvgTag=function(D,A,M,L){let H={};typeof arguments[0]=="object"&&(H=arguments[0],D=H.cellSize,A=H.margin,M=H.alt,L=H.title),D=D||2,A=typeof A>"u"?D*4:A,M=typeof M=="string"?{text:M}:M||{},M.text=M.text||null,M.id=M.text?M.id||"qrcode-description":null,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-title":null;const U=g.getModuleCount()*D+A*2;let P,W,K,V,Y="",te;for(te="l"+D+",0 0,"+D+" -"+D+",0 0,-"+D+"z ",Y+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',Y+=H.scalable?"":' width="'+U+'px" height="'+U+'px"',Y+=' viewBox="0 0 '+U+" "+U+'" ',Y+=' preserveAspectRatio="xMinYMin meet"',Y+=L.text||M.text?' role="img" aria-labelledby="'+O([L.id,M.id].join(" ").trim())+'"':"",Y+=">",Y+=L.text?'<title id="'+O(L.id)+'">'+O(L.text)+"</title>":"",Y+=M.text?'<description id="'+O(M.id)+'">'+O(M.text)+"</description>":"",Y+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',Y+='<path d="',K=0;K<g.getModuleCount();K+=1)for(V=K*D+A,P=0;P<g.getModuleCount();P+=1)g.isDark(K,P)&&(W=P*D+A,Y+="M"+W+","+V+te);return Y+='" stroke="transparent" fill="black"/>',Y+="</svg>",Y},g.createDataURL=function(D,A){D=D||2,A=typeof A>"u"?D*4:A;const M=g.getModuleCount()*D+A*2,L=A,H=M-A;return iS(M,M,function(U,P){if(L<=U&&U<H&&L<=P&&P<H){const W=Math.floor((U-L)/D),K=Math.floor((P-L)/D);return g.isDark(K,W)?0:1}else return 1})},g.createImgTag=function(D,A,M){D=D||2,A=typeof A>"u"?D*4:A;const L=g.getModuleCount()*D+A*2;let H="";return H+="<img",H+=' src="',H+=g.createDataURL(D,A),H+='"',H+=' width="',H+=L,H+='"',H+=' height="',H+=L,H+='"',M&&(H+=' alt="',H+=O(M),H+='"'),H+="/>",H};const O=function(D){let A="";for(let M=0;M<D.length;M+=1){const L=D.charAt(M);switch(L){case"<":A+="&lt;";break;case">":A+="&gt;";break;case"&":A+="&amp;";break;case'"':A+="&quot;";break;default:A+=L;break}}return A},R=function(D){D=typeof D>"u"?2:D;const M=g.getModuleCount()*1+D*2,L=D,H=M-D;let U,P,W,K,V;const Y={"██":"█","█ ":"▀"," █":"▄"," ":" "},te={"██":"▀","█ ":"▀"," █":" "," ":" "};let z="";for(U=0;U<M;U+=2){for(W=Math.floor((U-L)/1),K=Math.floor((U+1-L)/1),P=0;P<M;P+=1)V="█",L<=P&&P<H&&L<=U&&U<H&&g.isDark(W,Math.floor((P-L)/1))&&(V=" "),L<=P&&P<H&&L<=U+1&&U+1<H&&g.isDark(K,Math.floor((P-L)/1))?V+=" ":V+="█",z+=D<1&&U+1>=H?te[V]:Y[V];z+=`
50
50
  `}return M%2&&D>0?z.substring(0,z.length-M-1)+Array(M+1).join("▀"):z.substring(0,z.length-1)};return g.createASCII=function(D,A){if(D=D||1,D<2)return R(A);D-=1,A=typeof A>"u"?D*2:A;const M=g.getModuleCount()*D+A*2,L=A,H=M-A;let U,P,W,K;const V=Array(D+1).join("██"),Y=Array(D+1).join(" ");let te="",z="";for(U=0;U<M;U+=1){for(W=Math.floor((U-L)/D),z="",P=0;P<M;P+=1)K=1,L<=P&&P<H&&L<=U&&U<H&&g.isDark(W,Math.floor((P-L)/D))&&(K=0),z+=K?V:Y;for(W=0;W<D;W+=1)te+=z+`
51
- `}return te.substring(0,te.length-1)},g.renderTo2dContext=function(D,A){A=A||2;const M=g.getModuleCount();for(let L=0;L<M;L++)for(let H=0;H<M;H++)D.fillStyle=g.isDark(L,H)?"black":"white",D.fillRect(H*A,L*A,A,A)},g};Qr.stringToBytes=function(t){const r=[];for(let s=0;s<t.length;s+=1){const l=t.charCodeAt(s);r.push(l&255)}return r};Qr.createStringToBytes=function(t,r){const s=(function(){const d=tS(t),m=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const u=m(),g=m(),h=m(),S=String.fromCharCode(c<<8|u),w=g<<8|h;o[S]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const m=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)m.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?m.push(c):(m.push(c>>>8),m.push(c&255)):m.push(l)}}return m}};const en={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Za={L:1,M:0,Q:3,H:2},_r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},vr=(function(){const t=[[],[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]],r=1335,s=7973,l=21522,d={},m=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;m(o)-m(r)>=0;)o^=r<<m(o)-m(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;m(o)-m(s)>=0;)o^=s<<m(o)-m(s);return f<<12|o},d.getPatternPosition=function(f){return t[f-1]},d.getMaskFunction=function(f){switch(f){case _r.PATTERN000:return function(o,c){return(o+c)%2==0};case _r.PATTERN001:return function(o,c){return o%2==0};case _r.PATTERN010:return function(o,c){return c%3==0};case _r.PATTERN011:return function(o,c){return(o+c)%3==0};case _r.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case _r.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case _r.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case _r.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=rl([1],0);for(let c=0;c<f;c+=1)o=o.multiply(rl([1,Sr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case en.MODE_NUMBER:return 10;case en.MODE_ALPHA_NUM:return 9;case en.MODE_8BIT_BYTE:return 8;case en.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case en.MODE_NUMBER:return 12;case en.MODE_ALPHA_NUM:return 11;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case en.MODE_NUMBER:return 14;case en.MODE_ALPHA_NUM:return 13;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let h=0;h<o;h+=1)for(let S=0;S<o;S+=1){let w=0;const T=f.isDark(h,S);for(let k=-1;k<=1;k+=1)if(!(h+k<0||o<=h+k))for(let y=-1;y<=1;y+=1)S+y<0||o<=S+y||k==0&&y==0||T==f.isDark(h+k,S+y)&&(w+=1);w>5&&(c+=3+w-5)}for(let h=0;h<o-1;h+=1)for(let S=0;S<o-1;S+=1){let w=0;f.isDark(h,S)&&(w+=1),f.isDark(h+1,S)&&(w+=1),f.isDark(h,S+1)&&(w+=1),f.isDark(h+1,S+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(h,S)&&!f.isDark(h,S+1)&&f.isDark(h,S+2)&&f.isDark(h,S+3)&&f.isDark(h,S+4)&&!f.isDark(h,S+5)&&f.isDark(h,S+6)&&(c+=40);for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(S,h)&&!f.isDark(S+1,h)&&f.isDark(S+2,h)&&f.isDark(S+3,h)&&f.isDark(S+4,h)&&!f.isDark(S+5,h)&&f.isDark(S+6,h)&&(c+=40);let u=0;for(let h=0;h<o;h+=1)for(let S=0;S<o;S+=1)f.isDark(S,h)&&(u+=1);const g=Math.abs(100*u/o/o-50)/5;return c+=g*10,c},d})(),Sr=(function(){const t=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)t[l]=1<<l;for(let l=8;l<256;l+=1)t[l]=t[l-4]^t[l-5]^t[l-6]^t[l-8];for(let l=0;l<255;l+=1)r[t[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return t[l]},s})(),rl=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const s=(function(){let d=0;for(;d<t.length&&t[d]==0;)d+=1;const m=new Array(t.length-d+r);for(let f=0;f<t.length-d;f+=1)m[f]=t[f+d];return m})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const m=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)m[f+o]^=Sr.gexp(Sr.glog(l.getAt(f))+Sr.glog(d.getAt(o)));return rl(m,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const m=Sr.glog(l.getAt(0))-Sr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=Sr.gexp(Sr.glog(d.getAt(o))+m);return rl(f,0).mod(d)},l},Gm=(function(){const t=[[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]],r=function(d,m){const f={};return f.totalCount=d,f.dataCount=m,f},s={},l=function(d,m){switch(m){case Za.L:return t[(d-1)*4+0];case Za.M:return t[(d-1)*4+1];case Za.Q:return t[(d-1)*4+2];case Za.H:return t[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,m){const f=l(d,m);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+m;const o=f.length/3,c=[];for(let u=0;u<o;u+=1){const g=f[u*3+0],h=f[u*3+1],S=f[u*3+2];for(let w=0;w<g;w+=1)c.push(r(h,S))}return c},s})(),Vm=function(){const t=[];let r=0;const s={};return s.getBuffer=function(){return t},s.getAt=function(l){const d=Math.floor(l/8);return(t[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let m=0;m<d;m+=1)s.putBit((l>>>d-m-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);t.length<=d&&t.push(0),l&&(t[d]|=128>>>r%8),r+=1},s},X0=function(t){const r=en.MODE_NUMBER,s=t,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+m(f.charAt(c));return o},m=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},Q0=function(t){const r=en.MODE_ALPHA_NUM,s=t,l={};l.getMode=function(){return r},l.getLength=function(m){return s.length},l.write=function(m){const f=s;let o=0;for(;o+1<f.length;)m.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&m.put(d(f.charAt(o)),6)};const d=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;if("A"<=m&&m<="Z")return m.charCodeAt(0)-65+10;switch(m){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 :"+m}};return l},J0=function(t){const r=en.MODE_8BIT_BYTE,s=Qr.stringToBytes(t),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let m=0;m<s.length;m+=1)d.put(s[m],8)},l},Z0=function(t){const r=en.MODE_KANJI,s=Qr.stringToBytes;(function(m,f){const o=s(m);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(t),d={};return d.getMode=function(){return r},d.getLength=function(m){return~~(l.length/2)},d.write=function(m){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),m.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},f_=function(){const t=[],r={};return r.writeByte=function(s){t.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,l,d){l=l||0,d=d||s.length;for(let m=0;m<d;m+=1)r.writeByte(s[m+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return t},r.toString=function(){let s="";s+="[";for(let l=0;l<t.length;l+=1)l>0&&(s+=","),s+=t[l];return s+="]",s},r},eS=function(){let t=0,r=0,s=0,l="";const d={},m=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(t=t<<8|o&255,r+=8,s+=1;r>=6;)m(t>>>r-6),r-=6},d.flush=function(){if(r>0&&(m(t<<6-r),t=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},tS=function(t){const r=t;let s=0,l=0,d=0;const m={};m.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return m},nS=function(t,r){const s=t,l=r,d=new Array(t*r),m={};m.setPixel=function(u,g,h){d[g*s+u]=h},m.write=function(u){u.writeString("GIF87a"),u.writeShort(s),u.writeShort(l),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(","),u.writeShort(0),u.writeShort(0),u.writeShort(s),u.writeShort(l),u.writeByte(0);const g=2,h=o(g);u.writeByte(g);let S=0;for(;h.length-S>255;)u.writeByte(255),u.writeBytes(h,S,255),S+=255;u.writeByte(h.length-S),u.writeBytes(h,S,h.length-S),u.writeByte(0),u.writeString(";")};const f=function(u){const g=u;let h=0,S=0;const w={};return w.write=function(T,k){if(T>>>k)throw"length over";for(;h+k>=8;)g.writeByte(255&(T<<h|S)),k-=8-h,T>>>=8-h,S=0,h=0;S=T<<h|S,h=h+k},w.flush=function(){h>0&&g.writeByte(S)},w},o=function(u){const g=1<<u,h=(1<<u)+1;let S=u+1;const w=c();for(let v=0;v<g;v+=1)w.add(String.fromCharCode(v));w.add(String.fromCharCode(g)),w.add(String.fromCharCode(h));const T=f_(),k=f(T);k.write(g,S);let y=0,_=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const v=String.fromCharCode(d[y]);y+=1,w.contains(_+v)?_=_+v:(k.write(w.indexOf(_),S),w.size()<4095&&(w.size()==1<<S&&(S+=1),w.add(_+v)),_=v)}return k.write(w.indexOf(_),S),k.write(h,S),k.flush(),T.toByteArray()},c=function(){const u={};let g=0;const h={};return h.add=function(S){if(h.contains(S))throw"dup key:"+S;u[S]=g,g+=1},h.size=function(){return g},h.indexOf=function(S){return u[S]},h.contains=function(S){return typeof u[S]<"u"},h};return m},iS=function(t,r,s){const l=nS(t,r);for(let o=0;o<r;o+=1)for(let c=0;c<t;c+=1)l.setPixel(c,o,s(c,o));const d=f_();l.write(d);const m=eS(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)m.writeByte(f[o]);return m.flush(),"data:image/gif;base64,"+m};Qr.stringToBytes;const sl=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"tester",label:"Tester",commandAgent:"tester",dispatchable:!0}],d_={name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!1},Jr=[...sl,d_],rS={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},sS={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},p_=[rS,sS],Uo=[...Jr,...p_];sl.map(t=>t.name);const m_=Jr.map(t=>t.name);p_.map(t=>t.name);Uo.map(t=>t.name);Uo.filter(t=>t.dispatchable).map(t=>t.name);function aS(t){return m_.includes(t)}function lS(t){const r=Uo.find(s=>s.name===t);if(!r)throw new Error(`Unknown role: ${t}`);return r}const oS="zh-CN",cS="pm-final-only",g_=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],uS=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function hS(){const t={};for(const r of m_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}const __=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],fS=[{value:"default",label:"Default",description:"Account default",source:"claude",available:!0},{value:"fable",label:"Fable",description:"Claude Fable",source:"claude",available:!0},{value:"opus",label:"Opus",description:"Latest Opus",source:"claude",available:!0},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Pinned Claude Opus 4.8",source:"claude",available:!0},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet",source:"claude",available:!0}],dS="Codex API/gpt-5.6-sol",pS=`ccr:${dS}`;function v_(t=!1,r="CCR GPT models are unavailable."){return[...fS,{value:pS,label:"GPT-5.6 Sol (CCR)",description:"GPT-5.6 Sol through the host CCR gateway",source:"ccr",available:t,...t?{}:{unavailableReason:r}}]}const mS=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"}],y_=[...mS,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function gS({sidebar:t,children:r}){const[s,l]=ee.useState(!1);return C.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[C.jsxs("aside",{className:"app-sidebar",children:[C.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),C.jsx("div",{className:"sidebar-content",children:t})]}),C.jsx("main",{className:"app-main",children:r})]})}function cl(t,r="Unknown error."){if(t instanceof Error)return t.message||r;if(typeof t=="string"&&t.trim())return t;if(t===void 0)return r;try{return JSON.stringify(t)}catch{return String(t)}}function lt(t,r,s){return`${t} failed. Reason: ${cl(r,s)}`}function Lo(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const ye={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(t){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getCcrIntegrationStatus(){return be("/api/settings/ccr")},updateCcrIntegration(t){return be("/api/settings/ccr",{method:"PUT",body:JSON.stringify(t)})},checkCcrIntegration(){return be("/api/settings/ccr/check",{method:"POST"})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(t){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return be("/api/tasks")},createTask(t){return be("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return be(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(t,r){const s=new URLSearchParams({taskSlug:t});return r&&s.set("commit",r),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return be("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:t})})},getHarnessBootstrapStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/stop",{method:"POST",body:JSON.stringify(t)})},runHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return be(`/api/projects/harness/engineer/session${s}`)},ensureHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/stop",{method:"POST",body:JSON.stringify(t)})},notifyHarnessEngineerHarnessUpdated(t={}){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},sendHarnessFeedback(t){return be("/api/projects/harness/feedback/send",{method:"POST",body:JSON.stringify(t)})},startTaskHarnessRetrospective(t){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return be("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return be("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},retryDurableDocAssignment(t){return be("/api/projects/harness/memory/assignments/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return be(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return be(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return be(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},ignoreRoleStallWarning(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/role-stall/ignore`,{method:"POST",body:JSON.stringify({warningId:r})})},recoverRoleStallWarning(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/role-stall/recover`,{method:"POST",body:JSON.stringify({warningId:r})})},getTaskUsageAnalytics(t){return be(`/api/tasks/${encodeURIComponent(t)}/usage-analytics`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return be(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return be(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},cancelGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/cancel`,{method:"POST",body:JSON.stringify(s)})},skipGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/translation/sessions/${encodeURIComponent(t)}/events?${l.toString()}`)},pollTranslationTaskFeed(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(t={}){return be("/api/projects/translation/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},retryTranslation(t,r){return be(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return be(`/api/translation/session${s}`)},ensureTranslatorSession(t={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(t={}){return be("/api/translation/session/stop",{method:"POST",body:JSON.stringify(t)})},browseTranslationSourceFiles(t={}){const r=new URLSearchParams;t.path&&r.set("path",t.path),t.query&&r.set("query",t.query),t.limit!==void 0&&r.set("limit",String(t.limit));const s=r.toString()?`?${r.toString()}`:"";return be(`/api/translation/source-files${s}`)},createFileTranslation(t){return be("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return be(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return be(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(t){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function be(t,r={}){var m,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(t,{...r,headers:s})}catch(c){throw new Error(`${l} ${t} could not reach the VCM backend. Reason: ${cl(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),u=_S(c),g=d.statusText?`${d.status} ${d.statusText}`:String(d.status),S=((m=u==null?void 0:u.error)!=null&&m.hint?`${u.error.message??"Backend error."} ${u.error.hint}`:(f=u==null?void 0:u.error)==null?void 0:f.message)??vS(c),w=(o=u==null?void 0:u.error)==null?void 0:o.runtime,T=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${t} returned HTTP ${g}. ${S}${T}`)}return d.json()}function _S(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}function vS(t){const r=t.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const bh="vcm:ui-error-report",Ch="vcm:ui-error-clear-actions",wh="vcm:ui-error-clear-message";function yS(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(bh,{detail:{message:r}}))}function SS(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(wh,{detail:{message:r}}))}function bS(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(Ch,{detail:{actions:t}}))}function Ii(t){const[r,s]=ee.useState(t),l=ee.useRef(t),d=ee.useCallback(m=>{const f=l.current,o=typeof m=="function"?m(f):m;l.current=o,typeof o=="string"&&o.trim()?yS(o):typeof f=="string"&&f.trim()&&SS(f),s(o)},[]);return[r,d]}var eh={exports:{}},Wm;function CS(){return Wm||(Wm=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const m=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(m._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,m=d._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),h=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),S=u-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(S/m.css.cell.width)),rows:Math.max(1,Math.floor(h/m.css.cell.height))}}}})(),s})()))})(eh)),eh.exports}var wS=CS(),th={exports:{}},Km;function xS(){return Km||(Km=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(g){try{const h=new URL(g),S=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return g.toLocaleLowerCase().startsWith(S.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,h,S,w={}){this._terminal=g,this._regex=h,this._handler=S,this._options=w}provideLinks(g,h){const S=u.computeLink(g,this._regex,this._terminal,this._handler);h(this._addCallbacks(S))}_addCallbacks(g){return g.map((h=>(h.leave=this._options.leave,h.hover=(S,w)=>{if(this._options.hover){const{range:T}=h;this._options.hover(S,w,T)}},h)))}};class u{static computeLink(h,S,w,T){const k=new RegExp(S.source,(S.flags||"")+"g"),[y,_]=u._getWindowedLineStrings(h-1,w),v=y.join("");let b;const E=[];for(;b=k.exec(v);){const O=b[0];if(!c(O))continue;const[R,D]=u._mapStrIdx(w,_,0,b.index),[A,M]=u._mapStrIdx(w,R,D,O.length);if(R===-1||D===-1||A===-1||M===-1)continue;const L={start:{x:D+1,y:R+1},end:{x:M,y:A+1}};E.push({range:L,text:O,activate:T})}return E}static _getWindowedLineStrings(h,S){let w,T=h,k=h,y=0,_="";const v=[];if(w=S.buffer.active.getLine(h)){const b=w.translateToString(!0);if(w.isWrapped&&b[0]!==" "){for(y=0;(w=S.buffer.active.getLine(--T))&&y<2048&&(_=w.translateToString(!0),y+=_.length,v.push(_),w.isWrapped&&_.indexOf(" ")===-1););v.reverse()}for(v.push(b),y=0;(w=S.buffer.active.getLine(++k))&&w.isWrapped&&y<2048&&(_=w.translateToString(!0),y+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,T]}static _mapStrIdx(h,S,w,T){const k=h.buffer.active,y=k.getNullCell();let _=w;for(;T;){const v=k.getLine(S);if(!v)return[-1,-1];for(let b=_;b<v.length;++b){v.getCell(b,y);const E=y.getChars();if(y.getWidth()&&(T-=E.length||1,b===v.length-1&&E==="")){const O=k.getLine(S+1);O&&O.isWrapped&&(O.getCell(0,y),y.getWidth()===2&&(T+=1))}if(T<0)return[S,b]}S++,_=0}return[S,_]}}o.LinkComputer=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(g,h){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(g=u,h={}){this._handler=g,this._options=h}activate(g){this._terminal=g;const h=this._options,S=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,S,this._handler,h))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),m})()))})(th)),th.exports}var ES=xS(),nh={exports:{}},Ym;function kS(){return Ym||(Ym=1,(function(t,r){(function(s,l){t.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var u=this&&this.__decorate||function(v,b,E,O){var R,D=arguments.length,A=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(v,b,E,O);else for(var M=v.length-1;M>=0;M--)(R=v[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},g=this&&this.__param||function(v,b){return function(E,O){b(E,O,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),S=c(9924),w=c(844),T=c(4725),k=c(2585),y=c(3656);let _=o.AccessibilityManager=class extends w.Disposable{constructor(v,b,E,O){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=O,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
51
+ `}return te.substring(0,te.length-1)},g.renderTo2dContext=function(D,A){A=A||2;const M=g.getModuleCount();for(let L=0;L<M;L++)for(let H=0;H<M;H++)D.fillStyle=g.isDark(L,H)?"black":"white",D.fillRect(H*A,L*A,A,A)},g};Qr.stringToBytes=function(t){const r=[];for(let s=0;s<t.length;s+=1){const l=t.charCodeAt(s);r.push(l&255)}return r};Qr.createStringToBytes=function(t,r){const s=(function(){const d=tS(t),m=function(){const c=d.read();if(c==-1)throw"eof";return c};let f=0;const o={};for(;;){const c=d.read();if(c==-1)break;const u=m(),g=m(),h=m(),S=String.fromCharCode(c<<8|u),w=g<<8|h;o[S]=w,f+=1}if(f!=r)throw f+" != "+r;return o})(),l=63;return function(d){const m=[];for(let f=0;f<d.length;f+=1){const o=d.charCodeAt(f);if(o<128)m.push(o);else{const c=s[d.charAt(f)];typeof c=="number"?(c&255)==c?m.push(c):(m.push(c>>>8),m.push(c&255)):m.push(l)}}return m}};const en={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Za={L:1,M:0,Q:3,H:2},_r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},vr=(function(){const t=[[],[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]],r=1335,s=7973,l=21522,d={},m=function(f){let o=0;for(;f!=0;)o+=1,f>>>=1;return o};return d.getBCHTypeInfo=function(f){let o=f<<10;for(;m(o)-m(r)>=0;)o^=r<<m(o)-m(r);return(f<<10|o)^l},d.getBCHTypeNumber=function(f){let o=f<<12;for(;m(o)-m(s)>=0;)o^=s<<m(o)-m(s);return f<<12|o},d.getPatternPosition=function(f){return t[f-1]},d.getMaskFunction=function(f){switch(f){case _r.PATTERN000:return function(o,c){return(o+c)%2==0};case _r.PATTERN001:return function(o,c){return o%2==0};case _r.PATTERN010:return function(o,c){return c%3==0};case _r.PATTERN011:return function(o,c){return(o+c)%3==0};case _r.PATTERN100:return function(o,c){return(Math.floor(o/2)+Math.floor(c/3))%2==0};case _r.PATTERN101:return function(o,c){return o*c%2+o*c%3==0};case _r.PATTERN110:return function(o,c){return(o*c%2+o*c%3)%2==0};case _r.PATTERN111:return function(o,c){return(o*c%3+(o+c)%2)%2==0};default:throw"bad maskPattern:"+f}},d.getErrorCorrectPolynomial=function(f){let o=rl([1],0);for(let c=0;c<f;c+=1)o=o.multiply(rl([1,Sr.gexp(c)],0));return o},d.getLengthInBits=function(f,o){if(1<=o&&o<10)switch(f){case en.MODE_NUMBER:return 10;case en.MODE_ALPHA_NUM:return 9;case en.MODE_8BIT_BYTE:return 8;case en.MODE_KANJI:return 8;default:throw"mode:"+f}else if(o<27)switch(f){case en.MODE_NUMBER:return 12;case en.MODE_ALPHA_NUM:return 11;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 10;default:throw"mode:"+f}else if(o<41)switch(f){case en.MODE_NUMBER:return 14;case en.MODE_ALPHA_NUM:return 13;case en.MODE_8BIT_BYTE:return 16;case en.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+o},d.getLostPoint=function(f){const o=f.getModuleCount();let c=0;for(let h=0;h<o;h+=1)for(let S=0;S<o;S+=1){let w=0;const T=f.isDark(h,S);for(let k=-1;k<=1;k+=1)if(!(h+k<0||o<=h+k))for(let y=-1;y<=1;y+=1)S+y<0||o<=S+y||k==0&&y==0||T==f.isDark(h+k,S+y)&&(w+=1);w>5&&(c+=3+w-5)}for(let h=0;h<o-1;h+=1)for(let S=0;S<o-1;S+=1){let w=0;f.isDark(h,S)&&(w+=1),f.isDark(h+1,S)&&(w+=1),f.isDark(h,S+1)&&(w+=1),f.isDark(h+1,S+1)&&(w+=1),(w==0||w==4)&&(c+=3)}for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(h,S)&&!f.isDark(h,S+1)&&f.isDark(h,S+2)&&f.isDark(h,S+3)&&f.isDark(h,S+4)&&!f.isDark(h,S+5)&&f.isDark(h,S+6)&&(c+=40);for(let h=0;h<o;h+=1)for(let S=0;S<o-6;S+=1)f.isDark(S,h)&&!f.isDark(S+1,h)&&f.isDark(S+2,h)&&f.isDark(S+3,h)&&f.isDark(S+4,h)&&!f.isDark(S+5,h)&&f.isDark(S+6,h)&&(c+=40);let u=0;for(let h=0;h<o;h+=1)for(let S=0;S<o;S+=1)f.isDark(S,h)&&(u+=1);const g=Math.abs(100*u/o/o-50)/5;return c+=g*10,c},d})(),Sr=(function(){const t=new Array(256),r=new Array(256);for(let l=0;l<8;l+=1)t[l]=1<<l;for(let l=8;l<256;l+=1)t[l]=t[l-4]^t[l-5]^t[l-6]^t[l-8];for(let l=0;l<255;l+=1)r[t[l]]=l;const s={};return s.glog=function(l){if(l<1)throw"glog("+l+")";return r[l]},s.gexp=function(l){for(;l<0;)l+=255;for(;l>=256;)l-=255;return t[l]},s})(),rl=function(t,r){if(typeof t.length>"u")throw t.length+"/"+r;const s=(function(){let d=0;for(;d<t.length&&t[d]==0;)d+=1;const m=new Array(t.length-d+r);for(let f=0;f<t.length-d;f+=1)m[f]=t[f+d];return m})(),l={};return l.getAt=function(d){return s[d]},l.getLength=function(){return s.length},l.multiply=function(d){const m=new Array(l.getLength()+d.getLength()-1);for(let f=0;f<l.getLength();f+=1)for(let o=0;o<d.getLength();o+=1)m[f+o]^=Sr.gexp(Sr.glog(l.getAt(f))+Sr.glog(d.getAt(o)));return rl(m,0)},l.mod=function(d){if(l.getLength()-d.getLength()<0)return l;const m=Sr.glog(l.getAt(0))-Sr.glog(d.getAt(0)),f=new Array(l.getLength());for(let o=0;o<l.getLength();o+=1)f[o]=l.getAt(o);for(let o=0;o<d.getLength();o+=1)f[o]^=Sr.gexp(Sr.glog(d.getAt(o))+m);return rl(f,0).mod(d)},l},Gm=(function(){const t=[[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]],r=function(d,m){const f={};return f.totalCount=d,f.dataCount=m,f},s={},l=function(d,m){switch(m){case Za.L:return t[(d-1)*4+0];case Za.M:return t[(d-1)*4+1];case Za.Q:return t[(d-1)*4+2];case Za.H:return t[(d-1)*4+3];default:return}};return s.getRSBlocks=function(d,m){const f=l(d,m);if(typeof f>"u")throw"bad rs block @ typeNumber:"+d+"/errorCorrectionLevel:"+m;const o=f.length/3,c=[];for(let u=0;u<o;u+=1){const g=f[u*3+0],h=f[u*3+1],S=f[u*3+2];for(let w=0;w<g;w+=1)c.push(r(h,S))}return c},s})(),Vm=function(){const t=[];let r=0;const s={};return s.getBuffer=function(){return t},s.getAt=function(l){const d=Math.floor(l/8);return(t[d]>>>7-l%8&1)==1},s.put=function(l,d){for(let m=0;m<d;m+=1)s.putBit((l>>>d-m-1&1)==1)},s.getLengthInBits=function(){return r},s.putBit=function(l){const d=Math.floor(r/8);t.length<=d&&t.push(0),l&&(t[d]|=128>>>r%8),r+=1},s},X0=function(t){const r=en.MODE_NUMBER,s=t,l={};l.getMode=function(){return r},l.getLength=function(f){return s.length},l.write=function(f){const o=s;let c=0;for(;c+2<o.length;)f.put(d(o.substring(c,c+3)),10),c+=3;c<o.length&&(o.length-c==1?f.put(d(o.substring(c,c+1)),4):o.length-c==2&&f.put(d(o.substring(c,c+2)),7))};const d=function(f){let o=0;for(let c=0;c<f.length;c+=1)o=o*10+m(f.charAt(c));return o},m=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return l},Q0=function(t){const r=en.MODE_ALPHA_NUM,s=t,l={};l.getMode=function(){return r},l.getLength=function(m){return s.length},l.write=function(m){const f=s;let o=0;for(;o+1<f.length;)m.put(d(f.charAt(o))*45+d(f.charAt(o+1)),11),o+=2;o<f.length&&m.put(d(f.charAt(o)),6)};const d=function(m){if("0"<=m&&m<="9")return m.charCodeAt(0)-48;if("A"<=m&&m<="Z")return m.charCodeAt(0)-65+10;switch(m){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 :"+m}};return l},J0=function(t){const r=en.MODE_8BIT_BYTE,s=Qr.stringToBytes(t),l={};return l.getMode=function(){return r},l.getLength=function(d){return s.length},l.write=function(d){for(let m=0;m<s.length;m+=1)d.put(s[m],8)},l},Z0=function(t){const r=en.MODE_KANJI,s=Qr.stringToBytes;(function(m,f){const o=s(m);if(o.length!=2||(o[0]<<8|o[1])!=f)throw"sjis not supported."})("友",38726);const l=s(t),d={};return d.getMode=function(){return r},d.getLength=function(m){return~~(l.length/2)},d.write=function(m){const f=l;let o=0;for(;o+1<f.length;){let c=(255&f[o])<<8|255&f[o+1];if(33088<=c&&c<=40956)c-=33088;else if(57408<=c&&c<=60351)c-=49472;else throw"illegal char at "+(o+1)+"/"+c;c=(c>>>8&255)*192+(c&255),m.put(c,13),o+=2}if(o<f.length)throw"illegal char at "+(o+1)},d},f_=function(){const t=[],r={};return r.writeByte=function(s){t.push(s&255)},r.writeShort=function(s){r.writeByte(s),r.writeByte(s>>>8)},r.writeBytes=function(s,l,d){l=l||0,d=d||s.length;for(let m=0;m<d;m+=1)r.writeByte(s[m+l])},r.writeString=function(s){for(let l=0;l<s.length;l+=1)r.writeByte(s.charCodeAt(l))},r.toByteArray=function(){return t},r.toString=function(){let s="";s+="[";for(let l=0;l<t.length;l+=1)l>0&&(s+=","),s+=t[l];return s+="]",s},r},eS=function(){let t=0,r=0,s=0,l="";const d={},m=function(o){l+=String.fromCharCode(f(o&63))},f=function(o){if(o<0)throw"n:"+o;if(o<26)return 65+o;if(o<52)return 97+(o-26);if(o<62)return 48+(o-52);if(o==62)return 43;if(o==63)return 47;throw"n:"+o};return d.writeByte=function(o){for(t=t<<8|o&255,r+=8,s+=1;r>=6;)m(t>>>r-6),r-=6},d.flush=function(){if(r>0&&(m(t<<6-r),t=0,r=0),s%3!=0){const o=3-s%3;for(let c=0;c<o;c+=1)l+="="}},d.toString=function(){return l},d},tS=function(t){const r=t;let s=0,l=0,d=0;const m={};m.read=function(){for(;d<8;){if(s>=r.length){if(d==0)return-1;throw"unexpected end of file./"+d}const c=r.charAt(s);if(s+=1,c=="=")return d=0,-1;if(c.match(/^\s$/))continue;l=l<<6|f(c.charCodeAt(0)),d+=6}const o=l>>>d-8&255;return d-=8,o};const f=function(o){if(65<=o&&o<=90)return o-65;if(97<=o&&o<=122)return o-97+26;if(48<=o&&o<=57)return o-48+52;if(o==43)return 62;if(o==47)return 63;throw"c:"+o};return m},nS=function(t,r){const s=t,l=r,d=new Array(t*r),m={};m.setPixel=function(u,g,h){d[g*s+u]=h},m.write=function(u){u.writeString("GIF87a"),u.writeShort(s),u.writeShort(l),u.writeByte(128),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(0),u.writeByte(255),u.writeByte(255),u.writeByte(255),u.writeString(","),u.writeShort(0),u.writeShort(0),u.writeShort(s),u.writeShort(l),u.writeByte(0);const g=2,h=o(g);u.writeByte(g);let S=0;for(;h.length-S>255;)u.writeByte(255),u.writeBytes(h,S,255),S+=255;u.writeByte(h.length-S),u.writeBytes(h,S,h.length-S),u.writeByte(0),u.writeString(";")};const f=function(u){const g=u;let h=0,S=0;const w={};return w.write=function(T,k){if(T>>>k)throw"length over";for(;h+k>=8;)g.writeByte(255&(T<<h|S)),k-=8-h,T>>>=8-h,S=0,h=0;S=T<<h|S,h=h+k},w.flush=function(){h>0&&g.writeByte(S)},w},o=function(u){const g=1<<u,h=(1<<u)+1;let S=u+1;const w=c();for(let v=0;v<g;v+=1)w.add(String.fromCharCode(v));w.add(String.fromCharCode(g)),w.add(String.fromCharCode(h));const T=f_(),k=f(T);k.write(g,S);let y=0,_=String.fromCharCode(d[y]);for(y+=1;y<d.length;){const v=String.fromCharCode(d[y]);y+=1,w.contains(_+v)?_=_+v:(k.write(w.indexOf(_),S),w.size()<4095&&(w.size()==1<<S&&(S+=1),w.add(_+v)),_=v)}return k.write(w.indexOf(_),S),k.write(h,S),k.flush(),T.toByteArray()},c=function(){const u={};let g=0;const h={};return h.add=function(S){if(h.contains(S))throw"dup key:"+S;u[S]=g,g+=1},h.size=function(){return g},h.indexOf=function(S){return u[S]},h.contains=function(S){return typeof u[S]<"u"},h};return m},iS=function(t,r,s){const l=nS(t,r);for(let o=0;o<r;o+=1)for(let c=0;c<t;c+=1)l.setPixel(c,o,s(c,o));const d=f_();l.write(d);const m=eS(),f=d.toByteArray();for(let o=0;o<f.length;o+=1)m.writeByte(f[o]);return m.flush(),"data:image/gif;base64,"+m};Qr.stringToBytes;const sl=[{name:"project-manager",label:"Project Manager",commandAgent:"project-manager",dispatchable:!1},{name:"architect",label:"Architect",commandAgent:"architect",dispatchable:!0},{name:"coder",label:"Coder",commandAgent:"coder",dispatchable:!0},{name:"tester",label:"Tester",commandAgent:"tester",dispatchable:!0}],d_={name:"reviewer",label:"Reviewer",commandAgent:"reviewer",dispatchable:!1},Jr=[...sl,d_],rS={name:"translator",label:"Translator",commandAgent:"translator",dispatchable:!1},sS={name:"harness-engineer",label:"Harness Engineer",commandAgent:"harness-engineer",dispatchable:!1},p_=[rS,sS],Uo=[...Jr,...p_];sl.map(t=>t.name);const m_=Jr.map(t=>t.name);p_.map(t=>t.name);Uo.map(t=>t.name);Uo.filter(t=>t.dispatchable).map(t=>t.name);function aS(t){return m_.includes(t)}function lS(t){const r=Uo.find(s=>s.name===t);if(!r)throw new Error(`Unknown role: ${t}`);return r}const oS="zh-CN",cS="pm-final-only",g_=[{value:"zh-CN",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"es",label:"Spanish"}],uS=[{value:"round-final",label:"Round final reply"},{value:"pm-final-only",label:"PM final reply"},{value:"final-only",label:"Each role final reply"},{value:"all",label:"All replies"}];function hS(){const t={};for(const r of m_)t[r]={permissionMode:"bypassPermissions",model:"default",effort:"default"};return{version:1,roles:t,autoOrchestration:!0}}const __=[{value:"bypassPermissions",label:"bypassPermissions",description:"Bypass prompts; recommended in DevContainer worktrees"},{value:"plan",label:"plan",description:"Plan-only permission mode"},{value:"default",label:"default",description:"Claude Code default permission behavior"}],fS=[{value:"default",label:"Default",description:"Account default",source:"claude",available:!0},{value:"fable",label:"Fable",description:"Claude Fable",source:"claude",available:!0},{value:"opus",label:"Opus",description:"Latest Opus",source:"claude",available:!0},{value:"claude-opus-4-8",label:"Opus 4.8",description:"Pinned Claude Opus 4.8",source:"claude",available:!0},{value:"sonnet",label:"Sonnet",description:"Latest Sonnet",source:"claude",available:!0}];function dS(t){return`codex-bridge:${t}`}function v_(t=[],r){return[...fS,...t.map(s=>({value:dS(s.id),label:`${s.displayName??s.id} (Codex Bridge)`,description:`${s.id} through the host Codex Bridge`,source:"codex-bridge",available:r===void 0}))]}const pS=[{value:"default",label:"Default",description:"CLI or project default"},{value:"low",label:"Low",description:"Fastest reasoning"},{value:"medium",label:"Medium",description:"Balanced reasoning"},{value:"high",label:"High",description:"Deeper reasoning"},{value:"xhigh",label:"XHigh",description:"Extra high reasoning"}],y_=[...pS,{value:"max",label:"Max",description:"Maximum reasoning"},{value:"ultracode",label:"Ultracode",description:"Claude Code dynamic workflows with xhigh reasoning"}];function mS({sidebar:t,children:r}){const[s,l]=ee.useState(!1);return C.jsxs("div",{className:s?"app-shell is-sidebar-collapsed":"app-shell",children:[C.jsxs("aside",{className:"app-sidebar",children:[C.jsx("button",{className:"sidebar-toggle",type:"button","aria-label":s?"Expand sidebar":"Collapse sidebar",title:s?"Expand sidebar":"Collapse sidebar",onClick:()=>l(d=>!d)}),C.jsx("div",{className:"sidebar-content",children:t})]}),C.jsx("main",{className:"app-main",children:r})]})}function cl(t,r="Unknown error."){if(t instanceof Error)return t.message||r;if(typeof t=="string"&&t.trim())return t;if(t===void 0)return r;try{return JSON.stringify(t)}catch{return String(t)}}function lt(t,r,s){return`${t} failed. Reason: ${cl(r,s)}`}function Lo(t,r){return r.some(s=>t.startsWith(`${s} failed.`))?"":t}const ye={getAppPreferences(){return be("/api/settings/preferences")},updateAppPreferences(t){return be("/api/settings/preferences",{method:"PUT",body:JSON.stringify(t)})},getCodexBridgeIntegrationStatus(){return be("/api/settings/codex-bridge")},updateCodexBridgeIntegration(t){return be("/api/settings/codex-bridge",{method:"PUT",body:JSON.stringify(t)})},checkCodexBridgeIntegration(){return be("/api/settings/codex-bridge/check",{method:"POST"})},getRuntimeDiagnostics(){return be("/api/diagnostics/runtime")},getCurrentProject(){return be("/api/projects/current")},pullCurrentProject(){return be("/api/projects/current/pull",{method:"POST"})},getRecentRepositoryPaths(){return be("/api/projects/recent")},connectProject(t){return be("/api/projects/connect",{method:"POST",body:JSON.stringify(t)})},listTasks(){return be("/api/tasks")},createTask(t){return be("/api/tasks",{method:"POST",body:JSON.stringify(t)})},cleanupTask(t){return be(`/api/tasks/${encodeURIComponent(t)}/cleanup`,{method:"POST"})},getHarnessStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness?${r.toString()}`)},applyHarness(t){return be("/api/projects/harness/apply",{method:"POST",body:JSON.stringify(t)})},getHarnessFileContent(t,r){const s=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${s.toString()}`)},updateHarnessFileContent(t,r,s){const l=new URLSearchParams({path:r,taskSlug:t});return be(`/api/projects/harness/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},getRepositoryDiff(t,r){const s=new URLSearchParams({taskSlug:t});return r&&s.set("commit",r),be(`/api/projects/harness/repository-diff?${s.toString()}`)},getRepositoryFileDiff(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/repository-diff/file?${s.toString()}`)},mergeRepositoryDiffToCurrentBranch(t){return be("/api/projects/harness/repository-diff/merge-to-current-branch",{method:"POST",body:JSON.stringify({taskSlug:t})})},getHarnessBootstrapStatus(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/bootstrap?${r.toString()}`)},startHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/start",{method:"POST",body:JSON.stringify(t)})},restartHarnessBootstrap(t={}){return be("/api/projects/harness/bootstrap/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/stop",{method:"POST",body:JSON.stringify(t)})},runHarnessBootstrap(t){return be("/api/projects/harness/bootstrap/run",{method:"POST",body:JSON.stringify(t)})},getHarnessEngineerSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return be(`/api/projects/harness/engineer/session${s}`)},ensureHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/ensure",{method:"POST",body:JSON.stringify(t)})},startHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/start",{method:"POST",body:JSON.stringify(t)})},resumeHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/resume",{method:"POST",body:JSON.stringify(t)})},restartHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/restart",{method:"POST",body:JSON.stringify(t)})},stopHarnessEngineerSession(t={}){return be("/api/projects/harness/engineer/session/stop",{method:"POST",body:JSON.stringify(t)})},notifyHarnessEngineerHarnessUpdated(t={}){return be("/api/projects/harness/engineer/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},getHarnessFeedbackState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/harness/feedback${s?`?${s}`:""}`)},sendHarnessFeedback(t){return be("/api/projects/harness/feedback/send",{method:"POST",body:JSON.stringify(t)})},startTaskHarnessRetrospective(t){return be("/api/projects/harness/task-retrospective",{method:"POST",body:JSON.stringify(t)})},getAutoMemoryState(t){const r=new URLSearchParams({taskSlug:t});return be(`/api/projects/harness/memory?${r.toString()}`)},getMemoryFileContent(t,r){const s=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${s.toString()}`)},updateMemoryFileContent(t,r,s){const l=new URLSearchParams({taskSlug:t,path:r});return be(`/api/projects/harness/memory/file?${l.toString()}`,{method:"PUT",body:JSON.stringify(s)})},revertMemoryRun(t){return be("/api/projects/harness/memory/revert",{method:"POST",body:JSON.stringify(t)})},retryMemoryReview(t){return be("/api/projects/harness/memory/retry",{method:"POST",body:JSON.stringify(t)})},retryDurableDocAssignment(t){return be("/api/projects/harness/memory/assignments/retry",{method:"POST",body:JSON.stringify(t)})},getTaskStatus(t){return be(`/api/tasks/${encodeURIComponent(t)}/status`)},oneClickStart(t){return be(`/api/tasks/${encodeURIComponent(t)}/one-click-start`,{method:"POST"})},getTaskWorkspaceState(t){return be(`/api/tasks/${encodeURIComponent(t)}/workspace-state`)},ignoreRoleStallWarning(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/role-stall/ignore`,{method:"POST",body:JSON.stringify({warningId:r})})},recoverRoleStallWarning(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/role-stall/recover`,{method:"POST",body:JSON.stringify({warningId:r})})},getTaskUsageAnalytics(t){return be(`/api/tasks/${encodeURIComponent(t)}/usage-analytics`)},getProjectRuntimeState(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString();return be(`/api/projects/runtime-state${s?`?${s}`:""}`)},listSessions(t){return be(`/api/tasks/${encodeURIComponent(t)}/sessions`)},startRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/start`,{method:"POST",body:JSON.stringify(s)})},stopRoleSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/stop`,{method:"POST"})},restartRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/restart`,{method:"POST",body:JSON.stringify(s)})},resumeRoleSession(t,r,s={}){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/resume`,{method:"POST",body:JSON.stringify(s)})},notifyRoleHarnessUpdated(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/notify-harness`,{method:"POST"})},dispatchRoleCommand(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/dispatch`,{method:"POST"})},listMessages(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages`)},markAllMessagesDone(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/mark-all-done`,{method:"POST"})},deleteMessageHistory(t){return be(`/api/tasks/${encodeURIComponent(t)}/messages/history`,{method:"DELETE"})},getOrchestrationState(t){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`)},updateOrchestrationState(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/orchestration`,{method:"PUT",body:JSON.stringify(r)})},getSessionRoundState(t){return be(`/api/tasks/${encodeURIComponent(t)}/round`)},getGateReviewState(t){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review`)},updateGateReviewSettings(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/settings`,{method:"PUT",body:JSON.stringify(r)})},requestGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/request`,{method:"POST"})},retryGateReviewGate(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/retry`,{method:"POST"})},cancelGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/cancel`,{method:"POST",body:JSON.stringify(s)})},skipGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/skip`,{method:"POST",body:JSON.stringify(s)})},overrideGateReviewGate(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/override`,{method:"POST",body:JSON.stringify(s)})},getGateReviewReport(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/gate-review/${r}/report`)},startTranslationSession(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/start`,{method:"POST"})},pollTranslationSession(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/translation/sessions/${encodeURIComponent(t)}/events?${l.toString()}`)},pollTranslationTaskFeed(t,r,s){const l=new URLSearchParams({after:String(r)});return s!==void 0&&l.set("limit",String(s)),be(`/api/tasks/${encodeURIComponent(t)}/translation/feed?${l.toString()}`)},translateUserInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/input`,{method:"POST",body:JSON.stringify(s)})},translateManualOutput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/manual-output`,{method:"POST",body:JSON.stringify(s)})},translateLatestReply(t,r){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/latest-reply`,{method:"POST"})},sendTranslatedInput(t,r,s){return be(`/api/tasks/${encodeURIComponent(t)}/sessions/${r}/translation/send`,{method:"POST",body:JSON.stringify(s)})},clearTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/clear`,{method:"POST"})},stopTranslationSession(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/stop`,{method:"POST"})},notifyTranslatorHarnessUpdated(t={}){return be("/api/projects/translation/session/notify-harness",{method:"POST",body:JSON.stringify(t)})},retryTranslation(t,r){return be(`/api/translation/sessions/${encodeURIComponent(t)}/retry/${encodeURIComponent(r)}`,{method:"POST"})},ignoreTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/ignore`,{method:"POST"})},retryTranslationFailures(t){return be(`/api/translation/sessions/${encodeURIComponent(t)}/failures/retry`,{method:"POST"})},getTranslationState(){return be("/api/translation/state")},getTranslatorSession(t){const r=new URLSearchParams;t&&r.set("taskSlug",t);const s=r.toString()?`?${r.toString()}`:"";return be(`/api/translation/session${s}`)},ensureTranslatorSession(t={}){return be("/api/translation/session/ensure",{method:"POST",body:JSON.stringify(t)})},startTranslatorSession(t={}){return be("/api/translation/session/start",{method:"POST",body:JSON.stringify(t)})},resumeTranslatorSession(t={}){return be("/api/translation/session/resume",{method:"POST",body:JSON.stringify(t)})},restartTranslatorSession(t={}){return be("/api/translation/session/restart",{method:"POST",body:JSON.stringify(t)})},stopTranslatorSession(t={}){return be("/api/translation/session/stop",{method:"POST",body:JSON.stringify(t)})},browseTranslationSourceFiles(t={}){const r=new URLSearchParams;t.path&&r.set("path",t.path),t.query&&r.set("query",t.query),t.limit!==void 0&&r.set("limit",String(t.limit));const s=r.toString()?`?${r.toString()}`:"";return be(`/api/translation/source-files${s}`)},createFileTranslation(t){return be("/api/translation/files",{method:"POST",body:JSON.stringify(t)})},readFileTranslation(t){return be(`/api/translation/files/${encodeURIComponent(t)}`)},createTranslationBootstrap(t){return be("/api/translation/bootstrap",{method:"POST",body:JSON.stringify(t)})},createTranslationMemoryUpdate(t){return be("/api/translation/memory-update",{method:"POST",body:JSON.stringify(t)})},promoteTranslation(t,r){return be(`/api/translation/files/${encodeURIComponent(t)}/promote`,{method:"POST",body:JSON.stringify({targetPath:r})})},getGatewayStatus(){return be("/api/gateway/status")},updateGatewaySettings(t){return be("/api/gateway/settings",{method:"PUT",body:JSON.stringify(t)})},startGatewayQrLogin(){return be("/api/gateway/qr/start",{method:"POST"})},checkGatewayQrLogin(t={}){return be("/api/gateway/qr/check",{method:"POST",body:JSON.stringify(t)})},startGatewayLarkRegistration(){return be("/api/gateway/lark-registration/start",{method:"POST"})},checkGatewayLarkRegistration(){return be("/api/gateway/lark-registration/check",{method:"POST"})},bindGatewayLarkApp(t){return be("/api/gateway/lark-registration/bind",{method:"POST",body:JSON.stringify(t)})},resetGatewayBinding(){return be("/api/gateway/binding/reset",{method:"POST"})},setGatewayConnection(t){return be("/api/gateway/connection",{method:"PUT",body:JSON.stringify({enabled:t})})}};async function be(t,r={}){var m,f,o;const s=new Headers(r.headers);r.body!==void 0&&r.body!==null&&!s.has("content-type")&&s.set("content-type","application/json");const l=(r.method??"GET").toUpperCase();let d;try{d=await fetch(t,{...r,headers:s})}catch(c){throw new Error(`${l} ${t} could not reach the VCM backend. Reason: ${cl(c)}`)}if(!d.ok){const c=await d.text().catch(()=>""),u=gS(c),g=d.statusText?`${d.status} ${d.statusText}`:String(d.status),S=((m=u==null?void 0:u.error)!=null&&m.hint?`${u.error.message??"Backend error."} ${u.error.hint}`:(f=u==null?void 0:u.error)==null?void 0:f.message)??_S(c),w=(o=u==null?void 0:u.error)==null?void 0:o.runtime,T=w?` [backend ${w.version??"unknown"} pid=${w.pid??"unknown"} cwd=${w.cwd??"unknown"}]`:"";throw new Error(`${l} ${t} returned HTTP ${g}. ${S}${T}`)}return d.json()}function gS(t){if(!t.trim())return null;try{return JSON.parse(t)}catch{return null}}function _S(t){const r=t.trim();return r?`Non-JSON response body: ${r.slice(0,500)}`:"The response body was empty."}const bh="vcm:ui-error-report",Ch="vcm:ui-error-clear-actions",wh="vcm:ui-error-clear-message";function vS(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(bh,{detail:{message:r}}))}function yS(t){const r=t.trim();!r||typeof window>"u"||window.dispatchEvent(new CustomEvent(wh,{detail:{message:r}}))}function SS(t){t.length===0||typeof window>"u"||window.dispatchEvent(new CustomEvent(Ch,{detail:{actions:t}}))}function Ii(t){const[r,s]=ee.useState(t),l=ee.useRef(t),d=ee.useCallback(m=>{const f=l.current,o=typeof m=="function"?m(f):m;l.current=o,typeof o=="string"&&o.trim()?vS(o):typeof f=="string"&&f.trim()&&yS(f),s(o)},[]);return[r,d]}var eh={exports:{}},Wm;function bS(){return Wm||(Wm=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={};return(()=>{var l=s;Object.defineProperty(l,"__esModule",{value:!0}),l.FitAddon=void 0,l.FitAddon=class{activate(d){this._terminal=d}dispose(){}fit(){const d=this.proposeDimensions();if(!d||!this._terminal||isNaN(d.cols)||isNaN(d.rows))return;const m=this._terminal._core;this._terminal.rows===d.rows&&this._terminal.cols===d.cols||(m._renderService.clear(),this._terminal.resize(d.cols,d.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const d=this._terminal._core,m=d._renderService.dimensions;if(m.css.cell.width===0||m.css.cell.height===0)return;const f=this._terminal.options.scrollback===0?0:d.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),u=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),h=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),S=u-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-f;return{cols:Math.max(2,Math.floor(S/m.css.cell.width)),rows:Math.max(1,Math.floor(h/m.css.cell.height))}}}})(),s})()))})(eh)),eh.exports}var CS=bS(),th={exports:{}},Km;function wS(){return Km||(Km=1,(function(t,r){(function(s,l){t.exports=l()})(self,(()=>(()=>{var s={6:(f,o)=>{function c(g){try{const h=new URL(g),S=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return g.toLocaleLowerCase().startsWith(S.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,h,S,w={}){this._terminal=g,this._regex=h,this._handler=S,this._options=w}provideLinks(g,h){const S=u.computeLink(g,this._regex,this._terminal,this._handler);h(this._addCallbacks(S))}_addCallbacks(g){return g.map((h=>(h.leave=this._options.leave,h.hover=(S,w)=>{if(this._options.hover){const{range:T}=h;this._options.hover(S,w,T)}},h)))}};class u{static computeLink(h,S,w,T){const k=new RegExp(S.source,(S.flags||"")+"g"),[y,_]=u._getWindowedLineStrings(h-1,w),v=y.join("");let b;const E=[];for(;b=k.exec(v);){const O=b[0];if(!c(O))continue;const[R,D]=u._mapStrIdx(w,_,0,b.index),[A,M]=u._mapStrIdx(w,R,D,O.length);if(R===-1||D===-1||A===-1||M===-1)continue;const L={start:{x:D+1,y:R+1},end:{x:M,y:A+1}};E.push({range:L,text:O,activate:T})}return E}static _getWindowedLineStrings(h,S){let w,T=h,k=h,y=0,_="";const v=[];if(w=S.buffer.active.getLine(h)){const b=w.translateToString(!0);if(w.isWrapped&&b[0]!==" "){for(y=0;(w=S.buffer.active.getLine(--T))&&y<2048&&(_=w.translateToString(!0),y+=_.length,v.push(_),w.isWrapped&&_.indexOf(" ")===-1););v.reverse()}for(v.push(b),y=0;(w=S.buffer.active.getLine(++k))&&w.isWrapped&&y<2048&&(_=w.translateToString(!0),y+=_.length,v.push(_),_.indexOf(" ")===-1););}return[v,T]}static _mapStrIdx(h,S,w,T){const k=h.buffer.active,y=k.getNullCell();let _=w;for(;T;){const v=k.getLine(S);if(!v)return[-1,-1];for(let b=_;b<v.length;++b){v.getCell(b,y);const E=y.getChars();if(y.getWidth()&&(T-=E.length||1,b===v.length-1&&E==="")){const O=k.getLine(S+1);O&&O.isWrapped&&(O.getCell(0,y),y.getWidth()===2&&(T+=1))}if(T<0)return[S,b]}S++,_=0}return[S,_]}}o.LinkComputer=u}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f](c,c.exports,d),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.WebLinksAddon=void 0;const o=d(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function u(g,h){const S=window.open();if(S){try{S.opener=null}catch{}S.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}f.WebLinksAddon=class{constructor(g=u,h={}){this._handler=g,this._options=h}activate(g){this._terminal=g;const h=this._options,S=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,S,this._handler,h))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),m})()))})(th)),th.exports}var xS=wS(),nh={exports:{}},Ym;function ES(){return Ym||(Ym=1,(function(t,r){(function(s,l){t.exports=l()})(globalThis,(()=>(()=>{var s={4567:function(f,o,c){var u=this&&this.__decorate||function(v,b,E,O){var R,D=arguments.length,A=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(v,b,E,O);else for(var M=v.length-1;M>=0;M--)(R=v[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},g=this&&this.__param||function(v,b){return function(E,O){b(E,O,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const h=c(9042),S=c(9924),w=c(844),T=c(4725),k=c(2585),y=c(3656);let _=o.AccessibilityManager=class extends w.Disposable{constructor(v,b,E,O){super(),this._terminal=v,this._coreBrowserService=E,this._renderService=O,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new S.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
52
52
  `)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,y.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,w.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(v){for(let b=0;b<v;b++)this._handleChar(" ")}_handleChar(v){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==v&&(this._charsToAnnounce+=v):this._charsToAnnounce+=v,v===`
53
53
  `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(v){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(v)||this._charsToConsume.push(v)}_refreshRows(v,b){this._liveRegionDebouncer.refresh(v,b,this._terminal.rows)}_renderRows(v,b){const E=this._terminal.buffer,O=E.lines.length.toString();for(let R=v;R<=b;R++){const D=E.lines.get(E.ydisp+R),A=[],M=(D==null?void 0:D.translateToString(!0,void 0,void 0,A))||"",L=(E.ydisp+R+1).toString(),H=this._rowElements[R];H&&(M.length===0?(H.innerText=" ",this._rowColumns.set(H,[0,1])):(H.textContent=M,this._rowColumns.set(H,A)),H.setAttribute("aria-posinset",L),H.setAttribute("aria-setsize",O))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(v,b){const E=v.target,O=this._rowElements[b===0?1:this._rowElements.length-2];if(E.getAttribute("aria-posinset")===(b===0?"1":`${this._terminal.buffer.lines.length}`)||v.relatedTarget!==O)return;let R,D;if(b===0?(R=E,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(R=this._rowElements.shift(),D=E,this._rowContainer.removeChild(R)),R.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),b===0){const A=this._createAccessibilityTreeNode();this._rowElements.unshift(A),this._rowContainer.insertAdjacentElement("afterbegin",A)}else{const A=this._createAccessibilityTreeNode();this._rowElements.push(A),this._rowContainer.appendChild(A)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(b===0?-1:1),this._rowElements[b===0?1:this._rowElements.length-2].focus(),v.preventDefault(),v.stopImmediatePropagation()}_handleSelectionChange(){var M;if(this._rowElements.length===0)return;const v=document.getSelection();if(!v)return;if(v.isCollapsed)return void(this._rowContainer.contains(v.anchorNode)&&this._terminal.clearSelection());if(!v.anchorNode||!v.focusNode)return void console.error("anchorNode and/or focusNode are null");let b={node:v.anchorNode,offset:v.anchorOffset},E={node:v.focusNode,offset:v.focusOffset};if((b.node.compareDocumentPosition(E.node)&Node.DOCUMENT_POSITION_PRECEDING||b.node===E.node&&b.offset>E.offset)&&([b,E]=[E,b]),b.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(b={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(b.node))return;const O=this._rowElements.slice(-1)[0];if(E.node.compareDocumentPosition(O)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(E={node:O,offset:((M=O.textContent)==null?void 0:M.length)??0}),!this._rowContainer.contains(E.node))return;const R=({node:L,offset:H})=>{const U=L instanceof Text?L.parentNode:L;let P=parseInt(U==null?void 0:U.getAttribute("aria-posinset"),10)-1;if(isNaN(P))return console.warn("row is invalid. Race condition?"),null;const W=this._rowColumns.get(U);if(!W)return console.warn("columns is null. Race condition?"),null;let K=H<W.length?W[H]:W.slice(-1)[0]+1;return K>=this._terminal.cols&&(++P,K=0),{row:P,column:K}},D=R(b),A=R(E);if(D&&A){if(D.row>A.row||D.row===A.row&&D.column>=A.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(A.row-D.row)*this._terminal.cols-D.column+A.column)}}_handleResize(v){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let b=this._rowContainer.children.length;b<this._terminal.rows;b++)this._rowElements[b]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[b]);for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const v=this._coreBrowserService.mainDocument.createElement("div");return v.setAttribute("role","listitem"),v.tabIndex=-1,this._refreshRowDimensions(v),v}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let v=0;v<this._terminal.rows;v++)this._refreshRowDimensions(this._rowElements[v])}}_refreshRowDimensions(v){v.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=_=u([g(1,k.IInstantiationService),g(2,T.ICoreBrowserService),g(3,T.IRenderService)],_)},3614:(f,o)=>{function c(S){return S.replace(/\r?\n/g,"\r")}function u(S,w){return w?"\x1B[200~"+S+"\x1B[201~":S}function g(S,w,T,k){S=u(S=c(S),T.decPrivateModes.bracketedPasteMode&&k.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(S,!0),w.value=""}function h(S,w,T){const k=T.getBoundingClientRect(),y=S.clientX-k.left-10,_=S.clientY-k.top-10;w.style.width="20px",w.style.height="20px",w.style.left=`${y}px`,w.style.top=`${_}px`,w.style.zIndex="1000",w.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=u,o.copyHandler=function(S,w){S.clipboardData&&S.clipboardData.setData("text/plain",w.selectionText),S.preventDefault()},o.handlePasteEvent=function(S,w,T,k){S.stopPropagation(),S.clipboardData&&g(S.clipboardData.getData("text/plain"),w,T,k)},o.paste=g,o.moveTextAreaUnderMouseCursor=h,o.rightClickHandler=function(S,w,T,k,y){h(S,w,T),y&&k.rightClickSelect(S),w.value=k.selectionText,w.select()}},7239:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const u=c(1505);o.ColorContrastCache=class{constructor(){this._color=new u.TwoKeyMap,this._css=new u.TwoKeyMap}setCss(g,h,S){this._css.set(g,h,S)}getCss(g,h){return this._css.get(g,h)}setColor(g,h,S){this._color.set(g,h,S)}getColor(g,h){return this._color.get(g,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,u,g,h){c.addEventListener(u,g,h);let S=!1;return{dispose:()=>{S||(S=!0,c.removeEventListener(u,g,h))}}}},3551:function(f,o,c){var u=this&&this.__decorate||function(_,v,b,E){var O,R=arguments.length,D=R<3?v:E===null?E=Object.getOwnPropertyDescriptor(v,b):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(_,v,b,E);else for(var A=_.length-1;A>=0;A--)(O=_[A])&&(D=(R<3?O(D):R>3?O(v,b,D):O(v,b))||D);return R>3&&D&&Object.defineProperty(v,b,D),D},g=this&&this.__param||function(_,v){return function(b,E){v(b,E,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const h=c(3656),S=c(8460),w=c(844),T=c(2585),k=c(4725);let y=o.Linkifier=class extends w.Disposable{get currentLink(){return this._currentLink}constructor(_,v,b,E,O){super(),this._element=_,this._mouseService=v,this._renderService=b,this._bufferService=E,this._linkProviderService=O,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new S.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new S.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,w.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,w.toDisposable)((()=>{var R;this._lastMouseEvent=void 0,(R=this._activeProviderReplies)==null||R.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(_){this._lastMouseEvent=_;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);if(!v)return;this._isMouseOut=!1;const b=_.composedPath();for(let E=0;E<b.length;E++){const O=b[E];if(O.classList.contains("xterm"))break;if(O.classList.contains("xterm-hover"))return}this._lastBufferCell&&v.x===this._lastBufferCell.x&&v.y===this._lastBufferCell.y||(this._handleHover(v),this._lastBufferCell=v)}_handleHover(_){if(this._activeLine!==_.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(_,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,_)||(this._clearCurrentLink(),this._askForLink(_,!0))}_askForLink(_,v){var E,O;this._activeProviderReplies&&v||((E=this._activeProviderReplies)==null||E.forEach((R=>{R==null||R.forEach((D=>{D.link.dispose&&D.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=_.y);let b=!1;for(const[R,D]of this._linkProviderService.linkProviders.entries())v?(O=this._activeProviderReplies)!=null&&O.get(R)&&(b=this._checkLinkProviderResult(R,_,b)):D.provideLinks(_.y,(A=>{var L,H;if(this._isMouseOut)return;const M=A==null?void 0:A.map((U=>({link:U})));(L=this._activeProviderReplies)==null||L.set(R,M),b=this._checkLinkProviderResult(R,_,b),((H=this._activeProviderReplies)==null?void 0:H.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(_.y,this._activeProviderReplies)}))}_removeIntersectingLinks(_,v){const b=new Set;for(let E=0;E<v.size;E++){const O=v.get(E);if(O)for(let R=0;R<O.length;R++){const D=O[R],A=D.link.range.start.y<_?0:D.link.range.start.x,M=D.link.range.end.y>_?this._bufferService.cols:D.link.range.end.x;for(let L=A;L<=M;L++){if(b.has(L)){O.splice(R--,1);break}b.add(L)}}}}_checkLinkProviderResult(_,v,b){var R;if(!this._activeProviderReplies)return b;const E=this._activeProviderReplies.get(_);let O=!1;for(let D=0;D<_;D++)this._activeProviderReplies.has(D)&&!this._activeProviderReplies.get(D)||(O=!0);if(!O&&E){const D=E.find((A=>this._linkAtPosition(A.link,v)));D&&(b=!0,this._handleNewLink(D))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!b)for(let D=0;D<this._activeProviderReplies.size;D++){const A=(R=this._activeProviderReplies.get(D))==null?void 0:R.find((M=>this._linkAtPosition(M.link,v)));if(A){b=!0,this._handleNewLink(A);break}}return b}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(_){if(!this._currentLink)return;const v=this._positionFromMouseEvent(_,this._element,this._mouseService);v&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,v)&&this._currentLink.link.activate(_,this._currentLink.link.text)}_clearCurrentLink(_,v){this._currentLink&&this._lastMouseEvent&&(!_||!v||this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=v)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,w.disposeArray)(this._linkCacheDisposables))}_handleNewLink(_){if(!this._lastMouseEvent)return;const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._linkAtPosition(_.link,v)&&(this._currentLink=_,this._currentLink.state={decorations:{underline:_.link.decorations===void 0||_.link.decorations.underline,pointerCursor:_.link.decorations===void 0||_.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,_.link,this._lastMouseEvent),_.link.decorations={},Object.defineProperties(_.link.decorations,{pointerCursor:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.pointerCursor},set:b=>{var E;(E=this._currentLink)!=null&&E.state&&this._currentLink.state.decorations.pointerCursor!==b&&(this._currentLink.state.decorations.pointerCursor=b,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",b))}},underline:{get:()=>{var b,E;return(E=(b=this._currentLink)==null?void 0:b.state)==null?void 0:E.decorations.underline},set:b=>{var E,O,R;(E=this._currentLink)!=null&&E.state&&((R=(O=this._currentLink)==null?void 0:O.state)==null?void 0:R.decorations.underline)!==b&&(this._currentLink.state.decorations.underline=b,this._currentLink.state.isHovered&&this._fireUnderlineEvent(_.link,b))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((b=>{if(!this._currentLink)return;const E=b.start===0?0:b.start+1+this._bufferService.buffer.ydisp,O=this._bufferService.buffer.ydisp+1+b.end;if(this._currentLink.link.range.start.y>=E&&this._currentLink.link.range.end.y<=O&&(this._clearCurrentLink(E,O),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!1)}}))))}_linkHover(_,v,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!0),this._currentLink.state.decorations.pointerCursor&&_.classList.add("xterm-cursor-pointer")),v.hover&&v.hover(b,v.text)}_fireUnderlineEvent(_,v){const b=_.range,E=this._bufferService.buffer.ydisp,O=this._createLinkUnderlineEvent(b.start.x-1,b.start.y-E-1,b.end.x,b.end.y-E-1,void 0);(v?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(O)}_linkLeave(_,v,b){var E;(E=this._currentLink)!=null&&E.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(v,!1),this._currentLink.state.decorations.pointerCursor&&_.classList.remove("xterm-cursor-pointer")),v.leave&&v.leave(b,v.text)}_linkAtPosition(_,v){const b=_.range.start.y*this._bufferService.cols+_.range.start.x,E=_.range.end.y*this._bufferService.cols+_.range.end.x,O=v.y*this._bufferService.cols+v.x;return b<=O&&O<=E}_positionFromMouseEvent(_,v,b){const E=b.getCoords(_,v,this._bufferService.cols,this._bufferService.rows);if(E)return{x:E[0],y:E[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(_,v,b,E,O){return{x1:_,y1:v,x2:b,y2:E,cols:this._bufferService.cols,fg:O}}};o.Linkifier=y=u([g(1,k.IMouseService),g(2,k.IRenderService),g(3,T.IBufferService),g(4,k.ILinkProviderService)],y)},9042:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(f,o,c){var u=this&&this.__decorate||function(k,y,_,v){var b,E=arguments.length,O=E<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,_):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(k,y,_,v);else for(var R=k.length-1;R>=0;R--)(b=k[R])&&(O=(E<3?b(O):E>3?b(y,_,O):b(y,_))||O);return E>3&&O&&Object.defineProperty(y,_,O),O},g=this&&this.__param||function(k,y){return function(_,v){y(_,v,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const h=c(511),S=c(2585);let w=o.OscLinkProvider=class{constructor(k,y,_){this._bufferService=k,this._optionsService=y,this._oscLinkService=_}provideLinks(k,y){var M;const _=this._bufferService.buffer.lines.get(k-1);if(!_)return void y(void 0);const v=[],b=this._optionsService.rawOptions.linkHandler,E=new h.CellData,O=_.getTrimmedLength();let R=-1,D=-1,A=!1;for(let L=0;L<O;L++)if(D!==-1||_.hasContent(L)){if(_.loadCell(L,E),E.hasExtendedAttrs()&&E.extended.urlId){if(D===-1){D=L,R=E.extended.urlId;continue}A=E.extended.urlId!==R}else D!==-1&&(A=!0);if(A||D!==-1&&L===O-1){const H=(M=this._oscLinkService.getLinkData(R))==null?void 0:M.uri;if(H){const U={start:{x:D+1,y:k},end:{x:L+(A||L!==O-1?0:1),y:k}};let P=!1;if(!(b!=null&&b.allowNonHttpProtocols))try{const W=new URL(H);["http:","https:"].includes(W.protocol)||(P=!0)}catch{P=!0}P||v.push({text:H,range:U,activate:(W,K)=>b?b.activate(W,K,U):T(0,K),hover:(W,K)=>{var V;return(V=b==null?void 0:b.hover)==null?void 0:V.call(b,W,K,U)},leave:(W,K)=>{var V;return(V=b==null?void 0:b.leave)==null?void 0:V.call(b,W,K,U)}})}A=!1,E.hasExtendedAttrs()&&E.extended.urlId?(D=L,R=E.extended.urlId):(D=-1,R=-1)}}y(v)}};function T(k,y){if(confirm(`Do you want to navigate to ${y}?
54
54
 
@@ -56,42 +56,42 @@ WARNING: This link could potentially be dangerous`)){const _=window.open();if(_)
56
56
  `:`
57
57
  `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(A){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),_.isLinux&&A&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(A){const M=this._getMouseBufferCoords(A),L=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!!(L&&H&&M)&&this._areCoordsInSelection(M,L,H)}isCellInSelection(A,M){const L=this._model.finalSelectionStart,H=this._model.finalSelectionEnd;return!(!L||!H)&&this._areCoordsInSelection([A,M],L,H)}_areCoordsInSelection(A,M,L){return A[1]>M[1]&&A[1]<L[1]||M[1]===L[1]&&A[1]===M[1]&&A[0]>=M[0]&&A[0]<L[0]||M[1]<L[1]&&A[1]===L[1]&&A[0]<L[0]||M[1]<L[1]&&A[1]===M[1]&&A[0]>=M[0]}_selectWordAtCursor(A,M){var U,P;const L=(P=(U=this._linkifier.currentLink)==null?void 0:U.link)==null?void 0:P.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,v.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const H=this._getMouseBufferCoords(A);return!!H&&(this._selectWordAt(H,M),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(A,M){this._model.clearSelection(),A=Math.max(A,0),M=Math.min(M,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,A],this._model.selectionEnd=[this._bufferService.cols,M],this.refresh(),this._onSelectionChange.fire()}_handleTrim(A){this._model.handleTrim(A)&&this.refresh()}_getMouseBufferCoords(A){const M=this._mouseService.getCoords(A,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(M)return M[0]--,M[1]--,M[1]+=this._bufferService.buffer.ydisp,M}_getMouseEventScrollAmount(A){let M=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,A,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return M>=0&&M<=L?0:(M>L&&(M-=L),M=Math.min(Math.max(M,-50),50),M/=50,M/Math.abs(M)+Math.round(14*M))}shouldForceSelection(A){return _.isMac?A.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:A.shiftKey}handleMouseDown(A){if(this._mouseDownTimeStamp=A.timeStamp,(A.button!==2||!this.hasSelection)&&A.button===0){if(!this._enabled){if(!this.shouldForceSelection(A))return;A.stopPropagation()}A.preventDefault(),this._dragScrollAmount=0,this._enabled&&A.shiftKey?this._handleIncrementalClick(A):A.detail===1?this._handleSingleClick(A):A.detail===2?this._handleDoubleClick(A):A.detail===3&&this._handleTripleClick(A),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(A){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(A))}_handleSingleClick(A){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(A)?3:0,this._model.selectionStart=this._getMouseBufferCoords(A),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const M=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);M&&M.length!==this._model.selectionStart[0]&&M.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(A){this._selectWordAtCursor(A,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(A){const M=this._getMouseBufferCoords(A);M&&(this._activeSelectionMode=2,this._selectLineAt(M[1]))}shouldColumnSelect(A){return A.altKey&&!(_.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(A){if(A.stopImmediatePropagation(),!this._model.selectionStart)return;const M=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(A),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(A),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const H=L.lines.get(this._model.selectionEnd[1]);H&&H.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}M&&M[0]===this._model.selectionEnd[0]&&M[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const A=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(A.ydisp+this._bufferService.rows,A.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=A.ydisp),this.refresh()}}_handleMouseUp(A){const M=A.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&M<500&&A.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(A,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const H=(0,S.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(H,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const A=this._model.finalSelectionStart,M=this._model.finalSelectionEnd,L=!(!A||!M||A[0]===M[0]&&A[1]===M[1]);L?A&&M&&(this._oldSelectionStart&&this._oldSelectionEnd&&A[0]===this._oldSelectionStart[0]&&A[1]===this._oldSelectionStart[1]&&M[0]===this._oldSelectionEnd[0]&&M[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(A,M,L)):this._oldHasSelection&&this._fireOnSelectionChange(A,M,L)}_fireOnSelectionChange(A,M,L){this._oldSelectionStart=A,this._oldSelectionEnd=M,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(A){this.clearSelection(),this._trimListener.dispose(),this._trimListener=A.activeBuffer.lines.onTrim((M=>this._handleTrim(M)))}_convertViewportColToCharacterIndex(A,M){let L=M;for(let H=0;M>=H;H++){const U=A.loadCell(H,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:U>1&&M!==H&&(L+=U-1)}return L}setSelection(A,M,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[A,M],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(A){this._isClickInSelection(A)||(this._selectWordAtCursor(A,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(A,M,L=!0,H=!0){if(A[0]>=this._bufferService.cols)return;const U=this._bufferService.buffer,P=U.lines.get(A[1]);if(!P)return;const W=U.translateBufferLineToString(A[1],!1);let K=this._convertViewportColToCharacterIndex(P,A[0]),V=K;const Y=A[0]-K;let te=0,z=0,j=0,N=0;if(W.charAt(K)===" "){for(;K>0&&W.charAt(K-1)===" ";)K--;for(;V<W.length&&W.charAt(V+1)===" ";)V++}else{let ie=A[0],pe=A[0];P.getWidth(ie)===0&&(te++,ie--),P.getWidth(pe)===2&&(z++,pe++);const ge=P.getString(pe).length;for(ge>1&&(N+=ge-1,V+=ge-1);ie>0&&K>0&&!this._isCharWordSeparator(P.loadCell(ie-1,this._workCell));){P.loadCell(ie-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(te++,ie--):Q>1&&(j+=Q-1,K-=Q-1),K--,ie--}for(;pe<P.length&&V+1<W.length&&!this._isCharWordSeparator(P.loadCell(pe+1,this._workCell));){P.loadCell(pe+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(z++,pe++):Q>1&&(N+=Q-1,V+=Q-1),V++,pe++}}V++;let q=K+Y-te+j,I=Math.min(this._bufferService.cols,V-K+te+z-j-N);if(M||W.slice(K,V).trim()!==""){if(L&&q===0&&P.getCodePoint(0)!==32){const ie=U.lines.get(A[1]-1);if(ie&&P.isWrapped&&ie.getCodePoint(this._bufferService.cols-1)!==32){const pe=this._getWordAt([this._bufferService.cols-1,A[1]-1],!1,!0,!1);if(pe){const ge=this._bufferService.cols-pe.start;q-=ge,I+=ge}}}if(H&&q+I===this._bufferService.cols&&P.getCodePoint(this._bufferService.cols-1)!==32){const ie=U.lines.get(A[1]+1);if(ie!=null&&ie.isWrapped&&ie.getCodePoint(0)!==32){const pe=this._getWordAt([0,A[1]+1],!1,!1,!0);pe&&(I+=pe.length)}}return{start:q,length:I}}}_selectWordAt(A,M){const L=this._getWordAt(A,M);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,A[1]--;this._model.selectionStart=[L.start,A[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(A){const M=this._getWordAt(A,!0);if(M){let L=A[1];for(;M.start<0;)M.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;M.start+M.length>this._bufferService.cols;)M.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?M.start:M.start+M.length,L]}}_isCharWordSeparator(A){return A.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(A.getChars())>=0}_selectLineAt(A){const M=this._bufferService.buffer.getWrappedRangeForLine(A),L={start:{x:0,y:M.first},end:{x:this._bufferService.cols-1,y:M.last}};this._model.selectionStart=[0,M.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,v.getRangeLength)(L,this._bufferService.cols)}};o.SelectionService=D=u([g(3,E.IBufferService),g(4,E.ICoreService),g(5,T.IMouseService),g(6,E.IOptionsService),g(7,T.IRenderService),g(8,T.ICoreBrowserService)],D)},4725:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const u=c(8343);o.ICharSizeService=(0,u.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,u.createDecorator)("CoreBrowserService"),o.IMouseService=(0,u.createDecorator)("MouseService"),o.IRenderService=(0,u.createDecorator)("RenderService"),o.ISelectionService=(0,u.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,u.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,u.createDecorator)("ThemeService"),o.ILinkProviderService=(0,u.createDecorator)("LinkProviderService")},6731:function(f,o,c){var u=this&&this.__decorate||function(D,A,M,L){var H,U=arguments.length,P=U<3?A:L===null?L=Object.getOwnPropertyDescriptor(A,M):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(D,A,M,L);else for(var W=D.length-1;W>=0;W--)(H=D[W])&&(P=(U<3?H(P):U>3?H(A,M,P):H(A,M))||P);return U>3&&P&&Object.defineProperty(A,M,P),P},g=this&&this.__param||function(D,A){return function(M,L){A(M,L,D)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const h=c(7239),S=c(8055),w=c(8460),T=c(844),k=c(2585),y=S.css.toColor("#ffffff"),_=S.css.toColor("#000000"),v=S.css.toColor("#ffffff"),b=S.css.toColor("#000000"),E={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[S.css.toColor("#2e3436"),S.css.toColor("#cc0000"),S.css.toColor("#4e9a06"),S.css.toColor("#c4a000"),S.css.toColor("#3465a4"),S.css.toColor("#75507b"),S.css.toColor("#06989a"),S.css.toColor("#d3d7cf"),S.css.toColor("#555753"),S.css.toColor("#ef2929"),S.css.toColor("#8ae234"),S.css.toColor("#fce94f"),S.css.toColor("#729fcf"),S.css.toColor("#ad7fa8"),S.css.toColor("#34e2e2"),S.css.toColor("#eeeeec")],A=[0,95,135,175,215,255];for(let M=0;M<216;M++){const L=A[M/36%6|0],H=A[M/6%6|0],U=A[M%6];D.push({css:S.channels.toCss(L,H,U),rgba:S.channels.toRgba(L,H,U)})}for(let M=0;M<24;M++){const L=8+10*M;D.push({css:S.channels.toCss(L,L,L),rgba:S.channels.toRgba(L,L,L)})}return D})());let O=o.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new w.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:_,cursor:v,cursorAccent:b,selectionForeground:void 0,selectionBackgroundTransparent:E,selectionBackgroundOpaque:S.color.blend(_,E),selectionInactiveBackgroundTransparent:E,selectionInactiveBackgroundOpaque:S.color.blend(_,E),ansi:o.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(D={}){const A=this._colors;if(A.foreground=R(D.foreground,y),A.background=R(D.background,_),A.cursor=R(D.cursor,v),A.cursorAccent=R(D.cursorAccent,b),A.selectionBackgroundTransparent=R(D.selectionBackground,E),A.selectionBackgroundOpaque=S.color.blend(A.background,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundTransparent=R(D.selectionInactiveBackground,A.selectionBackgroundTransparent),A.selectionInactiveBackgroundOpaque=S.color.blend(A.background,A.selectionInactiveBackgroundTransparent),A.selectionForeground=D.selectionForeground?R(D.selectionForeground,S.NULL_COLOR):void 0,A.selectionForeground===S.NULL_COLOR&&(A.selectionForeground=void 0),S.color.isOpaque(A.selectionBackgroundTransparent)&&(A.selectionBackgroundTransparent=S.color.opacity(A.selectionBackgroundTransparent,.3)),S.color.isOpaque(A.selectionInactiveBackgroundTransparent)&&(A.selectionInactiveBackgroundTransparent=S.color.opacity(A.selectionInactiveBackgroundTransparent,.3)),A.ansi=o.DEFAULT_ANSI_COLORS.slice(),A.ansi[0]=R(D.black,o.DEFAULT_ANSI_COLORS[0]),A.ansi[1]=R(D.red,o.DEFAULT_ANSI_COLORS[1]),A.ansi[2]=R(D.green,o.DEFAULT_ANSI_COLORS[2]),A.ansi[3]=R(D.yellow,o.DEFAULT_ANSI_COLORS[3]),A.ansi[4]=R(D.blue,o.DEFAULT_ANSI_COLORS[4]),A.ansi[5]=R(D.magenta,o.DEFAULT_ANSI_COLORS[5]),A.ansi[6]=R(D.cyan,o.DEFAULT_ANSI_COLORS[6]),A.ansi[7]=R(D.white,o.DEFAULT_ANSI_COLORS[7]),A.ansi[8]=R(D.brightBlack,o.DEFAULT_ANSI_COLORS[8]),A.ansi[9]=R(D.brightRed,o.DEFAULT_ANSI_COLORS[9]),A.ansi[10]=R(D.brightGreen,o.DEFAULT_ANSI_COLORS[10]),A.ansi[11]=R(D.brightYellow,o.DEFAULT_ANSI_COLORS[11]),A.ansi[12]=R(D.brightBlue,o.DEFAULT_ANSI_COLORS[12]),A.ansi[13]=R(D.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),A.ansi[14]=R(D.brightCyan,o.DEFAULT_ANSI_COLORS[14]),A.ansi[15]=R(D.brightWhite,o.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const M=Math.min(A.ansi.length-16,D.extendedAnsi.length);for(let L=0;L<M;L++)A.ansi[L+16]=R(D.extendedAnsi[L],o.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[D]=this._restoreColors.ansi[D]}else for(let A=0;A<this._restoreColors.ansi.length;++A)this._colors.ansi[A]=this._restoreColors.ansi[A]}modifyColors(D){D(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};function R(D,A){if(D!==void 0)try{return S.css.toColor(D)}catch{}return A}o.ThemeService=O=u([g(0,k.IOptionsService)],O)},6349:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const u=c(8460),g=c(844);class h extends g.Disposable{constructor(w){super(),this._maxLength=w,this.onDeleteEmitter=this.register(new u.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new u.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new u.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(w){if(this._maxLength===w)return;const T=new Array(w);for(let k=0;k<Math.min(w,this.length);k++)T[k]=this._array[this._getCyclicIndex(k)];this._array=T,this._maxLength=w,this._startIndex=0}get length(){return this._length}set length(w){if(w>this._length)for(let T=this._length;T<w;T++)this._array[T]=void 0;this._length=w}get(w){return this._array[this._getCyclicIndex(w)]}set(w,T){this._array[this._getCyclicIndex(w)]=T}push(w){this._array[this._getCyclicIndex(this._length)]=w,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(w,T,...k){if(T){for(let y=w;y<this._length-T;y++)this._array[this._getCyclicIndex(y)]=this._array[this._getCyclicIndex(y+T)];this._length-=T,this.onDeleteEmitter.fire({index:w,amount:T})}for(let y=this._length-1;y>=w;y--)this._array[this._getCyclicIndex(y+k.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;y<k.length;y++)this._array[this._getCyclicIndex(w+y)]=k[y];if(k.length&&this.onInsertEmitter.fire({index:w,amount:k.length}),this._length+k.length>this._maxLength){const y=this._length+k.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=k.length}trimStart(w){w>this._length&&(w=this._length),this._startIndex+=w,this._length-=w,this.onTrimEmitter.fire(w)}shiftElements(w,T,k){if(!(T<=0)){if(w<0||w>=this._length)throw new Error("start argument out of range");if(w+k<0)throw new Error("Cannot shift elements in list beyond index 0");if(k>0){for(let _=T-1;_>=0;_--)this.set(w+_+k,this.get(w+_));const y=w+T+k-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<T;y++)this.set(w+y+k,this.get(w+y))}}_getCyclicIndex(w){return(this._startIndex+w)%this._maxLength}}o.CircularList=h},1439:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(u,g=5){if(typeof u!="object")return u;const h=Array.isArray(u)?[]:{};for(const S in u)h[S]=g<=1?u[S]:u[S]&&c(u[S],g-1);return h}},8055:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,u=0,g=0,h=0;var S,w,T,k,y;function _(b){const E=b.toString(16);return E.length<2?"0"+E:E}function v(b,E){return b<E?(E+.05)/(b+.05):(b+.05)/(E+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},(function(b){b.toCss=function(E,O,R,D){return D!==void 0?`#${_(E)}${_(O)}${_(R)}${_(D)}`:`#${_(E)}${_(O)}${_(R)}`},b.toRgba=function(E,O,R,D=255){return(E<<24|O<<16|R<<8|D)>>>0},b.toColor=function(E,O,R,D){return{css:b.toCss(E,O,R,D),rgba:b.toRgba(E,O,R,D)}}})(S||(o.channels=S={})),(function(b){function E(O,R){return h=Math.round(255*R),[c,u,g]=y.toChannels(O.rgba),{css:S.toCss(c,u,g,h),rgba:S.toRgba(c,u,g,h)}}b.blend=function(O,R){if(h=(255&R.rgba)/255,h===1)return{css:R.css,rgba:R.rgba};const D=R.rgba>>24&255,A=R.rgba>>16&255,M=R.rgba>>8&255,L=O.rgba>>24&255,H=O.rgba>>16&255,U=O.rgba>>8&255;return c=L+Math.round((D-L)*h),u=H+Math.round((A-H)*h),g=U+Math.round((M-U)*h),{css:S.toCss(c,u,g),rgba:S.toRgba(c,u,g)}},b.isOpaque=function(O){return(255&O.rgba)==255},b.ensureContrastRatio=function(O,R,D){const A=y.ensureContrastRatio(O.rgba,R.rgba,D);if(A)return S.toColor(A>>24&255,A>>16&255,A>>8&255)},b.opaque=function(O){const R=(255|O.rgba)>>>0;return[c,u,g]=y.toChannels(R),{css:S.toCss(c,u,g),rgba:R}},b.opacity=E,b.multiplyOpacity=function(O,R){return h=255&O.rgba,E(O,h*R/255)},b.toColorRGB=function(O){return[O.rgba>>24&255,O.rgba>>16&255,O.rgba>>8&255]}})(w||(o.color=w={})),(function(b){let E,O;try{const R=document.createElement("canvas");R.width=1,R.height=1;const D=R.getContext("2d",{willReadFrequently:!0});D&&(E=D,E.globalCompositeOperation="copy",O=E.createLinearGradient(0,0,1,1))}catch{}b.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),S.toColor(c,u,g);case 5:return c=parseInt(R.slice(1,2).repeat(2),16),u=parseInt(R.slice(2,3).repeat(2),16),g=parseInt(R.slice(3,4).repeat(2),16),h=parseInt(R.slice(4,5).repeat(2),16),S.toColor(c,u,g,h);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const D=R.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return c=parseInt(D[1]),u=parseInt(D[2]),g=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),S.toColor(c,u,g,h);if(!E||!O)throw new Error("css.toColor: Unsupported css format");if(E.fillStyle=O,E.fillStyle=R,typeof E.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(E.fillRect(0,0,1,1),[c,u,g,h]=E.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:S.toRgba(c,u,g,h),css:R}}})(T||(o.css=T={})),(function(b){function E(O,R,D){const A=O/255,M=R/255,L=D/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(M<=.03928?M/12.92:Math.pow((M+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}b.relativeLuminance=function(O){return E(O>>16&255,O>>8&255,255&O)},b.relativeLuminance2=E})(k||(o.rgb=k={})),(function(b){function E(R,D,A){const M=R>>24&255,L=R>>16&255,H=R>>8&255;let U=D>>24&255,P=D>>16&255,W=D>>8&255,K=v(k.relativeLuminance2(U,P,W),k.relativeLuminance2(M,L,H));for(;K<A&&(U>0||P>0||W>0);)U-=Math.max(0,Math.ceil(.1*U)),P-=Math.max(0,Math.ceil(.1*P)),W-=Math.max(0,Math.ceil(.1*W)),K=v(k.relativeLuminance2(U,P,W),k.relativeLuminance2(M,L,H));return(U<<24|P<<16|W<<8|255)>>>0}function O(R,D,A){const M=R>>24&255,L=R>>16&255,H=R>>8&255;let U=D>>24&255,P=D>>16&255,W=D>>8&255,K=v(k.relativeLuminance2(U,P,W),k.relativeLuminance2(M,L,H));for(;K<A&&(U<255||P<255||W<255);)U=Math.min(255,U+Math.ceil(.1*(255-U))),P=Math.min(255,P+Math.ceil(.1*(255-P))),W=Math.min(255,W+Math.ceil(.1*(255-W))),K=v(k.relativeLuminance2(U,P,W),k.relativeLuminance2(M,L,H));return(U<<24|P<<16|W<<8|255)>>>0}b.blend=function(R,D){if(h=(255&D)/255,h===1)return D;const A=D>>24&255,M=D>>16&255,L=D>>8&255,H=R>>24&255,U=R>>16&255,P=R>>8&255;return c=H+Math.round((A-H)*h),u=U+Math.round((M-U)*h),g=P+Math.round((L-P)*h),S.toRgba(c,u,g)},b.ensureContrastRatio=function(R,D,A){const M=k.relativeLuminance(R>>8),L=k.relativeLuminance(D>>8);if(v(M,L)<A){if(L<M){const P=E(R,D,A),W=v(M,k.relativeLuminance(P>>8));if(W<A){const K=O(R,D,A);return W>v(M,k.relativeLuminance(K>>8))?P:K}return P}const H=O(R,D,A),U=v(M,k.relativeLuminance(H>>8));if(U<A){const P=E(R,D,A);return U>v(M,k.relativeLuminance(P>>8))?H:P}return H}},b.reduceLuminance=E,b.increaseLuminance=O,b.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(y||(o.rgba=y={})),o.toPaddedHex=_,o.contrastRatio=v},8969:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const u=c(844),g=c(2585),h=c(4348),S=c(7866),w=c(744),T=c(7302),k=c(6975),y=c(8460),_=c(1753),v=c(1480),b=c(7994),E=c(9282),O=c(5435),R=c(5981),D=c(2660);let A=!1;class M extends u.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event((H=>{var U;(U=this._onScrollApi)==null||U.fire(H.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(H){for(const U in H)this.optionsService.options[U]=H[U]}constructor(H){super(),this._windowsWrappingHeuristics=this.register(new u.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new T.OptionsService(H)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(w.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(S.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(k.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(_.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(v.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(b.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new O.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((U=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new R.WriteBuffer(((U,P)=>this._inputHandler.parse(U,P)))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(H,U){this._writeBuffer.write(H,U)}writeSync(H,U){this._logService.logLevel<=g.LogLevelEnum.WARN&&!A&&(this._logService.warn("writeSync is unreliable and will be removed soon."),A=!0),this._writeBuffer.writeSync(H,U)}input(H,U=!0){this.coreService.triggerDataEvent(H,U)}resize(H,U){isNaN(H)||isNaN(U)||(H=Math.max(H,w.MINIMUM_COLS),U=Math.max(U,w.MINIMUM_ROWS),this._bufferService.resize(H,U))}scroll(H,U=!1){this._bufferService.scroll(H,U)}scrollLines(H,U,P){this._bufferService.scrollLines(H,U,P)}scrollPages(H){this.scrollLines(H*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(H){const U=H-this._bufferService.buffer.ydisp;U!==0&&this.scrollLines(U)}registerEscHandler(H,U){return this._inputHandler.registerEscHandler(H,U)}registerDcsHandler(H,U){return this._inputHandler.registerDcsHandler(H,U)}registerCsiHandler(H,U){return this._inputHandler.registerCsiHandler(H,U)}registerOscHandler(H,U){return this._inputHandler.registerOscHandler(H,U)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let H=!1;const U=this.optionsService.rawOptions.windowsPty;U&&U.buildNumber!==void 0&&U.buildNumber!==void 0?H=U.backend==="conpty"&&U.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(H=!0),H?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const H=[];H.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),H.push(this.registerCsiHandler({final:"H"},(()=>((0,E.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,u.toDisposable)((()=>{for(const U of H)U.dispose()}))}}}o.CoreTerminal=M},8460:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let u=0;u<this._listeners.length;u++)if(this._listeners[u]===c)return void this._listeners.splice(u,1)}}})),this._event}fire(c,u){const g=[];for(let h=0;h<this._listeners.length;h++)g.push(this._listeners[h]);for(let h=0;h<g.length;h++)g[h].call(void 0,c,u)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,u){return c((g=>u.fire(g)))},o.runAndSubscribe=function(c,u){return u(void 0),c((g=>u(g)))}},5435:function(f,o,c){var u=this&&this.__decorate||function(te,z,j,N){var q,I=arguments.length,ie=I<3?z:N===null?N=Object.getOwnPropertyDescriptor(z,j):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ie=Reflect.decorate(te,z,j,N);else for(var pe=te.length-1;pe>=0;pe--)(q=te[pe])&&(ie=(I<3?q(ie):I>3?q(z,j,ie):q(z,j))||ie);return I>3&&ie&&Object.defineProperty(z,j,ie),ie},g=this&&this.__param||function(te,z){return function(j,N){z(j,N,te)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const h=c(2584),S=c(7116),w=c(2015),T=c(844),k=c(482),y=c(8437),_=c(8460),v=c(643),b=c(511),E=c(3734),O=c(2585),R=c(1480),D=c(6242),A=c(6351),M=c(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},H=131072;function U(te,z){if(te>24)return z.setWinLines||!1;switch(te){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var P;(function(te){te[te.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",te[te.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(P||(o.WindowsOptionsReportType=P={}));let W=0;class K extends T.Disposable{getAttrData(){return this._curAttrData}constructor(z,j,N,q,I,ie,pe,ge,Q=new w.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=j,this._coreService=N,this._logService=q,this._optionsService=I,this._oscLinkService=ie,this._coreMouseService=pe,this._unicodeService=ge,this._parser=Q,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new k.StringToUtf32,this._utf8Decoder=new k.Utf8ToUtf32,this._workCell=new b.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new _.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new _.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new _.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new _.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new _.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new _.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new _.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new _.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new _.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new _.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new _.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new _.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new _.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new V(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,he)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:he.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,he,le)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:he,data:le})})),this._parser.setDcsHandlerFallback((($,he,le)=>{he==="HOOK"&&(le=le.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:he,payload:le})})),this._parser.setPrintHandler((($,he,le)=>this.print($,he,le))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new D.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new D.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new D.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new D.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new D.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new D.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new D.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new D.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new D.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new D.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new D.OscHandler(($=>this.restoreCursorColor($)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const $ in S.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new A.DcsHandler((($,he)=>this.requestStatusString($,he))))}_preserveStack(z,j,N,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=N,this._parseStack.position=q}_logSlowResolvingAsync(z){this._logService.logLevel<=O.LogLevelEnum.WARN&&Promise.race([z,new Promise(((j,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,j){let N,q=this._activeBuffer.x,I=this._activeBuffer.y,ie=0;const pe=this._parseStack.paused;if(pe){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(N),N;q=this._parseStack.cursorStartX,I=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>H&&(ie=this._parseStack.position+H)}if(this._logService.logLevel<=O.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,($=>String.fromCharCode($))).join("")}"`),typeof z=="string"?z.split("").map(($=>$.charCodeAt(0))):z),this._parseBuffer.length<z.length&&this._parseBuffer.length<H&&(this._parseBuffer=new Uint32Array(Math.min(z.length,H))),pe||this._dirtyRowTracker.clearRange(),z.length>H)for(let $=ie;$<z.length;$+=H){const he=$+H<z.length?$+H:z.length,le=typeof z=="string"?this._stringDecoder.decode(z.substring($,he),this._parseBuffer):this._utf8Decoder.decode(z.subarray($,he),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,le))return this._preserveStack(q,I,le,$),this._logSlowResolvingAsync(N),N}else if(!pe){const $=typeof z=="string"?this._stringDecoder.decode(z,this._parseBuffer):this._utf8Decoder.decode(z,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,$))return this._preserveStack(q,I,$,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===q&&this._activeBuffer.y===I||this._onCursorMove.fire();const ge=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(ge,this._bufferService.rows-1))}print(z,j,N){let q,I;const ie=this._charsetService.charset,pe=this._optionsService.rawOptions.screenReaderMode,ge=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,he=this._curAttrData;let le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-j>0&&le.getWidth(this._activeBuffer.x-1)===2&&le.setCellFromCodepoint(this._activeBuffer.x-1,0,1,he);let xe=this._parser.precedingJoinState;for(let Ce=j;Ce<N;++Ce){if(q=z[Ce],q<127&&ie){const $e=ie[String.fromCharCode(q)];$e&&(q=$e.charCodeAt(0))}const Le=this._unicodeService.charProperties(q,xe);I=R.UnicodeService.extractWidth(Le);const Ie=R.UnicodeService.extractShouldJoin(Le),He=Ie?R.UnicodeService.extractWidth(xe):0;if(xe=Le,pe&&this._onA11yChar.fire((0,k.stringFromCodePoint)(q)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+I-He>ge){if(Q){const $e=le;let De=this._activeBuffer.x-He;for(this._activeBuffer.x=He,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),le=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&le instanceof y.BufferLine&&le.copyCellsFrom($e,De,0,He,!1);De<ge;)$e.setCellFromCodepoint(De++,0,1,he)}else if(this._activeBuffer.x=ge-1,I===2)continue}if(Ie&&this._activeBuffer.x){const $e=le.getWidth(this._activeBuffer.x-1)?1:2;le.addCodepointToCell(this._activeBuffer.x-$e,q,I);for(let De=I-He;--De>=0;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,he)}else if($&&(le.insertCells(this._activeBuffer.x,I-He,this._activeBuffer.getNullCell(he)),le.getWidth(ge-1)===2&&le.setCellFromCodepoint(ge-1,v.NULL_CELL_CODE,v.NULL_CELL_WIDTH,he)),le.setCellFromCodepoint(this._activeBuffer.x++,q,I,he),I>0)for(;--I;)le.setCellFromCodepoint(this._activeBuffer.x++,0,0,he)}this._parser.precedingJoinState=xe,this._activeBuffer.x<ge&&N-j>0&&le.getWidth(this._activeBuffer.x)===0&&!le.hasContent(this._activeBuffer.x)&&le.setCellFromCodepoint(this._activeBuffer.x,0,1,he),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,j){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,j):this._parser.registerCsiHandler(z,(N=>!U(N.params[0],this._optionsService.rawOptions.windowOptions)||j(N)))}registerDcsHandler(z,j){return this._parser.registerDcsHandler(z,new A.DcsHandler(j))}registerEscHandler(z,j){return this._parser.registerEscHandler(z,j)}registerOscHandler(z,j){return this._parser.registerOscHandler(z,new D.OscHandler(j))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var z;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(z,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=z,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+j)}cursorUp(z){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const j=z.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=z.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const j=z.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,j,N,q=!1,I=!1){const ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);ie.replaceCells(j,N,this._activeBuffer.getNullCell(this._eraseAttrData()),I),q&&(ie.isWrapped=!1)}_resetBufferLine(z,j=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),N.isWrapped=!1)}eraseInDisplay(z,j=!1){let N;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);N<this._bufferService.rows;N++)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(N);break;case 1:for(N=this._activeBuffer.y,this._dirtyRowTracker.markDirty(N),this._eraseInBufferLine(N,0,this._activeBuffer.x+1,!0,j),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,j);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(z,j=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,I=this._bufferService.rows-1+this._activeBuffer.ybase-q+1;for(;j--;)this._activeBuffer.lines.splice(I-1,1),this._activeBuffer.lines.splice(N,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(z){this._restrictCursor();let j=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let q;for(q=this._bufferService.rows-1-this._activeBuffer.scrollBottom,q=this._bufferService.rows-1+this._activeBuffer.ybase-q;j--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(q,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.insertCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.deleteCells(this._activeBuffer.x,z.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(z){let j=z.params[0]||1;for(;j--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(z){let j=z.params[0]||1;for(;j--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(y.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.deleteCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.insertCells(0,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.insertCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(z){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const j=z.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const q=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);q.deleteCells(this._activeBuffer.x,j,this._activeBuffer.getNullCell(this._eraseAttrData())),q.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(z){this._restrictCursor();const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return j&&(j.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(z.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(z){const j=this._parser.precedingJoinState;if(!j)return!0;const N=z.params[0]||1,q=R.UnicodeService.extractWidth(j),I=this._activeBuffer.x-q,ie=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(I),pe=new Uint32Array(ie.length*N);let ge=0;for(let $=0;$<ie.length;){const he=ie.codePointAt($)||0;pe[ge++]=he,$+=he>65535?2:1}let Q=ge;for(let $=1;$<N;++$)pe.copyWithin(Q,0,ge),Q+=ge;return this.print(pe,0,Q),!0}sendDeviceAttributesPrimary(z){return z.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),this._charsetService.setgCharset(1,S.DEFAULT_CHARSET),this._charsetService.setgCharset(2,S.DEFAULT_CHARSET),this._charsetService.setgCharset(3,S.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(z){for(let j=0;j<z.length;j++)switch(z.params[j]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),z.params[j]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(z,j){const N=this._coreService.decPrivateModes,{activeProtocol:q,activeEncoding:I}=this._coreMouseService,ie=this._coreService,{buffers:pe,cols:ge}=this._bufferService,{active:Q,alt:$}=pe,he=this._optionsService.rawOptions,le=Ie=>Ie?1:2,xe=z.params[0];return Ce=xe,Le=j?xe===2?4:xe===4?le(ie.modes.insertMode):xe===12?3:xe===20?le(he.convertEol):0:xe===1?le(N.applicationCursorKeys):xe===3?he.windowOptions.setWinLines?ge===80?2:ge===132?1:0:0:xe===6?le(N.origin):xe===7?le(N.wraparound):xe===8?3:xe===9?le(q==="X10"):xe===12?le(he.cursorBlink):xe===25?le(!ie.isCursorHidden):xe===45?le(N.reverseWraparound):xe===66?le(N.applicationKeypad):xe===67?4:xe===1e3?le(q==="VT200"):xe===1002?le(q==="DRAG"):xe===1003?le(q==="ANY"):xe===1004?le(N.sendFocus):xe===1005?4:xe===1006?le(I==="SGR"):xe===1015?4:xe===1016?le(I==="SGR_PIXELS"):xe===1048?1:xe===47||xe===1047||xe===1049?le(Q===$):xe===2004?le(N.bracketedPasteMode):0,ie.triggerDataEvent(`${h.C0.ESC}[${j?"":"?"}${Ce};${Le}$y`),!0;var Ce,Le}_updateAttrColor(z,j,N,q,I){return j===2?(z|=50331648,z&=-16777216,z|=E.AttributeData.fromColorRGB([N,q,I])):j===5&&(z&=-50331904,z|=33554432|255&N),z}_extractColor(z,j,N){const q=[0,0,-1,0,0,0];let I=0,ie=0;do{if(q[ie+I]=z.params[j+ie],z.hasSubParams(j+ie)){const pe=z.getSubParams(j+ie);let ge=0;do q[1]===5&&(I=1),q[ie+ge+1+I]=pe[ge];while(++ge<pe.length&&ge+ie+1+I<q.length);break}if(q[1]===5&&ie+I>=2||q[1]===2&&ie+I>=5)break;q[1]&&(I=1)}while(++ie+j<z.length&&ie+I<q.length);for(let pe=2;pe<q.length;++pe)q[pe]===-1&&(q[pe]=0);switch(q[0]){case 38:N.fg=this._updateAttrColor(N.fg,q[1],q[3],q[4],q[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,q[1],q[3],q[4],q[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,q[1],q[3],q[4],q[5])}return ie}_processUnderline(z,j){j.extended=j.extended.clone(),(!~z||z>5)&&(z=1),j.extended.underlineStyle=z,j.fg|=268435456,z===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(z){z.fg=y.DEFAULT_ATTR_DATA.fg,z.bg=y.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const j=z.length;let N;const q=this._curAttrData;for(let I=0;I<j;I++)N=z.params[I],N>=30&&N<=37?(q.fg&=-50331904,q.fg|=16777216|N-30):N>=40&&N<=47?(q.bg&=-50331904,q.bg|=16777216|N-40):N>=90&&N<=97?(q.fg&=-50331904,q.fg|=16777224|N-90):N>=100&&N<=107?(q.bg&=-50331904,q.bg|=16777224|N-100):N===0?this._processSGR0(q):N===1?q.fg|=134217728:N===3?q.bg|=67108864:N===4?(q.fg|=268435456,this._processUnderline(z.hasSubParams(I)?z.getSubParams(I)[0]:1,q)):N===5?q.fg|=536870912:N===7?q.fg|=67108864:N===8?q.fg|=1073741824:N===9?q.fg|=2147483648:N===2?q.bg|=134217728:N===21?this._processUnderline(2,q):N===22?(q.fg&=-134217729,q.bg&=-134217729):N===23?q.bg&=-67108865:N===24?(q.fg&=-268435457,this._processUnderline(0,q)):N===25?q.fg&=-536870913:N===27?q.fg&=-67108865:N===28?q.fg&=-1073741825:N===29?q.fg&=2147483647:N===39?(q.fg&=-67108864,q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):N===49?(q.bg&=-67108864,q.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?I+=this._extractColor(z,I,q):N===53?q.bg|=1073741824:N===55?q.bg&=-1073741825:N===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):N===100?(q.fg&=-67108864,q.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${j};${N}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const j=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${j};${N}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(z){const j=z.params[0]||1;switch(j){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const N=j%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(z){const j=z.params[0]||1;let N;return(z.length<2||(N=z.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(z){if(!U(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(P.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(P.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(z){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const j=[],N=z.split(";");for(;N.length>1;){const q=N.shift(),I=N.shift();if(/^\d+$/.exec(q)){const ie=parseInt(q);if(Y(ie))if(I==="?")j.push({type:0,index:ie});else{const pe=(0,M.parseColor)(I);pe&&j.push({type:1,index:ie,color:pe})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(z){const j=z.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(z,j){this._getCurrentLinkId()&&this._finishHyperlink();const N=z.split(":");let q;const I=N.findIndex((ie=>ie.startsWith("id=")));return I!==-1&&(q=N[I].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,j){const N=z.split(";");for(let q=0;q<N.length&&!(j>=this._specialColors.length);++q,++j)if(N[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const I=(0,M.parseColor)(N[q]);I&&this._onColor.fire([{type:1,index:this._specialColors[j],color:I}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const j=[],N=z.split(";");for(let q=0;q<N.length;++q)if(/^\d+$/.exec(N[q])){const I=parseInt(N[q]);Y(I)&&j.push({type:2,index:I})}return j.length&&this._onColor.fire(j),!0}restoreFgColor(z){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(z){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(z){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),!0}selectCharset(z){return z.length!==2?(this.selectDefaultCharset(),!0):(z[0]==="/"||this._charsetService.setgCharset(L[z[0]],S.CHARSETS[z[1]]||S.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new b.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j<this._bufferService.rows;++j){const N=this._activeBuffer.ybase+this._activeBuffer.y+j,q=this._activeBuffer.lines.get(N);q&&(q.fill(z),q.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(z,j){const N=this._bufferService.buffer,q=this._optionsService.rawOptions;return(I=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${I}${h.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,j){this._dirtyRowTracker.markRangeDirty(z,j)}}o.InputHandler=K;let V=class{constructor(te){this._bufferService=te,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(te){te<this.start?this.start=te:te>this.end&&(this.end=te)}markRangeDirty(te,z){te>z&&(W=te,te=z,z=W),te<this.start&&(this.start=te),z>this.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(te){return 0<=te&&te<256}V=u([g(0,O.IBufferService)],V)},844:(f,o)=>{function c(u){for(const g of u)g.dispose();u.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const u of this._disposables)u.dispose();this._disposables.length=0}register(u){return this._disposables.push(u),u}unregister(u){const g=this._disposables.indexOf(u);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(u){var g;this._isDisposed||u===this._value||((g=this._value)==null||g.dispose(),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,(u=this._value)==null||u.dispose(),this._value=void 0}},o.toDisposable=function(u){return{dispose:u}},o.disposeArray=c,o.getDisposeArrayDisposable=function(u){return{dispose:()=>c(u)}}},1505:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,h,S){this._data[g]||(this._data[g]={}),this._data[g][h]=S}get(g,h){return this._data[g]?this._data[g][h]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(u,g,h,S,w){this._data.get(u,g)||this._data.set(u,g,new c),this._data.get(u,g).set(h,S,w)}get(u,g,h,S){var w;return(w=this._data.get(u,g))==null?void 0:w.get(h,S)}clear(){this._data.clear()}}},6114:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,u=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(u),o.isIpad=u==="iPad",o.isIphone=u==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(u),o.isLinux=u.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(u){this._getKey=u,this._array=[]}clear(){this._array.length=0}insert(u){this._array.length!==0?(c=this._search(this._getKey(u)),this._array.splice(c,0,u)):this._array.push(u)}delete(u){if(this._array.length===0)return!1;const g=this._getKey(u);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===u)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(u){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===u)}forEachByKey(u,g){if(this._array.length!==0&&(c=this._search(u),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===u))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===u)}values(){return[...this._array].values()}_search(u){let g=0,h=this._array.length-1;for(;h>=g;){let S=g+h>>1;const w=this._getKey(this._array[S]);if(w>u)h=S-1;else{if(!(w<u)){for(;S>0&&this._getKey(this._array[S-1])===u;)S--;return S}g=S+1}}return g}}},7226:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const u=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(w){this._tasks.push(w),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(w){this._idleCallback=void 0;let T=0,k=0,y=w.timeRemaining(),_=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),k=Math.max(T,k),_=w.timeRemaining(),1.5*k>_)return y-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-T))}ms`),void this._start();y=_}this.clear()}}class h extends g{_requestCallback(w){return setTimeout((()=>w(this._createDeadline(16))))}_cancelCallback(w){clearTimeout(w)}_createDeadline(w){const T=Date.now()+w;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}o.PriorityTaskQueue=h,o.IdleTaskQueue=!u.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(S){return requestIdleCallback(S)}_cancelCallback(S){cancelIdleCallback(S)}}:h,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(S){this._queue.clear(),this._queue.enqueue(S)}flush(){this._queue.flush()}}},9282:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const u=c(643);o.updateWindowsModeWrappedState=function(g){const h=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),S=h==null?void 0:h.get(g.cols-1),w=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);w&&S&&(w.isWrapped=S[u.CHAR_DATA_CODE_INDEX]!==u.NULL_CELL_CODE&&S[u.CHAR_DATA_CODE_INDEX]!==u.WHITESPACE_CELL_CODE)}},3734:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{constructor(){this.fg=0,this.bg=0,this.extended=new u}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new c;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;class u{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,S=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=S}clone(){return new u(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=u},9092:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const u=c(6349),g=c(7226),h=c(3734),S=c(8437),w=c(4634),T=c(511),k=c(643),y=c(4863),_=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(v,b,E){this._hasScrollback=v,this._optionsService=b,this._bufferService=E,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=S.DEFAULT_ATTR_DATA.clone(),this.savedCharset=_.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,k.NULL_CELL_CHAR,k.NULL_CELL_WIDTH,k.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,k.WHITESPACE_CELL_CHAR,k.WHITESPACE_CELL_WIDTH,k.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(v){return v?(this._nullCell.fg=v.fg,this._nullCell.bg=v.bg,this._nullCell.extended=v.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(v){return v?(this._whitespaceCell.fg=v.fg,this._whitespaceCell.bg=v.bg,this._whitespaceCell.extended=v.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(v,b){return new S.BufferLine(this._bufferService.cols,this.getNullCell(v),b)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const v=this.ybase+this.y-this.ydisp;return v>=0&&v<this._rows}_getCorrectBufferLength(v){if(!this._hasScrollback)return v;const b=v+this._optionsService.rawOptions.scrollback;return b>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:b}fillViewportRows(v){if(this.lines.length===0){v===void 0&&(v=S.DEFAULT_ATTR_DATA);let b=this._rows;for(;b--;)this.lines.push(this.getBlankLine(v))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new u.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(v,b){const E=this.getNullCell(S.DEFAULT_ATTR_DATA);let O=0;const R=this._getCorrectBufferLength(b);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<v)for(let A=0;A<this.lines.length;A++)O+=+this.lines.get(A).resize(v,E);let D=0;if(this._rows<b)for(let A=this._rows;A<b;A++)this.lines.length<b+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new S.BufferLine(v,E)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new S.BufferLine(v,E)));else for(let A=this._rows;A>b;A--)this.lines.length>b+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(R<this.lines.maxLength){const A=this.lines.length-R;A>0&&(this.lines.trimStart(A),this.ybase=Math.max(this.ybase-A,0),this.ydisp=Math.max(this.ydisp-A,0),this.savedY=Math.max(this.savedY-A,0)),this.lines.maxLength=R}this.x=Math.min(this.x,v-1),this.y=Math.min(this.y,b-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,v-1),this.scrollTop=0}if(this.scrollBottom=b-1,this._isReflowEnabled&&(this._reflow(v,b),this._cols>v))for(let D=0;D<this.lines.length;D++)O+=+this.lines.get(D).resize(v,E);this._cols=v,this._rows=b,this._memoryCleanupQueue.clear(),O>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let v=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,v=!1);let b=0;for(;this._memoryCleanupPosition<this.lines.length;)if(b+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),b>100)return!0;return v}get _isReflowEnabled(){const v=this._optionsService.rawOptions.windowsPty;return v&&v.buildNumber?this._hasScrollback&&v.backend==="conpty"&&v.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(v,b){this._cols!==v&&(v>this._cols?this._reflowLarger(v,b):this._reflowSmaller(v,b))}_reflowLarger(v,b){const E=(0,w.reflowLargerGetLinesToRemove)(this.lines,this._cols,v,this.ybase+this.y,this.getNullCell(S.DEFAULT_ATTR_DATA));if(E.length>0){const O=(0,w.reflowLargerCreateNewLayout)(this.lines,E);(0,w.reflowLargerApplyNewLayout)(this.lines,O.layout),this._reflowLargerAdjustViewport(v,b,O.countRemoved)}}_reflowLargerAdjustViewport(v,b,E){const O=this.getNullCell(S.DEFAULT_ATTR_DATA);let R=E;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<b&&this.lines.push(new S.BufferLine(v,O))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-E,0)}_reflowSmaller(v,b){const E=this.getNullCell(S.DEFAULT_ATTR_DATA),O=[];let R=0;for(let D=this.lines.length-1;D>=0;D--){let A=this.lines.get(D);if(!A||!A.isWrapped&&A.getTrimmedLength()<=v)continue;const M=[A];for(;A.isWrapped&&D>0;)A=this.lines.get(--D),M.unshift(A);const L=this.ybase+this.y;if(L>=D&&L<D+M.length)continue;const H=M[M.length-1].getTrimmedLength(),U=(0,w.reflowSmallerGetNewLineLengths)(M,this._cols,v),P=U.length-M.length;let W;W=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+P):Math.max(0,this.lines.length-this.lines.maxLength+P);const K=[];for(let N=0;N<P;N++){const q=this.getBlankLine(S.DEFAULT_ATTR_DATA,!0);K.push(q)}K.length>0&&(O.push({start:D+M.length+R,newLines:K}),R+=K.length),M.push(...K);let V=U.length-1,Y=U[V];Y===0&&(V--,Y=U[V]);let te=M.length-P-1,z=H;for(;te>=0;){const N=Math.min(z,Y);if(M[V]===void 0)break;if(M[V].copyCellsFrom(M[te],z-N,Y-N,N,!0),Y-=N,Y===0&&(V--,Y=U[V]),z-=N,z===0){te--;const q=Math.max(te,0);z=(0,w.getWrappedLineTrimmedLength)(M,q,this._cols)}}for(let N=0;N<M.length;N++)U[N]<v&&M[N].setCell(U[N],E);let j=P-W;for(;j-- >0;)this.ybase===0?this.y<b-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+R)-b&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+P,this.ybase+b-1)}if(O.length>0){const D=[],A=[];for(let V=0;V<this.lines.length;V++)A.push(this.lines.get(V));const M=this.lines.length;let L=M-1,H=0,U=O[H];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let P=0;for(let V=Math.min(this.lines.maxLength-1,M+R-1);V>=0;V--)if(U&&U.start>L+P){for(let Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(V--,U.newLines[Y]);V++,D.push({index:L+1,amount:U.newLines.length}),P+=U.newLines.length,U=O[++H]}else this.lines.set(V,A[L--]);let W=0;for(let V=D.length-1;V>=0;V--)D[V].index+=W,this.lines.onInsertEmitter.fire(D[V]),W+=D[V].amount;const K=Math.max(0,M+R-this.lines.maxLength);K>0&&this.lines.onTrimEmitter.fire(K)}}translateBufferLineToString(v,b,E=0,O){const R=this.lines.get(v);return R?R.translateToString(b,E,O):""}getWrappedRangeForLine(v){let b=v,E=v;for(;b>0&&this.lines.get(b).isWrapped;)b--;for(;E+1<this.lines.length&&this.lines.get(E+1).isWrapped;)E++;return{first:b,last:E}}setupTabStops(v){for(v!=null?this.tabs[v]||(v=this.prevStop(v)):(this.tabs={},v=0);v<this._cols;v+=this._optionsService.rawOptions.tabStopWidth)this.tabs[v]=!0}prevStop(v){for(v==null&&(v=this.x);!this.tabs[--v]&&v>0;);return v>=this._cols?this._cols-1:v<0?0:v}nextStop(v){for(v==null&&(v=this.x);!this.tabs[++v]&&v<this._cols;);return v>=this._cols?this._cols-1:v<0?0:v}clearMarkers(v){this._isClearing=!0;for(let b=0;b<this.markers.length;b++)this.markers[b].line===v&&(this.markers[b].dispose(),this.markers.splice(b--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].dispose(),this.markers.splice(v--,1);this._isClearing=!1}addMarker(v){const b=new y.Marker(v);return this.markers.push(b),b.register(this.lines.onTrim((E=>{b.line-=E,b.line<0&&b.dispose()}))),b.register(this.lines.onInsert((E=>{b.line>=E.index&&(b.line+=E.amount)}))),b.register(this.lines.onDelete((E=>{b.line>=E.index&&b.line<E.index+E.amount&&b.dispose(),b.line>E.index&&(b.line-=E.amount)}))),b.register(b.onDispose((()=>this._removeMarker(b)))),b}_removeMarker(v){this._isClearing||this.markers.splice(this.markers.indexOf(v),1)}}},8437:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const u=c(3734),g=c(511),h=c(643),S=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let w=0;class T{constructor(y,_,v=!1){this.isWrapped=v,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const b=_||g.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let E=0;E<y;++E)this.setCell(E,b);this.length=y}get(y){const _=this._data[3*y+0],v=2097151&_;return[this._data[3*y+1],2097152&_?this._combined[y]:v?(0,S.stringFromCodePoint)(v):"",_>>22,2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):v]}set(y,_){this._data[3*y+1]=_[h.CHAR_DATA_ATTR_INDEX],_[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=_[1],this._data[3*y+0]=2097152|y|_[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&_}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const _=this._data[3*y+0];return 2097152&_?this._combined[y]:2097151&_?(0,S.stringFromCodePoint)(2097151&_):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,_){return w=3*y,_.content=this._data[w+0],_.fg=this._data[w+1],_.bg=this._data[w+2],2097152&_.content&&(_.combinedData=this._combined[y]),268435456&_.bg&&(_.extended=this._extendedAttrs[y]),_}setCell(y,_){2097152&_.content&&(this._combined[y]=_.combinedData),268435456&_.bg&&(this._extendedAttrs[y]=_.extended),this._data[3*y+0]=_.content,this._data[3*y+1]=_.fg,this._data[3*y+2]=_.bg}setCellFromCodepoint(y,_,v,b){268435456&b.bg&&(this._extendedAttrs[y]=b.extended),this._data[3*y+0]=_|v<<22,this._data[3*y+1]=b.fg,this._data[3*y+2]=b.bg}addCodepointToCell(y,_,v){let b=this._data[3*y+0];2097152&b?this._combined[y]+=(0,S.stringFromCodePoint)(_):2097151&b?(this._combined[y]=(0,S.stringFromCodePoint)(2097151&b)+(0,S.stringFromCodePoint)(_),b&=-2097152,b|=2097152):b=_|4194304,v&&(b&=-12582913,b|=v<<22),this._data[3*y+0]=b}insertCells(y,_,v){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length-y){const b=new g.CellData;for(let E=this.length-y-_-1;E>=0;--E)this.setCell(y+_+E,this.loadCell(y+E,b));for(let E=0;E<_;++E)this.setCell(y+E,v)}else for(let b=y;b<this.length;++b)this.setCell(b,v);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,v)}deleteCells(y,_,v){if(y%=this.length,_<this.length-y){const b=new g.CellData;for(let E=0;E<this.length-y-_;++E)this.setCell(y+E,this.loadCell(y+_+E,b));for(let E=this.length-_;E<this.length;++E)this.setCell(E,v)}else for(let b=y;b<this.length;++b)this.setCell(b,v);y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),this.getWidth(y)!==0||this.hasContent(y)||this.setCellFromCodepoint(y,0,1,v)}replaceCells(y,_,v,b=!1){if(b)for(y&&this.getWidth(y-1)===2&&!this.isProtected(y-1)&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&!this.isProtected(_)&&this.setCellFromCodepoint(_,0,1,v);y<_&&y<this.length;)this.isProtected(y)||this.setCell(y,v),y++;else for(y&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,v),_<this.length&&this.getWidth(_-1)===2&&this.setCellFromCodepoint(_,0,1,v);y<_&&y<this.length;)this.setCell(y++,v)}resize(y,_){if(y===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const v=3*y;if(y>this.length){if(this._data.buffer.byteLength>=4*v)this._data=new Uint32Array(this._data.buffer,0,v);else{const b=new Uint32Array(v);b.set(this._data),this._data=b}for(let b=this.length;b<y;++b)this.setCell(b,_)}else{this._data=this._data.subarray(0,v);const b=Object.keys(this._combined);for(let O=0;O<b.length;O++){const R=parseInt(b[O],10);R>=y&&delete this._combined[R]}const E=Object.keys(this._extendedAttrs);for(let O=0;O<E.length;O++){const R=parseInt(E[O],10);R>=y&&delete this._extendedAttrs[R]}}return this.length=y,4*v*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const y=new Uint32Array(this._data.length);return y.set(this._data),this._data=y,1}return 0}fill(y,_=!1){if(_)for(let v=0;v<this.length;++v)this.isProtected(v)||this.setCell(v,y);else{this._combined={},this._extendedAttrs={};for(let v=0;v<this.length;++v)this.setCell(v,y)}}copyFrom(y){this.length!==y.length?this._data=new Uint32Array(y._data):this._data.set(y._data),this.length=y.length,this._combined={};for(const _ in y._combined)this._combined[_]=y._combined[_];this._extendedAttrs={};for(const _ in y._extendedAttrs)this._extendedAttrs[_]=y._extendedAttrs[_];this.isWrapped=y.isWrapped}clone(){const y=new T(0);y._data=new Uint32Array(this._data),y.length=this.length;for(const _ in this._combined)y._combined[_]=this._combined[_];for(const _ in this._extendedAttrs)y._extendedAttrs[_]=this._extendedAttrs[_];return y.isWrapped=this.isWrapped,y}getTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,_,v,b,E){const O=y._data;if(E)for(let D=b-1;D>=0;D--){for(let A=0;A<3;A++)this._data[3*(v+D)+A]=O[3*(_+D)+A];268435456&O[3*(_+D)+2]&&(this._extendedAttrs[v+D]=y._extendedAttrs[_+D])}else for(let D=0;D<b;D++){for(let A=0;A<3;A++)this._data[3*(v+D)+A]=O[3*(_+D)+A];268435456&O[3*(_+D)+2]&&(this._extendedAttrs[v+D]=y._extendedAttrs[_+D])}const R=Object.keys(y._combined);for(let D=0;D<R.length;D++){const A=parseInt(R[D],10);A>=_&&(this._combined[A-_+v]=y._combined[A])}}translateToString(y,_,v,b){_=_??0,v=v??this.length,y&&(v=Math.min(v,this.getTrimmedLength())),b&&(b.length=0);let E="";for(;_<v;){const O=this._data[3*_+0],R=2097151&O,D=2097152&O?this._combined[_]:R?(0,S.stringFromCodePoint)(R):h.WHITESPACE_CELL_CHAR;if(E+=D,b)for(let A=0;A<D.length;++A)b.push(_);_+=O>>22||1}return b&&b.push(_),E}}o.BufferLine=T},4841:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,u){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return u*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(f,o)=>{function c(u,g,h){if(g===u.length-1)return u[g].getTrimmedLength();const S=!u[g].hasContent(h-1)&&u[g].getWidth(h-1)===1,w=u[g+1].getWidth(0)===2;return S&&w?h-1:h}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(u,g,h,S,w){const T=[];for(let k=0;k<u.length-1;k++){let y=k,_=u.get(++y);if(!_.isWrapped)continue;const v=[u.get(k)];for(;y<u.length&&_.isWrapped;)v.push(_),_=u.get(++y);if(S>=k&&S<y){k+=v.length-1;continue}let b=0,E=c(v,b,g),O=1,R=0;for(;O<v.length;){const A=c(v,O,g),M=A-R,L=h-E,H=Math.min(M,L);v[b].copyCellsFrom(v[O],R,E,H,!1),E+=H,E===h&&(b++,E=0),R+=H,R===A&&(O++,R=0),E===0&&b!==0&&v[b-1].getWidth(h-1)===2&&(v[b].copyCellsFrom(v[b-1],h-1,E++,1,!1),v[b-1].setCell(h-1,w))}v[b].replaceCells(E,h,w);let D=0;for(let A=v.length-1;A>0&&(A>b||v[A].getTrimmedLength()===0);A--)D++;D>0&&(T.push(k+v.length-D),T.push(D)),k+=v.length-1}return T},o.reflowLargerCreateNewLayout=function(u,g){const h=[];let S=0,w=g[S],T=0;for(let k=0;k<u.length;k++)if(w===k){const y=g[++S];u.onDeleteEmitter.fire({index:k-T,amount:y}),k+=y-1,T+=y,w=g[++S]}else h.push(k);return{layout:h,countRemoved:T}},o.reflowLargerApplyNewLayout=function(u,g){const h=[];for(let S=0;S<g.length;S++)h.push(u.get(g[S]));for(let S=0;S<h.length;S++)u.set(S,h[S]);u.length=g.length},o.reflowSmallerGetNewLineLengths=function(u,g,h){const S=[],w=u.map(((_,v)=>c(u,v,g))).reduce(((_,v)=>_+v));let T=0,k=0,y=0;for(;y<w;){if(w-y<h){S.push(w-y);break}T+=h;const _=c(u,k,g);T>_&&(T-=_,k++);const v=u[k].getWidth(T-1)===2;v&&T--;const b=v?h-1:h;S.push(b),y+=b}return S},o.getWrappedLineTrimmedLength=c},5295:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const u=c(8460),g=c(844),h=c(9092);class S extends g.Disposable{constructor(T,k){super(),this._optionsService=T,this._bufferService=k,this._onBufferActivate=this.register(new u.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(T,k){this._normal.resize(T,k),this._alt.resize(T,k),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}o.BufferSet=S},511:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const u=c(482),g=c(643),h=c(3734);class S extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const k=new S;return k.setFromCharData(T),k}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,u.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let k=!1;if(T[g.CHAR_DATA_CHAR_INDEX].length>2)k=!0;else if(T[g.CHAR_DATA_CHAR_INDEX].length===2){const y=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const _=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=_&&_<=57343?this.content=1024*(y-55296)+_-56320+65536|T[g.CHAR_DATA_WIDTH_INDEX]<<22:k=!0}else k=!0}else this.content=T[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[g.CHAR_DATA_WIDTH_INDEX]<<22;k&&(this.combinedData=T[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=S},643:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const u=c(8460),g=c(844);class h{get id(){return this._id}constructor(w){this.line=w,this.isDisposed=!1,this._disposables=[],this._id=h._nextId++,this._onDispose=this.register(new u.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(w){return this._disposables.push(w),w}}o.Marker=h,h._nextId=1},7116:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(f,o)=>{var c,u,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
58
58
  `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(c||(o.C0=c={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(u||(o.C1=u={})),(function(h){h.ST=`${c.ESC}\\`})(g||(o.C1_ESCAPED=g={}))},7399:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const u=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(h,S,w,T){const k={type:0,cancel:!1,key:void 0},y=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?k.key=S?u.C0.ESC+"OA":u.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?k.key=S?u.C0.ESC+"OD":u.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?k.key=S?u.C0.ESC+"OC":u.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(k.key=S?u.C0.ESC+"OB":u.C0.ESC+"[B");break;case 8:k.key=h.ctrlKey?"\b":u.C0.DEL,h.altKey&&(k.key=u.C0.ESC+k.key);break;case 9:if(h.shiftKey){k.key=u.C0.ESC+"[Z";break}k.key=u.C0.HT,k.cancel=!0;break;case 13:k.key=h.altKey?u.C0.ESC+u.C0.CR:u.C0.CR,k.cancel=!0;break;case 27:k.key=u.C0.ESC,h.altKey&&(k.key=u.C0.ESC+u.C0.ESC),k.cancel=!0;break;case 37:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"D",k.key===u.C0.ESC+"[1;3D"&&(k.key=u.C0.ESC+(w?"b":"[1;5D"))):k.key=S?u.C0.ESC+"OD":u.C0.ESC+"[D";break;case 39:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"C",k.key===u.C0.ESC+"[1;3C"&&(k.key=u.C0.ESC+(w?"f":"[1;5C"))):k.key=S?u.C0.ESC+"OC":u.C0.ESC+"[C";break;case 38:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"A",w||k.key!==u.C0.ESC+"[1;3A"||(k.key=u.C0.ESC+"[1;5A")):k.key=S?u.C0.ESC+"OA":u.C0.ESC+"[A";break;case 40:if(h.metaKey)break;y?(k.key=u.C0.ESC+"[1;"+(y+1)+"B",w||k.key!==u.C0.ESC+"[1;3B"||(k.key=u.C0.ESC+"[1;5B")):k.key=S?u.C0.ESC+"OB":u.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(k.key=u.C0.ESC+"[2~");break;case 46:k.key=y?u.C0.ESC+"[3;"+(y+1)+"~":u.C0.ESC+"[3~";break;case 36:k.key=y?u.C0.ESC+"[1;"+(y+1)+"H":S?u.C0.ESC+"OH":u.C0.ESC+"[H";break;case 35:k.key=y?u.C0.ESC+"[1;"+(y+1)+"F":S?u.C0.ESC+"OF":u.C0.ESC+"[F";break;case 33:h.shiftKey?k.type=2:h.ctrlKey?k.key=u.C0.ESC+"[5;"+(y+1)+"~":k.key=u.C0.ESC+"[5~";break;case 34:h.shiftKey?k.type=3:h.ctrlKey?k.key=u.C0.ESC+"[6;"+(y+1)+"~":k.key=u.C0.ESC+"[6~";break;case 112:k.key=y?u.C0.ESC+"[1;"+(y+1)+"P":u.C0.ESC+"OP";break;case 113:k.key=y?u.C0.ESC+"[1;"+(y+1)+"Q":u.C0.ESC+"OQ";break;case 114:k.key=y?u.C0.ESC+"[1;"+(y+1)+"R":u.C0.ESC+"OR";break;case 115:k.key=y?u.C0.ESC+"[1;"+(y+1)+"S":u.C0.ESC+"OS";break;case 116:k.key=y?u.C0.ESC+"[15;"+(y+1)+"~":u.C0.ESC+"[15~";break;case 117:k.key=y?u.C0.ESC+"[17;"+(y+1)+"~":u.C0.ESC+"[17~";break;case 118:k.key=y?u.C0.ESC+"[18;"+(y+1)+"~":u.C0.ESC+"[18~";break;case 119:k.key=y?u.C0.ESC+"[19;"+(y+1)+"~":u.C0.ESC+"[19~";break;case 120:k.key=y?u.C0.ESC+"[20;"+(y+1)+"~":u.C0.ESC+"[20~";break;case 121:k.key=y?u.C0.ESC+"[21;"+(y+1)+"~":u.C0.ESC+"[21~";break;case 122:k.key=y?u.C0.ESC+"[23;"+(y+1)+"~":u.C0.ESC+"[23~";break;case 123:k.key=y?u.C0.ESC+"[24;"+(y+1)+"~":u.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(w&&!T||!h.altKey||h.metaKey)!w||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?k.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(k.key=u.C0.US),h.key==="@"&&(k.key=u.C0.NUL)):h.keyCode===65&&(k.type=1);else{const _=g[h.keyCode],v=_==null?void 0:_[h.shiftKey?1:0];if(v)k.key=u.C0.ESC+v;else if(h.keyCode>=65&&h.keyCode<=90){const b=h.ctrlKey?h.keyCode-64:h.keyCode+32;let E=String.fromCharCode(b);h.shiftKey&&(E=E.toUpperCase()),k.key=u.C0.ESC+E}else if(h.keyCode===32)k.key=u.C0.ESC+(h.ctrlKey?u.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let b=h.code.slice(3,4);h.shiftKey||(b=b.toLowerCase()),k.key=u.C0.ESC+b,k.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?k.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?k.key=u.C0.NUL:h.keyCode>=51&&h.keyCode<=55?k.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?k.key=u.C0.DEL:h.keyCode===219?k.key=u.C0.ESC:h.keyCode===220?k.key=u.C0.FS:h.keyCode===221&&(k.key=u.C0.GS)}return k}},482:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,u=0,g=c.length){let h="";for(let S=u;S<g;++S){let w=c[S];w>65535?(w-=65536,h+=String.fromCharCode(55296+(w>>10))+String.fromCharCode(w%1024+56320)):h+=String.fromCharCode(w)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,u){const g=c.length;if(!g)return 0;let h=0,S=0;if(this._interim){const w=c.charCodeAt(S++);56320<=w&&w<=57343?u[h++]=1024*(this._interim-55296)+w-56320+65536:(u[h++]=this._interim,u[h++]=w),this._interim=0}for(let w=S;w<g;++w){const T=c.charCodeAt(w);if(55296<=T&&T<=56319){if(++w>=g)return this._interim=T,h;const k=c.charCodeAt(w);56320<=k&&k<=57343?u[h++]=1024*(T-55296)+k-56320+65536:(u[h++]=T,u[h++]=k)}else T!==65279&&(u[h++]=T)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,u){const g=c.length;if(!g)return 0;let h,S,w,T,k=0,y=0,_=0;if(this.interim[0]){let E=!1,O=this.interim[0];O&=(224&O)==192?31:(240&O)==224?15:7;let R,D=0;for(;(R=63&this.interim[++D])&&D<4;)O<<=6,O|=R;const A=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,M=A-D;for(;_<M;){if(_>=g)return 0;if(R=c[_++],(192&R)!=128){_--,E=!0;break}this.interim[D++]=R,O<<=6,O|=63&R}E||(A===2?O<128?_--:u[k++]=O:A===3?O<2048||O>=55296&&O<=57343||O===65279||(u[k++]=O):O<65536||O>1114111||(u[k++]=O)),this.interim.fill(0)}const v=g-4;let b=_;for(;b<g;){for(;!(!(b<v)||128&(h=c[b])||128&(S=c[b+1])||128&(w=c[b+2])||128&(T=c[b+3]));)u[k++]=h,u[k++]=S,u[k++]=w,u[k++]=T,b+=4;if(h=c[b++],h<128)u[k++]=h;else if((224&h)==192){if(b>=g)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(y=(31&h)<<6|63&S,y<128){b--;continue}u[k++]=y}else if((240&h)==224){if(b>=g)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(b>=g)return this.interim[0]=h,this.interim[1]=S,k;if(w=c[b++],(192&w)!=128){b--;continue}if(y=(15&h)<<12|(63&S)<<6|63&w,y<2048||y>=55296&&y<=57343||y===65279)continue;u[k++]=y}else if((248&h)==240){if(b>=g)return this.interim[0]=h,k;if(S=c[b++],(192&S)!=128){b--;continue}if(b>=g)return this.interim[0]=h,this.interim[1]=S,k;if(w=c[b++],(192&w)!=128){b--;continue}if(b>=g)return this.interim[0]=h,this.interim[1]=S,this.interim[2]=w,k;if(T=c[b++],(192&T)!=128){b--;continue}if(y=(7&h)<<18|(63&S)<<12|(63&w)<<6|63&T,y<65536||y>1114111)continue;u[k++]=y}}return k}}},225:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const u=c(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let S;o.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let w=0;w<g.length;++w)S.fill(0,g[w][0],g[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?S[w]:(function(T,k){let y,_=0,v=k.length-1;if(T<k[0][0]||T>k[v][1])return!1;for(;v>=_;)if(y=_+v>>1,T>k[y][1])_=y+1;else{if(!(T<k[y][0]))return!0;v=y-1}return!1})(w,h)?0:w>=131072&&w<=196605||w>=196608&&w<=262141?2:1}charProperties(w,T){let k=this.wcwidth(w),y=k===0&&T!==0;if(y){const _=u.UnicodeService.extractWidth(T);_===0?y=!1:_>k&&(k=_)}return u.UnicodeService.createPropertyValue(0,k,y)}}},5981:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const u=c(8460),g=c(844);class h extends g.Disposable{constructor(w){super(),this._action=w,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(w,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let k;for(this._isSyncWriting=!0;k=this._writeBuffer.shift();){this._action(k);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(w,T){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=w.length,this._writeBuffer.push(w),this._callbacks.push(T)}_innerWrite(w=0,T=!0){const k=w||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],_=this._action(y,T);if(_){const b=E=>Date.now()-k>=12?setTimeout((()=>this._innerWrite(0,E))):this._innerWrite(k,E);return void _.catch((E=>(queueMicrotask((()=>{throw E})),Promise.resolve(!1)))).then(b)}const v=this._callbacks[this._bufferOffset];if(v&&v(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-k>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=h},5941:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,u=/^[\da-f]+$/;function g(h,S){const w=h.toString(16),T=w.length<2?"0"+w:w;switch(S){case 4:return w[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}o.parseColor=function(h){if(!h)return;let S=h.toLowerCase();if(S.indexOf("rgb:")===0){S=S.slice(4);const w=c.exec(S);if(w){const T=w[1]?15:w[4]?255:w[7]?4095:65535;return[Math.round(parseInt(w[1]||w[4]||w[7]||w[10],16)/T*255),Math.round(parseInt(w[2]||w[5]||w[8]||w[11],16)/T*255),Math.round(parseInt(w[3]||w[6]||w[9]||w[12],16)/T*255)]}}else if(S.indexOf("#")===0&&(S=S.slice(1),u.exec(S)&&[3,6,9,12].includes(S.length))){const w=S.length/3,T=[0,0,0];for(let k=0;k<3;++k){const y=parseInt(S.slice(w*k,w*k+w),16);T[k]=w===1?y<<4:w===2?y:w===3?y>>4:y>>8}return T}},o.toRgbString=function(h,S=16){const[w,T,k]=h;return`rgb:${g(w,S)}/${g(T,S)}/${g(k,S)}`}},5770:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const u=c(482),g=c(8742),h=c(5770),S=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=S}registerHandler(T,k){this._handlers[T]===void 0&&(this._handlers[T]=[]);const y=this._handlers[T];return y.push(k),{dispose:()=>{const _=y.indexOf(k);_!==-1&&y.splice(_,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=S,this._ident=0}hook(T,k){if(this.reset(),this._ident=T,this._active=this._handlers[T]||S,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(k);else this._handlerFb(this._ident,"HOOK",k)}put(T,k,y){if(this._active.length)for(let _=this._active.length-1;_>=0;_--)this._active[_].put(T,k,y);else this._handlerFb(this._ident,"PUT",(0,u.utf32ToString)(T,k,y))}unhook(T,k=!0){if(this._active.length){let y=!1,_=this._active.length-1,v=!1;if(this._stack.paused&&(_=this._stack.loopPosition-1,y=k,v=this._stack.fallThrough,this._stack.paused=!1),!v&&y===!1){for(;_>=0&&(y=this._active[_].unhook(T),y!==!0);_--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!1,y;_--}for(;_>=0;_--)if(y=this._active[_].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=_,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",T);this._active=S,this._ident=0}};const w=new g.Params;w.addParam(0),o.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=w,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():w,this._data="",this._hitLimit=!1}put(T,k,y){this._hitLimit||(this._data+=(0,u.utf32ToString)(T,k,y),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let k=!1;if(this._hitLimit)k=!1;else if(T&&(k=this._handler(this._data,this._params),k instanceof Promise))return k.then((y=>(this._params=w,this._data="",this._hitLimit=!1,y)));return this._params=w,this._data="",this._hitLimit=!1,k}}},2015:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const u=c(844),g=c(8742),h=c(6242),S=c(6351);class w{constructor(_){this.table=new Uint8Array(_)}setDefault(_,v){this.table.fill(_<<4|v)}add(_,v,b,E){this.table[v<<8|_]=b<<4|E}addMany(_,v,b,E){for(let O=0;O<_.length;O++)this.table[v<<8|_[O]]=b<<4|E}}o.TransitionTable=w;const T=160;o.VT500_TRANSITION_TABLE=(function(){const y=new w(4095),_=Array.apply(null,Array(256)).map(((D,A)=>A)),v=(D,A)=>_.slice(D,A),b=v(32,127),E=v(0,24);E.push(25),E.push.apply(E,v(28,32));const O=v(0,14);let R;for(R in y.setDefault(1,0),y.addMany(b,0,2,0),O)y.addMany([24,26,153,154],R,3,0),y.addMany(v(128,144),R,3,0),y.addMany(v(144,152),R,3,0),y.add(156,R,0,0),y.add(27,R,11,1),y.add(157,R,4,8),y.addMany([152,158,159],R,0,7),y.add(155,R,11,3),y.add(144,R,11,9);return y.addMany(E,0,3,0),y.addMany(E,1,3,1),y.add(127,1,0,1),y.addMany(E,8,0,8),y.addMany(E,3,3,3),y.add(127,3,0,3),y.addMany(E,4,3,4),y.add(127,4,0,4),y.addMany(E,6,3,6),y.addMany(E,5,3,5),y.add(127,5,0,5),y.addMany(E,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(b,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(v(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(b,7,0,7),y.addMany(E,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(v(64,127),3,7,0),y.addMany(v(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(v(48,60),4,8,4),y.addMany(v(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(v(32,64),6,0,6),y.add(127,6,0,6),y.addMany(v(64,127),6,0,0),y.addMany(v(32,48),3,9,5),y.addMany(v(32,48),5,9,5),y.addMany(v(48,64),5,0,6),y.addMany(v(64,127),5,7,0),y.addMany(v(32,48),4,9,5),y.addMany(v(32,48),1,9,2),y.addMany(v(32,48),2,9,2),y.addMany(v(48,127),2,10,0),y.addMany(v(48,80),1,10,0),y.addMany(v(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(v(96,127),1,10,0),y.add(80,1,11,9),y.addMany(E,9,0,9),y.add(127,9,0,9),y.addMany(v(28,32),9,0,9),y.addMany(v(32,48),9,9,12),y.addMany(v(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(E,11,0,11),y.addMany(v(32,128),11,0,11),y.addMany(v(28,32),11,0,11),y.addMany(E,10,0,10),y.add(127,10,0,10),y.addMany(v(28,32),10,0,10),y.addMany(v(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(v(32,48),10,9,12),y.addMany(E,12,0,12),y.add(127,12,0,12),y.addMany(v(28,32),12,0,12),y.addMany(v(32,48),12,9,12),y.addMany(v(48,64),12,0,11),y.addMany(v(64,127),12,12,13),y.addMany(v(64,127),10,12,13),y.addMany(v(64,127),9,12,13),y.addMany(E,13,13,13),y.addMany(b,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(T,0,2,0),y.add(T,8,5,8),y.add(T,6,0,6),y.add(T,11,0,11),y.add(T,13,13,13),y})();class k extends u.Disposable{constructor(_=o.VT500_TRANSITION_TABLE){super(),this._transitions=_,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(v,b,E)=>{},this._executeHandlerFb=v=>{},this._csiHandlerFb=(v,b)=>{},this._escHandlerFb=v=>{},this._errorHandlerFb=v=>v,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,u.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new S.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(_,v=[64,126]){let b=0;if(_.prefix){if(_.prefix.length>1)throw new Error("only one byte as prefix supported");if(b=_.prefix.charCodeAt(0),b&&60>b||b>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(_.intermediates){if(_.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let O=0;O<_.intermediates.length;++O){const R=_.intermediates.charCodeAt(O);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");b<<=8,b|=R}}if(_.final.length!==1)throw new Error("final must be a single byte");const E=_.final.charCodeAt(0);if(v[0]>E||E>v[1])throw new Error(`final must be in range ${v[0]} .. ${v[1]}`);return b<<=8,b|=E,b}identToString(_){const v=[];for(;_;)v.push(String.fromCharCode(255&_)),_>>=8;return v.reverse().join("")}setPrintHandler(_){this._printHandler=_}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(_,v){const b=this._identifier(_,[48,126]);this._escHandlers[b]===void 0&&(this._escHandlers[b]=[]);const E=this._escHandlers[b];return E.push(v),{dispose:()=>{const O=E.indexOf(v);O!==-1&&E.splice(O,1)}}}clearEscHandler(_){this._escHandlers[this._identifier(_,[48,126])]&&delete this._escHandlers[this._identifier(_,[48,126])]}setEscHandlerFallback(_){this._escHandlerFb=_}setExecuteHandler(_,v){this._executeHandlers[_.charCodeAt(0)]=v}clearExecuteHandler(_){this._executeHandlers[_.charCodeAt(0)]&&delete this._executeHandlers[_.charCodeAt(0)]}setExecuteHandlerFallback(_){this._executeHandlerFb=_}registerCsiHandler(_,v){const b=this._identifier(_);this._csiHandlers[b]===void 0&&(this._csiHandlers[b]=[]);const E=this._csiHandlers[b];return E.push(v),{dispose:()=>{const O=E.indexOf(v);O!==-1&&E.splice(O,1)}}}clearCsiHandler(_){this._csiHandlers[this._identifier(_)]&&delete this._csiHandlers[this._identifier(_)]}setCsiHandlerFallback(_){this._csiHandlerFb=_}registerDcsHandler(_,v){return this._dcsParser.registerHandler(this._identifier(_),v)}clearDcsHandler(_){this._dcsParser.clearHandler(this._identifier(_))}setDcsHandlerFallback(_){this._dcsParser.setHandlerFallback(_)}registerOscHandler(_,v){return this._oscParser.registerHandler(_,v)}clearOscHandler(_){this._oscParser.clearHandler(_)}setOscHandlerFallback(_){this._oscParser.setHandlerFallback(_)}setErrorHandler(_){this._errorHandler=_}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(_,v,b,E,O){this._parseStack.state=_,this._parseStack.handlers=v,this._parseStack.handlerPos=b,this._parseStack.transition=E,this._parseStack.chunkPos=O}parse(_,v,b){let E,O=0,R=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(b===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const A=this._parseStack.handlers;let M=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(b===!1&&M>-1){for(;M>=0&&(E=A[M](this._params),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 4:if(b===!1&&M>-1){for(;M>=0&&(E=A[M](),E!==!0);M--)if(E instanceof Promise)return this._parseStack.handlerPos=M,E}this._parseStack.handlers=[];break;case 6:if(O=_[this._parseStack.chunkPos],E=this._dcsParser.unhook(O!==24&&O!==26,b),E)return E;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(O=_[this._parseStack.chunkPos],E=this._oscParser.end(O!==24&&O!==26,b),E)return E;O===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let A=D;A<v;++A){switch(O=_[A],R=this._transitions.table[this.currentState<<8|(O<160?O:T)],R>>4){case 2:for(let P=A+1;;++P){if(P>=v||(O=_[P])<32||O>126&&O<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=v||(O=_[P])<32||O>126&&O<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=v||(O=_[P])<32||O>126&&O<T){this._printHandler(_,A,P),A=P-1;break}if(++P>=v||(O=_[P])<32||O>126&&O<T){this._printHandler(_,A,P),A=P-1;break}}break;case 3:this._executeHandlers[O]?this._executeHandlers[O]():this._executeHandlerFb(O),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:A,code:O,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const M=this._csiHandlers[this._collect<<8|O];let L=M?M.length-1:-1;for(;L>=0&&(E=M[L](this._params),E!==!0);L--)if(E instanceof Promise)return this._preserveStack(3,M,L,R,A),E;L<0&&this._csiHandlerFb(this._collect<<8|O,this._params),this.precedingJoinState=0;break;case 8:do switch(O){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(O-48)}while(++A<v&&(O=_[A])>47&&O<60);A--;break;case 9:this._collect<<=8,this._collect|=O;break;case 10:const H=this._escHandlers[this._collect<<8|O];let U=H?H.length-1:-1;for(;U>=0&&(E=H[U](),E!==!0);U--)if(E instanceof Promise)return this._preserveStack(4,H,U,R,A),E;U<0&&this._escHandlerFb(this._collect<<8|O),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|O,this._params);break;case 13:for(let P=A+1;;++P)if(P>=v||(O=_[P])===24||O===26||O===27||O>127&&O<T){this._dcsParser.put(_,A,P),A=P-1;break}break;case 14:if(E=this._dcsParser.unhook(O!==24&&O!==26),E)return this._preserveStack(6,[],0,R,A),E;O===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=A+1;;P++)if(P>=v||(O=_[P])<32||O>127&&O<T){this._oscParser.put(_,A,P),A=P-1;break}break;case 6:if(E=this._oscParser.end(O!==24&&O!==26),E)return this._preserveStack(5,[],0,R,A),E;O===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}o.EscapeSequenceParser=k},6242:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const u=c(5770),g=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(S,w){this._handlers[S]===void 0&&(this._handlers[S]=[]);const T=this._handlers[S];return T.push(w),{dispose:()=>{const k=T.indexOf(w);k!==-1&&T.splice(k,1)}}}clearHandler(S){this._handlers[S]&&delete this._handlers[S]}setHandlerFallback(S){this._handlerFb=S}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let S=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;S>=0;--S)this._active[S].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let S=this._active.length-1;S>=0;S--)this._active[S].start();else this._handlerFb(this._id,"START")}_put(S,w,T){if(this._active.length)for(let k=this._active.length-1;k>=0;k--)this._active[k].put(S,w,T);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(S,w,T))}start(){this.reset(),this._state=1}put(S,w,T){if(this._state!==3){if(this._state===1)for(;w<T;){const k=S[w++];if(k===59){this._state=2,this._start();break}if(k<48||57<k)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+k-48}this._state===2&&T-w>0&&this._put(S,w,T)}}end(S,w=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,k=this._active.length-1,y=!1;if(this._stack.paused&&(k=this._stack.loopPosition-1,T=w,y=this._stack.fallThrough,this._stack.paused=!1),!y&&T===!1){for(;k>=0&&(T=this._active[k].end(S),T!==!0);k--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!1,T;k--}for(;k>=0;k--)if(T=this._active[k].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=k,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",S);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(S){this._handler=S,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(S,w,T){this._hitLimit||(this._data+=(0,g.utf32ToString)(S,w,T),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(S){let w=!1;if(this._hitLimit)w=!1;else if(S&&(w=this._handler(this._data),w instanceof Promise))return w.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,w}}},8742:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class u{static fromArray(h){const S=new u;if(!h.length)return S;for(let w=Array.isArray(h[0])?1:0;w<h.length;++w){const T=h[w];if(Array.isArray(T))for(let k=0;k<T.length;++k)S.addSubParam(T[k]);else S.addParam(T)}return S}constructor(h=32,S=32){if(this.maxLength=h,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new u(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let S=0;S<this.length;++S){h.push(this.params[S]);const w=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-w>0&&h.push(Array.prototype.slice.call(this._subParams,w,T))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const S=this._subParamsIdx[h]>>8,w=255&this._subParamsIdx[h];return w-S>0?this._subParams.subarray(S,w):null}getSubParamsAll(){const h={};for(let S=0;S<this.length;++S){const w=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-w>0&&(h[S]=this._subParams.slice(w,T))}return h}addDigit(h){let S;if(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const w=this._digitIsSub?this._subParams:this.params,T=w[S-1];w[S-1]=~T?Math.min(10*T+h,c):h}}o.Params=u},5741:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,u){const g={instance:u,dispose:u.dispose,isDisposed:!1};this._addons.push(g),u.dispose=()=>this._wrappedAddonDispose(g),u.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let u=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){u=g;break}if(u===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(u,1)}}},8771:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const u=c(3785),g=c(511);o.BufferApiView=class{constructor(h,S){this._buffer=h,this.type=S}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const S=this._buffer.lines.get(h);if(S)return new u.BufferLineApiView(S)}getNullCell(){return new g.CellData}}},3785:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const u=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,h){if(!(g<0||g>=this._line.length))return h?(this._line.loadCell(g,h),h):this._line.loadCell(g,new u.CellData)}translateToString(g,h,S){return this._line.translateToString(g,h,S)}}},8285:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const u=c(8771),g=c(8460),h=c(844);class S extends h.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new u.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new u.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=S},7975:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,u){return this._core.registerCsiHandler(c,(g=>u(g.toArray())))}addCsiHandler(c,u){return this.registerCsiHandler(c,u)}registerDcsHandler(c,u){return this._core.registerDcsHandler(c,((g,h)=>u(g,h.toArray())))}addDcsHandler(c,u){return this.registerDcsHandler(c,u)}registerEscHandler(c,u){return this._core.registerEscHandler(c,u)}addEscHandler(c,u){return this.registerEscHandler(c,u)}registerOscHandler(c,u){return this._core.registerOscHandler(c,u)}addOscHandler(c,u){return this.registerOscHandler(c,u)}}},7090:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(f,o,c){var u=this&&this.__decorate||function(y,_,v,b){var E,O=arguments.length,R=O<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,v,b);else for(var D=y.length-1;D>=0;D--)(E=y[D])&&(R=(O<3?E(R):O>3?E(_,v,R):E(_,v))||R);return O>3&&R&&Object.defineProperty(_,v,R),R},g=this&&this.__param||function(y,_){return function(v,b){_(v,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),S=c(844),w=c(5295),T=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let k=o.BufferService=class extends S.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new w.BufferSet(y,this))}resize(y,_){this.cols=y,this.rows=_,this.buffers.resize(y,_),this._onResize.fire({cols:y,rows:_})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,_=!1){const v=this.buffer;let b;b=this._cachedBlankLine,b&&b.length===this.cols&&b.getFg(0)===y.fg&&b.getBg(0)===y.bg||(b=v.getBlankLine(y,_),this._cachedBlankLine=b),b.isWrapped=_;const E=v.ybase+v.scrollTop,O=v.ybase+v.scrollBottom;if(v.scrollTop===0){const R=v.lines.isFull;O===v.lines.length-1?R?v.lines.recycle().copyFrom(b):v.lines.push(b.clone()):v.lines.splice(O+1,0,b.clone()),R?this.isUserScrolling&&(v.ydisp=Math.max(v.ydisp-1,0)):(v.ybase++,this.isUserScrolling||v.ydisp++)}else{const R=O-E+1;v.lines.shiftElements(E+1,R-1,-1),v.lines.set(O,b.clone())}this.isUserScrolling||(v.ydisp=v.ybase),this._onScroll.fire(v.ydisp)}scrollLines(y,_,v){const b=this.buffer;if(y<0){if(b.ydisp===0)return;this.isUserScrolling=!0}else y+b.ydisp>=b.ybase&&(this.isUserScrolling=!1);const E=b.ydisp;b.ydisp=Math.max(Math.min(b.ydisp+y,b.ybase),0),E!==b.ydisp&&(_||this._onScroll.fire(b.ydisp))}};o.BufferService=k=u([g(0,T.IOptionsService)],k)},7994:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,u){this._charsets[c]=u,this.glevel===c&&(this.charset=u)}}},1753:function(f,o,c){var u=this&&this.__decorate||function(b,E,O,R){var D,A=arguments.length,M=A<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,O):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(b,E,O,R);else for(var L=b.length-1;L>=0;L--)(D=b[L])&&(M=(A<3?D(M):A>3?D(E,O,M):D(E,O))||M);return A>3&&M&&Object.defineProperty(E,O,M),M},g=this&&this.__param||function(b,E){return function(O,R){E(O,R,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),S=c(8460),w=c(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:b=>b.button!==4&&b.action===1&&(b.ctrl=!1,b.alt=!1,b.shift=!1,!0)},VT200:{events:19,restrict:b=>b.action!==32},DRAG:{events:23,restrict:b=>b.action!==32||b.button!==3},ANY:{events:31,restrict:b=>!0}};function k(b,E){let O=(b.ctrl?16:0)|(b.shift?4:0)|(b.alt?8:0);return b.button===4?(O|=64,O|=b.action):(O|=3&b.button,4&b.button&&(O|=64),8&b.button&&(O|=128),b.action===32?O|=32:b.action!==0||E||(O|=3)),O}const y=String.fromCharCode,_={DEFAULT:b=>{const E=[k(b,!1)+32,b.col+32,b.row+32];return E[0]>255||E[1]>255||E[2]>255?"":`\x1B[M${y(E[0])}${y(E[1])}${y(E[2])}`},SGR:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${k(b,!0)};${b.col};${b.row}${E}`},SGR_PIXELS:b=>{const E=b.action===0&&b.button!==4?"m":"M";return`\x1B[<${k(b,!0)};${b.x};${b.y}${E}`}};let v=o.CoreMouseService=class extends w.Disposable{constructor(b,E){super(),this._bufferService=b,this._coreService=E,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new S.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const O of Object.keys(T))this.addProtocol(O,T[O]);for(const O of Object.keys(_))this.addEncoding(O,_[O]);this.reset()}addProtocol(b,E){this._protocols[b]=E}addEncoding(b,E){this._encodings[b]=E}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(b){if(!this._protocols[b])throw new Error(`unknown protocol "${b}"`);this._activeProtocol=b,this._onProtocolChange.fire(this._protocols[b].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(b){if(!this._encodings[b])throw new Error(`unknown encoding "${b}"`);this._activeEncoding=b}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(b){if(b.col<0||b.col>=this._bufferService.cols||b.row<0||b.row>=this._bufferService.rows||b.button===4&&b.action===32||b.button===3&&b.action!==32||b.button!==4&&(b.action===2||b.action===3)||(b.col++,b.row++,b.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,b,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(b))return!1;const E=this._encodings[this._activeEncoding](b);return E&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(E):this._coreService.triggerDataEvent(E,!0)),this._lastEvent=b,!0}explainEvents(b){return{down:!!(1&b),up:!!(2&b),drag:!!(4&b),move:!!(8&b),wheel:!!(16&b)}}_equalEvents(b,E,O){if(O){if(b.x!==E.x||b.y!==E.y)return!1}else if(b.col!==E.col||b.row!==E.row)return!1;return b.button===E.button&&b.action===E.action&&b.ctrl===E.ctrl&&b.alt===E.alt&&b.shift===E.shift}};o.CoreMouseService=v=u([g(0,h.IBufferService),g(1,h.ICoreService)],v)},6975:function(f,o,c){var u=this&&this.__decorate||function(v,b,E,O){var R,D=arguments.length,A=D<3?b:O===null?O=Object.getOwnPropertyDescriptor(b,E):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(v,b,E,O);else for(var M=v.length-1;M>=0;M--)(R=v[M])&&(A=(D<3?R(A):D>3?R(b,E,A):R(b,E))||A);return D>3&&A&&Object.defineProperty(b,E,A),A},g=this&&this.__param||function(v,b){return function(E,O){b(E,O,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),S=c(8460),w=c(844),T=c(2585),k=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let _=o.CoreService=class extends w.Disposable{constructor(v,b,E){super(),this._bufferService=v,this._logService=b,this._optionsService=E,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new S.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new S.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new S.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new S.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(y)}reset(){this.modes=(0,h.clone)(k),this.decPrivateModes=(0,h.clone)(y)}triggerDataEvent(v,b=!1){if(this._optionsService.rawOptions.disableStdin)return;const E=this._bufferService.buffer;b&&this._optionsService.rawOptions.scrollOnUserInput&&E.ybase!==E.ydisp&&this._onRequestScrollToBottom.fire(),b&&this._onUserInput.fire(),this._logService.debug(`sending data "${v}"`,(()=>v.split("").map((O=>O.charCodeAt(0))))),this._onData.fire(v)}triggerBinaryEvent(v){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${v}"`,(()=>v.split("").map((b=>b.charCodeAt(0))))),this._onBinary.fire(v))}};o.CoreService=_=u([g(0,T.IBufferService),g(1,T.ILogService),g(2,T.IOptionsService)],_)},9074:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const u=c(8055),g=c(8460),h=c(844),S=c(6106);let w=0,T=0;class k extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new S.SortedList((v=>v==null?void 0:v.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(v){if(v.marker.isDisposed)return;const b=new y(v);if(b){const E=b.marker.onDispose((()=>b.dispose()));b.onDispose((()=>{b&&(this._decorations.delete(b)&&this._onDecorationRemoved.fire(b),E.dispose())})),this._decorations.insert(b),this._onDecorationRegistered.fire(b)}return b}reset(){for(const v of this._decorations.values())v.dispose();this._decorations.clear()}*getDecorationsAtCell(v,b,E){let O=0,R=0;for(const D of this._decorations.getKeyIterator(b))O=D.options.x??0,R=O+(D.options.width??1),v>=O&&v<R&&(!E||(D.options.layer??"bottom")===E)&&(yield D)}forEachDecorationAtCell(v,b,E,O){this._decorations.forEachByKey(b,(R=>{w=R.options.x??0,T=w+(R.options.width??1),v>=w&&v<T&&(!E||(R.options.layer??"bottom")===E)&&O(R)}))}}o.DecorationService=k;class y extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=u.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=u.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(v){super(),this.options=v,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=v.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const u=c(2585),g=c(8343);class h{constructor(...w){this._entries=new Map;for(const[T,k]of w)this.set(T,k)}set(w,T){const k=this._entries.get(w);return this._entries.set(w,T),k}forEach(w){for(const[T,k]of this._entries.entries())w(T,k)}has(w){return this._entries.has(w)}get(w){return this._entries.get(w)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(u.IInstantiationService,this)}setService(S,w){this._services.set(S,w)}getService(S){return this._services.get(S)}createInstance(S,...w){const T=(0,g.getServiceDependencies)(S).sort(((_,v)=>_.index-v.index)),k=[];for(const _ of T){const v=this._services.get(_.id);if(!v)throw new Error(`[createInstance] ${S.name} depends on UNKNOWN service ${_.id}.`);k.push(v)}const y=T.length>0?T[0].index:w.length;if(w.length!==y)throw new Error(`[createInstance] First service dependency of ${S.name} at position ${y+1} conflicts with ${w.length} static arguments`);return new S(...w,...k)}}},7866:function(f,o,c){var u=this&&this.__decorate||function(y,_,v,b){var E,O=arguments.length,R=O<3?_:b===null?b=Object.getOwnPropertyDescriptor(_,v):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(y,_,v,b);else for(var D=y.length-1;D>=0;D--)(E=y[D])&&(R=(O<3?E(R):O>3?E(_,v,R):E(_,v))||R);return O>3&&R&&Object.defineProperty(_,v,R),R},g=this&&this.__param||function(y,_){return function(v,b){_(v,b,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),S=c(2585),w={trace:S.LogLevelEnum.TRACE,debug:S.LogLevelEnum.DEBUG,info:S.LogLevelEnum.INFO,warn:S.LogLevelEnum.WARN,error:S.LogLevelEnum.ERROR,off:S.LogLevelEnum.OFF};let T,k=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=S.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=w[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let _=0;_<y.length;_++)typeof y[_]=="function"&&(y[_]=y[_]())}_log(y,_,v){this._evalLazyOptionalParams(v),y.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+_,...v)}trace(y,..._){var v;this._logLevel<=S.LogLevelEnum.TRACE&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.trace.bind(this._optionsService.options.logger))??console.log,y,_)}debug(y,..._){var v;this._logLevel<=S.LogLevelEnum.DEBUG&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.debug.bind(this._optionsService.options.logger))??console.log,y,_)}info(y,..._){var v;this._logLevel<=S.LogLevelEnum.INFO&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.info.bind(this._optionsService.options.logger))??console.info,y,_)}warn(y,..._){var v;this._logLevel<=S.LogLevelEnum.WARN&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.warn.bind(this._optionsService.options.logger))??console.warn,y,_)}error(y,..._){var v;this._logLevel<=S.LogLevelEnum.ERROR&&this._log(((v=this._optionsService.options.logger)==null?void 0:v.error.bind(this._optionsService.options.logger))??console.error,y,_)}};o.LogService=k=u([g(0,S.IOptionsService)],k),o.setTraceLogger=function(y){T=y},o.traceCall=function(y,_,v){if(typeof v.value!="function")throw new Error("not supported");const b=v.value;v.value=function(...E){if(T.logLevel!==S.LogLevelEnum.TRACE)return b.apply(this,E);T.trace(`GlyphRenderer#${b.name}(${E.map((R=>JSON.stringify(R))).join(", ")})`);const O=b.apply(this,E);return T.trace(`GlyphRenderer#${b.name} return`,O),O}}},7302:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const u=c(8460),g=c(844),h=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const S=["normal","bold","100","200","300","400","500","600","700","800","900"];class w extends g.Disposable{constructor(k){super(),this._onOptionChange=this.register(new u.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const _ in k)if(_ in y)try{const v=k[_];y[_]=this._sanitizeAndValidateOption(_,v)}catch(v){console.error(v)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(k,y){return this.onOptionChange((_=>{_===k&&y(this.rawOptions[k])}))}onMultipleOptionChange(k,y){return this.onOptionChange((_=>{k.indexOf(_)!==-1&&y()}))}_setupOptions(){const k=_=>{if(!(_ in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);return this.rawOptions[_]},y=(_,v)=>{if(!(_ in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${_}"`);v=this._sanitizeAndValidateOption(_,v),this.rawOptions[_]!==v&&(this.rawOptions[_]=v,this._onOptionChange.fire(_))};for(const _ in this.rawOptions){const v={get:k.bind(this,_),set:y.bind(this,_)};Object.defineProperty(this.options,_,v)}}_sanitizeAndValidateOption(k,y){switch(k){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[k]),!(function(_){return _==="block"||_==="underline"||_==="bar"})(y))throw new Error(`"${y}" is not a valid value for ${k}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[k]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=S.includes(y)?y:o.DEFAULT_OPTIONS[k];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${k} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${k} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${k} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${k} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=w},2660:function(f,o,c){var u=this&&this.__decorate||function(w,T,k,y){var _,v=arguments.length,b=v<3?T:y===null?y=Object.getOwnPropertyDescriptor(T,k):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(w,T,k,y);else for(var E=w.length-1;E>=0;E--)(_=w[E])&&(b=(v<3?_(b):v>3?_(T,k,b):_(T,k))||b);return v>3&&b&&Object.defineProperty(T,k,b),b},g=this&&this.__param||function(w,T){return function(k,y){T(k,y,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let S=o.OscLinkService=class{constructor(w){this._bufferService=w,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(w){const T=this._bufferService.buffer;if(w.id===void 0){const E=T.addMarker(T.ybase+T.y),O={data:w,id:this._nextId++,lines:[E]};return E.onDispose((()=>this._removeMarkerFromLink(O,E))),this._dataByLinkId.set(O.id,O),O.id}const k=w,y=this._getEntryIdKey(k),_=this._entriesWithId.get(y);if(_)return this.addLineToLink(_.id,T.ybase+T.y),_.id;const v=T.addMarker(T.ybase+T.y),b={id:this._nextId++,key:this._getEntryIdKey(k),data:k,lines:[v]};return v.onDispose((()=>this._removeMarkerFromLink(b,v))),this._entriesWithId.set(b.key,b),this._dataByLinkId.set(b.id,b),b.id}addLineToLink(w,T){const k=this._dataByLinkId.get(w);if(k&&k.lines.every((y=>y.line!==T))){const y=this._bufferService.buffer.addMarker(T);k.lines.push(y),y.onDispose((()=>this._removeMarkerFromLink(k,y)))}}getLinkData(w){var T;return(T=this._dataByLinkId.get(w))==null?void 0:T.data}_getEntryIdKey(w){return`${w.id};;${w.uri}`}_removeMarkerFromLink(w,T){const k=w.lines.indexOf(T);k!==-1&&(w.lines.splice(k,1),w.lines.length===0&&(w.data.id!==void 0&&this._entriesWithId.delete(w.key),this._dataByLinkId.delete(w.id)))}};o.OscLinkService=S=u([g(0,h.IBufferService)],S)},8343:(f,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",u="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[u]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const h=function(S,w,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(k,y,_){y[c]===y?y[u].push({id:k,index:_}):(y[u]=[{id:k,index:_}],y[c]=y)})(h,S,T)};return h.toString=()=>g,o.serviceRegistry.set(g,h),h}},2585:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const u=c(8343);var g;o.IBufferService=(0,u.createDecorator)("BufferService"),o.ICoreMouseService=(0,u.createDecorator)("CoreMouseService"),o.ICoreService=(0,u.createDecorator)("CoreService"),o.ICharsetService=(0,u.createDecorator)("CharsetService"),o.IInstantiationService=(0,u.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(g||(o.LogLevelEnum=g={})),o.ILogService=(0,u.createDecorator)("LogService"),o.IOptionsService=(0,u.createDecorator)("OptionsService"),o.IOscLinkService=(0,u.createDecorator)("OscLinkService"),o.IUnicodeService=(0,u.createDecorator)("UnicodeService"),o.IDecorationService=(0,u.createDecorator)("DecorationService")},1480:(f,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const u=c(8460),g=c(225);class h{static extractShouldJoin(w){return(1&w)!=0}static extractWidth(w){return w>>1&3}static extractCharKind(w){return w>>3}static createPropertyValue(w,T,k=!1){return(16777215&w)<<3|(3&T)<<1|(k?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new u.EventEmitter,this.onChange=this._onChange.event;const w=new g.UnicodeV6;this.register(w),this._active=w.version,this._activeProvider=w}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(w){if(!this._providers[w])throw new Error(`unknown Unicode version "${w}"`);this._active=w,this._activeProvider=this._providers[w],this._onChange.fire(w)}register(w){this._providers[w.version]=w}wcwidth(w){return this._activeProvider.wcwidth(w)}getStringCellWidth(w){let T=0,k=0;const y=w.length;for(let _=0;_<y;++_){let v=w.charCodeAt(_);if(55296<=v&&v<=56319){if(++_>=y)return T+this.wcwidth(v);const O=w.charCodeAt(_);56320<=O&&O<=57343?v=1024*(v-55296)+O-56320+65536:T+=this.wcwidth(O)}const b=this.charProperties(v,k);let E=h.extractWidth(b);h.extractShouldJoin(b)&&(E-=h.extractWidth(k)),T+=E,k=b}return T}charProperties(w,T){return this._activeProvider.charProperties(w,T)}}o.UnicodeService=h}},l={};function d(f){var o=l[f];if(o!==void 0)return o.exports;var c=l[f]={exports:{}};return s[f].call(c.exports,c,c.exports,d),c.exports}var m={};return(()=>{var f=m;Object.defineProperty(f,"__esModule",{value:!0}),f.Terminal=void 0;const o=d(9042),c=d(3236),u=d(844),g=d(5741),h=d(8285),S=d(7975),w=d(7090),T=["cols","rows"];class k extends u.Disposable{constructor(_){super(),this._core=this.register(new c.Terminal(_)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const v=E=>this._core.options[E],b=(E,O)=>{this._checkReadonlyOptions(E),this._core.options[E]=O};for(const E in this._core.options){const O={get:v.bind(this,E),set:b.bind(this,E)};Object.defineProperty(this._publicOptions,E,O)}}_checkReadonlyOptions(_){if(T.includes(_))throw new Error(`Option "${_}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new S.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new w.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const _=this._core.coreService.decPrivateModes;let v="none";switch(this._core.coreMouseService.activeProtocol){case"X10":v="x10";break;case"VT200":v="vt200";break;case"DRAG":v="drag";break;case"ANY":v="any"}return{applicationCursorKeysMode:_.applicationCursorKeys,applicationKeypadMode:_.applicationKeypad,bracketedPasteMode:_.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:v,originMode:_.origin,reverseWraparoundMode:_.reverseWraparound,sendFocusMode:_.sendFocus,wraparoundMode:_.wraparound}}get options(){return this._publicOptions}set options(_){for(const v in _)this._publicOptions[v]=_[v]}blur(){this._core.blur()}focus(){this._core.focus()}input(_,v=!0){this._core.input(_,v)}resize(_,v){this._verifyIntegers(_,v),this._core.resize(_,v)}open(_){this._core.open(_)}attachCustomKeyEventHandler(_){this._core.attachCustomKeyEventHandler(_)}attachCustomWheelEventHandler(_){this._core.attachCustomWheelEventHandler(_)}registerLinkProvider(_){return this._core.registerLinkProvider(_)}registerCharacterJoiner(_){return this._checkProposedApi(),this._core.registerCharacterJoiner(_)}deregisterCharacterJoiner(_){this._checkProposedApi(),this._core.deregisterCharacterJoiner(_)}registerMarker(_=0){return this._verifyIntegers(_),this._core.registerMarker(_)}registerDecoration(_){return this._checkProposedApi(),this._verifyPositiveIntegers(_.x??0,_.width??0,_.height??0),this._core.registerDecoration(_)}hasSelection(){return this._core.hasSelection()}select(_,v,b){this._verifyIntegers(_,v,b),this._core.select(_,v,b)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(_,v){this._verifyIntegers(_,v),this._core.selectLines(_,v)}dispose(){super.dispose()}scrollLines(_){this._verifyIntegers(_),this._core.scrollLines(_)}scrollPages(_){this._verifyIntegers(_),this._core.scrollPages(_)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(_){this._verifyIntegers(_),this._core.scrollToLine(_)}clear(){this._core.clear()}write(_,v){this._core.write(_,v)}writeln(_,v){this._core.write(_),this._core.write(`\r
59
- `,v)}paste(_){this._core.paste(_)}refresh(_,v){this._verifyIntegers(_,v),this._core.refresh(_,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return o}_verifyIntegers(..._){for(const v of _)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const v of _)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}f.Terminal=k})(),m})()))})(nh)),nh.exports}var AS=kS();class TS{constructor(r,s){Bm(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",m=>{var o,c,u;let f;try{f=JSON.parse(m.data)}catch(g){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${cl(g)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(u=s.onStatus)==null||u.call(s,f)}),this.socket.addEventListener("error",()=>{var m;(m=s.onError)==null||m.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function Po({sessionId:t,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),m=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(""),u=ee.useRef(""),g=ee.useRef(r),h=ee.useRef(s),[S,w]=ee.useState("idle");function T(_){w(_),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,w("idle")},1600)}async function k(){const _=f.current,v=Xm(_,c.current,u.current);if(!v){T("empty"),_==null||_.focus();return}T(await Jm(v)?"copied":"failed"),_==null||_.focus()}function y(_={}){const v=l.current,b=d.current,E=m.current,O=f.current;if(!v||!b||!E||!O)return!1;const R=v.getBoundingClientRect();return R.width<Zm||R.height<eg||(E.fit(),O.cols<tg||O.rows<ng)?!1:(b.resize(O.cols,O.rows),_.focus&&O.focus(),!0)}return ee.useEffect(()=>{h.current=s},[s]),ee.useEffect(()=>{g.current=r},[r]),ee.useEffect(()=>{var W;if(!l.current)return;const _=new AS.Terminal({cursorBlink:!0,convertEol:!0,drawBoldTextInBrightColors:!0,fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.35,macOptionIsMeta:!0,scrollback:1e4,theme:OS}),v=new wS.FitAddon;_.loadAddon(v),_.loadAddon(new ES.WebLinksAddon),_.open(l.current),f.current=_,m.current=v;const b=_.onSelectionChange(()=>{const K=_.getSelection();K&&(c.current=K,u.current="")}),E=_.parser.registerOscHandler(52,K=>{const V=MS(K);return V?(u.current=V,b_(V).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),O=K=>{const V=Xm(_,c.current,u.current);!V||!K.clipboardData||(K.clipboardData.setData("text/plain",V),K.preventDefault(),T("copied"))};(W=_.element)==null||W.addEventListener("copy",O),_.attachCustomKeyEventHandler(K=>{if(!DS(K))return!0;const V=_.getSelection()||c.current;return V?(K.preventDefault(),K.stopPropagation(),Jm(V).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const R=l.current.getBoundingClientRect();R.width>=Zm&&R.height>=eg&&v.fit();const D=new TS(t,{onOutput(K){_.write(K)},onStatus(K){var V;(V=h.current)==null||V.call(h,K.type)},onError(K){var V;_.writeln(`\r
60
- [VCM] ${K}`),(V=h.current)==null||V.call(h,K)}});d.current=D,_.cols>=tg&&_.rows>=ng&&D.resize(_.cols,_.rows);const A=_.onData(K=>{D.sendInput(K)});let M=0,L=0,H=0;const U=()=>{M&&window.cancelAnimationFrame(M),M=window.requestAnimationFrame(()=>{M=0,y({focus:g.current})})},P=new ResizeObserver(()=>{U()});return P.observe(l.current),L=window.requestAnimationFrame(U),H=window.setTimeout(U,120),()=>{var K;M&&window.cancelAnimationFrame(M),L&&window.cancelAnimationFrame(L),H&&window.clearTimeout(H),P.disconnect(),(K=_.element)==null||K.removeEventListener("copy",O),b.dispose(),E.dispose(),A.dispose(),D.close(),_.dispose(),d.current=null,f.current=null,m.current=null}},[t]),ee.useEffect(()=>{if(!r)return;const _=[],v=[];return _.push(window.requestAnimationFrame(()=>{y({focus:!0}),_.push(window.requestAnimationFrame(()=>y({focus:!0})))})),v.push(window.setTimeout(()=>y({focus:!0}),160)),v.push(window.setTimeout(()=>y({focus:!0}),360)),()=>{for(const b of _)window.cancelAnimationFrame(b);for(const b of v)window.clearTimeout(b)}},[r]),ee.useEffect(()=>{const _=()=>{g.current&&y()};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),ee.useEffect(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),C.jsxs("div",{className:"terminal-frame-shell",children:[C.jsx("div",{className:"terminal-frame",ref:l,onClick:()=>{var _;return(_=f.current)==null?void 0:_.focus()}}),C.jsx("button",{type:"button",className:`terminal-copy-button is-${S}`,title:"Copy selected terminal text",onMouseDown:Qm,onPointerDown:Qm,onClick:()=>void k(),children:RS(S)})]})}function RS(t){return t==="copied"?"Copied":t==="empty"?"No selection":t==="failed"?"Copy failed":t==="ready"?"Copy ready":"Copy"}function Xm(t,r,s){return(t==null?void 0:t.getSelection())||s||r}function DS(t){return t.type==="keydown"&&t.metaKey&&!t.ctrlKey&&!t.altKey&&t.key.toLowerCase()==="c"}function MS(t){const r=t.split(";"),s=r.length>=2?r.slice(1).join(";"):"";if(!s||s==="?")return null;try{const l=window.atob(s),d=new Uint8Array(l.length);for(let m=0;m<l.length;m+=1)d[m]=l.charCodeAt(m);return new TextDecoder().decode(d)}catch{return null}}function Qm(t){t.preventDefault(),t.stopPropagation()}async function Jm(t){return await b_(t)?!0:LS(t)}async function b_(t){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(t),!0}catch{return!1}return!1}function LS(t){const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}finally{r.remove()}}const Zm=160,eg=80,tg=20,ng=5,OS={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"};function jn({status:t}){return C.jsx("span",{className:`status-badge status-${t}`,children:t.replaceAll("_"," ")})}function Uh({role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m=v_(),busy:f=!1,onPermissionModeChange:o,onModelChange:c,onEffortChange:u,onStart:g,onResume:h,onStop:S,onRestart:w,onNotifyHarnessUpdated:T}){const k=(r==null?void 0:r.status)==="running",y=!!(r!=null&&r.claudeSessionId&&!k),_=!k&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated),b=m.find(E=>E.value===l);return C.jsxs("div",{className:"session-controls",children:[C.jsxs("label",{className:"session-option-field permission-mode-field",children:[C.jsx("span",{children:"Permission"}),C.jsx("select",{value:s,onChange:E=>o(E.target.value),children:__.map(E=>C.jsx("option",{value:E.value,children:E.label},E.value))})]}),C.jsxs("label",{className:"session-option-field model-field",children:[C.jsx("span",{children:"Model"}),C.jsx("select",{value:l,title:b!=null&&b.available?b.description:b==null?void 0:b.unavailableReason,onChange:E=>c(E.target.value),children:m.map(E=>C.jsx("option",{value:E.value,disabled:!E.available,title:E.available?E.description:E.unavailableReason,children:E.label},E.value))})]}),C.jsxs("label",{className:"session-option-field effort-field",children:[C.jsx("span",{children:"Effort"}),C.jsx("select",{value:d,onChange:E=>u(E.target.value),children:y_.map(E=>C.jsx("option",{value:E.value,children:E.label},E.value))})]}),C.jsxs("div",{className:"session-toolbar",children:[C.jsx("button",{type:"button",disabled:f||!_,onClick:g,children:"Start"}),C.jsx("button",{type:"button",disabled:f||!y,onClick:h,children:"Resume"}),C.jsx("button",{type:"button",disabled:f||!r,onClick:w,children:"Restart"}),C.jsx("button",{type:"button",disabled:f||!r,onClick:S,children:"Stop"})]}),v?C.jsxs("div",{className:"session-harness-notice",children:[C.jsx(jn,{status:"outdated"}),C.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),C.jsx("button",{type:"button",disabled:f||!k||!T,onClick:T,children:"Notify role"})]}):null]})}function BS({busy:t,effort:r,model:s,modelOptions:l,open:d,permissionMode:m,taskSlug:f,bootstrapStatus:o,engineerSession:c,status:u,feedbackState:g,memoryState:h,onClose:S,onEffortChange:w,onModelChange:T,onPermissionModeChange:k,onEngineerResume:y,onEngineerRestart:_,onEngineerStart:v,onEngineerStop:b,onEngineerNotifyHarnessUpdated:E,onSendFeedback:O,onOpenRepositoryDiff:R,onReviewTaskHarness:D,onRefresh:A,onMemoryStateChange:M}){var jt;const[L,H]=ee.useState(null),[U,P]=ee.useState(!1),[W,K]=ee.useState(null),[V,Y]=ee.useState(""),[te,z]=ee.useState(!1),[j,N]=ee.useState(!1),[,q]=Ii(null),[I,ie]=ee.useState(null),pe=(u==null?void 0:u.files)??[],ge=pe.filter(re=>re.kind.startsWith("agent-")),Q=ge.filter(re=>ig(re)),$=ge.filter(re=>!ig(re)),he=pe.filter(re=>re.kind.startsWith("skill-")),le=pe.filter(re=>re.kind.startsWith("tool-")),xe=pe.filter(re=>re.kind==="root-claude"||re.kind==="gitignore"||re.kind==="pull-request-template"),Ce=!!(W&&V!==W.content);ee.useEffect(()=>{d||(H(null),P(!1),K(null),Y(""),z(!1),q(null))},[pe,d,L]),ee.useEffect(()=>{if(!d||!L||!f||L.startsWith("memory-review:"))return;let re=!1;return N(!0),q(null),z(!1),(U?ye.getMemoryFileContent(f,L).then(ke=>({path:ke.path,title:ke.title,content:ke.content,editable:ke.editable,source:"memory"})):ye.getHarnessFileContent(f,L).then(ke=>({path:ke.path,title:ke.title,content:ke.content,editable:ke.editable,readonlyReason:ke.readonlyReason,source:"harness"}))).then(ke=>{re||(K(ke),Y(ke.content))}).catch(ke=>{re||q(lt(`Load harness file ${L}`,ke))}).finally(()=>{re||N(!1)}),()=>{re=!0}},[d,U,L,f]);async function Le(){if(!(!W||!W.editable||!Ce||!f)){N(!0),q(null);try{if(W.source==="memory"){const re=await ye.updateMemoryFileContent(f,W.path,{content:V}),ve=await ye.getMemoryFileContent(f,W.path);K({path:ve.path,title:ve.title,content:ve.content,editable:!0,source:"memory"}),Y(ve.content),M(re)}else{const re=await ye.updateHarnessFileContent(f,W.path,{content:V});K({path:re.file.path,title:re.file.title,content:re.file.content,editable:re.file.editable,readonlyReason:re.file.readonlyReason,source:"harness"}),Y(re.file.content)}z(!1),A()}catch(re){q(lt(`Save harness file ${W.path}`,re))}finally{N(!1)}}}function Ie(){H(null),P(!1),K(null),Y(""),z(!1),q(null)}async function He(re){q(null);try{await PS(re),ie(re),window.setTimeout(()=>{ie(ve=>ve===re?null:ve)},1200)}catch(ve){q(lt(`Copy harness file path ${re}`,ve))}}function $e(re){const ve=`memory-review:${re.runId}`;H(ve),P(!1),K({path:re.runId,title:`Memory Diff: ${re.runId}`,content:re.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${re.source}. Status: ${re.status}.`,source:"memory-diff"}),Y(re.diff||"No memory diff was recorded."),z(!1)}async function De(re){if(!(!f||!re.canRevert||!window.confirm(`Revert memory changes from ${re.runId}?`))){N(!0),q(null);try{const ve=await ye.revertMemoryRun({taskSlug:f,runId:re.runId});M(ve),Ie()}catch(ve){q(lt(`Revert memory review ${re.runId}`,ve))}finally{N(!1)}}}async function Ct(){if(f){N(!0),q(null);try{M(await ye.retryMemoryReview({taskSlug:f}))}catch(re){q(lt("Retry Auto Memory review",re))}finally{N(!1)}}}async function Rt(re){if(f){N(!0),q(null);try{M(await ye.retryDurableDocAssignment({taskSlug:f,assignmentId:re.id}))}catch(ve){q(lt(`Retry durable document assignment ${re.id}`,ve))}finally{N(!1)}}}return d?C.jsx(C.Fragment,{children:C.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:C.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[C.jsxs("header",{className:"harness-studio-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Harness Studio"}),f?null:C.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),C.jsxs("div",{className:"harness-studio-header-actions",children:[C.jsx("button",{type:"button",disabled:t||!f,onClick:D,children:"Review Task Harness"}),C.jsx("button",{type:"button",disabled:t,onClick:R,children:"Review Diff"}),C.jsx("button",{type:"button",disabled:t,onClick:A,children:"Refresh"}),C.jsx("button",{type:"button",onClick:S,children:"Close"})]})]}),C.jsxs("div",{className:"harness-studio-layout",children:[C.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?C.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[C.jsxs("header",{className:"harness-studio-file-editor-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:(W==null?void 0:W.title)??"Harness File"}),C.jsx("p",{className:"muted",children:(W==null?void 0:W.path)??L})]}),C.jsxs("div",{className:"harness-studio-file-editor-actions",children:[W?C.jsx(jn,{status:W.editable?"ok":"unknown"}):null,te?C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",disabled:j||!f||!(W!=null&&W.editable)||!Ce,onClick:()=>void Le(),children:"Save"}),C.jsx("button",{type:"button",disabled:j,onClick:()=>{Y((W==null?void 0:W.content)??""),z(!1)},children:"Cancel"})]}):C.jsx("button",{type:"button",disabled:j||!f||!(W!=null&&W.editable),onClick:()=>z(!0),children:"Edit"}),C.jsx("button",{type:"button",onClick:Ie,children:"Return"})]})]}),W!=null&&W.readonlyReason?C.jsx("p",{className:"muted",children:W.readonlyReason}):null,C.jsx("textarea",{className:te?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:V,spellCheck:!1,readOnly:!te,disabled:j,onChange:re=>Y(re.target.value)})]}):C.jsxs("div",{className:"harness-studio-left-scroll",children:[C.jsx(Wa,{title:"VCM Roles",files:Q,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)}}),C.jsx(Wa,{title:"Auxiliary Roles",files:$,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)}}),C.jsx(NS,{state:h,busy:j,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!0),H(re)},onViewDiff:$e,onRevert:re=>void De(re),onRetry:()=>void Ct(),onRetryAssignment:re=>void Rt(re)}),C.jsx(jS,{state:g,busy:t,taskSlug:f,onSend:O}),C.jsx(Gs,{title:"Overview",children:C.jsxs("section",{className:"harness-studio-overview",children:[C.jsxs("div",{className:"harness-studio-metrics",children:[C.jsx(Vr,{label:"Fixed install",value:u?u.initialized?u.needsApply?"updates":"current":"new":"unknown"}),C.jsx(Vr,{label:"Revision",value:String((u==null?void 0:u.harnessRevision)??0)}),C.jsx(Vr,{label:"Managed files",value:String(pe.length)}),C.jsx(Vr,{label:"Pending updates",value:String((u==null?void 0:u.plannedChanges.length)??0)}),C.jsx(Vr,{label:"Bootstrap",value:(o==null?void 0:o.status.replaceAll("_"," "))??"unknown"}),C.jsx(Vr,{label:"Code intelligence",value:HS(u)}),C.jsx(Vr,{label:"Engineer",value:rg(c)})]}),u!=null&&u.warnings.length?C.jsx("ul",{className:"warnings",children:u.warnings.map(re=>C.jsx("li",{children:re},re))}):null]})}),C.jsx(Gs,{title:"Code Intelligence",children:C.jsx("ul",{className:"harness-studio-doc-list harness-studio-code-intelligence-list",children:(jt=u==null?void 0:u.codeIntelligence)!=null&&jt.languages.length?u.codeIntelligence.languages.map(re=>C.jsxs("li",{children:[C.jsx("span",{children:re.label}),C.jsx("code",{title:"Language server",children:re.serverCommand}),C.jsx("code",{title:re.pluginReady?"VCM Claude Code plugin ready":"VCM Claude Code plugin missing",children:re.pluginName}),C.jsx(jn,{status:re.state==="server_runnable"?"ok":re.state==="server_failed"?"failed":"missing"}),C.jsx("span",{className:"harness-studio-code-intelligence-detail",children:re.error??"Server runnable; workspace readiness is checked in each role session."})]},re.language)):C.jsx("li",{children:C.jsx("span",{children:"No supported project language detected."})})})}),C.jsx(Wa,{title:"Skills",files:he,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Wa,{title:"Root Context",files:xe,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Wa,{title:"Tools",files:le,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Gs,{title:"Project Docs",children:C.jsx("ul",{className:"harness-studio-doc-list",children:(o==null?void 0:o.checks.map(re=>C.jsxs("li",{children:[C.jsx("span",{children:re.path??re.label}),C.jsx(jn,{status:re.status})]},re.key)))??C.jsx("li",{children:C.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),C.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[C.jsxs("div",{className:"harness-studio-engineer-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:"Harness Engineer"}),C.jsx("p",{className:"muted",children:rg(c)})]}),C.jsx(jn,{status:(c==null?void 0:c.status)??"unknown"})]}),C.jsx(Uh,{role:"harness-engineer",session:c??void 0,permissionMode:m,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:k,onModelChange:T,onEffortChange:w,onStart:v,onResume:y,onRestart:_,onStop:b,onNotifyHarnessUpdated:E}),C.jsx("div",{className:"harness-engineer-terminal",children:(c==null?void 0:c.status)==="running"?C.jsx(Po,{sessionId:c.id,active:d},c.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"harness-engineer"}),C.jsx("span",{children:c!=null&&c.claudeSessionId?"Resume this task Harness Engineer session.":"Start this task Harness Engineer session."})]})})]})]})]})})}):null}function Vr({label:t,value:r}){return C.jsxs("div",{className:"harness-studio-metric",children:[C.jsx("span",{children:t}),C.jsx("strong",{children:r})]})}function jS({state:t,busy:r,taskSlug:s,onSend:l}){return C.jsx(Gs,{title:`Harness Feedback Inbox (${(t==null?void 0:t.queuedCount)??0})`,children:C.jsx("ul",{className:"harness-studio-doc-list",children:t!=null&&t.pending.length?t.pending.map(d=>C.jsxs("li",{children:[C.jsx("span",{title:d.path,children:d.title}),C.jsx("code",{children:d.reporterRole??"unknown"}),C.jsx("button",{type:"button",title:"Send this feedback to Harness Engineer",disabled:r||!s,onClick:()=>l(d.path),children:"Send"})]},d.path)):C.jsx("li",{children:C.jsx("span",{children:"No pending harness feedback."})})})})}function Wa({title:t,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:m,collapsible:f=!1}){const o=C.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>C.jsxs("li",{className:c.path===s?"selected":void 0,children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>m(c.path),children:c.path}),C.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),C.jsx(jn,{status:c.action})]},c.path)):C.jsx("li",{children:C.jsx("span",{children:"No files."})})});return f?C.jsx(Gs,{title:t,children:o}):C.jsxs("section",{className:"harness-studio-section",children:[C.jsx("h3",{children:t}),o]})}function NS({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:m,onRevert:f,onRetry:o,onRetryAssignment:c}){var g,h,S;const u=(g=t==null?void 0:t.active)!=null&&g.assignments.length?t.active.assignments:(t==null?void 0:t.runs.flatMap(w=>w.assignments))??[];return C.jsxs(Gs,{title:"Memory",children:[C.jsxs("div",{className:"harness-memory-status",children:[C.jsx("span",{children:"Status"}),C.jsx(jn,{status:IS(t==null?void 0:t.status)}),(h=t==null?void 0:t.active)!=null&&h.currentRole?C.jsxs("span",{className:"muted",children:["Collecting ",t.active.currentRole]}):null,(S=t==null?void 0:t.active)!=null&&S.error?C.jsx("p",{className:"warnings",children:t.active.error}):null,(t==null?void 0:t.status)==="failed"?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:o,children:"Retry"}):null]}),C.jsx("ol",{className:"harness-studio-file-list",children:(t==null?void 0:t.files.map(w=>C.jsxs("li",{children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:w.path,onClick:()=>d(w.path),children:w.path}),C.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${w.path}`,onClick:()=>l(w.path),children:s===w.path?"Copied":"Copy"}),C.jsx("span",{className:"muted",children:zS(w.sizeBytes)})]},w.path)))??C.jsx("li",{children:C.jsx("span",{children:"No memory files."})})}),u.length?C.jsxs("div",{className:"harness-memory-runs",children:[C.jsx("h4",{children:"Durable Documentation"}),C.jsx("ol",{className:"harness-studio-file-list",children:u.map(w=>C.jsxs("li",{children:[C.jsx("span",{className:"harness-studio-file-path-button",title:w.id,children:w.targetPath}),C.jsx("code",{children:w.owner??"PM"}),C.jsx(jn,{status:US(w.status)}),w.status==="failed"?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,title:w.error,onClick:()=>c(w),children:"Retry"}):null]},w.id))})]}):null,t!=null&&t.runs.length?C.jsxs("div",{className:"harness-memory-runs",children:[C.jsx("h4",{children:"Applied History"}),C.jsx("ol",{className:"harness-studio-file-list",children:t.runs.map(w=>C.jsxs("li",{children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",onClick:()=>m(w),children:w.runId}),C.jsx(jn,{status:w.status==="applied"?"ok":w.status==="failed"?"failed":"unknown"}),w.canRevert?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:()=>f(w),children:"Revert"}):null]},w.runId))})]}):null]})}function Gs({title:t,children:r}){return C.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[C.jsxs("summary",{children:[C.jsx("h3",{children:t}),C.jsx("span",{children:"Show"})]}),C.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function ig(t){return t.kind==="agent-project-manager"||t.kind==="agent-architect"||t.kind==="agent-coder"||t.kind==="agent-tester"||t.kind==="agent-reviewer"}function rg(t){return t?t.status==="running"?`${t.status} / ${t.activityStatus??"idle"}`:t.status:"not started"}function HS(t){var r;return((r=t==null?void 0:t.codeIntelligence)==null?void 0:r.state.replaceAll("_"," "))??"unknown"}function zS(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function IS(t){return t==="collecting"||t==="reviewing"||t==="documenting"?"running":t==="failed"?"failed":t==="idle"?"ok":"unknown"}function US(t){return t==="completed"?"ok":t==="failed"?"failed":"running"}async function PS(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function FS({open:t,taskSlug:r,onClose:s}){var A;const[l,d]=ee.useState(null),[m,f]=ee.useState(null),[o,c]=ee.useState(null),[u,g]=ee.useState(null),[h,S]=ee.useState(null),[w,T]=ee.useState(!1),[k,y]=ee.useState(!1),[,_]=Ii(null),[v,b]=ee.useState(null),E=ee.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function O(M=m){var L;T(!0),_(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),g(null),f(((L=H.commit)==null?void 0:L.sha)??null),c(U=>{var P;return U&&H.files.some(W=>W.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){_(lt(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}ee.useEffect(()=>{t&&(f(null),b(null),O(null))},[t,r]);async function R(M){S(M),_(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const L=await ye.getRepositoryFileDiff(r,M);g(L),c(M)}catch(L){_(lt(`Load task file diff for ${M}`,L))}finally{S(null)}}async function D(){if(_(null),b(null),!r){_("Create or select a task before merging the task branch.");return}if(!l){_("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
61
- `))){y(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);b(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await O(null)}catch(H){_(lt("Merge task branch to connected repository branch",H))}finally{y(!1)}}}return t?C.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:C.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[C.jsxs("header",{className:"repository-diff-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Commit Diff"}),C.jsx("p",{children:l?`${((A=l.commit)==null?void 0:A.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),C.jsxs("div",{className:"repository-diff-header-actions",children:[C.jsxs("label",{className:"repository-diff-commit-picker",children:[C.jsx("span",{children:"Commit"}),C.jsx("select",{value:m??"",disabled:w||!(l!=null&&l.commits.length),onChange:M=>{const L=M.target.value||null;f(L),O(L)},children:l==null?void 0:l.commits.map(M=>C.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),C.jsx("button",{type:"button",disabled:w,onClick:()=>void O(),children:"Refresh"}),C.jsx("button",{type:"button",disabled:w||k||!r||!(l!=null&&l.commits.length),onClick:()=>void D(),children:k?"Merging...":"Merge to Main"}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),v?C.jsx("p",{className:"success-banner",children:v}):null,l!=null&&l.warnings.length?C.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(M=>C.jsx("li",{children:M},M))}):null,C.jsxs("div",{className:"repository-diff-body",children:[C.jsxs("aside",{className:"repository-diff-sidebar",children:[C.jsx(qS,{report:l,busy:w}),C.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(M=>C.jsx("li",{className:[(E==null?void 0:E.path)===M.path&&!u?"selected":"",(u==null?void 0:u.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:C.jsxs("div",{className:"repository-diff-file-row",children:[C.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{g(null),c(M.path)},children:[C.jsx("span",{children:M.path}),C.jsxs("small",{children:[Eh(M.status)," · ",sg(M.stage)," · ",xh(M.category)]})]}),C.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:h===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void R(M.path),children:h===M.path?"...":"Task diff"})]})},M.path)),l&&l.files.length===0?C.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),C.jsx("main",{className:"repository-diff-main",children:u?C.jsx($S,{diff:u,onClose:()=>g(null)}):E?C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"repository-diff-file-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:E.path}),C.jsxs("p",{children:[xh(E.category)," · ",Eh(E.status)," · ",sg(E.stage)]})]}),C.jsxs("span",{className:"repository-diff-stats",children:["+",E.additions," / -",E.deletions]})]}),E.binary?C.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,E.truncated?C.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,C.jsx("pre",{className:"repository-diff-code","aria-label":`${E.path} diff`,children:C_(E.diff)})]}):C.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function qS({report:t,busy:r}){var l;const s=t==null?void 0:t.summary;return C.jsxs("div",{className:"repository-diff-summary",children:[C.jsx("strong",{children:r?"Loading":t?"Commit changes":"Not loaded"}),s?C.jsxs(C.Fragment,{children:[C.jsxs("span",{children:[s.harnessFiles," harness files"]}),C.jsxs("span",{children:[s.productCodeFiles," product code files"]}),C.jsxs("span",{children:[s.committedFiles," committed files"]}),C.jsxs("span",{children:[(t==null?void 0:t.commits.length)??0," branch commits"]}),C.jsx("span",{children:((l=t==null?void 0:t.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function $S({diff:t,onClose:r}){const s=t.file;return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"repository-diff-file-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:t.path}),C.jsxs("p",{children:["Task diff · ",t.targetBranch," ",t.baseSha.slice(0,12)," → ",t.sourceBranch," worktree ",t.headSha.slice(0,12)]})]}),C.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?C.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,C.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),t.warnings.length>0?C.jsx("ul",{className:"warnings repository-diff-warnings",children:t.warnings.map(l=>C.jsx("li",{children:l},l))}):null,s?C.jsxs(C.Fragment,{children:[C.jsxs("p",{className:"muted",children:[xh(s.category)," · ",Eh(s.status)," · whole task comparison"]}),s.binary?C.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?C.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,C.jsx("pre",{className:"repository-diff-code","aria-label":`${t.path} task diff`,children:C_(s.diff)})]}):C.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function xh(t){switch(t){case"fixed_harness":return"fixed harness";case"tools_hooks":return"tools/hooks";case"generated_context":return"generated context";case"project_docs":return"project docs";case"product_code":return"product code"}}function sg(t){return t.replaceAll("_"," ")}function Eh(t){return t.replaceAll("_"," ")}function C_(t){return t.split(`
62
- `).filter(r=>!VS(r)).map((r,s)=>C.jsx("span",{className:`repository-diff-line ${GS(r)}`,children:r||" "},`${s}:${r}`))}function GS(t){return t.startsWith("+")&&!t.startsWith("+++")?"repository-diff-line-added":t.startsWith("-")&&!t.startsWith("---")?"repository-diff-line-deleted":t.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function VS(t){return t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("new file mode ")||t.startsWith("deleted file mode ")||t.startsWith("similarity index ")||t.startsWith("rename from ")||t.startsWith("rename to ")||t.startsWith("--- ")||t.startsWith("+++ ")}function WS({busy:t,effort:r,model:s,modelOptions:l,open:d,permissionMode:m,session:f,onClose:o,onEffortChange:c,onModelChange:u,onPermissionModeChange:g,onResume:h,onRestart:S,onStart:w,onStop:T,onNotifyHarnessUpdated:k}){return d?C.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:C.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[C.jsxs("header",{className:"translator-session-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Translator Session"}),C.jsx("p",{children:KS(f)})]}),C.jsx("button",{type:"button",onClick:o,children:"Close"})]}),C.jsx(Uh,{role:"translator",session:f??void 0,permissionMode:m,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:g,onModelChange:u,onEffortChange:c,onStart:w,onResume:h,onRestart:S,onStop:T,onNotifyHarnessUpdated:k}),C.jsx("div",{className:"translator-session-terminal",children:(f==null?void 0:f.status)==="running"?C.jsx(Po,{sessionId:f.id,active:d},f.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"translator"}),C.jsx("span",{children:f!=null&&f.claudeSessionId?"Resume this task translator session.":"Start the task translator session."})]})})]})}):null}function KS(t){if(!t)return"not started";const r=t.status==="running"?` · ${t.activityStatus??"idle"}`:"";return`${t.status}${r}`}function YS(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const XS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JS={};function ag(t,r){return(JS.jsx?QS:XS).test(t)}const ZS=/[ \t\n\f\r]/g;function e1(t){return typeof t=="object"?t.type==="text"?lg(t.value):!1:lg(t)}function lg(t){return t.replace(ZS,"")===""}class ul{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}ul.prototype.normal={};ul.prototype.property={};ul.prototype.space=void 0;function w_(t,r){const s={},l={};for(const d of t)Object.assign(s,d.property),Object.assign(l,d.normal);return new ul(s,l,r)}function kh(t){return t.toLowerCase()}class Cn{constructor(r,s){this.attribute=s,this.property=r}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let t1=0;const qe=Zr(),Bt=Zr(),Ah=Zr(),we=Zr(),gt=Zr(),Vs=Zr(),Bn=Zr();function Zr(){return 2**++t1}const Th=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:Bt,commaOrSpaceSeparated:Bn,commaSeparated:Vs,number:we,overloadedBoolean:Ah,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),ih=Object.keys(Th);class Ph extends Cn{constructor(r,s,l,d){let m=-1;if(super(r,s),og(this,"space",d),typeof l=="number")for(;++m<ih.length;){const f=ih[m];og(this,ih[m],(l&Th[f])===Th[f])}}}Ph.prototype.defined=!0;function og(t,r,s){s&&(t[r]=s)}function Ys(t){const r={},s={};for(const[l,d]of Object.entries(t.properties)){const m=new Ph(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(m.mustUseProperty=!0),r[l]=m,s[kh(l)]=l,s[kh(m.attribute)]=l}return new ul(r,s,t.space)}const x_=Ys({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:gt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:we,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:gt,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:Bt,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(t,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function E_(t,r){return r in t?t[r]:r}function k_(t,r){return E_(t,r.toLowerCase())}const n1=Ys({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vs,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:qe,allowPaymentRequest:qe,allowUserMedia:qe,alt:null,as:null,async:qe,autoCapitalize:null,autoComplete:gt,autoFocus:qe,autoPlay:qe,blocking:gt,capture:null,charSet:null,checked:qe,cite:null,className:gt,cols:we,colSpan:null,content:null,contentEditable:Bt,controls:qe,controlsList:gt,coords:we|Vs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:qe,defer:qe,dir:null,dirName:null,disabled:qe,download:Ah,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:qe,formTarget:null,headers:gt,height:we,hidden:Ah,high:we,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:qe,inputMode:null,integrity:null,is:null,isMap:qe,itemId:null,itemProp:gt,itemRef:gt,itemScope:qe,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:qe,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:qe,muted:qe,name:null,nonce:null,noModule:qe,noValidate:qe,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:qe,optimum:we,pattern:null,ping:gt,placeholder:null,playsInline:qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:qe,referrerPolicy:null,rel:gt,required:qe,reversed:qe,rows:we,rowSpan:we,sandbox:gt,scope:null,scoped:qe,seamless:qe,selected:qe,shadowRootClonable:qe,shadowRootDelegatesFocus:qe,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:qe,useMap:null,value:Bt,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:qe,declare:qe,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:qe,noHref:qe,noShade:qe,noWrap:qe,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:qe,disableRemotePlayback:qe,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:k_}),i1=Ys({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",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:Bn,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:gt,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:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,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:Vs,g2:Vs,glyphName:Vs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:Bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,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:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,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:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:Bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bn,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E_}),A_=Ys({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,r){return"xlink:"+r.slice(5).toLowerCase()}}),T_=Ys({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:k_}),R_=Ys({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),r1={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"},s1=/[A-Z]/g,cg=/-[a-z]/g,a1=/^data[-\w.:]+$/i;function l1(t,r){const s=kh(r);let l=r,d=Cn;if(s in t.normal)return t.property[t.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&a1.test(r)){if(r.charAt(4)==="-"){const m=r.slice(5).replace(cg,c1);l="data"+m.charAt(0).toUpperCase()+m.slice(1)}else{const m=r.slice(4);if(!cg.test(m)){let f=m.replace(s1,o1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Ph}return new d(l,r)}function o1(t){return"-"+t.toLowerCase()}function c1(t){return t.charAt(1).toUpperCase()}const u1=w_([x_,n1,A_,T_,R_],"html"),Fh=w_([x_,i1,A_,T_,R_],"svg");function h1(t){return t.join(" ").trim()}var Ps={},rh,ug;function f1(){if(ug)return rh;ug=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,m=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
63
- `,u="/",g="*",h="",S="comment",w="declaration";function T(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var v=1,b=1;function E(W){var K=W.match(r);K&&(v+=K.length);var V=W.lastIndexOf(c);b=~V?W.length-V:b+W.length}function O(){var W={line:v,column:b};return function(K){return K.position=new R(W),M(),K}}function R(W){this.start=W,this.end={line:v,column:b},this.source=_.source}R.prototype.content=y;function D(W){var K=new Error(_.source+":"+v+":"+b+": "+W);if(K.reason=W,K.filename=_.source,K.line=v,K.column=b,K.source=y,!_.silent)throw K}function A(W){var K=W.exec(y);if(K){var V=K[0];return E(V),y=y.slice(V.length),K}}function M(){A(s)}function L(W){var K;for(W=W||[];K=H();)K!==!1&&W.push(K);return W}function H(){var W=O();if(!(u!=y.charAt(0)||g!=y.charAt(1))){for(var K=2;h!=y.charAt(K)&&(g!=y.charAt(K)||u!=y.charAt(K+1));)++K;if(K+=2,h===y.charAt(K-1))return D("End of comment missing");var V=y.slice(2,K-2);return b+=2,E(V),y=y.slice(K),b+=2,W({type:S,comment:V})}}function U(){var W=O(),K=A(l);if(K){if(H(),!A(d))return D("property missing ':'");var V=A(m),Y=W({type:w,property:k(K[0].replace(t,h)),value:V?k(V[0].replace(t,h)):h});return A(f),Y}}function P(){var W=[];L(W);for(var K;K=U();)K!==!1&&(W.push(K),L(W));return W}return M(),P()}function k(y){return y?y.replace(o,h):h}return rh=T,rh}var hg;function d1(){if(hg)return Ps;hg=1;var t=Ps&&Ps.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=s;const r=t(f1());function s(l,d){let m=null;if(!l||typeof l!="string")return m;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:g}=c;o?d(u,g,c):g&&(m=m||{},m[u]=g)}),m}return Ps}var Ka={},fg;function p1(){if(fg)return Ka;fg=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,m=function(u){return!u||s.test(u)||t.test(u)},f=function(u,g){return g.toUpperCase()},o=function(u,g){return"".concat(g,"-")},c=function(u,g){return g===void 0&&(g={}),m(u)?u:(u=u.toLowerCase(),g.reactCompat?u=u.replace(d,o):u=u.replace(l,o),u.replace(r,f))};return Ka.camelCase=c,Ka}var Ya,dg;function m1(){if(dg)return Ya;dg=1;var t=Ya&&Ya.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(d1()),s=p1();function l(d,m){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,m)]=c)}),f}return l.default=l,Ya=l,Ya}var g1=m1();const _1=h_(g1),D_=M_("end"),qh=M_("start");function M_(t){return r;function r(s){const l=s&&s.position&&s.position[t]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function v1(t){const r=qh(t),s=D_(t);if(r&&s)return{start:r,end:s}}function el(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?pg(t.position):"start"in t||"end"in t?pg(t):"line"in t||"column"in t?Rh(t):""}function Rh(t){return mg(t&&t.line)+":"+mg(t&&t.column)}function pg(t){return Rh(t&&t.start)+"-"+Rh(t&&t.end)}function mg(t){return t&&typeof t=="number"?t:1}class nn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",m={},f=!1;if(s&&("line"in s&&"column"in s?m={place:s}:"start"in s&&"end"in s?m={place:s}:"type"in s?m={ancestors:[s],place:s.position}:m={...s}),typeof r=="string"?d=r:!m.cause&&r&&(f=!0,d=r.message,m.cause=r),!m.ruleId&&!m.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?m.ruleId=l:(m.source=l.slice(0,c),m.ruleId=l.slice(c+1))}if(!m.place&&m.ancestors&&m.ancestors){const c=m.ancestors[m.ancestors.length-1];c&&(m.place=c.position)}const o=m.place&&"start"in m.place?m.place.start:m.place;this.ancestors=m.ancestors||void 0,this.cause=m.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=el(m.place)||"1:1",this.place=m.place||void 0,this.reason=this.message,this.ruleId=m.ruleId||void 0,this.source=m.source||void 0,this.stack=f&&m.cause&&typeof m.cause.stack=="string"?m.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const $h={}.hasOwnProperty,y1=new Map,S1=/[A-Z]/g,b1=new Set(["table","tbody","thead","tfoot","tr"]),C1=new Set(["td","th"]),L_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function w1(t,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=M1(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=D1(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Fh:u1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},m=O_(d,t,void 0);return m&&typeof m!="string"?m:d.create(t,d.Fragment,{children:m||void 0},void 0)}function O_(t,r,s){if(r.type==="element")return x1(t,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return E1(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return A1(t,r,s);if(r.type==="mdxjsEsm")return k1(t,r);if(r.type==="root")return T1(t,r,s);if(r.type==="text")return R1(t,r)}function x1(t,r,s){const l=t.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Fh,t.schema=d),t.ancestors.push(r);const m=j_(t,r.tagName,!1),f=L1(t,r);let o=Vh(t,r);return b1.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!e1(c):!0})),B_(t,f,m,r),Gh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,m,f,s)}function E1(t,r){if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];return l.type,t.evaluater.evaluateExpression(l.expression)}al(t,r.position)}function k1(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);al(t,r.position)}function A1(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Fh,t.schema=d),t.ancestors.push(r);const m=r.name===null?t.Fragment:j_(t,r.name,!0),f=O1(t,r),o=Vh(t,r);return B_(t,f,m,r),Gh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,m,f,s)}function T1(t,r,s){const l={};return Gh(l,Vh(t,r)),t.create(r,t.Fragment,l,s)}function R1(t,r){return r.value}function B_(t,r,s,l){typeof s!="string"&&s!==t.Fragment&&t.passNode&&(r.node=l)}function Gh(t,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(t.children=s)}}function D1(t,r,s){return l;function l(d,m,f,o){const u=Array.isArray(f.children)?s:r;return o?u(m,f,o):u(m,f)}}function M1(t,r){return s;function s(l,d,m,f){const o=Array.isArray(m.children),c=qh(l);return r(d,m,f,o,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function L1(t,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&$h.call(r.properties,d)){const m=B1(t,d,r.properties[d]);if(m){const[f,o]=m;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&C1.has(r.tagName)?l=o:s[f]=o}}if(l){const m=s.style||(s.style={});m[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function O1(t,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&t.evaluater){const m=l.data.estree.body[0];m.type;const f=m.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,t.evaluater.evaluateExpression(o.argument))}else al(t,r.position);else{const d=l.name;let m;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&t.evaluater){const o=l.value.data.estree.body[0];o.type,m=t.evaluater.evaluateExpression(o.expression)}else al(t,r.position);else m=l.value===null?!0:l.value;s[d]=m}return s}function Vh(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:y1;for(;++l<r.children.length;){const m=r.children[l];let f;if(t.passKeys){const c=m.type==="element"?m.tagName:m.type==="mdxJsxFlowElement"||m.type==="mdxJsxTextElement"?m.name:void 0;if(c){const u=d.get(c)||0;f=c+"-"+u,d.set(c,u+1)}}const o=O_(t,m,f);o!==void 0&&s.push(o)}return s}function B1(t,r,s){const l=l1(t.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?YS(s):h1(s)),l.property==="style"){let d=typeof s=="object"?s:j1(t,String(s));return t.stylePropertyNameCase==="css"&&(d=N1(d)),["style",d]}return[t.elementAttributeNameCase==="react"&&l.space?r1[l.property]||l.property:l.attribute,s]}}function j1(t,r){try{return _1(r,{reactCompat:!0})}catch(s){if(t.ignoreInvalidStyle)return{};const l=s,d=new nn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=t.filePath||void 0,d.url=L_+"#cannot-parse-style-attribute",d}}function j_(t,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let m=-1,f;for(;++m<d.length;){const o=ag(d[m])?{type:"Identifier",name:d[m]}:{type:"Literal",value:d[m]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(m&&o.type==="Literal"),optional:!1}:o}l=f}else l=ag(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return $h.call(t.components,d)?t.components[d]:d}if(t.evaluater)return t.evaluater.evaluateExpression(l);al(t)}function al(t,r){const s=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=L_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function N1(t){const r={};let s;for(s in t)$h.call(t,s)&&(r[H1(s)]=t[s]);return r}function H1(t){let r=t.replace(S1,z1);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function z1(t){return"-"+t.toLowerCase()}const sh={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"]},I1={};function Wh(t,r){const s=I1,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return N_(t,l,d)}function N_(t,r,s){if(U1(t)){if("value"in t)return t.type==="html"&&!s?"":t.value;if(r&&"alt"in t&&t.alt)return t.alt;if("children"in t)return gg(t.children,r,s)}return Array.isArray(t)?gg(t,r,s):""}function gg(t,r,s){const l=[];let d=-1;for(;++d<t.length;)l[d]=N_(t[d],r,s);return l.join("")}function U1(t){return!!(t&&typeof t=="object")}const _g=document.createElement("i");function Kh(t){const r="&"+t+";";_g.innerHTML=r;const s=_g.textContent;return s.charCodeAt(s.length-1)===59&&t!=="semi"||s===r?!1:s}function Nn(t,r,s,l){const d=t.length;let m=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),t.splice(...f);else for(s&&t.splice(r,s);m<l.length;)f=l.slice(m,m+1e4),f.unshift(r,0),t.splice(...f),m+=1e4,r+=1e4}function Qn(t,r){return t.length>0?(Nn(t,t.length,0,r),t):r}const vg={}.hasOwnProperty;function H_(t){const r={};let s=-1;for(;++s<t.length;)P1(r,t[s]);return r}function P1(t,r){let s;for(s in r){const d=(vg.call(t,s)?t[s]:void 0)||(t[s]={}),m=r[s];let f;if(m)for(f in m){vg.call(d,f)||(d[f]=[]);const o=m[f];F1(d[f],Array.isArray(o)?o:o?[o]:[])}}}function F1(t,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?t:l).push(r[s]);Nn(t,0,0,l)}function z_(t,r){const s=Number.parseInt(t,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function ri(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=br(/[A-Za-z]/),tn=br(/[\dA-Za-z]/),q1=br(/[#-'*+\--9=?A-Z^-~]/);function Oo(t){return t!==null&&(t<32||t===127)}const Dh=br(/\d/),$1=br(/[\dA-Fa-f]/),G1=br(/[!-/:-@[-`{-~]/);function Be(t){return t!==null&&t<-2}function pt(t){return t!==null&&(t<0||t===32)}function Ke(t){return t===-2||t===-1||t===32}const Fo=br(new RegExp("\\p{P}|\\p{S}","u")),Xr=br(/\s/);function br(t){return r;function r(s){return s!==null&&s>-1&&t.test(String.fromCharCode(s))}}function Xs(t){const r=[];let s=-1,l=0,d=0;for(;++s<t.length;){const m=t.charCodeAt(s);let f="";if(m===37&&tn(t.charCodeAt(s+1))&&tn(t.charCodeAt(s+2)))d=2;else if(m<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(m))||(f=String.fromCharCode(m));else if(m>55295&&m<57344){const o=t.charCodeAt(s+1);m<56320&&o>56319&&o<57344?(f=String.fromCharCode(m,o),d=1):f="�"}else f=String.fromCharCode(m);f&&(r.push(t.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+t.slice(l)}function Ze(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let m=0;return f;function f(c){return Ke(c)?(t.enter(s),o(c)):r(c)}function o(c){return Ke(c)&&m++<d?(t.consume(c),o):(t.exit(s),r(c))}}const V1={tokenize:W1};function W1(t){const r=t.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ze(t,r,"linePrefix")}function d(o){return t.enter("paragraph"),m(o)}function m(o){const c=t.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return Be(o)?(t.consume(o),t.exit("chunkText"),m):(t.consume(o),f)}}const K1={tokenize:Y1},yg={tokenize:X1};function Y1(t){const r=this,s=[];let l=0,d,m,f;return o;function o(b){if(l<s.length){const E=s[l];return r.containerState=E[1],t.attempt(E[0].continuation,c,u)(b)}return u(b)}function c(b){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&v();const E=r.events.length;let O=E,R;for(;O--;)if(r.events[O][0]==="exit"&&r.events[O][1].type==="chunkFlow"){R=r.events[O][1].end;break}_(l);let D=E;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return Nn(r.events,O+1,0,r.events.slice(E)),r.events.length=D,u(b)}return o(b)}function u(b){if(l===s.length){if(!d)return S(b);if(d.currentConstruct&&d.currentConstruct.concrete)return T(b);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(yg,g,h)(b)}function g(b){return d&&v(),_(l),S(b)}function h(b){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(b)}function S(b){return r.containerState={},t.attempt(yg,w,T)(b)}function w(b){return l++,s.push([r.currentConstruct,r.containerState]),S(b)}function T(b){if(b===null){d&&v(),_(0),t.consume(b);return}return d=d||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:m}),k(b)}function k(b){if(b===null){y(t.exit("chunkFlow"),!0),_(0),t.consume(b);return}return Be(b)?(t.consume(b),y(t.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(t.consume(b),k)}function y(b,E){const O=r.sliceStream(b);if(E&&O.push(null),b.previous=m,m&&(m.next=b),m=b,d.defineSkip(b.start),d.write(O),r.parser.lazy[b.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let A=D,M,L;for(;A--;)if(r.events[A][0]==="exit"&&r.events[A][1].type==="chunkFlow"){if(M){L=r.events[A][1].end;break}M=!0}for(_(l),R=D;R<r.events.length;)r.events[R][1].end={...L},R++;Nn(r.events,A+1,0,r.events.slice(D)),r.events.length=R}}function _(b){let E=s.length;for(;E-- >b;){const O=s[E];r.containerState=O[1],O[0].exit.call(r,t)}s.length=b}function v(){d.write([null]),m=void 0,d=void 0,r.containerState._closeFlow=void 0}}function X1(t,r,s){return Ze(t,t.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ws(t){if(t===null||pt(t)||Xr(t))return 1;if(Fo(t))return 2}function qo(t,r,s){const l=[];let d=-1;for(;++d<t.length;){const m=t[d].resolveAll;m&&!l.includes(m)&&(r=m(r,s),l.push(m))}return r}const Mh={name:"attention",resolveAll:Q1,tokenize:J1};function Q1(t,r){let s=-1,l,d,m,f,o,c,u,g;for(;++s<t.length;)if(t[s][0]==="enter"&&t[s][1].type==="attentionSequence"&&t[s][1]._close){for(l=s;l--;)if(t[l][0]==="exit"&&t[l][1].type==="attentionSequence"&&t[l][1]._open&&r.sliceSerialize(t[l][1]).charCodeAt(0)===r.sliceSerialize(t[s][1]).charCodeAt(0)){if((t[l][1]._close||t[s][1]._open)&&(t[s][1].end.offset-t[s][1].start.offset)%3&&!((t[l][1].end.offset-t[l][1].start.offset+t[s][1].end.offset-t[s][1].start.offset)%3))continue;c=t[l][1].end.offset-t[l][1].start.offset>1&&t[s][1].end.offset-t[s][1].start.offset>1?2:1;const h={...t[l][1].end},S={...t[s][1].start};Sg(h,-c),Sg(S,c),f={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...t[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...t[s][1].start},end:S},m={type:c>1?"strongText":"emphasisText",start:{...t[l][1].end},end:{...t[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},t[l][1].end={...f.start},t[s][1].start={...o.end},u=[],t[l][1].end.offset-t[l][1].start.offset&&(u=Qn(u,[["enter",t[l][1],r],["exit",t[l][1],r]])),u=Qn(u,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",m,r]]),u=Qn(u,qo(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),u=Qn(u,[["exit",m,r],["enter",o,r],["exit",o,r],["exit",d,r]]),t[s][1].end.offset-t[s][1].start.offset?(g=2,u=Qn(u,[["enter",t[s][1],r],["exit",t[s][1],r]])):g=0,Nn(t,l-1,s-l+3,u),s=l+u.length-g-2;break}}for(s=-1;++s<t.length;)t[s][1].type==="attentionSequence"&&(t[s][1].type="data");return t}function J1(t,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=Ws(l);let m;return f;function f(c){return m=c,t.enter("attentionSequence"),o(c)}function o(c){if(c===m)return t.consume(c),o;const u=t.exit("attentionSequence"),g=Ws(c),h=!g||g===2&&d||s.includes(c),S=!d||d===2&&g||s.includes(l);return u._open=!!(m===42?h:h&&(d||!S)),u._close=!!(m===42?S:S&&(g||!h)),r(c)}}function Sg(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const Z1={name:"autolink",tokenize:eb};function eb(t,r,s){let l=0;return d;function d(w){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),m}function m(w){return un(w)?(t.consume(w),f):w===64?s(w):u(w)}function f(w){return w===43||w===45||w===46||tn(w)?(l=1,o(w)):u(w)}function o(w){return w===58?(t.consume(w),l=0,c):(w===43||w===45||w===46||tn(w))&&l++<32?(t.consume(w),o):(l=0,u(w))}function c(w){return w===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):w===null||w===32||w===60||Oo(w)?s(w):(t.consume(w),c)}function u(w){return w===64?(t.consume(w),g):q1(w)?(t.consume(w),u):s(w)}function g(w){return tn(w)?h(w):s(w)}function h(w){return w===46?(t.consume(w),l=0,g):w===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):S(w)}function S(w){if((w===45||tn(w))&&l++<63){const T=w===45?S:h;return t.consume(w),T}return s(w)}}const hl={partial:!0,tokenize:tb};function tb(t,r,s){return l;function l(m){return Ke(m)?Ze(t,d,"linePrefix")(m):d(m)}function d(m){return m===null||Be(m)?r(m):s(m)}}const I_={continuation:{tokenize:ib},exit:rb,name:"blockQuote",tokenize:nb};function nb(t,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(f),t.exit("blockQuoteMarker"),m}return s(f)}function m(f){return Ke(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(f))}}function ib(t,r,s){const l=this;return d;function d(f){return Ke(f)?Ze(t,m,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):m(f)}function m(f){return t.attempt(I_,r,s)(f)}}function rb(t){t.exit("blockQuote")}const U_={name:"characterEscape",tokenize:sb};function sb(t,r,s){return l;function l(m){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(m),t.exit("escapeMarker"),d}function d(m){return G1(m)?(t.enter("characterEscapeValue"),t.consume(m),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(m)}}const P_={name:"characterReference",tokenize:ab};function ab(t,r,s){const l=this;let d=0,m,f;return o;function o(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),c}function c(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),m=31,f=tn,g(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),m=6,f=$1,g):(t.enter("characterReferenceValue"),m=7,f=Dh,g(h))}function g(h){if(h===59&&d){const S=t.exit("characterReferenceValue");return f===tn&&!Kh(l.sliceSerialize(S))?s(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return f(h)&&d++<m?(t.consume(h),g):s(h)}}const bg={partial:!0,tokenize:ob},Cg={concrete:!0,name:"codeFenced",tokenize:lb};function lb(t,r,s){const l=this,d={partial:!0,tokenize:O};let m=0,f=0,o;return c;function c(R){return u(R)}function u(R){const D=l.events[l.events.length-1];return m=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===o?(f++,t.consume(R),g):f<3?s(R):(t.exit("codeFencedFenceSequence"),Ke(R)?Ze(t,h,"whitespace")(R):h(R))}function h(R){return R===null||Be(R)?(t.exit("codeFencedFence"),l.interrupt?r(R):t.check(bg,k,E)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Be(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(R)):Ke(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ze(t,w,"whitespace")(R)):R===96&&R===o?s(R):(t.consume(R),S)}function w(R){return R===null||Be(R)?h(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(R))}function T(R){return R===null||Be(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(R)):R===96&&R===o?s(R):(t.consume(R),T)}function k(R){return t.attempt(d,E,y)(R)}function y(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),_}function _(R){return m>0&&Ke(R)?Ze(t,v,"linePrefix",m+1)(R):v(R)}function v(R){return R===null||Be(R)?t.check(bg,k,E)(R):(t.enter("codeFlowValue"),b(R))}function b(R){return R===null||Be(R)?(t.exit("codeFlowValue"),v(R)):(t.consume(R),b)}function E(R){return t.exit("codeFenced"),r(R)}function O(R,D,A){let M=0;return L;function L(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),H}function H(K){return R.enter("codeFencedFence"),Ke(K)?Ze(R,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(R.enter("codeFencedFenceSequence"),P(K)):A(K)}function P(K){return K===o?(M++,R.consume(K),P):M>=f?(R.exit("codeFencedFenceSequence"),Ke(K)?Ze(R,W,"whitespace")(K):W(K)):A(K)}function W(K){return K===null||Be(K)?(R.exit("codeFencedFence"),D(K)):A(K)}}}function ob(t,r,s){const l=this;return d;function d(f){return f===null?s(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),m)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const ah={name:"codeIndented",tokenize:ub},cb={partial:!0,tokenize:hb};function ub(t,r,s){const l=this;return d;function d(u){return t.enter("codeIndented"),Ze(t,m,"linePrefix",5)(u)}function m(u){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(u):s(u)}function f(u){return u===null?c(u):Be(u)?t.attempt(cb,f,c)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(t.exit("codeFlowValue"),f(u)):(t.consume(u),o)}function c(u){return t.exit("codeIndented"),r(u)}}function hb(t,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Be(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):Ze(t,m,"linePrefix",5)(f)}function m(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Be(f)?d(f):s(f)}}const fb={name:"codeText",previous:pb,resolve:db,tokenize:mb};function db(t){let r=t.length-4,s=3,l,d;if((t[s][1].type==="lineEnding"||t[s][1].type==="space")&&(t[r][1].type==="lineEnding"||t[r][1].type==="space")){for(l=s;++l<r;)if(t[l][1].type==="codeTextData"){t[s][1].type="codeTextPadding",t[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&t[l][1].type!=="lineEnding"&&(d=l):(l===r||t[l][1].type==="lineEnding")&&(t[d][1].type="codeTextData",l!==d+2&&(t[d][1].end=t[l-1][1].end,t.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return t}function pb(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function mb(t,r,s){let l=0,d,m;return f;function f(h){return t.enter("codeText"),t.enter("codeTextSequence"),o(h)}function o(h){return h===96?(t.consume(h),l++,o):(t.exit("codeTextSequence"),c(h))}function c(h){return h===null?s(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),c):h===96?(m=t.enter("codeTextSequence"),d=0,g(h)):Be(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Be(h)?(t.exit("codeTextData"),c(h)):(t.consume(h),u)}function g(h){return h===96?(t.consume(h),d++,g):d===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(h)):(m.type="codeTextData",u(h))}}class gb{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const m=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Xa(this.left,l),m.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Xa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Xa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Xa(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Xa(this.left,s.reverse())}}}function Xa(t,r){let s=0;if(r.length<1e4)t.push(...r);else for(;s<r.length;)t.push(...r.slice(s,s+1e4)),s+=1e4}function F_(t){const r={};let s=-1,l,d,m,f,o,c,u;const g=new gb(t);for(;++s<g.length;){for(;s in r;)s=r[s];if(l=g.get(s),s&&l[1].type==="chunkFlow"&&g.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,m=0,m<c.length&&c[m][1].type==="lineEndingBlank"&&(m+=2),m<c.length&&c[m][1].type==="content"))for(;++m<c.length&&c[m][1].type!=="content";)c[m][1].type==="chunkText"&&(c[m][1]._isInFirstContentOfListItem=!0,m++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,_b(g,s)),s=r[s],u=!0);else if(l[1]._container){for(m=s,d=void 0;m--;)if(f=g.get(m),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(g.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=m);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...g.get(d)[1].start},o=g.slice(d,s),o.unshift(l),g.splice(d,s-d+1,o))}}return Nn(t,0,Number.POSITIVE_INFINITY,g.slice(0)),!u}function _b(t,r){const s=t.get(r)[1],l=t.get(r)[2];let d=r-1;const m=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],u={};let g,h,S=-1,w=s,T=0,k=0;const y=[k];for(;w;){for(;t.get(++d)[1]!==w;);m.push(d),w._tokenizer||(g=l.sliceStream(w),w.next||g.push(null),h&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=s;++S<o.length;)o[S][0]==="exit"&&o[S-1][0]==="enter"&&o[S][1].type===o[S-1][1].type&&o[S][1].start.line!==o[S][1].end.line&&(k=S+1,y.push(k),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):y.pop(),S=y.length;S--;){const _=o.slice(y[S],y[S+1]),v=m.pop();c.push([v,v+_.length-1]),t.splice(v,2,_)}for(c.reverse(),S=-1;++S<c.length;)u[T+c[S][0]]=T+c[S][1],T+=c[S][1]-c[S][0]-1;return u}const vb={resolve:Sb,tokenize:bb},yb={partial:!0,tokenize:Cb};function Sb(t){return F_(t),t}function bb(t,r){let s;return l;function l(o){return t.enter("content"),s=t.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?m(o):Be(o)?t.check(yb,f,m)(o):(t.consume(o),d)}function m(o){return t.exit("chunkContent"),t.exit("content"),r(o)}function f(o){return t.consume(o),t.exit("chunkContent"),s.next=t.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function Cb(t,r,s){const l=this;return d;function d(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Ze(t,m,"linePrefix")}function m(f){if(f===null||Be(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):t.interrupt(l.parser.constructs.flow,s,r)(f)}}function q_(t,r,s,l,d,m,f,o,c){const u=c||Number.POSITIVE_INFINITY;let g=0;return h;function h(_){return _===60?(t.enter(l),t.enter(d),t.enter(m),t.consume(_),t.exit(m),S):_===null||_===32||_===41||Oo(_)?s(_):(t.enter(l),t.enter(f),t.enter(o),t.enter("chunkString",{contentType:"string"}),k(_))}function S(_){return _===62?(t.enter(m),t.consume(_),t.exit(m),t.exit(d),t.exit(l),r):(t.enter(o),t.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===62?(t.exit("chunkString"),t.exit(o),S(_)):_===null||_===60||Be(_)?s(_):(t.consume(_),_===92?T:w)}function T(_){return _===60||_===62||_===92?(t.consume(_),w):w(_)}function k(_){return!g&&(_===null||_===41||pt(_))?(t.exit("chunkString"),t.exit(o),t.exit(f),t.exit(l),r(_)):g<u&&_===40?(t.consume(_),g++,k):_===41?(t.consume(_),g--,k):_===null||_===32||_===40||Oo(_)?s(_):(t.consume(_),_===92?y:k)}function y(_){return _===40||_===41||_===92?(t.consume(_),k):k(_)}}function $_(t,r,s,l,d,m){const f=this;let o=0,c;return u;function u(w){return t.enter(l),t.enter(d),t.consume(w),t.exit(d),t.enter(m),g}function g(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(t.exit(m),t.enter(d),t.consume(w),t.exit(d),t.exit(l),r):Be(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),g):(t.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||Be(w)||o++>999?(t.exit("chunkString"),g(w)):(t.consume(w),c||(c=!Ke(w)),w===92?S:h)}function S(w){return w===91||w===92||w===93?(t.consume(w),o++,h):h(w)}}function G_(t,r,s,l,d,m){let f;return o;function o(S){return S===34||S===39||S===40?(t.enter(l),t.enter(d),t.consume(S),t.exit(d),f=S===40?41:S,c):s(S)}function c(S){return S===f?(t.enter(d),t.consume(S),t.exit(d),t.exit(l),r):(t.enter(m),u(S))}function u(S){return S===f?(t.exit(m),c(f)):S===null?s(S):Be(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),Ze(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===f||S===null||Be(S)?(t.exit("chunkString"),u(S)):(t.consume(S),S===92?h:g)}function h(S){return S===f||S===92?(t.consume(S),g):g(S)}}function tl(t,r){let s;return l;function l(d){return Be(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):Ke(d)?Ze(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const wb={name:"definition",tokenize:Eb},xb={partial:!0,tokenize:kb};function Eb(t,r,s){const l=this;let d;return m;function m(w){return t.enter("definition"),f(w)}function f(w){return $_.call(l,t,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=ri(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),c):s(w)}function c(w){return pt(w)?tl(t,u)(w):u(w)}function u(w){return q_(t,g,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function g(w){return t.attempt(xb,h,h)(w)}function h(w){return Ke(w)?Ze(t,S,"whitespace")(w):S(w)}function S(w){return w===null||Be(w)?(t.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function kb(t,r,s){return l;function l(o){return pt(o)?tl(t,d)(o):s(o)}function d(o){return G_(t,m,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function m(o){return Ke(o)?Ze(t,f,"whitespace")(o):f(o)}function f(o){return o===null||Be(o)?r(o):s(o)}}const Ab={name:"hardBreakEscape",tokenize:Tb};function Tb(t,r,s){return l;function l(m){return t.enter("hardBreakEscape"),t.consume(m),d}function d(m){return Be(m)?(t.exit("hardBreakEscape"),r(m)):s(m)}}const Rb={name:"headingAtx",resolve:Db,tokenize:Mb};function Db(t,r){let s=t.length-2,l=3,d,m;return t[l][1].type==="whitespace"&&(l+=2),s-2>l&&t[s][1].type==="whitespace"&&(s-=2),t[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&t[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:t[l][1].start,end:t[s][1].end},m={type:"chunkText",start:t[l][1].start,end:t[s][1].end,contentType:"text"},Nn(t,l,s-l+1,[["enter",d,r],["enter",m,r],["exit",m,r],["exit",d,r]])),t}function Mb(t,r,s){let l=0;return d;function d(g){return t.enter("atxHeading"),m(g)}function m(g){return t.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&l++<6?(t.consume(g),f):g===null||pt(g)?(t.exit("atxHeadingSequence"),o(g)):s(g)}function o(g){return g===35?(t.enter("atxHeadingSequence"),c(g)):g===null||Be(g)?(t.exit("atxHeading"),r(g)):Ke(g)?Ze(t,o,"whitespace")(g):(t.enter("atxHeadingText"),u(g))}function c(g){return g===35?(t.consume(g),c):(t.exit("atxHeadingSequence"),o(g))}function u(g){return g===null||g===35||pt(g)?(t.exit("atxHeadingText"),o(g)):(t.consume(g),u)}}const Lb=["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"],wg=["pre","script","style","textarea"],Ob={concrete:!0,name:"htmlFlow",resolveTo:Nb,tokenize:Hb},Bb={partial:!0,tokenize:Ib},jb={partial:!0,tokenize:zb};function Nb(t){let r=t.length;for(;r--&&!(t[r][0]==="enter"&&t[r][1].type==="htmlFlow"););return r>1&&t[r-2][1].type==="linePrefix"&&(t[r][1].start=t[r-2][1].start,t[r+1][1].start=t[r-2][1].start,t.splice(r-2,2)),t}function Hb(t,r,s){const l=this;let d,m,f,o,c;return u;function u(I){return g(I)}function g(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),h}function h(I){return I===33?(t.consume(I),S):I===47?(t.consume(I),m=!0,k):I===63?(t.consume(I),d=3,l.interrupt?r:j):un(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function S(I){return I===45?(t.consume(I),d=2,w):I===91?(t.consume(I),d=5,o=0,T):un(I)?(t.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(t.consume(I),l.interrupt?r:j):s(I)}function T(I){const ie="CDATA[";return I===ie.charCodeAt(o++)?(t.consume(I),o===ie.length?l.interrupt?r:U:T):s(I)}function k(I){return un(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function y(I){if(I===null||I===47||I===62||pt(I)){const ie=I===47,pe=f.toLowerCase();return!ie&&!m&&wg.includes(pe)?(d=1,l.interrupt?r(I):U(I)):Lb.includes(f.toLowerCase())?(d=6,ie?(t.consume(I),_):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):m?v(I):b(I))}return I===45||tn(I)?(t.consume(I),f+=String.fromCharCode(I),y):s(I)}function _(I){return I===62?(t.consume(I),l.interrupt?r:U):s(I)}function v(I){return Ke(I)?(t.consume(I),v):L(I)}function b(I){return I===47?(t.consume(I),L):I===58||I===95||un(I)?(t.consume(I),E):Ke(I)?(t.consume(I),b):L(I)}function E(I){return I===45||I===46||I===58||I===95||tn(I)?(t.consume(I),E):O(I)}function O(I){return I===61?(t.consume(I),R):Ke(I)?(t.consume(I),O):b(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(t.consume(I),c=I,D):Ke(I)?(t.consume(I),R):A(I)}function D(I){return I===c?(t.consume(I),c=null,M):I===null||Be(I)?s(I):(t.consume(I),D)}function A(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||pt(I)?O(I):(t.consume(I),A)}function M(I){return I===47||I===62||Ke(I)?b(I):s(I)}function L(I){return I===62?(t.consume(I),H):s(I)}function H(I){return I===null||Be(I)?U(I):Ke(I)?(t.consume(I),H):s(I)}function U(I){return I===45&&d===2?(t.consume(I),V):I===60&&d===1?(t.consume(I),Y):I===62&&d===4?(t.consume(I),N):I===63&&d===3?(t.consume(I),j):I===93&&d===5?(t.consume(I),z):Be(I)&&(d===6||d===7)?(t.exit("htmlFlowData"),t.check(Bb,q,P)(I)):I===null||Be(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(jb,W,q)(I)}function W(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),K}function K(I){return I===null||Be(I)?P(I):(t.enter("htmlFlowData"),U(I))}function V(I){return I===45?(t.consume(I),j):U(I)}function Y(I){return I===47?(t.consume(I),f="",te):U(I)}function te(I){if(I===62){const ie=f.toLowerCase();return wg.includes(ie)?(t.consume(I),N):U(I)}return un(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),te):U(I)}function z(I){return I===93?(t.consume(I),j):U(I)}function j(I){return I===62?(t.consume(I),N):I===45&&d===2?(t.consume(I),j):U(I)}function N(I){return I===null||Be(I)?(t.exit("htmlFlowData"),q(I)):(t.consume(I),N)}function q(I){return t.exit("htmlFlow"),r(I)}}function zb(t,r,s){const l=this;return d;function d(f){return Be(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),m):s(f)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function Ib(t,r,s){return l;function l(d){return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),t.attempt(hl,r,s)}}const Ub={name:"htmlText",tokenize:Pb};function Pb(t,r,s){const l=this;let d,m,f;return o;function o(j){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(j),c}function c(j){return j===33?(t.consume(j),u):j===47?(t.consume(j),O):j===63?(t.consume(j),b):un(j)?(t.consume(j),A):s(j)}function u(j){return j===45?(t.consume(j),g):j===91?(t.consume(j),m=0,T):un(j)?(t.consume(j),v):s(j)}function g(j){return j===45?(t.consume(j),w):s(j)}function h(j){return j===null?s(j):j===45?(t.consume(j),S):Be(j)?(f=h,Y(j)):(t.consume(j),h)}function S(j){return j===45?(t.consume(j),w):h(j)}function w(j){return j===62?V(j):j===45?S(j):h(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(m++)?(t.consume(j),m===N.length?k:T):s(j)}function k(j){return j===null?s(j):j===93?(t.consume(j),y):Be(j)?(f=k,Y(j)):(t.consume(j),k)}function y(j){return j===93?(t.consume(j),_):k(j)}function _(j){return j===62?V(j):j===93?(t.consume(j),_):k(j)}function v(j){return j===null||j===62?V(j):Be(j)?(f=v,Y(j)):(t.consume(j),v)}function b(j){return j===null?s(j):j===63?(t.consume(j),E):Be(j)?(f=b,Y(j)):(t.consume(j),b)}function E(j){return j===62?V(j):b(j)}function O(j){return un(j)?(t.consume(j),R):s(j)}function R(j){return j===45||tn(j)?(t.consume(j),R):D(j)}function D(j){return Be(j)?(f=D,Y(j)):Ke(j)?(t.consume(j),D):V(j)}function A(j){return j===45||tn(j)?(t.consume(j),A):j===47||j===62||pt(j)?M(j):s(j)}function M(j){return j===47?(t.consume(j),V):j===58||j===95||un(j)?(t.consume(j),L):Be(j)?(f=M,Y(j)):Ke(j)?(t.consume(j),M):V(j)}function L(j){return j===45||j===46||j===58||j===95||tn(j)?(t.consume(j),L):H(j)}function H(j){return j===61?(t.consume(j),U):Be(j)?(f=H,Y(j)):Ke(j)?(t.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(t.consume(j),d=j,P):Be(j)?(f=U,Y(j)):Ke(j)?(t.consume(j),U):(t.consume(j),W)}function P(j){return j===d?(t.consume(j),d=void 0,K):j===null?s(j):Be(j)?(f=P,Y(j)):(t.consume(j),P)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||pt(j)?M(j):(t.consume(j),W)}function K(j){return j===47||j===62||pt(j)?M(j):s(j)}function V(j){return j===62?(t.consume(j),t.exit("htmlTextData"),t.exit("htmlText"),r):s(j)}function Y(j){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),te}function te(j){return Ke(j)?Ze(t,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return t.enter("htmlTextData"),f(j)}}const Yh={name:"labelEnd",resolveAll:Gb,resolveTo:Vb,tokenize:Wb},Fb={tokenize:Kb},qb={tokenize:Yb},$b={tokenize:Xb};function Gb(t){let r=-1;const s=[];for(;++r<t.length;){const l=t[r][1];if(s.push(t[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return t.length!==s.length&&Nn(t,0,t.length,s),t}function Vb(t,r){let s=t.length,l=0,d,m,f,o;for(;s--;)if(d=t[s][1],m){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;t[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(t[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(m=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:t[m][1].type==="labelLink"?"link":"image",start:{...t[m][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[m][1].start},end:{...t[f][1].end}},g={type:"labelText",start:{...t[m+l+2][1].end},end:{...t[f-2][1].start}};return o=[["enter",c,r],["enter",u,r]],o=Qn(o,t.slice(m+1,m+l+3)),o=Qn(o,[["enter",g,r]]),o=Qn(o,qo(r.parser.constructs.insideSpan.null,t.slice(m+l+4,f-3),r)),o=Qn(o,[["exit",g,r],t[f-2],t[f-1],["exit",u,r]]),o=Qn(o,t.slice(f+1)),o=Qn(o,[["exit",c,r]]),Nn(t,m,t.length,o),t}function Wb(t,r,s){const l=this;let d=l.events.length,m,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){m=l.events[d][1];break}return o;function o(S){return m?m._inactive?h(S):(f=l.parser.defined.includes(ri(l.sliceSerialize({start:m.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(S),t.exit("labelMarker"),t.exit("labelEnd"),c):s(S)}function c(S){return S===40?t.attempt(Fb,g,f?g:h)(S):S===91?t.attempt(qb,g,f?u:h)(S):f?g(S):h(S)}function u(S){return t.attempt($b,g,h)(S)}function g(S){return r(S)}function h(S){return m._balanced=!0,s(S)}}function Kb(t,r,s){return l;function l(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),d}function d(h){return pt(h)?tl(t,m)(h):m(h)}function m(h){return h===41?g(h):q_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function f(h){return pt(h)?tl(t,c)(h):g(h)}function o(h){return s(h)}function c(h){return h===34||h===39||h===40?G_(t,u,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):g(h)}function u(h){return pt(h)?tl(t,g)(h):g(h)}function g(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),r):s(h)}}function Yb(t,r,s){const l=this;return d;function d(o){return $_.call(l,t,m,f,"reference","referenceMarker","referenceString")(o)}function m(o){return l.parser.defined.includes(ri(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Xb(t,r,s){return l;function l(m){return t.enter("reference"),t.enter("referenceMarker"),t.consume(m),t.exit("referenceMarker"),d}function d(m){return m===93?(t.enter("referenceMarker"),t.consume(m),t.exit("referenceMarker"),t.exit("reference"),r):s(m)}}const Qb={name:"labelStartImage",resolveAll:Yh.resolveAll,tokenize:Jb};function Jb(t,r,s){const l=this;return d;function d(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),m}function m(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Zb={name:"labelStartLink",resolveAll:Yh.resolveAll,tokenize:eC};function eC(t,r,s){const l=this;return d;function d(f){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelLink"),m}function m(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const lh={name:"lineEnding",tokenize:tC};function tC(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ze(t,r,"linePrefix")}}const Do={name:"thematicBreak",tokenize:nC};function nC(t,r,s){let l=0,d;return m;function m(u){return t.enter("thematicBreak"),f(u)}function f(u){return d=u,o(u)}function o(u){return u===d?(t.enter("thematicBreakSequence"),c(u)):l>=3&&(u===null||Be(u))?(t.exit("thematicBreak"),r(u)):s(u)}function c(u){return u===d?(t.consume(u),l++,c):(t.exit("thematicBreakSequence"),Ke(u)?Ze(t,o,"whitespace")(u):o(u))}}const Sn={continuation:{tokenize:aC},exit:oC,name:"list",tokenize:sC},iC={partial:!0,tokenize:cC},rC={partial:!0,tokenize:lC};function sC(t,r,s){const l=this,d=l.events[l.events.length-1];let m=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const T=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:Dh(w)){if(l.containerState.type||(l.containerState.type=T,t.enter(T,{_container:!0})),T==="listUnordered")return t.enter("listItemPrefix"),w===42||w===45?t.check(Do,s,u)(w):u(w);if(!l.interrupt||w===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(w)}return s(w)}function c(w){return Dh(w)&&++f<10?(t.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.containerState.marker:w===41||w===46)?(t.exit("listItemValue"),u(w)):s(w)}function u(w){return t.enter("listItemMarker"),t.consume(w),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,t.check(hl,l.interrupt?s:g,t.attempt(iC,S,h))}function g(w){return l.containerState.initialBlankLine=!0,m++,S(w)}function h(w){return Ke(w)?(t.enter("listItemPrefixWhitespace"),t.consume(w),t.exit("listItemPrefixWhitespace"),S):s(w)}function S(w){return l.containerState.size=m+l.sliceSerialize(t.exit("listItemPrefix"),!0).length,r(w)}}function aC(t,r,s){const l=this;return l.containerState._closeFlow=void 0,t.check(hl,d,m);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ze(t,r,"listItemIndent",l.containerState.size+1)(o)}function m(o){return l.containerState.furtherBlankLines||!Ke(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(rC,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ze(t,t.attempt(Sn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function lC(t,r,s){const l=this;return Ze(t,d,"listItemIndent",l.containerState.size+1);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(m):s(m)}}function oC(t){t.exit(this.containerState.type)}function cC(t,r,s){const l=this;return Ze(t,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(m){const f=l.events[l.events.length-1];return!Ke(m)&&f&&f[1].type==="listItemPrefixWhitespace"?r(m):s(m)}}const xg={name:"setextUnderline",resolveTo:uC,tokenize:hC};function uC(t,r){let s=t.length,l,d,m;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){l=s;break}t[s][1].type==="paragraph"&&(d=s)}else t[s][1].type==="content"&&t.splice(s,1),!m&&t[s][1].type==="definition"&&(m=s);const f={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[d][1].type="setextHeadingText",m?(t.splice(d,0,["enter",f,r]),t.splice(m+1,0,["exit",t[l][1],r]),t[l][1].end={...t[m][1].end}):t[l][1]=f,t.push(["exit",f,r]),t}function hC(t,r,s){const l=this;let d;return m;function m(u){let g=l.events.length,h;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){h=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||h)?(t.enter("setextHeadingLine"),d=u,f(u)):s(u)}function f(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===d?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),Ke(u)?Ze(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Be(u)?(t.exit("setextHeadingLine"),r(u)):s(u)}}const fC={tokenize:dC};function dC(t){const r=this,s=t.attempt(hl,l,t.attempt(this.parser.constructs.flowInitial,d,Ze(t,t.attempt(this.parser.constructs.flow,d,t.attempt(vb,d)),"linePrefix")));return s;function l(m){if(m===null){t.consume(m);return}return t.enter("lineEndingBlank"),t.consume(m),t.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),r.currentConstruct=void 0,s}}const pC={resolveAll:W_()},mC=V_("string"),gC=V_("text");function V_(t){return{resolveAll:W_(t==="text"?_C:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[t],m=s.attempt(d,f,o);return f;function f(g){return u(g)?m(g):o(g)}function o(g){if(g===null){s.consume(g);return}return s.enter("data"),s.consume(g),c}function c(g){return u(g)?(s.exit("data"),m(g)):(s.consume(g),c)}function u(g){if(g===null)return!0;const h=d[g];let S=-1;if(h)for(;++S<h.length;){const w=h[S];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function W_(t){return r;function r(s,l){let d=-1,m;for(;++d<=s.length;)m===void 0?s[d]&&s[d][1].type==="data"&&(m=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==m+2&&(s[m][1].end=s[d-1][1].end,s.splice(m+2,d-m-2),d=m+2),m=void 0);return t?t(s,l):s}}function _C(t,r){let s=0;for(;++s<=t.length;)if((s===t.length||t[s][1].type==="lineEnding")&&t[s-1][1].type==="data"){const l=t[s-1][1],d=r.sliceStream(l);let m=d.length,f=-1,o=0,c;for(;m--;){const u=d[m];if(typeof u=="string"){for(f=u.length;u.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(u===-2)c=!0,o++;else if(u!==-1){m++;break}}if(r._contentTypeTextTrailing&&s===t.length&&(o=0),o){const u={type:s===t.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:m?f:l.start._bufferIndex+f,_index:l.start._index+m,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(t.splice(s,0,["enter",u,r],["exit",u,r]),s+=2)}s++}return t}const vC={42:Sn,43:Sn,45:Sn,48:Sn,49:Sn,50:Sn,51:Sn,52:Sn,53:Sn,54:Sn,55:Sn,56:Sn,57:Sn,62:I_},yC={91:wb},SC={[-2]:ah,[-1]:ah,32:ah},bC={35:Rb,42:Do,45:[xg,Do],60:Ob,61:xg,95:Do,96:Cg,126:Cg},CC={38:P_,92:U_},wC={[-5]:lh,[-4]:lh,[-3]:lh,33:Qb,38:P_,42:Mh,60:[Z1,Ub],91:Zb,92:[Ab,U_],93:Yh,95:Mh,96:fb},xC={null:[Mh,pC]},EC={null:[42,95]},kC={null:[]},AC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:EC,contentInitial:yC,disable:kC,document:vC,flow:bC,flowInitial:SC,insideSpan:xC,string:CC,text:wC},Symbol.toStringTag,{value:"Module"}));function TC(t,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},m=[];let f=[],o=[];const c={attempt:D(O),check:D(R),consume:v,enter:b,exit:E,interrupt:D(R,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:T,parser:t,previous:null,sliceSerialize:S,sliceStream:w,write:h};let g=r.tokenize.call(u,c);return r.resolveAll&&m.push(r),u;function h(H){return f=Qn(f,H),y(),f[f.length-1]!==null?[]:(A(r,0),u.events=qo(m,u.events,u),u.events)}function S(H,U){return DC(w(H),U)}function w(H){return RC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:W,offset:K}=l;return{_bufferIndex:H,_index:U,line:P,column:W,offset:K}}function k(H){d[H.line]=H.column,L()}function y(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)_(U.charCodeAt(l._bufferIndex));else _(U)}}function _(H){g=g(H)}function v(H){Be(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,L()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),u.previous=H}function b(H,U){const P=U||{};return P.type=H,P.start=T(),u.events.push(["enter",P,u]),o.push(P),P}function E(H){const U=o.pop();return U.end=T(),u.events.push(["exit",U,u]),U}function O(H,U){A(H,U.from)}function R(H,U){U.restore()}function D(H,U){return P;function P(W,K,V){let Y,te,z,j;return Array.isArray(W)?q(W):"tokenize"in W?q([W]):N(W);function N(ge){return Q;function Q($){const he=$!==null&&ge[$],le=$!==null&&ge.null,xe=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(le)?le:le?[le]:[]];return q(xe)($)}}function q(ge){return Y=ge,te=0,ge.length===0?V:I(ge[te])}function I(ge){return Q;function Q($){return j=M(),z=ge,ge.partial||(u.currentConstruct=ge),ge.name&&u.parser.constructs.disable.null.includes(ge.name)?pe():ge.tokenize.call(U?Object.assign(Object.create(u),U):u,c,ie,pe)($)}}function ie(ge){return H(z,j),K}function pe(ge){return j.restore(),++te<Y.length?I(Y[te]):V}}}function A(H,U){H.resolveAll&&!m.includes(H)&&m.push(H),H.resolve&&Nn(u.events,U,u.events.length-U,H.resolve(u.events.slice(U),u)),H.resolveTo&&(u.events=H.resolveTo(u.events,u))}function M(){const H=T(),U=u.previous,P=u.currentConstruct,W=u.events.length,K=Array.from(o);return{from:W,restore:V};function V(){l=H,u.previous=U,u.currentConstruct=P,u.events.length=W,o=K,L()}}function L(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function RC(t,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,m=r.end._bufferIndex;let f;if(s===d)f=[t[s].slice(l,m)];else{if(f=t.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}m>0&&f.push(t[d].slice(0,m))}return f}function DC(t,r){let s=-1;const l=[];let d;for(;++s<t.length;){const m=t[s];let f;if(typeof m=="string")f=m;else switch(m){case-5:{f="\r";break}case-4:{f=`
59
+ `,v)}paste(_){this._core.paste(_)}refresh(_,v){this._verifyIntegers(_,v),this._core.refresh(_,v)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(_){this._addonManager.loadAddon(this,_)}static get strings(){return o}_verifyIntegers(..._){for(const v of _)if(v===1/0||isNaN(v)||v%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(..._){for(const v of _)if(v&&(v===1/0||isNaN(v)||v%1!=0||v<0))throw new Error("This API only accepts positive integers")}}f.Terminal=k})(),m})()))})(nh)),nh.exports}var kS=ES();class AS{constructor(r,s){Bm(this,"socket");const d=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal/${encodeURIComponent(r)}`;this.socket=new WebSocket(d),this.socket.addEventListener("message",m=>{var o,c,u;let f;try{f=JSON.parse(m.data)}catch(g){(o=s.onError)==null||o.call(s,`Terminal message parse failed for session ${r}. Reason: ${cl(g)}`);return}f.type==="output"?s.onOutput(f.data):f.type==="error"?(c=s.onError)==null||c.call(s,f.message):(u=s.onStatus)==null||u.call(s,f)}),this.socket.addEventListener("error",()=>{var m;(m=s.onError)==null||m.call(s,`Terminal WebSocket connection failed for session ${r}. URL: ${d}. Check that the VCM backend is running and the session still exists.`)})}sendInput(r){this.send({type:"input",data:r})}resize(r,s){this.send({type:"resize",cols:r,rows:s})}close(){this.socket.close()}send(r){const s=JSON.stringify(r);if(this.socket.readyState===WebSocket.OPEN){this.socket.send(s);return}this.socket.addEventListener("open",()=>this.socket.send(s),{once:!0})}}function Po({sessionId:t,active:r=!0,onEvent:s}){const l=ee.useRef(null),d=ee.useRef(null),m=ee.useRef(null),f=ee.useRef(null),o=ee.useRef(null),c=ee.useRef(""),u=ee.useRef(""),g=ee.useRef(r),h=ee.useRef(s),[S,w]=ee.useState("idle");function T(_){w(_),o.current!==null&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,w("idle")},1600)}async function k(){const _=f.current,v=Xm(_,c.current,u.current);if(!v){T("empty"),_==null||_.focus();return}T(await Jm(v)?"copied":"failed"),_==null||_.focus()}function y(_={}){const v=l.current,b=d.current,E=m.current,O=f.current;if(!v||!b||!E||!O)return!1;const R=v.getBoundingClientRect();return R.width<Zm||R.height<eg||(E.fit(),O.cols<tg||O.rows<ng)?!1:(b.resize(O.cols,O.rows),_.focus&&O.focus(),!0)}return ee.useEffect(()=>{h.current=s},[s]),ee.useEffect(()=>{g.current=r},[r]),ee.useEffect(()=>{var W;if(!l.current)return;const _=new kS.Terminal({cursorBlink:!0,convertEol:!0,drawBoldTextInBrightColors:!0,fontFamily:"Menlo, Monaco, Consolas, monospace",fontSize:13,fontWeight:"400",fontWeightBold:"700",lineHeight:1.35,macOptionIsMeta:!0,scrollback:1e4,theme:LS}),v=new CS.FitAddon;_.loadAddon(v),_.loadAddon(new xS.WebLinksAddon),_.open(l.current),f.current=_,m.current=v;const b=_.onSelectionChange(()=>{const K=_.getSelection();K&&(c.current=K,u.current="")}),E=_.parser.registerOscHandler(52,K=>{const V=DS(K);return V?(u.current=V,b_(V).then(Y=>{T(Y?"copied":"ready")}),!0):!1}),O=K=>{const V=Xm(_,c.current,u.current);!V||!K.clipboardData||(K.clipboardData.setData("text/plain",V),K.preventDefault(),T("copied"))};(W=_.element)==null||W.addEventListener("copy",O),_.attachCustomKeyEventHandler(K=>{if(!RS(K))return!0;const V=_.getSelection()||c.current;return V?(K.preventDefault(),K.stopPropagation(),Jm(V).then(Y=>{T(Y?"copied":"failed")}),!1):!0});const R=l.current.getBoundingClientRect();R.width>=Zm&&R.height>=eg&&v.fit();const D=new AS(t,{onOutput(K){_.write(K)},onStatus(K){var V;(V=h.current)==null||V.call(h,K.type)},onError(K){var V;_.writeln(`\r
60
+ [VCM] ${K}`),(V=h.current)==null||V.call(h,K)}});d.current=D,_.cols>=tg&&_.rows>=ng&&D.resize(_.cols,_.rows);const A=_.onData(K=>{D.sendInput(K)});let M=0,L=0,H=0;const U=()=>{M&&window.cancelAnimationFrame(M),M=window.requestAnimationFrame(()=>{M=0,y({focus:g.current})})},P=new ResizeObserver(()=>{U()});return P.observe(l.current),L=window.requestAnimationFrame(U),H=window.setTimeout(U,120),()=>{var K;M&&window.cancelAnimationFrame(M),L&&window.cancelAnimationFrame(L),H&&window.clearTimeout(H),P.disconnect(),(K=_.element)==null||K.removeEventListener("copy",O),b.dispose(),E.dispose(),A.dispose(),D.close(),_.dispose(),d.current=null,f.current=null,m.current=null}},[t]),ee.useEffect(()=>{if(!r)return;const _=[],v=[];return _.push(window.requestAnimationFrame(()=>{y({focus:!0}),_.push(window.requestAnimationFrame(()=>y({focus:!0})))})),v.push(window.setTimeout(()=>y({focus:!0}),160)),v.push(window.setTimeout(()=>y({focus:!0}),360)),()=>{for(const b of _)window.cancelAnimationFrame(b);for(const b of v)window.clearTimeout(b)}},[r]),ee.useEffect(()=>{const _=()=>{g.current&&y()};return window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]),ee.useEffect(()=>()=>{o.current!==null&&window.clearTimeout(o.current)},[]),C.jsxs("div",{className:"terminal-frame-shell",children:[C.jsx("div",{className:"terminal-frame",ref:l,onClick:()=>{var _;return(_=f.current)==null?void 0:_.focus()}}),C.jsx("button",{type:"button",className:`terminal-copy-button is-${S}`,title:"Copy selected terminal text",onMouseDown:Qm,onPointerDown:Qm,onClick:()=>void k(),children:TS(S)})]})}function TS(t){return t==="copied"?"Copied":t==="empty"?"No selection":t==="failed"?"Copy failed":t==="ready"?"Copy ready":"Copy"}function Xm(t,r,s){return(t==null?void 0:t.getSelection())||s||r}function RS(t){return t.type==="keydown"&&t.metaKey&&!t.ctrlKey&&!t.altKey&&t.key.toLowerCase()==="c"}function DS(t){const r=t.split(";"),s=r.length>=2?r.slice(1).join(";"):"";if(!s||s==="?")return null;try{const l=window.atob(s),d=new Uint8Array(l.length);for(let m=0;m<l.length;m+=1)d[m]=l.charCodeAt(m);return new TextDecoder().decode(d)}catch{return null}}function Qm(t){t.preventDefault(),t.stopPropagation()}async function Jm(t){return await b_(t)?!0:MS(t)}async function b_(t){var r;try{if((r=navigator.clipboard)!=null&&r.writeText)return await navigator.clipboard.writeText(t),!0}catch{return!1}return!1}function MS(t){const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.top="0",r.style.left="-9999px",r.style.opacity="0",document.body.appendChild(r),r.focus(),r.select();try{return document.execCommand("copy")}finally{r.remove()}}const Zm=160,eg=80,tg=20,ng=5,LS={background:"#0d1117",foreground:"#d6deeb",cursor:"#ffd866",cursorAccent:"#0d1117",selectionBackground:"#264f78",selectionForeground:"#ffffff",black:"#1f2430",red:"#ff5c57",green:"#5af78e",yellow:"#f3f99d",blue:"#57c7ff",magenta:"#ff6ac1",cyan:"#9aedfe",white:"#f1f1f0",brightBlack:"#686868",brightRed:"#ff5c57",brightGreen:"#5af78e",brightYellow:"#f3f99d",brightBlue:"#57c7ff",brightMagenta:"#ff6ac1",brightCyan:"#9aedfe",brightWhite:"#ffffff"};function jn({status:t}){return C.jsx("span",{className:`status-badge status-${t}`,children:t.replaceAll("_"," ")})}function Uh({role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m=v_(),busy:f=!1,onPermissionModeChange:o,onModelChange:c,onEffortChange:u,onStart:g,onResume:h,onStop:S,onRestart:w,onNotifyHarnessUpdated:T}){const k=(r==null?void 0:r.status)==="running",y=!!(r!=null&&r.claudeSessionId&&!k),_=!k&&!(r!=null&&r.claudeSessionId),v=!!(r!=null&&r.harnessOutdated),b=m.find(E=>E.value===l);return C.jsxs("div",{className:"session-controls",children:[C.jsxs("label",{className:"session-option-field permission-mode-field",children:[C.jsx("span",{children:"Permission"}),C.jsx("select",{value:s,onChange:E=>o(E.target.value),children:__.map(E=>C.jsx("option",{value:E.value,children:E.label},E.value))})]}),C.jsxs("label",{className:"session-option-field model-field",children:[C.jsx("span",{children:"Model"}),C.jsx("select",{value:l,title:b!=null&&b.available?b.description:b==null?void 0:b.unavailableReason,onChange:E=>c(E.target.value),children:m.map(E=>C.jsx("option",{value:E.value,disabled:!E.available,title:E.available?E.description:E.unavailableReason,children:E.label},E.value))})]}),C.jsxs("label",{className:"session-option-field effort-field",children:[C.jsx("span",{children:"Effort"}),C.jsx("select",{value:d,onChange:E=>u(E.target.value),children:y_.map(E=>C.jsx("option",{value:E.value,children:E.label},E.value))})]}),C.jsxs("div",{className:"session-toolbar",children:[C.jsx("button",{type:"button",disabled:f||!_,onClick:g,children:"Start"}),C.jsx("button",{type:"button",disabled:f||!y,onClick:h,children:"Resume"}),C.jsx("button",{type:"button",disabled:f||!r,onClick:w,children:"Restart"}),C.jsx("button",{type:"button",disabled:f||!r,onClick:S,children:"Stop"})]}),v?C.jsxs("div",{className:"session-harness-notice",children:[C.jsx(jn,{status:"outdated"}),C.jsxs("span",{children:["Harness updated",(r==null?void 0:r.harnessRevision)!==void 0&&r.harnessCurrentRevision!==void 0?` (${r.harnessRevision} -> ${r.harnessCurrentRevision})`:""]}),C.jsx("button",{type:"button",disabled:f||!k||!T,onClick:T,children:"Notify role"})]}):null]})}function OS({busy:t,effort:r,model:s,modelOptions:l,open:d,permissionMode:m,taskSlug:f,bootstrapStatus:o,engineerSession:c,status:u,feedbackState:g,memoryState:h,onClose:S,onEffortChange:w,onModelChange:T,onPermissionModeChange:k,onEngineerResume:y,onEngineerRestart:_,onEngineerStart:v,onEngineerStop:b,onEngineerNotifyHarnessUpdated:E,onSendFeedback:O,onOpenRepositoryDiff:R,onReviewTaskHarness:D,onRefresh:A,onMemoryStateChange:M}){var jt;const[L,H]=ee.useState(null),[U,P]=ee.useState(!1),[W,K]=ee.useState(null),[V,Y]=ee.useState(""),[te,z]=ee.useState(!1),[j,N]=ee.useState(!1),[,q]=Ii(null),[I,ie]=ee.useState(null),pe=(u==null?void 0:u.files)??[],ge=pe.filter(re=>re.kind.startsWith("agent-")),Q=ge.filter(re=>ig(re)),$=ge.filter(re=>!ig(re)),he=pe.filter(re=>re.kind.startsWith("skill-")),le=pe.filter(re=>re.kind.startsWith("tool-")),xe=pe.filter(re=>re.kind==="root-claude"||re.kind==="gitignore"||re.kind==="pull-request-template"),Ce=!!(W&&V!==W.content);ee.useEffect(()=>{d||(H(null),P(!1),K(null),Y(""),z(!1),q(null))},[pe,d,L]),ee.useEffect(()=>{if(!d||!L||!f||L.startsWith("memory-review:"))return;let re=!1;return N(!0),q(null),z(!1),(U?ye.getMemoryFileContent(f,L).then(ke=>({path:ke.path,title:ke.title,content:ke.content,editable:ke.editable,source:"memory"})):ye.getHarnessFileContent(f,L).then(ke=>({path:ke.path,title:ke.title,content:ke.content,editable:ke.editable,readonlyReason:ke.readonlyReason,source:"harness"}))).then(ke=>{re||(K(ke),Y(ke.content))}).catch(ke=>{re||q(lt(`Load harness file ${L}`,ke))}).finally(()=>{re||N(!1)}),()=>{re=!0}},[d,U,L,f]);async function Le(){if(!(!W||!W.editable||!Ce||!f)){N(!0),q(null);try{if(W.source==="memory"){const re=await ye.updateMemoryFileContent(f,W.path,{content:V}),ve=await ye.getMemoryFileContent(f,W.path);K({path:ve.path,title:ve.title,content:ve.content,editable:!0,source:"memory"}),Y(ve.content),M(re)}else{const re=await ye.updateHarnessFileContent(f,W.path,{content:V});K({path:re.file.path,title:re.file.title,content:re.file.content,editable:re.file.editable,readonlyReason:re.file.readonlyReason,source:"harness"}),Y(re.file.content)}z(!1),A()}catch(re){q(lt(`Save harness file ${W.path}`,re))}finally{N(!1)}}}function Ie(){H(null),P(!1),K(null),Y(""),z(!1),q(null)}async function He(re){q(null);try{await US(re),ie(re),window.setTimeout(()=>{ie(ve=>ve===re?null:ve)},1200)}catch(ve){q(lt(`Copy harness file path ${re}`,ve))}}function $e(re){const ve=`memory-review:${re.runId}`;H(ve),P(!1),K({path:re.runId,title:`Memory Diff: ${re.runId}`,content:re.diff||"No memory diff was recorded.",editable:!1,readonlyReason:`Applied by ${re.source}. Status: ${re.status}.`,source:"memory-diff"}),Y(re.diff||"No memory diff was recorded."),z(!1)}async function De(re){if(!(!f||!re.canRevert||!window.confirm(`Revert memory changes from ${re.runId}?`))){N(!0),q(null);try{const ve=await ye.revertMemoryRun({taskSlug:f,runId:re.runId});M(ve),Ie()}catch(ve){q(lt(`Revert memory review ${re.runId}`,ve))}finally{N(!1)}}}async function Ct(){if(f){N(!0),q(null);try{M(await ye.retryMemoryReview({taskSlug:f}))}catch(re){q(lt("Retry Auto Memory review",re))}finally{N(!1)}}}async function Rt(re){if(f){N(!0),q(null);try{M(await ye.retryDurableDocAssignment({taskSlug:f,assignmentId:re.id}))}catch(ve){q(lt(`Retry durable document assignment ${re.id}`,ve))}finally{N(!1)}}}return d?C.jsx(C.Fragment,{children:C.jsx("div",{className:"modal-backdrop harness-studio-backdrop",children:C.jsxs("section",{className:"harness-studio-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Studio",children:[C.jsxs("header",{className:"harness-studio-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Harness Studio"}),f?null:C.jsx("p",{className:"muted",children:"Create or select a task before editing harness files."})]}),C.jsxs("div",{className:"harness-studio-header-actions",children:[C.jsx("button",{type:"button",disabled:t||!f,onClick:D,children:"Review Task Harness"}),C.jsx("button",{type:"button",disabled:t,onClick:R,children:"Review Diff"}),C.jsx("button",{type:"button",disabled:t,onClick:A,children:"Refresh"}),C.jsx("button",{type:"button",onClick:S,children:"Close"})]})]}),C.jsxs("div",{className:"harness-studio-layout",children:[C.jsx("aside",{className:L?"harness-studio-left harness-studio-left-preview":"harness-studio-left",children:L?C.jsxs("section",{className:"harness-studio-section harness-studio-file-preview",children:[C.jsxs("header",{className:"harness-studio-file-editor-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:(W==null?void 0:W.title)??"Harness File"}),C.jsx("p",{className:"muted",children:(W==null?void 0:W.path)??L})]}),C.jsxs("div",{className:"harness-studio-file-editor-actions",children:[W?C.jsx(jn,{status:W.editable?"ok":"unknown"}):null,te?C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",disabled:j||!f||!(W!=null&&W.editable)||!Ce,onClick:()=>void Le(),children:"Save"}),C.jsx("button",{type:"button",disabled:j,onClick:()=>{Y((W==null?void 0:W.content)??""),z(!1)},children:"Cancel"})]}):C.jsx("button",{type:"button",disabled:j||!f||!(W!=null&&W.editable),onClick:()=>z(!0),children:"Edit"}),C.jsx("button",{type:"button",onClick:Ie,children:"Return"})]})]}),W!=null&&W.readonlyReason?C.jsx("p",{className:"muted",children:W.readonlyReason}):null,C.jsx("textarea",{className:te?"harness-studio-file-textarea is-editing":"harness-studio-file-textarea",value:V,spellCheck:!1,readOnly:!te,disabled:j,onChange:re=>Y(re.target.value)})]}):C.jsxs("div",{className:"harness-studio-left-scroll",children:[C.jsx(Wa,{title:"VCM Roles",files:Q,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)}}),C.jsx(Wa,{title:"Auxiliary Roles",files:$,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)}}),C.jsx(jS,{state:h,busy:j,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!0),H(re)},onViewDiff:$e,onRevert:re=>void De(re),onRetry:()=>void Ct(),onRetryAssignment:re=>void Rt(re)}),C.jsx(BS,{state:g,busy:t,taskSlug:f,onSend:O}),C.jsx(Gs,{title:"Overview",children:C.jsxs("section",{className:"harness-studio-overview",children:[C.jsxs("div",{className:"harness-studio-metrics",children:[C.jsx(Vr,{label:"Fixed install",value:u?u.initialized?u.needsApply?"updates":"current":"new":"unknown"}),C.jsx(Vr,{label:"Revision",value:String((u==null?void 0:u.harnessRevision)??0)}),C.jsx(Vr,{label:"Managed files",value:String(pe.length)}),C.jsx(Vr,{label:"Pending updates",value:String((u==null?void 0:u.plannedChanges.length)??0)}),C.jsx(Vr,{label:"Bootstrap",value:(o==null?void 0:o.status.replaceAll("_"," "))??"unknown"}),C.jsx(Vr,{label:"Code intelligence",value:NS(u)}),C.jsx(Vr,{label:"Engineer",value:rg(c)})]}),u!=null&&u.warnings.length?C.jsx("ul",{className:"warnings",children:u.warnings.map(re=>C.jsx("li",{children:re},re))}):null]})}),C.jsx(Gs,{title:"Code Intelligence",children:C.jsx("ul",{className:"harness-studio-doc-list harness-studio-code-intelligence-list",children:(jt=u==null?void 0:u.codeIntelligence)!=null&&jt.languages.length?u.codeIntelligence.languages.map(re=>C.jsxs("li",{children:[C.jsx("span",{children:re.label}),C.jsx("code",{title:"Language server",children:re.serverCommand}),C.jsx("code",{title:re.pluginReady?"VCM Claude Code plugin ready":"VCM Claude Code plugin missing",children:re.pluginName}),C.jsx(jn,{status:re.state==="server_runnable"?"ok":re.state==="server_failed"?"failed":"missing"}),C.jsx("span",{className:"harness-studio-code-intelligence-detail",children:re.error??"Server runnable; workspace readiness is checked in each role session."})]},re.language)):C.jsx("li",{children:C.jsx("span",{children:"No supported project language detected."})})})}),C.jsx(Wa,{title:"Skills",files:he,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Wa,{title:"Root Context",files:xe,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Wa,{title:"Tools",files:le,selectedPath:L,copiedPath:I,onCopy:re=>void He(re),onSelect:re=>{P(!1),H(re)},collapsible:!0}),C.jsx(Gs,{title:"Project Docs",children:C.jsx("ul",{className:"harness-studio-doc-list",children:(o==null?void 0:o.checks.map(re=>C.jsxs("li",{children:[C.jsx("span",{children:re.path??re.label}),C.jsx(jn,{status:re.status})]},re.key)))??C.jsx("li",{children:C.jsx("span",{children:"No bootstrap status loaded."})})})})]})}),C.jsxs("section",{className:"harness-studio-section harness-studio-engineer",children:[C.jsxs("div",{className:"harness-studio-engineer-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:"Harness Engineer"}),C.jsx("p",{className:"muted",children:rg(c)})]}),C.jsx(jn,{status:(c==null?void 0:c.status)??"unknown"})]}),C.jsx(Uh,{role:"harness-engineer",session:c??void 0,permissionMode:m,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:k,onModelChange:T,onEffortChange:w,onStart:v,onResume:y,onRestart:_,onStop:b,onNotifyHarnessUpdated:E}),C.jsx("div",{className:"harness-engineer-terminal",children:(c==null?void 0:c.status)==="running"?C.jsx(Po,{sessionId:c.id,active:d},c.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"harness-engineer"}),C.jsx("span",{children:c!=null&&c.claudeSessionId?"Resume this task Harness Engineer session.":"Start this task Harness Engineer session."})]})})]})]})]})})}):null}function Vr({label:t,value:r}){return C.jsxs("div",{className:"harness-studio-metric",children:[C.jsx("span",{children:t}),C.jsx("strong",{children:r})]})}function BS({state:t,busy:r,taskSlug:s,onSend:l}){return C.jsx(Gs,{title:`Harness Feedback Inbox (${(t==null?void 0:t.queuedCount)??0})`,children:C.jsx("ul",{className:"harness-studio-doc-list",children:t!=null&&t.pending.length?t.pending.map(d=>C.jsxs("li",{children:[C.jsx("span",{title:d.path,children:d.title}),C.jsx("code",{children:d.reporterRole??"unknown"}),C.jsx("button",{type:"button",title:"Send this feedback to Harness Engineer",disabled:r||!s,onClick:()=>l(d.path),children:"Send"})]},d.path)):C.jsx("li",{children:C.jsx("span",{children:"No pending harness feedback."})})})})}function Wa({title:t,files:r,selectedPath:s,copiedPath:l,onCopy:d,onSelect:m,collapsible:f=!1}){const o=C.jsx("ol",{className:"harness-studio-file-list",children:r.length?r.map(c=>C.jsxs("li",{className:c.path===s?"selected":void 0,children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:c.path,onClick:()=>m(c.path),children:c.path}),C.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${c.path}`,onClick:()=>d(c.path),children:l===c.path?"Copied":"Copy"}),C.jsx(jn,{status:c.action})]},c.path)):C.jsx("li",{children:C.jsx("span",{children:"No files."})})});return f?C.jsx(Gs,{title:t,children:o}):C.jsxs("section",{className:"harness-studio-section",children:[C.jsx("h3",{children:t}),o]})}function jS({state:t,busy:r,copiedPath:s,onCopy:l,onSelect:d,onViewDiff:m,onRevert:f,onRetry:o,onRetryAssignment:c}){var g,h,S;const u=(g=t==null?void 0:t.active)!=null&&g.assignments.length?t.active.assignments:(t==null?void 0:t.runs.flatMap(w=>w.assignments))??[];return C.jsxs(Gs,{title:"Memory",children:[C.jsxs("div",{className:"harness-memory-status",children:[C.jsx("span",{children:"Status"}),C.jsx(jn,{status:zS(t==null?void 0:t.status)}),(h=t==null?void 0:t.active)!=null&&h.currentRole?C.jsxs("span",{className:"muted",children:["Collecting ",t.active.currentRole]}):null,(S=t==null?void 0:t.active)!=null&&S.error?C.jsx("p",{className:"warnings",children:t.active.error}):null,(t==null?void 0:t.status)==="failed"?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:o,children:"Retry"}):null]}),C.jsx("ol",{className:"harness-studio-file-list",children:(t==null?void 0:t.files.map(w=>C.jsxs("li",{children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",title:w.path,onClick:()=>d(w.path),children:w.path}),C.jsx("button",{className:"harness-studio-file-copy-button",type:"button",title:`Copy ${w.path}`,onClick:()=>l(w.path),children:s===w.path?"Copied":"Copy"}),C.jsx("span",{className:"muted",children:HS(w.sizeBytes)})]},w.path)))??C.jsx("li",{children:C.jsx("span",{children:"No memory files."})})}),u.length?C.jsxs("div",{className:"harness-memory-runs",children:[C.jsx("h4",{children:"Durable Documentation"}),C.jsx("ol",{className:"harness-studio-file-list",children:u.map(w=>C.jsxs("li",{children:[C.jsx("span",{className:"harness-studio-file-path-button",title:w.id,children:w.targetPath}),C.jsx("code",{children:w.owner??"PM"}),C.jsx(jn,{status:IS(w.status)}),w.status==="failed"?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,title:w.error,onClick:()=>c(w),children:"Retry"}):null]},w.id))})]}):null,t!=null&&t.runs.length?C.jsxs("div",{className:"harness-memory-runs",children:[C.jsx("h4",{children:"Applied History"}),C.jsx("ol",{className:"harness-studio-file-list",children:t.runs.map(w=>C.jsxs("li",{children:[C.jsx("button",{className:"harness-studio-file-path-button",type:"button",onClick:()=>m(w),children:w.runId}),C.jsx(jn,{status:w.status==="applied"?"ok":w.status==="failed"?"failed":"unknown"}),w.canRevert?C.jsx("button",{className:"harness-memory-action-button",type:"button",disabled:r,onClick:()=>f(w),children:"Revert"}):null]},w.runId))})]}):null]})}function Gs({title:t,children:r}){return C.jsxs("details",{className:"harness-studio-section harness-studio-collapsible-section",children:[C.jsxs("summary",{children:[C.jsx("h3",{children:t}),C.jsx("span",{children:"Show"})]}),C.jsx("div",{className:"harness-studio-collapsible-content",children:r})]})}function ig(t){return t.kind==="agent-project-manager"||t.kind==="agent-architect"||t.kind==="agent-coder"||t.kind==="agent-tester"||t.kind==="agent-reviewer"}function rg(t){return t?t.status==="running"?`${t.status} / ${t.activityStatus??"idle"}`:t.status:"not started"}function NS(t){var r;return((r=t==null?void 0:t.codeIntelligence)==null?void 0:r.state.replaceAll("_"," "))??"unknown"}function HS(t){return t<1024?`${t} B`:`${(t/1024).toFixed(1)} KB`}function zS(t){return t==="collecting"||t==="reviewing"||t==="documenting"?"running":t==="failed"?"failed":t==="idle"?"ok":"unknown"}function IS(t){return t==="completed"?"ok":t==="failed"?"failed":"running"}async function US(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function PS({open:t,taskSlug:r,onClose:s}){var A;const[l,d]=ee.useState(null),[m,f]=ee.useState(null),[o,c]=ee.useState(null),[u,g]=ee.useState(null),[h,S]=ee.useState(null),[w,T]=ee.useState(!1),[k,y]=ee.useState(!1),[,_]=Ii(null),[v,b]=ee.useState(null),E=ee.useMemo(()=>(l==null?void 0:l.files.find(M=>M.path===o))??(l==null?void 0:l.files[0])??null,[l,o]);async function O(M=m){var L;T(!0),_(null);try{if(!r)throw new Error("Create or select a task before reviewing harness commits.");const H=await ye.getRepositoryDiff(r,M);d(H),g(null),f(((L=H.commit)==null?void 0:L.sha)??null),c(U=>{var P;return U&&H.files.some(W=>W.path===U)?U:((P=H.files[0])==null?void 0:P.path)??null})}catch(H){_(lt(M?`Load commit diff ${M}`:"Load latest commit diff",H))}finally{T(!1)}}ee.useEffect(()=>{t&&(f(null),b(null),O(null))},[t,r]);async function R(M){S(M),_(null);try{if(!r)throw new Error("Create or select a task before reviewing file diffs.");const L=await ye.getRepositoryFileDiff(r,M);g(L),c(M)}catch(L){_(lt(`Load task file diff for ${M}`,L))}finally{S(null)}}async function D(){if(_(null),b(null),!r){_("Create or select a task before merging the task branch.");return}if(!l){_("Load the commit diff before merging the task branch.");return}const M=l.commits.length?l.commits.map(H=>`- ${H.shortSha} ${H.subject}`):["- No new commits found."];if(window.confirm([`Merge ${l.sourceBranch} into ${l.targetBranch}?`,"","VCM will run a fast-forward merge only.","The merge will fail if the task worktree or connected repository has uncommitted changes.","If the connected repository branch has diverged, rebase or merge manually first.","","Commits:",...M].join(`
61
+ `))){y(!0);try{const H=await ye.mergeRepositoryDiffToCurrentBranch(r);b(H.changed?`Merged ${H.sourceBranch} into ${H.targetBranch} at ${H.afterSha.slice(0,12)}.`:`${H.targetBranch} already includes ${H.sourceBranch}.`),f(null),await O(null)}catch(H){_(lt("Merge task branch to connected repository branch",H))}finally{y(!1)}}}return t?C.jsx("div",{className:"modal-backdrop repository-diff-backdrop",children:C.jsxs("section",{className:"repository-diff-modal",role:"dialog","aria-modal":"true","aria-label":"Commit Diff",children:[C.jsxs("header",{className:"repository-diff-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Commit Diff"}),C.jsx("p",{children:l?`${((A=l.commit)==null?void 0:A.shortSha)??"HEAD"} · ${l.summary.totalFiles} files · +${l.summary.additions} / -${l.summary.deletions}`:"Review a new commit on the active task worktree branch."})]}),C.jsxs("div",{className:"repository-diff-header-actions",children:[C.jsxs("label",{className:"repository-diff-commit-picker",children:[C.jsx("span",{children:"Commit"}),C.jsx("select",{value:m??"",disabled:w||!(l!=null&&l.commits.length),onChange:M=>{const L=M.target.value||null;f(L),O(L)},children:l==null?void 0:l.commits.map(M=>C.jsxs("option",{value:M.sha,children:[M.shortSha," · ",M.subject]},M.sha))})]}),C.jsx("button",{type:"button",disabled:w,onClick:()=>void O(),children:"Refresh"}),C.jsx("button",{type:"button",disabled:w||k||!r||!(l!=null&&l.commits.length),onClick:()=>void D(),children:k?"Merging...":"Merge to Main"}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]})]}),v?C.jsx("p",{className:"success-banner",children:v}):null,l!=null&&l.warnings.length?C.jsx("ul",{className:"warnings repository-diff-warnings",children:l.warnings.map(M=>C.jsx("li",{children:M},M))}):null,C.jsxs("div",{className:"repository-diff-body",children:[C.jsxs("aside",{className:"repository-diff-sidebar",children:[C.jsx(FS,{report:l,busy:w}),C.jsxs("ol",{className:"repository-diff-file-list",children:[l==null?void 0:l.files.map(M=>C.jsx("li",{className:[(E==null?void 0:E.path)===M.path&&!u?"selected":"",(u==null?void 0:u.path)===M.path?"task-diff-selected":""].filter(Boolean).join(" "),children:C.jsxs("div",{className:"repository-diff-file-row",children:[C.jsxs("button",{className:"repository-diff-file-select",type:"button",onClick:()=>{g(null),c(M.path)},children:[C.jsx("span",{children:M.path}),C.jsxs("small",{children:[Eh(M.status)," · ",sg(M.stage)," · ",xh(M.category)]})]}),C.jsx("button",{className:"repository-diff-task-file-button",type:"button",disabled:h===M.path,title:"View this file diff across the whole task worktree",onClick:()=>void R(M.path),children:h===M.path?"...":"Task diff"})]})},M.path)),l&&l.files.length===0?C.jsx("li",{className:"repository-diff-empty",children:l.commits.length===0?"No new commits on this task branch.":"No files in this commit."}):null]})]}),C.jsx("main",{className:"repository-diff-main",children:u?C.jsx(qS,{diff:u,onClose:()=>g(null)}):E?C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"repository-diff-file-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:E.path}),C.jsxs("p",{children:[xh(E.category)," · ",Eh(E.status)," · ",sg(E.stage)]})]}),C.jsxs("span",{className:"repository-diff-stats",children:["+",E.additions," / -",E.deletions]})]}),E.binary?C.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,E.truncated?C.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,C.jsx("pre",{className:"repository-diff-code","aria-label":`${E.path} diff`,children:C_(E.diff)})]}):C.jsx("div",{className:"repository-diff-placeholder",children:w?"Loading commit diff...":"No diff selected."})})]})]})}):null}function FS({report:t,busy:r}){var l;const s=t==null?void 0:t.summary;return C.jsxs("div",{className:"repository-diff-summary",children:[C.jsx("strong",{children:r?"Loading":t?"Commit changes":"Not loaded"}),s?C.jsxs(C.Fragment,{children:[C.jsxs("span",{children:[s.harnessFiles," harness files"]}),C.jsxs("span",{children:[s.productCodeFiles," product code files"]}),C.jsxs("span",{children:[s.committedFiles," committed files"]}),C.jsxs("span",{children:[(t==null?void 0:t.commits.length)??0," branch commits"]}),C.jsx("span",{children:((l=t==null?void 0:t.commit)==null?void 0:l.subject)??"HEAD"})]}):null]})}function qS({diff:t,onClose:r}){const s=t.file;return C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"repository-diff-file-header",children:[C.jsxs("div",{children:[C.jsx("h3",{children:t.path}),C.jsxs("p",{children:["Task diff · ",t.targetBranch," ",t.baseSha.slice(0,12)," → ",t.sourceBranch," worktree ",t.headSha.slice(0,12)]})]}),C.jsxs("div",{className:"repository-diff-task-file-actions",children:[s?C.jsxs("span",{className:"repository-diff-stats",children:["+",s.additions," / -",s.deletions]}):null,C.jsx("button",{type:"button",onClick:r,children:"Commit diff"})]})]}),t.warnings.length>0?C.jsx("ul",{className:"warnings repository-diff-warnings",children:t.warnings.map(l=>C.jsx("li",{children:l},l))}):null,s?C.jsxs(C.Fragment,{children:[C.jsxs("p",{className:"muted",children:[xh(s.category)," · ",Eh(s.status)," · whole task comparison"]}),s.binary?C.jsx("p",{className:"muted",children:"Binary or non-regular file. Text diff is not available."}):null,s.truncated?C.jsx("p",{className:"muted",children:"Diff was truncated for display."}):null,C.jsx("pre",{className:"repository-diff-code","aria-label":`${t.path} task diff`,children:C_(s.diff)})]}):C.jsx("div",{className:"repository-diff-placeholder",children:"No task-level diff for this file."})]})}function xh(t){switch(t){case"fixed_harness":return"fixed harness";case"tools_hooks":return"tools/hooks";case"generated_context":return"generated context";case"project_docs":return"project docs";case"product_code":return"product code"}}function sg(t){return t.replaceAll("_"," ")}function Eh(t){return t.replaceAll("_"," ")}function C_(t){return t.split(`
62
+ `).filter(r=>!GS(r)).map((r,s)=>C.jsx("span",{className:`repository-diff-line ${$S(r)}`,children:r||" "},`${s}:${r}`))}function $S(t){return t.startsWith("+")&&!t.startsWith("+++")?"repository-diff-line-added":t.startsWith("-")&&!t.startsWith("---")?"repository-diff-line-deleted":t.startsWith("@@")?"repository-diff-line-hunk":"repository-diff-line-context"}function GS(t){return t.startsWith("diff --git")||t.startsWith("index ")||t.startsWith("new file mode ")||t.startsWith("deleted file mode ")||t.startsWith("similarity index ")||t.startsWith("rename from ")||t.startsWith("rename to ")||t.startsWith("--- ")||t.startsWith("+++ ")}function VS({busy:t,effort:r,model:s,modelOptions:l,open:d,permissionMode:m,session:f,onClose:o,onEffortChange:c,onModelChange:u,onPermissionModeChange:g,onResume:h,onRestart:S,onStart:w,onStop:T,onNotifyHarnessUpdated:k}){return d?C.jsx("div",{className:"modal-backdrop translator-session-backdrop",children:C.jsxs("section",{className:"translator-session-modal",role:"dialog","aria-modal":"true","aria-label":"Translator Session",children:[C.jsxs("header",{className:"translator-session-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Translator Session"}),C.jsx("p",{children:WS(f)})]}),C.jsx("button",{type:"button",onClick:o,children:"Close"})]}),C.jsx(Uh,{role:"translator",session:f??void 0,permissionMode:m,model:s,modelOptions:l,effort:r,busy:t,onPermissionModeChange:g,onModelChange:u,onEffortChange:c,onStart:w,onResume:h,onRestart:S,onStop:T,onNotifyHarnessUpdated:k}),C.jsx("div",{className:"translator-session-terminal",children:(f==null?void 0:f.status)==="running"?C.jsx(Po,{sessionId:f.id,active:d},f.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"translator"}),C.jsx("span",{children:f!=null&&f.claudeSessionId?"Resume this task translator session.":"Start the task translator session."})]})})]})}):null}function WS(t){if(!t)return"not started";const r=t.status==="running"?` · ${t.activityStatus??"idle"}`:"";return`${t.status}${r}`}function KS(t,r){const s={};return(t[t.length-1]===""?[...t,""]:t).join((s.padRight?" ":"")+","+(s.padLeft===!1?"":" ")).trim()}const YS=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,XS=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,QS={};function ag(t,r){return(QS.jsx?XS:YS).test(t)}const JS=/[ \t\n\f\r]/g;function ZS(t){return typeof t=="object"?t.type==="text"?lg(t.value):!1:lg(t)}function lg(t){return t.replace(JS,"")===""}class ul{constructor(r,s,l){this.normal=s,this.property=r,l&&(this.space=l)}}ul.prototype.normal={};ul.prototype.property={};ul.prototype.space=void 0;function w_(t,r){const s={},l={};for(const d of t)Object.assign(s,d.property),Object.assign(l,d.normal);return new ul(s,l,r)}function kh(t){return t.toLowerCase()}class Cn{constructor(r,s){this.attribute=s,this.property=r}}Cn.prototype.attribute="";Cn.prototype.booleanish=!1;Cn.prototype.boolean=!1;Cn.prototype.commaOrSpaceSeparated=!1;Cn.prototype.commaSeparated=!1;Cn.prototype.defined=!1;Cn.prototype.mustUseProperty=!1;Cn.prototype.number=!1;Cn.prototype.overloadedBoolean=!1;Cn.prototype.property="";Cn.prototype.spaceSeparated=!1;Cn.prototype.space=void 0;let e1=0;const qe=Zr(),Bt=Zr(),Ah=Zr(),we=Zr(),gt=Zr(),Vs=Zr(),Bn=Zr();function Zr(){return 2**++e1}const Th=Object.freeze(Object.defineProperty({__proto__:null,boolean:qe,booleanish:Bt,commaOrSpaceSeparated:Bn,commaSeparated:Vs,number:we,overloadedBoolean:Ah,spaceSeparated:gt},Symbol.toStringTag,{value:"Module"})),ih=Object.keys(Th);class Ph extends Cn{constructor(r,s,l,d){let m=-1;if(super(r,s),og(this,"space",d),typeof l=="number")for(;++m<ih.length;){const f=ih[m];og(this,ih[m],(l&Th[f])===Th[f])}}}Ph.prototype.defined=!0;function og(t,r,s){s&&(t[r]=s)}function Ys(t){const r={},s={};for(const[l,d]of Object.entries(t.properties)){const m=new Ph(l,t.transform(t.attributes||{},l),d,t.space);t.mustUseProperty&&t.mustUseProperty.includes(l)&&(m.mustUseProperty=!0),r[l]=m,s[kh(l)]=l,s[kh(m.attribute)]=l}return new ul(r,s,t.space)}const x_=Ys({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:we,ariaColIndex:we,ariaColSpan:we,ariaControls:gt,ariaCurrent:null,ariaDescribedBy:gt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:gt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:gt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:gt,ariaLevel:we,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:gt,ariaPlaceholder:null,ariaPosInSet:we,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:gt,ariaRowCount:we,ariaRowIndex:we,ariaRowSpan:we,ariaSelected:Bt,ariaSetSize:we,ariaSort:null,ariaValueMax:we,ariaValueMin:we,ariaValueNow:we,ariaValueText:null,role:null},transform(t,r){return r==="role"?r:"aria-"+r.slice(4).toLowerCase()}});function E_(t,r){return r in t?t[r]:r}function k_(t,r){return E_(t,r.toLowerCase())}const t1=Ys({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Vs,acceptCharset:gt,accessKey:gt,action:null,allow:null,allowFullScreen:qe,allowPaymentRequest:qe,allowUserMedia:qe,alt:null,as:null,async:qe,autoCapitalize:null,autoComplete:gt,autoFocus:qe,autoPlay:qe,blocking:gt,capture:null,charSet:null,checked:qe,cite:null,className:gt,cols:we,colSpan:null,content:null,contentEditable:Bt,controls:qe,controlsList:gt,coords:we|Vs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:qe,defer:qe,dir:null,dirName:null,disabled:qe,download:Ah,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:qe,formTarget:null,headers:gt,height:we,hidden:Ah,high:we,href:null,hrefLang:null,htmlFor:gt,httpEquiv:gt,id:null,imageSizes:null,imageSrcSet:null,inert:qe,inputMode:null,integrity:null,is:null,isMap:qe,itemId:null,itemProp:gt,itemRef:gt,itemScope:qe,itemType:gt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:qe,low:we,manifest:null,max:null,maxLength:we,media:null,method:null,min:null,minLength:we,multiple:qe,muted:qe,name:null,nonce:null,noModule:qe,noValidate:qe,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:qe,optimum:we,pattern:null,ping:gt,placeholder:null,playsInline:qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:qe,referrerPolicy:null,rel:gt,required:qe,reversed:qe,rows:we,rowSpan:we,sandbox:gt,scope:null,scoped:qe,seamless:qe,selected:qe,shadowRootClonable:qe,shadowRootDelegatesFocus:qe,shadowRootMode:null,shape:null,size:we,sizes:null,slot:null,span:we,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:we,step:null,style:null,tabIndex:we,target:null,title:null,translate:null,type:null,typeMustMatch:qe,useMap:null,value:Bt,width:we,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:gt,axis:null,background:null,bgColor:null,border:we,borderColor:null,bottomMargin:we,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:qe,declare:qe,event:null,face:null,frame:null,frameBorder:null,hSpace:we,leftMargin:we,link:null,longDesc:null,lowSrc:null,marginHeight:we,marginWidth:we,noResize:qe,noHref:qe,noShade:qe,noWrap:qe,object:null,profile:null,prompt:null,rev:null,rightMargin:we,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:we,valueType:null,version:null,vAlign:null,vLink:null,vSpace:we,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:qe,disableRemotePlayback:qe,prefix:null,property:null,results:we,security:null,unselectable:null},space:"html",transform:k_}),n1=Ys({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",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:Bn,accentHeight:we,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:we,amplitude:we,arabicForm:null,ascent:we,attributeName:null,attributeType:null,azimuth:we,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:we,by:null,calcMode:null,capHeight:we,className:gt,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:we,diffuseConstant:we,direction:null,display:null,dur:null,divisor:we,dominantBaseline:null,download:qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:we,enableBackground:null,end:null,event:null,exponent:we,externalResourcesRequired:null,fill:null,fillOpacity:we,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:Vs,g2:Vs,glyphName:Vs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:we,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:we,horizOriginX:we,horizOriginY:we,id:null,ideographic:we,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:we,k:we,k1:we,k2:we,k3:we,k4:we,kernelMatrix:Bn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:we,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:we,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:we,overlineThickness:we,paintOrder:null,panose1:null,path:null,pathLength:we,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:gt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:we,pointsAtY:we,pointsAtZ:we,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Bn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Bn,rev:Bn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Bn,requiredFeatures:Bn,requiredFonts:Bn,requiredFormats:Bn,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:we,specularExponent:we,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:we,strikethroughThickness:we,string:null,stroke:null,strokeDashArray:Bn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:we,strokeOpacity:we,strokeWidth:null,style:null,surfaceScale:we,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Bn,tabIndex:we,tableValues:null,target:null,targetX:we,targetY:we,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Bn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:we,underlineThickness:we,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:we,values:null,vAlphabetic:we,vMathematical:we,vectorEffect:null,vHanging:we,vIdeographic:we,version:null,vertAdvY:we,vertOriginX:we,vertOriginY:we,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:we,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:E_}),A_=Ys({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,r){return"xlink:"+r.slice(5).toLowerCase()}}),T_=Ys({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:k_}),R_=Ys({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,r){return"xml:"+r.slice(3).toLowerCase()}}),i1={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"},r1=/[A-Z]/g,cg=/-[a-z]/g,s1=/^data[-\w.:]+$/i;function a1(t,r){const s=kh(r);let l=r,d=Cn;if(s in t.normal)return t.property[t.normal[s]];if(s.length>4&&s.slice(0,4)==="data"&&s1.test(r)){if(r.charAt(4)==="-"){const m=r.slice(5).replace(cg,o1);l="data"+m.charAt(0).toUpperCase()+m.slice(1)}else{const m=r.slice(4);if(!cg.test(m)){let f=m.replace(r1,l1);f.charAt(0)!=="-"&&(f="-"+f),r="data"+f}}d=Ph}return new d(l,r)}function l1(t){return"-"+t.toLowerCase()}function o1(t){return t.charAt(1).toUpperCase()}const c1=w_([x_,t1,A_,T_,R_],"html"),Fh=w_([x_,n1,A_,T_,R_],"svg");function u1(t){return t.join(" ").trim()}var Ps={},rh,ug;function h1(){if(ug)return rh;ug=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,s=/^\s*/,l=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,d=/^:\s*/,m=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,f=/^[;\s]*/,o=/^\s+|\s+$/g,c=`
63
+ `,u="/",g="*",h="",S="comment",w="declaration";function T(y,_){if(typeof y!="string")throw new TypeError("First argument must be a string");if(!y)return[];_=_||{};var v=1,b=1;function E(W){var K=W.match(r);K&&(v+=K.length);var V=W.lastIndexOf(c);b=~V?W.length-V:b+W.length}function O(){var W={line:v,column:b};return function(K){return K.position=new R(W),M(),K}}function R(W){this.start=W,this.end={line:v,column:b},this.source=_.source}R.prototype.content=y;function D(W){var K=new Error(_.source+":"+v+":"+b+": "+W);if(K.reason=W,K.filename=_.source,K.line=v,K.column=b,K.source=y,!_.silent)throw K}function A(W){var K=W.exec(y);if(K){var V=K[0];return E(V),y=y.slice(V.length),K}}function M(){A(s)}function L(W){var K;for(W=W||[];K=H();)K!==!1&&W.push(K);return W}function H(){var W=O();if(!(u!=y.charAt(0)||g!=y.charAt(1))){for(var K=2;h!=y.charAt(K)&&(g!=y.charAt(K)||u!=y.charAt(K+1));)++K;if(K+=2,h===y.charAt(K-1))return D("End of comment missing");var V=y.slice(2,K-2);return b+=2,E(V),y=y.slice(K),b+=2,W({type:S,comment:V})}}function U(){var W=O(),K=A(l);if(K){if(H(),!A(d))return D("property missing ':'");var V=A(m),Y=W({type:w,property:k(K[0].replace(t,h)),value:V?k(V[0].replace(t,h)):h});return A(f),Y}}function P(){var W=[];L(W);for(var K;K=U();)K!==!1&&(W.push(K),L(W));return W}return M(),P()}function k(y){return y?y.replace(o,h):h}return rh=T,rh}var hg;function f1(){if(hg)return Ps;hg=1;var t=Ps&&Ps.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.default=s;const r=t(h1());function s(l,d){let m=null;if(!l||typeof l!="string")return m;const f=(0,r.default)(l),o=typeof d=="function";return f.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:g}=c;o?d(u,g,c):g&&(m=m||{},m[u]=g)}),m}return Ps}var Ka={},fg;function d1(){if(fg)return Ka;fg=1,Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,s=/^[^-]+$/,l=/^-(webkit|moz|ms|o|khtml)-/,d=/^-(ms)-/,m=function(u){return!u||s.test(u)||t.test(u)},f=function(u,g){return g.toUpperCase()},o=function(u,g){return"".concat(g,"-")},c=function(u,g){return g===void 0&&(g={}),m(u)?u:(u=u.toLowerCase(),g.reactCompat?u=u.replace(d,o):u=u.replace(l,o),u.replace(r,f))};return Ka.camelCase=c,Ka}var Ya,dg;function p1(){if(dg)return Ya;dg=1;var t=Ya&&Ya.__importDefault||function(d){return d&&d.__esModule?d:{default:d}},r=t(f1()),s=d1();function l(d,m){var f={};return!d||typeof d!="string"||(0,r.default)(d,function(o,c){o&&c&&(f[(0,s.camelCase)(o,m)]=c)}),f}return l.default=l,Ya=l,Ya}var m1=p1();const g1=h_(m1),D_=M_("end"),qh=M_("start");function M_(t){return r;function r(s){const l=s&&s.position&&s.position[t]||{};if(typeof l.line=="number"&&l.line>0&&typeof l.column=="number"&&l.column>0)return{line:l.line,column:l.column,offset:typeof l.offset=="number"&&l.offset>-1?l.offset:void 0}}}function _1(t){const r=qh(t),s=D_(t);if(r&&s)return{start:r,end:s}}function el(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?pg(t.position):"start"in t||"end"in t?pg(t):"line"in t||"column"in t?Rh(t):""}function Rh(t){return mg(t&&t.line)+":"+mg(t&&t.column)}function pg(t){return Rh(t&&t.start)+"-"+Rh(t&&t.end)}function mg(t){return t&&typeof t=="number"?t:1}class nn extends Error{constructor(r,s,l){super(),typeof s=="string"&&(l=s,s=void 0);let d="",m={},f=!1;if(s&&("line"in s&&"column"in s?m={place:s}:"start"in s&&"end"in s?m={place:s}:"type"in s?m={ancestors:[s],place:s.position}:m={...s}),typeof r=="string"?d=r:!m.cause&&r&&(f=!0,d=r.message,m.cause=r),!m.ruleId&&!m.source&&typeof l=="string"){const c=l.indexOf(":");c===-1?m.ruleId=l:(m.source=l.slice(0,c),m.ruleId=l.slice(c+1))}if(!m.place&&m.ancestors&&m.ancestors){const c=m.ancestors[m.ancestors.length-1];c&&(m.place=c.position)}const o=m.place&&"start"in m.place?m.place.start:m.place;this.ancestors=m.ancestors||void 0,this.cause=m.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file="",this.message=d,this.line=o?o.line:void 0,this.name=el(m.place)||"1:1",this.place=m.place||void 0,this.reason=this.message,this.ruleId=m.ruleId||void 0,this.source=m.source||void 0,this.stack=f&&m.cause&&typeof m.cause.stack=="string"?m.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}nn.prototype.file="";nn.prototype.name="";nn.prototype.reason="";nn.prototype.message="";nn.prototype.stack="";nn.prototype.column=void 0;nn.prototype.line=void 0;nn.prototype.ancestors=void 0;nn.prototype.cause=void 0;nn.prototype.fatal=void 0;nn.prototype.place=void 0;nn.prototype.ruleId=void 0;nn.prototype.source=void 0;const $h={}.hasOwnProperty,v1=new Map,y1=/[A-Z]/g,S1=new Set(["table","tbody","thead","tfoot","tr"]),b1=new Set(["td","th"]),L_="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function C1(t,r){if(!r||r.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const s=r.filePath||void 0;let l;if(r.development){if(typeof r.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");l=D1(s,r.jsxDEV)}else{if(typeof r.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof r.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");l=R1(s,r.jsx,r.jsxs)}const d={Fragment:r.Fragment,ancestors:[],components:r.components||{},create:l,elementAttributeNameCase:r.elementAttributeNameCase||"react",evaluater:r.createEvaluater?r.createEvaluater():void 0,filePath:s,ignoreInvalidStyle:r.ignoreInvalidStyle||!1,passKeys:r.passKeys!==!1,passNode:r.passNode||!1,schema:r.space==="svg"?Fh:c1,stylePropertyNameCase:r.stylePropertyNameCase||"dom",tableCellAlignToStyle:r.tableCellAlignToStyle!==!1},m=O_(d,t,void 0);return m&&typeof m!="string"?m:d.create(t,d.Fragment,{children:m||void 0},void 0)}function O_(t,r,s){if(r.type==="element")return w1(t,r,s);if(r.type==="mdxFlowExpression"||r.type==="mdxTextExpression")return x1(t,r);if(r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement")return k1(t,r,s);if(r.type==="mdxjsEsm")return E1(t,r);if(r.type==="root")return A1(t,r,s);if(r.type==="text")return T1(t,r)}function w1(t,r,s){const l=t.schema;let d=l;r.tagName.toLowerCase()==="svg"&&l.space==="html"&&(d=Fh,t.schema=d),t.ancestors.push(r);const m=j_(t,r.tagName,!1),f=M1(t,r);let o=Vh(t,r);return S1.has(r.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!ZS(c):!0})),B_(t,f,m,r),Gh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,m,f,s)}function x1(t,r){if(r.data&&r.data.estree&&t.evaluater){const l=r.data.estree.body[0];return l.type,t.evaluater.evaluateExpression(l.expression)}al(t,r.position)}function E1(t,r){if(r.data&&r.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(r.data.estree);al(t,r.position)}function k1(t,r,s){const l=t.schema;let d=l;r.name==="svg"&&l.space==="html"&&(d=Fh,t.schema=d),t.ancestors.push(r);const m=r.name===null?t.Fragment:j_(t,r.name,!0),f=L1(t,r),o=Vh(t,r);return B_(t,f,m,r),Gh(f,o),t.ancestors.pop(),t.schema=l,t.create(r,m,f,s)}function A1(t,r,s){const l={};return Gh(l,Vh(t,r)),t.create(r,t.Fragment,l,s)}function T1(t,r){return r.value}function B_(t,r,s,l){typeof s!="string"&&s!==t.Fragment&&t.passNode&&(r.node=l)}function Gh(t,r){if(r.length>0){const s=r.length>1?r:r[0];s&&(t.children=s)}}function R1(t,r,s){return l;function l(d,m,f,o){const u=Array.isArray(f.children)?s:r;return o?u(m,f,o):u(m,f)}}function D1(t,r){return s;function s(l,d,m,f){const o=Array.isArray(m.children),c=qh(l);return r(d,m,f,o,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function M1(t,r){const s={};let l,d;for(d in r.properties)if(d!=="children"&&$h.call(r.properties,d)){const m=O1(t,d,r.properties[d]);if(m){const[f,o]=m;t.tableCellAlignToStyle&&f==="align"&&typeof o=="string"&&b1.has(r.tagName)?l=o:s[f]=o}}if(l){const m=s.style||(s.style={});m[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=l}return s}function L1(t,r){const s={};for(const l of r.attributes)if(l.type==="mdxJsxExpressionAttribute")if(l.data&&l.data.estree&&t.evaluater){const m=l.data.estree.body[0];m.type;const f=m.expression;f.type;const o=f.properties[0];o.type,Object.assign(s,t.evaluater.evaluateExpression(o.argument))}else al(t,r.position);else{const d=l.name;let m;if(l.value&&typeof l.value=="object")if(l.value.data&&l.value.data.estree&&t.evaluater){const o=l.value.data.estree.body[0];o.type,m=t.evaluater.evaluateExpression(o.expression)}else al(t,r.position);else m=l.value===null?!0:l.value;s[d]=m}return s}function Vh(t,r){const s=[];let l=-1;const d=t.passKeys?new Map:v1;for(;++l<r.children.length;){const m=r.children[l];let f;if(t.passKeys){const c=m.type==="element"?m.tagName:m.type==="mdxJsxFlowElement"||m.type==="mdxJsxTextElement"?m.name:void 0;if(c){const u=d.get(c)||0;f=c+"-"+u,d.set(c,u+1)}}const o=O_(t,m,f);o!==void 0&&s.push(o)}return s}function O1(t,r,s){const l=a1(t.schema,r);if(!(s==null||typeof s=="number"&&Number.isNaN(s))){if(Array.isArray(s)&&(s=l.commaSeparated?KS(s):u1(s)),l.property==="style"){let d=typeof s=="object"?s:B1(t,String(s));return t.stylePropertyNameCase==="css"&&(d=j1(d)),["style",d]}return[t.elementAttributeNameCase==="react"&&l.space?i1[l.property]||l.property:l.attribute,s]}}function B1(t,r){try{return g1(r,{reactCompat:!0})}catch(s){if(t.ignoreInvalidStyle)return{};const l=s,d=new nn("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:l,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw d.file=t.filePath||void 0,d.url=L_+"#cannot-parse-style-attribute",d}}function j_(t,r,s){let l;if(!s)l={type:"Literal",value:r};else if(r.includes(".")){const d=r.split(".");let m=-1,f;for(;++m<d.length;){const o=ag(d[m])?{type:"Identifier",name:d[m]}:{type:"Literal",value:d[m]};f=f?{type:"MemberExpression",object:f,property:o,computed:!!(m&&o.type==="Literal"),optional:!1}:o}l=f}else l=ag(r)&&!/^[a-z]/.test(r)?{type:"Identifier",name:r}:{type:"Literal",value:r};if(l.type==="Literal"){const d=l.value;return $h.call(t.components,d)?t.components[d]:d}if(t.evaluater)return t.evaluater.evaluateExpression(l);al(t)}function al(t,r){const s=new nn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:r,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=L_+"#cannot-handle-mdx-estrees-without-createevaluater",s}function j1(t){const r={};let s;for(s in t)$h.call(t,s)&&(r[N1(s)]=t[s]);return r}function N1(t){let r=t.replace(y1,H1);return r.slice(0,3)==="ms-"&&(r="-"+r),r}function H1(t){return"-"+t.toLowerCase()}const sh={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"]},z1={};function Wh(t,r){const s=z1,l=typeof s.includeImageAlt=="boolean"?s.includeImageAlt:!0,d=typeof s.includeHtml=="boolean"?s.includeHtml:!0;return N_(t,l,d)}function N_(t,r,s){if(I1(t)){if("value"in t)return t.type==="html"&&!s?"":t.value;if(r&&"alt"in t&&t.alt)return t.alt;if("children"in t)return gg(t.children,r,s)}return Array.isArray(t)?gg(t,r,s):""}function gg(t,r,s){const l=[];let d=-1;for(;++d<t.length;)l[d]=N_(t[d],r,s);return l.join("")}function I1(t){return!!(t&&typeof t=="object")}const _g=document.createElement("i");function Kh(t){const r="&"+t+";";_g.innerHTML=r;const s=_g.textContent;return s.charCodeAt(s.length-1)===59&&t!=="semi"||s===r?!1:s}function Nn(t,r,s,l){const d=t.length;let m=0,f;if(r<0?r=-r>d?0:d+r:r=r>d?d:r,s=s>0?s:0,l.length<1e4)f=Array.from(l),f.unshift(r,s),t.splice(...f);else for(s&&t.splice(r,s);m<l.length;)f=l.slice(m,m+1e4),f.unshift(r,0),t.splice(...f),m+=1e4,r+=1e4}function Qn(t,r){return t.length>0?(Nn(t,t.length,0,r),t):r}const vg={}.hasOwnProperty;function H_(t){const r={};let s=-1;for(;++s<t.length;)U1(r,t[s]);return r}function U1(t,r){let s;for(s in r){const d=(vg.call(t,s)?t[s]:void 0)||(t[s]={}),m=r[s];let f;if(m)for(f in m){vg.call(d,f)||(d[f]=[]);const o=m[f];P1(d[f],Array.isArray(o)?o:o?[o]:[])}}}function P1(t,r){let s=-1;const l=[];for(;++s<r.length;)(r[s].add==="after"?t:l).push(r[s]);Nn(t,0,0,l)}function z_(t,r){const s=Number.parseInt(t,r);return s<9||s===11||s>13&&s<32||s>126&&s<160||s>55295&&s<57344||s>64975&&s<65008||(s&65535)===65535||(s&65535)===65534||s>1114111?"�":String.fromCodePoint(s)}function ri(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const un=br(/[A-Za-z]/),tn=br(/[\dA-Za-z]/),F1=br(/[#-'*+\--9=?A-Z^-~]/);function Oo(t){return t!==null&&(t<32||t===127)}const Dh=br(/\d/),q1=br(/[\dA-Fa-f]/),$1=br(/[!-/:-@[-`{-~]/);function Be(t){return t!==null&&t<-2}function pt(t){return t!==null&&(t<0||t===32)}function Ke(t){return t===-2||t===-1||t===32}const Fo=br(new RegExp("\\p{P}|\\p{S}","u")),Xr=br(/\s/);function br(t){return r;function r(s){return s!==null&&s>-1&&t.test(String.fromCharCode(s))}}function Xs(t){const r=[];let s=-1,l=0,d=0;for(;++s<t.length;){const m=t.charCodeAt(s);let f="";if(m===37&&tn(t.charCodeAt(s+1))&&tn(t.charCodeAt(s+2)))d=2;else if(m<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(m))||(f=String.fromCharCode(m));else if(m>55295&&m<57344){const o=t.charCodeAt(s+1);m<56320&&o>56319&&o<57344?(f=String.fromCharCode(m,o),d=1):f="�"}else f=String.fromCharCode(m);f&&(r.push(t.slice(l,s),encodeURIComponent(f)),l=s+d+1,f=""),d&&(s+=d,d=0)}return r.join("")+t.slice(l)}function Ze(t,r,s,l){const d=l?l-1:Number.POSITIVE_INFINITY;let m=0;return f;function f(c){return Ke(c)?(t.enter(s),o(c)):r(c)}function o(c){return Ke(c)&&m++<d?(t.consume(c),o):(t.exit(s),r(c))}}const G1={tokenize:V1};function V1(t){const r=t.attempt(this.parser.constructs.contentInitial,l,d);let s;return r;function l(o){if(o===null){t.consume(o);return}return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),Ze(t,r,"linePrefix")}function d(o){return t.enter("paragraph"),m(o)}function m(o){const c=t.enter("chunkText",{contentType:"text",previous:s});return s&&(s.next=c),s=c,f(o)}function f(o){if(o===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(o);return}return Be(o)?(t.consume(o),t.exit("chunkText"),m):(t.consume(o),f)}}const W1={tokenize:K1},yg={tokenize:Y1};function K1(t){const r=this,s=[];let l=0,d,m,f;return o;function o(b){if(l<s.length){const E=s[l];return r.containerState=E[1],t.attempt(E[0].continuation,c,u)(b)}return u(b)}function c(b){if(l++,r.containerState._closeFlow){r.containerState._closeFlow=void 0,d&&v();const E=r.events.length;let O=E,R;for(;O--;)if(r.events[O][0]==="exit"&&r.events[O][1].type==="chunkFlow"){R=r.events[O][1].end;break}_(l);let D=E;for(;D<r.events.length;)r.events[D][1].end={...R},D++;return Nn(r.events,O+1,0,r.events.slice(E)),r.events.length=D,u(b)}return o(b)}function u(b){if(l===s.length){if(!d)return S(b);if(d.currentConstruct&&d.currentConstruct.concrete)return T(b);r.interrupt=!!(d.currentConstruct&&!d._gfmTableDynamicInterruptHack)}return r.containerState={},t.check(yg,g,h)(b)}function g(b){return d&&v(),_(l),S(b)}function h(b){return r.parser.lazy[r.now().line]=l!==s.length,f=r.now().offset,T(b)}function S(b){return r.containerState={},t.attempt(yg,w,T)(b)}function w(b){return l++,s.push([r.currentConstruct,r.containerState]),S(b)}function T(b){if(b===null){d&&v(),_(0),t.consume(b);return}return d=d||r.parser.flow(r.now()),t.enter("chunkFlow",{_tokenizer:d,contentType:"flow",previous:m}),k(b)}function k(b){if(b===null){y(t.exit("chunkFlow"),!0),_(0),t.consume(b);return}return Be(b)?(t.consume(b),y(t.exit("chunkFlow")),l=0,r.interrupt=void 0,o):(t.consume(b),k)}function y(b,E){const O=r.sliceStream(b);if(E&&O.push(null),b.previous=m,m&&(m.next=b),m=b,d.defineSkip(b.start),d.write(O),r.parser.lazy[b.start.line]){let R=d.events.length;for(;R--;)if(d.events[R][1].start.offset<f&&(!d.events[R][1].end||d.events[R][1].end.offset>f))return;const D=r.events.length;let A=D,M,L;for(;A--;)if(r.events[A][0]==="exit"&&r.events[A][1].type==="chunkFlow"){if(M){L=r.events[A][1].end;break}M=!0}for(_(l),R=D;R<r.events.length;)r.events[R][1].end={...L},R++;Nn(r.events,A+1,0,r.events.slice(D)),r.events.length=R}}function _(b){let E=s.length;for(;E-- >b;){const O=s[E];r.containerState=O[1],O[0].exit.call(r,t)}s.length=b}function v(){d.write([null]),m=void 0,d=void 0,r.containerState._closeFlow=void 0}}function Y1(t,r,s){return Ze(t,t.attempt(this.parser.constructs.document,r,s),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ws(t){if(t===null||pt(t)||Xr(t))return 1;if(Fo(t))return 2}function qo(t,r,s){const l=[];let d=-1;for(;++d<t.length;){const m=t[d].resolveAll;m&&!l.includes(m)&&(r=m(r,s),l.push(m))}return r}const Mh={name:"attention",resolveAll:X1,tokenize:Q1};function X1(t,r){let s=-1,l,d,m,f,o,c,u,g;for(;++s<t.length;)if(t[s][0]==="enter"&&t[s][1].type==="attentionSequence"&&t[s][1]._close){for(l=s;l--;)if(t[l][0]==="exit"&&t[l][1].type==="attentionSequence"&&t[l][1]._open&&r.sliceSerialize(t[l][1]).charCodeAt(0)===r.sliceSerialize(t[s][1]).charCodeAt(0)){if((t[l][1]._close||t[s][1]._open)&&(t[s][1].end.offset-t[s][1].start.offset)%3&&!((t[l][1].end.offset-t[l][1].start.offset+t[s][1].end.offset-t[s][1].start.offset)%3))continue;c=t[l][1].end.offset-t[l][1].start.offset>1&&t[s][1].end.offset-t[s][1].start.offset>1?2:1;const h={...t[l][1].end},S={...t[s][1].start};Sg(h,-c),Sg(S,c),f={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...t[l][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...t[s][1].start},end:S},m={type:c>1?"strongText":"emphasisText",start:{...t[l][1].end},end:{...t[s][1].start}},d={type:c>1?"strong":"emphasis",start:{...f.start},end:{...o.end}},t[l][1].end={...f.start},t[s][1].start={...o.end},u=[],t[l][1].end.offset-t[l][1].start.offset&&(u=Qn(u,[["enter",t[l][1],r],["exit",t[l][1],r]])),u=Qn(u,[["enter",d,r],["enter",f,r],["exit",f,r],["enter",m,r]]),u=Qn(u,qo(r.parser.constructs.insideSpan.null,t.slice(l+1,s),r)),u=Qn(u,[["exit",m,r],["enter",o,r],["exit",o,r],["exit",d,r]]),t[s][1].end.offset-t[s][1].start.offset?(g=2,u=Qn(u,[["enter",t[s][1],r],["exit",t[s][1],r]])):g=0,Nn(t,l-1,s-l+3,u),s=l+u.length-g-2;break}}for(s=-1;++s<t.length;)t[s][1].type==="attentionSequence"&&(t[s][1].type="data");return t}function Q1(t,r){const s=this.parser.constructs.attentionMarkers.null,l=this.previous,d=Ws(l);let m;return f;function f(c){return m=c,t.enter("attentionSequence"),o(c)}function o(c){if(c===m)return t.consume(c),o;const u=t.exit("attentionSequence"),g=Ws(c),h=!g||g===2&&d||s.includes(c),S=!d||d===2&&g||s.includes(l);return u._open=!!(m===42?h:h&&(d||!S)),u._close=!!(m===42?S:S&&(g||!h)),r(c)}}function Sg(t,r){t.column+=r,t.offset+=r,t._bufferIndex+=r}const J1={name:"autolink",tokenize:Z1};function Z1(t,r,s){let l=0;return d;function d(w){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),m}function m(w){return un(w)?(t.consume(w),f):w===64?s(w):u(w)}function f(w){return w===43||w===45||w===46||tn(w)?(l=1,o(w)):u(w)}function o(w){return w===58?(t.consume(w),l=0,c):(w===43||w===45||w===46||tn(w))&&l++<32?(t.consume(w),o):(l=0,u(w))}function c(w){return w===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):w===null||w===32||w===60||Oo(w)?s(w):(t.consume(w),c)}function u(w){return w===64?(t.consume(w),g):F1(w)?(t.consume(w),u):s(w)}function g(w){return tn(w)?h(w):s(w)}function h(w){return w===46?(t.consume(w),l=0,g):w===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(w),t.exit("autolinkMarker"),t.exit("autolink"),r):S(w)}function S(w){if((w===45||tn(w))&&l++<63){const T=w===45?S:h;return t.consume(w),T}return s(w)}}const hl={partial:!0,tokenize:eb};function eb(t,r,s){return l;function l(m){return Ke(m)?Ze(t,d,"linePrefix")(m):d(m)}function d(m){return m===null||Be(m)?r(m):s(m)}}const I_={continuation:{tokenize:nb},exit:ib,name:"blockQuote",tokenize:tb};function tb(t,r,s){const l=this;return d;function d(f){if(f===62){const o=l.containerState;return o.open||(t.enter("blockQuote",{_container:!0}),o.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(f),t.exit("blockQuoteMarker"),m}return s(f)}function m(f){return Ke(f)?(t.enter("blockQuotePrefixWhitespace"),t.consume(f),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),r):(t.exit("blockQuotePrefix"),r(f))}}function nb(t,r,s){const l=this;return d;function d(f){return Ke(f)?Ze(t,m,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f):m(f)}function m(f){return t.attempt(I_,r,s)(f)}}function ib(t){t.exit("blockQuote")}const U_={name:"characterEscape",tokenize:rb};function rb(t,r,s){return l;function l(m){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(m),t.exit("escapeMarker"),d}function d(m){return $1(m)?(t.enter("characterEscapeValue"),t.consume(m),t.exit("characterEscapeValue"),t.exit("characterEscape"),r):s(m)}}const P_={name:"characterReference",tokenize:sb};function sb(t,r,s){const l=this;let d=0,m,f;return o;function o(h){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),c}function c(h){return h===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(h),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),m=31,f=tn,g(h))}function u(h){return h===88||h===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(h),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),m=6,f=q1,g):(t.enter("characterReferenceValue"),m=7,f=Dh,g(h))}function g(h){if(h===59&&d){const S=t.exit("characterReferenceValue");return f===tn&&!Kh(l.sliceSerialize(S))?s(h):(t.enter("characterReferenceMarker"),t.consume(h),t.exit("characterReferenceMarker"),t.exit("characterReference"),r)}return f(h)&&d++<m?(t.consume(h),g):s(h)}}const bg={partial:!0,tokenize:lb},Cg={concrete:!0,name:"codeFenced",tokenize:ab};function ab(t,r,s){const l=this,d={partial:!0,tokenize:O};let m=0,f=0,o;return c;function c(R){return u(R)}function u(R){const D=l.events[l.events.length-1];return m=D&&D[1].type==="linePrefix"?D[2].sliceSerialize(D[1],!0).length:0,o=R,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),g(R)}function g(R){return R===o?(f++,t.consume(R),g):f<3?s(R):(t.exit("codeFencedFenceSequence"),Ke(R)?Ze(t,h,"whitespace")(R):h(R))}function h(R){return R===null||Be(R)?(t.exit("codeFencedFence"),l.interrupt?r(R):t.check(bg,k,E)(R)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),S(R))}function S(R){return R===null||Be(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),h(R)):Ke(R)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),Ze(t,w,"whitespace")(R)):R===96&&R===o?s(R):(t.consume(R),S)}function w(R){return R===null||Be(R)?h(R):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),T(R))}function T(R){return R===null||Be(R)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),h(R)):R===96&&R===o?s(R):(t.consume(R),T)}function k(R){return t.attempt(d,E,y)(R)}function y(R){return t.enter("lineEnding"),t.consume(R),t.exit("lineEnding"),_}function _(R){return m>0&&Ke(R)?Ze(t,v,"linePrefix",m+1)(R):v(R)}function v(R){return R===null||Be(R)?t.check(bg,k,E)(R):(t.enter("codeFlowValue"),b(R))}function b(R){return R===null||Be(R)?(t.exit("codeFlowValue"),v(R)):(t.consume(R),b)}function E(R){return t.exit("codeFenced"),r(R)}function O(R,D,A){let M=0;return L;function L(K){return R.enter("lineEnding"),R.consume(K),R.exit("lineEnding"),H}function H(K){return R.enter("codeFencedFence"),Ke(K)?Ze(R,U,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):U(K)}function U(K){return K===o?(R.enter("codeFencedFenceSequence"),P(K)):A(K)}function P(K){return K===o?(M++,R.consume(K),P):M>=f?(R.exit("codeFencedFenceSequence"),Ke(K)?Ze(R,W,"whitespace")(K):W(K)):A(K)}function W(K){return K===null||Be(K)?(R.exit("codeFencedFence"),D(K)):A(K)}}}function lb(t,r,s){const l=this;return d;function d(f){return f===null?s(f):(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),m)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}const ah={name:"codeIndented",tokenize:cb},ob={partial:!0,tokenize:ub};function cb(t,r,s){const l=this;return d;function d(u){return t.enter("codeIndented"),Ze(t,m,"linePrefix",5)(u)}function m(u){const g=l.events[l.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?f(u):s(u)}function f(u){return u===null?c(u):Be(u)?t.attempt(ob,f,c)(u):(t.enter("codeFlowValue"),o(u))}function o(u){return u===null||Be(u)?(t.exit("codeFlowValue"),f(u)):(t.consume(u),o)}function c(u){return t.exit("codeIndented"),r(u)}}function ub(t,r,s){const l=this;return d;function d(f){return l.parser.lazy[l.now().line]?s(f):Be(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),d):Ze(t,m,"linePrefix",5)(f)}function m(f){const o=l.events[l.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):Be(f)?d(f):s(f)}}const hb={name:"codeText",previous:db,resolve:fb,tokenize:pb};function fb(t){let r=t.length-4,s=3,l,d;if((t[s][1].type==="lineEnding"||t[s][1].type==="space")&&(t[r][1].type==="lineEnding"||t[r][1].type==="space")){for(l=s;++l<r;)if(t[l][1].type==="codeTextData"){t[s][1].type="codeTextPadding",t[r][1].type="codeTextPadding",s+=2,r-=2;break}}for(l=s-1,r++;++l<=r;)d===void 0?l!==r&&t[l][1].type!=="lineEnding"&&(d=l):(l===r||t[l][1].type==="lineEnding")&&(t[d][1].type="codeTextData",l!==d+2&&(t[d][1].end=t[l-1][1].end,t.splice(d+2,l-d-2),r-=l-d-2,l=d+2),d=void 0);return t}function db(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pb(t,r,s){let l=0,d,m;return f;function f(h){return t.enter("codeText"),t.enter("codeTextSequence"),o(h)}function o(h){return h===96?(t.consume(h),l++,o):(t.exit("codeTextSequence"),c(h))}function c(h){return h===null?s(h):h===32?(t.enter("space"),t.consume(h),t.exit("space"),c):h===96?(m=t.enter("codeTextSequence"),d=0,g(h)):Be(h)?(t.enter("lineEnding"),t.consume(h),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(h))}function u(h){return h===null||h===32||h===96||Be(h)?(t.exit("codeTextData"),c(h)):(t.consume(h),u)}function g(h){return h===96?(t.consume(h),d++,g):d===l?(t.exit("codeTextSequence"),t.exit("codeText"),r(h)):(m.type="codeTextData",u(h))}}class mb{constructor(r){this.left=r?[...r]:[],this.right=[]}get(r){if(r<0||r>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+r+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return r<this.left.length?this.left[r]:this.right[this.right.length-r+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(r,s){const l=s??Number.POSITIVE_INFINITY;return l<this.left.length?this.left.slice(r,l):r>this.left.length?this.right.slice(this.right.length-l+this.left.length,this.right.length-r+this.left.length).reverse():this.left.slice(r).concat(this.right.slice(this.right.length-l+this.left.length).reverse())}splice(r,s,l){const d=s||0;this.setCursor(Math.trunc(r));const m=this.right.splice(this.right.length-d,Number.POSITIVE_INFINITY);return l&&Xa(this.left,l),m.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(r){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(r)}pushMany(r){this.setCursor(Number.POSITIVE_INFINITY),Xa(this.left,r)}unshift(r){this.setCursor(0),this.right.push(r)}unshiftMany(r){this.setCursor(0),Xa(this.right,r.reverse())}setCursor(r){if(!(r===this.left.length||r>this.left.length&&this.right.length===0||r<0&&this.left.length===0))if(r<this.left.length){const s=this.left.splice(r,Number.POSITIVE_INFINITY);Xa(this.right,s.reverse())}else{const s=this.right.splice(this.left.length+this.right.length-r,Number.POSITIVE_INFINITY);Xa(this.left,s.reverse())}}}function Xa(t,r){let s=0;if(r.length<1e4)t.push(...r);else for(;s<r.length;)t.push(...r.slice(s,s+1e4)),s+=1e4}function F_(t){const r={};let s=-1,l,d,m,f,o,c,u;const g=new mb(t);for(;++s<g.length;){for(;s in r;)s=r[s];if(l=g.get(s),s&&l[1].type==="chunkFlow"&&g.get(s-1)[1].type==="listItemPrefix"&&(c=l[1]._tokenizer.events,m=0,m<c.length&&c[m][1].type==="lineEndingBlank"&&(m+=2),m<c.length&&c[m][1].type==="content"))for(;++m<c.length&&c[m][1].type!=="content";)c[m][1].type==="chunkText"&&(c[m][1]._isInFirstContentOfListItem=!0,m++);if(l[0]==="enter")l[1].contentType&&(Object.assign(r,gb(g,s)),s=r[s],u=!0);else if(l[1]._container){for(m=s,d=void 0;m--;)if(f=g.get(m),f[1].type==="lineEnding"||f[1].type==="lineEndingBlank")f[0]==="enter"&&(d&&(g.get(d)[1].type="lineEndingBlank"),f[1].type="lineEnding",d=m);else if(!(f[1].type==="linePrefix"||f[1].type==="listItemIndent"))break;d&&(l[1].end={...g.get(d)[1].start},o=g.slice(d,s),o.unshift(l),g.splice(d,s-d+1,o))}}return Nn(t,0,Number.POSITIVE_INFINITY,g.slice(0)),!u}function gb(t,r){const s=t.get(r)[1],l=t.get(r)[2];let d=r-1;const m=[];let f=s._tokenizer;f||(f=l.parser[s.contentType](s.start),s._contentTypeTextTrailing&&(f._contentTypeTextTrailing=!0));const o=f.events,c=[],u={};let g,h,S=-1,w=s,T=0,k=0;const y=[k];for(;w;){for(;t.get(++d)[1]!==w;);m.push(d),w._tokenizer||(g=l.sliceStream(w),w.next||g.push(null),h&&f.defineSkip(w.start),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=!0),f.write(g),w._isInFirstContentOfListItem&&(f._gfmTasklistFirstContentOfListItem=void 0)),h=w,w=w.next}for(w=s;++S<o.length;)o[S][0]==="exit"&&o[S-1][0]==="enter"&&o[S][1].type===o[S-1][1].type&&o[S][1].start.line!==o[S][1].end.line&&(k=S+1,y.push(k),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(f.events=[],w?(w._tokenizer=void 0,w.previous=void 0):y.pop(),S=y.length;S--;){const _=o.slice(y[S],y[S+1]),v=m.pop();c.push([v,v+_.length-1]),t.splice(v,2,_)}for(c.reverse(),S=-1;++S<c.length;)u[T+c[S][0]]=T+c[S][1],T+=c[S][1]-c[S][0]-1;return u}const _b={resolve:yb,tokenize:Sb},vb={partial:!0,tokenize:bb};function yb(t){return F_(t),t}function Sb(t,r){let s;return l;function l(o){return t.enter("content"),s=t.enter("chunkContent",{contentType:"content"}),d(o)}function d(o){return o===null?m(o):Be(o)?t.check(vb,f,m)(o):(t.consume(o),d)}function m(o){return t.exit("chunkContent"),t.exit("content"),r(o)}function f(o){return t.consume(o),t.exit("chunkContent"),s.next=t.enter("chunkContent",{contentType:"content",previous:s}),s=s.next,d}}function bb(t,r,s){const l=this;return d;function d(f){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),Ze(t,m,"linePrefix")}function m(f){if(f===null||Be(f))return s(f);const o=l.events[l.events.length-1];return!l.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?r(f):t.interrupt(l.parser.constructs.flow,s,r)(f)}}function q_(t,r,s,l,d,m,f,o,c){const u=c||Number.POSITIVE_INFINITY;let g=0;return h;function h(_){return _===60?(t.enter(l),t.enter(d),t.enter(m),t.consume(_),t.exit(m),S):_===null||_===32||_===41||Oo(_)?s(_):(t.enter(l),t.enter(f),t.enter(o),t.enter("chunkString",{contentType:"string"}),k(_))}function S(_){return _===62?(t.enter(m),t.consume(_),t.exit(m),t.exit(d),t.exit(l),r):(t.enter(o),t.enter("chunkString",{contentType:"string"}),w(_))}function w(_){return _===62?(t.exit("chunkString"),t.exit(o),S(_)):_===null||_===60||Be(_)?s(_):(t.consume(_),_===92?T:w)}function T(_){return _===60||_===62||_===92?(t.consume(_),w):w(_)}function k(_){return!g&&(_===null||_===41||pt(_))?(t.exit("chunkString"),t.exit(o),t.exit(f),t.exit(l),r(_)):g<u&&_===40?(t.consume(_),g++,k):_===41?(t.consume(_),g--,k):_===null||_===32||_===40||Oo(_)?s(_):(t.consume(_),_===92?y:k)}function y(_){return _===40||_===41||_===92?(t.consume(_),k):k(_)}}function $_(t,r,s,l,d,m){const f=this;let o=0,c;return u;function u(w){return t.enter(l),t.enter(d),t.consume(w),t.exit(d),t.enter(m),g}function g(w){return o>999||w===null||w===91||w===93&&!c||w===94&&!o&&"_hiddenFootnoteSupport"in f.parser.constructs?s(w):w===93?(t.exit(m),t.enter(d),t.consume(w),t.exit(d),t.exit(l),r):Be(w)?(t.enter("lineEnding"),t.consume(w),t.exit("lineEnding"),g):(t.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===null||w===91||w===93||Be(w)||o++>999?(t.exit("chunkString"),g(w)):(t.consume(w),c||(c=!Ke(w)),w===92?S:h)}function S(w){return w===91||w===92||w===93?(t.consume(w),o++,h):h(w)}}function G_(t,r,s,l,d,m){let f;return o;function o(S){return S===34||S===39||S===40?(t.enter(l),t.enter(d),t.consume(S),t.exit(d),f=S===40?41:S,c):s(S)}function c(S){return S===f?(t.enter(d),t.consume(S),t.exit(d),t.exit(l),r):(t.enter(m),u(S))}function u(S){return S===f?(t.exit(m),c(f)):S===null?s(S):Be(S)?(t.enter("lineEnding"),t.consume(S),t.exit("lineEnding"),Ze(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===f||S===null||Be(S)?(t.exit("chunkString"),u(S)):(t.consume(S),S===92?h:g)}function h(S){return S===f||S===92?(t.consume(S),g):g(S)}}function tl(t,r){let s;return l;function l(d){return Be(d)?(t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),s=!0,l):Ke(d)?Ze(t,l,s?"linePrefix":"lineSuffix")(d):r(d)}}const Cb={name:"definition",tokenize:xb},wb={partial:!0,tokenize:Eb};function xb(t,r,s){const l=this;let d;return m;function m(w){return t.enter("definition"),f(w)}function f(w){return $_.call(l,t,o,s,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function o(w){return d=ri(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)),w===58?(t.enter("definitionMarker"),t.consume(w),t.exit("definitionMarker"),c):s(w)}function c(w){return pt(w)?tl(t,u)(w):u(w)}function u(w){return q_(t,g,s,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function g(w){return t.attempt(wb,h,h)(w)}function h(w){return Ke(w)?Ze(t,S,"whitespace")(w):S(w)}function S(w){return w===null||Be(w)?(t.exit("definition"),l.parser.defined.push(d),r(w)):s(w)}}function Eb(t,r,s){return l;function l(o){return pt(o)?tl(t,d)(o):s(o)}function d(o){return G_(t,m,s,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function m(o){return Ke(o)?Ze(t,f,"whitespace")(o):f(o)}function f(o){return o===null||Be(o)?r(o):s(o)}}const kb={name:"hardBreakEscape",tokenize:Ab};function Ab(t,r,s){return l;function l(m){return t.enter("hardBreakEscape"),t.consume(m),d}function d(m){return Be(m)?(t.exit("hardBreakEscape"),r(m)):s(m)}}const Tb={name:"headingAtx",resolve:Rb,tokenize:Db};function Rb(t,r){let s=t.length-2,l=3,d,m;return t[l][1].type==="whitespace"&&(l+=2),s-2>l&&t[s][1].type==="whitespace"&&(s-=2),t[s][1].type==="atxHeadingSequence"&&(l===s-1||s-4>l&&t[s-2][1].type==="whitespace")&&(s-=l+1===s?2:4),s>l&&(d={type:"atxHeadingText",start:t[l][1].start,end:t[s][1].end},m={type:"chunkText",start:t[l][1].start,end:t[s][1].end,contentType:"text"},Nn(t,l,s-l+1,[["enter",d,r],["enter",m,r],["exit",m,r],["exit",d,r]])),t}function Db(t,r,s){let l=0;return d;function d(g){return t.enter("atxHeading"),m(g)}function m(g){return t.enter("atxHeadingSequence"),f(g)}function f(g){return g===35&&l++<6?(t.consume(g),f):g===null||pt(g)?(t.exit("atxHeadingSequence"),o(g)):s(g)}function o(g){return g===35?(t.enter("atxHeadingSequence"),c(g)):g===null||Be(g)?(t.exit("atxHeading"),r(g)):Ke(g)?Ze(t,o,"whitespace")(g):(t.enter("atxHeadingText"),u(g))}function c(g){return g===35?(t.consume(g),c):(t.exit("atxHeadingSequence"),o(g))}function u(g){return g===null||g===35||pt(g)?(t.exit("atxHeadingText"),o(g)):(t.consume(g),u)}}const Mb=["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"],wg=["pre","script","style","textarea"],Lb={concrete:!0,name:"htmlFlow",resolveTo:jb,tokenize:Nb},Ob={partial:!0,tokenize:zb},Bb={partial:!0,tokenize:Hb};function jb(t){let r=t.length;for(;r--&&!(t[r][0]==="enter"&&t[r][1].type==="htmlFlow"););return r>1&&t[r-2][1].type==="linePrefix"&&(t[r][1].start=t[r-2][1].start,t[r+1][1].start=t[r-2][1].start,t.splice(r-2,2)),t}function Nb(t,r,s){const l=this;let d,m,f,o,c;return u;function u(I){return g(I)}function g(I){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(I),h}function h(I){return I===33?(t.consume(I),S):I===47?(t.consume(I),m=!0,k):I===63?(t.consume(I),d=3,l.interrupt?r:j):un(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function S(I){return I===45?(t.consume(I),d=2,w):I===91?(t.consume(I),d=5,o=0,T):un(I)?(t.consume(I),d=4,l.interrupt?r:j):s(I)}function w(I){return I===45?(t.consume(I),l.interrupt?r:j):s(I)}function T(I){const ie="CDATA[";return I===ie.charCodeAt(o++)?(t.consume(I),o===ie.length?l.interrupt?r:U:T):s(I)}function k(I){return un(I)?(t.consume(I),f=String.fromCharCode(I),y):s(I)}function y(I){if(I===null||I===47||I===62||pt(I)){const ie=I===47,pe=f.toLowerCase();return!ie&&!m&&wg.includes(pe)?(d=1,l.interrupt?r(I):U(I)):Mb.includes(f.toLowerCase())?(d=6,ie?(t.consume(I),_):l.interrupt?r(I):U(I)):(d=7,l.interrupt&&!l.parser.lazy[l.now().line]?s(I):m?v(I):b(I))}return I===45||tn(I)?(t.consume(I),f+=String.fromCharCode(I),y):s(I)}function _(I){return I===62?(t.consume(I),l.interrupt?r:U):s(I)}function v(I){return Ke(I)?(t.consume(I),v):L(I)}function b(I){return I===47?(t.consume(I),L):I===58||I===95||un(I)?(t.consume(I),E):Ke(I)?(t.consume(I),b):L(I)}function E(I){return I===45||I===46||I===58||I===95||tn(I)?(t.consume(I),E):O(I)}function O(I){return I===61?(t.consume(I),R):Ke(I)?(t.consume(I),O):b(I)}function R(I){return I===null||I===60||I===61||I===62||I===96?s(I):I===34||I===39?(t.consume(I),c=I,D):Ke(I)?(t.consume(I),R):A(I)}function D(I){return I===c?(t.consume(I),c=null,M):I===null||Be(I)?s(I):(t.consume(I),D)}function A(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||pt(I)?O(I):(t.consume(I),A)}function M(I){return I===47||I===62||Ke(I)?b(I):s(I)}function L(I){return I===62?(t.consume(I),H):s(I)}function H(I){return I===null||Be(I)?U(I):Ke(I)?(t.consume(I),H):s(I)}function U(I){return I===45&&d===2?(t.consume(I),V):I===60&&d===1?(t.consume(I),Y):I===62&&d===4?(t.consume(I),N):I===63&&d===3?(t.consume(I),j):I===93&&d===5?(t.consume(I),z):Be(I)&&(d===6||d===7)?(t.exit("htmlFlowData"),t.check(Ob,q,P)(I)):I===null||Be(I)?(t.exit("htmlFlowData"),P(I)):(t.consume(I),U)}function P(I){return t.check(Bb,W,q)(I)}function W(I){return t.enter("lineEnding"),t.consume(I),t.exit("lineEnding"),K}function K(I){return I===null||Be(I)?P(I):(t.enter("htmlFlowData"),U(I))}function V(I){return I===45?(t.consume(I),j):U(I)}function Y(I){return I===47?(t.consume(I),f="",te):U(I)}function te(I){if(I===62){const ie=f.toLowerCase();return wg.includes(ie)?(t.consume(I),N):U(I)}return un(I)&&f.length<8?(t.consume(I),f+=String.fromCharCode(I),te):U(I)}function z(I){return I===93?(t.consume(I),j):U(I)}function j(I){return I===62?(t.consume(I),N):I===45&&d===2?(t.consume(I),j):U(I)}function N(I){return I===null||Be(I)?(t.exit("htmlFlowData"),q(I)):(t.consume(I),N)}function q(I){return t.exit("htmlFlow"),r(I)}}function Hb(t,r,s){const l=this;return d;function d(f){return Be(f)?(t.enter("lineEnding"),t.consume(f),t.exit("lineEnding"),m):s(f)}function m(f){return l.parser.lazy[l.now().line]?s(f):r(f)}}function zb(t,r,s){return l;function l(d){return t.enter("lineEnding"),t.consume(d),t.exit("lineEnding"),t.attempt(hl,r,s)}}const Ib={name:"htmlText",tokenize:Ub};function Ub(t,r,s){const l=this;let d,m,f;return o;function o(j){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(j),c}function c(j){return j===33?(t.consume(j),u):j===47?(t.consume(j),O):j===63?(t.consume(j),b):un(j)?(t.consume(j),A):s(j)}function u(j){return j===45?(t.consume(j),g):j===91?(t.consume(j),m=0,T):un(j)?(t.consume(j),v):s(j)}function g(j){return j===45?(t.consume(j),w):s(j)}function h(j){return j===null?s(j):j===45?(t.consume(j),S):Be(j)?(f=h,Y(j)):(t.consume(j),h)}function S(j){return j===45?(t.consume(j),w):h(j)}function w(j){return j===62?V(j):j===45?S(j):h(j)}function T(j){const N="CDATA[";return j===N.charCodeAt(m++)?(t.consume(j),m===N.length?k:T):s(j)}function k(j){return j===null?s(j):j===93?(t.consume(j),y):Be(j)?(f=k,Y(j)):(t.consume(j),k)}function y(j){return j===93?(t.consume(j),_):k(j)}function _(j){return j===62?V(j):j===93?(t.consume(j),_):k(j)}function v(j){return j===null||j===62?V(j):Be(j)?(f=v,Y(j)):(t.consume(j),v)}function b(j){return j===null?s(j):j===63?(t.consume(j),E):Be(j)?(f=b,Y(j)):(t.consume(j),b)}function E(j){return j===62?V(j):b(j)}function O(j){return un(j)?(t.consume(j),R):s(j)}function R(j){return j===45||tn(j)?(t.consume(j),R):D(j)}function D(j){return Be(j)?(f=D,Y(j)):Ke(j)?(t.consume(j),D):V(j)}function A(j){return j===45||tn(j)?(t.consume(j),A):j===47||j===62||pt(j)?M(j):s(j)}function M(j){return j===47?(t.consume(j),V):j===58||j===95||un(j)?(t.consume(j),L):Be(j)?(f=M,Y(j)):Ke(j)?(t.consume(j),M):V(j)}function L(j){return j===45||j===46||j===58||j===95||tn(j)?(t.consume(j),L):H(j)}function H(j){return j===61?(t.consume(j),U):Be(j)?(f=H,Y(j)):Ke(j)?(t.consume(j),H):M(j)}function U(j){return j===null||j===60||j===61||j===62||j===96?s(j):j===34||j===39?(t.consume(j),d=j,P):Be(j)?(f=U,Y(j)):Ke(j)?(t.consume(j),U):(t.consume(j),W)}function P(j){return j===d?(t.consume(j),d=void 0,K):j===null?s(j):Be(j)?(f=P,Y(j)):(t.consume(j),P)}function W(j){return j===null||j===34||j===39||j===60||j===61||j===96?s(j):j===47||j===62||pt(j)?M(j):(t.consume(j),W)}function K(j){return j===47||j===62||pt(j)?M(j):s(j)}function V(j){return j===62?(t.consume(j),t.exit("htmlTextData"),t.exit("htmlText"),r):s(j)}function Y(j){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(j),t.exit("lineEnding"),te}function te(j){return Ke(j)?Ze(t,z,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):z(j)}function z(j){return t.enter("htmlTextData"),f(j)}}const Yh={name:"labelEnd",resolveAll:$b,resolveTo:Gb,tokenize:Vb},Pb={tokenize:Wb},Fb={tokenize:Kb},qb={tokenize:Yb};function $b(t){let r=-1;const s=[];for(;++r<t.length;){const l=t[r][1];if(s.push(t[r]),l.type==="labelImage"||l.type==="labelLink"||l.type==="labelEnd"){const d=l.type==="labelImage"?4:2;l.type="data",r+=d}}return t.length!==s.length&&Nn(t,0,t.length,s),t}function Gb(t,r){let s=t.length,l=0,d,m,f,o;for(;s--;)if(d=t[s][1],m){if(d.type==="link"||d.type==="labelLink"&&d._inactive)break;t[s][0]==="enter"&&d.type==="labelLink"&&(d._inactive=!0)}else if(f){if(t[s][0]==="enter"&&(d.type==="labelImage"||d.type==="labelLink")&&!d._balanced&&(m=s,d.type!=="labelLink")){l=2;break}}else d.type==="labelEnd"&&(f=s);const c={type:t[m][1].type==="labelLink"?"link":"image",start:{...t[m][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[m][1].start},end:{...t[f][1].end}},g={type:"labelText",start:{...t[m+l+2][1].end},end:{...t[f-2][1].start}};return o=[["enter",c,r],["enter",u,r]],o=Qn(o,t.slice(m+1,m+l+3)),o=Qn(o,[["enter",g,r]]),o=Qn(o,qo(r.parser.constructs.insideSpan.null,t.slice(m+l+4,f-3),r)),o=Qn(o,[["exit",g,r],t[f-2],t[f-1],["exit",u,r]]),o=Qn(o,t.slice(f+1)),o=Qn(o,[["exit",c,r]]),Nn(t,m,t.length,o),t}function Vb(t,r,s){const l=this;let d=l.events.length,m,f;for(;d--;)if((l.events[d][1].type==="labelImage"||l.events[d][1].type==="labelLink")&&!l.events[d][1]._balanced){m=l.events[d][1];break}return o;function o(S){return m?m._inactive?h(S):(f=l.parser.defined.includes(ri(l.sliceSerialize({start:m.end,end:l.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(S),t.exit("labelMarker"),t.exit("labelEnd"),c):s(S)}function c(S){return S===40?t.attempt(Pb,g,f?g:h)(S):S===91?t.attempt(Fb,g,f?u:h)(S):f?g(S):h(S)}function u(S){return t.attempt(qb,g,h)(S)}function g(S){return r(S)}function h(S){return m._balanced=!0,s(S)}}function Wb(t,r,s){return l;function l(h){return t.enter("resource"),t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),d}function d(h){return pt(h)?tl(t,m)(h):m(h)}function m(h){return h===41?g(h):q_(t,f,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function f(h){return pt(h)?tl(t,c)(h):g(h)}function o(h){return s(h)}function c(h){return h===34||h===39||h===40?G_(t,u,s,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):g(h)}function u(h){return pt(h)?tl(t,g)(h):g(h)}function g(h){return h===41?(t.enter("resourceMarker"),t.consume(h),t.exit("resourceMarker"),t.exit("resource"),r):s(h)}}function Kb(t,r,s){const l=this;return d;function d(o){return $_.call(l,t,m,f,"reference","referenceMarker","referenceString")(o)}function m(o){return l.parser.defined.includes(ri(l.sliceSerialize(l.events[l.events.length-1][1]).slice(1,-1)))?r(o):s(o)}function f(o){return s(o)}}function Yb(t,r,s){return l;function l(m){return t.enter("reference"),t.enter("referenceMarker"),t.consume(m),t.exit("referenceMarker"),d}function d(m){return m===93?(t.enter("referenceMarker"),t.consume(m),t.exit("referenceMarker"),t.exit("reference"),r):s(m)}}const Xb={name:"labelStartImage",resolveAll:Yh.resolveAll,tokenize:Qb};function Qb(t,r,s){const l=this;return d;function d(o){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(o),t.exit("labelImageMarker"),m}function m(o){return o===91?(t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelImage"),f):s(o)}function f(o){return o===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(o):r(o)}}const Jb={name:"labelStartLink",resolveAll:Yh.resolveAll,tokenize:Zb};function Zb(t,r,s){const l=this;return d;function d(f){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(f),t.exit("labelMarker"),t.exit("labelLink"),m}function m(f){return f===94&&"_hiddenFootnoteSupport"in l.parser.constructs?s(f):r(f)}}const lh={name:"lineEnding",tokenize:eC};function eC(t,r){return s;function s(l){return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),Ze(t,r,"linePrefix")}}const Do={name:"thematicBreak",tokenize:tC};function tC(t,r,s){let l=0,d;return m;function m(u){return t.enter("thematicBreak"),f(u)}function f(u){return d=u,o(u)}function o(u){return u===d?(t.enter("thematicBreakSequence"),c(u)):l>=3&&(u===null||Be(u))?(t.exit("thematicBreak"),r(u)):s(u)}function c(u){return u===d?(t.consume(u),l++,c):(t.exit("thematicBreakSequence"),Ke(u)?Ze(t,o,"whitespace")(u):o(u))}}const Sn={continuation:{tokenize:sC},exit:lC,name:"list",tokenize:rC},nC={partial:!0,tokenize:oC},iC={partial:!0,tokenize:aC};function rC(t,r,s){const l=this,d=l.events[l.events.length-1];let m=d&&d[1].type==="linePrefix"?d[2].sliceSerialize(d[1],!0).length:0,f=0;return o;function o(w){const T=l.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(T==="listUnordered"?!l.containerState.marker||w===l.containerState.marker:Dh(w)){if(l.containerState.type||(l.containerState.type=T,t.enter(T,{_container:!0})),T==="listUnordered")return t.enter("listItemPrefix"),w===42||w===45?t.check(Do,s,u)(w):u(w);if(!l.interrupt||w===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(w)}return s(w)}function c(w){return Dh(w)&&++f<10?(t.consume(w),c):(!l.interrupt||f<2)&&(l.containerState.marker?w===l.containerState.marker:w===41||w===46)?(t.exit("listItemValue"),u(w)):s(w)}function u(w){return t.enter("listItemMarker"),t.consume(w),t.exit("listItemMarker"),l.containerState.marker=l.containerState.marker||w,t.check(hl,l.interrupt?s:g,t.attempt(nC,S,h))}function g(w){return l.containerState.initialBlankLine=!0,m++,S(w)}function h(w){return Ke(w)?(t.enter("listItemPrefixWhitespace"),t.consume(w),t.exit("listItemPrefixWhitespace"),S):s(w)}function S(w){return l.containerState.size=m+l.sliceSerialize(t.exit("listItemPrefix"),!0).length,r(w)}}function sC(t,r,s){const l=this;return l.containerState._closeFlow=void 0,t.check(hl,d,m);function d(o){return l.containerState.furtherBlankLines=l.containerState.furtherBlankLines||l.containerState.initialBlankLine,Ze(t,r,"listItemIndent",l.containerState.size+1)(o)}function m(o){return l.containerState.furtherBlankLines||!Ke(o)?(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,f(o)):(l.containerState.furtherBlankLines=void 0,l.containerState.initialBlankLine=void 0,t.attempt(iC,r,f)(o))}function f(o){return l.containerState._closeFlow=!0,l.interrupt=void 0,Ze(t,t.attempt(Sn,r,s),"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function aC(t,r,s){const l=this;return Ze(t,d,"listItemIndent",l.containerState.size+1);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="listItemIndent"&&f[2].sliceSerialize(f[1],!0).length===l.containerState.size?r(m):s(m)}}function lC(t){t.exit(this.containerState.type)}function oC(t,r,s){const l=this;return Ze(t,d,"listItemPrefixWhitespace",l.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function d(m){const f=l.events[l.events.length-1];return!Ke(m)&&f&&f[1].type==="listItemPrefixWhitespace"?r(m):s(m)}}const xg={name:"setextUnderline",resolveTo:cC,tokenize:uC};function cC(t,r){let s=t.length,l,d,m;for(;s--;)if(t[s][0]==="enter"){if(t[s][1].type==="content"){l=s;break}t[s][1].type==="paragraph"&&(d=s)}else t[s][1].type==="content"&&t.splice(s,1),!m&&t[s][1].type==="definition"&&(m=s);const f={type:"setextHeading",start:{...t[l][1].start},end:{...t[t.length-1][1].end}};return t[d][1].type="setextHeadingText",m?(t.splice(d,0,["enter",f,r]),t.splice(m+1,0,["exit",t[l][1],r]),t[l][1].end={...t[m][1].end}):t[l][1]=f,t.push(["exit",f,r]),t}function uC(t,r,s){const l=this;let d;return m;function m(u){let g=l.events.length,h;for(;g--;)if(l.events[g][1].type!=="lineEnding"&&l.events[g][1].type!=="linePrefix"&&l.events[g][1].type!=="content"){h=l.events[g][1].type==="paragraph";break}return!l.parser.lazy[l.now().line]&&(l.interrupt||h)?(t.enter("setextHeadingLine"),d=u,f(u)):s(u)}function f(u){return t.enter("setextHeadingLineSequence"),o(u)}function o(u){return u===d?(t.consume(u),o):(t.exit("setextHeadingLineSequence"),Ke(u)?Ze(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||Be(u)?(t.exit("setextHeadingLine"),r(u)):s(u)}}const hC={tokenize:fC};function fC(t){const r=this,s=t.attempt(hl,l,t.attempt(this.parser.constructs.flowInitial,d,Ze(t,t.attempt(this.parser.constructs.flow,d,t.attempt(_b,d)),"linePrefix")));return s;function l(m){if(m===null){t.consume(m);return}return t.enter("lineEndingBlank"),t.consume(m),t.exit("lineEndingBlank"),r.currentConstruct=void 0,s}function d(m){if(m===null){t.consume(m);return}return t.enter("lineEnding"),t.consume(m),t.exit("lineEnding"),r.currentConstruct=void 0,s}}const dC={resolveAll:W_()},pC=V_("string"),mC=V_("text");function V_(t){return{resolveAll:W_(t==="text"?gC:void 0),tokenize:r};function r(s){const l=this,d=this.parser.constructs[t],m=s.attempt(d,f,o);return f;function f(g){return u(g)?m(g):o(g)}function o(g){if(g===null){s.consume(g);return}return s.enter("data"),s.consume(g),c}function c(g){return u(g)?(s.exit("data"),m(g)):(s.consume(g),c)}function u(g){if(g===null)return!0;const h=d[g];let S=-1;if(h)for(;++S<h.length;){const w=h[S];if(!w.previous||w.previous.call(l,l.previous))return!0}return!1}}}function W_(t){return r;function r(s,l){let d=-1,m;for(;++d<=s.length;)m===void 0?s[d]&&s[d][1].type==="data"&&(m=d,d++):(!s[d]||s[d][1].type!=="data")&&(d!==m+2&&(s[m][1].end=s[d-1][1].end,s.splice(m+2,d-m-2),d=m+2),m=void 0);return t?t(s,l):s}}function gC(t,r){let s=0;for(;++s<=t.length;)if((s===t.length||t[s][1].type==="lineEnding")&&t[s-1][1].type==="data"){const l=t[s-1][1],d=r.sliceStream(l);let m=d.length,f=-1,o=0,c;for(;m--;){const u=d[m];if(typeof u=="string"){for(f=u.length;u.charCodeAt(f-1)===32;)o++,f--;if(f)break;f=-1}else if(u===-2)c=!0,o++;else if(u!==-1){m++;break}}if(r._contentTypeTextTrailing&&s===t.length&&(o=0),o){const u={type:s===t.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:m?f:l.start._bufferIndex+f,_index:l.start._index+m,line:l.end.line,column:l.end.column-o,offset:l.end.offset-o},end:{...l.end}};l.end={...u.start},l.start.offset===l.end.offset?Object.assign(l,u):(t.splice(s,0,["enter",u,r],["exit",u,r]),s+=2)}s++}return t}const _C={42:Sn,43:Sn,45:Sn,48:Sn,49:Sn,50:Sn,51:Sn,52:Sn,53:Sn,54:Sn,55:Sn,56:Sn,57:Sn,62:I_},vC={91:Cb},yC={[-2]:ah,[-1]:ah,32:ah},SC={35:Tb,42:Do,45:[xg,Do],60:Lb,61:xg,95:Do,96:Cg,126:Cg},bC={38:P_,92:U_},CC={[-5]:lh,[-4]:lh,[-3]:lh,33:Xb,38:P_,42:Mh,60:[J1,Ib],91:Jb,92:[kb,U_],93:Yh,95:Mh,96:hb},wC={null:[Mh,dC]},xC={null:[42,95]},EC={null:[]},kC=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:xC,contentInitial:vC,disable:EC,document:_C,flow:SC,flowInitial:yC,insideSpan:wC,string:bC,text:CC},Symbol.toStringTag,{value:"Module"}));function AC(t,r,s){let l={_bufferIndex:-1,_index:0,line:s&&s.line||1,column:s&&s.column||1,offset:s&&s.offset||0};const d={},m=[];let f=[],o=[];const c={attempt:D(O),check:D(R),consume:v,enter:b,exit:E,interrupt:D(R,{interrupt:!0})},u={code:null,containerState:{},defineSkip:k,events:[],now:T,parser:t,previous:null,sliceSerialize:S,sliceStream:w,write:h};let g=r.tokenize.call(u,c);return r.resolveAll&&m.push(r),u;function h(H){return f=Qn(f,H),y(),f[f.length-1]!==null?[]:(A(r,0),u.events=qo(m,u.events,u),u.events)}function S(H,U){return RC(w(H),U)}function w(H){return TC(f,H)}function T(){const{_bufferIndex:H,_index:U,line:P,column:W,offset:K}=l;return{_bufferIndex:H,_index:U,line:P,column:W,offset:K}}function k(H){d[H.line]=H.column,L()}function y(){let H;for(;l._index<f.length;){const U=f[l._index];if(typeof U=="string")for(H=l._index,l._bufferIndex<0&&(l._bufferIndex=0);l._index===H&&l._bufferIndex<U.length;)_(U.charCodeAt(l._bufferIndex));else _(U)}}function _(H){g=g(H)}function v(H){Be(H)?(l.line++,l.column=1,l.offset+=H===-3?2:1,L()):H!==-1&&(l.column++,l.offset++),l._bufferIndex<0?l._index++:(l._bufferIndex++,l._bufferIndex===f[l._index].length&&(l._bufferIndex=-1,l._index++)),u.previous=H}function b(H,U){const P=U||{};return P.type=H,P.start=T(),u.events.push(["enter",P,u]),o.push(P),P}function E(H){const U=o.pop();return U.end=T(),u.events.push(["exit",U,u]),U}function O(H,U){A(H,U.from)}function R(H,U){U.restore()}function D(H,U){return P;function P(W,K,V){let Y,te,z,j;return Array.isArray(W)?q(W):"tokenize"in W?q([W]):N(W);function N(ge){return Q;function Q($){const he=$!==null&&ge[$],le=$!==null&&ge.null,xe=[...Array.isArray(he)?he:he?[he]:[],...Array.isArray(le)?le:le?[le]:[]];return q(xe)($)}}function q(ge){return Y=ge,te=0,ge.length===0?V:I(ge[te])}function I(ge){return Q;function Q($){return j=M(),z=ge,ge.partial||(u.currentConstruct=ge),ge.name&&u.parser.constructs.disable.null.includes(ge.name)?pe():ge.tokenize.call(U?Object.assign(Object.create(u),U):u,c,ie,pe)($)}}function ie(ge){return H(z,j),K}function pe(ge){return j.restore(),++te<Y.length?I(Y[te]):V}}}function A(H,U){H.resolveAll&&!m.includes(H)&&m.push(H),H.resolve&&Nn(u.events,U,u.events.length-U,H.resolve(u.events.slice(U),u)),H.resolveTo&&(u.events=H.resolveTo(u.events,u))}function M(){const H=T(),U=u.previous,P=u.currentConstruct,W=u.events.length,K=Array.from(o);return{from:W,restore:V};function V(){l=H,u.previous=U,u.currentConstruct=P,u.events.length=W,o=K,L()}}function L(){l.line in d&&l.column<2&&(l.column=d[l.line],l.offset+=d[l.line]-1)}}function TC(t,r){const s=r.start._index,l=r.start._bufferIndex,d=r.end._index,m=r.end._bufferIndex;let f;if(s===d)f=[t[s].slice(l,m)];else{if(f=t.slice(s,d),l>-1){const o=f[0];typeof o=="string"?f[0]=o.slice(l):f.shift()}m>0&&f.push(t[d].slice(0,m))}return f}function RC(t,r){let s=-1;const l=[];let d;for(;++s<t.length;){const m=t[s];let f;if(typeof m=="string")f=m;else switch(m){case-5:{f="\r";break}case-4:{f=`
64
64
  `;break}case-3:{f=`\r
65
- `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(m)}d=m===-2,l.push(f)}return l.join("")}function MC(t){const l={constructs:H_([AC,...(t||{}).extensions||[]]),content:d(V1),defined:[],document:d(K1),flow:d(fC),lazy:{},string:d(mC),text:d(gC)};return l;function d(m){return f;function f(o){return TC(l,m,o)}}}function LC(t){for(;!F_(t););return t}const Eg=/[\0\t\n\r]/g;function OC(){let t=1,r="",s=!0,l;return d;function d(m,f,o){const c=[];let u,g,h,S,w;for(m=r+(typeof m=="string"?m.toString():new TextDecoder(f||void 0).decode(m)),h=0,r="",s&&(m.charCodeAt(0)===65279&&h++,s=void 0);h<m.length;){if(Eg.lastIndex=h,u=Eg.exec(m),S=u&&u.index!==void 0?u.index:m.length,w=m.charCodeAt(S),!u){r=m.slice(h);break}if(w===10&&h===S&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),h<S&&(c.push(m.slice(h,S)),t+=S-h),w){case 0:{c.push(65533),t++;break}case 9:{for(g=Math.ceil(t/4)*4,c.push(-2);t++<g;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:l=!0,t=1}h=S+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const BC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function jC(t){return t.replace(BC,NC)}function NC(t,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),m=d===120||d===88;return z_(s.slice(m?2:1),m?16:10)}return Kh(s)||t}const K_={}.hasOwnProperty;function HC(t,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),zC(s)(LC(MC(s).document().write(OC()(t,r,!0))))}function zC(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:m(Rt),autolinkProtocol:M,autolinkEmail:M,atxHeading:m(He),blockQuote:m(le),characterEscape:M,characterReference:M,codeFenced:m(xe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:m(xe,f),codeText:m(Ce,f),codeTextData:M,data:M,codeFlowValue:M,definition:m(Le),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:m(Ie),hardBreakEscape:m($e),hardBreakTrailing:m($e),htmlFlow:m(De,f),htmlFlowData:M,htmlText:m(De,f),htmlTextData:M,image:m(Ct),label:f,link:m(Rt),listItem:m(re),listItemValue:S,listOrdered:m(jt,h),listUnordered:m(jt),paragraph:m(ve),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:m(He),strong:m(ke),thematicBreak:m(ot)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:he,autolinkProtocol:$,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ge,characterReference:Q,codeFenced:c(y),codeFencedFence:k,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:c(_),codeText:c(K),codeTextData:L,data:L,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:L,htmlText:c(W),htmlTextData:L,image:c(Y),label:z,labelText:te,lineEnding:H,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:j,resourceTitleString:N,resource:q,setextHeading:c(A),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};Y_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(ce){let Se={type:"root",children:[]};const Ee={stack:[Se],tokenStack:[],config:r,enter:o,exit:u,buffer:f,resume:g,data:s},Oe=[];let Ne=-1;for(;++Ne<ce.length;)if(ce[Ne][1].type==="listOrdered"||ce[Ne][1].type==="listUnordered")if(ce[Ne][0]==="enter")Oe.push(Ne);else{const yt=Oe.pop();Ne=d(ce,yt,Ne)}for(Ne=-1;++Ne<ce.length;){const yt=r[ce[Ne][0]];K_.call(yt,ce[Ne][1].type)&&yt[ce[Ne][1].type].call(Object.assign({sliceSerialize:ce[Ne][2].sliceSerialize},Ee),ce[Ne][1])}if(Ee.tokenStack.length>0){const yt=Ee.tokenStack[Ee.tokenStack.length-1];(yt[1]||kg).call(Ee,void 0,yt[0])}for(Se.position={start:yr(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:yr(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)Se=r.transforms[Ne](Se)||Se;return Se}function d(ce,Se,Ee){let Oe=Se-1,Ne=-1,yt=!1,Pe,wt,bt,Nt;for(;++Oe<=Ee;){const it=ce[Oe];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?Ne++:Ne--,Nt=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(Pe&&!Nt&&!Ne&&!bt&&(bt=Oe),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!Ne&&it[0]==="enter"&&it[1].type==="listItemPrefix"||Ne===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(Pe){let Wt=Oe;for(wt=void 0;Wt--;){const rn=ce[Wt];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;wt&&(ce[wt][1].type="lineEndingBlank",yt=!0),rn[1].type="lineEnding",wt=Wt}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}bt&&(!wt||bt<wt)&&(Pe._spread=!0),Pe.end=Object.assign({},wt?ce[wt][1].start:it[1].end),ce.splice(wt||Oe,0,["exit",Pe,it[2]]),Oe++,Ee++}if(it[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};Pe=Wt,ce.splice(Oe,0,["enter",Wt,it[2]]),Oe++,Ee++,bt=void 0,Nt=!0}}}return ce[Se][1]._spread=yt,Ee}function m(ce,Se){return Ee;function Ee(Oe){o.call(this,ce(Oe),Oe),Se&&Se.call(this,Oe)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(ce,Se,Ee){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Se,Ee||void 0]),ce.position={start:yr(Se.start),end:void 0}}function c(ce){return Se;function Se(Ee){ce&&ce.call(this,Ee),u.call(this,Ee)}}function u(ce,Se){const Ee=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==ce.type&&(Se?Se.call(this,ce,Oe[0]):(Oe[1]||kg).call(this,ce,Oe[0]));else throw new Error("Cannot close `"+ce.type+"` ("+el({start:ce.start,end:ce.end})+"): it’s not open");Ee.position.end=yr(ce.end)}function g(){return Wh(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function S(ce){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ce}function T(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ce}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/(\r?\n|\r)$/g,"")}function v(ce){const Se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=Se,Ee.identifier=ri(this.sliceSerialize(ce)).toLowerCase()}function b(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function E(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function O(ce){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ee=this.sliceSerialize(ce).length;Se.depth=Ee}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ce){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ce){const Ee=this.stack[this.stack.length-1].children;let Oe=Ee[Ee.length-1];(!Oe||Oe.type!=="text")&&(Oe=nt(),Oe.position={start:yr(ce.start),end:void 0},Ee.push(Oe)),this.stack.push(Oe)}function L(ce){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ce),Se.position.end=yr(ce.end)}function H(ce){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=Se.children[Se.children.length-1];Ee.position.end=yr(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,ce),L.call(this,ce))}function U(){this.data.atHardBreak=!0}function P(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function W(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function K(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Y(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function te(ce){const Se=this.sliceSerialize(ce),Ee=this.stack[this.stack.length-2];Ee.label=jC(Se),Ee.identifier=ri(Se).toLowerCase()}function z(){const ce=this.stack[this.stack.length-1],Se=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Oe=ce.children;Ee.children=Oe}else Ee.alt=Se}function j(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function N(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(ce){const Se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=Se,Ee.identifier=ri(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function pe(ce){this.data.characterReferenceType=ce.type}function ge(ce){const Se=this.sliceSerialize(ce),Ee=this.data.characterReferenceType;let Oe;Ee?(Oe=z_(Se,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=Kh(Se);const Ne=this.stack[this.stack.length-1];Ne.value+=Oe}function Q(ce){const Se=this.stack.pop();Se.position.end=yr(ce.end)}function $(ce){L.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ce)}function he(ce){L.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ce)}function le(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function De(){return{type:"html",value:""}}function Ct(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function jt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function re(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function ke(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function ot(){return{type:"thematicBreak"}}}function yr(t){return{line:t.line,column:t.column,offset:t.offset}}function Y_(t,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?Y_(t,l):IC(t,l)}}function IC(t,r){let s;for(s in r)if(K_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&t[s].push(...l);break}case"transforms":{const l=r[s];l&&t[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(t[s],l);break}}}function kg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+el({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is still open")}function UC(t){const r=this;r.parser=s;function s(l){return HC(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function PC(t,r){const s={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(r),!0)};return t.patch(r,s),t.applyData(r,s)}function FC(t,r){const s={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,s),[t.applyData(r,s),{type:"text",value:`
66
- `}]}function qC(t,r){const s=r.value?r.value+`
67
- `:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let m={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(m.data={meta:r.meta}),t.patch(r,m),m=t.applyData(r,m),m={type:"element",tagName:"pre",properties:{},children:[m]},t.patch(r,m),m}function $C(t,r){const s={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function GC(t,r){const s={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function VC(t,r){const s=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Xs(l.toLowerCase()),m=t.footnoteOrder.indexOf(l);let f,o=t.footnoteCounts.get(l);o===void 0?(o=0,t.footnoteOrder.push(l),f=t.footnoteOrder.length):f=m+1,o+=1,t.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(r,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(r,u),t.applyData(r,u)}function WC(t,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function KC(t,r){if(t.options.allowDangerousHtml){const s={type:"raw",value:r.value};return t.patch(r,s),t.applyData(r,s)}}function X_(t,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=t.all(r),m=d[0];m&&m.type==="text"?m.value="["+m.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function YC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return X_(t,r);const d={src:Xs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const m={type:"element",tagName:"img",properties:d,children:[]};return t.patch(r,m),t.applyData(r,m)}function XC(t,r){const s={src:Xs(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return t.patch(r,l),t.applyData(r,l)}function QC(t,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};t.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return t.patch(r,l),t.applyData(r,l)}function JC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return X_(t,r);const d={href:Xs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const m={type:"element",tagName:"a",properties:d,children:t.all(r)};return t.patch(r,m),t.applyData(r,m)}function ZC(t,r){const s={href:Xs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function ew(t,r,s){const l=t.all(r),d=s?tw(s):Q_(r),m={},f=[];if(typeof r.checked=="boolean"){const g=l[0];let h;g&&g.type==="element"&&g.tagName==="p"?h=g:(h={type:"element",tagName:"p",properties:{},children:[]},l.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),m.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const g=l[o];(d||o!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
65
+ `;break}case-2:{f=r?" ":" ";break}case-1:{if(!r&&d)continue;f=" ";break}default:f=String.fromCharCode(m)}d=m===-2,l.push(f)}return l.join("")}function DC(t){const l={constructs:H_([kC,...(t||{}).extensions||[]]),content:d(G1),defined:[],document:d(W1),flow:d(hC),lazy:{},string:d(pC),text:d(mC)};return l;function d(m){return f;function f(o){return AC(l,m,o)}}}function MC(t){for(;!F_(t););return t}const Eg=/[\0\t\n\r]/g;function LC(){let t=1,r="",s=!0,l;return d;function d(m,f,o){const c=[];let u,g,h,S,w;for(m=r+(typeof m=="string"?m.toString():new TextDecoder(f||void 0).decode(m)),h=0,r="",s&&(m.charCodeAt(0)===65279&&h++,s=void 0);h<m.length;){if(Eg.lastIndex=h,u=Eg.exec(m),S=u&&u.index!==void 0?u.index:m.length,w=m.charCodeAt(S),!u){r=m.slice(h);break}if(w===10&&h===S&&l)c.push(-3),l=void 0;else switch(l&&(c.push(-5),l=void 0),h<S&&(c.push(m.slice(h,S)),t+=S-h),w){case 0:{c.push(65533),t++;break}case 9:{for(g=Math.ceil(t/4)*4,c.push(-2);t++<g;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:l=!0,t=1}h=S+1}return o&&(l&&c.push(-5),r&&c.push(r),c.push(null)),c}}const OC=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BC(t){return t.replace(OC,jC)}function jC(t,r,s){if(r)return r;if(s.charCodeAt(0)===35){const d=s.charCodeAt(1),m=d===120||d===88;return z_(s.slice(m?2:1),m?16:10)}return Kh(s)||t}const K_={}.hasOwnProperty;function NC(t,r,s){return r&&typeof r=="object"&&(s=r,r=void 0),HC(s)(MC(DC(s).document().write(LC()(t,r,!0))))}function HC(t){const r={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:m(Rt),autolinkProtocol:M,autolinkEmail:M,atxHeading:m(He),blockQuote:m(le),characterEscape:M,characterReference:M,codeFenced:m(xe),codeFencedFenceInfo:f,codeFencedFenceMeta:f,codeIndented:m(xe,f),codeText:m(Ce,f),codeTextData:M,data:M,codeFlowValue:M,definition:m(Le),definitionDestinationString:f,definitionLabelString:f,definitionTitleString:f,emphasis:m(Ie),hardBreakEscape:m($e),hardBreakTrailing:m($e),htmlFlow:m(De,f),htmlFlowData:M,htmlText:m(De,f),htmlTextData:M,image:m(Ct),label:f,link:m(Rt),listItem:m(re),listItemValue:S,listOrdered:m(jt,h),listUnordered:m(jt),paragraph:m(ve),reference:I,referenceString:f,resourceDestinationString:f,resourceTitleString:f,setextHeading:m(He),strong:m(ke),thematicBreak:m(ot)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:he,autolinkProtocol:$,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:ge,characterReference:Q,codeFenced:c(y),codeFencedFence:k,codeFencedFenceInfo:w,codeFencedFenceMeta:T,codeFlowValue:L,codeIndented:c(_),codeText:c(K),codeTextData:L,data:L,definition:c(),definitionDestinationString:E,definitionLabelString:v,definitionTitleString:b,emphasis:c(),hardBreakEscape:c(U),hardBreakTrailing:c(U),htmlFlow:c(P),htmlFlowData:L,htmlText:c(W),htmlTextData:L,image:c(Y),label:z,labelText:te,lineEnding:H,link:c(V),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ie,resourceDestinationString:j,resourceTitleString:N,resource:q,setextHeading:c(A),setextHeadingLineSequence:D,setextHeadingText:R,strong:c(),thematicBreak:c()}};Y_(r,(t||{}).mdastExtensions||[]);const s={};return l;function l(ce){let Se={type:"root",children:[]};const Ee={stack:[Se],tokenStack:[],config:r,enter:o,exit:u,buffer:f,resume:g,data:s},Oe=[];let Ne=-1;for(;++Ne<ce.length;)if(ce[Ne][1].type==="listOrdered"||ce[Ne][1].type==="listUnordered")if(ce[Ne][0]==="enter")Oe.push(Ne);else{const yt=Oe.pop();Ne=d(ce,yt,Ne)}for(Ne=-1;++Ne<ce.length;){const yt=r[ce[Ne][0]];K_.call(yt,ce[Ne][1].type)&&yt[ce[Ne][1].type].call(Object.assign({sliceSerialize:ce[Ne][2].sliceSerialize},Ee),ce[Ne][1])}if(Ee.tokenStack.length>0){const yt=Ee.tokenStack[Ee.tokenStack.length-1];(yt[1]||kg).call(Ee,void 0,yt[0])}for(Se.position={start:yr(ce.length>0?ce[0][1].start:{line:1,column:1,offset:0}),end:yr(ce.length>0?ce[ce.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<r.transforms.length;)Se=r.transforms[Ne](Se)||Se;return Se}function d(ce,Se,Ee){let Oe=Se-1,Ne=-1,yt=!1,Pe,wt,bt,Nt;for(;++Oe<=Ee;){const it=ce[Oe];switch(it[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{it[0]==="enter"?Ne++:Ne--,Nt=void 0;break}case"lineEndingBlank":{it[0]==="enter"&&(Pe&&!Nt&&!Ne&&!bt&&(bt=Oe),Nt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Nt=void 0}if(!Ne&&it[0]==="enter"&&it[1].type==="listItemPrefix"||Ne===-1&&it[0]==="exit"&&(it[1].type==="listUnordered"||it[1].type==="listOrdered")){if(Pe){let Wt=Oe;for(wt=void 0;Wt--;){const rn=ce[Wt];if(rn[1].type==="lineEnding"||rn[1].type==="lineEndingBlank"){if(rn[0]==="exit")continue;wt&&(ce[wt][1].type="lineEndingBlank",yt=!0),rn[1].type="lineEnding",wt=Wt}else if(!(rn[1].type==="linePrefix"||rn[1].type==="blockQuotePrefix"||rn[1].type==="blockQuotePrefixWhitespace"||rn[1].type==="blockQuoteMarker"||rn[1].type==="listItemIndent"))break}bt&&(!wt||bt<wt)&&(Pe._spread=!0),Pe.end=Object.assign({},wt?ce[wt][1].start:it[1].end),ce.splice(wt||Oe,0,["exit",Pe,it[2]]),Oe++,Ee++}if(it[1].type==="listItemPrefix"){const Wt={type:"listItem",_spread:!1,start:Object.assign({},it[1].start),end:void 0};Pe=Wt,ce.splice(Oe,0,["enter",Wt,it[2]]),Oe++,Ee++,bt=void 0,Nt=!0}}}return ce[Se][1]._spread=yt,Ee}function m(ce,Se){return Ee;function Ee(Oe){o.call(this,ce(Oe),Oe),Se&&Se.call(this,Oe)}}function f(){this.stack.push({type:"fragment",children:[]})}function o(ce,Se,Ee){this.stack[this.stack.length-1].children.push(ce),this.stack.push(ce),this.tokenStack.push([Se,Ee||void 0]),ce.position={start:yr(Se.start),end:void 0}}function c(ce){return Se;function Se(Ee){ce&&ce.call(this,Ee),u.call(this,Ee)}}function u(ce,Se){const Ee=this.stack.pop(),Oe=this.tokenStack.pop();if(Oe)Oe[0].type!==ce.type&&(Se?Se.call(this,ce,Oe[0]):(Oe[1]||kg).call(this,ce,Oe[0]));else throw new Error("Cannot close `"+ce.type+"` ("+el({start:ce.start,end:ce.end})+"): it’s not open");Ee.position.end=yr(ce.end)}function g(){return Wh(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function S(ce){if(this.data.expectingFirstListItemValue){const Se=this.stack[this.stack.length-2];Se.start=Number.parseInt(this.sliceSerialize(ce),10),this.data.expectingFirstListItemValue=void 0}}function w(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.lang=ce}function T(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.meta=ce}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function y(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce.replace(/(\r?\n|\r)$/g,"")}function v(ce){const Se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=Se,Ee.identifier=ri(this.sliceSerialize(ce)).toLowerCase()}function b(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function E(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function O(ce){const Se=this.stack[this.stack.length-1];if(!Se.depth){const Ee=this.sliceSerialize(ce).length;Se.depth=Ee}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function D(ce){const Se=this.stack[this.stack.length-1];Se.depth=this.sliceSerialize(ce).codePointAt(0)===61?1:2}function A(){this.data.setextHeadingSlurpLineEnding=void 0}function M(ce){const Ee=this.stack[this.stack.length-1].children;let Oe=Ee[Ee.length-1];(!Oe||Oe.type!=="text")&&(Oe=nt(),Oe.position={start:yr(ce.start),end:void 0},Ee.push(Oe)),this.stack.push(Oe)}function L(ce){const Se=this.stack.pop();Se.value+=this.sliceSerialize(ce),Se.position.end=yr(ce.end)}function H(ce){const Se=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ee=Se.children[Se.children.length-1];Ee.position.end=yr(ce.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&r.canContainEols.includes(Se.type)&&(M.call(this,ce),L.call(this,ce))}function U(){this.data.atHardBreak=!0}function P(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function W(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function K(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.value=ce}function V(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function Y(){const ce=this.stack[this.stack.length-1];if(this.data.inReference){const Se=this.data.referenceType||"shortcut";ce.type+="Reference",ce.referenceType=Se,delete ce.url,delete ce.title}else delete ce.identifier,delete ce.label;this.data.referenceType=void 0}function te(ce){const Se=this.sliceSerialize(ce),Ee=this.stack[this.stack.length-2];Ee.label=BC(Se),Ee.identifier=ri(Se).toLowerCase()}function z(){const ce=this.stack[this.stack.length-1],Se=this.resume(),Ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ee.type==="link"){const Oe=ce.children;Ee.children=Oe}else Ee.alt=Se}function j(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.url=ce}function N(){const ce=this.resume(),Se=this.stack[this.stack.length-1];Se.title=ce}function q(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function ie(ce){const Se=this.resume(),Ee=this.stack[this.stack.length-1];Ee.label=Se,Ee.identifier=ri(this.sliceSerialize(ce)).toLowerCase(),this.data.referenceType="full"}function pe(ce){this.data.characterReferenceType=ce.type}function ge(ce){const Se=this.sliceSerialize(ce),Ee=this.data.characterReferenceType;let Oe;Ee?(Oe=z_(Se,Ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Oe=Kh(Se);const Ne=this.stack[this.stack.length-1];Ne.value+=Oe}function Q(ce){const Se=this.stack.pop();Se.position.end=yr(ce.end)}function $(ce){L.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url=this.sliceSerialize(ce)}function he(ce){L.call(this,ce);const Se=this.stack[this.stack.length-1];Se.url="mailto:"+this.sliceSerialize(ce)}function le(){return{type:"blockquote",children:[]}}function xe(){return{type:"code",lang:null,meta:null,value:""}}function Ce(){return{type:"inlineCode",value:""}}function Le(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ie(){return{type:"emphasis",children:[]}}function He(){return{type:"heading",depth:0,children:[]}}function $e(){return{type:"break"}}function De(){return{type:"html",value:""}}function Ct(){return{type:"image",title:null,url:"",alt:null}}function Rt(){return{type:"link",title:null,url:"",children:[]}}function jt(ce){return{type:"list",ordered:ce.type==="listOrdered",start:null,spread:ce._spread,children:[]}}function re(ce){return{type:"listItem",spread:ce._spread,checked:null,children:[]}}function ve(){return{type:"paragraph",children:[]}}function ke(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function ot(){return{type:"thematicBreak"}}}function yr(t){return{line:t.line,column:t.column,offset:t.offset}}function Y_(t,r){let s=-1;for(;++s<r.length;){const l=r[s];Array.isArray(l)?Y_(t,l):zC(t,l)}}function zC(t,r){let s;for(s in r)if(K_.call(r,s))switch(s){case"canContainEols":{const l=r[s];l&&t[s].push(...l);break}case"transforms":{const l=r[s];l&&t[s].push(...l);break}case"enter":case"exit":{const l=r[s];l&&Object.assign(t[s],l);break}}}function kg(t,r){throw t?new Error("Cannot close `"+t.type+"` ("+el({start:t.start,end:t.end})+"): a different token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is open"):new Error("Cannot close document, a token (`"+r.type+"`, "+el({start:r.start,end:r.end})+") is still open")}function IC(t){const r=this;r.parser=s;function s(l){return NC(l,{...r.data("settings"),...t,extensions:r.data("micromarkExtensions")||[],mdastExtensions:r.data("fromMarkdownExtensions")||[]})}}function UC(t,r){const s={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(r),!0)};return t.patch(r,s),t.applyData(r,s)}function PC(t,r){const s={type:"element",tagName:"br",properties:{},children:[]};return t.patch(r,s),[t.applyData(r,s),{type:"text",value:`
66
+ `}]}function FC(t,r){const s=r.value?r.value+`
67
+ `:"",l={},d=r.lang?r.lang.split(/\s+/):[];d.length>0&&(l.className=["language-"+d[0]]);let m={type:"element",tagName:"code",properties:l,children:[{type:"text",value:s}]};return r.meta&&(m.data={meta:r.meta}),t.patch(r,m),m=t.applyData(r,m),m={type:"element",tagName:"pre",properties:{},children:[m]},t.patch(r,m),m}function qC(t,r){const s={type:"element",tagName:"del",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function $C(t,r){const s={type:"element",tagName:"em",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function GC(t,r){const s=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",l=String(r.identifier).toUpperCase(),d=Xs(l.toLowerCase()),m=t.footnoteOrder.indexOf(l);let f,o=t.footnoteCounts.get(l);o===void 0?(o=0,t.footnoteOrder.push(l),f=t.footnoteOrder.length):f=m+1,o+=1,t.footnoteCounts.set(l,o);const c={type:"element",tagName:"a",properties:{href:"#"+s+"fn-"+d,id:s+"fnref-"+d+(o>1?"-"+o:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(f)}]};t.patch(r,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(r,u),t.applyData(r,u)}function VC(t,r){const s={type:"element",tagName:"h"+r.depth,properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function WC(t,r){if(t.options.allowDangerousHtml){const s={type:"raw",value:r.value};return t.patch(r,s),t.applyData(r,s)}}function X_(t,r){const s=r.referenceType;let l="]";if(s==="collapsed"?l+="[]":s==="full"&&(l+="["+(r.label||r.identifier)+"]"),r.type==="imageReference")return[{type:"text",value:"!["+r.alt+l}];const d=t.all(r),m=d[0];m&&m.type==="text"?m.value="["+m.value:d.unshift({type:"text",value:"["});const f=d[d.length-1];return f&&f.type==="text"?f.value+=l:d.push({type:"text",value:l}),d}function KC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return X_(t,r);const d={src:Xs(l.url||""),alt:r.alt};l.title!==null&&l.title!==void 0&&(d.title=l.title);const m={type:"element",tagName:"img",properties:d,children:[]};return t.patch(r,m),t.applyData(r,m)}function YC(t,r){const s={src:Xs(r.url)};r.alt!==null&&r.alt!==void 0&&(s.alt=r.alt),r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"img",properties:s,children:[]};return t.patch(r,l),t.applyData(r,l)}function XC(t,r){const s={type:"text",value:r.value.replace(/\r?\n|\r/g," ")};t.patch(r,s);const l={type:"element",tagName:"code",properties:{},children:[s]};return t.patch(r,l),t.applyData(r,l)}function QC(t,r){const s=String(r.identifier).toUpperCase(),l=t.definitionById.get(s);if(!l)return X_(t,r);const d={href:Xs(l.url||"")};l.title!==null&&l.title!==void 0&&(d.title=l.title);const m={type:"element",tagName:"a",properties:d,children:t.all(r)};return t.patch(r,m),t.applyData(r,m)}function JC(t,r){const s={href:Xs(r.url)};r.title!==null&&r.title!==void 0&&(s.title=r.title);const l={type:"element",tagName:"a",properties:s,children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function ZC(t,r,s){const l=t.all(r),d=s?ew(s):Q_(r),m={},f=[];if(typeof r.checked=="boolean"){const g=l[0];let h;g&&g.type==="element"&&g.tagName==="p"?h=g:(h={type:"element",tagName:"p",properties:{},children:[]},l.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:r.checked,disabled:!0},children:[]}),m.className=["task-list-item"]}let o=-1;for(;++o<l.length;){const g=l[o];(d||o!==0||g.type!=="element"||g.tagName!=="p")&&f.push({type:"text",value:`
68
68
  `}),g.type==="element"&&g.tagName==="p"&&!d?f.push(...g.children):f.push(g)}const c=l[l.length-1];c&&(d||c.type!=="element"||c.tagName!=="p")&&f.push({type:"text",value:`
69
- `});const u={type:"element",tagName:"li",properties:m,children:f};return t.patch(r,u),t.applyData(r,u)}function tw(t){let r=!1;if(t.type==="list"){r=t.spread||!1;const s=t.children;let l=-1;for(;!r&&++l<s.length;)r=Q_(s[l])}return r}function Q_(t){const r=t.spread;return r??t.children.length>1}function nw(t,r){const s={},l=t.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const m={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:t.wrap(l,!0)};return t.patch(r,m),t.applyData(r,m)}function iw(t,r){const s={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function rw(t,r){const s={type:"root",children:t.wrap(t.all(r))};return t.patch(r,s),t.applyData(r,s)}function sw(t,r){const s={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function aw(t,r){const s=t.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:t.wrap([l],!0)};t.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(s,!0)},o=qh(r.children[1]),c=D_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const m={type:"element",tagName:"table",properties:{},children:t.wrap(d,!0)};return t.patch(r,m),t.applyData(r,m)}function lw(t,r,s){const l=s?s.children:void 0,m=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const u=[];for(;++c<o;){const h=r.children[c],S={},w=f?f[c]:void 0;w&&(S.align=w);let T={type:"element",tagName:m,properties:S,children:[]};h&&(T.children=t.all(h),t.patch(h,T),T=t.applyData(h,T)),u.push(T)}const g={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(r,g),t.applyData(r,g)}function ow(t,r){const s={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}const Ag=9,Tg=32;function cw(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const m=[];for(;l;)m.push(Rg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return m.push(Rg(r.slice(d),d>0,!1)),m.join("")}function Rg(t,r,s){let l=0,d=t.length;if(r){let m=t.codePointAt(l);for(;m===Ag||m===Tg;)l++,m=t.codePointAt(l)}if(s){let m=t.codePointAt(d-1);for(;m===Ag||m===Tg;)d--,m=t.codePointAt(d-1)}return d>l?t.slice(l,d):""}function uw(t,r){const s={type:"text",value:cw(String(r.value))};return t.patch(r,s),t.applyData(r,s)}function hw(t,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,s),t.applyData(r,s)}const fw={blockquote:PC,break:FC,code:qC,delete:$C,emphasis:GC,footnoteReference:VC,heading:WC,html:KC,imageReference:YC,image:XC,inlineCode:QC,linkReference:JC,link:ZC,listItem:ew,list:nw,paragraph:iw,root:rw,strong:sw,table:aw,tableCell:ow,tableRow:lw,text:uw,thematicBreak:hw,toml:Eo,yaml:Eo,definition:Eo,footnoteDefinition:Eo};function Eo(){}const J_=-1,$o=0,nl=1,Bo=2,Xh=3,Qh=4,Jh=5,Zh=6,Z_=7,ev=8,dw=typeof self=="object"?self:globalThis,Dg=(t,r)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new dw[t](r)},pw=(t,r)=>{const s=(d,m)=>(t.set(m,d),d),l=d=>{if(t.has(d))return t.get(d);const[m,f]=r[d];switch(m){case $o:case J_:return s(f,d);case nl:{const o=s([],d);for(const c of f)o.push(l(c));return o}case Bo:{const o=s({},d);for(const[c,u]of f)o[l(c)]=l(u);return o}case Xh:return s(new Date(f),d);case Qh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Jh:{const o=s(new Map,d);for(const[c,u]of f)o.set(l(c),l(u));return o}case Zh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case Z_:{const{name:o,message:c}=f;return s(Dg(o,c),d)}case ev:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(Dg(m,f),d)};return l},Mg=t=>pw(new Map,t)(0),Fs="",{toString:mw}={},{keys:gw}=Object,Qa=t=>{const r=typeof t;if(r!=="object"||!t)return[$o,r];const s=mw.call(t).slice(8,-1);switch(s){case"Array":return[nl,Fs];case"Object":return[Bo,Fs];case"Date":return[Xh,Fs];case"RegExp":return[Qh,Fs];case"Map":return[Jh,Fs];case"Set":return[Zh,Fs];case"DataView":return[nl,s]}return s.includes("Array")?[nl,s]:s.includes("Error")?[Z_,s]:[Bo,s]},ko=([t,r])=>t===$o&&(r==="function"||r==="symbol"),_w=(t,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},m=f=>{if(s.has(f))return s.get(f);let[o,c]=Qa(f);switch(o){case $o:{let g=f;switch(c){case"bigint":o=ev,g=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return d([J_],f)}return d([o,g],f)}case nl:{if(c){let S=f;return c==="DataView"?S=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(S=new Uint8Array(f)),d([c,[...S]],f)}const g=[],h=d([o,g],f);for(const S of f)g.push(m(S));return h}case Bo:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return m(f.toJSON());const g=[],h=d([o,g],f);for(const S of gw(f))(t||!ko(Qa(f[S])))&&g.push([m(S),m(f[S])]);return h}case Xh:return d([o,f.toISOString()],f);case Qh:{const{source:g,flags:h}=f;return d([o,{source:g,flags:h}],f)}case Jh:{const g=[],h=d([o,g],f);for(const[S,w]of f)(t||!(ko(Qa(S))||ko(Qa(w))))&&g.push([m(S),m(w)]);return h}case Zh:{const g=[],h=d([o,g],f);for(const S of f)(t||!ko(Qa(S)))&&g.push(m(S));return h}}const{message:u}=f;return d([o,{name:c,message:u}],f)};return m},Lg=(t,{json:r,lossy:s}={})=>{const l=[];return _w(!(r||s),!!r,new Map,l)(t),l},jo=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?Mg(Lg(t,r)):structuredClone(t):(t,r)=>Mg(Lg(t,r));function vw(t,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function yw(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function Sw(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",s=t.options.footnoteBackContent||vw,l=t.options.footnoteBackLabel||yw,d=t.options.footnoteLabel||"Footnotes",m=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const g=t.all(u),h=String(u.identifier).toUpperCase(),S=Xs(h.toLowerCase());let w=0;const T=[],k=t.footnoteCounts.get(h);for(;k!==void 0&&++w<=k;){T.length>0&&T.push({type:"text",value:" "});let v=typeof s=="string"?s:s(c,w);typeof v=="string"&&(v={type:"text",value:v}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=g[g.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...T)}else g.push(...T);const _={type:"element",tagName:"li",properties:{id:r+"fn-"+S},children:t.wrap(g,!0)};t.patch(u,_),o.push(_)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:m,properties:{...jo(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
69
+ `});const u={type:"element",tagName:"li",properties:m,children:f};return t.patch(r,u),t.applyData(r,u)}function ew(t){let r=!1;if(t.type==="list"){r=t.spread||!1;const s=t.children;let l=-1;for(;!r&&++l<s.length;)r=Q_(s[l])}return r}function Q_(t){const r=t.spread;return r??t.children.length>1}function tw(t,r){const s={},l=t.all(r);let d=-1;for(typeof r.start=="number"&&r.start!==1&&(s.start=r.start);++d<l.length;){const f=l[d];if(f.type==="element"&&f.tagName==="li"&&f.properties&&Array.isArray(f.properties.className)&&f.properties.className.includes("task-list-item")){s.className=["contains-task-list"];break}}const m={type:"element",tagName:r.ordered?"ol":"ul",properties:s,children:t.wrap(l,!0)};return t.patch(r,m),t.applyData(r,m)}function nw(t,r){const s={type:"element",tagName:"p",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function iw(t,r){const s={type:"root",children:t.wrap(t.all(r))};return t.patch(r,s),t.applyData(r,s)}function rw(t,r){const s={type:"element",tagName:"strong",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}function sw(t,r){const s=t.all(r),l=s.shift(),d=[];if(l){const f={type:"element",tagName:"thead",properties:{},children:t.wrap([l],!0)};t.patch(r.children[0],f),d.push(f)}if(s.length>0){const f={type:"element",tagName:"tbody",properties:{},children:t.wrap(s,!0)},o=qh(r.children[1]),c=D_(r.children[r.children.length-1]);o&&c&&(f.position={start:o,end:c}),d.push(f)}const m={type:"element",tagName:"table",properties:{},children:t.wrap(d,!0)};return t.patch(r,m),t.applyData(r,m)}function aw(t,r,s){const l=s?s.children:void 0,m=(l?l.indexOf(r):1)===0?"th":"td",f=s&&s.type==="table"?s.align:void 0,o=f?f.length:r.children.length;let c=-1;const u=[];for(;++c<o;){const h=r.children[c],S={},w=f?f[c]:void 0;w&&(S.align=w);let T={type:"element",tagName:m,properties:S,children:[]};h&&(T.children=t.all(h),t.patch(h,T),T=t.applyData(h,T)),u.push(T)}const g={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(r,g),t.applyData(r,g)}function lw(t,r){const s={type:"element",tagName:"td",properties:{},children:t.all(r)};return t.patch(r,s),t.applyData(r,s)}const Ag=9,Tg=32;function ow(t){const r=String(t),s=/\r?\n|\r/g;let l=s.exec(r),d=0;const m=[];for(;l;)m.push(Rg(r.slice(d,l.index),d>0,!0),l[0]),d=l.index+l[0].length,l=s.exec(r);return m.push(Rg(r.slice(d),d>0,!1)),m.join("")}function Rg(t,r,s){let l=0,d=t.length;if(r){let m=t.codePointAt(l);for(;m===Ag||m===Tg;)l++,m=t.codePointAt(l)}if(s){let m=t.codePointAt(d-1);for(;m===Ag||m===Tg;)d--,m=t.codePointAt(d-1)}return d>l?t.slice(l,d):""}function cw(t,r){const s={type:"text",value:ow(String(r.value))};return t.patch(r,s),t.applyData(r,s)}function uw(t,r){const s={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(r,s),t.applyData(r,s)}const hw={blockquote:UC,break:PC,code:FC,delete:qC,emphasis:$C,footnoteReference:GC,heading:VC,html:WC,imageReference:KC,image:YC,inlineCode:XC,linkReference:QC,link:JC,listItem:ZC,list:tw,paragraph:nw,root:iw,strong:rw,table:sw,tableCell:lw,tableRow:aw,text:cw,thematicBreak:uw,toml:Eo,yaml:Eo,definition:Eo,footnoteDefinition:Eo};function Eo(){}const J_=-1,$o=0,nl=1,Bo=2,Xh=3,Qh=4,Jh=5,Zh=6,Z_=7,ev=8,fw=typeof self=="object"?self:globalThis,Dg=(t,r)=>{switch(t){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+t)}return new fw[t](r)},dw=(t,r)=>{const s=(d,m)=>(t.set(m,d),d),l=d=>{if(t.has(d))return t.get(d);const[m,f]=r[d];switch(m){case $o:case J_:return s(f,d);case nl:{const o=s([],d);for(const c of f)o.push(l(c));return o}case Bo:{const o=s({},d);for(const[c,u]of f)o[l(c)]=l(u);return o}case Xh:return s(new Date(f),d);case Qh:{const{source:o,flags:c}=f;return s(new RegExp(o,c),d)}case Jh:{const o=s(new Map,d);for(const[c,u]of f)o.set(l(c),l(u));return o}case Zh:{const o=s(new Set,d);for(const c of f)o.add(l(c));return o}case Z_:{const{name:o,message:c}=f;return s(Dg(o,c),d)}case ev:return s(BigInt(f),d);case"BigInt":return s(Object(BigInt(f)),d);case"ArrayBuffer":return s(new Uint8Array(f).buffer,f);case"DataView":{const{buffer:o}=new Uint8Array(f);return s(new DataView(o),f)}}return s(Dg(m,f),d)};return l},Mg=t=>dw(new Map,t)(0),Fs="",{toString:pw}={},{keys:mw}=Object,Qa=t=>{const r=typeof t;if(r!=="object"||!t)return[$o,r];const s=pw.call(t).slice(8,-1);switch(s){case"Array":return[nl,Fs];case"Object":return[Bo,Fs];case"Date":return[Xh,Fs];case"RegExp":return[Qh,Fs];case"Map":return[Jh,Fs];case"Set":return[Zh,Fs];case"DataView":return[nl,s]}return s.includes("Array")?[nl,s]:s.includes("Error")?[Z_,s]:[Bo,s]},ko=([t,r])=>t===$o&&(r==="function"||r==="symbol"),gw=(t,r,s,l)=>{const d=(f,o)=>{const c=l.push(f)-1;return s.set(o,c),c},m=f=>{if(s.has(f))return s.get(f);let[o,c]=Qa(f);switch(o){case $o:{let g=f;switch(c){case"bigint":o=ev,g=f.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);g=null;break;case"undefined":return d([J_],f)}return d([o,g],f)}case nl:{if(c){let S=f;return c==="DataView"?S=new Uint8Array(f.buffer):c==="ArrayBuffer"&&(S=new Uint8Array(f)),d([c,[...S]],f)}const g=[],h=d([o,g],f);for(const S of f)g.push(m(S));return h}case Bo:{if(c)switch(c){case"BigInt":return d([c,f.toString()],f);case"Boolean":case"Number":case"String":return d([c,f.valueOf()],f)}if(r&&"toJSON"in f)return m(f.toJSON());const g=[],h=d([o,g],f);for(const S of mw(f))(t||!ko(Qa(f[S])))&&g.push([m(S),m(f[S])]);return h}case Xh:return d([o,f.toISOString()],f);case Qh:{const{source:g,flags:h}=f;return d([o,{source:g,flags:h}],f)}case Jh:{const g=[],h=d([o,g],f);for(const[S,w]of f)(t||!(ko(Qa(S))||ko(Qa(w))))&&g.push([m(S),m(w)]);return h}case Zh:{const g=[],h=d([o,g],f);for(const S of f)(t||!ko(Qa(S)))&&g.push(m(S));return h}}const{message:u}=f;return d([o,{name:c,message:u}],f)};return m},Lg=(t,{json:r,lossy:s}={})=>{const l=[];return gw(!(r||s),!!r,new Map,l)(t),l},jo=typeof structuredClone=="function"?(t,r)=>r&&("json"in r||"lossy"in r)?Mg(Lg(t,r)):structuredClone(t):(t,r)=>Mg(Lg(t,r));function _w(t,r){const s=[{type:"text",value:"↩"}];return r>1&&s.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(r)}]}),s}function vw(t,r){return"Back to reference "+(t+1)+(r>1?"-"+r:"")}function yw(t){const r=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",s=t.options.footnoteBackContent||_w,l=t.options.footnoteBackLabel||vw,d=t.options.footnoteLabel||"Footnotes",m=t.options.footnoteLabelTagName||"h2",f=t.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const g=t.all(u),h=String(u.identifier).toUpperCase(),S=Xs(h.toLowerCase());let w=0;const T=[],k=t.footnoteCounts.get(h);for(;k!==void 0&&++w<=k;){T.length>0&&T.push({type:"text",value:" "});let v=typeof s=="string"?s:s(c,w);typeof v=="string"&&(v={type:"text",value:v}),T.push({type:"element",tagName:"a",properties:{href:"#"+r+"fnref-"+S+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof l=="string"?l:l(c,w),className:["data-footnote-backref"]},children:Array.isArray(v)?v:[v]})}const y=g[g.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const v=y.children[y.children.length-1];v&&v.type==="text"?v.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(...T)}else g.push(...T);const _={type:"element",tagName:"li",properties:{id:r+"fn-"+S},children:t.wrap(g,!0)};t.patch(u,_),o.push(_)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:m,properties:{...jo(f),id:"footnote-label"},children:[{type:"text",value:d}]},{type:"text",value:`
70
70
  `},{type:"element",tagName:"ol",properties:{},children:t.wrap(o,!0)},{type:"text",value:`
71
- `}]}}const Go=(function(t){if(t==null)return xw;if(typeof t=="function")return Vo(t);if(typeof t=="object")return Array.isArray(t)?bw(t):Cw(t);if(typeof t=="string")return ww(t);throw new Error("Expected function, string, or object as test")});function bw(t){const r=[];let s=-1;for(;++s<t.length;)r[s]=Go(t[s]);return Vo(l);function l(...d){let m=-1;for(;++m<r.length;)if(r[m].apply(this,d))return!0;return!1}}function Cw(t){const r=t;return Vo(s);function s(l){const d=l;let m;for(m in t)if(d[m]!==r[m])return!1;return!0}}function ww(t){return Vo(r);function r(s){return s&&s.type===t}}function Vo(t){return r;function r(s,l,d){return!!(Ew(s)&&t.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function xw(){return!0}function Ew(t){return t!==null&&typeof t=="object"&&"type"in t}const tv=[],kw=!0,Lh=!1,Aw="skip";function nv(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const m=Go(d),f=l?-1:1;o(t,void 0,[])();function o(c,u,g){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const w=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=tv,T,k,y;if((!r||m(c,u,g[g.length-1]||void 0))&&(w=Tw(s(c,g)),w[0]===Lh))return w;if("children"in c&&c.children){const _=c;if(_.children&&w[0]!==Aw)for(k=(l?_.children.length:-1)+f,y=g.concat(_);k>-1&&k<_.children.length;){const v=_.children[k];if(T=o(v,k,y)(),T[0]===Lh)return T;k=typeof T[1]=="number"?T[1]:k+f}}return w}}}function Tw(t){return Array.isArray(t)?t:typeof t=="number"?[kw,t]:t==null?tv:[t]}function ef(t,r,s,l){let d,m,f;typeof r=="function"&&typeof s!="function"?(m=void 0,f=r,d=s):(m=r,f=s,d=l),nv(t,m,o,d);function o(c,u){const g=u[u.length-1],h=g?g.children.indexOf(c):void 0;return f(c,h,g)}}const Oh={}.hasOwnProperty,Rw={};function Dw(t,r){const s=r||Rw,l=new Map,d=new Map,m=new Map,f={...fw,...s.handlers},o={all:u,applyData:Lw,definitionById:l,footnoteById:d,footnoteCounts:m,footnoteOrder:[],handlers:f,one:c,options:s,patch:Mw,wrap:Bw};return ef(t,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const h=g.type==="definition"?l:d,S=String(g.identifier).toUpperCase();h.has(S)||h.set(S,g)}}),o;function c(g,h){const S=g.type,w=o.handlers[S];if(Oh.call(o.handlers,S)&&w)return w(o,g,h);if(o.options.passThrough&&o.options.passThrough.includes(S)){if("children"in g){const{children:k,...y}=g,_=jo(y);return _.children=o.all(g),_}return jo(g)}return(o.options.unknownHandler||Ow)(o,g,h)}function u(g){const h=[];if("children"in g){const S=g.children;let w=-1;for(;++w<S.length;){const T=o.one(S[w],g);if(T){if(w&&S[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Og(T.value)),!Array.isArray(T)&&T.type==="element")){const k=T.children[0];k&&k.type==="text"&&(k.value=Og(k.value))}Array.isArray(T)?h.push(...T):h.push(T)}}}return h}}function Mw(t,r){t.position&&(r.position=v1(t))}function Lw(t,r){let s=r;if(t&&t.data){const l=t.data.hName,d=t.data.hChildren,m=t.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&m&&Object.assign(s.properties,jo(m)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function Ow(t,r){const s=r.data||{},l="value"in r&&!(Oh.call(s,"hProperties")||Oh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Bw(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
71
+ `}]}}const Go=(function(t){if(t==null)return ww;if(typeof t=="function")return Vo(t);if(typeof t=="object")return Array.isArray(t)?Sw(t):bw(t);if(typeof t=="string")return Cw(t);throw new Error("Expected function, string, or object as test")});function Sw(t){const r=[];let s=-1;for(;++s<t.length;)r[s]=Go(t[s]);return Vo(l);function l(...d){let m=-1;for(;++m<r.length;)if(r[m].apply(this,d))return!0;return!1}}function bw(t){const r=t;return Vo(s);function s(l){const d=l;let m;for(m in t)if(d[m]!==r[m])return!1;return!0}}function Cw(t){return Vo(r);function r(s){return s&&s.type===t}}function Vo(t){return r;function r(s,l,d){return!!(xw(s)&&t.call(this,s,typeof l=="number"?l:void 0,d||void 0))}}function ww(){return!0}function xw(t){return t!==null&&typeof t=="object"&&"type"in t}const tv=[],Ew=!0,Lh=!1,kw="skip";function nv(t,r,s,l){let d;typeof r=="function"&&typeof s!="function"?(l=s,s=r):d=r;const m=Go(d),f=l?-1:1;o(t,void 0,[])();function o(c,u,g){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const w=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(S,"name",{value:"node ("+(c.type+(w?"<"+w+">":""))+")"})}return S;function S(){let w=tv,T,k,y;if((!r||m(c,u,g[g.length-1]||void 0))&&(w=Aw(s(c,g)),w[0]===Lh))return w;if("children"in c&&c.children){const _=c;if(_.children&&w[0]!==kw)for(k=(l?_.children.length:-1)+f,y=g.concat(_);k>-1&&k<_.children.length;){const v=_.children[k];if(T=o(v,k,y)(),T[0]===Lh)return T;k=typeof T[1]=="number"?T[1]:k+f}}return w}}}function Aw(t){return Array.isArray(t)?t:typeof t=="number"?[Ew,t]:t==null?tv:[t]}function ef(t,r,s,l){let d,m,f;typeof r=="function"&&typeof s!="function"?(m=void 0,f=r,d=s):(m=r,f=s,d=l),nv(t,m,o,d);function o(c,u){const g=u[u.length-1],h=g?g.children.indexOf(c):void 0;return f(c,h,g)}}const Oh={}.hasOwnProperty,Tw={};function Rw(t,r){const s=r||Tw,l=new Map,d=new Map,m=new Map,f={...hw,...s.handlers},o={all:u,applyData:Mw,definitionById:l,footnoteById:d,footnoteCounts:m,footnoteOrder:[],handlers:f,one:c,options:s,patch:Dw,wrap:Ow};return ef(t,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const h=g.type==="definition"?l:d,S=String(g.identifier).toUpperCase();h.has(S)||h.set(S,g)}}),o;function c(g,h){const S=g.type,w=o.handlers[S];if(Oh.call(o.handlers,S)&&w)return w(o,g,h);if(o.options.passThrough&&o.options.passThrough.includes(S)){if("children"in g){const{children:k,...y}=g,_=jo(y);return _.children=o.all(g),_}return jo(g)}return(o.options.unknownHandler||Lw)(o,g,h)}function u(g){const h=[];if("children"in g){const S=g.children;let w=-1;for(;++w<S.length;){const T=o.one(S[w],g);if(T){if(w&&S[w-1].type==="break"&&(!Array.isArray(T)&&T.type==="text"&&(T.value=Og(T.value)),!Array.isArray(T)&&T.type==="element")){const k=T.children[0];k&&k.type==="text"&&(k.value=Og(k.value))}Array.isArray(T)?h.push(...T):h.push(T)}}}return h}}function Dw(t,r){t.position&&(r.position=_1(t))}function Mw(t,r){let s=r;if(t&&t.data){const l=t.data.hName,d=t.data.hChildren,m=t.data.hProperties;if(typeof l=="string")if(s.type==="element")s.tagName=l;else{const f="children"in s?s.children:[s];s={type:"element",tagName:l,properties:{},children:f}}s.type==="element"&&m&&Object.assign(s.properties,jo(m)),"children"in s&&s.children&&d!==null&&d!==void 0&&(s.children=d)}return s}function Lw(t,r){const s=r.data||{},l="value"in r&&!(Oh.call(s,"hProperties")||Oh.call(s,"hChildren"))?{type:"text",value:r.value}:{type:"element",tagName:"div",properties:{},children:t.all(r)};return t.patch(r,l),t.applyData(r,l)}function Ow(t,r){const s=[];let l=-1;for(r&&s.push({type:"text",value:`
72
72
  `});++l<t.length;)l&&s.push({type:"text",value:`
73
73
  `}),s.push(t[l]);return r&&t.length>0&&s.push({type:"text",value:`
74
- `}),s}function Og(t){let r=0,s=t.charCodeAt(r);for(;s===9||s===32;)r++,s=t.charCodeAt(r);return t.slice(r)}function Bg(t,r){const s=Dw(t,r),l=s.one(t,void 0),d=Sw(s),m=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&m.children.push({type:"text",value:`
75
- `},d),m}function jw(t,r){return t&&"run"in t?async function(s,l){const d=Bg(s,{file:l,...r});await t.run(d,l)}:function(s,l){return Bg(s,{file:l,...t||r})}}function jg(t){if(t)throw t}var oh,Ng;function Nw(){if(Ng)return oh;Ng=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(u){return typeof Array.isArray=="function"?Array.isArray(u):r.call(u)==="[object Array]"},m=function(u){if(!u||r.call(u)!=="[object Object]")return!1;var g=t.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!g&&!h)return!1;var S;for(S in u);return typeof S>"u"||t.call(u,S)},f=function(u,g){s&&g.name==="__proto__"?s(u,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):u[g.name]=g.newValue},o=function(u,g){if(g==="__proto__")if(t.call(u,g)){if(l)return l(u,g).value}else return;return u[g]};return oh=function c(){var u,g,h,S,w,T,k=arguments[0],y=1,_=arguments.length,v=!1;for(typeof k=="boolean"&&(v=k,k=arguments[1]||{},y=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});y<_;++y)if(u=arguments[y],u!=null)for(g in u)h=o(k,g),S=o(u,g),k!==S&&(v&&S&&(m(S)||(w=d(S)))?(w?(w=!1,T=h&&d(h)?h:[]):T=h&&m(h)?h:{},f(k,{name:g,newValue:c(v,T,S)})):typeof S<"u"&&f(k,{name:g,newValue:S}));return k},oh}var Hw=Nw();const ch=h_(Hw);function Bh(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function zw(){const t=[],r={run:s,use:l};return r;function s(...d){let m=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...u){const g=t[++m];let h=-1;if(c){f(c);return}for(;++h<d.length;)(u[h]===null||u[h]===void 0)&&(u[h]=d[h]);d=u,g?Iw(g,o)(...u):f(null,...u)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return t.push(d),r}}function Iw(t,r){let s;return l;function l(...f){const o=t.length>f.length;let c;o&&f.push(d);try{c=t.apply(this,f)}catch(u){const g=u;if(o&&s)throw g;return d(g)}o||(c&&c.then&&typeof c.then=="function"?c.then(m,d):c instanceof Error?d(c):m(c))}function d(f,...o){s||(s=!0,r(f,...o))}function m(f){d(null,f)}}const di={basename:Uw,dirname:Pw,extname:Fw,join:qw,sep:"/"};function Uw(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');fl(t);let s=0,l=-1,d=t.length,m;if(r===void 0||r.length===0||r.length>t.length){for(;d--;)if(t.codePointAt(d)===47){if(m){s=d+1;break}}else l<0&&(m=!0,l=d+1);return l<0?"":t.slice(s,l)}if(r===t)return"";let f=-1,o=r.length-1;for(;d--;)if(t.codePointAt(d)===47){if(m){s=d+1;break}}else f<0&&(m=!0,f=d+1),o>-1&&(t.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=t.length),t.slice(s,l)}function Pw(t){if(fl(t),t.length===0)return".";let r=-1,s=t.length,l;for(;--s;)if(t.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?t.codePointAt(0)===47?"/":".":r===1&&t.codePointAt(0)===47?"//":t.slice(0,r)}function Fw(t){fl(t);let r=t.length,s=-1,l=0,d=-1,m=0,f;for(;r--;){const o=t.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:m!==1&&(m=1):d>-1&&(m=-1)}return d<0||s<0||m===0||m===1&&d===s-1&&d===l+1?"":t.slice(d,s)}function qw(...t){let r=-1,s;for(;++r<t.length;)fl(t[r]),t[r]&&(s=s===void 0?t[r]:s+"/"+t[r]);return s===void 0?".":$w(s)}function $w(t){fl(t);const r=t.codePointAt(0)===47;let s=Gw(t,!r);return s.length===0&&!r&&(s="."),s.length>0&&t.codePointAt(t.length-1)===47&&(s+="/"),r?"/"+s:s}function Gw(t,r){let s="",l=0,d=-1,m=0,f=-1,o,c;for(;++f<=t.length;){if(f<t.length)o=t.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||m===1))if(d!==f-1&&m===2){if(s.length<2||l!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,m=0;continue}}else if(s.length>0){s="",l=0,d=f,m=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+t.slice(d+1,f):s=t.slice(d+1,f),l=f-d-1;d=f,m=0}else o===46&&m>-1?m++:m=-1}return s}function fl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Vw={cwd:Ww};function Ww(){return"/"}function jh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Kw(t){if(typeof t=="string")t=new URL(t);else if(!jh(t)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(t.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Yw(t)}function Yw(t){if(t.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=t.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const uh=["history","path","basename","stem","extname","dirname"];class iv{constructor(r){let s;r?jh(r)?s={path:r}:typeof r=="string"||Xw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Vw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<uh.length;){const m=uh[l];m in s&&s[m]!==void 0&&s[m]!==null&&(this[m]=m==="history"?[...s[m]]:s[m])}let d;for(d in s)uh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(r){fh(r,"basename"),hh(r,"basename"),this.path=di.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(r){Hg(this.basename,"dirname"),this.path=di.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(r){if(hh(r,"extname"),Hg(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=di.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){jh(r)&&(r=Kw(r)),fh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(r){fh(r,"stem"),hh(r,"stem"),this.path=di.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new nn(r,s,l);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function hh(t,r){if(t&&t.includes(di.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+di.sep+"`")}function fh(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Hg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Xw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Qw=(function(t){const l=this.constructor.prototype,d=l[t],m=function(){return d.apply(m,arguments)};return Object.setPrototypeOf(m,l),m}),Jw={}.hasOwnProperty;class tf extends Qw{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=zw()}copy(){const r=new tf;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(ch(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(mh("data",this.frozen),this.namespace[r]=s,this):Jw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(mh("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Ao(r),l=this.parser||this.Parser;return dh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),dh("process",this.parser||this.Parser),ph("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(m,f){const o=Ao(r),c=l.parse(o);l.run(c,o,function(g,h,S){if(g||!h||!S)return u(g);const w=h,T=l.stringify(w,S);tx(T)?S.value=T:S.result=T,u(g,S)});function u(g,h){g||!h?f(g):m?m(h):s(void 0,h)}}}processSync(r){let s=!1,l;return this.freeze(),dh("processSync",this.parser||this.Parser),ph("processSync",this.compiler||this.Compiler),this.process(r,d),Ig("processSync","process",s),l;function d(m,f){s=!0,jg(m),l=f}}run(r,s,l){zg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?m(void 0,l):new Promise(m);function m(f,o){const c=Ao(s);d.run(r,c,u);function u(g,h,S){const w=h||r;g?o(g):f?f(w):l(void 0,w,S)}}}runSync(r,s){let l=!1,d;return this.run(r,s,m),Ig("runSync","run",l),d;function m(f,o){jg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=Ao(s),d=this.compiler||this.Compiler;return ph("stringify",d),zg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(mh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function m(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[g,...h]=u;c(g,h)}else f(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function f(u){if(!("plugins"in u)&&!("settings"in u))throw new 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(u.plugins),u.settings&&(d.settings=ch(!0,d.settings,u.settings))}function o(u){let g=-1;if(u!=null)if(Array.isArray(u))for(;++g<u.length;){const h=u[g];m(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,g){let h=-1,S=-1;for(;++h<l.length;)if(l[h][0]===u){S=h;break}if(S===-1)l.push([u,...g]);else if(g.length>0){let[w,...T]=g;const k=l[S][1];Bh(k)&&Bh(w)&&(w=ch(!0,k,w)),l[S]=[u,w,...T]}}}}const Zw=new tf().freeze();function dh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ph(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function mh(t,r){if(r)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zg(t){if(!Bh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ig(t,r,s){if(!s)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function Ao(t){return ex(t)?t:new iv(t)}function ex(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function tx(t){return typeof t=="string"||nx(t)}function nx(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ix="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ug=[],Pg={allowDangerousHtml:!0},rx=/^(https?|ircs?|mailto|xmpp)$/i,sx=[{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 rv(t){const r=ax(t),s=lx(t);return ox(r.runSync(r.parse(s),s),t)}function ax(t){const r=t.rehypePlugins||Ug,s=t.remarkPlugins||Ug,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Pg}:Pg;return Zw().use(UC).use(s).use(jw,l).use(r)}function lx(t){const r=t.children||"",s=new iv;return typeof r=="string"&&(s.value=r),s}function ox(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,m=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||cx;for(const g of sx)Object.hasOwn(r,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+ix+g.id,void 0);return ef(t,u),w1(t,{Fragment:C.Fragment,components:d,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function u(g,h,S){if(g.type==="raw"&&S&&typeof h=="number")return f?S.children.splice(h,1):S.children[h]={type:"text",value:g.value},h;if(g.type==="element"){let w;for(w in sh)if(Object.hasOwn(sh,w)&&Object.hasOwn(g.properties,w)){const T=g.properties[w],k=sh[w];(k===null||k.includes(g.tagName))&&(g.properties[w]=c(String(T||""),w,g))}}if(g.type==="element"){let w=s?!s.includes(g.tagName):m?m.includes(g.tagName):!1;if(!w&&l&&typeof h=="number"&&(w=!l(g,h,S)),w&&S&&typeof h=="number")return o&&g.children?S.children.splice(h,1,...g.children):S.children.splice(h,1),h}}}function cx(t){const r=t.indexOf(":"),s=t.indexOf("?"),l=t.indexOf("#"),d=t.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||rx.test(t.slice(0,r))?t:""}function Fg(t,r){const s=String(t);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function ux(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function hx(t,r,s){const d=Go((s||{}).ignore||[]),m=fx(r);let f=-1;for(;++f<m.length;)nv(t,"text",o);function o(u,g){let h=-1,S;for(;++h<g.length;){const w=g[h],T=S?S.children:void 0;if(d(w,T?T.indexOf(w):void 0,S))return;S=w}if(S)return c(u,g)}function c(u,g){const h=g[g.length-1],S=m[f][0],w=m[f][1];let T=0;const y=h.children.indexOf(u);let _=!1,v=[];S.lastIndex=0;let b=S.exec(u.value);for(;b;){const E=b.index,O={index:b.index,input:b.input,stack:[...g,u]};let R=w(...b,O);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?S.lastIndex=E+1:(T!==E&&v.push({type:"text",value:u.value.slice(T,E)}),Array.isArray(R)?v.push(...R):R&&v.push(R),T=E+b[0].length,_=!0),!S.global)break;b=S.exec(u.value)}return _?(T<u.value.length&&v.push({type:"text",value:u.value.slice(T)}),h.children.splice(y,1,...v)):v=[u],y+v.length}}function fx(t){const r=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!t[0]||Array.isArray(t[0])?t:[t];let l=-1;for(;++l<s.length;){const d=s[l];r.push([dx(d[0]),px(d[1])])}return r}function dx(t){return typeof t=="string"?new RegExp(ux(t),"g"):t}function px(t){return typeof t=="function"?t:function(){return t}}const gh="phrasing",_h=["autolink","link","image","label"];function mx(){return{transforms:[Cx],enter:{literalAutolink:_x,literalAutolinkEmail:vh,literalAutolinkHttp:vh,literalAutolinkWww:vh},exit:{literalAutolink:bx,literalAutolinkEmail:Sx,literalAutolinkHttp:vx,literalAutolinkWww:yx}}}function gx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:_h},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:_h},{character:":",before:"[ps]",after:"\\/",inConstruct:gh,notInConstruct:_h}]}}function _x(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function vh(t){this.config.enter.autolinkProtocol.call(this,t)}function vx(t){this.config.exit.autolinkProtocol.call(this,t)}function yx(t){this.config.exit.data.call(this,t);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(t)}function Sx(t){this.config.exit.autolinkEmail.call(this,t)}function bx(t){this.exit(t)}function Cx(t){hx(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,wx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xx]],{ignore:["link","linkReference"]})}function wx(t,r,s,l,d){let m="";if(!sv(d)||(/^w/i.test(r)&&(s=r+s,r="",m="http://"),!Ex(s)))return!1;const f=kx(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:m+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function xx(t,r,s,l){return!sv(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function Ex(t){const r=t.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function kx(t){const r=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!r)return[t,void 0];t=t.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Fg(t,"(");let m=Fg(t,")");for(;l!==-1&&d>m;)t+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),m++;return[t,s]}function sv(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Xr(s)||Fo(s))&&(!r||s!==47)}av.peek=jx;function Ax(){this.buffer()}function Tx(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Rx(){this.buffer()}function Dx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Mx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ri(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Lx(t){this.exit(t)}function Ox(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ri(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Bx(t){this.exit(t)}function jx(){return"["}function av(t,r,s,l){const d=s.createTracker(l);let m=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return m+=d.move(s.safe(s.associationId(t),{after:"]",before:m})),o(),f(),m+=d.move("]"),m}function Nx(){return{enter:{gfmFootnoteCallString:Ax,gfmFootnoteCall:Tx,gfmFootnoteDefinitionLabelString:Rx,gfmFootnoteDefinition:Dx},exit:{gfmFootnoteCallString:Mx,gfmFootnoteCall:Lx,gfmFootnoteDefinitionLabelString:Ox,gfmFootnoteDefinition:Bx}}}function Hx(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:av},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,m,f){const o=m.createTracker(f);let c=o.move("[^");const u=m.enter("footnoteDefinition"),g=m.enter("label");return c+=o.move(m.safe(m.associationId(l),{before:c,after:"]"})),g(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
76
- `:" ")+m.indentLines(m.containerFlow(l,o.current()),r?lv:zx))),u(),c}}function zx(t,r,s){return r===0?t:lv(t,r,s)}function lv(t,r,s){return(s?"":" ")+t}const Ix=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ov.peek=$x;function Ux(){return{canContainEols:["delete"],enter:{strikethrough:Fx},exit:{strikethrough:qx}}}function Px(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ix}],handlers:{delete:ov}}}function Fx(t){this.enter({type:"delete",children:[]},t)}function qx(t){this.exit(t)}function ov(t,r,s,l){const d=s.createTracker(l),m=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(t,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),m(),f}function $x(){return"~"}function Gx(t){return t.length}function Vx(t,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||Gx,m=[],f=[],o=[],c=[];let u=0,g=-1;for(;++g<t.length;){const k=[],y=[];let _=-1;for(t[g].length>u&&(u=t[g].length);++_<t[g].length;){const v=Wx(t[g][_]);if(s.alignDelimiters!==!1){const b=d(v);y[_]=b,(c[_]===void 0||b>c[_])&&(c[_]=b)}k.push(v)}f[g]=k,o[g]=y}let h=-1;if(typeof l=="object"&&"length"in l)for(;++h<u;)m[h]=qg(l[h]);else{const k=qg(l);for(;++h<u;)m[h]=k}h=-1;const S=[],w=[];for(;++h<u;){const k=m[h];let y="",_="";k===99?(y=":",_=":"):k===108?y=":":k===114&&(_=":");let v=s.alignDelimiters===!1?1:Math.max(1,c[h]-y.length-_.length);const b=y+"-".repeat(v)+_;s.alignDelimiters!==!1&&(v=y.length+v+_.length,v>c[h]&&(c[h]=v),w[h]=v),S[h]=b}f.splice(1,0,S),o.splice(1,0,w),g=-1;const T=[];for(;++g<f.length;){const k=f[g],y=o[g];h=-1;const _=[];for(;++h<u;){const v=k[h]||"";let b="",E="";if(s.alignDelimiters!==!1){const O=c[h]-(y[h]||0),R=m[h];R===114?b=" ".repeat(O):R===99?O%2?(b=" ".repeat(O/2+.5),E=" ".repeat(O/2-.5)):(b=" ".repeat(O/2),E=b):E=" ".repeat(O)}s.delimiterStart!==!1&&!h&&_.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&v==="")&&(s.delimiterStart!==!1||h)&&_.push(" "),s.alignDelimiters!==!1&&_.push(b),_.push(v),s.alignDelimiters!==!1&&_.push(E),s.padding!==!1&&_.push(" "),(s.delimiterEnd!==!1||h!==u-1)&&_.push("|")}T.push(s.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return T.join(`
77
- `)}function Wx(t){return t==null?"":String(t)}function qg(t){const r=typeof t=="string"?t.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Kx(t,r,s,l){const d=s.enter("blockquote"),m=s.createTracker(l);m.move("> "),m.shift(2);const f=s.indentLines(s.containerFlow(t,m.current()),Yx);return d(),f}function Yx(t,r,s){return">"+(s?"":" ")+t}function Xx(t,r){return $g(t,r.inConstruct,!0)&&!$g(t,r.notInConstruct,!1)}function $g(t,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(t.includes(r[l]))return!0;return!1}function Gg(t,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
78
- `&&Xx(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
79
- `}function Qx(t,r){const s=String(t);let l=s.indexOf(r),d=l,m=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++m>f&&(f=m):m=1,d=l+r.length,l=s.indexOf(r,d);return f}function Jx(t,r){return!!(r.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Zx(t){const r=t.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function eE(t,r,s,l){const d=Zx(s),m=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Jx(t,s)){const h=s.enter("codeIndented"),S=s.indentLines(m,tE);return h(),S}const o=s.createTracker(l),c=d.repeat(Math.max(Qx(m,d)+1,3)),u=s.enter("codeFenced");let g=o.move(c);if(t.lang){const h=s.enter(`codeFencedLang${f}`);g+=o.move(s.safe(t.lang,{before:g,after:" ",encode:["`"],...o.current()})),h()}if(t.lang&&t.meta){const h=s.enter(`codeFencedMeta${f}`);g+=o.move(" "),g+=o.move(s.safe(t.meta,{before:g,after:`
74
+ `}),s}function Og(t){let r=0,s=t.charCodeAt(r);for(;s===9||s===32;)r++,s=t.charCodeAt(r);return t.slice(r)}function Bg(t,r){const s=Rw(t,r),l=s.one(t,void 0),d=yw(s),m=Array.isArray(l)?{type:"root",children:l}:l||{type:"root",children:[]};return d&&m.children.push({type:"text",value:`
75
+ `},d),m}function Bw(t,r){return t&&"run"in t?async function(s,l){const d=Bg(s,{file:l,...r});await t.run(d,l)}:function(s,l){return Bg(s,{file:l,...t||r})}}function jg(t){if(t)throw t}var oh,Ng;function jw(){if(Ng)return oh;Ng=1;var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString,s=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d=function(u){return typeof Array.isArray=="function"?Array.isArray(u):r.call(u)==="[object Array]"},m=function(u){if(!u||r.call(u)!=="[object Object]")return!1;var g=t.call(u,"constructor"),h=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!g&&!h)return!1;var S;for(S in u);return typeof S>"u"||t.call(u,S)},f=function(u,g){s&&g.name==="__proto__"?s(u,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):u[g.name]=g.newValue},o=function(u,g){if(g==="__proto__")if(t.call(u,g)){if(l)return l(u,g).value}else return;return u[g]};return oh=function c(){var u,g,h,S,w,T,k=arguments[0],y=1,_=arguments.length,v=!1;for(typeof k=="boolean"&&(v=k,k=arguments[1]||{},y=2),(k==null||typeof k!="object"&&typeof k!="function")&&(k={});y<_;++y)if(u=arguments[y],u!=null)for(g in u)h=o(k,g),S=o(u,g),k!==S&&(v&&S&&(m(S)||(w=d(S)))?(w?(w=!1,T=h&&d(h)?h:[]):T=h&&m(h)?h:{},f(k,{name:g,newValue:c(v,T,S)})):typeof S<"u"&&f(k,{name:g,newValue:S}));return k},oh}var Nw=jw();const ch=h_(Nw);function Bh(t){if(typeof t!="object"||t===null)return!1;const r=Object.getPrototypeOf(t);return(r===null||r===Object.prototype||Object.getPrototypeOf(r)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function Hw(){const t=[],r={run:s,use:l};return r;function s(...d){let m=-1;const f=d.pop();if(typeof f!="function")throw new TypeError("Expected function as last argument, not "+f);o(null,...d);function o(c,...u){const g=t[++m];let h=-1;if(c){f(c);return}for(;++h<d.length;)(u[h]===null||u[h]===void 0)&&(u[h]=d[h]);d=u,g?zw(g,o)(...u):f(null,...u)}}function l(d){if(typeof d!="function")throw new TypeError("Expected `middelware` to be a function, not "+d);return t.push(d),r}}function zw(t,r){let s;return l;function l(...f){const o=t.length>f.length;let c;o&&f.push(d);try{c=t.apply(this,f)}catch(u){const g=u;if(o&&s)throw g;return d(g)}o||(c&&c.then&&typeof c.then=="function"?c.then(m,d):c instanceof Error?d(c):m(c))}function d(f,...o){s||(s=!0,r(f,...o))}function m(f){d(null,f)}}const di={basename:Iw,dirname:Uw,extname:Pw,join:Fw,sep:"/"};function Iw(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');fl(t);let s=0,l=-1,d=t.length,m;if(r===void 0||r.length===0||r.length>t.length){for(;d--;)if(t.codePointAt(d)===47){if(m){s=d+1;break}}else l<0&&(m=!0,l=d+1);return l<0?"":t.slice(s,l)}if(r===t)return"";let f=-1,o=r.length-1;for(;d--;)if(t.codePointAt(d)===47){if(m){s=d+1;break}}else f<0&&(m=!0,f=d+1),o>-1&&(t.codePointAt(d)===r.codePointAt(o--)?o<0&&(l=d):(o=-1,l=f));return s===l?l=f:l<0&&(l=t.length),t.slice(s,l)}function Uw(t){if(fl(t),t.length===0)return".";let r=-1,s=t.length,l;for(;--s;)if(t.codePointAt(s)===47){if(l){r=s;break}}else l||(l=!0);return r<0?t.codePointAt(0)===47?"/":".":r===1&&t.codePointAt(0)===47?"//":t.slice(0,r)}function Pw(t){fl(t);let r=t.length,s=-1,l=0,d=-1,m=0,f;for(;r--;){const o=t.codePointAt(r);if(o===47){if(f){l=r+1;break}continue}s<0&&(f=!0,s=r+1),o===46?d<0?d=r:m!==1&&(m=1):d>-1&&(m=-1)}return d<0||s<0||m===0||m===1&&d===s-1&&d===l+1?"":t.slice(d,s)}function Fw(...t){let r=-1,s;for(;++r<t.length;)fl(t[r]),t[r]&&(s=s===void 0?t[r]:s+"/"+t[r]);return s===void 0?".":qw(s)}function qw(t){fl(t);const r=t.codePointAt(0)===47;let s=$w(t,!r);return s.length===0&&!r&&(s="."),s.length>0&&t.codePointAt(t.length-1)===47&&(s+="/"),r?"/"+s:s}function $w(t,r){let s="",l=0,d=-1,m=0,f=-1,o,c;for(;++f<=t.length;){if(f<t.length)o=t.codePointAt(f);else{if(o===47)break;o=47}if(o===47){if(!(d===f-1||m===1))if(d!==f-1&&m===2){if(s.length<2||l!==2||s.codePointAt(s.length-1)!==46||s.codePointAt(s.length-2)!==46){if(s.length>2){if(c=s.lastIndexOf("/"),c!==s.length-1){c<0?(s="",l=0):(s=s.slice(0,c),l=s.length-1-s.lastIndexOf("/")),d=f,m=0;continue}}else if(s.length>0){s="",l=0,d=f,m=0;continue}}r&&(s=s.length>0?s+"/..":"..",l=2)}else s.length>0?s+="/"+t.slice(d+1,f):s=t.slice(d+1,f),l=f-d-1;d=f,m=0}else o===46&&m>-1?m++:m=-1}return s}function fl(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const Gw={cwd:Vw};function Vw(){return"/"}function jh(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Ww(t){if(typeof t=="string")t=new URL(t);else if(!jh(t)){const r=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw r.code="ERR_INVALID_ARG_TYPE",r}if(t.protocol!=="file:"){const r=new TypeError("The URL must be of scheme file");throw r.code="ERR_INVALID_URL_SCHEME",r}return Kw(t)}function Kw(t){if(t.hostname!==""){const l=new TypeError('File URL host must be "localhost" or empty on darwin');throw l.code="ERR_INVALID_FILE_URL_HOST",l}const r=t.pathname;let s=-1;for(;++s<r.length;)if(r.codePointAt(s)===37&&r.codePointAt(s+1)===50){const l=r.codePointAt(s+2);if(l===70||l===102){const d=new TypeError("File URL path must not include encoded / characters");throw d.code="ERR_INVALID_FILE_URL_PATH",d}}return decodeURIComponent(r)}const uh=["history","path","basename","stem","extname","dirname"];class iv{constructor(r){let s;r?jh(r)?s={path:r}:typeof r=="string"||Yw(r)?s={value:r}:s=r:s={},this.cwd="cwd"in s?"":Gw.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let l=-1;for(;++l<uh.length;){const m=uh[l];m in s&&s[m]!==void 0&&s[m]!==null&&(this[m]=m==="history"?[...s[m]]:s[m])}let d;for(d in s)uh.includes(d)||(this[d]=s[d])}get basename(){return typeof this.path=="string"?di.basename(this.path):void 0}set basename(r){fh(r,"basename"),hh(r,"basename"),this.path=di.join(this.dirname||"",r)}get dirname(){return typeof this.path=="string"?di.dirname(this.path):void 0}set dirname(r){Hg(this.basename,"dirname"),this.path=di.join(r||"",this.basename)}get extname(){return typeof this.path=="string"?di.extname(this.path):void 0}set extname(r){if(hh(r,"extname"),Hg(this.dirname,"extname"),r){if(r.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(r.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=di.join(this.dirname,this.stem+(r||""))}get path(){return this.history[this.history.length-1]}set path(r){jh(r)&&(r=Ww(r)),fh(r,"path"),this.path!==r&&this.history.push(r)}get stem(){return typeof this.path=="string"?di.basename(this.path,this.extname):void 0}set stem(r){fh(r,"stem"),hh(r,"stem"),this.path=di.join(this.dirname||"",r+(this.extname||""))}fail(r,s,l){const d=this.message(r,s,l);throw d.fatal=!0,d}info(r,s,l){const d=this.message(r,s,l);return d.fatal=void 0,d}message(r,s,l){const d=new nn(r,s,l);return this.path&&(d.name=this.path+":"+d.name,d.file=this.path),d.fatal=!1,this.messages.push(d),d}toString(r){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(r||void 0).decode(this.value)}}function hh(t,r){if(t&&t.includes(di.sep))throw new Error("`"+r+"` cannot be a path: did not expect `"+di.sep+"`")}function fh(t,r){if(!t)throw new Error("`"+r+"` cannot be empty")}function Hg(t,r){if(!t)throw new Error("Setting `"+r+"` requires `path` to be set too")}function Yw(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Xw=(function(t){const l=this.constructor.prototype,d=l[t],m=function(){return d.apply(m,arguments)};return Object.setPrototypeOf(m,l),m}),Qw={}.hasOwnProperty;class tf extends Xw{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=Hw()}copy(){const r=new tf;let s=-1;for(;++s<this.attachers.length;){const l=this.attachers[s];r.use(...l)}return r.data(ch(!0,{},this.namespace)),r}data(r,s){return typeof r=="string"?arguments.length===2?(mh("data",this.frozen),this.namespace[r]=s,this):Qw.call(this.namespace,r)&&this.namespace[r]||void 0:r?(mh("data",this.frozen),this.namespace=r,this):this.namespace}freeze(){if(this.frozen)return this;const r=this;for(;++this.freezeIndex<this.attachers.length;){const[s,...l]=this.attachers[this.freezeIndex];if(l[0]===!1)continue;l[0]===!0&&(l[0]=void 0);const d=s.call(r,...l);typeof d=="function"&&this.transformers.use(d)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(r){this.freeze();const s=Ao(r),l=this.parser||this.Parser;return dh("parse",l),l(String(s),s)}process(r,s){const l=this;return this.freeze(),dh("process",this.parser||this.Parser),ph("process",this.compiler||this.Compiler),s?d(void 0,s):new Promise(d);function d(m,f){const o=Ao(r),c=l.parse(o);l.run(c,o,function(g,h,S){if(g||!h||!S)return u(g);const w=h,T=l.stringify(w,S);ex(T)?S.value=T:S.result=T,u(g,S)});function u(g,h){g||!h?f(g):m?m(h):s(void 0,h)}}}processSync(r){let s=!1,l;return this.freeze(),dh("processSync",this.parser||this.Parser),ph("processSync",this.compiler||this.Compiler),this.process(r,d),Ig("processSync","process",s),l;function d(m,f){s=!0,jg(m),l=f}}run(r,s,l){zg(r),this.freeze();const d=this.transformers;return!l&&typeof s=="function"&&(l=s,s=void 0),l?m(void 0,l):new Promise(m);function m(f,o){const c=Ao(s);d.run(r,c,u);function u(g,h,S){const w=h||r;g?o(g):f?f(w):l(void 0,w,S)}}}runSync(r,s){let l=!1,d;return this.run(r,s,m),Ig("runSync","run",l),d;function m(f,o){jg(f),d=o,l=!0}}stringify(r,s){this.freeze();const l=Ao(s),d=this.compiler||this.Compiler;return ph("stringify",d),zg(r),d(r,l)}use(r,...s){const l=this.attachers,d=this.namespace;if(mh("use",this.frozen),r!=null)if(typeof r=="function")c(r,s);else if(typeof r=="object")Array.isArray(r)?o(r):f(r);else throw new TypeError("Expected usable value, not `"+r+"`");return this;function m(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[g,...h]=u;c(g,h)}else f(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function f(u){if(!("plugins"in u)&&!("settings"in u))throw new 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(u.plugins),u.settings&&(d.settings=ch(!0,d.settings,u.settings))}function o(u){let g=-1;if(u!=null)if(Array.isArray(u))for(;++g<u.length;){const h=u[g];m(h)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,g){let h=-1,S=-1;for(;++h<l.length;)if(l[h][0]===u){S=h;break}if(S===-1)l.push([u,...g]);else if(g.length>0){let[w,...T]=g;const k=l[S][1];Bh(k)&&Bh(w)&&(w=ch(!0,k,w)),l[S]=[u,w,...T]}}}}const Jw=new tf().freeze();function dh(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function ph(t,r){if(typeof r!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function mh(t,r){if(r)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function zg(t){if(!Bh(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function Ig(t,r,s){if(!s)throw new Error("`"+t+"` finished async. Use `"+r+"` instead")}function Ao(t){return Zw(t)?t:new iv(t)}function Zw(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function ex(t){return typeof t=="string"||tx(t)}function tx(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const nx="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Ug=[],Pg={allowDangerousHtml:!0},ix=/^(https?|ircs?|mailto|xmpp)$/i,rx=[{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 rv(t){const r=sx(t),s=ax(t);return lx(r.runSync(r.parse(s),s),t)}function sx(t){const r=t.rehypePlugins||Ug,s=t.remarkPlugins||Ug,l=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...Pg}:Pg;return Jw().use(IC).use(s).use(Bw,l).use(r)}function ax(t){const r=t.children||"",s=new iv;return typeof r=="string"&&(s.value=r),s}function lx(t,r){const s=r.allowedElements,l=r.allowElement,d=r.components,m=r.disallowedElements,f=r.skipHtml,o=r.unwrapDisallowed,c=r.urlTransform||ox;for(const g of rx)Object.hasOwn(r,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+nx+g.id,void 0);return ef(t,u),C1(t,{Fragment:C.Fragment,components:d,ignoreInvalidStyle:!0,jsx:C.jsx,jsxs:C.jsxs,passKeys:!0,passNode:!0});function u(g,h,S){if(g.type==="raw"&&S&&typeof h=="number")return f?S.children.splice(h,1):S.children[h]={type:"text",value:g.value},h;if(g.type==="element"){let w;for(w in sh)if(Object.hasOwn(sh,w)&&Object.hasOwn(g.properties,w)){const T=g.properties[w],k=sh[w];(k===null||k.includes(g.tagName))&&(g.properties[w]=c(String(T||""),w,g))}}if(g.type==="element"){let w=s?!s.includes(g.tagName):m?m.includes(g.tagName):!1;if(!w&&l&&typeof h=="number"&&(w=!l(g,h,S)),w&&S&&typeof h=="number")return o&&g.children?S.children.splice(h,1,...g.children):S.children.splice(h,1),h}}}function ox(t){const r=t.indexOf(":"),s=t.indexOf("?"),l=t.indexOf("#"),d=t.indexOf("/");return r===-1||d!==-1&&r>d||s!==-1&&r>s||l!==-1&&r>l||ix.test(t.slice(0,r))?t:""}function Fg(t,r){const s=String(t);if(typeof r!="string")throw new TypeError("Expected character");let l=0,d=s.indexOf(r);for(;d!==-1;)l++,d=s.indexOf(r,d+r.length);return l}function cx(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function ux(t,r,s){const d=Go((s||{}).ignore||[]),m=hx(r);let f=-1;for(;++f<m.length;)nv(t,"text",o);function o(u,g){let h=-1,S;for(;++h<g.length;){const w=g[h],T=S?S.children:void 0;if(d(w,T?T.indexOf(w):void 0,S))return;S=w}if(S)return c(u,g)}function c(u,g){const h=g[g.length-1],S=m[f][0],w=m[f][1];let T=0;const y=h.children.indexOf(u);let _=!1,v=[];S.lastIndex=0;let b=S.exec(u.value);for(;b;){const E=b.index,O={index:b.index,input:b.input,stack:[...g,u]};let R=w(...b,O);if(typeof R=="string"&&(R=R.length>0?{type:"text",value:R}:void 0),R===!1?S.lastIndex=E+1:(T!==E&&v.push({type:"text",value:u.value.slice(T,E)}),Array.isArray(R)?v.push(...R):R&&v.push(R),T=E+b[0].length,_=!0),!S.global)break;b=S.exec(u.value)}return _?(T<u.value.length&&v.push({type:"text",value:u.value.slice(T)}),h.children.splice(y,1,...v)):v=[u],y+v.length}}function hx(t){const r=[];if(!Array.isArray(t))throw new TypeError("Expected find and replace tuple or list of tuples");const s=!t[0]||Array.isArray(t[0])?t:[t];let l=-1;for(;++l<s.length;){const d=s[l];r.push([fx(d[0]),dx(d[1])])}return r}function fx(t){return typeof t=="string"?new RegExp(cx(t),"g"):t}function dx(t){return typeof t=="function"?t:function(){return t}}const gh="phrasing",_h=["autolink","link","image","label"];function px(){return{transforms:[bx],enter:{literalAutolink:gx,literalAutolinkEmail:vh,literalAutolinkHttp:vh,literalAutolinkWww:vh},exit:{literalAutolink:Sx,literalAutolinkEmail:yx,literalAutolinkHttp:_x,literalAutolinkWww:vx}}}function mx(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:_h},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gh,notInConstruct:_h},{character:":",before:"[ps]",after:"\\/",inConstruct:gh,notInConstruct:_h}]}}function gx(t){this.enter({type:"link",title:null,url:"",children:[]},t)}function vh(t){this.config.enter.autolinkProtocol.call(this,t)}function _x(t){this.config.exit.autolinkProtocol.call(this,t)}function vx(t){this.config.exit.data.call(this,t);const r=this.stack[this.stack.length-1];r.type,r.url="http://"+this.sliceSerialize(t)}function yx(t){this.config.exit.autolinkEmail.call(this,t)}function Sx(t){this.exit(t)}function bx(t){ux(t,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Cx],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),wx]],{ignore:["link","linkReference"]})}function Cx(t,r,s,l,d){let m="";if(!sv(d)||(/^w/i.test(r)&&(s=r+s,r="",m="http://"),!xx(s)))return!1;const f=Ex(s+l);if(!f[0])return!1;const o={type:"link",title:null,url:m+r+f[0],children:[{type:"text",value:r+f[0]}]};return f[1]?[o,{type:"text",value:f[1]}]:o}function wx(t,r,s,l){return!sv(l,!0)||/[-\d_]$/.test(s)?!1:{type:"link",title:null,url:"mailto:"+r+"@"+s,children:[{type:"text",value:r+"@"+s}]}}function xx(t){const r=t.split(".");return!(r.length<2||r[r.length-1]&&(/_/.test(r[r.length-1])||!/[a-zA-Z\d]/.test(r[r.length-1]))||r[r.length-2]&&(/_/.test(r[r.length-2])||!/[a-zA-Z\d]/.test(r[r.length-2])))}function Ex(t){const r=/[!"&'),.:;<>?\]}]+$/.exec(t);if(!r)return[t,void 0];t=t.slice(0,r.index);let s=r[0],l=s.indexOf(")");const d=Fg(t,"(");let m=Fg(t,")");for(;l!==-1&&d>m;)t+=s.slice(0,l+1),s=s.slice(l+1),l=s.indexOf(")"),m++;return[t,s]}function sv(t,r){const s=t.input.charCodeAt(t.index-1);return(t.index===0||Xr(s)||Fo(s))&&(!r||s!==47)}av.peek=Bx;function kx(){this.buffer()}function Ax(t){this.enter({type:"footnoteReference",identifier:"",label:""},t)}function Tx(){this.buffer()}function Rx(t){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},t)}function Dx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ri(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Mx(t){this.exit(t)}function Lx(t){const r=this.resume(),s=this.stack[this.stack.length-1];s.type,s.identifier=ri(this.sliceSerialize(t)).toLowerCase(),s.label=r}function Ox(t){this.exit(t)}function Bx(){return"["}function av(t,r,s,l){const d=s.createTracker(l);let m=d.move("[^");const f=s.enter("footnoteReference"),o=s.enter("reference");return m+=d.move(s.safe(s.associationId(t),{after:"]",before:m})),o(),f(),m+=d.move("]"),m}function jx(){return{enter:{gfmFootnoteCallString:kx,gfmFootnoteCall:Ax,gfmFootnoteDefinitionLabelString:Tx,gfmFootnoteDefinition:Rx},exit:{gfmFootnoteCallString:Dx,gfmFootnoteCall:Mx,gfmFootnoteDefinitionLabelString:Lx,gfmFootnoteDefinition:Ox}}}function Nx(t){let r=!1;return t&&t.firstLineBlank&&(r=!0),{handlers:{footnoteDefinition:s,footnoteReference:av},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function s(l,d,m,f){const o=m.createTracker(f);let c=o.move("[^");const u=m.enter("footnoteDefinition"),g=m.enter("label");return c+=o.move(m.safe(m.associationId(l),{before:c,after:"]"})),g(),c+=o.move("]:"),l.children&&l.children.length>0&&(o.shift(4),c+=o.move((r?`
76
+ `:" ")+m.indentLines(m.containerFlow(l,o.current()),r?lv:Hx))),u(),c}}function Hx(t,r,s){return r===0?t:lv(t,r,s)}function lv(t,r,s){return(s?"":" ")+t}const zx=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ov.peek=qx;function Ix(){return{canContainEols:["delete"],enter:{strikethrough:Px},exit:{strikethrough:Fx}}}function Ux(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:zx}],handlers:{delete:ov}}}function Px(t){this.enter({type:"delete",children:[]},t)}function Fx(t){this.exit(t)}function ov(t,r,s,l){const d=s.createTracker(l),m=s.enter("strikethrough");let f=d.move("~~");return f+=s.containerPhrasing(t,{...d.current(),before:f,after:"~"}),f+=d.move("~~"),m(),f}function qx(){return"~"}function $x(t){return t.length}function Gx(t,r){const s=r||{},l=(s.align||[]).concat(),d=s.stringLength||$x,m=[],f=[],o=[],c=[];let u=0,g=-1;for(;++g<t.length;){const k=[],y=[];let _=-1;for(t[g].length>u&&(u=t[g].length);++_<t[g].length;){const v=Vx(t[g][_]);if(s.alignDelimiters!==!1){const b=d(v);y[_]=b,(c[_]===void 0||b>c[_])&&(c[_]=b)}k.push(v)}f[g]=k,o[g]=y}let h=-1;if(typeof l=="object"&&"length"in l)for(;++h<u;)m[h]=qg(l[h]);else{const k=qg(l);for(;++h<u;)m[h]=k}h=-1;const S=[],w=[];for(;++h<u;){const k=m[h];let y="",_="";k===99?(y=":",_=":"):k===108?y=":":k===114&&(_=":");let v=s.alignDelimiters===!1?1:Math.max(1,c[h]-y.length-_.length);const b=y+"-".repeat(v)+_;s.alignDelimiters!==!1&&(v=y.length+v+_.length,v>c[h]&&(c[h]=v),w[h]=v),S[h]=b}f.splice(1,0,S),o.splice(1,0,w),g=-1;const T=[];for(;++g<f.length;){const k=f[g],y=o[g];h=-1;const _=[];for(;++h<u;){const v=k[h]||"";let b="",E="";if(s.alignDelimiters!==!1){const O=c[h]-(y[h]||0),R=m[h];R===114?b=" ".repeat(O):R===99?O%2?(b=" ".repeat(O/2+.5),E=" ".repeat(O/2-.5)):(b=" ".repeat(O/2),E=b):E=" ".repeat(O)}s.delimiterStart!==!1&&!h&&_.push("|"),s.padding!==!1&&!(s.alignDelimiters===!1&&v==="")&&(s.delimiterStart!==!1||h)&&_.push(" "),s.alignDelimiters!==!1&&_.push(b),_.push(v),s.alignDelimiters!==!1&&_.push(E),s.padding!==!1&&_.push(" "),(s.delimiterEnd!==!1||h!==u-1)&&_.push("|")}T.push(s.delimiterEnd===!1?_.join("").replace(/ +$/,""):_.join(""))}return T.join(`
77
+ `)}function Vx(t){return t==null?"":String(t)}function qg(t){const r=typeof t=="string"?t.codePointAt(0):0;return r===67||r===99?99:r===76||r===108?108:r===82||r===114?114:0}function Wx(t,r,s,l){const d=s.enter("blockquote"),m=s.createTracker(l);m.move("> "),m.shift(2);const f=s.indentLines(s.containerFlow(t,m.current()),Kx);return d(),f}function Kx(t,r,s){return">"+(s?"":" ")+t}function Yx(t,r){return $g(t,r.inConstruct,!0)&&!$g(t,r.notInConstruct,!1)}function $g(t,r,s){if(typeof r=="string"&&(r=[r]),!r||r.length===0)return s;let l=-1;for(;++l<r.length;)if(t.includes(r[l]))return!0;return!1}function Gg(t,r,s,l){let d=-1;for(;++d<s.unsafe.length;)if(s.unsafe[d].character===`
78
+ `&&Yx(s.stack,s.unsafe[d]))return/[ \t]/.test(l.before)?"":" ";return`\\
79
+ `}function Xx(t,r){const s=String(t);let l=s.indexOf(r),d=l,m=0,f=0;if(typeof r!="string")throw new TypeError("Expected substring");for(;l!==-1;)l===d?++m>f&&(f=m):m=1,d=l+r.length,l=s.indexOf(r,d);return f}function Qx(t,r){return!!(r.options.fences===!1&&t.value&&!t.lang&&/[^ \r\n]/.test(t.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(t.value))}function Jx(t){const r=t.options.fence||"`";if(r!=="`"&&r!=="~")throw new Error("Cannot serialize code with `"+r+"` for `options.fence`, expected `` ` `` or `~`");return r}function Zx(t,r,s,l){const d=Jx(s),m=t.value||"",f=d==="`"?"GraveAccent":"Tilde";if(Qx(t,s)){const h=s.enter("codeIndented"),S=s.indentLines(m,eE);return h(),S}const o=s.createTracker(l),c=d.repeat(Math.max(Xx(m,d)+1,3)),u=s.enter("codeFenced");let g=o.move(c);if(t.lang){const h=s.enter(`codeFencedLang${f}`);g+=o.move(s.safe(t.lang,{before:g,after:" ",encode:["`"],...o.current()})),h()}if(t.lang&&t.meta){const h=s.enter(`codeFencedMeta${f}`);g+=o.move(" "),g+=o.move(s.safe(t.meta,{before:g,after:`
80
80
  `,encode:["`"],...o.current()})),h()}return g+=o.move(`
81
81
  `),m&&(g+=o.move(m+`
82
- `)),g+=o.move(c),u(),g}function tE(t,r,s){return(s?"":" ")+t}function nf(t){const r=t.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function nE(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("[");return u+=c.move(s.safe(s.associationId(t),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":`
83
- `,...c.current()}))),o(),t.title&&(o=s.enter(`title${m}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),f(),u}function iE(t){const r=t.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function ll(t){return"&#x"+t.toString(16).toUpperCase()+";"}function No(t,r,s){const l=Ws(t),d=Ws(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cv.peek=rE;function cv(t,r,s,l){const d=iE(s),m=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const u=c.charCodeAt(0),g=No(l.before.charCodeAt(l.before.length-1),u,d);g.inside&&(c=ll(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=No(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+ll(h));const w=f.move(d);return m(),s.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},o+c+w}function rE(t,r,s){return s.options.emphasis||"*"}function sE(t,r){let s=!1;return ef(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Lh}),!!((!t.depth||t.depth<3)&&Wh(t)&&(r.options.setext||s))}function aE(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),m=s.createTracker(l);if(sE(t,s)){const g=s.enter("headingSetext"),h=s.enter("phrasing"),S=s.containerPhrasing(t,{...m.current(),before:`
82
+ `)),g+=o.move(c),u(),g}function eE(t,r,s){return(s?"":" ")+t}function nf(t){const r=t.options.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Cannot serialize title with `"+r+"` for `options.quote`, expected `\"`, or `'`");return r}function tE(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.enter("definition");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("[");return u+=c.move(s.safe(s.associationId(t),{before:u,after:"]",...c.current()})),u+=c.move("]: "),o(),!t.url||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":`
83
+ `,...c.current()}))),o(),t.title&&(o=s.enter(`title${m}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),f(),u}function nE(t){const r=t.options.emphasis||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize emphasis with `"+r+"` for `options.emphasis`, expected `*`, or `_`");return r}function ll(t){return"&#x"+t.toString(16).toUpperCase()+";"}function No(t,r,s){const l=Ws(t),d=Ws(r);return l===void 0?d===void 0?s==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:l===1?d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:d===void 0?{inside:!1,outside:!1}:d===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}cv.peek=iE;function cv(t,r,s,l){const d=nE(s),m=s.enter("emphasis"),f=s.createTracker(l),o=f.move(d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const u=c.charCodeAt(0),g=No(l.before.charCodeAt(l.before.length-1),u,d);g.inside&&(c=ll(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=No(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+ll(h));const w=f.move(d);return m(),s.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},o+c+w}function iE(t,r,s){return s.options.emphasis||"*"}function rE(t,r){let s=!1;return ef(t,function(l){if("value"in l&&/\r?\n|\r/.test(l.value)||l.type==="break")return s=!0,Lh}),!!((!t.depth||t.depth<3)&&Wh(t)&&(r.options.setext||s))}function sE(t,r,s,l){const d=Math.max(Math.min(6,t.depth||1),1),m=s.createTracker(l);if(rE(t,s)){const g=s.enter("headingSetext"),h=s.enter("phrasing"),S=s.containerPhrasing(t,{...m.current(),before:`
84
84
  `,after:`
85
85
  `});return h(),g(),S+`
86
86
  `+(d===1?"=":"-").repeat(S.length-(Math.max(S.lastIndexOf("\r"),S.lastIndexOf(`
87
87
  `))+1))}const f="#".repeat(d),o=s.enter("headingAtx"),c=s.enter("phrasing");m.move(f+" ");let u=s.containerPhrasing(t,{before:"# ",after:`
88
- `,...m.current()});return/^[\t ]/.test(u)&&(u=ll(u.charCodeAt(0))+u.slice(1)),u=u?f+" "+u:f,s.options.closeAtx&&(u+=" "+f),c(),o(),u}uv.peek=lE;function uv(t){return t.value||""}function lE(){return"<"}hv.peek=oE;function hv(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("![");return u+=c.move(s.safe(t.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":")",...c.current()}))),o(),t.title&&(o=s.enter(`title${m}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),u+=c.move(")"),f(),u}function oE(){return"!"}fv.peek=cE;function fv(t,r,s,l){const d=t.referenceType,m=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const u=s.safe(t.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=g,m(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function cE(){return"!"}dv.peek=uE;function dv(t,r,s){let l=t.value||"",d="`",m=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++m<s.unsafe.length;){const f=s.unsafe[m],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let u=c.index;l.charCodeAt(u)===10&&l.charCodeAt(u-1)===13&&u--,l=l.slice(0,u)+" "+l.slice(c.index+1)}}return d+l+d}function uE(){return"`"}function pv(t,r){const s=Wh(t);return!!(!r.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(s===t.url||"mailto:"+s===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}mv.peek=hE;function mv(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(pv(t,s)){const g=s.stack;s.stack=[],o=s.enter("autolink");let h=f.move("<");return h+=f.move(s.containerPhrasing(t,{before:h,after:">",...f.current()})),h+=f.move(">"),o(),s.stack=g,h}o=s.enter("link"),c=s.enter("label");let u=f.move("[");return u+=f.move(s.containerPhrasing(t,{before:u,after:"](",...f.current()})),u+=f.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),u+=f.move("<"),u+=f.move(s.safe(t.url,{before:u,after:">",...f.current()})),u+=f.move(">")):(c=s.enter("destinationRaw"),u+=f.move(s.safe(t.url,{before:u,after:t.title?" ":")",...f.current()}))),c(),t.title&&(c=s.enter(`title${m}`),u+=f.move(" "+d),u+=f.move(s.safe(t.title,{before:u,after:d,...f.current()})),u+=f.move(d),c()),u+=f.move(")"),o(),u}function hE(t,r,s){return pv(t,s)?"<":"["}gv.peek=fE;function gv(t,r,s,l){const d=t.referenceType,m=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const u=s.containerPhrasing(t,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=g,m(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function fE(){return"["}function rf(t){const r=t.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function dE(t){const r=rf(t),s=t.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function pE(t){const r=t.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function _v(t){const r=t.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function mE(t,r,s,l){const d=s.enter("list"),m=s.bulletCurrent;let f=t.ordered?pE(s):rf(s);const o=t.ordered?f==="."?")":".":dE(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!t.ordered){const g=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),_v(s)===f&&g){let h=-1;for(;++h<t.children.length;){const S=t.children[h];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const u=s.containerFlow(t,l);return s.bulletLastUsed=f,s.bulletCurrent=m,d(),u}function gE(t){const r=t.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function _E(t,r,s,l){const d=gE(s);let m=s.bulletCurrent||rf(s);r&&r.type==="list"&&r.ordered&&(m=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(t))+m);let f=m.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||t.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(m+" ".repeat(f-m.length)),o.shift(f);const c=s.enter("listItem"),u=s.indentLines(s.containerFlow(t,o.current()),g);return c(),u;function g(h,S,w){return S?(w?"":" ".repeat(f))+h:(w?m:m+" ".repeat(f-m.length))+h}}function vE(t,r,s,l){const d=s.enter("paragraph"),m=s.enter("phrasing"),f=s.containerPhrasing(t,l);return m(),d(),f}const yE=Go(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function SE(t,r,s,l){return(t.children.some(function(f){return yE(f)})?s.containerPhrasing:s.containerFlow).call(s,t,l)}function bE(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}vv.peek=CE;function vv(t,r,s,l){const d=bE(s),m=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const u=c.charCodeAt(0),g=No(l.before.charCodeAt(l.before.length-1),u,d);g.inside&&(c=ll(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=No(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+ll(h));const w=f.move(d+d);return m(),s.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},o+c+w}function CE(t,r,s){return s.options.strong||"*"}function wE(t,r,s,l){return s.safe(t.value,l)}function xE(t){const r=t.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function EE(t,r,s){const l=(_v(s)+(s.options.ruleSpaces?" ":"")).repeat(xE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const yv={blockquote:Kx,break:Gg,code:eE,definition:nE,emphasis:cv,hardBreak:Gg,heading:aE,html:uv,image:hv,imageReference:fv,inlineCode:dv,link:mv,linkReference:gv,list:mE,listItem:_E,paragraph:vE,root:SE,strong:vv,text:wE,thematicBreak:EE};function kE(){return{enter:{table:AE,tableData:Vg,tableHeader:Vg,tableRow:RE},exit:{codeText:DE,table:TE,tableData:yh,tableHeader:yh,tableRow:yh}}}function AE(t){const r=t._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},t),this.data.inTable=!0}function TE(t){this.exit(t),this.data.inTable=void 0}function RE(t){this.enter({type:"tableRow",children:[]},t)}function yh(t){this.exit(t)}function Vg(t){this.enter({type:"tableCell",children:[]},t)}function DE(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,ME));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(t)}function ME(t,r){return r==="|"?r:t}function LE(t){const r=t||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,m=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
88
+ `,...m.current()});return/^[\t ]/.test(u)&&(u=ll(u.charCodeAt(0))+u.slice(1)),u=u?f+" "+u:f,s.options.closeAtx&&(u+=" "+f),c(),o(),u}uv.peek=aE;function uv(t){return t.value||""}function aE(){return"<"}hv.peek=lE;function hv(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.enter("image");let o=s.enter("label");const c=s.createTracker(l);let u=c.move("![");return u+=c.move(s.safe(t.alt,{before:u,after:"]",...c.current()})),u+=c.move("]("),o(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(o=s.enter("destinationLiteral"),u+=c.move("<"),u+=c.move(s.safe(t.url,{before:u,after:">",...c.current()})),u+=c.move(">")):(o=s.enter("destinationRaw"),u+=c.move(s.safe(t.url,{before:u,after:t.title?" ":")",...c.current()}))),o(),t.title&&(o=s.enter(`title${m}`),u+=c.move(" "+d),u+=c.move(s.safe(t.title,{before:u,after:d,...c.current()})),u+=c.move(d),o()),u+=c.move(")"),f(),u}function lE(){return"!"}fv.peek=oE;function fv(t,r,s,l){const d=t.referenceType,m=s.enter("imageReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("![");const u=s.safe(t.alt,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=g,m(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function oE(){return"!"}dv.peek=cE;function dv(t,r,s){let l=t.value||"",d="`",m=-1;for(;new RegExp("(^|[^`])"+d+"([^`]|$)").test(l);)d+="`";for(/[^ \r\n]/.test(l)&&(/^[ \r\n]/.test(l)&&/[ \r\n]$/.test(l)||/^`|`$/.test(l))&&(l=" "+l+" ");++m<s.unsafe.length;){const f=s.unsafe[m],o=s.compilePattern(f);let c;if(f.atBreak)for(;c=o.exec(l);){let u=c.index;l.charCodeAt(u)===10&&l.charCodeAt(u-1)===13&&u--,l=l.slice(0,u)+" "+l.slice(c.index+1)}}return d+l+d}function cE(){return"`"}function pv(t,r){const s=Wh(t);return!!(!r.options.resourceLink&&t.url&&!t.title&&t.children&&t.children.length===1&&t.children[0].type==="text"&&(s===t.url||"mailto:"+s===t.url)&&/^[a-z][a-z+.-]+:/i.test(t.url)&&!/[\0- <>\u007F]/.test(t.url))}mv.peek=uE;function mv(t,r,s,l){const d=nf(s),m=d==='"'?"Quote":"Apostrophe",f=s.createTracker(l);let o,c;if(pv(t,s)){const g=s.stack;s.stack=[],o=s.enter("autolink");let h=f.move("<");return h+=f.move(s.containerPhrasing(t,{before:h,after:">",...f.current()})),h+=f.move(">"),o(),s.stack=g,h}o=s.enter("link"),c=s.enter("label");let u=f.move("[");return u+=f.move(s.containerPhrasing(t,{before:u,after:"](",...f.current()})),u+=f.move("]("),c(),!t.url&&t.title||/[\0- \u007F]/.test(t.url)?(c=s.enter("destinationLiteral"),u+=f.move("<"),u+=f.move(s.safe(t.url,{before:u,after:">",...f.current()})),u+=f.move(">")):(c=s.enter("destinationRaw"),u+=f.move(s.safe(t.url,{before:u,after:t.title?" ":")",...f.current()}))),c(),t.title&&(c=s.enter(`title${m}`),u+=f.move(" "+d),u+=f.move(s.safe(t.title,{before:u,after:d,...f.current()})),u+=f.move(d),c()),u+=f.move(")"),o(),u}function uE(t,r,s){return pv(t,s)?"<":"["}gv.peek=hE;function gv(t,r,s,l){const d=t.referenceType,m=s.enter("linkReference");let f=s.enter("label");const o=s.createTracker(l);let c=o.move("[");const u=s.containerPhrasing(t,{before:c,after:"]",...o.current()});c+=o.move(u+"]["),f();const g=s.stack;s.stack=[],f=s.enter("reference");const h=s.safe(s.associationId(t),{before:c,after:"]",...o.current()});return f(),s.stack=g,m(),d==="full"||!u||u!==h?c+=o.move(h+"]"):d==="shortcut"?c=c.slice(0,-1):c+=o.move("]"),c}function hE(){return"["}function rf(t){const r=t.options.bullet||"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bullet`, expected `*`, `+`, or `-`");return r}function fE(t){const r=rf(t),s=t.options.bulletOther;if(!s)return r==="*"?"-":"*";if(s!=="*"&&s!=="+"&&s!=="-")throw new Error("Cannot serialize items with `"+s+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(s===r)throw new Error("Expected `bullet` (`"+r+"`) and `bulletOther` (`"+s+"`) to be different");return s}function dE(t){const r=t.options.bulletOrdered||".";if(r!=="."&&r!==")")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOrdered`, expected `.` or `)`");return r}function _v(t){const r=t.options.rule||"*";if(r!=="*"&&r!=="-"&&r!=="_")throw new Error("Cannot serialize rules with `"+r+"` for `options.rule`, expected `*`, `-`, or `_`");return r}function pE(t,r,s,l){const d=s.enter("list"),m=s.bulletCurrent;let f=t.ordered?dE(s):rf(s);const o=t.ordered?f==="."?")":".":fE(s);let c=r&&s.bulletLastUsed?f===s.bulletLastUsed:!1;if(!t.ordered){const g=t.children?t.children[0]:void 0;if((f==="*"||f==="-")&&g&&(!g.children||!g.children[0])&&s.stack[s.stack.length-1]==="list"&&s.stack[s.stack.length-2]==="listItem"&&s.stack[s.stack.length-3]==="list"&&s.stack[s.stack.length-4]==="listItem"&&s.indexStack[s.indexStack.length-1]===0&&s.indexStack[s.indexStack.length-2]===0&&s.indexStack[s.indexStack.length-3]===0&&(c=!0),_v(s)===f&&g){let h=-1;for(;++h<t.children.length;){const S=t.children[h];if(S&&S.type==="listItem"&&S.children&&S.children[0]&&S.children[0].type==="thematicBreak"){c=!0;break}}}}c&&(f=o),s.bulletCurrent=f;const u=s.containerFlow(t,l);return s.bulletLastUsed=f,s.bulletCurrent=m,d(),u}function mE(t){const r=t.options.listItemIndent||"one";if(r!=="tab"&&r!=="one"&&r!=="mixed")throw new Error("Cannot serialize items with `"+r+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return r}function gE(t,r,s,l){const d=mE(s);let m=s.bulletCurrent||rf(s);r&&r.type==="list"&&r.ordered&&(m=(typeof r.start=="number"&&r.start>-1?r.start:1)+(s.options.incrementListMarker===!1?0:r.children.indexOf(t))+m);let f=m.length+1;(d==="tab"||d==="mixed"&&(r&&r.type==="list"&&r.spread||t.spread))&&(f=Math.ceil(f/4)*4);const o=s.createTracker(l);o.move(m+" ".repeat(f-m.length)),o.shift(f);const c=s.enter("listItem"),u=s.indentLines(s.containerFlow(t,o.current()),g);return c(),u;function g(h,S,w){return S?(w?"":" ".repeat(f))+h:(w?m:m+" ".repeat(f-m.length))+h}}function _E(t,r,s,l){const d=s.enter("paragraph"),m=s.enter("phrasing"),f=s.containerPhrasing(t,l);return m(),d(),f}const vE=Go(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function yE(t,r,s,l){return(t.children.some(function(f){return vE(f)})?s.containerPhrasing:s.containerFlow).call(s,t,l)}function SE(t){const r=t.options.strong||"*";if(r!=="*"&&r!=="_")throw new Error("Cannot serialize strong with `"+r+"` for `options.strong`, expected `*`, or `_`");return r}vv.peek=bE;function vv(t,r,s,l){const d=SE(s),m=s.enter("strong"),f=s.createTracker(l),o=f.move(d+d);let c=f.move(s.containerPhrasing(t,{after:d,before:o,...f.current()}));const u=c.charCodeAt(0),g=No(l.before.charCodeAt(l.before.length-1),u,d);g.inside&&(c=ll(u)+c.slice(1));const h=c.charCodeAt(c.length-1),S=No(l.after.charCodeAt(0),h,d);S.inside&&(c=c.slice(0,-1)+ll(h));const w=f.move(d+d);return m(),s.attentionEncodeSurroundingInfo={after:S.outside,before:g.outside},o+c+w}function bE(t,r,s){return s.options.strong||"*"}function CE(t,r,s,l){return s.safe(t.value,l)}function wE(t){const r=t.options.ruleRepetition||3;if(r<3)throw new Error("Cannot serialize rules with repetition `"+r+"` for `options.ruleRepetition`, expected `3` or more");return r}function xE(t,r,s){const l=(_v(s)+(s.options.ruleSpaces?" ":"")).repeat(wE(s));return s.options.ruleSpaces?l.slice(0,-1):l}const yv={blockquote:Wx,break:Gg,code:Zx,definition:tE,emphasis:cv,hardBreak:Gg,heading:sE,html:uv,image:hv,imageReference:fv,inlineCode:dv,link:mv,linkReference:gv,list:pE,listItem:gE,paragraph:_E,root:yE,strong:vv,text:CE,thematicBreak:xE};function EE(){return{enter:{table:kE,tableData:Vg,tableHeader:Vg,tableRow:TE},exit:{codeText:RE,table:AE,tableData:yh,tableHeader:yh,tableRow:yh}}}function kE(t){const r=t._align;this.enter({type:"table",align:r.map(function(s){return s==="none"?null:s}),children:[]},t),this.data.inTable=!0}function AE(t){this.exit(t),this.data.inTable=void 0}function TE(t){this.enter({type:"tableRow",children:[]},t)}function yh(t){this.exit(t)}function Vg(t){this.enter({type:"tableCell",children:[]},t)}function RE(t){let r=this.resume();this.data.inTable&&(r=r.replace(/\\([\\|])/g,DE));const s=this.stack[this.stack.length-1];s.type,s.value=r,this.exit(t)}function DE(t,r){return r==="|"?r:t}function ME(t){const r=t||{},s=r.tableCellPadding,l=r.tablePipeAlign,d=r.stringLength,m=s?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
89
89
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:S,table:f,tableCell:c,tableRow:o}};function f(w,T,k,y){return u(g(w,k,y),w.align)}function o(w,T,k,y){const _=h(w,k,y),v=u([_]);return v.slice(0,v.indexOf(`
90
- `))}function c(w,T,k,y){const _=k.enter("tableCell"),v=k.enter("phrasing"),b=k.containerPhrasing(w,{...y,before:m,after:m});return v(),_(),b}function u(w,T){return Vx(w,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function g(w,T,k){const y=w.children;let _=-1;const v=[],b=T.enter("table");for(;++_<y.length;)v[_]=h(y[_],T,k);return b(),v}function h(w,T,k){const y=w.children;let _=-1;const v=[],b=T.enter("tableRow");for(;++_<y.length;)v[_]=c(y[_],w,T,k);return b(),v}function S(w,T,k){let y=yv.inlineCode(w,T,k);return k.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function OE(){return{exit:{taskListCheckValueChecked:Wg,taskListCheckValueUnchecked:Wg,paragraph:jE}}}function BE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:NE}}}function Wg(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function jE(t){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const l=s.children[0];if(l&&l.type==="text"){const d=r.children;let m=-1,f;for(;++m<d.length;){const o=d[m];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(t)}function NE(t,r,s,l){const d=t.children[0],m=typeof t.checked=="boolean"&&d&&d.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",o=s.createTracker(l);m&&o.move(f);let c=yv.listItem(t,r,s,{...l,...o.current()});return m&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(g){return g+f}}function HE(){return[mx(),Nx(),Ux(),kE(),OE()]}function zE(t){return{extensions:[gx(),Hx(t),Px(),LE(t),BE()]}}const IE={tokenize:GE,partial:!0},Sv={tokenize:VE,partial:!0},bv={tokenize:WE,partial:!0},Cv={tokenize:KE,partial:!0},UE={tokenize:YE,partial:!0},wv={name:"wwwAutolink",tokenize:qE,previous:Ev},xv={name:"protocolAutolink",tokenize:$E,previous:kv},Ui={name:"emailAutolink",tokenize:FE,previous:Av},pi={};function PE(){return{text:pi}}let Wr=48;for(;Wr<123;)pi[Wr]=Ui,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);pi[43]=Ui;pi[45]=Ui;pi[46]=Ui;pi[95]=Ui;pi[72]=[Ui,xv];pi[104]=[Ui,xv];pi[87]=[Ui,wv];pi[119]=[Ui,wv];function FE(t,r,s){const l=this;let d,m;return f;function f(h){return!Nh(h)||!Av.call(l,l.previous)||sf(l.events)?s(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(h))}function o(h){return Nh(h)?(t.consume(h),o):h===64?(t.consume(h),c):s(h)}function c(h){return h===46?t.check(UE,g,u)(h):h===45||h===95||tn(h)?(m=!0,t.consume(h),c):g(h)}function u(h){return t.consume(h),d=!0,c}function g(h){return m&&d&&un(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(h)):s(h)}}function qE(t,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!Ev.call(l,l.previous)||sf(l.events)?s(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(IE,t.attempt(Sv,t.attempt(bv,m),s),s)(f))}function m(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function $E(t,r,s){const l=this;let d="",m=!1;return f;function f(h){return(h===72||h===104)&&kv.call(l,l.previous)&&!sf(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(h),t.consume(h),o):s(h)}function o(h){if(un(h)&&d.length<5)return d+=String.fromCodePoint(h),t.consume(h),o;if(h===58){const S=d.toLowerCase();if(S==="http"||S==="https")return t.consume(h),c}return s(h)}function c(h){return h===47?(t.consume(h),m?u:(m=!0,c)):s(h)}function u(h){return h===null||Oo(h)||pt(h)||Xr(h)||Fo(h)?s(h):t.attempt(Sv,t.attempt(bv,g),s)(h)}function g(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(h)}}function GE(t,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,t.consume(f),d):f===46&&l===3?(t.consume(f),m):s(f)}function m(f){return f===null?s(f):r(f)}}function VE(t,r,s){let l,d,m;return f;function f(u){return u===46||u===95?t.check(Cv,c,o)(u):u===null||pt(u)||Xr(u)||u!==45&&Fo(u)?c(u):(m=!0,t.consume(u),f)}function o(u){return u===95?l=!0:(d=l,l=void 0),t.consume(u),f}function c(u){return d||l||!m?s(u):r(u)}}function WE(t,r){let s=0,l=0;return d;function d(f){return f===40?(s++,t.consume(f),d):f===41&&l<s?m(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(Cv,r,m)(f):f===null||pt(f)||Xr(f)?r(f):(t.consume(f),d)}function m(f){return f===41&&l++,t.consume(f),d}}function KE(t,r,s){return l;function l(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?(t.consume(o),l):o===38?(t.consume(o),m):o===93?(t.consume(o),d):o===60||o===null||pt(o)||Xr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||pt(o)||Xr(o)?r(o):l(o)}function m(o){return un(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):un(o)?(t.consume(o),f):s(o)}}function YE(t,r,s){return l;function l(m){return t.consume(m),d}function d(m){return tn(m)?s(m):r(m)}}function Ev(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||pt(t)}function kv(t){return!un(t)}function Av(t){return!(t===47||Nh(t))}function Nh(t){return t===43||t===45||t===46||t===95||tn(t)}function sf(t){let r=t.length,s=!1;for(;r--;){const l=t[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return t.length>0&&!s&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const XE={tokenize:rk,partial:!0};function QE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:tk,continuation:{tokenize:nk},exit:ik}},text:{91:{name:"gfmFootnoteCall",tokenize:ek},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:JE,resolveTo:ZE}}}}function JE(t,r,s){const l=this;let d=l.events.length;const m=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!f||!f._balanced)return s(c);const u=ri(l.sliceSerialize({start:f.end,end:l.now()}));return u.codePointAt(0)!==94||!m.includes(u.slice(1))?s(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),r(c))}}function ZE(t,r){let s=t.length;for(;s--;)if(t[s][1].type==="labelImage"&&t[s][0]==="enter"){t[s][1];break}t[s+1][1].type="data",t[s+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},t[s+3][1].start),end:Object.assign({},t[t.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},t[s+3][1].end),end:Object.assign({},t[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const m={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},m.start),end:Object.assign({},m.end)},o=[t[s+1],t[s+2],["enter",l,r],t[s+3],t[s+4],["enter",d,r],["exit",d,r],["enter",m,r],["enter",f,r],["exit",f,r],["exit",m,r],t[t.length-2],t[t.length-1],["exit",l,r]];return t.splice(s,t.length-s+1,...o),t}function ek(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m=0,f;return o;function o(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?s(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(h){if(m>999||h===93&&!f||h===null||h===91||pt(h))return s(h);if(h===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return d.includes(ri(l.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):s(h)}return pt(h)||(f=!0),m++,t.consume(h),h===92?g:u}function g(h){return h===91||h===92||h===93?(t.consume(h),m++,u):u(h)}}function tk(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m,f=0,o;return c;function c(T){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(T){return T===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",g):s(T)}function g(T){if(f>999||T===93&&!o||T===null||T===91||pt(T))return s(T);if(T===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return m=ri(l.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return pt(T)||(o=!0),f++,t.consume(T),T===92?h:g}function h(T){return T===91||T===92||T===93?(t.consume(T),f++,g):g(T)}function S(T){return T===58?(t.enter("definitionMarker"),t.consume(T),t.exit("definitionMarker"),d.includes(m)||d.push(m),Ze(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function nk(t,r,s){return t.check(hl,r,t.attempt(XE,r,s))}function ik(t){t.exit("gfmFootnoteDefinition")}function rk(t,r,s){const l=this;return Ze(t,d,"gfmFootnoteDefinitionIndent",5);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(m):s(m)}}function sk(t){let s=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:m,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let u=c;for(;u--;)if(f[u][0]==="exit"&&f[u][1].type==="strikethroughSequenceTemporary"&&f[u][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[u][1].end.offset-f[u][1].start.offset){f[c][1].type="strikethroughSequence",f[u][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},f[u][1].start),end:Object.assign({},f[c][1].end)},h={type:"strikethroughText",start:Object.assign({},f[u][1].end),end:Object.assign({},f[c][1].start)},S=[["enter",g,o],["enter",f[u][1],o],["exit",f[u][1],o],["enter",h,o]],w=o.parser.constructs.insideSpan.null;w&&Nn(S,S.length,0,qo(w,f.slice(u+1,c),o)),Nn(S,S.length,0,[["exit",h,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",g,o]]),Nn(f,u-1,c-u+3,S),c=u+S.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function m(f,o,c){const u=this.previous,g=this.events;let h=0;return S;function S(T){return u===126&&g[g.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const k=Ws(u);if(T===126)return h>1?c(T):(f.consume(T),h++,w);if(h<2&&!s)return c(T);const y=f.exit("strikethroughSequenceTemporary"),_=Ws(T);return y._open=!_||_===2&&!!k,y._close=!k||k===2&&!!_,o(T)}}}class ak{constructor(){this.map=[]}add(r,s,l){lk(this,r,s,l)}consume(r){if(this.map.sort(function(m,f){return m[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const m of d)r.push(m);d=l.pop()}this.map.length=0}}function lk(t,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<t.map.length;){if(t.map[d][0]===r){t.map[d][1]+=s,t.map[d][2].push(...l);return}d+=1}t.map.push([r,s,l])}}function ok(t,r){let s=!1;const l=[];for(;r<t.length;){const d=t[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(t[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(t[r-1][1].type==="tableDelimiterMarker"){const m=l.length-1;l[m]=l[m]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function ck(){return{flow:{null:{name:"table",tokenize:uk,resolveAll:hk}}}}function uk(t,r,s){const l=this;let d=0,m=0,f;return o;function o(L){let H=l.events.length-1;for(;H>-1;){const W=l.events[H][1].type;if(W==="lineEnding"||W==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?R:c;return P===R&&l.parser.lazy[l.now().line]?s(L):P(L)}function c(L){return t.enter("tableHead"),t.enter("tableRow"),u(L)}function u(L){return L===124||(f=!0,m+=1),g(L)}function g(L){return L===null?s(L):Be(L)?m>1?(m=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),w):s(L):Ke(L)?Ze(t,g,"whitespace")(L):(m+=1,f&&(f=!1,d+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),f=!0,g):(t.enter("data"),h(L)))}function h(L){return L===null||L===124||pt(L)?(t.exit("data"),g(L)):(t.consume(L),L===92?S:h)}function S(L){return L===92||L===124?(t.consume(L),h):h(L)}function w(L){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(L):(t.enter("tableDelimiterRow"),f=!1,Ke(L)?Ze(t,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):T(L))}function T(L){return L===45||L===58?y(L):L===124?(f=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),k):O(L)}function k(L){return Ke(L)?Ze(t,y,"whitespace")(L):y(L)}function y(L){return L===58?(m+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),_):L===45?(m+=1,_(L)):L===null||Be(L)?E(L):O(L)}function _(L){return L===45?(t.enter("tableDelimiterFiller"),v(L)):O(L)}function v(L){return L===45?(t.consume(L),v):L===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(L))}function b(L){return Ke(L)?Ze(t,E,"whitespace")(L):E(L)}function E(L){return L===124?T(L):L===null||Be(L)?!f||d!==m?O(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(L)):O(L)}function O(L){return s(L)}function R(L){return t.enter("tableRow"),D(L)}function D(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),D):L===null||Be(L)?(t.exit("tableRow"),r(L)):Ke(L)?Ze(t,D,"whitespace")(L):(t.enter("data"),A(L))}function A(L){return L===null||L===124||pt(L)?(t.exit("data"),D(L)):(t.consume(L),L===92?M:A)}function M(L){return L===92||L===124?(t.consume(L),A):A(L)}}function hk(t,r){let s=-1,l=!0,d=0,m=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,u,g,h;const S=new ak;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Kg(S,r,c,u,g),g=void 0,c=0),u={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",u,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,h=void 0,m=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,g={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",g,r]])),d=T.type==="tableDelimiterRow"?2:g?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(m[1]!==0&&(f[0]=f[1],h=To(S,r,m,d,void 0,h),m=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(m[1]!==0&&(f[0]=f[1],h=To(S,r,m,d,void 0,h)),m=f,f=[m[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,m[1]!==0?(f[0]=f[1],h=To(S,r,m,d,s,h)):f[1]!==0&&(h=To(S,r,f,d,s,h)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Kg(S,r,c,u,g),S.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=ok(r.events,s))}return t}function To(t,r,s,l,d,m){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(m.end=Object.assign({},qs(r.events,s[0])),t.add(s[0],0,[["exit",m,r]]));const c=qs(r.events,s[1]);if(m={type:f,start:Object.assign({},c),end:Object.assign({},c)},t.add(s[1],0,[["enter",m,r]]),s[2]!==0){const u=qs(r.events,s[2]),g=qs(r.events,s[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},g)};if(t.add(s[2],0,[["enter",h,r]]),l!==2){const S=r.events[s[2]],w=r.events[s[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,k=s[3]-s[2]-1;t.add(T,k,[])}}t.add(s[3]+1,0,[["exit",h,r]])}return d!==void 0&&(m.end=Object.assign({},qs(r.events,d)),t.add(d,0,[["exit",m,r]]),m=void 0),m}function Kg(t,r,s,l,d){const m=[],f=qs(r.events,s);d&&(d.end=Object.assign({},f),m.push(["exit",d,r])),l.end=Object.assign({},f),m.push(["exit",l,r]),t.add(s+1,0,m)}function qs(t,r){const s=t[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const fk={name:"tasklistCheck",tokenize:pk};function dk(){return{text:{91:fk}}}function pk(t,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),m)}function m(c){return pt(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):s(c)}function o(c){return Be(c)?r(c):Ke(c)?t.check({tokenize:mk},r,s)(c):s(c)}}function mk(t,r,s){return Ze(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function gk(t){return H_([PE(),QE(),sk(t),ck(),dk()])}const _k={};function Tv(t){const r=this,s=t||_k,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),m=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(gk(s)),m.push(HE()),f.push(zE(s))}const Rv=1e3,$s=new Map;let il;function vk(t,r,s){const l=Symbol(t),d=Math.max(Rv,s.intervalMs),m=Date.now();return $s.set(t,{id:t,intervalMs:d,nextRunAt:s.runImmediately===!1?m+d:m,inFlight:!1,run:r,token:l}),yk(),Dv(),()=>{const f=$s.get(t);(f==null?void 0:f.token)===l&&($s.delete(t),$s.size===0&&il!==void 0&&(window.clearInterval(il),il=void 0))}}function yk(){il!==void 0||typeof window>"u"||(il=window.setInterval(()=>{Dv()},Rv))}async function Dv(){const t=Date.now();for(const r of $s.values())r.inFlight||r.nextRunAt>t||Sk(r)}async function Sk(t){t.inFlight=!0;try{await t.run()}catch{}finally{const r=$s.get(t.id);(r==null?void 0:r.token)===t.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function ol(t,r,s){const l=ee.useRef(r);ee.useEffect(()=>{l.current=r},[r]),ee.useEffect(()=>{if(!(!t||s.enabled===!1))return vk(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Ho=`
90
+ `))}function c(w,T,k,y){const _=k.enter("tableCell"),v=k.enter("phrasing"),b=k.containerPhrasing(w,{...y,before:m,after:m});return v(),_(),b}function u(w,T){return Gx(w,{align:T,alignDelimiters:l,padding:s,stringLength:d})}function g(w,T,k){const y=w.children;let _=-1;const v=[],b=T.enter("table");for(;++_<y.length;)v[_]=h(y[_],T,k);return b(),v}function h(w,T,k){const y=w.children;let _=-1;const v=[],b=T.enter("tableRow");for(;++_<y.length;)v[_]=c(y[_],w,T,k);return b(),v}function S(w,T,k){let y=yv.inlineCode(w,T,k);return k.stack.includes("tableCell")&&(y=y.replace(/\|/g,"\\$&")),y}}function LE(){return{exit:{taskListCheckValueChecked:Wg,taskListCheckValueUnchecked:Wg,paragraph:BE}}}function OE(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:jE}}}function Wg(t){const r=this.stack[this.stack.length-2];r.type,r.checked=t.type==="taskListCheckValueChecked"}function BE(t){const r=this.stack[this.stack.length-2];if(r&&r.type==="listItem"&&typeof r.checked=="boolean"){const s=this.stack[this.stack.length-1];s.type;const l=s.children[0];if(l&&l.type==="text"){const d=r.children;let m=-1,f;for(;++m<d.length;){const o=d[m];if(o.type==="paragraph"){f=o;break}}f===s&&(l.value=l.value.slice(1),l.value.length===0?s.children.shift():s.position&&l.position&&typeof l.position.start.offset=="number"&&(l.position.start.column++,l.position.start.offset++,s.position.start=Object.assign({},l.position.start)))}}this.exit(t)}function jE(t,r,s,l){const d=t.children[0],m=typeof t.checked=="boolean"&&d&&d.type==="paragraph",f="["+(t.checked?"x":" ")+"] ",o=s.createTracker(l);m&&o.move(f);let c=yv.listItem(t,r,s,{...l,...o.current()});return m&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,u)),c;function u(g){return g+f}}function NE(){return[px(),jx(),Ix(),EE(),LE()]}function HE(t){return{extensions:[mx(),Nx(t),Ux(),ME(t),OE()]}}const zE={tokenize:$E,partial:!0},Sv={tokenize:GE,partial:!0},bv={tokenize:VE,partial:!0},Cv={tokenize:WE,partial:!0},IE={tokenize:KE,partial:!0},wv={name:"wwwAutolink",tokenize:FE,previous:Ev},xv={name:"protocolAutolink",tokenize:qE,previous:kv},Ui={name:"emailAutolink",tokenize:PE,previous:Av},pi={};function UE(){return{text:pi}}let Wr=48;for(;Wr<123;)pi[Wr]=Ui,Wr++,Wr===58?Wr=65:Wr===91&&(Wr=97);pi[43]=Ui;pi[45]=Ui;pi[46]=Ui;pi[95]=Ui;pi[72]=[Ui,xv];pi[104]=[Ui,xv];pi[87]=[Ui,wv];pi[119]=[Ui,wv];function PE(t,r,s){const l=this;let d,m;return f;function f(h){return!Nh(h)||!Av.call(l,l.previous)||sf(l.events)?s(h):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),o(h))}function o(h){return Nh(h)?(t.consume(h),o):h===64?(t.consume(h),c):s(h)}function c(h){return h===46?t.check(IE,g,u)(h):h===45||h===95||tn(h)?(m=!0,t.consume(h),c):g(h)}function u(h){return t.consume(h),d=!0,c}function g(h){return m&&d&&un(l.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),r(h)):s(h)}}function FE(t,r,s){const l=this;return d;function d(f){return f!==87&&f!==119||!Ev.call(l,l.previous)||sf(l.events)?s(f):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(zE,t.attempt(Sv,t.attempt(bv,m),s),s)(f))}function m(f){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),r(f)}}function qE(t,r,s){const l=this;let d="",m=!1;return f;function f(h){return(h===72||h===104)&&kv.call(l,l.previous)&&!sf(l.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),d+=String.fromCodePoint(h),t.consume(h),o):s(h)}function o(h){if(un(h)&&d.length<5)return d+=String.fromCodePoint(h),t.consume(h),o;if(h===58){const S=d.toLowerCase();if(S==="http"||S==="https")return t.consume(h),c}return s(h)}function c(h){return h===47?(t.consume(h),m?u:(m=!0,c)):s(h)}function u(h){return h===null||Oo(h)||pt(h)||Xr(h)||Fo(h)?s(h):t.attempt(Sv,t.attempt(bv,g),s)(h)}function g(h){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),r(h)}}function $E(t,r,s){let l=0;return d;function d(f){return(f===87||f===119)&&l<3?(l++,t.consume(f),d):f===46&&l===3?(t.consume(f),m):s(f)}function m(f){return f===null?s(f):r(f)}}function GE(t,r,s){let l,d,m;return f;function f(u){return u===46||u===95?t.check(Cv,c,o)(u):u===null||pt(u)||Xr(u)||u!==45&&Fo(u)?c(u):(m=!0,t.consume(u),f)}function o(u){return u===95?l=!0:(d=l,l=void 0),t.consume(u),f}function c(u){return d||l||!m?s(u):r(u)}}function VE(t,r){let s=0,l=0;return d;function d(f){return f===40?(s++,t.consume(f),d):f===41&&l<s?m(f):f===33||f===34||f===38||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===60||f===63||f===93||f===95||f===126?t.check(Cv,r,m)(f):f===null||pt(f)||Xr(f)?r(f):(t.consume(f),d)}function m(f){return f===41&&l++,t.consume(f),d}}function WE(t,r,s){return l;function l(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?(t.consume(o),l):o===38?(t.consume(o),m):o===93?(t.consume(o),d):o===60||o===null||pt(o)||Xr(o)?r(o):s(o)}function d(o){return o===null||o===40||o===91||pt(o)||Xr(o)?r(o):l(o)}function m(o){return un(o)?f(o):s(o)}function f(o){return o===59?(t.consume(o),l):un(o)?(t.consume(o),f):s(o)}}function KE(t,r,s){return l;function l(m){return t.consume(m),d}function d(m){return tn(m)?s(m):r(m)}}function Ev(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||pt(t)}function kv(t){return!un(t)}function Av(t){return!(t===47||Nh(t))}function Nh(t){return t===43||t===45||t===46||t===95||tn(t)}function sf(t){let r=t.length,s=!1;for(;r--;){const l=t[r][1];if((l.type==="labelLink"||l.type==="labelImage")&&!l._balanced){s=!0;break}if(l._gfmAutolinkLiteralWalkedInto){s=!1;break}}return t.length>0&&!s&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),s}const YE={tokenize:ik,partial:!0};function XE(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:ek,continuation:{tokenize:tk},exit:nk}},text:{91:{name:"gfmFootnoteCall",tokenize:ZE},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:QE,resolveTo:JE}}}}function QE(t,r,s){const l=this;let d=l.events.length;const m=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let f;for(;d--;){const c=l.events[d][1];if(c.type==="labelImage"){f=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return o;function o(c){if(!f||!f._balanced)return s(c);const u=ri(l.sliceSerialize({start:f.end,end:l.now()}));return u.codePointAt(0)!==94||!m.includes(u.slice(1))?s(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),r(c))}}function JE(t,r){let s=t.length;for(;s--;)if(t[s][1].type==="labelImage"&&t[s][0]==="enter"){t[s][1];break}t[s+1][1].type="data",t[s+3][1].type="gfmFootnoteCallLabelMarker";const l={type:"gfmFootnoteCall",start:Object.assign({},t[s+3][1].start),end:Object.assign({},t[t.length-1][1].end)},d={type:"gfmFootnoteCallMarker",start:Object.assign({},t[s+3][1].end),end:Object.assign({},t[s+3][1].end)};d.end.column++,d.end.offset++,d.end._bufferIndex++;const m={type:"gfmFootnoteCallString",start:Object.assign({},d.end),end:Object.assign({},t[t.length-1][1].start)},f={type:"chunkString",contentType:"string",start:Object.assign({},m.start),end:Object.assign({},m.end)},o=[t[s+1],t[s+2],["enter",l,r],t[s+3],t[s+4],["enter",d,r],["exit",d,r],["enter",m,r],["enter",f,r],["exit",f,r],["exit",m,r],t[t.length-2],t[t.length-1],["exit",l,r]];return t.splice(s,t.length-s+1,...o),t}function ZE(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m=0,f;return o;function o(h){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),c}function c(h){return h!==94?s(h):(t.enter("gfmFootnoteCallMarker"),t.consume(h),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",u)}function u(h){if(m>999||h===93&&!f||h===null||h===91||pt(h))return s(h);if(h===93){t.exit("chunkString");const S=t.exit("gfmFootnoteCallString");return d.includes(ri(l.sliceSerialize(S)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(h),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),r):s(h)}return pt(h)||(f=!0),m++,t.consume(h),h===92?g:u}function g(h){return h===91||h===92||h===93?(t.consume(h),m++,u):u(h)}}function ek(t,r,s){const l=this,d=l.parser.gfmFootnotes||(l.parser.gfmFootnotes=[]);let m,f=0,o;return c;function c(T){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),u}function u(T){return T===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",g):s(T)}function g(T){if(f>999||T===93&&!o||T===null||T===91||pt(T))return s(T);if(T===93){t.exit("chunkString");const k=t.exit("gfmFootnoteDefinitionLabelString");return m=ri(l.sliceSerialize(k)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(T),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),S}return pt(T)||(o=!0),f++,t.consume(T),T===92?h:g}function h(T){return T===91||T===92||T===93?(t.consume(T),f++,g):g(T)}function S(T){return T===58?(t.enter("definitionMarker"),t.consume(T),t.exit("definitionMarker"),d.includes(m)||d.push(m),Ze(t,w,"gfmFootnoteDefinitionWhitespace")):s(T)}function w(T){return r(T)}}function tk(t,r,s){return t.check(hl,r,t.attempt(YE,r,s))}function nk(t){t.exit("gfmFootnoteDefinition")}function ik(t,r,s){const l=this;return Ze(t,d,"gfmFootnoteDefinitionIndent",5);function d(m){const f=l.events[l.events.length-1];return f&&f[1].type==="gfmFootnoteDefinitionIndent"&&f[2].sliceSerialize(f[1],!0).length===4?r(m):s(m)}}function rk(t){let s=(t||{}).singleTilde;const l={name:"strikethrough",tokenize:m,resolveAll:d};return s==null&&(s=!0),{text:{126:l},insideSpan:{null:[l]},attentionMarkers:{null:[126]}};function d(f,o){let c=-1;for(;++c<f.length;)if(f[c][0]==="enter"&&f[c][1].type==="strikethroughSequenceTemporary"&&f[c][1]._close){let u=c;for(;u--;)if(f[u][0]==="exit"&&f[u][1].type==="strikethroughSequenceTemporary"&&f[u][1]._open&&f[c][1].end.offset-f[c][1].start.offset===f[u][1].end.offset-f[u][1].start.offset){f[c][1].type="strikethroughSequence",f[u][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},f[u][1].start),end:Object.assign({},f[c][1].end)},h={type:"strikethroughText",start:Object.assign({},f[u][1].end),end:Object.assign({},f[c][1].start)},S=[["enter",g,o],["enter",f[u][1],o],["exit",f[u][1],o],["enter",h,o]],w=o.parser.constructs.insideSpan.null;w&&Nn(S,S.length,0,qo(w,f.slice(u+1,c),o)),Nn(S,S.length,0,[["exit",h,o],["enter",f[c][1],o],["exit",f[c][1],o],["exit",g,o]]),Nn(f,u-1,c-u+3,S),c=u+S.length-2;break}}for(c=-1;++c<f.length;)f[c][1].type==="strikethroughSequenceTemporary"&&(f[c][1].type="data");return f}function m(f,o,c){const u=this.previous,g=this.events;let h=0;return S;function S(T){return u===126&&g[g.length-1][1].type!=="characterEscape"?c(T):(f.enter("strikethroughSequenceTemporary"),w(T))}function w(T){const k=Ws(u);if(T===126)return h>1?c(T):(f.consume(T),h++,w);if(h<2&&!s)return c(T);const y=f.exit("strikethroughSequenceTemporary"),_=Ws(T);return y._open=!_||_===2&&!!k,y._close=!k||k===2&&!!_,o(T)}}}class sk{constructor(){this.map=[]}add(r,s,l){ak(this,r,s,l)}consume(r){if(this.map.sort(function(m,f){return m[0]-f[0]}),this.map.length===0)return;let s=this.map.length;const l=[];for(;s>0;)s-=1,l.push(r.slice(this.map[s][0]+this.map[s][1]),this.map[s][2]),r.length=this.map[s][0];l.push(r.slice()),r.length=0;let d=l.pop();for(;d;){for(const m of d)r.push(m);d=l.pop()}this.map.length=0}}function ak(t,r,s,l){let d=0;if(!(s===0&&l.length===0)){for(;d<t.map.length;){if(t.map[d][0]===r){t.map[d][1]+=s,t.map[d][2].push(...l);return}d+=1}t.map.push([r,s,l])}}function lk(t,r){let s=!1;const l=[];for(;r<t.length;){const d=t[r];if(s){if(d[0]==="enter")d[1].type==="tableContent"&&l.push(t[r+1][1].type==="tableDelimiterMarker"?"left":"none");else if(d[1].type==="tableContent"){if(t[r-1][1].type==="tableDelimiterMarker"){const m=l.length-1;l[m]=l[m]==="left"?"center":"right"}}else if(d[1].type==="tableDelimiterRow")break}else d[0]==="enter"&&d[1].type==="tableDelimiterRow"&&(s=!0);r+=1}return l}function ok(){return{flow:{null:{name:"table",tokenize:ck,resolveAll:uk}}}}function ck(t,r,s){const l=this;let d=0,m=0,f;return o;function o(L){let H=l.events.length-1;for(;H>-1;){const W=l.events[H][1].type;if(W==="lineEnding"||W==="linePrefix")H--;else break}const U=H>-1?l.events[H][1].type:null,P=U==="tableHead"||U==="tableRow"?R:c;return P===R&&l.parser.lazy[l.now().line]?s(L):P(L)}function c(L){return t.enter("tableHead"),t.enter("tableRow"),u(L)}function u(L){return L===124||(f=!0,m+=1),g(L)}function g(L){return L===null?s(L):Be(L)?m>1?(m=0,l.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(L),t.exit("lineEnding"),w):s(L):Ke(L)?Ze(t,g,"whitespace")(L):(m+=1,f&&(f=!1,d+=1),L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),f=!0,g):(t.enter("data"),h(L)))}function h(L){return L===null||L===124||pt(L)?(t.exit("data"),g(L)):(t.consume(L),L===92?S:h)}function S(L){return L===92||L===124?(t.consume(L),h):h(L)}function w(L){return l.interrupt=!1,l.parser.lazy[l.now().line]?s(L):(t.enter("tableDelimiterRow"),f=!1,Ke(L)?Ze(t,T,"linePrefix",l.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):T(L))}function T(L){return L===45||L===58?y(L):L===124?(f=!0,t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),k):O(L)}function k(L){return Ke(L)?Ze(t,y,"whitespace")(L):y(L)}function y(L){return L===58?(m+=1,f=!0,t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),_):L===45?(m+=1,_(L)):L===null||Be(L)?E(L):O(L)}function _(L){return L===45?(t.enter("tableDelimiterFiller"),v(L)):O(L)}function v(L){return L===45?(t.consume(L),v):L===58?(f=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(L),t.exit("tableDelimiterMarker"),b):(t.exit("tableDelimiterFiller"),b(L))}function b(L){return Ke(L)?Ze(t,E,"whitespace")(L):E(L)}function E(L){return L===124?T(L):L===null||Be(L)?!f||d!==m?O(L):(t.exit("tableDelimiterRow"),t.exit("tableHead"),r(L)):O(L)}function O(L){return s(L)}function R(L){return t.enter("tableRow"),D(L)}function D(L){return L===124?(t.enter("tableCellDivider"),t.consume(L),t.exit("tableCellDivider"),D):L===null||Be(L)?(t.exit("tableRow"),r(L)):Ke(L)?Ze(t,D,"whitespace")(L):(t.enter("data"),A(L))}function A(L){return L===null||L===124||pt(L)?(t.exit("data"),D(L)):(t.consume(L),L===92?M:A)}function M(L){return L===92||L===124?(t.consume(L),A):A(L)}}function uk(t,r){let s=-1,l=!0,d=0,m=[0,0,0,0],f=[0,0,0,0],o=!1,c=0,u,g,h;const S=new sk;for(;++s<t.length;){const w=t[s],T=w[1];w[0]==="enter"?T.type==="tableHead"?(o=!1,c!==0&&(Kg(S,r,c,u,g),g=void 0,c=0),u={type:"table",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",u,r]])):T.type==="tableRow"||T.type==="tableDelimiterRow"?(l=!0,h=void 0,m=[0,0,0,0],f=[0,s+1,0,0],o&&(o=!1,g={type:"tableBody",start:Object.assign({},T.start),end:Object.assign({},T.end)},S.add(s,0,[["enter",g,r]])),d=T.type==="tableDelimiterRow"?2:g?3:1):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")?(l=!1,f[2]===0&&(m[1]!==0&&(f[0]=f[1],h=To(S,r,m,d,void 0,h),m=[0,0,0,0]),f[2]=s)):T.type==="tableCellDivider"&&(l?l=!1:(m[1]!==0&&(f[0]=f[1],h=To(S,r,m,d,void 0,h)),m=f,f=[m[1],s,0,0])):T.type==="tableHead"?(o=!0,c=s):T.type==="tableRow"||T.type==="tableDelimiterRow"?(c=s,m[1]!==0?(f[0]=f[1],h=To(S,r,m,d,s,h)):f[1]!==0&&(h=To(S,r,f,d,s,h)),d=0):d&&(T.type==="data"||T.type==="tableDelimiterMarker"||T.type==="tableDelimiterFiller")&&(f[3]=s)}for(c!==0&&Kg(S,r,c,u,g),S.consume(r.events),s=-1;++s<r.events.length;){const w=r.events[s];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=lk(r.events,s))}return t}function To(t,r,s,l,d,m){const f=l===1?"tableHeader":l===2?"tableDelimiter":"tableData",o="tableContent";s[0]!==0&&(m.end=Object.assign({},qs(r.events,s[0])),t.add(s[0],0,[["exit",m,r]]));const c=qs(r.events,s[1]);if(m={type:f,start:Object.assign({},c),end:Object.assign({},c)},t.add(s[1],0,[["enter",m,r]]),s[2]!==0){const u=qs(r.events,s[2]),g=qs(r.events,s[3]),h={type:o,start:Object.assign({},u),end:Object.assign({},g)};if(t.add(s[2],0,[["enter",h,r]]),l!==2){const S=r.events[s[2]],w=r.events[s[3]];if(S[1].end=Object.assign({},w[1].end),S[1].type="chunkText",S[1].contentType="text",s[3]>s[2]+1){const T=s[2]+1,k=s[3]-s[2]-1;t.add(T,k,[])}}t.add(s[3]+1,0,[["exit",h,r]])}return d!==void 0&&(m.end=Object.assign({},qs(r.events,d)),t.add(d,0,[["exit",m,r]]),m=void 0),m}function Kg(t,r,s,l,d){const m=[],f=qs(r.events,s);d&&(d.end=Object.assign({},f),m.push(["exit",d,r])),l.end=Object.assign({},f),m.push(["exit",l,r]),t.add(s+1,0,m)}function qs(t,r){const s=t[r],l=s[0]==="enter"?"start":"end";return s[1][l]}const hk={name:"tasklistCheck",tokenize:dk};function fk(){return{text:{91:hk}}}function dk(t,r,s){const l=this;return d;function d(c){return l.previous!==null||!l._gfmTasklistFirstContentOfListItem?s(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),m)}function m(c){return pt(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),f):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),f):s(c)}function f(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),o):s(c)}function o(c){return Be(c)?r(c):Ke(c)?t.check({tokenize:pk},r,s)(c):s(c)}}function pk(t,r,s){return Ze(t,l,"whitespace");function l(d){return d===null?s(d):r(d)}}function mk(t){return H_([UE(),XE(),rk(t),ok(),fk()])}const gk={};function Tv(t){const r=this,s=t||gk,l=r.data(),d=l.micromarkExtensions||(l.micromarkExtensions=[]),m=l.fromMarkdownExtensions||(l.fromMarkdownExtensions=[]),f=l.toMarkdownExtensions||(l.toMarkdownExtensions=[]);d.push(mk(s)),m.push(NE()),f.push(HE(s))}const Rv=1e3,$s=new Map;let il;function _k(t,r,s){const l=Symbol(t),d=Math.max(Rv,s.intervalMs),m=Date.now();return $s.set(t,{id:t,intervalMs:d,nextRunAt:s.runImmediately===!1?m+d:m,inFlight:!1,run:r,token:l}),vk(),Dv(),()=>{const f=$s.get(t);(f==null?void 0:f.token)===l&&($s.delete(t),$s.size===0&&il!==void 0&&(window.clearInterval(il),il=void 0))}}function vk(){il!==void 0||typeof window>"u"||(il=window.setInterval(()=>{Dv()},Rv))}async function Dv(){const t=Date.now();for(const r of $s.values())r.inFlight||r.nextRunAt>t||yk(r)}async function yk(t){t.inFlight=!0;try{await t.run()}catch{}finally{const r=$s.get(t.id);(r==null?void 0:r.token)===t.token&&(r.inFlight=!1,r.nextRunAt=Date.now()+r.intervalMs)}}function ol(t,r,s){const l=ee.useRef(r);ee.useEffect(()=>{l.current=r},[r]),ee.useEffect(()=>{if(!(!t||s.enabled===!1))return _k(t,()=>l.current(),{intervalMs:s.intervalMs,runImmediately:s.runImmediately})},[t,s.enabled,s.intervalMs,s.runImmediately])}const Ho=`
91
91
 
92
92
  --- Translation ---
93
- `;function bk({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:m,panelState:f,onClearSession:o,onEntry:c,onFailures:u}){const[g,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=ee.useState(!1),[y,_]=ee.useState(Date.now()),[v,b]=ee.useState(!1),[,E]=Ii(""),O=ee.useRef(null),R=f.entries,D=f.failures,A=f.status;ee.useEffect(()=>{if(!t)return;const N=O.current;if(!N)return;const q=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(q)},[t,R]);const M=Rk(R);ee.useEffect(()=>{if(!M)return;_(Date.now());const N=window.setInterval(()=>_(Date.now()),250);return()=>window.clearInterval(N)},[M]);async function L(N=!1){const q=g;b(!0),E(""),k(!1);try{const I=await ye.translateUserInput(l,d,{text:q,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(h(""),k(!1)):(h(Lv(q,I.englishPreview)),k(!0))}catch(I){E(lt("Translate composer input",I))}finally{b(!1)}}async function H(){const N=S.trim();if(N){b(!0),E("");try{const q=await ye.translateManualOutput(l,d,{text:N});c(m,d,q),w("")}catch(q){E(lt("Translate pasted English output",q))}finally{b(!1)}}}async function U(){b(!0),E("");try{const N=await ye.translateLatestReply(l,d);c(m,d,N)}catch(N){E(lt("Translate final reply",N))}finally{b(!1)}}async function P(){const N=T?Xg(g):g;if(N.trim()){b(!0),E("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),h(""),k(!1)}catch(q){E(lt("Send translated English input to role",q))}finally{b(!1)}}}function W(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!v&&g.trim()&&(T?P():L(r)))}async function K(){o(m,d),await ye.clearTranslationSession(m).catch(N=>E(lt("Clear conversation translation panel",N)))}async function V(){b(!0),E("");try{const N=await ye.ignoreTranslationFailures(m);u(m,d,N.failures)}catch(N){E(lt("Ignore failed conversation translations",N))}finally{b(!1)}}async function Y(N){b(!0),E("");try{const q=await ye.retryTranslation(m,N.translationId);c(m,d,q)}catch(q){E(lt("Retry latest failed conversation translation",q))}finally{b(!1)}}const te=Dk(R,A,y),z=D.length,j=wk(D);return C.jsxs("aside",{className:"translation-panel",children:[C.jsxs("header",{className:"translation-panel-header",children:[C.jsxs("div",{className:"translation-panel-titlebar",children:[C.jsx("h2",{children:"Translation"}),C.jsxs("div",{className:"translation-panel-actions",children:[z>0?C.jsxs(C.Fragment,{children:[C.jsxs("button",{type:"button",disabled:v,onClick:()=>void V(),children:["Ignore ",z]}),j?C.jsx("button",{type:"button",disabled:v,onClick:()=>void Y(j),children:"Retry latest"}):null]}):null,C.jsx("button",{type:"button",disabled:v,onClick:()=>void U(),children:"Translate final reply"}),C.jsx("button",{type:"button",onClick:()=>void K(),children:"Clear"})]})]}),C.jsx("div",{className:"translation-status-row",children:C.jsxs("p",{children:["Claude Code · target ",Ck(s)," · ",te]})})]}),C.jsx("div",{className:"translation-manual-panel",children:C.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[C.jsx("textarea",{value:S,onChange:N=>w(N.target.value),placeholder:"Paste English to translate on demand..."}),C.jsx("div",{className:"translation-composer-actions",children:C.jsx("button",{type:"button",disabled:v||!S.trim(),onClick:()=>void H(),children:"Translate"})})]})}),C.jsxs("div",{className:"translation-entry-list",ref:O,children:[R.length===0?C.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,R.map(N=>C.jsx(Ak,{entry:N},N.id))]}),C.jsx("div",{className:"translation-composer",children:C.jsxs("div",{className:"translation-composer-row",children:[C.jsx("textarea",{value:g,onChange:N=>{h(N.target.value),(!N.target.value.trim()||T&&!Ok(N.target.value))&&k(!1)},onKeyDown:W,placeholder:"输入中文,先翻译成英文工程指令..."}),C.jsx("div",{className:"translation-composer-actions",children:C.jsx("button",{type:"button",disabled:v||!T||!Xg(g).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function Ck(t){var r;return((r=g_.find(s=>s.value===t))==null?void 0:r.label)??t}function wk(t){let r,s=Number.NEGATIVE_INFINITY;for(const l of t){const d=Date.parse(l.failedAt),m=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||m>=s)&&(r=l,s=m)}return r}function xk({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,m]=ee.useState(!1),[,f]=Ii(""),[o,c]=ee.useState(null),[u,g]=ee.useState(""),[h,S]=ee.useState(""),[w,T]=ee.useState(""),[k,y]=ee.useState(!1),[_,v]=ee.useState(null),[b,E]=ee.useState(""),[O,R]=ee.useState(""),[D,A]=ee.useState(""),[M,L]=ee.useState(!1);ol(t?`file-translation:${u||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(V=!1){try{const Y=await ye.getTranslationState();c(Y);const te=u?Y.fileIndex.jobs.some(z=>z.id===u):!1;if((!u||!te)&&Y.fileIndex.jobs[0])U(Y.fileIndex.jobs[0].id);else if(!Y.fileIndex.jobs[0])g(""),S(""),T("");else if(V&&u){const z=await ye.readFileTranslation(u);S(z.output),T(z.report)}}catch(Y){f(lt("Load file translation list",Y))}}async function U(V){g(V),S(""),T("");try{const Y=await ye.readFileTranslation(V);S(Y.output),T(Y.report)}catch(Y){f(lt(`Read translated file ${V}`,Y))}}async function P(){y(!0),await W(b,O)}async function W(V="",Y=""){L(!0),f("");try{const te=await ye.browseTranslationSourceFiles({path:V,query:Y,limit:250});v(te),E(te.currentPath),R(Y)}catch(te){f(lt("Browse translation source files",te))}finally{L(!1)}}async function K(V=D){const Y=V.trim();if(Y){m(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const te=await ye.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});y(!1),await H(),await U(te.id)}catch(te){f(lt(`Create file translation for ${Y}`,te))}finally{m(!1)}}}return t?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:C.jsx(kk,{busy:d,state:o,selectedJobId:u,output:h,report:w,onClose:()=>{y(!1),l()},onRefresh:()=>void H(),onSelectJob:V=>void U(V),onTranslate:()=>void P()})}),k?C.jsx(Ek,{busy:d||M,state:_,currentPath:b,query:O,selectedPath:D,onBrowse:(V,Y)=>void W(V,Y),onClose:()=>y(!1),onQueryChange:R,onSelectPath:A,onTranslate:()=>void K()}):null]}):null}function Ek({busy:t,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:m,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:u}){const g=(r==null?void 0:r.entries)??[],h=g.filter(w=>w.type==="directory"),S=g.filter(w=>w.type==="file");return C.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:C.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Select Source File"}),C.jsx("p",{children:s||"."})]}),C.jsx("button",{type:"button",onClick:f,children:"Close"})]}),C.jsxs("div",{className:"translation-file-browser-controls",children:[C.jsxs("div",{className:"translation-file-browser-nav",children:[C.jsx("button",{type:"button",disabled:t||!s,onClick:()=>m((r==null?void 0:r.parentPath)??"",""),children:"Up"}),C.jsx("button",{type:"button",disabled:t||!s,onClick:()=>m("",""),children:"Root"})]}),C.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),m(s,l)},children:[C.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),C.jsx("button",{type:"submit",disabled:t,children:"Search"}),C.jsx("button",{type:"button",disabled:t||!l,onClick:()=>m(s,""),children:"Clear"})]})]}),C.jsxs("div",{className:"translation-file-browser-layout",children:[C.jsxs("div",{className:"translation-file-browser-list",children:[t&&!r?C.jsx("p",{className:"muted",children:"Loading files..."}):null,!t&&g.length===0?C.jsx("p",{className:"muted",children:"No source files found."}):null,h.length>0?C.jsxs("div",{className:"translation-file-browser-group",children:[C.jsx("h3",{children:"Folders"}),h.map(w=>C.jsx(Yg,{entry:w,selected:d===w.path,onBrowse:m,onSelectPath:c},w.path))]}):null,S.length>0?C.jsxs("div",{className:"translation-file-browser-group",children:[C.jsx("h3",{children:"Files"}),S.map(w=>C.jsx(Yg,{entry:w,selected:d===w.path,onBrowse:m,onSelectPath:c},w.path))]}):null,r!=null&&r.truncated?C.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),C.jsxs("aside",{className:"translation-file-browser-selection",children:[C.jsxs("label",{children:[C.jsx("span",{children:"Source path"}),C.jsx("input",{value:d,onChange:w=>c(w.target.value)})]}),C.jsx("button",{type:"button",disabled:t||!d.trim(),onClick:u,children:"Translate File"})]})]})]})})}function Yg({entry:t,selected:r,onBrowse:s,onSelectPath:l}){const d=t.type==="directory";return C.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(t.path,""):l(t.path),onDoubleClick:()=>d?s(t.path,""):void 0,children:[C.jsx("span",{children:d?"DIR":"FILE"}),C.jsx("strong",{children:t.name}),C.jsx("small",{children:t.path})]})}function kk({busy:t,state:r,selectedJobId:s,output:l,report:d,onClose:m,onRefresh:f,onSelectJob:o,onTranslate:c}){const u=(r==null?void 0:r.fileIndex.jobs)??[],g=u.find(h=>h.id===s);return C.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[C.jsxs("header",{className:"file-translation-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"File Translation"}),C.jsx("p",{children:"Claude Code · 中英互译"})]}),C.jsxs("div",{className:"file-translation-toolbar",children:[C.jsx("button",{type:"button",disabled:t,onClick:c,children:"Translate"}),C.jsx("button",{type:"button",disabled:t,onClick:f,children:"Refresh"}),C.jsx("button",{type:"button",onClick:m,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:C.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),C.jsxs("div",{className:"file-translation-layout",children:[C.jsxs("div",{className:"file-translation-list",children:[u.length===0?C.jsx("p",{className:"muted",children:"No translated files yet."}):null,u.map(h=>C.jsxs("button",{className:h.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(h.id),children:[C.jsx("strong",{children:h.sourcePath}),C.jsxs("span",{children:[h.status," · ",h.targetLanguage]})]},h.id))]}),C.jsx("div",{className:"file-translation-preview",children:g?C.jsxs(C.Fragment,{children:[C.jsxs("header",{children:[C.jsx("strong",{children:g.sourcePath}),C.jsx("span",{children:g.status})]}),C.jsx("div",{className:"translation-markdown",children:C.jsx(rv,{remarkPlugins:[Tv],children:l||d||"Translation output is not available yet."})})]}):C.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function Ak({entry:t}){if(t.sourceKind==="conversation-boundary")return C.jsx(Tk,{entry:t});const r=Lk(t),s=t.sourceKind==="tool-output",l=t.direction==="user-input-to-english",d=["translation-entry",`is-${t.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return C.jsxs("article",{className:d,children:[s?C.jsx("pre",{children:r}):C.jsx("div",{className:"translation-markdown",children:C.jsx(rv,{remarkPlugins:[Tv],children:r})}),t.warning?C.jsx("p",{className:"translation-entry-note",children:t.warning}):null,t.error?C.jsx("p",{className:"translation-entry-note is-error",children:t.error}):null]})}function Tk({entry:t}){const r=t.boundaryKind==="end"?"结束":"开始",s=t.conversationTurn??0,l=jk(t.occurredAt??t.createdAt);return C.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[C.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),C.jsx("span",{children:r}),C.jsxs("span",{children:["第 ",s," 轮"]}),C.jsx("time",{children:l}),C.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function Rk(t){const r=t.find(Mv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function Dk(t,r,s){const l=t.find(Mv);if(l)return`translating ${Bk(Math.max(0,s-Mk(l)))}`;const d=t.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function Mv(t){return t.status==="queued"||t.status==="translating"}function Mk(t){const r=Date.parse(t.translationStartedAt??t.createdAt);return Number.isFinite(r)?r:Date.now()}function Lk(t){return t.status==="queued"||t.status==="translating"?t.sourceText:t.status==="translated"?t.direction==="user-input-to-english"?Lv(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function Lv(t,r){return`${t.trimEnd()}${Ho}${r.trimStart()}`}function Ok(t){return t.includes(Ho)}function Xg(t){const r=t.indexOf(Ho);return r===-1?t:t.slice(r+Ho.length)}function Bk(t){if(t<1e3)return`${Math.max(.1,t/1e3).toFixed(1)}s`;const r=t/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function jk(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}const Nk=8;function Hk(){const[t,r]=ee.useState([]);return ee.useEffect(()=>{const s=m=>{var c,u;const f=(u=(c=m.detail)==null?void 0:c.message)==null?void 0:u.trim();if(!f)return;const o=new Date().toISOString();r(g=>{const h=g.find(S=>S.message===f);return h?[{...h,count:h.count+1,updatedAt:o},...g.filter(S=>S.id!==h.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...g].slice(0,Nk)})},l=m=>{var o;const f=((o=m.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(u=>!f.some(g=>u.message.startsWith(`${g} failed.`))))},d=m=>{var o,c;const f=(c=(o=m.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(u=>u.filter(g=>g.message!==f))};return window.addEventListener(bh,s),window.addEventListener(Ch,l),window.addEventListener(wh,d),()=>{window.removeEventListener(bh,s),window.removeEventListener(Ch,l),window.removeEventListener(wh,d)}},[]),t.length===0?null:C.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[C.jsxs("header",{className:"ui-error-center-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Errors"}),C.jsxs("p",{children:[t.length," active"]})]}),C.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),C.jsx("ol",{className:"ui-error-list",children:t.map(s=>C.jsxs("li",{children:[C.jsxs("div",{children:[C.jsx("p",{children:s.message}),C.jsxs("span",{children:[zk(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),C.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function zk(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Ik(t,r){return t.find(s=>s.taskSlug===r)??t[0]??null}function Uk(t){if(!(t.mode!=="auto"||t.status!=="running")&&!(!t.activeRole||t.activeRole===t.lastFollowedRole))return t.activeRole}function Pk(t,r){var d;if(!((d=t.flowPause)!=null&&d.paused))return null;const s=t.flowPause.role??t.activeRole??"role",l=t.roleRecovery;return t.flowPause.reason==="role-recovery-failed"&&l?r(l,s):`No new turn started after ${s} stopped.`}function Fk(t){const r=t.roundId??t.startedAt??t.taskSlug,s=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${r}:${s}`}function qk(t){return t?"strong":"none"}function $k(t,r){if(!r)return{observation:t,dismissPauseAlert:!1};const s=r.lastPmInputMessageId??null;return t.initialized?{observation:{initialized:!0,messageId:s},dismissPauseAlert:!!(r.enabled&&s&&s!==t.messageId)}:{observation:{initialized:!0,messageId:s},dismissPauseAlert:!1}}const Gk=3,Vk=3e4,Mo=new Map;function Ov(t,r){const s=lt(t,r);if(!Wk(r))return Mo.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=Mo.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,m=Date.now(),f=d>=Gk&&(!l||l.lastMessage!==s||m-l.lastReportedAt>=Vk);return Mo.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?m:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function zo(t){Mo.delete(t),bS([t])}function Wk(t){const r=cl(t);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const Kk=["architecture-plan","validation-adequacy","code-diff"];function Yk({events:t,maxEvents:r=8,showHeader:s=!0}){const l=r===null?t:t.slice(-r);return C.jsxs("section",{className:"event-log",children:[s?C.jsx("h2",{children:"Events"}):null,t.length===0?C.jsx("p",{className:"muted",children:"No terminal events yet."}):C.jsx("ol",{children:l.map((d,m)=>C.jsx("li",{children:d},`${d}-${m}`))})]})}function Hn({checked:t,className:r,disabled:s,label:l,stateLabel:d,title:m,onChange:f}){const o=["switch-control",t?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(t?"on":"off");return C.jsxs("button",{type:"button",role:"switch","aria-checked":t,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:m,onClick:()=>f(!t),children:[C.jsx("span",{className:"switch-control-label",children:l}),C.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:C.jsx("span",{className:"switch-control-thumb"})})]})}function Xk({status:t,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,autoMemoryEnabled:m,launchOptions:f,modelOptions:o,busy:c=!1,onRefresh:u,onApply:g,onOpenStudio:h,onOpenRepositoryDiff:S,onAutoTaskHarnessReviewChange:w,onAutoMemoryChange:T,onLaunchOptionsChange:k,onStartBootstrap:y,onRestartBootstrap:_,onStopBootstrap:v,onRunBootstrap:b}){const[E,O]=ee.useState(!1),R=r==null?void 0:r.session,D=(r==null?void 0:r.status)==="running",A=(R==null?void 0:R.status)==="running",M=(r==null?void 0:r.status)!=="complete";return l?t?C.jsxs("section",{className:"harness-panel",children:[C.jsxs("div",{className:"harness-stage",children:[C.jsxs("div",{className:"harness-panel-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Fixed install"}),C.jsx("p",{className:"muted",children:t.initialized?t.needsApply?`${t.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),C.jsx("div",{className:"harness-actions",children:t.initialized?C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",disabled:c,onClick:()=>void u(),children:"Refresh"}),t.needsApply?C.jsx("button",{type:"button",disabled:c,onClick:()=>void g(),children:"Update"}):null]}):C.jsx("button",{type:"button",disabled:c,onClick:()=>void g(),children:"Initialize"})})]}),t.initialized&&t.needsApply?C.jsxs(C.Fragment,{children:[C.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),C.jsx("ol",{className:"harness-file-list",children:t.plannedChanges.map(L=>C.jsxs("li",{children:[C.jsx("span",{children:L.path}),C.jsx(jn,{status:L.action})]},`${L.path}:${L.action}`))})]}):null]}),C.jsxs("div",{className:"harness-stage",children:[C.jsxs("div",{className:"harness-panel-header",children:[C.jsx("div",{children:C.jsx("strong",{children:"Harness Studio"})}),C.jsx("div",{className:"harness-actions",children:C.jsx("button",{type:"button",disabled:c,onClick:h,children:"Open Studio"})})]}),C.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:c,onClick:S,children:"Review Diff"}),C.jsx(Hn,{checked:d,className:"sidebar-switch",disabled:c,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:w}),C.jsx(Hn,{checked:m,className:"sidebar-switch",disabled:c,label:"Auto memory",title:"Collect role memory drafts after Final Acceptance and let Harness Engineer apply reviewed memory",onChange:T})]}),M?C.jsx("div",{className:"harness-stage",children:C.jsxs("div",{className:"harness-panel-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Bootstrap"}),C.jsx("p",{className:"muted",children:r?Qk(r.status):"not loaded"})]}),C.jsx("div",{className:"harness-actions",children:C.jsx("button",{type:"button",disabled:c||!(r!=null&&r.canStart),onClick:()=>{O(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?C.jsx("div",{className:"harness-result",children:C.jsx("p",{className:"muted",children:s.message})}):null,t.warnings.length>0?C.jsx("ul",{className:"warnings",children:t.warnings.map(L=>C.jsx("li",{children:L},L))}):null,r!=null&&r.warnings.length?C.jsx("ul",{className:"warnings",children:r.warnings.map(L=>C.jsx("li",{children:L},L))}):null,M&&E?C.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:C.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[C.jsxs("header",{className:"harness-bootstrap-modal-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Harness Engineer Bootstrap"}),C.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),C.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?C.jsx(jn,{status:R.status}):null,C.jsx("button",{type:"button",onClick:()=>O(!1),children:"Close"})]})]}),C.jsxs("div",{className:"harness-bootstrap-controls",children:[C.jsxs("label",{children:[C.jsx("span",{children:"Permission"}),C.jsx("select",{value:f.permissionMode,disabled:c||D||A,onChange:L=>k({...f,permissionMode:L.target.value}),children:__.map(L=>C.jsx("option",{value:L.value,children:L.label},L.value))})]}),C.jsxs("label",{children:[C.jsx("span",{children:"Model"}),C.jsx("select",{value:f.model,title:(()=>{const L=o.find(H=>H.value===f.model);return L!=null&&L.available?L.description:L==null?void 0:L.unavailableReason})(),disabled:c||D||A,onChange:L=>k({...f,model:L.target.value}),children:o.map(L=>C.jsx("option",{value:L.value,disabled:!L.available,title:L.available?L.description:L.unavailableReason,children:L.label},L.value))})]}),C.jsxs("label",{children:[C.jsx("span",{children:"Effort"}),C.jsx("select",{value:f.effort,disabled:c||D||A,onChange:L=>k({...f,effort:L.target.value}),children:y_.map(L=>C.jsx("option",{value:L.value,children:L.label},L.value))})]}),C.jsxs("div",{className:"harness-bootstrap-control-actions",children:[C.jsx("button",{type:"button",disabled:c||D||!(r!=null&&r.canStart),onClick:()=>void y(f),children:"Start"}),C.jsx("button",{type:"button",disabled:c||D||!(r!=null&&r.canStart),onClick:()=>void _(f),children:"Restart"}),C.jsx("button",{type:"button",disabled:c||!R,onClick:()=>void v(),children:"Stop"}),C.jsx("button",{type:"button",disabled:c||D||!A,onClick:()=>void b(),children:"Run bootstrap"})]})]}),C.jsx("div",{className:"harness-bootstrap-terminal",children:A?C.jsx(Po,{sessionId:R.id,active:E}):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"Harness Bootstrap"}),C.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:C.jsx("section",{className:"harness-panel",children:C.jsxs("div",{className:"harness-result",children:[C.jsx("strong",{children:"Task required"}),C.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function Qk(t){return t.replaceAll("_"," ")}function af(t){return{total:t.length,accepted:t.filter(r=>r.acceptedAt).length,delivered:t.filter(r=>r.deliveredAt).length}}function Jk(t,r=6){const s=[...t].sort(t2).map((d,m)=>({message:d,sequence:m+1}));return[...r===null?s:s.slice(-r)].sort((d,m)=>m.sequence-d.sequence)}function Zk({messages:t,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:m=!0,onModeChange:f,onMarkAllDone:o}){const[c,u]=ee.useState(null),g=af(t),h=(r==null?void 0:r.mode)??"auto",S=Jk(t,l);async function w(T){await n2(T.body),u(T.id),window.setTimeout(()=>u(k=>k===T.id?null:k),1200)}return C.jsxs("section",{className:"message-panel",children:[m?C.jsxs("div",{className:"message-panel-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Messages"}),C.jsxs("p",{className:"muted",children:[g.total," total / ",g.accepted," accepted"]})]}),d&&f?C.jsx("div",{className:"message-controls",children:C.jsx(Hn,{checked:h==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?C.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,t.length===0?C.jsx("p",{className:"muted",children:"No role messages yet."}):C.jsx("ol",{className:"message-list",children:S.map(({message:T,sequence:k})=>C.jsxs("li",{className:"message-item",children:[C.jsxs("div",{className:"message-item-main",children:[C.jsxs("div",{className:"message-meta",children:[C.jsxs("span",{className:"message-sequence",children:["#",k]}),C.jsx("time",{dateTime:Io(T),children:e2(Io(T))}),C.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),C.jsx("span",{children:T.type})]}),C.jsx("p",{children:T.body}),T.failureReason?C.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?C.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),C.jsx("div",{className:"message-actions",children:C.jsx("button",{type:"button",disabled:s,onClick:()=>void w(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function e2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Io(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function t2(t,r){const s=Io(t).localeCompare(Io(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function n2(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function i2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,m]=ee.useState(t);ee.useEffect(()=>{t&&m(t)},[t]);async function f(o){o.preventDefault(),await l(d)}return C.jsx("form",{className:"repo-connect",onSubmit:f,children:C.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[C.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>m(o.target.value),placeholder:"/path/to/repo"}),r.length>0?C.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&m(o.target.value)},children:[C.jsx("option",{value:"",children:"Recent"}),r.map(o=>C.jsx("option",{value:o,children:o},o))]}):null,C.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function r2({tasks:t,activeTaskSlug:r,onSelect:s}){return C.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:t.map(l=>C.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[C.jsx("span",{children:l.title||l.taskSlug}),C.jsx(jn,{status:l.status})]},l.taskSlug))})}function s2({open:t,taskSlug:r,taskTitle:s,onClose:l}){const[d,m]=ee.useState(null),[f,o]=ee.useState(!1),[c,u]=ee.useState(null),g=ee.useCallback(async()=>{o(!0),u(null);try{m(await ye.getTaskUsageAnalytics(r))}catch(h){u(`Load task usage analytics failed. Reason: ${cl(h)}`)}finally{o(!1)}},[r]);return ee.useEffect(()=>{t&&g()},[g,t]),t?C.jsx("div",{className:"modal-backdrop usage-analytics-backdrop",children:C.jsxs("section",{className:"usage-analytics-modal",role:"dialog","aria-modal":"true","aria-label":"Usage Analytics",children:[C.jsxs("header",{className:"usage-analytics-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Usage Analytics"}),C.jsxs("p",{children:[(s==null?void 0:s.trim())||r," · Claude models only"]})]}),C.jsxs("div",{className:"usage-analytics-header-actions",children:[C.jsx("button",{type:"button",disabled:f,onClick:()=>void g(),children:f?"Refreshing...":"Refresh"}),C.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),c?C.jsx("p",{className:"inline-error usage-analytics-error",children:c}):null,d?C.jsx(a2,{report:d}):C.jsx("div",{className:"usage-analytics-empty",children:f?"Loading usage data...":"No usage data available."})]})}):null}function a2({report:t}){return C.jsxs("div",{className:"usage-analytics-content",children:[C.jsxs("div",{className:"usage-analytics-meta",children:[C.jsx("span",{children:t.updatedAt?`Updated ${o2(t.updatedAt)}`:"No Claude usage recorded yet"}),C.jsxs("span",{children:[bn(t.totals.requestCount)," requests · ",bn(t.totals.sessionCount)," sessions"]})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-task-summary",children:[C.jsx("h3",{id:"usage-task-summary",children:"Task Summary"}),C.jsx(l2,{totals:t.totals})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-by-role",children:[C.jsx("h3",{id:"usage-by-role",children:"Usage by Role"}),C.jsx("div",{className:"usage-analytics-table-wrap",children:C.jsxs("table",{className:"usage-analytics-table",children:[C.jsx("thead",{children:C.jsx(Qg,{firstColumn:"Role"})}),C.jsx("tbody",{children:t.byRole.map(r=>C.jsxs("tr",{children:[C.jsxs("th",{scope:"row",children:[C.jsx("span",{children:lS(r.role).label}),C.jsxs("small",{children:[bn(r.requestCount)," requests · ",bn(r.sessionCount)," sessions"]})]}),C.jsx(Jg,{totals:r})]},r.role))})]})})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-by-model",children:[C.jsx("h3",{id:"usage-by-model",children:"Usage by Model"}),t.byModel.length>0?C.jsx("div",{className:"usage-analytics-table-wrap",children:C.jsxs("table",{className:"usage-analytics-table",children:[C.jsx("thead",{children:C.jsx(Qg,{firstColumn:"Model"})}),C.jsx("tbody",{children:t.byModel.map(r=>C.jsxs("tr",{children:[C.jsxs("th",{scope:"row",children:[C.jsx("span",{children:r.model}),C.jsxs("small",{children:[bn(r.requestCount)," requests · ",bn(r.sessionCount)," sessions"]})]}),C.jsx(Jg,{totals:r})]},r.model))})]})}):C.jsx("p",{className:"usage-analytics-no-models",children:"No Claude model usage recorded yet."})]})]})}function l2({totals:t}){return C.jsxs("dl",{className:"usage-totals-grid",children:[C.jsx(Ja,{label:"Input Tokens",value:bn(t.inputTokens)}),C.jsx(Ja,{label:"Output Tokens",value:bn(t.outputTokens)}),C.jsx(Ja,{label:"Cache Read",value:bn(t.cacheReadTokens)}),C.jsx(Ja,{label:"Cache Creation",value:bn(t.cacheCreationTokens)}),C.jsx(Ja,{label:"Estimated Cost",value:Bv(t.costUsd)})]})}function Ja({label:t,value:r}){return C.jsxs("div",{children:[C.jsx("dt",{children:t}),C.jsx("dd",{children:r})]})}function Qg({firstColumn:t}){return C.jsxs("tr",{children:[C.jsx("th",{scope:"col",children:t}),C.jsx("th",{scope:"col",children:"Input"}),C.jsx("th",{scope:"col",children:"Output"}),C.jsx("th",{scope:"col",children:"Cache Read"}),C.jsx("th",{scope:"col",children:"Cache Creation"}),C.jsx("th",{scope:"col",children:"Estimated Cost"})]})}function Jg({totals:t}){return C.jsxs(C.Fragment,{children:[C.jsx("td",{children:bn(t.inputTokens)}),C.jsx("td",{children:bn(t.outputTokens)}),C.jsx("td",{children:bn(t.cacheReadTokens)}),C.jsx("td",{children:bn(t.cacheCreationTokens)}),C.jsx("td",{children:Bv(t.costUsd)})]})}function bn(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0}).format(t)}function Bv(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(t)}function o2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function c2({project:t,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:m,events:f,roundState:o,gateReview:c,translationEnabled:u,translationAutoSendEnabled:g,translationTargetLanguage:h,translationOutputMode:S,translationMemoryInitialized:w,translatorSession:T,harnessStatus:k,harnessBootstrapStatus:y,harnessApplyResult:_,harnessEngineerLaunchOptions:v,autoTaskHarnessReviewEnabled:b,autoMemoryEnabled:E,gatewayStatus:O,gatewayQrLogin:R,gatewayQrCheck:D,gatewayLarkRegistration:A,gatewayLarkRegistrationCheck:M,ccrStatus:L,modelOptions:H,busy:U,onConnect:P,onRefreshConnectedRepository:W,onPullConnectedRepository:K,onRefreshHarness:V,onApplyHarness:Y,onStartHarnessBootstrap:te,onRestartHarnessBootstrap:z,onStopHarnessBootstrap:j,onRunHarnessBootstrap:N,onOpenHarnessStudio:q,onOpenRepositoryDiff:I,onAutoTaskHarnessReviewChange:ie,onAutoMemoryChange:pe,onHarnessEngineerLaunchOptionsChange:ge,onRefreshGateway:Q,onGatewayEnabledChange:$,onGatewaySettingsChange:he,onCcrSettingsChange:le,onCcrCheck:xe,onGatewayTranslationChange:Ce,onGatewayConnectionChange:Le,onStartGatewayQrLogin:Ie,onStartGatewayLarkRegistration:He,onResetGatewayBinding:$e,onGateReviewGateEnabledChange:De,onCancelGateReviewGate:Ct,onTranslationEnabledChange:Rt,onTranslationAutoSendChange:jt,onTranslationTargetLanguageChange:re,onTranslationOutputModeChange:ve,onOpenFileTranslation:ke,onOpenTranslatorSession:nt,onCreateTranslationBootstrap:ot,onUpdateTranslationMemory:ce,onCreateTask:Se,onCloseTask:Ee,onSelectTask:Oe,themeMode:Ne,onAutoOrchestrationChange:yt,onThemeModeChange:Pe,pauseAlertSound:wt,onPauseAlertSoundChange:bt,roleRetryEnabled:Nt,onRoleRetryEnabledChange:it,permissionRequestMode:Wt,onPermissionRequestModeChange:rn,launchTemplate:Cr,canSaveLaunchTemplate:mi,canOneClickStart:gi,onSaveLaunchTemplate:Pi,onOneClickStart:zn,onMarkAllMessagesDone:Fi,onDeleteMessageHistory:Jn}){const[si,sn]=ee.useState(""),[ai,In]=ee.useState(!1),[qi,_i]=ee.useState(!1),[vi,yi]=ee.useState(!1),[wn,Pt]=ee.useState(()=>l?null:"repository"),li=af(d),hn=si.trim(),Kt=p2(t,l,k),mt=s.filter(Ge=>Ge.cleanupStatus!=="cleaned"),ct=mt.find(Ge=>Ge.taskSlug===l)??null;ee.useEffect(()=>{Pt(Ge=>!l&&Ge===null?t?"task":"repository":Ge)},[l,t]);function Ht(Ge,Un){Pt(Un?Ge:null)}async function $i(Ge){Ge.preventDefault(),await Se({taskSlug:hn}),sn("")}return C.jsxs("div",{className:"project-dashboard",children:[C.jsx("header",{className:"brand-header",children:C.jsx("strong",{children:"VibeCodingMaster"})}),C.jsx(Kr,{title:"Repository",open:wn==="repository",onOpenChange:Ge=>{Ht("repository",Ge),Ge&&t&&W()},children:C.jsxs("div",{className:"repository-panel",children:[C.jsx(i2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:U,onConnect:P}),t?C.jsx(v2,{busy:U,project:t,onPull:K}):null]})}),C.jsx(Kr,{title:"Settings",open:wn==="settings",onOpenChange:Ge=>Ht("settings",Ge),children:C.jsxs("div",{className:"sidebar-settings",children:[C.jsxs("button",{"aria-label":`Theme mode: ${e_(Ne)}`,className:"settings-toggle theme-mode-toggle",disabled:U,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Pe(w2(Ne)),children:[C.jsx("span",{children:"Theme"}),C.jsx("span",{children:e_(Ne)})]}),C.jsx(Hn,{checked:((m==null?void 0:m.mode)??"auto")==="auto",className:"sidebar-switch",disabled:U||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:yt}),C.jsx(Hn,{checked:wt,className:"sidebar-switch",disabled:U,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ge=>bt(Ge)}),C.jsx(Hn,{checked:Nt,className:"sidebar-switch",disabled:U,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ge=>it(Ge)}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Permission requests"}),C.jsxs("select",{value:Wt,disabled:U,onChange:Ge=>rn(Ge.target.value),children:[C.jsx("option",{value:"off",children:"off"}),C.jsx("option",{value:"allowAll",children:"allow all"})]})]}),C.jsx(h2,{busy:U,status:L,onCheck:xe,onSettingsChange:le}),C.jsxs("button",{className:"settings-toggle",disabled:U||!mi,title:"Save the current core role launch settings and optional Reviewer settings",type:"button",onClick:Pi,children:[C.jsx("span",{children:"Save launch template"}),C.jsx("span",{children:mi?"ready":"open task"})]}),gi?C.jsxs("button",{className:"settings-toggle is-active",disabled:U,title:u2(Cr),type:"button",onClick:zn,children:[C.jsx("span",{children:"One-click start"}),C.jsx("span",{children:jv(Cr)})]}):null,l?C.jsxs(C.Fragment,{children:[C.jsxs("button",{type:"button",onClick:()=>In(!0),children:[C.jsx("span",{children:"Messages"}),C.jsxs("span",{className:"muted",children:[li.total," total"]})]}),C.jsxs("button",{type:"button",onClick:()=>_i(!0),children:[C.jsx("span",{children:"Events"}),C.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),C.jsx(Kr,{title:"Translation",open:wn==="translation",onOpenChange:Ge=>Ht("translation",Ge),children:C.jsx(f2,{busy:U,enabled:u,autoSendEnabled:g,targetLanguage:h,outputMode:S,memoryInitialized:w,baseUnavailableReason:Kt,translatorSession:T,onAutoSendChange:jt,onCreateBootstrap:ot,onEnabledChange:Rt,onUpdateMemory:ce,onTargetLanguageChange:re,onOutputModeChange:ve,onOpenFileTranslation:ke,onOpenTranslatorSession:nt})}),t&&l?C.jsx(Kr,{title:"Gate Review Gates",open:wn==="gate-review-gates",onOpenChange:Ge=>Ht("gate-review-gates",Ge),children:C.jsx(m2,{busy:U,state:c,onCancelGateReview:Ct,onGateEnabledChange:De})}):null,C.jsx(Kr,{title:"Gateway",open:wn==="gateway",onOpenChange:Ge=>{Ht("gateway",Ge),Ge&&Q()},children:C.jsx(_2,{busy:U,qrCheck:D,qrLogin:R,larkRegistration:A,larkRegistrationCheck:M,status:O,onEnabledChange:$,onSettingsChange:he,onResetBinding:$e,onStartLarkRegistration:He,onStartQrLogin:Ie,onTranslationChange:Ce,onConnectionChange:Le})}),t?C.jsx(Kr,{title:"VCM Harness",open:wn==="vcm-harness",onOpenChange:Ge=>Ht("vcm-harness",Ge),children:C.jsx(Xk,{status:k,bootstrapStatus:y,applyResult:_,hasActiveTask:!!ct,autoTaskHarnessReviewEnabled:b,autoMemoryEnabled:E,launchOptions:v,modelOptions:H,busy:U,onRefresh:V,onApply:Y,onOpenStudio:q,onOpenRepositoryDiff:I,onAutoTaskHarnessReviewChange:ie,onAutoMemoryChange:pe,onLaunchOptionsChange:ge,onStartBootstrap:te,onRestartBootstrap:z,onStopBootstrap:j,onRunBootstrap:N})}):null,t?C.jsx(Kr,{title:"Task",open:wn==="task",onOpenChange:Ge=>Ht("task",Ge),children:mt.length>0?C.jsxs("div",{className:"task-panel",children:[C.jsx(r2,{tasks:mt,activeTaskSlug:l,onSelect:Oe}),ct?C.jsxs("div",{className:"task-panel-actions",children:[C.jsx("button",{type:"button",onClick:()=>yi(!0),children:"Usage Analytics"}),C.jsx("button",{className:"danger-button",disabled:U,type:"button",onClick:Ee,children:"Close Task"})]}):null]}):C.jsx("div",{className:"task-create",children:C.jsxs("form",{onSubmit:$i,children:[C.jsx("input",{value:si,onChange:Ge=>sn(Ge.target.value),placeholder:"task name"}),C.jsxs("div",{className:"task-create-preview",children:[C.jsxs("small",{children:["branch: ",hn?`feature/${hn}`:"feature/<task>"]}),C.jsxs("small",{children:["worktree: ",hn?`.claude/worktrees/${hn}`:".claude/worktrees/<task>"]})]}),C.jsx("button",{type:"submit",disabled:U||!hn,children:"Create"})]})})}):null,t&&ct?C.jsx(b2,{task:ct,roundState:o}):null,ai?C.jsx(E2,{busy:U,messages:d,orchestration:m,onClose:()=>In(!1),onMarkAllDone:()=>{l&&Fi(l)},onDeleteMessageHistory:()=>{l&&Jn(l)}}):null,qi?C.jsx(x2,{events:f,onClose:()=>_i(!1)}):null,ct?C.jsx(s2,{open:vi,taskSlug:ct.taskSlug,taskTitle:ct.title,onClose:()=>yi(!1)}):null]})}function jv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function u2(t){const r=Object.entries(t.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${jv(t)}; ${r}`}function h2({busy:t,status:r,onCheck:s,onSettingsChange:l}){const[d,m]=ee.useState(""),f=!!(r!=null&&r.apiKeyConfigured),o=async c=>{c.preventDefault();const u=d.trim();u&&(await l({apiKey:u}),m(""))};return C.jsxs("div",{className:"ccr-settings",children:[C.jsx(Hn,{checked:!!(r!=null&&r.enabled),className:"sidebar-switch",disabled:t||!f,label:"CCR GPT models",title:f?"Enable GPT models through Claude Code Router":"Save the CCR API key first",onChange:c=>void l({enabled:c})}),C.jsxs("form",{className:"ccr-api-key-form",onSubmit:c=>void o(c),children:[C.jsx("label",{htmlFor:"ccr-api-key",children:"CCR API key"}),C.jsxs("div",{children:[C.jsx("input",{id:"ccr-api-key",type:"password",autoComplete:"off",disabled:t,placeholder:f?"Saved":"Required",value:d,onChange:c=>m(c.target.value)}),C.jsx("button",{type:"submit",disabled:t||!d.trim(),children:"Save"})]})]}),C.jsxs("div",{className:"settings-status-row",children:[C.jsx("span",{children:"CCR status"}),C.jsx("strong",{children:(r==null?void 0:r.connectionState)??"loading"})]}),C.jsxs("div",{className:"ccr-actions",children:[C.jsx("button",{type:"button",disabled:t||!(r!=null&&r.enabled),onClick:()=>void s(),children:"Check"}),C.jsx("button",{type:"button",disabled:t||!f,onClick:()=>void l({clearApiKey:!0}),children:"Clear key"})]}),r!=null&&r.error?C.jsx("p",{className:"settings-help-text",children:r.error}):null]})}function f2({autoSendEnabled:t,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:m,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:u,onEnabledChange:g,onUpdateMemory:h,onOutputModeChange:S,onTargetLanguageChange:w,onOpenFileTranslation:T,onOpenTranslatorSession:k}){const y=!!(s||r),_=(o==null?void 0:o.status)==="running",v=!!(l&&!r&&_),b=r??(_?null:"Start Translator session first."),E=!!(s||b),R=r??"Open Translator session",D=b??"Translation tools are ready";return C.jsxs("div",{className:"sidebar-settings",children:[C.jsx(Hn,{checked:v,className:"sidebar-switch",disabled:y||!_,label:"Conversation translation",title:D,onChange:g}),C.jsx(Hn,{checked:t,className:"sidebar-switch",disabled:y,label:"Auto-send",onChange:c}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Language"}),C.jsx("select",{value:f,disabled:y,onChange:A=>w(A.target.value),children:g_.map(A=>C.jsx("option",{value:A.value,children:A.label},A.value))})]}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Reply scope"}),C.jsx("select",{value:m,disabled:y,onChange:A=>S(A.target.value),children:uS.map(A=>C.jsx("option",{value:A.value,children:A.label},A.value))})]}),C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:T,children:[C.jsx("span",{children:"File translation"}),C.jsx("span",{children:"open"})]}),d?null:C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:u,children:[C.jsx("span",{children:"Bootstrap"}),C.jsx("span",{children:"run"})]}),C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:h,children:[C.jsx("span",{children:"Update memory"}),C.jsx("span",{children:"run"})]}),b?C.jsx("p",{className:"settings-help-text",children:b}):null,C.jsxs("div",{className:"settings-status-row",children:[C.jsx("span",{children:"Session status"}),C.jsx("strong",{children:d2(o)})]}),C.jsxs("button",{className:"settings-toggle",disabled:y,title:R,type:"button",onClick:k,children:[C.jsx("span",{children:"Open Session"}),C.jsx("span",{children:"open"})]})]})}function d2(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function p2(t,r,s){return t?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function m2({busy:t,onCancelGateReview:r,onGateEnabledChange:s,state:l}){return C.jsx("div",{className:"sidebar-settings",children:Kk.map(d=>{const m=l==null?void 0:l.gates[d],f=!!(m!=null&&m.required);return C.jsxs("div",{className:"gate-review-setting",children:[C.jsx(Hn,{checked:f,className:"sidebar-switch",disabled:t||!l||(m==null?void 0:m.status)==="running",label:g2(d),title:m!=null&&m.status?`status: ${m.status}`:void 0,onChange:o=>s(d,o)}),(m==null?void 0:m.status)==="running"&&m.requestId?C.jsx("button",{className:"danger-button",disabled:t,type:"button",onClick:()=>r(d,m.requestId),children:"Cancel review"}):null]},d)})})}function g2(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function _2({busy:t,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:m,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:u,qrCheck:g,qrLogin:h,status:S}){const w=(S==null?void 0:S.channel)==="lark",T=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.binding.tokenConfigured),k=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.binding.tokenConfigured);return C.jsxs("div",{className:"gateway-panel",children:[C.jsxs("label",{className:"compact-field",children:[C.jsx("span",{children:"Channel"}),C.jsxs("select",{disabled:t||!S,value:(S==null?void 0:S.channel)??"weixin-ilink",onChange:y=>{m({channel:y.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[C.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),C.jsx("option",{value:"lark",children:"Lark"})]})]}),C.jsxs("div",{className:"gateway-actions",children:[C.jsx(Hn,{checked:!!(S!=null&&S.connectionEnabled),className:"sidebar-switch",disabled:t||!S||!S.connectionEnabled&&!T,label:"Connection",stateLabel:S!=null&&S.connectionEnabled?"connected":"off",title:T?"Connect or disconnect the channel for this session. Off by default; the phone can drive the gateway only while Connection is on. Separate from the Gateway command switch.":"Configure the selected Gateway channel first",onChange:y=>u(y)}),C.jsx(Hn,{checked:!!(S!=null&&S.enabled),className:"sidebar-switch",disabled:t||!S||!S.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:y=>l(y)}),C.jsx(Hn,{checked:!!(S!=null&&S.translationEnabled),className:"sidebar-switch",disabled:t||!S,label:"Translation",onChange:y=>c(y)}),w?C.jsx("button",{type:"button",disabled:t,onClick:f,children:"Start QR Setup"}):k?C.jsx("button",{className:"danger-button",type:"button",disabled:t,onClick:d,children:"Reset Binding"}):C.jsx("button",{type:"button",disabled:t,onClick:o,children:"Start QR Login"})]}),w?C.jsxs("div",{className:"gateway-lark-settings",children:[C.jsx("p",{className:"muted",children:S!=null&&S.binding.appIdConfigured&&S.binding.appSecretConfigured?`Lark app configured${S.binding.larkBotName?` · ${S.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?C.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):h?C.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!w&&g?C.jsxs("p",{className:"muted",children:["QR status: ",g.status,g.message?` · ${g.message}`:""]}):null]})}function v2({busy:t,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return C.jsxs("div",{className:"project-summary",children:[C.jsxs("dl",{children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Base path"}),C.jsx("dd",{children:s.repoRoot})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Branch"}),C.jsx("dd",{children:y2(s)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Remote"}),C.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:S2(s)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Commit"}),C.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Working tree"}),C.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),C.jsxs("div",{className:"connected-repo-actions",children:[C.jsx("button",{type:"button",disabled:t||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),C.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Hh(s.checkedAt)}`:"status not refreshed"})]}),l?C.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?C.jsx("ul",{className:"warnings",children:s.warnings.map(m=>C.jsx("li",{children:m},m))}):null]})}function y2(t){return t.branch||"unknown"}function S2(t){if(!t.upstreamBranch)return"no upstream";const r=t.ahead??0,s=t.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function b2({roundState:t,task:r}){var g;const[s,l]=ee.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),m=Nv(r.createdAt,s),f=Zg(t,(t==null?void 0:t.totalCcActiveMs)??0,s),o=d&&t?Zg(t,t.currentRoundCcActiveMs,s):0,c=d&&t?C2(t,s):0,u=((g=r.title)==null?void 0:g.trim())||r.taskSlug;return ee.useEffect(()=>{const h=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(h)},[]),C.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[C.jsxs("div",{className:"task-status-dock-title",children:[C.jsx("strong",{title:u,children:u}),C.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),C.jsxs("dl",{className:"task-status-stats",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Session start"}),C.jsx("dd",{children:Hh(r.createdAt)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Session total"}),C.jsx("dd",{children:Ro(m)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Rounds"}),C.jsx("dd",{children:(t==null?void 0:t.totalRoundCount)??0})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Role runtime"}),C.jsx("dd",{children:Ro(f)})]})]}),d&&t?C.jsxs("div",{className:"current-round-status",children:[C.jsxs("div",{className:"current-round-title",children:[C.jsx("span",{children:t.status==="running"?"Current Round":"Last Round"}),C.jsx("span",{className:`status-badge status-${t.status}`,children:t.status})]}),C.jsxs("dl",{className:"task-status-stats",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Started"}),C.jsx("dd",{children:Hh(t.startedAt)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Total"}),C.jsx("dd",{children:Ro(c)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Role runtime"}),C.jsx("dd",{children:Ro(o)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Turn count"}),C.jsx("dd",{children:t.turnCount})]})]})]}):null]})}function Zg(t,r,s){if(!(t!=null&&t.activeTurnStartedAt)||t.status!=="running")return r;const l=Date.parse(t.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function C2(t,r){const s=t.status==="running"?r:Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return Nv(t.startedAt??"",Number.isFinite(s)?s:r)}function Nv(t,r){const s=Date.parse(t);return Number.isFinite(s)?Math.max(0,r-s):0}function Hh(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function Ro(t){const r=Math.max(0,Math.floor(t/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function w2(t){return t==="system"?"light":t==="light"?"dark":"system"}function e_(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function x2({events:t,onClose:r}){return C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Events"}),C.jsxs("p",{className:"muted",children:[t.length," total"]})]}),C.jsx("button",{type:"button",onClick:r,children:"Close"})]}),C.jsx(Yk,{events:t,maxEvents:null,showHeader:!1})]})})}function E2({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:m}){const f=af(r);function o(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
93
+ `;function Sk({active:t=!0,autoSendEnabled:r,targetLanguage:s,taskSlug:l,role:d,sessionId:m,panelState:f,onClearSession:o,onEntry:c,onFailures:u}){const[g,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=ee.useState(!1),[y,_]=ee.useState(Date.now()),[v,b]=ee.useState(!1),[,E]=Ii(""),O=ee.useRef(null),R=f.entries,D=f.failures,A=f.status;ee.useEffect(()=>{if(!t)return;const N=O.current;if(!N)return;const q=window.requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight});return()=>window.cancelAnimationFrame(q)},[t,R]);const M=Tk(R);ee.useEffect(()=>{if(!M)return;_(Date.now());const N=window.setInterval(()=>_(Date.now()),250);return()=>window.clearInterval(N)},[M]);async function L(N=!1){const q=g;b(!0),E(""),k(!1);try{const I=await ye.translateUserInput(l,d,{text:q,mode:N?"auto-send":"review-before-send",useContext:!1,send:N});I.sent?(h(""),k(!1)):(h(Lv(q,I.englishPreview)),k(!0))}catch(I){E(lt("Translate composer input",I))}finally{b(!1)}}async function H(){const N=S.trim();if(N){b(!0),E("");try{const q=await ye.translateManualOutput(l,d,{text:N});c(m,d,q),w("")}catch(q){E(lt("Translate pasted English output",q))}finally{b(!1)}}}async function U(){b(!0),E("");try{const N=await ye.translateLatestReply(l,d);c(m,d,N)}catch(N){E(lt("Translate final reply",N))}finally{b(!1)}}async function P(){const N=T?Xg(g):g;if(N.trim()){b(!0),E("");try{await ye.sendTranslatedInput(l,d,{englishText:N}),h(""),k(!1)}catch(q){E(lt("Send translated English input to role",q))}finally{b(!1)}}}function W(N){N.key!=="Enter"||N.shiftKey||N.nativeEvent.isComposing||(N.preventDefault(),!v&&g.trim()&&(T?P():L(r)))}async function K(){o(m,d),await ye.clearTranslationSession(m).catch(N=>E(lt("Clear conversation translation panel",N)))}async function V(){b(!0),E("");try{const N=await ye.ignoreTranslationFailures(m);u(m,d,N.failures)}catch(N){E(lt("Ignore failed conversation translations",N))}finally{b(!1)}}async function Y(N){b(!0),E("");try{const q=await ye.retryTranslation(m,N.translationId);c(m,d,q)}catch(q){E(lt("Retry latest failed conversation translation",q))}finally{b(!1)}}const te=Rk(R,A,y),z=D.length,j=Ck(D);return C.jsxs("aside",{className:"translation-panel",children:[C.jsxs("header",{className:"translation-panel-header",children:[C.jsxs("div",{className:"translation-panel-titlebar",children:[C.jsx("h2",{children:"Translation"}),C.jsxs("div",{className:"translation-panel-actions",children:[z>0?C.jsxs(C.Fragment,{children:[C.jsxs("button",{type:"button",disabled:v,onClick:()=>void V(),children:["Ignore ",z]}),j?C.jsx("button",{type:"button",disabled:v,onClick:()=>void Y(j),children:"Retry latest"}):null]}):null,C.jsx("button",{type:"button",disabled:v,onClick:()=>void U(),children:"Translate final reply"}),C.jsx("button",{type:"button",onClick:()=>void K(),children:"Clear"})]})]}),C.jsx("div",{className:"translation-status-row",children:C.jsxs("p",{children:["Claude Code · target ",bk(s)," · ",te]})})]}),C.jsx("div",{className:"translation-manual-panel",children:C.jsxs("div",{className:"translation-composer-row translation-manual-row",children:[C.jsx("textarea",{value:S,onChange:N=>w(N.target.value),placeholder:"Paste English to translate on demand..."}),C.jsx("div",{className:"translation-composer-actions",children:C.jsx("button",{type:"button",disabled:v||!S.trim(),onClick:()=>void H(),children:"Translate"})})]})}),C.jsxs("div",{className:"translation-entry-list",ref:O,children:[R.length===0?C.jsx("p",{className:"muted",children:"Translated Claude Code output will appear here."}):null,R.map(N=>C.jsx(kk,{entry:N},N.id))]}),C.jsx("div",{className:"translation-composer",children:C.jsxs("div",{className:"translation-composer-row",children:[C.jsx("textarea",{value:g,onChange:N=>{h(N.target.value),(!N.target.value.trim()||T&&!Lk(N.target.value))&&k(!1)},onKeyDown:W,placeholder:"输入中文,先翻译成英文工程指令..."}),C.jsx("div",{className:"translation-composer-actions",children:C.jsx("button",{type:"button",disabled:v||!T||!Xg(g).trim(),onClick:()=>void P(),children:"Send English"})})]})})]})}function bk(t){var r;return((r=g_.find(s=>s.value===t))==null?void 0:r.label)??t}function Ck(t){let r,s=Number.NEGATIVE_INFINITY;for(const l of t){const d=Date.parse(l.failedAt),m=Number.isFinite(d)?d:Number.NEGATIVE_INFINITY;(!r||m>=s)&&(r=l,s=m)}return r}function wk({open:t,taskSlug:r,targetLanguage:s,onClose:l}){const[d,m]=ee.useState(!1),[,f]=Ii(""),[o,c]=ee.useState(null),[u,g]=ee.useState(""),[h,S]=ee.useState(""),[w,T]=ee.useState(""),[k,y]=ee.useState(!1),[_,v]=ee.useState(null),[b,E]=ee.useState(""),[O,R]=ee.useState(""),[D,A]=ee.useState(""),[M,L]=ee.useState(!1);ol(t?`file-translation:${u||"none"}`:null,()=>H(!0),{intervalMs:2e3,runImmediately:!0});async function H(V=!1){try{const Y=await ye.getTranslationState();c(Y);const te=u?Y.fileIndex.jobs.some(z=>z.id===u):!1;if((!u||!te)&&Y.fileIndex.jobs[0])U(Y.fileIndex.jobs[0].id);else if(!Y.fileIndex.jobs[0])g(""),S(""),T("");else if(V&&u){const z=await ye.readFileTranslation(u);S(z.output),T(z.report)}}catch(Y){f(lt("Load file translation list",Y))}}async function U(V){g(V),S(""),T("");try{const Y=await ye.readFileTranslation(V);S(Y.output),T(Y.report)}catch(Y){f(lt(`Read translated file ${V}`,Y))}}async function P(){y(!0),await W(b,O)}async function W(V="",Y=""){L(!0),f("");try{const te=await ye.browseTranslationSourceFiles({path:V,query:Y,limit:250});v(te),E(te.currentPath),R(Y)}catch(te){f(lt("Browse translation source files",te))}finally{L(!1)}}async function K(V=D){const Y=V.trim();if(Y){m(!0),f("");try{if(!r)throw new Error("Create or select a task before translating files.");const te=await ye.createFileTranslation({taskSlug:r,sourcePath:Y,targetLanguage:s});y(!1),await H(),await U(te.id)}catch(te){f(lt(`Create file translation for ${Y}`,te))}finally{m(!1)}}}return t?C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"modal-backdrop file-translation-backdrop",children:C.jsx(Ek,{busy:d,state:o,selectedJobId:u,output:h,report:w,onClose:()=>{y(!1),l()},onRefresh:()=>void H(),onSelectJob:V=>void U(V),onTranslate:()=>void P()})}),k?C.jsx(xk,{busy:d||M,state:_,currentPath:b,query:O,selectedPath:D,onBrowse:(V,Y)=>void W(V,Y),onClose:()=>y(!1),onQueryChange:R,onSelectPath:A,onTranslate:()=>void K()}):null]}):null}function xk({busy:t,state:r,currentPath:s,query:l,selectedPath:d,onBrowse:m,onClose:f,onQueryChange:o,onSelectPath:c,onTranslate:u}){const g=(r==null?void 0:r.entries)??[],h=g.filter(w=>w.type==="directory"),S=g.filter(w=>w.type==="file");return C.jsx("div",{className:"modal-backdrop translation-file-browser-backdrop",children:C.jsxs("section",{className:"translation-file-browser-modal",role:"dialog","aria-modal":"true","aria-label":"Select Source File",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Select Source File"}),C.jsx("p",{children:s||"."})]}),C.jsx("button",{type:"button",onClick:f,children:"Close"})]}),C.jsxs("div",{className:"translation-file-browser-controls",children:[C.jsxs("div",{className:"translation-file-browser-nav",children:[C.jsx("button",{type:"button",disabled:t||!s,onClick:()=>m((r==null?void 0:r.parentPath)??"",""),children:"Up"}),C.jsx("button",{type:"button",disabled:t||!s,onClick:()=>m("",""),children:"Root"})]}),C.jsxs("form",{className:"translation-file-browser-search",onSubmit:w=>{w.preventDefault(),m(s,l)},children:[C.jsx("input",{value:l,onChange:w=>o(w.target.value),placeholder:"Search files"}),C.jsx("button",{type:"submit",disabled:t,children:"Search"}),C.jsx("button",{type:"button",disabled:t||!l,onClick:()=>m(s,""),children:"Clear"})]})]}),C.jsxs("div",{className:"translation-file-browser-layout",children:[C.jsxs("div",{className:"translation-file-browser-list",children:[t&&!r?C.jsx("p",{className:"muted",children:"Loading files..."}):null,!t&&g.length===0?C.jsx("p",{className:"muted",children:"No source files found."}):null,h.length>0?C.jsxs("div",{className:"translation-file-browser-group",children:[C.jsx("h3",{children:"Folders"}),h.map(w=>C.jsx(Yg,{entry:w,selected:d===w.path,onBrowse:m,onSelectPath:c},w.path))]}):null,S.length>0?C.jsxs("div",{className:"translation-file-browser-group",children:[C.jsx("h3",{children:"Files"}),S.map(w=>C.jsx(Yg,{entry:w,selected:d===w.path,onBrowse:m,onSelectPath:c},w.path))]}):null,r!=null&&r.truncated?C.jsx("p",{className:"translation-entry-note",children:"Result limit reached."}):null]}),C.jsxs("aside",{className:"translation-file-browser-selection",children:[C.jsxs("label",{children:[C.jsx("span",{children:"Source path"}),C.jsx("input",{value:d,onChange:w=>c(w.target.value)})]}),C.jsx("button",{type:"button",disabled:t||!d.trim(),onClick:u,children:"Translate File"})]})]})]})})}function Yg({entry:t,selected:r,onBrowse:s,onSelectPath:l}){const d=t.type==="directory";return C.jsxs("button",{className:r?"translation-file-browser-entry is-selected":"translation-file-browser-entry",type:"button",onClick:()=>d?s(t.path,""):l(t.path),onDoubleClick:()=>d?s(t.path,""):void 0,children:[C.jsx("span",{children:d?"DIR":"FILE"}),C.jsx("strong",{children:t.name}),C.jsx("small",{children:t.path})]})}function Ek({busy:t,state:r,selectedJobId:s,output:l,report:d,onClose:m,onRefresh:f,onSelectJob:o,onTranslate:c}){const u=(r==null?void 0:r.fileIndex.jobs)??[],g=u.find(h=>h.id===s);return C.jsxs("section",{className:"file-translation-modal",role:"dialog","aria-modal":"true","aria-label":"File Translation",children:[C.jsxs("header",{className:"file-translation-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"File Translation"}),C.jsx("p",{children:"Claude Code · 中英互译"})]}),C.jsxs("div",{className:"file-translation-toolbar",children:[C.jsx("button",{type:"button",disabled:t,onClick:c,children:"Translate"}),C.jsx("button",{type:"button",disabled:t,onClick:f,children:"Refresh"}),C.jsx("button",{type:"button",onClick:m,children:"Close"})]})]}),r!=null&&r.memoryInitialized?null:C.jsx("p",{className:"translation-entry-note",children:"Translation memory is not initialized. Run Bootstrap from the sidebar before important file translations."}),C.jsxs("div",{className:"file-translation-layout",children:[C.jsxs("div",{className:"file-translation-list",children:[u.length===0?C.jsx("p",{className:"muted",children:"No translated files yet."}):null,u.map(h=>C.jsxs("button",{className:h.id===s?"file-translation-item is-active":"file-translation-item",type:"button",onClick:()=>o(h.id),children:[C.jsx("strong",{children:h.sourcePath}),C.jsxs("span",{children:[h.status," · ",h.targetLanguage]})]},h.id))]}),C.jsx("div",{className:"file-translation-preview",children:g?C.jsxs(C.Fragment,{children:[C.jsxs("header",{children:[C.jsx("strong",{children:g.sourcePath}),C.jsx("span",{children:g.status})]}),C.jsx("div",{className:"translation-markdown",children:C.jsx(rv,{remarkPlugins:[Tv],children:l||d||"Translation output is not available yet."})})]}):C.jsx("p",{className:"muted",children:"Select a translated file to preview it."})})]})]})}function kk({entry:t}){if(t.sourceKind==="conversation-boundary")return C.jsx(Ak,{entry:t});const r=Mk(t),s=t.sourceKind==="tool-output",l=t.direction==="user-input-to-english",d=["translation-entry",`is-${t.sourceKind}`,l?"is-user-input":""].filter(Boolean).join(" ");return C.jsxs("article",{className:d,children:[s?C.jsx("pre",{children:r}):C.jsx("div",{className:"translation-markdown",children:C.jsx(rv,{remarkPlugins:[Tv],children:r})}),t.warning?C.jsx("p",{className:"translation-entry-note",children:t.warning}):null,t.error?C.jsx("p",{className:"translation-entry-note is-error",children:t.error}):null]})}function Ak({entry:t}){const r=t.boundaryKind==="end"?"结束":"开始",s=t.conversationTurn??0,l=Bk(t.occurredAt??t.createdAt);return C.jsxs("div",{className:"translation-conversation-boundary","aria-label":`${r} 第 ${s} 轮 ${l}`,children:[C.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"}),C.jsx("span",{children:r}),C.jsxs("span",{children:["第 ",s," 轮"]}),C.jsx("time",{children:l}),C.jsx("span",{className:"translation-boundary-dash","aria-hidden":"true"})]})}function Tk(t){const r=t.find(Mv);return(r==null?void 0:r.translationStartedAt)??(r==null?void 0:r.createdAt)}function Rk(t,r,s){const l=t.find(Mv);if(l)return`translating ${Ok(Math.max(0,s-Dk(l)))}`;const d=t.at(-1);return(d==null?void 0:d.status)==="failed"||r==="failed"?"error":r}function Mv(t){return t.status==="queued"||t.status==="translating"}function Dk(t){const r=Date.parse(t.translationStartedAt??t.createdAt);return Number.isFinite(r)?r:Date.now()}function Mk(t){return t.status==="queued"||t.status==="translating"?t.sourceText:t.status==="translated"?t.direction==="user-input-to-english"?Lv(t.sourceText,t.translatedText):t.translatedText:t.translatedText||t.sourceText}function Lv(t,r){return`${t.trimEnd()}${Ho}${r.trimStart()}`}function Lk(t){return t.includes(Ho)}function Xg(t){const r=t.indexOf(Ho);return r===-1?t:t.slice(r+Ho.length)}function Ok(t){if(t<1e3)return`${Math.max(.1,t/1e3).toFixed(1)}s`;const r=t/1e3;if(r<60)return`${r.toFixed(1)}s`;const s=Math.floor(r/60),l=Math.floor(r%60).toString().padStart(2,"0");return`${s}:${l}`}function Bk(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}const jk=8;function Nk(){const[t,r]=ee.useState([]);return ee.useEffect(()=>{const s=m=>{var c,u;const f=(u=(c=m.detail)==null?void 0:c.message)==null?void 0:u.trim();if(!f)return;const o=new Date().toISOString();r(g=>{const h=g.find(S=>S.message===f);return h?[{...h,count:h.count+1,updatedAt:o},...g.filter(S=>S.id!==h.id)]:[{id:`ui_error_${Date.now()}_${Math.random().toString(16).slice(2)}`,message:f,count:1,createdAt:o,updatedAt:o},...g].slice(0,jk)})},l=m=>{var o;const f=((o=m.detail)==null?void 0:o.actions)??[];f.length!==0&&r(c=>c.filter(u=>!f.some(g=>u.message.startsWith(`${g} failed.`))))},d=m=>{var o,c;const f=(c=(o=m.detail)==null?void 0:o.message)==null?void 0:c.trim();f&&r(u=>u.filter(g=>g.message!==f))};return window.addEventListener(bh,s),window.addEventListener(Ch,l),window.addEventListener(wh,d),()=>{window.removeEventListener(bh,s),window.removeEventListener(Ch,l),window.removeEventListener(wh,d)}},[]),t.length===0?null:C.jsxs("aside",{className:"ui-error-center",role:"alert","aria-live":"polite","aria-label":"Application errors",children:[C.jsxs("header",{className:"ui-error-center-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Errors"}),C.jsxs("p",{children:[t.length," active"]})]}),C.jsx("button",{type:"button",onClick:()=>r([]),children:"Clear"})]}),C.jsx("ol",{className:"ui-error-list",children:t.map(s=>C.jsxs("li",{children:[C.jsxs("div",{children:[C.jsx("p",{children:s.message}),C.jsxs("span",{children:[Hk(s.updatedAt),s.count>1?` · repeated ${s.count} times`:""]})]}),C.jsx("button",{type:"button","aria-label":"Dismiss error",onClick:()=>r(l=>l.filter(d=>d.id!==s.id)),children:"Close"})]},s.id))})]})}function Hk(t){return new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function zk(t,r){return t.find(s=>s.taskSlug===r)??t[0]??null}function Ik(t){if(!(t.mode!=="auto"||t.status!=="running")&&!(!t.activeRole||t.activeRole===t.lastFollowedRole))return t.activeRole}function Uk(t,r){var d;if(!((d=t.flowPause)!=null&&d.paused))return null;const s=t.flowPause.role??t.activeRole??"role",l=t.roleRecovery;return t.flowPause.reason==="role-recovery-failed"&&l?r(l,s):`No new turn started after ${s} stopped.`}function Pk(t){const r=t.roundId??t.startedAt??t.taskSlug,s=t.stoppedAt??t.lastTurnEndedAt??"stopped";return`${r}:${s}`}function Fk(t){return t?"strong":"none"}function qk(t,r){if(!r)return{observation:t,dismissPauseAlert:!1};const s=r.lastPmInputMessageId??null;return t.initialized?{observation:{initialized:!0,messageId:s},dismissPauseAlert:!!(r.enabled&&s&&s!==t.messageId)}:{observation:{initialized:!0,messageId:s},dismissPauseAlert:!1}}const $k=3,Gk=3e4,Mo=new Map;function Ov(t,r){const s=lt(t,r);if(!Vk(r))return Mo.set(t,{consecutiveFailures:1,lastMessage:s,lastReportedAt:Date.now()}),s;const l=Mo.get(t),d=((l==null?void 0:l.consecutiveFailures)??0)+1,m=Date.now(),f=d>=$k&&(!l||l.lastMessage!==s||m-l.lastReportedAt>=Gk);return Mo.set(t,{consecutiveFailures:d,lastMessage:s,lastReportedAt:f?m:(l==null?void 0:l.lastReportedAt)??0}),f?s:null}function zo(t){Mo.delete(t),SS([t])}function Vk(t){const r=cl(t);return r.includes("could not reach the VCM backend")||r.includes("Failed to fetch")||r.includes("NetworkError")||r.includes("Load failed")||r.includes("ERR_CONNECTION")}const Wk=["architecture-plan","validation-adequacy","code-diff"];function Kk({events:t,maxEvents:r=8,showHeader:s=!0}){const l=r===null?t:t.slice(-r);return C.jsxs("section",{className:"event-log",children:[s?C.jsx("h2",{children:"Events"}):null,t.length===0?C.jsx("p",{className:"muted",children:"No terminal events yet."}):C.jsx("ol",{children:l.map((d,m)=>C.jsx("li",{children:d},`${d}-${m}`))})]})}function Hn({checked:t,className:r,disabled:s,label:l,stateLabel:d,title:m,onChange:f}){const o=["switch-control",t?"is-on":"is-off",r].filter(Boolean).join(" "),c=d??(t?"on":"off");return C.jsxs("button",{type:"button",role:"switch","aria-checked":t,"aria-label":`${l}: ${c}`,className:o,disabled:s,title:m,onClick:()=>f(!t),children:[C.jsx("span",{className:"switch-control-label",children:l}),C.jsx("span",{className:"switch-control-track","aria-hidden":"true",children:C.jsx("span",{className:"switch-control-thumb"})})]})}function Yk({status:t,bootstrapStatus:r,applyResult:s,hasActiveTask:l=!1,autoTaskHarnessReviewEnabled:d,autoMemoryEnabled:m,launchOptions:f,modelOptions:o,busy:c=!1,onRefresh:u,onApply:g,onOpenStudio:h,onOpenRepositoryDiff:S,onAutoTaskHarnessReviewChange:w,onAutoMemoryChange:T,onLaunchOptionsChange:k,onStartBootstrap:y,onRestartBootstrap:_,onStopBootstrap:v,onRunBootstrap:b}){const[E,O]=ee.useState(!1),R=r==null?void 0:r.session,D=(r==null?void 0:r.status)==="running",A=(R==null?void 0:R.status)==="running",M=(r==null?void 0:r.status)!=="complete";return l?t?C.jsxs("section",{className:"harness-panel",children:[C.jsxs("div",{className:"harness-stage",children:[C.jsxs("div",{className:"harness-panel-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Fixed install"}),C.jsx("p",{className:"muted",children:t.initialized?t.needsApply?`${t.plannedChanges.length} pending updates`:"Up to date":"Not initialized"})]}),C.jsx("div",{className:"harness-actions",children:t.initialized?C.jsxs(C.Fragment,{children:[C.jsx("button",{type:"button",disabled:c,onClick:()=>void u(),children:"Refresh"}),t.needsApply?C.jsx("button",{type:"button",disabled:c,onClick:()=>void g(),children:"Update"}):null]}):C.jsx("button",{type:"button",disabled:c,onClick:()=>void g(),children:"Initialize"})})]}),t.initialized&&t.needsApply?C.jsxs(C.Fragment,{children:[C.jsx("h3",{className:"harness-file-list-title",children:"Files to update"}),C.jsx("ol",{className:"harness-file-list",children:t.plannedChanges.map(L=>C.jsxs("li",{children:[C.jsx("span",{children:L.path}),C.jsx(jn,{status:L.action})]},`${L.path}:${L.action}`))})]}):null]}),C.jsxs("div",{className:"harness-stage",children:[C.jsxs("div",{className:"harness-panel-header",children:[C.jsx("div",{children:C.jsx("strong",{children:"Harness Studio"})}),C.jsx("div",{className:"harness-actions",children:C.jsx("button",{type:"button",disabled:c,onClick:h,children:"Open Studio"})})]}),C.jsx("button",{className:"harness-review-diff-button",type:"button",disabled:c,onClick:S,children:"Review Diff"}),C.jsx(Hn,{checked:d,className:"sidebar-switch",disabled:c,label:"Auto task harness review",title:"Automatically ask Harness Engineer to review task harness after final acceptance completes",onChange:w}),C.jsx(Hn,{checked:m,className:"sidebar-switch",disabled:c,label:"Auto memory",title:"Collect role memory drafts after Final Acceptance and let Harness Engineer apply reviewed memory",onChange:T})]}),M?C.jsx("div",{className:"harness-stage",children:C.jsxs("div",{className:"harness-panel-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Bootstrap"}),C.jsx("p",{className:"muted",children:r?Xk(r.status):"not loaded"})]}),C.jsx("div",{className:"harness-actions",children:C.jsx("button",{type:"button",disabled:c||!(r!=null&&r.canStart),onClick:()=>{O(!0)},children:"Open Bootstrap"})})]})}):null,s!=null&&s.changedFiles.length?C.jsx("div",{className:"harness-result",children:C.jsx("p",{className:"muted",children:s.message})}):null,t.warnings.length>0?C.jsx("ul",{className:"warnings",children:t.warnings.map(L=>C.jsx("li",{children:L},L))}):null,r!=null&&r.warnings.length?C.jsx("ul",{className:"warnings",children:r.warnings.map(L=>C.jsx("li",{children:L},L))}):null,M&&E?C.jsx("div",{className:"harness-bootstrap-modal",role:"dialog","aria-modal":"true","aria-label":"Harness Engineer bootstrap session",children:C.jsxs("div",{className:"harness-bootstrap-modal-surface",children:[C.jsxs("header",{className:"harness-bootstrap-modal-header",children:[C.jsxs("div",{children:[C.jsx("strong",{children:"Harness Engineer Bootstrap"}),C.jsx("p",{className:"muted",children:(R==null?void 0:R.command)??"Start Harness Engineer, then run bootstrap when ready."})]}),C.jsxs("div",{className:"harness-bootstrap-modal-actions",children:[R?C.jsx(jn,{status:R.status}):null,C.jsx("button",{type:"button",onClick:()=>O(!1),children:"Close"})]})]}),C.jsxs("div",{className:"harness-bootstrap-controls",children:[C.jsxs("label",{children:[C.jsx("span",{children:"Permission"}),C.jsx("select",{value:f.permissionMode,disabled:c||D||A,onChange:L=>k({...f,permissionMode:L.target.value}),children:__.map(L=>C.jsx("option",{value:L.value,children:L.label},L.value))})]}),C.jsxs("label",{children:[C.jsx("span",{children:"Model"}),C.jsx("select",{value:f.model,title:(()=>{const L=o.find(H=>H.value===f.model);return L!=null&&L.available?L.description:L==null?void 0:L.unavailableReason})(),disabled:c||D||A,onChange:L=>k({...f,model:L.target.value}),children:o.map(L=>C.jsx("option",{value:L.value,disabled:!L.available,title:L.available?L.description:L.unavailableReason,children:L.label},L.value))})]}),C.jsxs("label",{children:[C.jsx("span",{children:"Effort"}),C.jsx("select",{value:f.effort,disabled:c||D||A,onChange:L=>k({...f,effort:L.target.value}),children:y_.map(L=>C.jsx("option",{value:L.value,children:L.label},L.value))})]}),C.jsxs("div",{className:"harness-bootstrap-control-actions",children:[C.jsx("button",{type:"button",disabled:c||D||!(r!=null&&r.canStart),onClick:()=>void y(f),children:"Start"}),C.jsx("button",{type:"button",disabled:c||D||!(r!=null&&r.canStart),onClick:()=>void _(f),children:"Restart"}),C.jsx("button",{type:"button",disabled:c||!R,onClick:()=>void v(),children:"Stop"}),C.jsx("button",{type:"button",disabled:c||D||!A,onClick:()=>void b(),children:"Run bootstrap"})]})]}),C.jsx("div",{className:"harness-bootstrap-terminal",children:A?C.jsx(Po,{sessionId:R.id,active:E}):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:"Harness Bootstrap"}),C.jsx("span",{children:"Start Harness Engineer first. When it is ready, click Run bootstrap to send the prompt."})]})})]})}):null]}):null:C.jsx("section",{className:"harness-panel",children:C.jsxs("div",{className:"harness-result",children:[C.jsx("strong",{children:"Task required"}),C.jsx("p",{className:"muted",children:"Create or select a task before changing VCM Harness. Harness changes are committed in the active task worktree."})]})})}function Xk(t){return t.replaceAll("_"," ")}function af(t){return{total:t.length,accepted:t.filter(r=>r.acceptedAt).length,delivered:t.filter(r=>r.deliveredAt).length}}function Qk(t,r=6){const s=[...t].sort(e2).map((d,m)=>({message:d,sequence:m+1}));return[...r===null?s:s.slice(-r)].sort((d,m)=>m.sequence-d.sequence)}function Jk({messages:t,orchestration:r,busy:s,maxMessages:l=6,showControls:d=!0,showHeader:m=!0,onModeChange:f,onMarkAllDone:o}){const[c,u]=ee.useState(null),g=af(t),h=(r==null?void 0:r.mode)??"auto",S=Qk(t,l);async function w(T){await t2(T.body),u(T.id),window.setTimeout(()=>u(k=>k===T.id?null:k),1200)}return C.jsxs("section",{className:"message-panel",children:[m?C.jsxs("div",{className:"message-panel-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Messages"}),C.jsxs("p",{className:"muted",children:[g.total," total / ",g.accepted," accepted"]})]}),d&&f?C.jsx("div",{className:"message-controls",children:C.jsx(Hn,{checked:h==="auto",className:"message-mode-toggle",disabled:s,label:"Auto orchestration",onChange:T=>f(T?"auto":"manual")})}):null,d&&o?C.jsx("button",{type:"button",disabled:s,onClick:o,children:"Mark All Done"}):null]}):null,t.length===0?C.jsx("p",{className:"muted",children:"No role messages yet."}):C.jsx("ol",{className:"message-list",children:S.map(({message:T,sequence:k})=>C.jsxs("li",{className:"message-item",children:[C.jsxs("div",{className:"message-item-main",children:[C.jsxs("div",{className:"message-meta",children:[C.jsxs("span",{className:"message-sequence",children:["#",k]}),C.jsx("time",{dateTime:Io(T),children:Zk(Io(T))}),C.jsxs("strong",{children:[T.fromRole," ","->"," ",T.toRole]}),C.jsx("span",{children:T.type})]}),C.jsx("p",{children:T.body}),T.failureReason?C.jsx("span",{className:"message-reason",children:T.failureReason}):null,T.bodyPath?C.jsx("span",{className:"message-path",children:T.bodyPath}):null]}),C.jsx("div",{className:"message-actions",children:C.jsx("button",{type:"button",disabled:s,onClick:()=>void w(T),children:c===T.id?"Copied":"Copy"})})]},T.id))})]})}function Zk(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}function Io(t){return t.acceptedAt??t.deliveredAt??t.dispatchingAt??t.createdAt}function e2(t,r){const s=Io(t).localeCompare(Io(r));if(s!==0)return s;const l=t.createdAt.localeCompare(r.createdAt);return l!==0?l:t.id.localeCompare(r.id)}async function t2(t){var s;if((s=navigator.clipboard)!=null&&s.writeText){await navigator.clipboard.writeText(t);return}const r=document.createElement("textarea");r.value=t,r.setAttribute("readonly","true"),r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove()}function n2({defaultPath:t="",recentPaths:r=[],busy:s=!1,onConnect:l}){const[d,m]=ee.useState(t);ee.useEffect(()=>{t&&m(t)},[t]);async function f(o){o.preventDefault(),await l(d)}return C.jsx("form",{className:"repo-connect",onSubmit:f,children:C.jsxs("div",{className:r.length>0?"inline-form has-recent-paths":"inline-form",children:[C.jsx("input",{"aria-label":"Repository path",id:"repo-path",value:d,onChange:o=>m(o.target.value),placeholder:"/path/to/repo"}),r.length>0?C.jsxs("select",{"aria-label":"Recent repositories",className:"repo-recent-select",value:"",onChange:o=>{o.target.value&&m(o.target.value)},children:[C.jsx("option",{value:"",children:"Recent"}),r.map(o=>C.jsx("option",{value:o,children:o},o))]}):null,C.jsx("button",{type:"submit",disabled:s||!d.trim(),children:"Connect"})]})})}function i2({tasks:t,activeTaskSlug:r,onSelect:s}){return C.jsx("nav",{className:"task-nav","aria-label":"Tasks",children:t.map(l=>C.jsxs("button",{className:l.taskSlug===r?"task-nav-item is-active":"task-nav-item",type:"button",onClick:()=>s(l.taskSlug),children:[C.jsx("span",{children:l.title||l.taskSlug}),C.jsx(jn,{status:l.status})]},l.taskSlug))})}function r2({open:t,taskSlug:r,taskTitle:s,onClose:l}){const[d,m]=ee.useState(null),[f,o]=ee.useState(!1),[c,u]=ee.useState(null),g=ee.useCallback(async()=>{o(!0),u(null);try{m(await ye.getTaskUsageAnalytics(r))}catch(h){u(`Load task usage analytics failed. Reason: ${cl(h)}`)}finally{o(!1)}},[r]);return ee.useEffect(()=>{t&&g()},[g,t]),t?C.jsx("div",{className:"modal-backdrop usage-analytics-backdrop",children:C.jsxs("section",{className:"usage-analytics-modal",role:"dialog","aria-modal":"true","aria-label":"Usage Analytics",children:[C.jsxs("header",{className:"usage-analytics-header",children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Usage Analytics"}),C.jsxs("p",{children:[(s==null?void 0:s.trim())||r," · Claude models only"]})]}),C.jsxs("div",{className:"usage-analytics-header-actions",children:[C.jsx("button",{type:"button",disabled:f,onClick:()=>void g(),children:f?"Refreshing...":"Refresh"}),C.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),c?C.jsx("p",{className:"inline-error usage-analytics-error",children:c}):null,d?C.jsx(s2,{report:d}):C.jsx("div",{className:"usage-analytics-empty",children:f?"Loading usage data...":"No usage data available."})]})}):null}function s2({report:t}){return C.jsxs("div",{className:"usage-analytics-content",children:[C.jsxs("div",{className:"usage-analytics-meta",children:[C.jsx("span",{children:t.updatedAt?`Updated ${l2(t.updatedAt)}`:"No Claude usage recorded yet"}),C.jsxs("span",{children:[bn(t.totals.requestCount)," requests · ",bn(t.totals.sessionCount)," sessions"]})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-task-summary",children:[C.jsx("h3",{id:"usage-task-summary",children:"Task Summary"}),C.jsx(a2,{totals:t.totals})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-by-role",children:[C.jsx("h3",{id:"usage-by-role",children:"Usage by Role"}),C.jsx("div",{className:"usage-analytics-table-wrap",children:C.jsxs("table",{className:"usage-analytics-table",children:[C.jsx("thead",{children:C.jsx(Qg,{firstColumn:"Role"})}),C.jsx("tbody",{children:t.byRole.map(r=>C.jsxs("tr",{children:[C.jsxs("th",{scope:"row",children:[C.jsx("span",{children:lS(r.role).label}),C.jsxs("small",{children:[bn(r.requestCount)," requests · ",bn(r.sessionCount)," sessions"]})]}),C.jsx(Jg,{totals:r})]},r.role))})]})})]}),C.jsxs("section",{className:"usage-analytics-section","aria-labelledby":"usage-by-model",children:[C.jsx("h3",{id:"usage-by-model",children:"Usage by Model"}),t.byModel.length>0?C.jsx("div",{className:"usage-analytics-table-wrap",children:C.jsxs("table",{className:"usage-analytics-table",children:[C.jsx("thead",{children:C.jsx(Qg,{firstColumn:"Model"})}),C.jsx("tbody",{children:t.byModel.map(r=>C.jsxs("tr",{children:[C.jsxs("th",{scope:"row",children:[C.jsx("span",{children:r.model}),C.jsxs("small",{children:[bn(r.requestCount)," requests · ",bn(r.sessionCount)," sessions"]})]}),C.jsx(Jg,{totals:r})]},r.model))})]})}):C.jsx("p",{className:"usage-analytics-no-models",children:"No Claude model usage recorded yet."})]})]})}function a2({totals:t}){return C.jsxs("dl",{className:"usage-totals-grid",children:[C.jsx(Ja,{label:"Input Tokens",value:bn(t.inputTokens)}),C.jsx(Ja,{label:"Output Tokens",value:bn(t.outputTokens)}),C.jsx(Ja,{label:"Cache Read",value:bn(t.cacheReadTokens)}),C.jsx(Ja,{label:"Cache Creation",value:bn(t.cacheCreationTokens)}),C.jsx(Ja,{label:"Estimated Cost",value:Bv(t.costUsd)})]})}function Ja({label:t,value:r}){return C.jsxs("div",{children:[C.jsx("dt",{children:t}),C.jsx("dd",{children:r})]})}function Qg({firstColumn:t}){return C.jsxs("tr",{children:[C.jsx("th",{scope:"col",children:t}),C.jsx("th",{scope:"col",children:"Input"}),C.jsx("th",{scope:"col",children:"Output"}),C.jsx("th",{scope:"col",children:"Cache Read"}),C.jsx("th",{scope:"col",children:"Cache Creation"}),C.jsx("th",{scope:"col",children:"Estimated Cost"})]})}function Jg({totals:t}){return C.jsxs(C.Fragment,{children:[C.jsx("td",{children:bn(t.inputTokens)}),C.jsx("td",{children:bn(t.outputTokens)}),C.jsx("td",{children:bn(t.cacheReadTokens)}),C.jsx("td",{children:bn(t.cacheCreationTokens)}),C.jsx("td",{children:Bv(t.costUsd)})]})}function bn(t){return new Intl.NumberFormat("en-US",{maximumFractionDigits:0}).format(t)}function Bv(t){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:4,maximumFractionDigits:6}).format(t)}function l2(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleString()}function o2({project:t,recentRepositoryPaths:r,tasks:s,activeTaskSlug:l,messages:d,orchestration:m,events:f,roundState:o,gateReview:c,translationEnabled:u,translationAutoSendEnabled:g,translationTargetLanguage:h,translationOutputMode:S,translationMemoryInitialized:w,translatorSession:T,harnessStatus:k,harnessBootstrapStatus:y,harnessApplyResult:_,harnessEngineerLaunchOptions:v,autoTaskHarnessReviewEnabled:b,autoMemoryEnabled:E,gatewayStatus:O,gatewayQrLogin:R,gatewayQrCheck:D,gatewayLarkRegistration:A,gatewayLarkRegistrationCheck:M,codexBridgeStatus:L,modelOptions:H,busy:U,onConnect:P,onRefreshConnectedRepository:W,onPullConnectedRepository:K,onRefreshHarness:V,onApplyHarness:Y,onStartHarnessBootstrap:te,onRestartHarnessBootstrap:z,onStopHarnessBootstrap:j,onRunHarnessBootstrap:N,onOpenHarnessStudio:q,onOpenRepositoryDiff:I,onAutoTaskHarnessReviewChange:ie,onAutoMemoryChange:pe,onHarnessEngineerLaunchOptionsChange:ge,onRefreshGateway:Q,onGatewayEnabledChange:$,onGatewaySettingsChange:he,onCodexBridgeSettingsChange:le,onCodexBridgeCheck:xe,onGatewayTranslationChange:Ce,onGatewayConnectionChange:Le,onStartGatewayQrLogin:Ie,onStartGatewayLarkRegistration:He,onResetGatewayBinding:$e,onGateReviewGateEnabledChange:De,onCancelGateReviewGate:Ct,onTranslationEnabledChange:Rt,onTranslationAutoSendChange:jt,onTranslationTargetLanguageChange:re,onTranslationOutputModeChange:ve,onOpenFileTranslation:ke,onOpenTranslatorSession:nt,onCreateTranslationBootstrap:ot,onUpdateTranslationMemory:ce,onCreateTask:Se,onCloseTask:Ee,onSelectTask:Oe,themeMode:Ne,onAutoOrchestrationChange:yt,onThemeModeChange:Pe,pauseAlertSound:wt,onPauseAlertSoundChange:bt,roleRetryEnabled:Nt,onRoleRetryEnabledChange:it,permissionRequestMode:Wt,onPermissionRequestModeChange:rn,launchTemplate:Cr,canSaveLaunchTemplate:mi,canOneClickStart:gi,onSaveLaunchTemplate:Pi,onOneClickStart:zn,onMarkAllMessagesDone:Fi,onDeleteMessageHistory:Jn}){const[si,sn]=ee.useState(""),[ai,In]=ee.useState(!1),[qi,_i]=ee.useState(!1),[vi,yi]=ee.useState(!1),[wn,Pt]=ee.useState(()=>l?null:"repository"),li=af(d),hn=si.trim(),Kt=d2(t,l,k),mt=s.filter(Ge=>Ge.cleanupStatus!=="cleaned"),ct=mt.find(Ge=>Ge.taskSlug===l)??null;ee.useEffect(()=>{Pt(Ge=>!l&&Ge===null?t?"task":"repository":Ge)},[l,t]);function Ht(Ge,Un){Pt(Un?Ge:null)}async function $i(Ge){Ge.preventDefault(),await Se({taskSlug:hn}),sn("")}return C.jsxs("div",{className:"project-dashboard",children:[C.jsx("header",{className:"brand-header",children:C.jsx("strong",{children:"VibeCodingMaster"})}),C.jsx(Kr,{title:"Repository",open:wn==="repository",onOpenChange:Ge=>{Ht("repository",Ge),Ge&&t&&W()},children:C.jsxs("div",{className:"repository-panel",children:[C.jsx(n2,{defaultPath:(t==null?void 0:t.repoRoot)??"",recentPaths:r,busy:U,onConnect:P}),t?C.jsx(_2,{busy:U,project:t,onPull:K}):null]})}),C.jsx(Kr,{title:"Settings",open:wn==="settings",onOpenChange:Ge=>Ht("settings",Ge),children:C.jsxs("div",{className:"sidebar-settings",children:[C.jsxs("button",{"aria-label":`Theme mode: ${e_(Ne)}`,className:"settings-toggle theme-mode-toggle",disabled:U,title:"Cycle theme: system, light, dark",type:"button",onClick:()=>Pe(C2(Ne)),children:[C.jsx("span",{children:"Theme"}),C.jsx("span",{children:e_(Ne)})]}),C.jsx(Hn,{checked:((m==null?void 0:m.mode)??"auto")==="auto",className:"sidebar-switch",disabled:U||!l,label:"Auto orchestration",title:l?"Automatically dispatch role messages during the active task":"Create or select a task first",onChange:yt}),C.jsx(Hn,{checked:wt,className:"sidebar-switch",disabled:U,label:"Pause alert sound",title:"Play a sound when VCM shows the fixed flow pause dialog",onChange:Ge=>bt(Ge)}),C.jsx(Hn,{checked:Nt,className:"sidebar-switch",disabled:U,label:"CC auto retry",title:"Retry temporary Claude Code turn failures before showing the flow pause alert",onChange:Ge=>it(Ge)}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Permission requests"}),C.jsxs("select",{value:Wt,disabled:U,onChange:Ge=>rn(Ge.target.value),children:[C.jsx("option",{value:"off",children:"off"}),C.jsx("option",{value:"allowAll",children:"allow all"})]})]}),C.jsx(u2,{busy:U,status:L,onCheck:xe,onSettingsChange:le}),C.jsxs("button",{className:"settings-toggle",disabled:U||!mi,title:"Save the current core role launch settings and optional Reviewer settings",type:"button",onClick:Pi,children:[C.jsx("span",{children:"Save launch template"}),C.jsx("span",{children:mi?"ready":"open task"})]}),gi?C.jsxs("button",{className:"settings-toggle is-active",disabled:U,title:c2(Cr),type:"button",onClick:zn,children:[C.jsx("span",{children:"One-click start"}),C.jsx("span",{children:jv(Cr)})]}):null,l?C.jsxs(C.Fragment,{children:[C.jsxs("button",{type:"button",onClick:()=>In(!0),children:[C.jsx("span",{children:"Messages"}),C.jsxs("span",{className:"muted",children:[li.total," total"]})]}),C.jsxs("button",{type:"button",onClick:()=>_i(!0),children:[C.jsx("span",{children:"Events"}),C.jsxs("span",{className:"muted",children:[f.length," total"]})]})]}):null]})}),C.jsx(Kr,{title:"Translation",open:wn==="translation",onOpenChange:Ge=>Ht("translation",Ge),children:C.jsx(h2,{busy:U,enabled:u,autoSendEnabled:g,targetLanguage:h,outputMode:S,memoryInitialized:w,baseUnavailableReason:Kt,translatorSession:T,onAutoSendChange:jt,onCreateBootstrap:ot,onEnabledChange:Rt,onUpdateMemory:ce,onTargetLanguageChange:re,onOutputModeChange:ve,onOpenFileTranslation:ke,onOpenTranslatorSession:nt})}),t&&l?C.jsx(Kr,{title:"Gate Review Gates",open:wn==="gate-review-gates",onOpenChange:Ge=>Ht("gate-review-gates",Ge),children:C.jsx(p2,{busy:U,state:c,onCancelGateReview:Ct,onGateEnabledChange:De})}):null,C.jsx(Kr,{title:"Gateway",open:wn==="gateway",onOpenChange:Ge=>{Ht("gateway",Ge),Ge&&Q()},children:C.jsx(g2,{busy:U,qrCheck:D,qrLogin:R,larkRegistration:A,larkRegistrationCheck:M,status:O,onEnabledChange:$,onSettingsChange:he,onResetBinding:$e,onStartLarkRegistration:He,onStartQrLogin:Ie,onTranslationChange:Ce,onConnectionChange:Le})}),t?C.jsx(Kr,{title:"VCM Harness",open:wn==="vcm-harness",onOpenChange:Ge=>Ht("vcm-harness",Ge),children:C.jsx(Yk,{status:k,bootstrapStatus:y,applyResult:_,hasActiveTask:!!ct,autoTaskHarnessReviewEnabled:b,autoMemoryEnabled:E,launchOptions:v,modelOptions:H,busy:U,onRefresh:V,onApply:Y,onOpenStudio:q,onOpenRepositoryDiff:I,onAutoTaskHarnessReviewChange:ie,onAutoMemoryChange:pe,onLaunchOptionsChange:ge,onStartBootstrap:te,onRestartBootstrap:z,onStopBootstrap:j,onRunBootstrap:N})}):null,t?C.jsx(Kr,{title:"Task",open:wn==="task",onOpenChange:Ge=>Ht("task",Ge),children:mt.length>0?C.jsxs("div",{className:"task-panel",children:[C.jsx(i2,{tasks:mt,activeTaskSlug:l,onSelect:Oe}),ct?C.jsxs("div",{className:"task-panel-actions",children:[C.jsx("button",{type:"button",onClick:()=>yi(!0),children:"Usage Analytics"}),C.jsx("button",{className:"danger-button",disabled:U,type:"button",onClick:Ee,children:"Close Task"})]}):null]}):C.jsx("div",{className:"task-create",children:C.jsxs("form",{onSubmit:$i,children:[C.jsx("input",{value:si,onChange:Ge=>sn(Ge.target.value),placeholder:"task name"}),C.jsxs("div",{className:"task-create-preview",children:[C.jsxs("small",{children:["branch: ",hn?`feature/${hn}`:"feature/<task>"]}),C.jsxs("small",{children:["worktree: ",hn?`.claude/worktrees/${hn}`:".claude/worktrees/<task>"]})]}),C.jsx("button",{type:"submit",disabled:U||!hn,children:"Create"})]})})}):null,t&&ct?C.jsx(S2,{task:ct,roundState:o}):null,ai?C.jsx(x2,{busy:U,messages:d,orchestration:m,onClose:()=>In(!1),onMarkAllDone:()=>{l&&Fi(l)},onDeleteMessageHistory:()=>{l&&Jn(l)}}):null,qi?C.jsx(w2,{events:f,onClose:()=>_i(!1)}):null,ct?C.jsx(r2,{open:vi,taskSlug:ct.taskSlug,taskTitle:ct.title,onClose:()=>yi(!1)}):null]})}function jv(t){return[t.autoOrchestration?"auto":"manual"].join(" + ")}function c2(t){const r=Object.entries(t.roles).map(([s,l])=>`${s}: ${l.permissionMode} / ${l.model} / ${l.effort}`).join("; ");return`Launch template: ${jv(t)}; ${r}`}function u2({busy:t,status:r,onCheck:s,onSettingsChange:l}){const[d,m]=ee.useState(""),f=!!(r!=null&&r.apiKeyConfigured),o=async c=>{c.preventDefault();const u=d.trim();u&&(await l({apiKey:u}),m(""))};return C.jsxs("div",{className:"codex-bridge-settings",children:[C.jsx(Hn,{checked:!!(r!=null&&r.enabled),className:"sidebar-switch",disabled:t||!f,label:"Codex Bridge models",title:f?"Enable Codex models through Codex Bridge":"Save the Codex Bridge API key first",onChange:c=>void l({enabled:c})}),C.jsxs("form",{className:"codex-bridge-api-key-form",onSubmit:c=>void o(c),children:[C.jsx("label",{htmlFor:"codex-bridge-api-key",children:"Codex Bridge API key"}),C.jsxs("div",{children:[C.jsx("input",{id:"codex-bridge-api-key",type:"password",autoComplete:"off",disabled:t,placeholder:f?"Saved":"Required",value:d,onChange:c=>m(c.target.value)}),C.jsx("button",{type:"submit",disabled:t||!d.trim(),children:"Save"})]})]}),C.jsxs("div",{className:"settings-status-row",children:[C.jsx("span",{children:"Codex Bridge status"}),C.jsx("strong",{children:(r==null?void 0:r.connectionState)??"loading"})]}),C.jsxs("div",{className:"codex-bridge-actions",children:[C.jsx("button",{type:"button",disabled:t||!(r!=null&&r.enabled),onClick:()=>void s(),children:"Check"}),C.jsx("button",{type:"button",disabled:t||!f,onClick:()=>void l({clearApiKey:!0}),children:"Clear key"})]}),r!=null&&r.error?C.jsx("p",{className:"settings-help-text",children:r.error}):null]})}function h2({autoSendEnabled:t,baseUnavailableReason:r,busy:s,enabled:l,memoryInitialized:d,outputMode:m,targetLanguage:f,translatorSession:o,onAutoSendChange:c,onCreateBootstrap:u,onEnabledChange:g,onUpdateMemory:h,onOutputModeChange:S,onTargetLanguageChange:w,onOpenFileTranslation:T,onOpenTranslatorSession:k}){const y=!!(s||r),_=(o==null?void 0:o.status)==="running",v=!!(l&&!r&&_),b=r??(_?null:"Start Translator session first."),E=!!(s||b),R=r??"Open Translator session",D=b??"Translation tools are ready";return C.jsxs("div",{className:"sidebar-settings",children:[C.jsx(Hn,{checked:v,className:"sidebar-switch",disabled:y||!_,label:"Conversation translation",title:D,onChange:g}),C.jsx(Hn,{checked:t,className:"sidebar-switch",disabled:y,label:"Auto-send",onChange:c}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Language"}),C.jsx("select",{value:f,disabled:y,onChange:A=>w(A.target.value),children:g_.map(A=>C.jsx("option",{value:A.value,children:A.label},A.value))})]}),C.jsxs("label",{className:"settings-select-row",children:[C.jsx("span",{children:"Reply scope"}),C.jsx("select",{value:m,disabled:y,onChange:A=>S(A.target.value),children:uS.map(A=>C.jsx("option",{value:A.value,children:A.label},A.value))})]}),C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:T,children:[C.jsx("span",{children:"File translation"}),C.jsx("span",{children:"open"})]}),d?null:C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:u,children:[C.jsx("span",{children:"Bootstrap"}),C.jsx("span",{children:"run"})]}),C.jsxs("button",{className:"settings-toggle",disabled:E,title:D,type:"button",onClick:h,children:[C.jsx("span",{children:"Update memory"}),C.jsx("span",{children:"run"})]}),b?C.jsx("p",{className:"settings-help-text",children:b}):null,C.jsxs("div",{className:"settings-status-row",children:[C.jsx("span",{children:"Session status"}),C.jsx("strong",{children:f2(o)})]}),C.jsxs("button",{className:"settings-toggle",disabled:y,title:R,type:"button",onClick:k,children:[C.jsx("span",{children:"Open Session"}),C.jsx("span",{children:"open"})]})]})}function f2(t){return t?t.status==="running"?t.activityStatus??"idle":t.status:"not started"}function d2(t,r,s){return t?r?s?s.initialized?null:"Initialize VCM Harness first.":"Load VCM Harness status first.":"Create or select a task first.":"Connect a repository first."}function p2({busy:t,onCancelGateReview:r,onGateEnabledChange:s,state:l}){return C.jsx("div",{className:"sidebar-settings",children:Wk.map(d=>{const m=l==null?void 0:l.gates[d],f=!!(m!=null&&m.required);return C.jsxs("div",{className:"gate-review-setting",children:[C.jsx(Hn,{checked:f,className:"sidebar-switch",disabled:t||!l||(m==null?void 0:m.status)==="running",label:m2(d),title:m!=null&&m.status?`status: ${m.status}`:void 0,onChange:o=>s(d,o)}),(m==null?void 0:m.status)==="running"&&m.requestId?C.jsx("button",{className:"danger-button",disabled:t,type:"button",onClick:()=>r(d,m.requestId),children:"Cancel review"}):null]},d)})})}function m2(t){switch(t){case"architecture-plan":return"Architecture plan";case"validation-adequacy":return"Validation adequacy";case"code-diff":return"Code diff"}return t}function g2({busy:t,larkRegistration:r,larkRegistrationCheck:s,onEnabledChange:l,onResetBinding:d,onSettingsChange:m,onStartLarkRegistration:f,onStartQrLogin:o,onTranslationChange:c,onConnectionChange:u,qrCheck:g,qrLogin:h,status:S}){const w=(S==null?void 0:S.channel)==="lark",T=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.binding.tokenConfigured),k=(S==null?void 0:S.channel)==="lark"?!!(S.binding.appIdConfigured&&S.binding.appSecretConfigured):!!(S!=null&&S.binding.tokenConfigured);return C.jsxs("div",{className:"gateway-panel",children:[C.jsxs("label",{className:"compact-field",children:[C.jsx("span",{children:"Channel"}),C.jsxs("select",{disabled:t||!S,value:(S==null?void 0:S.channel)??"weixin-ilink",onChange:y=>{m({channel:y.currentTarget.value==="lark"?"lark":"weixin-ilink"})},children:[C.jsx("option",{value:"weixin-ilink",children:"Weixin iLink"}),C.jsx("option",{value:"lark",children:"Lark"})]})]}),C.jsxs("div",{className:"gateway-actions",children:[C.jsx(Hn,{checked:!!(S!=null&&S.connectionEnabled),className:"sidebar-switch",disabled:t||!S||!S.connectionEnabled&&!T,label:"Connection",stateLabel:S!=null&&S.connectionEnabled?"connected":"off",title:T?"Connect or disconnect the channel for this session. Off by default; the phone can drive the gateway only while Connection is on. Separate from the Gateway command switch.":"Configure the selected Gateway channel first",onChange:y=>u(y)}),C.jsx(Hn,{checked:!!(S!=null&&S.enabled),className:"sidebar-switch",disabled:t||!S||!S.enabled&&!T,label:"Gateway",title:T?"Enable or disable PM messages and task-changing Gateway commands":"Configure the selected Gateway channel first",onChange:y=>l(y)}),C.jsx(Hn,{checked:!!(S!=null&&S.translationEnabled),className:"sidebar-switch",disabled:t||!S,label:"Translation",onChange:y=>c(y)}),w?C.jsx("button",{type:"button",disabled:t,onClick:f,children:"Start QR Setup"}):k?C.jsx("button",{className:"danger-button",type:"button",disabled:t,onClick:d,children:"Reset Binding"}):C.jsx("button",{type:"button",disabled:t,onClick:o,children:"Start QR Login"})]}),w?C.jsxs("div",{className:"gateway-lark-settings",children:[C.jsx("p",{className:"muted",children:S!=null&&S.binding.appIdConfigured&&S.binding.appSecretConfigured?`Lark app configured${S.binding.larkBotName?` · ${S.binding.larkBotName}`:""}.`:"Use QR setup to create and configure the Lark bot automatically."}),r?C.jsxs("p",{className:"muted",children:["QR setup: ",(s==null?void 0:s.status)??r.status,s!=null&&s.message?` · ${s.message}`:""]}):null]}):h?C.jsx("p",{className:"muted",children:"QR login started. Use the login dialog to confirm binding."}):null,!w&&g?C.jsxs("p",{className:"muted",children:["QR status: ",g.status,g.message?` · ${g.message}`:""]}):null]})}function _2({busy:t,onPull:r,project:s}){const l=s.pullDisabledReason,d=!!s.canPull;return C.jsxs("div",{className:"project-summary",children:[C.jsxs("dl",{children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Base path"}),C.jsx("dd",{children:s.repoRoot})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Branch"}),C.jsx("dd",{children:v2(s)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Remote"}),C.jsx("dd",{children:s.upstreamBranch??"no upstream"})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:y2(s)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Commit"}),C.jsx("dd",{children:s.shortHeadCommit??s.headCommit??"unknown"})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Working tree"}),C.jsx("dd",{children:s.isDirty?"uncommitted changes":"clean"})]})]}),C.jsxs("div",{className:"connected-repo-actions",children:[C.jsx("button",{type:"button",disabled:t||!d,title:l??"Pull latest changes with git pull --ff-only",onClick:()=>void r(),children:"Pull"}),C.jsx("span",{className:"muted",children:s.checkedAt?`checked ${Hh(s.checkedAt)}`:"status not refreshed"})]}),l?C.jsx("p",{className:"muted",children:l}):null,s.warnings.length>0?C.jsx("ul",{className:"warnings",children:s.warnings.map(m=>C.jsx("li",{children:m},m))}):null]})}function v2(t){return t.branch||"unknown"}function y2(t){if(!t.upstreamBranch)return"no upstream";const r=t.ahead??0,s=t.behind??0;return r===0&&s===0?"up to date":r>0&&s>0?`ahead ${r}, behind ${s}`:r>0?`ahead ${r}`:`behind ${s}`}function S2({roundState:t,task:r}){var g;const[s,l]=ee.useState(()=>Date.now()),d=!!(t!=null&&t.startedAt),m=Nv(r.createdAt,s),f=Zg(t,(t==null?void 0:t.totalCcActiveMs)??0,s),o=d&&t?Zg(t,t.currentRoundCcActiveMs,s):0,c=d&&t?b2(t,s):0,u=((g=r.title)==null?void 0:g.trim())||r.taskSlug;return ee.useEffect(()=>{const h=window.setInterval(()=>l(Date.now()),1e3);return()=>window.clearInterval(h)},[]),C.jsxs("section",{className:"task-status-dock","aria-label":"VCM Session status",children:[C.jsxs("div",{className:"task-status-dock-title",children:[C.jsx("strong",{title:u,children:u}),C.jsx("span",{className:`status-badge status-${r.status}`,children:r.status})]}),C.jsxs("dl",{className:"task-status-stats",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Session start"}),C.jsx("dd",{children:Hh(r.createdAt)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Session total"}),C.jsx("dd",{children:Ro(m)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Rounds"}),C.jsx("dd",{children:(t==null?void 0:t.totalRoundCount)??0})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Role runtime"}),C.jsx("dd",{children:Ro(f)})]})]}),d&&t?C.jsxs("div",{className:"current-round-status",children:[C.jsxs("div",{className:"current-round-title",children:[C.jsx("span",{children:t.status==="running"?"Current Round":"Last Round"}),C.jsx("span",{className:`status-badge status-${t.status}`,children:t.status})]}),C.jsxs("dl",{className:"task-status-stats",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Started"}),C.jsx("dd",{children:Hh(t.startedAt)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Total"}),C.jsx("dd",{children:Ro(c)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Role runtime"}),C.jsx("dd",{children:Ro(o)})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Turn count"}),C.jsx("dd",{children:t.turnCount})]})]})]}):null]})}function Zg(t,r,s){if(!(t!=null&&t.activeTurnStartedAt)||t.status!=="running")return r;const l=Date.parse(t.updatedAt);return Number.isFinite(l)?r+Math.max(0,s-l):r}function b2(t,r){const s=t.status==="running"?r:Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return Nv(t.startedAt??"",Number.isFinite(s)?s:r)}function Nv(t,r){const s=Date.parse(t);return Number.isFinite(s)?Math.max(0,r-s):0}function Hh(t){if(!t)return"-";const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}).format(r)}function Ro(t){const r=Math.max(0,Math.floor(t/1e3)),s=Math.floor(r/3600),l=Math.floor(r%3600/60),d=r%60;return s>0?l>0?`${s}h ${l}m`:`${s}h`:l>0?d>0?`${l}m ${d}s`:`${l}m`:`${d}s`}function C2(t){return t==="system"?"light":t==="light"?"dark":"system"}function e_(t){return t==="system"?"System":t==="light"?"Light":"Dark"}function w2({events:t,onClose:r}){return C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{className:"event-modal",role:"dialog","aria-modal":"true","aria-label":"Events",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Events"}),C.jsxs("p",{className:"muted",children:[t.length," total"]})]}),C.jsx("button",{type:"button",onClick:r,children:"Close"})]}),C.jsx(Kk,{events:t,maxEvents:null,showHeader:!1})]})})}function x2({busy:t,messages:r,orchestration:s,onClose:l,onMarkAllDone:d,onDeleteMessageHistory:m}){const f=af(r);function o(){window.confirm(["Clear all pending route-file messages?","","Use this only after you manually copied or handled stuck route-file messages.","VCM will clear non-empty handoff message files so Stop-hook orchestration can continue."].join(`
94
94
  `))&&d()}function c(){window.confirm([`Delete ${f.total} message histor${f.total===1?"y item":"y items"}?`,"","This removes message history from the Messages panel.","Pending route-file messages are not touched."].join(`
95
- `))&&m()}return C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Messages"}),C.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),C.jsxs("div",{className:"modal-actions",children:[C.jsx("button",{type:"button",disabled:t,onClick:o,children:"Mark All Done"}),C.jsx("button",{type:"button",disabled:t||f.total===0,onClick:c,children:"Delete All"}),C.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),C.jsx(Zk,{busy:t,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Kr({children:t,onOpenChange:r,open:s,title:l}){return C.jsxs("section",{className:"sidebar-section",children:[C.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[C.jsx("span",{children:l}),C.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?C.jsx("div",{className:"sidebar-section-content",children:t}):null]})}function Hv(t,r){return t.find(s=>s.role===r)}function k2({activeRole:t,roles:r=Uo,sessions:s,onSelect:l}){return C.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const m=Hv(s,d.name),f=(m==null?void 0:m.status)==="running"?m.activityStatus??"idle":(m==null?void 0:m.status)??"not_started";return C.jsxs("button",{className:d.name===t?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===t,onClick:()=>l(d.name),children:[C.jsx("span",{children:d.label}),C.jsx(jn,{status:f})]},d.name)})})}function A2({warning:t,busy:r,onIgnore:s,onRecover:l}){var m;const d=((m=Jr.find(f=>f.name===t.role))==null?void 0:m.label)??t.role;return C.jsx("div",{className:"modal-backdrop role-stall-warning-backdrop",children:C.jsxs("section",{className:"role-stall-warning-modal",role:"dialog","aria-modal":"true","aria-label":"Role stall warning",children:[C.jsxs("header",{children:[C.jsx("p",{className:"role-stall-warning-kicker",children:"Possible stalled response"}),C.jsxs("h2",{children:[d," may be stalled"]})]}),C.jsxs("p",{children:["VCM has not received the expected Claude Code progress hook since ",t_(t.phaseStartedAt),". The task flow has not been changed or interrupted."]}),C.jsxs("dl",{children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Phase"}),C.jsx("dd",{children:T2(t.phase)})]}),t.toolName?C.jsxs("div",{children:[C.jsx("dt",{children:"Tool"}),C.jsx("dd",{children:t.toolName})]}):null,C.jsxs("div",{children:[C.jsx("dt",{children:"Detected"}),C.jsx("dd",{children:t_(t.detectedAt)})]})]}),C.jsxs("footer",{children:[C.jsx("button",{type:"button",className:"secondary",disabled:r,onClick:s,children:"Ignore"}),C.jsx("button",{type:"button",disabled:r,onClick:l,children:r?"Recovering...":"Recover"})]})]})})}function T2(t){return t.split("-").map(r=>{var s;return`${((s=r[0])==null?void 0:s.toUpperCase())??""}${r.slice(1)}`}).join(" ")}function t_(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}function R2({role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m,active:f=!0,busy:o,translationEnabled:c,translationAutoSendEnabled:u,translationTargetLanguage:g,translationPanelState:h,onClearTranslationSession:S,onTranslationEntry:w,onTranslationFailures:T,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:v,onResume:b,onStop:E,onRestart:O,onNotifyHarnessUpdated:R,onTerminalEvent:D}){const A=aS(t)&&c&&(r==null?void 0:r.status)==="running";return C.jsx("section",{className:"session-console",children:C.jsxs("div",{className:A?"session-console-body has-translation":"session-console-body",children:[C.jsxs("div",{className:"terminal-pane",children:[C.jsx(Uh,{role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m,busy:o,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:v,onResume:b,onStop:E,onRestart:O,onNotifyHarnessUpdated:R}),(r==null?void 0:r.status)==="running"?C.jsx(Po,{sessionId:r.id,active:f,onEvent:D},r.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:t}),C.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),A?C.jsx("div",{className:"translation-pane",children:C.jsx(bk,{active:f,autoSendEnabled:u,targetLanguage:g,taskSlug:r.taskSlug,role:t,sessionId:r.id,panelState:h??{role:t,status:"ready",entries:[],failures:[]},onClearSession:S??(()=>{}),onEntry:w??(()=>{}),onFailures:T??(()=>{})},`${t}:${r.id}`)}):null]})})}const Sh=500;function zh(t){return{taskSlug:t,cursor:1,sessions:{}}}function D2(t,r,s){return t.sessions[r]??Ks(s)}function M2(t,r){const l={...j2(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Ks(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const m=l[d.sessionId]??Ks(d.role);if(d.event.type==="status")l[d.sessionId]={...m,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...m,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Iv(zv(m.entries,d.event.entry));l[d.sessionId]={...m,role:d.role,entries:f.entries,failures:f.removedIds.size>0?m.failures.filter(o=>!f.removedIds.has(o.translationId)):m.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function L2(t,r,s){return{...t,sessions:{...t.sessions,[r]:Ks(s)}}}function O2(t,r,s,l){const d=t.sessions[r]??Ks(s),m=Iv(zv(d.entries,l));return{...t,sessions:{...t.sessions,[r]:{...d,role:s,entries:m.entries,failures:m.removedIds.size>0?d.failures.filter(f=>!m.removedIds.has(f.translationId)):d.failures}}}}function B2(t,r,s,l){const d=t.sessions[r]??Ks(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function j2(t,r){return t.taskSlug===r?t:zh(r)}function Ks(t){return{role:t,status:"ready",entries:[],failures:[]}}function zv(t,r){return t.findIndex(l=>l.id===r.id)===-1?[...t,r]:t.map(l=>l.id===r.id?r:l)}function Iv(t){if(t.length<=Sh)return{entries:t,removedIds:new Set};const r=t.slice(0,t.length-Sh);return{entries:t.slice(-Sh),removedIds:new Set(r.map(s=>s.id))}}const N2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions",reviewer:"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},H2={"project-manager":"default",architect:"default",coder:"default",tester:"default",reviewer:"default",translator:"default","harness-engineer":"default"},z2={"project-manager":"default",architect:"default",coder:"default",tester:"default",reviewer:"default",translator:"medium","harness-engineer":"medium"};function I2({task:t,activeRole:r,reviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,launchTemplate:f,modelOptions:o,refreshNonce:c=0,onTaskChanged:u,onActiveRoleChange:g,onMessagesChanged:h,onOrchestrationChanged:S,onRoundStateChanged:w,onEventsChanged:T,onLaunchStateChanged:k}){const[y,_]=ee.useState(null),[v,b]=ee.useState(()=>i_(f)),[E,O]=ee.useState(()=>r_(f)),[R,D]=ee.useState(()=>s_(f)),[A,M]=ee.useState(!1),[,L]=Ii(""),[H,U]=ee.useState([]),[P,W]=ee.useState(null),[K,V]=ee.useState(null),[Y,te]=ee.useState(null),[z,j]=ee.useState(null),[N,q]=ee.useState(!1),[I,ie]=ee.useState(()=>zh(t.taskSlug)),pe=ee.useRef(""),ge=ee.useRef(1),Q=ee.useMemo(()=>JSON.stringify(f),[f]),$=!!(y!=null&&y.sessions.some(re=>re.role==="reviewer")),he=s||$,le=[...sl,...he?[d_]:[]],xe=ee.useCallback((re,ve)=>{W(ve),h==null||h(re),S==null||S(ve)},[h,S]),Ce=ee.useCallback((re,ve,ke,nt,ot)=>{_(re),V(ot),xe(ve,ke),w==null||w(nt)},[xe,w]),Le=ee.useCallback(async()=>{const re=await ye.getTaskWorkspaceState(t.taskSlug);te(re.architectRestart),j(re.roleStallWarning),Ce(re.taskStatus,re.messages,re.orchestration,re.roundState,re.workflowState),zo("Poll task workspace state"),L(ve=>Lo(ve,["Load task workspace state","Poll task workspace state"]))},[Ce,t.taskSlug]),Ie=ee.useCallback((re,ve)=>{const ke=Ov(re,ve);ke&&L(ke)},[]);ol(`task-workspace:${t.taskSlug}:${c}`,()=>Le().catch(re=>{Ie("Poll task workspace state",re)}),{intervalMs:3e3,runImmediately:!0}),ol(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const re=await ye.pollTranslationTaskFeed(t.taskSlug,ge.current);ge.current=re.nextCursor,ie(ve=>M2(ve,re)),zo("Poll task translation feed"),L(ve=>Lo(ve,["Poll task translation feed"]))}catch(re){Ie("Poll task translation feed",re)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{U([]),V(null),j(null),T==null||T([])},[T,t.taskSlug]),ee.useEffect(()=>{ge.current=1,ie(zh(t.taskSlug))},[t.taskSlug]),ee.useEffect(()=>{b(i_(f)),O(r_(f)),D(s_(f))},[Q,t.taskSlug]),ee.useEffect(()=>{y&&!he&&r==="reviewer"&&g("project-manager"),y&&r==="translator"&&g("project-manager")},[r,he,g,y]),ee.useEffect(()=>{const re=y==null?void 0:y.task;if(!re||re.taskSlug!==t.taskSlug)return;const ve=n_(re);if(ve===n_(t)){pe.current="";return}pe.current!==ve&&(pe.current=ve,u().catch(ke=>{pe.current="",L(lt("Refresh task list after task status changed",ke))}))},[u,y==null?void 0:y.task,t]),ee.useEffect(()=>{const re=(y==null?void 0:y.sessions)??[],ve=re.filter(ce=>U2(ce.role)),ke=new Set(ve.map(ce=>ce.role)),nt=re.some(ce=>ce.role==="reviewer"),ot={};for(const ce of Jr)ot[ce.name]={permissionMode:v[ce.name],model:E[ce.name],effort:R[ce.name]};k==null||k({taskSlug:t.taskSlug,roles:ot,autoOrchestration:((P==null?void 0:P.mode)??"auto")==="auto",statusLoaded:!!y,sessionCount:ve.length,hasAnySession:ve.length>0,hasReviewerSession:nt,allRolesHaveSession:sl.every(ce=>ke.has(ce.name))})},[E,R,k,P==null?void 0:P.mode,v,y,t.taskSlug]);async function He(re,ve="Run role session action"){M(!0),L("");try{await re(),await Le(),await u()}catch(ke){L(lt(ve,ke))}finally{M(!1)}}function $e(re){U(ve=>{const ke=[...ve,`${new Date().toLocaleTimeString()} ${re}`];return T==null||T(ke),ke})}async function De(re){const ve=z;if(!(!ve||N)){q(!0);try{const ke=re==="recover"?await ye.recoverRoleStallWarning(t.taskSlug,ve.id):await ye.ignoreRoleStallWarning(t.taskSlug,ve.id);j(ke.warning),L(""),await Le()}catch(ke){L(lt(`${re==="recover"?"Recover":"Ignore"} stalled role`,ke))}finally{q(!1)}}}function Ct(re,ve){b(ke=>({...ke,[re]:ve}))}function Rt(re,ve){O(ke=>({...ke,[re]:ve}))}function jt(re,ve){D(ke=>({...ke,[re]:ve}))}return C.jsxs("div",{className:"task-workspace",children:[C.jsxs("header",{className:"workspace-header",children:[C.jsxs("div",{className:"workspace-title-line",children:[C.jsx("h1",{children:t.title||t.taskSlug}),K!=null&&K.declared?C.jsxs("div",{className:"workspace-workflow-state",title:[K.declared.branch?`Branch: ${K.declared.branch}`:"",K.declared.resumePoint?`Resume: ${K.declared.resumePoint}`:"",K.declared.status?`Status: ${K.declared.status}`:""].filter(Boolean).join(" | "),children:[C.jsx("span",{children:K.declared.flow??"Workflow"}),K.declared.step?C.jsx("strong",{children:K.declared.step}):null]}):null]}),C.jsx(k2,{activeRole:r,roles:le,sessions:(y==null?void 0:y.sessions)??[],onSelect:g})]}),(Y==null?void 0:Y.status)==="blocked"&&Y.blocker?C.jsxs("div",{className:"workspace-runtime-warning",role:"alert",children:[C.jsx("strong",{children:"Architect restart blocked"}),C.jsx("span",{children:Y.blocker.message}),C.jsx("code",{children:Y.blocker.code})]}):null,z?C.jsx(A2,{warning:z,busy:N,onIgnore:()=>void De("ignore"),onRecover:()=>void De("recover")}):null,C.jsx("div",{className:"workspace-grid",children:C.jsx("div",{className:"workspace-main",children:C.jsx("div",{className:"role-console-stack",children:le.map(re=>{const ve=re.name,ke=ve===r,nt=(y==null?void 0:y.sessions)??[],ot=Hv(nt,ve),ce=ot?D2(I,ot.id,ve):void 0;return C.jsx("div",{className:ke?"role-console-panel is-active":"role-console-panel","aria-hidden":!ke,children:C.jsx(R2,{role:ve,session:ot,permissionMode:v[ve],model:E[ve],effort:R[ve],modelOptions:o,active:ke,busy:A,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,translationPanelState:ce,onClearTranslationSession:(Se,Ee)=>{ie(Oe=>L2(Oe,Se,Ee))},onTranslationEntry:(Se,Ee,Oe)=>{ie(Ne=>O2(Ne,Se,Ee,Oe))},onTranslationFailures:(Se,Ee,Oe)=>{ie(Ne=>B2(Ne,Se,Ee,Oe))},onPermissionModeChange:Se=>Ct(ve,Se),onModelChange:Se=>Rt(ve,Se),onEffortChange:Se=>jt(ve,Se),onStart:()=>void He(async()=>{await ye.startRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`started ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Start ${ve} session`),onResume:()=>void He(async()=>{await ye.resumeRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`resumed ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Resume ${ve} session`),onStop:()=>void He(async()=>{await ye.stopRoleSession(t.taskSlug,ve),$e(`stopped ${ve}`)},`Stop ${ve} session`),onRestart:()=>void He(async()=>{await ye.restartRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`restarted ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Restart ${ve} session`),onNotifyHarnessUpdated:()=>void He(async()=>{await ye.notifyRoleHarnessUpdated(t.taskSlug,ve),$e(`notified ${ve} to reload latest harness`)},`Notify ${ve} to reload harness`),onTerminalEvent:Se=>$e(`${re.label}: ${Se}`)})},ve)})})})})]})}function U2(t){return sl.some(r=>r.name===t)}function n_(t){return[t.status,t.updatedAt,t.cleanupStatus??"",t.cleanedAt??""].join(":")}function i_(t){var s;const r={...N2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function r_(t){var s;const r={...H2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function s_(t){var s;const r={...z2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const P2=1400;function F2(t){return!!(t!=null&&t.initialized)}function q2(){const[t,r]=ee.useState(null),[s,l]=ee.useState([]),[d,m]=ee.useState(null),[f,o]=ee.useState(null),[c,u]=ee.useState(null),[g,h]=ee.useState(null),[S,w]=ee.useState(null),[T,k]=ee.useState(null),[y,_]=ee.useState(null),[v,b]=ee.useState(null),[E,O]=ee.useState(null),[R,D]=ee.useState(null),[A,M]=ee.useState(null),[L,H]=ee.useState(null),[U,P]=ee.useState(!1),[W,K]=ee.useState(null),[V,Y]=ee.useState(null),[te,z]=ee.useState(!1),[j,N]=ee.useState([]),[q,I]=ee.useState(null),[ie,pe]=ee.useState(null),[ge,Q]=ee.useState(null),[$,he]=ee.useState(null),[le,xe]=ee.useState(null),[Ce,Le]=ee.useState(null),[Ie,He]=ee.useState("project-manager"),[$e,De]=ee.useState("system"),[Ct,Rt]=ee.useState(!0),[jt,re]=ee.useState(!0),[ve,ke]=ee.useState("off"),[nt,ot]=ee.useState(!1),[ce,Se]=ee.useState(!1),[Ee,Oe]=ee.useState(!1),[Ne,yt]=ee.useState(!1),[Pe,wt]=ee.useState(oS),[bt,Nt]=ee.useState(cS),[it,Wt]=ee.useState(!1),[rn,Cr]=ee.useState(!1),[mi,gi]=ee.useState(!1),[Pi,zn]=ee.useState(!1),[Fi,Jn]=ee.useState(!1),[si,sn]=ee.useState(null),[ai,In]=ee.useState("bypassPermissions"),[qi,_i]=ee.useState("default"),[vi,yi]=ee.useState("medium"),[wn,Pt]=ee.useState(null),[li,hn]=ee.useState("bypassPermissions"),[Kt,mt]=ee.useState("default"),[ct,Ht]=ee.useState("medium"),[$i,Ge]=ee.useState(()=>hS()),[Un,dl]=ee.useState(null),[wr,es]=ee.useState(0),[xn,Si]=ee.useState(null),[xr,Gi]=ee.useState(null),[kt,pl]=ee.useState(!1),[Vi,oi]=ee.useState(!1),[,fn]=Ii(""),ml=ee.useRef({}),ts=ee.useRef({}),Qs=ee.useRef({}),gl=ee.useRef({}),Er=ee.useRef({}),bi=ee.useRef(null),Pn=ee.useRef({initialized:!1,messageId:null}),Yt=ee.useRef(""),Z=ee.useMemo(()=>Ik(j,q),[j,q]),dn=(Un==null?void 0:Un.taskSlug)===(Z==null?void 0:Z.taskSlug)?Un:null,kr=c===(Z==null?void 0:Z.taskSlug)?d:null,Js=g===(Z==null?void 0:Z.taskSlug)?f:null,ns=v===(Z==null?void 0:Z.taskSlug)?y:null,Wo=!!(t&&Z&&F2(kr)),pn=(si==null?void 0:si.status)==="running",is=!!(Ee&&Wo&&pn),_l=!!(dn!=null&&dn.statusLoaded),Zs=!!(Z&&(dn!=null&&dn.statusLoaded)&&!dn.hasAnySession),Zn=(R==null?void 0:R.modelOptions)??v_(),Ft=ee.useCallback((G,fe={})=>{De(G.themeMode),Rt(G.flowPauseAlerts),re(G.roleRetryEnabled),ke(G.permissionRequestMode),ot(G.autoTaskHarnessReviewEnabled),Se(G.autoMemoryEnabled),Oe(G.translationEnabled),yt(G.translationAutoSendEnabled),wt(G.translationTargetLanguage),Nt(G.translationOutputMode),Ge(G.launchTemplate),fe.syncToolLaunchOptions&&(In(G.toolSessionDefaults.translator.permissionMode),_i(G.toolSessionDefaults.translator.model),yi(G.toolSessionDefaults.translator.effort),hn(G.toolSessionDefaults["harness-engineer"].permissionMode),mt(G.toolSessionDefaults["harness-engineer"].model),Ht(G.toolSessionDefaults["harness-engineer"].effort))},[]);ee.useEffect(()=>{if(!Ct)return;let G=!1;const fe=()=>{G||(G=!0,a_(),window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe))};return window.addEventListener("pointerdown",fe),window.addEventListener("keydown",fe),()=>{window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe)}},[Ct]);const Fn=ee.useCallback(()=>{bi.current!==null&&(window.clearInterval(bi.current),bi.current=null)},[]),Ci=ee.useCallback(()=>{Fn(),l_(),bi.current=window.setInterval(()=>{l_()},P2)},[Fn]),vl=ee.useCallback((G,fe=`manual-${Date.now()}`)=>{Si({id:fe,text:G})},[]),rs=ee.useCallback(()=>{Fn(),Si(null)},[Fn]);ee.useEffect(()=>{Z!=null&&Z.taskSlug&&(Er.current[Z.taskSlug]=Date.now())},[Z==null?void 0:Z.taskSlug]);const yl=ee.useCallback(G=>{Z!=null&&Z.taskSlug&&pe({taskSlug:Z.taskSlug,messages:G})},[Z==null?void 0:Z.taskSlug]),ea=ee.useCallback(G=>{Qs.current[G.taskSlug]=G.mode,Z!=null&&Z.taskSlug&&Q({taskSlug:Z.taskSlug,orchestration:G})},[Z==null?void 0:Z.taskSlug]),Ko=ee.useCallback(G=>{Z!=null&&Z.taskSlug&&he({taskSlug:Z.taskSlug,events:G})},[Z==null?void 0:Z.taskSlug]),Yo=ee.useCallback(G=>{if(!(Z!=null&&Z.taskSlug)||G.taskSlug!==Z.taskSlug)return;xe({taskSlug:G.taskSlug,roundState:G});const fe=Uk({mode:Qs.current[G.taskSlug],status:G.status,activeRole:G.activeRole,lastFollowedRole:gl.current[G.taskSlug]});fe&&(gl.current[G.taskSlug]=fe,He(fe));const Ye=Pk(G,Y2);if(Ye===null){ts.current[G.taskSlug]={status:G.status};return}const on=Fk(G),wi=ml.current[G.taskSlug],Jo=ts.current[G.taskSlug];ts.current[G.taskSlug]={status:G.status},wi!==on&&(ml.current[G.taskSlug]=on,V2(G,Jo,Er.current[G.taskSlug])&&vl(Ye,on))},[Z==null?void 0:Z.taskSlug,vl]),ss=ee.useCallback(G=>{dl(fe=>(fe==null?void 0:fe.taskSlug)===G.taskSlug&&fe.statusLoaded===G.statusLoaded&&fe.sessionCount===G.sessionCount&&fe.hasAnySession===G.hasAnySession&&fe.hasReviewerSession===G.hasReviewerSession&&fe.allRolesHaveSession===G.allRolesHaveSession&&fe.autoOrchestration===G.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(G.roles)?fe:G)},[]);async function Xt(){const G=await ye.listTasks();return N(G),I(fe=>{var Ye;return fe&&G.some(on=>on.taskSlug===fe)?fe:((Ye=G[0])==null?void 0:Ye.taskSlug)??null}),G}async function Ar(G=Z==null?void 0:Z.taskSlug){if(!G)return m(null),u(null),null;const fe=await ye.getHarnessStatus(G);return m(fe),u(G),fe}async function Tr(G=Z==null?void 0:Z.taskSlug){if(!G)return o(null),h(null),null;const fe=await ye.getHarnessBootstrapStatus(G);return o(fe),h(G),fe}async function En(){const G=await ye.getGatewayStatus();return O(G),G}async function Wi(){const G=await ye.getRecentRepositoryPaths();return l(G),G}async function ta(){if(!t)return Wt(!1),!1;const G=await ye.getTranslationState();return Wt(G.memoryInitialized),G.memoryInitialized}async function Rr(G){const[fe,Ye]=await Promise.all([ye.listMessages(G),ye.getOrchestrationState(G)]);pe({taskSlug:G,messages:fe}),Q({taskSlug:G,orchestration:Ye})}async function na(G){const fe=await ye.getGateReviewState(G);return Le({taskSlug:G,state:fe}),zo("Poll Gate Review state"),fn(Ye=>Lo(Ye,["Refresh Gate Review state","Poll Gate Review state"])),fe}function Ki(G,fe){const Ye=Ov(G,fe);Ye&&fn(Ye)}function Qt(G){G&&(In(G.permissionMode),G.model&&_i(G.model),G.effort&&yi(G.effort))}async function as(G={}){const fe=await ye.getTranslatorSession((Z==null?void 0:Z.taskSlug)??null);return sn(fe),G.syncLaunchOptions&&Qt(fe),fe}function kn(G){G&&(hn(G.permissionMode),G.model&&mt(G.model),G.effort&&Ht(G.effort))}async function an(G={}){const fe=await ye.getHarnessEngineerSession((Z==null?void 0:Z.taskSlug)??null);return Pt(fe),G.syncLaunchOptions&&kn(fe),fe}async function ia(G=Z==null?void 0:Z.taskSlug){if(!t)return k(null),null;const fe=await ye.getHarnessFeedbackState(G);return k(fe),fe}function ls(G,fe,Ye={}){var on;sn(G.translatorSession),Wt(!!((on=G.translationState)!=null&&on.memoryInitialized)),Pt(G.harnessEngineerSession),k(G.harnessFeedbackState),_(G.autoMemoryState),b(fe&&G.autoMemoryState?fe:null),O(G.gatewayStatus),fe&&G.harnessStatus?(m(G.harnessStatus),u(fe)):(m(null),u(null)),fe&&G.harnessBootstrapStatus?(o(G.harnessBootstrapStatus),h(fe)):(o(null),h(null)),Ye.syncLaunchOptions&&(Qt(G.translatorSession),kn(G.harnessEngineerSession))}async function ra(G={}){if(!t)return sn(null),Wt(!1),Pt(null),m(null),o(null),u(null),h(null),k(null),_(null),b(null),null;const fe=(Z==null?void 0:Z.taskSlug)??null,Ye=await ye.getProjectRuntimeState(fe);return ls(Ye,fe,G),Ye}function os(){const G=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const fe of G)zo(fe);fn(fe=>Lo(fe,G))}ee.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus(),ye.getCcrIntegrationStatus()]).then(async([G,fe,Ye,on,wi])=>{r(G),l(fe),O(on),D(wi),Ft(Ye,{syncToolLaunchOptions:!0}),G&&await Xt()}).catch(G=>fn(lt("Load initial app data",G)))},[Ft]),ee.useEffect(()=>{const G=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>pl(G.matches);return fe(),G.addEventListener("change",fe),()=>G.removeEventListener("change",fe)},[]),ee.useEffect(()=>()=>Fn(),[Fn]),ee.useEffect(()=>{(E==null?void 0:E.pauseAlertSoundEnabled)!==void 0&&Rt(E.pauseAlertSoundEnabled);const G=$k(Pn.current,E);Pn.current=G.observation,G.dismissPauseAlert&&rs()},[rs,E]),ee.useEffect(()=>{if(xn&&qk(Ct)==="strong")return Ci(),Fn;Fn()},[xn==null?void 0:xn.id,Ct,Ci,Fn]),ee.useEffect(()=>{const G=$e==="system"?kt?"dark":"light":$e;document.documentElement.dataset.theme=G,document.documentElement.dataset.themeMode=$e},[kt,$e]),ee.useEffect(()=>{if(!(Z!=null&&Z.taskSlug)){Le(null);return}na(Z.taskSlug).catch(G=>fn(lt("Refresh Gate Review state",G)))},[Z==null?void 0:Z.taskSlug]),ee.useEffect(()=>{Yt.current="",sn(null),Wt(!1),Pt(null),m(null),o(null),u(null),h(null),k(null)},[t==null?void 0:t.repoRoot,Z==null?void 0:Z.taskSlug]),ol(t?`project-runtime:${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:null,async()=>{try{const G=t?`${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:"",fe=!!(t&&Yt.current!==G);await ra({syncLaunchOptions:fe}),fe&&(Yt.current=G),os()}catch(G){Ki("Poll project runtime state",G)}},{intervalMs:3e3,runImmediately:!0});const Jt=(Z==null?void 0:Z.taskSlug)??null,cs=Jt&&(Ce==null?void 0:Ce.taskSlug)===Jt?Ce.state:null,It=Jt&&(le==null?void 0:le.taskSlug)===Jt?le.roundState:null,ei=Jt&&(Un==null?void 0:Un.taskSlug)===Jt?Un:null,us=!!(Jt&&(cs!=null&&cs.activeGate||(It==null?void 0:It.activeRole)==="reviewer"||ei!=null&&ei.hasReviewerSession));ol(us&&Jt?`gate-review:${Jt}`:null,async()=>{if(Jt)try{await na(Jt)}catch(G){Ki("Poll Gate Review state",G)}},{intervalMs:3e3,runImmediately:!1});async function Te(G,fe="Run UI action"){oi(!0),fn("");try{await G()}catch(Ye){fn(lt(fe,Ye))}finally{oi(!1)}}async function Xo(){var on;if(!Z)throw new Error("Create or select a task before closing it.");const G=[`Close task "${Z.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- stops Translator and Harness Engineer sessions for this task",`- deletes the task worktree: ${Z.worktreePath}`,`- deletes the Git branch: ${Z.branch}`,"- deletes VCM task/session/message/orchestration state","","The task will close even if a cleanup step fails; cleanup issues are reported as warnings."].join(`
95
+ `))&&m()}return C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{className:"message-modal",role:"dialog","aria-modal":"true","aria-label":"Messages",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{children:"Messages"}),C.jsxs("p",{className:"muted",children:[f.total," total / ",f.accepted," accepted",s?` · ${s.mode}`:""]})]}),C.jsxs("div",{className:"modal-actions",children:[C.jsx("button",{type:"button",disabled:t,onClick:o,children:"Mark All Done"}),C.jsx("button",{type:"button",disabled:t||f.total===0,onClick:c,children:"Delete All"}),C.jsx("button",{type:"button",onClick:l,children:"Close"})]})]}),C.jsx(Jk,{busy:t,maxMessages:null,messages:r,orchestration:s,showControls:!1,showHeader:!1})]})})}function Kr({children:t,onOpenChange:r,open:s,title:l}){return C.jsxs("section",{className:"sidebar-section",children:[C.jsxs("button",{"aria-expanded":s,className:"sidebar-section-toggle",type:"button",onClick:()=>{r==null||r(!s)},children:[C.jsx("span",{children:l}),C.jsx("span",{"aria-hidden":"true",className:"sidebar-section-chevron"})]}),s?C.jsx("div",{className:"sidebar-section-content",children:t}):null]})}function Hv(t,r){return t.find(s=>s.role===r)}function E2({activeRole:t,roles:r=Uo,sessions:s,onSelect:l}){return C.jsx("div",{className:"role-tabs",role:"tablist","aria-label":"Role sessions",children:r.map(d=>{const m=Hv(s,d.name),f=(m==null?void 0:m.status)==="running"?m.activityStatus??"idle":(m==null?void 0:m.status)??"not_started";return C.jsxs("button",{className:d.name===t?"role-tab is-active":"role-tab",type:"button",role:"tab","aria-selected":d.name===t,onClick:()=>l(d.name),children:[C.jsx("span",{children:d.label}),C.jsx(jn,{status:f})]},d.name)})})}function k2({warning:t,busy:r,onIgnore:s,onRecover:l}){var m;const d=((m=Jr.find(f=>f.name===t.role))==null?void 0:m.label)??t.role;return C.jsx("div",{className:"modal-backdrop role-stall-warning-backdrop",children:C.jsxs("section",{className:"role-stall-warning-modal",role:"dialog","aria-modal":"true","aria-label":"Role stall warning",children:[C.jsxs("header",{children:[C.jsx("p",{className:"role-stall-warning-kicker",children:"Possible stalled response"}),C.jsxs("h2",{children:[d," may be stalled"]})]}),C.jsxs("p",{children:["VCM has not received the expected Claude Code progress hook since ",t_(t.phaseStartedAt),". The task flow has not been changed or interrupted."]}),C.jsxs("dl",{children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Phase"}),C.jsx("dd",{children:A2(t.phase)})]}),t.toolName?C.jsxs("div",{children:[C.jsx("dt",{children:"Tool"}),C.jsx("dd",{children:t.toolName})]}):null,C.jsxs("div",{children:[C.jsx("dt",{children:"Detected"}),C.jsx("dd",{children:t_(t.detectedAt)})]})]}),C.jsxs("footer",{children:[C.jsx("button",{type:"button",className:"secondary",disabled:r,onClick:s,children:"Ignore"}),C.jsx("button",{type:"button",disabled:r,onClick:l,children:r?"Recovering...":"Recover"})]})]})})}function A2(t){return t.split("-").map(r=>{var s;return`${((s=r[0])==null?void 0:s.toUpperCase())??""}${r.slice(1)}`}).join(" ")}function t_(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:r.toLocaleTimeString()}function T2({role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m,active:f=!0,busy:o,translationEnabled:c,translationAutoSendEnabled:u,translationTargetLanguage:g,translationPanelState:h,onClearTranslationSession:S,onTranslationEntry:w,onTranslationFailures:T,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:v,onResume:b,onStop:E,onRestart:O,onNotifyHarnessUpdated:R,onTerminalEvent:D}){const A=aS(t)&&c&&(r==null?void 0:r.status)==="running";return C.jsx("section",{className:"session-console",children:C.jsxs("div",{className:A?"session-console-body has-translation":"session-console-body",children:[C.jsxs("div",{className:"terminal-pane",children:[C.jsx(Uh,{role:t,session:r,permissionMode:s,model:l,effort:d,modelOptions:m,busy:o,onPermissionModeChange:k,onModelChange:y,onEffortChange:_,onStart:v,onResume:b,onStop:E,onRestart:O,onNotifyHarnessUpdated:R}),(r==null?void 0:r.status)==="running"?C.jsx(Po,{sessionId:r.id,active:f,onEvent:D},r.id):C.jsxs("div",{className:"terminal-empty",children:[C.jsx("strong",{children:t}),C.jsx("span",{children:r!=null&&r.claudeSessionId?"Resume this role to reconnect its Claude Code conversation.":"Start this role to open an embedded Claude Code terminal."})]})]}),A?C.jsx("div",{className:"translation-pane",children:C.jsx(Sk,{active:f,autoSendEnabled:u,targetLanguage:g,taskSlug:r.taskSlug,role:t,sessionId:r.id,panelState:h??{role:t,status:"ready",entries:[],failures:[]},onClearSession:S??(()=>{}),onEntry:w??(()=>{}),onFailures:T??(()=>{})},`${t}:${r.id}`)}):null]})})}const Sh=500;function zh(t){return{taskSlug:t,cursor:1,sessions:{}}}function R2(t,r,s){return t.sessions[r]??Ks(s)}function D2(t,r){const l={...B2(t,r.taskSlug).sessions};for(const d of r.sessions)l[d.sessionId]={...Ks(d.role),...l[d.sessionId],role:d.role,status:d.status};for(const d of r.events){const m=l[d.sessionId]??Ks(d.role);if(d.event.type==="status")l[d.sessionId]={...m,role:d.role,status:d.event.status};else if(d.event.type==="failures")l[d.sessionId]={...m,role:d.role,failures:d.event.failures};else if(d.event.type==="entry"){const f=Iv(zv(m.entries,d.event.entry));l[d.sessionId]={...m,role:d.role,entries:f.entries,failures:f.removedIds.size>0?m.failures.filter(o=>!f.removedIds.has(o.translationId)):m.failures}}}return{taskSlug:r.taskSlug,cursor:r.nextCursor,sessions:l}}function M2(t,r,s){return{...t,sessions:{...t.sessions,[r]:Ks(s)}}}function L2(t,r,s,l){const d=t.sessions[r]??Ks(s),m=Iv(zv(d.entries,l));return{...t,sessions:{...t.sessions,[r]:{...d,role:s,entries:m.entries,failures:m.removedIds.size>0?d.failures.filter(f=>!m.removedIds.has(f.translationId)):d.failures}}}}function O2(t,r,s,l){const d=t.sessions[r]??Ks(s);return{...t,sessions:{...t.sessions,[r]:{...d,role:s,failures:l}}}}function B2(t,r){return t.taskSlug===r?t:zh(r)}function Ks(t){return{role:t,status:"ready",entries:[],failures:[]}}function zv(t,r){return t.findIndex(l=>l.id===r.id)===-1?[...t,r]:t.map(l=>l.id===r.id?r:l)}function Iv(t){if(t.length<=Sh)return{entries:t,removedIds:new Set};const r=t.slice(0,t.length-Sh);return{entries:t.slice(-Sh),removedIds:new Set(r.map(s=>s.id))}}const j2={"project-manager":"bypassPermissions",architect:"bypassPermissions",coder:"bypassPermissions",tester:"bypassPermissions",reviewer:"bypassPermissions",translator:"bypassPermissions","harness-engineer":"bypassPermissions"},N2={"project-manager":"default",architect:"default",coder:"default",tester:"default",reviewer:"default",translator:"default","harness-engineer":"default"},H2={"project-manager":"default",architect:"default",coder:"default",tester:"default",reviewer:"default",translator:"medium","harness-engineer":"medium"};function z2({task:t,activeRole:r,reviewerEnabled:s,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,launchTemplate:f,modelOptions:o,refreshNonce:c=0,onTaskChanged:u,onActiveRoleChange:g,onMessagesChanged:h,onOrchestrationChanged:S,onRoundStateChanged:w,onEventsChanged:T,onLaunchStateChanged:k}){const[y,_]=ee.useState(null),[v,b]=ee.useState(()=>i_(f)),[E,O]=ee.useState(()=>r_(f)),[R,D]=ee.useState(()=>s_(f)),[A,M]=ee.useState(!1),[,L]=Ii(""),[H,U]=ee.useState([]),[P,W]=ee.useState(null),[K,V]=ee.useState(null),[Y,te]=ee.useState(null),[z,j]=ee.useState(null),[N,q]=ee.useState(!1),[I,ie]=ee.useState(()=>zh(t.taskSlug)),pe=ee.useRef(""),ge=ee.useRef(1),Q=ee.useMemo(()=>JSON.stringify(f),[f]),$=!!(y!=null&&y.sessions.some(re=>re.role==="reviewer")),he=s||$,le=[...sl,...he?[d_]:[]],xe=ee.useCallback((re,ve)=>{W(ve),h==null||h(re),S==null||S(ve)},[h,S]),Ce=ee.useCallback((re,ve,ke,nt,ot)=>{_(re),V(ot),xe(ve,ke),w==null||w(nt)},[xe,w]),Le=ee.useCallback(async()=>{const re=await ye.getTaskWorkspaceState(t.taskSlug);te(re.architectRestart),j(re.roleStallWarning),Ce(re.taskStatus,re.messages,re.orchestration,re.roundState,re.workflowState),zo("Poll task workspace state"),L(ve=>Lo(ve,["Load task workspace state","Poll task workspace state"]))},[Ce,t.taskSlug]),Ie=ee.useCallback((re,ve)=>{const ke=Ov(re,ve);ke&&L(ke)},[]);ol(`task-workspace:${t.taskSlug}:${c}`,()=>Le().catch(re=>{Ie("Poll task workspace state",re)}),{intervalMs:3e3,runImmediately:!0}),ol(l?`task-translation-feed:${t.taskSlug}`:null,async()=>{try{const re=await ye.pollTranslationTaskFeed(t.taskSlug,ge.current);ge.current=re.nextCursor,ie(ve=>D2(ve,re)),zo("Poll task translation feed"),L(ve=>Lo(ve,["Poll task translation feed"]))}catch(re){Ie("Poll task translation feed",re)}},{intervalMs:1e3,runImmediately:!0}),ee.useEffect(()=>{U([]),V(null),j(null),T==null||T([])},[T,t.taskSlug]),ee.useEffect(()=>{ge.current=1,ie(zh(t.taskSlug))},[t.taskSlug]),ee.useEffect(()=>{b(i_(f)),O(r_(f)),D(s_(f))},[Q,t.taskSlug]),ee.useEffect(()=>{y&&!he&&r==="reviewer"&&g("project-manager"),y&&r==="translator"&&g("project-manager")},[r,he,g,y]),ee.useEffect(()=>{const re=y==null?void 0:y.task;if(!re||re.taskSlug!==t.taskSlug)return;const ve=n_(re);if(ve===n_(t)){pe.current="";return}pe.current!==ve&&(pe.current=ve,u().catch(ke=>{pe.current="",L(lt("Refresh task list after task status changed",ke))}))},[u,y==null?void 0:y.task,t]),ee.useEffect(()=>{const re=(y==null?void 0:y.sessions)??[],ve=re.filter(ce=>I2(ce.role)),ke=new Set(ve.map(ce=>ce.role)),nt=re.some(ce=>ce.role==="reviewer"),ot={};for(const ce of Jr)ot[ce.name]={permissionMode:v[ce.name],model:E[ce.name],effort:R[ce.name]};k==null||k({taskSlug:t.taskSlug,roles:ot,autoOrchestration:((P==null?void 0:P.mode)??"auto")==="auto",statusLoaded:!!y,sessionCount:ve.length,hasAnySession:ve.length>0,hasReviewerSession:nt,allRolesHaveSession:sl.every(ce=>ke.has(ce.name))})},[E,R,k,P==null?void 0:P.mode,v,y,t.taskSlug]);async function He(re,ve="Run role session action"){M(!0),L("");try{await re(),await Le(),await u()}catch(ke){L(lt(ve,ke))}finally{M(!1)}}function $e(re){U(ve=>{const ke=[...ve,`${new Date().toLocaleTimeString()} ${re}`];return T==null||T(ke),ke})}async function De(re){const ve=z;if(!(!ve||N)){q(!0);try{const ke=re==="recover"?await ye.recoverRoleStallWarning(t.taskSlug,ve.id):await ye.ignoreRoleStallWarning(t.taskSlug,ve.id);j(ke.warning),L(""),await Le()}catch(ke){L(lt(`${re==="recover"?"Recover":"Ignore"} stalled role`,ke))}finally{q(!1)}}}function Ct(re,ve){b(ke=>({...ke,[re]:ve}))}function Rt(re,ve){O(ke=>({...ke,[re]:ve}))}function jt(re,ve){D(ke=>({...ke,[re]:ve}))}return C.jsxs("div",{className:"task-workspace",children:[C.jsxs("header",{className:"workspace-header",children:[C.jsxs("div",{className:"workspace-title-line",children:[C.jsx("h1",{children:t.title||t.taskSlug}),K!=null&&K.declared?C.jsxs("div",{className:"workspace-workflow-state",title:[K.declared.branch?`Branch: ${K.declared.branch}`:"",K.declared.resumePoint?`Resume: ${K.declared.resumePoint}`:"",K.declared.status?`Status: ${K.declared.status}`:""].filter(Boolean).join(" | "),children:[C.jsx("span",{children:K.declared.flow??"Workflow"}),K.declared.step?C.jsx("strong",{children:K.declared.step}):null]}):null]}),C.jsx(E2,{activeRole:r,roles:le,sessions:(y==null?void 0:y.sessions)??[],onSelect:g})]}),(Y==null?void 0:Y.status)==="blocked"&&Y.blocker?C.jsxs("div",{className:"workspace-runtime-warning",role:"alert",children:[C.jsx("strong",{children:"Architect restart blocked"}),C.jsx("span",{children:Y.blocker.message}),C.jsx("code",{children:Y.blocker.code})]}):null,z?C.jsx(k2,{warning:z,busy:N,onIgnore:()=>void De("ignore"),onRecover:()=>void De("recover")}):null,C.jsx("div",{className:"workspace-grid",children:C.jsx("div",{className:"workspace-main",children:C.jsx("div",{className:"role-console-stack",children:le.map(re=>{const ve=re.name,ke=ve===r,nt=(y==null?void 0:y.sessions)??[],ot=Hv(nt,ve),ce=ot?R2(I,ot.id,ve):void 0;return C.jsx("div",{className:ke?"role-console-panel is-active":"role-console-panel","aria-hidden":!ke,children:C.jsx(T2,{role:ve,session:ot,permissionMode:v[ve],model:E[ve],effort:R[ve],modelOptions:o,active:ke,busy:A,translationEnabled:l,translationAutoSendEnabled:d,translationTargetLanguage:m,translationPanelState:ce,onClearTranslationSession:(Se,Ee)=>{ie(Oe=>M2(Oe,Se,Ee))},onTranslationEntry:(Se,Ee,Oe)=>{ie(Ne=>L2(Ne,Se,Ee,Oe))},onTranslationFailures:(Se,Ee,Oe)=>{ie(Ne=>O2(Ne,Se,Ee,Oe))},onPermissionModeChange:Se=>Ct(ve,Se),onModelChange:Se=>Rt(ve,Se),onEffortChange:Se=>jt(ve,Se),onStart:()=>void He(async()=>{await ye.startRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`started ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Start ${ve} session`),onResume:()=>void He(async()=>{await ye.resumeRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`resumed ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Resume ${ve} session`),onStop:()=>void He(async()=>{await ye.stopRoleSession(t.taskSlug,ve),$e(`stopped ${ve}`)},`Stop ${ve} session`),onRestart:()=>void He(async()=>{await ye.restartRoleSession(t.taskSlug,ve,{cols:100,rows:28,permissionMode:v[ve],model:E[ve],effort:R[ve]}),$e(`restarted ${ve} with ${v[ve]} / ${E[ve]} / ${R[ve]}`)},`Restart ${ve} session`),onNotifyHarnessUpdated:()=>void He(async()=>{await ye.notifyRoleHarnessUpdated(t.taskSlug,ve),$e(`notified ${ve} to reload latest harness`)},`Notify ${ve} to reload harness`),onTerminalEvent:Se=>$e(`${re.label}: ${Se}`)})},ve)})})})})]})}function I2(t){return sl.some(r=>r.name===t)}function n_(t){return[t.status,t.updatedAt,t.cleanupStatus??"",t.cleanedAt??""].join(":")}function i_(t){var s;const r={...j2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.permissionMode)??r[l.name];return r}function r_(t){var s;const r={...N2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.model)??r[l.name];return r}function s_(t){var s;const r={...H2};for(const l of Jr)r[l.name]=((s=t.roles[l.name])==null?void 0:s.effort)??r[l.name];return r}const U2=1400;function P2(t){return!!(t!=null&&t.initialized)}function F2(){const[t,r]=ee.useState(null),[s,l]=ee.useState([]),[d,m]=ee.useState(null),[f,o]=ee.useState(null),[c,u]=ee.useState(null),[g,h]=ee.useState(null),[S,w]=ee.useState(null),[T,k]=ee.useState(null),[y,_]=ee.useState(null),[v,b]=ee.useState(null),[E,O]=ee.useState(null),[R,D]=ee.useState(null),[A,M]=ee.useState(null),[L,H]=ee.useState(null),[U,P]=ee.useState(!1),[W,K]=ee.useState(null),[V,Y]=ee.useState(null),[te,z]=ee.useState(!1),[j,N]=ee.useState([]),[q,I]=ee.useState(null),[ie,pe]=ee.useState(null),[ge,Q]=ee.useState(null),[$,he]=ee.useState(null),[le,xe]=ee.useState(null),[Ce,Le]=ee.useState(null),[Ie,He]=ee.useState("project-manager"),[$e,De]=ee.useState("system"),[Ct,Rt]=ee.useState(!0),[jt,re]=ee.useState(!0),[ve,ke]=ee.useState("off"),[nt,ot]=ee.useState(!1),[ce,Se]=ee.useState(!1),[Ee,Oe]=ee.useState(!1),[Ne,yt]=ee.useState(!1),[Pe,wt]=ee.useState(oS),[bt,Nt]=ee.useState(cS),[it,Wt]=ee.useState(!1),[rn,Cr]=ee.useState(!1),[mi,gi]=ee.useState(!1),[Pi,zn]=ee.useState(!1),[Fi,Jn]=ee.useState(!1),[si,sn]=ee.useState(null),[ai,In]=ee.useState("bypassPermissions"),[qi,_i]=ee.useState("default"),[vi,yi]=ee.useState("medium"),[wn,Pt]=ee.useState(null),[li,hn]=ee.useState("bypassPermissions"),[Kt,mt]=ee.useState("default"),[ct,Ht]=ee.useState("medium"),[$i,Ge]=ee.useState(()=>hS()),[Un,dl]=ee.useState(null),[wr,es]=ee.useState(0),[xn,Si]=ee.useState(null),[xr,Gi]=ee.useState(null),[kt,pl]=ee.useState(!1),[Vi,oi]=ee.useState(!1),[,fn]=Ii(""),ml=ee.useRef({}),ts=ee.useRef({}),Qs=ee.useRef({}),gl=ee.useRef({}),Er=ee.useRef({}),bi=ee.useRef(null),Pn=ee.useRef({initialized:!1,messageId:null}),Yt=ee.useRef(""),Z=ee.useMemo(()=>zk(j,q),[j,q]),dn=(Un==null?void 0:Un.taskSlug)===(Z==null?void 0:Z.taskSlug)?Un:null,kr=c===(Z==null?void 0:Z.taskSlug)?d:null,Js=g===(Z==null?void 0:Z.taskSlug)?f:null,ns=v===(Z==null?void 0:Z.taskSlug)?y:null,Wo=!!(t&&Z&&P2(kr)),pn=(si==null?void 0:si.status)==="running",is=!!(Ee&&Wo&&pn),_l=!!(dn!=null&&dn.statusLoaded),Zs=!!(Z&&(dn!=null&&dn.statusLoaded)&&!dn.hasAnySession),Zn=(R==null?void 0:R.modelOptions)??v_(),Ft=ee.useCallback((G,fe={})=>{De(G.themeMode),Rt(G.flowPauseAlerts),re(G.roleRetryEnabled),ke(G.permissionRequestMode),ot(G.autoTaskHarnessReviewEnabled),Se(G.autoMemoryEnabled),Oe(G.translationEnabled),yt(G.translationAutoSendEnabled),wt(G.translationTargetLanguage),Nt(G.translationOutputMode),Ge(G.launchTemplate),fe.syncToolLaunchOptions&&(In(G.toolSessionDefaults.translator.permissionMode),_i(G.toolSessionDefaults.translator.model),yi(G.toolSessionDefaults.translator.effort),hn(G.toolSessionDefaults["harness-engineer"].permissionMode),mt(G.toolSessionDefaults["harness-engineer"].model),Ht(G.toolSessionDefaults["harness-engineer"].effort))},[]);ee.useEffect(()=>{if(!Ct)return;let G=!1;const fe=()=>{G||(G=!0,a_(),window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe))};return window.addEventListener("pointerdown",fe),window.addEventListener("keydown",fe),()=>{window.removeEventListener("pointerdown",fe),window.removeEventListener("keydown",fe)}},[Ct]);const Fn=ee.useCallback(()=>{bi.current!==null&&(window.clearInterval(bi.current),bi.current=null)},[]),Ci=ee.useCallback(()=>{Fn(),l_(),bi.current=window.setInterval(()=>{l_()},U2)},[Fn]),vl=ee.useCallback((G,fe=`manual-${Date.now()}`)=>{Si({id:fe,text:G})},[]),rs=ee.useCallback(()=>{Fn(),Si(null)},[Fn]);ee.useEffect(()=>{Z!=null&&Z.taskSlug&&(Er.current[Z.taskSlug]=Date.now())},[Z==null?void 0:Z.taskSlug]);const yl=ee.useCallback(G=>{Z!=null&&Z.taskSlug&&pe({taskSlug:Z.taskSlug,messages:G})},[Z==null?void 0:Z.taskSlug]),ea=ee.useCallback(G=>{Qs.current[G.taskSlug]=G.mode,Z!=null&&Z.taskSlug&&Q({taskSlug:Z.taskSlug,orchestration:G})},[Z==null?void 0:Z.taskSlug]),Ko=ee.useCallback(G=>{Z!=null&&Z.taskSlug&&he({taskSlug:Z.taskSlug,events:G})},[Z==null?void 0:Z.taskSlug]),Yo=ee.useCallback(G=>{if(!(Z!=null&&Z.taskSlug)||G.taskSlug!==Z.taskSlug)return;xe({taskSlug:G.taskSlug,roundState:G});const fe=Ik({mode:Qs.current[G.taskSlug],status:G.status,activeRole:G.activeRole,lastFollowedRole:gl.current[G.taskSlug]});fe&&(gl.current[G.taskSlug]=fe,He(fe));const Ye=Uk(G,K2);if(Ye===null){ts.current[G.taskSlug]={status:G.status};return}const on=Pk(G),wi=ml.current[G.taskSlug],Jo=ts.current[G.taskSlug];ts.current[G.taskSlug]={status:G.status},wi!==on&&(ml.current[G.taskSlug]=on,G2(G,Jo,Er.current[G.taskSlug])&&vl(Ye,on))},[Z==null?void 0:Z.taskSlug,vl]),ss=ee.useCallback(G=>{dl(fe=>(fe==null?void 0:fe.taskSlug)===G.taskSlug&&fe.statusLoaded===G.statusLoaded&&fe.sessionCount===G.sessionCount&&fe.hasAnySession===G.hasAnySession&&fe.hasReviewerSession===G.hasReviewerSession&&fe.allRolesHaveSession===G.allRolesHaveSession&&fe.autoOrchestration===G.autoOrchestration&&JSON.stringify(fe.roles)===JSON.stringify(G.roles)?fe:G)},[]);async function Xt(){const G=await ye.listTasks();return N(G),I(fe=>{var Ye;return fe&&G.some(on=>on.taskSlug===fe)?fe:((Ye=G[0])==null?void 0:Ye.taskSlug)??null}),G}async function Ar(G=Z==null?void 0:Z.taskSlug){if(!G)return m(null),u(null),null;const fe=await ye.getHarnessStatus(G);return m(fe),u(G),fe}async function Tr(G=Z==null?void 0:Z.taskSlug){if(!G)return o(null),h(null),null;const fe=await ye.getHarnessBootstrapStatus(G);return o(fe),h(G),fe}async function En(){const G=await ye.getGatewayStatus();return O(G),G}async function Wi(){const G=await ye.getRecentRepositoryPaths();return l(G),G}async function ta(){if(!t)return Wt(!1),!1;const G=await ye.getTranslationState();return Wt(G.memoryInitialized),G.memoryInitialized}async function Rr(G){const[fe,Ye]=await Promise.all([ye.listMessages(G),ye.getOrchestrationState(G)]);pe({taskSlug:G,messages:fe}),Q({taskSlug:G,orchestration:Ye})}async function na(G){const fe=await ye.getGateReviewState(G);return Le({taskSlug:G,state:fe}),zo("Poll Gate Review state"),fn(Ye=>Lo(Ye,["Refresh Gate Review state","Poll Gate Review state"])),fe}function Ki(G,fe){const Ye=Ov(G,fe);Ye&&fn(Ye)}function Qt(G){G&&(In(G.permissionMode),G.model&&_i(G.model),G.effort&&yi(G.effort))}async function as(G={}){const fe=await ye.getTranslatorSession((Z==null?void 0:Z.taskSlug)??null);return sn(fe),G.syncLaunchOptions&&Qt(fe),fe}function kn(G){G&&(hn(G.permissionMode),G.model&&mt(G.model),G.effort&&Ht(G.effort))}async function an(G={}){const fe=await ye.getHarnessEngineerSession((Z==null?void 0:Z.taskSlug)??null);return Pt(fe),G.syncLaunchOptions&&kn(fe),fe}async function ia(G=Z==null?void 0:Z.taskSlug){if(!t)return k(null),null;const fe=await ye.getHarnessFeedbackState(G);return k(fe),fe}function ls(G,fe,Ye={}){var on;sn(G.translatorSession),Wt(!!((on=G.translationState)!=null&&on.memoryInitialized)),Pt(G.harnessEngineerSession),k(G.harnessFeedbackState),_(G.autoMemoryState),b(fe&&G.autoMemoryState?fe:null),O(G.gatewayStatus),fe&&G.harnessStatus?(m(G.harnessStatus),u(fe)):(m(null),u(null)),fe&&G.harnessBootstrapStatus?(o(G.harnessBootstrapStatus),h(fe)):(o(null),h(null)),Ye.syncLaunchOptions&&(Qt(G.translatorSession),kn(G.harnessEngineerSession))}async function ra(G={}){if(!t)return sn(null),Wt(!1),Pt(null),m(null),o(null),u(null),h(null),k(null),_(null),b(null),null;const fe=(Z==null?void 0:Z.taskSlug)??null,Ye=await ye.getProjectRuntimeState(fe);return ls(Ye,fe,G),Ye}function os(){const G=["Poll project runtime state","Load project runtime state","Refresh Harness feedback state","Poll Harness feedback state","Load Translator session","Poll Translator session","Poll translation memory status","Load Harness Engineer session","Poll Harness Engineer session","Load VCM Harness status","Poll VCM Harness status"];for(const fe of G)zo(fe);fn(fe=>Lo(fe,G))}ee.useEffect(()=>{Promise.all([ye.getCurrentProject(),ye.getRecentRepositoryPaths(),ye.getAppPreferences(),ye.getGatewayStatus(),ye.getCodexBridgeIntegrationStatus()]).then(async([G,fe,Ye,on,wi])=>{r(G),l(fe),O(on),D(wi),Ft(Ye,{syncToolLaunchOptions:!0}),G&&await Xt()}).catch(G=>fn(lt("Load initial app data",G)))},[Ft]),ee.useEffect(()=>{const G=window.matchMedia("(prefers-color-scheme: dark)"),fe=()=>pl(G.matches);return fe(),G.addEventListener("change",fe),()=>G.removeEventListener("change",fe)},[]),ee.useEffect(()=>()=>Fn(),[Fn]),ee.useEffect(()=>{(E==null?void 0:E.pauseAlertSoundEnabled)!==void 0&&Rt(E.pauseAlertSoundEnabled);const G=qk(Pn.current,E);Pn.current=G.observation,G.dismissPauseAlert&&rs()},[rs,E]),ee.useEffect(()=>{if(xn&&Fk(Ct)==="strong")return Ci(),Fn;Fn()},[xn==null?void 0:xn.id,Ct,Ci,Fn]),ee.useEffect(()=>{const G=$e==="system"?kt?"dark":"light":$e;document.documentElement.dataset.theme=G,document.documentElement.dataset.themeMode=$e},[kt,$e]),ee.useEffect(()=>{if(!(Z!=null&&Z.taskSlug)){Le(null);return}na(Z.taskSlug).catch(G=>fn(lt("Refresh Gate Review state",G)))},[Z==null?void 0:Z.taskSlug]),ee.useEffect(()=>{Yt.current="",sn(null),Wt(!1),Pt(null),m(null),o(null),u(null),h(null),k(null)},[t==null?void 0:t.repoRoot,Z==null?void 0:Z.taskSlug]),ol(t?`project-runtime:${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:null,async()=>{try{const G=t?`${t.repoRoot}:${(Z==null?void 0:Z.taskSlug)??"no-task"}`:"",fe=!!(t&&Yt.current!==G);await ra({syncLaunchOptions:fe}),fe&&(Yt.current=G),os()}catch(G){Ki("Poll project runtime state",G)}},{intervalMs:3e3,runImmediately:!0});const Jt=(Z==null?void 0:Z.taskSlug)??null,cs=Jt&&(Ce==null?void 0:Ce.taskSlug)===Jt?Ce.state:null,It=Jt&&(le==null?void 0:le.taskSlug)===Jt?le.roundState:null,ei=Jt&&(Un==null?void 0:Un.taskSlug)===Jt?Un:null,us=!!(Jt&&(cs!=null&&cs.activeGate||(It==null?void 0:It.activeRole)==="reviewer"||ei!=null&&ei.hasReviewerSession));ol(us&&Jt?`gate-review:${Jt}`:null,async()=>{if(Jt)try{await na(Jt)}catch(G){Ki("Poll Gate Review state",G)}},{intervalMs:3e3,runImmediately:!1});async function Te(G,fe="Run UI action"){oi(!0),fn("");try{await G()}catch(Ye){fn(lt(fe,Ye))}finally{oi(!1)}}async function Xo(){var on;if(!Z)throw new Error("Create or select a task before closing it.");const G=[`Close task "${Z.taskSlug}"?`,"","This is destructive:","- stops VCM-managed running role sessions for this task","- stops Translator and Harness Engineer sessions for this task",`- deletes the task worktree: ${Z.worktreePath}`,`- deletes the Git branch: ${Z.branch}`,"- deletes VCM task/session/message/orchestration state","","The task will close even if a cleanup step fails; cleanup issues are reported as warnings."].join(`
96
96
  `);if(!window.confirm(G))return;const Ye=await ye.cleanupTask(Z.taskSlug);I(null),pe(null),Q(null),he(null),xe(null),Le(null),es(wi=>wi+1),await Xt(),(on=Ye.warnings)!=null&&on.length&&window.alert([`Task "${Ye.taskSlug}" closed with cleanup warnings:`,"",...Ye.warnings.map(wi=>`- ${wi}`)].join(`
97
- `))}const sa=ie&&ie.taskSlug===(Z==null?void 0:Z.taskSlug)?ie.messages:[],aa=ge&&ge.taskSlug===(Z==null?void 0:Z.taskSlug)?ge.orchestration:null,Dr=$&&$.taskSlug===(Z==null?void 0:Z.taskSlug)?$.events:[],ln=le&&le.taskSlug===(Z==null?void 0:Z.taskSlug)?le.roundState:null,hs=Z!=null&&Z.taskSlug&&(ln!=null&&ln.roleRecovery)?W2(Z.taskSlug,ln.roleRecovery):null,Sl=ln!=null&&ln.roleRecovery&&ln.roleRecovery.status!=="failed"&&hs!==xr?K2(ln.roleRecovery):null,la=Ce&&Ce.taskSlug===(Z==null?void 0:Z.taskSlug)?Ce.state:null,Qo=!!(la&&Object.values(la.gates).some(G=>G.required));return C.jsxs(gS,{sidebar:C.jsx(c2,{project:t,recentRepositoryPaths:s,tasks:j,activeTaskSlug:(Z==null?void 0:Z.taskSlug)??null,messages:sa,orchestration:aa,events:Dr,roundState:ln,gateReview:la,translationEnabled:is,translationAutoSendEnabled:Ne,translationTargetLanguage:Pe,translationOutputMode:bt,translationMemoryInitialized:it,translatorSession:si,harnessStatus:kr,harnessBootstrapStatus:Js,harnessApplyResult:S,harnessEngineerLaunchOptions:{permissionMode:li,model:Kt,effort:ct},autoTaskHarnessReviewEnabled:nt,autoMemoryEnabled:ce,gatewayStatus:E,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:W,gatewayLarkRegistrationCheck:V,ccrStatus:R,modelOptions:Zn,busy:Vi,onConnect:G=>Te(async()=>{const fe=await ye.connectProject({repoPath:G});r(fe),w(null),await Promise.all([Xt(),Wi()])},"Connect repository"),onRefreshConnectedRepository:()=>Te(async()=>{const G=await ye.getCurrentProject();r(G)},"Refresh connected repository"),onPullConnectedRepository:()=>Te(async()=>{const G=await ye.pullCurrentProject();r(G)},"Pull connected repository"),onRefreshHarness:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before applying VCM Harness.");const G=await ye.applyHarness({taskSlug:Z.taskSlug});w(G),await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:G=>Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...G});o(fe.status),h(Z.taskSlug),await an({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:G=>Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...G});o(fe.status),h(Z.taskSlug),await an({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Bootstrap.");const G=await ye.stopHarnessBootstrap({taskSlug:Z.taskSlug});o(G),h((Z==null?void 0:Z.taskSlug)??null),await an()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before running Harness Bootstrap.");const G=await ye.runHarnessBootstrap({taskSlug:Z.taskSlug});o(G.status),h(Z.taskSlug),await an()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>zn(!0),onOpenRepositoryDiff:()=>Jn(!0),onAutoTaskHarnessReviewChange:G=>{ot(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:G});Ft(fe)},"Update auto task harness review setting")},onAutoMemoryChange:G=>{Se(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoMemoryEnabled:G});Ft(fe),await ra()},"Update auto memory setting")},onHarnessEngineerLaunchOptionsChange:G=>{hn(G.permissionMode),mt(G.model),Ht(G.effort)},onRefreshGateway:()=>Te(async()=>{await En()},"Refresh Gateway status"),onGatewayEnabledChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({enabled:G,...G&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(Z==null?void 0:Z.taskSlug)??null}:{}});O(fe),G&&Ft(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:G=>Te(async()=>{const fe=await ye.updateGatewaySettings(G);O(fe)},"Update Gateway settings"),onCcrSettingsChange:G=>Te(async()=>{D(await ye.updateCcrIntegration(G))},"Update CCR settings"),onCcrCheck:()=>Te(async()=>{D(await ye.checkCcrIntegration())},"Check CCR connection"),onGatewayTranslationChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:G});O(fe)},"Update Gateway translation setting")},onGatewayConnectionChange:G=>{Te(async()=>{const fe=await ye.setGatewayConnection(G);O(fe)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{Te(async()=>{const G=await ye.startGatewayQrLogin();M(G),H(null),P(!0),await En()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Te(async()=>{const G=await ye.startGatewayLarkRegistration();K(G),Y(null),z(!0),await En()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Te(async()=>{const G=await ye.resetGatewayBinding();O(G),M(null),H(null),P(!1),K(null),Y(null),z(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(G,fe)=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before changing Gate Review Gates.");const Ye=await ye.updateGateReviewSettings(Z.taskSlug,{gates:{[G]:fe}});Le({taskSlug:Z.taskSlug,state:Ye})},`Update ${G} Gate Review setting`)},onCancelGateReviewGate:(G,fe)=>{window.confirm(`Cancel the running ${G} Gate Review request ${fe}?`)&&Te(async()=>{if(!Z)throw new Error("Create or select a task before cancelling Gate Review.");const Ye=await ye.cancelGateReviewGate(Z.taskSlug,G,{requestId:fe,reason:"Cancelled by the user from VCM."});Le({taskSlug:Z.taskSlug,state:Ye})},`Cancel ${G} Gate Review`)},onTranslationEnabledChange:G=>{Oe(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:G});Ft(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:G=>{yt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:G});Ft(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:G=>{wt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:G});Ft(fe)},"Update translation target language")},onTranslationOutputModeChange:G=>{Nt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:G});Ft(fe)},"Update translation output mode")},onOpenFileTranslation:()=>Cr(!0),onOpenTranslatorSession:()=>gi(!0),onCreateTranslationBootstrap:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Z.taskSlug,targetLanguage:Pe}),await ta(),await as()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Z.taskSlug,targetLanguage:Pe}),await ta(),await as()},"Create translation memory update task")},onCreateTask:G=>Te(async()=>{const fe=await ye.createTask(G);await Xt(),I(fe.taskSlug)},"Create task"),onCloseTask:()=>{Te(Xo,"Close task")},onSelectTask:I,themeMode:$e,onAutoOrchestrationChange:G=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(Z.taskSlug,{mode:G?"auto":"manual"});Q({taskSlug:Z.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:G=>{De(G),Te(async()=>{const fe=await ye.updateAppPreferences({themeMode:G});Ft(fe)},"Update theme setting")},pauseAlertSound:Ct,onPauseAlertSoundChange:G=>{Rt(G),G&&a_(),Te(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:G});Ft(fe)},"Update pause alert sound setting")},roleRetryEnabled:jt,onRoleRetryEnabledChange:G=>{re(G),Te(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:G});Ft(fe)},"Update CC retry setting")},permissionRequestMode:ve,onPermissionRequestModeChange:G=>{ke(G),Te(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:G});Ft(fe)},"Update permission request setting")},launchTemplate:$i,canSaveLaunchTemplate:_l,canOneClickStart:Zs,onSaveLaunchTemplate:()=>{Te(async()=>{if(!(dn!=null&&dn.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const G=await ye.updateAppPreferences({launchTemplate:{version:1,roles:dn.roles,autoOrchestration:dn.autoOrchestration}});Ft(G)},"Save launch template")},onOneClickStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before one-click start.");const G=await ye.oneClickStart(Z.taskSlug);Q({taskSlug:Z.taskSlug,orchestration:G.orchestration}),He("project-manager"),await Rr(Z.taskSlug),await Xt(),es(fe=>fe+1)},"One-click start role sessions")},onMarkAllMessagesDone:G=>{Te(async()=>{const fe=await ye.markAllMessagesDone(G);pe({taskSlug:G,messages:fe.messages}),await Rr(G)},"Mark all role messages done")},onDeleteMessageHistory:G=>{Te(async()=>{const fe=await ye.deleteMessageHistory(G);pe({taskSlug:G,messages:fe.messages}),await Rr(G)},"Delete role message history")}}),children:[C.jsx(Hk,{}),xn?C.jsx("div",{className:"flow-pause-alert-backdrop",children:C.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[C.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),C.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),C.jsx("p",{id:"flow-pause-alert-body",children:xn.text}),C.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),C.jsx("button",{type:"button",autoFocus:!0,onClick:rs,children:"Confirm"})]})}):null,Sl&&hs?C.jsxs("div",{className:"role-recovery-toast",role:"status",children:[C.jsx("span",{children:Sl}),C.jsx("button",{type:"button",onClick:()=>Gi(hs),children:"Close"})]}):null,U&&A?C.jsx($2,{busy:Vi,qrCheck:L,qrLogin:A,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayQrLogin();H(G),(G.status==="confirmed"||G.status==="binded_redirect")&&P(!1),await En()})},onClose:()=>P(!1)}):null,te&&W?C.jsx(G2,{busy:Vi,registration:W,registrationCheck:V,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayLarkRegistration();Y(G),G.gatewayStatus&&O(G.gatewayStatus),G.status==="confirmed"&&(z(!1),await En())},"Check Lark Gateway QR setup")},onManualBind:(G,fe)=>{Te(async()=>{const Ye=await ye.bindGatewayLarkApp({appId:G,appSecret:fe,larkDomain:"lark"});Y(Ye),Ye.gatewayStatus&&O(Ye.gatewayStatus),Ye.status==="confirmed"&&(z(!1),await En())},"Bind Lark Gateway app")},onClose:()=>z(!1)}):null,t&&Z?C.jsx(I2,{task:Z,activeRole:Ie,reviewerEnabled:Qo,translationEnabled:is,translationAutoSendEnabled:Ne,translationTargetLanguage:Pe,launchTemplate:$i,modelOptions:Zn,refreshNonce:wr,onTaskChanged:async()=>{await Xt()},onActiveRoleChange:He,onMessagesChanged:yl,onOrchestrationChanged:ea,onRoundStateChanged:Yo,onEventsChanged:Ko,onLaunchStateChanged:ss}):C.jsxs("section",{className:"empty-workspace",children:[C.jsx("h1",{children:t?"Create a task to open the workspace":"Connect a repository to begin"}),C.jsx("p",{children:t?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),C.jsx(xk,{open:rn,taskSlug:(Z==null?void 0:Z.taskSlug)??null,targetLanguage:Pe,onClose:()=>Cr(!1)}),C.jsx(BS,{open:Pi,busy:Vi,status:kr,feedbackState:T,memoryState:ns,bootstrapStatus:Js,engineerSession:wn,permissionMode:li,model:Kt,modelOptions:Zn,effort:ct,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>zn(!1),onRefresh:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug),an(),ia(Z.taskSlug),ye.getAutoMemoryState(Z.taskSlug).then(G=>{_(G),b(Z.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:hn,onModelChange:mt,onEffortChange:Ht,onEngineerStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Engineer.");const G=await ye.startHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Start Harness Engineer")},onEngineerResume:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before resuming Harness Engineer.");const G=await ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Resume Harness Engineer")},onEngineerRestart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Engineer.");const G=await ye.restartHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Restart Harness Engineer")},onEngineerStop:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Engineer.");const G=await ye.stopHarnessEngineerSession({taskSlug:Z.taskSlug});Pt(G)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before notifying Harness Engineer.");const G=await ye.notifyHarnessEngineerHarnessUpdated({taskSlug:Z.taskSlug});Pt(G),kn(G)},"Notify Harness Engineer to reload harness")},onSendFeedback:G=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before sending Harness Feedback.");const fe=await ye.sendHarnessFeedback({taskSlug:Z.taskSlug,feedbackPath:G});Pt(fe),kn(fe)},"Send Harness Feedback to Harness Engineer")},onOpenRepositoryDiff:()=>Jn(!0),onReviewTaskHarness:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before reviewing task harness.");const G=await ye.startTaskHarnessRetrospective({taskSlug:Z.taskSlug,trigger:"manual"});k(G),await an({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:G=>{_(G),b((Z==null?void 0:Z.taskSlug)??null)}}),C.jsx(FS,{open:Fi,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Jn(!1)}),C.jsx(WS,{open:mi,busy:Vi,session:si,permissionMode:ai,model:qi,modelOptions:Zn,effort:vi,onClose:()=>gi(!1),onPermissionModeChange:In,onModelChange:_i,onEffortChange:yi,onStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Translator.");const G=await ye.startTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Start Translator session")},onResume:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before resuming Translator.");const G=await ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Resume Translator session")},onRestart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Translator.");const G=await ye.restartTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Restart Translator session")},onStop:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Translator.");const G=await ye.stopTranslatorSession({taskSlug:Z.taskSlug});sn(G)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before notifying Translator.");const G=await ye.notifyTranslatorHarnessUpdated({taskSlug:Z.taskSlug});sn(G),Qt(G)},"Notify Translator to reload harness")}})]})}function $2({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[m,f]=ee.useState(""),[o,c]=Ii("");return ee.useEffect(()=>{let u=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const g=Qr(0,"M");g.addData(d.qrcodeUrl),g.make(),u||f(g.createDataURL(8,2))}catch(g){u||c(lt("Render Gateway QR login code",g))}return()=>{u=!0}},[d.qrcodeUrl]),C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),C.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]}),C.jsxs("div",{className:"gateway-qr-modal-body",children:[C.jsx("div",{className:"gateway-qr-code-frame",children:m?C.jsx("img",{alt:"Weixin Gateway QR login",src:m}):C.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),C.jsxs("dl",{className:"gateway-qr-meta",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Expires"}),C.jsx("dd",{children:Uv(d.expiresAt)})]}),l!=null&&l.message?C.jsxs("div",{children:[C.jsx("dt",{children:"Message"}),C.jsx("dd",{children:l.message})]}):null]})]}),C.jsx("footer",{children:C.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})})]})})}function G2({busy:t,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:m}){const[f,o]=ee.useState(""),[c,u]=Ii(""),[g,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=Ii("");return ee.useEffect(()=>{let y=!1;u(""),o("");try{const _=Qr(0,"M");_.addData(d.qrUrl),_.make(),y||o(_.createDataURL(8,2))}catch(_){y||u(lt("Render Lark Gateway setup QR code",_))}return()=>{y=!0}},[d.qrUrl]),C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),C.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]}),C.jsxs("div",{className:"gateway-qr-modal-body",children:[C.jsx("div",{className:"gateway-qr-code-frame",children:f?C.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):C.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),C.jsx("div",{className:"gateway-qr-actions",children:C.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})}),C.jsxs("dl",{className:"gateway-qr-meta",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:(m==null?void 0:m.status)??d.status})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Expires"}),C.jsx("dd",{children:Uv(d.expiresAt)})]}),d.userCode?C.jsxs("div",{children:[C.jsx("dt",{children:"User Code"}),C.jsx("dd",{children:d.userCode})]}):null,m!=null&&m.larkBotName?C.jsxs("div",{children:[C.jsx("dt",{children:"Bot"}),C.jsx("dd",{children:m.larkBotName})]}):null,m!=null&&m.message?C.jsxs("div",{children:[C.jsx("dt",{children:"Message"}),C.jsx("dd",{children:m.message})]}):null]}),C.jsxs("form",{className:"gateway-manual-bind",onSubmit:y=>{y.preventDefault();const _=g.trim(),v=S.trim();if(!_||!v){k("Enter both App ID and App Secret.");return}k(""),w(""),l(_,v)},children:[C.jsxs("div",{children:[C.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),C.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:t,value:g,onChange:y=>h(y.currentTarget.value),placeholder:"cli_xxx"})]}),C.jsxs("div",{children:[C.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),C.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:t,type:"password",value:S,onChange:y=>w(y.currentTarget.value),placeholder:"Enter App Secret"})]}),T?C.jsx("p",{className:"form-error",children:T}):null,C.jsx("button",{type:"submit",disabled:t,children:"Bind manually"})]})]})]})})}function Uv(t){const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let Yr=null;function V2(t,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function W2(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function K2(t){const r=Q2(t.role),s=Pv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${J2(t.nextRetryAt)}`}function Y2(t,r){const s=Pv(t);return t.retryable===!1?`CC stopped for ${r}: ${X2(t)} cannot be fixed by retrying.`:`CC retry failed after ${t.maxAttempts} attempts for ${r}${s}.`}function Pv(t){return!t.error||t.error==="unknown"?"":` · ${t.error}`}function X2(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function Q2(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function J2(t){if(!t)return"即将重试";const r=Date.parse(t)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function a_(){const t=Fv();return t?qv(t):!1}async function l_(){const t=Fv();if(!t||!await qv(t))return!1;try{const s=t.createGain(),l=t.currentTime+.025;return s.gain.setValueAtTime(.85,t.currentTime),s.connect(t.destination),u_(t,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),u_(t,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Fv(){const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{return(!Yr||Yr.state==="closed")&&(Yr=new t),Yr}catch{return null}}function o_(t){Yr=null,t&&t.state!=="closed"&&t.close().catch(()=>{})}async function qv(t){if(c_(t))return!0;try{await t.resume();const r=c_(t);return!r&&t===Yr&&o_(t),r}catch{return t===Yr&&o_(t),!1}}function c_(t){return t.state==="running"}function u_(t,r,s){const l=t.createGain(),d=t.createOscillator(),m=t.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),m.type="triangle",m.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),m.connect(l),l.connect(r),d.start(s.startAt),m.start(s.startAt),d.stop(f+.02),m.stop(f+.02)}const $v=document.getElementById("root");if(!$v)throw new Error("Missing #root element.");Y0.createRoot($v).render(C.jsx(ee.StrictMode,{children:C.jsx(q2,{})}));
97
+ `))}const sa=ie&&ie.taskSlug===(Z==null?void 0:Z.taskSlug)?ie.messages:[],aa=ge&&ge.taskSlug===(Z==null?void 0:Z.taskSlug)?ge.orchestration:null,Dr=$&&$.taskSlug===(Z==null?void 0:Z.taskSlug)?$.events:[],ln=le&&le.taskSlug===(Z==null?void 0:Z.taskSlug)?le.roundState:null,hs=Z!=null&&Z.taskSlug&&(ln!=null&&ln.roleRecovery)?V2(Z.taskSlug,ln.roleRecovery):null,Sl=ln!=null&&ln.roleRecovery&&ln.roleRecovery.status!=="failed"&&hs!==xr?W2(ln.roleRecovery):null,la=Ce&&Ce.taskSlug===(Z==null?void 0:Z.taskSlug)?Ce.state:null,Qo=!!(la&&Object.values(la.gates).some(G=>G.required));return C.jsxs(mS,{sidebar:C.jsx(o2,{project:t,recentRepositoryPaths:s,tasks:j,activeTaskSlug:(Z==null?void 0:Z.taskSlug)??null,messages:sa,orchestration:aa,events:Dr,roundState:ln,gateReview:la,translationEnabled:is,translationAutoSendEnabled:Ne,translationTargetLanguage:Pe,translationOutputMode:bt,translationMemoryInitialized:it,translatorSession:si,harnessStatus:kr,harnessBootstrapStatus:Js,harnessApplyResult:S,harnessEngineerLaunchOptions:{permissionMode:li,model:Kt,effort:ct},autoTaskHarnessReviewEnabled:nt,autoMemoryEnabled:ce,gatewayStatus:E,gatewayQrLogin:A,gatewayQrCheck:L,gatewayLarkRegistration:W,gatewayLarkRegistrationCheck:V,codexBridgeStatus:R,modelOptions:Zn,busy:Vi,onConnect:G=>Te(async()=>{const fe=await ye.connectProject({repoPath:G});r(fe),w(null),await Promise.all([Xt(),Wi()])},"Connect repository"),onRefreshConnectedRepository:()=>Te(async()=>{const G=await ye.getCurrentProject();r(G)},"Refresh connected repository"),onPullConnectedRepository:()=>Te(async()=>{const G=await ye.pullCurrentProject();r(G)},"Pull connected repository"),onRefreshHarness:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before refreshing VCM Harness.");w(null),await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug)])},"Refresh VCM Harness"),onApplyHarness:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before applying VCM Harness.");const G=await ye.applyHarness({taskSlug:Z.taskSlug});w(G),await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug)])},"Apply VCM Harness"),onStartHarnessBootstrap:G=>Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Bootstrap.");const fe=await ye.startHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...G});o(fe.status),h(Z.taskSlug),await an({syncLaunchOptions:!0})},"Start Harness Bootstrap"),onRestartHarnessBootstrap:G=>Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Bootstrap.");const fe=await ye.restartHarnessBootstrap({taskSlug:Z.taskSlug,cols:120,rows:32,...G});o(fe.status),h(Z.taskSlug),await an({syncLaunchOptions:!0})},"Restart Harness Bootstrap"),onStopHarnessBootstrap:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Bootstrap.");const G=await ye.stopHarnessBootstrap({taskSlug:Z.taskSlug});o(G),h((Z==null?void 0:Z.taskSlug)??null),await an()},"Stop Harness Bootstrap"),onRunHarnessBootstrap:()=>Te(async()=>{if(!Z)throw new Error("Create or select a task before running Harness Bootstrap.");const G=await ye.runHarnessBootstrap({taskSlug:Z.taskSlug});o(G.status),h(Z.taskSlug),await an()},"Run Harness Bootstrap"),onOpenHarnessStudio:()=>zn(!0),onOpenRepositoryDiff:()=>Jn(!0),onAutoTaskHarnessReviewChange:G=>{ot(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoTaskHarnessReviewEnabled:G});Ft(fe)},"Update auto task harness review setting")},onAutoMemoryChange:G=>{Se(G),Te(async()=>{const fe=await ye.updateAppPreferences({autoMemoryEnabled:G});Ft(fe),await ra()},"Update auto memory setting")},onHarnessEngineerLaunchOptionsChange:G=>{hn(G.permissionMode),mt(G.model),Ht(G.effort)},onRefreshGateway:()=>Te(async()=>{await En()},"Refresh Gateway status"),onGatewayEnabledChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({enabled:G,...G&&t?{currentProjectId:t.repoRoot,currentTaskSlug:(Z==null?void 0:Z.taskSlug)??null}:{}});O(fe),G&&Ft(await ye.getAppPreferences())},"Update Gateway enabled setting")},onGatewaySettingsChange:G=>Te(async()=>{const fe=await ye.updateGatewaySettings(G);O(fe)},"Update Gateway settings"),onCodexBridgeSettingsChange:G=>Te(async()=>{D(await ye.updateCodexBridgeIntegration(G))},"Update Codex Bridge settings"),onCodexBridgeCheck:()=>Te(async()=>{D(await ye.checkCodexBridgeIntegration())},"Check Codex Bridge connection"),onGatewayTranslationChange:G=>{Te(async()=>{const fe=await ye.updateGatewaySettings({translationEnabled:G});O(fe)},"Update Gateway translation setting")},onGatewayConnectionChange:G=>{Te(async()=>{const fe=await ye.setGatewayConnection(G);O(fe)},"Update Gateway connection setting")},onStartGatewayQrLogin:()=>{Te(async()=>{const G=await ye.startGatewayQrLogin();M(G),H(null),P(!0),await En()},"Start Gateway QR login")},onStartGatewayLarkRegistration:()=>{Te(async()=>{const G=await ye.startGatewayLarkRegistration();K(G),Y(null),z(!0),await En()},"Start Lark Gateway QR setup")},onResetGatewayBinding:()=>{Te(async()=>{const G=await ye.resetGatewayBinding();O(G),M(null),H(null),P(!1),K(null),Y(null),z(!1)},"Reset Gateway binding")},onGateReviewGateEnabledChange:(G,fe)=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before changing Gate Review Gates.");const Ye=await ye.updateGateReviewSettings(Z.taskSlug,{gates:{[G]:fe}});Le({taskSlug:Z.taskSlug,state:Ye})},`Update ${G} Gate Review setting`)},onCancelGateReviewGate:(G,fe)=>{window.confirm(`Cancel the running ${G} Gate Review request ${fe}?`)&&Te(async()=>{if(!Z)throw new Error("Create or select a task before cancelling Gate Review.");const Ye=await ye.cancelGateReviewGate(Z.taskSlug,G,{requestId:fe,reason:"Cancelled by the user from VCM."});Le({taskSlug:Z.taskSlug,state:Ye})},`Cancel ${G} Gate Review`)},onTranslationEnabledChange:G=>{Oe(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationEnabled:G});Ft(fe)},"Update conversation translation setting")},onTranslationAutoSendChange:G=>{yt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationAutoSendEnabled:G});Ft(fe)},"Update translation auto-send setting")},onTranslationTargetLanguageChange:G=>{wt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationTargetLanguage:G});Ft(fe)},"Update translation target language")},onTranslationOutputModeChange:G=>{Nt(G),Te(async()=>{const fe=await ye.updateAppPreferences({translationOutputMode:G});Ft(fe)},"Update translation output mode")},onOpenFileTranslation:()=>Cr(!0),onOpenTranslatorSession:()=>gi(!0),onCreateTranslationBootstrap:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before running Translation Bootstrap.");await ye.createTranslationBootstrap({taskSlug:Z.taskSlug,targetLanguage:Pe}),await ta(),await as()},"Create Translation Bootstrap task")},onUpdateTranslationMemory:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before updating translation memory.");await ye.createTranslationMemoryUpdate({taskSlug:Z.taskSlug,targetLanguage:Pe}),await ta(),await as()},"Create translation memory update task")},onCreateTask:G=>Te(async()=>{const fe=await ye.createTask(G);await Xt(),I(fe.taskSlug)},"Create task"),onCloseTask:()=>{Te(Xo,"Close task")},onSelectTask:I,themeMode:$e,onAutoOrchestrationChange:G=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before changing auto orchestration.");const fe=await ye.updateOrchestrationState(Z.taskSlug,{mode:G?"auto":"manual"});Q({taskSlug:Z.taskSlug,orchestration:fe})},"Update auto orchestration mode")},onThemeModeChange:G=>{De(G),Te(async()=>{const fe=await ye.updateAppPreferences({themeMode:G});Ft(fe)},"Update theme setting")},pauseAlertSound:Ct,onPauseAlertSoundChange:G=>{Rt(G),G&&a_(),Te(async()=>{const fe=await ye.updateAppPreferences({flowPauseAlerts:G});Ft(fe)},"Update pause alert sound setting")},roleRetryEnabled:jt,onRoleRetryEnabledChange:G=>{re(G),Te(async()=>{const fe=await ye.updateAppPreferences({roleRetryEnabled:G});Ft(fe)},"Update CC retry setting")},permissionRequestMode:ve,onPermissionRequestModeChange:G=>{ke(G),Te(async()=>{const fe=await ye.updateAppPreferences({permissionRequestMode:G});Ft(fe)},"Update permission request setting")},launchTemplate:$i,canSaveLaunchTemplate:_l,canOneClickStart:Zs,onSaveLaunchTemplate:()=>{Te(async()=>{if(!(dn!=null&&dn.statusLoaded))throw new Error("Open a task workspace before saving a launch template.");const G=await ye.updateAppPreferences({launchTemplate:{version:1,roles:dn.roles,autoOrchestration:dn.autoOrchestration}});Ft(G)},"Save launch template")},onOneClickStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before one-click start.");const G=await ye.oneClickStart(Z.taskSlug);Q({taskSlug:Z.taskSlug,orchestration:G.orchestration}),He("project-manager"),await Rr(Z.taskSlug),await Xt(),es(fe=>fe+1)},"One-click start role sessions")},onMarkAllMessagesDone:G=>{Te(async()=>{const fe=await ye.markAllMessagesDone(G);pe({taskSlug:G,messages:fe.messages}),await Rr(G)},"Mark all role messages done")},onDeleteMessageHistory:G=>{Te(async()=>{const fe=await ye.deleteMessageHistory(G);pe({taskSlug:G,messages:fe.messages}),await Rr(G)},"Delete role message history")}}),children:[C.jsx(Nk,{}),xn?C.jsx("div",{className:"flow-pause-alert-backdrop",children:C.jsxs("section",{"aria-describedby":"flow-pause-alert-body flow-pause-alert-hint","aria-labelledby":"flow-pause-alert-title","aria-modal":"true",className:"flow-pause-alert",role:"alertdialog",children:[C.jsx("p",{className:"flow-pause-alert-kicker",children:"VCM needs attention"}),C.jsx("h2",{id:"flow-pause-alert-title",children:"Flow needs attention"}),C.jsx("p",{id:"flow-pause-alert-body",children:xn.text}),C.jsx("p",{id:"flow-pause-alert-hint",className:"flow-pause-alert-hint",children:"The task may be complete, waiting for your decision, or blocked by a workflow issue."}),C.jsx("button",{type:"button",autoFocus:!0,onClick:rs,children:"Confirm"})]})}):null,Sl&&hs?C.jsxs("div",{className:"role-recovery-toast",role:"status",children:[C.jsx("span",{children:Sl}),C.jsx("button",{type:"button",onClick:()=>Gi(hs),children:"Close"})]}):null,U&&A?C.jsx(q2,{busy:Vi,qrCheck:L,qrLogin:A,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayQrLogin();H(G),(G.status==="confirmed"||G.status==="binded_redirect")&&P(!1),await En()})},onClose:()=>P(!1)}):null,te&&W?C.jsx($2,{busy:Vi,registration:W,registrationCheck:V,onCheck:()=>{Te(async()=>{const G=await ye.checkGatewayLarkRegistration();Y(G),G.gatewayStatus&&O(G.gatewayStatus),G.status==="confirmed"&&(z(!1),await En())},"Check Lark Gateway QR setup")},onManualBind:(G,fe)=>{Te(async()=>{const Ye=await ye.bindGatewayLarkApp({appId:G,appSecret:fe,larkDomain:"lark"});Y(Ye),Ye.gatewayStatus&&O(Ye.gatewayStatus),Ye.status==="confirmed"&&(z(!1),await En())},"Bind Lark Gateway app")},onClose:()=>z(!1)}):null,t&&Z?C.jsx(z2,{task:Z,activeRole:Ie,reviewerEnabled:Qo,translationEnabled:is,translationAutoSendEnabled:Ne,translationTargetLanguage:Pe,launchTemplate:$i,modelOptions:Zn,refreshNonce:wr,onTaskChanged:async()=>{await Xt()},onActiveRoleChange:He,onMessagesChanged:yl,onOrchestrationChanged:ea,onRoundStateChanged:Yo,onEventsChanged:Ko,onLaunchStateChanged:ss}):C.jsxs("section",{className:"empty-workspace",children:[C.jsx("h1",{children:t?"Create a task to open the workspace":"Connect a repository to begin"}),C.jsx("p",{children:t?"Tasks create local role commands and handoff artifacts for the selected repository.":"VibeCodingMaster will create a local task workspace, role sessions, and handoff artifacts."})]}),C.jsx(wk,{open:rn,taskSlug:(Z==null?void 0:Z.taskSlug)??null,targetLanguage:Pe,onClose:()=>Cr(!1)}),C.jsx(OS,{open:Pi,busy:Vi,status:kr,feedbackState:T,memoryState:ns,bootstrapStatus:Js,engineerSession:wn,permissionMode:li,model:Kt,modelOptions:Zn,effort:ct,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>zn(!1),onRefresh:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before refreshing Harness Studio.");await Promise.all([Ar(Z.taskSlug),Tr(Z.taskSlug),an(),ia(Z.taskSlug),ye.getAutoMemoryState(Z.taskSlug).then(G=>{_(G),b(Z.taskSlug)})])},"Refresh Harness Studio")},onPermissionModeChange:hn,onModelChange:mt,onEffortChange:Ht,onEngineerStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Harness Engineer.");const G=await ye.startHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Start Harness Engineer")},onEngineerResume:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before resuming Harness Engineer.");const G=await ye.resumeHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Resume Harness Engineer")},onEngineerRestart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Harness Engineer.");const G=await ye.restartHarnessEngineerSession({taskSlug:Z.taskSlug,cols:120,rows:32,permissionMode:li,model:Kt,effort:ct});Pt(G),kn(G)},"Restart Harness Engineer")},onEngineerStop:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Harness Engineer.");const G=await ye.stopHarnessEngineerSession({taskSlug:Z.taskSlug});Pt(G)},"Stop Harness Engineer")},onEngineerNotifyHarnessUpdated:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before notifying Harness Engineer.");const G=await ye.notifyHarnessEngineerHarnessUpdated({taskSlug:Z.taskSlug});Pt(G),kn(G)},"Notify Harness Engineer to reload harness")},onSendFeedback:G=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before sending Harness Feedback.");const fe=await ye.sendHarnessFeedback({taskSlug:Z.taskSlug,feedbackPath:G});Pt(fe),kn(fe)},"Send Harness Feedback to Harness Engineer")},onOpenRepositoryDiff:()=>Jn(!0),onReviewTaskHarness:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before reviewing task harness.");const G=await ye.startTaskHarnessRetrospective({taskSlug:Z.taskSlug,trigger:"manual"});k(G),await an({syncLaunchOptions:!0})},"Review task harness")},onMemoryStateChange:G=>{_(G),b((Z==null?void 0:Z.taskSlug)??null)}}),C.jsx(PS,{open:Fi,taskSlug:(Z==null?void 0:Z.taskSlug)??null,onClose:()=>Jn(!1)}),C.jsx(VS,{open:mi,busy:Vi,session:si,permissionMode:ai,model:qi,modelOptions:Zn,effort:vi,onClose:()=>gi(!1),onPermissionModeChange:In,onModelChange:_i,onEffortChange:yi,onStart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before starting Translator.");const G=await ye.startTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Start Translator session")},onResume:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before resuming Translator.");const G=await ye.resumeTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Resume Translator session")},onRestart:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before restarting Translator.");const G=await ye.restartTranslatorSession({taskSlug:Z.taskSlug,cols:100,rows:28,permissionMode:ai,model:qi,effort:vi});sn(G),Qt(G)},"Restart Translator session")},onStop:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before stopping Translator.");const G=await ye.stopTranslatorSession({taskSlug:Z.taskSlug});sn(G)},"Stop Translator session")},onNotifyHarnessUpdated:()=>{Te(async()=>{if(!Z)throw new Error("Create or select a task before notifying Translator.");const G=await ye.notifyTranslatorHarnessUpdated({taskSlug:Z.taskSlug});sn(G),Qt(G)},"Notify Translator to reload harness")}})]})}function q2({busy:t,onCheck:r,onClose:s,qrCheck:l,qrLogin:d}){const[m,f]=ee.useState(""),[o,c]=Ii("");return ee.useEffect(()=>{let u=!1;if(c(""),f(""),d.qrcodeUrl.startsWith("data:image/")){f(d.qrcodeUrl);return}try{const g=Qr(0,"M");g.addData(d.qrcodeUrl),g.make(),u||f(g.createDataURL(8,2))}catch(g){u||c(lt("Render Gateway QR login code",g))}return()=>{u=!0}},[d.qrcodeUrl]),C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{"aria-labelledby":"gateway-qr-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{id:"gateway-qr-title",children:"Weixin Gateway Login"}),C.jsx("p",{className:"muted",children:"Scan with Weixin, confirm on the phone, then click Confirm."})]}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]}),C.jsxs("div",{className:"gateway-qr-modal-body",children:[C.jsx("div",{className:"gateway-qr-code-frame",children:m?C.jsx("img",{alt:"Weixin Gateway QR login",src:m}):C.jsx("div",{className:"gateway-qr-placeholder",children:o?"QR code could not be rendered.":"Rendering QR code..."})}),C.jsxs("dl",{className:"gateway-qr-meta",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:(l==null?void 0:l.status)??d.status})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Expires"}),C.jsx("dd",{children:Uv(d.expiresAt)})]}),l!=null&&l.message?C.jsxs("div",{children:[C.jsx("dt",{children:"Message"}),C.jsx("dd",{children:l.message})]}):null]})]}),C.jsx("footer",{children:C.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})})]})})}function $2({busy:t,onCheck:r,onClose:s,onManualBind:l,registration:d,registrationCheck:m}){const[f,o]=ee.useState(""),[c,u]=Ii(""),[g,h]=ee.useState(""),[S,w]=ee.useState(""),[T,k]=Ii("");return ee.useEffect(()=>{let y=!1;u(""),o("");try{const _=Qr(0,"M");_.addData(d.qrUrl),_.make(),y||o(_.createDataURL(8,2))}catch(_){y||u(lt("Render Lark Gateway setup QR code",_))}return()=>{y=!0}},[d.qrUrl]),C.jsx("div",{className:"modal-backdrop",children:C.jsxs("section",{"aria-labelledby":"gateway-lark-registration-title","aria-modal":"true",className:"gateway-qr-modal",role:"dialog",children:[C.jsxs("header",{children:[C.jsxs("div",{children:[C.jsx("h2",{id:"gateway-lark-registration-title",children:"Lark Gateway Setup"}),C.jsx("p",{className:"muted",children:"Scan with Lark, approve bot creation, then click Confirm."})]}),C.jsx("button",{type:"button",onClick:s,children:"Close"})]}),C.jsxs("div",{className:"gateway-qr-modal-body",children:[C.jsx("div",{className:"gateway-qr-code-frame",children:f?C.jsx("img",{alt:"Lark Gateway setup QR code",src:f}):C.jsx("div",{className:"gateway-qr-placeholder",children:c?"QR code could not be rendered.":"Rendering QR code..."})}),C.jsx("div",{className:"gateway-qr-actions",children:C.jsx("button",{type:"button",disabled:t,onClick:r,children:"Confirm"})}),C.jsxs("dl",{className:"gateway-qr-meta",children:[C.jsxs("div",{children:[C.jsx("dt",{children:"Status"}),C.jsx("dd",{children:(m==null?void 0:m.status)??d.status})]}),C.jsxs("div",{children:[C.jsx("dt",{children:"Expires"}),C.jsx("dd",{children:Uv(d.expiresAt)})]}),d.userCode?C.jsxs("div",{children:[C.jsx("dt",{children:"User Code"}),C.jsx("dd",{children:d.userCode})]}):null,m!=null&&m.larkBotName?C.jsxs("div",{children:[C.jsx("dt",{children:"Bot"}),C.jsx("dd",{children:m.larkBotName})]}):null,m!=null&&m.message?C.jsxs("div",{children:[C.jsx("dt",{children:"Message"}),C.jsx("dd",{children:m.message})]}):null]}),C.jsxs("form",{className:"gateway-manual-bind",onSubmit:y=>{y.preventDefault();const _=g.trim(),v=S.trim();if(!_||!v){k("Enter both App ID and App Secret.");return}k(""),w(""),l(_,v)},children:[C.jsxs("div",{children:[C.jsx("label",{htmlFor:"gateway-lark-app-id",children:"App ID"}),C.jsx("input",{id:"gateway-lark-app-id",autoComplete:"off",disabled:t,value:g,onChange:y=>h(y.currentTarget.value),placeholder:"cli_xxx"})]}),C.jsxs("div",{children:[C.jsx("label",{htmlFor:"gateway-lark-app-secret",children:"App Secret"}),C.jsx("input",{id:"gateway-lark-app-secret",autoComplete:"off",disabled:t,type:"password",value:S,onChange:y=>w(y.currentTarget.value),placeholder:"Enter App Secret"})]}),T?C.jsx("p",{className:"form-error",children:T}):null,C.jsx("button",{type:"submit",disabled:t,children:"Bind manually"})]})]})]})})}function Uv(t){const r=new Date(t);return Number.isNaN(r.getTime())?"-":new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(r)}let Yr=null;function G2(t,r,s){if((r==null?void 0:r.status)==="running")return!0;const l=Date.parse(t.stoppedAt??t.lastTurnEndedAt??"");return!!(s&&Number.isFinite(l)&&l>s)}function V2(t,r){return`${t}:${r.role}:${r.lastFailureAt}`}function W2(t){const r=X2(t.role),s=Pv(t);return t.status==="retrying"?`CC 出错,正在重试 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次`:`CC 出错,重试中 ${r}${s} · 第 ${t.attempt}/${t.maxAttempts} 次 · ${Q2(t.nextRetryAt)}`}function K2(t,r){const s=Pv(t);return t.retryable===!1?`CC stopped for ${r}: ${Y2(t)} cannot be fixed by retrying.`:`CC retry failed after ${t.maxAttempts} attempts for ${r}${s}.`}function Pv(t){return!t.error||t.error==="unknown"?"":` · ${t.error}`}function Y2(t){return t.error&&t.error!=="unknown"?t.error:"this error"}function X2(t){return t.split("-").filter(Boolean).map(r=>`${r.slice(0,1).toUpperCase()}${r.slice(1)}`).join(" ")}function Q2(t){if(!t)return"即将重试";const r=Date.parse(t)-Date.now();return!Number.isFinite(r)||r<=0?"即将重试":`${Math.ceil(r/6e4)} 分钟后`}async function a_(){const t=Fv();return t?qv(t):!1}async function l_(){const t=Fv();if(!t||!await qv(t))return!1;try{const s=t.createGain(),l=t.currentTime+.025;return s.gain.setValueAtTime(.85,t.currentTime),s.connect(t.destination),u_(t,s,{frequency:587.33,startAt:l,duration:.18,peakGain:.045}),u_(t,s,{frequency:783.99,startAt:l+.11,duration:.28,peakGain:.055}),window.setTimeout(()=>{s.disconnect()},800),!0}catch{return!1}}function Fv(){const t=window.AudioContext??window.webkitAudioContext;if(!t)return null;try{return(!Yr||Yr.state==="closed")&&(Yr=new t),Yr}catch{return null}}function o_(t){Yr=null,t&&t.state!=="closed"&&t.close().catch(()=>{})}async function qv(t){if(c_(t))return!0;try{await t.resume();const r=c_(t);return!r&&t===Yr&&o_(t),r}catch{return t===Yr&&o_(t),!1}}function c_(t){return t.state==="running"}function u_(t,r,s){const l=t.createGain(),d=t.createOscillator(),m=t.createOscillator(),f=s.startAt+s.duration;l.gain.setValueAtTime(1e-4,s.startAt),l.gain.exponentialRampToValueAtTime(s.peakGain,s.startAt+.018),l.gain.exponentialRampToValueAtTime(1e-4,f),d.type="sine",d.frequency.setValueAtTime(s.frequency,s.startAt),m.type="triangle",m.frequency.setValueAtTime(s.frequency*2.01,s.startAt),d.connect(l),m.connect(l),l.connect(r),d.start(s.startAt),m.start(s.startAt),d.stop(f+.02),m.stop(f+.02)}const $v=document.getElementById("root");if(!$v)throw new Error("Missing #root element.");Y0.createRoot($v).render(C.jsx(ee.StrictMode,{children:C.jsx(F2,{})}));