codesesh 1.0.6 → 1.0.7

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.
Files changed (44) hide show
  1. package/dist/{chunk-4QFNZCBR.js → chunk-DE6UJMOY.js} +2 -2
  2. package/dist/{chunk-COZSWVCH.js → chunk-EYZ73CYP.js} +2 -2
  3. package/dist/{chunk-4ND6AT6W.js → chunk-QHWSZFRM.js} +3 -3
  4. package/dist/chunk-QHWSZFRM.js.map +1 -0
  5. package/dist/{chunk-L3DDWTYV.js → chunk-SII3M66U.js} +7 -5
  6. package/dist/chunk-SII3M66U.js.map +1 -0
  7. package/dist/{chunk-XQDYKKRC.js → chunk-VVCSQU5B.js} +98 -14
  8. package/dist/chunk-VVCSQU5B.js.map +1 -0
  9. package/dist/{chunk-A3MT6L6Z.js → chunk-WIWK7BXS.js} +2 -2
  10. package/dist/{chunk-YZ6XCSVQ.js → chunk-YEQTRALH.js} +2 -2
  11. package/dist/{discovery-ADSQARBV.js → discovery-4WAEYSTR.js} +7 -5
  12. package/dist/index.js +40 -14
  13. package/dist/index.js.map +1 -1
  14. package/dist/project-identity-worker.js +4 -4
  15. package/dist/scan-refresh-worker.js +6 -6
  16. package/dist/search-index-worker.js +6 -6
  17. package/dist/session-detail-worker.js +6 -6
  18. package/dist/smart-tag-worker.js +3 -3
  19. package/dist/web/assets/{CustomTimeWindowDialog-D2bx7uDv.js → CustomTimeWindowDialog-CVURkiVO.js} +1 -1
  20. package/dist/web/assets/{InteractiveReceipt-BFpIdno8.js → InteractiveReceipt-DGC-xV7U.js} +1 -1
  21. package/dist/web/assets/{OverviewScreen-D_KXfiJi.js → OverviewScreen-DoXrZ5qp.js} +1 -1
  22. package/dist/web/assets/{PrismHighlighter-BgVkYu_S.js → PrismHighlighter-02695Lmx.js} +1 -1
  23. package/dist/web/assets/{Projects-CN44UpuR.js → Projects-DZiYh6hp.js} +1 -1
  24. package/dist/web/assets/{SearchResultsPanel-CWD01v-a.js → SearchResultsPanel-CAQe8Di0.js} +1 -1
  25. package/dist/web/assets/{SessionDetail-D8taQ6Tl.js → SessionDetail-Da8EBygt.js} +4 -4
  26. package/dist/web/assets/api-ToidoNW6.js +1 -0
  27. package/dist/web/assets/{index-XpolWMY4.js → index-Bl8pbRFj.js} +68 -68
  28. package/dist/web/assets/index-CRI1m3xN.css +1 -0
  29. package/dist/web/assets/{session-indexes-fib48ZKn.js → session-indexes-D5gps7K8.js} +1 -1
  30. package/dist/web/assets/translate-BDFu3ZiK.js +2 -0
  31. package/dist/web/assets/{utils-Bk66u8b3.js → utils-BIZi2up3.js} +1 -1
  32. package/dist/web/index.html +7 -7
  33. package/package.json +1 -1
  34. package/dist/chunk-4ND6AT6W.js.map +0 -1
  35. package/dist/chunk-L3DDWTYV.js.map +0 -1
  36. package/dist/chunk-XQDYKKRC.js.map +0 -1
  37. package/dist/web/assets/api-B9lJtVbO.js +0 -1
  38. package/dist/web/assets/index-xbEEMszv.css +0 -1
  39. package/dist/web/assets/translate-Dmym1ZDl.js +0 -2
  40. /package/dist/{chunk-4QFNZCBR.js.map → chunk-DE6UJMOY.js.map} +0 -0
  41. /package/dist/{chunk-COZSWVCH.js.map → chunk-EYZ73CYP.js.map} +0 -0
  42. /package/dist/{chunk-A3MT6L6Z.js.map → chunk-WIWK7BXS.js.map} +0 -0
  43. /package/dist/{chunk-YZ6XCSVQ.js.map → chunk-YEQTRALH.js.map} +0 -0
  44. /package/dist/{discovery-ADSQARBV.js.map → discovery-4WAEYSTR.js.map} +0 -0
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismHighlighter-BgVkYu_S.js","assets/jsx-runtime-B-hcVAMW.js","assets/InteractiveReceipt-BFpIdno8.js","assets/translate-Dmym1ZDl.js","assets/index-XpolWMY4.js","assets/utils-Bk66u8b3.js","assets/CustomTimeWindowDialog-D2bx7uDv.js","assets/api-B9lJtVbO.js","assets/session-indexes-fib48ZKn.js","assets/index-xbEEMszv.css"])))=>i.map(i=>d[i]);
2
- import{a as e,i as t,n,r,t as i}from"./jsx-runtime-B-hcVAMW.js";import{Bn as a,c as o,d as s,h as c,n as l,t as u}from"./utils-Bk66u8b3.js";import{E as d,d as f,k as p,m,n as h,t as g}from"./translate-Dmym1ZDl.js";import{g as _,o as v}from"./session-indexes-fib48ZKn.js";import{A as y,B as b,C as x,D as S,E as C,F as w,I as T,J as E,K as ee,L as D,M as te,N as ne,O as re,P as O,R as k,S as ie,T as ae,W as oe,_ as se,a as ce,b as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,j as ge,k as _e,l as ve,m as ye,n as be,o as xe,p as Se,q as Ce,r as we,s as Te,t as Ee,u as De,v as Oe,w as ke,x as Ae,y as je,z as Me}from"./index-XpolWMY4.js";function Ne(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Pe(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Fe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ie=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Le={};function Re(e,t){return((t||Le).jsx?Ie:Fe).test(e)}var ze=/[ \t\n\f\r]/g;function Be(e){return typeof e==`object`?e.type===`text`&&Ve(e.value):Ve(e)}function Ve(e){return e.replace(ze,``)===``}var He=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};He.prototype.normal={},He.prototype.property={},He.prototype.space=void 0;function Ue(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new He(n,r,t)}function We(e){return e.toLowerCase()}var A=class{constructor(e,t){this.attribute=t,this.property=e}};A.prototype.attribute=``,A.prototype.booleanish=!1,A.prototype.boolean=!1,A.prototype.commaOrSpaceSeparated=!1,A.prototype.commaSeparated=!1,A.prototype.defined=!1,A.prototype.mustUseProperty=!1,A.prototype.number=!1,A.prototype.overloadedBoolean=!1,A.prototype.property=``,A.prototype.spaceSeparated=!1,A.prototype.space=void 0;var Ge=t({boolean:()=>j,booleanish:()=>M,commaOrSpaceSeparated:()=>F,commaSeparated:()=>Je,number:()=>N,overloadedBoolean:()=>qe,spaceSeparated:()=>P}),Ke=0,j=Ye(),M=Ye(),qe=Ye(),N=Ye(),P=Ye(),Je=Ye(),F=Ye();function Ye(){return 2**++Ke}var Xe=Object.keys(Ge),Ze=class extends A{constructor(e,t,n,r){let i=-1;if(super(e,t),Qe(this,`space`,r),typeof n==`number`)for(;++i<Xe.length;){let e=Xe[i];Qe(this,Xe[i],(n&Ge[e])===Ge[e])}}};Ze.prototype.defined=!0;function Qe(e,t,n){n&&(e[t]=n)}function $e(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ze(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[We(r)]=r,n[We(a.attribute)]=r}return new He(t,n,e.space)}var et=$e({properties:{ariaActiveDescendant:null,ariaAtomic:M,ariaAutoComplete:null,ariaBusy:M,ariaChecked:M,ariaColCount:N,ariaColIndex:N,ariaColSpan:N,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:M,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:M,ariaFlowTo:P,ariaGrabbed:M,ariaHasPopup:null,ariaHidden:M,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:N,ariaLive:null,ariaModal:M,ariaMultiLine:M,ariaMultiSelectable:M,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:N,ariaPressed:M,ariaReadOnly:M,ariaRelevant:null,ariaRequired:M,ariaRoleDescription:P,ariaRowCount:N,ariaRowIndex:N,ariaRowSpan:N,ariaSelected:M,ariaSetSize:N,ariaSort:null,ariaValueMax:N,ariaValueMin:N,ariaValueNow:N,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function tt(e,t){return t in e?e[t]:t}function nt(e,t){return tt(e,t.toLowerCase())}var rt=$e({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Je,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alpha:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:P,autoFocus:j,autoPlay:j,blocking:P,capture:null,charSet:null,checked:j,cite:null,className:P,closedBy:null,colorSpace:null,cols:N,colSpan:N,command:null,commandFor:null,content:null,contentEditable:M,controls:j,controlsList:P,coords:N|Je,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:qe,draggable:M,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:P,height:N,hidden:qe,high:N,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:P,itemRef:P,itemScope:j,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:N,manifest:null,max:null,maxLength:N,media:null,method:null,min:null,minLength:N,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,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:j,optimum:N,pattern:null,ping:P,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:P,required:j,reversed:j,rows:N,rowSpan:N,sandbox:P,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootCustomElementRegistry:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shadowRootSerializable:j,shape:null,size:N,sizes:null,slot:null,span:N,spellCheck:M,src:null,srcDoc:null,srcLang:null,srcSet:null,start:N,step:null,style:null,tabIndex:N,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:M,width:N,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:N,borderColor:null,bottomMargin:N,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:N,leftMargin:N,link:null,longDesc:null,lowSrc:null,marginHeight:N,marginWidth:N,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:N,rules:null,scheme:null,scrolling:M,standby:null,summary:null,text:null,topMargin:N,valueType:null,version:null,vAlign:null,vLink:null,vSpace:N,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:j,disablePictureInPicture:j,disableRemotePlayback:j,exportParts:Je,part:P,prefix:null,property:null,results:N,security:null,unselectable:null},space:`html`,transform:nt}),it=$e({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:F,accentHeight:N,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:N,amplitude:N,arabicForm:null,ascent:N,attributeName:null,attributeType:null,azimuth:N,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:N,by:null,calcMode:null,capHeight:N,className:P,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:N,diffuseConstant:N,direction:null,display:null,dur:null,divisor:N,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:N,enableBackground:null,end:null,event:null,exponent:N,externalResourcesRequired:null,fill:null,fillOpacity:N,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:Je,g2:Je,glyphName:Je,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:N,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:N,horizOriginX:N,horizOriginY:N,id:null,ideographic:N,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:N,k:N,k1:N,k2:N,k3:N,k4:N,kernelMatrix:F,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:N,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:N,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:N,overlineThickness:N,paintOrder:null,panose1:null,path:null,pathLength:N,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:N,pointsAtY:N,pointsAtZ:N,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:F,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:F,rev:F,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:F,requiredFeatures:F,requiredFonts:F,requiredFormats:F,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:N,specularExponent:N,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:N,strikethroughThickness:N,string:null,stroke:null,strokeDashArray:F,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:N,strokeOpacity:N,strokeWidth:null,style:null,surfaceScale:N,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:F,tabIndex:N,tableValues:null,target:null,targetX:N,targetY:N,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:F,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:N,underlineThickness:N,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:N,values:null,vAlphabetic:N,vMathematical:N,vectorEffect:null,vHanging:N,vIdeographic:N,version:null,vertAdvY:N,vertOriginX:N,vertOriginY:N,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:N,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:tt}),at=$e({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ot=$e({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:nt}),st=$e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ct={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`},lt=/[A-Z]/g,ut=/-[a-z]/g,dt=/^data[-\w.:]+$/i;function ft(e,t){let n=We(t),r=t,i=A;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&dt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ut,mt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ut.test(e)){let n=e.replace(lt,pt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ze}return new i(r,t)}function pt(e){return`-`+e.toLowerCase()}function mt(e){return e.charAt(1).toUpperCase()}var ht=Ue([et,rt,at,ot,st],`html`),gt=Ue([et,it,at,ot,st],`svg`);function _t(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vt(e){return e.join(` `).trim()}var yt=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PrismHighlighter-02695Lmx.js","assets/jsx-runtime-B-hcVAMW.js","assets/InteractiveReceipt-DGC-xV7U.js","assets/translate-BDFu3ZiK.js","assets/index-Bl8pbRFj.js","assets/utils-BIZi2up3.js","assets/CustomTimeWindowDialog-CVURkiVO.js","assets/api-ToidoNW6.js","assets/session-indexes-D5gps7K8.js","assets/index-CRI1m3xN.css"])))=>i.map(i=>d[i]);
2
+ import{a as e,i as t,n,r,t as i}from"./jsx-runtime-B-hcVAMW.js";import{Bn as a,c as o,d as s,h as c,n as l,t as u}from"./utils-BIZi2up3.js";import{E as d,d as f,k as p,m,n as h,t as g}from"./translate-BDFu3ZiK.js";import{g as _,o as v}from"./session-indexes-D5gps7K8.js";import{A as y,B as b,C as x,D as S,E as C,F as w,I as T,J as E,K as ee,L as D,M as te,N as ne,O as re,P as O,R as k,S as ie,T as ae,W as oe,_ as se,a as ce,b as le,c as ue,d as de,f as fe,g as pe,h as me,i as he,j as ge,k as _e,l as ve,m as ye,n as be,o as xe,p as Se,q as Ce,r as we,s as Te,t as Ee,u as De,v as Oe,w as ke,x as Ae,y as je,z as Me}from"./index-Bl8pbRFj.js";function Ne(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Pe(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Fe=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ie=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Le={};function Re(e,t){return((t||Le).jsx?Ie:Fe).test(e)}var ze=/[ \t\n\f\r]/g;function Be(e){return typeof e==`object`?e.type===`text`&&Ve(e.value):Ve(e)}function Ve(e){return e.replace(ze,``)===``}var He=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};He.prototype.normal={},He.prototype.property={},He.prototype.space=void 0;function Ue(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new He(n,r,t)}function We(e){return e.toLowerCase()}var A=class{constructor(e,t){this.attribute=t,this.property=e}};A.prototype.attribute=``,A.prototype.booleanish=!1,A.prototype.boolean=!1,A.prototype.commaOrSpaceSeparated=!1,A.prototype.commaSeparated=!1,A.prototype.defined=!1,A.prototype.mustUseProperty=!1,A.prototype.number=!1,A.prototype.overloadedBoolean=!1,A.prototype.property=``,A.prototype.spaceSeparated=!1,A.prototype.space=void 0;var Ge=t({boolean:()=>j,booleanish:()=>M,commaOrSpaceSeparated:()=>F,commaSeparated:()=>Je,number:()=>N,overloadedBoolean:()=>qe,spaceSeparated:()=>P}),Ke=0,j=Ye(),M=Ye(),qe=Ye(),N=Ye(),P=Ye(),Je=Ye(),F=Ye();function Ye(){return 2**++Ke}var Xe=Object.keys(Ge),Ze=class extends A{constructor(e,t,n,r){let i=-1;if(super(e,t),Qe(this,`space`,r),typeof n==`number`)for(;++i<Xe.length;){let e=Xe[i];Qe(this,Xe[i],(n&Ge[e])===Ge[e])}}};Ze.prototype.defined=!0;function Qe(e,t,n){n&&(e[t]=n)}function $e(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new Ze(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[We(r)]=r,n[We(a.attribute)]=r}return new He(t,n,e.space)}var et=$e({properties:{ariaActiveDescendant:null,ariaAtomic:M,ariaAutoComplete:null,ariaBusy:M,ariaChecked:M,ariaColCount:N,ariaColIndex:N,ariaColSpan:N,ariaControls:P,ariaCurrent:null,ariaDescribedBy:P,ariaDetails:null,ariaDisabled:M,ariaDropEffect:P,ariaErrorMessage:null,ariaExpanded:M,ariaFlowTo:P,ariaGrabbed:M,ariaHasPopup:null,ariaHidden:M,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:P,ariaLevel:N,ariaLive:null,ariaModal:M,ariaMultiLine:M,ariaMultiSelectable:M,ariaOrientation:null,ariaOwns:P,ariaPlaceholder:null,ariaPosInSet:N,ariaPressed:M,ariaReadOnly:M,ariaRelevant:null,ariaRequired:M,ariaRoleDescription:P,ariaRowCount:N,ariaRowIndex:N,ariaRowSpan:N,ariaSelected:M,ariaSetSize:N,ariaSort:null,ariaValueMax:N,ariaValueMin:N,ariaValueNow:N,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function tt(e,t){return t in e?e[t]:t}function nt(e,t){return tt(e,t.toLowerCase())}var rt=$e({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:Je,acceptCharset:P,accessKey:P,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alpha:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:P,autoFocus:j,autoPlay:j,blocking:P,capture:null,charSet:null,checked:j,cite:null,className:P,closedBy:null,colorSpace:null,cols:N,colSpan:N,command:null,commandFor:null,content:null,contentEditable:M,controls:j,controlsList:P,coords:N|Je,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:qe,draggable:M,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:P,height:N,hidden:qe,high:N,href:null,hrefLang:null,htmlFor:P,httpEquiv:P,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:P,itemRef:P,itemScope:j,itemType:P,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:N,manifest:null,max:null,maxLength:N,media:null,method:null,min:null,minLength:N,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,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:j,optimum:N,pattern:null,ping:P,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:P,required:j,reversed:j,rows:N,rowSpan:N,sandbox:P,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootCustomElementRegistry:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shadowRootSerializable:j,shape:null,size:N,sizes:null,slot:null,span:N,spellCheck:M,src:null,srcDoc:null,srcLang:null,srcSet:null,start:N,step:null,style:null,tabIndex:N,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:M,width:N,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:P,axis:null,background:null,bgColor:null,border:N,borderColor:null,bottomMargin:N,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:N,leftMargin:N,link:null,longDesc:null,lowSrc:null,marginHeight:N,marginWidth:N,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:N,rules:null,scheme:null,scrolling:M,standby:null,summary:null,text:null,topMargin:N,valueType:null,version:null,vAlign:null,vLink:null,vSpace:N,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:j,disablePictureInPicture:j,disableRemotePlayback:j,exportParts:Je,part:P,prefix:null,property:null,results:N,security:null,unselectable:null},space:`html`,transform:nt}),it=$e({attributes:{accentHeight:`accent-height`,alignmentBaseline:`alignment-baseline`,arabicForm:`arabic-form`,baselineShift:`baseline-shift`,capHeight:`cap-height`,className:`class`,clipPath:`clip-path`,clipRule:`clip-rule`,colorInterpolation:`color-interpolation`,colorInterpolationFilters:`color-interpolation-filters`,colorProfile:`color-profile`,colorRendering:`color-rendering`,crossOrigin:`crossorigin`,dataType:`datatype`,dominantBaseline:`dominant-baseline`,enableBackground:`enable-background`,fillOpacity:`fill-opacity`,fillRule:`fill-rule`,floodColor:`flood-color`,floodOpacity:`flood-opacity`,fontFamily:`font-family`,fontSize:`font-size`,fontSizeAdjust:`font-size-adjust`,fontStretch:`font-stretch`,fontStyle:`font-style`,fontVariant:`font-variant`,fontWeight:`font-weight`,glyphName:`glyph-name`,glyphOrientationHorizontal:`glyph-orientation-horizontal`,glyphOrientationVertical:`glyph-orientation-vertical`,hrefLang:`hreflang`,horizAdvX:`horiz-adv-x`,horizOriginX:`horiz-origin-x`,horizOriginY:`horiz-origin-y`,imageRendering:`image-rendering`,letterSpacing:`letter-spacing`,lightingColor:`lighting-color`,markerEnd:`marker-end`,markerMid:`marker-mid`,markerStart:`marker-start`,maskType:`mask-type`,navDown:`nav-down`,navDownLeft:`nav-down-left`,navDownRight:`nav-down-right`,navLeft:`nav-left`,navNext:`nav-next`,navPrev:`nav-prev`,navRight:`nav-right`,navUp:`nav-up`,navUpLeft:`nav-up-left`,navUpRight:`nav-up-right`,onAbort:`onabort`,onActivate:`onactivate`,onAfterPrint:`onafterprint`,onBeforePrint:`onbeforeprint`,onBegin:`onbegin`,onCancel:`oncancel`,onCanPlay:`oncanplay`,onCanPlayThrough:`oncanplaythrough`,onChange:`onchange`,onClick:`onclick`,onClose:`onclose`,onCopy:`oncopy`,onCueChange:`oncuechange`,onCut:`oncut`,onDblClick:`ondblclick`,onDrag:`ondrag`,onDragEnd:`ondragend`,onDragEnter:`ondragenter`,onDragExit:`ondragexit`,onDragLeave:`ondragleave`,onDragOver:`ondragover`,onDragStart:`ondragstart`,onDrop:`ondrop`,onDurationChange:`ondurationchange`,onEmptied:`onemptied`,onEnd:`onend`,onEnded:`onended`,onError:`onerror`,onFocus:`onfocus`,onFocusIn:`onfocusin`,onFocusOut:`onfocusout`,onHashChange:`onhashchange`,onInput:`oninput`,onInvalid:`oninvalid`,onKeyDown:`onkeydown`,onKeyPress:`onkeypress`,onKeyUp:`onkeyup`,onLoad:`onload`,onLoadedData:`onloadeddata`,onLoadedMetadata:`onloadedmetadata`,onLoadStart:`onloadstart`,onMessage:`onmessage`,onMouseDown:`onmousedown`,onMouseEnter:`onmouseenter`,onMouseLeave:`onmouseleave`,onMouseMove:`onmousemove`,onMouseOut:`onmouseout`,onMouseOver:`onmouseover`,onMouseUp:`onmouseup`,onMouseWheel:`onmousewheel`,onOffline:`onoffline`,onOnline:`ononline`,onPageHide:`onpagehide`,onPageShow:`onpageshow`,onPaste:`onpaste`,onPause:`onpause`,onPlay:`onplay`,onPlaying:`onplaying`,onPopState:`onpopstate`,onProgress:`onprogress`,onRateChange:`onratechange`,onRepeat:`onrepeat`,onReset:`onreset`,onResize:`onresize`,onScroll:`onscroll`,onSeeked:`onseeked`,onSeeking:`onseeking`,onSelect:`onselect`,onShow:`onshow`,onStalled:`onstalled`,onStorage:`onstorage`,onSubmit:`onsubmit`,onSuspend:`onsuspend`,onTimeUpdate:`ontimeupdate`,onToggle:`ontoggle`,onUnload:`onunload`,onVolumeChange:`onvolumechange`,onWaiting:`onwaiting`,onZoom:`onzoom`,overlinePosition:`overline-position`,overlineThickness:`overline-thickness`,paintOrder:`paint-order`,panose1:`panose-1`,pointerEvents:`pointer-events`,referrerPolicy:`referrerpolicy`,renderingIntent:`rendering-intent`,shapeRendering:`shape-rendering`,stopColor:`stop-color`,stopOpacity:`stop-opacity`,strikethroughPosition:`strikethrough-position`,strikethroughThickness:`strikethrough-thickness`,strokeDashArray:`stroke-dasharray`,strokeDashOffset:`stroke-dashoffset`,strokeLineCap:`stroke-linecap`,strokeLineJoin:`stroke-linejoin`,strokeMiterLimit:`stroke-miterlimit`,strokeOpacity:`stroke-opacity`,strokeWidth:`stroke-width`,tabIndex:`tabindex`,textAnchor:`text-anchor`,textDecoration:`text-decoration`,textRendering:`text-rendering`,transformOrigin:`transform-origin`,typeOf:`typeof`,underlinePosition:`underline-position`,underlineThickness:`underline-thickness`,unicodeBidi:`unicode-bidi`,unicodeRange:`unicode-range`,unitsPerEm:`units-per-em`,vAlphabetic:`v-alphabetic`,vHanging:`v-hanging`,vIdeographic:`v-ideographic`,vMathematical:`v-mathematical`,vectorEffect:`vector-effect`,vertAdvY:`vert-adv-y`,vertOriginX:`vert-origin-x`,vertOriginY:`vert-origin-y`,wordSpacing:`word-spacing`,writingMode:`writing-mode`,xHeight:`x-height`,playbackOrder:`playbackorder`,timelineBegin:`timelinebegin`},properties:{about:F,accentHeight:N,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:N,amplitude:N,arabicForm:null,ascent:N,attributeName:null,attributeType:null,azimuth:N,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:N,by:null,calcMode:null,capHeight:N,className:P,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:N,diffuseConstant:N,direction:null,display:null,dur:null,divisor:N,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:N,enableBackground:null,end:null,event:null,exponent:N,externalResourcesRequired:null,fill:null,fillOpacity:N,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:Je,g2:Je,glyphName:Je,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:N,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:N,horizOriginX:N,horizOriginY:N,id:null,ideographic:N,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:N,k:N,k1:N,k2:N,k3:N,k4:N,kernelMatrix:F,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:N,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:N,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:N,overlineThickness:N,paintOrder:null,panose1:null,path:null,pathLength:N,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:P,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:N,pointsAtY:N,pointsAtZ:N,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:F,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:F,rev:F,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:F,requiredFeatures:F,requiredFonts:F,requiredFormats:F,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:N,specularExponent:N,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:N,strikethroughThickness:N,string:null,stroke:null,strokeDashArray:F,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:N,strokeOpacity:N,strokeWidth:null,style:null,surfaceScale:N,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:F,tabIndex:N,tableValues:null,target:null,targetX:N,targetY:N,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:F,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:N,underlineThickness:N,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:N,values:null,vAlphabetic:N,vMathematical:N,vectorEffect:null,vHanging:N,vIdeographic:N,version:null,vertAdvY:N,vertOriginX:N,vertOriginY:N,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:N,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:tt}),at=$e({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:`xlink`,transform(e,t){return`xlink:`+t.slice(5).toLowerCase()}}),ot=$e({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:nt}),st=$e({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),ct={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`},lt=/[A-Z]/g,ut=/-[a-z]/g,dt=/^data[-\w.:]+$/i;function ft(e,t){let n=We(t),r=t,i=A;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&dt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(ut,mt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!ut.test(e)){let n=e.replace(lt,pt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=Ze}return new i(r,t)}function pt(e){return`-`+e.toLowerCase()}function mt(e){return e.charAt(1).toUpperCase()}var ht=Ue([et,rt,at,ot,st],`html`),gt=Ue([et,it,at,ot,st],`svg`);function _t(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vt(e){return e.join(` `).trim()}var yt=r(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
3
3
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),bt=r((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(yt());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),xt=r((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),St=r(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(bt()),r=xt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ct=Tt(`end`),wt=Tt(`start`);function Tt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Et(e){let t=wt(e),n=Ct(e);if(t&&n)return{start:t,end:n}}function Dt(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?kt(e.position):`start`in e||`end`in e?kt(e):`line`in e||`column`in e?Ot(e):``}function Ot(e){return At(e&&e.line)+`:`+At(e&&e.column)}function kt(e){return Ot(e&&e.start)+`-`+Ot(e&&e.end)}function At(e){return e&&typeof e==`number`?e:1}var I=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Dt(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};I.prototype.file=``,I.prototype.name=``,I.prototype.reason=``,I.prototype.message=``,I.prototype.stack=``,I.prototype.column=void 0,I.prototype.line=void 0,I.prototype.ancestors=void 0,I.prototype.cause=void 0,I.prototype.fatal=void 0,I.prototype.place=void 0,I.prototype.ruleId=void 0,I.prototype.source=void 0;var jt=e(St(),1),Mt={}.hasOwnProperty,Nt=new Map,Pt=/[A-Z]/g,Ft=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),It=new Set([`td`,`th`]),Lt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Rt(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=Yt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Jt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?gt:ht,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=zt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function zt(e,t,n){if(t.type===`element`)return Bt(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return Vt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Ut(e,t,n);if(t.type===`mdxjsEsm`)return Ht(e,t);if(t.type===`root`)return Wt(e,t,n);if(t.type===`text`)return Gt(e,t)}function Bt(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=gt,e.schema=i),e.ancestors.push(t);let a=tn(e,t.tagName,!1),o=Xt(e,t),s=Qt(e,t);return Ft.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Be(e)})),Kt(e,o,a,t),qt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Vt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}nn(e,t.position)}function Ht(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);nn(e,t.position)}function Ut(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=gt,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:tn(e,t.name,!0),o=Zt(e,t),s=Qt(e,t);return Kt(e,o,a,t),qt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Wt(e,t,n){let r={};return qt(r,Qt(e,t)),e.create(t,e.Fragment,r,n)}function Gt(e,t){return t.value}function Kt(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Jt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function Yt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=wt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Xt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Mt.call(t.properties,i)){let a=$t(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&It.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Zt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else nn(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else nn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Qt(e,t){let n=[],r=-1,i=e.passKeys?new Map:Nt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=zt(e,a,o);s!==void 0&&n.push(s)}return n}function $t(e,t,n){let r=ft(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Pe(n):vt(n)),r.property===`style`){let t=typeof n==`object`?n:en(e,String(n));return e.stylePropertyNameCase===`css`&&(t=rn(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?ct[r.property]||r.property:r.attribute,n]}}function en(e,t){try{return(0,jt.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new I("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Lt+`#cannot-parse-style-attribute`,r}}function tn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Re(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Re(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Mt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);nn(e)}function nn(e,t){let n=new I("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Lt+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function rn(e){let t={},n;for(n in e)Mt.call(e,n)&&(t[an(n)]=e[n]);return t}function an(e){let t=e.replace(Pt,on);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function on(e){return`-`+e.toLowerCase()}var sn={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`]},cn={};function ln(e,t){let n=t||cn;return un(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function un(e,t,n){if(fn(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return dn(e.children,t,n)}return Array.isArray(e)?dn(e,t,n):``}function dn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=un(e[i],t,n);return r.join(``)}function fn(e){return!!(e&&typeof e==`object`)}var pn=document.createElement(`i`);function mn(e){let t=`&`+e+`;`;pn.innerHTML=t;let n=pn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function hn(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function L(e,t){return e.length>0?(hn(e,e.length,0,t),e):t}var gn={}.hasOwnProperty;function _n(e){let t={},n=-1;for(;++n<e.length;)vn(t,e[n]);return t}function vn(e,t){let n;for(n in t){let r=(gn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){gn.call(r,a)||(r[a]=[]);let e=i[a];yn(r[a],Array.isArray(e)?e:e?[e]:[])}}}function yn(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);hn(e,0,0,r)}function bn(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function xn(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Sn=An(/[A-Za-z]/),R=An(/[\dA-Za-z]/),Cn=An(/[#-'*+\--9=?A-Z^-~]/);function wn(e){return e!==null&&(e<32||e===127)}var Tn=An(/\d/),En=An(/[\dA-Fa-f]/),Dn=An(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function B(e){return e!==null&&(e<0||e===32)}function V(e){return e===-2||e===-1||e===32}var On=An(/\p{P}|\p{S}/u),kn=An(/\s/);function An(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function jn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&R(e.charCodeAt(n+1))&&R(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function H(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return V(r)?(e.enter(n),s(r)):t(r)}function s(r){return V(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}var Mn={tokenize:Nn};function Nn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return z(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Pn={tokenize:In},Fn={tokenize:Ln};function In(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;return hn(t.events,a+1,0,t.events.slice(n)),t.events.length=s,l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Fn,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(Fn,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return z(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;hn(t.events,a+1,0,t.events.slice(n)),t.events.length=e}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Ln(e,t,n){return H(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Rn(e){if(e===null||B(e)||kn(e))return 1;if(On(e))return 2}function zn(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Bn={name:`attention`,resolveAll:Vn,tokenize:Hn};function Vn(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};Un(d,-c),Un(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=L(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=L(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=L(l,zn(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=L(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=L(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,hn(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Hn(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Rn(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Rn(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function Un(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var Wn={name:`autolink`,tokenize:Gn};function Gn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Sn(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||R(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||R(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||wn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Cn(t)?(e.consume(t),l):n(t)}function u(e){return R(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||R(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var Kn={partial:!0,tokenize:qn};function qn(e,t,n){return r;function r(t){return V(t)?H(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||z(e)?t(e):n(e)}}var Jn={continuation:{tokenize:Xn},exit:Zn,name:`blockQuote`,tokenize:Yn};function Yn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return V(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function Xn(e,t,n){let r=this;return i;function i(t){return V(t)?H(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Jn,t,n)(r)}}function Zn(e){e.exit(`blockQuote`)}var Qn={name:`characterEscape`,tokenize:$n};function $n(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Dn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var er={name:`characterReference`,tokenize:tr};function tr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=R,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=En,u):(e.enter(`characterReferenceValue`),a=7,o=Tn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===R&&!mn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var nr={partial:!0,tokenize:ar},rr={concrete:!0,name:`codeFenced`,tokenize:ir};function ir(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),V(t)?H(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||z(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(nr,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):V(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),H(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||z(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&V(t)?H(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||z(t)?e.check(nr,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||z(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),V(t)?H(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),V(t)?H(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||z(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function ar(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var or={name:`codeIndented`,tokenize:cr},sr={partial:!0,tokenize:lr};function cr(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),H(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):z(t)?e.attempt(sr,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||z(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function lr(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):H(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):z(e)?i(e):n(e)}}var ur={name:`codeText`,previous:fr,resolve:dr,tokenize:pr};function dr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function fr(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function pr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||z(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var mr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&hr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),hr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),hr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);hr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);hr(this.left,t.reverse())}}}};function hr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function gr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new mr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,_r(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return hn(e,0,1/0,u.slice(0)),!l}function _r(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var vr={resolve:br,tokenize:xr},yr={partial:!0,tokenize:Sr};function br(e){return gr(e),e}function xr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):z(t)?e.check(yr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Sr(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,a,`linePrefix`)}function a(i){if(i===null||z(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Cr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||wn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||z(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||B(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||wn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function wr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):z(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||z(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!V(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Tr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),H(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||z(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Er(e,t){let n;return r;function r(i){return z(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):V(i)?H(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Dr={name:`definition`,tokenize:kr},Or={partial:!0,tokenize:Ar};function kr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return wr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return B(t)?Er(e,l)(t):l(t)}function l(t){return Cr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Or,d,d)(t)}function d(t){return V(t)?H(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||z(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Ar(e,t,n){return r;function r(t){return B(t)?Er(e,i)(t):n(t)}function i(t){return Tr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return V(t)?H(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||z(e)?t(e):n(e)}}var jr={name:`hardBreakEscape`,tokenize:Mr};function Mr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return z(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Nr={name:`headingAtx`,resolve:Pr,tokenize:Fr};function Pr(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},hn(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function Fr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||B(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||z(n)?(e.exit(`atxHeading`),t(n)):V(n)?H(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||B(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Ir=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Lr=[`pre`,`script`,`style`,`textarea`],Rr={concrete:!0,name:`htmlFlow`,resolveTo:Vr,tokenize:Hr},zr={partial:!0,tokenize:Wr},Br={partial:!0,tokenize:Ur};function Vr(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Hr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:oe):Sn(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Sn(a)?(e.consume(a),i=4,r.interrupt?t:oe):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:oe):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:D:m):n(i)}function h(t){return Sn(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||B(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Lr.includes(l)?(i=1,r.interrupt?t(s):D(s)):Ir.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):D(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||R(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:D):n(i)}function v(t){return V(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||Sn(t)?(e.consume(t),b):V(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||R(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):V(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):V(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||z(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||B(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||V(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||z(t)?D(t):V(t)?(e.consume(t),ee):n(t)}function D(t){return t===45&&i===2?(e.consume(t),O):t===60&&i===1?(e.consume(t),k):t===62&&i===4?(e.consume(t),se):t===63&&i===3?(e.consume(t),oe):t===93&&i===5?(e.consume(t),ae):z(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(zr,ce,te)(t)):t===null||z(t)?(e.exit(`htmlFlowData`),te(t)):(e.consume(t),D)}function te(t){return e.check(Br,ne,ce)(t)}function ne(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||z(t)?te(t):(e.enter(`htmlFlowData`),D(t))}function O(t){return t===45?(e.consume(t),oe):D(t)}function k(t){return t===47?(e.consume(t),o=``,ie):D(t)}function ie(t){if(t===62){let n=o.toLowerCase();return Lr.includes(n)?(e.consume(t),se):D(t)}return Sn(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ie):D(t)}function ae(t){return t===93?(e.consume(t),oe):D(t)}function oe(t){return t===62?(e.consume(t),se):t===45&&i===2?(e.consume(t),oe):D(t)}function se(t){return t===null||z(t)?(e.exit(`htmlFlowData`),ce(t)):(e.consume(t),se)}function ce(n){return e.exit(`htmlFlow`),t(n)}}function Ur(e,t,n){let r=this;return i;function i(t){return z(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function Wr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Kn,t,n)}}var Gr={name:`htmlText`,tokenize:Kr};function Kr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Sn(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Sn(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):z(t)?(o=d,k(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?O(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):z(t)?(o=h,k(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?O(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?O(t):z(t)?(o=v,k(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):z(t)?(o=y,k(t)):(e.consume(t),y)}function b(e){return e===62?O(e):y(e)}function x(t){return Sn(t)?(e.consume(t),S):n(t)}function S(t){return t===45||R(t)?(e.consume(t),S):C(t)}function C(t){return z(t)?(o=C,k(t)):V(t)?(e.consume(t),C):O(t)}function w(t){return t===45||R(t)?(e.consume(t),w):t===47||t===62||B(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),O):t===58||t===95||Sn(t)?(e.consume(t),E):z(t)?(o=T,k(t)):V(t)?(e.consume(t),T):O(t)}function E(t){return t===45||t===46||t===58||t===95||R(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),D):z(t)?(o=ee,k(t)):V(t)?(e.consume(t),ee):T(t)}function D(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,te):z(t)?(o=D,k(t)):V(t)?(e.consume(t),D):(e.consume(t),ne)}function te(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):z(t)?(o=te,k(t)):(e.consume(t),te)}function ne(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||B(t)?T(t):(e.consume(t),ne)}function re(e){return e===47||e===62||B(e)?T(e):n(e)}function O(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function k(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return V(t)?H(e,ae,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ae(t)}function ae(t){return e.enter(`htmlTextData`),o(t)}}var qr={name:`labelEnd`,resolveAll:Zr,resolveTo:Qr,tokenize:$r},Jr={tokenize:ei},Yr={tokenize:ti},Xr={tokenize:ni};function Zr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&hn(e,0,e.length,n),e}function Qr(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=L(s,e.slice(a+1,a+r+3)),s=L(s,[[`enter`,u,t]]),s=L(s,zn(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=L(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=L(s,e.slice(o+1)),s=L(s,[[`exit`,c,t]]),hn(e,a,e.length,s),e}function $r(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(xn(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Jr,u,o?u:d)(t):t===91?e.attempt(Yr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Xr,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function ei(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return B(t)?Er(e,a)(t):a(t)}function a(t){return t===41?u(t):Cr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return B(t)?Er(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Tr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return B(t)?Er(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function ti(e,t,n){let r=this;return i;function i(t){return wr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(xn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function ni(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var ri={name:`labelStartImage`,resolveAll:qr.resolveAll,tokenize:ii};function ii(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var ai={name:`labelStartLink`,resolveAll:qr.resolveAll,tokenize:oi};function oi(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}var si={name:`lineEnding`,tokenize:ci};function ci(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),H(e,t,`linePrefix`)}}var li={name:`thematicBreak`,tokenize:ui};function ui(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||z(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),V(t)?H(e,s,`whitespace`)(t):s(t))}}var U={continuation:{tokenize:mi},exit:gi,name:`list`,tokenize:pi},di={partial:!0,tokenize:_i},fi={partial:!0,tokenize:hi};function pi(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Tn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(li,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Tn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Kn,r.interrupt?n:u,e.attempt(di,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return V(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function mi(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Kn,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,H(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!V(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(fi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,H(e,e.attempt(U,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function hi(e,t,n){let r=this;return H(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function gi(e){e.exit(this.containerState.type)}function _i(e,t,n){let r=this;return H(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!V(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var vi={name:`setextUnderline`,resolveTo:yi,tokenize:bi};function yi(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function bi(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),V(t)?H(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||z(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var xi={tokenize:Si};function Si(e){let t=this,n=e.attempt(Kn,r,e.attempt(this.parser.constructs.flowInitial,i,H(e,e.attempt(this.parser.constructs.flow,i,e.attempt(vr,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Ci={resolveAll:Di()},wi=Ei(`string`),Ti=Ei(`text`);function Ei(e){return{resolveAll:Di(e===`text`?Oi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Di(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Oi(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type===`lineEnding`)&&e[n-1][1].type===`data`){let r=e[n-1][1],i=t.sliceStream(r),a=i.length,o=-1,s=0,c;for(;a--;){let e=i[a];if(typeof e==`string`){for(o=e.length;e.charCodeAt(o-1)===32;)s++,o--;if(o)break;o=-1}else if(e===-2)c=!0,s++;else if(e!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(s=0),s){let i={type:n===e.length||c||s<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:a?o:r.start._bufferIndex+o,_index:r.start._index+a,line:r.end.line,column:r.end.column-s,offset:r.end.offset-s},end:{...r.end}};r.end={...i.start},r.start.offset===r.end.offset?Object.assign(r,i):(e.splice(n,0,[`enter`,i,t],[`exit`,i,t]),n+=2)}n++}return e}var ki=t({attentionMarkers:()=>Li,contentInitial:()=>ji,disable:()=>Ri,document:()=>Ai,flow:()=>Ni,flowInitial:()=>Mi,insideSpan:()=>Ii,string:()=>Pi,text:()=>Fi}),Ai={42:U,43:U,45:U,48:U,49:U,50:U,51:U,52:U,53:U,54:U,55:U,56:U,57:U,62:Jn},ji={91:Dr},Mi={[-2]:or,[-1]:or,32:or},Ni={35:Nr,42:li,45:[vi,li],60:Rr,61:vi,95:li,96:rr,126:rr},Pi={38:er,92:Qn},Fi={[-5]:si,[-4]:si,[-3]:si,33:ri,38:er,42:Bn,60:[Wn,Gr],91:ai,92:[jr,Qn],93:qr,95:Bn,96:ur},Ii={null:[Bn,Ci]},Li={null:[42,95]},Ri={null:[]};function zi(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=L(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=zn(a,l.events,l),l.events):[]}function f(e,t){return Vi(p(e),t)}function p(e){return Bi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){let e;for(;r._index<o.length;){let t=o[r._index];if(typeof t==`string`)for(e=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===e&&r._bufferIndex<t.length;)_(t.charCodeAt(r._bufferIndex));else _(t)}}function _(e){u=u(e)}function v(e){z(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&hn(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Bi(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Vi(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
4
4
  `;break;case-3:o=`\r
5
5
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function Hi(e){let t={constructs:_n([ki,...(e||{}).extensions||[]]),content:n(Mn),defined:[],document:n(Pn),flow:n(xi),lazy:{},string:n(wi),text:n(Ti)};return t;function n(e){return n;function n(n){return zi(t,e,n)}}}function Ui(e){for(;!gr(e););return e}var Wi=/[\0\t\n\r]/g;function Gi(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){let s=[],c,l,u,d,f;for(i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i)),u=0,t=``,n&&=(i.charCodeAt(0)===65279&&u++,void 0);u<i.length;){if(Wi.lastIndex=u,c=Wi.exec(i),d=c&&c.index!==void 0?c.index:i.length,f=i.charCodeAt(d),!c){t=i.slice(u);break}if(f===10&&u===d&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),u<d&&(s.push(i.slice(u,d)),e+=d-u),f){case 0:s.push(65533),e++;break;case 9:for(l=Math.ceil(e/4)*4,s.push(-2);e++<l;)s.push(-1);break;case 10:s.push(-4),e=1;break;default:r=!0,e=1}u=d+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var Ki=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function qi(e){return e.replace(Ki,Ji)}function Ji(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return bn(n.slice(t?2:1),t?16:10)}return mn(n)||e}var Yi={}.hasOwnProperty;function Xi(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),Zi(n)(Ui(Hi(n).document().write(Gi()(e,t,!0))))}function Zi(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(Te),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(xe),blockQuote:a(ge),characterEscape:T,characterReference:T,codeFenced:a(_e),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(_e,o),codeText:a(ve,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(ye),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(be),hardBreakEscape:a(Se),hardBreakTrailing:a(Se),htmlFlow:a(Ce,o),htmlFlowData:T,htmlText:a(Ce,o),htmlTextData:T,image:a(we),label:o,link:a(Te),listItem:a(De),listItemValue:f,listOrdered:a(Ee,d),listUnordered:a(Ee),paragraph:a(Oe),reference:le,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(xe),strong:a(ke),thematicBreak:a(je)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:he,autolinkProtocol:me,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:de,characterReferenceMarkerNumeric:de,characterReferenceValue:fe,characterReference:pe,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(re),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(D),hardBreakTrailing:c(D),htmlFlow:c(te),htmlFlowData:E,htmlText:c(ne),htmlTextData:E,image:c(k),label:ae,labelText:ie,lineEnding:ee,link:c(O),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:oe,resourceTitleString:se,resource:ce,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};$i(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];Yi.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||ta).call(a,void 0,e[0])}for(r.position={start:Qi(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Qi(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:Qi(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||ta).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Dt({start:e.start,end:e.end})+`): it’s not open`);n.position.end=Qi(e.end)}function u(){return ln(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=xn(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ae(),n.position={start:Qi(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=Qi(e.end)}function ee(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=Qi(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function D(){this.data.atHardBreak=!0}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ie(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=qi(t),n.identifier=xn(t).toLowerCase()}function ae(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function oe(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function se(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function ce(){this.data.inReference=void 0}function le(){this.data.referenceType=`collapsed`}function ue(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=xn(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function de(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=bn(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=mn(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=Qi(e.end)}function me(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function he(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ge(){return{type:`blockquote`,children:[]}}function _e(){return{type:`code`,lang:null,meta:null,value:``}}function ve(){return{type:`inlineCode`,value:``}}function ye(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function be(){return{type:`emphasis`,children:[]}}function xe(){return{type:`heading`,depth:0,children:[]}}function Se(){return{type:`break`}}function Ce(){return{type:`html`,value:``}}function we(){return{type:`image`,title:null,url:``,alt:null}}function Te(){return{type:`link`,title:null,url:``,children:[]}}function Ee(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function De(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function Oe(){return{type:`paragraph`,children:[]}}function ke(){return{type:`strong`,children:[]}}function Ae(){return{type:`text`,value:``}}function je(){return{type:`thematicBreak`}}}function Qi(e){return{line:e.line,column:e.column,offset:e.offset}}function $i(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?$i(e,r):ea(e,r)}}function ea(e,t){let n;for(n in t)if(Yi.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function ta(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Dt({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Dt({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Dt({start:t.start,end:t.end})+`) is still open`)}function na(e){let t=this;t.parser=n;function n(n){return Xi(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ra(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ia(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -43,11 +43,11 @@ import{a as e,i as t,n,r,t as i}from"./jsx-runtime-B-hcVAMW.js";import{Bn as a,c
43
43
  `)||e}function Ou(e,t,n){let r=Dl(e,t,n),i=Js(e),a=q(K(t.metadataValue).namespace),o=e=>Z(e,n),s=e=>pl(e,n);if(i===`skill`)return Ol(e,t,r,n);if(i===`js`&&(a===`mcp__node_repl__`||a===`mcp__node_repl__.js`)){let e=q(K(t.inputValue).title);return{...r,Icon:O,title:g(`Browser`),secondaryText:e||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:Du(X(t)),language:`text`,isCode:!1}}}if(i===`exec_command`||i===`bash`){let e=cu(t.inputValue,X(t),_l,o,s);return{...r,Icon:O,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(i===`write_stdin`){let e=lu(t.inputValue,X(t),_l);return{...r,Icon:O,title:`bash`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:e.outputAnalysis.text,language:e.outputAnalysis.language,isCode:e.outputAnalysis.isCode}}}if(i===`request_user_input`){let e=uu(t.inputValue,X(t));return{...r,Icon:me,title:`ask`,secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:e.outputContent}}if(i===`patch`){let n=yu(t.inputValue),i=xu(n);return{...r,Icon:Oe,title:Ys(e,`patch`),secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:wu(n,X(t),_l,o)}}if(i===`update_plan`){let e=du(t.inputValue);return{...r,Icon:ae,title:g(`update plan`),secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,contentLabel:g(`Plan`),outputContent:{kind:`task-list`,items:e.items}}}if(i===`web__run`){let e=pu(t.inputValue);return{...r,Icon:le,title:e.title,secondaryText:e.secondaryText,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`markdown`,isCode:!1}}}if(i===`view_image`){let e=mu(t.inputValue,o);return{...r,Icon:x,title:g(`view image`),secondaryText:e.secondaryText,details:e.details,showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`text`,isCode:!1}}}if(i===`subagent`){let n=K(t.inputValue),i=Is(n.task_name),a=Is(n.model),o=Is(n.reasoning_effort),s=Is(n.fork_turns),c=Is(n.service_tier)===`priority`,l=X(t);return{...r,Icon:ce,title:i||Ys(e,`subagent`),secondaryText:void 0,details:[a?{label:g(`Model`),value:c?g(`{0} · Fast`,[a]):a}:null,o?{label:g(`Effort`),value:o}:null,s?{label:g(`Fork`),value:s}:null].filter(e=>e!==null),showInputPreview:!1,outputContent:{kind:`plain`,text:l,language:`markdown`,isCode:!1}}}if(i===`collaboration.send_message`||i===`collaboration.followup_task`){let e=K(t.inputValue),n=q(e.target),a=q(e.message);return{...r,Icon:re,title:i.endsWith(`followup_task`)?g(`follow up with agent`):g(`message agent`),secondaryText:n||void 0,details:[],showInputPreview:!1,contentLabel:g(`Message`),outputContent:{kind:`property-list`,items:[n?{label:g(`Recipient`),value:n}:null,a?{label:g(`Message`),value:a}:null].filter(e=>e!=null)}}}if(i===`collaboration.wait_agent`||i===`wait`){let e=K(t.inputValue).timeout_ms;return{...r,Icon:pe,title:g(`wait for agents`),secondaryText:typeof e==`number`?g(`{0}s timeout`,[Math.round(e/1e3)]):void 0,details:[],showInputPreview:!1,contentLabel:g(`Agent updates`)}}if(i===`collaboration.list_agents`)return{...r,Icon:D,title:g(`list agents`),secondaryText:void 0,details:[],showInputPreview:!1,contentLabel:g(`Agent tree`)};if(i===`collaboration.interrupt_agent`){let e=q(K(t.inputValue).target);return{...r,Icon:D,title:g(`interrupt agent`),secondaryText:e||void 0,details:[],showInputPreview:!1,contentLabel:g(`Result`)}}if(i===`create_goal`||i===`get_goal`||i===`update_goal`){let e=K(t.inputValue);return{...r,Icon:w,title:Tu(i),secondaryText:q(e.objective)||q(e.status)||void 0,details:[],showInputPreview:!1,contentLabel:g(`Goal state`)}}if(a.startsWith(`mcp__`)||i.includes(`._`)){let e=K(t.inputValue),[n,a=`tool`]=i.split(`.`,2),o=Object.entries(e).map(([e,t])=>({label:e,value:t})),s=Bs(t.outputValue);return{...r,Icon:te,title:`${Tu(n??`integration`)} · ${Tu(a)}`,secondaryText:Eu(e)||void 0,details:[],showInputPreview:!1,contentLabel:g(s?`Result`:`Request`),outputContent:s??(o.length>0?{kind:`property-list`,items:o}:r.outputContent)}}return r}function ku(e){return e&&typeof e==`object`&&!Array.isArray(e)?e:typeof e==`string`&&Ls(e)||{}}function Au(e){let t=J(ku(e).contents);return t?Y(t):g(`No output captured.`)}function ju(e){let t=ku(e),n=Array.isArray(t.directories)?t.directories:[];if(n.length===0)return Xs(e);let r=n.flatMap(e=>{let t=K(e);return[q(t.absPath),...(Array.isArray(t.files)?t.files:[]).map(e=>{let t=K(e);return q(t.relPath)||q(t.absPath)}).filter(Boolean).map(e=>` ${e}`)].filter(Boolean)});return r.length>0?r.join(`
44
44
  `):g(`No output captured.`)}function Mu(e,t,n){let r=Dl(e,t,n),i=e.tool.toLowerCase(),a=K(t.inputValue),o=ul(t.inputValue),s=Z(o,n);if(i===`read_file_v2`){let e=Au(t.outputValue);return Sl({defaultStrategy:r,state:t,filePath:o,displayPath:s,text:e,details:e===g(`No output captured.`)?[{label:g(`Lines`),value:q(ku(t.outputValue).totalLinesInFile)}]:[],isCode:e!==g(`No output captured.`)})}if(i===`edit_file_v2`){let e=Y(J(a.streamingContent));return wl({defaultStrategy:r,displayPath:s,outputContent:{kind:`plain`,text:e||X(t),language:e?`diff`:`text`,isCode:!!e}})}if(i===`ripgrep_raw_search`){let e=q(a.pattern),i=[Z(q(a.path),n),e].filter(Boolean).join(` · `);return{...r,Icon:le,title:`grep`,secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`text`,isCode:!1}}}if(i===`glob_file_search`){let e=q(a.globPattern),i=[Z(q(a.targetDirectory),n),e].filter(Boolean).join(` · `);return{...r,Icon:le,title:`glob`,secondaryText:i||void 0,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:ju(t.outputValue),language:`text`,isCode:!1}}}if(i===`run_terminal_command_v2`){let e=pl(q(a.command),n),i=q(a.commandDescription),o=i?`${i}${e?` (${e})`:``}`:e?`(${e})`:void 0;return{...r,Icon:O,title:`bash`,secondaryText:o,details:[],showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`text`,isCode:!1}}}return{...r,title:Ys(e)}}var Nu=[`FileNotFound`,`IsADirectory`,`PermissionDenied`,`FileTooLarge`,`FileReadError`,`ImageSizeError`];function Pu(e){return typeof e==`number`&&Number.isSafeInteger(e)?e:null}function Fu(e){let t=K(e.outputValue);return Object.keys(t).length>0?t:K(e.errorValue)}function Iu(e){let t=q(e.message)||q(e.content)||q(e.text);if(t)return t;for(let t of Nu){let n=q(e[t]);if(n)return n}return q(K(e.Error).message)||q(e.error)}function Lu(e,t,n){let r=[],i=Pu(e.total_lines),a=Pu(e.offset),o=Pu(e.limit),s=q(t.mime_type),c=Pu(n.total_pages);return i!==null&&i>=0&&r.push({label:g(`Lines`),value:String(i)}),a!==null&&a>=0&&r.push({label:g(`Offset`),value:String(a)}),o!==null&&o>=0&&r.push({label:g(`Limit`),value:String(o)}),s&&r.push({label:g(`Format`),value:s}),c!==null&&c>=0&&r.push({label:g(`Pages`),value:String(c)}),r}function Ru(e,t){let n=[],r=J(e.data),i=q(e.mime_type);r&&i&&n.push({type:`image`,data:r,mime_type:i});let a=Array.isArray(t.pages)?t.pages:[];for(let e of a){let t=K(e),r=J(t.data),i=q(t.mime_type);r&&i&&n.push({type:`image`,data:r,mime_type:i})}return Bs(n)}function zu(e,t,n){let r=K(e.inputValue),i=Fu(e),a=K(i.FileContent),o=K(i.ImageContent),s=K(i.PdfPageImages),c=q(a.absolute_path)||q(r.target_file)||q(r.file_path),l=Z(c,n),u=Lu(a,o,s),d=Ru(o,s);return d?Sl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:d}):Object.keys(o).length>0||Object.keys(s).length>0?Sl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:{kind:`plain`,text:Object.keys(s).length>0?g(`PDF preview unavailable.`):g(`Image preview unavailable.`),language:`text`,isCode:!1}}):Object.keys(a).length>0?Sl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,text:J(a.raw_output)||J(a.content)||g(`File is empty.`)}):Sl({defaultStrategy:t,state:e,filePath:c,displayPath:l,details:u,outputContent:{kind:`plain`,text:Iu(i)||X(e),language:`text`,isCode:!1}})}function Bu(e){if(typeof e.output==`string`)return e.output;if(Array.isArray(e.output)){let t=e.output;return t.every(e=>typeof e==`number`&&Number.isInteger(e)&&e>=0&&e<=255)?new TextDecoder().decode(Uint8Array.from(t)):``}return J(e.output_for_prompt)}function Vu(e,t,n){let r=K(e.inputValue),i=Fu(e),a=J(r.command)||J(i.command),o=q(r.description)||q(i.description),s=pl(a,n),c=Z(q(i.current_dir),n),l=Z(q(i.output_file),n),u=Pu(i.exit_code),d=q(i.signal),f=[];s&&f.push({label:g(`Command`),value:s}),c&&f.push({label:g(`Workdir`),value:c}),u!==null&&f.push({label:g(`Exit code`),value:String(u)}),d&&f.push({label:g(`Signal`),value:d}),i.timed_out===!0&&f.push({label:g(`Timed out`),value:g(`Yes`)}),i.truncated===!0&&(f.push({label:g(`Output`),value:g(`Truncated`)}),l&&f.push({label:g(`Full output`),value:l}));let p=Bu(i)||Iu(i),m=e.status===`error`||u!==null&&u!==0;return{...t,Icon:O,title:`bash`,secondaryText:o||Is(s).slice(0,120)||void 0,details:f,showInputPreview:!1,contentLabel:g(m?`Error`:`Terminal output`),outputContent:{kind:`plain`,text:p||g(`No output captured.`),language:`text`,isCode:!1}}}function Hu(e,t,n){let r=K(e.inputValue),i=Fu(e),a=K(i.Content),o=K(i.Error),s=K(i.CrossHostRedirect),c=K(a.outputLocation),l=q(r.url),u=q(a.url)||q(o.url)||l,d=Pu(a.status_code),f=Pu(a.bytes),p=q(a.content_type),m=q(i.error),h=[];d!==null&&d>=0&&h.push({label:g(`Status`),value:String(d)}),p&&h.push({label:g(`Content type`),value:p}),f!==null&&f>=0&&h.push({label:g(`Size`),value:g(`{0} bytes`,[f])}),m&&h.push({label:g(`Type`),value:m});let _=Z(q(c.filePath),n),v=q(s.redirect_url),y=q(s.original_host),b=q(i.DomainNotAllowed),x=J(a.content),S=Iu(i)||(v?g(`Cross-host redirect from {0} to {1}.`,[y||g(`the original host`),v]):``)||(b?g(`Domain not allowed: {0}`,[b]):``),C=x||S||(_?g(`Full content saved to {0}`,[_]):``)||X(e);return{...t,Icon:le,title:g(`web fetch`),secondaryText:u||void 0,details:h,showInputPreview:!1,contentLabel:e.status===`error`?g(`Error`):g(`Page content`),outputContent:{kind:`plain`,text:C,language:`markdown`,isCode:!1}}}function Uu(e,t,n){let r=Dl(e,t,n),i=Js(e),a=e.tool.trim().toLowerCase();return i===`read`||a===`read_file`?zu(t,r,n):i===`bash`||a===`run_terminal_command`?Vu(t,r,n):i===`web fetch`||a===`web_fetch`?Hu(t,r,n):r}function Wu(e){let t=K(e.inputValue),n=K(e.metadataValue),r=Array.isArray(n.tasks)?n.tasks:[],i=Number(t.id);return K(Number.isFinite(i)&&i>0?r.find(e=>Number(K(e).id)===i):r.at(-1))}function Gu(e){let t=X(e).match(/\(([^()]+?)\s*→\s*([^()]+?)\)/);return t?`${t[1]} -> ${t[2]}`:``}function Ku(e){let t=(e.split(`
45
45
  `)[0]??``).match(/^Agent:\s*(.+)$/i),n=e.split(`
46
- `).find(e=>e.includes(g(`Status:`))),r=[];return t?.[1]&&r.push({label:g(`Agent`),value:t[1].trim()}),n&&r.push({label:g(`Summary`),value:n.trim()}),r}function qu(e,t,n){let r=Dl(e,t,n),i=e.tool.toLowerCase(),a=K(t.inputValue),o=K(t.metadataValue),s=ul(t.inputValue),c=Z(s,n);if(i===`todo`){let e=q(a.action)||q(o.action)||`todo`,n=Wu(t),i=Number(n.id)||Number(a.id),s=q(n.subject)||q(a.subject),c=q(n.description)||q(a.description),l=q(n.status)||q(a.status),u=Gu(t),d=[i?`#${i}`:``,s,e===`update`&&u?u:l].filter(Boolean);return{...r,Icon:ae,title:e===`create`?g(`todo create`):e===`update`?g(`todo update`):`todo`,secondaryText:d.join(` · `)||void 0,details:[i?{label:`ID`,value:`#${i}`}:null,s?{label:g(`Subject`),value:s}:null,l?{label:g(`Status`),value:l}:null,u?{label:g(`Change`),value:u}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:c||X(t),language:`markdown`,isCode:!1}}}if(i===`read`)return Sl({defaultStrategy:r,state:t,filePath:s,displayPath:c});if(i===`write`)return Cl({defaultStrategy:r,state:t,filePath:s,displayPath:c,Icon:je});if(i===`edit`){let e=al(t,c||s),n=typeof o.firstChangedLine==`number`?String(o.firstChangedLine):J(o.firstChangedLine);return wl({defaultStrategy:r,displayPath:c,details:n?[{label:g(`Line`),value:n}]:[],outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:X(t),language:`text`,isCode:!1}})}if(i===`agent`){let e=q(a.description)||q(o.description),n=q(a.subagent_type)||q(o.subagentType),i=q(o.agentId),s=q(o.status);return{...r,Icon:ce,title:n?g(`agent · {0}`,[n]):`agent`,secondaryText:[i?`#${i}`:``,e].filter(Boolean).join(` · `),details:[i?{label:g(`Agent`),value:i}:null,n?{label:g(`Type`),value:n}:null,s?{label:g(`Status`),value:s}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:J(a.prompt)||X(t),language:`markdown`,isCode:!1}}}if(i===`get_subagent_result`){let e=q(a.agent_id),n=X(t);return{...r,Icon:ce,title:g(`subagent result`),secondaryText:e?`#${e}`:void 0,details:Ku(n),showInputPreview:!1,outputContent:{kind:`plain`,text:n,language:`markdown`,isCode:!1}}}if(i===`analyze_image`){let e=Array.isArray(a.images)?a.images.map(e=>J(e)).filter(Boolean):[],i=J(a.question);return{...r,Icon:x,title:g(`analyze image`),secondaryText:e.map(e=>Z(e,n)).join(`, `),details:[...e.map((e,t)=>({label:t===0?g(`Image`):g(`Image {0}`,[t+1]),value:Z(e,n)})),i?{label:g(`Question`),value:i}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`markdown`,isCode:!1}}}if(i===`bash`||i===`batch`){let e=pl(q(a.command),n);return{...r,Icon:O,title:i===`batch`?`batch`:`bash`,secondaryText:e?`(${e})`:void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`text`,isCode:!1}}}return r}function Ju(e,t,n){let r=Dl(e,t,n),i=K(t.inputValue),a=ul(t.inputValue),o=Z(a,n);switch(e.tool.toLowerCase()){case`bash`:{let e=El({defaultStrategy:r,state:t,title:`bash`,command:q(i.command),description:q(i.description),baseDirectory:n}),a=q(i.workdir);return a?{...e,details:[...e.details,{label:g(`Workdir`),value:Z(a,n)}]}:e}case`read`:return Sl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`write`:return Cl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`edit`:{let e=ol(t,o||a);return wl({defaultStrategy:r,displayPath:o,outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:X(t),language:`text`,isCode:!1}})}case`glob`:case`grep`:return Tl({defaultStrategy:r,state:t,title:e.tool.toLowerCase(),path:q(i.path),pattern:q(i.pattern),baseDirectory:n});default:return r}}var Yu={claudecode:Pl,opencode:Fl,kimi:Il,"kimi-code":Hl,codex:Ou,cursor:Mu,grok:Uu,pi:qu,zcode:Vl,dsh:Ju};function Xu(e,t,n,r){return(Yu[e.toLowerCase()]??Dl)(t,n,r)}function Zu(e,t){let n=0;return e.map(e=>{if(e.type!==`tool`)return e;let r=e.parts.map(()=>ec(t,n++));return{...e,anchorIds:r}})}function Qu(e){let t=[];for(let n of e){let e=Ns(n.parts);if(e.length===0)continue;let r=t.length;t.push({msg:n,blocks:Zu(e,r),index:r})}return t}function $u({messages:e,agentName:t,fileActivity:n}){let r=Qu($s(e,t)),i=Ec(r),a=rc(r);return{messages:r,toc:i,fileChangeSummary:ic(n,a.summary),select(e){let{messages:t,visibleUnitCount:n}=Ac(r,e),i=new Map(t.map((e,t)=>[e.index,t]));return{messages:t,visibleUnitCount:n,timelineEntries:pc(t),resolveListIndex(e){return i.get(e)}}},resolveMessageIndex(e){return a.anchorMessageIndexes.get(e)}}}function ed({state:e,onToggle:t,size:n=14,label:r}){let i=(0,G.useRef)(null),a=e===`indeterminate`;return(0,G.useLayoutEffect)(()=>{i.current&&(i.current.indeterminate=a)},[a]),(0,W.jsxs)(`span`,{className:`relative inline-flex shrink-0`,style:{width:n,height:n},children:[(0,W.jsx)(`input`,{ref:i,type:`checkbox`,checked:e===`checked`,"aria-checked":a?`mixed`:e===`checked`,"aria-label":r,onChange:t,className:`absolute inset-0 z-10 size-full cursor-pointer opacity-0`}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:u(`flex size-full items-center justify-center rounded-[4px] border`,e===`unchecked`?`border-[var(--console-border-strong)] bg-transparent text-transparent`:`border-[var(--brand)] bg-[var(--brand)] text-[var(--brand-fg)]`),children:a?(0,W.jsx)(_e,{className:`size-2.5 stroke-[3]`}):e===`checked`?(0,W.jsx)(Te,{className:`size-2.5 stroke-[3]`}):null})]})}function td({open:e,children:t,className:n}){return(0,W.jsx)(`div`,{className:u(`motion-collapsible`,n),"data-open":e||void 0,children:(0,W.jsx)(`div`,{className:`motion-collapsible-inner`,children:e?t():null})})}function nd(e){return e===0?`auto`:`smooth`}function rd(e,t){return e===`smooth`&&t?`auto`:e}function id(e){let t=e.parentElement;for(;t;){let{overflowY:e}=window.getComputedStyle(t);if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return window}function ad(e){return e===window}function od(e){return ad(e)?window.scrollY||(document.scrollingElement??document.documentElement).scrollTop:e.scrollTop}function sd(e){return ad(e)?window.innerHeight||900:e.clientHeight}function cd(e){return ad(e)?(document.scrollingElement??document.documentElement).scrollHeight:e.scrollHeight}function ld(e,t){if(ad(e))return t.getBoundingClientRect().top+od(e);let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.scrollTop+r.top-n.top}function ud(e,t){if(ad(e)){window.scrollTo({top:t,behavior:`auto`});return}e.scrollTo({top:t,behavior:`auto`})}function dd(e){return e.read.length+e.edit.length+e.write.length+e.delete.length}function fd({summary:e,baseDirectory:t,onJumpToAnchor:n}){h();let r=[{key:`read`,label:g(`Read`),Icon:le,items:e.read},{key:`edit`,label:g(`Edit`),Icon:Oe,items:e.edit},{key:`write`,label:g(`Write`),Icon:y,items:e.write},{key:`delete`,label:g(`Delete`),Icon:b,items:e.delete}].filter(e=>e.items.length>0);return r.length===0?null:(0,W.jsxs)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--console-border)] px-4 py-3`,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`console-mono text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:g(`File Tracker`)})]}),(0,W.jsx)(`div`,{className:`space-y-3 p-3`,children:r.map(({key:e,label:r,Icon:i,items:a})=>(0,W.jsx)(pd,{label:r,Icon:i,items:a,baseDirectory:t,onJumpToAnchor:n},e))})]})}function pd({label:e,Icon:t,items:n,baseDirectory:r,onJumpToAnchor:i}){h();let[a,o]=(0,G.useState)(!1);return(0,W.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`motion-hover flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-[var(--console-surface-muted)]`,children:[(0,W.jsx)(t,{className:`size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] font-semibold uppercase tracking-[0.12em] text-[var(--console-muted)]`,children:e}),(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:n.length}),(0,W.jsx)(ve,{className:`motion-chevron size-3.5 shrink-0 text-[var(--console-muted)]`,"data-open":a||void 0})]}),(0,W.jsx)(td,{open:a,children:()=>(0,W.jsx)(`div`,{className:`space-y-1 border-t border-[var(--console-border)] p-2`,children:n.map(e=>(0,W.jsx)(md,{item:e,baseDirectory:r,onJumpToAnchor:i},`${e.path}:${e.latestAnchorId||e.latestTime}`))})})]})}function md({item:e,baseDirectory:t,onJumpToAnchor:n}){h();let[r,i]=(0,G.useState)(0);function a(t,r){let a=e.anchors.length;if(a===0)return;let o=(t%a+a)%a;i(o);let s=e.anchors[o];s&&n(s.anchorId,r)}return(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm px-2 py-2 motion-hover hover:bg-[var(--console-surface-muted)]`,children:[(0,W.jsx)(`button`,{type:`button`,title:e.path,onClick:e=>a(r,nd(e.detail)),className:`min-w-0 flex-1 text-left`,children:(0,W.jsx)(`span`,{className:`console-mono block break-all text-xs text-[var(--console-text)]`,children:ml(e.path,t)})}),e.anchors.length>1?(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Previous {0}`,[e.path]),onClick:e=>a(r-1,nd(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,W.jsx)(fe,{className:`size-3`})}),(0,W.jsxs)(`span`,{className:`console-mono text-[10px] text-[var(--console-muted)]`,children:[r+1,`/`,e.anchors.length]}),(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Next {0}`,[e.path]),onClick:e=>a(r+1,nd(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,W.jsx)(ve,{className:`size-3`})})]}):(0,W.jsx)(`button`,{type:`button`,title:g(`Jump to tool call`),onClick:e=>a(0,nd(e.detail)),className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:e.count})]})}function hd(){return{excluded:new Set,toolQuery:``,toolsExpanded:!0}}function gd(e,t){return new Set([...e.filterIds].filter(e=>!t.has(e)))}function _d(e,t){let n=new Set(e.excluded);return n.delete(t)||n.add(t),{...e,excluded:n}}function vd(e,t){return _d(e,t)}function yd(e,t){return _d(e,t)}function bd(e,t,n){let r=new Set(e.excluded);for(let i of Dd(t,e))n?r.delete(i.id):r.add(i.id);return{...e,excluded:r}}function xd(e,t){let n=new Set(e.excluded);for(let e of t.tools)e.kind===`write`?n.delete(e.id):n.add(e.id);return{...e,excluded:n}}function Sd(e,t){return{...e,toolQuery:t}}function Cd(e){return{...e,toolsExpanded:!e.toolsExpanded}}function wd(e){return{...e,excluded:new Set,toolQuery:``}}function Td(e,t){return e.tools.reduce((e,n)=>e+ +!t.excluded.has(n.id),0)}function Ed(e,t){let n=Td(e,t);return n===0?`none`:n===e.tools.length?`all`:`partial`}function Dd(e,t){let n=t.toolQuery.trim().toLowerCase();return n?e.tools.filter(e=>e.label.toLowerCase().includes(n)):e.tools}function Od(e,t){return Ed(e,t)===`all`?[]:e.tools.filter(e=>!t.excluded.has(e.id)).map(e=>({id:e.id,label:e.label}))}function kd(e,t){return e.tools.filter(e=>t.excluded.has(e.id)).map(e=>({label:e.label,count:e.count}))}function Ad(e,t){let n=0;for(let r of _c)t.excluded.has(r)&&(n+=e.counts[r]);for(let r of e.tools)t.excluded.has(r.id)&&(n+=r.count);return n}var jd={user:`Your messages`,agent_message:`Agent replies`,thinking:`Thinking`,plan:`Plans`},Md={all:`checked`,none:`unchecked`,partial:`indeterminate`};function Nd({toc:e,state:t,actions:n,visibleUnitCount:r}){h();let i=kd(e,t);return(0,W.jsxs)(`section`,{"aria-label":g(`Content filters`),className:`flex flex-col rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[var(--console-border)] px-3 py-2.5`,children:[(0,W.jsx)(`span`,{className:`console-eyebrow`,children:g(`Content filters`)}),(0,W.jsx)(`button`,{type:`button`,onClick:n.resetAll,className:`console-mono motion-hover ml-auto rounded-sm px-1 text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:g(`Reset`)})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2.5 p-3`,children:[(0,W.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:_c.filter(t=>e.counts[t]>0).map(r=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-sm px-1 py-1`,children:[(0,W.jsx)(ed,{size:15,label:g(jd[r]),state:t.excluded.has(r)?`unchecked`:`checked`,onToggle:()=>n.toggleContentKind(r)}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-[var(--console-text)]`,children:g(jd[r])}),(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[10.5px] text-[var(--console-muted)]`,children:e.counts[r]})]},r))}),e.tools.length>0?(0,W.jsx)(Pd,{toc:e,state:t,actions:n}):null,(0,W.jsxs)(`div`,{className:`mt-auto rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-2.5`,children:[(0,W.jsx)(`span`,{className:`console-eyebrow`,children:g(`Current view`)}),(0,W.jsxs)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-[var(--console-text-secondary)]`,children:[g(`Showing`),` `,(0,W.jsx)(`b`,{className:`console-mono text-[var(--console-text)]`,children:r}),` /`,` `,(0,W.jsx)(`span`,{className:`console-mono`,children:e.totalUnitCount}),i.length>0?g(` · hiding {0}`,[i.map(e=>e.label).join(`, `)]):null]})]})]})]})}function Pd({toc:e,state:t,actions:n}){h();let r=Ed(e,t),i=Dd(e,t),a=t.toolsExpanded?ve:de;return(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-[var(--brand-line)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 bg-[var(--brand-soft)] px-2.5 py-2`,children:[(0,W.jsx)(ed,{size:15,label:g(`All tools`),state:Md[r],onToggle:()=>n.setAllTools(r!==`all`)}),(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":t.toolsExpanded,onClick:n.toggleToolsExpanded,className:`flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:[(0,W.jsx)(`span`,{className:`text-[13px] text-[var(--console-text)]`,children:g(`Tools`)}),(0,W.jsxs)(`span`,{className:`console-mono ml-auto text-[10.5px] text-[var(--console-muted)]`,children:[Td(e,t),` / `,e.tools.length,` `,g(`selected`)]}),(0,W.jsx)(a,{className:`size-3.5 shrink-0 text-[var(--console-muted)]`})]})]}),t.toolsExpanded?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--console-surface)] p-2.5`,children:[(0,W.jsx)(`input`,{type:`search`,value:t.toolQuery,"aria-label":g(`Filter tool names`),placeholder:g(`Filter tools…`),onChange:e=>n.setToolQuery(e.target.value),className:`console-mono w-full rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`}),i.map(r=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-0.5`,children:[(0,W.jsx)(ed,{size:14,label:r.label,state:t.excluded.has(r.id)?`unchecked`:`checked`,onToggle:()=>n.toggleTool(r.id)}),(0,W.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs text-[var(--console-text)]`,children:r.label}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-1 w-[34px] shrink-0 overflow-hidden rounded-[2px] bg-[var(--console-surface-sunken)]`,children:(0,W.jsx)(`span`,{className:`block h-full rounded-[2px] bg-[var(--brand)]`,style:{width:`${r.count/e.maxToolCount*100}%`}})}),(0,W.jsx)(`span`,{className:`console-mono w-5 shrink-0 text-right text-[10px] text-[var(--console-muted)]`,children:r.count})]},r.id)),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 pt-0.5`,children:[(0,W.jsxs)(Fd,{onClick:()=>n.setAllTools(!0),children:[g(`Select all (`),i.length,`)`]}),(0,W.jsxs)(Fd,{onClick:()=>n.setAllTools(!1),children:[g(`Clear all (`),i.length,`)`]}),(0,W.jsx)(Fd,{onClick:n.selectWriteToolsOnly,children:g(`Writes only`)})]})]}):null]})}function Fd({onClick:e,children:t}){return h(),(0,W.jsx)(`button`,{type:`button`,onClick:e,className:`console-mono motion-hover rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-[3px] text-[10px] text-[var(--console-text-secondary)] hover:border-[var(--brand-line)] hover:text-[var(--brand)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:t})}function Id({fileChangeSummary:e,baseDirectory:t,onJumpToAnchor:n,...r}){return h(),(0,W.jsx)(`aside`,{className:`console-scrollbar hidden min-[1025px]:sticky min-[1025px]:top-4 min-[1025px]:block min-[1025px]:max-h-[calc(100dvh-14rem)] min-[1025px]:overflow-y-auto min-[1025px]:overscroll-contain`,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(Nd,{...r}),(0,W.jsx)(fd,{summary:e,baseDirectory:t,onJumpToAnchor:n})]})})}var Ld={user:`You`,agent_message:`Reply`,thinking:`Thinking`,plan:`Plan`};function Rd(e,t){return Od(e,t).length}function zd({toc:e,state:t,actions:n}){h();let r=Od(e,t);if(r.length===0)return null;let i=_c.filter(n=>e.counts[n]>0&&!t.excluded.has(n)).map(e=>g(Ld[e]));return(0,W.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-1.5 min-[1025px]:flex`,children:[r.map(e=>(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full bg-[var(--brand)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand-fg)]`,children:[g(`Tool ·`),` `,e.label,(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Remove filter {0}`,[e.label]),onClick:()=>n.toggleTool(e.id),className:`motion-hover -mr-1 rounded-full p-0.5 opacity-80 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-[var(--brand-fg)] focus-visible:outline-none`,children:(0,W.jsx)(Me,{className:`size-2.5 stroke-[3]`})})]},e.id)),i.length>0?(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center rounded-full border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-[3px] text-[10.5px] text-[var(--console-muted)]`,children:[`+ `,i.join(` / `)]}):null]})}function Bd({hiddenCount:e,hiddenTools:t,onShowAll:n}){if(h(),e<=0)return null;let r=t.map(e=>`${e.label} ${e.count}`).join(` · `);return(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg border border-dashed border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-[15px] py-[11px]`,children:[(0,W.jsxs)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] text-[var(--console-muted)]`,children:[e,` `,g(`hidden by filters`),r?` (${r})`:``]}),(0,W.jsx)(`button`,{type:`button`,onClick:n,className:`console-mono motion-hover shrink-0 rounded-sm border border-[var(--brand-line)] bg-[var(--brand-soft)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:g(`Show all`)})]})}function Vd(e,t){let[n,r]=(0,G.useState)(hd),[i,a]=(0,G.useState)(t);return i!==t&&(a(t),r(hd())),{state:n,actions:(0,G.useMemo)(()=>({toggleContentKind:e=>r(t=>vd(t,e)),toggleTool:e=>r(t=>yd(t,e)),setAllTools:t=>r(n=>bd(n,e,t)),selectWriteToolsOnly:()=>r(t=>xd(t,e)),setToolQuery:e=>r(t=>Sd(t,e)),toggleToolsExpanded:()=>r(e=>Cd(e)),resetAll:()=>r(wd)}),[e])}}var Hd={fontSize:`0.75rem`,lineHeight:1.55},Ud=(0,G.lazy)(()=>_(()=>import(`./PrismHighlighter-BgVkYu_S.js`).then(e=>({default:e.PrismHighlighter})),__vite__mapDeps([0,1])));function Wd({text:e}){return h(),(0,W.jsx)(`pre`,{className:`console-mono m-0 overflow-x-auto whitespace-pre-wrap break-words p-3 text-[var(--code-fg)]`,style:{background:`transparent`,...Hd},children:e})}function Gd({language:e,text:t}){return h(),(0,W.jsx)(Ts,{text:t,initialBudget:bs.code,children:t=>(0,W.jsx)(be,{fallback:(0,W.jsx)(Wd,{text:t}),children:(0,W.jsx)(G.Suspense,{fallback:(0,W.jsx)(Wd,{text:t}),children:(0,W.jsx)(Ud,{language:e,text:t})})})})}var Kd={add:`text-[var(--diff-add-fg)] bg-[var(--diff-add-bg)]`,remove:`text-[var(--diff-remove-fg)] bg-[var(--diff-remove-bg)]`,hunk:`text-[var(--diff-hunk-fg)] bg-[var(--diff-hunk-bg)]`,meta:`text-[var(--diff-meta-fg)] bg-[var(--diff-meta-bg)]`,header:`text-[var(--console-text)] bg-[var(--diff-header-bg)]`,context:`text-[var(--console-text)]`};function qd(e){return Kd[e]}function Jd(e,t){return`${e}:${t}`}function Yd(e){return/^(Index:|diff\s|===)/.test(e)?`header`:e.startsWith(`@@`)?`hunk`:e.startsWith(`+++ `)||e.startsWith(`--- `)?`meta`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function Xd({text:e}){return(0,W.jsx)(Ts,{text:e,initialBudget:bs.diff,children:e=>{let t=e.split(`
46
+ `).find(e=>e.includes(g(`Status:`))),r=[];return t?.[1]&&r.push({label:g(`Agent`),value:t[1].trim()}),n&&r.push({label:g(`Summary`),value:n.trim()}),r}function qu(e,t,n){let r=Dl(e,t,n),i=e.tool.toLowerCase(),a=K(t.inputValue),o=K(t.metadataValue),s=ul(t.inputValue),c=Z(s,n);if(i===`todo`){let e=q(a.action)||q(o.action)||`todo`,n=Wu(t),i=Number(n.id)||Number(a.id),s=q(n.subject)||q(a.subject),c=q(n.description)||q(a.description),l=q(n.status)||q(a.status),u=Gu(t),d=[i?`#${i}`:``,s,e===`update`&&u?u:l].filter(Boolean);return{...r,Icon:ae,title:e===`create`?g(`todo create`):e===`update`?g(`todo update`):`todo`,secondaryText:d.join(` · `)||void 0,details:[i?{label:`ID`,value:`#${i}`}:null,s?{label:g(`Subject`),value:s}:null,l?{label:g(`Status`),value:l}:null,u?{label:g(`Change`),value:u}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:c||X(t),language:`markdown`,isCode:!1}}}if(i===`read`)return Sl({defaultStrategy:r,state:t,filePath:s,displayPath:c});if(i===`write`)return Cl({defaultStrategy:r,state:t,filePath:s,displayPath:c,Icon:je});if(i===`edit`){let e=al(t,c||s),n=typeof o.firstChangedLine==`number`?String(o.firstChangedLine):J(o.firstChangedLine);return wl({defaultStrategy:r,displayPath:c,details:n?[{label:g(`Line`),value:n}]:[],outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:X(t),language:`text`,isCode:!1}})}if(i===`agent`){let e=q(a.description)||q(o.description),n=q(a.subagent_type)||q(o.subagentType),i=q(o.agentId),s=q(o.status);return{...r,Icon:ce,title:n?g(`agent · {0}`,[n]):`agent`,secondaryText:[i?`#${i}`:``,e].filter(Boolean).join(` · `),details:[i?{label:g(`Agent`),value:i}:null,n?{label:g(`Type`),value:n}:null,s?{label:g(`Status`),value:s}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:J(a.prompt)||X(t),language:`markdown`,isCode:!1}}}if(i===`get_subagent_result`){let e=q(a.agent_id),n=X(t);return{...r,Icon:ce,title:g(`subagent result`),secondaryText:e?`#${e}`:void 0,details:Ku(n),showInputPreview:!1,outputContent:{kind:`plain`,text:n,language:`markdown`,isCode:!1}}}if(i===`analyze_image`){let e=Array.isArray(a.images)?a.images.map(e=>J(e)).filter(Boolean):[],i=J(a.question);return{...r,Icon:x,title:g(`analyze image`),secondaryText:e.map(e=>Z(e,n)).join(`, `),details:[...e.map((e,t)=>({label:t===0?g(`Image`):g(`Image {0}`,[t+1]),value:Z(e,n)})),i?{label:g(`Question`),value:i}:null].filter(e=>e!=null),showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`markdown`,isCode:!1}}}if(i===`bash`||i===`batch`){let e=pl(q(a.command),n);return{...r,Icon:O,title:i===`batch`?`batch`:`bash`,secondaryText:e?`(${e})`:void 0,showInputPreview:!1,outputContent:{kind:`plain`,text:X(t),language:`text`,isCode:!1}}}return r}function Ju(e,t,n){let r=Dl(e,t,n),i=K(t.inputValue),a=ul(t.inputValue),o=Z(a,n);switch(e.tool.toLowerCase()){case`bash`:{let e=El({defaultStrategy:r,state:t,title:`bash`,command:q(i.command),description:q(i.description),baseDirectory:n}),a=q(i.workdir);return a?{...e,details:[...e.details,{label:g(`Workdir`),value:Z(a,n)}]}:e}case`read`:return Sl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`write`:return Cl({defaultStrategy:r,state:t,filePath:a,displayPath:o});case`edit`:{let e=ol(t,o||a);return wl({defaultStrategy:r,displayPath:o,outputContent:e.length>0?{kind:`structured-diff`,blocks:e}:{kind:`plain`,text:X(t),language:`text`,isCode:!1}})}case`glob`:case`grep`:return Tl({defaultStrategy:r,state:t,title:e.tool.toLowerCase(),path:q(i.path),pattern:q(i.pattern),baseDirectory:n});default:return r}}var Yu={claudecode:Pl,opencode:Fl,kimi:Il,"kimi-code":Hl,codex:Ou,cursor:Mu,grok:Uu,pi:qu,zcode:Vl,dsh:Ju};function Xu(e,t,n,r){return(Yu[e.toLowerCase()]??Dl)(t,n,r)}function Zu(e,t){let n=0;return e.map(e=>{if(e.type!==`tool`)return e;let r=e.parts.map(()=>ec(t,n++));return{...e,anchorIds:r}})}function Qu(e){let t=[];for(let n of e){let e=Ns(n.parts);if(e.length===0)continue;let r=t.length;t.push({msg:n,blocks:Zu(e,r),index:r})}return t}function $u({messages:e,agentName:t,fileActivity:n}){let r=Qu($s(e,t)),i=Ec(r),a=rc(r);return{messages:r,toc:i,fileChangeSummary:ic(n,a.summary),select(e){let{messages:t,visibleUnitCount:n}=Ac(r,e),i=new Map(t.map((e,t)=>[e.index,t]));return{messages:t,visibleUnitCount:n,timelineEntries:pc(t),resolveListIndex(e){return i.get(e)}}},resolveMessageIndex(e){return a.anchorMessageIndexes.get(e)}}}function ed({state:e,onToggle:t,size:n=14,label:r}){let i=(0,G.useRef)(null),a=e===`indeterminate`;return(0,G.useLayoutEffect)(()=>{i.current&&(i.current.indeterminate=a)},[a]),(0,W.jsxs)(`span`,{className:`relative inline-flex shrink-0`,style:{width:n,height:n},children:[(0,W.jsx)(`input`,{ref:i,type:`checkbox`,checked:e===`checked`,"aria-checked":a?`mixed`:e===`checked`,"aria-label":r,onChange:t,className:`absolute inset-0 z-10 size-full cursor-pointer opacity-0`}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:u(`flex size-full items-center justify-center rounded-[4px] border`,e===`unchecked`?`border-[var(--console-border-strong)] bg-transparent text-transparent`:`border-[var(--brand)] bg-[var(--brand)] text-[var(--brand-fg)]`),children:a?(0,W.jsx)(_e,{className:`size-2.5 stroke-[3]`}):e===`checked`?(0,W.jsx)(Te,{className:`size-2.5 stroke-[3]`}):null})]})}function td({open:e,children:t,className:n}){return(0,W.jsx)(`div`,{className:u(`motion-collapsible`,n),"data-open":e||void 0,children:(0,W.jsx)(`div`,{className:`motion-collapsible-inner`,children:e?t():null})})}function nd(e){return e===0?`auto`:`smooth`}function rd(e,t){return e===`smooth`&&t?`auto`:e}function id(e){let t=e.parentElement;for(;t;){let{overflowY:e}=window.getComputedStyle(t);if(e===`auto`||e===`scroll`||e===`overlay`)return t;t=t.parentElement}return window}function ad(e){return e===window}function od(e){return ad(e)?window.scrollY||(document.scrollingElement??document.documentElement).scrollTop:e.scrollTop}function sd(e){return ad(e)?window.innerHeight||900:e.clientHeight}function cd(e){return ad(e)?(document.scrollingElement??document.documentElement).scrollHeight:e.scrollHeight}function ld(e,t){if(ad(e))return t.getBoundingClientRect().top+od(e);let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return e.scrollTop+r.top-n.top}function ud(e,t){if(ad(e)){window.scrollTo({top:t,behavior:`auto`});return}e.scrollTo({top:t,behavior:`auto`})}function dd(e){return e.read.length+e.edit.length+e.write.length+e.delete.length}function fd({summary:e,baseDirectory:t,onJumpToAnchor:n}){h();let r=[{key:`read`,label:g(`Read`),Icon:le,items:e.read},{key:`edit`,label:g(`Edit`),Icon:Oe,items:e.edit},{key:`write`,label:g(`Write`),Icon:y,items:e.write},{key:`delete`,label:g(`Delete`),Icon:b,items:e.delete}].filter(e=>e.items.length>0);return r.length===0?null:(0,W.jsxs)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-[var(--console-border)] px-4 py-3`,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`console-mono text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:g(`File Tracker`)})]}),(0,W.jsx)(`div`,{className:`space-y-3 p-3`,children:r.map(({key:e,label:r,Icon:i,items:a})=>(0,W.jsx)(pd,{label:r,Icon:i,items:a,baseDirectory:t,onJumpToAnchor:n},e))})]})}function pd({label:e,Icon:t,items:n,baseDirectory:r,onJumpToAnchor:i}){h();let[a,o]=(0,G.useState)(!1);return(0,W.jsxs)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>o(e=>!e),className:`motion-hover flex w-full items-center gap-2 px-3 py-2 text-left hover:bg-[var(--console-surface-muted)]`,children:[(0,W.jsx)(t,{className:`size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] font-semibold uppercase tracking-[0.12em] text-[var(--console-muted)]`,children:e}),(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:n.length}),(0,W.jsx)(ve,{className:`motion-chevron size-3.5 shrink-0 text-[var(--console-muted)]`,"data-open":a||void 0})]}),(0,W.jsx)(td,{open:a,children:()=>(0,W.jsx)(`div`,{className:`space-y-1 border-t border-[var(--console-border)] p-2`,children:n.map(e=>(0,W.jsx)(md,{item:e,baseDirectory:r,onJumpToAnchor:i},`${e.path}:${e.latestAnchorId||e.latestTime}`))})})]})}function md({item:e,baseDirectory:t,onJumpToAnchor:n}){h();let[r,i]=(0,G.useState)(0);function a(t,r){let a=e.anchors.length;if(a===0)return;let o=(t%a+a)%a;i(o);let s=e.anchors[o];s&&n(s.anchorId,r)}return(0,W.jsxs)(`div`,{className:`flex items-start gap-2 rounded-sm px-2 py-2 motion-hover hover:bg-[var(--console-surface-muted)]`,children:[(0,W.jsx)(`button`,{type:`button`,title:e.path,onClick:e=>a(r,nd(e.detail)),className:`min-w-0 flex-1 text-left`,children:(0,W.jsx)(`span`,{className:`console-mono block break-all text-xs text-[var(--console-text)]`,children:ml(e.path,t)})}),e.anchors.length>1?(0,W.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Previous {0}`,[e.path]),onClick:e=>a(r-1,nd(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,W.jsx)(fe,{className:`size-3`})}),(0,W.jsxs)(`span`,{className:`console-mono text-[10px] text-[var(--console-muted)]`,children:[r+1,`/`,e.anchors.length]}),(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Next {0}`,[e.path]),onClick:e=>a(r+1,nd(e.detail)),className:`rounded-sm border border-[var(--console-border)] p-1 text-[var(--console-muted)] motion-hover hover:bg-[var(--console-surface)]`,children:(0,W.jsx)(ve,{className:`size-3`})})]}):(0,W.jsx)(`button`,{type:`button`,title:g(`Jump to tool call`),onClick:e=>a(0,nd(e.detail)),className:`console-mono shrink-0 text-[10px] text-[var(--console-muted)]`,children:e.count})]})}function hd(){return{excluded:new Set,toolQuery:``,toolsExpanded:!0}}function gd(e,t){return new Set([...e.filterIds].filter(e=>!t.has(e)))}function _d(e,t){let n=new Set(e.excluded);return n.delete(t)||n.add(t),{...e,excluded:n}}function vd(e,t){return _d(e,t)}function yd(e,t){return _d(e,t)}function bd(e,t,n){let r=new Set(e.excluded);for(let i of Dd(t,e))n?r.delete(i.id):r.add(i.id);return{...e,excluded:r}}function xd(e,t){let n=new Set(e.excluded);for(let e of t.tools)e.kind===`write`?n.delete(e.id):n.add(e.id);return{...e,excluded:n}}function Sd(e,t){return{...e,toolQuery:t}}function Cd(e){return{...e,toolsExpanded:!e.toolsExpanded}}function wd(e){return{...e,excluded:new Set,toolQuery:``}}function Td(e,t){return e.tools.reduce((e,n)=>e+ +!t.excluded.has(n.id),0)}function Ed(e,t){let n=Td(e,t);return n===0?`none`:n===e.tools.length?`all`:`partial`}function Dd(e,t){let n=t.toolQuery.trim().toLowerCase();return n?e.tools.filter(e=>e.label.toLowerCase().includes(n)):e.tools}function Od(e,t){return Ed(e,t)===`all`?[]:e.tools.filter(e=>!t.excluded.has(e.id)).map(e=>({id:e.id,label:e.label}))}function kd(e,t){return e.tools.filter(e=>t.excluded.has(e.id)).map(e=>({label:e.label,count:e.count}))}function Ad(e,t){let n=0;for(let r of _c)t.excluded.has(r)&&(n+=e.counts[r]);for(let r of e.tools)t.excluded.has(r.id)&&(n+=r.count);return n}var jd={user:`Your messages`,agent_message:`Agent replies`,thinking:`Thinking`,plan:`Plans`},Md={all:`checked`,none:`unchecked`,partial:`indeterminate`};function Nd({toc:e,state:t,actions:n,visibleUnitCount:r}){h();let i=kd(e,t);return(0,W.jsxs)(`section`,{"aria-label":g(`Content filters`),className:`flex flex-col rounded-lg border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-[var(--console-border)] px-3 py-2.5`,children:[(0,W.jsx)(`span`,{className:`console-eyebrow`,children:g(`Content filters`)}),(0,W.jsx)(`button`,{type:`button`,onClick:n.resetAll,className:`console-mono motion-hover ml-auto rounded-sm px-1 text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:g(`Reset`)})]}),(0,W.jsxs)(`div`,{className:`flex flex-1 flex-col gap-2.5 p-3`,children:[(0,W.jsx)(`div`,{className:`flex flex-col gap-0.5`,children:_c.filter(t=>e.counts[t]>0).map(r=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-sm px-1 py-1`,children:[(0,W.jsx)(ed,{size:15,label:g(jd[r]),state:t.excluded.has(r)?`unchecked`:`checked`,onToggle:()=>n.toggleContentKind(r)}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-[13px] text-[var(--console-text)]`,children:g(jd[r])}),(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[10.5px] text-[var(--console-muted)]`,children:e.counts[r]})]},r))}),e.tools.length>0?(0,W.jsx)(Pd,{toc:e,state:t,actions:n}):null,(0,W.jsxs)(`div`,{className:`mt-auto rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] p-2.5`,children:[(0,W.jsx)(`span`,{className:`console-eyebrow`,children:g(`Current view`)}),(0,W.jsxs)(`p`,{className:`mt-1 text-[11px] leading-relaxed text-[var(--console-text-secondary)]`,children:[g(`Showing`),` `,(0,W.jsx)(`b`,{className:`console-mono text-[var(--console-text)]`,children:r}),` /`,` `,(0,W.jsx)(`span`,{className:`console-mono`,children:e.totalUnitCount}),i.length>0?g(` · hiding {0}`,[i.map(e=>e.label).join(`, `)]):null]})]})]})]})}function Pd({toc:e,state:t,actions:n}){h();let r=Ed(e,t),i=Dd(e,t),a=t.toolsExpanded?ve:de;return(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-md border border-[var(--brand-line)]`,children:[(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 bg-[var(--brand-soft)] px-2.5 py-2`,children:[(0,W.jsx)(ed,{size:15,label:g(`All tools`),state:Md[r],onToggle:()=>n.setAllTools(r!==`all`)}),(0,W.jsxs)(`button`,{type:`button`,"aria-expanded":t.toolsExpanded,onClick:n.toggleToolsExpanded,className:`flex min-w-0 flex-1 items-center gap-2 text-left focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:[(0,W.jsx)(`span`,{className:`text-[13px] text-[var(--console-text)]`,children:g(`Tools`)}),(0,W.jsxs)(`span`,{className:`console-mono ml-auto text-[10.5px] text-[var(--console-muted)]`,children:[Td(e,t),` / `,e.tools.length,` `,g(`selected`)]}),(0,W.jsx)(a,{className:`size-3.5 shrink-0 text-[var(--console-muted)]`})]})]}),t.toolsExpanded?(0,W.jsxs)(`div`,{className:`flex flex-col gap-1.5 bg-[var(--console-surface)] p-2.5`,children:[(0,W.jsx)(`input`,{type:`search`,value:t.toolQuery,"aria-label":g(`Filter tool names`),placeholder:g(`Filter tools…`),onChange:e=>n.setToolQuery(e.target.value),className:`console-mono w-full rounded-sm border border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-text)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`}),i.map(r=>(0,W.jsxs)(`div`,{className:`flex items-center gap-2 px-0.5`,children:[(0,W.jsx)(ed,{size:14,label:r.label,state:t.excluded.has(r.id)?`unchecked`:`checked`,onToggle:()=>n.toggleTool(r.id)}),(0,W.jsx)(`span`,{className:`console-mono min-w-0 flex-1 truncate text-xs text-[var(--console-text)]`,children:r.label}),(0,W.jsx)(`span`,{"aria-hidden":`true`,className:`h-1 w-[34px] shrink-0 overflow-hidden rounded-[2px] bg-[var(--console-surface-sunken)]`,children:(0,W.jsx)(`span`,{className:`block h-full rounded-[2px] bg-[var(--brand)]`,style:{width:`${r.count/e.maxToolCount*100}%`}})}),(0,W.jsx)(`span`,{className:`console-mono w-5 shrink-0 text-right text-[10px] text-[var(--console-muted)]`,children:r.count})]},r.id)),(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-1.5 pt-0.5`,children:[(0,W.jsxs)(Fd,{onClick:()=>n.setAllTools(!0),children:[g(`Select all (`),i.length,`)`]}),(0,W.jsxs)(Fd,{onClick:()=>n.setAllTools(!1),children:[g(`Clear all (`),i.length,`)`]}),(0,W.jsx)(Fd,{onClick:n.selectWriteToolsOnly,children:g(`Writes only`)})]})]}):null]})}function Fd({onClick:e,children:t}){return h(),(0,W.jsx)(`button`,{type:`button`,onClick:e,className:`console-mono motion-hover rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-[3px] text-[10px] text-[var(--console-text-secondary)] hover:border-[var(--brand-line)] hover:text-[var(--brand)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:t})}function Id({fileChangeSummary:e,baseDirectory:t,onJumpToAnchor:n,...r}){return h(),(0,W.jsx)(`aside`,{className:`console-scrollbar hidden min-[1025px]:sticky min-[1025px]:top-4 min-[1025px]:block min-[1025px]:max-h-[calc(100dvh-14rem)] min-[1025px]:overflow-y-auto min-[1025px]:overscroll-contain`,children:(0,W.jsxs)(`div`,{className:`space-y-4`,children:[(0,W.jsx)(Nd,{...r}),(0,W.jsx)(fd,{summary:e,baseDirectory:t,onJumpToAnchor:n})]})})}var Ld={user:`You`,agent_message:`Reply`,thinking:`Thinking`,plan:`Plan`};function Rd(e,t){return Od(e,t).length}function zd({toc:e,state:t,actions:n}){h();let r=Od(e,t);if(r.length===0)return null;let i=_c.filter(n=>e.counts[n]>0&&!t.excluded.has(n)).map(e=>g(Ld[e]));return(0,W.jsxs)(`div`,{className:`hidden flex-wrap items-center gap-1.5 min-[1025px]:flex`,children:[r.map(e=>(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full bg-[var(--brand)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand-fg)]`,children:[g(`Tool ·`),` `,e.label,(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Remove filter {0}`,[e.label]),onClick:()=>n.toggleTool(e.id),className:`motion-hover -mr-1 rounded-full p-0.5 opacity-80 hover:opacity-100 focus-visible:ring-2 focus-visible:ring-[var(--brand-fg)] focus-visible:outline-none`,children:(0,W.jsx)(Me,{className:`size-2.5 stroke-[3]`})})]},e.id)),i.length>0?(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center rounded-full border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2.5 py-[3px] text-[10.5px] text-[var(--console-muted)]`,children:[`+ `,i.join(` / `)]}):null]})}function Bd({hiddenCount:e,hiddenTools:t,onShowAll:n}){if(h(),e<=0)return null;let r=t.map(e=>`${e.label} ${e.count}`).join(` · `);return(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-lg border border-dashed border-[var(--console-border-strong)] bg-[var(--console-surface-muted)] px-[15px] py-[11px]`,children:[(0,W.jsxs)(`span`,{className:`console-mono min-w-0 flex-1 text-[11px] text-[var(--console-muted)]`,children:[e,` `,g(`hidden by filters`),r?` (${r})`:``]}),(0,W.jsx)(`button`,{type:`button`,onClick:n,className:`console-mono motion-hover shrink-0 rounded-sm border border-[var(--brand-line)] bg-[var(--brand-soft)] px-2.5 py-[3px] text-[10.5px] text-[var(--brand)] hover:text-[var(--brand-hover)] focus-visible:ring-2 focus-visible:ring-[var(--brand)] focus-visible:outline-none`,children:g(`Show all`)})]})}function Vd(e,t){let[n,r]=(0,G.useState)(hd),[i,a]=(0,G.useState)(t);return i!==t&&(a(t),r(hd())),{state:n,actions:(0,G.useMemo)(()=>({toggleContentKind:e=>r(t=>vd(t,e)),toggleTool:e=>r(t=>yd(t,e)),setAllTools:t=>r(n=>bd(n,e,t)),selectWriteToolsOnly:()=>r(t=>xd(t,e)),setToolQuery:e=>r(t=>Sd(t,e)),toggleToolsExpanded:()=>r(e=>Cd(e)),resetAll:()=>r(wd)}),[e])}}var Hd={fontSize:`0.75rem`,lineHeight:1.55},Ud=(0,G.lazy)(()=>_(()=>import(`./PrismHighlighter-02695Lmx.js`).then(e=>({default:e.PrismHighlighter})),__vite__mapDeps([0,1])));function Wd({text:e}){return h(),(0,W.jsx)(`pre`,{className:`console-mono m-0 overflow-x-auto whitespace-pre-wrap break-words p-3 text-[var(--code-fg)]`,style:{background:`transparent`,...Hd},children:e})}function Gd({language:e,text:t}){return h(),(0,W.jsx)(Ts,{text:t,initialBudget:bs.code,children:t=>(0,W.jsx)(be,{fallback:(0,W.jsx)(Wd,{text:t}),children:(0,W.jsx)(G.Suspense,{fallback:(0,W.jsx)(Wd,{text:t}),children:(0,W.jsx)(Ud,{language:e,text:t})})})})}var Kd={add:`text-[var(--diff-add-fg)] bg-[var(--diff-add-bg)]`,remove:`text-[var(--diff-remove-fg)] bg-[var(--diff-remove-bg)]`,hunk:`text-[var(--diff-hunk-fg)] bg-[var(--diff-hunk-bg)]`,meta:`text-[var(--diff-meta-fg)] bg-[var(--diff-meta-bg)]`,header:`text-[var(--console-text)] bg-[var(--diff-header-bg)]`,context:`text-[var(--console-text)]`};function qd(e){return Kd[e]}function Jd(e,t){return`${e}:${t}`}function Yd(e){return/^(Index:|diff\s|===)/.test(e)?`header`:e.startsWith(`@@`)?`hunk`:e.startsWith(`+++ `)||e.startsWith(`--- `)?`meta`:e.startsWith(`+`)?`add`:e.startsWith(`-`)?`remove`:`context`}function Xd({text:e}){return(0,W.jsx)(Ts,{text:e,initialBudget:bs.diff,children:e=>{let t=e.split(`
47
47
  `),n=new Map;return(0,W.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed`,children:t.map(e=>{let t=n.get(e)??0;return n.set(e,t+1),(0,W.jsx)(`span`,{className:`block rounded-[2px] px-1 ${qd(Yd(e))}`,children:e||` `},Jd(e,t))})})}})}function Zd(e){let t=e.text||g(`No output captured.`);return!e.isCode||e.language===`text`?(0,W.jsx)(Ts,{text:t,initialBudget:bs.plain,children:e=>(0,W.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre-wrap break-all p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):e.language===`diff`?(0,W.jsx)(Xd,{text:t}):(0,W.jsx)(`div`,{className:`max-h-[420px] overflow-auto bg-[var(--console-surface-sunken)]`,children:(0,W.jsx)(Gd,{language:e.language,text:t})})}function Qd({sections:e}){return h(),(0,W.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.operation}),(0,W.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:e.label})]})}),Zd(e)]},`${e.operation}:${e.label}:${e.language}`))})}function $d({items:e,text:t}){return(0,W.jsxs)(`div`,{className:`space-y-3`,children:[(0,W.jsx)(`div`,{className:`grid gap-3 ${e.length>1?`sm:grid-cols-2`:``}`,children:e.map((e,t)=>(0,W.jsxs)(`figure`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:[(0,W.jsx)(`img`,{src:e.src,alt:e.alt,className:`max-h-[520px] w-full object-contain`,loading:`lazy`}),e.caption?(0,W.jsx)(`figcaption`,{className:`console-mono border-t border-[var(--console-border)] px-3 py-2 text-[11px] text-[var(--console-muted)]`,children:e.caption}):null]},`${e.src.slice(0,80)}:${t}`))}),t?(0,W.jsx)(Ts,{text:t,initialBudget:bs.plain,children:e=>(0,W.jsx)(`pre`,{className:`console-mono whitespace-pre-wrap break-words rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):null]})}function ef(e){return e==null||e===``?`—`:typeof e==`boolean`?g(e?`Yes`:`No`):typeof e==`string`||typeof e==`number`||typeof e==`bigint`?String(e):null}function tf({value:e,depth:t=0}){h();let n=ef(e);return n==null?Array.isArray(e)?t>=2?(0,W.jsxs)(`span`,{children:[e.length,` `,g(`items`)]}):(0,W.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map((e,n)=>(0,W.jsx)(`span`,{className:`rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5`,children:(0,W.jsx)(tf,{value:e,depth:t+1})},n))}):typeof e==`object`?t>=2?(0,W.jsxs)(`span`,{children:[Object.keys(e).length,` `,g(`fields`)]}):(0,W.jsx)(`dl`,{className:`space-y-1.5`,children:Object.entries(e).map(([e,n])=>(0,W.jsxs)(`div`,{className:`grid grid-cols-[minmax(80px,auto)_1fr] gap-2`,children:[(0,W.jsx)(`dt`,{className:`text-[var(--console-muted)]`,children:e}),(0,W.jsx)(`dd`,{className:`min-w-0`,children:(0,W.jsx)(tf,{value:n,depth:t+1})})]},e))}):(0,W.jsx)(`span`,{children:String(e)}):(0,W.jsx)(`span`,{className:`whitespace-pre-wrap break-words`,children:n})}function nf({items:e}){return h(),(0,W.jsx)(`dl`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`grid gap-1 border-b border-[var(--console-border)] px-3 py-2.5 last:border-b-0 sm:grid-cols-[130px_1fr] sm:gap-3`,children:[(0,W.jsx)(`dt`,{className:`console-mono text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.label}),(0,W.jsx)(`dd`,{className:`console-mono min-w-0 text-xs leading-relaxed text-[var(--console-text)]`,children:(0,W.jsx)(tf,{value:e.value})})]},e.label))})}function rf({questions:e}){return h(),(0,W.jsx)(`div`,{className:`space-y-3`,children:e.map(e=>(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,W.jsxs)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-2`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.header?(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-[var(--console-muted)]`,children:e.header}):null,e.answers.length>0?(0,W.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-success)]`,children:g(`Answered`)}):(0,W.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:g(`Pending`)})]}),(0,W.jsx)(`p`,{className:`mt-2 text-sm leading-relaxed text-[var(--console-text)]`,children:e.question})]}),(0,W.jsx)(`div`,{className:`space-y-2 p-3`,children:e.options.map(t=>{let n=e.answers.includes(t.label);return(0,W.jsxs)(`div`,{className:`rounded-sm border px-3 py-2 ${n?`border-[var(--console-success-border)] bg-[var(--console-success-bg)]`:`border-[var(--console-border)] bg-[var(--console-surface)]`}`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,W.jsx)(`span`,{className:`console-mono text-xs font-semibold ${n?`text-[var(--console-success)]`:`text-[var(--console-text)]`}`,children:t.label}),t.recommended?(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:g(`Recommended`)}):null,n?(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-success-border)] bg-[var(--console-surface)] px-1.5 py-0.5 text-[10px] text-[var(--console-success)]`,children:g(`Selected`)}):null]}),t.description?(0,W.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-[var(--console-muted)]`,children:t.description}):null]},`${e.question}:${t.label}`)})})]},`${e.header??`question`}:${e.question}`))})}function af(e){let t=0;for(let n of e)t+=n.lines.length+1;return t}function of(e,t){let n=[],r=0,i=0,a=!1;for(let o of e){if(i>=t.maxLines||r>=t.maxCharacters){a=!0;break}let e=t.maxCharacters-r,s=o.label.slice(0,e);r+=s.length,i+=1;let c=[];for(let e of o.lines){if(i>=t.maxLines||r>=t.maxCharacters){a=!0;break}let n=t.maxCharacters-r-1;if(n<0){a=!0;break}let o=e.text.slice(0,n);if(c.push(o===e.text?e:{...e,text:o}),r+=o.length+1,i+=1,o!==e.text){a=!0;break}}if(n.push({...o,label:s,lines:c}),s!==o.label||c.length!==o.lines.length){a=!0;break}}return{blocks:n,renderedLines:i,truncated:a}}function sf(e){let t=[];for(let n of e){t.push(`diff ${n.label}`);for(let e of n.lines){let n=e.type===`add`?`+`:e.type===`remove`?`-`:` `;t.push(`${n}${e.text}`)}}return t.join(`
48
48
  `)}function cf({blocks:e}){let t=h(),n=(0,G.useMemo)(()=>af(e),[t,e]),{budget:r,renderMore:i}=ws(e,bs.diff,{lines:n}),a=(0,G.useMemo)(()=>of(e,r),[e,r]);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`div`,{className:`space-y-3`,children:a.blocks.map((e,t)=>(0,W.jsxs)(`div`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsx)(`span`,{className:`console-mono text-[11px] font-semibold text-[var(--console-muted)]`,children:e.label})}),(0,W.jsx)(`pre`,{className:`console-mono max-h-[280px] overflow-auto whitespace-pre p-3 text-xs leading-relaxed`,children:e.lines.map((e,t)=>(0,W.jsxs)(`span`,{className:`block rounded-[2px] px-1 ${qd(e.type)}`,children:[e.type===`add`?`+`:e.type===`remove`?`-`:` `,e.text||` `]},`${e.type}:${t}`))})]},`${e.label.slice(0,80)}:${t}`))}),a.truncated?(0,W.jsx)(Cs,{copySource:()=>sf(e),onRenderMore:i,rendered:a.renderedLines,total:n,unit:`lines`}):null]})}var lf={completed:{Icon:Te,label:`Done`,className:`text-[var(--console-success)]`},error:{Icon:Me,label:`Failed`,className:`text-[var(--console-error)]`},in_progress:{Icon:ye,label:`In progress`,className:`text-[var(--console-warning)]`},pending:{Icon:Se,label:`Pending`,className:`text-[var(--console-muted)]`}};function uf({items:e}){return h(),(0,W.jsx)(`ol`,{className:`overflow-hidden rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)]`,children:e.map((e,t)=>{let n=lf[e.status];return(0,W.jsxs)(`li`,{className:`flex gap-3 border-b border-[var(--console-border)] px-3 py-2.5 last:border-b-0`,children:[(0,W.jsx)(n.Icon,{className:`mt-0.5 size-3.5 shrink-0 ${n.className}`}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-baseline justify-between gap-x-3 gap-y-1`,children:[(0,W.jsx)(`span`,{className:`text-xs font-medium leading-relaxed text-[var(--console-text)]`,children:e.label}),(0,W.jsx)(`span`,{className:`console-mono text-[10px] uppercase tracking-wide ${n.className}`,children:g(n.label)})]}),e.detail?(0,W.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-[var(--console-muted)]`,children:e.detail}):null]})]},`${e.label}:${t}`)})})}function df({outputContent:e}){if(h(),e.kind===`structured-diff`)return(0,W.jsx)(cf,{blocks:e.blocks});if(e.kind===`file-sections`)return(0,W.jsx)(Qd,{sections:e.sections});if(e.kind===`question-list`)return(0,W.jsx)(rf,{questions:e.questions});if(e.kind===`task-list`)return(0,W.jsx)(uf,{items:e.items});if(e.kind===`media`)return(0,W.jsx)($d,{items:e.items,text:e.text});if(e.kind===`property-list`)return(0,W.jsx)(nf,{items:e.items});let t=e.text||g(`No output captured.`);return!e.isCode||e.language===`text`?(0,W.jsx)(Ts,{text:t,initialBudget:bs.plain,children:e=>(0,W.jsx)(`pre`,{className:`console-mono max-h-[420px] overflow-auto whitespace-pre-wrap break-words rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)] p-3 text-xs leading-relaxed text-[var(--console-text)]`,children:e})}):e.language===`diff`?(0,W.jsx)(Xd,{text:t}):(0,W.jsx)(`div`,{className:`max-h-[420px] overflow-auto rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-sunken)]`,children:(0,W.jsx)(Gd,{language:e.language,text:t})})}var ff=`<turn_aborted>
