argus-review 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -80657,7 +80657,7 @@ For each candidate, re-derive it from the code yourself. Decide:
80657
80657
  * it needs an imagined input, caller, configuration or attacker that is not plausible from the code shown,
80658
80658
  * it is about code this PR does not touch and does not affect,
80659
80659
  * it is a "verify/ensure/consider" remark, a test-coverage or docs opinion, a style preference${config2.review.profile === "assertive" ? " (style is allowed in this profile when it is concrete)" : ""},
80660
- * it duplicates another candidate (keep only the best one),
80660
+ * it duplicates another candidate: keep only the best one (prefer the one reported by more review passes, then the most accurate) and set duplicateOf to that candidate's index on the discarded ones,
80661
80661
  * the quoted existingCode does not exist at the given lines and the problem cannot be located,
80662
80662
  * the suggested fix would introduce a bug and the issue itself is not clearly real.
80663
80663
 
@@ -80666,7 +80666,7 @@ ${SEVERITY_GUIDE}
80666
80666
 
80667
80667
  Suggestions must replace exactly the finding's startLine..endLine with correct, minimal, compilable code that preserves indentation; set suggestion to null if the candidate's suggestion is wrong and you cannot fix it locally.
80668
80668
 
80669
- Return one verdict per candidate, using the candidate's index. Write in ${config2.review.language}.
80669
+ Return one verdict per candidate, using the candidate's index. duplicateOf is null unless the candidate is discarded as a duplicate. Write in ${config2.review.language}.
80670
80670
 
