@markusylisiurunen/tau 0.3.113 → 0.3.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/dist/core/code_mode/history.js +3 -1
  2. package/dist/core/code_mode/history.js.map +1 -1
  3. package/dist/core/history/history_manager.js +17 -14
  4. package/dist/core/history/history_manager.js.map +1 -1
  5. package/dist/core/history/local_history_store.js +59 -41
  6. package/dist/core/history/local_history_store.js.map +1 -1
  7. package/dist/core/history/remote_history_client.js +25 -3
  8. package/dist/core/history/remote_history_client.js.map +1 -1
  9. package/dist/core/history/schema.js +1 -0
  10. package/dist/core/history/schema.js.map +1 -1
  11. package/dist/core/static/code_mode/docs/history.md +4 -2
  12. package/dist/core/subagents/claude_code_runner.mjs +58 -58
  13. package/dist/core/version.js +2 -2
  14. package/dist/diff_tool/app/dist/assets/{core-BfpRGcqe.js → core-CEX1B8U5.js} +1 -1
  15. package/dist/diff_tool/app/dist/assets/engine-oniguruma-DEI4DY_o.js +1 -0
  16. package/dist/diff_tool/app/dist/assets/{highlights-CLc_g6m8.js → highlights-Ct-rVULM.js} +1 -1
  17. package/dist/diff_tool/app/dist/assets/{index-bu2WOD1Y.js → index-wTs3AdOj.js} +7 -7
  18. package/dist/diff_tool/app/dist/assets/langs-Dr3LSnZI.js +1 -0
  19. package/dist/diff_tool/app/dist/assets/{lib-BKZ5ZaMU.js → lib-DHaWRzOq.js} +1 -1
  20. package/dist/diff_tool/app/dist/assets/{shiki-r9Q4gIo6.js → shiki-NEnG1qil.js} +2 -2
  21. package/dist/diff_tool/app/dist/assets/{stream-tokenizer-bgeDT4xc.js → stream-tokenizer-C793Xkmg.js} +1 -1
  22. package/dist/diff_tool/app/dist/assets/{themes-h4OE3MIe.js → themes-DrbXSZTP.js} +2 -2
  23. package/dist/diff_tool/app/dist/index.html +2 -2
  24. package/dist/history/worker/index.js +69 -41
  25. package/dist/history/worker/index.js.map +1 -1
  26. package/dist/history/worker/viewer.js +17 -1
  27. package/dist/host/local_session_host.js +2 -0
  28. package/dist/host/local_session_host.js.map +1 -1
  29. package/dist/tui/ui/chat_container.js +6 -4
  30. package/dist/tui/ui/chat_container.js.map +1 -1
  31. package/package.json +8 -8
  32. package/dist/diff_tool/app/dist/assets/engine-oniguruma-D_AXpl2k.js +0 -1
  33. package/dist/diff_tool/app/dist/assets/langs-DO7BJV2U.js +0 -1
