@swestash/agent-lens 0.5.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-lens.js +94 -43
- package/dist/agent-lens.js.map +1 -1
- package/package.json +1 -1
- package/web/assets/{CopyButton-WFGbfzdo.js → CopyButton-CAUFwuiX.js} +1 -1
- package/web/assets/{Dashboard-B0wpOYPt.js → Dashboard-5CwsbaWY.js} +1 -1
- package/web/assets/SecurityView-DCWVNFf5.js +1 -0
- package/web/assets/SessionView-BJywkNAY.js +12 -0
- package/web/assets/{SkillView-COo5sndg.js → SkillView-BDENXN1E.js} +1 -1
- package/web/assets/{SkillsView-C6f11mVw.js → SkillsView-C4SyADuV.js} +1 -1
- package/web/assets/{WorkflowView-B8jF6aE7.js → WorkflowView-BQCMn0Uf.js} +1 -1
- package/web/assets/index-3w3Rb7sW.css +1 -0
- package/web/assets/{index-CnYz-f0y.js → index-BR_zJBAm.js} +1 -1
- package/web/assets/{index-DTfBIYUK.js → index-dvmn2NT_.js} +2 -2
- package/web/assets/{severity-DoLHU1bt.js → severity-4pf1WhNq.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/SecurityView-D9MKBBkp.js +0 -1
- package/web/assets/SessionView-BkOEhK9L.js +0 -12
- package/web/assets/index-DfoRqKEF.css +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Zt,j as hn}from"./index-DTfBIYUK.js";function pi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,di={};function ct(e,t){return(di.jsx?gi:mi).test(e)}const yi=/[ \t\n\f\r]/g;function ki(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(yi,"")===""}class Ye{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ye.prototype.normal={};Ye.prototype.property={};Ye.prototype.space=void 0;function er(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ye(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let xi=0;const L=Ae(),Y=Ae(),Dn=Ae(),E=Ae(),$=Ae(),Ee=Ae(),te=Ae();function Ae(){return 2**++xi}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ee,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),ht(this,"space",i),typeof r=="number")for(;++o<pn.length;){const l=pn[o];ht(this,pn[o],(r&Ln[l])===Ln[l])}}}Hn.prototype.defined=!0;function ht(e,t,n){n&&(e[t]=n)}function Fe(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zn(r)]=r,n[zn(o.attribute)]=r}return new Ye(t,n,e.space)}const nr=Fe({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:$,ariaCurrent:null,ariaDescribedBy:$,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:$,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:$,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$,ariaLevel:E,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:$,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:$,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:Y,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tr(e,t){return t in e?e[t]:t}function rr(e,t){return tr(e,t.toLowerCase())}const bi=Fe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ee,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:$,autoFocus:L,autoPlay:L,blocking:$,capture:null,charSet:null,checked:L,cite:null,className:$,closedBy:null,colorSpace:null,cols:E,colSpan:E,command:null,commandFor:null,content:null,contentEditable:Y,controls:L,controlsList:$,coords:E|Ee,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Dn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:$,height:E,hidden:Dn,high:E,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:$,itemRef:$,itemScope:L,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,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:L,optimum:E,pattern:null,ping:$,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:$,required:L,reversed:L,rows:E,rowSpan:E,sandbox:$,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:Y,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:Ee,part:$,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:rr}),wi=Fe({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:te,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:$,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:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,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:Ee,g2:Ee,glyphName:Ee,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,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:E,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:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,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:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tr}),ir=Fe({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()}}),lr=Fe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rr}),or=Fe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Si={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"},Ci=/[A-Z]/g,pt=/-[a-z]/g,Ei=/^data[-\w.:]+$/i;function Ii(e,t){const n=zn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ei.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(pt,Ti);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!pt.test(o)){let l=o.replace(Ci,Ai);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ai(e){return"-"+e.toLowerCase()}function Ti(e){return e.charAt(1).toUpperCase()}const Pi=er([nr,bi,ir,lr,or],"html"),Un=er([nr,wi,ir,lr,or],"svg");function vi(e){return e.join(" ").trim()}var ze={},mn,mt;function zi(){if(mt)return mn;mt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
1
|
+
import{g as Zt,j as hn}from"./index-dvmn2NT_.js";function pi(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const mi=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,gi=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,di={};function ct(e,t){return(di.jsx?gi:mi).test(e)}const yi=/[ \t\n\f\r]/g;function ki(e){return typeof e=="object"?e.type==="text"?ft(e.value):!1:ft(e)}function ft(e){return e.replace(yi,"")===""}class Ye{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ye.prototype.normal={};Ye.prototype.property={};Ye.prototype.space=void 0;function er(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Ye(n,r,t)}function zn(e){return e.toLowerCase()}class ee{constructor(t,n){this.attribute=n,this.property=t}}ee.prototype.attribute="";ee.prototype.booleanish=!1;ee.prototype.boolean=!1;ee.prototype.commaOrSpaceSeparated=!1;ee.prototype.commaSeparated=!1;ee.prototype.defined=!1;ee.prototype.mustUseProperty=!1;ee.prototype.number=!1;ee.prototype.overloadedBoolean=!1;ee.prototype.property="";ee.prototype.spaceSeparated=!1;ee.prototype.space=void 0;let xi=0;const L=Ae(),Y=Ae(),Dn=Ae(),E=Ae(),$=Ae(),Ee=Ae(),te=Ae();function Ae(){return 2**++xi}const Ln=Object.freeze(Object.defineProperty({__proto__:null,boolean:L,booleanish:Y,commaOrSpaceSeparated:te,commaSeparated:Ee,number:E,overloadedBoolean:Dn,spaceSeparated:$},Symbol.toStringTag,{value:"Module"})),pn=Object.keys(Ln);class Hn extends ee{constructor(t,n,r,i){let o=-1;if(super(t,n),ht(this,"space",i),typeof r=="number")for(;++o<pn.length;){const l=pn[o];ht(this,pn[o],(r&Ln[l])===Ln[l])}}}Hn.prototype.defined=!0;function ht(e,t,n){n&&(e[t]=n)}function Fe(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Hn(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[zn(r)]=r,n[zn(o.attribute)]=r}return new Ye(t,n,e.space)}const nr=Fe({properties:{ariaActiveDescendant:null,ariaAtomic:Y,ariaAutoComplete:null,ariaBusy:Y,ariaChecked:Y,ariaColCount:E,ariaColIndex:E,ariaColSpan:E,ariaControls:$,ariaCurrent:null,ariaDescribedBy:$,ariaDetails:null,ariaDisabled:Y,ariaDropEffect:$,ariaErrorMessage:null,ariaExpanded:Y,ariaFlowTo:$,ariaGrabbed:Y,ariaHasPopup:null,ariaHidden:Y,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:$,ariaLevel:E,ariaLive:null,ariaModal:Y,ariaMultiLine:Y,ariaMultiSelectable:Y,ariaOrientation:null,ariaOwns:$,ariaPlaceholder:null,ariaPosInSet:E,ariaPressed:Y,ariaReadOnly:Y,ariaRelevant:null,ariaRequired:Y,ariaRoleDescription:$,ariaRowCount:E,ariaRowIndex:E,ariaRowSpan:E,ariaSelected:Y,ariaSetSize:E,ariaSort:null,ariaValueMax:E,ariaValueMin:E,ariaValueNow:E,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tr(e,t){return t in e?e[t]:t}function rr(e,t){return tr(e,t.toLowerCase())}const bi=Fe({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ee,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:L,allowPaymentRequest:L,allowUserMedia:L,alpha:L,alt:null,as:null,async:L,autoCapitalize:null,autoComplete:$,autoFocus:L,autoPlay:L,blocking:$,capture:null,charSet:null,checked:L,cite:null,className:$,closedBy:null,colorSpace:null,cols:E,colSpan:E,command:null,commandFor:null,content:null,contentEditable:Y,controls:L,controlsList:$,coords:E|Ee,crossOrigin:null,data:null,dateTime:null,decoding:null,default:L,defer:L,dir:null,dirName:null,disabled:L,download:Dn,draggable:Y,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:L,formTarget:null,headers:$,height:E,hidden:Dn,high:E,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:null,inert:L,inputMode:null,integrity:null,is:null,isMap:L,itemId:null,itemProp:$,itemRef:$,itemScope:L,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:L,low:E,manifest:null,max:null,maxLength:E,media:null,method:null,min:null,minLength:E,multiple:L,muted:L,name:null,nonce:null,noModule:L,noValidate:L,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:L,optimum:E,pattern:null,ping:$,placeholder:null,playsInline:L,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:L,referrerPolicy:null,rel:$,required:L,reversed:L,rows:E,rowSpan:E,sandbox:$,scope:null,scoped:L,seamless:L,selected:L,shadowRootClonable:L,shadowRootCustomElementRegistry:L,shadowRootDelegatesFocus:L,shadowRootMode:null,shadowRootSerializable:L,shape:null,size:E,sizes:null,slot:null,span:E,spellCheck:Y,src:null,srcDoc:null,srcLang:null,srcSet:null,start:E,step:null,style:null,tabIndex:E,target:null,title:null,translate:null,type:null,typeMustMatch:L,useMap:null,value:Y,width:E,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:E,borderColor:null,bottomMargin:E,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:L,declare:L,event:null,face:null,frame:null,frameBorder:null,hSpace:E,leftMargin:E,link:null,longDesc:null,lowSrc:null,marginHeight:E,marginWidth:E,noResize:L,noHref:L,noShade:L,noWrap:L,object:null,profile:null,prompt:null,rev:null,rightMargin:E,rules:null,scheme:null,scrolling:Y,standby:null,summary:null,text:null,topMargin:E,valueType:null,version:null,vAlign:null,vLink:null,vSpace:E,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:L,disablePictureInPicture:L,disableRemotePlayback:L,exportParts:Ee,part:$,prefix:null,property:null,results:E,security:null,unselectable:null},space:"html",transform:rr}),wi=Fe({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:te,accentHeight:E,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:E,amplitude:E,arabicForm:null,ascent:E,attributeName:null,attributeType:null,azimuth:E,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:E,by:null,calcMode:null,capHeight:E,className:$,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:E,diffuseConstant:E,direction:null,display:null,dur:null,divisor:E,dominantBaseline:null,download:L,dx:null,dy:null,edgeMode:null,editable:null,elevation:E,enableBackground:null,end:null,event:null,exponent:E,externalResourcesRequired:null,fill:null,fillOpacity:E,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:Ee,g2:Ee,glyphName:Ee,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:E,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:E,horizOriginX:E,horizOriginY:E,id:null,ideographic:E,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:E,k:E,k1:E,k2:E,k3:E,k4:E,kernelMatrix:te,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:E,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:E,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:E,overlineThickness:E,paintOrder:null,panose1:null,path:null,pathLength:E,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:$,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:E,pointsAtY:E,pointsAtZ:E,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:te,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:te,rev:te,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:te,requiredFeatures:te,requiredFonts:te,requiredFormats:te,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:E,specularExponent:E,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:E,strikethroughThickness:E,string:null,stroke:null,strokeDashArray:te,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:E,strokeOpacity:E,strokeWidth:null,style:null,surfaceScale:E,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:te,tabIndex:E,tableValues:null,target:null,targetX:E,targetY:E,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:te,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:E,underlineThickness:E,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:E,values:null,vAlphabetic:E,vMathematical:E,vectorEffect:null,vHanging:E,vIdeographic:E,version:null,vertAdvY:E,vertOriginX:E,vertOriginY:E,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:E,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tr}),ir=Fe({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()}}),lr=Fe({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:rr}),or=Fe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Si={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"},Ci=/[A-Z]/g,pt=/-[a-z]/g,Ei=/^data[-\w.:]+$/i;function Ii(e,t){const n=zn(t);let r=t,i=ee;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Ei.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(pt,Ti);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!pt.test(o)){let l=o.replace(Ci,Ai);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Hn}return new i(r,t)}function Ai(e){return"-"+e.toLowerCase()}function Ti(e){return e.charAt(1).toUpperCase()}const Pi=er([nr,bi,ir,lr,or],"html"),Un=er([nr,wi,ir,lr,or],"svg");function vi(e){return e.join(" ").trim()}var ze={},mn,mt;function zi(){if(mt)return mn;mt=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,u=`
|
|
2
2
|
`,s="/",f="*",c="",p="comment",h="declaration";function d(S,y){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];y=y||{};var I=1,C=1;function R(D){var T=D.match(t);T&&(I+=T.length);var q=D.lastIndexOf(u);C=~q?D.length-q:C+D.length}function _(){var D={line:I,column:C};return function(T){return T.position=new b(D),j(),T}}function b(D){this.start=D,this.end={line:I,column:C},this.source=y.source}b.prototype.content=S;function M(D){var T=new Error(y.source+":"+I+":"+C+": "+D);if(T.reason=D,T.filename=y.source,T.line=I,T.column=C,T.source=S,!y.silent)throw T}function H(D){var T=D.exec(S);if(T){var q=T[0];return R(q),S=S.slice(q.length),T}}function j(){H(n)}function k(D){var T;for(D=D||[];T=P();)T!==!1&&D.push(T);return D}function P(){var D=_();if(!(s!=S.charAt(0)||f!=S.charAt(1))){for(var T=2;c!=S.charAt(T)&&(f!=S.charAt(T)||s!=S.charAt(T+1));)++T;if(T+=2,c===S.charAt(T-1))return M("End of comment missing");var q=S.slice(2,T-2);return C+=2,R(q),S=S.slice(T),C+=2,D({type:p,comment:q})}}function v(){var D=_(),T=H(r);if(T){if(P(),!H(i))return M("property missing ':'");var q=H(o),X=D({type:h,property:w(T[0].replace(e,c)),value:q?w(q[0].replace(e,c)):c});return H(l),X}}function U(){var D=[];k(D);for(var T;T=v();)T!==!1&&(D.push(T),k(D));return D}return j(),U()}function w(S){return S?S.replace(a,c):c}return mn=d,mn}var gt;function Di(){if(gt)return ze;gt=1;var e=ze&&ze.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ze,"__esModule",{value:!0}),ze.default=n;const t=e(zi());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(u=>{if(u.type!=="declaration")return;const{property:s,value:f}=u;a?i(s,f,u):f&&(o=o||{},o[s]=f)}),o}return ze}var Ne={},dt;function Li(){if(dt)return Ne;dt=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(s){return!s||n.test(s)||e.test(s)},l=function(s,f){return f.toUpperCase()},a=function(s,f){return"".concat(f,"-")},u=function(s,f){return f===void 0&&(f={}),o(s)?s:(s=s.toLowerCase(),f.reactCompat?s=s.replace(i,a):s=s.replace(r,a),s.replace(t,l))};return Ne.camelCase=u,Ne}var Be,yt;function Fi(){if(yt)return Be;yt=1;var e=Be&&Be.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(Di()),n=Li();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,u){a&&u&&(l[(0,n.camelCase)(a,o)]=u)}),l}return r.default=r,Be=r,Be}var Ri=Fi();const _i=Zt(Ri),ar=ur("end"),qn=ur("start");function ur(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Oi(e){const t=qn(e),n=ar(e);if(t&&n)return{start:t,end:n}}function Ue(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?Fn(e):""}function Fn(e){return xt(e&&e.line)+":"+xt(e&&e.column)}function kt(e){return Fn(e&&e.start)+"-"+Fn(e&&e.end)}function xt(e){return e&&typeof e=="number"?e:1}class K extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?o.ruleId=r:(o.source=r.slice(0,u),o.ruleId=r.slice(u+1))}if(!o.place&&o.ancestors&&o.ancestors){const u=o.ancestors[o.ancestors.length-1];u&&(o.place=u.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ue(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Vn={}.hasOwnProperty,Mi=new Map,Ni=/[A-Z]/g,Bi=new Set(["table","tbody","thead","tfoot","tr"]),ji=new Set(["td","th"]),sr="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Hi(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Qi(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Xi(n,t.jsx,t.jsxs)}const 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"?Un:Pi,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=cr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function cr(e,t,n){if(t.type==="element")return Ui(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return qi(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return $i(e,t,n);if(t.type==="mdxjsEsm")return Vi(e,t);if(t.type==="root")return Wi(e,t,n);if(t.type==="text")return Yi(e,t)}function Ui(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=hr(e,t.tagName,!1),l=Gi(e,t);let a=Wn(e,t);return Bi.has(t.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!ki(u):!0})),fr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function qi(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}$e(e,t.position)}function Vi(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);$e(e,t.position)}function $i(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Un,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:hr(e,t.name,!0),l=Ki(e,t),a=Wn(e,t);return fr(e,l,o,t),$n(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Wi(e,t,n){const r={};return $n(r,Wn(e,t)),e.create(t,e.Fragment,r,n)}function Yi(e,t){return t.value}function fr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function $n(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Xi(e,t,n){return r;function r(i,o,l,a){const s=Array.isArray(l.children)?n:t;return a?s(o,l,a):s(o,l)}}function Qi(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),u=qn(r);return t(i,o,l,a,{columnNumber:u?u.column-1:void 0,fileName:e,lineNumber:u?u.line:void 0},void 0)}}function Gi(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Vn.call(t.properties,i)){const o=Ji(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&ji.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Ki(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else $e(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else $e(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Wn(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Mi;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const u=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(u){const s=i.get(u)||0;l=u+"-"+s,i.set(u,s+1)}}const a=cr(e,o,l);a!==void 0&&n.push(a)}return n}function Ji(e,t,n){const r=Ii(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?pi(n):vi(n)),r.property==="style"){let i=typeof n=="object"?n:Zi(e,String(n));return e.stylePropertyNameCase==="css"&&(i=el(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Si[r.property]||r.property:r.attribute,n]}}function Zi(e,t){try{return _i(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new K("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=sr+"#cannot-parse-style-attribute",i}}function hr(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=ct(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=ct(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Vn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);$e(e)}function $e(e,t){const n=new K("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=sr+"#cannot-handle-mdx-estrees-without-createevaluater",n}function el(e){const t={};let n;for(n in e)Vn.call(e,n)&&(t[nl(n)]=e[n]);return t}function nl(e){let t=e.replace(Ni,tl);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function tl(e){return"-"+e.toLowerCase()}const gn={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"]},rl={};function Yn(e,t){const n=rl,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return pr(e,r,i)}function pr(e,t,n){if(il(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 bt(e.children,t,n)}return Array.isArray(e)?bt(e,t,n):""}function bt(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=pr(e[i],t,n);return r.join("")}function il(e){return!!(e&&typeof e=="object")}const wt=document.createElement("i");function Xn(e){const t="&"+e+";";wt.innerHTML=t;const n=wt.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function re(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function ie(e,t){return e.length>0?(re(e,e.length,0,t),e):t}const St={}.hasOwnProperty;function mr(e){const t={};let n=-1;for(;++n<e.length;)ll(t,e[n]);return t}function ll(e,t){let n;for(n in t){const i=(St.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){St.call(i,l)||(i[l]=[]);const a=o[l];ol(i[l],Array.isArray(a)?a:a?[a]:[])}}}function ol(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);re(e,0,0,r)}function gr(e,t){const 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 se(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const J=xe(/[A-Za-z]/),G=xe(/[\dA-Za-z]/),al=xe(/[#-'*+\--9=?A-Z^-~]/);function tn(e){return e!==null&&(e<32||e===127)}const Rn=xe(/\d/),ul=xe(/[\dA-Fa-f]/),sl=xe(/[!-/:-@[-`{-~]/);function z(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function O(e){return e===-2||e===-1||e===32}const an=xe(new RegExp("\\p{P}|\\p{S}","u")),Ie=xe(/\s/);function xe(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Re(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&G(e.charCodeAt(n+1))&&G(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function B(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(u){return O(u)?(e.enter(n),a(u)):t(u)}function a(u){return O(u)&&o++<i?(e.consume(u),a):(e.exit(n),t(u))}}const cl={tokenize:fl};function fl(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),B(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const u=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=u),n=u,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return z(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const hl={tokenize:pl},Ct={tokenize:ml};function pl(e){const t=this,n=[];let r=0,i,o,l;return a;function a(C){if(r<n.length){const R=n[r];return t.containerState=R[1],e.attempt(R[0].continuation,u,s)(C)}return s(C)}function u(C){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&I();const R=t.events.length;let _=R,b;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){b=t.events[_][1].end;break}y(r);let M=R;for(;M<t.events.length;)t.events[M][1].end={...b},M++;return re(t.events,_+1,0,t.events.slice(R)),t.events.length=M,s(C)}return a(C)}function s(C){if(r===n.length){if(!i)return p(C);if(i.currentConstruct&&i.currentConstruct.concrete)return d(C);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Ct,f,c)(C)}function f(C){return i&&I(),y(r),p(C)}function c(C){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,d(C)}function p(C){return t.containerState={},e.attempt(Ct,h,d)(C)}function h(C){return r++,n.push([t.currentConstruct,t.containerState]),p(C)}function d(C){if(C===null){i&&I(),y(0),e.consume(C);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),w(C)}function w(C){if(C===null){S(e.exit("chunkFlow"),!0),y(0),e.consume(C);return}return z(C)?(e.consume(C),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(C),w)}function S(C,R){const _=t.sliceStream(C);if(R&&_.push(null),C.previous=o,o&&(o.next=C),o=C,i.defineSkip(C.start),i.write(_),t.parser.lazy[C.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const M=t.events.length;let H=M,j,k;for(;H--;)if(t.events[H][0]==="exit"&&t.events[H][1].type==="chunkFlow"){if(j){k=t.events[H][1].end;break}j=!0}for(y(r),b=M;b<t.events.length;)t.events[b][1].end={...k},b++;re(t.events,H+1,0,t.events.slice(M)),t.events.length=b}}function y(C){let R=n.length;for(;R-- >C;){const _=n[R];t.containerState=_[1],_[0].exit.call(t,e)}n.length=C}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function ml(e,t,n){return B(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Le(e){if(e===null||W(e)||Ie(e))return 1;if(an(e))return 2}function un(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const _n={name:"attention",resolveAll:gl,tokenize:dl};function gl(e,t){let n=-1,r,i,o,l,a,u,s,f;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;u=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};Et(c,-u),Et(p,u),l={type:u>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:u>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:u>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:u>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},s=[],e[r][1].end.offset-e[r][1].start.offset&&(s=ie(s,[["enter",e[r][1],t],["exit",e[r][1],t]])),s=ie(s,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),s=ie(s,un(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),s=ie(s,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,s=ie(s,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,re(e,r-1,n-r+3,s),n=r+s.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function dl(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Le(r);let o;return l;function l(u){return o=u,e.enter("attentionSequence"),a(u)}function a(u){if(u===o)return e.consume(u),a;const s=e.exit("attentionSequence"),f=Le(u),c=!f||f===2&&i||n.includes(u),p=!i||i===2&&f||n.includes(r);return s._open=!!(o===42?c:c&&(i||!p)),s._close=!!(o===42?p:p&&(f||!c)),t(u)}}function Et(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const yl={name:"autolink",tokenize:kl};function kl(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return J(h)?(e.consume(h),l):h===64?n(h):s(h)}function l(h){return h===43||h===45||h===46||G(h)?(r=1,a(h)):s(h)}function a(h){return h===58?(e.consume(h),r=0,u):(h===43||h===45||h===46||G(h))&&r++<32?(e.consume(h),a):(r=0,s(h))}function u(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||tn(h)?n(h):(e.consume(h),u)}function s(h){return h===64?(e.consume(h),f):al(h)?(e.consume(h),s):n(h)}function f(h){return G(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||G(h))&&r++<63){const d=h===45?p:c;return e.consume(h),d}return n(h)}}const Xe={partial:!0,tokenize:xl};function xl(e,t,n){return r;function r(o){return O(o)?B(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||z(o)?t(o):n(o)}}const dr={continuation:{tokenize:wl},exit:Sl,name:"blockQuote",tokenize:bl};function bl(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return O(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function wl(e,t,n){const r=this;return i;function i(l){return O(l)?B(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(dr,t,n)(l)}}function Sl(e){e.exit("blockQuote")}const yr={name:"characterEscape",tokenize:Cl};function Cl(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return sl(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const kr={name:"characterReference",tokenize:El};function El(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),u}function u(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,l=G,f(c))}function s(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=ul,f):(e.enter("characterReferenceValue"),o=7,l=Rn,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===G&&!Xn(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const It={partial:!0,tokenize:Al},At={concrete:!0,name:"codeFenced",tokenize:Il};function Il(e,t,n){const r=this,i={partial:!0,tokenize:_};let o=0,l=0,a;return u;function u(b){return s(b)}function s(b){const M=r.events[r.events.length-1];return o=M&&M[1].type==="linePrefix"?M[2].sliceSerialize(M[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?n(b):(e.exit("codeFencedFenceSequence"),O(b)?B(e,c,"whitespace")(b):c(b))}function c(b){return b===null||z(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(It,w,R)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):O(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),B(e,h,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),p)}function h(b){return b===null||z(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),d(b))}function d(b){return b===null||z(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),d)}function w(b){return e.attempt(i,R,S)(b)}function S(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y}function y(b){return o>0&&O(b)?B(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||z(b)?e.check(It,w,R)(b):(e.enter("codeFlowValue"),C(b))}function C(b){return b===null||z(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),C)}function R(b){return e.exit("codeFenced"),t(b)}function _(b,M,H){let j=0;return k;function k(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),P}function P(T){return b.enter("codeFencedFence"),O(T)?B(b,v,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):v(T)}function v(T){return T===a?(b.enter("codeFencedFenceSequence"),U(T)):H(T)}function U(T){return T===a?(j++,b.consume(T),U):j>=l?(b.exit("codeFencedFenceSequence"),O(T)?B(b,D,"whitespace")(T):D(T)):H(T)}function D(T){return T===null||z(T)?(b.exit("codeFencedFence"),M(T)):H(T)}}}function Al(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const dn={name:"codeIndented",tokenize:Pl},Tl={partial:!0,tokenize:vl};function Pl(e,t,n){const r=this;return i;function i(s){return e.enter("codeIndented"),B(e,o,"linePrefix",5)(s)}function o(s){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(s):n(s)}function l(s){return s===null?u(s):z(s)?e.attempt(Tl,l,u)(s):(e.enter("codeFlowValue"),a(s))}function a(s){return s===null||z(s)?(e.exit("codeFlowValue"),l(s)):(e.consume(s),a)}function u(s){return e.exit("codeIndented"),t(s)}}function vl(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):B(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):z(l)?i(l):n(l)}}const zl={name:"codeText",previous:Ll,resolve:Dl,tokenize:Fl};function Dl(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 Ll(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Fl(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),u(c))}function u(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),u):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):z(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):(e.enter("codeTextData"),s(c))}function s(c){return c===null||c===32||c===96||z(c)?(e.exit("codeTextData"),u(c)):(e.consume(c),s)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",s(c))}}class Rl{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&je(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),je(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),je(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);je(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);je(this.left,n.reverse())}}}function je(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 xr(e){const t={};let n=-1,r,i,o,l,a,u,s;const f=new Rl(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(u=r[1]._tokenizer.events,o=0,o<u.length&&u[o][1].type==="lineEndingBlank"&&(o+=2),o<u.length&&u[o][1].type==="content"))for(;++o<u.length&&u[o][1].type!=="content";)u[o][1].type==="chunkText"&&(u[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,_l(f,n)),n=t[n],s=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return re(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!s}function _l(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,u=[],s={};let f,c,p=-1,h=n,d=0,w=0;const S=[w];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(w=p+1,S.push(w),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):S.pop(),p=S.length;p--;){const y=a.slice(S[p],S[p+1]),I=o.pop();u.push([I,I+y.length-1]),e.splice(I,2,y)}for(u.reverse(),p=-1;++p<u.length;)s[d+u[p][0]]=d+u[p][1],d+=u[p][1]-u[p][0]-1;return s}const Ol={resolve:Nl,tokenize:Bl},Ml={partial:!0,tokenize:jl};function Nl(e){return xr(e),e}function Bl(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):z(a)?e.check(Ml,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function jl(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),B(e,o,"linePrefix")}function o(l){if(l===null||z(l))return n(l);const 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(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function br(e,t,n,r,i,o,l,a,u){const s=u||Number.POSITIVE_INFINITY;let f=0;return c;function c(y){return y===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(y),e.exit(o),p):y===null||y===32||y===41||tn(y)?n(y):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),w(y))}function p(y){return y===62?(e.enter(o),e.consume(y),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===62?(e.exit("chunkString"),e.exit(a),p(y)):y===null||y===60||z(y)?n(y):(e.consume(y),y===92?d:h)}function d(y){return y===60||y===62||y===92?(e.consume(y),h):h(y)}function w(y){return!f&&(y===null||y===41||W(y))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(y)):f<s&&y===40?(e.consume(y),f++,w):y===41?(e.consume(y),f--,w):y===null||y===32||y===40||tn(y)?n(y):(e.consume(y),y===92?S:w)}function S(y){return y===40||y===41||y===92?(e.consume(y),w):w(y)}}function wr(e,t,n,r,i,o){const l=this;let a=0,u;return s;function s(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!u||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):z(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||z(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),u||(u=!O(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Sr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,u):n(p)}function u(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),s(p))}function s(p){return p===l?(e.exit(o),u(l)):p===null?n(p):z(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),B(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||z(p)?(e.exit("chunkString"),s(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function qe(e,t){let n;return r;function r(i){return z(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):O(i)?B(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Hl={name:"definition",tokenize:ql},Ul={partial:!0,tokenize:Vl};function ql(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return wr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),u):n(h)}function u(h){return W(h)?qe(e,s)(h):s(h)}function s(h){return br(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Ul,c,c)(h)}function c(h){return O(h)?B(e,p,"whitespace")(h):p(h)}function p(h){return h===null||z(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Vl(e,t,n){return r;function r(a){return W(a)?qe(e,i)(a):n(a)}function i(a){return Sr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return O(a)?B(e,l,"whitespace")(a):l(a)}function l(a){return a===null||z(a)?t(a):n(a)}}const $l={name:"hardBreakEscape",tokenize:Wl};function Wl(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return z(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Yl={name:"headingAtx",resolve:Xl,tokenize:Ql};function Xl(e,t){let n=e.length-2,r=3,i,o;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},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},re(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function Ql(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||W(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),u(f)):f===null||z(f)?(e.exit("atxHeading"),t(f)):O(f)?B(e,a,"whitespace")(f):(e.enter("atxHeadingText"),s(f))}function u(f){return f===35?(e.consume(f),u):(e.exit("atxHeadingSequence"),a(f))}function s(f){return f===null||f===35||W(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),s)}}const Gl=["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"],Tt=["pre","script","style","textarea"],Kl={concrete:!0,name:"htmlFlow",resolveTo:eo,tokenize:no},Jl={partial:!0,tokenize:ro},Zl={partial:!0,tokenize:to};function eo(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 no(e,t,n){const r=this;let i,o,l,a,u;return s;function s(g){return f(g)}function f(g){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(g),c}function c(g){return g===33?(e.consume(g),p):g===47?(e.consume(g),o=!0,w):g===63?(e.consume(g),i=3,r.interrupt?t:m):J(g)?(e.consume(g),l=String.fromCharCode(g),S):n(g)}function p(g){return g===45?(e.consume(g),i=2,h):g===91?(e.consume(g),i=5,a=0,d):J(g)?(e.consume(g),i=4,r.interrupt?t:m):n(g)}function h(g){return g===45?(e.consume(g),r.interrupt?t:m):n(g)}function d(g){const ae="CDATA[";return g===ae.charCodeAt(a++)?(e.consume(g),a===ae.length?r.interrupt?t:v:d):n(g)}function w(g){return J(g)?(e.consume(g),l=String.fromCharCode(g),S):n(g)}function S(g){if(g===null||g===47||g===62||W(g)){const ae=g===47,be=l.toLowerCase();return!ae&&!o&&Tt.includes(be)?(i=1,r.interrupt?t(g):v(g)):Gl.includes(l.toLowerCase())?(i=6,ae?(e.consume(g),y):r.interrupt?t(g):v(g)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(g):o?I(g):C(g))}return g===45||G(g)?(e.consume(g),l+=String.fromCharCode(g),S):n(g)}function y(g){return g===62?(e.consume(g),r.interrupt?t:v):n(g)}function I(g){return O(g)?(e.consume(g),I):k(g)}function C(g){return g===47?(e.consume(g),k):g===58||g===95||J(g)?(e.consume(g),R):O(g)?(e.consume(g),C):k(g)}function R(g){return g===45||g===46||g===58||g===95||G(g)?(e.consume(g),R):_(g)}function _(g){return g===61?(e.consume(g),b):O(g)?(e.consume(g),_):C(g)}function b(g){return g===null||g===60||g===61||g===62||g===96?n(g):g===34||g===39?(e.consume(g),u=g,M):O(g)?(e.consume(g),b):H(g)}function M(g){return g===u?(e.consume(g),u=null,j):g===null||z(g)?n(g):(e.consume(g),M)}function H(g){return g===null||g===34||g===39||g===47||g===60||g===61||g===62||g===96||W(g)?_(g):(e.consume(g),H)}function j(g){return g===47||g===62||O(g)?C(g):n(g)}function k(g){return g===62?(e.consume(g),P):n(g)}function P(g){return g===null||z(g)?v(g):O(g)?(e.consume(g),P):n(g)}function v(g){return g===45&&i===2?(e.consume(g),q):g===60&&i===1?(e.consume(g),X):g===62&&i===4?(e.consume(g),oe):g===63&&i===3?(e.consume(g),m):g===93&&i===5?(e.consume(g),he):z(g)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(Jl,pe,U)(g)):g===null||z(g)?(e.exit("htmlFlowData"),U(g)):(e.consume(g),v)}function U(g){return e.check(Zl,D,pe)(g)}function D(g){return e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),T}function T(g){return g===null||z(g)?U(g):(e.enter("htmlFlowData"),v(g))}function q(g){return g===45?(e.consume(g),m):v(g)}function X(g){return g===47?(e.consume(g),l="",le):v(g)}function le(g){if(g===62){const ae=l.toLowerCase();return Tt.includes(ae)?(e.consume(g),oe):v(g)}return J(g)&&l.length<8?(e.consume(g),l+=String.fromCharCode(g),le):v(g)}function he(g){return g===93?(e.consume(g),m):v(g)}function m(g){return g===62?(e.consume(g),oe):g===45&&i===2?(e.consume(g),m):v(g)}function oe(g){return g===null||z(g)?(e.exit("htmlFlowData"),pe(g)):(e.consume(g),oe)}function pe(g){return e.exit("htmlFlow"),t(g)}}function to(e,t,n){const r=this;return i;function i(l){return z(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ro(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Xe,t,n)}}const io={name:"htmlText",tokenize:lo};function lo(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),u}function u(m){return m===33?(e.consume(m),s):m===47?(e.consume(m),_):m===63?(e.consume(m),C):J(m)?(e.consume(m),H):n(m)}function s(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,d):J(m)?(e.consume(m),I):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):z(m)?(l=c,X(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?q(m):m===45?p(m):c(m)}function d(m){const oe="CDATA[";return m===oe.charCodeAt(o++)?(e.consume(m),o===oe.length?w:d):n(m)}function w(m){return m===null?n(m):m===93?(e.consume(m),S):z(m)?(l=w,X(m)):(e.consume(m),w)}function S(m){return m===93?(e.consume(m),y):w(m)}function y(m){return m===62?q(m):m===93?(e.consume(m),y):w(m)}function I(m){return m===null||m===62?q(m):z(m)?(l=I,X(m)):(e.consume(m),I)}function C(m){return m===null?n(m):m===63?(e.consume(m),R):z(m)?(l=C,X(m)):(e.consume(m),C)}function R(m){return m===62?q(m):C(m)}function _(m){return J(m)?(e.consume(m),b):n(m)}function b(m){return m===45||G(m)?(e.consume(m),b):M(m)}function M(m){return z(m)?(l=M,X(m)):O(m)?(e.consume(m),M):q(m)}function H(m){return m===45||G(m)?(e.consume(m),H):m===47||m===62||W(m)?j(m):n(m)}function j(m){return m===47?(e.consume(m),q):m===58||m===95||J(m)?(e.consume(m),k):z(m)?(l=j,X(m)):O(m)?(e.consume(m),j):q(m)}function k(m){return m===45||m===46||m===58||m===95||G(m)?(e.consume(m),k):P(m)}function P(m){return m===61?(e.consume(m),v):z(m)?(l=P,X(m)):O(m)?(e.consume(m),P):j(m)}function v(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,U):z(m)?(l=v,X(m)):O(m)?(e.consume(m),v):(e.consume(m),D)}function U(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):z(m)?(l=U,X(m)):(e.consume(m),U)}function D(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||W(m)?j(m):(e.consume(m),D)}function T(m){return m===47||m===62||W(m)?j(m):n(m)}function q(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function X(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),le}function le(m){return O(m)?B(e,he,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):he(m)}function he(m){return e.enter("htmlTextData"),l(m)}}const Qn={name:"labelEnd",resolveAll:so,resolveTo:co,tokenize:fo},oo={tokenize:ho},ao={tokenize:po},uo={tokenize:mo};function so(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&re(e,0,e.length,n),e}function co(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const u={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},s={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",u,t],["enter",s,t]],a=ie(a,e.slice(o+1,o+r+3)),a=ie(a,[["enter",f,t]]),a=ie(a,un(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=ie(a,[["exit",f,t],e[l-2],e[l-1],["exit",s,t]]),a=ie(a,e.slice(l+1)),a=ie(a,[["exit",u,t]]),re(e,o,e.length,a),e}function fo(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(se(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),u):n(p)}function u(p){return p===40?e.attempt(oo,f,l?f:c)(p):p===91?e.attempt(ao,f,l?s:c)(p):l?f(p):c(p)}function s(p){return e.attempt(uo,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function ho(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return W(c)?qe(e,o)(c):o(c)}function o(c){return c===41?f(c):br(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return W(c)?qe(e,u)(c):f(c)}function a(c){return n(c)}function u(c){return c===34||c===39||c===40?Sr(e,s,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function s(c){return W(c)?qe(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function po(e,t,n){const r=this;return i;function i(a){return wr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(se(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function mo(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const go={name:"labelStartImage",resolveAll:Qn.resolveAll,tokenize:yo};function yo(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const ko={name:"labelStartLink",resolveAll:Qn.resolveAll,tokenize:xo};function xo(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const yn={name:"lineEnding",tokenize:bo};function bo(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),B(e,t,"linePrefix")}}const nn={name:"thematicBreak",tokenize:wo};function wo(e,t,n){let r=0,i;return o;function o(s){return e.enter("thematicBreak"),l(s)}function l(s){return i=s,a(s)}function a(s){return s===i?(e.enter("thematicBreakSequence"),u(s)):r>=3&&(s===null||z(s))?(e.exit("thematicBreak"),t(s)):n(s)}function u(s){return s===i?(e.consume(s),r++,u):(e.exit("thematicBreakSequence"),O(s)?B(e,a,"whitespace")(s):a(s))}}const Z={continuation:{tokenize:Io},exit:To,name:"list",tokenize:Eo},So={partial:!0,tokenize:Po},Co={partial:!0,tokenize:Ao};function Eo(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const d=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(d==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Rn(h)){if(r.containerState.type||(r.containerState.type=d,e.enter(d,{_container:!0})),d==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(nn,n,s)(h):s(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),u(h)}return n(h)}function u(h){return Rn(h)&&++l<10?(e.consume(h),u):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),s(h)):n(h)}function s(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(Xe,r.interrupt?n:f,e.attempt(So,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return O(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Io(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Xe,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,B(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!O(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Co,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,B(e,e.attempt(Z,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function Ao(e,t,n){const r=this;return B(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function To(e){e.exit(this.containerState.type)}function Po(e,t,n){const r=this;return B(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!O(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Pt={name:"setextUnderline",resolveTo:vo,tokenize:zo};function vo(e,t){let n=e.length,r,i,o;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),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function zo(e,t,n){const r=this;let i;return o;function o(s){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=s,l(s)):n(s)}function l(s){return e.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(e.consume(s),a):(e.exit("setextHeadingLineSequence"),O(s)?B(e,u,"lineSuffix")(s):u(s))}function u(s){return s===null||z(s)?(e.exit("setextHeadingLine"),t(s)):n(s)}}const Do={tokenize:Lo};function Lo(e){const t=this,n=e.attempt(Xe,r,e.attempt(this.parser.constructs.flowInitial,i,B(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ol,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Fo={resolveAll:Er()},Ro=Cr("string"),_o=Cr("text");function Cr(e){return{resolveAll:Er(e==="text"?Oo:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return s(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),u}function u(f){return s(f)?(n.exit("data"),o(f)):(n.consume(f),u)}function s(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function Er(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Oo(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,u;for(;o--;){const s=i[o];if(typeof s=="string"){for(l=s.length;s.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(s===-2)u=!0,a++;else if(s!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const s={type:n===e.length||u||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...s.start},r.start.offset===r.end.offset?Object.assign(r,s):(e.splice(n,0,["enter",s,t],["exit",s,t]),n+=2)}n++}return e}const Mo={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:dr},No={91:Hl},Bo={[-2]:dn,[-1]:dn,32:dn},jo={35:Yl,42:nn,45:[Pt,nn],60:Kl,61:Pt,95:nn,96:At,126:At},Ho={38:kr,92:yr},Uo={[-5]:yn,[-4]:yn,[-3]:yn,33:go,38:kr,42:_n,60:[yl,io],91:ko,92:[$l,yr],93:Qn,95:_n,96:zl},qo={null:[_n,Fo]},Vo={null:[42,95]},$o={null:[]},Wo=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Vo,contentInitial:No,disable:$o,document:Mo,flow:jo,flowInitial:Bo,insideSpan:qo,string:Ho,text:Uo},Symbol.toStringTag,{value:"Module"}));function Yo(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const u={attempt:M(_),check:M(b),consume:I,enter:C,exit:R,interrupt:M(b,{interrupt:!0})},s={code:null,containerState:{},defineSkip:w,events:[],now:d,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(s,u);return t.resolveAll&&o.push(t),s;function c(P){return l=ie(l,P),S(),l[l.length-1]!==null?[]:(H(t,0),s.events=un(o,s.events,s),s.events)}function p(P,v){return Qo(h(P),v)}function h(P){return Xo(l,P)}function d(){const{_bufferIndex:P,_index:v,line:U,column:D,offset:T}=r;return{_bufferIndex:P,_index:v,line:U,column:D,offset:T}}function w(P){i[P.line]=P.column,k()}function S(){let P;for(;r._index<l.length;){const v=l[r._index];if(typeof v=="string")for(P=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===P&&r._bufferIndex<v.length;)y(v.charCodeAt(r._bufferIndex));else y(v)}}function y(P){f=f(P)}function I(P){z(P)?(r.line++,r.column=1,r.offset+=P===-3?2:1,k()):P!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),s.previous=P}function C(P,v){const U=v||{};return U.type=P,U.start=d(),s.events.push(["enter",U,s]),a.push(U),U}function R(P){const v=a.pop();return v.end=d(),s.events.push(["exit",v,s]),v}function _(P,v){H(P,v.from)}function b(P,v){v.restore()}function M(P,v){return U;function U(D,T,q){let X,le,he,m;return Array.isArray(D)?pe(D):"tokenize"in D?pe([D]):oe(D);function oe(Q){return _e;function _e(ye){const Te=ye!==null&&Q[ye],Pe=ye!==null&&Q.null,Ge=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Pe)?Pe:Pe?[Pe]:[]];return pe(Ge)(ye)}}function pe(Q){return X=Q,le=0,Q.length===0?q:g(Q[le])}function g(Q){return _e;function _e(ye){return m=j(),he=Q,Q.partial||(s.currentConstruct=Q),Q.name&&s.parser.constructs.disable.null.includes(Q.name)?be():Q.tokenize.call(v?Object.assign(Object.create(s),v):s,u,ae,be)(ye)}}function ae(Q){return P(he,m),T}function be(Q){return m.restore(),++le<X.length?g(X[le]):q}}}function H(P,v){P.resolveAll&&!o.includes(P)&&o.push(P),P.resolve&&re(s.events,v,s.events.length-v,P.resolve(s.events.slice(v),s)),P.resolveTo&&(s.events=P.resolveTo(s.events,s))}function j(){const P=d(),v=s.previous,U=s.currentConstruct,D=s.events.length,T=Array.from(a);return{from:D,restore:q};function q(){r=P,s.previous=v,s.currentConstruct=U,s.events.length=D,a=T,k()}}function k(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Xo(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function Qo(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
3
3
|
`;break}case-3:{l=`\r
|
|
4
4
|
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function Go(e){const r={constructs:mr([Wo,...(e||{}).extensions||[]]),content:i(cl),defined:[],document:i(hl),flow:i(Do),lazy:{},string:i(Ro),text:i(_o)};return r;function i(o){return l;function l(a){return Yo(r,o,a)}}}function Ko(e){for(;!xr(e););return e}const vt=/[\0\t\n\r]/g;function Jo(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const u=[];let s,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(vt.lastIndex=c,s=vt.exec(o),p=s&&s.index!==void 0?s.index:o.length,h=o.charCodeAt(p),!s){t=o.slice(c);break}if(h===10&&c===p&&r)u.push(-3),r=void 0;else switch(r&&(u.push(-5),r=void 0),c<p&&(u.push(o.slice(c,p)),e+=p-c),h){case 0:{u.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,u.push(-2);e++<f;)u.push(-1);break}case 10:{u.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&u.push(-5),t&&u.push(t),u.push(null)),u}}const Zo=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ea(e){return e.replace(Zo,na)}function na(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return gr(n.slice(o?2:1),o?16:10)}return Xn(n)||e}const Ir={}.hasOwnProperty;function ta(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ra(n)(Ko(Go(n).document().write(Jo()(e,t,!0))))}function ra(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ut),autolinkProtocol:j,autolinkEmail:j,atxHeading:o(lt),blockQuote:o(Pe),characterEscape:j,characterReference:j,codeFenced:o(Ge),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Ge,l),codeText:o(ii,l),codeTextData:j,data:j,codeFlowValue:j,definition:o(li),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(oi),hardBreakEscape:o(ot),hardBreakTrailing:o(ot),htmlFlow:o(at,l),htmlFlowData:j,htmlText:o(at,l),htmlTextData:j,image:o(ai),label:l,link:o(ut),listItem:o(ui),listItemValue:p,listOrdered:o(st,c),listUnordered:o(st),paragraph:o(si),reference:g,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(lt),strong:o(ci),thematicBreak:o(hi)},exit:{atxHeading:u(),atxHeadingSequence:_,autolink:u(),autolinkEmail:Te,autolinkProtocol:ye,blockQuote:u(),characterEscapeValue:k,characterReferenceMarkerHexadecimal:be,characterReferenceMarkerNumeric:be,characterReferenceValue:Q,characterReference:_e,codeFenced:u(S),codeFencedFence:w,codeFencedFenceInfo:h,codeFencedFenceMeta:d,codeFlowValue:k,codeIndented:u(y),codeText:u(T),codeTextData:k,data:k,definition:u(),definitionDestinationString:R,definitionLabelString:I,definitionTitleString:C,emphasis:u(),hardBreakEscape:u(v),hardBreakTrailing:u(v),htmlFlow:u(U),htmlFlowData:k,htmlText:u(D),htmlTextData:k,image:u(X),label:he,labelText:le,lineEnding:P,link:u(q),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:ae,resourceDestinationString:m,resourceTitleString:oe,resource:pe,setextHeading:u(H),setextHeadingLineSequence:M,setextHeadingText:b,strong:u(),thematicBreak:u()}};Ar(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(x){let A={type:"root",children:[]};const F={stack:[A],tokenStack:[],config:t,enter:a,exit:s,buffer:l,resume:f,data:n},N=[];let V=-1;for(;++V<x.length;)if(x[V][1].type==="listOrdered"||x[V][1].type==="listUnordered")if(x[V][0]==="enter")N.push(V);else{const ue=N.pop();V=i(x,ue,V)}for(V=-1;++V<x.length;){const ue=t[x[V][0]];Ir.call(ue,x[V][1].type)&&ue[x[V][1].type].call(Object.assign({sliceSerialize:x[V][2].sliceSerialize},F),x[V][1])}if(F.tokenStack.length>0){const ue=F.tokenStack[F.tokenStack.length-1];(ue[1]||zt).call(F,void 0,ue[0])}for(A.position={start:ke(x.length>0?x[0][1].start:{line:1,column:1,offset:0}),end:ke(x.length>0?x[x.length-2][1].end:{line:1,column:1,offset:0})},V=-1;++V<t.transforms.length;)A=t.transforms[V](A)||A;return A}function i(x,A,F){let N=A-1,V=-1,ue=!1,we,me,Oe,Me;for(;++N<=F;){const ne=x[N];switch(ne[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ne[0]==="enter"?V++:V--,Me=void 0;break}case"lineEndingBlank":{ne[0]==="enter"&&(we&&!Me&&!V&&!Oe&&(Oe=N),Me=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Me=void 0}if(!V&&ne[0]==="enter"&&ne[1].type==="listItemPrefix"||V===-1&&ne[0]==="exit"&&(ne[1].type==="listUnordered"||ne[1].type==="listOrdered")){if(we){let ve=N;for(me=void 0;ve--;){const ge=x[ve];if(ge[1].type==="lineEnding"||ge[1].type==="lineEndingBlank"){if(ge[0]==="exit")continue;me&&(x[me][1].type="lineEndingBlank",ue=!0),ge[1].type="lineEnding",me=ve}else if(!(ge[1].type==="linePrefix"||ge[1].type==="blockQuotePrefix"||ge[1].type==="blockQuotePrefixWhitespace"||ge[1].type==="blockQuoteMarker"||ge[1].type==="listItemIndent"))break}Oe&&(!me||Oe<me)&&(we._spread=!0),we.end=Object.assign({},me?x[me][1].start:ne[1].end),x.splice(me||N,0,["exit",we,ne[2]]),N++,F++}if(ne[1].type==="listItemPrefix"){const ve={type:"listItem",_spread:!1,start:Object.assign({},ne[1].start),end:void 0};we=ve,x.splice(N,0,["enter",ve,ne[2]]),N++,F++,Oe=void 0,Me=!0}}}return x[A][1]._spread=ue,F}function o(x,A){return F;function F(N){a.call(this,x(N),N),A&&A.call(this,N)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(x,A,F){this.stack[this.stack.length-1].children.push(x),this.stack.push(x),this.tokenStack.push([A,F||void 0]),x.position={start:ke(A.start),end:void 0}}function u(x){return A;function A(F){x&&x.call(this,F),s.call(this,F)}}function s(x,A){const F=this.stack.pop(),N=this.tokenStack.pop();if(N)N[0].type!==x.type&&(A?A.call(this,x,N[0]):(N[1]||zt).call(this,x,N[0]));else throw new Error("Cannot close `"+x.type+"` ("+Ue({start:x.start,end:x.end})+"): it’s not open");F.position.end=ke(x.end)}function f(){return Yn(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(x){if(this.data.expectingFirstListItemValue){const A=this.stack[this.stack.length-2];A.start=Number.parseInt(this.sliceSerialize(x),10),this.data.expectingFirstListItemValue=void 0}}function h(){const x=this.resume(),A=this.stack[this.stack.length-1];A.lang=x}function d(){const x=this.resume(),A=this.stack[this.stack.length-1];A.meta=x}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function y(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x.replace(/(\r?\n|\r)$/g,"")}function I(x){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=se(this.sliceSerialize(x)).toLowerCase()}function C(){const x=this.resume(),A=this.stack[this.stack.length-1];A.title=x}function R(){const x=this.resume(),A=this.stack[this.stack.length-1];A.url=x}function _(x){const A=this.stack[this.stack.length-1];if(!A.depth){const F=this.sliceSerialize(x).length;A.depth=F}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function M(x){const A=this.stack[this.stack.length-1];A.depth=this.sliceSerialize(x).codePointAt(0)===61?1:2}function H(){this.data.setextHeadingSlurpLineEnding=void 0}function j(x){const F=this.stack[this.stack.length-1].children;let N=F[F.length-1];(!N||N.type!=="text")&&(N=fi(),N.position={start:ke(x.start),end:void 0},F.push(N)),this.stack.push(N)}function k(x){const A=this.stack.pop();A.value+=this.sliceSerialize(x),A.position.end=ke(x.end)}function P(x){const A=this.stack[this.stack.length-1];if(this.data.atHardBreak){const F=A.children[A.children.length-1];F.position.end=ke(x.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(A.type)&&(j.call(this,x),k.call(this,x))}function v(){this.data.atHardBreak=!0}function U(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function D(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function T(){const x=this.resume(),A=this.stack[this.stack.length-1];A.value=x}function q(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=A,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function X(){const x=this.stack[this.stack.length-1];if(this.data.inReference){const A=this.data.referenceType||"shortcut";x.type+="Reference",x.referenceType=A,delete x.url,delete x.title}else delete x.identifier,delete x.label;this.data.referenceType=void 0}function le(x){const A=this.sliceSerialize(x),F=this.stack[this.stack.length-2];F.label=ea(A),F.identifier=se(A).toLowerCase()}function he(){const x=this.stack[this.stack.length-1],A=this.resume(),F=this.stack[this.stack.length-1];if(this.data.inReference=!0,F.type==="link"){const N=x.children;F.children=N}else F.alt=A}function m(){const x=this.resume(),A=this.stack[this.stack.length-1];A.url=x}function oe(){const x=this.resume(),A=this.stack[this.stack.length-1];A.title=x}function pe(){this.data.inReference=void 0}function g(){this.data.referenceType="collapsed"}function ae(x){const A=this.resume(),F=this.stack[this.stack.length-1];F.label=A,F.identifier=se(this.sliceSerialize(x)).toLowerCase(),this.data.referenceType="full"}function be(x){this.data.characterReferenceType=x.type}function Q(x){const A=this.sliceSerialize(x),F=this.data.characterReferenceType;let N;F?(N=gr(A,F==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):N=Xn(A);const V=this.stack[this.stack.length-1];V.value+=N}function _e(x){const A=this.stack.pop();A.position.end=ke(x.end)}function ye(x){k.call(this,x);const A=this.stack[this.stack.length-1];A.url=this.sliceSerialize(x)}function Te(x){k.call(this,x);const A=this.stack[this.stack.length-1];A.url="mailto:"+this.sliceSerialize(x)}function Pe(){return{type:"blockquote",children:[]}}function Ge(){return{type:"code",lang:null,meta:null,value:""}}function ii(){return{type:"inlineCode",value:""}}function li(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function oi(){return{type:"emphasis",children:[]}}function lt(){return{type:"heading",depth:0,children:[]}}function ot(){return{type:"break"}}function at(){return{type:"html",value:""}}function ai(){return{type:"image",title:null,url:"",alt:null}}function ut(){return{type:"link",title:null,url:"",children:[]}}function st(x){return{type:"list",ordered:x.type==="listOrdered",start:null,spread:x._spread,children:[]}}function ui(x){return{type:"listItem",spread:x._spread,checked:null,children:[]}}function si(){return{type:"paragraph",children:[]}}function ci(){return{type:"strong",children:[]}}function fi(){return{type:"text",value:""}}function hi(){return{type:"thematicBreak"}}}function ke(e){return{line:e.line,column:e.column,offset:e.offset}}function Ar(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Ar(e,r):ia(e,r)}}function ia(e,t){let n;for(n in t)if(Ir.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function zt(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ue({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ue({start:t.start,end:t.end})+") is still open")}function la(e){const t=this;t.parser=n;function n(r){return ta(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function oa(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function aa(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionView-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SessionView-BJywkNAY.js","assets/CopyButton-CAUFwuiX.js","assets/severity-4pf1WhNq.js","assets/index-BR_zJBAm.js","assets/WorkflowView-BQCMn0Uf.js","assets/SkillView-BDENXN1E.js","assets/SecurityView-DCWVNFf5.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
function $d(o,a){for(var s=0;s<a.length;s++){const f=a[s];if(typeof f!="string"&&!Array.isArray(f)){for(const h in f)if(h!=="default"&&!(h in o)){const v=Object.getOwnPropertyDescriptor(f,h);v&&Object.defineProperty(o,h,v.get?v:{enumerable:!0,get:()=>f[h]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))f(h);new MutationObserver(h=>{for(const v of h)if(v.type==="childList")for(const S of v.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&f(S)}).observe(document,{childList:!0,subtree:!0});function s(h){const v={};return h.integrity&&(v.integrity=h.integrity),h.referrerPolicy&&(v.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?v.credentials="include":h.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function f(h){if(h.ep)return;h.ep=!0;const v=s(h);fetch(h.href,v)}})();const Ad="modulepreload",Bd=function(o){return"/"+o},lc={},Wn=function(a,s,f){let h=Promise.resolve();if(s&&s.length>0){let S=function(R){return Promise.all(R.map(z=>Promise.resolve(z).then(j=>({status:"fulfilled",value:j}),j=>({status:"rejected",reason:j}))))};document.getElementsByTagName("link");const k=document.querySelector("meta[property=csp-nonce]"),C=(k==null?void 0:k.nonce)||(k==null?void 0:k.getAttribute("nonce"));h=S(s.map(R=>{if(R=Bd(R),R in lc)return;lc[R]=!0;const z=R.endsWith(".css"),j=z?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${R}"]${j}`))return;const I=document.createElement("link");if(I.rel=z?"stylesheet":Ad,z||(I.as="script"),I.crossOrigin="",I.href=R,C&&I.setAttribute("nonce",C),document.head.appendChild(I),z)return new Promise((Z,A)=>{I.addEventListener("load",Z),I.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${R}`)))})}))}function v(S){const k=new Event("vite:preloadError",{cancelable:!0});if(k.payload=S,window.dispatchEvent(k),!k.defaultPrevented)throw S}return h.then(S=>{for(const k of S||[])k.status==="rejected"&&v(k.reason);return a().catch(v)})};var jh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vd(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var Xo={exports:{}},Lr={},Go={exports:{}},te={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -65,4 +65,4 @@ Error generating stack: `+i.message+`
|
|
|
65
65
|
* LICENSE.md file in the root directory of this source tree.
|
|
66
66
|
*
|
|
67
67
|
* @license MIT
|
|
68
|
-
*/function Jl(){return Jl=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)({}).hasOwnProperty.call(s,f)&&(o[f]=s[f])}return o},Jl.apply(null,arguments)}function Uc(o,a){if(o==null)return{};var s={};for(var f in o)if({}.hasOwnProperty.call(o,f)){if(a.indexOf(f)!==-1)continue;s[f]=o[f]}return s}function Qp(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function Kp(o,a){return o.button===0&&(!a||a==="_self")&&!Qp(o)}function lu(o){return o===void 0&&(o=""),new URLSearchParams(typeof o=="string"||Array.isArray(o)||o instanceof URLSearchParams?o:Object.keys(o).reduce((a,s)=>{let f=o[s];return a.concat(Array.isArray(f)?f.map(h=>[s,h]):[[s,f]])},[]))}function Yp(o,a){let s=lu(o);return a&&a.forEach((f,h)=>{s.has(h)||a.getAll(h).forEach(v=>{s.append(h,v)})}),s}const Xp=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gp=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Jp="6";try{window.__reactRouterVersion=Jp}catch{}const Zp=E.createContext({isTransitioning:!1}),qp="startTransition",Sc=Kd[qp];function bp(o){let{basename:a,children:s,future:f,window:h}=o,v=E.useRef();v.current==null&&(v.current=qd({window:h,v5Compat:!0}));let S=v.current,[k,C]=E.useState({action:S.action,location:S.location}),{v7_startTransition:R}=f||{},z=E.useCallback(j=>{R&&Sc?Sc(()=>C(j)):C(j)},[C,R]);return E.useLayoutEffect(()=>S.listen(z),[S,z]),E.useEffect(()=>Bp(f),[f]),E.createElement(Wp,{basename:a,children:s,location:k.location,navigationType:k.action,navigator:S,future:f})}const eh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",th=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,su=E.forwardRef(function(a,s){let{onClick:f,relative:h,reloadDocument:v,replace:S,state:k,target:C,to:R,preventScrollReset:z,viewTransition:j}=a,I=Uc(a,Xp),{basename:Z}=E.useContext(bt),A,K=!1;if(typeof R=="string"&&th.test(R)&&(A=R,eh))try{let D=new URL(window.location.href),H=R.startsWith("//")?new URL(D.protocol+R):new URL(R),ue=Vn(H.pathname,Z);H.origin===D.origin&&ue!=null?R=ue+H.search+H.hash:K=!0}catch{}let O=Cp(R,{relative:h}),q=rh(R,{replace:S,state:k,target:C,preventScrollReset:z,relative:h,viewTransition:j});function b(D){f&&f(D),D.defaultPrevented||q(D)}return E.createElement("a",Jl({},I,{href:A||O,onClick:K||v?f:b,ref:s,target:C}))}),Yl=E.forwardRef(function(a,s){let{"aria-current":f="page",caseSensitive:h=!1,className:v="",end:S=!1,style:k,to:C,viewTransition:R,children:z}=a,j=Uc(a,Gp),I=bl(C,{relative:j.relative}),Z=hn(),A=E.useContext(Tc),{navigator:K,basename:O}=E.useContext(bt),q=A!=null&&ih(I)&&R===!0,b=K.encodeLocation?K.encodeLocation(I).pathname:I.pathname,D=Z.pathname,H=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;h||(D=D.toLowerCase(),H=H?H.toLowerCase():null,b=b.toLowerCase()),H&&O&&(H=Vn(H,O)||H);const ue=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let Ee=D===b||!S&&D.startsWith(b)&&D.charAt(ue)==="/",Ne=H!=null&&(H===b||!S&&H.startsWith(b)&&H.charAt(b.length)==="/"),F={isActive:Ee,isPending:Ne,isTransitioning:q},ge=Ee?f:void 0,ce;typeof v=="function"?ce=v(F):ce=[v,Ee?"active":null,Ne?"pending":null,q?"transitioning":null].filter(Boolean).join(" ");let Be=typeof k=="function"?k(F):k;return E.createElement(su,Jl({},j,{"aria-current":ge,className:ce,ref:s,style:Be,to:C,viewTransition:R}),typeof z=="function"?z(F):z)});var iu;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(iu||(iu={}));var kc;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(kc||(kc={}));function nh(o){let a=E.useContext(Zl);return a||xe(!1),a}function rh(o,a){let{target:s,replace:f,state:h,preventScrollReset:v,relative:S,viewTransition:k}=a===void 0?{}:a,C=Dc(),R=hn(),z=bl(o,{relative:S});return E.useCallback(j=>{if(Kp(j,s)){j.preventDefault();let I=f!==void 0?f:Gl(R)===Gl(z);C(o,{replace:I,state:h,preventScrollReset:v,relative:S,viewTransition:k})}},[R,C,z,f,h,s,o,v,S,k])}function lh(o){let a=E.useRef(lu(o)),s=E.useRef(!1),f=hn(),h=E.useMemo(()=>Yp(f.search,s.current?null:a.current),[f.search]),v=Dc(),S=E.useCallback((k,C)=>{const R=lu(typeof k=="function"?k(h):k);s.current=!0,v("?"+R,C)},[v,h]);return[h,S]}function ih(o,a){a===void 0&&(a={});let s=E.useContext(Zp);s==null&&xe(!1);let{basename:f}=nh(iu.useViewTransitionState),h=bl(o,{relative:a.relative});if(!s.isTransitioning)return!1;let v=Vn(s.currentLocation.pathname,f)||s.currentLocation.pathname,S=Vn(s.nextLocation.pathname,f)||s.nextLocation.pathname;return nu(h.pathname,S)!=null||nu(h.pathname,v)!=null}const oh="/assets/logo-Cd7Wsq5o.png",eu={},au=(eu==null?void 0:eu.VITE_SNAPSHOT)==="1",$c="/";function uh(o){if(!au)return"/api"+o;const a=o.split("?")[0].replace(/^\//,"");return`${$c}snapshot/${a}.json`}function Lh(o){return au?`${$c}snapshot/sessions/${o}.export.md`:`/api/sessions/${o}/export.md`}async function Tr(o){const a=await fetch(uh(o));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function sh(o,a){const s=await fetch("/api"+o,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!s.ok)throw new Error(`${s.status} ${await s.text()}`);return s.json()}const Ac="agentlens.theme";function ah(){if(typeof document<"u"){const o=document.documentElement.dataset.theme;if(o==="light"||o==="dark")return o}try{const o=localStorage.getItem(Ac);if(o==="light"||o==="dark")return o}catch{}return"dark"}const Bc=E.createContext({theme:"dark",toggle:()=>{}});function ch({children:o}){const[a,s]=E.useState(ah);typeof document<"u"&&(document.documentElement.dataset.theme=a),E.useEffect(()=>{try{localStorage.setItem(Ac,a)}catch{}},[a]);const f=()=>s(h=>h==="dark"?"light":"dark");return x.jsx(Bc.Provider,{value:{theme:a,toggle:f},children:o})}function fh(){return E.useContext(Bc)}function dh(o){const a=Math.round((Date.now()-new Date(o).getTime())/1e3);if(a<45)return"just now";const s=Math.round(a/60);if(s<60)return`${s}m ago`;const f=Math.round(s/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function ph(){const{theme:o,toggle:a}=fh(),[s,f]=E.useState(null),[h,v]=E.useState(!1),S=E.useCallback(()=>{Tr("/health").then(A=>{f(A.last_ingested??null),v(!!A.schema_stale)}).catch(()=>{})},[]);E.useEffect(()=>{S();const A=setInterval(S,6e4);return()=>clearInterval(A)},[S]);const[k,C]=E.useState(!1),[R,z]=E.useState(null),j=E.useCallback(async()=>{C(!0),z(null);try{await sh("/refresh"),window.location.reload()}catch(A){z(String((A==null?void 0:A.message)??A).slice(0,200)),C(!1)}},[]),{pathname:I}=hn(),Z=I==="/dashboard"||I==="/security"||I.startsWith("/skill/");return x.jsxs("div",{className:"app",children:[x.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),x.jsxs("header",{className:"topbar",children:[x.jsxs(su,{to:"/",className:"brand",children:[x.jsx("img",{src:oh,alt:"",className:"brand-logo"})," Agent Lens"]}),x.jsxs("nav",{className:"nav",children:[x.jsx(Yl,{to:"/",end:!0,className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Sessions"}),x.jsx(Yl,{to:"/skills",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Skills"}),x.jsx(Yl,{to:"/security",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Security"}),x.jsx(Yl,{to:"/dashboard",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Dashboard"})]}),s?x.jsxs("span",{className:"tagline",title:`Data last ingested ${new Date(s).toLocaleString()}`,children:["updated ",dh(s)]}):x.jsx("span",{className:"tagline",children:"local agent session explorer"}),x.jsxs("div",{className:"topbar-actions",children:[!au&&x.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:j,disabled:k,"aria-label":"Refresh data — collect new transcripts and rebuild",title:R?`Refresh failed: ${R}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[x.jsx("span",{className:k?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",k?"Refreshing…":R?"Retry":"Refresh"]}),x.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":o==="light",title:o==="dark"?"Switch to light theme":"Switch to dark theme",children:o==="dark"?"☀":"☾"})]})]}),h&&x.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",x.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",x.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),x.jsx("main",{className:"content"+(Z?" wide":""),id:"main",tabIndex:-1,children:x.jsx(Vp,{})})]})}function hh(o){if(!o||o<0)return"—";const a=Math.round(o/1e3);if(a<60)return`${a}s`;const s=Math.round(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}function zr(o){return o>=1e9?(o/1e9).toFixed(1)+"B":o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"k":String(o)}function mh(o){return o>=.01?"$"+o.toFixed(2):o>0?"<$0.01":"$0"}function vh(o){return o?`input ${zr(o.input)} · output ${zr(o.output)} · cache-write ${zr(o.cache_creation)} · cache-read ${zr(o.cache_read)}`:""}function gh(o){if(!o)return"—";const a=new Date(o);return isNaN(a.getTime())?o:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function xc(o){return o?o==="<synthetic>"?"local":o.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function yh({value:o,options:a,onChange:s,ariaLabel:f,searchPlaceholder:h="Filter…"}){const[v,S]=E.useState(!1),[k,C]=E.useState(""),[R,z]=E.useState(0),j=E.useRef(null),I=E.useRef(null),Z=E.useId(),A=D=>`${Z}-opt-${D}`,K=a.find(D=>D.value===o)??a[0]??{value:"",label:""},O=E.useMemo(()=>{const D=k.trim().toLowerCase();return D?a.filter(H=>H.label.toLowerCase().includes(D)):a},[a,k]);E.useEffect(()=>{if(!v)return;const D=H=>{j.current&&!j.current.contains(H.target)&&S(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),E.useEffect(()=>{var H;if(!v)return;C(""),(H=I.current)==null||H.focus();const D=O.findIndex(ue=>ue.value===o);z(D>=0?D:0)},[v]),E.useEffect(()=>{z(D=>Math.min(D,Math.max(0,O.length-1)))},[O.length]);function q(D){D&&(s(D.value),S(!1))}function b(D){if(D.key==="ArrowDown"){if(D.preventDefault(),!v)return S(!0);z(H=>Math.min(H+1,O.length-1))}else D.key==="ArrowUp"?(D.preventDefault(),z(H=>Math.max(H-1,0))):D.key==="Enter"?(D.preventDefault(),q(O[R])):D.key==="Escape"&&(D.preventDefault(),S(!1))}return x.jsxs("div",{className:"filter-select",ref:j,children:[x.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":f,"aria-haspopup":"listbox","aria-expanded":v,onClick:()=>S(D=>!D),children:[x.jsx("span",{className:"filter-select-value"+(K.value?"":" muted"),children:K.label}),x.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),v&&x.jsxs("div",{className:"filter-select-pop",children:[x.jsx("input",{ref:I,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Z,"aria-activedescendant":O.length?A(R):void 0,"aria-label":f,className:"filter-select-search",placeholder:h,value:k,onChange:D=>C(D.target.value),onKeyDown:b}),x.jsx("ul",{className:"filter-select-list",role:"listbox",id:Z,"aria-label":f,children:O.length===0?x.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):O.map((D,H)=>x.jsx("li",{id:A(H),role:"option","aria-selected":D.value===o,className:"filter-select-opt"+(H===R?" is-active":"")+(D.value===o?" is-selected":""),onMouseEnter:()=>z(H),onMouseDown:ue=>{ue.preventDefault(),q(D)},children:D.value?D.label:x.jsx("span",{className:"muted",children:D.label})},D.value||"__all__"))})]})]})}function wh({page:o,pages:a,total:s,unit:f,onPage:h}){return x.jsxs("div",{className:"pager",children:[x.jsx("button",{disabled:o<=1,onClick:()=>h(o-1),children:"← Prev"}),x.jsxs("span",{className:"muted",children:["page ",o," / ",a," · ",s," ",f]}),x.jsx("button",{disabled:o>=a,onClick:()=>h(o+1),children:"Next →"}),a>1&&x.jsxs("label",{className:"page-jump",children:[x.jsx("span",{className:"sr-only",children:"Jump to page"}),x.jsx("select",{value:o,onChange:v=>h(Number(v.target.value)),children:Array.from({length:a},(v,S)=>S+1).map(v=>x.jsxs("option",{value:v,children:["page ",v," / ",a]},v))})]})]})}function Th(o,a,s){const f=s==="asc"?1:-1;return o.map((h,v)=>({row:h,i:v})).sort((h,v)=>{const S=a(h.row),k=a(v.row);if(S==null&&k==null)return h.i-v.i;if(S==null)return 1;if(k==null)return-1;const C=typeof S=="number"&&typeof k=="number"?S-k:String(S).localeCompare(String(k),void 0,{numeric:!0,sensitivity:"base"});return C!==0?C*f:h.i-v.i}).map(h=>h.row)}function zh(o,a){const[s,f]=E.useState({key:o,dir:a});return{sort:s,toggle:(v,S="desc")=>f(k=>k.key===v?{key:v,dir:k.dir==="asc"?"desc":"asc"}:{key:v,dir:S})}}function An({label:o,sortKey:a,active:s,dir:f,onSort:h,defaultDir:v="desc",className:S}){const k=s===a;return x.jsx("th",{className:S,"aria-sort":k?f==="asc"?"ascending":"descending":"none",children:x.jsxs("button",{type:"button",className:"sort-th"+(k?" is-active":""),onClick:()=>h(a,v),children:[x.jsx("span",{children:o}),x.jsx("span",{className:"sort-ind","aria-hidden":"true",children:k?f==="asc"?"▲":"▼":"↕"})]})})}const Xl=50;function Sh(){const[o,a]=lh(),[s,f]=E.useState([]),[h,v]=E.useState([]),[S,k]=E.useState([]),[C,R]=E.useState({total:0,sessions:[]}),[z,j]=E.useState(!0),[I,Z]=E.useState(null),[A,K]=E.useState(o.get("q")??""),O=Number(o.get("offset")??0);E.useEffect(()=>{Tr("/sources").then(f).catch(()=>{}),Tr("/projects").then(v).catch(()=>{}),Tr("/models").then(k).catch(()=>{})},[]),E.useEffect(()=>{j(!0),Z(null);const F=new URLSearchParams;for(const ge of["source","project","model","q","sort","dir"]){const ce=o.get(ge);ce&&F.set(ge,ce)}F.set("kind",o.get("kind")||"main"),F.set("limit",String(Xl)),F.set("offset",String(O)),Tr("/sessions?"+F.toString()).then(R).catch(ge=>Z(String(ge))).finally(()=>j(!1))},[o]);function q(F,ge){const ce=new URLSearchParams(o);ge?ce.set(F,ge):ce.delete(F),F!=="offset"&&ce.delete("offset"),a(ce)}function b(F){F.preventDefault(),q("q",A.trim())}const D=o.get("sort")??"started",H=o.get("dir")==="asc"?"asc":"desc";function ue(F,ge){const ce=D===F?H==="asc"?"desc":"asc":ge,Be=new URLSearchParams(o);Be.set("sort",F),Be.set("dir",ce),Be.delete("offset"),a(Be)}const Ee=Math.floor(O/Xl)+1,Ne=Math.max(1,Math.ceil(C.total/Xl));return x.jsxs("div",{children:[x.jsx("h1",{className:"sr-only",children:"Sessions"}),x.jsxs("div",{className:"filters",children:[x.jsxs("form",{onSubmit:b,className:"search",role:"search",children:[x.jsx("input",{type:"search","aria-label":"Search session names, projects and transcripts",placeholder:"Search names, projects & transcripts…",value:A,onChange:F=>K(F.target.value)}),x.jsx("button",{type:"submit",children:"Search"}),o.get("q")&&x.jsx("button",{type:"button",className:"ghost",onClick:()=>(K(""),q("q","")),children:"clear"})]}),x.jsxs("select",{"aria-label":"Filter by source",value:o.get("source")??"",onChange:F=>q("source",F.target.value),children:[x.jsx("option",{value:"",children:"all sources"}),s.map(F=>x.jsxs("option",{value:F.id,children:[F.label," (",F.session_count,")"]},F.id))]}),x.jsx(yh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:o.get("project")??"",onChange:F=>q("project",F),options:[{value:"",label:"all projects"},...h.map(F=>({value:F.id,label:`${F.path.replace(/^.*\//,"")} (${F.session_count})`}))]}),x.jsxs("select",{"aria-label":"Filter by model",value:o.get("model")??"",onChange:F=>q("model",F.target.value),children:[x.jsx("option",{value:"",children:"all models"}),S.map(F=>x.jsx("option",{value:F,children:xc(F)},F))]}),x.jsxs("select",{"aria-label":"Filter by kind",value:o.get("kind")||"main",onChange:F=>q("kind",F.target.value),children:[x.jsx("option",{value:"main",children:"main only"}),x.jsx("option",{value:"all",children:"main + subagents"}),x.jsx("option",{value:"subagent",children:"subagents only"})]})]}),I&&x.jsx("div",{className:"error",role:"alert",children:I}),z?x.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}):C.sessions.length===0?x.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):x.jsxs("table",{className:"sessions",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx(An,{label:"Session",sortKey:"title",active:D,dir:H,onSort:ue,defaultDir:"asc"}),x.jsx("th",{children:"Source"}),x.jsx("th",{children:"Project"}),x.jsx(An,{label:"Turns",sortKey:"turns",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Tokens",sortKey:"tokens",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Cost",sortKey:"cost",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Duration",sortKey:"duration",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Started",sortKey:"started",active:D,dir:H,onSort:ue})]})}),x.jsx("tbody",{children:C.sessions.map(F=>{var ge;return x.jsxs("tr",{children:[x.jsxs("td",{children:[x.jsx(su,{to:`/session/${F.id}`,className:"title",children:F.title||x.jsx("span",{className:"muted",children:F.id.slice(0,12)})}),x.jsxs("div",{className:"sub",children:[F.is_sidechain?x.jsx("span",{className:"tag subagent",children:"subagent"}):null,(F.models??"").split(",").filter(Boolean).slice(0,3).map(ce=>x.jsx("span",{className:"tag",children:xc(ce)},ce))]})]}),x.jsx("td",{children:F.source_id}),x.jsx("td",{className:"path",children:((ge=F.project_path)==null?void 0:ge.replace(/^.*\//,""))??"—"}),x.jsx("td",{className:"num",children:F.turn_count}),x.jsx("td",{className:"num",title:vh(F.token_split),children:zr(F.tokens)}),x.jsx("td",{className:"num",title:"Estimated at API list prices (cache-aware)",children:mh(F.cost)}),x.jsx("td",{className:"num",children:hh(F.duration_ms)}),x.jsx("td",{children:gh(F.started_at)})]},F.id)})})]}),x.jsx(wh,{page:Ee,pages:Ne,total:C.total,unit:"sessions",onPage:F=>q("offset",String((F-1)*Xl))})]})}const kh=E.lazy(()=>Wn(()=>import("./Dashboard-B0wpOYPt.js"),[])),xh=E.lazy(()=>Wn(()=>import("./SessionView-BkOEhK9L.js"),__vite__mapDeps([0,1,2,3]))),Eh=E.lazy(()=>Wn(()=>import("./WorkflowView-B8jF6aE7.js"),__vite__mapDeps([4,1,3]))),Ch=E.lazy(()=>Wn(()=>import("./SkillsView-C6f11mVw.js"),[])),_h=E.lazy(()=>Wn(()=>import("./SkillView-COo5sndg.js"),__vite__mapDeps([5,3]))),Ph=E.lazy(()=>Wn(()=>import("./SecurityView-D9MKBBkp.js"),__vite__mapDeps([6,2]))),Bn=()=>x.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}),Nh="/".replace(/\/$/,"");Zd.createRoot(document.getElementById("root")).render(x.jsx(Ec.StrictMode,{children:x.jsx(ch,{children:x.jsx(bp,{basename:Nh,children:x.jsx(Hp,{children:x.jsxs(Lt,{path:"/",element:x.jsx(ph,{}),children:[x.jsx(Lt,{index:!0,element:x.jsx(Sh,{})}),x.jsx(Lt,{path:"dashboard",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(kh,{})})}),x.jsx(Lt,{path:"session/:id",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(xh,{})})}),x.jsx(Lt,{path:"workflow/:run_id",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Eh,{})})}),x.jsx(Lt,{path:"skills",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Ch,{})})}),x.jsx(Lt,{path:"skill/:name",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(_h,{})})}),x.jsx(Lt,{path:"security",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Ph,{})})})]})})})})}));export{yh as F,su as L,wh as P,Ec as R,An as S,lh as a,Dc as b,jh as c,Tr as d,hh as e,mh as f,Vd as g,zr as h,Rh as i,x as j,gh as k,Lh as l,zh as m,Th as n,au as o,sh as p,E as r,xc as s,vh as t,fh as u};
|
|
68
|
+
*/function Jl(){return Jl=Object.assign?Object.assign.bind():function(o){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var f in s)({}).hasOwnProperty.call(s,f)&&(o[f]=s[f])}return o},Jl.apply(null,arguments)}function Uc(o,a){if(o==null)return{};var s={};for(var f in o)if({}.hasOwnProperty.call(o,f)){if(a.indexOf(f)!==-1)continue;s[f]=o[f]}return s}function Qp(o){return!!(o.metaKey||o.altKey||o.ctrlKey||o.shiftKey)}function Kp(o,a){return o.button===0&&(!a||a==="_self")&&!Qp(o)}function lu(o){return o===void 0&&(o=""),new URLSearchParams(typeof o=="string"||Array.isArray(o)||o instanceof URLSearchParams?o:Object.keys(o).reduce((a,s)=>{let f=o[s];return a.concat(Array.isArray(f)?f.map(h=>[s,h]):[[s,f]])},[]))}function Yp(o,a){let s=lu(o);return a&&a.forEach((f,h)=>{s.has(h)||a.getAll(h).forEach(v=>{s.append(h,v)})}),s}const Xp=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Gp=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Jp="6";try{window.__reactRouterVersion=Jp}catch{}const Zp=E.createContext({isTransitioning:!1}),qp="startTransition",Sc=Kd[qp];function bp(o){let{basename:a,children:s,future:f,window:h}=o,v=E.useRef();v.current==null&&(v.current=qd({window:h,v5Compat:!0}));let S=v.current,[k,C]=E.useState({action:S.action,location:S.location}),{v7_startTransition:R}=f||{},z=E.useCallback(j=>{R&&Sc?Sc(()=>C(j)):C(j)},[C,R]);return E.useLayoutEffect(()=>S.listen(z),[S,z]),E.useEffect(()=>Bp(f),[f]),E.createElement(Wp,{basename:a,children:s,location:k.location,navigationType:k.action,navigator:S,future:f})}const eh=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",th=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,su=E.forwardRef(function(a,s){let{onClick:f,relative:h,reloadDocument:v,replace:S,state:k,target:C,to:R,preventScrollReset:z,viewTransition:j}=a,I=Uc(a,Xp),{basename:Z}=E.useContext(bt),A,K=!1;if(typeof R=="string"&&th.test(R)&&(A=R,eh))try{let D=new URL(window.location.href),H=R.startsWith("//")?new URL(D.protocol+R):new URL(R),ue=Vn(H.pathname,Z);H.origin===D.origin&&ue!=null?R=ue+H.search+H.hash:K=!0}catch{}let O=Cp(R,{relative:h}),q=rh(R,{replace:S,state:k,target:C,preventScrollReset:z,relative:h,viewTransition:j});function b(D){f&&f(D),D.defaultPrevented||q(D)}return E.createElement("a",Jl({},I,{href:A||O,onClick:K||v?f:b,ref:s,target:C}))}),Yl=E.forwardRef(function(a,s){let{"aria-current":f="page",caseSensitive:h=!1,className:v="",end:S=!1,style:k,to:C,viewTransition:R,children:z}=a,j=Uc(a,Gp),I=bl(C,{relative:j.relative}),Z=hn(),A=E.useContext(Tc),{navigator:K,basename:O}=E.useContext(bt),q=A!=null&&ih(I)&&R===!0,b=K.encodeLocation?K.encodeLocation(I).pathname:I.pathname,D=Z.pathname,H=A&&A.navigation&&A.navigation.location?A.navigation.location.pathname:null;h||(D=D.toLowerCase(),H=H?H.toLowerCase():null,b=b.toLowerCase()),H&&O&&(H=Vn(H,O)||H);const ue=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let Ee=D===b||!S&&D.startsWith(b)&&D.charAt(ue)==="/",Ne=H!=null&&(H===b||!S&&H.startsWith(b)&&H.charAt(b.length)==="/"),F={isActive:Ee,isPending:Ne,isTransitioning:q},ge=Ee?f:void 0,ce;typeof v=="function"?ce=v(F):ce=[v,Ee?"active":null,Ne?"pending":null,q?"transitioning":null].filter(Boolean).join(" ");let Be=typeof k=="function"?k(F):k;return E.createElement(su,Jl({},j,{"aria-current":ge,className:ce,ref:s,style:Be,to:C,viewTransition:R}),typeof z=="function"?z(F):z)});var iu;(function(o){o.UseScrollRestoration="useScrollRestoration",o.UseSubmit="useSubmit",o.UseSubmitFetcher="useSubmitFetcher",o.UseFetcher="useFetcher",o.useViewTransitionState="useViewTransitionState"})(iu||(iu={}));var kc;(function(o){o.UseFetcher="useFetcher",o.UseFetchers="useFetchers",o.UseScrollRestoration="useScrollRestoration"})(kc||(kc={}));function nh(o){let a=E.useContext(Zl);return a||xe(!1),a}function rh(o,a){let{target:s,replace:f,state:h,preventScrollReset:v,relative:S,viewTransition:k}=a===void 0?{}:a,C=Dc(),R=hn(),z=bl(o,{relative:S});return E.useCallback(j=>{if(Kp(j,s)){j.preventDefault();let I=f!==void 0?f:Gl(R)===Gl(z);C(o,{replace:I,state:h,preventScrollReset:v,relative:S,viewTransition:k})}},[R,C,z,f,h,s,o,v,S,k])}function lh(o){let a=E.useRef(lu(o)),s=E.useRef(!1),f=hn(),h=E.useMemo(()=>Yp(f.search,s.current?null:a.current),[f.search]),v=Dc(),S=E.useCallback((k,C)=>{const R=lu(typeof k=="function"?k(h):k);s.current=!0,v("?"+R,C)},[v,h]);return[h,S]}function ih(o,a){a===void 0&&(a={});let s=E.useContext(Zp);s==null&&xe(!1);let{basename:f}=nh(iu.useViewTransitionState),h=bl(o,{relative:a.relative});if(!s.isTransitioning)return!1;let v=Vn(s.currentLocation.pathname,f)||s.currentLocation.pathname,S=Vn(s.nextLocation.pathname,f)||s.nextLocation.pathname;return nu(h.pathname,S)!=null||nu(h.pathname,v)!=null}const oh="/assets/logo-Cd7Wsq5o.png",eu={},au=(eu==null?void 0:eu.VITE_SNAPSHOT)==="1",$c="/";function uh(o){if(!au)return"/api"+o;const a=o.split("?")[0].replace(/^\//,"");return`${$c}snapshot/${a}.json`}function Lh(o){return au?`${$c}snapshot/sessions/${o}.export.md`:`/api/sessions/${o}/export.md`}async function Tr(o){const a=await fetch(uh(o));if(!a.ok)throw new Error(`${a.status} ${await a.text()}`);return a.json()}async function sh(o,a){const s=await fetch("/api"+o,{method:"POST",...a!==void 0?{headers:{"content-type":"application/json"},body:JSON.stringify(a)}:{}});if(!s.ok)throw new Error(`${s.status} ${await s.text()}`);return s.json()}const Ac="agentlens.theme";function ah(){if(typeof document<"u"){const o=document.documentElement.dataset.theme;if(o==="light"||o==="dark")return o}try{const o=localStorage.getItem(Ac);if(o==="light"||o==="dark")return o}catch{}return"dark"}const Bc=E.createContext({theme:"dark",toggle:()=>{}});function ch({children:o}){const[a,s]=E.useState(ah);typeof document<"u"&&(document.documentElement.dataset.theme=a),E.useEffect(()=>{try{localStorage.setItem(Ac,a)}catch{}},[a]);const f=()=>s(h=>h==="dark"?"light":"dark");return x.jsx(Bc.Provider,{value:{theme:a,toggle:f},children:o})}function fh(){return E.useContext(Bc)}function dh(o){const a=Math.round((Date.now()-new Date(o).getTime())/1e3);if(a<45)return"just now";const s=Math.round(a/60);if(s<60)return`${s}m ago`;const f=Math.round(s/60);return f<24?`${f}h ago`:`${Math.round(f/24)}d ago`}function ph(){const{theme:o,toggle:a}=fh(),[s,f]=E.useState(null),[h,v]=E.useState(!1),S=E.useCallback(()=>{Tr("/health").then(A=>{f(A.last_ingested??null),v(!!A.schema_stale)}).catch(()=>{})},[]);E.useEffect(()=>{S();const A=setInterval(S,6e4);return()=>clearInterval(A)},[S]);const[k,C]=E.useState(!1),[R,z]=E.useState(null),j=E.useCallback(async()=>{C(!0),z(null);try{await sh("/refresh"),window.location.reload()}catch(A){z(String((A==null?void 0:A.message)??A).slice(0,200)),C(!1)}},[]),{pathname:I}=hn(),Z=I==="/dashboard"||I==="/security"||I.startsWith("/skill/");return x.jsxs("div",{className:"app",children:[x.jsx("a",{className:"skip-link",href:"#main",children:"Skip to content"}),x.jsxs("header",{className:"topbar",children:[x.jsxs(su,{to:"/",className:"brand",children:[x.jsx("img",{src:oh,alt:"",className:"brand-logo"})," Agent Lens"]}),x.jsxs("nav",{className:"nav",children:[x.jsx(Yl,{to:"/",end:!0,className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Sessions"}),x.jsx(Yl,{to:"/skills",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Skills"}),x.jsx(Yl,{to:"/security",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Security"}),x.jsx(Yl,{to:"/dashboard",className:({isActive:A})=>A?"nav-link active":"nav-link",children:"Dashboard"})]}),s?x.jsxs("span",{className:"tagline",title:`Data last ingested ${new Date(s).toLocaleString()}`,children:["updated ",dh(s)]}):x.jsx("span",{className:"tagline",children:"local agent session explorer"}),x.jsxs("div",{className:"topbar-actions",children:[!au&&x.jsxs("button",{type:"button",className:"ghost refresh-btn",onClick:j,disabled:k,"aria-label":"Refresh data — collect new transcripts and rebuild",title:R?`Refresh failed: ${R}`:"Collect new transcripts and rebuild the data (runs on the host)",children:[x.jsx("span",{className:k?"refresh-icon spinning":"refresh-icon","aria-hidden":"true",children:"⟳"})," ",k?"Refreshing…":R?"Retry":"Refresh"]}),x.jsx("button",{type:"button",className:"ghost theme-toggle",onClick:a,"aria-label":"Toggle light or dark theme","aria-pressed":o==="light",title:o==="dark"?"Switch to light theme":"Switch to dark theme",children:o==="dark"?"☀":"☾"})]})]}),h&&x.jsxs("div",{className:"schema-banner",role:"status",children:["⚠ Data schema is out of date — run ",x.jsx("code",{children:"agent-lens ingest --full"})," on the host to rebuild. The ",x.jsx("em",{children:"Refresh"})," button only does an incremental ingest and won't fix this."]}),x.jsx("main",{className:"content"+(Z?" wide":""),id:"main",tabIndex:-1,children:x.jsx(Vp,{})})]})}function hh(o){if(!o||o<0)return"—";const a=Math.round(o/1e3);if(a<60)return`${a}s`;const s=Math.round(a/60);return s<60?`${s}m`:`${Math.floor(s/60)}h ${s%60}m`}function zr(o){return o>=1e9?(o/1e9).toFixed(1)+"B":o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"k":String(o)}function mh(o){return o>=.01?"$"+o.toFixed(2):o>0?"<$0.01":"$0"}function vh(o){return o?`input ${zr(o.input)} · output ${zr(o.output)} · cache-write ${zr(o.cache_creation)} · cache-read ${zr(o.cache_read)}`:""}function gh(o){if(!o)return"—";const a=new Date(o);return isNaN(a.getTime())?o:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function xc(o){return o?o==="<synthetic>"?"local":o.replace(/^claude-/,"").replace(/-\d{8}$/,""):""}function yh({value:o,options:a,onChange:s,ariaLabel:f,searchPlaceholder:h="Filter…"}){const[v,S]=E.useState(!1),[k,C]=E.useState(""),[R,z]=E.useState(0),j=E.useRef(null),I=E.useRef(null),Z=E.useId(),A=D=>`${Z}-opt-${D}`,K=a.find(D=>D.value===o)??a[0]??{value:"",label:""},O=E.useMemo(()=>{const D=k.trim().toLowerCase();return D?a.filter(H=>H.label.toLowerCase().includes(D)):a},[a,k]);E.useEffect(()=>{if(!v)return;const D=H=>{j.current&&!j.current.contains(H.target)&&S(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[v]),E.useEffect(()=>{var H;if(!v)return;C(""),(H=I.current)==null||H.focus();const D=O.findIndex(ue=>ue.value===o);z(D>=0?D:0)},[v]),E.useEffect(()=>{z(D=>Math.min(D,Math.max(0,O.length-1)))},[O.length]);function q(D){D&&(s(D.value),S(!1))}function b(D){if(D.key==="ArrowDown"){if(D.preventDefault(),!v)return S(!0);z(H=>Math.min(H+1,O.length-1))}else D.key==="ArrowUp"?(D.preventDefault(),z(H=>Math.max(H-1,0))):D.key==="Enter"?(D.preventDefault(),q(O[R])):D.key==="Escape"&&(D.preventDefault(),S(!1))}return x.jsxs("div",{className:"filter-select",ref:j,children:[x.jsxs("button",{type:"button",className:"filter-select-btn","aria-label":f,"aria-haspopup":"listbox","aria-expanded":v,onClick:()=>S(D=>!D),children:[x.jsx("span",{className:"filter-select-value"+(K.value?"":" muted"),children:K.label}),x.jsx("span",{className:"chev","aria-hidden":"true",children:"▾"})]}),v&&x.jsxs("div",{className:"filter-select-pop",children:[x.jsx("input",{ref:I,type:"text",role:"combobox","aria-expanded":"true","aria-controls":Z,"aria-activedescendant":O.length?A(R):void 0,"aria-label":f,className:"filter-select-search",placeholder:h,value:k,onChange:D=>C(D.target.value),onKeyDown:b}),x.jsx("ul",{className:"filter-select-list",role:"listbox",id:Z,"aria-label":f,children:O.length===0?x.jsx("li",{className:"filter-select-empty muted",role:"presentation",children:"No matches"}):O.map((D,H)=>x.jsx("li",{id:A(H),role:"option","aria-selected":D.value===o,className:"filter-select-opt"+(H===R?" is-active":"")+(D.value===o?" is-selected":""),onMouseEnter:()=>z(H),onMouseDown:ue=>{ue.preventDefault(),q(D)},children:D.value?D.label:x.jsx("span",{className:"muted",children:D.label})},D.value||"__all__"))})]})]})}function wh({page:o,pages:a,total:s,unit:f,onPage:h}){return x.jsxs("div",{className:"pager",children:[x.jsx("button",{disabled:o<=1,onClick:()=>h(o-1),children:"← Prev"}),x.jsxs("span",{className:"muted",children:["page ",o," / ",a," · ",s," ",f]}),x.jsx("button",{disabled:o>=a,onClick:()=>h(o+1),children:"Next →"}),a>1&&x.jsxs("label",{className:"page-jump",children:[x.jsx("span",{className:"sr-only",children:"Jump to page"}),x.jsx("select",{value:o,onChange:v=>h(Number(v.target.value)),children:Array.from({length:a},(v,S)=>S+1).map(v=>x.jsxs("option",{value:v,children:["page ",v," / ",a]},v))})]})]})}function Th(o,a,s){const f=s==="asc"?1:-1;return o.map((h,v)=>({row:h,i:v})).sort((h,v)=>{const S=a(h.row),k=a(v.row);if(S==null&&k==null)return h.i-v.i;if(S==null)return 1;if(k==null)return-1;const C=typeof S=="number"&&typeof k=="number"?S-k:String(S).localeCompare(String(k),void 0,{numeric:!0,sensitivity:"base"});return C!==0?C*f:h.i-v.i}).map(h=>h.row)}function zh(o,a){const[s,f]=E.useState({key:o,dir:a});return{sort:s,toggle:(v,S="desc")=>f(k=>k.key===v?{key:v,dir:k.dir==="asc"?"desc":"asc"}:{key:v,dir:S})}}function An({label:o,sortKey:a,active:s,dir:f,onSort:h,defaultDir:v="desc",className:S}){const k=s===a;return x.jsx("th",{className:S,"aria-sort":k?f==="asc"?"ascending":"descending":"none",children:x.jsxs("button",{type:"button",className:"sort-th"+(k?" is-active":""),onClick:()=>h(a,v),children:[x.jsx("span",{children:o}),x.jsx("span",{className:"sort-ind","aria-hidden":"true",children:k?f==="asc"?"▲":"▼":"↕"})]})})}const Xl=50;function Sh(){const[o,a]=lh(),[s,f]=E.useState([]),[h,v]=E.useState([]),[S,k]=E.useState([]),[C,R]=E.useState({total:0,sessions:[]}),[z,j]=E.useState(!0),[I,Z]=E.useState(null),[A,K]=E.useState(o.get("q")??""),O=Number(o.get("offset")??0);E.useEffect(()=>{Tr("/sources").then(f).catch(()=>{}),Tr("/projects").then(v).catch(()=>{}),Tr("/models").then(k).catch(()=>{})},[]),E.useEffect(()=>{j(!0),Z(null);const F=new URLSearchParams;for(const ge of["source","project","model","q","sort","dir"]){const ce=o.get(ge);ce&&F.set(ge,ce)}F.set("kind",o.get("kind")||"main"),F.set("limit",String(Xl)),F.set("offset",String(O)),Tr("/sessions?"+F.toString()).then(R).catch(ge=>Z(String(ge))).finally(()=>j(!1))},[o]);function q(F,ge){const ce=new URLSearchParams(o);ge?ce.set(F,ge):ce.delete(F),F!=="offset"&&ce.delete("offset"),a(ce)}function b(F){F.preventDefault(),q("q",A.trim())}const D=o.get("sort")??"started",H=o.get("dir")==="asc"?"asc":"desc";function ue(F,ge){const ce=D===F?H==="asc"?"desc":"asc":ge,Be=new URLSearchParams(o);Be.set("sort",F),Be.set("dir",ce),Be.delete("offset"),a(Be)}const Ee=Math.floor(O/Xl)+1,Ne=Math.max(1,Math.ceil(C.total/Xl));return x.jsxs("div",{children:[x.jsx("h1",{className:"sr-only",children:"Sessions"}),x.jsxs("div",{className:"filters",children:[x.jsxs("form",{onSubmit:b,className:"search",role:"search",children:[x.jsx("input",{type:"search","aria-label":"Search session names, projects and transcripts",placeholder:"Search names, projects & transcripts…",value:A,onChange:F=>K(F.target.value)}),x.jsx("button",{type:"submit",children:"Search"}),o.get("q")&&x.jsx("button",{type:"button",className:"ghost",onClick:()=>(K(""),q("q","")),children:"clear"})]}),x.jsxs("select",{"aria-label":"Filter by source",value:o.get("source")??"",onChange:F=>q("source",F.target.value),children:[x.jsx("option",{value:"",children:"all sources"}),s.map(F=>x.jsxs("option",{value:F.id,children:[F.label," (",F.session_count,")"]},F.id))]}),x.jsx(yh,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:o.get("project")??"",onChange:F=>q("project",F),options:[{value:"",label:"all projects"},...h.map(F=>({value:F.id,label:`${F.path.replace(/^.*\//,"")} (${F.session_count})`}))]}),x.jsxs("select",{"aria-label":"Filter by model",value:o.get("model")??"",onChange:F=>q("model",F.target.value),children:[x.jsx("option",{value:"",children:"all models"}),S.map(F=>x.jsx("option",{value:F,children:xc(F)},F))]}),x.jsxs("select",{"aria-label":"Filter by kind",value:o.get("kind")||"main",onChange:F=>q("kind",F.target.value),children:[x.jsx("option",{value:"main",children:"main only"}),x.jsx("option",{value:"all",children:"main + subagents"}),x.jsx("option",{value:"subagent",children:"subagents only"})]})]}),I&&x.jsx("div",{className:"error",role:"alert",children:I}),z?x.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}):C.sessions.length===0?x.jsx("div",{className:"muted pad",role:"status",children:"No sessions match."}):x.jsxs("table",{className:"sessions",children:[x.jsx("thead",{children:x.jsxs("tr",{children:[x.jsx(An,{label:"Session",sortKey:"title",active:D,dir:H,onSort:ue,defaultDir:"asc"}),x.jsx("th",{children:"Source"}),x.jsx("th",{children:"Project"}),x.jsx(An,{label:"Turns",sortKey:"turns",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Tokens",sortKey:"tokens",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Cost",sortKey:"cost",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Duration",sortKey:"duration",active:D,dir:H,onSort:ue,className:"num"}),x.jsx(An,{label:"Started",sortKey:"started",active:D,dir:H,onSort:ue})]})}),x.jsx("tbody",{children:C.sessions.map(F=>{var ge;return x.jsxs("tr",{children:[x.jsxs("td",{children:[x.jsx(su,{to:`/session/${F.id}`,className:"title",children:F.title||x.jsx("span",{className:"muted",children:F.id.slice(0,12)})}),x.jsxs("div",{className:"sub",children:[F.is_sidechain?x.jsx("span",{className:"tag subagent",children:"subagent"}):null,(F.models??"").split(",").filter(Boolean).slice(0,3).map(ce=>x.jsx("span",{className:"tag",children:xc(ce)},ce))]})]}),x.jsx("td",{children:F.source_id}),x.jsx("td",{className:"path",children:((ge=F.project_path)==null?void 0:ge.replace(/^.*\//,""))??"—"}),x.jsx("td",{className:"num",children:F.turn_count}),x.jsx("td",{className:"num",title:vh(F.token_split),children:zr(F.tokens)}),x.jsx("td",{className:"num",title:"Estimated at API list prices (cache-aware)",children:mh(F.cost)}),x.jsx("td",{className:"num",children:hh(F.duration_ms)}),x.jsx("td",{children:gh(F.started_at)})]},F.id)})})]}),x.jsx(wh,{page:Ee,pages:Ne,total:C.total,unit:"sessions",onPage:F=>q("offset",String((F-1)*Xl))})]})}const kh=E.lazy(()=>Wn(()=>import("./Dashboard-5CwsbaWY.js"),[])),xh=E.lazy(()=>Wn(()=>import("./SessionView-BJywkNAY.js"),__vite__mapDeps([0,1,2,3]))),Eh=E.lazy(()=>Wn(()=>import("./WorkflowView-BQCMn0Uf.js"),__vite__mapDeps([4,1,3]))),Ch=E.lazy(()=>Wn(()=>import("./SkillsView-C4SyADuV.js"),[])),_h=E.lazy(()=>Wn(()=>import("./SkillView-BDENXN1E.js"),__vite__mapDeps([5,3]))),Ph=E.lazy(()=>Wn(()=>import("./SecurityView-DCWVNFf5.js"),__vite__mapDeps([6,2]))),Bn=()=>x.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}),Nh="/".replace(/\/$/,"");Zd.createRoot(document.getElementById("root")).render(x.jsx(Ec.StrictMode,{children:x.jsx(ch,{children:x.jsx(bp,{basename:Nh,children:x.jsx(Hp,{children:x.jsxs(Lt,{path:"/",element:x.jsx(ph,{}),children:[x.jsx(Lt,{index:!0,element:x.jsx(Sh,{})}),x.jsx(Lt,{path:"dashboard",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(kh,{})})}),x.jsx(Lt,{path:"session/:id",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(xh,{})})}),x.jsx(Lt,{path:"workflow/:run_id",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Eh,{})})}),x.jsx(Lt,{path:"skills",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Ch,{})})}),x.jsx(Lt,{path:"skill/:name",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(_h,{})})}),x.jsx(Lt,{path:"security",element:x.jsx(E.Suspense,{fallback:x.jsx(Bn,{}),children:x.jsx(Ph,{})})})]})})})})}));export{yh as F,su as L,wh as P,Ec as R,An as S,lh as a,Dc as b,jh as c,Tr as d,hh as e,mh as f,Vd as g,zr as h,Rh as i,x as j,hn as k,gh as l,Lh as m,zh as n,Th as o,au as p,sh as q,E as r,xc as s,vh as t,fh as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./index-
|
|
1
|
+
import{j as i}from"./index-dvmn2NT_.js";const n=["critical","high","medium","low","info"];function r({severity:s,count:a}){return i.jsxs("span",{className:"tag sev sev-"+s,children:[s,a!=null?` ${a}`:""]})}export{n as S,r as a};
|
package/web/index.html
CHANGED
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
document.documentElement.dataset.theme = "dark";
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
19
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
19
|
+
<script type="module" crossorigin src="/assets/index-dvmn2NT_.js"></script>
|
|
20
|
+
<link rel="stylesheet" crossorigin href="/assets/index-3w3Rb7sW.css">
|
|
21
21
|
</head>
|
|
22
22
|
<body>
|
|
23
23
|
<div id="root"></div>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as te,r as a,m as ie,d as N,o as p,j as e,F as ae,p as j,S as R,P as le,k as ne,L as re}from"./index-DTfBIYUK.js";import{S as ce,a as oe}from"./severity-DoLHU1bt.js";const E=50;function ge(){const[t,h]=te(),[i,l]=a.useState(null),[c,M]=a.useState({total:0,findings:[]}),[S,F]=a.useState([]),[H,V]=a.useState([]),[G,Q]=a.useState([]),[K,U]=a.useState(!0),[D,_]=a.useState(null),[f,I]=a.useState(!1),[w,q]=a.useState(1),[u,C]=a.useState(new Set),[T,J]=a.useState(0),{sort:r,toggle:P}=ie("severity","desc"),x=t.get("severity")??"",y=t.get("category")??"",b=t.get("rule")??"",L=t.get("session")??"",$=t.get("source")??"",A=t.get("project")??"",O=t.get("from")??"",W=t.get("to")??"",m=t.get("status")??"open",v=a.useMemo(()=>{const s=new URLSearchParams;for(const[n,d]of Object.entries({severity:x,category:y,rule:b,session:L,source:$,project:A,from:O,to:W,status:m}))d&&s.set(n,d);return s},[x,y,b,L,$,A,O,W,m]);a.useEffect(()=>{N("/sources").then(V).catch(()=>{}),N("/projects").then(Q).catch(()=>{})},[]),a.useEffect(()=>{N("/security/summary").then(l).catch(()=>{}),p||N("/security/mutes").then(F).catch(()=>{})},[T]),a.useEffect(()=>q(1),[v.toString(),r.key,r.dir]),a.useEffect(()=>C(new Set),[v.toString(),r.key,r.dir,w,T]),a.useEffect(()=>{U(!0),_(null);const s=new URLSearchParams(v);s.set("sort",r.key),s.set("dir",r.dir),s.set("limit",String(E)),s.set("offset",String((w-1)*E)),N("/security/findings?"+s.toString()).then(M).catch(n=>_(String(n))).finally(()=>U(!1))},[v,r.key,r.dir,w,T]);const o=a.useCallback(s=>{const n=new URLSearchParams(t);for(const[d,k]of Object.entries(s))k?n.set(d,k):n.delete(d);h(n)},[t,h]),g=a.useCallback(async s=>{I(!0),_(null);try{await s(),J(n=>n+1)}catch(n){_(String(n))}finally{I(!1)}},[]),X=a.useMemo(()=>new Map(((i==null?void 0:i.by_severity)??[]).map(s=>[s.severity,s.n])),[i]),B=a.useMemo(()=>((i==null?void 0:i.by_rule)??[]).filter(s=>!y||s.category===y),[i,y]),Y=Math.max(1,Math.ceil(c.total/E)),Z=[...v.keys()].some(s=>s!=="status")||m!=="open",z=c.findings.map(s=>s.id),ee=z.length>0&&z.every(s=>u.has(s)),se=s=>C(n=>{const d=new Set(n);return d.has(s)?d.delete(s):d.add(s),d});return e.jsxs("div",{children:[e.jsxs("div",{className:"detail-head",children:[e.jsx("h1",{children:"Security findings"}),e.jsxs("p",{className:"muted",style:{margin:"4px 0 0",maxWidth:760},children:["Risky operations the agent performed, flagged after the fact by deterministic rules over each tool call. Counts show ",e.jsx("strong",{children:"open"})," findings — mark benign ones safe or mute a noisy rule so a real one stands out. agent-lens is retrospective; it surfaces what ",e.jsx("em",{children:"happened"}),", it doesn't block."]})]}),p&&e.jsxs("div",{className:"demo-note",role:"note",children:["📦 This is a static demo over synthetic sessions. Browse the findings and reference below —"," ",e.jsx("strong",{children:"triage"})," (mark safe, mute rules) and live filtering run in the local app on your own data."]}),e.jsxs("div",{className:"kpi-row sev-kpis",role:"group","aria-label":"Open findings by severity",children:[e.jsxs("button",{type:"button",className:"kpi kpi-btn"+(x?"":" is-active"),onClick:()=>o({severity:""}),children:[e.jsx("div",{className:"kpi-label",children:"Open findings"}),e.jsx("div",{className:"kpi-value",children:(i==null?void 0:i.total)??"—"}),e.jsxs("div",{className:"kpi-sub",children:[(i==null?void 0:i.sessions_flagged)??0," sessions flagged"]})]}),ce.map(s=>e.jsxs("button",{type:"button",className:"kpi kpi-btn sev-kpi sev-"+s+(x===s?" is-active":""),onClick:()=>o({severity:x===s?"":s}),"aria-pressed":x===s,children:[e.jsx("div",{className:"kpi-label",children:s}),e.jsx("div",{className:"kpi-value",children:X.get(s)??0})]},s))]}),i&&(i.dismissed>0||i.muted>0)&&e.jsxs("div",{className:"triage-counts muted small",children:[e.jsxs("button",{type:"button",className:"linkish",onClick:()=>o({status:"dismissed",severity:""}),children:[i.dismissed," dismissed"]})," · ",e.jsxs("button",{type:"button",className:"linkish",onClick:()=>o({status:"muted",severity:""}),children:[i.muted," muted by rule"]})]}),e.jsxs("div",{className:"filters",children:[e.jsxs("select",{"aria-label":"Filter by status",value:m,onChange:s=>o({status:s.target.value}),children:[e.jsx("option",{value:"open",children:"open"}),e.jsx("option",{value:"dismissed",children:"dismissed"}),e.jsx("option",{value:"muted",children:"muted"}),e.jsx("option",{value:"all",children:"all"})]}),e.jsxs("select",{"aria-label":"Filter by category",value:y,onChange:s=>{const n=s.target.value,d=!b||B.some(k=>k.rule_id===b&&(!n||k.category===n));o({category:n,rule:d?b:""})},children:[e.jsx("option",{value:"",children:"all categories"}),((i==null?void 0:i.categories)??[]).map(s=>e.jsx("option",{value:s.key,children:s.title},s.key))]}),e.jsxs("select",{"aria-label":"Filter by rule",value:b,onChange:s=>o({rule:s.target.value}),children:[e.jsx("option",{value:"",children:"all rules"}),B.map(s=>e.jsxs("option",{value:s.rule_id,children:[s.rule_id," (",s.n,")"]},s.rule_id))]}),e.jsxs("select",{"aria-label":"Filter by source",value:$,onChange:s=>o({source:s.target.value}),children:[e.jsx("option",{value:"",children:"all sources"}),H.map(s=>e.jsx("option",{value:s.id,children:s.label},s.id))]}),e.jsx(ae,{ariaLabel:"Filter by project",searchPlaceholder:"Find project…",value:A,onChange:s=>o({project:s}),options:[{value:"",label:"all projects"},...G.map(s=>({value:s.id,label:s.path.replace(/^.*\//,"")}))]}),e.jsxs("label",{className:"ctl",children:["from ",e.jsx("input",{type:"date",value:O,onChange:s=>o({from:s.target.value})})]}),e.jsxs("label",{className:"ctl",children:["to ",e.jsx("input",{type:"date",value:W,onChange:s=>o({to:s.target.value})})]}),L&&e.jsxs("span",{className:"tag",style:{alignSelf:"center"},children:["session ",L.slice(0,8),"… ",e.jsx("button",{type:"button",className:"linkish",onClick:()=>o({session:""}),children:"✕"})]}),Z&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>h(new URLSearchParams),children:"clear filters"})]}),!p&&(u.size>0||m==="open"&&c.total>0)&&e.jsxs("div",{className:"triage-bar",role:"group","aria-label":"Triage actions",children:[u.size>0&&m!=="dismissed"&&e.jsxs("button",{type:"button",disabled:f,onClick:()=>g(()=>j("/security/dismiss",{ids:[...u]})),children:["✓ Mark ",u.size," safe"]}),u.size>0&&m==="dismissed"&&e.jsxs("button",{type:"button",disabled:f,onClick:()=>g(()=>j("/security/reopen",{ids:[...u]})),children:["↩ Reopen ",u.size]}),u.size>0&&e.jsx("button",{type:"button",className:"ghost",onClick:()=>C(new Set),children:"clear selection"}),m==="open"&&c.total>0&&e.jsxs("button",{type:"button",className:"ghost",disabled:f,onClick:()=>{confirm(`Dismiss all ${c.total} open findings matching the current filter as safe?`)&&g(()=>j("/security/dismiss-matching",{filter:Object.fromEntries(v)}))},title:"Mark every open finding matching the current filter as safe",children:["Dismiss all ",c.total," matching"]})]}),D&&e.jsx("div",{className:"error",role:"alert",children:D}),K?e.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"}):c.findings.length===0?e.jsx("div",{className:"muted pad",role:"status",children:i&&i.total===0&&m==="open"?"No open security findings — nothing risky is awaiting review.":"No findings match these filters."}):e.jsxs("table",{className:"sessions findings-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[!p&&e.jsx("th",{className:"check-col",children:e.jsx("input",{type:"checkbox","aria-label":"Select all on this page",checked:ee,onChange:s=>C(s.target.checked?new Set(z):new Set)})}),e.jsx(R,{label:"Severity",sortKey:"severity",active:r.key,dir:r.dir,onSort:P}),e.jsx("th",{children:"Finding"}),e.jsx(R,{label:"Category",sortKey:"category",active:r.key,dir:r.dir,onSort:P}),e.jsx("th",{children:"Evidence"}),e.jsx(R,{label:"When",sortKey:"time",active:r.key,dir:r.dir,onSort:P}),e.jsx(R,{label:"Session",sortKey:"session",active:r.key,dir:r.dir,onSort:P}),!p&&e.jsx("th",{children:"Actions"})]})}),e.jsx("tbody",{children:c.findings.map(s=>e.jsx(de,{f:s,selected:u.has(s.id),onToggle:()=>se(s.id),busy:f,onDismiss:()=>g(()=>j("/security/dismiss",{ids:[s.id]})),onReopen:()=>g(()=>j("/security/reopen",{ids:[s.id]})),onMute:()=>g(()=>j("/security/mute",{rule_id:s.rule_id,scope:"global"}))},s.id))})]}),!K&&c.total>E&&e.jsx(le,{page:w,pages:Y,total:c.total,unit:"findings",onPage:q}),!p&&S.length>0&&e.jsx(ue,{mutes:S,busy:f,onUnmute:s=>g(()=>j("/security/unmute",{rule_id:s.rule_id,scope:s.scope,scope_id:s.scope_id}))}),i&&i.categories.length>0&&e.jsx(he,{summary:i})]})}function de({f:t,selected:h,onToggle:i,busy:l,onDismiss:c,onReopen:M,onMute:S}){const F=`/session/${t.session_id}${t.event_uuid?`#ev-${t.event_uuid}`:""}`;return e.jsxs("tr",{className:t.dismissed?"is-dismissed":"",children:[!p&&e.jsx("td",{className:"check-col",children:e.jsx("input",{type:"checkbox","aria-label":"Select finding",checked:h,onChange:i})}),e.jsxs("td",{children:[e.jsx(oe,{severity:t.severity}),t.dismissed?e.jsx("span",{className:"tag",style:{marginLeft:4},title:t.dismiss_note??"",children:"safe"}):null]}),e.jsxs("td",{children:[e.jsx("div",{className:"finding-title",children:t.title??t.rule_id}),e.jsxs("div",{className:"muted small",children:[e.jsx("code",{children:t.rule_id}),t.framework_ref&&e.jsx("span",{className:"tag framework",style:{marginLeft:6},children:t.framework_ref})]})]}),e.jsx("td",{className:"small",children:t.category}),e.jsxs("td",{className:"finding-evidence-cell",children:[t.tool_name&&e.jsx("span",{className:"tag tool-tag",title:"Tool the finding fired on",children:t.tool_name}),e.jsx("code",{title:t.evidence??"",children:t.evidence})]}),e.jsx("td",{className:"small muted",title:t.started_at??"",children:ne(t.started_at??null)}),e.jsxs("td",{className:"small",children:[e.jsx(re,{to:F,className:"title",children:t.session_title||t.session_id.slice(0,12)}),t.is_sidechain?e.jsx("span",{className:"tag subagent",style:{marginLeft:6},children:"subagent"}):null,t.project_path&&e.jsx("div",{className:"muted path",children:t.project_path.replace(/^.*\//,"")})]}),!p&&e.jsxs("td",{className:"finding-actions small",children:[t.dismissed?e.jsx("button",{type:"button",className:"linkish",disabled:l,onClick:M,children:"reopen"}):e.jsx("button",{type:"button",className:"linkish",disabled:l,onClick:c,children:"safe"}),e.jsx("button",{type:"button",className:"linkish",disabled:l,onClick:S,title:`Mute rule ${t.rule_id} everywhere`,children:"mute rule"})]})]})}function ue({mutes:t,busy:h,onUnmute:i}){return e.jsxs("details",{className:"card muted-rules",children:[e.jsx("summary",{children:e.jsxs("span",{className:"sec-ref-title",children:["Muted rules (",t.length,")"]})}),e.jsx("ul",{className:"muted-rules-list",children:t.map(l=>e.jsxs("li",{children:[e.jsx("code",{children:l.rule_id}),e.jsxs("span",{className:"tag",style:{marginLeft:6},children:[l.scope,l.scope_id?`: ${l.scope_id}`:""]}),l.note&&e.jsx("span",{className:"muted small",style:{marginLeft:6},children:l.note}),e.jsx("button",{type:"button",className:"linkish",style:{marginLeft:8},disabled:h,onClick:()=>i(l),children:"unmute"})]},`${l.rule_id}:${l.scope}:${l.scope_id}`))})]})}function he({summary:t}){const h=new Map(t.by_category.map(i=>[i.category,i.n]));return e.jsxs("section",{className:"sec-reference",children:[e.jsx("h2",{children:"Risk categories"}),e.jsx("p",{className:"muted small",style:{marginTop:0},children:"What each category means and why it matters, anchored to OWASP Top 10 for Agentic Apps and MITRE ATLAS."}),e.jsx("div",{className:"sec-ref-grid",children:t.categories.map(i=>e.jsxs("details",{className:"card sec-ref",children:[e.jsxs("summary",{children:[e.jsx("span",{className:"sec-ref-title",children:i.title}),e.jsxs("a",{className:"tag framework",href:i.framework_url,target:"_blank",rel:"noreferrer",onClick:l=>l.stopPropagation(),children:[i.framework_ref," ↗"]}),e.jsxs("span",{className:"muted small",children:[h.get(i.key)??0," open"]})]}),e.jsxs("dl",{className:"sec-ref-body",children:[e.jsx("dt",{children:"What"}),e.jsx("dd",{children:i.what}),e.jsx("dt",{children:"Why it matters"}),e.jsx("dd",{children:i.why}),e.jsx("dt",{children:"What to do"}),e.jsx("dd",{children:i.remediation})]})]},i.key))})]})}export{ge as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import{i as Z,r as m,d as ss,j as s,L as _,h as B,t as es,f as A,e as C,k as L,l as ns,s as R}from"./index-DTfBIYUK.js";import{C as y,p as k}from"./CopyButton-WFGbfzdo.js";import{S as I,a as J}from"./severity-DoLHU1bt.js";import{M as ts,r as as}from"./index-CnYz-f0y.js";const P=m.createContext("markdown"),H=m.createContext(new Map),U=m.createContext(!1),W="agentlens.msgFormat";function ls(){try{return localStorage.getItem(W)==="raw"?"raw":"markdown"}catch{return"markdown"}}const D="agentlens.hideTools";function is(){try{return localStorage.getItem(D)==="1"}catch{return!1}}function rs({c:e}){var o;const[n,t]=m.useState(!1),l=m.useId(),a=(o=e.signals)==null?void 0:o.loc;return s.jsxs("div",{className:"classification",children:[s.jsx("span",{className:"tag cat cat-"+(e.category??"none"),children:e.category??"unclassified"}),e.complexity_band&&s.jsxs("span",{className:"tag complexity",children:[e.complexity_band," · ",e.complexity_score]}),a&&s.jsxs("span",{className:"muted small",children:["+",a.added,"/−",a.removed," LoC · ",a.files," files"]}),s.jsxs("button",{className:"ghost small","aria-expanded":n,"aria-controls":l,onClick:()=>t(r=>!r),children:["why ",n?"▾":"▸"]}),n&&(e.signals?s.jsx(cs,{id:l,s:e.signals,category:e.category}):s.jsx("div",{id:l,className:"muted small pad",children:"No signals recorded for this session."}))]})}const os={loc:"Lines changed",files:"Files touched",turns:"Turns",tokens:"Work tokens",duration:"Duration",subagents:"Subagents"},M=e=>`${Math.max(0,Math.min(1,e))*100}%`;function E({counts:e}){const n=Object.entries(e).sort((t,l)=>l[1]-t[1]);return n.length===0?s.jsx("span",{className:"muted",children:"—"}):s.jsx("span",{className:"sig-chips",children:n.map(([t,l])=>s.jsxs("span",{className:"sig-chip",children:[t," ",s.jsxs("span",{className:"muted",children:["×",l]})]},t))})}function cs({id:e,s:n,category:t}){const[l,a]=m.useState(!1),o=m.useId(),r=n.complexity_weights??{},i=n.complexity_subscores??{},d=Object.keys(r).map(c=>({key:c,weight:r[c],subscore:i[c]??0,pts:r[c]*(i[c]??0)*100})).sort((c,g)=>g.pts-c.pts),u=Math.max(...d.map(c=>c.pts),1e-4),x=Object.entries(n.category_scores??{}).map(([c,g])=>({k:c,v:g})).sort((c,g)=>g.v-c.v),j=Math.max(...x.map(c=>c.v),1e-4),h=x.filter(c=>c.v>.02||c.k===t),f=n.skills&&Object.keys(n.skills).length>0;return s.jsxs("div",{id:e,className:"signals-panel",children:[d.length>0&&s.jsxs("section",{className:"sig-section",children:[s.jsxs("h4",{className:"sig-h",children:["Complexity breakdown ",s.jsx("span",{className:"muted",children:"— what built the score"})]}),s.jsx("ul",{className:"sig-bars",children:d.map(c=>s.jsxs("li",{className:"sig-bar-row",children:[s.jsx("span",{className:"sig-bar-label",children:os[c.key]??c.key}),s.jsx("span",{className:"sig-bar","aria-hidden":"true",children:s.jsx("span",{className:"sig-bar-fill",style:{width:M(c.pts/u)}})}),s.jsxs("span",{className:"sig-bar-val",children:[c.pts.toFixed(1)," pts"]}),s.jsxs("span",{className:"sig-bar-sub muted",children:[Math.round(c.subscore*100),"% intensity · weight ",Math.round(c.weight*100),"%"]})]},c.key))})]}),h.length>0&&s.jsxs("section",{className:"sig-section",children:[s.jsxs("h4",{className:"sig-h",children:["Category scores ",s.jsxs("span",{className:"muted",children:["— why “",t,"” won"]})]}),s.jsx("ul",{className:"sig-bars",children:h.map(c=>s.jsxs("li",{className:"sig-bar-row"+(c.k===t?" is-win":""),children:[s.jsx("span",{className:"sig-bar-label",children:c.k}),s.jsx("span",{className:"sig-bar","aria-hidden":"true",children:s.jsx("span",{className:"sig-bar-fill",style:{width:M(c.v/j)}})}),s.jsx("span",{className:"sig-bar-val",children:c.v.toFixed(2)})]},c.k))})]}),s.jsxs("section",{className:"sig-section",children:[s.jsx("h4",{className:"sig-h",children:"Evidence"}),s.jsxs("dl",{className:"sig-grid",children:[n.tool_counts&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Tools"}),s.jsx("dd",{children:s.jsx(E,{counts:n.tool_counts})})]}),f&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Skills"}),s.jsx("dd",{children:s.jsx(E,{counts:n.skills})})]}),n.subagent_role&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Subagent role"}),s.jsx("dd",{children:n.subagent_role})]}),n.files&&n.files.length>0&&s.jsxs(s.Fragment,{children:[s.jsxs("dt",{children:["Files (",n.files.length,")"]}),s.jsx("dd",{className:"sig-files",children:n.files.join(", ")})]})]})]}),s.jsx("button",{className:"ghost small","aria-expanded":l,"aria-controls":o,onClick:()=>a(c=>!c),children:l?"Hide raw JSON ▴":"View raw JSON ▾"}),l&&s.jsx("pre",{id:o,className:"code signals",children:JSON.stringify(n,null,2)})]})}function ds({f:e}){var r;const[n,t]=m.useState(!1),l=m.useId(),a=((r=e.signals)==null?void 0:r.modifiers)??{},o=Object.keys(a).filter(i=>a[i]!==!1&&a[i]!=null&&a[i]!=="");return s.jsxs("div",{className:"finding sev-border-"+e.severity,children:[s.jsxs("button",{className:"finding-head","aria-expanded":n,"aria-controls":l,onClick:()=>t(i=>!i),children:[s.jsx(J,{severity:e.severity}),s.jsx("span",{className:"finding-title",children:e.title??e.rule_id}),e.framework_ref&&s.jsx("span",{className:"tag framework",children:e.framework_ref}),s.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),n&&s.jsxs("div",{className:"finding-body",id:l,children:[e.evidence&&s.jsx("div",{className:"code-block",children:s.jsx("pre",{className:"code finding-evidence",children:e.evidence})}),s.jsxs("dl",{className:"sig-grid",children:[s.jsx("dt",{children:"Rule"}),s.jsx("dd",{children:s.jsx("code",{children:e.rule_id})}),s.jsx("dt",{children:"Category"}),s.jsx("dd",{children:e.category}),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"Context"}),s.jsx("dd",{children:o.map(i=>s.jsxs("span",{className:"sig-chip",children:[i,a[i]!==!0?s.jsxs("span",{className:"muted",children:[" ",String(a[i])]}):null]},i))})]})]}),s.jsxs(_,{className:"subagent-link small",to:`/security?rule=${encodeURIComponent(e.rule_id)}`,children:["see all “",e.rule_id,"” findings →"]})]})]})}function us({findings:e}){if(!e.length)return null;const n=[...e].sort((t,l)=>I.indexOf(t.severity)-I.indexOf(l.severity));return s.jsx("div",{className:"tool-findings",children:n.map(t=>s.jsx(ds,{f:t},t.id))})}function ms({findings:e,sessionId:n}){const t=new Map;for(const a of e)t.set(a.severity,(t.get(a.severity)??0)+1);const l=I.find(a=>t.has(a))??"info";return s.jsxs("div",{className:"security-banner sev-border-"+l,role:"status",children:[s.jsx("span",{className:"security-banner-icon","aria-hidden":"true",children:"🛡"}),s.jsxs("span",{className:"security-banner-text",children:[e.length," security ",e.length===1?"finding":"findings"," in this session"]}),s.jsx("span",{className:"security-banner-sevs",children:I.filter(a=>t.has(a)).map(a=>s.jsx(J,{severity:a,count:t.get(a)},a))}),s.jsx(_,{className:"subagent-link small",to:`/security?session=${encodeURIComponent(n)}`,children:"view on Security page →"})]})}function Q({t:e}){const[n,t]=m.useState(!1),[l,a]=m.useState(!1),o=m.useId(),r=e.skill_name?`Skill · ${e.skill_name}`:e.tool_name==="Workflow"&&e.workflow_name?`Workflow · ${e.workflow_name}`:e.agent_type?`${e.tool_name} → ${e.agent_type}`:e.tool_name;return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":n,"aria-controls":o,onClick:()=>t(i=>!i),children:[s.jsxs("span",{className:"tool-name",children:["🔧 ",r]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:n?"▾":"▸"})]}),e.spawned_session_id&&s.jsx(_,{className:"subagent-link small",to:`/session/${e.spawned_session_id}`,children:"view subagent transcript →"}),e.workflow_run_id&&s.jsxs(_,{className:"subagent-link small",to:`/workflow/${e.workflow_run_id}`,children:["🔀 launched ",e.workflow_agent_count??0," agent",e.workflow_agent_count===1?"":"s"," · ",s.jsx("code",{children:e.workflow_run_id})," →"]}),e.skill_name&&s.jsxs(_,{className:"subagent-link small",to:`/skill/${encodeURIComponent(e.skill_name)}${e.skill_id?`?v=${e.skill_id}`:""}`,children:["📖 view skill",e.skill_id?" version":""," →"]}),n&&s.jsxs("div",{className:"tool-body",id:o,children:[e.input_json&&e.input_json!=="{}"&&s.jsxs("div",{className:"code-block",children:[s.jsx(y,{text:k(e.input_json),className:"copy-corner",title:"Copy tool input JSON"}),s.jsx("pre",{className:"code",children:k(e.input_json)})]}),e.result_summary&&s.jsx("div",{className:"result",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":l,onClick:()=>a(i=>!i),children:[l?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),l&&s.jsxs("div",{className:"code-block",children:[s.jsx(y,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]})]})]})}function V(e){if(!e)return null;try{const n=JSON.parse(e).plan;return typeof n=="string"&&n.trim()?n:null}catch{return null}}function hs({plan:e}){return s.jsxs("div",{className:"plan-card",children:[s.jsx("div",{className:"plan-card-head",children:"📋 Approved plan"}),s.jsx(z,{text:e})]})}function ps(e){if(!e)return[];try{const n=JSON.parse(e).questions;return Array.isArray(n)?n:[]}catch{return[]}}function xs(e){if(!e)return{answers:{},annotations:{}};try{const n=JSON.parse(e);if(n&&typeof n=="object"&&n.answers)return{answers:n.answers,annotations:n.annotations??{}}}catch{}return{answers:{},annotations:{}}}function js({t:e}){const[n,t]=m.useState(!1),l=m.useId(),a=ps(e.input_json),{answers:o,annotations:r}=xs(e.result_summary);return a.length===0?s.jsx(Q,{t:e}):s.jsxs("div",{className:"qa-card",children:[s.jsxs("div",{className:"qa-card-head",children:["🙋 Question",a.length===1?"":"s"," for the user"]}),a.map((i,d)=>{var g;const u=o[i.question],x=Array.isArray(u)?u:u!=null?[u]:[],j=new Set(x),h=new Set(i.options.map(N=>N.label)),f=x.filter(N=>!h.has(N)),c=(g=r[i.question])==null?void 0:g.notes;return s.jsxs("div",{className:"qa-q",children:[s.jsxs("div",{className:"qa-q-head",children:[i.header&&s.jsx("span",{className:"tag",children:i.header}),i.multiSelect&&s.jsx("span",{className:"muted small",children:"multi-select"})]}),s.jsx("div",{className:"qa-question",children:i.question}),s.jsxs("ul",{className:"qa-options",children:[i.options.map((N,b)=>{const S=j.has(N.label);return s.jsxs("li",{className:"qa-opt"+(S?" is-selected":""),children:[s.jsx("span",{className:"qa-mark","aria-hidden":"true",children:S?"☑":"☐"}),s.jsxs("span",{className:"qa-opt-body",children:[s.jsx("span",{className:"qa-opt-label",children:N.label}),N.description&&s.jsx("span",{className:"qa-opt-desc muted",children:N.description})]})]},b)}),f.map((N,b)=>s.jsxs("li",{className:"qa-opt is-selected",children:[s.jsx("span",{className:"qa-mark","aria-hidden":"true",children:"☑"}),s.jsxs("span",{className:"qa-opt-body",children:[s.jsx("span",{className:"qa-opt-label",children:N}),s.jsx("span",{className:"qa-opt-desc muted",children:"custom answer"})]})]},"c"+b))]}),c&&s.jsxs("div",{className:"qa-note",children:["📝 ",c]})]},d)}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":n,"aria-controls":l,onClick:()=>t(i=>!i),children:n?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(y,{text:k(e.input_json??"{}")+(e.result_summary?`
|
|
2
|
-
|
|
3
|
-
`+k(e.result_summary):""),label:"JSON",title:"Copy raw question JSON"})]}),n&&s.jsxs("pre",{id:l,className:"code",children:[k(e.input_json??"{}"),e.result_summary?`
|
|
4
|
-
|
|
5
|
-
`+k(e.result_summary):""]})]})}function fs({t:e}){const n=e.workflow_name?`Workflow · ${e.workflow_name}`:"Workflow";return s.jsxs("div",{className:"tool launch-tool",children:[s.jsxs("div",{className:"launch-tool-head",children:[s.jsxs("span",{className:"tool-name",children:["🔀 ",n]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status})]}),e.workflow_run_id&&s.jsxs(_,{className:"subagent-link small",to:`/workflow/${e.workflow_run_id}`,children:["🔀 launched ",e.workflow_agent_count??0," agent",e.workflow_agent_count===1?"":"s"," · ",s.jsx("code",{children:e.workflow_run_id})," →"]}),e.result_summary&&s.jsx("div",{className:"result",children:e.result_summary})]})}function gs(e){if(!e)return null;try{const n=JSON.parse(e);if(!n||typeof n!="object")return null;const t=typeof n.command=="string"?n.command:"";return t.trim()?{command:t,description:typeof n.description=="string"?n.description:void 0,timeout:typeof n.timeout=="number"?n.timeout:void 0,run_in_background:n.run_in_background===!0,restart:n.restart===!0}:null}catch{return null}}function $(e,n,t){let l=n+2,a=!1;for(e[l]==="-"&&(a=!0,l++);e[l]===" "||e[l]===" ";)l++;let o="";(e[l]==="'"||e[l]==='"')&&(o=e[l],l++);let r="";if(o){for(;l<e.length&&e[l]!==o;)r+=e[l++];e[l]===o&&l++}else for(;l<e.length&&/[A-Za-z0-9_]/.test(e[l]);)r+=e[l++];return r&&t.push({delim:r,strip:a}),l-1}function Ns(e){const n=e.split(`
|
|
6
|
-
`),t=[];let l="NORMAL",a=0;const o=[];let r=!1;for(const i of n){if(o.length>0){t.push({text:i,cont:!0});const d=o[0];(d.strip?i.replace(/^\t+/,""):i).trimEnd()===d.delim&&o.shift();continue}t.push({text:i,cont:l!=="NORMAL"||a>0||r}),r=!1;for(let d=0;d<i.length;d++){const u=i[d];if(l==="SQUOTE"){u==="'"&&(l="NORMAL");continue}if(l==="DQUOTE"){u==="\\"?d++:u==='"'?l="NORMAL":u==="$"&&i[d+1]==="("?(a++,d++):u===")"?a>0&&a--:u==="<"&&i[d+1]==="<"&&i[d+2]!=="<"&&(d=$(i,d,o));continue}if(u==="\\")d++;else if(u==="'")l="SQUOTE";else if(u==='"')l="DQUOTE";else{if(u==="#"&&(d===0||/\s/.test(i[d-1])))break;u==="$"&&i[d+1]==="("?(a++,d++):u==="("?a++:u===")"?a>0&&a--:u==="<"&&i[d+1]==="<"&&i[d+2]!=="<"&&(d=$(i,d,o))}}if(l==="NORMAL"&&a===0&&o.length===0){const d=i.replace(/\s+$/,""),u=d.match(/\\+$/);(u&&u[0].length%2===1||/(&&|\|\||\|)$/.test(d))&&(r=!0)}}return t}function ws({t:e,bash:n}){const[t,l]=m.useState(!1),[a,o]=m.useState(!1),[r,i]=m.useState(!1),d=m.useId(),u=m.useId(),x=n.command.split(`
|
|
7
|
-
`)[0],j=Ns(n.command);return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":t,"aria-controls":d,onClick:()=>l(h=>!h),children:[s.jsx("span",{className:"tool-name",children:"🖥 Bash"}),n.description?s.jsxs("span",{className:"bash-desc",children:["# ",n.description]}):!t&&s.jsx("span",{className:"bash-preview",children:x}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:t?"▾":"▸"})]}),t&&s.jsxs("div",{className:"tool-body",id:d,children:[s.jsxs("div",{className:"shell code-block",children:[s.jsx(y,{text:n.command,className:"copy-corner",title:"Copy command"}),s.jsx("pre",{className:"shell-cmd",children:j.map((h,f)=>s.jsxs("span",{children:[s.jsx("span",{className:"shell-gutter"+(h.cont?" cont":""),"aria-hidden":"true",children:h.cont?" ":"$ "}),h.text,f<j.length-1?`
|
|
8
|
-
`:""]},f))})]}),(n.run_in_background||n.restart||n.timeout!=null)&&s.jsxs("div",{className:"bash-badges",children:[n.run_in_background&&s.jsx("span",{className:"bash-badge",children:"background"}),n.restart&&s.jsx("span",{className:"bash-badge",children:"restart"}),n.timeout!=null&&s.jsxs("span",{className:"bash-badge",children:["timeout ",Math.round(n.timeout/1e3),"s"]})]}),e.result_summary&&s.jsx("pre",{className:"shell-out",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":a,onClick:()=>o(h=>!h),children:[a?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),a&&s.jsxs("div",{className:"code-block",children:[s.jsx(y,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":r,"aria-controls":u,onClick:()=>i(h=>!h),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(y,{text:k(e.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),r&&s.jsx("pre",{id:u,className:"code",children:k(e.input_json??"{}")})]})]})}function F(e,n){const t=e===""?[]:e.split(`
|
|
9
|
-
`),l=n===""?[]:n.split(`
|
|
10
|
-
`),a=t.length,o=l.length;if(a*o>25e4)return[...t.map(x=>({type:"del",text:x})),...l.map(x=>({type:"add",text:x}))];const r=Array.from({length:a+1},()=>new Array(o+1).fill(0));for(let x=a-1;x>=0;x--)for(let j=o-1;j>=0;j--)r[x][j]=t[x]===l[j]?r[x+1][j+1]+1:Math.max(r[x+1][j],r[x][j+1]);const i=[];let d=0,u=0;for(;d<a&&u<o;)t[d]===l[u]?(i.push({type:"ctx",text:t[d]}),d++,u++):r[d+1][u]>=r[d][u+1]?(i.push({type:"del",text:t[d]}),d++):(i.push({type:"add",text:l[u]}),u++);for(;d<a;)i.push({type:"del",text:t[d++]});for(;u<o;)i.push({type:"add",text:l[u++]});return i}function _s(e,n){if(!n)return null;try{const t=JSON.parse(n);if(!t||typeof t!="object"||typeof t.file_path!="string")return null;let l;if(e==="Write"){if(typeof t.content!="string")return null;l=[t.content===""?[]:t.content.split(`
|
|
11
|
-
`).map(r=>({type:"add",text:r}))]}else if(e==="MultiEdit"){if(!Array.isArray(t.edits)||(l=t.edits.filter(r=>{const i=r;return!!i&&typeof i.old_string=="string"&&typeof i.new_string=="string"}).map(r=>F(r.old_string,r.new_string)),l.length===0))return null}else{if(typeof t.old_string!="string"||typeof t.new_string!="string")return null;l=[F(t.old_string,t.new_string)]}let a=0,o=0;for(const r of l)for(const i of r)i.type==="add"?a++:i.type==="del"&&o++;return{file_path:t.file_path,kind:e,hunks:l,adds:a,dels:o}}catch{return null}}function ks(e){const n=e.lastIndexOf("/");return n>=0?{dir:e.slice(0,n+1),base:e.slice(n+1)}:{dir:"",base:e}}const ys={Edit:"✏️",MultiEdit:"✏️",Write:"📄"},O=400;function bs({t:e,edit:n}){const[t,l]=m.useState(!1),[a,o]=m.useState(!1),[r,i]=m.useState(!1),d=m.useId(),u=m.useId(),{dir:x,base:j}=ks(n.file_path);return s.jsxs("div",{className:"tool "+(e.status==="error"?"tool-err":""),children:[s.jsxs("button",{className:"tool-head","aria-expanded":t,"aria-controls":d,onClick:()=>l(h=>!h),children:[s.jsxs("span",{className:"tool-name",children:[ys[n.kind]??"✏️"," ",n.kind]}),s.jsxs("span",{className:"edit-path",children:[s.jsx("span",{className:"base",children:j}),x&&s.jsx("span",{className:"dir",children:x.replace(/\/$/,"")})]}),s.jsxs("span",{className:"diff-stat",children:[n.adds>0&&s.jsxs("span",{className:"add",children:["+",n.adds]}),n.dels>0&&s.jsxs("span",{className:"del",children:["−",n.dels]})]}),e.status&&s.jsx("span",{className:"tool-status",children:e.status}),e.total_duration_ms?s.jsx("span",{className:"muted",children:C(e.total_duration_ms)}):null,s.jsx("span",{className:"chev",children:t?"▾":"▸"})]}),t&&s.jsxs("div",{className:"tool-body",id:d,children:[n.hunks.map((h,f)=>s.jsxs("div",{className:"diff",children:[n.hunks.length>1&&s.jsxs("div",{className:"diff-hunk-sep",children:["edit ",f+1]}),h.slice(0,O).map((c,g)=>s.jsxs("div",{className:"diff-line "+c.type,children:[s.jsx("span",{className:"diff-sign","aria-hidden":"true",children:c.type==="add"?"+":c.type==="del"?"−":" "}),s.jsx("span",{className:"diff-text",children:c.text===""?" ":c.text})]},g)),h.length>O&&s.jsxs("div",{className:"diff-more",children:["… ",h.length-O," more lines — View raw JSON for the rest"]})]},f)),e.result_summary&&s.jsx("pre",{className:"shell-out",children:e.result_summary}),e.full_result&&s.jsxs("div",{className:"full-result",children:[s.jsxs("button",{type:"button",className:"ghost small show-full","aria-expanded":a,onClick:()=>o(h=>!h),children:[a?"Hide":"Show"," full result (",(e.full_result.bytes/1024).toFixed(1)," KB)"]}),a&&s.jsxs("div",{className:"code-block",children:[s.jsx(y,{text:e.full_result.text,className:"copy-corner",title:"Copy full tool result"}),s.jsx("pre",{className:"code",children:e.full_result.text})]})]}),s.jsxs("div",{className:"launch-actions",children:[s.jsx("button",{className:"ghost small","aria-expanded":r,"aria-controls":u,onClick:()=>i(h=>!h),children:r?"Hide raw JSON ▴":"View raw JSON ▾"}),s.jsx(y,{text:k(e.input_json??"{}"),label:"JSON",title:"Copy raw tool input JSON"})]}),r&&s.jsx("pre",{id:u,className:"code",children:k(e.input_json??"{}")})]})]})}function vs({t:e,hideTools:n}){const t=e.findings??[],l=n&&t.length===0,a=Ss(e,l);return t.length===0?a:s.jsxs(s.Fragment,{children:[a,s.jsx(us,{findings:t})]})}function Ss(e,n){if(e.tool_name==="ExitPlanMode"){const t=V(e.input_json);if(t)return s.jsx(hs,{plan:t})}if(e.tool_name==="AskUserQuestion")return s.jsx(js,{t:e});if(e.tool_name==="Workflow")return s.jsx(fs,{t:e});if(e.tool_name==="Bash"){const t=gs(e.input_json);if(t)return n?null:s.jsx(ws,{t:e,bash:t})}if(e.tool_name==="Edit"||e.tool_name==="MultiEdit"||e.tool_name==="Write"){const t=_s(e.tool_name,e.input_json);if(t)return n?null:s.jsx(bs,{t:e,edit:t})}return n?null:s.jsx(Q,{t:e})}function Cs(e,n){return e.findings&&e.findings.length||e.tool_name==="AskUserQuestion"||e.tool_name==="Workflow"||e.tool_name==="ExitPlanMode"&&V(e.input_json)?!0:!n}function K(e){var l,a,o,r,i;const n=(a=(l=e.match(/<command-name>([^<]*)<\/command-name>/))==null?void 0:l[1])==null?void 0:a.trim();if(n){const d=((r=(o=e.match(/<command-args>([^<]*)<\/command-args>/))==null?void 0:o[1])==null?void 0:r.trim())??"";return{kind:"invocation",name:n.startsWith("/")?n:`/${n}`,args:d}}const t=(i=e.match(/<(?:local-command-stdout|command-output|local-command-stderr)>([\s\S]*?)<\/(?:local-command-stdout|command-output|local-command-stderr)>/))==null?void 0:i[1];return t!=null?{kind:"output",stdout:t.trim()}:/<local-command-caveat>/.test(e)?{kind:"caveat"}:null}function Is({cmd:e}){return e.kind==="invocation"?s.jsxs("div",{className:"cmd",children:[s.jsxs("span",{className:"cmd-chip",title:"Slash command",children:["⌘ ",e.name]}),e.args&&s.jsx("code",{className:"cmd-args",children:e.args})]}):e.kind==="output"?s.jsx("div",{className:"cmd-out",children:e.stdout&&e.stdout!=="(no content)"?e.stdout:s.jsx("span",{className:"muted",children:"no output"})}):s.jsx("div",{className:"cmd-note muted small",children:"⌘ local command context"})}function Y(e){if(!/<task-notification>/.test(e))return null;const n=t=>{var l,a;return((a=(l=e.match(new RegExp(`<${t}>([\\s\\S]*?)</${t}>`)))==null?void 0:l[1])==null?void 0:a.trim())??null};return{taskId:n("task-id"),toolUseId:n("tool-use-id"),status:n("status"),summary:n("summary")}}function Os({n:e}){const n=m.useContext(H),t=e.toolUseId?n.get(e.toolUseId):void 0,l=(e.status??"").toLowerCase();return s.jsxs("div",{className:"task-notif",children:[s.jsxs("div",{className:"task-notif-head",children:[s.jsx("span",{className:"task-notif-icon","aria-hidden":"true",children:"🔔"}),e.status&&s.jsx("span",{className:"tag task-status task-status-"+l,children:e.status}),e.taskId&&s.jsxs("code",{className:"task-notif-id",children:["task ",e.taskId]}),t&&s.jsx(_,{className:"subagent-link small",to:`/workflow/${t}`,children:"view workflow →"})]}),e.summary&&s.jsx("div",{className:"task-notif-summary",children:e.summary})]})}function q({text:e,id:n}){return m.useContext(P)==="raw"?s.jsx("div",{className:"text",id:n,children:e}):s.jsx("div",{className:"text md",id:n,children:s.jsx(ts,{remarkPlugins:[as],components:Ts,children:e})})}const Ts={a:({node:e,...n})=>s.jsx("a",{...n,target:"_blank",rel:"noopener noreferrer"})};function z({text:e}){const n=e.length>1400||e.split(`
|
|
12
|
-
`).length>18,[t,l]=m.useState(!1),a=m.useId();return n?s.jsxs("div",{className:"text-wrap"+(t?"":" is-clamped"),children:[s.jsx(q,{text:e,id:a}),s.jsx("button",{className:"ghost small show-more","aria-expanded":t,"aria-controls":a,onClick:()=>l(o=>!o),children:t?"Show less ▴":"Show more ▾"})]}):s.jsx(q,{text:e})}function Ms(e,n){const t=new Map(n.map(a=>[a.id,a])),l=[];for(const a of e){const o=a.turn_id??null,r=l[l.length-1];r&&r.turnId===o?r.events.push(a):l.push({turnId:o,turn:o?t.get(o)??null:null,events:[a]})}return l}function Es(e){const n=K(e);if((n==null?void 0:n.kind)==="invocation")return`⌘ ${n.name}${n.args?" "+n.args:""}`;if((n==null?void 0:n.kind)==="output")return"⌘ command output";if((n==null?void 0:n.kind)==="caveat")return"⌘ local command";const t=Y(e);return t?`🔔 task ${t.status??"notification"}`:e}function $s({turn:e,events:n,open:t,onToggle:l}){const a=m.useId();return s.jsxs("section",{className:"turn"+(t?" is-open":""),children:[s.jsxs("button",{className:"turn-head","aria-expanded":t,"aria-controls":a,onClick:l,children:[s.jsx("span",{className:"chev turn-chev","aria-hidden":"true",children:t?"▾":"▸"}),s.jsxs("span",{className:"turn-no",children:["turn ",e.seq+1]}),e.prompt_preview?s.jsx("span",{className:"turn-preview",children:Es(e.prompt_preview)}):null,s.jsxs("span",{className:"turn-stats muted",children:[n.length," msg",n.length===1?"":"s",e.duration_ms?" · "+C(e.duration_ms):""]})]}),s.jsx("div",{id:a,className:"turn-body",role:"region","aria-label":`turn ${e.seq+1} messages`,children:t&&n.map(o=>s.jsx(G,{e:o},o.uuid))})]})}function G({e}){const[n,t]=m.useState(!1),l=m.useId(),a=m.useContext(U),o=e.role||e.type,r=o==="user"?"👤":o==="assistant"?"🤖":"⚙️",i=e.toolCalls.filter(h=>Cs(h,a));if(!(e.text||e.thinking||i.length))return null;const u=e.text?K(e.text):null,x=e.text&&!u?Y(e.text):null,j=e.text||e.thinking||"";return s.jsxs("div",{className:"event ev-"+o,children:[s.jsxs("div",{className:"ev-meta",children:[s.jsxs("span",{className:"ev-who",children:[r," ",o]}),e.model&&s.jsx("span",{className:"tag",children:R(e.model)}),e.is_sidechain?s.jsx("span",{className:"tag subagent",children:"subagent"}):null,s.jsx("span",{className:"muted ev-time",children:L(e.timestamp)}),j&&s.jsx(y,{text:j,className:"ev-copy copy-hover",title:"Copy message"})]}),e.thinking&&s.jsxs("div",{className:"thinking",children:[s.jsxs("button",{className:"thinking-toggle","aria-expanded":n,"aria-controls":l,onClick:()=>t(h=>!h),children:["🧠 thinking ",n?"▾":"▸"]}),n&&s.jsxs("div",{className:"code-block",children:[s.jsx(y,{text:e.thinking,className:"copy-corner",title:"Copy thinking"}),s.jsx("pre",{id:l,className:"thinking-body",children:e.thinking})]})]}),e.text&&(u?s.jsx(Is,{cmd:u}):x?s.jsx(Os,{n:x}):s.jsx(z,{text:e.text})),i.map((h,f)=>s.jsx(vs,{t:h,hideTools:a},f))]})}function T({c:e}){const n=e.agent_description||e.title||e.id.slice(0,12);return s.jsxs("li",{children:[s.jsx(_,{to:`/session/${e.id}`,children:n}),e.agent_type&&s.jsx("span",{className:"tag subagent meta-type",children:e.agent_type}),e.spawn_depth!=null&&e.spawn_depth>1&&s.jsxs("span",{className:"tag meta-depth",title:`nested ${e.spawn_depth} levels deep`,children:["↳",e.spawn_depth]}),s.jsxs("span",{className:"muted",children:[" ","· ",(e.models??"").split(",").filter(Boolean).map(R).join(", ")," ·"," ",B(e.tokens)," tok · ",A(e.cost)]})]})}function Fs({d:e}){const n=e.workflow_runs??[],t=e.children.filter(a=>!a.workflow_run_id),l=n.length>0;return s.jsxs("div",{className:"subagents",children:[s.jsxs("h2",{children:["Spawned subagents (",e.children.length,")"]}),n.map(a=>{const o=e.children.filter(r=>r.workflow_run_id===a.run_id);return s.jsxs("details",{className:"wf-run",children:[s.jsxs("summary",{children:[s.jsxs(_,{className:"wf-run-name",to:`/workflow/${a.run_id}`,onClick:r=>r.stopPropagation(),children:["🔀 ",a.name||"workflow"," →"]}),a.status&&s.jsx("span",{className:"tag task-status task-status-"+a.status.toLowerCase(),children:a.status}),s.jsxs("span",{className:"muted small",children:[o.length," agent",o.length===1?"":"s",a.turn_seq!=null?` · turn ${a.turn_seq+1}`:""," · ",s.jsx("code",{children:a.run_id})]})]}),s.jsx("ul",{children:o.map(r=>s.jsx(T,{c:r},r.id))})]},a.run_id)}),t.length>0&&(l?s.jsxs("details",{className:"wf-run",open:!0,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"wf-run-name",children:"Task / Agent"}),s.jsxs("span",{className:"muted small",children:[t.length," subagent",t.length===1?"":"s"]})]}),s.jsx("ul",{children:t.map(a=>s.jsx(T,{c:a},a.id))})]}):s.jsx("ul",{children:t.map(a=>s.jsx(T,{c:a},a.id))}))]})}function Rs(){const{id:e}=Z(),[n,t]=m.useState(null),[l,a]=m.useState(null),[o,r]=m.useState(new Set),[i,d]=m.useState(ls),[u,x]=m.useState(is),j=p=>{d(p);try{localStorage.setItem(W,p)}catch{}},h=()=>x(p=>{const v=!p;try{localStorage.setItem(D,v?"1":"0")}catch{}return v});m.useEffect(()=>{t(null),a(null),r(new Set),ss("/sessions/"+e).then(t).catch(p=>a(String(p)))},[e]);const f=m.useMemo(()=>{const p=new Map;for(const v of(n==null?void 0:n.events)??[])for(const w of v.toolCalls)w.tool_name==="Workflow"&&w.id&&w.workflow_run_id&&p.set(w.id,w.workflow_run_id);return p},[n]);if(l)return s.jsx("div",{className:"error",role:"alert",children:l});if(!n)return s.jsx("div",{className:"muted pad",role:"status","aria-live":"polite",children:"Loading…"});const c=n.session,g=n.events.filter(p=>p.text||p.thinking||p.toolCalls.length),N=Ms(g,n.turns),b=N.filter(p=>p.turn).map(p=>p.turnId),S=b.some(p=>!o.has(p)),X=p=>r(v=>{const w=new Set(v);return w.has(p)?w.delete(p):w.add(p),w});return s.jsxs("div",{className:"detail",children:[s.jsxs("div",{className:"detail-head",children:[s.jsx(_,{to:"/",className:"back",children:"← all sessions"}),s.jsx("h1",{children:c.title||c.id.slice(0,12)}),s.jsxs("div",{className:"detail-meta",children:[s.jsx("span",{children:s.jsx("b",{children:c.source_id})}),s.jsx("span",{className:"path",children:c.project_path}),c.is_sidechain?s.jsx("span",{className:"tag subagent",children:"subagent"}):null,n.parent&&s.jsxs("span",{className:"spawned-by",children:["↖ spawned by"," ",s.jsx(_,{to:`/session/${n.parent.id}`,children:n.parent.title||n.parent.id.slice(0,12)}),n.parent.turn_seq!=null?` · turn ${n.parent.turn_seq+1}`:""]}),s.jsxs("span",{children:[n.turns.length," turns"]}),s.jsxs("span",{children:[c.event_count," events"]}),s.jsxs("span",{title:es(c.token_split),children:[B(c.tokens)," tok"]}),s.jsx("span",{title:"Estimated at API list prices (cache-aware)",children:A(c.cost)}),s.jsx("span",{children:C(c.duration_ms)}),s.jsx("span",{className:"muted",children:L(c.started_at)}),s.jsx("a",{className:"export",href:ns(c.id),children:"⬇ Export Markdown"})]}),n.classification&&s.jsx(rs,{c:n.classification}),n.findings&&n.findings.length>0&&s.jsx(ms,{findings:n.findings,sessionId:c.id})]}),n.children&&n.children.length>0&&s.jsx(Fs,{d:n}),s.jsxs("div",{className:"transcript-tools",children:[b.length>1&&s.jsxs(s.Fragment,{children:[s.jsxs("span",{className:"muted small",children:[b.length," turns"]}),s.jsx("button",{className:"ghost small",onClick:()=>r(S?new Set(b):new Set),children:S?"Collapse all":"Expand all"})]}),s.jsxs("button",{className:"ghost small"+(u?" is-active":""),"aria-pressed":u,onClick:h,title:"Hide Bash/Edit/Skill and other tool calls — show only assistant answers, plans and questions",children:[u?"☑ ":"☐ ","Hide tool messages"]}),s.jsxs("div",{className:"format-toggle",role:"group","aria-label":"Message format",children:[s.jsx("button",{className:"ghost small"+(i==="markdown"?" is-active":""),"aria-pressed":i==="markdown",onClick:()=>j("markdown"),children:"Markdown"}),s.jsx("button",{className:"ghost small"+(i==="raw"?" is-active":""),"aria-pressed":i==="raw",onClick:()=>j("raw"),children:"Raw"})]})]}),s.jsx(H.Provider,{value:f,children:s.jsx(P.Provider,{value:i,children:s.jsx(U.Provider,{value:u,children:s.jsxs("div",{className:"transcript",children:[g.length===0&&s.jsx("div",{className:"muted pad",role:"status",children:"This session has no rendered messages."}),N.map((p,v)=>p.turn?s.jsx($s,{turn:p.turn,events:p.events,open:!o.has(p.turnId),onToggle:()=>X(p.turnId)},p.turnId):s.jsx("div",{className:"unturned",children:p.events.map(w=>s.jsx(G,{e:w},w.uuid))},"unturned-"+v))]})})})})]})}export{Rs as default};
|