49
49
  The user interrupted the previous turn on purpose. Any running unified exec processes were terminated. If any tools/commands were aborted, they may have partially executed; verify current state before retrying.
50
50
  </turn_aborted>`;function pf(e){return e.replace(/\r\n/g,`
51
51
  `).trim()}function mf(e,t){if(t.toLowerCase()!==`codex`||e.role!==`user`||e.parts.length!==1)return!1;let[n]=e.parts;return!n||n.type!==`text`?!1:pf(n.text)===pf(ff)}function hf(e){let t=e.approval_status===`fail`?`fail`:`success`,n=e.text.trim();return{title:`plan`,secondaryText:void 0,approvalStatus:t,expandable:!!n,contentLabel:g(t===`fail`?`Rejected`:`Plan`),contentMarkdown:n}}function gf(){let e=new Map,t=new Set;return{get:t=>e.get(t),entries:()=>e.entries(),register:(n,r)=>{let i=e.get(n);i===r||!i&&!r||(r?e.set(n,r):e.delete(n),t.forEach(e=>e(n,r,i)))},subscribe:e=>(t.add(e),()=>t.delete(e))}}var _f=(0,G.createContext)(null);function vf({registry:e,children:t}){return(0,W.jsx)(_f.Provider,{value:e,children:t})}function yf(e){let t=(0,G.useContext)(_f);return(0,G.useCallback)(n=>{e&&t?.register(e,n)},[e,t])}var bf={completed:{label:`Success`,className:`border-[var(--console-success-border)] bg-[var(--positive-soft)] text-[var(--positive)]`,icon:ue},error:{label:`Failed`,className:`border-[var(--console-error-border)] bg-[var(--console-error-bg)] text-[var(--console-error)]`,icon:b},running:{label:`Running`,className:`border-[var(--console-warning-border)] bg-[var(--console-warning-bg)] text-[var(--console-warning)]`,icon:C}};function xf(e,t){let n=ys(t);return n?e.split(n).map((e,t)=>e.match(n)?(0,W.jsx)(`mark`,{children:e},`${e}-${t}`):(0,W.jsx)(`span`,{children:e},`${e}-${t}`)):e}function Sf({text:e,highlightQuery:t}){return h(),(0,W.jsx)(Ms,{text:e,highlightQuery:t})}var Cf=(0,G.memo)(function({messageIndex:e,msg:t,blocks:n,formatTokens:r,sessionAgentKey:i,agent:a,baseDirectory:s,highlightQuery:c,childSessionById:u}){h();let d=t.role===`user`,f=mf(t,i),m=d?sc(e):void 0,_=yf(m),y=()=>{let e=a?.displayName??i,t=a?.icon;return(0,W.jsx)(W.Fragment,{children:t?(0,W.jsx)(l,{icon:t,iconColored:a?.iconColored,alt:e,className:`size-4 rounded-sm object-cover`}):(0,W.jsx)(ce,{className:`size-4 text-[var(--console-muted)]`})})},b=t.mode?t.mode.toUpperCase():null,x=t.model||null,S=Qs(t),C=o(t.time_created),w=t.subagent_id?u?.get(t.subagent_id):void 0;return(0,W.jsx)(`article`,{ref:_,id:m,className:`w-full scroll-mt-20 border-l-2 border-[var(--console-thread)] pl-4 pr-3 md:pr-5`,children:(0,W.jsxs)(`div`,{className:`flex gap-4`,children:[(0,W.jsx)(`div`,{className:`shrink-0 pt-1`,children:(0,W.jsx)(`div`,{className:`flex size-8 items-center justify-center rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)]`,children:d?(0,W.jsx)(T,{className:`size-4 text-[var(--console-muted)]`}):y()})}),(0,W.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,W.jsxs)(`div`,{className:`flex items-baseline gap-3`,children:[(0,W.jsx)(`span`,{className:`console-mono text-sm font-bold tracking-wide text-[var(--console-text)]`,children:S}),C?(0,W.jsx)(`time`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:C}):null,b&&(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:b}),x&&(0,W.jsx)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-1.5 py-0.5 text-[10px] text-[var(--console-muted)]`,children:x}),w?(0,W.jsx)(v,{to:p(w),className:`console-mono rounded-full border border-[var(--brand-line)] px-1.5 py-0.5 text-[10px] text-[var(--brand)] hover:bg-[var(--brand-soft)] hover:text-[var(--brand-hover)]`,children:g(`Open sub-session ↗`)}):null]}),f?(0,W.jsx)(Tf,{}):n.map((t,n)=>{let r=cc(e,n);return t.type===`reasoning`?(0,W.jsx)(Ef,{anchorId:r,parts:t.parts,highlightQuery:c},n):t.type===`plan`?(0,W.jsx)(Of,{anchorId:r,parts:t.parts,highlightQuery:c},n):t.type===`tool`?(0,W.jsx)(Df,{parts:t.parts,anchorIds:t.anchorIds,sessionAgentKey:i,baseDirectory:s,highlightQuery:c},n):(0,W.jsx)(wf,{anchorId:r,parts:t.parts,highlightQuery:c},n)}),!d&&(t.tokens||t.cost)&&(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[t.tokens?.input?(0,W.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[g(`INPUT`),` `,r(t.tokens.input)]}):null,t.tokens?.output?(0,W.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[g(`OUTPUT`),` `,r(t.tokens.output)]}):null,t.tokens?.reasoning?(0,W.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[g(`REASONING`),` `,r(t.tokens.reasoning)]}):null,t.cost?(0,W.jsxs)(`span`,{className:`console-mono rounded-sm border border-[var(--console-border)] bg-[var(--console-surface-muted)] px-2 py-1 text-[11px] text-[var(--console-muted)]`,children:[t.cost_source===`estimated`?g(`EST COST`):g(`COST`),` $`,t.cost.toFixed(4)]}):null]})]})]})})}),wf=(0,G.memo)(function({anchorId:e,parts:t,highlightQuery:n}){h();let r=yf(e);return(0,W.jsx)(`div`,{ref:r,id:e,className:`scroll-mt-20 rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-4 shadow-[var(--shadow-raised)]`,children:(0,W.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:t.map((e,t)=>(0,W.jsx)(Sf,{text:e.text,highlightQuery:n},t))})})});function Tf(){return h(),(0,W.jsx)(`div`,{className:`space-y-2`,children:(0,W.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,W.jsx)(`div`,{className:`w-full rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2 text-left shadow-[var(--shadow-raised)] md:w-[560px]`,children:(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(S,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:g(`abort`)})})]})})})})}var Ef=(0,G.memo)(function({anchorId:e,parts:t,highlightQuery:n}){h();let[r,i]=(0,G.useState)(!1),a=yf(e),o=(0,G.useMemo)(()=>t.map(e=>e.text).filter(Boolean).join(`
52
52
 
53
- `),[t]);return(0,W.jsxs)(`div`,{ref:a,id:e,className:`scroll-mt-20 overflow-hidden rounded-lg border border-[var(--console-thinking-border)] bg-[var(--console-thinking-bg)]`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between bg-[var(--console-surface-muted)] px-3 py-2 text-left motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--brand)]`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,W.jsxs)(`span`,{className:`console-mono flex items-center gap-2 text-xs font-medium text-[var(--console-muted)]`,children:[(0,W.jsx)(ke,{className:`size-3.5`}),` `,g(`Thinking`)]}),(0,W.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron w-4 h-4`,"data-open":r||void 0})})]}),(0,W.jsx)(td,{open:r,children:()=>(0,W.jsx)(`div`,{className:`border-t border-dashed border-[var(--console-thinking-border)] px-4 py-3`,children:(0,W.jsx)(Ts,{text:o,initialBudget:bs.plain,children:e=>(0,W.jsx)(`div`,{className:`console-mono whitespace-pre-wrap text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(e,n)})})})})]})}),Df=(0,G.memo)(function({parts:e,anchorIds:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){return h(),(0,W.jsx)(`div`,{className:`space-y-2`,children:(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map((e,a)=>(0,W.jsx)(Af,{tool:e,anchorId:t?.[a],sessionAgentKey:n,baseDirectory:r,highlightQuery:i},a))})})}),Of=(0,G.memo)(function({anchorId:e,parts:t,highlightQuery:n}){h();let r=yf(e);return(0,W.jsx)(`div`,{ref:r,id:e,className:`scroll-mt-20 space-y-2`,children:t.map((e,t)=>(0,W.jsx)(kf,{part:e,highlightQuery:n},t))})}),kf=(0,G.memo)(function({part:e,highlightQuery:t}){let n=h(),[r,i]=(0,G.useState)(!1),a=(0,G.useMemo)(()=>hf(e),[n,e]),o=a.approvalStatus===`fail`?bf.error:bf.completed,s=o.icon;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,W.jsx)(`div`,{className:`w-full md:w-[560px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2 text-left shadow-[var(--shadow-raised)] ${a.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:a.expandable?(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,W.jsx)(xe,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:g(a.title)})}),(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron size-3.5`,"data-open":r||void 0})})]}):(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(xe,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:g(a.title)})})]})}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${o.className}`,children:[(0,W.jsx)(s,{className:`size-3`}),g(o.label)]})]}),(0,W.jsx)(td,{open:a.expandable&&r,children:()=>(0,W.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:a.contentLabel})}),(0,W.jsx)(`div`,{className:`bg-[var(--console-surface-sunken)] p-4`,children:(0,W.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,W.jsx)(Sf,{text:a.contentMarkdown,highlightQuery:t})})})]})})]})}),Af=(0,G.memo)(function({tool:e,anchorId:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){let a=h(),[o,s]=(0,G.useState)(!1),c=yf(t),l=(0,G.useMemo)(()=>Zs(e),[e]),u=(0,G.useMemo)(()=>Xu(n,e,l,r),[a,r,n,l,e]),d=(0,G.useMemo)(()=>pl(l.inputText||`{}`,r),[r,l.inputText]),f=bf[l.status],p=f.icon,m=u.Icon;return(0,W.jsxs)(`div`,{ref:c,id:t,className:`scroll-mt-20`,children:[(0,W.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,W.jsx)(`div`,{className:`w-full max-w-[720px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2.5 text-left shadow-[var(--shadow-raised)] ${u.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:u.expandable?(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2.5 text-left active:scale-[0.995] motion-reduce:transform-none`,onClick:()=>s(!o),"aria-expanded":o,children:[(0,W.jsx)(m,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:u.title}),u.secondaryText?(0,W.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(u.secondaryText,i)}):null]}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${f.className}`,children:[(0,W.jsx)(p,{className:`size-2.5 ${l.status===`running`?`animate-spin motion-reduce:animate-none`:``}`}),g(f.label)]}),(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron size-3.5`,"data-open":o||void 0})})]}):(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(m,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:u.title}),u.secondaryText?(0,W.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(u.secondaryText,i)}):null]}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${f.className}`,children:[(0,W.jsx)(p,{className:`size-2.5`}),g(f.label)]})]})})}),(0,W.jsx)(td,{open:u.expandable&&o,children:()=>(0,W.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:u.contentLabel??g(`Output`)})}),(0,W.jsxs)(`div`,{className:`space-y-3 bg-[var(--console-surface-sunken)] p-3`,children:[u.details.length>0?(0,W.jsx)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2`,children:(0,W.jsx)(`div`,{className:`space-y-2`,children:u.details.map(e=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] font-semibold uppercase tracking-wide text-[var(--console-muted)] md:w-24`,children:e.label}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(Ts,{text:e.value,initialBudget:bs.plain,children:e=>(0,W.jsx)(`span`,{className:`console-mono whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-text)]`,children:xf(e,i)})})})]},`${e.label}:${e.value}`))})}):null,(0,W.jsx)(df,{outputContent:u.outputContent})]}),u.showInputPreview?(0,W.jsxs)(`div`,{className:`border-t border-[var(--console-border)] bg-[var(--console-surface-sunken)] px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:g(`Input Preview`)}),(0,W.jsx)(Ts,{text:d,initialBudget:bs.plain,children:e=>(0,W.jsx)(`pre`,{className:`console-mono mt-1 max-h-[200px] overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(e,i)})})]}):null]})})]})}),jf=class{count;gap;sizes;measured;tree;constructor(e,t,n){this.count=e,this.gap=n,this.sizes=new Float64Array(e),this.measured=new Uint8Array(e),this.tree=new Float64Array(e+1);for(let n=0;n<e;n+=1)this.sizes[n]=this.extentOf(t,n);this.buildTree()}heightAt(e){return e<0||e>=this.count?0:this.sizes[e]-this.gapAfter(e)}setHeight(e,t){if(e<0||e>=this.count||!Number.isFinite(t)||t<=0)return!1;let n=Math.ceil(t);if(this.measured[e]===1&&Math.abs(this.heightAt(e)-n)<=1)return!1;let r=this.extentOf(n,e),i=r-this.sizes[e];return this.sizes[e]=r,this.measured[e]=1,i!==0&&this.addToTree(e,i),!0}startAt(e){return this.prefixSum(Math.max(0,Math.min(e,this.count)))}endAt(e){return this.startAt(e)+this.heightAt(e)}get totalSize(){return this.prefixSum(this.count)}firstEndAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.endAt(r)<e?t=r+1:n=r}return t}firstStartAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.startAt(r)<=e?t=r+1:n=r}return t}gapAfter(e){return e===this.count-1?0:this.gap}extentOf(e,t){return e+this.gapAfter(t)}buildTree(){for(let e=0;e<this.count;e+=1){let t=e+1;this.tree[t]+=this.sizes[e];let n=t+(t&-t);n<=this.count&&(this.tree[n]+=this.tree[t])}}addToTree(e,t){for(let n=e+1;n<=this.count;n+=n&-n)this.tree[n]+=t}prefixSum(e){let t=0;for(let n=e;n>0;n-=n&-n)t+=this.tree[n];return t}},Mf=32,Nf=280,Pf=6;function Ff({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}){h();let l=e.length>80;return(0,G.useEffect)(()=>{l||(o.current=null)},[o,l]),l?(0,W.jsx)(If,{messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}):(0,W.jsx)(vf,{registry:s,children:(0,W.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:e.map(({msg:e,blocks:o,index:s})=>(0,W.jsx)(Cf,{messageIndex:s,msg:e,blocks:o,formatTokens:c,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a},`${e.id}:${s}`))})})}function If({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}){let l=h(),u=(0,G.useRef)(null),d=(0,G.useRef)(null),[f,p]=(0,G.useState)(0),m=(0,G.useRef)(0),[g,_]=(0,G.useState)(null),[v,y]=(0,G.useState)(()=>({scrollTop:0,height:900,listTop:0})),b=(0,G.useRef)(v);(0,G.useEffect)(()=>{b.current=v},[v]);let x=(0,G.useCallback)(()=>{if(typeof window>`u`)return null;let e=u.current,t=e?id(e):window;d.current=t;let n=e?ld(t,e):0,r={scrollTop:od(t),height:sd(t),listTop:n},i=b.current;return Math.abs(i.scrollTop-r.scrollTop)<1&&Math.abs(i.height-r.height)<1&&Math.abs(i.listTop-r.listTop)<1?t:(b.current=r,y(r),t)},[]);(0,G.useEffect)(()=>{let e=0,t=null,n=null,r=e=>{t!==e&&(t&&(t.removeEventListener(`scroll`,a),n&&!ad(t)&&n.unobserve(t)),t=e,t.addEventListener(`scroll`,a,{passive:!0}),n&&!ad(t)&&n.observe(t))},i=()=>{let e=x();e&&r(e)},a=()=>{e||=requestAnimationFrame(()=>{e=0,i()})};window.addEventListener(`resize`,a),typeof ResizeObserver<`u`&&(n=new ResizeObserver(a),u.current&&n.observe(u.current),document.body&&n.observe(document.body));let o=new MutationObserver(a),s=u.current?.parentElement;for(;s;)o.observe(s,{attributes:!0,attributeFilter:[`class`,`style`]}),s=s.parentElement;return document.fonts?.addEventListener(`loadingdone`,a),i(),()=>{e&&cancelAnimationFrame(e),n?.disconnect(),o.disconnect(),document.fonts?.removeEventListener(`loadingdone`,a),t?.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[x]);let S=(0,G.useMemo)(()=>new jf(e.length,Nf,Mf),[e]);(0,G.useEffect)(()=>{x()},[e,x]),(0,G.useEffect)(()=>()=>{m.current&&cancelAnimationFrame(m.current),m.current=0},[]);let C=(0,G.useCallback)((e,t)=>{S.setHeight(e,t)&&(m.current||=requestAnimationFrame(()=>{m.current=0,p(e=>e+1)}))},[S]),w=(0,G.useMemo)(()=>{if(e.length===0)return[];let t=Math.max(0,v.scrollTop-v.listTop),n=t+v.height,r=Math.max(0,S.firstEndAfter(t)-Pf),i=Math.min(e.length,S.firstStartAfter(n)+Pf),a=[];for(let e=r;e<i;e+=1)a.push({index:e,start:S.startAt(e)});let o=g?.heightIndex===S?g.index:null;return o!=null&&o>=0&&o<e.length&&(a.some(e=>e.index===o)||(a.push({index:o,start:S.startAt(o)}),a.sort((e,t)=>e.start-t.start))),a},[l,g,S,f,e.length,v]),T=(0,G.useCallback)(t=>{if(typeof window>`u`||t<0||t>=e.length)return;_({heightIndex:S,index:t});let n=u.current,r=n?id(n):d.current??window;d.current=r;let i=n?ld(r,n):0,a=Math.max(0,i+S.startAt(t)-24);ud(r,a);let o={scrollTop:a,height:sd(r),listTop:i};b.current=o,y(o)},[S,e.length]);return(0,G.useEffect)(()=>(o.current={scrollToIndex:T},()=>{o.current?.scrollToIndex===T&&(o.current=null)}),[o,T]),(0,W.jsx)(vf,{registry:s,children:(0,W.jsx)(`div`,{ref:u,className:`relative min-w-0`,style:{height:Math.max(1,S.totalSize)},children:w.map(({index:o,start:s})=>{let l=e[o];return l?(0,W.jsx)(Lf,{index:o,top:s,onMeasure:C,children:(0,W.jsx)(Cf,{messageIndex:l.index,msg:l.msg,blocks:l.blocks,formatTokens:c,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a})},`${l.msg.id}:${l.index}`):null})})})}function Lf({index:e,top:t,onMeasure:n,children:r}){h();let i=(0,G.useRef)(null);return(0,G.useLayoutEffect)(()=>{let t=i.current;if(!t)return;let r=()=>n(e,t.getBoundingClientRect().height);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(t),()=>a.disconnect()},[e,n]),(0,W.jsx)(`div`,{ref:i,className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${t}px)`},children:r})}var Rf=(0,G.lazy)(()=>_(()=>import(`./InteractiveReceipt-BFpIdno8.js`).then(e=>({default:e.InteractiveReceipt})),__vite__mapDeps([2,1,3,4,5,6,7,8,9])));function zf(){return h(),(0,W.jsx)(`div`,{className:`h-[calc(100dvh-5.5rem)] min-h-[420px] rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)]`})}function Bf({session:e,toc:t}){h();let[n,r]=(0,G.useState)(!1),[i,a]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{if(!n)return;let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>a(!0))}),i=window.matchMedia(`(min-width: 1025px)`),o=()=>{i.matches||(r(!1),a(!1))};return i.addEventListener(`change`,o),()=>{cancelAnimationFrame(t),e&&cancelAnimationFrame(e),i.removeEventListener(`change`,o)}},[n]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":g(`Open session receipt`),onClick:()=>{a(!1),r(!0)},className:`console-mono fixed right-0 top-1/2 z-40 hidden h-32 w-10 -translate-y-1/2 items-center justify-center rounded-l-sm border border-r-0 border-[var(--console-border)] bg-[var(--console-surface)] text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--console-text)] shadow-[var(--shadow-overlay)] motion-hover hover:bg-[var(--console-surface-muted)] min-[1025px]:flex`,children:(0,W.jsx)(`span`,{className:`[writing-mode:vertical-rl]`,children:g(`Receipt`)})}),(0,W.jsx)(we,{open:n,onOpenChange:e=>{r(e),e||a(!1)},title:g(`Session Receipt`),variant:`desktop`,children:i?(0,W.jsx)(ee,{id:`InteractiveReceipt`,children:(0,W.jsx)(be,{children:(0,W.jsx)(G.Suspense,{fallback:(0,W.jsx)(zf,{}),children:(0,W.jsx)(Rf,{session:e,toc:t},d(e.reference))})})}):(0,W.jsx)(zf,{})})]})}var Vf=`console-mono motion-hover inline-flex h-9 items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-3 text-xs font-semibold tracking-[0.12em] text-[var(--console-text)] uppercase shadow-[var(--shadow-raised)] hover:bg-[var(--console-surface-muted)]`;function Hf({toc:e,state:t,fileChangeSummary:n,onOpen:r}){h();let i=dd(n),a=Rd(e,t);return(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 min-[1025px]:hidden`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(`toc`),className:Vf,children:[(0,W.jsx)(ie,{className:`size-3.5 text-[var(--brand)]`}),a>0?g(`{0} filters`,[a]):g(`Content filters`)]}),i>0?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(`files`),className:Vf,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),` `,g(`Files`),` `,(0,W.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:i})]}):null]})}function Uf({openPanel:e,fileChangeSummary:t,baseDirectory:n,onClose:r,onJumpToAnchor:i,...a}){return h(),(0,G.useEffect)(()=>{if(!e)return;let t=window.matchMedia(`(min-width: 1025px)`),n=()=>{t.matches&&r()};return t.addEventListener(`change`,n),n(),()=>{t.removeEventListener(`change`,n)}},[r,e]),(0,W.jsx)(we,{open:e!==null,onOpenChange:e=>{e||r()},title:g(e===`files`?`File Tracker`:`Content filters`),variant:`mobile`,children:e?e===`toc`?(0,W.jsx)(Nd,{...a}):(0,W.jsx)(fd,{summary:t,baseDirectory:n,onJumpToAnchor:i}):null})}var Wf=6;function Gf(e){return{start:0,end:Math.min(e,80)}}function Kf(e,t,n,r){if(e<=80)return{start:0,end:e};if(n<=0||r<=0)return Gf(e);if(n>=r)return{start:0,end:e};let i=Math.floor(Math.max(0,t)/r*e),a=Math.ceil(Math.min(r,t+n)/r*e);return{start:Math.max(0,i-Wf),end:Math.min(e,a+Wf)}}function qf(e,t,n){let r=100/t;return{position:`absolute`,top:0,bottom:0,left:`calc(${e*r}% + ${e*n/t}px)`,width:`calc(${r}% - ${(t-1)*n/t}px)`}}function Jf(e){let t=e>80?{className:`gap-px`,width:1}:e>40?{className:`gap-0.5`,width:2}:{className:`gap-1`,width:4};return{gapClassName:t.className,gapWidth:t.width,minWidth:e*10+Math.max(0,e-1)*t.width}}function Yf(e,t,n,r,i){if(r===0||e.clientWidth<=0)return;let a=Math.max(e.scrollWidth,t.scrollWidth,t.getBoundingClientRect().width);if(a<=0)return;let o=Math.max(0,(a-Math.max(0,r-1)*i)/r),s=n*(o+i),c=s+o,l=e.scrollLeft,u=l+e.clientWidth;s<l?e.scrollLeft=s:c>u&&(e.scrollLeft=c-e.clientWidth)}var Xf={user:`--timeline-user`,agent:`--timeline-agent`,"tool-read":`--timeline-tool-read`,"tool-write":`--timeline-tool-write`,"tool-execute":`--timeline-tool-execute`};function Zf({entries:e,viewportRef:t,visibleWindow:n}){h();let r=(0,G.useRef)(null),i=(0,G.useRef)(null);(0,G.useEffect)(()=>{let t=r.current;if(!t)return;let n=()=>{let n=t.getContext(`2d`),r=t.clientWidth,i=t.clientHeight;if(!n||!r||!i||e.length===0)return;let a=window.devicePixelRatio||1;t.width=Math.round(r*a),t.height=Math.round(i*a),n.scale(a,a),n.clearRect(0,0,r,i);let o=window.getComputedStyle(t),s=Object.fromEntries(Object.entries(Xf).map(([e,t])=>[e,o.getPropertyValue(t).trim()||o.color]));e.forEach((t,a)=>{let o=a/e.length*r,c=(a+1)/e.length*r;n.fillStyle=s[t.kind],n.fillRect(o,0,Math.max(c-o,.5),i)})};n();let i=new MutationObserver(n);if(i.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),typeof ResizeObserver>`u`)return()=>i.disconnect();let a=new ResizeObserver(n);return a.observe(t),()=>{i.disconnect(),a.disconnect()}},[e]);let a=(0,G.useCallback)((e,n)=>{let r=t.current;r&&(r.scrollLeft=(e-n)*r.scrollWidth)},[t]),o=(0,G.useCallback)(e=>{let n=t.current;if(!n)return;let r=Math.max(0,n.scrollWidth-n.clientWidth),i=Math.max(40,n.clientWidth*.1),a=Math.max(120,n.clientWidth*.75),o=null;e.key===`ArrowLeft`&&(o=n.scrollLeft-i),e.key===`ArrowRight`&&(o=n.scrollLeft+i),e.key===`PageUp`&&(o=n.scrollLeft-a),e.key===`PageDown`&&(o=n.scrollLeft+a),e.key===`Home`&&(o=0),e.key===`End`&&(o=r),o!=null&&(e.preventDefault(),n.scrollLeft=Math.min(r,Math.max(0,o)))},[t]);return(0,W.jsx)(`div`,{"data-testid":`session-timeline-minimap`,role:`scrollbar`,"aria-controls":`session-timeline-viewport`,"aria-orientation":`horizontal`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n.start/(1-n.size)*100),"aria-label":g(`Timeline scroll position`),tabIndex:0,className:`session-timeline-minimap relative mt-2 h-2.5 cursor-pointer touch-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)]`,onKeyDown:o,onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();if(t.width<=0)return;let r=(e.clientX-t.left)/t.width,o=r>=n.start&&r<=n.start+n.size?r-n.start:n.size/2;i.current={pointerId:e.pointerId,grabOffset:o},e.currentTarget.setPointerCapture(e.pointerId),a(r,o)},onPointerMove:e=>{let t=i.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.currentTarget.getBoundingClientRect();n.width<=0||a((e.clientX-n.left)/n.width,t.grabOffset)},onPointerUp:e=>{i.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerCancel:()=>{i.current=null},children:(0,W.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden rounded-[2px]`,children:[(0,W.jsx)(`canvas`,{ref:r,"aria-hidden":`true`,className:`absolute inset-0 h-full w-full`}),(0,W.jsx)(`div`,{"data-testid":`session-timeline-minimap-window`,className:`session-timeline-minimap-window absolute inset-y-0`,style:{left:`${n.start*100}%`,width:`${n.size*100}%`}})]})})}var Qf=e(a(),1),$f=8;function ep(){let e=(0,G.useRef)(null),t=(0,G.useRef)(null),[n,r]=(0,G.useState)(null);return(0,G.useLayoutEffect)(()=>{let t=e.current;if(!t||!n)return;let r=t.offsetWidth/2,i=Math.min(window.innerWidth-$f-r,Math.max($f+r,n.anchorX));t.style.left=`${i}px`},[n]),{tooltip:n,tooltipRef:e,show:(0,G.useCallback)((e,n,i)=>{let a=n.getBoundingClientRect();t.current=n,r({entryId:e.id,id:`timeline-tooltip-${e.id}`,text:e.tooltip,anchorX:a.left+a.width/2,top:a.bottom+8,source:i})},[]),hide:(0,G.useCallback)(e=>{r(n=>n?.entryId===e?(t.current=null,null):n)},[]),handleScroll:(0,G.useCallback)(()=>{r(e=>{let n=t.current;if(!e||e.source!==`focus`||!n||n!==document.activeElement)return t.current=null,null;let r=n.getBoundingClientRect();return{...e,anchorX:r.left+r.width/2,top:r.bottom+8}})},[])}}function tp({tooltip:e,tooltipRef:t}){return e?(0,Qf.createPortal)((0,W.jsx)(`span`,{ref:t,id:e.id,role:`tooltip`,className:`t-tt session-timeline-floating-tooltip console-mono text-[11px]`,style:{left:e.anchorX,top:e.top},children:e.text}),document.body):null}function np(e){let t=sd(e);return{center:ad(e)?t/2:e.getBoundingClientRect().top+t/2,scrollTop:od(e),viewportHeight:t,scrollHeight:cd(e)}}function rp({rootRef:e,entries:t,anchorRegistry:n}){let[r,i]=(0,G.useState)(null),a=(0,G.useMemo)(()=>new Map(t.map((e,t)=>[e.anchorId,t])),[t]);return(0,G.useEffect)(()=>{let r=e.current;if(!r||t.length===0)return;let o=id(r),s=0,c=(e,t)=>{let n=a.get(e);return n==null?null:{index:n,top:t.getBoundingClientRect().top}},l=()=>Array.from(n.entries()).flatMap(([e,t])=>c(e,t)??[]),u=new Map,d=()=>Array.from(u).flatMap(([e,t])=>c(e,t)??[]),f=()=>{let e=np(o),n=hc(e.scrollTop,e.viewportHeight,e.scrollHeight,t.length),r=g?d():l(),a=n??mc(r,e.center),s=a==null?null:t[a]?.anchorId;s!=null&&i(e=>e===s?e:s)},p=()=>{s||=requestAnimationFrame(()=>{s=0,f()})},m=typeof ResizeObserver>`u`?null:new ResizeObserver(p),h=new WeakMap,g=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{for(let t of e){let e=t.target,n=h.get(e);n&&(t.isIntersecting?u.set(n,e):u.delete(n))}p()},{root:ad(o)?null:o,threshold:0}),_=(e,t)=>{h.set(t,e),g?.observe(t),m?.observe(t)},v=(e,t)=>{g?.unobserve(t),m?.unobserve(t),h.delete(t),u.delete(e)};g&&Array.from(n.entries()).forEach(([e,t])=>_(e,t)),p(),o.addEventListener(`scroll`,p,{passive:!0}),window.addEventListener(`resize`,p);let y=n.subscribe((e,t,n)=>{n&&n!==t&&v(e,n),t&&_(e,t),p()});return()=>{s&&cancelAnimationFrame(s),g?.disconnect(),m?.disconnect(),y(),o.removeEventListener(`scroll`,p),window.removeEventListener(`resize`,p)}},[n,t,a,e]),r==null?0:a.get(r)??0}function ip({entries:e,trackRef:t,focusIndex:n,onNavigate:r}){let i=(0,G.useRef)({active:!1,moved:!1,startX:0,lastIndex:-1}),a=(0,G.useRef)(!1),o=(0,G.useCallback)((n,a)=>{let o=t.current;if(!o)return;let s=o.getBoundingClientRect(),c=gc(n,s.left,s.width,e.length);if(c==null||c===i.current.lastIndex)return;let l=e[c];l&&(i.current.lastIndex=c,r(l,a))},[e,r,t]);return{handleKeyDown:(0,G.useCallback)(t=>{let r=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,i=r==null?null:Number(r);if(i==null||!Number.isInteger(i))return;let a=null;t.key===`ArrowLeft`&&(a=Math.max(0,i-1)),t.key===`ArrowRight`&&(a=Math.min(e.length-1,i+1)),t.key===`Home`&&(a=0),t.key===`End`&&(a=e.length-1),a!=null&&a!==i&&(t.preventDefault(),n(a))},[e.length,n]),handlePointerDown:(0,G.useCallback)(e=>{e.button===0&&(i.current={active:!0,moved:!1,startX:e.clientX,lastIndex:-1})},[]),handlePointerMove:(0,G.useCallback)(e=>{let t=i.current;if(t.active){if(!t.moved){if(Math.abs(e.clientX-t.startX)<3)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}a.current=!0,o(e.clientX,`auto`)}},[o]),handlePointerUp:(0,G.useCallback)(e=>{i.current.active=!1,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),window.setTimeout(()=>{a.current=!1},0)},[]),handlePointerCancel:(0,G.useCallback)(()=>{i.current.active=!1,a.current=!1},[]),handleClick:(0,G.useCallback)(t=>{if(a.current)return;let n=nd(t.detail),i=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,s=i==null?null:Number(i),c=s==null||!Number.isInteger(s)?void 0:e[s];if(c){r(c,n);return}o(t.clientX,n)},[e,o,r])}}var ap=1;function op({activeIndex:e,entryCount:t,gapWidth:n}){let r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),[o,s]=(0,G.useState)({left:!1,right:!1}),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(()=>Gf(t)),f=t>80,p=f?Math.min(u.start,t):0,m=f?Math.max(p,Math.min(u.end,t)):t,h=(0,G.useCallback)(()=>{let e=r.current;if(!e)return;let n=Kf(t,e.scrollLeft,e.clientWidth,e.scrollWidth);d(e=>e.start===n.start&&e.end===n.end?e:n);let i=Math.max(0,e.scrollWidth-e.clientWidth),a={left:e.scrollLeft>ap,right:e.scrollLeft<i-ap};if(s(e=>e.left===a.left&&e.right===a.right?e:a),i<=0){l(null);return}let o={start:e.scrollLeft/e.scrollWidth,size:e.clientWidth/e.scrollWidth};l(e=>e?.start===o.start&&e.size===o.size?e:o)},[t]);return(0,G.useLayoutEffect)(()=>{h();let e=r.current,t=i.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(h);return n.observe(e),n.observe(t),()=>n.disconnect()},[t,h]),(0,G.useEffect)(()=>{let a=r.current,o=i.current;!a||!o||(Yf(a,o,e,t,n),h())},[e,t,n,h]),(0,G.useLayoutEffect)(()=>{let e=a.current;if(e==null)return;let t=i.current?.querySelector(`[data-timeline-index="${e}"]`);t&&(a.current=null,t.focus())},[m,p]),{scrollRef:r,trackRef:i,virtualized:f,renderStart:p,renderEnd:m,scrollAvailability:o,minimapWindow:c,update:h,scrollByPage:(0,G.useCallback)(e=>{let t=r.current;t&&(t.scrollLeft+=e*Math.max(120,t.clientWidth*.75))},[]),focusIndex:(0,G.useCallback)(e=>{let o=r.current,s=i.current;if(!o||!s)return;let c=s.querySelector(`[data-timeline-index="${e}"]`);if(c){c.focus();return}a.current=e,Yf(o,s,e,t,n),h()},[t,n,h])}}var sp={user:`bg-[var(--timeline-user)]`,agent:`bg-[var(--timeline-agent)]`,"tool-read":`bg-[var(--timeline-tool-read)]`,"tool-write":`bg-[var(--timeline-tool-write)]`,"tool-execute":`bg-[var(--timeline-tool-execute)]`},cp=(0,G.memo)(function({entry:e,index:t,isActive:n,isTooltipVisible:r,virtualized:i,entryCount:a,gapWidth:o,onShowTooltip:s,onHideTooltip:c}){h();let l=`timeline-tooltip-${e.id}`;return(0,W.jsx)(`span`,{className:`session-timeline-item min-w-0`,style:i?qf(t,a,o):void 0,children:(0,W.jsx)(`button`,{type:`button`,"data-timeline-index":t,"data-timeline-kind":e.kind,"aria-current":n?`location`:void 0,"aria-describedby":r?l:void 0,"aria-label":g(`Go to {0}`,[e.tooltip]),className:`t-tt-trigger session-timeline-segment h-full w-full rounded-[2px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)] ${sp[e.kind]}`,onPointerEnter:t=>s(e,t.currentTarget,`pointer`),onPointerLeave:()=>c(e.id),onFocus:t=>s(e,t.currentTarget,`focus`),onBlur:()=>c(e.id)})})});function lp({entries:e,anchorRegistry:t,onNavigate:n}){h();let r=(0,G.useRef)(null),i=rp({rootRef:r,entries:e,anchorRegistry:t}),a=Jf(e.length),{scrollRef:o,trackRef:s,virtualized:c,renderStart:l,renderEnd:u,scrollAvailability:d,minimapWindow:f,update:p,scrollByPage:m,focusIndex:_}=op({activeIndex:i,entryCount:e.length,gapWidth:a.gapWidth}),{tooltip:v,tooltipRef:y,show:b,hide:x,handleScroll:S}=ep(),{handleKeyDown:C,handlePointerDown:w,handlePointerMove:T,handlePointerUp:E,handlePointerCancel:ee,handleClick:D}=ip({entries:e,trackRef:s,focusIndex:_,onNavigate:n}),te=(0,G.useMemo)(()=>e.slice(l,u).map((e,t)=>({entry:e,index:l+t})),[e,u,l]),ne=(0,G.useCallback)(()=>{p(),S()},[S,p]);return(0,W.jsx)(`div`,{className:`sticky top-0 z-20 -mx-2 bg-[var(--console-bg)] px-2 py-3`,children:(0,W.jsxs)(`div`,{ref:r,className:`session-message-timeline relative rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2.5 shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`div`,{ref:o,id:`session-timeline-viewport`,role:`navigation`,"aria-label":g(`Session message timeline`),tabIndex:0,className:`session-timeline-viewport overflow-x-auto overflow-y-hidden overscroll-x-contain py-1`,onScroll:ne,children:(0,W.jsx)(`div`,{ref:s,"data-testid":`session-timeline-track`,className:`${c?`relative`:`grid items-stretch ${a.gapClassName}`} h-5 w-full select-none`,style:c?{minWidth:`${a.minWidth}px`}:{gridTemplateColumns:`repeat(${e.length}, minmax(10px, 1fr))`,minWidth:`${a.minWidth}px`},onKeyDown:C,onPointerDown:w,onPointerMove:T,onPointerUp:E,onPointerCancel:ee,onClick:D,children:te.map(({entry:t,index:n})=>(0,W.jsx)(cp,{entry:t,index:n,isActive:n===i,isTooltipVisible:v?.entryId===t.id,virtualized:c,entryCount:e.length,gapWidth:a.gapWidth,onShowTooltip:b,onHideTooltip:x},t.id))})}),d.left&&(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Scroll timeline left`),className:`absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-start bg-[linear-gradient(to_right,var(--console-surface)_55%,transparent)] pl-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(-1),children:(0,W.jsx)(De,{size:14,"aria-hidden":`true`})}),d.right&&(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Scroll timeline right`),className:`absolute inset-y-0 right-0 z-10 flex w-8 items-center justify-end bg-[linear-gradient(to_left,var(--console-surface)_55%,transparent)] pr-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(1),children:(0,W.jsx)(de,{size:14,"aria-hidden":`true`})})]}),f&&(0,W.jsx)(Zf,{entries:e,viewportRef:o,visibleWindow:f}),(0,W.jsx)(tp,{tooltip:v,tooltipRef:y})]})})}function up({anchorId:e,behavior:t,anchorRegistry:n,prepareAnchor:r,isCurrent:i}){if(typeof document>`u`)return;let a=rd(t,window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),o=n.get(e);if(!o&&r){r();let t=0,s=()=>{if(i()){if(o=n.get(e),o){o.scrollIntoView({behavior:a,block:`center`});return}t+=1,t<8&&requestAnimationFrame(s)}};requestAnimationFrame(s);return}o&&o.scrollIntoView({behavior:a,block:`center`})}function dp(e,t){if(!Ce())return t();let n=performance.now(),r=t(),i=performance.now();return E({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}function fp({session:e,agentCatalog:t,highlightQuery:n,childSessions:r=[]}){let i=h(),a=e.reference.agentName,o=oe(t,a),s=(0,G.useMemo)(()=>dp(`SessionDetail:buildDisplayModel`,()=>$u({messages:e.messages,agentName:a,fileActivity:e.file_activity})),[i,e.file_activity,e.messages,a]),{messages:c,toc:l,fileChangeSummary:u}=s,f=d(e.reference),{state:p,actions:m}=Vd(l,f),[_,v]=(0,G.useState)(null),y=(0,G.useMemo)(()=>dp(`SessionDetail:selectDisplayModel`,()=>s.select(gd(l,p.excluded))),[i,s,l,p.excluded]),{messages:b,timelineEntries:x,visibleUnitCount:S}=y,C=(0,G.useMemo)(()=>new Map(r.map(e=>[e.reference.sessionId,e])),[r]),[w]=(0,G.useState)(gf),T=(0,G.useRef)(null),E=(0,G.useRef)(0),D=(0,G.useCallback)((e,t,n)=>{let r=E.current+1;E.current=r;let i=t==null?void 0:y.resolveListIndex(t);up({anchorId:e,behavior:n,anchorRegistry:w,prepareAnchor:i==null?void 0:()=>T.current?.scrollToIndex(i),isCurrent:()=>E.current===r})},[w,y]),te=(0,G.useCallback)((e,t)=>{D(e,s.resolveMessageIndex(e),t)},[s,D]);return c.length===0?(0,W.jsx)(`div`,{"data-testid":`session-detail`,className:`mx-auto max-w-4xl rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:g(`This session has no displayable messages.`)}):(0,W.jsxs)(`div`,{"data-testid":`session-detail`,className:`mx-auto w-full max-w-[1440px] space-y-8 px-2 md:px-4`,children:[(0,W.jsx)(pp,{summary:typeof e.summary_files==`string`?e.summary_files:void 0}),(0,W.jsxs)(`div`,{className:`grid gap-6 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,W.jsx)(Hf,{toc:l,state:p,fileChangeSummary:u,onOpen:v}),(0,W.jsx)(Uf,{openPanel:_,toc:l,state:p,actions:m,visibleUnitCount:S,fileChangeSummary:u,baseDirectory:e.directory,onClose:()=>v(null),onJumpToAnchor:(e,t)=>{v(null),te(e,t)}}),(0,W.jsx)(Id,{toc:l,state:p,actions:m,visibleUnitCount:S,fileChangeSummary:u,baseDirectory:e.directory,onJumpToAnchor:te}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:[(0,W.jsx)(zd,{toc:l,state:p,actions:m}),b.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lp,{entries:x,anchorRegistry:w,onNavigate:(e,t)=>D(e.anchorId,e.messageIndex,t)}),(0,W.jsx)(ee,{id:`MessageList`,detail:{messages:b.length,virtualized:b.length>80},children:(0,W.jsx)(Ff,{messages:b,sessionAgentKey:a,agent:o,baseDirectory:e.directory,highlightQuery:n,childSessionById:C,apiRef:T,anchorRegistry:w},f)})]}):(0,W.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:g(`No messages match the current filters.`)}),(0,W.jsx)(Bd,{hiddenCount:Ad(l,p),hiddenTools:kd(l,p),onShowAll:m.resetAll})]})]}),(0,W.jsx)(Bf,{session:e,toc:l})]})}function pp({summary:e,defaultExpanded:t=!1}){h();let n=typeof e==`string`?e.trim():``,[r,i]=(0,G.useState)(t);return n?(0,W.jsxs)(`section`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-4 py-3 text-left`,onClick:()=>i(e=>!e),children:[(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),` `,g(`Session Summary`)]}),r?(0,W.jsx)(fe,{className:`size-3.5 text-[var(--console-muted)]`}):(0,W.jsx)(ve,{className:`size-3.5 text-[var(--console-muted)]`})]}),r?(0,W.jsx)(`div`,{className:`border-t border-[var(--console-border)] px-4 py-4`,children:(0,W.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,W.jsx)(Ms,{text:n})})}):null]}):null}export{fp as SessionDetail,gt as a,Ne as c,ht as i,mn as n,ft as o,_t as r,We as s,Hd as t};
53
+ `),[t]);return(0,W.jsxs)(`div`,{ref:a,id:e,className:`scroll-mt-20 overflow-hidden rounded-lg border border-[var(--console-thinking-border)] bg-[var(--console-thinking-bg)]`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between bg-[var(--console-surface-muted)] px-3 py-2 text-left motion-hover hover:bg-[var(--console-surface-muted)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--brand)]`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,W.jsxs)(`span`,{className:`console-mono flex items-center gap-2 text-xs font-medium text-[var(--console-muted)]`,children:[(0,W.jsx)(ke,{className:`size-3.5`}),` `,g(`Thinking`)]}),(0,W.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron w-4 h-4`,"data-open":r||void 0})})]}),(0,W.jsx)(td,{open:r,children:()=>(0,W.jsx)(`div`,{className:`border-t border-dashed border-[var(--console-thinking-border)] px-4 py-3`,children:(0,W.jsx)(Ts,{text:o,initialBudget:bs.plain,children:e=>(0,W.jsx)(`div`,{className:`console-mono whitespace-pre-wrap text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(e,n)})})})})]})}),Df=(0,G.memo)(function({parts:e,anchorIds:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){return h(),(0,W.jsx)(`div`,{className:`space-y-2`,children:(0,W.jsx)(`div`,{className:`space-y-2`,children:e.map((e,a)=>(0,W.jsx)(Af,{tool:e,anchorId:t?.[a],sessionAgentKey:n,baseDirectory:r,highlightQuery:i},a))})})}),Of=(0,G.memo)(function({anchorId:e,parts:t,highlightQuery:n}){h();let r=yf(e);return(0,W.jsx)(`div`,{ref:r,id:e,className:`scroll-mt-20 space-y-2`,children:t.map((e,t)=>(0,W.jsx)(kf,{part:e,highlightQuery:n},t))})}),kf=(0,G.memo)(function({part:e,highlightQuery:t}){let n=h(),[r,i]=(0,G.useState)(!1),a=(0,G.useMemo)(()=>hf(e),[n,e]),o=a.approvalStatus===`fail`?bf.error:bf.completed,s=o.icon;return(0,W.jsxs)(`div`,{children:[(0,W.jsxs)(`div`,{className:`flex flex-wrap items-start gap-2`,children:[(0,W.jsx)(`div`,{className:`w-full md:w-[560px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2 text-left shadow-[var(--shadow-raised)] ${a.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:a.expandable?(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-start gap-2 text-left`,onClick:()=>i(e=>!e),"aria-expanded":r,children:[(0,W.jsx)(xe,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:g(a.title)})}),(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron size-3.5`,"data-open":r||void 0})})]}):(0,W.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,W.jsx)(xe,{className:`mt-0.5 size-3.5 shrink-0 text-[var(--console-accent)]`}),(0,W.jsx)(`span`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:g(a.title)})})]})}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] font-bold uppercase tracking-wider ${o.className}`,children:[(0,W.jsx)(s,{className:`size-3`}),g(o.label)]})]}),(0,W.jsx)(td,{open:a.expandable&&r,children:()=>(0,W.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:a.contentLabel})}),(0,W.jsx)(`div`,{className:`bg-[var(--console-surface-sunken)] p-4`,children:(0,W.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,W.jsx)(Sf,{text:a.contentMarkdown,highlightQuery:t})})})]})})]})}),Af=(0,G.memo)(function({tool:e,anchorId:t,sessionAgentKey:n,baseDirectory:r,highlightQuery:i}){let a=h(),[o,s]=(0,G.useState)(!1),c=yf(t),l=(0,G.useMemo)(()=>Zs(e),[e]),u=(0,G.useMemo)(()=>Xu(n,e,l,r),[a,r,n,l,e]),d=(0,G.useMemo)(()=>pl(l.inputText||`{}`,r),[r,l.inputText]),f=bf[l.status],p=f.icon,m=u.Icon;return(0,W.jsxs)(`div`,{ref:c,id:t,className:`scroll-mt-20`,children:[(0,W.jsx)(`div`,{className:`flex flex-wrap items-start gap-2`,children:(0,W.jsx)(`div`,{className:`w-full max-w-[720px] rounded-lg border border-[var(--console-border-strong)] bg-[var(--console-surface)] px-3 py-2.5 text-left shadow-[var(--shadow-raised)] ${u.expandable?`motion-hover hover:bg-[var(--console-surface-muted)]`:``}`,children:u.expandable?(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center gap-2.5 text-left active:scale-[0.995] motion-reduce:transform-none`,onClick:()=>s(!o),"aria-expanded":o,children:[(0,W.jsx)(m,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:u.title}),u.secondaryText?(0,W.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(u.secondaryText,i)}):null]}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${f.className}`,children:[(0,W.jsx)(p,{className:`size-2.5 ${l.status===`running`?`animate-spin motion-reduce:animate-none`:``}`}),g(f.label)]}),(0,W.jsx)(`span`,{className:`mt-0.5 shrink-0 text-[var(--console-muted)]`,children:(0,W.jsx)(ve,{className:`motion-chevron size-3.5`,"data-open":o||void 0})})]}):(0,W.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,W.jsx)(m,{className:`size-4 shrink-0 text-[var(--console-accent)]`}),(0,W.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,W.jsx)(`span`,{className:`console-mono block text-xs font-semibold text-[var(--console-text)]`,children:u.title}),u.secondaryText?(0,W.jsx)(`span`,{className:`console-mono mt-0.5 block whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(u.secondaryText,i)}):null]}),(0,W.jsxs)(`span`,{className:`console-mono inline-flex shrink-0 items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-bold uppercase tracking-wider ${f.className}`,children:[(0,W.jsx)(p,{className:`size-2.5`}),g(f.label)]})]})})}),(0,W.jsx)(td,{open:u.expandable&&o,children:()=>(0,W.jsxs)(`div`,{className:`mt-2 overflow-hidden rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsx)(`div`,{className:`border-b border-[var(--console-border)] bg-[var(--console-surface-muted)] px-3 py-1.5`,children:(0,W.jsx)(`span`,{className:`console-mono text-xs text-[var(--console-muted)]`,children:u.contentLabel??g(`Output`)})}),(0,W.jsxs)(`div`,{className:`space-y-3 bg-[var(--console-surface-sunken)] p-3`,children:[u.details.length>0?(0,W.jsx)(`div`,{className:`rounded-md border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2`,children:(0,W.jsx)(`div`,{className:`space-y-2`,children:u.details.map(e=>(0,W.jsxs)(`div`,{className:`flex flex-col gap-1 md:flex-row md:items-start md:gap-3`,children:[(0,W.jsx)(`span`,{className:`console-mono shrink-0 text-[11px] font-semibold uppercase tracking-wide text-[var(--console-muted)] md:w-24`,children:e.label}),(0,W.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,W.jsx)(Ts,{text:e.value,initialBudget:bs.plain,children:e=>(0,W.jsx)(`span`,{className:`console-mono whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-text)]`,children:xf(e,i)})})})]},`${e.label}:${e.value}`))})}):null,(0,W.jsx)(df,{outputContent:u.outputContent})]}),u.showInputPreview?(0,W.jsxs)(`div`,{className:`border-t border-[var(--console-border)] bg-[var(--console-surface-sunken)] px-3 py-2`,children:[(0,W.jsx)(`span`,{className:`console-mono text-[11px] text-[var(--console-muted)]`,children:g(`Input Preview`)}),(0,W.jsx)(Ts,{text:d,initialBudget:bs.plain,children:e=>(0,W.jsx)(`pre`,{className:`console-mono mt-1 max-h-[200px] overflow-x-auto whitespace-pre-wrap break-words text-xs leading-relaxed text-[var(--console-muted)]`,children:xf(e,i)})})]}):null]})})]})}),jf=class{count;gap;sizes;measured;tree;constructor(e,t,n){this.count=e,this.gap=n,this.sizes=new Float64Array(e),this.measured=new Uint8Array(e),this.tree=new Float64Array(e+1);for(let n=0;n<e;n+=1)this.sizes[n]=this.extentOf(t,n);this.buildTree()}heightAt(e){return e<0||e>=this.count?0:this.sizes[e]-this.gapAfter(e)}setHeight(e,t){if(e<0||e>=this.count||!Number.isFinite(t)||t<=0)return!1;let n=Math.ceil(t);if(this.measured[e]===1&&Math.abs(this.heightAt(e)-n)<=1)return!1;let r=this.extentOf(n,e),i=r-this.sizes[e];return this.sizes[e]=r,this.measured[e]=1,i!==0&&this.addToTree(e,i),!0}startAt(e){return this.prefixSum(Math.max(0,Math.min(e,this.count)))}endAt(e){return this.startAt(e)+this.heightAt(e)}get totalSize(){return this.prefixSum(this.count)}firstEndAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.endAt(r)<e?t=r+1:n=r}return t}firstStartAfter(e){let t=0,n=this.count;for(;t<n;){let r=t+n>>1;this.startAt(r)<=e?t=r+1:n=r}return t}gapAfter(e){return e===this.count-1?0:this.gap}extentOf(e,t){return e+this.gapAfter(t)}buildTree(){for(let e=0;e<this.count;e+=1){let t=e+1;this.tree[t]+=this.sizes[e];let n=t+(t&-t);n<=this.count&&(this.tree[n]+=this.tree[t])}}addToTree(e,t){for(let n=e+1;n<=this.count;n+=n&-n)this.tree[n]+=t}prefixSum(e){let t=0;for(let n=e;n>0;n-=n&-n)t+=this.tree[n];return t}},Mf=32,Nf=280,Pf=6;function Ff({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}){h();let l=e.length>80;return(0,G.useEffect)(()=>{l||(o.current=null)},[o,l]),l?(0,W.jsx)(If,{messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}):(0,W.jsx)(vf,{registry:s,children:(0,W.jsx)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:e.map(({msg:e,blocks:o,index:s})=>(0,W.jsx)(Cf,{messageIndex:s,msg:e,blocks:o,formatTokens:c,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a},`${e.id}:${s}`))})})}function If({messages:e,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a,apiRef:o,anchorRegistry:s}){let l=h(),u=(0,G.useRef)(null),d=(0,G.useRef)(null),[f,p]=(0,G.useState)(0),m=(0,G.useRef)(0),[g,_]=(0,G.useState)(null),[v,y]=(0,G.useState)(()=>({scrollTop:0,height:900,listTop:0})),b=(0,G.useRef)(v);(0,G.useEffect)(()=>{b.current=v},[v]);let x=(0,G.useCallback)(()=>{if(typeof window>`u`)return null;let e=u.current,t=e?id(e):window;d.current=t;let n=e?ld(t,e):0,r={scrollTop:od(t),height:sd(t),listTop:n},i=b.current;return Math.abs(i.scrollTop-r.scrollTop)<1&&Math.abs(i.height-r.height)<1&&Math.abs(i.listTop-r.listTop)<1?t:(b.current=r,y(r),t)},[]);(0,G.useEffect)(()=>{let e=0,t=null,n=null,r=e=>{t!==e&&(t&&(t.removeEventListener(`scroll`,a),n&&!ad(t)&&n.unobserve(t)),t=e,t.addEventListener(`scroll`,a,{passive:!0}),n&&!ad(t)&&n.observe(t))},i=()=>{let e=x();e&&r(e)},a=()=>{e||=requestAnimationFrame(()=>{e=0,i()})};window.addEventListener(`resize`,a),typeof ResizeObserver<`u`&&(n=new ResizeObserver(a),u.current&&n.observe(u.current),document.body&&n.observe(document.body));let o=new MutationObserver(a),s=u.current?.parentElement;for(;s;)o.observe(s,{attributes:!0,attributeFilter:[`class`,`style`]}),s=s.parentElement;return document.fonts?.addEventListener(`loadingdone`,a),i(),()=>{e&&cancelAnimationFrame(e),n?.disconnect(),o.disconnect(),document.fonts?.removeEventListener(`loadingdone`,a),t?.removeEventListener(`scroll`,a),window.removeEventListener(`resize`,a)}},[x]);let S=(0,G.useMemo)(()=>new jf(e.length,Nf,Mf),[e]);(0,G.useEffect)(()=>{x()},[e,x]),(0,G.useEffect)(()=>()=>{m.current&&cancelAnimationFrame(m.current),m.current=0},[]);let C=(0,G.useCallback)((e,t)=>{S.setHeight(e,t)&&(m.current||=requestAnimationFrame(()=>{m.current=0,p(e=>e+1)}))},[S]),w=(0,G.useMemo)(()=>{if(e.length===0)return[];let t=Math.max(0,v.scrollTop-v.listTop),n=t+v.height,r=Math.max(0,S.firstEndAfter(t)-Pf),i=Math.min(e.length,S.firstStartAfter(n)+Pf),a=[];for(let e=r;e<i;e+=1)a.push({index:e,start:S.startAt(e)});let o=g?.heightIndex===S?g.index:null;return o!=null&&o>=0&&o<e.length&&(a.some(e=>e.index===o)||(a.push({index:o,start:S.startAt(o)}),a.sort((e,t)=>e.start-t.start))),a},[l,g,S,f,e.length,v]),T=(0,G.useCallback)(t=>{if(typeof window>`u`||t<0||t>=e.length)return;_({heightIndex:S,index:t});let n=u.current,r=n?id(n):d.current??window;d.current=r;let i=n?ld(r,n):0,a=Math.max(0,i+S.startAt(t)-24);ud(r,a);let o={scrollTop:a,height:sd(r),listTop:i};b.current=o,y(o)},[S,e.length]);return(0,G.useEffect)(()=>(o.current={scrollToIndex:T},()=>{o.current?.scrollToIndex===T&&(o.current=null)}),[o,T]),(0,W.jsx)(vf,{registry:s,children:(0,W.jsx)(`div`,{ref:u,className:`relative min-w-0`,style:{height:Math.max(1,S.totalSize)},children:w.map(({index:o,start:s})=>{let l=e[o];return l?(0,W.jsx)(Lf,{index:o,top:s,onMeasure:C,children:(0,W.jsx)(Cf,{messageIndex:l.index,msg:l.msg,blocks:l.blocks,formatTokens:c,sessionAgentKey:t,agent:n,baseDirectory:r,highlightQuery:i,childSessionById:a})},`${l.msg.id}:${l.index}`):null})})})}function Lf({index:e,top:t,onMeasure:n,children:r}){h();let i=(0,G.useRef)(null);return(0,G.useLayoutEffect)(()=>{let t=i.current;if(!t)return;let r=()=>n(e,t.getBoundingClientRect().height);if(r(),typeof ResizeObserver>`u`)return;let a=new ResizeObserver(r);return a.observe(t),()=>a.disconnect()},[e,n]),(0,W.jsx)(`div`,{ref:i,className:`absolute left-0 top-0 w-full`,style:{transform:`translateY(${t}px)`},children:r})}var Rf=(0,G.lazy)(()=>_(()=>import(`./InteractiveReceipt-DGC-xV7U.js`).then(e=>({default:e.InteractiveReceipt})),__vite__mapDeps([2,1,3,4,5,6,7,8,9])));function zf(){return h(),(0,W.jsx)(`div`,{className:`h-[calc(100dvh-5.5rem)] min-h-[420px] rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)]`})}function Bf({session:e,toc:t}){h();let[n,r]=(0,G.useState)(!1),[i,a]=(0,G.useState)(!1);return(0,G.useEffect)(()=>{if(!n)return;let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>a(!0))}),i=window.matchMedia(`(min-width: 1025px)`),o=()=>{i.matches||(r(!1),a(!1))};return i.addEventListener(`change`,o),()=>{cancelAnimationFrame(t),e&&cancelAnimationFrame(e),i.removeEventListener(`change`,o)}},[n]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`button`,{type:`button`,"aria-expanded":n,"aria-label":g(`Open session receipt`),onClick:()=>{a(!1),r(!0)},className:`console-mono fixed right-0 top-1/2 z-40 hidden h-32 w-10 -translate-y-1/2 items-center justify-center rounded-l-sm border border-r-0 border-[var(--console-border)] bg-[var(--console-surface)] text-[10px] font-semibold uppercase tracking-[0.14em] text-[var(--console-text)] shadow-[var(--shadow-overlay)] motion-hover hover:bg-[var(--console-surface-muted)] min-[1025px]:flex`,children:(0,W.jsx)(`span`,{className:`[writing-mode:vertical-rl]`,children:g(`Receipt`)})}),(0,W.jsx)(we,{open:n,onOpenChange:e=>{r(e),e||a(!1)},title:g(`Session Receipt`),variant:`desktop`,children:i?(0,W.jsx)(ee,{id:`InteractiveReceipt`,children:(0,W.jsx)(be,{children:(0,W.jsx)(G.Suspense,{fallback:(0,W.jsx)(zf,{}),children:(0,W.jsx)(Rf,{session:e,toc:t},d(e.reference))})})}):(0,W.jsx)(zf,{})})]})}var Vf=`console-mono motion-hover inline-flex h-9 items-center gap-2 rounded-sm border border-[var(--console-border)] bg-[var(--console-surface)] px-3 text-xs font-semibold tracking-[0.12em] text-[var(--console-text)] uppercase shadow-[var(--shadow-raised)] hover:bg-[var(--console-surface-muted)]`;function Hf({toc:e,state:t,fileChangeSummary:n,onOpen:r}){h();let i=dd(n),a=Rd(e,t);return(0,W.jsxs)(`div`,{className:`flex flex-wrap gap-2 min-[1025px]:hidden`,children:[(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(`toc`),className:Vf,children:[(0,W.jsx)(ie,{className:`size-3.5 text-[var(--brand)]`}),a>0?g(`{0} filters`,[a]):g(`Content filters`)]}),i>0?(0,W.jsxs)(`button`,{type:`button`,onClick:()=>r(`files`),className:Vf,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),` `,g(`Files`),` `,(0,W.jsx)(`span`,{className:`text-[var(--console-muted)]`,children:i})]}):null]})}function Uf({openPanel:e,fileChangeSummary:t,baseDirectory:n,onClose:r,onJumpToAnchor:i,...a}){return h(),(0,G.useEffect)(()=>{if(!e)return;let t=window.matchMedia(`(min-width: 1025px)`),n=()=>{t.matches&&r()};return t.addEventListener(`change`,n),n(),()=>{t.removeEventListener(`change`,n)}},[r,e]),(0,W.jsx)(we,{open:e!==null,onOpenChange:e=>{e||r()},title:g(e===`files`?`File Tracker`:`Content filters`),variant:`mobile`,children:e?e===`toc`?(0,W.jsx)(Nd,{...a}):(0,W.jsx)(fd,{summary:t,baseDirectory:n,onJumpToAnchor:i}):null})}var Wf=6;function Gf(e){return{start:0,end:Math.min(e,80)}}function Kf(e,t,n,r){if(e<=80)return{start:0,end:e};if(n<=0||r<=0)return Gf(e);if(n>=r)return{start:0,end:e};let i=Math.floor(Math.max(0,t)/r*e),a=Math.ceil(Math.min(r,t+n)/r*e);return{start:Math.max(0,i-Wf),end:Math.min(e,a+Wf)}}function qf(e,t,n){let r=100/t;return{position:`absolute`,top:0,bottom:0,left:`calc(${e*r}% + ${e*n/t}px)`,width:`calc(${r}% - ${(t-1)*n/t}px)`}}function Jf(e){let t=e>80?{className:`gap-px`,width:1}:e>40?{className:`gap-0.5`,width:2}:{className:`gap-1`,width:4};return{gapClassName:t.className,gapWidth:t.width,minWidth:e*10+Math.max(0,e-1)*t.width}}function Yf(e,t,n,r,i){if(r===0||e.clientWidth<=0)return;let a=Math.max(e.scrollWidth,t.scrollWidth,t.getBoundingClientRect().width);if(a<=0)return;let o=Math.max(0,(a-Math.max(0,r-1)*i)/r),s=n*(o+i),c=s+o,l=e.scrollLeft,u=l+e.clientWidth;s<l?e.scrollLeft=s:c>u&&(e.scrollLeft=c-e.clientWidth)}var Xf={user:`--timeline-user`,agent:`--timeline-agent`,"tool-read":`--timeline-tool-read`,"tool-write":`--timeline-tool-write`,"tool-execute":`--timeline-tool-execute`};function Zf({entries:e,viewportRef:t,visibleWindow:n}){h();let r=(0,G.useRef)(null),i=(0,G.useRef)(null);(0,G.useEffect)(()=>{let t=r.current;if(!t)return;let n=()=>{let n=t.getContext(`2d`),r=t.clientWidth,i=t.clientHeight;if(!n||!r||!i||e.length===0)return;let a=window.devicePixelRatio||1;t.width=Math.round(r*a),t.height=Math.round(i*a),n.scale(a,a),n.clearRect(0,0,r,i);let o=window.getComputedStyle(t),s=Object.fromEntries(Object.entries(Xf).map(([e,t])=>[e,o.getPropertyValue(t).trim()||o.color]));e.forEach((t,a)=>{let o=a/e.length*r,c=(a+1)/e.length*r;n.fillStyle=s[t.kind],n.fillRect(o,0,Math.max(c-o,.5),i)})};n();let i=new MutationObserver(n);if(i.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]}),typeof ResizeObserver>`u`)return()=>i.disconnect();let a=new ResizeObserver(n);return a.observe(t),()=>{i.disconnect(),a.disconnect()}},[e]);let a=(0,G.useCallback)((e,n)=>{let r=t.current;r&&(r.scrollLeft=(e-n)*r.scrollWidth)},[t]),o=(0,G.useCallback)(e=>{let n=t.current;if(!n)return;let r=Math.max(0,n.scrollWidth-n.clientWidth),i=Math.max(40,n.clientWidth*.1),a=Math.max(120,n.clientWidth*.75),o=null;e.key===`ArrowLeft`&&(o=n.scrollLeft-i),e.key===`ArrowRight`&&(o=n.scrollLeft+i),e.key===`PageUp`&&(o=n.scrollLeft-a),e.key===`PageDown`&&(o=n.scrollLeft+a),e.key===`Home`&&(o=0),e.key===`End`&&(o=r),o!=null&&(e.preventDefault(),n.scrollLeft=Math.min(r,Math.max(0,o)))},[t]);return(0,W.jsx)(`div`,{"data-testid":`session-timeline-minimap`,role:`scrollbar`,"aria-controls":`session-timeline-viewport`,"aria-orientation":`horizontal`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(n.start/(1-n.size)*100),"aria-label":g(`Timeline scroll position`),tabIndex:0,className:`session-timeline-minimap relative mt-2 h-2.5 cursor-pointer touch-none select-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)]`,onKeyDown:o,onPointerDown:e=>{if(e.button!==0)return;let t=e.currentTarget.getBoundingClientRect();if(t.width<=0)return;let r=(e.clientX-t.left)/t.width,o=r>=n.start&&r<=n.start+n.size?r-n.start:n.size/2;i.current={pointerId:e.pointerId,grabOffset:o},e.currentTarget.setPointerCapture(e.pointerId),a(r,o)},onPointerMove:e=>{let t=i.current;if(!t||t.pointerId!==e.pointerId)return;let n=e.currentTarget.getBoundingClientRect();n.width<=0||a((e.clientX-n.left)/n.width,t.grabOffset)},onPointerUp:e=>{i.current=null,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId)},onPointerCancel:()=>{i.current=null},children:(0,W.jsxs)(`div`,{className:`relative h-full w-full overflow-hidden rounded-[2px]`,children:[(0,W.jsx)(`canvas`,{ref:r,"aria-hidden":`true`,className:`absolute inset-0 h-full w-full`}),(0,W.jsx)(`div`,{"data-testid":`session-timeline-minimap-window`,className:`session-timeline-minimap-window absolute inset-y-0`,style:{left:`${n.start*100}%`,width:`${n.size*100}%`}})]})})}var Qf=e(a(),1),$f=8;function ep(){let e=(0,G.useRef)(null),t=(0,G.useRef)(null),[n,r]=(0,G.useState)(null);return(0,G.useLayoutEffect)(()=>{let t=e.current;if(!t||!n)return;let r=t.offsetWidth/2,i=Math.min(window.innerWidth-$f-r,Math.max($f+r,n.anchorX));t.style.left=`${i}px`},[n]),{tooltip:n,tooltipRef:e,show:(0,G.useCallback)((e,n,i)=>{let a=n.getBoundingClientRect();t.current=n,r({entryId:e.id,id:`timeline-tooltip-${e.id}`,text:e.tooltip,anchorX:a.left+a.width/2,top:a.bottom+8,source:i})},[]),hide:(0,G.useCallback)(e=>{r(n=>n?.entryId===e?(t.current=null,null):n)},[]),handleScroll:(0,G.useCallback)(()=>{r(e=>{let n=t.current;if(!e||e.source!==`focus`||!n||n!==document.activeElement)return t.current=null,null;let r=n.getBoundingClientRect();return{...e,anchorX:r.left+r.width/2,top:r.bottom+8}})},[])}}function tp({tooltip:e,tooltipRef:t}){return e?(0,Qf.createPortal)((0,W.jsx)(`span`,{ref:t,id:e.id,role:`tooltip`,className:`t-tt session-timeline-floating-tooltip console-mono text-[11px]`,style:{left:e.anchorX,top:e.top},children:e.text}),document.body):null}function np(e){let t=sd(e);return{center:ad(e)?t/2:e.getBoundingClientRect().top+t/2,scrollTop:od(e),viewportHeight:t,scrollHeight:cd(e)}}function rp({rootRef:e,entries:t,anchorRegistry:n}){let[r,i]=(0,G.useState)(null),a=(0,G.useMemo)(()=>new Map(t.map((e,t)=>[e.anchorId,t])),[t]);return(0,G.useEffect)(()=>{let r=e.current;if(!r||t.length===0)return;let o=id(r),s=0,c=(e,t)=>{let n=a.get(e);return n==null?null:{index:n,top:t.getBoundingClientRect().top}},l=()=>Array.from(n.entries()).flatMap(([e,t])=>c(e,t)??[]),u=new Map,d=()=>Array.from(u).flatMap(([e,t])=>c(e,t)??[]),f=()=>{let e=np(o),n=hc(e.scrollTop,e.viewportHeight,e.scrollHeight,t.length),r=g?d():l(),a=n??mc(r,e.center),s=a==null?null:t[a]?.anchorId;s!=null&&i(e=>e===s?e:s)},p=()=>{s||=requestAnimationFrame(()=>{s=0,f()})},m=typeof ResizeObserver>`u`?null:new ResizeObserver(p),h=new WeakMap,g=typeof IntersectionObserver>`u`?null:new IntersectionObserver(e=>{for(let t of e){let e=t.target,n=h.get(e);n&&(t.isIntersecting?u.set(n,e):u.delete(n))}p()},{root:ad(o)?null:o,threshold:0}),_=(e,t)=>{h.set(t,e),g?.observe(t),m?.observe(t)},v=(e,t)=>{g?.unobserve(t),m?.unobserve(t),h.delete(t),u.delete(e)};g&&Array.from(n.entries()).forEach(([e,t])=>_(e,t)),p(),o.addEventListener(`scroll`,p,{passive:!0}),window.addEventListener(`resize`,p);let y=n.subscribe((e,t,n)=>{n&&n!==t&&v(e,n),t&&_(e,t),p()});return()=>{s&&cancelAnimationFrame(s),g?.disconnect(),m?.disconnect(),y(),o.removeEventListener(`scroll`,p),window.removeEventListener(`resize`,p)}},[n,t,a,e]),r==null?0:a.get(r)??0}function ip({entries:e,trackRef:t,focusIndex:n,onNavigate:r}){let i=(0,G.useRef)({active:!1,moved:!1,startX:0,lastIndex:-1}),a=(0,G.useRef)(!1),o=(0,G.useCallback)((n,a)=>{let o=t.current;if(!o)return;let s=o.getBoundingClientRect(),c=gc(n,s.left,s.width,e.length);if(c==null||c===i.current.lastIndex)return;let l=e[c];l&&(i.current.lastIndex=c,r(l,a))},[e,r,t]);return{handleKeyDown:(0,G.useCallback)(t=>{let r=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,i=r==null?null:Number(r);if(i==null||!Number.isInteger(i))return;let a=null;t.key===`ArrowLeft`&&(a=Math.max(0,i-1)),t.key===`ArrowRight`&&(a=Math.min(e.length-1,i+1)),t.key===`Home`&&(a=0),t.key===`End`&&(a=e.length-1),a!=null&&a!==i&&(t.preventDefault(),n(a))},[e.length,n]),handlePointerDown:(0,G.useCallback)(e=>{e.button===0&&(i.current={active:!0,moved:!1,startX:e.clientX,lastIndex:-1})},[]),handlePointerMove:(0,G.useCallback)(e=>{let t=i.current;if(t.active){if(!t.moved){if(Math.abs(e.clientX-t.startX)<3)return;t.moved=!0,e.currentTarget.setPointerCapture(e.pointerId)}a.current=!0,o(e.clientX,`auto`)}},[o]),handlePointerUp:(0,G.useCallback)(e=>{i.current.active=!1,e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId),window.setTimeout(()=>{a.current=!1},0)},[]),handlePointerCancel:(0,G.useCallback)(()=>{i.current.active=!1,a.current=!1},[]),handleClick:(0,G.useCallback)(t=>{if(a.current)return;let n=nd(t.detail),i=t.target.closest(`[data-timeline-index]`)?.dataset.timelineIndex,s=i==null?null:Number(i),c=s==null||!Number.isInteger(s)?void 0:e[s];if(c){r(c,n);return}o(t.clientX,n)},[e,o,r])}}var ap=1;function op({activeIndex:e,entryCount:t,gapWidth:n}){let r=(0,G.useRef)(null),i=(0,G.useRef)(null),a=(0,G.useRef)(null),[o,s]=(0,G.useState)({left:!1,right:!1}),[c,l]=(0,G.useState)(null),[u,d]=(0,G.useState)(()=>Gf(t)),f=t>80,p=f?Math.min(u.start,t):0,m=f?Math.max(p,Math.min(u.end,t)):t,h=(0,G.useCallback)(()=>{let e=r.current;if(!e)return;let n=Kf(t,e.scrollLeft,e.clientWidth,e.scrollWidth);d(e=>e.start===n.start&&e.end===n.end?e:n);let i=Math.max(0,e.scrollWidth-e.clientWidth),a={left:e.scrollLeft>ap,right:e.scrollLeft<i-ap};if(s(e=>e.left===a.left&&e.right===a.right?e:a),i<=0){l(null);return}let o={start:e.scrollLeft/e.scrollWidth,size:e.clientWidth/e.scrollWidth};l(e=>e?.start===o.start&&e.size===o.size?e:o)},[t]);return(0,G.useLayoutEffect)(()=>{h();let e=r.current,t=i.current;if(!e||!t||typeof ResizeObserver>`u`)return;let n=new ResizeObserver(h);return n.observe(e),n.observe(t),()=>n.disconnect()},[t,h]),(0,G.useEffect)(()=>{let a=r.current,o=i.current;!a||!o||(Yf(a,o,e,t,n),h())},[e,t,n,h]),(0,G.useLayoutEffect)(()=>{let e=a.current;if(e==null)return;let t=i.current?.querySelector(`[data-timeline-index="${e}"]`);t&&(a.current=null,t.focus())},[m,p]),{scrollRef:r,trackRef:i,virtualized:f,renderStart:p,renderEnd:m,scrollAvailability:o,minimapWindow:c,update:h,scrollByPage:(0,G.useCallback)(e=>{let t=r.current;t&&(t.scrollLeft+=e*Math.max(120,t.clientWidth*.75))},[]),focusIndex:(0,G.useCallback)(e=>{let o=r.current,s=i.current;if(!o||!s)return;let c=s.querySelector(`[data-timeline-index="${e}"]`);if(c){c.focus();return}a.current=e,Yf(o,s,e,t,n),h()},[t,n,h])}}var sp={user:`bg-[var(--timeline-user)]`,agent:`bg-[var(--timeline-agent)]`,"tool-read":`bg-[var(--timeline-tool-read)]`,"tool-write":`bg-[var(--timeline-tool-write)]`,"tool-execute":`bg-[var(--timeline-tool-execute)]`},cp=(0,G.memo)(function({entry:e,index:t,isActive:n,isTooltipVisible:r,virtualized:i,entryCount:a,gapWidth:o,onShowTooltip:s,onHideTooltip:c}){h();let l=`timeline-tooltip-${e.id}`;return(0,W.jsx)(`span`,{className:`session-timeline-item min-w-0`,style:i?qf(t,a,o):void 0,children:(0,W.jsx)(`button`,{type:`button`,"data-timeline-index":t,"data-timeline-kind":e.kind,"aria-current":n?`location`:void 0,"aria-describedby":r?l:void 0,"aria-label":g(`Go to {0}`,[e.tooltip]),className:`t-tt-trigger session-timeline-segment h-full w-full rounded-[2px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--brand)] ${sp[e.kind]}`,onPointerEnter:t=>s(e,t.currentTarget,`pointer`),onPointerLeave:()=>c(e.id),onFocus:t=>s(e,t.currentTarget,`focus`),onBlur:()=>c(e.id)})})});function lp({entries:e,anchorRegistry:t,onNavigate:n}){h();let r=(0,G.useRef)(null),i=rp({rootRef:r,entries:e,anchorRegistry:t}),a=Jf(e.length),{scrollRef:o,trackRef:s,virtualized:c,renderStart:l,renderEnd:u,scrollAvailability:d,minimapWindow:f,update:p,scrollByPage:m,focusIndex:_}=op({activeIndex:i,entryCount:e.length,gapWidth:a.gapWidth}),{tooltip:v,tooltipRef:y,show:b,hide:x,handleScroll:S}=ep(),{handleKeyDown:C,handlePointerDown:w,handlePointerMove:T,handlePointerUp:E,handlePointerCancel:ee,handleClick:D}=ip({entries:e,trackRef:s,focusIndex:_,onNavigate:n}),te=(0,G.useMemo)(()=>e.slice(l,u).map((e,t)=>({entry:e,index:l+t})),[e,u,l]),ne=(0,G.useCallback)(()=>{p(),S()},[S,p]);return(0,W.jsx)(`div`,{className:`sticky top-0 z-20 -mx-2 bg-[var(--console-bg)] px-2 py-3`,children:(0,W.jsxs)(`div`,{ref:r,className:`session-message-timeline relative rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] px-3 py-2.5 shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`div`,{className:`relative`,children:[(0,W.jsx)(`div`,{ref:o,id:`session-timeline-viewport`,role:`navigation`,"aria-label":g(`Session message timeline`),tabIndex:0,className:`session-timeline-viewport overflow-x-auto overflow-y-hidden overscroll-x-contain py-1`,onScroll:ne,children:(0,W.jsx)(`div`,{ref:s,"data-testid":`session-timeline-track`,className:`${c?`relative`:`grid items-stretch ${a.gapClassName}`} h-5 w-full select-none`,style:c?{minWidth:`${a.minWidth}px`}:{gridTemplateColumns:`repeat(${e.length}, minmax(10px, 1fr))`,minWidth:`${a.minWidth}px`},onKeyDown:C,onPointerDown:w,onPointerMove:T,onPointerUp:E,onPointerCancel:ee,onClick:D,children:te.map(({entry:t,index:n})=>(0,W.jsx)(cp,{entry:t,index:n,isActive:n===i,isTooltipVisible:v?.entryId===t.id,virtualized:c,entryCount:e.length,gapWidth:a.gapWidth,onShowTooltip:b,onHideTooltip:x},t.id))})}),d.left&&(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Scroll timeline left`),className:`absolute inset-y-0 left-0 z-10 flex w-8 items-center justify-start bg-[linear-gradient(to_right,var(--console-surface)_55%,transparent)] pl-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(-1),children:(0,W.jsx)(De,{size:14,"aria-hidden":`true`})}),d.right&&(0,W.jsx)(`button`,{type:`button`,"aria-label":g(`Scroll timeline right`),className:`absolute inset-y-0 right-0 z-10 flex w-8 items-center justify-end bg-[linear-gradient(to_left,var(--console-surface)_55%,transparent)] pr-0.5 text-[var(--console-muted)] hover:text-[var(--console-text)] focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-[var(--brand)]`,onClick:()=>m(1),children:(0,W.jsx)(de,{size:14,"aria-hidden":`true`})})]}),f&&(0,W.jsx)(Zf,{entries:e,viewportRef:o,visibleWindow:f}),(0,W.jsx)(tp,{tooltip:v,tooltipRef:y})]})})}function up({anchorId:e,behavior:t,anchorRegistry:n,prepareAnchor:r,isCurrent:i}){if(typeof document>`u`)return;let a=rd(t,window.matchMedia(`(prefers-reduced-motion: reduce)`).matches),o=n.get(e);if(!o&&r){r();let t=0,s=()=>{if(i()){if(o=n.get(e),o){o.scrollIntoView({behavior:a,block:`center`});return}t+=1,t<8&&requestAnimationFrame(s)}};requestAnimationFrame(s);return}o&&o.scrollIntoView({behavior:a,block:`center`})}function dp(e,t){if(!Ce())return t();let n=performance.now(),r=t(),i=performance.now();return E({id:e,source:`custom-timing`,phase:`measure`,actualDuration:Math.round((i-n)*100)/100,baseDuration:0,startTime:n,commitTime:i}),r}function fp({session:e,agentCatalog:t,highlightQuery:n,childSessions:r=[]}){let i=h(),a=e.reference.agentName,o=oe(t,a),s=(0,G.useMemo)(()=>dp(`SessionDetail:buildDisplayModel`,()=>$u({messages:e.messages,agentName:a,fileActivity:e.file_activity})),[i,e.file_activity,e.messages,a]),{messages:c,toc:l,fileChangeSummary:u}=s,f=d(e.reference),{state:p,actions:m}=Vd(l,f),[_,v]=(0,G.useState)(null),y=(0,G.useMemo)(()=>dp(`SessionDetail:selectDisplayModel`,()=>s.select(gd(l,p.excluded))),[i,s,l,p.excluded]),{messages:b,timelineEntries:x,visibleUnitCount:S}=y,C=(0,G.useMemo)(()=>new Map(r.map(e=>[e.reference.sessionId,e])),[r]),[w]=(0,G.useState)(gf),T=(0,G.useRef)(null),E=(0,G.useRef)(0),D=(0,G.useCallback)((e,t,n)=>{let r=E.current+1;E.current=r;let i=t==null?void 0:y.resolveListIndex(t);up({anchorId:e,behavior:n,anchorRegistry:w,prepareAnchor:i==null?void 0:()=>T.current?.scrollToIndex(i),isCurrent:()=>E.current===r})},[w,y]),te=(0,G.useCallback)((e,t)=>{D(e,s.resolveMessageIndex(e),t)},[s,D]);return c.length===0?(0,W.jsx)(`div`,{"data-testid":`session-detail`,className:`mx-auto max-w-4xl rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:g(`This session has no displayable messages.`)}):(0,W.jsxs)(`div`,{"data-testid":`session-detail`,className:`mx-auto w-full max-w-[1440px] space-y-8 px-2 md:px-4`,children:[(0,W.jsx)(pp,{summary:typeof e.summary_files==`string`?e.summary_files:void 0}),(0,W.jsxs)(`div`,{className:`grid gap-6 min-[1025px]:grid-cols-[288px_minmax(0,1fr)] min-[1025px]:items-start`,children:[(0,W.jsx)(Hf,{toc:l,state:p,fileChangeSummary:u,onOpen:v}),(0,W.jsx)(Uf,{openPanel:_,toc:l,state:p,actions:m,visibleUnitCount:S,fileChangeSummary:u,baseDirectory:e.directory,onClose:()=>v(null),onJumpToAnchor:(e,t)=>{v(null),te(e,t)}}),(0,W.jsx)(Id,{toc:l,state:p,actions:m,visibleUnitCount:S,fileChangeSummary:u,baseDirectory:e.directory,onJumpToAnchor:te}),(0,W.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-8`,children:[(0,W.jsx)(zd,{toc:l,state:p,actions:m}),b.length>0?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(lp,{entries:x,anchorRegistry:w,onNavigate:(e,t)=>D(e.anchorId,e.messageIndex,t)}),(0,W.jsx)(ee,{id:`MessageList`,detail:{messages:b.length,virtualized:b.length>80},children:(0,W.jsx)(Ff,{messages:b,sessionAgentKey:a,agent:o,baseDirectory:e.directory,highlightQuery:n,childSessionById:C,apiRef:T,anchorRegistry:w},f)})]}):(0,W.jsx)(`div`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] p-6 text-sm text-[var(--console-muted)]`,children:g(`No messages match the current filters.`)}),(0,W.jsx)(Bd,{hiddenCount:Ad(l,p),hiddenTools:kd(l,p),onShowAll:m.resetAll})]})]}),(0,W.jsx)(Bf,{session:e,toc:l})]})}function pp({summary:e,defaultExpanded:t=!1}){h();let n=typeof e==`string`?e.trim():``,[r,i]=(0,G.useState)(t);return n?(0,W.jsxs)(`section`,{className:`rounded-lg border border-[var(--console-border)] bg-[var(--console-surface)] shadow-[var(--shadow-raised)]`,children:[(0,W.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-3 px-4 py-3 text-left`,onClick:()=>i(e=>!e),children:[(0,W.jsxs)(`span`,{className:`console-mono inline-flex items-center gap-2 text-xs font-semibold uppercase tracking-[0.16em] text-[var(--console-text)]`,children:[(0,W.jsx)(Ae,{className:`size-3.5 text-[var(--console-accent)]`}),` `,g(`Session Summary`)]}),r?(0,W.jsx)(fe,{className:`size-3.5 text-[var(--console-muted)]`}):(0,W.jsx)(ve,{className:`size-3.5 text-[var(--console-muted)]`})]}),r?(0,W.jsx)(`div`,{className:`border-t border-[var(--console-border)] px-4 py-4`,children:(0,W.jsx)(`div`,{className:`console-markdown text-sm leading-relaxed text-[var(--console-text)]`,children:(0,W.jsx)(Ms,{text:n})})}):null]}):null}export{fp as SessionDetail,gt as a,Ne as c,ht as i,mn as n,ft as o,_t as r,We as s,Hd as t};