@@ -0,0 +1 @@
1
+ export{Y as bundledLanguages}from"./index-wTs3AdOj.js";
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-XKyaHtl9.js";var t=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],n=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};n.prototype.normal={},n.prototype.property={},n.prototype.space=void 0;function r(e,t){let r={},i={};for(let t of e)Object.assign(r,t.property),Object.assign(i,t.normal);return new n(r,i,t)}function i(e){return e.toLowerCase()}var a=class{constructor(e,t){this.attribute=t,this.property=e}};a.prototype.attribute=``,a.prototype.booleanish=!1,a.prototype.boolean=!1,a.prototype.commaOrSpaceSeparated=!1,a.prototype.commaSeparated=!1,a.prototype.defined=!1,a.prototype.mustUseProperty=!1,a.prototype.number=!1,a.prototype.overloadedBoolean=!1,a.prototype.property=``,a.prototype.spaceSeparated=!1,a.prototype.space=void 0;var o=e({boolean:()=>c,booleanish:()=>l,commaOrSpaceSeparated:()=>m,commaSeparated:()=>p,number:()=>d,overloadedBoolean:()=>u,spaceSeparated:()=>f}),s=0,c=h(),l=h(),u=h(),d=h(),f=h(),p=h(),m=h();function h(){return 2**++s}var g=Object.keys(o),_=class extends a{constructor(e,t,n,r){let i=-1;if(super(e,t),v(this,`space`,r),typeof n==`number`)for(;++i<g.length;){let e=g[i];v(this,g[i],(n&o[e])===o[e])}}};_.prototype.defined=!0;function v(e,t,n){n&&(e[t]=n)}function y(e){let t={},r={};for(let[n,a]of Object.entries(e.properties)){let o=new _(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,r[i(n)]=n,r[i(o.attribute)]=n}return new n(t,r,e.space)}var b=y({properties:{ariaActiveDescendant:null,ariaAtomic:l,ariaAutoComplete:null,ariaBusy:l,ariaChecked:l,ariaColCount:d,ariaColIndex:d,ariaColSpan:d,ariaControls:f,ariaCurrent:null,ariaDescribedBy:f,ariaDetails:null,ariaDisabled:l,ariaDropEffect:f,ariaErrorMessage:null,ariaExpanded:l,ariaFlowTo:f,ariaGrabbed:l,ariaHasPopup:null,ariaHidden:l,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:f,ariaLevel:d,ariaLive:null,ariaModal:l,ariaMultiLine:l,ariaMultiSelectable:l,ariaOrientation:null,ariaOwns:f,ariaPlaceholder:null,ariaPosInSet:d,ariaPressed:l,ariaReadOnly:l,ariaRelevant:null,ariaRequired:l,ariaRoleDescription:f,ariaRowCount:d,ariaRowIndex:d,ariaRowSpan:d,ariaSelected:l,ariaSetSize:d,ariaSort:null,ariaValueMax:d,ariaValueMin:d,ariaValueNow:d,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function x(e,t){return t in e?e[t]:t}function S(e,t){return x(e,t.toLowerCase())}var C=y({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:p,acceptCharset:f,accessKey:f,action:null,allow:null,allowFullScreen:c,allowPaymentRequest:c,allowUserMedia:c,alpha:c,alt:null,as:null,async:c,autoCapitalize:null,autoComplete:f,autoFocus:c,autoPlay:c,blocking:f,capture:null,charSet:null,checked:c,cite:null,className:f,closedBy:null,colorSpace:null,cols:d,colSpan:d,command:null,commandFor:null,content:null,contentEditable:l,controls:c,controlsList:f,coords:d|p,crossOrigin:null,data:null,dateTime:null,decoding:null,default:c,defer:c,dir:null,dirName:null,disabled:c,download:u,draggable:l,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:c,formTarget:null,headers:f,height:d,hidden:u,high:d,href:null,hrefLang:null,htmlFor:f,httpEquiv:f,id:null,imageSizes:null,imageSrcSet:null,inert:c,inputMode:null,integrity:null,is:null,isMap:c,itemId:null,itemProp:f,itemRef:f,itemScope:c,itemType:f,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:c,low:d,manifest:null,max:null,maxLength:d,media:null,method:null,min:null,minLength:d,multiple:c,muted:c,name:null,nonce:null,noModule:c,noValidate:c,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:c,optimum:d,pattern:null,ping:f,placeholder:null,playsInline:c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:c,referrerPolicy:null,rel:f,required:c,reversed:c,rows:d,rowSpan:d,sandbox:f,scope:null,scoped:c,seamless:c,selected:c,shadowRootClonable:c,shadowRootCustomElementRegistry:c,shadowRootDelegatesFocus:c,shadowRootMode:null,shadowRootSerializable:c,shape:null,size:d,sizes:null,slot:null,span:d,spellCheck:l,src:null,srcDoc:null,srcLang:null,srcSet:null,start:d,step:null,style:null,tabIndex:d,target:null,title:null,translate:null,type:null,typeMustMatch:c,useMap:null,value:l,width:d,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:f,axis:null,background:null,bgColor:null,border:d,borderColor:null,bottomMargin:d,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:c,declare:c,event:null,face:null,frame:null,frameBorder:null,hSpace:d,leftMargin:d,link:null,longDesc:null,lowSrc:null,marginHeight:d,marginWidth:d,noResize:c,noHref:c,noShade:c,noWrap:c,object:null,profile:null,prompt:null,rev:null,rightMargin:d,rules:null,scheme:null,scrolling:l,standby:null,summary:null,text:null,topMargin:d,valueType:null,version:null,vAlign:null,vLink:null,vSpace:d,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:c,disablePictureInPicture:c,disableRemotePlayback:c,exportParts:p,part:f,prefix:null,property:null,results:d,security:null,unselectable:null},space:`html`,transform:S}),w=y({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:m,accentHeight:d,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:d,amplitude:d,arabicForm:null,ascent:d,attributeName:null,attributeType:null,azimuth:d,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:d,by:null,calcMode:null,capHeight:d,className:f,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:d,diffuseConstant:d,direction:null,display:null,dur:null,divisor:d,dominantBaseline:null,download:c,dx:null,dy:null,edgeMode:null,editable:null,elevation:d,enableBackground:null,end:null,event:null,exponent:d,externalResourcesRequired:null,fill:null,fillOpacity:d,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:p,g2:p,glyphName:p,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:d,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:d,horizOriginX:d,horizOriginY:d,id:null,ideographic:d,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:d,k:d,k1:d,k2:d,k3:d,k4:d,kernelMatrix:m,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:d,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:d,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:d,overlineThickness:d,paintOrder:null,panose1:null,path:null,pathLength:d,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:f,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:d,pointsAtY:d,pointsAtZ:d,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:m,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:m,rev:m,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:m,requiredFeatures:m,requiredFonts:m,requiredFormats:m,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:d,specularExponent:d,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:d,strikethroughThickness:d,string:null,stroke:null,strokeDashArray:m,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:d,strokeOpacity:d,strokeWidth:null,style:null,surfaceScale:d,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:m,tabIndex:d,tableValues:null,target:null,targetX:d,targetY:d,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:m,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:d,underlineThickness:d,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:d,values:null,vAlphabetic:d,vMathematical:d,vectorEffect:null,vHanging:d,vIdeographic:d,version:null,vertAdvY:d,vertOriginX:d,vertOriginY:d,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:d,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:x}),T=y({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()}}),E=y({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:S}),D=y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),O=/[A-Z]/g,k=/-[a-z]/g,ee=/^data[-\w.:]+$/i;function te(e,t){let n=i(t),r=t,o=a;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ee.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(k,re);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!k.test(e)){let n=e.replace(O,ne);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}o=_}return new o(r,t)}function ne(e){return`-`+e.toLowerCase()}function re(e){return e.charAt(1).toUpperCase()}var A=r([b,C,T,E,D],`html`),j=r([b,w,T,E,D],`svg`),M={}.hasOwnProperty;function N(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&M.call(t,e)){let n=String(t[e]);i=M.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var P=/["&'<>`]/g,F=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,L=/[|\\{}()[\]^$+*?.]/g,R=new WeakMap;function z(e,t){return e=e.replace(t.subset?B(t.subset):P,r),t.subset||t.escapeOnly?e:e.replace(F,n).replace(I,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function B(e){let t=R.get(e);return t||(t=V(e),R.set(e,t)),t}function V(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(L,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var H=/[\dA-Fa-f]/;function U(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!H.test(String.fromCharCode(t))?r:r+`;`}var W=/\d/;function G(e,t,n){let r=`&#`+String(e);return n&&t&&!W.test(String.fromCharCode(t))?r:r+`;`}var K=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),q={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},J=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Y={}.hasOwnProperty,X={},Z;for(Z in q)Y.call(q,Z)&&(X[q[Z]]=Z);var ie=/[^\dA-Za-z]/;function ae(e,t,n,r){let i=String.fromCharCode(e);if(Y.call(X,i)){let e=X[i],a=`&`+e;return n&&K.includes(e)&&!J.includes(e)&&(!r||t&&t!==61&&ie.test(String.fromCharCode(t)))?a:a+`;`}return``}function oe(e,t,n){let r=U(e,t,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=ae(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){let i=G(e,t,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function se(e,t){return z(e,Object.assign({format:oe},t))}function Q(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ce(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function le(e){return e.join(` `).trim()}var ue=/[ \t\n\f\r]/g;function de(e){return typeof e==`object`?e.type===`text`&&$(e.value):$(e)}function $(e){return e.replace(ue,``)===``}export{se as a,j as c,Q as i,te as l,le as n,N as o,ce as r,A as s,de as t,t as u};
1
+ import{n as e}from"./rolldown-runtime-XKyaHtl9.js";var t=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],n=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};n.prototype.normal={},n.prototype.property={},n.prototype.space=void 0;function r(e,t){let r={},i={};for(let t of e)Object.assign(r,t.property),Object.assign(i,t.normal);return new n(r,i,t)}function i(e){return e.toLowerCase()}var a=class{constructor(e,t){this.attribute=t,this.property=e}};a.prototype.attribute=``,a.prototype.booleanish=!1,a.prototype.boolean=!1,a.prototype.commaOrSpaceSeparated=!1,a.prototype.commaSeparated=!1,a.prototype.defined=!1,a.prototype.mustUseProperty=!1,a.prototype.number=!1,a.prototype.overloadedBoolean=!1,a.prototype.property=``,a.prototype.spaceSeparated=!1,a.prototype.space=void 0;var o=e({boolean:()=>c,booleanish:()=>l,commaOrSpaceSeparated:()=>m,commaSeparated:()=>p,number:()=>d,overloadedBoolean:()=>u,spaceSeparated:()=>f}),s=0,c=h(),l=h(),u=h(),d=h(),f=h(),p=h(),m=h();function h(){return 2**++s}var g=Object.keys(o),_=class extends a{constructor(e,t,n,r){let i=-1;if(super(e,t),v(this,`space`,r),typeof n==`number`)for(;++i<g.length;){let e=g[i];v(this,g[i],(n&o[e])===o[e])}}};_.prototype.defined=!0;function v(e,t,n){n&&(e[t]=n)}function y(e){let t={},r={};for(let[n,a]of Object.entries(e.properties)){let o=new _(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(o.mustUseProperty=!0),t[n]=o,r[i(n)]=n,r[i(o.attribute)]=n}return new n(t,r,e.space)}var b=y({properties:{ariaActiveDescendant:null,ariaAtomic:l,ariaAutoComplete:null,ariaBusy:l,ariaChecked:l,ariaColCount:d,ariaColIndex:d,ariaColSpan:d,ariaControls:f,ariaCurrent:null,ariaDescribedBy:f,ariaDetails:null,ariaDisabled:l,ariaDropEffect:f,ariaErrorMessage:null,ariaExpanded:l,ariaFlowTo:f,ariaGrabbed:l,ariaHasPopup:null,ariaHidden:l,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:f,ariaLevel:d,ariaLive:null,ariaModal:l,ariaMultiLine:l,ariaMultiSelectable:l,ariaOrientation:null,ariaOwns:f,ariaPlaceholder:null,ariaPosInSet:d,ariaPressed:l,ariaReadOnly:l,ariaRelevant:null,ariaRequired:l,ariaRoleDescription:f,ariaRowCount:d,ariaRowIndex:d,ariaRowSpan:d,ariaSelected:l,ariaSetSize:d,ariaSort:null,ariaValueMax:d,ariaValueMin:d,ariaValueNow:d,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function x(e,t){return t in e?e[t]:t}function S(e,t){return x(e,t.toLowerCase())}var C=y({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:p,acceptCharset:f,accessKey:f,action:null,allow:null,allowFullScreen:c,allowPaymentRequest:c,allowUserMedia:c,alpha:c,alt:null,as:null,async:c,autoCapitalize:null,autoComplete:f,autoFocus:c,autoPlay:c,blocking:f,capture:null,charSet:null,checked:c,cite:null,className:f,closedBy:null,colorSpace:null,cols:d,colSpan:d,command:null,commandFor:null,content:null,contentEditable:l,controls:c,controlsList:f,coords:d|p,crossOrigin:null,data:null,dateTime:null,decoding:null,default:c,defer:c,dir:null,dirName:null,disabled:c,download:u,draggable:l,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:c,formTarget:null,headers:f,height:d,hidden:u,high:d,href:null,hrefLang:null,htmlFor:f,httpEquiv:f,id:null,imageSizes:null,imageSrcSet:null,inert:c,inputMode:null,integrity:null,is:null,isMap:c,itemId:null,itemProp:f,itemRef:f,itemScope:c,itemType:f,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:c,low:d,manifest:null,max:null,maxLength:d,media:null,method:null,min:null,minLength:d,multiple:c,muted:c,name:null,nonce:null,noModule:c,noValidate:c,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:c,optimum:d,pattern:null,ping:f,placeholder:null,playsInline:c,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:c,referrerPolicy:null,rel:f,required:c,reversed:c,rows:d,rowSpan:d,sandbox:f,scope:null,scoped:c,seamless:c,selected:c,shadowRootClonable:c,shadowRootCustomElementRegistry:c,shadowRootDelegatesFocus:c,shadowRootMode:null,shadowRootSerializable:c,shape:null,size:d,sizes:null,slot:null,span:d,spellCheck:l,src:null,srcDoc:null,srcLang:null,srcSet:null,start:d,step:null,style:null,tabIndex:d,target:null,title:null,translate:null,type:null,typeMustMatch:c,useMap:null,value:l,width:d,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:f,axis:null,background:null,bgColor:null,border:d,borderColor:null,bottomMargin:d,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:c,declare:c,event:null,face:null,frame:null,frameBorder:null,hSpace:d,leftMargin:d,link:null,longDesc:null,lowSrc:null,marginHeight:d,marginWidth:d,noResize:c,noHref:c,noShade:c,noWrap:c,object:null,profile:null,prompt:null,rev:null,rightMargin:d,rules:null,scheme:null,scrolling:l,standby:null,summary:null,text:null,topMargin:d,valueType:null,version:null,vAlign:null,vLink:null,vSpace:d,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:c,disablePictureInPicture:c,disableRemotePlayback:c,exportParts:p,part:f,prefix:null,property:null,results:d,security:null,unselectable:null},space:`html`,transform:S}),w=y({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:m,accentHeight:d,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:d,amplitude:d,arabicForm:null,ascent:d,attributeName:null,attributeType:null,azimuth:d,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:d,by:null,calcMode:null,capHeight:d,className:f,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:d,diffuseConstant:d,direction:null,display:null,dur:null,divisor:d,dominantBaseline:null,download:c,dx:null,dy:null,edgeMode:null,editable:null,elevation:d,enableBackground:null,end:null,event:null,exponent:d,externalResourcesRequired:null,fill:null,fillOpacity:d,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:p,g2:p,glyphName:p,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:d,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:d,horizOriginX:d,horizOriginY:d,id:null,ideographic:d,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:d,k:d,k1:d,k2:d,k3:d,k4:d,kernelMatrix:m,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:d,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:d,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:d,overlineThickness:d,paintOrder:null,panose1:null,path:null,pathLength:d,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:f,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:d,pointsAtY:d,pointsAtZ:d,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:m,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:m,rev:m,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:m,requiredFeatures:m,requiredFonts:m,requiredFormats:m,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:d,specularExponent:d,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:d,strikethroughThickness:d,string:null,stroke:null,strokeDashArray:m,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:d,strokeOpacity:d,strokeWidth:null,style:null,surfaceScale:d,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:m,tabIndex:d,tableValues:null,target:null,targetX:d,targetY:d,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:m,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:d,underlineThickness:d,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:d,values:null,vAlphabetic:d,vMathematical:d,vectorEffect:null,vHanging:d,vIdeographic:d,version:null,vertAdvY:d,vertOriginX:d,vertOriginY:d,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:d,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:x}),T=y({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()}}),E=y({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:S}),D=y({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),O=/[A-Z]/g,k=/-[a-z]/g,ee=/^data[-\w.:]+$/i;function te(e,t){let n=i(t),r=t,o=a;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&ee.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(k,re);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!k.test(e)){let n=e.replace(O,ne);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}o=_}return new o(r,t)}function ne(e){return`-`+e.toLowerCase()}function re(e){return e.charAt(1).toUpperCase()}var A=r([b,C,T,E,D],`html`),j=r([b,w,T,E,D],`svg`),M={}.hasOwnProperty;function N(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&M.call(t,e)){let n=String(t[e]);i=M.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var P=/["&'<>`]/g,F=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,I=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,L=/[|\\{}()[\]^$+*?.]/g,R=new WeakMap;function z(e,t){return e=e.replace(t.subset?B(t.subset):P,r),t.subset||t.escapeOnly?e:e.replace(F,n).replace(I,r);function n(e,n,r){return t.format((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)-56320+65536,r.charCodeAt(n+2),t)}function r(e,n,r){return t.format(e.charCodeAt(0),r.charCodeAt(n+1),t)}}function B(e){let t=R.get(e);return t||(t=V(e),R.set(e,t)),t}function V(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(L,`\\$&`));return RegExp(`(?:`+t.join(`|`)+`)`,`g`)}var H=/[\dA-Fa-f]/;function U(e,t,n){let r=`&#x`+e.toString(16).toUpperCase();return n&&t&&!H.test(String.fromCharCode(t))?r:r+`;`}var W=/\d/;function G(e,t,n){let r=`&#`+String(e);return n&&t&&!W.test(String.fromCharCode(t))?r:r+`;`}var K=`AElig.AMP.Aacute.Acirc.Agrave.Aring.Atilde.Auml.COPY.Ccedil.ETH.Eacute.Ecirc.Egrave.Euml.GT.Iacute.Icirc.Igrave.Iuml.LT.Ntilde.Oacute.Ocirc.Ograve.Oslash.Otilde.Ouml.QUOT.REG.THORN.Uacute.Ucirc.Ugrave.Uuml.Yacute.aacute.acirc.acute.aelig.agrave.amp.aring.atilde.auml.brvbar.ccedil.cedil.cent.copy.curren.deg.divide.eacute.ecirc.egrave.eth.euml.frac12.frac14.frac34.gt.iacute.icirc.iexcl.igrave.iquest.iuml.laquo.lt.macr.micro.middot.nbsp.not.ntilde.oacute.ocirc.ograve.ordf.ordm.oslash.otilde.ouml.para.plusmn.pound.quot.raquo.reg.sect.shy.sup1.sup2.sup3.szlig.thorn.times.uacute.ucirc.ugrave.uml.uuml.yacute.yen.yuml`.split(`.`),q={nbsp:`\xA0`,iexcl:`¡`,cent:`¢`,pound:`£`,curren:`¤`,yen:`¥`,brvbar:`¦`,sect:`§`,uml:`¨`,copy:`©`,ordf:`ª`,laquo:`«`,not:`¬`,shy:`­`,reg:`®`,macr:`¯`,deg:`°`,plusmn:`±`,sup2:`²`,sup3:`³`,acute:`´`,micro:`µ`,para:`¶`,middot:`·`,cedil:`¸`,sup1:`¹`,ordm:`º`,raquo:`»`,frac14:`¼`,frac12:`½`,frac34:`¾`,iquest:`¿`,Agrave:`À`,Aacute:`Á`,Acirc:`Â`,Atilde:`Ã`,Auml:`Ä`,Aring:`Å`,AElig:`Æ`,Ccedil:`Ç`,Egrave:`È`,Eacute:`É`,Ecirc:`Ê`,Euml:`Ë`,Igrave:`Ì`,Iacute:`Í`,Icirc:`Î`,Iuml:`Ï`,ETH:`Ð`,Ntilde:`Ñ`,Ograve:`Ò`,Oacute:`Ó`,Ocirc:`Ô`,Otilde:`Õ`,Ouml:`Ö`,times:`×`,Oslash:`Ø`,Ugrave:`Ù`,Uacute:`Ú`,Ucirc:`Û`,Uuml:`Ü`,Yacute:`Ý`,THORN:`Þ`,szlig:`ß`,agrave:`à`,aacute:`á`,acirc:`â`,atilde:`ã`,auml:`ä`,aring:`å`,aelig:`æ`,ccedil:`ç`,egrave:`è`,eacute:`é`,ecirc:`ê`,euml:`ë`,igrave:`ì`,iacute:`í`,icirc:`î`,iuml:`ï`,eth:`ð`,ntilde:`ñ`,ograve:`ò`,oacute:`ó`,ocirc:`ô`,otilde:`õ`,ouml:`ö`,divide:`÷`,oslash:`ø`,ugrave:`ù`,uacute:`ú`,ucirc:`û`,uuml:`ü`,yacute:`ý`,thorn:`þ`,yuml:`ÿ`,fnof:`ƒ`,Alpha:`Α`,Beta:`Β`,Gamma:`Γ`,Delta:`Δ`,Epsilon:`Ε`,Zeta:`Ζ`,Eta:`Η`,Theta:`Θ`,Iota:`Ι`,Kappa:`Κ`,Lambda:`Λ`,Mu:`Μ`,Nu:`Ν`,Xi:`Ξ`,Omicron:`Ο`,Pi:`Π`,Rho:`Ρ`,Sigma:`Σ`,Tau:`Τ`,Upsilon:`Υ`,Phi:`Φ`,Chi:`Χ`,Psi:`Ψ`,Omega:`Ω`,alpha:`α`,beta:`β`,gamma:`γ`,delta:`δ`,epsilon:`ε`,zeta:`ζ`,eta:`η`,theta:`θ`,iota:`ι`,kappa:`κ`,lambda:`λ`,mu:`μ`,nu:`ν`,xi:`ξ`,omicron:`ο`,pi:`π`,rho:`ρ`,sigmaf:`ς`,sigma:`σ`,tau:`τ`,upsilon:`υ`,phi:`φ`,chi:`χ`,psi:`ψ`,omega:`ω`,thetasym:`ϑ`,upsih:`ϒ`,piv:`ϖ`,bull:`•`,hellip:`…`,prime:`′`,Prime:`″`,oline:`‾`,frasl:`⁄`,weierp:`℘`,image:`ℑ`,real:`ℜ`,trade:`™`,alefsym:`ℵ`,larr:`←`,uarr:`↑`,rarr:`→`,darr:`↓`,harr:`↔`,crarr:`↵`,lArr:`⇐`,uArr:`⇑`,rArr:`⇒`,dArr:`⇓`,hArr:`⇔`,forall:`∀`,part:`∂`,exist:`∃`,empty:`∅`,nabla:`∇`,isin:`∈`,notin:`∉`,ni:`∋`,prod:`∏`,sum:`∑`,minus:`−`,lowast:`∗`,radic:`√`,prop:`∝`,infin:`∞`,ang:`∠`,and:`∧`,or:`∨`,cap:`∩`,cup:`∪`,int:`∫`,there4:`∴`,sim:`∼`,cong:`≅`,asymp:`≈`,ne:`≠`,equiv:`≡`,le:`≤`,ge:`≥`,sub:`⊂`,sup:`⊃`,nsub:`⊄`,sube:`⊆`,supe:`⊇`,oplus:`⊕`,otimes:`⊗`,perp:`⊥`,sdot:`⋅`,lceil:`⌈`,rceil:`⌉`,lfloor:`⌊`,rfloor:`⌋`,lang:`〈`,rang:`〉`,loz:`◊`,spades:`♠`,clubs:`♣`,hearts:`♥`,diams:`♦`,quot:`"`,amp:`&`,lt:`<`,gt:`>`,OElig:`Œ`,oelig:`œ`,Scaron:`Š`,scaron:`š`,Yuml:`Ÿ`,circ:`ˆ`,tilde:`˜`,ensp:` `,emsp:` `,thinsp:` `,zwnj:`‌`,zwj:`‍`,lrm:`‎`,rlm:`‏`,ndash:`–`,mdash:`—`,lsquo:`‘`,rsquo:`’`,sbquo:`‚`,ldquo:`“`,rdquo:`”`,bdquo:`„`,dagger:`†`,Dagger:`‡`,permil:`‰`,lsaquo:`‹`,rsaquo:`›`,euro:`€`},J=[`cent`,`copy`,`divide`,`gt`,`lt`,`not`,`para`,`times`],Y={}.hasOwnProperty,X={},Z;for(Z in q)Y.call(q,Z)&&(X[q[Z]]=Z);var ie=/[^\dA-Za-z]/;function ae(e,t,n,r){let i=String.fromCharCode(e);if(Y.call(X,i)){let e=X[i],a=`&`+e;return n&&K.includes(e)&&!J.includes(e)&&(!r||t&&t!==61&&ie.test(String.fromCharCode(t)))?a:a+`;`}return``}function oe(e,t,n){let r=n.omitOptionalSemicolons&&t!==59,i=U(e,t,r),a;if((n.useNamedReferences||n.useShortestReferences)&&(a=ae(e,t,r,n.attribute)),(n.useShortestReferences||!a)&&n.useShortestReferences){let n=G(e,t,r);n.length<i.length&&(i=n)}return a&&(!n.useShortestReferences||a.length<i.length)?a:i}function se(e,t){return z(e,Object.assign({format:oe},t))}function Q(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function ce(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}function le(e){return e.join(` `).trim()}var ue=/[ \t\n\f\r]/g;function de(e){return typeof e==`object`?e.type===`text`&&$(e.value):$(e)}function $(e){return e.replace(ue,``)===``}export{se as a,j as c,Q as i,te as l,le as n,N as o,ce as r,A as s,de as t,t as u};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./langs-DO7BJV2U.js","./index-bu2WOD1Y.js","./rolldown-runtime-XKyaHtl9.js","./preload-helper-DclECHGd.js","./lib-BKZ5ZaMU.js","./index-DuML4oGc.css","./engine-oniguruma-D_AXpl2k.js"])))=>i.map(i=>d[i]);
2
- import{H as e,U as t,at as n,c as r,ct as i,lt as a,nt as o,ot as s,rt as c,s as l,st as u}from"./index-bu2WOD1Y.js";import{t as d}from"./preload-helper-DclECHGd.js";import{n as f,t as p}from"./stream-tokenizer-bgeDT4xc.js";async function m(e){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:n())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=a.get(e);if(t!=null)return t;let r=(async()=>{let t=u.get(e);if(t==null){let{bundledLanguages:n}=await d(async()=>{let{bundledLanguages:e}=await import(`./langs-DO7BJV2U.js`);return{bundledLanguages:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);Object.prototype.hasOwnProperty.call(n,e)&&(t=n[e])}if(t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let{default:n}=await t(),r={name:e,data:n};return i.has(e)||i.set(e,r),r})();a.set(e,r);try{return await r}finally{a.get(e)===r&&a.delete(e)}}function h(e){return i.get(e)??m(e)}async function g(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=h(r)??m(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function _(e,t){for(let n of Array.isArray(e)?e:[e]){let e=i.get(n.name);e??(e=n,i.set(n.name,e)),t.attachLanguages([e]),s.add(e.name)}}function v(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var y=0,b=0,x=class{backend;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=[t];#d=[];#f=0;#p=[];#m=-1;#h=!0;#g=!1;#_=0;#v=++b;#y=-1;#b=-1;#x;#S=0;#C=[];#w=!1;#T=v(async e=>{if(this.#l)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#i.lineCount);if(this.#t==null&&!C(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#l)return;this.#t=this.#e.getLanguage(this.#i.languageId)}this.#D(),this.#N(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#v&&typeof r==`number`&&r===this.#_&&(this.#y>=0?this.#z(r):this.#B(r))};getStringCommentRegexpRangesInLine(e){if(!this.#s||e<0||e>=this.#i.lineCount||(this.#O(),this.#t==null))return null;if(this.#C[e]===void 0){this.#R(e);let n=this.#u[e]??t,r=this.#P(e,n);this.#u[e+1]=r.state}return this.#C[e]??null}constructor(e,t,n){this.backend=n,this.#e=e,this.#i=t.textDocument,this.#n=t.theme,this.#r=[],this.#a=t.tokenizeMaxLineLength??1e3,this.#o=t.onDeferTokenize,this.#s=t.matchBrackets!==!1,this.#c=t.__debug??!1,this.#O(),this.#D()}setTheme(e){this.#n!==e&&(this.#n=e,this.#D(),this.stopBackgroundTokenize(),this.#u=[t],this.#d=[],this.#f=0,this.#p=[],this.#t!=null&&this.#i.lineCount>0&&this.#M(0))}#D(){if(this.#n===``)return;this.backend?.getTheme(this.#n);let{colorMap:e}=this.#e.setTheme(this.#n);this.#r=e}dispose(){this.#l=!0,this.stopBackgroundTokenize(),this.#A()}tokenize(e,n,r=!1){if(this.#O(),this.#D(),this.#t==null&&!C(this.#i.languageId))throw Error(`Grammar for language "${this.#i.languageId}" not loaded`);let{lineCount:i}=this.#i,{startingLine:a=0,totalLines:o=1/0}=n??{},s=o===1/0?i:Math.min(a+o,i),c=e.startLine,l=Math.max(a,c),u=n!=null&&o!==1/0&&e.lineDelta>0&&c<s&&e.endLine>=s,d=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0);this.#s&&!d&&(this.#C.length=Math.min(this.#C.length,e.startLine));let f=r&&e.lineDelta!==0&&c>=a,p=d||n==null||c>=l,m=e.changedLineRanges??[[c,e.endLine]];this.#d=[],this.#f=0,this.#p=[];let h=-1;if(c<l)for(let[e,t]of m)e<l&&(h=Math.max(h,Math.min(t,l-1)));let g=h>=c&&(d||e.lineDelta<0);d?this.#R(c):(this.#I(e),(n==null||c>=l)&&this.#R(l));let _=0,v=m[_][1],y,b=0,x=d?m[_][0]:l,S=!1,w=new Map,T=g?new Map:void 0;if(T!=null&&!d){let e=Math.min(h+1,l,s);if(e>c){this.#R(e);let n=c,r=this.#u[n]??t;for(;n<e;n++){let e=this.#P(n,r);r=e.state,T.set(n,e.resolvedTokens)}this.#u[e]=r}}let E=this.#u[x]??t;for(;x<s;){let e=d?this.#u[x+1]:f?this.#L(x+1):void 0;p&&(this.#u[x]=E);let{resolvedTokens:t,state:n}=this.#P(x,E);if(E=n,x>=l?w.set(x,t):T?.set(x,t),p&&(this.#u[x+1]=E),S=x>=v&&(d||f)&&e!=null&&E.equals(e),S){_++;let e=m[_];if(e==null)break;if(e[0]>=s){y=e[0],b=_;break}let t=this.#u[e[0]];if(f)for(let n=x+2;n<=e[0]&&(t=this.#L(n),t!=null);n++)this.#u[n]=t;t==null?(v=e[1],x++):(x=e[0],E=t,v=e[1]),S=!1}else x++}if(p&&(x<s?this.#u[x+1]=E:this.#u[x]=E),S&&f&&y==null){for(let e=x+2;e<=i;e++){let t=this.#L(e);if(t==null)break;this.#u[e]=t}this.#d=[],this.#f=0,this.#p=[]}if(T!=null&&T.size>0&&this.#o(T),y!=null)this.#s&&d&&(this.#C.length=Math.min(this.#C.length,y)),this.#M(y,m,b);else if(!S&&x<i){let e=u&&c>=l?s:c<l&&!d?c:x;this.#s&&d&&(this.#C.length=Math.min(this.#C.length,e)),this.#M(e,m,_)}return w}prebuildStateStack(e){this.#O(),this.#T(e)}stopBackgroundTokenize(){this.#b=-1,this.#h||(this.#h=!0,this.#g=!1,this.#m=-1,this.#y=-1,this.#x=void 0,this.#S=0,this.#d=[],this.#f=0,this.#p=[],this.#A())}pauseBackgroundTokenize(){this.#h||this.#g||(this.#c&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#_}),this.#g=!0)}resumeBackgroundTokenize(){this.#h||!this.#g||this.#t==null||this.#m<0||(this.#c&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#_}),this.#g=!1,this.#j(this.#_))}#O(){this.#t==null&&!C(this.#i.languageId)&&this.#e.getLoadedLanguages().includes(this.#i.languageId)&&(this.#t=this.#e.getLanguage(this.#i.languageId))}#k(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#A(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#j(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#v,jobId:e})}#M(e,t,n=0){if(C(this.#i.languageId))return;let r=++this.#_;this.#c&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#h=!1,this.#g=!1,this.#m=e,this.#y>=0&&(this.#b=Math.max(this.#b,this.#y)),this.#y=-1,this.#x=t,this.#S=n,this.#k(),this.#j(r)}#N(e){if(this.#t==null||this.#u.length>e)return;if(!this.#h){this.#y>=0?this.#y=Math.max(this.#y,e):this.#b=Math.max(this.#b,e);return}let t=++this.#_;this.#h=!1,this.#g=!1,this.#m=this.#u.length-1,this.#y=e,this.#b=-1,this.#x=void 0,this.#S=0,this.#k(),this.#j(t)}#P(e,t){let n=this.#i.getLineText(e);if(n.length>=this.#a)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t==null||n===``||n.trim()===``)return this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=S(this.#t,this.#r,n,t,y,this.#s);return this.#F(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#F(e,t){this.#s&&(this.#C[e]=t)}#I(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#u.length-n?(this.#d=this.#u,this.#f=0,this.#u=this.#u.slice(0,n)):(this.#f=n,this.#d=this.#u.slice(n),this.#u.length=Math.min(this.#u.length,n)),this.#p=t}#L(e){let t=e;for(let n=this.#p.length-1;n>=0;n--){let[r,i,a]=this.#p[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#u[e]}}return this.#d[t-this.#f]??this.#u[e]}#R(e,n){let r=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#u.length>r||this.#t==null)return!0;let i=n==null?0:performance.now(),a=this.#u.length-1,o=this.#u[a]??t;for(;a<r;){this.#u[a]=o;let e=this.#i.getLineText(a);if(e.length<this.#a&&e!==``&&e.trim()!==``){let t=S(this.#t,this.#r,e,o,y,this.#s,!1);this.#F(a,t.bracketIgnoredRanges),o=t.ruleStack}else this.#F(a,null);if(a++,this.#u[a]=o,n!=null&&performance.now()-i>n)break}return a>=r}#z(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=this.#R(this.#y,1);this.#h||this.#g||e!==this.#_||(t?this.stopBackgroundTokenize():(this.#m=this.#u.length-1,this.#j(e)))}#B(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let n=performance.now(),r=new Map,i=this.#i.lineCount,a=this.#x,o=this.#m,s=this.#u[o]??t,c=!1,l=this.#S,u=a?.[l]?.[1];for(;o<i;){this.#u[o]=s;let e=u==null?void 0:this.#L(o+1),t=this.#P(o,s);if(r.set(o,t.resolvedTokens),s=t.state,this.#u[o+1]=s,c=u!=null&&o>=u&&e!=null&&s.equals(e),o++,c){l++;let e=a?.[l];if(e==null)break;if(u=e[1],this.#u[e[0]]==null)c=!1;else{o=e[0],s=this.#u[o]??s,c=!1;continue}}if(performance.now()-n>1)break}if(this.#o(r),!(this.#h||this.#g||e!==this.#_)){if(c||o>=i){let e=this.#b;this.stopBackgroundTokenize(),e>=0&&this.#N(e)}else this.#m=o,this.#S=l,this.#j(e)}}};function S(t,n,r,i,a,o=!0,s=!0){let c=t.tokenizeLine2(r,i,a);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${r.substring(0,100)}`);let l=c.tokens,u=l.length/2,d=[],f=[];if(!s&&!o)return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let t=0;t<u;t++){let i=l[2*t],a=t+1<u?l[2*t+2]:r.length;if(i===a)continue;let c=l[2*t+1];if(s){let t=e.getForeground(c);d.push([i,n[t],r.slice(i,a)])}o&&e.getTokenType(c)>0&&f.push([i,a])}return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function C(e){return e===`text`||e===`ansi`}var w=class e extends p{highlighter;options;#e=``;#t;constructor(e,t){super(),this.highlighter=e,this.options=t}tokenizeChunk(e,t){let n=(this.#e+e).split(/(\r\n|\r|\n)/),r=[];for(let e=0;e<n.length;e+=2){let i=n[e],a=this.highlighter.codeToTokens(i,{...this.options,grammarState:this.#t}),s=a.tokens[0].map(e=>({...e,offset:e.offset+this.stableOffset}));e+1<n.length?(o(t,s),this.pushLineBreak(t,i.length,n[e+1]),this.#t=a.grammarState):(r=s,this.#e=i)}return{unstable:r,tailLength:this.#e.length}}clone(){this.assertActive();let t=new e(this.highlighter,this.options);return this.copyStateTo(t),t.#e=this.#e,t.#t=this.#t,t}resetSource(){this.#e=``,this.#t=void 0}releaseSource(){this.resetSource()}},T=class e extends f{raw;loadedThemes=new Map;attachedLanguages=new Set([`text`,`ansi`]);static async create(t){let n=t===`shiki-wasm`?(await d(async()=>{let{createOnigurumaEngine:e}=await import(`./engine-oniguruma-D_AXpl2k.js`);return{createOnigurumaEngine:e}},__vite__mapDeps([6,1,2,3,4,5]),import.meta.url)).createOnigurumaEngine(d(()=>import(`./wasm-4KdTHw0F.js`),[],import.meta.url)):(await d(async()=>{let{createJavaScriptRegexEngine:e}=await import(`./engine-javascript-DKxkqixV.js`);return{createJavaScriptRegexEngine:e}},[],import.meta.url)).createJavaScriptRegexEngine(),i=await r({themes:[],langs:[],engine:n});return new e(t,i)}constructor(e,t){super(e,c(e)),this.raw=t}getTheme(e){this.assertNotDisposed();let t=this.loadedThemes.get(e),n=this.themeResolver.getResolvedTheme(e)??t;if(n==null)throw Error(`Theme "${e}" has not been resolved`);if(t!==n){let t=n.textmate??(n.cssVariables==null?void 0:l(n.cssVariables));if(t==null)throw Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...t,name:e}),this.loadedThemes.set(e,n)}return n}codeToTokens(e,t){return this.raw.codeToTokens(e,this.resolveOptions(t))}createEditorTokenizer(e){return new x(this.raw,e,this)}createStreamTokenizer(e){return new w(this.raw,this.resolveOptions(e))}async loadLanguages(e){this.assertNotDisposed(),_(await g(e.filter(e=>!this.attachedLanguages.has(e))),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let t;return e.every(e=>this.attachedLanguages.has(e)?!0:!u.has(e)&&(t??=this.raw.getLoadedLanguages(),t.includes(e)))}attachLanguages(e){this.assertNotDisposed();for(let t of e){if(this.attachedLanguages.has(t.name))continue;let e=t.data.find(e=>e.name===t.name||e.aliases?.includes(t.name)===!0);if(e==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${t.name}" as its name or an alias.`);this.raw.loadLanguageSync(t.data);try{this.raw.getLanguage(t.name)}catch{throw Error(`attachResolvedLanguages: "${e.name}" is already loaded without alias "${t.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(t.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:t,...n}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...n,theme:e};if(t==null)throw Error(`A theme or themes option is required`);for(let e of Object.values(t))this.getTheme(e);return{...n,themes:t}}};export{T as ShikiHighlighter};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./langs-Dr3LSnZI.js","./index-wTs3AdOj.js","./rolldown-runtime-XKyaHtl9.js","./preload-helper-DclECHGd.js","./lib-DHaWRzOq.js","./index-DuML4oGc.css","./engine-oniguruma-DEI4DY_o.js"])))=>i.map(i=>d[i]);
2
+ import{H as e,U as t,at as n,c as r,ct as i,lt as a,nt as o,ot as s,rt as c,s as l,st as u}from"./index-wTs3AdOj.js";import{t as d}from"./preload-helper-DclECHGd.js";import{n as f,t as p}from"./stream-tokenizer-C793Xkmg.js";async function m(e){if(typeof __DIFFS_WORKER__<`u`?__DIFFS_WORKER__:n())throw Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);let t=a.get(e);if(t!=null)return t;let r=(async()=>{let t=u.get(e);if(t==null){let{bundledLanguages:n}=await d(async()=>{let{bundledLanguages:e}=await import(`./langs-Dr3LSnZI.js`);return{bundledLanguages:e}},__vite__mapDeps([0,1,2,3,4,5]),import.meta.url);Object.prototype.hasOwnProperty.call(n,e)&&(t=n[e])}if(t==null)throw Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);let{default:n}=await t(),r={name:e,data:n};return i.has(e)||i.set(e,r),r})();a.set(e,r);try{return await r}finally{a.get(e)===r&&a.delete(e)}}function h(e){return i.get(e)??m(e)}async function g(e){let t=[],n=[];for(let r of e){if(r===`text`||r===`ansi`)continue;let e=h(r)??m(r);`then`in e?n.push(e):t.push(e)}return n.length>0&&await Promise.all(n).then(e=>{for(let n of e){if(n==null)throw Error(`resolvedLanguages: unable to resolve language`);t.push(n)}}),t}function _(e,t){for(let n of Array.isArray(e)?e:[e]){let e=i.get(n.name);e??(e=n,i.set(n.name,e)),t.attachLanguages([e]),s.add(e.name)}}function v(e,t){let n;return function(...r){clearTimeout(n),n=setTimeout(()=>e.apply(this,r),t)}}var y=0,b=0,x=class{backend;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=[t];#d=[];#f=0;#p=[];#m=-1;#h=!0;#g=!1;#_=0;#v=++b;#y=-1;#b=-1;#x;#S=0;#C=[];#w=!1;#T=v(async e=>{if(this.#l)return;let{startingLine:t=0,totalLines:n=1/0}=e??{},r=Math.min(n===1/0?1/0:t+n,this.#i.lineCount);if(this.#t==null&&!C(this.#i.languageId)){if(await this.backend?.loadLanguages([this.#i.languageId]),this.#l)return;this.#t=this.#e.getLanguage(this.#i.languageId)}this.#D(),this.#N(r)},500);#E=({data:e})=>{if(typeof e!=`object`||!e)return;let{type:t,tokenizerId:n,jobId:r}=e;t===`tokenize`&&n===this.#v&&typeof r==`number`&&r===this.#_&&(this.#y>=0?this.#z(r):this.#B(r))};getStringCommentRegexpRangesInLine(e){if(!this.#s||e<0||e>=this.#i.lineCount||(this.#O(),this.#t==null))return null;if(this.#C[e]===void 0){this.#R(e);let n=this.#u[e]??t,r=this.#P(e,n);this.#u[e+1]=r.state}return this.#C[e]??null}constructor(e,t,n){this.backend=n,this.#e=e,this.#i=t.textDocument,this.#n=t.theme,this.#r=[],this.#a=t.tokenizeMaxLineLength??1e3,this.#o=t.onDeferTokenize,this.#s=t.matchBrackets!==!1,this.#c=t.__debug??!1,this.#O(),this.#D()}setTheme(e){this.#n!==e&&(this.#n=e,this.#D(),this.stopBackgroundTokenize(),this.#u=[t],this.#d=[],this.#f=0,this.#p=[],this.#t!=null&&this.#i.lineCount>0&&this.#M(0))}#D(){if(this.#n===``)return;this.backend?.getTheme(this.#n);let{colorMap:e}=this.#e.setTheme(this.#n);this.#r=e}dispose(){this.#l=!0,this.stopBackgroundTokenize(),this.#A()}tokenize(e,n,r=!1){if(this.#O(),this.#D(),this.#t==null&&!C(this.#i.languageId))throw Error(`Grammar for language "${this.#i.languageId}" not loaded`);let{lineCount:i}=this.#i,{startingLine:a=0,totalLines:o=1/0}=n??{},s=o===1/0?i:Math.min(a+o,i),c=e.startLine,l=Math.max(a,c),u=n!=null&&o!==1/0&&e.lineDelta>0&&c<s&&e.endLine>=s,d=e.lineDelta===0&&(e.changedLineChanges?.every(([,,e])=>e===0)??!0);this.#s&&!d&&(this.#C.length=Math.min(this.#C.length,e.startLine));let f=r&&e.lineDelta!==0&&c>=a,p=d||n==null||c>=l,m=e.changedLineRanges??[[c,e.endLine]];this.#d=[],this.#f=0,this.#p=[];let h=-1;if(c<l)for(let[e,t]of m)e<l&&(h=Math.max(h,Math.min(t,l-1)));let g=h>=c&&(d||e.lineDelta<0);d?this.#R(c):(this.#I(e),(n==null||c>=l)&&this.#R(l));let _=0,v=m[_][1],y,b=0,x=d?m[_][0]:l,S=!1,w=new Map,T=g?new Map:void 0;if(T!=null&&!d){let e=Math.min(h+1,l,s);if(e>c){this.#R(e);let n=c,r=this.#u[n]??t;for(;n<e;n++){let e=this.#P(n,r);r=e.state,T.set(n,e.resolvedTokens)}this.#u[e]=r}}let E=this.#u[x]??t;for(;x<s;){let e=d?this.#u[x+1]:f?this.#L(x+1):void 0;p&&(this.#u[x]=E);let{resolvedTokens:t,state:n}=this.#P(x,E);if(E=n,x>=l?w.set(x,t):T?.set(x,t),p&&(this.#u[x+1]=E),S=x>=v&&(d||f)&&e!=null&&E.equals(e),S){_++;let e=m[_];if(e==null)break;if(e[0]>=s){y=e[0],b=_;break}let t=this.#u[e[0]];if(f)for(let n=x+2;n<=e[0]&&(t=this.#L(n),t!=null);n++)this.#u[n]=t;t==null?(v=e[1],x++):(x=e[0],E=t,v=e[1]),S=!1}else x++}if(p&&(x<s?this.#u[x+1]=E:this.#u[x]=E),S&&f&&y==null){for(let e=x+2;e<=i;e++){let t=this.#L(e);if(t==null)break;this.#u[e]=t}this.#d=[],this.#f=0,this.#p=[]}if(T!=null&&T.size>0&&this.#o(T),y!=null)this.#s&&d&&(this.#C.length=Math.min(this.#C.length,y)),this.#M(y,m,b);else if(!S&&x<i){let e=u&&c>=l?s:c<l&&!d?c:x;this.#s&&d&&(this.#C.length=Math.min(this.#C.length,e)),this.#M(e,m,_)}return w}prebuildStateStack(e){this.#O(),this.#T(e)}stopBackgroundTokenize(){this.#b=-1,this.#h||(this.#h=!0,this.#g=!1,this.#m=-1,this.#y=-1,this.#x=void 0,this.#S=0,this.#d=[],this.#f=0,this.#p=[],this.#A())}pauseBackgroundTokenize(){this.#h||this.#g||(this.#c&&console.log(`[diffs/editor] background tokenization paused`,{jobId:this.#_}),this.#g=!0)}resumeBackgroundTokenize(){this.#h||!this.#g||this.#t==null||this.#m<0||(this.#c&&console.log(`[diffs/editor] background tokenization resumed`,{jobId:this.#_}),this.#g=!1,this.#j(this.#_))}#O(){this.#t==null&&!C(this.#i.languageId)&&this.#e.getLoadedLanguages().includes(this.#i.languageId)&&(this.#t=this.#e.getLanguage(this.#i.languageId))}#k(){this.#w||=(globalThis.addEventListener(`message`,this.#E),!0)}#A(){this.#w&&=(globalThis.removeEventListener(`message`,this.#E),!1)}#j(e){globalThis.postMessage({type:`tokenize`,tokenizerId:this.#v,jobId:e})}#M(e,t,n=0){if(C(this.#i.languageId))return;let r=++this.#_;this.#c&&console.log(`[diffs/editor] background tokenization scheduled`,{jobId:r,startLine:e,changedLineRanges:t,changedRangeIndex:n}),this.#h=!1,this.#g=!1,this.#m=e,this.#y>=0&&(this.#b=Math.max(this.#b,this.#y)),this.#y=-1,this.#x=t,this.#S=n,this.#k(),this.#j(r)}#N(e){if(this.#t==null||this.#u.length>e)return;if(!this.#h){this.#y>=0?this.#y=Math.max(this.#y,e):this.#b=Math.max(this.#b,e);return}let t=++this.#_;this.#h=!1,this.#g=!1,this.#m=this.#u.length-1,this.#y=e,this.#b=-1,this.#x=void 0,this.#S=0,this.#k(),this.#j(t)}#P(e,t){let n=this.#i.getLineText(e);if(n.length>=this.#a)return console.warn(`[diffs] Line(${e}) too long to tokenize: ${n.length}`),this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};if(this.#t==null||n===``||n.trim()===``)return this.#F(e,null),{resolvedTokens:[[0,``,n]],state:t};let r=S(this.#t,this.#r,n,t,y,this.#s);return this.#F(e,r.bracketIgnoredRanges),{resolvedTokens:r.resolvedTokens,state:r.ruleStack}}#F(e,t){this.#s&&(this.#C[e]=t)}#I(e){let t=e.changedLineChanges??[[e.startLine,e.endLine,e.lineDelta]],n=e.startLine+1;n<=this.#u.length-n?(this.#d=this.#u,this.#f=0,this.#u=this.#u.slice(0,n)):(this.#f=n,this.#d=this.#u.slice(n),this.#u.length=Math.min(this.#u.length,n)),this.#p=t}#L(e){let t=e;for(let n=this.#p.length-1;n>=0;n--){let[r,i,a]=this.#p[n];if(a!==0){if(t>i)t-=a;else if(t>r)return this.#u[e]}}return this.#d[t-this.#f]??this.#u[e]}#R(e,n){let r=Math.min(Math.max(0,e),this.#i.lineCount);if(this.#u.length>r||this.#t==null)return!0;let i=n==null?0:performance.now(),a=this.#u.length-1,o=this.#u[a]??t;for(;a<r;){this.#u[a]=o;let e=this.#i.getLineText(a);if(e.length<this.#a&&e!==``&&e.trim()!==``){let t=S(this.#t,this.#r,e,o,y,this.#s,!1);this.#F(a,t.bracketIgnoredRanges),o=t.ruleStack}else this.#F(a,null);if(a++,this.#u[a]=o,n!=null&&performance.now()-i>n)break}return a>=r}#z(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let t=this.#R(this.#y,1);this.#h||this.#g||e!==this.#_||(t?this.stopBackgroundTokenize():(this.#m=this.#u.length-1,this.#j(e)))}#B(e){if(this.#h||this.#g||this.#t==null||e!==this.#_)return;this.#D();let n=performance.now(),r=new Map,i=this.#i.lineCount,a=this.#x,o=this.#m,s=this.#u[o]??t,c=!1,l=this.#S,u=a?.[l]?.[1];for(;o<i;){this.#u[o]=s;let e=u==null?void 0:this.#L(o+1),t=this.#P(o,s);if(r.set(o,t.resolvedTokens),s=t.state,this.#u[o+1]=s,c=u!=null&&o>=u&&e!=null&&s.equals(e),o++,c){l++;let e=a?.[l];if(e==null)break;if(u=e[1],this.#u[e[0]]==null)c=!1;else{o=e[0],s=this.#u[o]??s,c=!1;continue}}if(performance.now()-n>1)break}if(this.#o(r),!(this.#h||this.#g||e!==this.#_)){if(c||o>=i){let e=this.#b;this.stopBackgroundTokenize(),e>=0&&this.#N(e)}else this.#m=o,this.#S=l,this.#j(e)}}};function S(t,n,r,i,a,o=!0,s=!0){let c=t.tokenizeLine2(r,i,a);c.stoppedEarly&&console.warn(`[diffs] Time limit reached when tokenizing line: ${r.substring(0,100)}`);let l=c.tokens,u=l.length/2,d=[],f=[];if(!s&&!o)return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f};for(let t=0;t<u;t++){let i=l[2*t],a=t+1<u?l[2*t+2]:r.length;if(i===a)continue;let c=l[2*t+1];if(s){let t=e.getForeground(c);d.push([i,n[t],r.slice(i,a)])}o&&e.getTokenType(c)>0&&f.push([i,a])}return{ruleStack:c.ruleStack,resolvedTokens:d,bracketIgnoredRanges:f}}function C(e){return e===`text`||e===`ansi`}var w=class e extends p{highlighter;options;#e=``;#t;constructor(e,t){super(),this.highlighter=e,this.options=t}tokenizeChunk(e,t){let n=(this.#e+e).split(/(\r\n|\r|\n)/),r=[];for(let e=0;e<n.length;e+=2){let i=n[e],a=this.highlighter.codeToTokens(i,{...this.options,grammarState:this.#t}),s=a.tokens[0].map(e=>({...e,offset:e.offset+this.stableOffset}));e+1<n.length?(o(t,s),this.pushLineBreak(t,i.length,n[e+1]),this.#t=a.grammarState):(r=s,this.#e=i)}return{unstable:r,tailLength:this.#e.length}}clone(){this.assertActive();let t=new e(this.highlighter,this.options);return this.copyStateTo(t),t.#e=this.#e,t.#t=this.#t,t}resetSource(){this.#e=``,this.#t=void 0}releaseSource(){this.resetSource()}},T=class e extends f{raw;loadedThemes=new Map;attachedLanguages=new Set([`text`,`ansi`]);static async create(t){let n=t===`shiki-wasm`?(await d(async()=>{let{createOnigurumaEngine:e}=await import(`./engine-oniguruma-DEI4DY_o.js`);return{createOnigurumaEngine:e}},__vite__mapDeps([6,1,2,3,4,5]),import.meta.url)).createOnigurumaEngine(d(()=>import(`./wasm-4KdTHw0F.js`),[],import.meta.url)):(await d(async()=>{let{createJavaScriptRegexEngine:e}=await import(`./engine-javascript-DKxkqixV.js`);return{createJavaScriptRegexEngine:e}},[],import.meta.url)).createJavaScriptRegexEngine(),i=await r({themes:[],langs:[],engine:n});return new e(t,i)}constructor(e,t){super(e,c(e)),this.raw=t}getTheme(e){this.assertNotDisposed();let t=this.loadedThemes.get(e),n=this.themeResolver.getResolvedTheme(e)??t;if(n==null)throw Error(`Theme "${e}" has not been resolved`);if(t!==n){let t=n.textmate??(n.cssVariables==null?void 0:l(n.cssVariables));if(t==null)throw Error(`Theme "${e}" does not support Shiki`);this.raw.setTheme({...t,name:e}),this.loadedThemes.set(e,n)}return n}codeToTokens(e,t){return this.raw.codeToTokens(e,this.resolveOptions(t))}createEditorTokenizer(e){return new x(this.raw,e,this)}createStreamTokenizer(e){return new w(this.raw,this.resolveOptions(e))}async loadLanguages(e){this.assertNotDisposed(),_(await g(e.filter(e=>!this.attachedLanguages.has(e))),this)}hasLoadedLanguages(e){if(this.disposed)return!1;let t;return e.every(e=>this.attachedLanguages.has(e)?!0:!u.has(e)&&(t??=this.raw.getLoadedLanguages(),t.includes(e)))}attachLanguages(e){this.assertNotDisposed();for(let t of e){if(this.attachedLanguages.has(t.name))continue;let e=t.data.find(e=>e.name===t.name||e.aliases?.includes(t.name)===!0);if(e==null)throw Error(`attachResolvedLanguages: No returned grammar declares "${t.name}" as its name or an alias.`);this.raw.loadLanguageSync(t.data);try{this.raw.getLanguage(t.name)}catch{throw Error(`attachResolvedLanguages: "${e.name}" is already loaded without alias "${t.name}". Load the alias first or give the grammar a unique name.`)}this.attachedLanguages.add(t.name)}}releaseResources(){this.loadedThemes.clear(),this.attachedLanguages.clear(),this.raw.dispose()}resolveOptions({theme:e,themes:t,...n}){if(this.assertNotDisposed(),e!=null)return this.getTheme(e),{...n,theme:e};if(t==null)throw Error(`A theme or themes option is required`);for(let e of Object.values(t))this.getTheme(e);return{...n,themes:t}}};export{T as ShikiHighlighter};
@@ -1,4 +1,4 @@
1
- import{$ as e,dt as t,et as n,ft as r,ut as i}from"./index-bu2WOD1Y.js";function a(t,r,i,a=!1){let o=[0];if(i.decorations?.some(e=>typeof e.start==`number`||typeof e.end==`number`)===!0)for(let e=t.indexOf(`
1
+ import{$ as e,dt as t,et as n,ft as r,ut as i}from"./index-wTs3AdOj.js";function a(t,r,i,a=!1){let o=[0];if(i.decorations?.some(e=>typeof e.start==`number`||typeof e.end==`number`)===!0)for(let e=t.indexOf(`
2
2
  `);e!==-1;e=t.indexOf(`
3
3
  `,e+1))o.push(e+1);let s={type:`element`,tagName:`code`,properties:{},children:[]},c=n(r.tokens,{decorations:i.decorations,mergeWhitespaces:i.mergeWhitespaces,lineOffsets:o,cacheHtmlStyles:a});for(let e=0;e<c.length;e++)e>0&&s.children.push({type:`text`,value:`
4
4
  `}),s.children.push(c[e]);let l={type:`root`,children:[{type:`element`,tagName:`pre`,properties:{class:`diffs`,style:r.rootStyle===!1?void 0:r.rootStyle??[r.fg==null?``:`color:${r.fg}`,r.bg==null?``:`background-color:${r.bg}`].filter(Boolean).join(`;`),tabIndex:0},children:[s]}]};return e(l)}var o=class{name;themeResolver;disposed=!1;constructor(e,n){this.name=e,this.themeResolver=n,t(e)}codeToHtml(e,t){return a(e,this.codeToTokens(e,t),t,this.name===`highlights`)}get isDisposed(){return this.disposed}dispose(){this.disposed||(this.disposed=!0,this.releaseResources(),r())}assertNotDisposed(){if(this.disposed)throw new i}},s=class{disposed=!1;stableOffset=0;unstable=[];pendingCarriageReturn=``;enqueue(e){this.assertActive(),e=this.pendingCarriageReturn+e,this.pendingCarriageReturn=e.endsWith(`\r`)?`\r`:``,this.pendingCarriageReturn!==``&&(e=e.slice(0,-1));let t=this.unstable.length,n=[],{unstable:r,tailLength:i}=this.tokenizeChunk(e,n);return this.pendingCarriageReturn!==``&&r.push({content:`\r`,offset:this.stableOffset+i}),this.unstable=r,{recall:t,stable:n,unstable:r}}pushLineBreak(e,t,n){for(let r=0;r<n.length;r++)e.push({content:n[r],offset:this.stableOffset+t+r});this.stableOffset+=t+n.length}close(){let e=this.unstable;return this.dispose(),{stable:e}}clear(){this.assertActive(),this.stableOffset=0,this.unstable=[],this.pendingCarriageReturn=``,this.resetSource()}dispose(){this.disposed||(this.disposed=!0,this.unstable=[],this.releaseSource())}copyStateTo(e){e.stableOffset=this.stableOffset,e.unstable=this.unstable.slice(),e.pendingCarriageReturn=this.pendingCarriageReturn}assertActive(){if(this.disposed)throw Error(`stream tokenizer is disposed`)}};export{o as n,s as t};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./core-BfpRGcqe.js","./index-bu2WOD1Y.js","./rolldown-runtime-XKyaHtl9.js","./preload-helper-DclECHGd.js","./lib-BKZ5ZaMU.js","./index-DuML4oGc.css"])))=>i.map(i=>d[i]);
2
- import{it as e}from"./index-bu2WOD1Y.js";import{t}from"./preload-helper-DclECHGd.js";function n(e){let t=[],i=new Set;for(let n of r(e.themes)){let e=o(n)?n.getThemes():[n];for(let n of e){if(i.has(n.name))throw Error(`Theme collection already contains theme "${n.name}"`);i.add(n.name),t.push(n)}}let a=Object.freeze([...t]),s=Object.freeze(a.filter(e=>e.colorScheme===`light`)),c=Object.freeze(a.filter(e=>e.colorScheme===`dark`)),l=new Map(a.map(e=>[e.name,e])),u=Object.freeze(a.map(e=>e.name)),d=Object.freeze(s.map(e=>e.name)),f=Object.freeze(c.map(e=>e.name));function p(e){if(e==null)return a;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?s:t===`dark`?c:a:a.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return l.get(e)},getThemes(e){return p(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?d:e?.colorScheme===`dark`?f:u:p(e).map(e=>e.name)},hasTheme(e){return l.has(e)},orderBy(e){return n({themes:a.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],r=new Set;for(let n of e){if(r.has(n))throw Error(`Theme collection pick already includes theme "${n}"`);r.add(n);let e=l.get(n);if(e==null)throw Error(`Theme collection does not contain theme "${n}"`);t.push(e)}return n({themes:t})},registerInto(e){for(let t of a)e.registerThemeIfAbsent(t.name,t.load)}}}function r(e){return i(e)?[e]:e}function i(e){return o(e)||a(e)}function a(e){return typeof e.name==`string`&&typeof e.load==`function`}function o(e){return typeof e.getThemes==`function`}function s({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:c(t)}}function c(n){return async()=>{let[r,{normalizeTheme:i}]=await Promise.all([n(),t(()=>import(`./core-BfpRGcqe.js`),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)]);return i(e(r))}}var l=`pierre`,u=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],d=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],f=[...d,...u],p=new Set(d);function m(e){return p.has(e)?`light`:`dark`}var h={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},g={"pierre-dark":()=>t(()=>import(`./pierre-dark-CpLgRqie.js`),[],import.meta.url),"pierre-dark-soft":()=>t(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[],import.meta.url),"pierre-dark-vibrant":()=>t(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>t(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[],import.meta.url),"pierre-dark-tritanopia":()=>t(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[],import.meta.url),"pierre-light":()=>t(()=>import(`./pierre-light-CoaEpmwp.js`),[],import.meta.url),"pierre-light-soft":()=>t(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[],import.meta.url),"pierre-light-vibrant":()=>t(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>t(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[],import.meta.url),"pierre-light-tritanopia":()=>t(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[],import.meta.url)};function _(e){return s({name:e,collection:l,colorScheme:m(e),displayName:h[e],load:g[e]})}var v=n({themes:f.map(e=>_(e))}),y=`shiki`,b=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],x=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),S=new Set(b);function C(e){return S.has(e)?`light`:`dark`}var w={andromeeda:()=>t(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url),"aurora-x":()=>t(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url),"ayu-dark":()=>t(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url),"ayu-light":()=>t(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url),"ayu-mirage":()=>t(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url),"catppuccin-frappe":()=>t(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url),"catppuccin-latte":()=>t(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url),"catppuccin-macchiato":()=>t(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url),"catppuccin-mocha":()=>t(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url),"dark-plus":()=>t(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url),dracula:()=>t(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url),"dracula-soft":()=>t(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url),"everforest-dark":()=>t(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url),"everforest-light":()=>t(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url),"github-dark":()=>t(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url),"github-dark-default":()=>t(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url),"github-dark-dimmed":()=>t(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url),"github-dark-high-contrast":()=>t(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url),"github-light":()=>t(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url),"github-light-default":()=>t(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url),"github-light-high-contrast":()=>t(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url),"gruvbox-dark-hard":()=>t(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url),"gruvbox-dark-medium":()=>t(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url),"gruvbox-dark-soft":()=>t(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url),"gruvbox-light-hard":()=>t(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url),"gruvbox-light-medium":()=>t(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url),"gruvbox-light-soft":()=>t(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url),horizon:()=>t(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url),"horizon-bright":()=>t(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url),houston:()=>t(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url),"kanagawa-dragon":()=>t(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url),"kanagawa-lotus":()=>t(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url),"kanagawa-wave":()=>t(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url),laserwave:()=>t(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url),"light-plus":()=>t(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url),"material-theme":()=>t(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url),"material-theme-darker":()=>t(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url),"material-theme-lighter":()=>t(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url),"material-theme-ocean":()=>t(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url),"material-theme-palenight":()=>t(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url),"min-dark":()=>t(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url),"min-light":()=>t(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url),monokai:()=>t(()=>import(`./monokai-BscAjiQZ.js`),[],import.meta.url),"night-owl":()=>t(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url),"night-owl-light":()=>t(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url),nord:()=>t(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url),"one-dark-pro":()=>t(()=>import(`./one-dark-pro-C6YyR8OD.js`),[],import.meta.url),"one-light":()=>t(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url),plastic:()=>t(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url),poimandres:()=>t(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url),red:()=>t(()=>import(`./red-CYlAq2b0.js`),[],import.meta.url),"rose-pine":()=>t(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url),"rose-pine-dawn":()=>t(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url),"rose-pine-moon":()=>t(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url),"slack-dark":()=>t(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url),"slack-ochin":()=>t(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url),"snazzy-light":()=>t(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url),"solarized-dark":()=>t(()=>import(`./solarized-dark-b97czJOk.js`),[],import.meta.url),"solarized-light":()=>t(()=>import(`./solarized-light-DFPxpIYQ.js`),[],import.meta.url),"synthwave-84":()=>t(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url),"tokyo-night":()=>t(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url),vesper:()=>t(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url),"vitesse-black":()=>t(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url),"vitesse-dark":()=>t(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url),"vitesse-light":()=>t(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url)};function T(e){return s({name:e,collection:y,colorScheme:C(e),load:w[e]})}var E=n({themes:Object.freeze([...b.map(e=>T(e)),...x.map(e=>T(e))])}),D=n({themes:[v,E]});export{s as createTheme,v as pierreThemes,E as shikiThemes,D as themes};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./core-CEX1B8U5.js","./index-wTs3AdOj.js","./rolldown-runtime-XKyaHtl9.js","./preload-helper-DclECHGd.js","./lib-DHaWRzOq.js","./index-DuML4oGc.css"])))=>i.map(i=>d[i]);
2
+ import{it as e}from"./index-wTs3AdOj.js";import{t}from"./preload-helper-DclECHGd.js";function n(e){let t=[],i=new Set;for(let n of r(e.themes)){let e=o(n)?n.getThemes():[n];for(let n of e){if(i.has(n.name))throw Error(`Theme collection already contains theme "${n.name}"`);i.add(n.name),t.push(n)}}let a=Object.freeze([...t]),s=Object.freeze(a.filter(e=>e.colorScheme===`light`)),c=Object.freeze(a.filter(e=>e.colorScheme===`dark`)),l=new Map(a.map(e=>[e.name,e])),u=Object.freeze(a.map(e=>e.name)),d=Object.freeze(s.map(e=>e.name)),f=Object.freeze(c.map(e=>e.name));function p(e){if(e==null)return a;let{colorScheme:t,collection:n}=e;return n==null?t===`light`?s:t===`dark`?c:a:a.filter(e=>e.collection===n?t==null||e.colorScheme===t:!1)}return{getTheme(e){return l.get(e)},getThemes(e){return p(e)},getThemeNames(e){return e?.collection==null?e?.colorScheme===`light`?d:e?.colorScheme===`dark`?f:u:p(e).map(e=>e.name)},hasTheme(e){return l.has(e)},orderBy(e){return n({themes:a.map((e,t)=>({descriptor:e,index:t})).sort((t,n)=>{let r=e(t.descriptor,n.descriptor);return r===0?t.index-n.index:r}).map(e=>e.descriptor)})},pick(e){let t=[],r=new Set;for(let n of e){if(r.has(n))throw Error(`Theme collection pick already includes theme "${n}"`);r.add(n);let e=l.get(n);if(e==null)throw Error(`Theme collection does not contain theme "${n}"`);t.push(e)}return n({themes:t})},registerInto(e){for(let t of a)e.registerThemeIfAbsent(t.name,t.load)}}}function r(e){return i(e)?[e]:e}function i(e){return o(e)||a(e)}function a(e){return typeof e.name==`string`&&typeof e.load==`function`}function o(e){return typeof e.getThemes==`function`}function s({name:e,load:t,colorScheme:n,collection:r,displayName:i}){return{name:e,colorScheme:n,collection:r,displayName:i,load:c(t)}}function c(n){return async()=>{let[r,{normalizeTheme:i}]=await Promise.all([n(),t(()=>import(`./core-CEX1B8U5.js`),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)]);return i(e(r))}}var l=`pierre`,u=[`pierre-dark`,`pierre-dark-soft`,`pierre-dark-vibrant`,`pierre-dark-protanopia-deuteranopia`,`pierre-dark-tritanopia`],d=[`pierre-light`,`pierre-light-soft`,`pierre-light-vibrant`,`pierre-light-protanopia-deuteranopia`,`pierre-light-tritanopia`],f=[...d,...u],p=new Set(d);function m(e){return p.has(e)?`light`:`dark`}var h={"pierre-dark":`Pierre Dark`,"pierre-dark-soft":`Pierre Dark Soft`,"pierre-dark-vibrant":`Pierre Dark Vibrant`,"pierre-dark-protanopia-deuteranopia":`Pierre Dark Protanopia & Deuteranopia`,"pierre-dark-tritanopia":`Pierre Dark Tritanopia`,"pierre-light":`Pierre Light`,"pierre-light-soft":`Pierre Light Soft`,"pierre-light-vibrant":`Pierre Light Vibrant`,"pierre-light-protanopia-deuteranopia":`Pierre Light Protanopia & Deuteranopia`,"pierre-light-tritanopia":`Pierre Light Tritanopia`},g={"pierre-dark":()=>t(()=>import(`./pierre-dark-CpLgRqie.js`),[],import.meta.url),"pierre-dark-soft":()=>t(()=>import(`./pierre-dark-soft-kZQmAZld.js`),[],import.meta.url),"pierre-dark-vibrant":()=>t(()=>import(`./pierre-dark-vibrant-CpQYzh95.js`),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>t(()=>import(`./pierre-dark-protanopia-deuteranopia-B35FxJx-.js`),[],import.meta.url),"pierre-dark-tritanopia":()=>t(()=>import(`./pierre-dark-tritanopia-CpjhbsIL.js`),[],import.meta.url),"pierre-light":()=>t(()=>import(`./pierre-light-CoaEpmwp.js`),[],import.meta.url),"pierre-light-soft":()=>t(()=>import(`./pierre-light-soft-lWLdNTOI.js`),[],import.meta.url),"pierre-light-vibrant":()=>t(()=>import(`./pierre-light-vibrant-D80Fkn33.js`),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>t(()=>import(`./pierre-light-protanopia-deuteranopia-0fSaH845.js`),[],import.meta.url),"pierre-light-tritanopia":()=>t(()=>import(`./pierre-light-tritanopia-CEbqgOJL.js`),[],import.meta.url)};function _(e){return s({name:e,collection:l,colorScheme:m(e),displayName:h[e],load:g[e]})}var v=n({themes:f.map(e=>_(e))}),y=`shiki`,b=[`ayu-light`,`catppuccin-latte`,`everforest-light`,`github-light`,`github-light-default`,`github-light-high-contrast`,`gruvbox-light-hard`,`gruvbox-light-medium`,`gruvbox-light-soft`,`horizon-bright`,`kanagawa-lotus`,`light-plus`,`material-theme-lighter`,`min-light`,`night-owl-light`,`one-light`,`rose-pine-dawn`,`slack-ochin`,`snazzy-light`,`solarized-light`,`vitesse-light`],x=`andromeeda.aurora-x.ayu-dark.ayu-mirage.catppuccin-frappe.catppuccin-macchiato.catppuccin-mocha.dark-plus.dracula.dracula-soft.everforest-dark.github-dark.github-dark-default.github-dark-dimmed.github-dark-high-contrast.gruvbox-dark-hard.gruvbox-dark-medium.gruvbox-dark-soft.horizon.houston.kanagawa-dragon.kanagawa-wave.laserwave.material-theme.material-theme-darker.material-theme-ocean.material-theme-palenight.min-dark.monokai.night-owl.nord.one-dark-pro.plastic.poimandres.red.rose-pine.rose-pine-moon.slack-dark.solarized-dark.synthwave-84.tokyo-night.vesper.vitesse-black.vitesse-dark`.split(`.`),S=new Set(b);function C(e){return S.has(e)?`light`:`dark`}var w={andromeeda:()=>t(()=>import(`./andromeeda-vGVdxbeo.js`),[],import.meta.url),"aurora-x":()=>t(()=>import(`./aurora-x-CDeNXAV0.js`),[],import.meta.url),"ayu-dark":()=>t(()=>import(`./ayu-dark-DluEY0Gj.js`),[],import.meta.url),"ayu-light":()=>t(()=>import(`./ayu-light-C3h-C4tm.js`),[],import.meta.url),"ayu-mirage":()=>t(()=>import(`./ayu-mirage-Bqwy1Gya.js`),[],import.meta.url),"catppuccin-frappe":()=>t(()=>import(`./catppuccin-frappe-C9Q5zVZY.js`),[],import.meta.url),"catppuccin-latte":()=>t(()=>import(`./catppuccin-latte-CtsyrtPq.js`),[],import.meta.url),"catppuccin-macchiato":()=>t(()=>import(`./catppuccin-macchiato-R8nAf1vR.js`),[],import.meta.url),"catppuccin-mocha":()=>t(()=>import(`./catppuccin-mocha-DjuaAJKi.js`),[],import.meta.url),"dark-plus":()=>t(()=>import(`./dark-plus-Cs2F2srj.js`),[],import.meta.url),dracula:()=>t(()=>import(`./dracula-BHWKrbxM.js`),[],import.meta.url),"dracula-soft":()=>t(()=>import(`./dracula-soft-5eyTD99u.js`),[],import.meta.url),"everforest-dark":()=>t(()=>import(`./everforest-dark-sB-x3p7T.js`),[],import.meta.url),"everforest-light":()=>t(()=>import(`./everforest-light-Df2xbC6M.js`),[],import.meta.url),"github-dark":()=>t(()=>import(`./github-dark-C-LZuMrd.js`),[],import.meta.url),"github-dark-default":()=>t(()=>import(`./github-dark-default-DXG-b-1a.js`),[],import.meta.url),"github-dark-dimmed":()=>t(()=>import(`./github-dark-dimmed-Bx1FflLF.js`),[],import.meta.url),"github-dark-high-contrast":()=>t(()=>import(`./github-dark-high-contrast-B_tTalzw.js`),[],import.meta.url),"github-light":()=>t(()=>import(`./github-light-EUqPIrTm.js`),[],import.meta.url),"github-light-default":()=>t(()=>import(`./github-light-default-BXViO-2h.js`),[],import.meta.url),"github-light-high-contrast":()=>t(()=>import(`./github-light-high-contrast-B68TUdTA.js`),[],import.meta.url),"gruvbox-dark-hard":()=>t(()=>import(`./gruvbox-dark-hard-C820rvS2.js`),[],import.meta.url),"gruvbox-dark-medium":()=>t(()=>import(`./gruvbox-dark-medium-BPjhmG05.js`),[],import.meta.url),"gruvbox-dark-soft":()=>t(()=>import(`./gruvbox-dark-soft-MrdJrrXF.js`),[],import.meta.url),"gruvbox-light-hard":()=>t(()=>import(`./gruvbox-light-hard-BC_s9l72.js`),[],import.meta.url),"gruvbox-light-medium":()=>t(()=>import(`./gruvbox-light-medium-BAWPOn9u.js`),[],import.meta.url),"gruvbox-light-soft":()=>t(()=>import(`./gruvbox-light-soft-BSMLrYjP.js`),[],import.meta.url),horizon:()=>t(()=>import(`./horizon-CE9ld1lL.js`),[],import.meta.url),"horizon-bright":()=>t(()=>import(`./horizon-bright-DSNQnXHK.js`),[],import.meta.url),houston:()=>t(()=>import(`./houston-CsvMBhTu.js`),[],import.meta.url),"kanagawa-dragon":()=>t(()=>import(`./kanagawa-dragon-Bozd7klA.js`),[],import.meta.url),"kanagawa-lotus":()=>t(()=>import(`./kanagawa-lotus-BmuOG9ZW.js`),[],import.meta.url),"kanagawa-wave":()=>t(()=>import(`./kanagawa-wave-BML5mF2J.js`),[],import.meta.url),laserwave:()=>t(()=>import(`./laserwave-C_8bwKvT.js`),[],import.meta.url),"light-plus":()=>t(()=>import(`./light-plus-DVQuIRkW.js`),[],import.meta.url),"material-theme":()=>t(()=>import(`./material-theme-Bm3Qr25_.js`),[],import.meta.url),"material-theme-darker":()=>t(()=>import(`./material-theme-darker-2IIEA8gg.js`),[],import.meta.url),"material-theme-lighter":()=>t(()=>import(`./material-theme-lighter-uhdI0v04.js`),[],import.meta.url),"material-theme-ocean":()=>t(()=>import(`./material-theme-ocean-CHQ94UKr.js`),[],import.meta.url),"material-theme-palenight":()=>t(()=>import(`./material-theme-palenight-B5W6OYN7.js`),[],import.meta.url),"min-dark":()=>t(()=>import(`./min-dark-BSWPekZh.js`),[],import.meta.url),"min-light":()=>t(()=>import(`./min-light-DDpmG2fV.js`),[],import.meta.url),monokai:()=>t(()=>import(`./monokai-BscAjiQZ.js`),[],import.meta.url),"night-owl":()=>t(()=>import(`./night-owl-DhmEMT88.js`),[],import.meta.url),"night-owl-light":()=>t(()=>import(`./night-owl-light-eJ-hLW7d.js`),[],import.meta.url),nord:()=>t(()=>import(`./nord-Cb4Vim4T.js`),[],import.meta.url),"one-dark-pro":()=>t(()=>import(`./one-dark-pro-C6YyR8OD.js`),[],import.meta.url),"one-light":()=>t(()=>import(`./one-light-D7Lr4KcI.js`),[],import.meta.url),plastic:()=>t(()=>import(`./plastic-DQwYfKfQ.js`),[],import.meta.url),poimandres:()=>t(()=>import(`./poimandres-DRFjx7u4.js`),[],import.meta.url),red:()=>t(()=>import(`./red-CYlAq2b0.js`),[],import.meta.url),"rose-pine":()=>t(()=>import(`./rose-pine-aMsaMD1D.js`),[],import.meta.url),"rose-pine-dawn":()=>t(()=>import(`./rose-pine-dawn-8PwUyIlP.js`),[],import.meta.url),"rose-pine-moon":()=>t(()=>import(`./rose-pine-moon-DO-qXg-I.js`),[],import.meta.url),"slack-dark":()=>t(()=>import(`./slack-dark-DnToyrRv.js`),[],import.meta.url),"slack-ochin":()=>t(()=>import(`./slack-ochin-B2OO5cIa.js`),[],import.meta.url),"snazzy-light":()=>t(()=>import(`./snazzy-light-4G7pJPwS.js`),[],import.meta.url),"solarized-dark":()=>t(()=>import(`./solarized-dark-b97czJOk.js`),[],import.meta.url),"solarized-light":()=>t(()=>import(`./solarized-light-DFPxpIYQ.js`),[],import.meta.url),"synthwave-84":()=>t(()=>import(`./synthwave-84-nFMaYfgc.js`),[],import.meta.url),"tokyo-night":()=>t(()=>import(`./tokyo-night-oM2G3aXe.js`),[],import.meta.url),vesper:()=>t(()=>import(`./vesper-DdrHHSXu.js`),[],import.meta.url),"vitesse-black":()=>t(()=>import(`./vitesse-black-fwtXNY1n.js`),[],import.meta.url),"vitesse-dark":()=>t(()=>import(`./vitesse-dark-BZCL-v6S.js`),[],import.meta.url),"vitesse-light":()=>t(()=>import(`./vitesse-light-VbXTXTou.js`),[],import.meta.url)};function T(e){return s({name:e,collection:y,colorScheme:C(e),load:w[e]})}var E=n({themes:Object.freeze([...b.map(e=>T(e)),...x.map(e=>T(e))])}),D=n({themes:[v,E]});export{s as createTheme,v as pierreThemes,E as shikiThemes,D as themes};
@@ -4,10 +4,10 @@
4
4
  <meta charset="utf-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1" />
6
6
  <title>Tau diff tool</title>
7
- <script type="module" crossorigin src="./assets/index-bu2WOD1Y.js"></script>
7
+ <script type="module" crossorigin src="./assets/index-wTs3AdOj.js"></script>
8
8
  <link rel="modulepreload" crossorigin href="./assets/rolldown-runtime-XKyaHtl9.js">
9
9
  <link rel="modulepreload" crossorigin href="./assets/preload-helper-DclECHGd.js">
10
- <link rel="modulepreload" crossorigin href="./assets/lib-BKZ5ZaMU.js">
10
+ <link rel="modulepreload" crossorigin href="./assets/lib-DHaWRzOq.js">
11
11
  <link rel="stylesheet" crossorigin href="./assets/index-DuML4oGc.css">
12
12
  </head>
13
13
  <body>
@@ -33,7 +33,9 @@ const MAX_READ_LIMIT = 100;
33
33
  const MAX_READ_PAGE_PAYLOAD_BYTES = 12 * 1024 * 1024;
34
34
  const MAX_TREE_DEPTH = 8;
35
35
  const MAX_TREE_DESCENDANTS = 200;
36
- const CHILD_COUNT_COLUMN = "(SELECT COUNT(*) FROM sessions c WHERE c.parent_session_id = s.session_id) AS child_count";
36
+ const SESSION_METADATA_COLUMNS = `(SELECT COUNT(*) FROM sessions c WHERE c.parent_session_id = s.session_id) AS child_count,
37
+ (SELECT e.entry_id FROM entries e WHERE e.session_id = s.session_id
38
+ ORDER BY e.position DESC LIMIT 1) AS last_entry_id`;
37
39
  const VIEWER_USERNAME = "tau";
38
40
  const VIEWER_SEARCH_PAGE_SIZE = 20;
39
41
  const VIEWER_READ_PAGE_PAYLOAD_BYTES = 512 * 1024;
@@ -69,9 +71,11 @@ function invalidRequest(message) {
69
71
  export default {
70
72
  async fetch(request, env, _context) {
71
73
  const url = new URL(request.url);
74
+ const viewerEntriesRoute = /^\/sessions\/[^/]+\/entries$/.test(url.pathname);
72
75
  const viewerRoute = url.pathname === "/" ||
73
76
  url.pathname === "/viewer.js" ||
74
- /^\/sessions\/[^/]+(?:\/entries)?$/.test(url.pathname);
77
+ viewerEntriesRoute ||
78
+ /^\/sessions\/[^/]+$/.test(url.pathname);
75
79
  if (viewerRoute && url.protocol === "http:" && !isLoopbackHost(url.hostname)) {
76
80
  return redirectViewerToHttps(url);
77
81
  }
@@ -116,17 +120,25 @@ export default {
116
120
  }
117
121
  if (url.pathname === "/")
118
122
  return await renderViewerIndex(env.DB, url);
119
- if (/^\/sessions\/[^/]+\/entries$/.test(url.pathname))
123
+ if (viewerEntriesRoute)
120
124
  return await readViewerEntries(env.DB, url);
121
125
  return await renderViewerSession(env.DB, url);
122
126
  }
123
127
  catch (caught) {
124
128
  if (caught instanceof HistoryApiError) {
129
+ if (viewerEntriesRoute) {
130
+ return viewerJson({ error: { code: caught.code, message: caught.message } }, caught.status);
131
+ }
125
132
  return viewerRoute
126
133
  ? viewerError(caught.message, caught.status)
127
134
  : error(caught.code, caught.message, caught.status, operationId);
128
135
  }
129
136
  logWorkerError("history_request_failed", caught, { pathname: url.pathname });
137
+ if (caught instanceof Error && /D1 DB is overloaded/i.test(caught.message)) {
138
+ return viewerRoute
139
+ ? viewerError("History is temporarily overloaded", 503)
140
+ : error("overloaded", "History is temporarily overloaded", 503, operationId);
141
+ }
130
142
  return viewerRoute
131
143
  ? viewerError("Internal server error", 500)
132
144
  : error("internal_error", "Internal server error", 500, operationId);
@@ -515,7 +527,7 @@ async function search(database, raw, origin) {
515
527
  const timeClause = timeFilters.length > 0 ? `AND ${timeFilters.join(" AND ")}` : "";
516
528
  if (!query) {
517
529
  const rows = await database
518
- .prepare(`SELECT s.*, ${CHILD_COUNT_COLUMN} FROM sessions s
530
+ .prepare(`SELECT s.*, ${SESSION_METADATA_COLUMNS} FROM sessions s
519
531
  WHERE 1 = 1 ${parentClause} ${attributeClause} ${timeClause}
520
532
  ORDER BY ${order} LIMIT ? OFFSET ?`)
521
533
  .bind(...parentValues, ...attributeValues, ...timeValues, limit + 1, offset)
@@ -542,7 +554,7 @@ async function search(database, raw, origin) {
542
554
  FROM matching_sessions
543
555
  GROUP BY session_id
544
556
  )
545
- SELECT s.*, ${CHILD_COUNT_COLUMN}
557
+ SELECT s.*, ${SESSION_METADATA_COLUMNS}
546
558
  FROM ranked_sessions r
547
559
  JOIN sessions s ON s.session_id = r.session_id
548
560
  WHERE 1 = 1 ${parentClause} ${attributeClause} ${timeClause}
@@ -608,35 +620,57 @@ async function read(database, raw, origin, maxPayloadBytes = MAX_READ_PAGE_PAYLO
608
620
  const input = asRecord(raw, "read input");
609
621
  const sessionId = requiredString(input.sessionId, "sessionId", 256);
610
622
  const limit = boundedInteger(input.limit ?? 50, "limit", 1, MAX_READ_LIMIT);
611
- const position = decodeCursor(optionalString(input.cursor, "cursor", 2_048), "position");
612
- const session = await database
613
- .prepare(`SELECT s.*, ${CHILD_COUNT_COLUMN} FROM sessions s WHERE s.session_id = ?`)
614
- .bind(sessionId)
615
- .first();
616
- if (!session) {
623
+ const cursor = optionalString(input.cursor, "cursor", 2_048);
624
+ const afterEntryId = optionalString(input.afterEntryId, "afterEntryId", 512);
625
+ if (afterEntryId && cursor)
626
+ throw invalidRequest("pass afterEntryId or cursor, not both");
627
+ if (cursor && (!cursor.startsWith("entry:") || cursor.length === 6))
628
+ throw invalidRequest("invalid cursor");
629
+ const anchor = afterEntryId ?? cursor?.slice(6) ?? null;
630
+ const start = `CASE WHEN ?2 IS NULL THEN 0 ELSE
631
+ (SELECT position FROM entries WHERE session_id = ?1 AND entry_id = ?2) END`;
632
+ // D1 executes a batch in one transaction. Size candidates before fetching payloads.
633
+ const [descriptorRows, page] = await database.batch([
634
+ database
635
+ .prepare(`SELECT s.*, ${SESSION_METADATA_COLUMNS}, ${start} AS start_position
636
+ FROM sessions s WHERE s.session_id = ?1`)
637
+ .bind(sessionId, anchor),
638
+ database
639
+ .prepare(`WITH candidates AS (
640
+ SELECT position, octet_length(payload_json) + 1 AS bytes FROM entries
641
+ WHERE session_id = ?1 AND position > (${start}) ORDER BY position LIMIT ?3
642
+ ), sized AS (
643
+ SELECT position, row_number() OVER (ORDER BY position) AS n,
644
+ sum(bytes) OVER (ORDER BY position) AS total_bytes, count(*) OVER () AS candidates
645
+ FROM candidates
646
+ )
647
+ SELECT e.entry_id, e.payload_json, sized.candidates FROM sized
648
+ JOIN entries e ON e.session_id = ?1 AND e.position = sized.position
649
+ WHERE n <= ?4 AND (n = 1 OR total_bytes <= ?5) ORDER BY n`)
650
+ .bind(sessionId, anchor, limit + 1, limit, maxPayloadBytes),
651
+ ]);
652
+ if (!descriptorRows || !page)
653
+ throw new Error("incomplete history read batch");
654
+ const session = descriptorRows.results[0];
655
+ if (!session)
617
656
  throw new HistoryApiError("not_found", `history session '${sessionId}' was not found`, 404);
618
- }
619
- const candidates = await database
620
- .prepare("SELECT position, LENGTH(CAST(payload_json AS BLOB)) AS payload_bytes FROM entries WHERE session_id = ? AND position > ? ORDER BY position LIMIT ?")
621
- .bind(sessionId, position, limit + 1)
622
- .all();
623
- const page = selectHistoryReadPage(candidates.results, limit, maxPayloadBytes);
624
- const rows = await database
625
- .prepare("SELECT position, payload_json FROM entries WHERE session_id = ? AND position > ? ORDER BY position LIMIT ?")
626
- .bind(sessionId, position, page.count)
627
- .all();
628
- const last = rows.results.at(-1);
657
+ if (session.start_position === null)
658
+ throw new HistoryApiError("anchor_not_found", "history read anchor was not found", 404);
659
+ const last = page.results.at(-1);
629
660
  return {
630
661
  session: descriptor(session, origin),
631
- entries: rows.results.map((row) => JSON.parse(row.payload_json)),
632
- ...(page.hasMore && last ? { nextCursor: encodeCursor({ position: last.position }) } : {}),
662
+ ...(afterEntryId ? { afterEntryId } : {}),
663
+ entries: page.results.map((row) => JSON.parse(String(row.payload_json))),
664
+ ...(last && Number(last.candidates) > page.results.length
665
+ ? { nextCursor: `entry:${last.entry_id}` }
666
+ : {}),
633
667
  };
634
668
  }
635
669
  // Parent links are not validated against each other, so traversal must tolerate cycles.
636
670
  export async function readSessionTree(database, session, origin) {
637
671
  const parent = session.parentSessionId
638
672
  ? await database
639
- .prepare(`SELECT s.*, ${CHILD_COUNT_COLUMN} FROM sessions s WHERE s.session_id = ?`)
673
+ .prepare(`SELECT s.*, ${SESSION_METADATA_COLUMNS} FROM sessions s WHERE s.session_id = ?`)
640
674
  .bind(session.parentSessionId)
641
675
  .first()
642
676
  : null;
@@ -651,7 +685,7 @@ export async function readSessionTree(database, session, origin) {
651
685
  ORDER BY 2
652
686
  LIMIT ?
653
687
  )
654
- SELECT s.*, ${CHILD_COUNT_COLUMN}, MIN(t.depth) AS depth
688
+ SELECT s.*, ${SESSION_METADATA_COLUMNS}, MIN(t.depth) AS depth
655
689
  FROM tree t
656
690
  JOIN sessions s ON s.session_id = t.session_id
657
691
  GROUP BY s.session_id
@@ -685,18 +719,6 @@ export async function readSessionTree(database, session, origin) {
685
719
  descendants.some((descendant) => descendant.depth === MAX_TREE_DEPTH && descendant.session.childCount > 0),
686
720
  };
687
721
  }
688
- export function selectHistoryReadPage(candidates, limit, maxPayloadBytes = MAX_READ_PAGE_PAYLOAD_BYTES) {
689
- let count = 0;
690
- let bytes = 0;
691
- for (const candidate of candidates.slice(0, limit)) {
692
- const nextBytes = bytes + Number(candidate.payload_bytes) + 1;
693
- if (count > 0 && nextBytes > maxPayloadBytes)
694
- break;
695
- count += 1;
696
- bytes = nextBytes;
697
- }
698
- return { count, hasMore: candidates.length > count };
699
- }
700
722
  function descriptor(row, origin) {
701
723
  const title = typeof row.digest_title === "string" ? row.digest_title : undefined;
702
724
  const summary = typeof row.digest_summary === "string" ? row.digest_summary : undefined;
@@ -710,6 +732,7 @@ function descriptor(row, origin) {
710
732
  ? { parentSessionId: row.parent_session_id }
711
733
  : {}),
712
734
  childCount: Number(row.child_count),
735
+ lastEntryId: row.last_entry_id === null ? null : String(row.last_entry_id),
713
736
  webUrl: `${origin}/sessions/${encodeURIComponent(String(row.session_id))}`,
714
737
  ...(title && summary && through
715
738
  ? { digest: { title, summary, updatedThroughEntryId: through } }
@@ -803,15 +826,15 @@ async function readViewerEntries(database, url) {
803
826
  limit: MAX_READ_LIMIT,
804
827
  cursor: url.searchParams.get("cursor") ?? undefined,
805
828
  }, url.origin, VIEWER_READ_PAGE_PAYLOAD_BYTES);
806
- return viewerResponse(JSON.stringify({
829
+ return viewerJson({
807
830
  html: result.entries.map(renderViewerEntry).join(""),
808
831
  nextCursor: result.nextCursor ?? null,
809
- }), 200, { "content-type": "application/json; charset=utf-8" });
832
+ });
810
833
  }
811
834
  async function renderViewerSession(database, url) {
812
835
  const sessionId = viewerSessionId(url);
813
836
  const row = await database
814
- .prepare(`SELECT s.*, ${CHILD_COUNT_COLUMN} FROM sessions s WHERE s.session_id = ?`)
837
+ .prepare(`SELECT s.*, ${SESSION_METADATA_COLUMNS} FROM sessions s WHERE s.session_id = ?`)
815
838
  .bind(sessionId)
816
839
  .first();
817
840
  if (!row)
@@ -962,6 +985,11 @@ function viewerResponse(body, status = 200, headers = {}) {
962
985
  },
963
986
  });
964
987
  }
988
+ function viewerJson(body, status = 200) {
989
+ return viewerResponse(JSON.stringify(body), status, {
990
+ "content-type": "application/json; charset=utf-8",
991
+ });
992
+ }
965
993
  function viewerUnauthorized() {
966
994
  return viewerError("Authentication required", 401, {
967
995
  "www-authenticate": 'Basic realm="Tau history", charset="UTF-8"',