80671
80671
  ${UNTRUSTED_INPUT_NOTE}`;
80672
80672
  }
@@ -80790,7 +80790,9 @@ var init_schemas3 = __esm({
80790
80790
  severity: lenientEnum(SEVERITIES, "minor").nullable(),
80791
80791
  title: external_exports.string().nullable(),
80792
80792
  explanation: external_exports.string().nullable(),
80793
- suggestion: external_exports.string().nullable()
80793
+ suggestion: external_exports.string().nullable(),
80794
+ /** With a discard: the index of the candidate this one duplicates, which inherits its votes. */
80795
+ duplicateOf: external_exports.number().nullable().catch(null)
80794
80796
  });
80795
80797
  verifyResponseSchema = external_exports.object({
80796
80798
  verdicts: external_exports.array(verdictSchema)
@@ -80883,13 +80885,24 @@ function isNearDuplicate(a2, b2) {
80883
80885
  if (similarity >= 0.4) return true;
80884
80886
  return a2.category === b2.category && jaccard(words(a2.explanation), words(b2.explanation)) >= 0.35;
80885
80887
  }
80888
+ function absorb(into, from) {
80889
+ if (!from.votePasses?.length) return;
80890
+ const passes = /* @__PURE__ */ new Set([...into.votePasses ?? [], ...from.votePasses]);
80891
+ into.votePasses = [...passes].sort((a2, b2) => a2 - b2);
80892
+ into.votes = passes.size;
80893
+ into.passes = Math.max(into.passes ?? 0, from.passes ?? 0);
80894
+ if (from.models?.length) into.models = [.../* @__PURE__ */ new Set([...into.models ?? [], ...from.models])];
80895
+ }
80886
80896
  function dedupe(findings) {
80887
80897
  const sorted = [...findings].sort((a2, b2) => rank(b2) - rank(a2));
80888
80898
  const kept = [];
80889
80899
  const duplicates = [];
80890
80900
  for (const f2 of sorted) {
80891
- if (kept.some((k2) => isNearDuplicate(k2, f2))) duplicates.push(f2);
80892
- else kept.push(f2);
80901
+ const keeper = kept.find((k2) => isNearDuplicate(k2, f2));
80902
+ if (keeper) {
80903
+ absorb(keeper, f2);
80904
+ duplicates.push(f2);
80905
+ } else kept.push(f2);
80893
80906
  }
80894
80907
  return { kept, duplicates };
80895
80908
  }
@@ -81186,11 +81199,12 @@ function tallyVotes(results, passesFor) {
81186
81199
  kept.push(finding);
81187
81200
  continue;
81188
81201
  }
81189
- const cluster = clusters.find((c3) => isNearDuplicate(c3.lead, finding));
81202
+ const cluster = clusters.find((c3) => c3.members.some((m2) => isNearDuplicate(m2, finding)));
81190
81203
  if (!cluster) {
81191
- clusters.push({ lead: finding, passes: /* @__PURE__ */ new Set([pass]), models: new Set(model ? [model] : []) });
81204
+ clusters.push({ lead: finding, members: [finding], passes: /* @__PURE__ */ new Set([pass]), models: new Set(model ? [model] : []) });
81192
81205
  continue;
81193
81206
  }
81207
+ cluster.members.push(finding);
81194
81208
  cluster.passes.add(pass);
81195
81209
  if (model) cluster.models.add(model);
81196
81210
  if (finding.confidence > cluster.lead.confidence) {
@@ -81201,6 +81215,7 @@ function tallyVotes(results, passesFor) {
81201
81215
  }
81202
81216
  }
81203
81217
  for (const cluster of clusters) {
81218
+ cluster.lead.votePasses = [...cluster.passes].sort((a2, b2) => a2 - b2);
81204
81219
  cluster.lead.votes = cluster.passes.size;
81205
81220
  cluster.lead.passes = passesFor(cluster.lead.file);
81206
81221
  if (cluster.models.size) cluster.lead.models = [...cluster.models];
@@ -82494,6 +82509,8 @@ ${listing}
82494
82509
  unverified(run3, candidate, skeptic, `${skeptic ? "second verifier" : "verifier"} returned an unrecognised verdict`);
82495
82510
  return;
82496
82511
  }
82512
+ const target = verdict.verdict === "discard" && verdict.duplicateOf !== null ? group[Math.round(verdict.duplicateOf)] : void 0;
82513
+ if (target && target !== candidate) absorb(target, candidate);
82497
82514
  if (applyVerdict(run3, candidate, verdict, skeptic)) kept.push(candidate);
82498
82515
  });
82499
82516
  } catch (error62) {
@@ -84544,7 +84561,7 @@ var VERSION3;
84544
84561
  var init_version3 = __esm({
84545
84562
  "apps/server/src/version.ts"() {
84546
84563
  "use strict";
84547
- VERSION3 = "0.2.1";
84564
+ VERSION3 = "0.2.2";
84548
84565
  }
84549
84566
  });
84550
84567
 
@@ -89937,7 +89954,7 @@ var init_store = __esm({
89937
89954
  return (await this.db.all(sql, args)).map((r2) => this.toReview(r2));
89938
89955
  }
89939
89956
  async reviewsUpdatedSince(since) {
89940
- return (await this.db.all(`SELECT ${_Store.LIST_COLUMNS}, updated_at FROM reviews WHERE updated_at > ? ORDER BY updated_at LIMIT 200`, [since])).map((r2) => ({
89957
+ return (await this.db.all(`SELECT ${_Store.LIST_COLUMNS}, updated_at FROM reviews WHERE updated_at >= ? ORDER BY updated_at LIMIT 200`, [since])).map((r2) => ({
89941
89958
  ...this.toReview(r2),
89942
89959
  updatedAt: String(r2.updated_at)
89943
89960
  }));
@@ -90696,6 +90713,8 @@ var init_jobs2 = __esm({
90696
90713
  /** Live review updates. */
90697
90714
  listeners = /* @__PURE__ */ new Set();
90698
90715
  lastSeen = (/* @__PURE__ */ new Date()).toISOString();
90716
+ /** What was last broadcast per review at `lastSeen`: rows are read with `>=`, so one changed twice in a millisecond is still sent. */
90717
+ sentAtLastSeen = /* @__PURE__ */ new Map();
90699
90718
  cache;
90700
90719
  /**
90701
90720
  * One process serves the data directory, so anything still running at start was interrupted by a stop: reviews fail
@@ -90769,7 +90788,11 @@ var init_jobs2 = __esm({
90769
90788
  return;
90770
90789
  }
90771
90790
  for (const review2 of await this.store.reviewsUpdatedSince(this.lastSeen)) {
90791
+ const key = `${review2.status}|${JSON.stringify(review2.progress)}`;
90792
+ if (review2.updatedAt === this.lastSeen && this.sentAtLastSeen.get(review2.id) === key) continue;
90793
+ if (review2.updatedAt !== this.lastSeen) this.sentAtLastSeen.clear();
90772
90794
  this.lastSeen = review2.updatedAt;
90795
+ this.sentAtLastSeen.set(review2.id, key);
90773
90796
  for (const l2 of this.listeners) l2(review2);
90774
90797
  }
90775
90798
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argus-review",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Self-hosted AI code review for GitHub, GitLab, Bitbucket and Azure DevOps: CLI, CI, web UI and webhooks",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x,w as S,x as C,y as w}from"./index-BLp-bx8B.js";function T(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var E=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O={};function ee(e,t){return((t||O).jsx?D:E).test(e)}var te=/[ \t\n\f\r]/g;function ne(e){return typeof e==`object`?e.type===`text`&&k(e.value):k(e)}function k(e){return e.replace(te,``)===``}var A=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};A.prototype.normal={},A.prototype.property={},A.prototype.space=void 0;function re(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new A(n,r,t)}function ie(e){return e.toLowerCase()}var j=class{constructor(e,t){this.attribute=t,this.property=e}};j.prototype.attribute=``,j.prototype.booleanish=!1,j.prototype.boolean=!1,j.prototype.commaOrSpaceSeparated=!1,j.prototype.commaSeparated=!1,j.prototype.defined=!1,j.prototype.mustUseProperty=!1,j.prototype.number=!1,j.prototype.overloadedBoolean=!1,j.prototype.property=``,j.prototype.spaceSeparated=!1,j.prototype.space=void 0;var ae=S({boolean:()=>M,booleanish:()=>N,commaOrSpaceSeparated:()=>I,commaSeparated:()=>ce,number:()=>P,overloadedBoolean:()=>se,spaceSeparated:()=>F}),oe=0,M=le(),N=le(),se=le(),P=le(),F=le(),ce=le(),I=le();function le(){return 2**++oe}var ue=Object.keys(ae),de=class extends j{constructor(e,t,n,r){let i=-1;if(super(e,t),fe(this,`space`,r),typeof n==`number`)for(;++i<ue.length;){let e=ue[i];fe(this,ue[i],(n&ae[e])===ae[e])}}};de.prototype.defined=!0;function fe(e,t,n){n&&(e[t]=n)}function pe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new de(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ie(r)]=r,n[ie(a.attribute)]=r}return new A(t,n,e.space)}var me=pe({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:F,ariaCurrent:null,ariaDescribedBy:F,ariaDetails:null,ariaDisabled:N,ariaDropEffect:F,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:F,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:F,ariaLevel:P,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:F,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:F,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:N,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function he(e,t){return t in e?e[t]:t}function ge(e,t){return he(e,t.toLowerCase())}var _e=pe({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ce,acceptCharset:F,accessKey:F,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alpha:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:F,autoFocus:M,autoPlay:M,blocking:F,capture:null,charSet:null,checked:M,cite:null,className:F,closedBy:null,colorSpace:null,cols:P,colSpan:P,command:null,commandFor:null,content:null,contentEditable:N,controls:M,controlsList:F,coords:P|ce,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:se,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:F,height:P,hidden:se,high:P,href:null,hrefLang:null,htmlFor:F,httpEquiv:F,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:F,itemRef:F,itemScope:M,itemType:F,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:M,muted:M,name:null,nonce:null,noModule:M,noValidate:M,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:M,optimum:P,pattern:null,ping:F,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:F,required:M,reversed:M,rows:P,rowSpan:P,sandbox:F,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootCustomElementRegistry:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shadowRootSerializable:M,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:N,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:F,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:M,declare:M,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:M,disablePictureInPicture:M,disableRemotePlayback:M,exportParts:ce,part:F,prefix:null,property:null,results:P,security:null,unselectable:null},space:`html`,transform:ge}),ve=pe({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:I,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,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:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:ce,g2:ce,glyphName:ce,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:I,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,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:P,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:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:F,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:I,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:I,rev:I,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:I,requiredFeatures:I,requiredFonts:I,requiredFormats:I,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:I,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:I,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:I,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:he}),ye=pe({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()}}),be=pe({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ge}),xe=pe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Se={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ce=/[A-Z]/g,we=/-[a-z]/g,Te=/^data[-\w.:]+$/i;function Ee(e,t){let n=ie(t),r=t,i=j;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Te.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(we,Oe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!we.test(e)){let n=e.replace(Ce,De);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=de}return new i(r,t)}function De(e){return`-`+e.toLowerCase()}function Oe(e){return e.charAt(1).toUpperCase()}var ke=re([me,_e,ye,be,xe],`html`),Ae=re([me,ve,ye,be,xe],`svg`);function je(e){return e.join(` `).trim()}var Me=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
1
+ import{C as e,S as t,T as n,_ as r,a as i,b as a,c as o,d as s,f as c,g as l,h as u,i as d,l as f,m as p,n as m,o as h,p as g,r as _,s as v,t as y,u as b,v as x,w as S,x as C,y as w}from"./index-EFsso5qt.js";function T(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var E=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,D=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,O={};function ee(e,t){return((t||O).jsx?D:E).test(e)}var te=/[ \t\n\f\r]/g;function ne(e){return typeof e==`object`?e.type===`text`&&k(e.value):k(e)}function k(e){return e.replace(te,``)===``}var A=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};A.prototype.normal={},A.prototype.property={},A.prototype.space=void 0;function re(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new A(n,r,t)}function ie(e){return e.toLowerCase()}var j=class{constructor(e,t){this.attribute=t,this.property=e}};j.prototype.attribute=``,j.prototype.booleanish=!1,j.prototype.boolean=!1,j.prototype.commaOrSpaceSeparated=!1,j.prototype.commaSeparated=!1,j.prototype.defined=!1,j.prototype.mustUseProperty=!1,j.prototype.number=!1,j.prototype.overloadedBoolean=!1,j.prototype.property=``,j.prototype.spaceSeparated=!1,j.prototype.space=void 0;var ae=S({boolean:()=>M,booleanish:()=>N,commaOrSpaceSeparated:()=>I,commaSeparated:()=>ce,number:()=>P,overloadedBoolean:()=>se,spaceSeparated:()=>F}),oe=0,M=le(),N=le(),se=le(),P=le(),F=le(),ce=le(),I=le();function le(){return 2**++oe}var ue=Object.keys(ae),de=class extends j{constructor(e,t,n,r){let i=-1;if(super(e,t),fe(this,`space`,r),typeof n==`number`)for(;++i<ue.length;){let e=ue[i];fe(this,ue[i],(n&ae[e])===ae[e])}}};de.prototype.defined=!0;function fe(e,t,n){n&&(e[t]=n)}function pe(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new de(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ie(r)]=r,n[ie(a.attribute)]=r}return new A(t,n,e.space)}var me=pe({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:P,ariaColIndex:P,ariaColSpan:P,ariaControls:F,ariaCurrent:null,ariaDescribedBy:F,ariaDetails:null,ariaDisabled:N,ariaDropEffect:F,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:F,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:F,ariaLevel:P,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:F,ariaPlaceholder:null,ariaPosInSet:P,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:F,ariaRowCount:P,ariaRowIndex:P,ariaRowSpan:P,ariaSelected:N,ariaSetSize:P,ariaSort:null,ariaValueMax:P,ariaValueMin:P,ariaValueNow:P,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function he(e,t){return t in e?e[t]:t}function ge(e,t){return he(e,t.toLowerCase())}var _e=pe({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:ce,acceptCharset:F,accessKey:F,action:null,allow:null,allowFullScreen:M,allowPaymentRequest:M,allowUserMedia:M,alpha:M,alt:null,as:null,async:M,autoCapitalize:null,autoComplete:F,autoFocus:M,autoPlay:M,blocking:F,capture:null,charSet:null,checked:M,cite:null,className:F,closedBy:null,colorSpace:null,cols:P,colSpan:P,command:null,commandFor:null,content:null,contentEditable:N,controls:M,controlsList:F,coords:P|ce,crossOrigin:null,data:null,dateTime:null,decoding:null,default:M,defer:M,dir:null,dirName:null,disabled:M,download:se,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:M,formTarget:null,headers:F,height:P,hidden:se,high:P,href:null,hrefLang:null,htmlFor:F,httpEquiv:F,id:null,imageSizes:null,imageSrcSet:null,inert:M,inputMode:null,integrity:null,is:null,isMap:M,itemId:null,itemProp:F,itemRef:F,itemScope:M,itemType:F,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:M,low:P,manifest:null,max:null,maxLength:P,media:null,method:null,min:null,minLength:P,multiple:M,muted:M,name:null,nonce:null,noModule:M,noValidate:M,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:M,optimum:P,pattern:null,ping:F,placeholder:null,playsInline:M,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:M,referrerPolicy:null,rel:F,required:M,reversed:M,rows:P,rowSpan:P,sandbox:F,scope:null,scoped:M,seamless:M,selected:M,shadowRootClonable:M,shadowRootCustomElementRegistry:M,shadowRootDelegatesFocus:M,shadowRootMode:null,shadowRootSerializable:M,shape:null,size:P,sizes:null,slot:null,span:P,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:P,step:null,style:null,tabIndex:P,target:null,title:null,translate:null,type:null,typeMustMatch:M,useMap:null,value:N,width:P,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:F,axis:null,background:null,bgColor:null,border:P,borderColor:null,bottomMargin:P,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:M,declare:M,event:null,face:null,frame:null,frameBorder:null,hSpace:P,leftMargin:P,link:null,longDesc:null,lowSrc:null,marginHeight:P,marginWidth:P,noResize:M,noHref:M,noShade:M,noWrap:M,object:null,profile:null,prompt:null,rev:null,rightMargin:P,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:P,valueType:null,version:null,vAlign:null,vLink:null,vSpace:P,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:M,disablePictureInPicture:M,disableRemotePlayback:M,exportParts:ce,part:F,prefix:null,property:null,results:P,security:null,unselectable:null},space:`html`,transform:ge}),ve=pe({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:I,accentHeight:P,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:P,amplitude:P,arabicForm:null,ascent:P,attributeName:null,attributeType:null,azimuth:P,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:P,by:null,calcMode:null,capHeight:P,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:P,diffuseConstant:P,direction:null,display:null,dur:null,divisor:P,dominantBaseline:null,download:M,dx:null,dy:null,edgeMode:null,editable:null,elevation:P,enableBackground:null,end:null,event:null,exponent:P,externalResourcesRequired:null,fill:null,fillOpacity:P,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:ce,g2:ce,glyphName:ce,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:P,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:P,horizOriginX:P,horizOriginY:P,id:null,ideographic:P,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:P,k:P,k1:P,k2:P,k3:P,k4:P,kernelMatrix:I,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:P,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:P,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:P,overlineThickness:P,paintOrder:null,panose1:null,path:null,pathLength:P,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:F,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:P,pointsAtY:P,pointsAtZ:P,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:I,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:I,rev:I,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:I,requiredFeatures:I,requiredFonts:I,requiredFormats:I,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:P,specularExponent:P,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:P,strikethroughThickness:P,string:null,stroke:null,strokeDashArray:I,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:P,strokeOpacity:P,strokeWidth:null,style:null,surfaceScale:P,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:I,tabIndex:P,tableValues:null,target:null,targetX:P,targetY:P,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:I,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:P,underlineThickness:P,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:P,values:null,vAlphabetic:P,vMathematical:P,vectorEffect:null,vHanging:P,vIdeographic:P,version:null,vertAdvY:P,vertOriginX:P,vertOriginY:P,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:P,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:he}),ye=pe({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()}}),be=pe({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ge}),xe=pe({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Se={classId:`classID`,dataType:`datatype`,itemId:`itemID`,strokeDashArray:`strokeDasharray`,strokeDashOffset:`strokeDashoffset`,strokeLineCap:`strokeLinecap`,strokeLineJoin:`strokeLinejoin`,strokeMiterLimit:`strokeMiterlimit`,typeOf:`typeof`,xLinkActuate:`xlinkActuate`,xLinkArcRole:`xlinkArcrole`,xLinkHref:`xlinkHref`,xLinkRole:`xlinkRole`,xLinkShow:`xlinkShow`,xLinkTitle:`xlinkTitle`,xLinkType:`xlinkType`,xmlnsXLink:`xmlnsXlink`},Ce=/[A-Z]/g,we=/-[a-z]/g,Te=/^data[-\w.:]+$/i;function Ee(e,t){let n=ie(t),r=t,i=j;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Te.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(we,Oe);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!we.test(e)){let n=e.replace(Ce,De);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=de}return new i(r,t)}function De(e){return`-`+e.toLowerCase()}function Oe(e){return e.charAt(1).toUpperCase()}var ke=re([me,_e,ye,be,xe],`html`),Ae=re([me,ve,ye,be,xe],`svg`);function je(e){return e.join(` `).trim()}var Me=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
2
2
  `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),Ne=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(Me());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),Pe=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Fe=e(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ne()),r=Pe();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),Ie=Re(`end`),Le=Re(`start`);function Re(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function ze(e){let t=Le(e),n=Ie(e);if(t&&n)return{start:t,end:n}}function Be(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?He(e.position):`start`in e||`end`in e?He(e):`line`in e||`column`in e?Ve(e):``}function Ve(e){return Ue(e&&e.line)+`:`+Ue(e&&e.column)}function He(e){return Ve(e&&e.start)+`-`+Ve(e&&e.end)}function Ue(e){return e&&typeof e==`number`?e:1}var L=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Be(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};L.prototype.file=``,L.prototype.name=``,L.prototype.reason=``,L.prototype.message=``,L.prototype.stack=``,L.prototype.column=void 0,L.prototype.line=void 0,L.prototype.ancestors=void 0,L.prototype.cause=void 0,L.prototype.fatal=void 0,L.prototype.place=void 0,L.prototype.ruleId=void 0,L.prototype.source=void 0;var We=n(Fe(),1),Ge={}.hasOwnProperty,Ke=new Map,qe=/[A-Z]/g,Je=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Ye=new Set([`td`,`th`]),Xe=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ze(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=ct(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=st(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Ae:ke,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=Qe(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function Qe(e,t,n){if(t.type===`element`)return $e(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return et(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return nt(e,t,n);if(t.type===`mdxjsEsm`)return tt(e,t);if(t.type===`root`)return rt(e,t,n);if(t.type===`text`)return it(e,t)}function $e(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Ae,e.schema=i),e.ancestors.push(t);let a=mt(e,t.tagName,!1),o=lt(e,t),s=dt(e,t);return Je.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ne(e)})),at(e,o,a,t),ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function et(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}ht(e,t.position)}function tt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ht(e,t.position)}function nt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Ae,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:mt(e,t.name,!0),o=ut(e,t),s=dt(e,t);return at(e,o,a,t),ot(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function rt(e,t,n){let r={};return ot(r,dt(e,t)),e.create(t,e.Fragment,r,n)}function it(e,t){return t.value}function at(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ot(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function st(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function ct(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Le(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function lt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Ge.call(t.properties,i)){let a=ft(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Ye.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function ut(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else ht(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else ht(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function dt(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ke;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=Qe(e,a,o);s!==void 0&&n.push(s)}return n}function ft(e,t,n){let r=Ee(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?T(n):je(n)),r.property===`style`){let t=typeof n==`object`?n:pt(e,String(n));return e.stylePropertyNameCase===`css`&&(t=gt(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Se[r.property]||r.property:r.attribute,n]}}function pt(e,t){try{return(0,We.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new L("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=Xe+`#cannot-parse-style-attribute`,r}}function mt(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=ee(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=ee(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Ge.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);ht(e)}function ht(e,t){let n=new L("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:`mdx-estree`,source:`hast-util-to-jsx-runtime`});throw n.file=e.filePath||void 0,n.url=Xe+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function gt(e){let t={},n;for(n in e)Ge.call(e,n)&&(t[_t(n)]=e[n]);return t}function _t(e){let t=e.replace(qe,vt);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function vt(e){return`-`+e.toLowerCase()}var yt={action:[`form`],cite:[`blockquote`,`del`,`ins`,`q`],data:[`object`],formAction:[`button`,`input`],href:[`a`,`area`,`base`,`link`],icon:[`menuitem`],itemId:null,manifest:[`html`],ping:[`a`,`area`],poster:[`video`],src:[`audio`,`embed`,`iframe`,`img`,`input`,`script`,`source`,`track`,`video`]},bt={};function xt(e,t){let n=t||bt;return St(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function St(e,t,n){if(wt(e)){if(`value`in e)return e.type===`html`&&!n?``:e.value;if(t&&`alt`in e&&e.alt)return e.alt;if(`children`in e)return Ct(e.children,t,n)}return Array.isArray(e)?Ct(e,t,n):``}function Ct(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=St(e[i],t,n);return r.join(``)}function wt(e){return!!(e&&typeof e==`object`)}var Tt=document.createElement(`i`);function Et(e){let t=`&`+e+`;`;Tt.innerHTML=t;let n=Tt.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function R(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function z(e,t){return e.length>0?(R(e,e.length,0,t),e):t}var Dt={}.hasOwnProperty;function Ot(e){let t={},n=-1;for(;++n<e.length;)kt(t,e[n]);return t}function kt(e,t){let n;for(n in t){let r=(Dt.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Dt.call(r,a)||(r[a]=[]);let e=i[a];At(r[a],Array.isArray(e)?e:e?[e]:[])}}}function At(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);R(e,0,0,r)}function jt(e,t){let n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function B(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var V=zt(/[A-Za-z]/),H=zt(/[\dA-Za-z]/),Mt=zt(/[#-'*+\--9=?A-Z^-~]/);function Nt(e){return e!==null&&(e<32||e===127)}var Pt=zt(/\d/),Ft=zt(/[\dA-Fa-f]/),It=zt(/[!-/:-@[-`{-~]/);function U(e){return e!==null&&e<-2}function W(e){return e!==null&&(e<0||e===32)}function G(e){return e===-2||e===-1||e===32}var Lt=zt(/\p{P}|\p{S}/u),Rt=zt(/\s/);function zt(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Bt(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&H(e.charCodeAt(n+1))&&H(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function K(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return G(r)?(e.enter(n),s(r)):t(r)}function s(r){return G(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function Vt(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&G(t)?(e.enter(r),c(t)):l(t)}function c(t){return G(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Ht={tokenize:Ut};function Ut(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),K(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return U(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Wt=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Gt(this,e,t,n,!1)}addBefore(e,t,n){Gt(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Gt(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Kt={tokenize:Jt},qt={tokenize:Yt};function Jt(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Wt;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qt,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(qt,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null){i&&v(),_(0),e.consume(n);return}return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null){g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);return}return U(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Wt;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Yt(e,t,n){return K(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function Xt(e){if(e===null||W(e)||Rt(e))return 1;if(Lt(e))return 2}function Zt(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var Qt={name:`attention`,resolveAll:$t,tokenize:en};function $t(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};tn(o,-a),tn(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=z(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=z(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=z(r,Zt(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=z(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=z(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),R(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function en(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Xt(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=Xt(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function tn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var nn={name:`autolink`,tokenize:rn};function rn(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return V(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||H(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||H(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Nt(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Mt(t)?(e.consume(t),l):n(t)}function u(e){return H(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||H(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var an={partial:!0,tokenize:on};function on(e,t,n){return r;function r(t){return G(t)?K(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||U(e)?t(e):n(e)}}var sn={continuation:{tokenize:ln},exit:un,name:`blockQuote`,tokenize:cn};function cn(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return G(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function ln(e,t,n){let r=this;return i;function i(t){return G(t)?K(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(sn,t,n)(r)}}function un(e){e.exit(`blockQuote`)}var dn={name:`characterEscape`,tokenize:fn};function fn(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return It(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var pn={name:`characterReference`,tokenize:mn};function mn(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=H,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Ft,u):(e.enter(`characterReferenceValue`),a=7,o=Pt,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===H&&!Et(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var hn={partial:!0,tokenize:gn};function gn(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var _n={concrete:!0,name:`codeFenced`,tokenize:vn};function vn(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),G(t)?K(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||U(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(hn,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):G(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),K(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||U(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||U(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&G(t)?K(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||U(t)?e.check(hn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||U(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),G(t)?K(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),G(t)?K(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||U(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var yn={name:`codeIndented`,tokenize:xn},bn={partial:!0,tokenize:Sn};function xn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),Vt(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):U(t)?e.attempt(bn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||U(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Sn(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):U(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):Vt(e,t,a,`linePrefix`,4,4)(o)}function a(e){return U(e)?i(e):n(e)}}var Cn={name:`codeText`,previous:Tn,resolve:wn,tokenize:En};function wn(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Tn(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function En(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||U(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Dn=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&On(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),On(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),On(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);On(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);On(this.left,t.reverse())}}}};function On(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function kn(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Dn(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,An(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return R(e,0,1/0,u.slice(0)),!l}function An(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var jn={resolve:Nn,tokenize:Pn},Mn={partial:!0,tokenize:Fn};function Nn(e){return kn(e),e}function Pn(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):U(t)?e.check(Mn,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Fn(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),K(e,a,`linePrefix`)}function a(i){if(i===null||U(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function In(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Nt(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||U(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||W(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Nt(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Ln(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):U(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||U(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!G(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Rn(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):U(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),K(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||U(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function zn(e,t){let n;return r;function r(i){return U(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):G(i)?K(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Bn={name:`definition`,tokenize:Hn},Vn={partial:!0,tokenize:Un};function Hn(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Ln.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=B(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return W(t)?zn(e,l)(t):l(t)}function l(t){return In(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Vn,d,d)(t)}function d(t){return G(t)?K(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||U(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Un(e,t,n){return r;function r(t){return W(t)?zn(e,i)(t):n(t)}function i(t){return Rn(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return G(t)?K(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||U(e)?t(e):n(e)}}var Wn={name:`hardBreakEscape`,tokenize:Gn};function Gn(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return U(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Kn={name:`headingAtx`,resolve:qn,tokenize:Jn};function qn(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};R(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Jn(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||W(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||U(n)?(e.exit(`atxHeading`),t(n)):G(n)?K(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||W(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Yn=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Xn=[`pre`,`script`,`style`,`textarea`],Zn={concrete:!0,name:`htmlFlow`,resolveTo:$n,tokenize:er},Qn={partial:!0,tokenize:tr};function $n(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function er(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:j):V(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):V(a)?(e.consume(a),i=4,r.interrupt?t:j):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:j):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return V(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||W(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Xn.includes(l)?(i=1,r.interrupt?t(s):O(s)):Yn.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||H(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return G(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||V(t)?(e.consume(t),b):G(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||H(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):G(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):G(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||U(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||W(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||G(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||U(t)?O(t):G(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),k):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),ae):t===63&&i===3?(e.consume(t),j):t===93&&i===5?(e.consume(t),ie):U(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(Qn,oe,ee)(t)):t===null||U(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(hn,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return t===null||U(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function k(t){return t===45?(e.consume(t),j):O(t)}function A(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return Xn.includes(n)?(e.consume(t),ae):O(t)}return V(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),j):O(t)}function j(t){return t===62?(e.consume(t),ae):t===45&&i===2?(e.consume(t),j):O(t)}function ae(t){return t===null||U(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),ae)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function tr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(an,t,n)}}var nr={name:`htmlText`,tokenize:rr};function rr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):V(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):V(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):U(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?k(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):U(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?k(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?k(t):U(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):U(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?k(e):y(e)}function x(t){return V(t)?(e.consume(t),S):n(t)}function S(t){return t===45||H(t)?(e.consume(t),S):C(t)}function C(t){return U(t)?(o=C,A(t)):G(t)?(e.consume(t),C):k(t)}function w(t){return t===45||H(t)?(e.consume(t),w):t===47||t===62||W(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),k):t===58||t===95||V(t)?(e.consume(t),E):U(t)?(o=T,A(t)):G(t)?(e.consume(t),T):k(t)}function E(t){return t===45||t===46||t===58||t===95||H(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):U(t)?(o=D,A(t)):G(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):U(t)?(o=O,A(t)):G(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,ne):t===null?n(t):U(t)?(o=ee,A(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||W(t)?T(t):(e.consume(t),te)}function ne(e){return e===47||e===62||W(e)?T(e):n(e)}function k(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return G(t)?K(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var ir={name:`labelEnd`,resolveAll:cr,resolveTo:lr,tokenize:ur},ar={tokenize:dr},or={tokenize:fr},sr={tokenize:pr};function cr(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&R(e,0,e.length,n),e}function lr(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=z(o,e.slice(i+1,i+r+3)),o=z(o,[[`enter`,l,t]]),o=z(o,Zt(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=z(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=z(o,e.slice(a+1)),o=z(o,[[`exit`,s,t]]),R(e,i,e.length,o),e}function ur(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(B(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ar,u,o?u:d)(t):t===91?e.attempt(or,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(sr,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function dr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return W(t)?zn(e,a)(t):a(t)}function a(t){return t===41?u(t):In(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return W(t)?zn(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Rn(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return W(t)?zn(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function fr(e,t,n){let r=this;return i;function i(t){return Ln.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(B(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function pr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var mr={name:`labelStartImage`,resolveAll:ir.resolveAll,tokenize:hr};function hr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var gr={name:`labelStartLink`,resolveAll:ir.resolveAll,tokenize:_r};function _r(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var vr={name:`lineEnding`,tokenize:yr};function yr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),K(e,t,`linePrefix`)}}var br={name:`thematicBreak`,tokenize:xr};function xr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||U(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),G(t)?K(e,s,`whitespace`)(t):s(t))}}var q={continuation:{tokenize:Tr},exit:Dr,name:`list`,tokenize:wr},Sr={partial:!0,tokenize:Or},Cr={partial:!0,tokenize:Er};function wr(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Pt(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(br,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Pt(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(an,r.interrupt?n:u,e.attempt(Sr,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return G(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Tr(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(an,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,K(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!G(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Cr,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,K(e,e.attempt(q,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Er(e,t,n){let r=this;return K(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Dr(e){e.exit(this.containerState.type)}function Or(e,t,n){let r=this;return K(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!G(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var kr={name:`setextUnderline`,resolveTo:Ar,tokenize:jr};function Ar(e,t){let n=new Wt,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function jr(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),G(t)?K(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||U(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Mr={tokenize:Nr};function Nr(e){let t=this,n=e.attempt(an,r,e.attempt(this.parser.constructs.flowInitial,i,K(e,e.attempt(this.parser.constructs.flow,i,e.attempt(jn,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Pr={resolveAll:Rr()},Fr=Lr(`string`),Ir=Lr(`text`);function Lr(e){return{resolveAll:Rr(e===`text`?zr:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Rr(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function zr(e,t){let n=new Wt,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Br=S({attentionMarkers:()=>Jr,contentInitial:()=>Hr,disable:()=>Yr,document:()=>Vr,flow:()=>Wr,flowInitial:()=>Ur,insideSpan:()=>qr,string:()=>Gr,text:()=>Kr}),Vr={42:q,43:q,45:q,48:q,49:q,50:q,51:q,52:q,53:q,54:q,55:q,56:q,57:q,62:sn},Hr={91:Bn},Ur={[-2]:yn,[-1]:yn,32:yn},Wr={35:Kn,42:br,45:[kr,br],60:Zn,61:kr,95:br,96:_n,126:_n},Gr={38:pn,92:dn},Kr={[-5]:vr,[-4]:vr,[-3]:vr,33:mr,38:pn,42:Qt,60:[nn,nr],91:gr,92:[Wn,dn],93:ir,95:Qt,96:Cn},qr={null:[Qt,Pr]},Jr={null:[42,95]},Yr={null:[]};function Xr(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=z(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=Zt(a,l.events,l),l.events):[]}function f(e,t){return Qr(p(e),t)}function p(e){return Zr(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){U(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&R(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Zr(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function Qr(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
3
3
  `;break;case-3:o=`\r
4
4
  `;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function $r(e){let t={constructs:Ot([Br,...(e||{}).extensions||[]]),content:n(Ht),defined:[],document:n(Kt),flow:n(Mr),lazy:{},string:n(Fr),text:n(Ir)};return t;function n(e){return n;function n(n){return Xr(t,e,n)}}}function ei(e){for(;!kn(e););return e}var ti=/[\0\t\n\r]/g;function ni(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){ti.lastIndex=c;let n=ti.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ri=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ii(e){return e.replace(ri,ai)}function ai(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return jt(n.slice(t?2:1),t?16:10)}return Et(n)||e}var oi={}.hasOwnProperty;function si(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),ci(n)(ei($r(n).document().write(ni()(e,t,!0))))}function ci(e){let t={transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:a(ve),autolinkProtocol:T,autolinkEmail:T,atxHeading:a(me),blockQuote:a(le),characterEscape:T,characterReference:T,codeFenced:a(ue),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(ue,o),codeText:a(de,o),codeTextData:T,data:T,codeFlowValue:T,definition:a(fe),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(pe),hardBreakEscape:a(he),hardBreakTrailing:a(he),htmlFlow:a(ge,o),htmlFlowData:T,htmlText:a(ge,o),htmlTextData:T,image:a(_e),label:o,link:a(ve),listItem:a(be),listItemValue:f,listOrdered:a(ye,d),listUnordered:a(ye),paragraph:a(xe),reference:M,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(me),strong:a(Se),thematicBreak:a(we)},exit:{atxHeading:c(),atxHeadingSequence:x,autolink:c(),autolinkEmail:I,autolinkProtocol:ce,blockQuote:c(),characterEscapeValue:E,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:P,characterReference:F,codeFenced:c(g),codeFencedFence:h,codeFencedFenceInfo:p,codeFencedFenceMeta:m,codeFlowValue:E,codeIndented:c(_),codeText:c(ne),codeTextData:E,data:E,definition:c(),definitionDestinationString:b,definitionLabelString:v,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(O),hardBreakTrailing:c(O),htmlFlow:c(ee),htmlFlowData:E,htmlText:c(te),htmlTextData:E,image:c(A),label:ie,labelText:re,lineEnding:D,link:c(k),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:N,resourceDestinationString:j,resourceTitleString:ae,resource:oe,setextHeading:c(w),setextHeadingLineSequence:C,setextHeadingText:S,strong:c(),thematicBreak:c()}};ui(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[]},a={stack:[r],tokenStack:[],config:t,enter:s,exit:l,buffer:o,resume:u,data:n},c=[],d=-1;for(;++d<e.length;)(e[d][1].type===`listOrdered`||e[d][1].type===`listUnordered`)&&(e[d][0]===`enter`?c.push(d):d=i(e,c.pop(),d));for(d=-1;++d<e.length;){let n=t[e[d][0]];oi.call(n,e[d][1].type)&&n[e[d][1].type].call(Object.assign({sliceSerialize:e[d][2].sliceSerialize},a),e[d][1])}if(a.tokenStack.length>0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||fi).call(a,void 0,e[0])}for(r.position={start:li(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:li(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d<t.transforms.length;)r=t.transforms[d](r)||r;return r}function i(e,t,n){let r=t-1,i=-1,a=!1,o,s,c,l;for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let i=r;for(s=void 0;i--;){let t=e[i];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=i}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),e.splice(s||r,0,[`exit`,o,t[2]]),r++,n++}if(t[1].type===`listItemPrefix`){let i={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=i,e.splice(r,0,[`enter`,i,t[2]]),r++,n++,c=void 0,l=!0}}}return e[t][1]._spread=a,n}function a(e,t){return n;function n(n){s.call(this,e(n),n),t&&t.call(this,n)}}function o(){this.stack.push({type:`fragment`,children:[]})}function s(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:li(t.start),end:void 0}}function c(e){return t;function t(t){e&&e.call(this,t),l.call(this,t)}}function l(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(r)r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||fi).call(this,e,r[0]));else throw Error("Cannot close `"+e.type+"` ("+Be({start:e.start,end:e.end})+`): it’s not open`);n.position.end=li(e.end)}function u(){return xt(this.stack.pop())}function d(){this.data.expectingFirstListItemValue=!0}function f(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function p(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function h(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function g(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function v(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=B(this.sliceSerialize(e)).toLowerCase()}function y(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function x(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function S(){this.data.setextHeadingSlurpLineEnding=!0}function C(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function T(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ce(),n.position={start:li(e.start),end:void 0},t.push(n)),this.stack.push(n)}function E(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=li(e.end)}function D(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=li(e.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(T.call(this,e),E.call(this,e))}function O(){this.data.atHardBreak=!0}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function te(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ne(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function k(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function A(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function re(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=ii(t),n.identifier=B(t).toLowerCase()}function ie(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function M(){this.data.referenceType=`collapsed`}function N(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=B(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function se(e){this.data.characterReferenceType=e.type}function P(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=jt(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Et(t);let i=this.stack[this.stack.length-1];i.value+=r}function F(e){let t=this.stack.pop();t.position.end=li(e.end)}function ce(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function I(e){E.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function le(){return{type:`blockquote`,children:[]}}function ue(){return{type:`code`,lang:null,meta:null,value:``}}function de(){return{type:`inlineCode`,value:``}}function fe(){return{type:`definition`,identifier:``,label:null,title:null,url:``}}function pe(){return{type:`emphasis`,children:[]}}function me(){return{type:`heading`,depth:0,children:[]}}function he(){return{type:`break`}}function ge(){return{type:`html`,value:``}}function _e(){return{type:`image`,title:null,url:``,alt:null}}function ve(){return{type:`link`,title:null,url:``,children:[]}}function ye(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[]}}function be(e){return{type:`listItem`,spread:e._spread,checked:null,children:[]}}function xe(){return{type:`paragraph`,children:[]}}function Se(){return{type:`strong`,children:[]}}function Ce(){return{type:`text`,value:``}}function we(){return{type:`thematicBreak`}}}function li(e){return{line:e.line,column:e.column,offset:e.offset}}function ui(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ui(e,r):di(e,r)}}function di(e,t){let n;for(n in t)if(oi.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function fi(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Be({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Be({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Be({start:t.start,end:t.end})+`) is still open`)}function pi(e){let t=this;t.parser=n;function n(n){return si(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function mi(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hi(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
@@ -166,4 +166,4 @@ argus hook install
166
166
  # or review on demand
167
167
  argus local # staged changes
168
168
  argus local --working # everything uncommitted
169
- argus local --base main`}}var Is={github:{name:`GitHub`,pipeline:`GitHub Actions`,host:`github.com`,fixedHost:!1,example:`acme/shop`},gitlab:{name:`GitLab`,pipeline:`GitLab CI`,host:`gitlab.com`,fixedHost:!1,example:`group/subgroup/project`},bitbucket:{name:`Bitbucket`,pipeline:`Bitbucket`,host:`bitbucket.org`,fixedHost:!0,example:`workspace/repo`},azure:{name:`Azure DevOps`,pipeline:`Azure Pipelines`,host:`dev.azure.com`,fixedHost:!0,example:`organization/project/_git/repo`}},Ls=e=>e in Is,Rs=new Set([`pull`,`pulls`,`pull-requests`,`tree`,`blob`,`commit`,`commits`,`issues`,`src`,`actions`]),zs=/^[^\s\p{Cc}]+$/u;function Bs(e){let t=e.trim();if(!t)return null;let n=``,r;if(/^[a-z][a-z\d+.-]*:/i.test(t)){let e;try{e=new URL(t)}catch{return null}if(e.protocol!==`https:`&&e.protocol!==`http:`)return null;n=e.hostname.toLowerCase();try{r=e.pathname.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{return null}}else if(r=t.replace(/\/+$/,``).split(`/`),r.some(e=>!e))return null;let i,a,o=r.indexOf(`_git`);if(o>=0){if(i=n.endsWith(`.visualstudio.com`)&&o===1?[n.split(`.`)[0],r[0]]:r.slice(0,o),a=r[o+1],i.length!==2)return null}else if(n===`github.com`||n===`bitbucket.org`)i=r.slice(0,1),a=r[1];else{let e=r.indexOf(`-`),t=e>=0?r.slice(0,e):r;n&&t.length>2&&Rs.has(t[2])&&(t=t.slice(0,2)),i=t.slice(0,-1),a=t[t.length-1]}return a=a?.replace(/\.git$/i,``),!a||!i.length||![...i,a].every(e=>zs.test(e))?null:{owner:i.join(`/`),name:a}}function Vs(e,t){return e?{url:e,fromPage:!1}:{url:t,fromPage:!0}}function Hs(){let e=Nr(`/server`);return{...Vs(e.data?.effectivePublicUrl,window.location.origin),loading:e.loading&&!e.data}}function Us({version:e,dashboardUrl:t,initialPlatform:n=`github`,withHook:r}){let[i,a]=(0,v.useState)(n),[o,s]=(0,v.useState)(`openrouter`),[c,l]=(0,v.useState)(ss.openrouter[0]),[u,d]=(0,v.useState)(!1),f=(0,v.useMemo)(()=>{if(i!==`hook`)try{return{template:Ps({platform:i,provider:o,model:c,version:e,fromSource:u,dashboardUrl:t})}}catch(e){return{error:e.message}}},[i,o,c,e,u,t]),p=f?.template,m=p??(i===`hook`?Fs():void 0),h=e=>{s(e),l(ss[e][0])};return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-4 overflow-x-auto scrollbar-thin`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[...Object.keys(Is).map(e=>({value:e,label:Is[e].pipeline})),...r?[{value:`hook`,label:`Pre-commit`}]:[]]})}),i!==`hook`&&(0,k.jsxs)(`div`,{className:`mb-4 grid gap-3 md:grid-cols-[1fr_1fr_auto]`,children:[(0,k.jsx)(N,{label:`Provider`,children:(0,k.jsxs)(sr,{value:o,onChange:e=>h(e.target.value),children:[(0,k.jsx)(`option`,{value:`openrouter`,children:`OpenRouter (API key)`}),(0,k.jsx)(`option`,{value:`claude-code`,children:`Claude subscription (Claude Code)`}),(0,k.jsx)(`option`,{value:`copilot`,children:`GitHub Copilot`}),(0,k.jsx)(`option`,{value:`codex`,children:`ChatGPT subscription (Codex)`})]})}),(0,k.jsxs)(N,{label:`Model`,hint:`Free text; the list only holds suggestions.`,children:[(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),list:`ci-models`,className:`font-mono`}),(0,k.jsx)(`datalist`,{id:`ci-models`,children:ss[o].map(e=>(0,k.jsx)(`option`,{value:e},e))})]}),(0,k.jsx)(N,{label:`Build Argus from source`,children:(0,k.jsx)(cr,{checked:u,onChange:d,label:`Build Argus from source`})})]}),f?.error&&(0,k.jsxs)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:[f.error,`. Set the public URL of this dashboard first (Settings → Server & CI).`]}),m&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13.5px] text-ink-2`,children:m.note}),p&&(0,k.jsxs)(`div`,{className:`mb-4`,children:[(0,k.jsx)(`div`,{className:`mb-1.5 text-[12px] font-medium tracking-wide text-ink-3 uppercase`,children:`Secrets to add`}),(0,k.jsx)(`ul`,{className:`space-y-1.5`,children:p.secrets.map(e=>(0,k.jsxs)(`li`,{className:`text-[13px] text-ink-2`,children:[(0,k.jsx)(`code`,{className:`font-mono text-ink`,children:e.name}),`: `,e.how]},e.name))})]}),(0,k.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`font-mono text-[12px] text-ink-3`,children:m.file}),(0,k.jsx)(br,{text:m.text})]}),(0,k.jsx)(yr,{children:m.text})]})]})}function Ws({token:e}){return(0,k.jsxs)(`div`,{className:`rounded-xl border border-minor/40 bg-minor/5 px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[13.5px] font-medium text-ink`,children:`Repository token`}),(0,k.jsx)(br,{text:e,label:`Copy token`})]}),(0,k.jsx)(`code`,{className:`mt-2 block font-mono text-[12.5px] break-all text-ink`,children:e}),(0,k.jsxs)(`p`,{className:`mt-2 text-[12.5px] text-ink-2`,children:[`Copy it now: you won't see it again. Add it to the repository's CI secrets as `,(0,k.jsx)(`code`,{className:`font-mono`,children:`ARGUS_TOKEN`}),`. Lost it? Regenerate it from the repository page.`]})]})}function Gs({repo:e,token:t}){let n=Hs(),r=Nr(`/status`);return(0,k.jsxs)(`div`,{className:`space-y-5`,children:[(0,k.jsx)(Ws,{token:t}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-2 font-display text-[16px]`,children:`Pipeline`}),n.fromPage&&!n.loading&&(0,k.jsxs)(`p`,{className:`mb-3 text-[12.5px] text-ink-3`,children:[`No public URL is set, so the pipeline sends results to this page's address, `,(0,k.jsx)(`span`,{className:`font-mono`,children:n.url}),`. Set the public URL under Server & CI if your CI reaches the dashboard at another address.`]}),n.loading||r.loading&&!r.data?(0,k.jsx)(ir,{}):(0,k.jsx)(Us,{version:r.data?.version??`0.2.1`,dashboardUrl:n.url,initialPlatform:Ls(e.platform)?e.platform:`github`})]})]})}function Ks({onAdded:e}){let[t,n]=(0,v.useState)(`github`),[r,i]=(0,v.useState)(Is.github.host),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(),d=Is[t],f=Bs(a),p=e=>{n(e),i(Is[e].host)},m=async()=>{if(f){c(!0),u(void 0);try{let n=await I(`/repositories`,{method:`POST`,json:{platform:t,host:r.trim()||d.host,...f}});e(n.repository,n.token)}catch(e){u(e.message)}finally{c(!1)}}};return(0,k.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,k.jsx)(`p`,{className:`text-[13.5px] text-ink-2`,children:`The review runs in the repository's own pipeline, with your model provider. Argus gives the repository a token: with it the pipeline pulls this dashboard's settings and sends each review back here.`}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Platform`,children:(0,k.jsx)(sr,{value:t,onChange:e=>p(e.target.value),children:Object.keys(Is).map(e=>(0,k.jsx)(`option`,{value:e,children:Is[e].name},e))})}),(0,k.jsx)(N,{label:`Host`,hint:d.fixedHost?void 0:`Change for self-hosted instances.`,children:(0,k.jsx)(M,{value:r,onChange:e=>i(e.target.value),disabled:d.fixedHost,className:`font-mono`})})]}),(0,k.jsx)(N,{label:`Repository`,hint:a.trim()&&!f?`Enter owner/name or the repository URL.`:f?`Owner ${f.owner}, repository ${f.name}`:`For example ${d.example}, or the repository URL.`,children:(0,k.jsx)(M,{value:a,onChange:e=>o(e.target.value),placeholder:`${d.example} or https://${d.host}/…`,className:`font-mono`})}),l&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:l}),(0,k.jsx)(`div`,{className:`flex justify-end`,children:(0,k.jsx)(j,{type:`submit`,variant:`primary`,loading:s,disabled:!f,children:`Add repository`})})]})}function qs({repo:e,onChange:t}){let n=Nr(`/repositories/${e.id}/token`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),s=zr(`admin`),c=Cr(),l=`${e.owner}/${e.name}`,u=n.data??void 0,d=async(e,t)=>{o(e);try{await t()}catch(e){c(`bad`,e.message)}finally{o(void 0)}},f=()=>d(`token`,async()=>{if(u&&!window.confirm(`Regenerate the token for ${l}? The current token stops working right away; update ARGUS_TOKEN in CI with the new one.`))return;let t=await I(`/repositories/${e.id}/token`,{method:`POST`});i(t.token),n.setData({prefix:t.prefix,createdAt:t.createdAt,lastUsedAt:null})}),p=()=>d(`revoke`,async()=>{window.confirm(`Revoke the token for ${l}? CI runs can no longer pull settings or send reviews until you create a new token.`)&&(await I(`/repositories/${e.id}/token`,{method:`DELETE`}),i(void 0),n.setData(null),c(`ok`,`Token revoked`))}),m=n=>d(`summary`,async()=>{let r=await I(`/repositories/${e.id}`,{method:`PUT`,json:{summaryOnly:n}});t({...e,summaryOnly:r.repository.summaryOnly})});return(0,k.jsxs)(P,{eyebrow:`Reviewed in CI`,title:`CI connection`,actions:s&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(j,{size:`sm`,loading:a===`token`,onClick:()=>void f(),children:u?`Regenerate token`:`Create token`}),u&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:a===`revoke`,onClick:()=>void p(),children:`Revoke`})]}),children:[n.loading&&!n.data&&n.data!==null?(0,k.jsx)(ir,{}):n.error?(0,k.jsx)(`p`,{className:`text-[13px] text-critical`,children:n.error}):u?(0,k.jsxs)(`dl`,{className:`grid gap-x-8 gap-y-2 text-[13px] md:grid-cols-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Token`}),(0,k.jsxs)(`dd`,{className:`mt-1 font-mono text-ink`,children:[`argus_`,u.prefix,`…`]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Created`}),(0,k.jsx)(`dd`,{className:`mt-1 text-ink-2`,children:wr(u.createdAt)})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Last used`}),(0,k.jsx)(`dd`,{className:`mt-1 text-ink-2`,children:u.lastUsedAt?wr(u.lastUsedAt):`Never`})]})]}):(0,k.jsxs)(`p`,{className:`text-[13.5px] text-ink-2`,children:[(0,k.jsx)(F,{tone:`warn`,children:`No active token`}),` CI runs of this repository cannot pull settings or send reviews until `,s?`you create`:`an admin creates`,` a token.`]}),r&&(0,k.jsx)(`div`,{className:`mt-5 border-t border-line pt-5`,children:(0,k.jsx)(Gs,{repo:e,token:r})}),(0,k.jsx)(`div`,{className:`mt-4 border-t border-line`,children:(0,k.jsx)(lr,{label:`Send summary only`,hint:(0,k.jsxs)(k.Fragment,{children:[`CI sends this dashboard only the outline of each review: counts, titles and locations of findings, timings and usage. Explanations, suggested fixes, code and the summary text stay on the pull request. Results stored before you turn this on stay as they were stored.`,!s&&` Only admins can change this.`]}),checked:e.summaryOnly,disabled:!s||a===`summary`,onChange:e=>void m(e)})})]})}var Js=[{value:`quiet`,title:`Quiet`,text:`Only critical and major defects. Silent otherwise.`},{value:`chill`,title:`Chill`,text:`Real defects of every severity, no nitpicks or style.`},{value:`assertive`,title:`Assertive`,text:`Everything a strict senior reviewer would say, including nitpicks.`}],Ys={bug:`Logic errors, wrong conditions, off-by-one, code vs comment mismatch`,security:`Injection, XSS, SSRF, authz, secrets, unsafe crypto`,performance:`N+1, quadratic loops, blocking I/O, memory growth`,concurrency:`Races, missing await, unhandled promises`,"error-handling":`Swallowed errors, missing null checks, cleanup`,"data-integrity":`Validation, rounding, money, time zones, units`,"api-contract":`Breaking signature or schema changes across files`,maintainability:`Duplication that will drift, hidden coupling`,readability:`Confusing flow likely to cause misuse`,testing:`Tests that cannot fail or test the wrong thing`,documentation:`Docs and comments made wrong by the change`,style:`Formatting and idiom (assertive profile only)`};function Xs(){let e=Yr(),t=e.get(`review.profile`),n=e.get(`review.categories`)??[],r=e.meta.severities;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Tone`,title:`Review profile`,children:[(0,k.jsx)(`div`,{className:`mb-2 flex items-center`,children:(0,k.jsx)(si,{path:`review.profile`})}),(0,k.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:Js.map(n=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`review.profile`,n.value),className:A(`rounded-xl border p-4 text-left transition-all`,t===n.value?`border-iris bg-iris-soft shadow-[0_0_0_3px_color-mix(in_oklab,var(--iris)_18%,transparent)]`:`border-line-strong hover:border-ink-3`),children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`font-display text-[17px] font-medium`,children:n.title}),(0,k.jsx)(`span`,{className:A(`h-3.5 w-3.5 rounded-full border-2`,t===n.value?`border-iris bg-iris`:`border-line-strong`)})]}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12.5px] leading-snug text-ink-2`,children:n.text})]},n.value))})]}),(0,k.jsx)(P,{eyebrow:`Precision`,title:`What gets reported`,children:(0,k.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(ui,{path:`review.minSeverity`,label:`Severity floor`,hint:`Findings below this severity are dropped. Profiles can raise it further (quiet ⇒ major).`,options:r.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}),(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Confidence threshold: `,(0,k.jsxs)(`span`,{className:`font-mono`,children:[Math.round((e.get(`review.minConfidence`)??.6)*10),`/10`]}),(0,k.jsx)(si,{path:`review.minConfidence`})]}),hint:`Verified score a finding needs to be posted. Higher means fewer, surer comments.`,children:(0,k.jsx)(`input`,{type:`range`,min:1,max:10,value:Math.round((e.get(`review.minConfidence`)??.6)*10),onChange:t=>e.set(`review.minConfidence`,Number(t.target.value)/10),className:`w-full max-w-sm accent-[var(--iris)]`})}),(0,k.jsx)(li,{path:`review.maxComments`,label:`Max inline comments per review`,min:1,max:200,hint:`Extra findings go into the summary.`}),(0,k.jsx)(fi,{path:`review.language`,label:`Review language`,hint:`Language for comments, e.g. English, German, Macedonian.`})]})}),(0,k.jsx)(P,{eyebrow:`Focus`,title:`Categories`,actions:(0,k.jsx)(si,{path:`review.categories`}),children:(0,k.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.meta.categories.map(t=>{let r=n.includes(t);return(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`review.categories`,r?n.filter(e=>e!==t):[...n,t]),className:A(`flex items-start gap-3 rounded-xl border px-3.5 py-2.5 text-left transition-colors`,r?`border-iris/50 bg-iris-soft/60`:`border-line hover:border-line-strong`),children:[(0,k.jsx)(`span`,{className:A(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border text-[10px]`,r?`border-iris bg-iris text-iris-ink`:`border-line-strong`),children:r?`✓`:``}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink`,children:t}),(0,k.jsx)(`span`,{className:`block text-[12px] text-ink-3`,children:Ys[t]})]})]},t)})})}),(0,k.jsx)(P,{eyebrow:`Pipeline`,title:`Quality passes`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.verifyFindings`,label:`Verify every finding`,hint:`A second model pass re-derives each finding from the code and discards speculation. Biggest precision gain; costs one extra call per batch.`}),(0,k.jsx)(L,{path:`review.crossFileAnalysis`,label:`Cross-file analysis`,hint:`Looks at all changed files together for broken contracts, missed callers and inconsistent changes.`}),(0,k.jsx)(L,{path:`review.secretScan`,label:`Secret scanning`,hint:`Deterministic detection of keys, tokens and passwords in added lines.`}),(0,k.jsx)(L,{path:`review.incremental`,label:`Incremental re-reviews`,hint:`On new pushes, review only what changed since the last reviewed commit.`}),(0,k.jsx)(L,{path:`review.adaptive`,label:`Learn from developer reactions`,hint:`Categories the team keeps dismissing (👎, “false positive”, “intended”) need more confidence in that repository; categories that are almost always fixed get a little more room. Kicks in after 8 decided comments per category.`}),(0,k.jsx)(L,{path:`review.cache.enabled`,label:`Reuse identical model answers`,hint:`Requests with exactly the same prompt (same code, context and settings) are answered from a local cache for a week: re-running a review on an unchanged commit is instant and free.`}),(0,k.jsx)(L,{path:`review.autoResolve`,label:`Resolve threads when the issue is fixed`,hint:`On each new push, findings whose code changed are re-checked; fixed ones get a “✅ Fixed in abc123” reply and their thread is resolved.`})]})}),(0,k.jsxs)(P,{eyebrow:`Merge gate`,title:`Commit status`,children:[(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`review.status.enabled`,label:`Report an argus commit status`,hint:`Pending while the review runs, then failure, error (the review did not complete) or success. Require the argus check in branch protection to block merges until it passes.`})}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`review.status.enabled`)&&`pointer-events-none opacity-50`),children:(0,k.jsx)(ui,{path:`review.status.failOn`,label:`Fail when a finding is at least`,options:[{value:`critical`,label:`Critical`},{value:`major`,label:`Major`},{value:`minor`,label:`Minor`}]})})]}),(0,k.jsxs)(P,{eyebrow:`Output`,title:`Comments and approval`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.suggestions`,label:`Committable suggestions`,hint:`Include one-click fix suggestions (GitHub and GitLab; shown as code on Bitbucket).`}),(0,k.jsx)(L,{path:`review.agentPrompts`,label:`Prompt for AI agents`,hint:`Add a collapsible prompt to each comment for Claude Code, Codex or Cursor.`}),(0,k.jsx)(L,{path:`review.approveWhenClean`,label:`Approve when no issues are found`})]}),(0,k.jsx)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(ui,{path:`review.requestChangesOn`,label:`Request changes when a finding is at least`,options:[{value:`never`,label:`Never (comment only)`},{value:`critical`,label:`Critical`},{value:`major`,label:`Major`}]})})]}),(0,k.jsx)(P,{eyebrow:`Limits`,title:`Size and throughput`,children:(0,k.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:[(0,k.jsx)(li,{path:`review.maxFiles`,label:`Max files per review`,min:1}),(0,k.jsx)(li,{path:`review.maxPatchLines`,label:`Max changed lines`,min:100,hint:`Larger PRs are reviewed up to this budget.`}),(0,k.jsx)(li,{path:`review.concurrency`,label:`Parallel model calls`,min:1,max:16})]})})]})}function Zs(){return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(P,{eyebrow:`Walkthrough`,title:`Summary comment`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`summary.enabled`,label:`Generate a summary`,hint:`One persistent comment on the PR, edited in place on every review.`}),(0,k.jsx)(L,{path:`summary.walkthrough`,label:`Walkthrough paragraph`}),(0,k.jsx)(L,{path:`summary.changesTable`,label:`Changed files table`}),(0,k.jsx)(L,{path:`summary.sequenceDiagram`,label:`Sequence diagram`,hint:`Mermaid diagram of the main runtime flow (GitHub and GitLab render it).`}),(0,k.jsx)(L,{path:`summary.effortEstimate`,label:`Review effort estimate`}),(0,k.jsx)(L,{path:`summary.collapseWalkthrough`,label:`Collapse the walkthrough`})]})}),(0,k.jsxs)(P,{eyebrow:`Pull request`,title:`Description and labels`,children:[(0,k.jsx)(`div`,{className:`grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(ui,{path:`summary.updateDescription`,label:`Write the PR description`,options:[{value:`never`,label:`Never`},{value:`when-empty`,label:`Only when the description is empty`},{value:`append`,label:`Append a summary section`}]})}),(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`summary.applyLabels`,label:`Apply suggested labels`,hint:`Adds up to 4 labels such as bug, feature or security (GitHub and GitLab).`})})]}),(0,k.jsx)(P,{eyebrow:`Intent`,title:`Linked issues`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`tickets.enabled`,label:`Read linked issues`,hint:`Finds #123, owner/repo#123, issue URLs and Jira or Linear keys (PROJ-42) in the title, branch, description and commits, and gives the reviewer the issue text so the code is held to it. Jira and Linear need credentials under Server & CI.`}),(0,k.jsx)(L,{path:`tickets.checkRequirements`,label:`Check requirement coverage`,hint:`Extracts the acceptance criteria from each issue and marks every one as met, partial, missing or unclear in the summary comment.`}),(0,k.jsx)(di,{path:`tickets.allowedRepos`,label:`Other repositories`,hint:`Issues of the pull request's own owner are always read. Add owner/name (globs allowed) for other repositories Argus may read issues from.`,placeholder:`acme/*, partner/api`}),(0,k.jsx)(di,{path:`tickets.projectKeys`,label:`Jira and Linear projects`,hint:`Only tickets from these project keys are read. Empty means Jira and Linear tickets are never fetched.`,placeholder:`PAY, ENG`})]})})]})}function Qs(){let e=Yr().get(`chat.mention`);return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Triggers`,title:`Automatic reviews`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`autoReview.enabled`,label:`Review pull requests automatically`,hint:`On open, reopen, ready-for-review and every new push.`}),(0,k.jsx)(L,{path:`autoReview.drafts`,label:`Review draft pull requests`})]}),(0,k.jsxs)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(di,{path:`autoReview.baseBranches`,label:`Only target branches`,hint:`Glob or /regex/. Empty means all branches.`,placeholder:`main, release/*`}),(0,k.jsx)(di,{path:`autoReview.labels`,label:`Only with labels`,hint:`Empty means no label is required.`,mono:!1,placeholder:`ai-review`}),(0,k.jsx)(di,{path:`autoReview.ignoreTitleKeywords`,label:`Skip titles containing`,mono:!1}),(0,k.jsx)(di,{path:`autoReview.ignoreAuthors`,label:`Skip authors`,placeholder:`dependabot[bot]`})]})]}),(0,k.jsxs)(P,{eyebrow:`Conversation`,title:`Chat and commands`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`chat.enabled`,label:`Reply to mentions and review threads`}),(0,k.jsx)(L,{path:`chat.learnFromFeedback`,label:`Learn from feedback`,hint:`When someone corrects Argus, store the lesson as a learning for future reviews.`})]}),(0,k.jsx)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(fi,{path:`chat.mention`,label:`Mention`,mono:!0,hint:`Commands: ${e} review · full review · review focus <topic> · pause · resume · resolve · remember <rule> · help`})})]})]})}function $s(){let e=Yr();return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Scope`,title:`Path filters`,children:[(0,k.jsxs)(`div`,{className:`grid gap-5`,children:[(0,k.jsx)(di,{path:`files.include`,label:`Only review`,hint:`Glob patterns. Empty means everything. A leading ! excludes.`,placeholder:`src/**, !src/generated/**`}),(0,k.jsx)(di,{path:`files.exclude`,label:`Never review`,placeholder:`**/*.test.ts, docs/**`})]}),(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`files.useDefaultExcludes`,label:`Skip lock files, build output, minified, vendored and binary files`})})]}),(0,k.jsxs)(P,{eyebrow:`Context`,title:`What the reviewer can see`,children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Context depth`,(0,k.jsx)(si,{path:`files.contextDepth`})]}),hint:`Related context adds imported files and other usages of changed symbols, which is how cross-file bugs are caught.`,children:(0,k.jsx)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[[`diff`,`Diff only`,`Fastest and cheapest`],[`files`,`Full files`,`Whole changed files`],[`related`,`Related code`,`Files + imports + usages`]].map(([t,n,r])=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`files.contextDepth`,t),className:A(`rounded-xl border px-4 py-3 text-left`,e.get(`files.contextDepth`)===t?`border-iris bg-iris-soft`:`border-line-strong hover:border-ink-3`),children:[(0,k.jsx)(`div`,{className:`font-medium`,children:n}),(0,k.jsx)(`div`,{className:`text-[12.5px] text-ink-3`,children:r})]},t))})}),(0,k.jsx)(`div`,{className:`mt-2`,children:(0,k.jsx)(L,{path:`files.codeGraph`,label:`Syntax-tree code graph`,hint:`Parses TypeScript, JavaScript, Python, Go, Java, Rust, Ruby, PHP, C# and C++ with tree-sitter to find real callers (with the function they sit in), definitions, implementations and the transitive impact of a change. Feeds related context, the reviewer's tools and risk scoring. Other languages fall back to text search.`})}),(0,k.jsx)(`div`,{className:`mt-3 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(li,{path:`files.maxContextChars`,label:`Context budget (characters)`,min:2e4,step:1e4})})]}),(0,k.jsx)(P,{eyebrow:`Conventions`,title:`Guideline files`,children:(0,k.jsx)(di,{path:`files.guidelineFiles`,label:`Read these files from the repository`,hint:`Nested files apply only to their directory, e.g. services/billing/CLAUDE.md covers services/billing/**.`})})]})}var ec={types:`types`,lint:`lint`,security:`security`,secret:`secrets`,dependency:`dependencies`};function tc(){let e=Yr(),t=e.get(`review.agent.enabled`),n=e.get(`review.voting.enabled`),r=e.get(`review.voting.passes`)??3,i=e.get(`analyzers.enabled`),a=e.get(`review.verifyFindings`),o=n&&e.get(`review.voting.doubleCheckCritical`),s=[{label:`Analyze`,detail:`linters · scanners`,on:!!i},{label:`Route`,detail:`light · standard · deep`,on:!!e.get(`review.routing.enabled`)},{label:`Review`,detail:n?`${r} lenses on risky files`:`one pass`,on:!0},{label:`Explore`,detail:`read · grep · references`,on:!!t},{label:`Verify`,detail:`every finding`,on:!!a},{label:`Second check`,detail:`critical findings`,on:!!(o&&a)},{label:`Prove`,detail:`tests reproduce bugs`,on:!!(e.get(`execution.enabled`)&&e.get(`execution.proveFindings`))}];return(0,k.jsx)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:s.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(`div`,{className:A(`rounded-xl border px-3.5 py-2 transition-colors`,e.on?`border-iris/45 bg-iris-soft/60`:`border-dashed border-line-strong opacity-55`),children:[(0,k.jsx)(`div`,{className:A(`font-display text-[14.5px] leading-tight`,e.on?`text-ink`:`text-ink-3 line-through decoration-ink-3/50`),children:e.label}),(0,k.jsx)(`div`,{className:`font-mono text-[10.5px] tracking-wide text-ink-3`,children:e.detail})]}),t<s.length-1&&(0,k.jsx)(`span`,{className:`font-mono text-ink-3`,children:`→`})]},e.label))})}function nc(){let e=Yr(),t=Nr(`/analyzers`),n=e.get(`analyzers.disabled`)??[],r=e.get(`analyzers.enabled`);return t.error?(0,k.jsx)(`p`,{className:`text-[13px] text-critical`,children:t.error}):t.data?(0,k.jsx)(`div`,{className:A(`divide-y divide-line`,!r&&`pointer-events-none opacity-50`),children:t.data.analyzers.map(t=>{let r=!n.includes(t.name);return(0,k.jsxs)(`div`,{className:`flex items-start gap-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[13.5px] font-medium text-ink`,children:t.label}),(0,k.jsx)(F,{children:ec[t.kind]}),t.installed===!0&&(0,k.jsx)(F,{tone:`ok`,children:`installed`}),t.installed===!1&&(0,k.jsx)(F,{tone:`warn`,children:`not installed`}),t.installed===null&&(0,k.jsx)(F,{tone:`iris`,children:`uses repo dependencies`})]}),(0,k.jsx)(`p`,{className:`mt-0.5 text-[12.5px] leading-snug text-ink-3`,children:t.description}),t.installed!==!0&&(0,k.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-snug text-ink-3/80 italic`,children:t.note})]}),(0,k.jsx)(cr,{checked:r,label:`Run ${t.label}`,onChange:r=>e.set(`analyzers.disabled`,r?n.filter(e=>e!==t.name):[...n,t.name])})]},t.name)})}):(0,k.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-[13px] text-ink-3`,children:[(0,k.jsx)(ir,{size:13}),` Checking which tools are installed…`]})}function rc(){let e=Yr(),t=Nr(`/execution`),n=e.get(`execution.enabled`),r=e.get(`execution.sandbox`)??`auto`,i=e.meta.severities;return(0,k.jsxs)(P,{eyebrow:`Proof`,title:`Run the tests and prove findings`,actions:t.data?t.data.docker?(0,k.jsx)(F,{tone:`ok`,children:`Docker ready`}):(0,k.jsx)(F,{tone:`warn`,children:`Docker not found`}):(0,k.jsx)(ir,{size:13}),children:[e.isLocked(`execution.sandbox`)&&(0,k.jsxs)(`p`,{className:`mb-3 rounded-lg border border-line px-3 py-2 text-[12.5px] text-ink-3`,children:[`Settings marked `,(0,k.jsx)(`span`,{className:`font-mono text-[10px] uppercase`,children:`admin only`}),` decide what code runs and where. `,e.lockNote,`.`]}),(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`execution.enabled`,label:`Install dependencies and run code`,hint:`A private copy of the pull request is installed in a container (vitest, jest, npm test, pytest or go test are detected). Installs get network access; tests run with networking disabled, CPU and memory limits, and no access to your files. tsc and ESLint also run against the installed copy.`}),(0,k.jsx)(L,{path:`execution.runTests`,label:`Run the test suite`,hint:`Failing tests are re-run against the base branch: ones that passed before are reported as regressions caused by this change, ones that already failed are ignored.`}),(0,k.jsx)(L,{path:`execution.proveFindings`,label:`Write a test for each serious finding`,hint:`The model writes a focused test that should fail because of the bug. If it fails, and passes once the suggested fix is applied, the finding is marked as reproduced and shown with the test. If it passes, the finding loses confidence.`})]}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-3`,!n&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Where code runs`,(0,k.jsx)(si,{path:`execution.sandbox`}),(0,k.jsx)(ci,{path:`execution.sandbox`})]}),hint:r===`host`?`Runs directly on this machine. Only for your own repositories.`:`Docker isolates untrusted pull requests.`,children:(0,k.jsx)(`div`,{className:A(e.isLocked(`execution.sandbox`)&&`pointer-events-none opacity-60`),children:(0,k.jsx)(gr,{value:r,options:[{value:`auto`,label:`Auto`,hint:`Use Docker when available, otherwise skip`},{value:`docker`,label:`Docker`,hint:`Always in Docker; skipped when Docker is unavailable`},{value:`host`,label:`This machine`,hint:`No isolation; for trusted code only`}],onChange:t=>e.set(`execution.sandbox`,t)})})}),(0,k.jsx)(ui,{path:`execution.isolation`,label:`Isolation`,hint:`Strict drops every Linux capability and makes the container filesystem read-only while tests run.`,options:[{value:`strict`,label:`Strict (recommended)`},{value:`standard`,label:`Standard`}]}),(0,k.jsx)(ui,{path:`execution.runtime`,label:`Container runtime`,hint:`gVisor (runsc) or Kata Containers add a kernel boundary for untrusted pull requests; auto uses them when Docker has them.`,options:[{value:`auto`,label:`Auto (gVisor or Kata when installed)`},{value:`runsc`,label:`gVisor (runsc)`},{value:`kata`,label:`Kata Containers`},{value:`runc`,label:`Default (runc)`}]}),(0,k.jsx)(li,{path:`execution.maxProofs`,label:`Findings to prove per review`,min:0,max:20}),(0,k.jsx)(ui,{path:`execution.proofMinSeverity`,label:`Prove findings of at least`,options:i.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}),(0,k.jsx)(fi,{path:`execution.installCommand`,label:`Install command`,placeholder:`Detected automatically`,mono:!0}),(0,k.jsx)(fi,{path:`execution.testCommand`,label:`Test command`,placeholder:`Detected automatically`,mono:!0}),(0,k.jsx)(fi,{path:`execution.image`,label:`Container image`,placeholder:`node:22-bookworm, python:3.12-bookworm…`,mono:!0}),(0,k.jsx)(li,{path:`execution.timeoutSec`,label:`Install timeout (s)`,min:30,max:3600}),(0,k.jsx)(li,{path:`execution.testTimeoutSec`,label:`Test-suite timeout (s)`,min:30,max:3600,hint:`Tests run without network; ones that need it fail or time out and are ignored unless they passed on the base branch.`}),(0,k.jsx)(li,{path:`execution.proofTimeoutSec`,label:`Timeout per proof test (s)`,min:10,max:1800})]})]})}function ic(){let e=Yr(),t=e.get(`review.agent.enabled`),n=e.get(`review.voting.enabled`),r=String(e.get(`review.voting.passes`)??3),i=e.get(`review.voting.scope`)??`risky`;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Pipeline`,title:`How deep each review goes`,children:[(0,k.jsx)(tc,{}),(0,k.jsx)(`p`,{className:`mt-3 text-[12.5px] leading-snug text-ink-3`,children:`Every stage trades time and tokens for precision. Disabled stages are skipped; the rest run in this order for each pull request.`})]}),(0,k.jsxs)(P,{eyebrow:`Exploration`,title:`Agentic codebase exploration`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.agent.enabled`,label:`Let the reviewer explore the repository`,hint:`The model can read files, search the code, look up definitions, callers, implementations and the transitive impact of a change, and check history before it reports anything. API models use Argus tools; Claude Code and Codex explore a read-only checkout with their own tools.`}),(0,k.jsx)(L,{path:`review.agent.verify`,label:`Explore during verification`,hint:`The verifier checks each finding against the code it points at: guards elsewhere, broken callers, existing validation. The biggest single cut in false positives.`})]}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!t&&`pointer-events-none opacity-50`),children:(0,k.jsx)(li,{path:`review.agent.maxSteps`,label:`Tool rounds per call`,min:1,max:40,hint:`Upper bound on exploration per review batch. 6–10 covers most pull requests.`})})]}),(0,k.jsxs)(P,{eyebrow:`Consensus`,title:`Multi-pass voting`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.voting.enabled`,label:`Review high-risk files several times`,hint:`Auth, payments, migrations, security-sensitive and large changes get extra independent passes, each with a different lens (adversarial, edge cases, contracts). Findings are clustered across passes; the ones most passes agree on gain confidence, lone findings need a stronger verification score.`}),(0,k.jsx)(L,{path:`review.voting.doubleCheckCritical`,label:`Second, independent check for critical findings`,hint:`A skeptical verifier must also confirm every critical finding before it is posted, so a false critical never blocks a merge.`})]}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-3`,!n&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Passes per high-risk file`,(0,k.jsx)(si,{path:`review.voting.passes`})]}),children:(0,k.jsx)(gr,{value:r,options:[`2`,`3`,`4`,`5`].map(e=>({value:e,label:e})),onChange:t=>e.set(`review.voting.passes`,Number(t))})}),(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Which files`,(0,k.jsx)(si,{path:`review.voting.scope`})]}),children:(0,k.jsx)(gr,{value:i,options:[{value:`risky`,label:`High-risk`,hint:`Files scored as risky by path, change size, summary and analyzers`},{value:`all`,label:`All files`,hint:`Every reviewed file except tests and docs; costs more`}],onChange:t=>e.set(`review.voting.scope`,t)})}),i===`risky`&&(0,k.jsx)(li,{path:`review.voting.maxFiles`,label:`Max high-risk files`,min:1,max:50})]})]}),(0,k.jsx)(rc,{}),(0,k.jsxs)(P,{eyebrow:`Cost`,title:`Model routing and spending`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.routing.enabled`,label:`Route files by risk`,hint:`Formatting- and comment-only changes get a light review without exploration; high-risk files go to the high-risk model and get voting. Set the light and high-risk models under Models & providers.`}),(0,k.jsx)(L,{path:`review.routing.triage`,label:`Triage small changes with the light model`,hint:`A cheap model decides which small files have no behavioural impact (copy text, version bumps). Only runs when a light model is set. When unsure it keeps the full review.`})]}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`review.routing.enabled`)&&`pointer-events-none opacity-50`),children:(0,k.jsx)(li,{path:`review.routing.maxTrivialLines`,label:`Largest change triage may call trivial`,min:1,max:500,hint:`Changed lines. Bigger files always get the full review.`})}),(0,k.jsxs)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Spending limit per review (USD)`,(0,k.jsx)(si,{path:`review.maxCostUsd`}),(0,k.jsx)(ci,{path:`review.maxCostUsd`})]}),hint:`Stops calling paid APIs once a single review reaches this amount (default $5). Subscriptions (Claude Code, Codex, Copilot) report no cost and are not limited.`,children:(0,k.jsx)(`input`,{type:`number`,min:.01,step:.05,value:e.get(`review.maxCostUsd`)??``,disabled:e.isLocked(`review.maxCostUsd`),placeholder:`5`,onChange:t=>e.set(`review.maxCostUsd`,t.target.value===``?void 0:Math.max(.01,Number(t.target.value))),className:`h-9 w-full max-w-48 rounded-lg border border-line-strong bg-panel-2 px-3 font-mono text-[13px] text-ink outline-none focus:border-iris`})}),(0,k.jsx)(li,{path:`review.timeoutMinutes`,label:`Time limit per review (minutes)`,min:1,max:240,hint:`A review still running after this is stopped and its commit status set to error.`})]})]}),(0,k.jsxs)(P,{eyebrow:`Evidence`,title:`Linters and security scanners`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`analyzers.enabled`,label:`Run static analysis on changed files`,hint:`Results on changed lines are handed to the model as evidence to confirm, explain or dismiss, never posted raw. Type errors elsewhere that mention a changed symbol are included, so broken callers surface.`}),(0,k.jsx)(L,{path:`analyzers.promoteSecurity`,label:`Post leaked secrets and vulnerable dependencies directly`,hint:`Gitleaks matches and high-severity OSV advisories on added lines become findings without waiting for the model.`})]}),(0,k.jsx)(`div`,{className:`mt-2`,children:(0,k.jsx)(nc,{})}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`analyzers.enabled`)&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(di,{path:`analyzers.semgrepConfig`,label:`Semgrep rulesets`,placeholder:`p/default`,hint:`Registry packs (p/owasp-top-ten, p/typescript) or paths to rule files in the repository.`}),(0,k.jsx)(li,{path:`analyzers.timeoutSec`,label:`Timeout per tool (seconds)`,min:10,max:1800})]})]})]})}var ac=[`review`,`depth`,`summary`,`triggers`,`files`,`rules`,`guidelines`];function oc(){let{id:e}=At(),t=Number(e),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(`overview`),f=Cr(),p=(0,v.useCallback)(async()=>{try{let[e,n,i]=await Promise.all([I(`/repositories`),I(`/meta`),I(`/config`)]),o=e.repositories.find(e=>e.id===t);if(!o)throw Error(`Repository not found`);r(o),a(n),s(i.config)}catch(e){l(e.message)}},[t]);(0,v.useEffect)(()=>{p()},[p]);let m=(0,v.useMemo)(()=>i&&o?Kr(i.defaults,o):void 0,[i,o]),h=(0,v.useCallback)(async e=>{let n=await I(`/repositories/${t}`,{method:`PUT`,json:{config:e}});r(e=>e&&{...e,config:n.repository.config}),n.ignoredKeys?.length&&f(`info`,`Not saved, only an admin can set: ${n.ignoredKeys.join(`, `)}`)},[t,f]);if(c)return(0,k.jsx)(`div`,{className:`rounded-xl border border-critical/40 p-6 text-critical`,children:c});if(!n||!i||!m)return(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading repository…`]});let g=Object.keys(n.config??{}).length;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(Vn,{to:`/repositories`,className:`hover:text-ink`,children:`Repositories`}),`/ `,n.integrationId===null?`Reviewed in CI`:n.integrationName]}),title:(0,k.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(Tr,{platform:n.platform,size:26}),(0,k.jsxs)(`span`,{className:`font-mono text-[28px]`,children:[n.owner,`/`,(0,k.jsx)(`b`,{children:n.name})]})]}),description:g?`${g} setting group${g>1?`s`:``} override the global configuration.`:`Inherits every global setting. Override anything below for this repository only.`,actions:(0,k.jsxs)(`label`,{className:`flex items-center gap-2.5 rounded-xl border border-line-strong bg-panel px-3.5 py-2 text-[13px]`,children:[(0,k.jsx)(cr,{checked:n.enabled,label:`Reviews enabled`,onChange:async e=>{try{await I(`/repositories/${n.id}`,{method:`PUT`,json:{enabled:e}}),r({...n,enabled:e})}catch(e){f(`bad`,e.message)}}}),n.enabled?`Reviews on`:`Reviews off`]})}),(0,k.jsx)(`div`,{className:`mb-6 overflow-x-auto scrollbar-thin`,children:(0,k.jsx)(gr,{value:u,onChange:d,options:[{value:`overview`,label:`Overview`},{value:`review`,label:`Review`},{value:`depth`,label:`Depth`},{value:`summary`,label:`Summary`},{value:`triggers`,label:`Triggers`},{value:`files`,label:`Files`},{value:`rules`,label:`Rules`},{value:`guidelines`,label:`Guidelines`},{value:`learnings`,label:`Learnings`},{value:`file`,label:`.argus.yml`}]})}),u===`overview`&&(0,k.jsx)(sc,{repo:n,onChange:r}),ac.includes(u)&&(0,k.jsxs)(Xr,{base:m,meta:i,stored:n.config,onSave:h,scope:`repository`,children:[(0,k.jsxs)(`p`,{className:`mb-4 rounded-xl border border-iris/30 bg-iris-soft/50 px-4 py-2.5 text-[13px] text-ink-2`,children:[`Changes here apply to `,(0,k.jsxs)(`b`,{className:`text-ink`,children:[n.owner,`/`,n.name]}),` only. Values that differ from the global settings are marked `,(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-iris uppercase`,children:`overridden`}),`.`]}),u===`review`&&(0,k.jsx)(Xs,{}),u===`depth`&&(0,k.jsx)(ic,{}),u===`summary`&&(0,k.jsx)(Zs,{}),u===`triggers`&&(0,k.jsx)(Qs,{}),u===`files`&&(0,k.jsx)($s,{}),u===`rules`&&(0,k.jsx)(os,{}),u===`guidelines`&&(0,k.jsx)(hi,{})]}),u===`learnings`&&(0,k.jsx)(bi,{repositoryId:n.id,ci:n.integrationId===null}),u===`file`&&(0,k.jsx)(cc,{repo:n})]})}function sc({repo:e,onChange:t}){let n=Nr(`/reviews?repository=${e.id}&limit=20`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=Cr(),c=e.platform===`github`?`pull`:e.platform===`gitlab`?`-/merge_requests`:`pull-requests`,l=e.integrationId===null;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[l&&(0,k.jsx)(qs,{repo:e,onChange:t}),(0,k.jsx)(ri,{repositoryId:e.id}),!l&&(0,k.jsx)(P,{eyebrow:`Manual`,title:`Review a pull request`,children:(0,k.jsxs)(`form`,{className:`flex gap-2`,onSubmit:async t=>{t.preventDefault(),o(!0);try{let t=/^\d+$/.test(r.trim())?r.trim():void 0;await I(`/reviews`,{method:`POST`,json:{url:t?`https://${e.host}/${e.owner}/${e.name}/${c}/${t}`:r.trim()}}),s(`ok`,`Review queued`),i(``),n.reload()}catch(e){s(`bad`,e.message)}finally{o(!1)}},children:[(0,k.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`Pull request number or URL, e.g. 42`,className:`h-9 flex-1 rounded-lg border border-line-strong bg-panel px-3 font-mono text-[13px] focus:border-iris focus:ring-2 focus:ring-iris/25 focus:outline-none`}),(0,k.jsx)(j,{variant:`primary`,loading:a,disabled:!r.trim(),type:`submit`,children:`Review`})]})}),(0,k.jsx)(P,{eyebrow:`History`,title:`Recent reviews`,padded:!1,children:(0,k.jsx)(ei,{reviews:n.data?.reviews,loading:n.loading,onChange:()=>void n.reload(),hideRepo:!0})})]})}function cc({repo:e}){let t=e.integrationId!==null,n=Nr(t?`/repositories/${e.id}/repo-config`:null),r=Nr(`/repositories/${e.id}/effective-config`),i=(0,v.useMemo)(()=>{if(!r.data)return``;let{learnings:t,...n}=r.data.config;return`# Generated by Argus for ${e.owner}/${e.name}\n${ts(n)}`},[r.data,e]);return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[t&&(0,k.jsx)(P,{eyebrow:`In the repository`,title:n.data?.file??`.argus.yml`,actions:n.data?.file?(0,k.jsx)(F,{tone:`ok`,children:`Found on the default branch`}):(0,k.jsx)(F,{children:`Not present`}),children:n.loading?(0,k.jsx)(ir,{}):n.data?.text?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13px] text-ink-2`,children:`Settings in this file are applied on top of everything configured here, per pull request (the file is read from the PR's head commit).`}),(0,k.jsx)(yr,{children:n.data.text})]}):(0,k.jsx)(`p`,{className:`text-[13.5px] text-ink-2`,children:`The repository has no Argus config file. That's fine: the settings configured in this dashboard apply. Add one to keep review settings in code, or to use Argus from CI.`})}),(0,k.jsxs)(P,{eyebrow:`Export`,title:`Effective settings as .argus.yml`,actions:i&&(0,k.jsx)(br,{text:i,label:`Copy YAML`}),children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13px] text-ink-2`,children:`Everything this repository uses today (global settings plus overrides). Commit it to run the same review from GitHub Actions, GitLab CI, Bitbucket Pipelines or Azure Pipelines.`}),r.loading?(0,k.jsx)(ir,{}):(0,k.jsx)(yr,{className:`max-h-[480px]`,children:i})]})]})}var lc={github:{name:`GitHub`,host:`github.com`,token:`Personal access token`,steps:[`Create a fine-grained token (Settings → Developer settings → Fine-grained tokens) for the repositories Argus should review.`,`Repository permissions: Pull requests — Read and write, Contents — Read, Issues — Read and write, Webhooks — Read and write (only for automatic webhook setup), Metadata — Read.`,`A classic token with the repo scope also works.`],link:`https://github.com/settings/personal-access-tokens/new`},gitlab:{name:`GitLab`,host:`gitlab.com`,token:`Access token`,steps:[`Create a personal access token with the api scope (User settings → Access tokens). Use a dedicated bot user if you can.`,`On self-managed GitLab (or GitLab.com Premium) a project or group access token with the api scope and Developer role also works.`,`For self-managed GitLab, set the host below to your instance, e.g. gitlab.example.com.`],link:`https://gitlab.com/-/user_settings/personal_access_tokens`},bitbucket:{name:`Bitbucket`,host:`bitbucket.org`,token:`Access token or API token`,steps:[`Recommended: a repository access token (Repository settings → Access tokens) with Pull requests: Write, Repositories: Read and Webhooks: Read and write. Leave the username empty.`,`Alternatively an Atlassian API token with Bitbucket scopes: enter your Atlassian email as the username.`,`Repository tokens cannot list repositories, so add repositories by URL.`],link:`https://support.atlassian.com/bitbucket-cloud/docs/create-a-repository-access-token/`},azure:{name:`Azure DevOps`,host:`dev.azure.com`,token:`Personal access token`,steps:[`Create a personal access token (User settings → Personal access tokens) with Code: Read & write, Pull Request Threads: Read & write and Service Hooks: Read, write & manage (so Argus can install the service hooks). Use a dedicated account if you can.`,`Enter your organization name (the part after dev.azure.com/).`,`Argus installs the Service Hooks (Pull request created, updated, commented on) for automatic reviews. Without the Service Hooks scope, add them by hand: they post to the webhook URL with basic authentication, any username and the webhook secret as the password.`],link:`https://learn.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate`},"bitbucket-server":{name:`Bitbucket Server`,host:``,token:`HTTP access token`,steps:[`Create an HTTP access token for a project or repository (Settings → HTTP access tokens), or a personal one on a service account. Repository admin lets Argus install the webhook and check who may use chat commands; with write only, add the webhook by hand and only pull request authors can use chat commands.`,`Enter the server host, for example bitbucket.acme.com.`,`Argus installs the repository webhook (Pull request opened, Source branch updated, Comment added) for automatic reviews when the token allows it.`],link:`https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html`}},uc={azure:{where:`Project settings → Service hooks → Create subscription → Web Hooks`,events:`One subscription each for: Pull request created, Pull request updated, Pull request commented on`,auth:`Basic authentication: any username, and the webhook secret as the password`},"bitbucket-server":{where:`Repository settings → Webhooks → Create webhook`,events:`Pull request: Opened, Source branch updated, Modified; Comment: Added`,auth:`Paste the webhook secret into the Secret field`}};function dc({repo:e,integration:t,reason:n,onClose:r}){let i=uc[e.platform],a=zr(`admin`),[o,s]=(0,v.useState)(),c=Cr();return(0,k.jsx)(_r,{open:!0,onClose:r,title:`Set up the webhook for ${e.owner}/${e.name}`,children:(0,k.jsxs)(`div`,{className:`space-y-4 text-[13.5px] text-ink-2`,children:[n&&(0,k.jsx)(`p`,{className:`rounded-lg border border-minor/40 bg-minor/5 px-3 py-2 text-[12.5px]`,children:n}),(0,k.jsxs)(`p`,{children:[`Argus can't install this webhook automatically. Add it in `,lc[e.platform].name,`:`]}),i&&(0,k.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-5`,children:[(0,k.jsx)(`li`,{children:i.where}),(0,k.jsx)(`li`,{children:i.events}),(0,k.jsx)(`li`,{children:i.auth})]}),(0,k.jsx)(N,{label:`Webhook URL`,children:t?.webhookUrl?(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(yr,{className:`flex-1`,children:t.webhookUrl}),(0,k.jsx)(br,{text:t.webhookUrl})]}):(0,k.jsx)(F,{tone:`warn`,children:`Set the public URL under Server & CI first`})}),(0,k.jsx)(N,{label:`Webhook secret`,children:o?(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(yr,{className:`flex-1`,children:o}),(0,k.jsx)(br,{text:o})]}):a&&t?(0,k.jsx)(j,{size:`sm`,onClick:async()=>{try{s((await I(`/integrations/${t.id}/webhook-secret`)).secret)}catch(e){c(`bad`,e.message)}},children:`Reveal secret`}):(0,k.jsx)(`span`,{className:`text-[12.5px] text-ink-3`,children:`Ask an admin for this connection's webhook secret.`})})]})})}function fc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),h=Cr(),g=async()=>{f(`create`),m(void 0);try{let e=new URLSearchParams;t.trim()&&e.set(`org`,t.trim()),r.trim()&&e.set(`name`,r.trim());let{action:n,manifest:i,webhooks:a}=await I(`/github-app/manifest?${e}`);a||h(`info`,`No public URL is set, so the app is created without webhooks; set one under Server & CI for automatic reviews`);let o=document.createElement(`form`);o.method=`post`,o.action=n;let s=document.createElement(`input`);s.type=`hidden`,s.name=`manifest`,s.value=JSON.stringify(i),o.appendChild(s),document.body.appendChild(o),o.submit()}catch(e){m(e.message),f(void 0)}},_=async()=>{f(`existing`),m(void 0);try{await I(`/integrations/github-app`,{method:`POST`,json:{appId:a.trim(),privateKey:s,...l.trim()?{installationId:l.trim()}:{}}}),h(`ok`,`GitHub App connected`),e()}catch(e){m(e.message)}finally{f(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-[16px]`,children:`Create a new GitHub App`}),(0,k.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-2`,children:`One click on GitHub creates a private app with exactly the permissions Argus needs (pull requests and issues: write, contents: read). Argus receives its key automatically, then you pick the repositories to install it on. Comments appear as the app’s bot and tokens rotate every hour.`}),(0,k.jsxs)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Organization (optional)`,hint:`Leave empty to create it under your personal account.`,children:(0,k.jsx)(M,{value:t,onChange:e=>n(e.target.value),placeholder:`acme`,className:`font-mono`})}),(0,k.jsx)(N,{label:`App name (optional)`,hint:`Must be unique on GitHub.`,children:(0,k.jsx)(M,{value:r,onChange:e=>i(e.target.value),placeholder:`Argus for acme`})})]}),(0,k.jsx)(j,{className:`mt-3`,variant:`primary`,loading:d===`create`,onClick:()=>void g(),children:`Create on GitHub ↗`})]}),(0,k.jsxs)(`details`,{className:`rounded-xl border border-line px-4 py-3`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-[13.5px] font-medium text-ink`,children:`Use an existing GitHub App`}),(0,k.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`App ID`,children:(0,k.jsx)(M,{value:a,onChange:e=>o(e.target.value),className:`font-mono`})}),(0,k.jsx)(N,{label:`Installation ID (optional)`,hint:`Found automatically from each repository when empty.`,children:(0,k.jsx)(M,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})})]}),(0,k.jsx)(N,{label:`Private key (.pem)`,children:(0,k.jsx)(or,{rows:5,value:s,onChange:e=>c(e.target.value),className:`font-mono text-[11.5px]`,placeholder:`-----BEGIN RSA PRIVATE KEY-----`})}),(0,k.jsx)(j,{loading:d===`existing`,disabled:!a.trim()||!s.includes(`PRIVATE KEY`),onClick:()=>void _(),children:`Connect app`})]})]}),p&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:p})]})}function pc({platform:e,onClose:t,onDone:n}){let r=lc[e],[i,a]=(0,v.useState)(e===`github`?`app`:`token`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(r.host),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(),y=Cr(),b=async()=>{h(!0),_(void 0);try{let t={platform:e,token:o.trim(),host:u.trim()||r.host};f.trim()&&(t.name=f.trim()),c.trim()&&(t.username=c.trim());let i=await I(`/integrations`,{method:`POST`,json:t});y(`ok`,i.message),n()}catch(e){_(e.message)}finally{h(!1)}};return(0,k.jsxs)(_r,{open:!0,onClose:t,title:`Connect ${r.name}`,footer:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(j,{variant:`ghost`,onClick:t,children:`Cancel`}),i===`token`&&(0,k.jsx)(j,{variant:`primary`,loading:m,disabled:o.trim().length<8,onClick:()=>void b(),children:`Connect`})]}),children:[e===`github`&&(0,k.jsx)(`div`,{className:`mb-5`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[{value:`app`,label:`GitHub App (recommended)`},{value:`token`,label:`Personal access token`}]})}),i===`app`?(0,k.jsx)(fc,{onDone:n}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`ol`,{className:`mb-5 list-decimal space-y-1.5 pl-5 text-[13px] text-ink-2`,children:r.steps.map(e=>(0,k.jsx)(`li`,{children:e},e))}),(0,k.jsxs)(`a`,{href:r.link,target:`_blank`,rel:`noreferrer`,className:`mb-5 inline-block text-[13px] text-iris underline underline-offset-4`,children:[`Open `,r.name,` token settings ↗`]}),(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsx)(N,{label:r.token,children:(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),className:`font-mono`})}),e===`azure`&&(0,k.jsx)(N,{label:`Organization`,hint:`dev.azure.com/<organization>`,children:(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),placeholder:`acme`,className:`font-mono`})}),(e===`bitbucket`||e===`bitbucket-server`)&&(0,k.jsx)(N,{label:`Username or email (optional)`,hint:`Only for Atlassian API tokens. Leave empty for access tokens.`,children:(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value)})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Host`,hint:e===`bitbucket`?`Use Bitbucket Server for self-hosted instances.`:e===`bitbucket-server`?`Your Bitbucket Server or Data Center host.`:`Change for self-hosted instances.`,children:(0,k.jsx)(M,{value:u,onChange:e=>d(e.target.value),disabled:e===`bitbucket`||e===`azure`,placeholder:e===`bitbucket-server`?`bitbucket.acme.com`:``,className:`font-mono`})}),(0,k.jsx)(N,{label:`Display name (optional)`,children:(0,k.jsx)(M,{value:f,onChange:e=>p(e.target.value),placeholder:`${r.name} (${u})`})})]}),g&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:g})]})]})]})}function mc(e){return e>0?[`connection`,`ci`]:[`ci`,`connection`]}function hc({integrations:e,onClose:t,onDone:n}){let r=mc(e.length),[i,a]=(0,v.useState)(r[0]),[o,s]=(0,v.useState)();return o?(0,k.jsx)(_r,{open:!0,onClose:n,title:`Connect ${o.repository.owner}/${o.repository.name} to CI`,wide:!0,footer:(0,k.jsx)(j,{variant:`primary`,onClick:n,children:`Done`}),children:(0,k.jsx)(Gs,{repo:o.repository,token:o.token})}):(0,k.jsxs)(_r,{open:!0,onClose:t,title:`Add a repository`,wide:!0,children:[r.length>1&&(0,k.jsx)(`div`,{className:`mb-5`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[{value:`connection`,label:`From a connection`},{value:`ci`,label:`Reviewed in CI`}]})}),i===`ci`?(0,k.jsx)(Ks,{onAdded:(e,t)=>s({repository:e,token:t})}):e.length===0?(0,k.jsx)(vr,{title:`No code host connected`,children:`Connect a code host first, or add the repository as reviewed in CI.`}):(0,k.jsx)(gc,{integrations:e,onDone:n})]})}function gc({integrations:e,onDone:t}){let[n,r]=(0,v.useState)(e[0]?.id??0),i=e.find(e=>e.id===n),a=Nr(i?`/integrations/${i.id}/remote-repositories`:null,[n]),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(),m=Cr(),h=(0,v.useMemo)(()=>(a.data?.repositories??[]).filter(e=>e.fullName.toLowerCase().includes(o.toLowerCase())).slice(0,60),[a.data,o]),g=async(e,r)=>{p(r);try{let r=await I(`/repositories`,{method:`POST`,json:{integrationId:n,installWebhook:u,...e}});m(r.webhook&&!r.webhook.ok?`bad`:`ok`,r.webhook?.message??`Repository added`),t()}catch(e){m(`bad`,e.message)}finally{p(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Connection`,children:(0,k.jsx)(sr,{value:n,onChange:e=>r(Number(e.target.value)),children:e.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.name},e.id))})}),(0,k.jsx)(`div`,{className:`flex items-end pb-1.5`,children:(0,k.jsxs)(`label`,{className:`flex items-center gap-2.5 text-[13px] text-ink-2`,children:[(0,k.jsx)(cr,{checked:u,onChange:d,label:`Install webhook`}),`Install the webhook automatically`]})})]}),(0,k.jsx)(N,{label:`Repository URL`,hint:`Works for every platform, including repositories the token cannot list.`,children:(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),placeholder:`https://${i?.host??`github.com`}/owner/repo`,className:`font-mono`}),(0,k.jsx)(j,{variant:`primary`,disabled:!c.trim(),loading:f===`url`,onClick:()=>void g({url:c.trim()},`url`),children:`Add`})]})}),(0,k.jsx)(`div`,{className:`eyebrow pt-2`,children:`or pick from your repositories`}),(0,k.jsx)(M,{placeholder:`Search`,value:o,onChange:e=>s(e.target.value)}),(0,k.jsx)(`div`,{className:`max-h-80 overflow-y-auto rounded-xl border border-line scrollbar-thin`,children:a.loading?(0,k.jsx)(`div`,{className:`flex justify-center p-6 text-ink-3`,children:(0,k.jsx)(ir,{})}):a.error?(0,k.jsx)(`p`,{className:`p-4 text-[13px] text-ink-3`,children:a.error}):h.length===0?(0,k.jsx)(`p`,{className:`p-4 text-[13px] text-ink-3`,children:`No repositories found.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-line`,children:h.map(e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between gap-3 px-4 py-2.5`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[e.fullName,` `,e.private&&(0,k.jsx)(F,{children:`private`})]}),(0,k.jsx)(j,{size:`sm`,loading:f===e.fullName,onClick:()=>void g({owner:e.owner,name:e.name},e.fullName),children:`Add`})]},e.fullName))})})]})}function _c(){let e=Nr(`/integrations`),t=Cr();(0,v.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`installed`);e!==null&&(t(`ok`,`GitHub App installed; ${e} repositor${e===`1`?`y`:`ies`} added`),window.history.replaceState(null,``,window.location.pathname))},[t]);let n=Nr(`/repositories`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),d=Cr(),f=zr(`admin`),p=zr(`maintainer`),m=e.data?.integrations??[],h=async e=>{let t=!!uc[e.platform];c(`hook-${e.id}`);try{let n=await I(`/repositories/${e.id}/webhook`,{method:`POST`});!n.ok&&t?u({repo:e,reason:n.message}):d(n.ok?`ok`:`bad`,n.message)}catch(n){t?u({repo:e,reason:n.message}):d(`bad`,n.message)}finally{c(void 0)}},g=async(e,t)=>{c(e);try{await t()}catch(e){d(`bad`,e.message)}finally{c(void 0)}};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Code hosts`,title:`Repositories`,description:`Connect GitHub, GitLab, Bitbucket or Azure DevOps and choose which repositories Argus watches, or add repositories reviewed in their own CI. Each repository can override any setting.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Connections`,title:`Code hosts`,padded:!1,children:[(0,k.jsx)(`div`,{className:`grid gap-3 p-5 md:grid-cols-3`,children:[`github`,`gitlab`,`bitbucket`,`azure`,`bitbucket-server`].map(e=>(0,k.jsxs)(`button`,{onClick:()=>i(e),disabled:!f,title:f?void 0:`Only admins can connect code hosts`,className:`group flex items-center gap-3 rounded-xl border border-dashed border-line-strong px-4 py-3.5 text-left transition-colors hover:border-iris hover:bg-iris-soft/40 disabled:pointer-events-none disabled:opacity-60`,children:[(0,k.jsx)(`span`,{className:`text-ink-2 group-hover:text-ink`,children:(0,k.jsx)(Tr,{platform:e,size:22})}),(0,k.jsxs)(`span`,{children:[(0,k.jsxs)(`span`,{className:`block font-medium`,children:[`Connect `,lc[e].name]}),(0,k.jsxs)(`span`,{className:`text-[12px] text-ink-3`,children:[m.filter(t=>t.platform===e).length,` connected`]})]})]},e))}),m.length>0&&(0,k.jsx)(`ul`,{className:`divide-y divide-line border-t border-line`,children:m.map(t=>(0,k.jsxs)(`li`,{className:`flex flex-wrap items-center gap-4 px-5 py-3.5`,children:[(0,k.jsx)(Tr,{platform:t.platform,size:18}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:t.name}),(0,k.jsxs)(`div`,{className:`font-mono text-[12px] text-ink-3`,children:[t.host,t.username?` · ${t.username}`:``,` · added `,wr(t.createdAt)]})]}),f&&(0,k.jsxs)(k.Fragment,{children:[t.auth===`app`&&t.appSlug&&(0,k.jsx)(`a`,{href:`/api/github-app/install?integration=${t.id}`,className:`text-[13px] text-ink-2 underline-offset-2 hover:underline`,children:`Install on another account`}),(0,k.jsx)(j,{size:`sm`,variant:`ghost`,loading:s===`test-${t.id}`,onClick:()=>void g(`test-${t.id}`,async()=>{let e=await I(`/integrations/${t.id}/test`,{method:`POST`});d(e.ok?`ok`:`bad`,e.message)}),children:`Test`}),(0,k.jsx)(j,{size:`sm`,variant:`ghost`,onClick:()=>void g(`del-${t.id}`,async()=>{window.confirm(`Remove ${t.name} and its ${n.data?.repositories.filter(e=>e.integrationId===t.id).length??0} repositories from Argus?`)&&(await I(`/integrations/${t.id}`,{method:`DELETE`}),await Promise.all([e.reload(),n.reload()]))}),children:`Remove`})]})]},t.id))})]}),(0,k.jsx)(P,{eyebrow:`${n.data?.repositories.filter(e=>e.enabled).length??0} active`,title:`Watched repositories`,actions:f&&(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:e.loading&&!e.data,onClick:()=>o(!0),children:`Add repository`}),padded:!1,children:n.loading&&!n.data?(0,k.jsx)(`div`,{className:`flex justify-center p-10 text-ink-3`,children:(0,k.jsx)(ir,{})}):(n.data?.repositories.length??0)===0?(0,k.jsx)(vr,{title:`No repositories yet`,children:m.length?`Add a repository to start reviewing its pull requests.`:`Connect a code host, or add a repository reviewed in its own CI.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-line`,children:n.data.repositories.map(e=>{let t=Object.keys(e.config??{}).length;return(0,k.jsxs)(`li`,{className:A(`flex flex-wrap items-center gap-4 px-5 py-3.5`,!e.enabled&&`opacity-60`),children:[(0,k.jsx)(cr,{checked:e.enabled,disabled:!p,label:`Enable ${e.owner}/${e.name}`,onChange:t=>void g(`toggle-${e.id}`,async()=>{await I(`/repositories/${e.id}`,{method:`PUT`,json:{enabled:t}}),await n.reload()})}),(0,k.jsx)(Tr,{platform:e.platform}),(0,k.jsxs)(Vn,{to:`/repositories/${e.id}`,className:`min-w-0 flex-1 hover:text-iris`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[13.5px]`,children:[e.owner,`/`,(0,k.jsx)(`span`,{className:`font-semibold`,children:e.name})]}),e.integrationId===null?(0,k.jsx)(F,{className:`ml-2`,children:`CI`}):(0,k.jsx)(`span`,{className:`ml-2 text-[12px] text-ink-3`,children:e.integrationName})]}),t>0&&(0,k.jsxs)(F,{tone:`iris`,children:[t,` override`,t>1?`s`:``]}),p&&e.integrationId!==null&&(0,k.jsx)(j,{size:`sm`,variant:`ghost`,loading:s===`hook-${e.id}`,onClick:()=>void h(e),children:`Install webhook`}),(0,k.jsx)(Vn,{to:`/repositories/${e.id}`,children:(0,k.jsx)(j,{size:`sm`,children:`Configure`})})]},e.id)})})})]}),r&&(0,k.jsx)(pc,{platform:r,onClose:()=>i(void 0),onDone:()=>{i(void 0),e.reload()}}),l&&(0,k.jsx)(dc,{repo:l.repo,integration:m.find(e=>e.id===l.repo.integrationId),reason:l.reason,onClose:()=>u(void 0)}),a&&(0,k.jsx)(hc,{integrations:m,onClose:()=>o(!1),onDone:()=>{o(!1),n.reload()}})]})}function vc(){let[e,t]=(0,v.useState)(``),n=zr(`maintainer`),r=Nr(`/reviews?limit=100${e?`&status=${e}`:``}`,[e]);return Pr(t=>{r.setData(n=>{if(!n)return n;let r=!e||t.status===e;return n.reviews.some(e=>e.id===t.id)?r?{reviews:n.reviews.map(e=>e.id===t.id?{...e,...t}:e)}:{reviews:n.reviews.filter(e=>e.id!==t.id)}:r?{reviews:[t,...n.reviews]}:n})},()=>void r.reload()),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Overview`,title:`Reviews`,description:`Every review Argus has run, live.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[n&&(0,k.jsx)(P,{eyebrow:`Manual`,title:`Review a pull request`,children:(0,k.jsx)(Qr,{})}),(0,k.jsx)(P,{title:`History`,actions:(0,k.jsx)(gr,{value:e,onChange:t,options:[{value:``,label:`All`},{value:`running`,label:`Running`},{value:`done`,label:`Done`},{value:`failed`,label:`Failed`},{value:`skipped`,label:`Skipped`}]}),padded:!1,children:(0,k.jsx)(ei,{reviews:r.data?.reviews,loading:r.loading,onChange:()=>void r.reload()})})]})]})}function yc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Review brain`,title:`Rules`,description:`Your team's conventions as enforceable checks. Each rule can target paths and carries its own severity. Repositories can add or override rules.`}),(0,k.jsx)(os,{})]})}function bc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Triggers & chat`,description:`When Argus reviews on its own, and how it talks with your team in pull requests.`}),(0,k.jsx)(Qs,{})]})}function xc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Depth & analysis`,description:`Codebase exploration, multi-pass voting and static analysis: the stages that make findings precise. Repositories can override any of this.`}),(0,k.jsx)(ic,{})]})}function Sc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Files & context`,description:`Which files get reviewed and how much surrounding code the reviewer reads.`}),(0,k.jsx)($s,{})]})}var Cc={openrouter:`OpenRouter`,anthropic:`Anthropic API`,openai:`OpenAI API`,"openai-compatible":`OpenAI-compatible`,"claude-code":`Claude subscription (Claude Code)`,codex:`ChatGPT subscription (Codex)`,copilot:`GitHub Copilot`},wc={openrouter:`One key for hundreds of models. Model ids look like anthropic/claude-sonnet-5.5.`,anthropic:`Direct Anthropic API with prompt caching. Model ids look like claude-sonnet-5-5.`,openai:`Direct OpenAI API.`,"openai-compatible":`Any endpoint that speaks the OpenAI chat API: Ollama, vLLM, LM Studio, Azure, a company gateway.`,"claude-code":`Uses the Claude Code CLI logged in with your Claude Pro or Max plan. No API key needed.`,codex:`Uses the Codex CLI logged in with your ChatGPT plan. No API key needed.`,copilot:`Uses your Copilot subscription through the Copilot CLI`},Tc=[{key:`review`,title:`Review`,text:`Finds defects. Use your strongest model here.`,inherit:``},{key:`light`,title:`Triage & trivial files`,text:`Classifies small changes and reviews the ones with no behavioural impact (copy, formatting, version bumps). A fast, cheap model such as Haiku.`,inherit:`Off (same as review)`},{key:`verify`,title:`Verification`,text:`Re-checks every finding. A strong model keeps precision high.`,inherit:`Same as review`},{key:`summary`,title:`Summary`,text:`Writes the walkthrough. A faster model is fine.`,inherit:`Same as review`},{key:`chat`,title:`Chat`,text:`Answers questions and learns from feedback in PR threads.`,inherit:`Same as review`}];function Ec({provider:e,state:t,onChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=Cr(),c=async t=>{o(!0);try{await I(`/providers/${e}/key`,{method:`PUT`,json:{key:t}}),i(``),s(`ok`,t?`${Cc[e]} key saved`:`${Cc[e]} key removed`),n()}catch(e){s(`bad`,e.message)}finally{o(!1)}};return(0,k.jsxs)(`div`,{className:`grid items-center gap-3 py-3.5 md:grid-cols-[220px_1fr_auto]`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`text-[13.5px] font-medium`,children:Cc[e]}),(0,k.jsx)(`div`,{className:`mt-0.5 flex gap-1.5`,children:t?.hasKey?(0,k.jsxs)(F,{tone:`ok`,children:[`Key `,t.hint]}):t?.fromEnv?(0,k.jsx)(F,{tone:`iris`,children:`From environment`}):(0,k.jsx)(F,{children:`Not set`})})]}),(0,k.jsx)(M,{type:`password`,autoComplete:`off`,placeholder:t?.hasKey?`Paste a new key to replace it`:`Paste API key`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&void c(r.trim())}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!r.trim(),loading:a,onClick:()=>void c(r.trim()),children:`Save`}),t?.hasKey&&(0,k.jsx)(j,{size:`sm`,variant:`ghost`,onClick:()=>void c(null),children:`Remove`})]})]})}function Dc(e,t){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(!1),c=zr(`admin`);return(0,v.useEffect)(()=>{if(!c)return;let n=!1;s(!0),a(void 0);let i=new URLSearchParams({provider:e});return t&&i.set(`baseUrl`,t),I(`/models?${i}`).then(e=>!n&&r(e.models)).catch(e=>!n&&(r([]),a(e.message))).finally(()=>!n&&s(!1)),()=>{n=!0}},[e,t,c]),{models:n,error:i,loading:o}}function Oc(e){return e===void 0?``:e===0?`free`:`$${e<1?e.toFixed(2):e.toFixed(+(e<10))}`}function kc({provider:e,value:t,onChange:n,baseUrl:r}){let{models:i,error:a,loading:o}=Dc(e,r),s=(0,v.useId)(),c=i.find(e=>e.id===t);return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(M,{list:s,value:t,onChange:e=>n(e.target.value),className:`font-mono`,placeholder:`model id`}),o&&(0,k.jsx)(`span`,{className:`absolute top-2.5 right-3 text-ink-3`,children:(0,k.jsx)(ir,{size:14})})]}),(0,k.jsx)(`datalist`,{id:s,children:i.slice(0,600).map(e=>(0,k.jsx)(`option`,{value:e.id,children:[e.name,e.inputPrice===void 0?``:`${Oc(e.inputPrice)} / ${Oc(e.outputPrice)} per M`,e.description].filter(Boolean).join(` · `)},e.id))}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12px] text-ink-3`,children:a?`Could not load models: ${a}`:c?[c.name,c.contextLength?`${Math.round(c.contextLength/1e3)}k context`:``,c.inputPrice===void 0?``:`${Oc(c.inputPrice)} in / ${Oc(c.outputPrice)} out per million tokens`,c.description].filter(Boolean).join(` · `):i.length?`${i.length} models available — start typing to search`:``})]})}function Ac({stage:e}){let t=Yr(),n=Cr(),r=`models.${e.key}`,i=t.get(r),a=t.get(`models.review`),o=e.key!==`review`&&!i,s=i??a,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(``),m=zr(`admin`),h=t.isLocked(r),g=!!(u&&!u.ok&&u.keyRequired),_=e=>{let n={...s,...e};n.provider!==`openai-compatible`&&delete n.baseUrl,t.set(r,n),d(void 0)},y=async()=>{l(!0),d(void 0);try{let e={provider:s.provider,model:s.model};s.baseUrl&&(e.baseUrl=s.baseUrl),s.effort&&(e.effort=s.effort),f.trim()&&(e.apiKey=f.trim()),d(await I(`/models/test`,{method:`POST`,json:e}))}catch(e){n(`bad`,e.message)}finally{l(!1)}};return(0,k.jsxs)(`div`,{className:A(`rounded-xl border p-4`,o?`border-dashed border-line-strong`:`border-line-strong`),children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`font-display text-[17px] font-medium`,children:[e.title,(0,k.jsx)(si,{path:r}),(0,k.jsx)(ci,{path:r})]}),(0,k.jsx)(`div`,{className:`text-[12.5px] text-ink-3`,children:e.text})]}),e.key!==`review`&&!h&&(0,k.jsx)(lr,{label:(0,k.jsx)(`span`,{className:`text-[12.5px] font-normal text-ink-2`,children:e.inherit}),checked:o,onChange:e=>t.set(r,e?void 0:structuredClone(a))})]}),o?(0,k.jsxs)(`p`,{className:`mt-1 font-mono text-[12.5px] text-ink-2`,children:[Cc[a.provider],` · `,a.model]}):(0,k.jsxs)(`div`,{className:A(`mt-3 space-y-4`,h&&`pointer-events-none opacity-60`),"aria-disabled":h||void 0,children:[(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_1fr]`,children:[(0,k.jsx)(N,{label:`Provider`,children:(0,k.jsx)(sr,{value:s.provider,onChange:e=>_({provider:e.target.value,model:``}),children:t.meta.providers.map(e=>(0,k.jsx)(`option`,{value:e,children:Cc[e]},e))})}),(0,k.jsx)(N,{label:`Model`,children:(0,k.jsx)(kc,{provider:s.provider,value:s.model,onChange:e=>_({model:e}),...s.baseUrl?{baseUrl:s.baseUrl}:{}})})]}),(0,k.jsx)(`p`,{className:`-mt-1 text-[12.5px] text-ink-3`,children:wc[s.provider]}),s.provider===`openrouter`&&(0,k.jsx)(N,{label:`Preferred upstream providers`,hint:`OpenRouter routes in this order (e.g. anthropic, google-vertex). Pinning one provider keeps prompt caching warm. Anthropic models default to anthropic.`,children:(0,k.jsx)(hr,{value:s.providerOrder??[],onChange:e=>_({providerOrder:e.length?e:void 0}),placeholder:`anthropic`})}),s.provider===`openai-compatible`&&(0,k.jsx)(N,{label:`Base URL`,hint:`For example http://localhost:11434/v1 for Ollama.`,children:(0,k.jsx)(M,{value:s.baseUrl??``,onChange:e=>_({baseUrl:e.target.value||void 0}),className:`font-mono`,placeholder:`https://…/v1`})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,k.jsx)(N,{label:`Reasoning effort`,hint:`Higher thinks longer. Leave empty for the model default.`,children:(0,k.jsxs)(sr,{value:s.effort??``,onChange:e=>_({effort:e.target.value||void 0}),children:[(0,k.jsx)(`option`,{value:``,children:`Model default`}),t.meta.efforts.map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))]})}),(0,k.jsx)(N,{label:`Max output tokens`,children:(0,k.jsx)(M,{type:`number`,min:1e3,max:128e3,step:1e3,value:s.maxOutputTokens,onChange:e=>_({maxOutputTokens:Number(e.target.value)||16e3})})}),(0,k.jsx)(N,{label:`Timeout (seconds)`,children:(0,k.jsx)(M,{type:`number`,min:30,step:30,value:Math.round(s.timeoutMs/1e3),onChange:e=>_({timeoutMs:(Number(e.target.value)||600)*1e3})})})]}),m&&!h&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(j,{size:`sm`,onClick:()=>void y(),loading:c,disabled:!s.model,children:`Test connection`}),u&&(0,k.jsxs)(`span`,{className:A(`text-[13px]`,u.ok?`text-ok`:`text-critical`),children:[u.ok?`✓`:`✕`,` `,u.message,` `,(0,k.jsxs)(`span`,{className:`text-ink-3`,children:[`(`,(u.latencyMs/1e3).toFixed(1),`s)`]})]}),(g||f)&&(0,k.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:f,onChange:e=>p(e.target.value),placeholder:`API key for this base URL (used for this test only)`,className:`max-w-sm`}),(0,k.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:`Or save the settings first so the stored key may be used.`})]})]})]})]})}function jc({title:e,status:t,login:n}){return(0,k.jsxs)(`div`,{className:`rounded-xl border border-line-strong p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:e}),t?t.installed?t.loggedIn===void 0?(0,k.jsx)(F,{tone:`neutral`,children:`Login unknown`}):t.loggedIn?(0,k.jsx)(F,{tone:`ok`,children:`Logged in`}):(0,k.jsx)(F,{tone:`warn`,children:`Not logged in`}):(0,k.jsx)(F,{tone:`bad`,children:`Not installed`}):(0,k.jsx)(ir,{size:14})]}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12.5px] text-ink-3`,children:t?.detail}),t?.version&&(0,k.jsx)(`p`,{className:`mt-1 font-mono text-[11.5px] text-ink-3`,children:t.version}),t&&t.loggedIn!==!0&&(0,k.jsx)(`p`,{className:`mt-2 font-mono text-[12px] text-ink-2`,children:n})]})}function Mc(){let e=Yr(),t=Nr(`/providers`);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Models & providers`,description:`Connect an API, or use your Claude, ChatGPT or GitHub Copilot subscription through their official command-line tools. Pick a model for each stage of the review.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Pipeline`,title:`Models per stage`,children:[e.isLocked(`models`)&&(0,k.jsxs)(`p`,{className:`mb-3 rounded-lg border border-line px-3 py-2 text-[12.5px] text-ink-3`,children:[`The models decide what runs on this server. `,e.lockNote,`.`]}),(0,k.jsx)(`div`,{className:`space-y-3`,children:Tc.map(e=>(0,k.jsx)(Ac,{stage:e},e.key))})]}),(0,k.jsx)(P,{eyebrow:`Credentials`,title:`API keys`,actions:(0,k.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:`Encrypted at rest. Never shown again.`}),children:(0,k.jsx)(`div`,{className:`divide-y divide-line`,children:[`openrouter`,`anthropic`,`openai`,`openai-compatible`].map(e=>(0,k.jsx)(Ec,{provider:e,state:t.data?.keys[e],onChange:()=>void t.reload()},e))})}),(0,k.jsxs)(P,{eyebrow:`Subscriptions`,title:`Claude, ChatGPT and Copilot plans`,children:[(0,k.jsx)(`p`,{className:`mb-4 text-[13.5px] text-ink-2`,children:`Argus runs the official CLIs on this machine, so reviews use your plan's limits instead of API billing. Log in once in a terminal; the server picks it up.`}),(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(jc,{title:`Claude Code`,status:t.data?.cli[`claude-code`],login:`claude # then /login with your Claude account`}),(0,k.jsx)(jc,{title:`Codex`,status:t.data?.cli.codex,login:`codex login`}),(0,k.jsx)(jc,{title:`GitHub Copilot`,status:t.data?.cli.copilot,login:`copilot login`})]})]})]})]})}function Nc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Review behaviour`,description:`How strict Argus is, what it looks for, and how it reports. Repositories can override any of this.`}),(0,k.jsx)(Xs,{})]})}function Pc(){let e=Nr(`/trackers`),t=Cr(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)();(0,v.useEffect)(()=>{e.data?.jira&&(r(e.data.jira.baseUrl),a(e.data.jira.email))},[e.data]);let f=async(n,r,i)=>{d(r);try{await I(`/trackers`,{method:`PUT`,json:n}),t(`ok`,i),s(``),l(``),await e.reload()}catch(e){t(`bad`,e.message)}finally{d(void 0)}},p=e.data?.jira,m=e.data?.linear;return(0,k.jsxs)(P,{eyebrow:`Issue trackers`,title:`Jira and Linear`,children:[(0,k.jsxs)(`p`,{className:`mb-4 text-[13.5px] text-ink-2`,children:[`GitHub, GitLab and Bitbucket issues are read with the code-host token. Add Jira or Linear so keys like `,(0,k.jsx)(`span`,{className:`font-mono`,children:`PROJ-42`}),` in a pull request pull in the issue text and acceptance criteria. Tokens are encrypted at rest. CLI and CI runs read `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_BASE_URL`}),`,`,` `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_EMAIL`}),`, `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_API_TOKEN`}),` and `,(0,k.jsx)(`span`,{className:`font-mono`,children:`LINEAR_API_KEY`}),`.`]}),(0,k.jsxs)(`div`,{className:`space-y-5`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`font-display text-[16px]`,children:`Jira Cloud`}),p?(0,k.jsx)(F,{tone:`ok`,children:`Connected`}):(0,k.jsx)(F,{children:`Not set`})]}),(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,k.jsx)(N,{label:`Site URL`,children:(0,k.jsx)(M,{value:n,onChange:e=>r(e.target.value),placeholder:`https://acme.atlassian.net`,className:`font-mono`})}),(0,k.jsx)(N,{label:`Account email`,children:(0,k.jsx)(M,{value:i,onChange:e=>a(e.target.value),placeholder:`you@acme.com`})}),(0,k.jsx)(N,{label:`API token`,children:(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),placeholder:p?.tokenSet?`•••••• saved`:`id.atlassian.com → API tokens`})})]}),(0,k.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!n||!i||!o&&!p?.tokenSet,loading:u===`jira`,onClick:()=>void f({jira:{baseUrl:n,email:i,...o?{token:o}:{}}},`jira`,`Jira saved`),children:`Save Jira`}),p&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:u===`jira-rm`,onClick:()=>void f({jira:null},`jira-rm`,`Jira removed`),children:`Remove`})]})]}),(0,k.jsxs)(`div`,{className:`border-t border-line pt-5`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`font-display text-[16px]`,children:`Linear`}),m?(0,k.jsx)(F,{tone:`ok`,children:`Connected`}):(0,k.jsx)(F,{children:`Not set`})]}),(0,k.jsxs)(`div`,{className:`flex max-w-xl gap-2`,children:[(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:c,onChange:e=>l(e.target.value),placeholder:m?`•••••• saved`:`Personal API key (lin_api_…)`}),(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!c,loading:u===`linear`,onClick:()=>void f({linear:{apiKey:c}},`linear`,`Linear saved`),children:`Save`}),m&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:u===`linear-rm`,onClick:()=>void f({linear:null},`linear-rm`,`Linear removed`),children:`Remove`})]})]})]})]})}function Fc(){let e=Nr(`/server`),t=Nr(`/integrations`),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(),o=Cr(),s=Nr(`/status`).data?.version??`0.2.1`;(0,v.useEffect)(()=>{e.data&&r(e.data.publicUrl)},[e.data]);let c=async(n,r)=>{a(r);try{let r=await I(`/server`,{method:`PUT`,json:n});e.setData(r),t.reload(),o(`ok`,`Saved`)}catch(e){o(`bad`,e.message)}finally{a(void 0)}};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Server & CI`,description:`Make Argus reachable for webhooks, or run reviews inside your CI instead.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Webhooks`,title:`Public URL`,children:[(0,k.jsx)(N,{label:`Address where GitHub, GitLab, Bitbucket and Azure DevOps can reach this server`,hint:`For example https://argus.example.com, or a tunnel such as an ngrok static domain. Webhooks go to <url>/webhooks/<platform>.`,children:(0,k.jsxs)(`div`,{className:`flex max-w-xl gap-2`,children:[(0,k.jsx)(M,{value:n,onChange:e=>r(e.target.value),placeholder:`https://argus.example.com`,className:`font-mono`}),(0,k.jsx)(j,{variant:`primary`,loading:i===`url`,onClick:()=>void c({publicUrl:n},`url`),disabled:n===e.data?.publicUrl,children:`Save`})]})}),t.data&&t.data.integrations.length>0&&(0,k.jsx)(`div`,{className:`mt-5 space-y-2`,children:t.data.integrations.map(e=>(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-line px-3 py-2`,children:[(0,k.jsx)(`span`,{className:`text-[13px]`,children:e.name}),e.webhookUrl?(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.webhookUrl}),(0,k.jsx)(br,{text:e.webhookUrl})]}):(0,k.jsx)(F,{tone:`warn`,children:`Set the public URL first`})]},e.id))})]}),(0,k.jsx)(Pc,{}),(0,k.jsxs)(P,{eyebrow:`Without a server`,title:`Run Argus in CI or before commits`,children:[(0,k.jsx)(Us,{version:s,withHook:!0}),(0,k.jsxs)(`p`,{className:`mt-3 text-[12.5px] text-ink-3`,children:[`CI runs read settings from a `,(0,k.jsx)(`code`,{className:`font-mono`,children:`.argus.yml`}),` file in the repository; export it from any repository page here. The files install Argus with`,` `,(0,k.jsx)(`code`,{className:`font-mono`,children:`npx argus-review`}),`, which needs the package published to npm or your private registry (see the README); until then, switch on `,(0,k.jsx)(`em`,{children:`Build Argus from source`}),`.`]})]})]})]})}function Ic(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Summary`,description:`The walkthrough comment Argus keeps up to date on every pull request.`}),(0,k.jsx)(Zs,{})]})}var Lc={viewer:`Sees reviews, findings, repositories and settings`,maintainer:`Also starts, cancels and retries reviews, edits learnings and per-repository settings`,admin:`Also manages integrations, models, keys, global settings and users`};function Rc({me:e,onChanged:t}){let n=Nr(`/users`),r=Cr(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(`maintainer`),[f,p]=(0,v.useState)(),m=n.data?.users??[],h=n.data!==void 0&&m.length===0,g=async(e,i,a)=>{p(e);try{await i(),r(`ok`,a),await n.reload(),t()}catch(e){r(`bad`,e.message)}finally{p(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Team & access`,description:`Give each person their own sign-in and a role. Once the first admin exists, Argus asks everyone for an email and password; the shared server password stops working.`}),(0,k.jsxs)(P,{eyebrow:h?`Step 1`:`Invite`,title:h?`Create the first admin`:`Add a person`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Email`,children:(0,k.jsx)(M,{type:`email`,value:i,onChange:e=>a(e.target.value),placeholder:`dev@acme.com`})}),(0,k.jsx)(N,{label:`Name`,hint:`Optional`,children:(0,k.jsx)(M,{value:o,onChange:e=>s(e.target.value)})}),(0,k.jsx)(N,{label:`Password`,hint:`At least 8 characters; they can be changed later by an admin`,children:(0,k.jsx)(M,{type:`password`,autoComplete:`new-password`,value:c,onChange:e=>l(e.target.value)})}),(0,k.jsx)(N,{label:`Role`,hint:Lc[h?`admin`:u],children:(0,k.jsx)(gr,{value:h?`admin`:u,onChange:e=>!h&&d(e),options:[{value:`viewer`,label:`Viewer`},{value:`maintainer`,label:`Maintainer`},{value:`admin`,label:`Admin`}]})})]}),(0,k.jsx)(`div`,{className:`mt-4`,children:(0,k.jsx)(j,{variant:`primary`,disabled:!i.includes(`@`)||c.length<8,loading:f===`add`,onClick:()=>void g(`add`,async()=>{await I(`/users`,{method:`POST`,json:{email:i,name:o||null,role:h?`admin`:u,password:c}}),a(``),s(``),l(``)},h?`Admin created; you are signed in as them`:`${i} can now sign in`),children:h?`Create admin and require sign-in`:`Add person`})})]}),(0,k.jsx)(P,{eyebrow:`People`,title:`${m.length} ${m.length===1?`person`:`people`}`,padded:!1,children:m.length===0?(0,k.jsx)(`div`,{className:`p-6`,children:(0,k.jsx)(vr,{title:`No users yet`,children:`Anyone who can reach this server can change everything until the first admin is created.`})}):(0,k.jsxs)(`table`,{className:`w-full text-[13.5px]`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`eyebrow border-b border-line text-left`,children:[(0,k.jsx)(`th`,{className:`px-5 py-2.5 font-normal`,children:`Person`}),(0,k.jsx)(`th`,{className:`px-3 py-2.5 font-normal`,children:`Role`}),(0,k.jsx)(`th`,{className:`px-3 py-2.5 font-normal`,children:`Last sign-in`}),(0,k.jsx)(`th`,{className:`px-5 py-2.5`})]})}),(0,k.jsx)(`tbody`,{children:m.map(t=>(0,k.jsxs)(`tr`,{className:`border-b border-line/60 last:border-0`,children:[(0,k.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:t.name||t.email}),t.name&&(0,k.jsx)(`div`,{className:`text-[12px] text-ink-3`,children:t.email}),e?.id===t.id&&(0,k.jsx)(F,{tone:`iris`,className:`mt-1`,children:`You`})]}),(0,k.jsx)(`td`,{className:`px-3 py-3`,children:(0,k.jsxs)(sr,{value:t.role,disabled:f===`role-${t.id}`,onChange:e=>void g(`role-${t.id}`,()=>I(`/users/${t.id}`,{method:`PUT`,json:{role:e.target.value}}),`Role changed`),children:[(0,k.jsx)(`option`,{value:`viewer`,children:`Viewer`}),(0,k.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,k.jsx)(`option`,{value:`admin`,children:`Admin`})]})}),(0,k.jsx)(`td`,{className:`px-3 py-3 text-ink-3`,children:t.lastLoginAt?wr(t.lastLoginAt.replace(` `,`T`)+`Z`):`never`}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right`,children:e?.id!==t.id&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:f===`rm-${t.id}`,onClick:()=>void g(`rm-${t.id}`,()=>I(`/users/${t.id}`,{method:`DELETE`}),`${t.email} removed`),children:`Remove`})})]},t.id))})]})}),(0,k.jsx)(P,{eyebrow:`Automation`,title:`Create the admin from the environment`,children:(0,k.jsxs)(`p`,{className:`text-[13.5px] text-ink-2`,children:[`For Docker and Kubernetes, set `,(0,k.jsx)(`span`,{className:`font-mono`,children:`ARGUS_ADMIN_EMAIL`}),` and `,(0,k.jsx)(`span`,{className:`font-mono`,children:`ARGUS_ADMIN_PASSWORD`}),`; Argus creates that admin at start-up if it does not exist yet.`]})})]})}var zc=(0,v.lazy)(()=>ne(()=>import(`./ReviewDetail-BH5o1kPf.js`).then(e=>({default:e.ReviewDetail})),[])),Bc=[`/rules`,`/guidelines`,`/settings/models`,`/settings/review`,`/settings/depth`,`/settings/summary`,`/settings/automation`,`/settings/files`];function Vc(){let{meta:e,stored:t,error:n,save:r}=Zr();return n?(0,k.jsxs)(`div`,{className:`rounded-xl border border-critical/40 p-6 text-critical`,children:[`Could not load settings: `,n]}):!e||!t?(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading settings…`]}):(0,k.jsx)(Xr,{base:e.defaults,meta:e,stored:t,onSave:r,scope:`global`,stayOn:Bc,children:(0,k.jsx)($t,{})})}function Hc({onDone:e}){return(0,k.jsx)(`div`,{className:`rings flex min-h-screen items-center justify-center p-6`,children:(0,k.jsxs)(`div`,{className:`w-full max-w-sm animate-rise rounded-2xl border border-line bg-panel p-8 shadow-xl`,children:[(0,k.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,k.jsx)(rr,{size:36}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-2xl font-semibold`,children:`Argus`}),(0,k.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:`Sign in to manage reviews`})]})]}),(0,k.jsx)(Uc,{onDone:e})]})})}function Uc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1);return(0,k.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),c(!0),o(void 0);try{await I(`/auth/login`,{method:`POST`,json:{email:t,password:r}}),e()}catch(e){o(e.message)}finally{c(!1)}},children:[(0,k.jsx)(`label`,{htmlFor:`email`,className:`mb-1.5 block text-[13px] font-medium`,children:`Email`}),(0,k.jsx)(M,{id:`email`,type:`email`,autoComplete:`username`,autoFocus:!0,value:t,onChange:e=>n(e.target.value),className:`mb-4`}),(0,k.jsx)(`label`,{htmlFor:`password`,className:`mb-1.5 block text-[13px] font-medium`,children:`Password`}),(0,k.jsx)(M,{id:`password`,type:`password`,autoComplete:`current-password`,value:r,onChange:e=>i(e.target.value)}),a&&(0,k.jsx)(`p`,{className:`mt-2 text-[13px] text-critical`,children:a}),(0,k.jsx)(j,{variant:`primary`,className:`mt-5 w-full`,loading:s,type:`submit`,children:`Sign in`})]})}function Wc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(!1);return(0,k.jsx)(`div`,{className:`rings flex min-h-screen items-center justify-center p-6`,children:(0,k.jsxs)(`form`,{className:`w-full max-w-sm animate-rise rounded-2xl border border-line bg-panel p-8 shadow-xl`,onSubmit:async n=>{n.preventDefault(),f(!0),u(void 0);try{await I(`/users`,{method:`POST`,headers:{"X-Argus-Setup-Token":t.trim()},json:{email:r.trim(),name:a.trim()||null,role:`admin`,password:s}}),e()}catch(e){u(e instanceof Ar&&e.status===401?`The setup token is wrong or was already used. Check the server log.`:e.message)}finally{f(!1)}},children:[(0,k.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,k.jsx)(rr,{size:36}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-2xl font-semibold`,children:`Set up Argus`}),(0,k.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:`Create the first admin`})]})]}),(0,k.jsxs)(`p`,{className:`mb-4 text-[13px] text-ink-2`,children:[`Argus has no users yet. Paste the one-time setup token printed in the server log, or restart Argus with`,` `,(0,k.jsx)(`code`,{className:`font-mono text-[12px]`,children:`ARGUS_ADMIN_EMAIL`}),` and `,(0,k.jsx)(`code`,{className:`font-mono text-[12px]`,children:`ARGUS_ADMIN_PASSWORD`}),`.`]}),(0,k.jsx)(`label`,{htmlFor:`setup-token`,className:`mb-1.5 block text-[13px] font-medium`,children:`Setup token`}),(0,k.jsx)(M,{id:`setup-token`,autoComplete:`off`,autoFocus:!0,value:t,onChange:e=>n(e.target.value),className:`mb-4 font-mono`}),(0,k.jsx)(`label`,{htmlFor:`setup-email`,className:`mb-1.5 block text-[13px] font-medium`,children:`Email`}),(0,k.jsx)(M,{id:`setup-email`,type:`email`,autoComplete:`username`,value:r,onChange:e=>i(e.target.value),className:`mb-4`}),(0,k.jsxs)(`label`,{htmlFor:`setup-name`,className:`mb-1.5 block text-[13px] font-medium`,children:[`Name `,(0,k.jsx)(`span`,{className:`font-normal text-ink-3`,children:`(optional)`})]}),(0,k.jsx)(M,{id:`setup-name`,autoComplete:`name`,value:a,onChange:e=>o(e.target.value),className:`mb-4`}),(0,k.jsx)(`label`,{htmlFor:`setup-password`,className:`mb-1.5 block text-[13px] font-medium`,children:`Password`}),(0,k.jsx)(M,{id:`setup-password`,type:`password`,autoComplete:`new-password`,minLength:8,value:s,onChange:e=>c(e.target.value)}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12px] text-ink-3`,children:`At least 8 characters.`}),l&&(0,k.jsx)(`p`,{className:`mt-2 text-[13px] text-critical`,children:l}),(0,k.jsx)(j,{variant:`primary`,className:`mt-5 w-full`,loading:d,type:`submit`,disabled:!t.trim()||!r.trim()||s.length<8,children:`Create admin`})]})})}function Gc({path:e,children:t}){let n=(0,v.useContext)(Lr);return!n||!er(e,n.role??`admin`)?(0,k.jsx)(Qt,{to:`/`,replace:!0}):t}function Kc(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1),o=(0,v.useCallback)(async()=>{a(!0);try{t(await I(`/auth/me`)),r(void 0)}catch(e){if(e instanceof Ar&&e.status===401){let n=!!e.data?.setupRequired;t(n?{authenticated:!1,passwordRequired:!0,mode:`locked`,setupTokenRequired:!0}:{authenticated:!1,passwordRequired:!0}),r(void 0)}else r(e instanceof Ar?e.message:`The Argus server could not be reached.`)}finally{a(!1)}},[]);if((0,v.useEffect)(()=>{o();let e=()=>{t(e=>e&&{...e,authenticated:!1}),o()};return window.addEventListener(`argus:unauthorized`,e),()=>window.removeEventListener(`argus:unauthorized`,e)},[o]),n&&!e)return(0,k.jsxs)(`div`,{className:`flex min-h-screen flex-col items-center justify-center gap-4 p-6 text-center`,children:[(0,k.jsx)(rr,{size:44}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-medium`,children:`Could not reach Argus`}),(0,k.jsx)(`div`,{className:`mt-1 text-[13px] text-ink-3`,children:n})]}),(0,k.jsx)(j,{variant:`primary`,loading:i,onClick:()=>void o(),children:`Retry`})]});if(!e)return(0,k.jsx)(`div`,{className:`flex min-h-screen items-center justify-center`,children:(0,k.jsx)(rr,{size:44,spin:!0})});let s=async()=>{await I(`/auth/logout`,{method:`POST`}),o()};return(0,k.jsx)(Lr.Provider,{value:e,children:(0,k.jsx)(Sr,{children:!e.authenticated&&(e.mode===`locked`||e.setupTokenRequired)?(0,k.jsx)(Wc,{onDone:()=>void o()}):(0,k.jsx)(Bn,{children:(0,k.jsx)(nn,{children:e.authenticated?(0,k.jsxs)(en,{element:(0,k.jsx)(kr,{auth:e,onLogout:()=>void s()}),children:[(0,k.jsx)(en,{index:!0,element:(0,k.jsx)(oi,{})}),(0,k.jsx)(en,{path:`reviews`,element:(0,k.jsx)(vc,{})}),(0,k.jsx)(en,{path:`reviews/:id`,element:(0,k.jsx)(v.Suspense,{fallback:(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading review…`]}),children:(0,k.jsx)(zc,{})})}),(0,k.jsx)(en,{path:`repositories`,element:(0,k.jsx)(_c,{})}),(0,k.jsx)(en,{path:`repositories/:id`,element:(0,k.jsx)(oc,{})}),(0,k.jsx)(en,{path:`learnings`,element:(0,k.jsx)(xi,{})}),(0,k.jsxs)(en,{element:(0,k.jsx)(Vc,{}),children:[(0,k.jsx)(en,{path:`rules`,element:(0,k.jsx)(yc,{})}),(0,k.jsx)(en,{path:`guidelines`,element:(0,k.jsx)(gi,{})}),(0,k.jsx)(en,{path:`settings/models`,element:(0,k.jsx)(Mc,{})}),(0,k.jsx)(en,{path:`settings/review`,element:(0,k.jsx)(Nc,{})}),(0,k.jsx)(en,{path:`settings/depth`,element:(0,k.jsx)(xc,{})}),(0,k.jsx)(en,{path:`settings/summary`,element:(0,k.jsx)(Ic,{})}),(0,k.jsx)(en,{path:`settings/automation`,element:(0,k.jsx)(bc,{})}),(0,k.jsx)(en,{path:`settings/files`,element:(0,k.jsx)(Sc,{})})]}),(0,k.jsx)(en,{path:`settings/server`,element:(0,k.jsx)(Gc,{path:`/settings/server`,children:(0,k.jsx)(Fc,{})})}),(0,k.jsx)(en,{path:`settings/users`,element:(0,k.jsx)(Gc,{path:`/settings/users`,children:(0,k.jsx)(Rc,{me:e.user??null,onChanged:()=>void o()})})}),(0,k.jsx)(en,{path:`settings`,element:(0,k.jsx)(Qt,{to:`/settings/models`,replace:!0})}),(0,k.jsx)(en,{path:`*`,element:(0,k.jsx)(Qt,{to:`/`,replace:!0})})]}):(0,k.jsx)(en,{path:`*`,element:(0,k.jsx)(Hc,{onDone:()=>void o()})})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(v.StrictMode,{children:(0,k.jsx)(Kc,{})}));export{o as C,d as S,l as T,wr as _,Pr as a,Vn as b,P as c,ur as d,Tr as f,A as g,mr as h,Nr as i,yr as l,ir as m,zr as n,F as o,fr as p,I as r,j as s,$r as t,vr as u,Cr as v,s as w,At as x,nr as y};
169
+ argus local --base main`}}var Is={github:{name:`GitHub`,pipeline:`GitHub Actions`,host:`github.com`,fixedHost:!1,example:`acme/shop`},gitlab:{name:`GitLab`,pipeline:`GitLab CI`,host:`gitlab.com`,fixedHost:!1,example:`group/subgroup/project`},bitbucket:{name:`Bitbucket`,pipeline:`Bitbucket`,host:`bitbucket.org`,fixedHost:!0,example:`workspace/repo`},azure:{name:`Azure DevOps`,pipeline:`Azure Pipelines`,host:`dev.azure.com`,fixedHost:!0,example:`organization/project/_git/repo`}},Ls=e=>e in Is,Rs=new Set([`pull`,`pulls`,`pull-requests`,`tree`,`blob`,`commit`,`commits`,`issues`,`src`,`actions`]),zs=/^[^\s\p{Cc}]+$/u;function Bs(e){let t=e.trim();if(!t)return null;let n=``,r;if(/^[a-z][a-z\d+.-]*:/i.test(t)){let e;try{e=new URL(t)}catch{return null}if(e.protocol!==`https:`&&e.protocol!==`http:`)return null;n=e.hostname.toLowerCase();try{r=e.pathname.split(`/`).filter(Boolean).map(decodeURIComponent)}catch{return null}}else if(r=t.replace(/\/+$/,``).split(`/`),r.some(e=>!e))return null;let i,a,o=r.indexOf(`_git`);if(o>=0){if(i=n.endsWith(`.visualstudio.com`)&&o===1?[n.split(`.`)[0],r[0]]:r.slice(0,o),a=r[o+1],i.length!==2)return null}else if(n===`github.com`||n===`bitbucket.org`)i=r.slice(0,1),a=r[1];else{let e=r.indexOf(`-`),t=e>=0?r.slice(0,e):r;n&&t.length>2&&Rs.has(t[2])&&(t=t.slice(0,2)),i=t.slice(0,-1),a=t[t.length-1]}return a=a?.replace(/\.git$/i,``),!a||!i.length||![...i,a].every(e=>zs.test(e))?null:{owner:i.join(`/`),name:a}}function Vs(e,t){return e?{url:e,fromPage:!1}:{url:t,fromPage:!0}}function Hs(){let e=Nr(`/server`);return{...Vs(e.data?.effectivePublicUrl,window.location.origin),loading:e.loading&&!e.data}}function Us({version:e,dashboardUrl:t,initialPlatform:n=`github`,withHook:r}){let[i,a]=(0,v.useState)(n),[o,s]=(0,v.useState)(`openrouter`),[c,l]=(0,v.useState)(ss.openrouter[0]),[u,d]=(0,v.useState)(!1),f=(0,v.useMemo)(()=>{if(i!==`hook`)try{return{template:Ps({platform:i,provider:o,model:c,version:e,fromSource:u,dashboardUrl:t})}}catch(e){return{error:e.message}}},[i,o,c,e,u,t]),p=f?.template,m=p??(i===`hook`?Fs():void 0),h=e=>{s(e),l(ss[e][0])};return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-4 overflow-x-auto scrollbar-thin`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[...Object.keys(Is).map(e=>({value:e,label:Is[e].pipeline})),...r?[{value:`hook`,label:`Pre-commit`}]:[]]})}),i!==`hook`&&(0,k.jsxs)(`div`,{className:`mb-4 grid gap-3 md:grid-cols-[1fr_1fr_auto]`,children:[(0,k.jsx)(N,{label:`Provider`,children:(0,k.jsxs)(sr,{value:o,onChange:e=>h(e.target.value),children:[(0,k.jsx)(`option`,{value:`openrouter`,children:`OpenRouter (API key)`}),(0,k.jsx)(`option`,{value:`claude-code`,children:`Claude subscription (Claude Code)`}),(0,k.jsx)(`option`,{value:`copilot`,children:`GitHub Copilot`}),(0,k.jsx)(`option`,{value:`codex`,children:`ChatGPT subscription (Codex)`})]})}),(0,k.jsxs)(N,{label:`Model`,hint:`Free text; the list only holds suggestions.`,children:[(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),list:`ci-models`,className:`font-mono`}),(0,k.jsx)(`datalist`,{id:`ci-models`,children:ss[o].map(e=>(0,k.jsx)(`option`,{value:e},e))})]}),(0,k.jsx)(N,{label:`Build Argus from source`,children:(0,k.jsx)(cr,{checked:u,onChange:d,label:`Build Argus from source`})})]}),f?.error&&(0,k.jsxs)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:[f.error,`. Set the public URL of this dashboard first (Settings → Server & CI).`]}),m&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13.5px] text-ink-2`,children:m.note}),p&&(0,k.jsxs)(`div`,{className:`mb-4`,children:[(0,k.jsx)(`div`,{className:`mb-1.5 text-[12px] font-medium tracking-wide text-ink-3 uppercase`,children:`Secrets to add`}),(0,k.jsx)(`ul`,{className:`space-y-1.5`,children:p.secrets.map(e=>(0,k.jsxs)(`li`,{className:`text-[13px] text-ink-2`,children:[(0,k.jsx)(`code`,{className:`font-mono text-ink`,children:e.name}),`: `,e.how]},e.name))})]}),(0,k.jsxs)(`div`,{className:`mb-1.5 flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`font-mono text-[12px] text-ink-3`,children:m.file}),(0,k.jsx)(br,{text:m.text})]}),(0,k.jsx)(yr,{children:m.text})]})]})}function Ws({token:e}){return(0,k.jsxs)(`div`,{className:`rounded-xl border border-minor/40 bg-minor/5 px-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[13.5px] font-medium text-ink`,children:`Repository token`}),(0,k.jsx)(br,{text:e,label:`Copy token`})]}),(0,k.jsx)(`code`,{className:`mt-2 block font-mono text-[12.5px] break-all text-ink`,children:e}),(0,k.jsxs)(`p`,{className:`mt-2 text-[12.5px] text-ink-2`,children:[`Copy it now: you won't see it again. Add it to the repository's CI secrets as `,(0,k.jsx)(`code`,{className:`font-mono`,children:`ARGUS_TOKEN`}),`. Lost it? Regenerate it from the repository page.`]})]})}function Gs({repo:e,token:t}){let n=Hs(),r=Nr(`/status`);return(0,k.jsxs)(`div`,{className:`space-y-5`,children:[(0,k.jsx)(Ws,{token:t}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-2 font-display text-[16px]`,children:`Pipeline`}),n.fromPage&&!n.loading&&(0,k.jsxs)(`p`,{className:`mb-3 text-[12.5px] text-ink-3`,children:[`No public URL is set, so the pipeline sends results to this page's address, `,(0,k.jsx)(`span`,{className:`font-mono`,children:n.url}),`. Set the public URL under Server & CI if your CI reaches the dashboard at another address.`]}),n.loading||r.loading&&!r.data?(0,k.jsx)(ir,{}):(0,k.jsx)(Us,{version:r.data?.version??`0.2.2`,dashboardUrl:n.url,initialPlatform:Ls(e.platform)?e.platform:`github`})]})]})}function Ks({onAdded:e}){let[t,n]=(0,v.useState)(`github`),[r,i]=(0,v.useState)(Is.github.host),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(),d=Is[t],f=Bs(a),p=e=>{n(e),i(Is[e].host)},m=async()=>{if(f){c(!0),u(void 0);try{let n=await I(`/repositories`,{method:`POST`,json:{platform:t,host:r.trim()||d.host,...f}});e(n.repository,n.token)}catch(e){u(e.message)}finally{c(!1)}}};return(0,k.jsxs)(`form`,{className:`space-y-4`,onSubmit:e=>{e.preventDefault(),m()},children:[(0,k.jsx)(`p`,{className:`text-[13.5px] text-ink-2`,children:`The review runs in the repository's own pipeline, with your model provider. Argus gives the repository a token: with it the pipeline pulls this dashboard's settings and sends each review back here.`}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Platform`,children:(0,k.jsx)(sr,{value:t,onChange:e=>p(e.target.value),children:Object.keys(Is).map(e=>(0,k.jsx)(`option`,{value:e,children:Is[e].name},e))})}),(0,k.jsx)(N,{label:`Host`,hint:d.fixedHost?void 0:`Change for self-hosted instances.`,children:(0,k.jsx)(M,{value:r,onChange:e=>i(e.target.value),disabled:d.fixedHost,className:`font-mono`})})]}),(0,k.jsx)(N,{label:`Repository`,hint:a.trim()&&!f?`Enter owner/name or the repository URL.`:f?`Owner ${f.owner}, repository ${f.name}`:`For example ${d.example}, or the repository URL.`,children:(0,k.jsx)(M,{value:a,onChange:e=>o(e.target.value),placeholder:`${d.example} or https://${d.host}/…`,className:`font-mono`})}),l&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:l}),(0,k.jsx)(`div`,{className:`flex justify-end`,children:(0,k.jsx)(j,{type:`submit`,variant:`primary`,loading:s,disabled:!f,children:`Add repository`})})]})}function qs({repo:e,onChange:t}){let n=Nr(`/repositories/${e.id}/token`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(),s=zr(`admin`),c=Cr(),l=`${e.owner}/${e.name}`,u=n.data??void 0,d=async(e,t)=>{o(e);try{await t()}catch(e){c(`bad`,e.message)}finally{o(void 0)}},f=()=>d(`token`,async()=>{if(u&&!window.confirm(`Regenerate the token for ${l}? The current token stops working right away; update ARGUS_TOKEN in CI with the new one.`))return;let t=await I(`/repositories/${e.id}/token`,{method:`POST`});i(t.token),n.setData({prefix:t.prefix,createdAt:t.createdAt,lastUsedAt:null})}),p=()=>d(`revoke`,async()=>{window.confirm(`Revoke the token for ${l}? CI runs can no longer pull settings or send reviews until you create a new token.`)&&(await I(`/repositories/${e.id}/token`,{method:`DELETE`}),i(void 0),n.setData(null),c(`ok`,`Token revoked`))}),m=n=>d(`summary`,async()=>{let r=await I(`/repositories/${e.id}`,{method:`PUT`,json:{summaryOnly:n}});t({...e,summaryOnly:r.repository.summaryOnly})});return(0,k.jsxs)(P,{eyebrow:`Reviewed in CI`,title:`CI connection`,actions:s&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(j,{size:`sm`,loading:a===`token`,onClick:()=>void f(),children:u?`Regenerate token`:`Create token`}),u&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:a===`revoke`,onClick:()=>void p(),children:`Revoke`})]}),children:[n.loading&&!n.data&&n.data!==null?(0,k.jsx)(ir,{}):n.error?(0,k.jsx)(`p`,{className:`text-[13px] text-critical`,children:n.error}):u?(0,k.jsxs)(`dl`,{className:`grid gap-x-8 gap-y-2 text-[13px] md:grid-cols-3`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Token`}),(0,k.jsxs)(`dd`,{className:`mt-1 font-mono text-ink`,children:[`argus_`,u.prefix,`…`]})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Created`}),(0,k.jsx)(`dd`,{className:`mt-1 text-ink-2`,children:wr(u.createdAt)})]}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`dt`,{className:`eyebrow`,children:`Last used`}),(0,k.jsx)(`dd`,{className:`mt-1 text-ink-2`,children:u.lastUsedAt?wr(u.lastUsedAt):`Never`})]})]}):(0,k.jsxs)(`p`,{className:`text-[13.5px] text-ink-2`,children:[(0,k.jsx)(F,{tone:`warn`,children:`No active token`}),` CI runs of this repository cannot pull settings or send reviews until `,s?`you create`:`an admin creates`,` a token.`]}),r&&(0,k.jsx)(`div`,{className:`mt-5 border-t border-line pt-5`,children:(0,k.jsx)(Gs,{repo:e,token:r})}),(0,k.jsx)(`div`,{className:`mt-4 border-t border-line`,children:(0,k.jsx)(lr,{label:`Send summary only`,hint:(0,k.jsxs)(k.Fragment,{children:[`CI sends this dashboard only the outline of each review: counts, titles and locations of findings, timings and usage. Explanations, suggested fixes, code and the summary text stay on the pull request. Results stored before you turn this on stay as they were stored.`,!s&&` Only admins can change this.`]}),checked:e.summaryOnly,disabled:!s||a===`summary`,onChange:e=>void m(e)})})]})}var Js=[{value:`quiet`,title:`Quiet`,text:`Only critical and major defects. Silent otherwise.`},{value:`chill`,title:`Chill`,text:`Real defects of every severity, no nitpicks or style.`},{value:`assertive`,title:`Assertive`,text:`Everything a strict senior reviewer would say, including nitpicks.`}],Ys={bug:`Logic errors, wrong conditions, off-by-one, code vs comment mismatch`,security:`Injection, XSS, SSRF, authz, secrets, unsafe crypto`,performance:`N+1, quadratic loops, blocking I/O, memory growth`,concurrency:`Races, missing await, unhandled promises`,"error-handling":`Swallowed errors, missing null checks, cleanup`,"data-integrity":`Validation, rounding, money, time zones, units`,"api-contract":`Breaking signature or schema changes across files`,maintainability:`Duplication that will drift, hidden coupling`,readability:`Confusing flow likely to cause misuse`,testing:`Tests that cannot fail or test the wrong thing`,documentation:`Docs and comments made wrong by the change`,style:`Formatting and idiom (assertive profile only)`};function Xs(){let e=Yr(),t=e.get(`review.profile`),n=e.get(`review.categories`)??[],r=e.meta.severities;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Tone`,title:`Review profile`,children:[(0,k.jsx)(`div`,{className:`mb-2 flex items-center`,children:(0,k.jsx)(si,{path:`review.profile`})}),(0,k.jsx)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:Js.map(n=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`review.profile`,n.value),className:A(`rounded-xl border p-4 text-left transition-all`,t===n.value?`border-iris bg-iris-soft shadow-[0_0_0_3px_color-mix(in_oklab,var(--iris)_18%,transparent)]`:`border-line-strong hover:border-ink-3`),children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`font-display text-[17px] font-medium`,children:n.title}),(0,k.jsx)(`span`,{className:A(`h-3.5 w-3.5 rounded-full border-2`,t===n.value?`border-iris bg-iris`:`border-line-strong`)})]}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12.5px] leading-snug text-ink-2`,children:n.text})]},n.value))})]}),(0,k.jsx)(P,{eyebrow:`Precision`,title:`What gets reported`,children:(0,k.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(ui,{path:`review.minSeverity`,label:`Severity floor`,hint:`Findings below this severity are dropped. Profiles can raise it further (quiet ⇒ major).`,options:r.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}),(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Confidence threshold: `,(0,k.jsxs)(`span`,{className:`font-mono`,children:[Math.round((e.get(`review.minConfidence`)??.6)*10),`/10`]}),(0,k.jsx)(si,{path:`review.minConfidence`})]}),hint:`Verified score a finding needs to be posted. Higher means fewer, surer comments.`,children:(0,k.jsx)(`input`,{type:`range`,min:1,max:10,value:Math.round((e.get(`review.minConfidence`)??.6)*10),onChange:t=>e.set(`review.minConfidence`,Number(t.target.value)/10),className:`w-full max-w-sm accent-[var(--iris)]`})}),(0,k.jsx)(li,{path:`review.maxComments`,label:`Max inline comments per review`,min:1,max:200,hint:`Extra findings go into the summary.`}),(0,k.jsx)(fi,{path:`review.language`,label:`Review language`,hint:`Language for comments, e.g. English, German, Macedonian.`})]})}),(0,k.jsx)(P,{eyebrow:`Focus`,title:`Categories`,actions:(0,k.jsx)(si,{path:`review.categories`}),children:(0,k.jsx)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:e.meta.categories.map(t=>{let r=n.includes(t);return(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`review.categories`,r?n.filter(e=>e!==t):[...n,t]),className:A(`flex items-start gap-3 rounded-xl border px-3.5 py-2.5 text-left transition-colors`,r?`border-iris/50 bg-iris-soft/60`:`border-line hover:border-line-strong`),children:[(0,k.jsx)(`span`,{className:A(`mt-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded border text-[10px]`,r?`border-iris bg-iris text-iris-ink`:`border-line-strong`),children:r?`✓`:``}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`span`,{className:`font-mono text-[12.5px] text-ink`,children:t}),(0,k.jsx)(`span`,{className:`block text-[12px] text-ink-3`,children:Ys[t]})]})]},t)})})}),(0,k.jsx)(P,{eyebrow:`Pipeline`,title:`Quality passes`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.verifyFindings`,label:`Verify every finding`,hint:`A second model pass re-derives each finding from the code and discards speculation. Biggest precision gain; costs one extra call per batch.`}),(0,k.jsx)(L,{path:`review.crossFileAnalysis`,label:`Cross-file analysis`,hint:`Looks at all changed files together for broken contracts, missed callers and inconsistent changes.`}),(0,k.jsx)(L,{path:`review.secretScan`,label:`Secret scanning`,hint:`Deterministic detection of keys, tokens and passwords in added lines.`}),(0,k.jsx)(L,{path:`review.incremental`,label:`Incremental re-reviews`,hint:`On new pushes, review only what changed since the last reviewed commit.`}),(0,k.jsx)(L,{path:`review.adaptive`,label:`Learn from developer reactions`,hint:`Categories the team keeps dismissing (👎, “false positive”, “intended”) need more confidence in that repository; categories that are almost always fixed get a little more room. Kicks in after 8 decided comments per category.`}),(0,k.jsx)(L,{path:`review.cache.enabled`,label:`Reuse identical model answers`,hint:`Requests with exactly the same prompt (same code, context and settings) are answered from a local cache for a week: re-running a review on an unchanged commit is instant and free.`}),(0,k.jsx)(L,{path:`review.autoResolve`,label:`Resolve threads when the issue is fixed`,hint:`On each new push, findings whose code changed are re-checked; fixed ones get a “✅ Fixed in abc123” reply and their thread is resolved.`})]})}),(0,k.jsxs)(P,{eyebrow:`Merge gate`,title:`Commit status`,children:[(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`review.status.enabled`,label:`Report an argus commit status`,hint:`Pending while the review runs, then failure, error (the review did not complete) or success. Require the argus check in branch protection to block merges until it passes.`})}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`review.status.enabled`)&&`pointer-events-none opacity-50`),children:(0,k.jsx)(ui,{path:`review.status.failOn`,label:`Fail when a finding is at least`,options:[{value:`critical`,label:`Critical`},{value:`major`,label:`Major`},{value:`minor`,label:`Minor`}]})})]}),(0,k.jsxs)(P,{eyebrow:`Output`,title:`Comments and approval`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.suggestions`,label:`Committable suggestions`,hint:`Include one-click fix suggestions (GitHub and GitLab; shown as code on Bitbucket).`}),(0,k.jsx)(L,{path:`review.agentPrompts`,label:`Prompt for AI agents`,hint:`Add a collapsible prompt to each comment for Claude Code, Codex or Cursor.`}),(0,k.jsx)(L,{path:`review.approveWhenClean`,label:`Approve when no issues are found`})]}),(0,k.jsx)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(ui,{path:`review.requestChangesOn`,label:`Request changes when a finding is at least`,options:[{value:`never`,label:`Never (comment only)`},{value:`critical`,label:`Critical`},{value:`major`,label:`Major`}]})})]}),(0,k.jsx)(P,{eyebrow:`Limits`,title:`Size and throughput`,children:(0,k.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:[(0,k.jsx)(li,{path:`review.maxFiles`,label:`Max files per review`,min:1}),(0,k.jsx)(li,{path:`review.maxPatchLines`,label:`Max changed lines`,min:100,hint:`Larger PRs are reviewed up to this budget.`}),(0,k.jsx)(li,{path:`review.concurrency`,label:`Parallel model calls`,min:1,max:16})]})})]})}function Zs(){return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(P,{eyebrow:`Walkthrough`,title:`Summary comment`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`summary.enabled`,label:`Generate a summary`,hint:`One persistent comment on the PR, edited in place on every review.`}),(0,k.jsx)(L,{path:`summary.walkthrough`,label:`Walkthrough paragraph`}),(0,k.jsx)(L,{path:`summary.changesTable`,label:`Changed files table`}),(0,k.jsx)(L,{path:`summary.sequenceDiagram`,label:`Sequence diagram`,hint:`Mermaid diagram of the main runtime flow (GitHub and GitLab render it).`}),(0,k.jsx)(L,{path:`summary.effortEstimate`,label:`Review effort estimate`}),(0,k.jsx)(L,{path:`summary.collapseWalkthrough`,label:`Collapse the walkthrough`})]})}),(0,k.jsxs)(P,{eyebrow:`Pull request`,title:`Description and labels`,children:[(0,k.jsx)(`div`,{className:`grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(ui,{path:`summary.updateDescription`,label:`Write the PR description`,options:[{value:`never`,label:`Never`},{value:`when-empty`,label:`Only when the description is empty`},{value:`append`,label:`Append a summary section`}]})}),(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`summary.applyLabels`,label:`Apply suggested labels`,hint:`Adds up to 4 labels such as bug, feature or security (GitHub and GitLab).`})})]}),(0,k.jsx)(P,{eyebrow:`Intent`,title:`Linked issues`,children:(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`tickets.enabled`,label:`Read linked issues`,hint:`Finds #123, owner/repo#123, issue URLs and Jira or Linear keys (PROJ-42) in the title, branch, description and commits, and gives the reviewer the issue text so the code is held to it. Jira and Linear need credentials under Server & CI.`}),(0,k.jsx)(L,{path:`tickets.checkRequirements`,label:`Check requirement coverage`,hint:`Extracts the acceptance criteria from each issue and marks every one as met, partial, missing or unclear in the summary comment.`}),(0,k.jsx)(di,{path:`tickets.allowedRepos`,label:`Other repositories`,hint:`Issues of the pull request's own owner are always read. Add owner/name (globs allowed) for other repositories Argus may read issues from.`,placeholder:`acme/*, partner/api`}),(0,k.jsx)(di,{path:`tickets.projectKeys`,label:`Jira and Linear projects`,hint:`Only tickets from these project keys are read. Empty means Jira and Linear tickets are never fetched.`,placeholder:`PAY, ENG`})]})})]})}function Qs(){let e=Yr().get(`chat.mention`);return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Triggers`,title:`Automatic reviews`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`autoReview.enabled`,label:`Review pull requests automatically`,hint:`On open, reopen, ready-for-review and every new push.`}),(0,k.jsx)(L,{path:`autoReview.drafts`,label:`Review draft pull requests`})]}),(0,k.jsxs)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(di,{path:`autoReview.baseBranches`,label:`Only target branches`,hint:`Glob or /regex/. Empty means all branches.`,placeholder:`main, release/*`}),(0,k.jsx)(di,{path:`autoReview.labels`,label:`Only with labels`,hint:`Empty means no label is required.`,mono:!1,placeholder:`ai-review`}),(0,k.jsx)(di,{path:`autoReview.ignoreTitleKeywords`,label:`Skip titles containing`,mono:!1}),(0,k.jsx)(di,{path:`autoReview.ignoreAuthors`,label:`Skip authors`,placeholder:`dependabot[bot]`})]})]}),(0,k.jsxs)(P,{eyebrow:`Conversation`,title:`Chat and commands`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`chat.enabled`,label:`Reply to mentions and review threads`}),(0,k.jsx)(L,{path:`chat.learnFromFeedback`,label:`Learn from feedback`,hint:`When someone corrects Argus, store the lesson as a learning for future reviews.`})]}),(0,k.jsx)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(fi,{path:`chat.mention`,label:`Mention`,mono:!0,hint:`Commands: ${e} review · full review · review focus <topic> · pause · resume · resolve · remember <rule> · help`})})]})]})}function $s(){let e=Yr();return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Scope`,title:`Path filters`,children:[(0,k.jsxs)(`div`,{className:`grid gap-5`,children:[(0,k.jsx)(di,{path:`files.include`,label:`Only review`,hint:`Glob patterns. Empty means everything. A leading ! excludes.`,placeholder:`src/**, !src/generated/**`}),(0,k.jsx)(di,{path:`files.exclude`,label:`Never review`,placeholder:`**/*.test.ts, docs/**`})]}),(0,k.jsx)(pi,{children:(0,k.jsx)(L,{path:`files.useDefaultExcludes`,label:`Skip lock files, build output, minified, vendored and binary files`})})]}),(0,k.jsxs)(P,{eyebrow:`Context`,title:`What the reviewer can see`,children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Context depth`,(0,k.jsx)(si,{path:`files.contextDepth`})]}),hint:`Related context adds imported files and other usages of changed symbols, which is how cross-file bugs are caught.`,children:(0,k.jsx)(`div`,{className:`grid gap-2 md:grid-cols-3`,children:[[`diff`,`Diff only`,`Fastest and cheapest`],[`files`,`Full files`,`Whole changed files`],[`related`,`Related code`,`Files + imports + usages`]].map(([t,n,r])=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>e.set(`files.contextDepth`,t),className:A(`rounded-xl border px-4 py-3 text-left`,e.get(`files.contextDepth`)===t?`border-iris bg-iris-soft`:`border-line-strong hover:border-ink-3`),children:[(0,k.jsx)(`div`,{className:`font-medium`,children:n}),(0,k.jsx)(`div`,{className:`text-[12.5px] text-ink-3`,children:r})]},t))})}),(0,k.jsx)(`div`,{className:`mt-2`,children:(0,k.jsx)(L,{path:`files.codeGraph`,label:`Syntax-tree code graph`,hint:`Parses TypeScript, JavaScript, Python, Go, Java, Rust, Ruby, PHP, C# and C++ with tree-sitter to find real callers (with the function they sit in), definitions, implementations and the transitive impact of a change. Feeds related context, the reviewer's tools and risk scoring. Other languages fall back to text search.`})}),(0,k.jsx)(`div`,{className:`mt-3 grid gap-5 md:grid-cols-2`,children:(0,k.jsx)(li,{path:`files.maxContextChars`,label:`Context budget (characters)`,min:2e4,step:1e4})})]}),(0,k.jsx)(P,{eyebrow:`Conventions`,title:`Guideline files`,children:(0,k.jsx)(di,{path:`files.guidelineFiles`,label:`Read these files from the repository`,hint:`Nested files apply only to their directory, e.g. services/billing/CLAUDE.md covers services/billing/**.`})})]})}var ec={types:`types`,lint:`lint`,security:`security`,secret:`secrets`,dependency:`dependencies`};function tc(){let e=Yr(),t=e.get(`review.agent.enabled`),n=e.get(`review.voting.enabled`),r=e.get(`review.voting.passes`)??3,i=e.get(`analyzers.enabled`),a=e.get(`review.verifyFindings`),o=n&&e.get(`review.voting.doubleCheckCritical`),s=[{label:`Analyze`,detail:`linters · scanners`,on:!!i},{label:`Route`,detail:`light · standard · deep`,on:!!e.get(`review.routing.enabled`)},{label:`Review`,detail:n?`${r} lenses on risky files`:`one pass`,on:!0},{label:`Explore`,detail:`read · grep · references`,on:!!t},{label:`Verify`,detail:`every finding`,on:!!a},{label:`Second check`,detail:`critical findings`,on:!!(o&&a)},{label:`Prove`,detail:`tests reproduce bugs`,on:!!(e.get(`execution.enabled`)&&e.get(`execution.proveFindings`))}];return(0,k.jsx)(`div`,{className:`flex flex-wrap items-stretch gap-2`,children:s.map((e,t)=>(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(`div`,{className:A(`rounded-xl border px-3.5 py-2 transition-colors`,e.on?`border-iris/45 bg-iris-soft/60`:`border-dashed border-line-strong opacity-55`),children:[(0,k.jsx)(`div`,{className:A(`font-display text-[14.5px] leading-tight`,e.on?`text-ink`:`text-ink-3 line-through decoration-ink-3/50`),children:e.label}),(0,k.jsx)(`div`,{className:`font-mono text-[10.5px] tracking-wide text-ink-3`,children:e.detail})]}),t<s.length-1&&(0,k.jsx)(`span`,{className:`font-mono text-ink-3`,children:`→`})]},e.label))})}function nc(){let e=Yr(),t=Nr(`/analyzers`),n=e.get(`analyzers.disabled`)??[],r=e.get(`analyzers.enabled`);return t.error?(0,k.jsx)(`p`,{className:`text-[13px] text-critical`,children:t.error}):t.data?(0,k.jsx)(`div`,{className:A(`divide-y divide-line`,!r&&`pointer-events-none opacity-50`),children:t.data.analyzers.map(t=>{let r=!n.includes(t.name);return(0,k.jsxs)(`div`,{className:`flex items-start gap-4 py-3`,children:[(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`text-[13.5px] font-medium text-ink`,children:t.label}),(0,k.jsx)(F,{children:ec[t.kind]}),t.installed===!0&&(0,k.jsx)(F,{tone:`ok`,children:`installed`}),t.installed===!1&&(0,k.jsx)(F,{tone:`warn`,children:`not installed`}),t.installed===null&&(0,k.jsx)(F,{tone:`iris`,children:`uses repo dependencies`})]}),(0,k.jsx)(`p`,{className:`mt-0.5 text-[12.5px] leading-snug text-ink-3`,children:t.description}),t.installed!==!0&&(0,k.jsx)(`p`,{className:`mt-0.5 text-[12px] leading-snug text-ink-3/80 italic`,children:t.note})]}),(0,k.jsx)(cr,{checked:r,label:`Run ${t.label}`,onChange:r=>e.set(`analyzers.disabled`,r?n.filter(e=>e!==t.name):[...n,t.name])})]},t.name)})}):(0,k.jsxs)(`div`,{className:`flex items-center gap-2 py-3 text-[13px] text-ink-3`,children:[(0,k.jsx)(ir,{size:13}),` Checking which tools are installed…`]})}function rc(){let e=Yr(),t=Nr(`/execution`),n=e.get(`execution.enabled`),r=e.get(`execution.sandbox`)??`auto`,i=e.meta.severities;return(0,k.jsxs)(P,{eyebrow:`Proof`,title:`Run the tests and prove findings`,actions:t.data?t.data.docker?(0,k.jsx)(F,{tone:`ok`,children:`Docker ready`}):(0,k.jsx)(F,{tone:`warn`,children:`Docker not found`}):(0,k.jsx)(ir,{size:13}),children:[e.isLocked(`execution.sandbox`)&&(0,k.jsxs)(`p`,{className:`mb-3 rounded-lg border border-line px-3 py-2 text-[12.5px] text-ink-3`,children:[`Settings marked `,(0,k.jsx)(`span`,{className:`font-mono text-[10px] uppercase`,children:`admin only`}),` decide what code runs and where. `,e.lockNote,`.`]}),(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`execution.enabled`,label:`Install dependencies and run code`,hint:`A private copy of the pull request is installed in a container (vitest, jest, npm test, pytest or go test are detected). Installs get network access; tests run with networking disabled, CPU and memory limits, and no access to your files. tsc and ESLint also run against the installed copy.`}),(0,k.jsx)(L,{path:`execution.runTests`,label:`Run the test suite`,hint:`Failing tests are re-run against the base branch: ones that passed before are reported as regressions caused by this change, ones that already failed are ignored.`}),(0,k.jsx)(L,{path:`execution.proveFindings`,label:`Write a test for each serious finding`,hint:`The model writes a focused test that should fail because of the bug. If it fails, and passes once the suggested fix is applied, the finding is marked as reproduced and shown with the test. If it passes, the finding loses confidence.`})]}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-3`,!n&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Where code runs`,(0,k.jsx)(si,{path:`execution.sandbox`}),(0,k.jsx)(ci,{path:`execution.sandbox`})]}),hint:r===`host`?`Runs directly on this machine. Only for your own repositories.`:`Docker isolates untrusted pull requests.`,children:(0,k.jsx)(`div`,{className:A(e.isLocked(`execution.sandbox`)&&`pointer-events-none opacity-60`),children:(0,k.jsx)(gr,{value:r,options:[{value:`auto`,label:`Auto`,hint:`Use Docker when available, otherwise skip`},{value:`docker`,label:`Docker`,hint:`Always in Docker; skipped when Docker is unavailable`},{value:`host`,label:`This machine`,hint:`No isolation; for trusted code only`}],onChange:t=>e.set(`execution.sandbox`,t)})})}),(0,k.jsx)(ui,{path:`execution.isolation`,label:`Isolation`,hint:`Strict drops every Linux capability and makes the container filesystem read-only while tests run.`,options:[{value:`strict`,label:`Strict (recommended)`},{value:`standard`,label:`Standard`}]}),(0,k.jsx)(ui,{path:`execution.runtime`,label:`Container runtime`,hint:`gVisor (runsc) or Kata Containers add a kernel boundary for untrusted pull requests; auto uses them when Docker has them.`,options:[{value:`auto`,label:`Auto (gVisor or Kata when installed)`},{value:`runsc`,label:`gVisor (runsc)`},{value:`kata`,label:`Kata Containers`},{value:`runc`,label:`Default (runc)`}]}),(0,k.jsx)(li,{path:`execution.maxProofs`,label:`Findings to prove per review`,min:0,max:20}),(0,k.jsx)(ui,{path:`execution.proofMinSeverity`,label:`Prove findings of at least`,options:i.map(e=>({value:e,label:e[0].toUpperCase()+e.slice(1)}))}),(0,k.jsx)(fi,{path:`execution.installCommand`,label:`Install command`,placeholder:`Detected automatically`,mono:!0}),(0,k.jsx)(fi,{path:`execution.testCommand`,label:`Test command`,placeholder:`Detected automatically`,mono:!0}),(0,k.jsx)(fi,{path:`execution.image`,label:`Container image`,placeholder:`node:22-bookworm, python:3.12-bookworm…`,mono:!0}),(0,k.jsx)(li,{path:`execution.timeoutSec`,label:`Install timeout (s)`,min:30,max:3600}),(0,k.jsx)(li,{path:`execution.testTimeoutSec`,label:`Test-suite timeout (s)`,min:30,max:3600,hint:`Tests run without network; ones that need it fail or time out and are ignored unless they passed on the base branch.`}),(0,k.jsx)(li,{path:`execution.proofTimeoutSec`,label:`Timeout per proof test (s)`,min:10,max:1800})]})]})}function ic(){let e=Yr(),t=e.get(`review.agent.enabled`),n=e.get(`review.voting.enabled`),r=String(e.get(`review.voting.passes`)??3),i=e.get(`review.voting.scope`)??`risky`;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Pipeline`,title:`How deep each review goes`,children:[(0,k.jsx)(tc,{}),(0,k.jsx)(`p`,{className:`mt-3 text-[12.5px] leading-snug text-ink-3`,children:`Every stage trades time and tokens for precision. Disabled stages are skipped; the rest run in this order for each pull request.`})]}),(0,k.jsxs)(P,{eyebrow:`Exploration`,title:`Agentic codebase exploration`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.agent.enabled`,label:`Let the reviewer explore the repository`,hint:`The model can read files, search the code, look up definitions, callers, implementations and the transitive impact of a change, and check history before it reports anything. API models use Argus tools; Claude Code and Codex explore a read-only checkout with their own tools.`}),(0,k.jsx)(L,{path:`review.agent.verify`,label:`Explore during verification`,hint:`The verifier checks each finding against the code it points at: guards elsewhere, broken callers, existing validation. The biggest single cut in false positives.`})]}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!t&&`pointer-events-none opacity-50`),children:(0,k.jsx)(li,{path:`review.agent.maxSteps`,label:`Tool rounds per call`,min:1,max:40,hint:`Upper bound on exploration per review batch. 6–10 covers most pull requests.`})})]}),(0,k.jsxs)(P,{eyebrow:`Consensus`,title:`Multi-pass voting`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.voting.enabled`,label:`Review high-risk files several times`,hint:`Auth, payments, migrations, security-sensitive and large changes get extra independent passes, each with a different lens (adversarial, edge cases, contracts). Findings are clustered across passes; the ones most passes agree on gain confidence, lone findings need a stronger verification score.`}),(0,k.jsx)(L,{path:`review.voting.doubleCheckCritical`,label:`Second, independent check for critical findings`,hint:`A skeptical verifier must also confirm every critical finding before it is posted, so a false critical never blocks a merge.`})]}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-3`,!n&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Passes per high-risk file`,(0,k.jsx)(si,{path:`review.voting.passes`})]}),children:(0,k.jsx)(gr,{value:r,options:[`2`,`3`,`4`,`5`].map(e=>({value:e,label:e})),onChange:t=>e.set(`review.voting.passes`,Number(t))})}),(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Which files`,(0,k.jsx)(si,{path:`review.voting.scope`})]}),children:(0,k.jsx)(gr,{value:i,options:[{value:`risky`,label:`High-risk`,hint:`Files scored as risky by path, change size, summary and analyzers`},{value:`all`,label:`All files`,hint:`Every reviewed file except tests and docs; costs more`}],onChange:t=>e.set(`review.voting.scope`,t)})}),i===`risky`&&(0,k.jsx)(li,{path:`review.voting.maxFiles`,label:`Max high-risk files`,min:1,max:50})]})]}),(0,k.jsx)(rc,{}),(0,k.jsxs)(P,{eyebrow:`Cost`,title:`Model routing and spending`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`review.routing.enabled`,label:`Route files by risk`,hint:`Formatting- and comment-only changes get a light review without exploration; high-risk files go to the high-risk model and get voting. Set the light and high-risk models under Models & providers.`}),(0,k.jsx)(L,{path:`review.routing.triage`,label:`Triage small changes with the light model`,hint:`A cheap model decides which small files have no behavioural impact (copy text, version bumps). Only runs when a light model is set. When unsure it keeps the full review.`})]}),(0,k.jsx)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`review.routing.enabled`)&&`pointer-events-none opacity-50`),children:(0,k.jsx)(li,{path:`review.routing.maxTrivialLines`,label:`Largest change triage may call trivial`,min:1,max:500,hint:`Changed lines. Bigger files always get the full review.`})}),(0,k.jsxs)(`div`,{className:`mt-4 grid gap-5 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:(0,k.jsxs)(k.Fragment,{children:[`Spending limit per review (USD)`,(0,k.jsx)(si,{path:`review.maxCostUsd`}),(0,k.jsx)(ci,{path:`review.maxCostUsd`})]}),hint:`Stops calling paid APIs once a single review reaches this amount (default $5). Subscriptions (Claude Code, Codex, Copilot) report no cost and are not limited.`,children:(0,k.jsx)(`input`,{type:`number`,min:.01,step:.05,value:e.get(`review.maxCostUsd`)??``,disabled:e.isLocked(`review.maxCostUsd`),placeholder:`5`,onChange:t=>e.set(`review.maxCostUsd`,t.target.value===``?void 0:Math.max(.01,Number(t.target.value))),className:`h-9 w-full max-w-48 rounded-lg border border-line-strong bg-panel-2 px-3 font-mono text-[13px] text-ink outline-none focus:border-iris`})}),(0,k.jsx)(li,{path:`review.timeoutMinutes`,label:`Time limit per review (minutes)`,min:1,max:240,hint:`A review still running after this is stopped and its commit status set to error.`})]})]}),(0,k.jsxs)(P,{eyebrow:`Evidence`,title:`Linters and security scanners`,children:[(0,k.jsxs)(pi,{children:[(0,k.jsx)(L,{path:`analyzers.enabled`,label:`Run static analysis on changed files`,hint:`Results on changed lines are handed to the model as evidence to confirm, explain or dismiss, never posted raw. Type errors elsewhere that mention a changed symbol are included, so broken callers surface.`}),(0,k.jsx)(L,{path:`analyzers.promoteSecurity`,label:`Post leaked secrets and vulnerable dependencies directly`,hint:`Gitleaks matches and high-severity OSV advisories on added lines become findings without waiting for the model.`})]}),(0,k.jsx)(`div`,{className:`mt-2`,children:(0,k.jsx)(nc,{})}),(0,k.jsxs)(`div`,{className:A(`mt-4 grid gap-5 md:grid-cols-2`,!e.get(`analyzers.enabled`)&&`pointer-events-none opacity-50`),children:[(0,k.jsx)(di,{path:`analyzers.semgrepConfig`,label:`Semgrep rulesets`,placeholder:`p/default`,hint:`Registry packs (p/owasp-top-ten, p/typescript) or paths to rule files in the repository.`}),(0,k.jsx)(li,{path:`analyzers.timeoutSec`,label:`Timeout per tool (seconds)`,min:10,max:1800})]})]})]})}var ac=[`review`,`depth`,`summary`,`triggers`,`files`,`rules`,`guidelines`];function oc(){let{id:e}=At(),t=Number(e),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(),[c,l]=(0,v.useState)(),[u,d]=(0,v.useState)(`overview`),f=Cr(),p=(0,v.useCallback)(async()=>{try{let[e,n,i]=await Promise.all([I(`/repositories`),I(`/meta`),I(`/config`)]),o=e.repositories.find(e=>e.id===t);if(!o)throw Error(`Repository not found`);r(o),a(n),s(i.config)}catch(e){l(e.message)}},[t]);(0,v.useEffect)(()=>{p()},[p]);let m=(0,v.useMemo)(()=>i&&o?Kr(i.defaults,o):void 0,[i,o]),h=(0,v.useCallback)(async e=>{let n=await I(`/repositories/${t}`,{method:`PUT`,json:{config:e}});r(e=>e&&{...e,config:n.repository.config}),n.ignoredKeys?.length&&f(`info`,`Not saved, only an admin can set: ${n.ignoredKeys.join(`, `)}`)},[t,f]);if(c)return(0,k.jsx)(`div`,{className:`rounded-xl border border-critical/40 p-6 text-critical`,children:c});if(!n||!i||!m)return(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading repository…`]});let g=Object.keys(n.config??{}).length;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:(0,k.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(Vn,{to:`/repositories`,className:`hover:text-ink`,children:`Repositories`}),`/ `,n.integrationId===null?`Reviewed in CI`:n.integrationName]}),title:(0,k.jsxs)(`span`,{className:`flex items-center gap-3`,children:[(0,k.jsx)(Tr,{platform:n.platform,size:26}),(0,k.jsxs)(`span`,{className:`font-mono text-[28px]`,children:[n.owner,`/`,(0,k.jsx)(`b`,{children:n.name})]})]}),description:g?`${g} setting group${g>1?`s`:``} override the global configuration.`:`Inherits every global setting. Override anything below for this repository only.`,actions:(0,k.jsxs)(`label`,{className:`flex items-center gap-2.5 rounded-xl border border-line-strong bg-panel px-3.5 py-2 text-[13px]`,children:[(0,k.jsx)(cr,{checked:n.enabled,label:`Reviews enabled`,onChange:async e=>{try{await I(`/repositories/${n.id}`,{method:`PUT`,json:{enabled:e}}),r({...n,enabled:e})}catch(e){f(`bad`,e.message)}}}),n.enabled?`Reviews on`:`Reviews off`]})}),(0,k.jsx)(`div`,{className:`mb-6 overflow-x-auto scrollbar-thin`,children:(0,k.jsx)(gr,{value:u,onChange:d,options:[{value:`overview`,label:`Overview`},{value:`review`,label:`Review`},{value:`depth`,label:`Depth`},{value:`summary`,label:`Summary`},{value:`triggers`,label:`Triggers`},{value:`files`,label:`Files`},{value:`rules`,label:`Rules`},{value:`guidelines`,label:`Guidelines`},{value:`learnings`,label:`Learnings`},{value:`file`,label:`.argus.yml`}]})}),u===`overview`&&(0,k.jsx)(sc,{repo:n,onChange:r}),ac.includes(u)&&(0,k.jsxs)(Xr,{base:m,meta:i,stored:n.config,onSave:h,scope:`repository`,children:[(0,k.jsxs)(`p`,{className:`mb-4 rounded-xl border border-iris/30 bg-iris-soft/50 px-4 py-2.5 text-[13px] text-ink-2`,children:[`Changes here apply to `,(0,k.jsxs)(`b`,{className:`text-ink`,children:[n.owner,`/`,n.name]}),` only. Values that differ from the global settings are marked `,(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-iris uppercase`,children:`overridden`}),`.`]}),u===`review`&&(0,k.jsx)(Xs,{}),u===`depth`&&(0,k.jsx)(ic,{}),u===`summary`&&(0,k.jsx)(Zs,{}),u===`triggers`&&(0,k.jsx)(Qs,{}),u===`files`&&(0,k.jsx)($s,{}),u===`rules`&&(0,k.jsx)(os,{}),u===`guidelines`&&(0,k.jsx)(hi,{})]}),u===`learnings`&&(0,k.jsx)(bi,{repositoryId:n.id,ci:n.integrationId===null}),u===`file`&&(0,k.jsx)(cc,{repo:n})]})}function sc({repo:e,onChange:t}){let n=Nr(`/reviews?repository=${e.id}&limit=20`),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=Cr(),c=e.platform===`github`?`pull`:e.platform===`gitlab`?`-/merge_requests`:`pull-requests`,l=e.integrationId===null;return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[l&&(0,k.jsx)(qs,{repo:e,onChange:t}),(0,k.jsx)(ri,{repositoryId:e.id}),!l&&(0,k.jsx)(P,{eyebrow:`Manual`,title:`Review a pull request`,children:(0,k.jsxs)(`form`,{className:`flex gap-2`,onSubmit:async t=>{t.preventDefault(),o(!0);try{let t=/^\d+$/.test(r.trim())?r.trim():void 0;await I(`/reviews`,{method:`POST`,json:{url:t?`https://${e.host}/${e.owner}/${e.name}/${c}/${t}`:r.trim()}}),s(`ok`,`Review queued`),i(``),n.reload()}catch(e){s(`bad`,e.message)}finally{o(!1)}},children:[(0,k.jsx)(`input`,{value:r,onChange:e=>i(e.target.value),placeholder:`Pull request number or URL, e.g. 42`,className:`h-9 flex-1 rounded-lg border border-line-strong bg-panel px-3 font-mono text-[13px] focus:border-iris focus:ring-2 focus:ring-iris/25 focus:outline-none`}),(0,k.jsx)(j,{variant:`primary`,loading:a,disabled:!r.trim(),type:`submit`,children:`Review`})]})}),(0,k.jsx)(P,{eyebrow:`History`,title:`Recent reviews`,padded:!1,children:(0,k.jsx)(ei,{reviews:n.data?.reviews,loading:n.loading,onChange:()=>void n.reload(),hideRepo:!0})})]})}function cc({repo:e}){let t=e.integrationId!==null,n=Nr(t?`/repositories/${e.id}/repo-config`:null),r=Nr(`/repositories/${e.id}/effective-config`),i=(0,v.useMemo)(()=>{if(!r.data)return``;let{learnings:t,...n}=r.data.config;return`# Generated by Argus for ${e.owner}/${e.name}\n${ts(n)}`},[r.data,e]);return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[t&&(0,k.jsx)(P,{eyebrow:`In the repository`,title:n.data?.file??`.argus.yml`,actions:n.data?.file?(0,k.jsx)(F,{tone:`ok`,children:`Found on the default branch`}):(0,k.jsx)(F,{children:`Not present`}),children:n.loading?(0,k.jsx)(ir,{}):n.data?.text?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13px] text-ink-2`,children:`Settings in this file are applied on top of everything configured here, per pull request (the file is read from the PR's head commit).`}),(0,k.jsx)(yr,{children:n.data.text})]}):(0,k.jsx)(`p`,{className:`text-[13.5px] text-ink-2`,children:`The repository has no Argus config file. That's fine: the settings configured in this dashboard apply. Add one to keep review settings in code, or to use Argus from CI.`})}),(0,k.jsxs)(P,{eyebrow:`Export`,title:`Effective settings as .argus.yml`,actions:i&&(0,k.jsx)(br,{text:i,label:`Copy YAML`}),children:[(0,k.jsx)(`p`,{className:`mb-3 text-[13px] text-ink-2`,children:`Everything this repository uses today (global settings plus overrides). Commit it to run the same review from GitHub Actions, GitLab CI, Bitbucket Pipelines or Azure Pipelines.`}),r.loading?(0,k.jsx)(ir,{}):(0,k.jsx)(yr,{className:`max-h-[480px]`,children:i})]})]})}var lc={github:{name:`GitHub`,host:`github.com`,token:`Personal access token`,steps:[`Create a fine-grained token (Settings → Developer settings → Fine-grained tokens) for the repositories Argus should review.`,`Repository permissions: Pull requests — Read and write, Contents — Read, Issues — Read and write, Webhooks — Read and write (only for automatic webhook setup), Metadata — Read.`,`A classic token with the repo scope also works.`],link:`https://github.com/settings/personal-access-tokens/new`},gitlab:{name:`GitLab`,host:`gitlab.com`,token:`Access token`,steps:[`Create a personal access token with the api scope (User settings → Access tokens). Use a dedicated bot user if you can.`,`On self-managed GitLab (or GitLab.com Premium) a project or group access token with the api scope and Developer role also works.`,`For self-managed GitLab, set the host below to your instance, e.g. gitlab.example.com.`],link:`https://gitlab.com/-/user_settings/personal_access_tokens`},bitbucket:{name:`Bitbucket`,host:`bitbucket.org`,token:`Access token or API token`,steps:[`Recommended: a repository access token (Repository settings → Access tokens) with Pull requests: Write, Repositories: Read and Webhooks: Read and write. Leave the username empty.`,`Alternatively an Atlassian API token with Bitbucket scopes: enter your Atlassian email as the username.`,`Repository tokens cannot list repositories, so add repositories by URL.`],link:`https://support.atlassian.com/bitbucket-cloud/docs/create-a-repository-access-token/`},azure:{name:`Azure DevOps`,host:`dev.azure.com`,token:`Personal access token`,steps:[`Create a personal access token (User settings → Personal access tokens) with Code: Read & write, Pull Request Threads: Read & write and Service Hooks: Read, write & manage (so Argus can install the service hooks). Use a dedicated account if you can.`,`Enter your organization name (the part after dev.azure.com/).`,`Argus installs the Service Hooks (Pull request created, updated, commented on) for automatic reviews. Without the Service Hooks scope, add them by hand: they post to the webhook URL with basic authentication, any username and the webhook secret as the password.`],link:`https://learn.microsoft.com/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate`},"bitbucket-server":{name:`Bitbucket Server`,host:``,token:`HTTP access token`,steps:[`Create an HTTP access token for a project or repository (Settings → HTTP access tokens), or a personal one on a service account. Repository admin lets Argus install the webhook and check who may use chat commands; with write only, add the webhook by hand and only pull request authors can use chat commands.`,`Enter the server host, for example bitbucket.acme.com.`,`Argus installs the repository webhook (Pull request opened, Source branch updated, Comment added) for automatic reviews when the token allows it.`],link:`https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html`}},uc={azure:{where:`Project settings → Service hooks → Create subscription → Web Hooks`,events:`One subscription each for: Pull request created, Pull request updated, Pull request commented on`,auth:`Basic authentication: any username, and the webhook secret as the password`},"bitbucket-server":{where:`Repository settings → Webhooks → Create webhook`,events:`Pull request: Opened, Source branch updated, Modified; Comment: Added`,auth:`Paste the webhook secret into the Secret field`}};function dc({repo:e,integration:t,reason:n,onClose:r}){let i=uc[e.platform],a=zr(`admin`),[o,s]=(0,v.useState)(),c=Cr();return(0,k.jsx)(_r,{open:!0,onClose:r,title:`Set up the webhook for ${e.owner}/${e.name}`,children:(0,k.jsxs)(`div`,{className:`space-y-4 text-[13.5px] text-ink-2`,children:[n&&(0,k.jsx)(`p`,{className:`rounded-lg border border-minor/40 bg-minor/5 px-3 py-2 text-[12.5px]`,children:n}),(0,k.jsxs)(`p`,{children:[`Argus can't install this webhook automatically. Add it in `,lc[e.platform].name,`:`]}),i&&(0,k.jsxs)(`ol`,{className:`list-decimal space-y-1 pl-5`,children:[(0,k.jsx)(`li`,{children:i.where}),(0,k.jsx)(`li`,{children:i.events}),(0,k.jsx)(`li`,{children:i.auth})]}),(0,k.jsx)(N,{label:`Webhook URL`,children:t?.webhookUrl?(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(yr,{className:`flex-1`,children:t.webhookUrl}),(0,k.jsx)(br,{text:t.webhookUrl})]}):(0,k.jsx)(F,{tone:`warn`,children:`Set the public URL under Server & CI first`})}),(0,k.jsx)(N,{label:`Webhook secret`,children:o?(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(yr,{className:`flex-1`,children:o}),(0,k.jsx)(br,{text:o})]}):a&&t?(0,k.jsx)(j,{size:`sm`,onClick:async()=>{try{s((await I(`/integrations/${t.id}/webhook-secret`)).secret)}catch(e){c(`bad`,e.message)}},children:`Reveal secret`}):(0,k.jsx)(`span`,{className:`text-[12.5px] text-ink-3`,children:`Ask an admin for this connection's webhook secret.`})})]})})}function fc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(),[p,m]=(0,v.useState)(),h=Cr(),g=async()=>{f(`create`),m(void 0);try{let e=new URLSearchParams;t.trim()&&e.set(`org`,t.trim()),r.trim()&&e.set(`name`,r.trim());let{action:n,manifest:i,webhooks:a}=await I(`/github-app/manifest?${e}`);a||h(`info`,`No public URL is set, so the app is created without webhooks; set one under Server & CI for automatic reviews`);let o=document.createElement(`form`);o.method=`post`,o.action=n;let s=document.createElement(`input`);s.type=`hidden`,s.name=`manifest`,s.value=JSON.stringify(i),o.appendChild(s),document.body.appendChild(o),o.submit()}catch(e){m(e.message),f(void 0)}},_=async()=>{f(`existing`),m(void 0);try{await I(`/integrations/github-app`,{method:`POST`,json:{appId:a.trim(),privateKey:s,...l.trim()?{installationId:l.trim()}:{}}}),h(`ok`,`GitHub App connected`),e()}catch(e){m(e.message)}finally{f(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-[16px]`,children:`Create a new GitHub App`}),(0,k.jsx)(`p`,{className:`mt-1 text-[13px] text-ink-2`,children:`One click on GitHub creates a private app with exactly the permissions Argus needs (pull requests and issues: write, contents: read). Argus receives its key automatically, then you pick the repositories to install it on. Comments appear as the app’s bot and tokens rotate every hour.`}),(0,k.jsxs)(`div`,{className:`mt-3 grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Organization (optional)`,hint:`Leave empty to create it under your personal account.`,children:(0,k.jsx)(M,{value:t,onChange:e=>n(e.target.value),placeholder:`acme`,className:`font-mono`})}),(0,k.jsx)(N,{label:`App name (optional)`,hint:`Must be unique on GitHub.`,children:(0,k.jsx)(M,{value:r,onChange:e=>i(e.target.value),placeholder:`Argus for acme`})})]}),(0,k.jsx)(j,{className:`mt-3`,variant:`primary`,loading:d===`create`,onClick:()=>void g(),children:`Create on GitHub ↗`})]}),(0,k.jsxs)(`details`,{className:`rounded-xl border border-line px-4 py-3`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-[13.5px] font-medium text-ink`,children:`Use an existing GitHub App`}),(0,k.jsxs)(`div`,{className:`mt-3 space-y-3`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`App ID`,children:(0,k.jsx)(M,{value:a,onChange:e=>o(e.target.value),className:`font-mono`})}),(0,k.jsx)(N,{label:`Installation ID (optional)`,hint:`Found automatically from each repository when empty.`,children:(0,k.jsx)(M,{value:l,onChange:e=>u(e.target.value),className:`font-mono`})})]}),(0,k.jsx)(N,{label:`Private key (.pem)`,children:(0,k.jsx)(or,{rows:5,value:s,onChange:e=>c(e.target.value),className:`font-mono text-[11.5px]`,placeholder:`-----BEGIN RSA PRIVATE KEY-----`})}),(0,k.jsx)(j,{loading:d===`existing`,disabled:!a.trim()||!s.includes(`PRIVATE KEY`),onClick:()=>void _(),children:`Connect app`})]})]}),p&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:p})]})}function pc({platform:e,onClose:t,onDone:n}){let r=lc[e],[i,a]=(0,v.useState)(e===`github`?`app`:`token`),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(r.host),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(),y=Cr(),b=async()=>{h(!0),_(void 0);try{let t={platform:e,token:o.trim(),host:u.trim()||r.host};f.trim()&&(t.name=f.trim()),c.trim()&&(t.username=c.trim());let i=await I(`/integrations`,{method:`POST`,json:t});y(`ok`,i.message),n()}catch(e){_(e.message)}finally{h(!1)}};return(0,k.jsxs)(_r,{open:!0,onClose:t,title:`Connect ${r.name}`,footer:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(j,{variant:`ghost`,onClick:t,children:`Cancel`}),i===`token`&&(0,k.jsx)(j,{variant:`primary`,loading:m,disabled:o.trim().length<8,onClick:()=>void b(),children:`Connect`})]}),children:[e===`github`&&(0,k.jsx)(`div`,{className:`mb-5`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[{value:`app`,label:`GitHub App (recommended)`},{value:`token`,label:`Personal access token`}]})}),i===`app`?(0,k.jsx)(fc,{onDone:n}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`ol`,{className:`mb-5 list-decimal space-y-1.5 pl-5 text-[13px] text-ink-2`,children:r.steps.map(e=>(0,k.jsx)(`li`,{children:e},e))}),(0,k.jsxs)(`a`,{href:r.link,target:`_blank`,rel:`noreferrer`,className:`mb-5 inline-block text-[13px] text-iris underline underline-offset-4`,children:[`Open `,r.name,` token settings ↗`]}),(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsx)(N,{label:r.token,children:(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),className:`font-mono`})}),e===`azure`&&(0,k.jsx)(N,{label:`Organization`,hint:`dev.azure.com/<organization>`,children:(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),placeholder:`acme`,className:`font-mono`})}),(e===`bitbucket`||e===`bitbucket-server`)&&(0,k.jsx)(N,{label:`Username or email (optional)`,hint:`Only for Atlassian API tokens. Leave empty for access tokens.`,children:(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value)})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Host`,hint:e===`bitbucket`?`Use Bitbucket Server for self-hosted instances.`:e===`bitbucket-server`?`Your Bitbucket Server or Data Center host.`:`Change for self-hosted instances.`,children:(0,k.jsx)(M,{value:u,onChange:e=>d(e.target.value),disabled:e===`bitbucket`||e===`azure`,placeholder:e===`bitbucket-server`?`bitbucket.acme.com`:``,className:`font-mono`})}),(0,k.jsx)(N,{label:`Display name (optional)`,children:(0,k.jsx)(M,{value:f,onChange:e=>p(e.target.value),placeholder:`${r.name} (${u})`})})]}),g&&(0,k.jsx)(`p`,{className:`rounded-lg border border-critical/40 bg-critical/5 px-3 py-2 text-[13px] text-critical`,children:g})]})]})]})}function mc(e){return e>0?[`connection`,`ci`]:[`ci`,`connection`]}function hc({integrations:e,onClose:t,onDone:n}){let r=mc(e.length),[i,a]=(0,v.useState)(r[0]),[o,s]=(0,v.useState)();return o?(0,k.jsx)(_r,{open:!0,onClose:n,title:`Connect ${o.repository.owner}/${o.repository.name} to CI`,wide:!0,footer:(0,k.jsx)(j,{variant:`primary`,onClick:n,children:`Done`}),children:(0,k.jsx)(Gs,{repo:o.repository,token:o.token})}):(0,k.jsxs)(_r,{open:!0,onClose:t,title:`Add a repository`,wide:!0,children:[r.length>1&&(0,k.jsx)(`div`,{className:`mb-5`,children:(0,k.jsx)(gr,{value:i,onChange:a,options:[{value:`connection`,label:`From a connection`},{value:`ci`,label:`Reviewed in CI`}]})}),i===`ci`?(0,k.jsx)(Ks,{onAdded:(e,t)=>s({repository:e,token:t})}):e.length===0?(0,k.jsx)(vr,{title:`No code host connected`,children:`Connect a code host first, or add the repository as reviewed in CI.`}):(0,k.jsx)(gc,{integrations:e,onDone:n})]})}function gc({integrations:e,onDone:t}){let[n,r]=(0,v.useState)(e[0]?.id??0),i=e.find(e=>e.id===n),a=Nr(i?`/integrations/${i.id}/remote-repositories`:null,[n]),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(),m=Cr(),h=(0,v.useMemo)(()=>(a.data?.repositories??[]).filter(e=>e.fullName.toLowerCase().includes(o.toLowerCase())).slice(0,60),[a.data,o]),g=async(e,r)=>{p(r);try{let r=await I(`/repositories`,{method:`POST`,json:{integrationId:n,installWebhook:u,...e}});m(r.webhook&&!r.webhook.ok?`bad`:`ok`,r.webhook?.message??`Repository added`),t()}catch(e){m(`bad`,e.message)}finally{p(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-4`,children:[(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Connection`,children:(0,k.jsx)(sr,{value:n,onChange:e=>r(Number(e.target.value)),children:e.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.name},e.id))})}),(0,k.jsx)(`div`,{className:`flex items-end pb-1.5`,children:(0,k.jsxs)(`label`,{className:`flex items-center gap-2.5 text-[13px] text-ink-2`,children:[(0,k.jsx)(cr,{checked:u,onChange:d,label:`Install webhook`}),`Install the webhook automatically`]})})]}),(0,k.jsx)(N,{label:`Repository URL`,hint:`Works for every platform, including repositories the token cannot list.`,children:(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(M,{value:c,onChange:e=>l(e.target.value),placeholder:`https://${i?.host??`github.com`}/owner/repo`,className:`font-mono`}),(0,k.jsx)(j,{variant:`primary`,disabled:!c.trim(),loading:f===`url`,onClick:()=>void g({url:c.trim()},`url`),children:`Add`})]})}),(0,k.jsx)(`div`,{className:`eyebrow pt-2`,children:`or pick from your repositories`}),(0,k.jsx)(M,{placeholder:`Search`,value:o,onChange:e=>s(e.target.value)}),(0,k.jsx)(`div`,{className:`max-h-80 overflow-y-auto rounded-xl border border-line scrollbar-thin`,children:a.loading?(0,k.jsx)(`div`,{className:`flex justify-center p-6 text-ink-3`,children:(0,k.jsx)(ir,{})}):a.error?(0,k.jsx)(`p`,{className:`p-4 text-[13px] text-ink-3`,children:a.error}):h.length===0?(0,k.jsx)(`p`,{className:`p-4 text-[13px] text-ink-3`,children:`No repositories found.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-line`,children:h.map(e=>(0,k.jsxs)(`li`,{className:`flex items-center justify-between gap-3 px-4 py-2.5`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[13px]`,children:[e.fullName,` `,e.private&&(0,k.jsx)(F,{children:`private`})]}),(0,k.jsx)(j,{size:`sm`,loading:f===e.fullName,onClick:()=>void g({owner:e.owner,name:e.name},e.fullName),children:`Add`})]},e.fullName))})})]})}function _c(){let e=Nr(`/integrations`),t=Cr();(0,v.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`installed`);e!==null&&(t(`ok`,`GitHub App installed; ${e} repositor${e===`1`?`y`:`ies`} added`),window.history.replaceState(null,``,window.location.pathname))},[t]);let n=Nr(`/repositories`),[r,i]=(0,v.useState)(),[a,o]=(0,v.useState)(!1),[s,c]=(0,v.useState)(),[l,u]=(0,v.useState)(),d=Cr(),f=zr(`admin`),p=zr(`maintainer`),m=e.data?.integrations??[],h=async e=>{let t=!!uc[e.platform];c(`hook-${e.id}`);try{let n=await I(`/repositories/${e.id}/webhook`,{method:`POST`});!n.ok&&t?u({repo:e,reason:n.message}):d(n.ok?`ok`:`bad`,n.message)}catch(n){t?u({repo:e,reason:n.message}):d(`bad`,n.message)}finally{c(void 0)}},g=async(e,t)=>{c(e);try{await t()}catch(e){d(`bad`,e.message)}finally{c(void 0)}};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Code hosts`,title:`Repositories`,description:`Connect GitHub, GitLab, Bitbucket or Azure DevOps and choose which repositories Argus watches, or add repositories reviewed in their own CI. Each repository can override any setting.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Connections`,title:`Code hosts`,padded:!1,children:[(0,k.jsx)(`div`,{className:`grid gap-3 p-5 md:grid-cols-3`,children:[`github`,`gitlab`,`bitbucket`,`azure`,`bitbucket-server`].map(e=>(0,k.jsxs)(`button`,{onClick:()=>i(e),disabled:!f,title:f?void 0:`Only admins can connect code hosts`,className:`group flex items-center gap-3 rounded-xl border border-dashed border-line-strong px-4 py-3.5 text-left transition-colors hover:border-iris hover:bg-iris-soft/40 disabled:pointer-events-none disabled:opacity-60`,children:[(0,k.jsx)(`span`,{className:`text-ink-2 group-hover:text-ink`,children:(0,k.jsx)(Tr,{platform:e,size:22})}),(0,k.jsxs)(`span`,{children:[(0,k.jsxs)(`span`,{className:`block font-medium`,children:[`Connect `,lc[e].name]}),(0,k.jsxs)(`span`,{className:`text-[12px] text-ink-3`,children:[m.filter(t=>t.platform===e).length,` connected`]})]})]},e))}),m.length>0&&(0,k.jsx)(`ul`,{className:`divide-y divide-line border-t border-line`,children:m.map(t=>(0,k.jsxs)(`li`,{className:`flex flex-wrap items-center gap-4 px-5 py-3.5`,children:[(0,k.jsx)(Tr,{platform:t.platform,size:18}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:t.name}),(0,k.jsxs)(`div`,{className:`font-mono text-[12px] text-ink-3`,children:[t.host,t.username?` · ${t.username}`:``,` · added `,wr(t.createdAt)]})]}),f&&(0,k.jsxs)(k.Fragment,{children:[t.auth===`app`&&t.appSlug&&(0,k.jsx)(`a`,{href:`/api/github-app/install?integration=${t.id}`,className:`text-[13px] text-ink-2 underline-offset-2 hover:underline`,children:`Install on another account`}),(0,k.jsx)(j,{size:`sm`,variant:`ghost`,loading:s===`test-${t.id}`,onClick:()=>void g(`test-${t.id}`,async()=>{let e=await I(`/integrations/${t.id}/test`,{method:`POST`});d(e.ok?`ok`:`bad`,e.message)}),children:`Test`}),(0,k.jsx)(j,{size:`sm`,variant:`ghost`,onClick:()=>void g(`del-${t.id}`,async()=>{window.confirm(`Remove ${t.name} and its ${n.data?.repositories.filter(e=>e.integrationId===t.id).length??0} repositories from Argus?`)&&(await I(`/integrations/${t.id}`,{method:`DELETE`}),await Promise.all([e.reload(),n.reload()]))}),children:`Remove`})]})]},t.id))})]}),(0,k.jsx)(P,{eyebrow:`${n.data?.repositories.filter(e=>e.enabled).length??0} active`,title:`Watched repositories`,actions:f&&(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:e.loading&&!e.data,onClick:()=>o(!0),children:`Add repository`}),padded:!1,children:n.loading&&!n.data?(0,k.jsx)(`div`,{className:`flex justify-center p-10 text-ink-3`,children:(0,k.jsx)(ir,{})}):(n.data?.repositories.length??0)===0?(0,k.jsx)(vr,{title:`No repositories yet`,children:m.length?`Add a repository to start reviewing its pull requests.`:`Connect a code host, or add a repository reviewed in its own CI.`}):(0,k.jsx)(`ul`,{className:`divide-y divide-line`,children:n.data.repositories.map(e=>{let t=Object.keys(e.config??{}).length;return(0,k.jsxs)(`li`,{className:A(`flex flex-wrap items-center gap-4 px-5 py-3.5`,!e.enabled&&`opacity-60`),children:[(0,k.jsx)(cr,{checked:e.enabled,disabled:!p,label:`Enable ${e.owner}/${e.name}`,onChange:t=>void g(`toggle-${e.id}`,async()=>{await I(`/repositories/${e.id}`,{method:`PUT`,json:{enabled:t}}),await n.reload()})}),(0,k.jsx)(Tr,{platform:e.platform}),(0,k.jsxs)(Vn,{to:`/repositories/${e.id}`,className:`min-w-0 flex-1 hover:text-iris`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-[13.5px]`,children:[e.owner,`/`,(0,k.jsx)(`span`,{className:`font-semibold`,children:e.name})]}),e.integrationId===null?(0,k.jsx)(F,{className:`ml-2`,children:`CI`}):(0,k.jsx)(`span`,{className:`ml-2 text-[12px] text-ink-3`,children:e.integrationName})]}),t>0&&(0,k.jsxs)(F,{tone:`iris`,children:[t,` override`,t>1?`s`:``]}),p&&e.integrationId!==null&&(0,k.jsx)(j,{size:`sm`,variant:`ghost`,loading:s===`hook-${e.id}`,onClick:()=>void h(e),children:`Install webhook`}),(0,k.jsx)(Vn,{to:`/repositories/${e.id}`,children:(0,k.jsx)(j,{size:`sm`,children:`Configure`})})]},e.id)})})})]}),r&&(0,k.jsx)(pc,{platform:r,onClose:()=>i(void 0),onDone:()=>{i(void 0),e.reload()}}),l&&(0,k.jsx)(dc,{repo:l.repo,integration:m.find(e=>e.id===l.repo.integrationId),reason:l.reason,onClose:()=>u(void 0)}),a&&(0,k.jsx)(hc,{integrations:m,onClose:()=>o(!1),onDone:()=>{o(!1),n.reload()}})]})}function vc(){let[e,t]=(0,v.useState)(``),n=zr(`maintainer`),r=Nr(`/reviews?limit=100${e?`&status=${e}`:``}`,[e]);return Pr(t=>{r.setData(n=>{if(!n)return n;let r=!e||t.status===e;return n.reviews.some(e=>e.id===t.id)?r?{reviews:n.reviews.map(e=>e.id===t.id?{...e,...t}:e)}:{reviews:n.reviews.filter(e=>e.id!==t.id)}:r?{reviews:[t,...n.reviews]}:n})},()=>void r.reload()),(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Overview`,title:`Reviews`,description:`Every review Argus has run, live.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[n&&(0,k.jsx)(P,{eyebrow:`Manual`,title:`Review a pull request`,children:(0,k.jsx)(Qr,{})}),(0,k.jsx)(P,{title:`History`,actions:(0,k.jsx)(gr,{value:e,onChange:t,options:[{value:``,label:`All`},{value:`running`,label:`Running`},{value:`done`,label:`Done`},{value:`failed`,label:`Failed`},{value:`skipped`,label:`Skipped`}]}),padded:!1,children:(0,k.jsx)(ei,{reviews:r.data?.reviews,loading:r.loading,onChange:()=>void r.reload()})})]})]})}function yc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Review brain`,title:`Rules`,description:`Your team's conventions as enforceable checks. Each rule can target paths and carries its own severity. Repositories can add or override rules.`}),(0,k.jsx)(os,{})]})}function bc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Triggers & chat`,description:`When Argus reviews on its own, and how it talks with your team in pull requests.`}),(0,k.jsx)(Qs,{})]})}function xc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Depth & analysis`,description:`Codebase exploration, multi-pass voting and static analysis: the stages that make findings precise. Repositories can override any of this.`}),(0,k.jsx)(ic,{})]})}function Sc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Files & context`,description:`Which files get reviewed and how much surrounding code the reviewer reads.`}),(0,k.jsx)($s,{})]})}var Cc={openrouter:`OpenRouter`,anthropic:`Anthropic API`,openai:`OpenAI API`,"openai-compatible":`OpenAI-compatible`,"claude-code":`Claude subscription (Claude Code)`,codex:`ChatGPT subscription (Codex)`,copilot:`GitHub Copilot`},wc={openrouter:`One key for hundreds of models. Model ids look like anthropic/claude-sonnet-5.5.`,anthropic:`Direct Anthropic API with prompt caching. Model ids look like claude-sonnet-5-5.`,openai:`Direct OpenAI API.`,"openai-compatible":`Any endpoint that speaks the OpenAI chat API: Ollama, vLLM, LM Studio, Azure, a company gateway.`,"claude-code":`Uses the Claude Code CLI logged in with your Claude Pro or Max plan. No API key needed.`,codex:`Uses the Codex CLI logged in with your ChatGPT plan. No API key needed.`,copilot:`Uses your Copilot subscription through the Copilot CLI`},Tc=[{key:`review`,title:`Review`,text:`Finds defects. Use your strongest model here.`,inherit:``},{key:`light`,title:`Triage & trivial files`,text:`Classifies small changes and reviews the ones with no behavioural impact (copy, formatting, version bumps). A fast, cheap model such as Haiku.`,inherit:`Off (same as review)`},{key:`verify`,title:`Verification`,text:`Re-checks every finding. A strong model keeps precision high.`,inherit:`Same as review`},{key:`summary`,title:`Summary`,text:`Writes the walkthrough. A faster model is fine.`,inherit:`Same as review`},{key:`chat`,title:`Chat`,text:`Answers questions and learns from feedback in PR threads.`,inherit:`Same as review`}];function Ec({provider:e,state:t,onChange:n}){let[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(!1),s=Cr(),c=async t=>{o(!0);try{await I(`/providers/${e}/key`,{method:`PUT`,json:{key:t}}),i(``),s(`ok`,t?`${Cc[e]} key saved`:`${Cc[e]} key removed`),n()}catch(e){s(`bad`,e.message)}finally{o(!1)}};return(0,k.jsxs)(`div`,{className:`grid items-center gap-3 py-3.5 md:grid-cols-[220px_1fr_auto]`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`text-[13.5px] font-medium`,children:Cc[e]}),(0,k.jsx)(`div`,{className:`mt-0.5 flex gap-1.5`,children:t?.hasKey?(0,k.jsxs)(F,{tone:`ok`,children:[`Key `,t.hint]}):t?.fromEnv?(0,k.jsx)(F,{tone:`iris`,children:`From environment`}):(0,k.jsx)(F,{children:`Not set`})})]}),(0,k.jsx)(M,{type:`password`,autoComplete:`off`,placeholder:t?.hasKey?`Paste a new key to replace it`:`Paste API key`,value:r,onChange:e=>i(e.target.value),onKeyDown:e=>e.key===`Enter`&&r.trim()&&void c(r.trim())}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!r.trim(),loading:a,onClick:()=>void c(r.trim()),children:`Save`}),t?.hasKey&&(0,k.jsx)(j,{size:`sm`,variant:`ghost`,onClick:()=>void c(null),children:`Remove`})]})]})}function Dc(e,t){let[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)(),[o,s]=(0,v.useState)(!1),c=zr(`admin`);return(0,v.useEffect)(()=>{if(!c)return;let n=!1;s(!0),a(void 0);let i=new URLSearchParams({provider:e});return t&&i.set(`baseUrl`,t),I(`/models?${i}`).then(e=>!n&&r(e.models)).catch(e=>!n&&(r([]),a(e.message))).finally(()=>!n&&s(!1)),()=>{n=!0}},[e,t,c]),{models:n,error:i,loading:o}}function Oc(e){return e===void 0?``:e===0?`free`:`$${e<1?e.toFixed(2):e.toFixed(+(e<10))}`}function kc({provider:e,value:t,onChange:n,baseUrl:r}){let{models:i,error:a,loading:o}=Dc(e,r),s=(0,v.useId)(),c=i.find(e=>e.id===t);return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsx)(M,{list:s,value:t,onChange:e=>n(e.target.value),className:`font-mono`,placeholder:`model id`}),o&&(0,k.jsx)(`span`,{className:`absolute top-2.5 right-3 text-ink-3`,children:(0,k.jsx)(ir,{size:14})})]}),(0,k.jsx)(`datalist`,{id:s,children:i.slice(0,600).map(e=>(0,k.jsx)(`option`,{value:e.id,children:[e.name,e.inputPrice===void 0?``:`${Oc(e.inputPrice)} / ${Oc(e.outputPrice)} per M`,e.description].filter(Boolean).join(` · `)},e.id))}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12px] text-ink-3`,children:a?`Could not load models: ${a}`:c?[c.name,c.contextLength?`${Math.round(c.contextLength/1e3)}k context`:``,c.inputPrice===void 0?``:`${Oc(c.inputPrice)} in / ${Oc(c.outputPrice)} out per million tokens`,c.description].filter(Boolean).join(` · `):i.length?`${i.length} models available — start typing to search`:``})]})}function Ac({stage:e}){let t=Yr(),n=Cr(),r=`models.${e.key}`,i=t.get(r),a=t.get(`models.review`),o=e.key!==`review`&&!i,s=i??a,[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(),[f,p]=(0,v.useState)(``),m=zr(`admin`),h=t.isLocked(r),g=!!(u&&!u.ok&&u.keyRequired),_=e=>{let n={...s,...e};n.provider!==`openai-compatible`&&delete n.baseUrl,t.set(r,n),d(void 0)},y=async()=>{l(!0),d(void 0);try{let e={provider:s.provider,model:s.model};s.baseUrl&&(e.baseUrl=s.baseUrl),s.effort&&(e.effort=s.effort),f.trim()&&(e.apiKey=f.trim()),d(await I(`/models/test`,{method:`POST`,json:e}))}catch(e){n(`bad`,e.message)}finally{l(!1)}};return(0,k.jsxs)(`div`,{className:A(`rounded-xl border p-4`,o?`border-dashed border-line-strong`:`border-line-strong`),children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`font-display text-[17px] font-medium`,children:[e.title,(0,k.jsx)(si,{path:r}),(0,k.jsx)(ci,{path:r})]}),(0,k.jsx)(`div`,{className:`text-[12.5px] text-ink-3`,children:e.text})]}),e.key!==`review`&&!h&&(0,k.jsx)(lr,{label:(0,k.jsx)(`span`,{className:`text-[12.5px] font-normal text-ink-2`,children:e.inherit}),checked:o,onChange:e=>t.set(r,e?void 0:structuredClone(a))})]}),o?(0,k.jsxs)(`p`,{className:`mt-1 font-mono text-[12.5px] text-ink-2`,children:[Cc[a.provider],` · `,a.model]}):(0,k.jsxs)(`div`,{className:A(`mt-3 space-y-4`,h&&`pointer-events-none opacity-60`),"aria-disabled":h||void 0,children:[(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-[260px_1fr]`,children:[(0,k.jsx)(N,{label:`Provider`,children:(0,k.jsx)(sr,{value:s.provider,onChange:e=>_({provider:e.target.value,model:``}),children:t.meta.providers.map(e=>(0,k.jsx)(`option`,{value:e,children:Cc[e]},e))})}),(0,k.jsx)(N,{label:`Model`,children:(0,k.jsx)(kc,{provider:s.provider,value:s.model,onChange:e=>_({model:e}),...s.baseUrl?{baseUrl:s.baseUrl}:{}})})]}),(0,k.jsx)(`p`,{className:`-mt-1 text-[12.5px] text-ink-3`,children:wc[s.provider]}),s.provider===`openrouter`&&(0,k.jsx)(N,{label:`Preferred upstream providers`,hint:`OpenRouter routes in this order (e.g. anthropic, google-vertex). Pinning one provider keeps prompt caching warm. Anthropic models default to anthropic.`,children:(0,k.jsx)(hr,{value:s.providerOrder??[],onChange:e=>_({providerOrder:e.length?e:void 0}),placeholder:`anthropic`})}),s.provider===`openai-compatible`&&(0,k.jsx)(N,{label:`Base URL`,hint:`For example http://localhost:11434/v1 for Ollama.`,children:(0,k.jsx)(M,{value:s.baseUrl??``,onChange:e=>_({baseUrl:e.target.value||void 0}),className:`font-mono`,placeholder:`https://…/v1`})}),(0,k.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-3`,children:[(0,k.jsx)(N,{label:`Reasoning effort`,hint:`Higher thinks longer. Leave empty for the model default.`,children:(0,k.jsxs)(sr,{value:s.effort??``,onChange:e=>_({effort:e.target.value||void 0}),children:[(0,k.jsx)(`option`,{value:``,children:`Model default`}),t.meta.efforts.map(e=>(0,k.jsx)(`option`,{value:e,children:e},e))]})}),(0,k.jsx)(N,{label:`Max output tokens`,children:(0,k.jsx)(M,{type:`number`,min:1e3,max:128e3,step:1e3,value:s.maxOutputTokens,onChange:e=>_({maxOutputTokens:Number(e.target.value)||16e3})})}),(0,k.jsx)(N,{label:`Timeout (seconds)`,children:(0,k.jsx)(M,{type:`number`,min:30,step:30,value:Math.round(s.timeoutMs/1e3),onChange:e=>_({timeoutMs:(Number(e.target.value)||600)*1e3})})})]}),m&&!h&&(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,k.jsx)(j,{size:`sm`,onClick:()=>void y(),loading:c,disabled:!s.model,children:`Test connection`}),u&&(0,k.jsxs)(`span`,{className:A(`text-[13px]`,u.ok?`text-ok`:`text-critical`),children:[u.ok?`✓`:`✕`,` `,u.message,` `,(0,k.jsxs)(`span`,{className:`text-ink-3`,children:[`(`,(u.latencyMs/1e3).toFixed(1),`s)`]})]}),(g||f)&&(0,k.jsxs)(`div`,{className:`flex w-full items-center gap-2`,children:[(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:f,onChange:e=>p(e.target.value),placeholder:`API key for this base URL (used for this test only)`,className:`max-w-sm`}),(0,k.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:`Or save the settings first so the stored key may be used.`})]})]})]})]})}function jc({title:e,status:t,login:n}){return(0,k.jsxs)(`div`,{className:`rounded-xl border border-line-strong p-4`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:e}),t?t.installed?t.loggedIn===void 0?(0,k.jsx)(F,{tone:`neutral`,children:`Login unknown`}):t.loggedIn?(0,k.jsx)(F,{tone:`ok`,children:`Logged in`}):(0,k.jsx)(F,{tone:`warn`,children:`Not logged in`}):(0,k.jsx)(F,{tone:`bad`,children:`Not installed`}):(0,k.jsx)(ir,{size:14})]}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12.5px] text-ink-3`,children:t?.detail}),t?.version&&(0,k.jsx)(`p`,{className:`mt-1 font-mono text-[11.5px] text-ink-3`,children:t.version}),t&&t.loggedIn!==!0&&(0,k.jsx)(`p`,{className:`mt-2 font-mono text-[12px] text-ink-2`,children:n})]})}function Mc(){let e=Yr(),t=Nr(`/providers`);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Models & providers`,description:`Connect an API, or use your Claude, ChatGPT or GitHub Copilot subscription through their official command-line tools. Pick a model for each stage of the review.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Pipeline`,title:`Models per stage`,children:[e.isLocked(`models`)&&(0,k.jsxs)(`p`,{className:`mb-3 rounded-lg border border-line px-3 py-2 text-[12.5px] text-ink-3`,children:[`The models decide what runs on this server. `,e.lockNote,`.`]}),(0,k.jsx)(`div`,{className:`space-y-3`,children:Tc.map(e=>(0,k.jsx)(Ac,{stage:e},e.key))})]}),(0,k.jsx)(P,{eyebrow:`Credentials`,title:`API keys`,actions:(0,k.jsx)(`span`,{className:`text-[12px] text-ink-3`,children:`Encrypted at rest. Never shown again.`}),children:(0,k.jsx)(`div`,{className:`divide-y divide-line`,children:[`openrouter`,`anthropic`,`openai`,`openai-compatible`].map(e=>(0,k.jsx)(Ec,{provider:e,state:t.data?.keys[e],onChange:()=>void t.reload()},e))})}),(0,k.jsxs)(P,{eyebrow:`Subscriptions`,title:`Claude, ChatGPT and Copilot plans`,children:[(0,k.jsx)(`p`,{className:`mb-4 text-[13.5px] text-ink-2`,children:`Argus runs the official CLIs on this machine, so reviews use your plan's limits instead of API billing. Log in once in a terminal; the server picks it up.`}),(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(jc,{title:`Claude Code`,status:t.data?.cli[`claude-code`],login:`claude # then /login with your Claude account`}),(0,k.jsx)(jc,{title:`Codex`,status:t.data?.cli.codex,login:`codex login`}),(0,k.jsx)(jc,{title:`GitHub Copilot`,status:t.data?.cli.copilot,login:`copilot login`})]})]})]})]})}function Nc(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Review behaviour`,description:`How strict Argus is, what it looks for, and how it reports. Repositories can override any of this.`}),(0,k.jsx)(Xs,{})]})}function Pc(){let e=Nr(`/trackers`),t=Cr(),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)();(0,v.useEffect)(()=>{e.data?.jira&&(r(e.data.jira.baseUrl),a(e.data.jira.email))},[e.data]);let f=async(n,r,i)=>{d(r);try{await I(`/trackers`,{method:`PUT`,json:n}),t(`ok`,i),s(``),l(``),await e.reload()}catch(e){t(`bad`,e.message)}finally{d(void 0)}},p=e.data?.jira,m=e.data?.linear;return(0,k.jsxs)(P,{eyebrow:`Issue trackers`,title:`Jira and Linear`,children:[(0,k.jsxs)(`p`,{className:`mb-4 text-[13.5px] text-ink-2`,children:[`GitHub, GitLab and Bitbucket issues are read with the code-host token. Add Jira or Linear so keys like `,(0,k.jsx)(`span`,{className:`font-mono`,children:`PROJ-42`}),` in a pull request pull in the issue text and acceptance criteria. Tokens are encrypted at rest. CLI and CI runs read `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_BASE_URL`}),`,`,` `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_EMAIL`}),`, `,(0,k.jsx)(`span`,{className:`font-mono`,children:`JIRA_API_TOKEN`}),` and `,(0,k.jsx)(`span`,{className:`font-mono`,children:`LINEAR_API_KEY`}),`.`]}),(0,k.jsxs)(`div`,{className:`space-y-5`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`font-display text-[16px]`,children:`Jira Cloud`}),p?(0,k.jsx)(F,{tone:`ok`,children:`Connected`}):(0,k.jsx)(F,{children:`Not set`})]}),(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-3`,children:[(0,k.jsx)(N,{label:`Site URL`,children:(0,k.jsx)(M,{value:n,onChange:e=>r(e.target.value),placeholder:`https://acme.atlassian.net`,className:`font-mono`})}),(0,k.jsx)(N,{label:`Account email`,children:(0,k.jsx)(M,{value:i,onChange:e=>a(e.target.value),placeholder:`you@acme.com`})}),(0,k.jsx)(N,{label:`API token`,children:(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:o,onChange:e=>s(e.target.value),placeholder:p?.tokenSet?`•••••• saved`:`id.atlassian.com → API tokens`})})]}),(0,k.jsxs)(`div`,{className:`mt-3 flex gap-2`,children:[(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!n||!i||!o&&!p?.tokenSet,loading:u===`jira`,onClick:()=>void f({jira:{baseUrl:n,email:i,...o?{token:o}:{}}},`jira`,`Jira saved`),children:`Save Jira`}),p&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:u===`jira-rm`,onClick:()=>void f({jira:null},`jira-rm`,`Jira removed`),children:`Remove`})]})]}),(0,k.jsxs)(`div`,{className:`border-t border-line pt-5`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`font-display text-[16px]`,children:`Linear`}),m?(0,k.jsx)(F,{tone:`ok`,children:`Connected`}):(0,k.jsx)(F,{children:`Not set`})]}),(0,k.jsxs)(`div`,{className:`flex max-w-xl gap-2`,children:[(0,k.jsx)(M,{type:`password`,autoComplete:`off`,value:c,onChange:e=>l(e.target.value),placeholder:m?`•••••• saved`:`Personal API key (lin_api_…)`}),(0,k.jsx)(j,{size:`sm`,variant:`primary`,disabled:!c,loading:u===`linear`,onClick:()=>void f({linear:{apiKey:c}},`linear`,`Linear saved`),children:`Save`}),m&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:u===`linear-rm`,onClick:()=>void f({linear:null},`linear-rm`,`Linear removed`),children:`Remove`})]})]})]})]})}function Fc(){let e=Nr(`/server`),t=Nr(`/integrations`),[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(),o=Cr(),s=Nr(`/status`).data?.version??`0.2.2`;(0,v.useEffect)(()=>{e.data&&r(e.data.publicUrl)},[e.data]);let c=async(n,r)=>{a(r);try{let r=await I(`/server`,{method:`PUT`,json:n});e.setData(r),t.reload(),o(`ok`,`Saved`)}catch(e){o(`bad`,e.message)}finally{a(void 0)}};return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Server & CI`,description:`Make Argus reachable for webhooks, or run reviews inside your CI instead.`}),(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsxs)(P,{eyebrow:`Webhooks`,title:`Public URL`,children:[(0,k.jsx)(N,{label:`Address where GitHub, GitLab, Bitbucket and Azure DevOps can reach this server`,hint:`For example https://argus.example.com, or a tunnel such as an ngrok static domain. Webhooks go to <url>/webhooks/<platform>.`,children:(0,k.jsxs)(`div`,{className:`flex max-w-xl gap-2`,children:[(0,k.jsx)(M,{value:n,onChange:e=>r(e.target.value),placeholder:`https://argus.example.com`,className:`font-mono`}),(0,k.jsx)(j,{variant:`primary`,loading:i===`url`,onClick:()=>void c({publicUrl:n},`url`),disabled:n===e.data?.publicUrl,children:`Save`})]})}),t.data&&t.data.integrations.length>0&&(0,k.jsx)(`div`,{className:`mt-5 space-y-2`,children:t.data.integrations.map(e=>(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-4 rounded-lg border border-line px-3 py-2`,children:[(0,k.jsx)(`span`,{className:`text-[13px]`,children:e.name}),e.webhookUrl?(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`code`,{className:`font-mono text-[12px] text-ink-2`,children:e.webhookUrl}),(0,k.jsx)(br,{text:e.webhookUrl})]}):(0,k.jsx)(F,{tone:`warn`,children:`Set the public URL first`})]},e.id))})]}),(0,k.jsx)(Pc,{}),(0,k.jsxs)(P,{eyebrow:`Without a server`,title:`Run Argus in CI or before commits`,children:[(0,k.jsx)(Us,{version:s,withHook:!0}),(0,k.jsxs)(`p`,{className:`mt-3 text-[12.5px] text-ink-3`,children:[`CI runs read settings from a `,(0,k.jsx)(`code`,{className:`font-mono`,children:`.argus.yml`}),` file in the repository; export it from any repository page here. The files install Argus with`,` `,(0,k.jsx)(`code`,{className:`font-mono`,children:`npx argus-review`}),`, which needs the package published to npm or your private registry (see the README); until then, switch on `,(0,k.jsx)(`em`,{children:`Build Argus from source`}),`.`]})]})]})]})}function Ic(){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Summary`,description:`The walkthrough comment Argus keeps up to date on every pull request.`}),(0,k.jsx)(Zs,{})]})}var Lc={viewer:`Sees reviews, findings, repositories and settings`,maintainer:`Also starts, cancels and retries reviews, edits learnings and per-repository settings`,admin:`Also manages integrations, models, keys, global settings and users`};function Rc({me:e,onChanged:t}){let n=Nr(`/users`),r=Cr(),[i,a]=(0,v.useState)(``),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(`maintainer`),[f,p]=(0,v.useState)(),m=n.data?.users??[],h=n.data!==void 0&&m.length===0,g=async(e,i,a)=>{p(e);try{await i(),r(`ok`,a),await n.reload(),t()}catch(e){r(`bad`,e.message)}finally{p(void 0)}};return(0,k.jsxs)(`div`,{className:`space-y-6`,children:[(0,k.jsx)(ur,{eyebrow:`Settings`,title:`Team & access`,description:`Give each person their own sign-in and a role. Once the first admin exists, Argus asks everyone for an email and password; the shared server password stops working.`}),(0,k.jsxs)(P,{eyebrow:h?`Step 1`:`Invite`,title:h?`Create the first admin`:`Add a person`,children:[(0,k.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,k.jsx)(N,{label:`Email`,children:(0,k.jsx)(M,{type:`email`,value:i,onChange:e=>a(e.target.value),placeholder:`dev@acme.com`})}),(0,k.jsx)(N,{label:`Name`,hint:`Optional`,children:(0,k.jsx)(M,{value:o,onChange:e=>s(e.target.value)})}),(0,k.jsx)(N,{label:`Password`,hint:`At least 8 characters; they can be changed later by an admin`,children:(0,k.jsx)(M,{type:`password`,autoComplete:`new-password`,value:c,onChange:e=>l(e.target.value)})}),(0,k.jsx)(N,{label:`Role`,hint:Lc[h?`admin`:u],children:(0,k.jsx)(gr,{value:h?`admin`:u,onChange:e=>!h&&d(e),options:[{value:`viewer`,label:`Viewer`},{value:`maintainer`,label:`Maintainer`},{value:`admin`,label:`Admin`}]})})]}),(0,k.jsx)(`div`,{className:`mt-4`,children:(0,k.jsx)(j,{variant:`primary`,disabled:!i.includes(`@`)||c.length<8,loading:f===`add`,onClick:()=>void g(`add`,async()=>{await I(`/users`,{method:`POST`,json:{email:i,name:o||null,role:h?`admin`:u,password:c}}),a(``),s(``),l(``)},h?`Admin created; you are signed in as them`:`${i} can now sign in`),children:h?`Create admin and require sign-in`:`Add person`})})]}),(0,k.jsx)(P,{eyebrow:`People`,title:`${m.length} ${m.length===1?`person`:`people`}`,padded:!1,children:m.length===0?(0,k.jsx)(`div`,{className:`p-6`,children:(0,k.jsx)(vr,{title:`No users yet`,children:`Anyone who can reach this server can change everything until the first admin is created.`})}):(0,k.jsxs)(`table`,{className:`w-full text-[13.5px]`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`eyebrow border-b border-line text-left`,children:[(0,k.jsx)(`th`,{className:`px-5 py-2.5 font-normal`,children:`Person`}),(0,k.jsx)(`th`,{className:`px-3 py-2.5 font-normal`,children:`Role`}),(0,k.jsx)(`th`,{className:`px-3 py-2.5 font-normal`,children:`Last sign-in`}),(0,k.jsx)(`th`,{className:`px-5 py-2.5`})]})}),(0,k.jsx)(`tbody`,{children:m.map(t=>(0,k.jsxs)(`tr`,{className:`border-b border-line/60 last:border-0`,children:[(0,k.jsxs)(`td`,{className:`px-5 py-3`,children:[(0,k.jsx)(`div`,{className:`font-medium`,children:t.name||t.email}),t.name&&(0,k.jsx)(`div`,{className:`text-[12px] text-ink-3`,children:t.email}),e?.id===t.id&&(0,k.jsx)(F,{tone:`iris`,className:`mt-1`,children:`You`})]}),(0,k.jsx)(`td`,{className:`px-3 py-3`,children:(0,k.jsxs)(sr,{value:t.role,disabled:f===`role-${t.id}`,onChange:e=>void g(`role-${t.id}`,()=>I(`/users/${t.id}`,{method:`PUT`,json:{role:e.target.value}}),`Role changed`),children:[(0,k.jsx)(`option`,{value:`viewer`,children:`Viewer`}),(0,k.jsx)(`option`,{value:`maintainer`,children:`Maintainer`}),(0,k.jsx)(`option`,{value:`admin`,children:`Admin`})]})}),(0,k.jsx)(`td`,{className:`px-3 py-3 text-ink-3`,children:t.lastLoginAt?wr(t.lastLoginAt.replace(` `,`T`)+`Z`):`never`}),(0,k.jsx)(`td`,{className:`px-5 py-3 text-right`,children:e?.id!==t.id&&(0,k.jsx)(j,{size:`sm`,variant:`danger`,loading:f===`rm-${t.id}`,onClick:()=>void g(`rm-${t.id}`,()=>I(`/users/${t.id}`,{method:`DELETE`}),`${t.email} removed`),children:`Remove`})})]},t.id))})]})}),(0,k.jsx)(P,{eyebrow:`Automation`,title:`Create the admin from the environment`,children:(0,k.jsxs)(`p`,{className:`text-[13.5px] text-ink-2`,children:[`For Docker and Kubernetes, set `,(0,k.jsx)(`span`,{className:`font-mono`,children:`ARGUS_ADMIN_EMAIL`}),` and `,(0,k.jsx)(`span`,{className:`font-mono`,children:`ARGUS_ADMIN_PASSWORD`}),`; Argus creates that admin at start-up if it does not exist yet.`]})})]})}var zc=(0,v.lazy)(()=>ne(()=>import(`./ReviewDetail-CFz5C1aT.js`).then(e=>({default:e.ReviewDetail})),[])),Bc=[`/rules`,`/guidelines`,`/settings/models`,`/settings/review`,`/settings/depth`,`/settings/summary`,`/settings/automation`,`/settings/files`];function Vc(){let{meta:e,stored:t,error:n,save:r}=Zr();return n?(0,k.jsxs)(`div`,{className:`rounded-xl border border-critical/40 p-6 text-critical`,children:[`Could not load settings: `,n]}):!e||!t?(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading settings…`]}):(0,k.jsx)(Xr,{base:e.defaults,meta:e,stored:t,onSave:r,scope:`global`,stayOn:Bc,children:(0,k.jsx)($t,{})})}function Hc({onDone:e}){return(0,k.jsx)(`div`,{className:`rings flex min-h-screen items-center justify-center p-6`,children:(0,k.jsxs)(`div`,{className:`w-full max-w-sm animate-rise rounded-2xl border border-line bg-panel p-8 shadow-xl`,children:[(0,k.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,k.jsx)(rr,{size:36}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-2xl font-semibold`,children:`Argus`}),(0,k.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:`Sign in to manage reviews`})]})]}),(0,k.jsx)(Uc,{onDone:e})]})})}function Uc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(),[s,c]=(0,v.useState)(!1);return(0,k.jsxs)(`form`,{onSubmit:async n=>{n.preventDefault(),c(!0),o(void 0);try{await I(`/auth/login`,{method:`POST`,json:{email:t,password:r}}),e()}catch(e){o(e.message)}finally{c(!1)}},children:[(0,k.jsx)(`label`,{htmlFor:`email`,className:`mb-1.5 block text-[13px] font-medium`,children:`Email`}),(0,k.jsx)(M,{id:`email`,type:`email`,autoComplete:`username`,autoFocus:!0,value:t,onChange:e=>n(e.target.value),className:`mb-4`}),(0,k.jsx)(`label`,{htmlFor:`password`,className:`mb-1.5 block text-[13px] font-medium`,children:`Password`}),(0,k.jsx)(M,{id:`password`,type:`password`,autoComplete:`current-password`,value:r,onChange:e=>i(e.target.value)}),a&&(0,k.jsx)(`p`,{className:`mt-2 text-[13px] text-critical`,children:a}),(0,k.jsx)(j,{variant:`primary`,className:`mt-5 w-full`,loading:s,type:`submit`,children:`Sign in`})]})}function Wc({onDone:e}){let[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(),[d,f]=(0,v.useState)(!1);return(0,k.jsx)(`div`,{className:`rings flex min-h-screen items-center justify-center p-6`,children:(0,k.jsxs)(`form`,{className:`w-full max-w-sm animate-rise rounded-2xl border border-line bg-panel p-8 shadow-xl`,onSubmit:async n=>{n.preventDefault(),f(!0),u(void 0);try{await I(`/users`,{method:`POST`,headers:{"X-Argus-Setup-Token":t.trim()},json:{email:r.trim(),name:a.trim()||null,role:`admin`,password:s}}),e()}catch(e){u(e instanceof Ar&&e.status===401?`The setup token is wrong or was already used. Check the server log.`:e.message)}finally{f(!1)}},children:[(0,k.jsxs)(`div`,{className:`mb-6 flex items-center gap-3`,children:[(0,k.jsx)(rr,{size:36}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-display text-2xl font-semibold`,children:`Set up Argus`}),(0,k.jsx)(`div`,{className:`text-[13px] text-ink-3`,children:`Create the first admin`})]})]}),(0,k.jsxs)(`p`,{className:`mb-4 text-[13px] text-ink-2`,children:[`Argus has no users yet. Paste the one-time setup token printed in the server log, or restart Argus with`,` `,(0,k.jsx)(`code`,{className:`font-mono text-[12px]`,children:`ARGUS_ADMIN_EMAIL`}),` and `,(0,k.jsx)(`code`,{className:`font-mono text-[12px]`,children:`ARGUS_ADMIN_PASSWORD`}),`.`]}),(0,k.jsx)(`label`,{htmlFor:`setup-token`,className:`mb-1.5 block text-[13px] font-medium`,children:`Setup token`}),(0,k.jsx)(M,{id:`setup-token`,autoComplete:`off`,autoFocus:!0,value:t,onChange:e=>n(e.target.value),className:`mb-4 font-mono`}),(0,k.jsx)(`label`,{htmlFor:`setup-email`,className:`mb-1.5 block text-[13px] font-medium`,children:`Email`}),(0,k.jsx)(M,{id:`setup-email`,type:`email`,autoComplete:`username`,value:r,onChange:e=>i(e.target.value),className:`mb-4`}),(0,k.jsxs)(`label`,{htmlFor:`setup-name`,className:`mb-1.5 block text-[13px] font-medium`,children:[`Name `,(0,k.jsx)(`span`,{className:`font-normal text-ink-3`,children:`(optional)`})]}),(0,k.jsx)(M,{id:`setup-name`,autoComplete:`name`,value:a,onChange:e=>o(e.target.value),className:`mb-4`}),(0,k.jsx)(`label`,{htmlFor:`setup-password`,className:`mb-1.5 block text-[13px] font-medium`,children:`Password`}),(0,k.jsx)(M,{id:`setup-password`,type:`password`,autoComplete:`new-password`,minLength:8,value:s,onChange:e=>c(e.target.value)}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[12px] text-ink-3`,children:`At least 8 characters.`}),l&&(0,k.jsx)(`p`,{className:`mt-2 text-[13px] text-critical`,children:l}),(0,k.jsx)(j,{variant:`primary`,className:`mt-5 w-full`,loading:d,type:`submit`,disabled:!t.trim()||!r.trim()||s.length<8,children:`Create admin`})]})})}function Gc({path:e,children:t}){let n=(0,v.useContext)(Lr);return!n||!er(e,n.role??`admin`)?(0,k.jsx)(Qt,{to:`/`,replace:!0}):t}function Kc(){let[e,t]=(0,v.useState)(),[n,r]=(0,v.useState)(),[i,a]=(0,v.useState)(!1),o=(0,v.useCallback)(async()=>{a(!0);try{t(await I(`/auth/me`)),r(void 0)}catch(e){if(e instanceof Ar&&e.status===401){let n=!!e.data?.setupRequired;t(n?{authenticated:!1,passwordRequired:!0,mode:`locked`,setupTokenRequired:!0}:{authenticated:!1,passwordRequired:!0}),r(void 0)}else r(e instanceof Ar?e.message:`The Argus server could not be reached.`)}finally{a(!1)}},[]);if((0,v.useEffect)(()=>{o();let e=()=>{t(e=>e&&{...e,authenticated:!1}),o()};return window.addEventListener(`argus:unauthorized`,e),()=>window.removeEventListener(`argus:unauthorized`,e)},[o]),n&&!e)return(0,k.jsxs)(`div`,{className:`flex min-h-screen flex-col items-center justify-center gap-4 p-6 text-center`,children:[(0,k.jsx)(rr,{size:44}),(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`font-medium`,children:`Could not reach Argus`}),(0,k.jsx)(`div`,{className:`mt-1 text-[13px] text-ink-3`,children:n})]}),(0,k.jsx)(j,{variant:`primary`,loading:i,onClick:()=>void o(),children:`Retry`})]});if(!e)return(0,k.jsx)(`div`,{className:`flex min-h-screen items-center justify-center`,children:(0,k.jsx)(rr,{size:44,spin:!0})});let s=async()=>{await I(`/auth/logout`,{method:`POST`}),o()};return(0,k.jsx)(Lr.Provider,{value:e,children:(0,k.jsx)(Sr,{children:!e.authenticated&&(e.mode===`locked`||e.setupTokenRequired)?(0,k.jsx)(Wc,{onDone:()=>void o()}):(0,k.jsx)(Bn,{children:(0,k.jsx)(nn,{children:e.authenticated?(0,k.jsxs)(en,{element:(0,k.jsx)(kr,{auth:e,onLogout:()=>void s()}),children:[(0,k.jsx)(en,{index:!0,element:(0,k.jsx)(oi,{})}),(0,k.jsx)(en,{path:`reviews`,element:(0,k.jsx)(vc,{})}),(0,k.jsx)(en,{path:`reviews/:id`,element:(0,k.jsx)(v.Suspense,{fallback:(0,k.jsxs)(`div`,{className:`flex items-center gap-3 p-10 text-ink-3`,children:[(0,k.jsx)(ir,{}),` Loading review…`]}),children:(0,k.jsx)(zc,{})})}),(0,k.jsx)(en,{path:`repositories`,element:(0,k.jsx)(_c,{})}),(0,k.jsx)(en,{path:`repositories/:id`,element:(0,k.jsx)(oc,{})}),(0,k.jsx)(en,{path:`learnings`,element:(0,k.jsx)(xi,{})}),(0,k.jsxs)(en,{element:(0,k.jsx)(Vc,{}),children:[(0,k.jsx)(en,{path:`rules`,element:(0,k.jsx)(yc,{})}),(0,k.jsx)(en,{path:`guidelines`,element:(0,k.jsx)(gi,{})}),(0,k.jsx)(en,{path:`settings/models`,element:(0,k.jsx)(Mc,{})}),(0,k.jsx)(en,{path:`settings/review`,element:(0,k.jsx)(Nc,{})}),(0,k.jsx)(en,{path:`settings/depth`,element:(0,k.jsx)(xc,{})}),(0,k.jsx)(en,{path:`settings/summary`,element:(0,k.jsx)(Ic,{})}),(0,k.jsx)(en,{path:`settings/automation`,element:(0,k.jsx)(bc,{})}),(0,k.jsx)(en,{path:`settings/files`,element:(0,k.jsx)(Sc,{})})]}),(0,k.jsx)(en,{path:`settings/server`,element:(0,k.jsx)(Gc,{path:`/settings/server`,children:(0,k.jsx)(Fc,{})})}),(0,k.jsx)(en,{path:`settings/users`,element:(0,k.jsx)(Gc,{path:`/settings/users`,children:(0,k.jsx)(Rc,{me:e.user??null,onChanged:()=>void o()})})}),(0,k.jsx)(en,{path:`settings`,element:(0,k.jsx)(Qt,{to:`/settings/models`,replace:!0})}),(0,k.jsx)(en,{path:`*`,element:(0,k.jsx)(Qt,{to:`/`,replace:!0})})]}):(0,k.jsx)(en,{path:`*`,element:(0,k.jsx)(Hc,{onDone:()=>void o()})})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(v.StrictMode,{children:(0,k.jsx)(Kc,{})}));export{o as C,d as S,l as T,wr as _,Pr as a,Vn as b,P as c,ur as d,Tr as f,A as g,mr as h,Nr as i,yr as l,ir as m,zr as n,F as o,fr as p,I as r,j as s,$r as t,vr as u,Cr as v,s as w,At as x,nr as y};
package/web/index.html CHANGED
@@ -13,7 +13,7 @@
13
13
  if (t === 'light' || t === 'dark') document.documentElement.dataset.theme = t
14
14
  } catch {}
15
15
  </script>
16
- <script type="module" crossorigin src="/assets/index-BLp-bx8B.js"></script>
16
+ <script type="module" crossorigin src="/assets/index-EFsso5qt.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-CbU08bTx.css">
18
18
  </head>
19
19
  <body>