performance.mark("js-parse-end:82458-1043a8b96b223959.js"); "use strict";(globalThis.webpackChunk_github_ui_github_ui=globalThis.webpackChunk_github_ui_github_ui||[]).push([["82458"],{72105(e,t,n){n.d(t,{A:()=>i});let i={diff:"Diff-module__diff__rx9XH",diffTargetable:"Diff-module__diffTargetable__pirZi",diffHeaderWrapper:"Diff-module__diffHeaderWrapper__UgUyv",diffAddFileThread:"Diff-module__diffAddFileThread__DCIBJ",diffFooter:"Diff-module__diffFooter__nVNpq"}},83914(e,t,n){n.d(t,{nB:()=>x,pO:()=>_});var i=n(74848),r=n(16522),a=n(23666),l=n(78597),o=n(38621),s=n(59134),d=n(26108),c=n(10095),u=n(49305),m=n(34164),f=n(96540),h=n(23054);let g="CodeownersValidationBanner-module__Flash__TSfKS";var p=n(73537);let b=["CODEOWNERS","/CODEOWNERS"],v="ERROR",C="LOADING";function x(e){let t,n,o,s,d,c,u,m=(0,r.c)(17),{filePath:g,forceRender:x,full:L,refName:S,repo:_}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],m[0]=t):t=m[0];let[w,D]=(0,f.useState)(t),[I,j]=(0,f.useState)(C);m[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,p.G7)("codeowners_validation_in_diff"),m[1]=n):n=m[1];let k=n;m[2]!==g?(o=b.includes(g),m[2]=g,m[3]=o):o=m[3];let A=o,E=x||k&&A,R=(0,f.useRef)(!1);return(m[4]!==g||m[5]!==S||m[6]!==_||m[7]!==E?(s=()=>{!E||R.current||(async()=>{R.current=!0;try{var e,t,n;let i=await (e=_,t={name:S},n=g,(0,l.lS)((0,a.$RX)({owner:e.ownerLogin,repo:e.name,commitish:t.name,filePath:n}),{method:"GET"}));if(i.ok){let e=await i.json();D(e.map(N)),j("VALIDATED")}else j(v)}catch{j(v)}})()},d=[g,S,_,E],m[4]=g,m[5]=S,m[6]=_,m[7]=E,m[8]=s,m[9]=d):(s=m[8],d=m[9]),(0,f.useEffect)(s,d),E)?(m[10]!==L||m[11]!==w||m[12]!==I?(c=(0,i.jsx)(y,{validationErrors:w,validationState:I,full:L}),m[10]=L,m[11]=w,m[12]=I,m[13]=c):c=m[13],m[14]!==c||m[15]!==w?(u=(0,i.jsx)(h.A,{value:w,children:c}),m[14]=c,m[15]=w,m[16]=u):u=m[16],u):null}function y(e){let t,n,a,l,m,h,p,b,x,y,S,N=(0,r.c)(27),{full:_,validationErrors:w,validationState:D}=e,[I,j]=(0,f.useState)(!1),k=(0,f.useRef)(null);if(D===v){let e;return N[0]!==_?(e=(0,i.jsx)(s.A,{variant:"warning",className:g,full:_,children:"Failed to validate this CODEOWNERS file"}),N[0]=_,N[1]=e):e=N[1],e}if(D===C){let e;return N[2]!==_?(e=(0,i.jsx)(s.A,{variant:"default",className:g,full:_,children:"Validating CODEOWNERS rules..."}),N[2]=_,N[3]=e):e=N[3],e}if(0===w.length){let e;return N[4]!==_?(e=(0,i.jsx)(s.A,{variant:"success",className:g,full:_,children:"This CODEOWNERS file is valid."}),N[4]=_,N[5]=e):e=N[5],e}return N[6]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(c.A,{icon:o.BugIcon}),N[6]=t):t=N[6],N[7]!==I?(n=()=>j(!I),N[7]=I,N[8]=n):n=N[8],N[9]===Symbol.for("react.memo_cache_sentinel")?(a=(0,i.jsx)(d.K,{"aria-label":"View CODEOWNERS errors",tooltipDirection:"s",ref:k,size:"small",icon:o.KebabHorizontalIcon,className:"CodeownersValidationBanner-module__IconButton__deECG"}),N[9]=a):a=N[9],N[10]!==n?(l=(0,i.jsxs)("div",{onClick:n,className:"CodeownersValidationBanner-module__Box__gN1J4",children:["This CODEOWNERS file contains errors",a]}),N[10]=n,N[11]=l):l=N[11],N[12]!==_||N[13]!==l?(m=(0,i.jsxs)(s.A,{variant:"warning",className:"CodeownersValidationBanner-module__Flash_1__QF8oV",full:_,children:[t,l]}),N[12]=_,N[13]=l,N[14]=m):m=N[14],N[15]===Symbol.for("react.memo_cache_sentinel")?(h=()=>j(!1),N[15]=h):h=N[15],N[16]===Symbol.for("react.memo_cache_sentinel")?(p=(0,i.jsx)(u.A.Header,{children:"CODEOWNERS errors"}),N[16]=p):p=N[16],N[17]!==w?(b=w.map(L),N[17]=w,N[18]=b):b=N[18],N[19]!==b?(x=(0,i.jsx)("div",{className:"CodeownersValidationBanner-module__Box_1__elFSw",children:b}),N[19]=b,N[20]=x):x=N[20],N[21]!==I||N[22]!==x?(y=(0,i.jsxs)(u.A,{isOpen:I,onDismiss:h,returnFocusRef:k,className:"CodeownersValidationBanner-module__Dialog__t75ku",children:[p,x]}),N[21]=I,N[22]=x,N[23]=y):y=N[23],N[24]!==y||N[25]!==m?(S=(0,i.jsxs)(i.Fragment,{children:[m,y]}),N[24]=y,N[25]=m,N[26]=S):S=N[26],S}function L(e,t){return(0,i.jsx)(S,{error:e},t)}function S(e){let t,n,a,l,o=(0,r.c)(10),{error:s}=e,d=`${s.kind} on line ${s.line}${s.suggestion?`: ${s.suggestion}`:""}`;return o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.$)(g,"CodeownersValidationBanner-module__ErrorCodeBlock__E0i9w"),o[0]=t):t=o[0],o[1]!==s.lineError?(n=(0,i.jsx)("b",{className:"CodeownersValidationBanner-module__Box_3__Xb9rR",children:s.lineError}),o[1]=s.lineError,o[2]=n):n=o[2],o[3]!==s.linePrefix||o[4]!==s.lineSuffix||o[5]!==n?(a=(0,i.jsx)("pre",{className:t,children:(0,i.jsxs)("code",{children:[s.linePrefix,n,s.lineSuffix]})}),o[3]=s.linePrefix,o[4]=s.lineSuffix,o[5]=n,o[6]=a):a=o[6],o[7]!==d||o[8]!==a?(l=(0,i.jsxs)("div",{className:"CodeownersValidationBanner-module__Box_2__Y4FaM",children:[d,a]}),o[7]=d,o[8]=a,o[9]=l):l=o[9],l}function N(e){var t,n,i;let r=e.source.trim(),a=e.column-1,l=(t=a,n=e.end_column,i=r,n||(i.substring(t).indexOf(" ")>0?i.indexOf(" ",t):i.length));if(a>30){let e=a-30;r="\u2026"+r.slice(e),a-=e-1,l-=e-1}return{...e,linePrefix:r.substring(0,a),lineError:r.substring(a,l),lineSuffix:r.substring(l)}}function _(){let e,t=(0,r.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)(c.A,{icon:o.DotFillIcon,"aria-label":"This line contains CODEOWNERS errors",className:"CodeownersValidationBanner-module__Octicon__Hyamu"}),t[0]=e):e=t[0],e}x.displayName="CodeownersValidationBanner",y.displayName="CodeownersValidationBannerInner",S.displayName="CodeownersErrorDetails",_.displayName="CodeownersErrorLineIndicator"},23054(e,t,n){n.d(t,{A:()=>a,v:()=>l});var i=n(96540);let r=(0,i.createContext)([]);r.displayName="SplitCodeownersErrorsContext";let a=r;function l(){return(0,i.use)(r)}},2827(e,t,n){n.d(t,{YH:()=>x,Vv:()=>_,Gt:()=>C});var i=n(74848),r=n(16522),a=n(206),l=n(16497),o=n(38621),s=n(26108),d=n(36007),c=n(39775),u=n(21373),m=n(34164),f=n(80655);let h="Annotation-module__inlineReviewThreadHeading__Ic9N2";var g=n(64714),p=n(96540),b=n(35205),v=n(26316);let C={[f.UZ.Failure]:(0,i.jsx)(o.StopIcon,{className:"fgColor-danger mr-2"}),[f.UZ.Warning]:(0,i.jsx)(o.AlertIcon,{className:"fgColor-attention mr-2"}),[f.UZ.Notice]:(0,i.jsx)(o.InfoIcon,{className:"fgColor-muted mr-2"})};function x(e){let t,n,f,h,p,b,v,C=(0,r.c)(31),{annotation:x,inSidePanel:y}=e,N=y?"h3":"h2",{isCollapsed:w,handleToggleCollapsed:D}=_(x),I=g.GF[x.annotationLevel];return C[0]!==I.borderColor?(t=(0,m.$)("p-1 bgColor-default",I.borderColor,"Annotation-module__annotation__SSvB_"),C[0]=I.borderColor,C[1]=t):t=C[1],C[2]!==D||C[3]!==y||C[4]!==w?(n=!y&&(0,i.jsx)(s.K,{"aria-label":w?"Expand annotation":"Collapse annotation",icon:w?o.ChevronRightIcon:o.ChevronDownIcon,size:"small",variant:"invisible",onClick:D}),C[2]=D,C[3]=y,C[4]=w,C[5]=n):n=C[5],C[6]!==x||C[7]!==y?(f=!y&&(0,i.jsx)(L,{annotation:x}),C[6]=x,C[7]=y,C[8]=f):f=C[8],C[9]!==x||C[10]!==y?(h=y&&(0,i.jsx)(S,{annotation:x}),C[9]=x,C[10]=y,C[11]=h):h=C[11],C[12]!==n||C[13]!==f||C[14]!==h?(p=(0,i.jsxs)("div",{className:"d-flex flex-items-center",children:[n,f,h]}),C[12]=n,C[13]=f,C[14]=h,C[15]=p):p=C[15],C[16]!==N||C[17]!==x.annotationLevel||C[18]!==x.appAvatarAltText||C[19]!==x.appAvatarUrl||C[20]!==x.checkRun||C[21]!==x.checkSuiteName||C[22]!==x.message||C[23]!==x.title||C[24]!==y||C[25]!==w?(b=(!w||y)&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"tmp-ml-4 mt-2",children:x.title&&(0,i.jsx)(d.A,{weight:"semibold",size:"medium",className:g.GF[x.annotationLevel].primaryColorClass,children:x.title})}),(0,i.jsxs)(N,{className:"sr-only",children:[g.GF[x.annotationLevel].ariaLabel,": ",x.title]}),(0,i.jsx)("div",{className:"tmp-mb-3 mt-1 tmp-ml-4",children:x.message&&(0,i.jsx)(l.$6,{html:x.message,className:"Annotation-module__annotationMessage__lcAsr"})}),(0,i.jsxs)("div",{className:"d-flex flex-items-center flex-justify-between tmp-ml-4 pr-2 pb-2",children:[(0,i.jsxs)("div",{className:"Annotation-module__annotationSource__GJ9Jm",children:[(0,i.jsx)(a.r,{src:x.appAvatarUrl,alt:x.appAvatarAltText}),(0,i.jsxs)(c.A,{className:"ml-2",maxWidth:"300px",inline:!0,title:`${x.checkSuiteName} / ${x.checkRun.name}`,children:[(0,i.jsx)(d.A,{weight:"semibold",size:"small",children:x.checkSuiteName})," ","/ ",(0,i.jsx)(d.A,{size:"small",children:x.checkRun.name})]})]}),x.checkRun.detailsUrl&&(0,i.jsx)(u.Q,{as:"a",href:x.checkRun.detailsUrl,size:"small",children:"View details"})]})]}),C[16]=N,C[17]=x.annotationLevel,C[18]=x.appAvatarAltText,C[19]=x.appAvatarUrl,C[20]=x.checkRun,C[21]=x.checkSuiteName,C[22]=x.message,C[23]=x.title,C[24]=y,C[25]=w,C[26]=b):b=C[26],C[27]!==t||C[28]!==p||C[29]!==b?(v=(0,i.jsxs)("div",{className:t,children:[p,b]}),C[27]=t,C[28]=p,C[29]=b,C[30]=v):v=C[30],v}function y(e){let t,n=(0,r.c)(2),{children:a}=e;return n[0]!==a?(t=(0,i.jsx)("span",{className:"text-semibold fgColor-default",children:a}),n[0]=a,n[1]=t):t=n[1],t}function L(e){let t,n,a=(0,r.c)(6),{annotation:l}=e,o=C[l.annotationLevel],s=g.GF[l.annotationLevel];return a[0]!==l.endLine?(t=(0,i.jsxs)(y,{children:["R",l.endLine]}),a[0]=l.endLine,a[1]=t):t=a[1],a[2]!==o||a[3]!==s.ariaLabel||a[4]!==t?(n=(0,i.jsxs)("h2",{className:h,children:[o,s.ariaLabel," on line"," ",t]}),a[2]=o,a[3]=s.ariaLabel,a[4]=t,a[5]=n):n=a[5],n}function S(e){let t,n,a=(0,r.c)(3),{annotation:l}=e;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,m.$)(h,"tmp-ml-4","pt-1","pl-0"),a[0]=t):t=a[0];let o=g.GF[l.annotationLevel];return a[1]!==o.ariaLabel?(n=(0,i.jsx)("div",{className:t,children:(0,i.jsx)(y,{children:o.ariaLabel})}),a[1]=o.ariaLabel,a[2]=n):n=a[2],n}function N(e){return`AnnotationIsCollapsed_${e.path}_${e.endLine}_${e.annotationLevel}_${e.title}`}function _(e){let t,n,i,a,l,o=(0,r.c)(10);o[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,b.A)("localStorage"),o[0]=t):t=o[0];let s=t,[d,c]=(0,p.useState)(!1);o[1]!==e?(n=()=>{let t=localStorage.getItem(N(e));null!==t&&c(JSON.parse(t))},i=[e],o[1]=e,o[2]=n,o[3]=i):(n=o[2],i=o[3]),(0,p.useEffect)(n,i),o[4]!==e||o[5]!==d?(a=()=>{v.cg?.requestAnimationFrame(()=>{s.setItem(N(e),JSON.stringify(!d))}),c(w)},o[4]=e,o[5]=d,o[6]=a):a=o[6];let u=a;return o[7]!==u||o[8]!==d?(l={isCollapsed:d,handleToggleCollapsed:u},o[7]=u,o[8]=d,o[9]=l):l=o[9],l}function w(e){return!e}x.displayName="Annotation",y.displayName="Emphasis",L.displayName="AnnotationBanner",S.displayName="SidePanelAnnotationBanner"},64714(e,t,n){n.d(t,{Xh:()=>o,GF:()=>d,S:()=>s});var i=n(74848),r=n(16522),a=n(34164),l=n(80655);function o({annotationLevel:e,...t}){let{icon:n,...r}=d[e];return function({fill:e,stroke:t,ariaLabel:n,svgHtml:r,className:a}){return(0,i.jsx)("svg",{"aria-label":n,className:a,fill:e,height:"24",stroke:t,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",style:{boxShadow:"none"},viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:r})}({...n,...r,...t})}function s(e){let t,n,l,s,d=(0,r.c)(8);return d[0]!==e?({className:t,...n}=e,d[0]=e,d[1]=t,d[2]=n):(t=d[1],n=d[2]),d[3]!==t?(l=(0,a.$)("AnnotationIcon-module__AnimatedAnnotationIcon__GP9yX",t),d[3]=t,d[4]=l):l=d[4],d[5]!==n||d[6]!==l?(s=(0,i.jsx)(o,{...n,className:l}),d[5]=n,d[6]=l,d[7]=s):s=d[7],s}o.displayName="AnnotationIcon",s.displayName="AnimatedAnnotationIcon";let d={[l.UZ.Failure]:{priority:1,ariaLabel:"Check failure",primaryColor:"danger.fg",primaryColorClass:"fgColor-danger",borderColor:"borderColor-danger-emphasis",icon:{fill:"var(--bgColor-danger-emphasis, var(--color-danger-emphasis))",stroke:"var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))",svgHtml:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,i.jsx)("line",{x1:"15",x2:"9",y1:"9",y2:"15"}),(0,i.jsx)("line",{x1:"9",x2:"15",y1:"9",y2:"15"})]})}},[l.UZ.Warning]:{priority:2,ariaLabel:"Check warning",primaryColor:"attention.fg",primaryColorClass:"fgColor-attention",borderColor:"borderColor-attention-emphasis",icon:{fill:"var(--bgColor-attention-emphasis, var(--color-attention-emphasis))",stroke:"var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))",svgHtml:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,i.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),(0,i.jsx)("line",{x1:"12",x2:"12",y1:"16",y2:"16"})]})}},[l.UZ.Notice]:{priority:3,ariaLabel:"Check notice",primaryColor:"fg.muted",primaryColorClass:"fgColor-muted",borderColor:"fgColor-muted",icon:{fill:"var(--bgColor-neutral-emphasis, var(--color-neutral-emphasis))",stroke:"var(--fgColor-onEmphasis, var(--color-fg-on-emphasis))",svgHtml:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,i.jsx)("line",{x1:"12",x2:"12",y1:"16",y2:"12"}),(0,i.jsx)("line",{x1:"12",x2:"12",y1:"8",y2:"8"})]})}}}},30572(e,t,n){n.d(t,{G:()=>s});var i=n(74848),r=n(16522),a=n(86276),l=n(5024);let o="CommentContentSkeleton-module__commentLine__zeT7c";function s(){let e,t,n,s=(0,r.c)(3);return s[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxs)("div",{className:"CommentContentSkeleton-module__commentHeader__h3YJm",children:[(0,i.jsx)(a.r,{size:"bodySmall",className:"CommentContentSkeleton-module__authorName__VFo2d"}),(0,i.jsx)(a.r,{size:"bodySmall",className:"CommentContentSkeleton-module__timestamp__eeloQ"})]}),s[0]=e):e=s[0],s[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsxs)("div",{className:"CommentContentSkeleton-module__comment__n3x7a",children:[e,(0,i.jsxs)("div",{className:"CommentContentSkeleton-module__commentBody__oTMOH",children:[(0,i.jsx)(a.r,{size:"bodySmall",className:o}),(0,i.jsx)(a.r,{size:"bodySmall",className:o})]})]}),s[1]=t):t=s[1],s[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsxs)("div",{"data-testid":"comment-content-skeleton",children:[t,(0,i.jsx)("div",{className:"CommentContentSkeleton-module__footer__TeDrw",children:(0,i.jsx)(l.f,{className:"CommentContentSkeleton-module__repliesButton__BBbGU"})})]}),s[2]=n):n=s[2],n}s.displayName="CommentContentSkeleton"},6021(e,t,n){n.d(t,{S:()=>o});var i=n(74848),r=n(16522),a=n(11675),l=n(70503);let o=e=>{let t,n,o,s,d,c,u,m,f=(0,r.c)(22);f[0]!==e?({ref:n,children:t,...o}=e,f[0]=e,f[1]=t,f[2]=n,f[3]=o):(t=f[1],n=f[2],o=f[3]);let h=(0,l.Yp)(),{baseRepository:g}=(0,l.GK)(),p=(0,l.L3)();f[4]!==h.id?(s={id:h.id},f[4]=h.id,f[5]=s):s=f[5];let b=`${g.ownerLogin}/${g.name}`;f[6]!==g.id||f[7]!==b?(d={databaseId:g.id,nwo:b,slashCommandsEnabled:!1},f[6]=g.id,f[7]=b,f[8]=d):d=f[8],f[9]!==p.effectiveRange.baseOid||f[10]!==p.effectiveRange.headOid?(c={startCommitOid:p.effectiveRange.baseOid,endCommitOid:p.effectiveRange.headOid},f[9]=p.effectiveRange.baseOid,f[10]=p.effectiveRange.headOid,f[11]=c):c=f[11],f[12]!==h.number||f[13]!==s||f[14]!==d||f[15]!==c?(u={type:"pull_request",id:s,pullRequestNumber:h.number,repository:d,comparison:c},f[12]=h.number,f[13]=s,f[14]=d,f[15]=c,f[16]=u):u=f[16];let v=u;return f[17]!==t||f[18]!==n||f[19]!==o||f[20]!==v?(m=(0,i.jsx)(a.hF,{...o,ref:n,placeholder:"Leave a comment",actions:t,subject:v,showLabel:!1}),f[17]=t,f[18]=n,f[19]=o,f[20]=v,f[21]=m):m=f[21],m};o.displayName="ConversationCommentBox",o.displayName="ConversationCommentBox"},33874(e,t,n){n.d(t,{U:()=>el});var i=n(74848),r=n(16522),a=n(11675),l=n(22182),o=n(57053),s=n(93238),d=n(66798),c=n(73537),u=n(52111),m=n(53178),f=n(16497),h=n(26316),g=n(40914),p=n(38621),b=n(41431),v=n(83223),C=n(59134),x=n(72685),y=n(34164),L=n(96540),S=n(23666),N=n(94747),_=n(70503),w=n(1932),D=n(78597);async function I(e){let{duration:t,hiddenReason:n,organizationLogin:i,notifyBlockedUser:r,shouldHideComment:a,userLogin:l}=e,o=new FormData;o.append("duration",t),o.append("hide_comment",a.toString()),n&&o.append("hidden_reason",n),o.append("login",l),o.append("send_notification",r.toString()),await (0,D.DI)((0,S.ggd)({owner:i}),{method:"POST",body:o,redirect:"manual"})}var j=n(78431),k=n(62764),A=n(38125),E=n(95424);async function R(e){let{organizationLogin:t,userLogin:n}=e;await (0,j.q$)(`${(0,S.ggd)({owner:t})}/${(0,E.QU)(n)}`,{method:"DELETE",redirect:"manual"})}function T(e){if(e)return{...e,isHidden:!1,minimizedReason:null}}var O=n(34784),$=n(25546),F=n(32371),M=n(56392),B=n(6021);let H="ReviewThreadComment-module__ReviewThreadWrapper__maToZ";var P=n(40961),K=n(52392),U=n(68938);function V(){h.cg?.location.reload()}var z=n(6877),q=n(79134),G=n(51581),W=n(4925),X=n(21373),J=n(65222);function Q(e){let t,n,a,l,o,s=(0,r.c)(32),{onOpenDialog:d,suggestedChange:c,canAddToBatch:u}=e,m=void 0===u||u,{sendAnalyticsEvent:f}=(0,G.s)(),h=(0,L.useRef)(null),g=c.commentDatabaseId||0;s[0]!==c.suggestionIndex||s[1]!==g?(t={commentDatabaseId:g,suggestionIndex:c.suggestionIndex},s[0]=c.suggestionIndex,s[1]=g,s[2]=t):t=s[2];let p=(0,_.Nk)(t),b=(0,_.RH)(),v=(0,z.u)("batch_suggested_changes"),{addSuggestionToBatch:C,removeSuggestionFromBatch:x}=(0,_.xJ)(),y=(0,_.WK)(),S=(0,_.Kp)(),N=(0,_.L3)();s[3]!==C||s[4]!==N||s[5]!==S||s[6]!==f||s[7]!==c.commentDatabaseId||s[8]!==c.lineRange||s[9]!==c.path||s[10]!==c.suggestionIndex||s[11]!==c.threadId||s[12]!==y?(n=()=>{if(!c.commentDatabaseId)return;let e={commentDatabaseId:c.commentDatabaseId,suggestionIndex:c.suggestionIndex,threadId:c.threadId,pathLineRanges:[{path:c.path,lineRange:c.lineRange}]};C(e),(0,J.CE)(S,N.fullDiff.headOid,[...y.activeBatch,e]),f("comments.add_suggested_change_to_batch","ADD_SUGGESTED_CHANGE_TO_BATCH_BUTTON")},s[3]=C,s[4]=N,s[5]=S,s[6]=f,s[7]=c.commentDatabaseId,s[8]=c.lineRange,s[9]=c.path,s[10]=c.suggestionIndex,s[11]=c.threadId,s[12]=y,s[13]=n):n=s[13];let w=n;s[14]!==N||s[15]!==S||s[16]!==x||s[17]!==f||s[18]!==c.commentDatabaseId||s[19]!==c.suggestionIndex||s[20]!==y?(a=()=>{if(!c.commentDatabaseId)return;let e={commentDatabaseId:c.commentDatabaseId,suggestionIndex:c.suggestionIndex};x(e),(0,J.CE)(S,N.fullDiff.headOid,y.activeBatch.filter(t=>t.commentDatabaseId!==e.commentDatabaseId||t.suggestionIndex!==e.suggestionIndex)),f("comments.remove_suggested_change_from_batch","REMOVE_SUGGESTED_CHANGE_FROM_BATCH_BUTTON")},s[14]=N,s[15]=S,s[16]=x,s[17]=f,s[18]=c.commentDatabaseId,s[19]=c.suggestionIndex,s[20]=y,s[21]=a):a=s[21];let D=a;s[22]!==d?(l=()=>{d(h)},s[22]=d,s[23]=l):l=s[23];let I=l;return s[24]!==v||s[25]!==m||s[26]!==w||s[27]!==I||s[28]!==D||s[29]!==p||s[30]!==b?(o=(0,i.jsx)("div",{className:"d-flex flex-row flex-items-center",children:v&&p?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(W.A,{variant:"attention",children:"Pending in batch"}),(0,i.jsx)("div",{className:"ml-auto",children:(0,i.jsx)(X.Q,{variant:"danger",onClick:D,children:"Remove from batch"})})]}):(0,i.jsxs)("div",{className:"d-flex gap-2 ml-auto flex-wrap-reverse",children:[!b&&(0,i.jsx)(X.Q,{variant:"default",onClick:I,ref:h,children:"Apply suggestion"}),v&&m&&(0,i.jsx)(X.Q,{variant:"primary",onClick:w,children:"Add suggestion to batch"})]})}),s[24]=v,s[25]=m,s[26]=w,s[27]=I,s[28]=D,s[29]=p,s[30]=b,s[31]=o):o=s[31],o}Q.displayName="ApplyOrAddToBatch";var Y=n(70985),Z=n(33906);function ee(e){let t,n,a,l,o,s,d,c,u,m,f,h,g,p,b,v,C=(0,r.c)(43),{suggestedChange:x}=e,{setIsDialogOpen:y}=(0,q.W)(),[S,w]=(0,L.useState)(!1),D=(0,L.useRef)(void 0),I=(0,z.u)("batch_suggested_changes"),A=(0,_.WK)();C[0]!==I||C[1]!==x.commentDatabaseId||C[2]!==x.suggestionIndex||C[3]!==A.activeBatch?(t=I&&void 0!==x.commentDatabaseId&&null!==x.commentDatabaseId&&A.activeBatch.some(e=>e.commentDatabaseId===x.commentDatabaseId&&e.suggestionIndex===x.suggestionIndex),C[0]=I,C[1]=x.commentDatabaseId,C[2]=x.suggestionIndex,C[3]=A.activeBatch,C[4]=t):t=C[4];let E=t;C[5]!==x.lineRange||C[6]!==x.path||C[7]!==x.threadId||C[8]!==A.activeBatch?(n=(0,K.EJ)({threadId:x.threadId,pathLineRanges:[{path:x.path,lineRange:x.lineRange}]},A.activeBatch),C[5]=x.lineRange,C[6]=x.path,C[7]=x.threadId,C[8]=A.activeBatch,C[9]=n):n=C[9];let{isValid:R,reason:T}=n;C[10]!==x?(a=[x],C[10]=x,C[11]=a):a=C[11];let O=a;C[12]!==O?(l=O.map(et),C[12]=O,C[13]=l):l=C[13];let $=l;C[14]!==y?(o=e=>{w(e),y?.(e)},C[14]=y,C[15]=o):o=C[15];let F=o;C[16]!==F?(s=()=>{if(F(!1),D.current){let e=D.current.current;setTimeout(()=>e?.focus())}},C[16]=F,C[17]=s):s=C[17];let M=s;C[18]!==F?(d=e=>{F(!0),D.current=e},C[18]=F,C[19]=d):d=C[19];let B=d,{mutate:H}=(p=(0,r.c)(2),b=(0,_.Kp)(),v=`${b}/page_data/${k.uT.submitSuggestedChanges}`,p[0]!==v?(g={mutationFn:async e=>{let{changes:t,currentOid:n,message:i}=e,r=await (0,j.q$)(v,{method:"POST",body:{changes:t,currentOid:n,message:i}}),a=await (0,j.hp)(r);return(0,j.R)(r,a),a},onSuccess:V},p[0]=v,p[1]=g):g=p[1],(0,N.n)(g)),{fullDiff:P}=(0,_.L3)(),{headOid:U}=P;C[20]!==O||C[21]!==M||C[22]!==U||C[23]!==H?(c=(e,t,n)=>{H({changes:O,message:e,currentOid:U},{onSuccess:()=>{M(),n()},onError:e=>{t(e,"submitSuggestedChanges","Failed to submit suggested changes")}})},C[20]=O,C[21]=M,C[22]=U,C[23]=H,C[24]=c):c=C[24];let G=c;return C[25]!==R||C[26]!==B||C[27]!==x?(u=(0,i.jsx)(Q,{suggestedChange:x,onOpenDialog:B,canAddToBatch:R}),C[25]=R,C[26]=B,C[27]=x,C[28]=u):u=C[28],C[29]!==E||C[30]!==R||C[31]!==T?(m=!E&&!R&&T&&(0,i.jsx)(Z.s,{reason:T,className:"m-0"}),C[29]=E,C[30]=R,C[31]=T,C[32]=m):m=C[32],C[33]!==$||C[34]!==O.length||C[35]!==M||C[36]!==G||C[37]!==S?(f=S&&(0,i.jsx)(Y.$,{authorLogins:$,batchSize:O.length,onClose:M,onCommit:G}),C[33]=$,C[34]=O.length,C[35]=M,C[36]=G,C[37]=S,C[38]=f):f=C[38],C[39]!==u||C[40]!==m||C[41]!==f?(h=(0,i.jsxs)("div",{className:"border-top p-2",children:[u,m,f]}),C[39]=u,C[40]=m,C[41]=f,C[42]=h):h=C[42],h}function et(e){return e.authorLogin}function en(e){let t,n,a=(0,r.c)(12),{applySuggestedChangesValidationData:l,comment:o,commentBodyRef:s,filePath:d,isOutdated:c,isThreadResolved:u,suggestedChangesConfig:m,databaseId:f,viewerCanApplySuggestion:h}=e,{state:g}=(0,_.Yp)(),p=(0,_.ww)(),b=function(e,t,n,i,a){let l,o,s=(0,r.c)(19),[d,c]=(0,L.useState)();s[0]!==a.lineRange||s[1]!==t.author?.login||s[2]!==t.databaseId||s[3]!==t.id||s[4]!==t.subjectType||s[5]!==e||s[6]!==n||s[7]!==i?(l=()=>{if(!e.current||t.subjectType?.toUpperCase()!=="LINE")return;let r=[...e.current.getElementsByClassName("js-apply-changes")];if(r.length>0){let e=[];for(let l=0;l{let{isValid:t,reason:n}=(0,K.o_)({suggestedChange:e,hasCommitRange:p,isOutdated:c,isPending:"PENDING"===o.state.toUpperCase(),isResolved:u,pullRequestIsClosed:void 0===g||"CLOSED"===g||"MERGED"===g,pullRequestIsInMergeQueue:"QUEUED"===g,userCanApplySuggestion:!!h,applySuggestedChangesValidationData:l,suggestedChangesConfig:m});return!t&&n?(0,P.createPortal)((0,i.jsx)(Z.s,{reason:n}),e.ref):(0,P.createPortal)((0,i.jsx)(ee,{suggestedChange:e}),e.ref)}):null,a[0]=l,a[1]=o,a[2]=p,a[3]=c,a[4]=u,a[5]=g,a[6]=b,a[7]=m,a[8]=h,a[9]=t):t=a[9],a[10]!==t?(n=(0,i.jsx)(i.Fragment,{children:t}),a[10]=t,a[11]=n):n=a[11],n}ee.displayName="CodeSuggestionActions",en.displayName="SuggestedChangeView";var ei=n(13739),er=n(70056),ea=n(35665);function el(e){let t,n,S,D,E,P,K,U,V,z,q,G,W,X,J,Q,Y,Z,ee,et,el,es,ed,ec,eu,em,ef,eh,eg,ep,eb,ev,eC,ex,ey,eL,eS,eN,e_,ew,eD,eI,ej,ek,eA,eE=(0,r.c)(182),{isAnchorable:eR,index:eT,isInlineComment:eO,isLastChild:e$,isOutdated:eF,isThreadResolved:eM,lineMarkersKey:eB,anchorPrefix:eH,comment:eP,disableDialogMode:eK,enableDialogMode:eU,filePath:eV,gridCellId:ez,hideActions:eq,isFirstComment:eG,isInDialogMode:eW,onDeleteLineComment:eX,onQuoteReply:eJ,threadCommentCount:eQ,threadId:eY,threadPositionNumber:eZ,suggestedChangesConfig:e1,applySuggestedChangesValidationData:e0,viewerData:e2,ghostUser:e3,originalDiffPathUri:e4,headingLevel:e5,tooltipDirection:e6}=e,e7=void 0!==eR&&eR,e8=void 0===eT?0:eT,e9=void 0!==eG&&eG,te=void 0===eJ?u.l:eJ,tt=void 0===e3?s.t.ghostUser:e3,tn=void 0===e5?"h3":e5,{addToast:ti}=(0,g.Y6)(),[tr,ta]=(0,L.useState)(!1),[tl,to]=(0,L.useState)(eP.isHidden),[ts,td]=(0,L.useState)(!1),[tc,tu]=(0,L.useState)(eP.body),[tm,tf]=(0,L.useState)(!1),[th,tg]=(0,L.useState)(!1),[tp,tb]=(0,L.useState)(""),tv=(0,_.Kp)(),tC="FILE"===eP.subjectType;eE[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{let{text:t}=e;t&&tu(t)},eE[0]=t):t=eE[0],eE[1]!==tv||eE[2]!==eP.id||eE[3]!==eV||eE[4]!==tC?(n={subjectId:tv,filePath:eV,fileLevelComment:tC,threadId:eP.id,handlePersistedCommentExists:t},eE[1]=tv,eE[2]=eP.id,eE[3]=eV,eE[4]=tC,eE[5]=n):n=eE[5];let{persistCommentToStorage:tx,removePersistedCommentFromStorage:ty}=(0,F.L4)(n),tL=(0,L.useRef)(null),tS=(0,L.useRef)(null),tN=(0,L.useRef)(null),[t_,tw]=(0,L.useState)("");eE[6]===Symbol.for("react.memo_cache_sentinel")?(S=()=>{tL.current?.focus()},eE[6]=S):S=eE[6];let tD=S;eE[7]!==tr?(D=()=>{if(tr){let e=window.setTimeout(tD);return()=>{window.clearTimeout(e)}}},E=[tr],eE[7]=tr,eE[8]=D,eE[9]=E):(D=eE[8],E=eE[9]),(0,L.useEffect)(D,E),eE[10]!==eX?(P=()=>{td(!1),tg(!1),eX?.()},eE[10]=eX,eE[11]=P):P=eE[11],eE[12]!==eV||eE[13]!==eB||eE[14]!==P?(K={filePath:eV,lineMarkersKey:eB,onSuccess:P},eE[12]=eV,eE[13]=eB,eE[14]=P,eE[15]=K):K=eE[15];let{mutate:tI}=function(e){let t,n,i,a=(0,r.c)(15),{filePath:l,lineMarkersKey:o,onSuccess:s}=e,d=(0,_.Kp)(),{deleteThreadComment:c}=(0,_.an)(),{onCommentThreadDeleted:u}=(0,_.Ud)(),m=(0,_.SM)(),{removePendingComment:f}=(0,_._N)();return a[0]!==d||a[1]!==l||a[2]!==m||a[3]!==o?(t=async e=>{let{commentId:t,threadId:n}=e,i=m(Number(n),l,o)?.commentsData?.comments?.find(e=>e.id===t);if(!i)return;let r=`${d}/page_data/review_comments/${i.databaseId}`,a=await (0,j.q$)(`${r}`,{method:"DELETE"});if(204===a.status||200===a.status)return;let s=await (0,j.hp)(a);(0,j.R)(a,s)},a[0]=d,a[1]=l,a[2]=m,a[3]=o,a[4]=t):t=a[4],a[5]!==c||a[6]!==l||a[7]!==o||a[8]!==u||a[9]!==s||a[10]!==f?(n=(e,t)=>{let{commentId:n,threadId:i}=t,r=c(Number(i),n,l,o);f(Number(i)),"thread_deleted"===r&&("thread_deleted"===r&&u({path:l,threadID:i}),s?.())},a[5]=c,a[6]=l,a[7]=o,a[8]=u,a[9]=s,a[10]=f,a[11]=n):n=a[11],a[12]!==t||a[13]!==n?(i={mutationFn:t,onSuccess:n},a[12]=t,a[13]=n,a[14]=i):i=a[14],(0,N.n)(i)}(K);eE[16]!==eK?(U=async()=>{eK?.(),td(!0)},eE[16]=eK,eE[17]=U):U=eE[17];let tj=U;eE[18]!==ti||eE[19]!==eP.id||eE[20]!==tI||eE[21]!==eU||eE[22]!==eV||eE[23]!==ez||eE[24]!==eY?(V=e=>{"confirm"===e?(tg(!0),tI({commentId:eP.id,threadId:eY,filePath:eV},{onError:()=>{td(!1),ti({type:"error",message:"Failed to delete comment"}),tg(!1)}})):(ez&&eU?.(ez),td(!1),tg(!1))},eE[18]=ti,eE[19]=eP.id,eE[20]=tI,eE[21]=eU,eE[22]=eV,eE[23]=ez,eE[24]=eY,eE[25]=V):V=eE[25];let tk=V,{mutate:tA}=function(e,t){let n,i,a,l=(0,r.c)(9),o=(0,_.Kp)(),s=`${o}/page_data/${k.uT.hideComment}`,{updateThreadComment:d}=(0,_.an)();return l[0]!==s?(n=async e=>{let{commentDatabaseId:t,reason:n}=e,i=await (0,j.q$)(s,{method:"POST",body:{classifier:n,commentId:t}}),r=await (0,j.hp)(i);return(0,j.R)(i,r),r},l[0]=s,l[1]=n):n=l[1],l[2]!==e||l[3]!==t||l[4]!==d?(i=n=>{d({threadID:n.threadId,filePath:e,lineMarkersKey:t,match:e=>e.databaseId===n.commentDatabaseId,transform:e=>{if(e)return{...e,isHidden:!0,minimizedReason:n.reason}}})},l[2]=e,l[3]=t,l[4]=d,l[5]=i):i=l[5],l[6]!==n||l[7]!==i?(a={mutationFn:n,onSuccess:i},l[6]=n,l[7]=i,l[8]=a):a=l[8],(0,N.n)(a)}(eV,eB);eE[26]!==eP.databaseId||eE[27]!==tA?(z=e=>{if(!eP.databaseId)throw Error("Comment not found");tA({commentDatabaseId:eP.databaseId,reason:e},{onError:()=>{tf(!1),tw("Failed to hide comment")},onSuccess:()=>to(!0)})},eE[26]=eP.databaseId,eE[27]=tA,eE[28]=z):z=eE[28];let tE=z,{mutate:tR}=function(e,t){let n,i,a,l=(0,r.c)(9),o=(0,_.Kp)(),s=`${o}/page_data/${k.uT.unhideComment}`,{updateThreadComment:d}=(0,_.an)();return l[0]!==s?(n=async e=>{let{commentDatabaseId:t}=e,n=await (0,j.q$)(s,{method:"POST",body:{commentId:t}}),i=await (0,j.hp)(n);return(0,j.R)(n,i),i},l[0]=s,l[1]=n):n=l[1],l[2]!==e||l[3]!==t||l[4]!==d?(i=n=>{d({threadID:n.threadId,filePath:e,lineMarkersKey:t,match:e=>e.databaseId===n.commentDatabaseId,transform:T})},l[2]=e,l[3]=t,l[4]=d,l[5]=i):i=l[5],l[6]!==n||l[7]!==i?(a={mutationFn:n,onSuccess:i},l[6]=n,l[7]=i,l[8]=a):a=l[8],(0,N.n)(a)}(eV,eB);eE[29]!==eP.databaseId||eE[30]!==tR?(q=()=>{if(!eP.databaseId)throw Error("Comment not found");tR({commentDatabaseId:eP.databaseId},{onError:()=>{tf(!1),tw("Failed to unhide comment")},onSuccess:()=>to(!1)})},eE[29]=eP.databaseId,eE[30]=tR,eE[31]=q):q=eE[31];let tT=q,{mutate:tO}=function(){let e,t=(0,r.c)(2),{updateThreads:n}=(0,_.an)();return t[0]!==n?(e={mutationFn:I,onSuccess:(e,t)=>{n((0,w.jM)(e=>{let n=e.flatMap(e=>e.commentsData?.comments.filter(e=>e.author?.login===t.userLogin));if(0!==n.length)for(let e of n)e&&(e.viewerCanBlockFromOrg=!1,e.viewerCanUnblockFromOrg=!0,e.isHidden=t.shouldHideComment||e.isHidden,e.minimizedReason=t.hiddenReason||null)}))}},t[0]=n,t[1]=e):e=t[1],(0,N.n)(e)}();eE[32]!==tO?(G=(e,t,n,i,r,a)=>tO({duration:e,shouldHideComment:t,hiddenReason:n,organizationLogin:i,notifyBlockedUser:r,userLogin:a},{onError:()=>tw("Failed to block user"),onSuccess:()=>{t&&to(!0)}}),eE[32]=tO,eE[33]=G):G=eE[33];let t$=G,{mutate:tF}=function(){let e,t=(0,r.c)(2),{updateThreads:n}=(0,_.an)();return t[0]!==n?(e={mutationFn:R,onSuccess:(e,t)=>{n((0,w.jM)(e=>{let n=e.flatMap(e=>e.commentsData?.comments.filter(e=>e.author?.login===t.userLogin));if(0!==n.length)for(let e of n)e&&(e.viewerCanBlockFromOrg=!0,e.viewerCanUnblockFromOrg=!1)}))}},t[0]=n,t[1]=e):e=t[1],(0,N.n)(e)}();eE[34]!==tF?(W=(e,t)=>tF({organizationLogin:e,userLogin:t},{onError:()=>tw("Failed to unblock user")}),eE[34]=tF,eE[35]=W):W=eE[35];let tM=W,{mutate:tB}=(0,A.u)(eV,eB);eE[36]!==ti||eE[37]!==eP.databaseId||eE[38]!==tB||eE[39]!==eY?(X=(e,t)=>{if(!eP.databaseId)throw Error("Comment not found");setTimeout(()=>tN.current?.focus(),0),tB({commentDatabaseId:eP.databaseId,threadId:eY,reaction:e,viewerHasReacted:t},{onError:()=>{tf(!1),ti({type:"error",message:"Failed to react to comment"})}})},eE[36]=ti,eE[37]=eP.databaseId,eE[38]=tB,eE[39]=eY,eE[40]=X):X=eE[40];let tH=X;eE[41]===Symbol.for("react.memo_cache_sentinel")?(J=()=>{ta(!0)},eE[41]=J):J=eE[41];let tP=J;eE[42]!==eP.body||eE[43]!==ty?(Q=()=>{ta(!1),ty(),tu(eP.body)},eE[42]=eP.body,eE[43]=ty,eE[44]=Q):Q=eE[44];let tK=Q;eE[45]!==tx?(Y=e=>{tx({text:e}),tu(e),tb(void 0)},eE[45]=tx,eE[46]=Y):Y=eE[46];let tU=Y;eE[47]!==ty?(Z=()=>{ta(!1),tf(!1),ty()},eE[47]=ty,eE[48]=Z):Z=eE[48],eE[49]!==eV||eE[50]!==eB||eE[51]!==Z?(ee={filePath:eV,lineMarkersKey:eB,onSuccess:Z},eE[49]=eV,eE[50]=eB,eE[51]=Z,eE[52]=ee):ee=eE[52];let{mutate:tV}=function(e){let t,n,i,a=(0,r.c)(10),{filePath:l,lineMarkersKey:o,onSuccess:s}=e,d=(0,_.Kp)(),c=`${d}/page_data/${k.uT.updateReviewComment}`,{updateThreadComment:u}=(0,_.an)();return a[0]!==c?(t=async e=>{let{commentId:t,bodyVersion:n,body:i}=e,r=await (0,j.q$)(`${c}${n?`?body_version=${n}`:""}`,{method:"PUT",body:{body:i,commentId:t}}),a=await (0,j.hp)(r);return(0,j.R)(r,a),a},a[0]=c,a[1]=t):t=a[1],a[2]!==l||a[3]!==o||a[4]!==s||a[5]!==u?(n=e=>{u({threadID:e.threadId,filePath:l,lineMarkersKey:o,match:t=>t.databaseId===e.commentDatabaseId,transform:t=>{if(t)return{...t,body:e.body,bodyHTML:e.bodyHTML,bodyVersion:e.bodyVersion}}}),s?.()},a[2]=l,a[3]=o,a[4]=s,a[5]=u,a[6]=n):n=a[6],a[7]!==t||a[8]!==n?(i={mutationFn:t,onSuccess:n},a[7]=t,a[8]=n,a[9]=i):i=a[9],(0,N.n)(i)}(ee);eE[53]!==ti||eE[54]!==tc||eE[55]!==eP.bodyVersion||eE[56]!==eP.databaseId||eE[57]!==e1?.sourceContentFromDiffLines||eE[58]!==tV?(et=()=>{tf(!0);let e=(0,M.u)(tc,e1?.sourceContentFromDiffLines??"");if(!e.isValid){tb(e.errorMessage),tf(!1);return}tV({commentId:String(eP.databaseId),body:tc,bodyVersion:eP.bodyVersion},{onError:()=>{tf(!1),ti({type:"error",message:"Failed to update comment"})}})},eE[53]=ti,eE[54]=tc,eE[55]=eP.bodyVersion,eE[56]=eP.databaseId,eE[57]=e1?.sourceContentFromDiffLines,eE[58]=tV,eE[59]=et):et=eE[59],e1?.sourceContentFromDiffLines;let tz=et;eE[60]!==eP.databaseId?(el=eP.databaseId?.toString(),eE[60]=eP.databaseId,eE[61]=el):el=eE[61];let tq=el,tG=tq?`${void 0===eH?"r":eH}${tq}`:void 0;eE[62]!==tG?(es=tG&&h.fV?new URL(`${h.fV.pathname}#${tG}`,h.fV.origin).toString():"",eE[62]=tG,eE[63]=es):es=eE[63];let tW=es,tX=(0,L.useRef)(null);eE[64]!==tG||eE[65]!==tq||eE[66]!==e7?(ed={isAnchorable:e7,commentId:tq,commentAnchor:tG,containerRef:tX},eE[64]=tG,eE[65]=tq,eE[66]=e7,eE[67]=ed):ed=eE[67],(0,$.u)(ed);let tJ=e8>0,tQ=e8>1,tY=tr?"editing":tl?"hidden":"visible";eE[68]!==tn?(ec={as:tn},eE[68]=tn,eE[69]=ec):ec=eE[69];let tZ=ec,t1=eP.author?.avatarUrl??tt.avatarUrl,t0=eP.reference.text??`#${eP.reference.number}`;eE[70]!==eP||eE[71]!==tW||eE[72]!==t0?(eu={...eP,url:tW,referenceText:t0},eE[70]=eP,eE[71]=tW,eE[72]=t0,eE[73]=eu):eu=eE[73];let t2=eP.author?.login??tt.login,t3=eP.reference?.author?.login??"";eE[74]===Symbol.for("react.memo_cache_sentinel")?(em={},eE[74]=em):em=eE[74];let t4="copilot"===eP.reviewVariantType?"copilot-pull-request-reviewer":void 0,t5="copilot"===eP.reviewVariantType?l.S.Bot:void 0;eE[75]!==eq||eE[76]!==tl||eE[77]!==eF||eE[78]!==tJ||eE[79]!==t$||eE[80]!==tj||eE[81]!==tE||eE[82]!==te||eE[83]!==tM||eE[84]!==tT||eE[85]!==e4||eE[86]!==tZ||eE[87]!==t1||eE[88]!==eu||eE[89]!==t2||eE[90]!==t3||eE[91]!==t4||eE[92]!==t5?(ef={headingProps:tZ,avatarUrl:t1,comment:eu,commentRef:tX,deleteComment:tj,editComment:tP,editHistoryComponent:void 0,hideComment:tE,onBlock:t$,onUnblock:tM,onMinimize:to,onSuccessfulBlock:eo,isMinimized:tl,commentAuthorLogin:t2,navigate:u.l,commentSubjectAuthorLogin:t3,commentSubjectType:"pull request",onReplySelect:te,unhideComment:tT,hideActions:eq,isReply:tJ,forceInlineAvatar:!0,containerStyle:em,originalDiffPathUri:e4,isOutdated:eF,commentAuthorSlug:t4,commentAuthorType:t5},eE[75]=eq,eE[76]=tl,eE[77]=eF,eE[78]=tJ,eE[79]=t$,eE[80]=tj,eE[81]=tE,eE[82]=te,eE[83]=tM,eE[84]=tT,eE[85]=e4,eE[86]=tZ,eE[87]=t1,eE[88]=eu,eE[89]=t2,eE[90]=t3,eE[91]=t4,eE[92]=t5,eE[93]=ef):ef=eE[93];let t6=ef;eE[94]!==e8||eE[95]!==tJ||eE[96]!==eZ?(eh=()=>tJ?void 0!==eZ?`Reply ${e8} to Comment ${eZ}`:`Reply ${e8}`:void 0!==eZ?`Comment ${eZ}`:"Comment",eE[94]=e8,eE[95]=tJ,eE[96]=eZ,eE[97]=eh):eh=eE[97];let t7=eh;eE[98]!==eP.body||eE[99]!==tr||eE[100]!==te?(eg=()=>{if(tr)return;let e=h.cg?.getSelection(),t=e?.anchorNode?{anchorNode:e.anchorNode,range:e.getRangeAt(0)}:null;te((0,ea.E)(tX?.current,t,eP.body))},eE[98]=eP.body,eE[99]=tr,eE[100]=te,eE[101]=eg):eg=eE[101];let t8=eg;eE[102]===Symbol.for("react.memo_cache_sentinel")?(ep=(0,ei.E7)(),eE[102]=ep):ep=eE[102];let t9=ep;eE[103]!==t8?(eb={"pull-requests-diff-view:quote-reply":t8},eE[103]=t8,eE[104]=eb):eb=eE[104];let ne=e7?tG:void 0,nt=eO?eW?0:-1:0,nn=eP.id;eE[105]!==t7||eE[106]!==eW?(ev=eW?{role:"document","aria-roledescription":"comment","aria-label":t7()}:{},eE[105]=t7,eE[106]=eW,eE[107]=ev):ev=eE[107];let ni=e7&&"ReviewThreadComment-module__anchorable__kHiVn",nr="hidden"===tY&&"pb-2",na=tJ&&"ReviewThreadComment-module__isReply__tjdPF";return eE[108]!==ni||eE[109]!==nr||eE[110]!==na?(eC=(0,y.$)("ReviewThreadComment-module__ReviewThreadContainer__m2xlo",ni,nr,na),eE[108]=ni,eE[109]=nr,eE[110]=na,eE[111]=eC):eC=eE[111],eE[112]!==tQ||eE[113]!==tJ?(ex=tQ&&(0,i.jsx)("div",{className:H,"data-is-reply":tJ,children:(0,i.jsx)("div",{className:"ReviewThreadComment-module__ReviewThreadBox__sr89I"})}),eE[112]=tQ,eE[113]=tJ,eE[114]=ex):ex=eE[114],eE[115]!==tv||eE[116]!==eP.reviewVariantType?(ey="code_scanning"===eP.reviewVariantType&&(0,c.G7)("code_scanning_dfa_degraded_experience_notice")&&(0,i.jsx)(b.l,{variant:"info",hideTitle:!0,title:"Code scanning notice",className:"mt-2 tmp-mb-3",children:(0,i.jsxs)(b.l.Description,{children:[(0,i.jsx)(v.A,{inline:!0,href:tv,children:"View in Conversation tab"})," ","for the full code scanning experience."]})}),eE[115]=tv,eE[116]=eP.reviewVariantType,eE[117]=ey):ey=eE[117],eE[118]!==t6||eE[119]!==eq?(eL=eq?void 0:(0,i.jsx)(O.RelayEnvironmentProvider,{environment:t9,children:(0,i.jsx)(o.p,{...t6})}),eE[118]=t6,eE[119]=eq,eE[120]=eL):eL=eE[120],eE[121]!==eP.body||eE[122]!==t6||eE[123]!==eW||eE[124]!==eF||eE[125]!==eL||eE[126]!==eQ||eE[127]!==e6?(eS=(0,i.jsx)(l.v,{...t6,commentBody:eP.body,threadCommentCount:eQ,isInDialogMode:eW,actions:eL,isOutdated:eF,tooltipDirection:e6}),eE[121]=eP.body,eE[122]=t6,eE[123]=eW,eE[124]=eF,eE[125]=eL,eE[126]=eQ,eE[127]=e6,eE[128]=eS):eS=eE[128],eE[129]!==tQ||eE[130]!==ey||eE[131]!==eS?(eN=(0,i.jsxs)("div",{className:"ReviewThreadComment-module__ReviewThreadInnerContainer__ONuV_","data-is-nested-reply":tQ,children:[ey,eS]}),eE[129]=tQ,eE[130]=ey,eE[131]=eS,eE[132]=eN):eN=eE[132],eE[133]!==t_?(e_=t_&&(0,i.jsxs)(C.A,{variant:"danger",className:"tmp-m-3",children:[(0,i.jsx)(p.StopIcon,{className:"mr-2"}),t_]}),eE[133]=t_,eE[134]=e_):e_=eE[134],eE[135]!==e$||eE[136]!==tJ?(ew=tJ&&(0,i.jsx)("div",{className:"ReviewThreadComment-module__ReplyWrapper__HaO4j","data-is-last-child":e$}),eE[135]=e$,eE[136]=tJ,eE[137]=ew):ew=eE[137],eE[138]!==tc||eE[139]!==tY||eE[140]!==tp||eE[141]!==tJ||eE[142]!==tm||eE[143]!==tK||eE[144]!==tU||eE[145]!==tz||eE[146]!==e1?(eD="editing"===tY&&(0,i.jsx)("div",{className:(0,y.$)("flex-1 min-width-0 pr-2 pt-1 pb-2",tJ?"pl-0":"pl-2"),children:(0,i.jsxs)(B.S,{ref:tL,label:"Update comment",value:tc,onChange:tU,onPrimaryAction:tz,suggestedChangesConfig:e1,markdownErrorMessage:tp,children:[(0,i.jsx)(a.xR,{variant:"default",onClick:tK,children:"Cancel"}),(0,i.jsx)(a.xR,{disabled:tm||!tc.length,loading:tm,variant:"primary",onClick:tz,children:"Update"})]})}),eE[138]=tc,eE[139]=tY,eE[140]=tp,eE[141]=tJ,eE[142]=tm,eE[143]=tK,eE[144]=tU,eE[145]=tz,eE[146]=e1,eE[147]=eD):eD=eE[147],eE[148]!==e0||eE[149]!==eP||eE[150]!==tY||eE[151]!==ts||eE[152]!==eV||eE[153]!==tk||eE[154]!==th||eE[155]!==eF||eE[156]!==tJ||eE[157]!==eM||eE[158]!==tH||eE[159]!==e1||eE[160]!==e2?.viewerCanApplySuggestion?(eI="visible"===tY&&(0,i.jsxs)("div",{className:"ReviewThreadComment-module__BodyHTMLContainer__HYeiL","data-is-reply":tJ,children:[eP.bodyHTML&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(f.vb,{ref:tS,className:(0,y.$)("markdown-body","ReviewThreadComment-module__SafeHTMLBox__yw3LK","ReviewThreadComment-module__SafeHTMLBoxWrapped__mvCwc"),"comment-testid":`Comment body html for comment ${eP.id}`,html:eP.bodyHTML}),"copilot"===eP.reviewVariantType&&(0,i.jsxs)("p",{className:"text-small color-fg-muted mt-2 mb-1",children:[(0,i.jsx)("a",{target:"_blank",rel:"noopener noreferrer",className:"Link--inTextBlock",href:"https://docs.github.com/en/copilot/responsible-use-of-github-copilot-features/responsible-use-of-github-copilot-code-review",children:"Copilot"})," ","uses AI. Check for mistakes."]}),(0,i.jsxs)("div",{className:"d-flex flex-direction-column gap-2",children:["copilot"===eP.reviewVariantType&&(0,i.jsx)("div",{className:"mt-2",children:(0,i.jsx)(d.Z,{commentUrl:eP.url,commentId:eP.databaseId?.toString()??"",showNegativeFeedbackModal:!1})}),eP.reactionGroups&&(0,i.jsx)("div",{className:"d-flex flex-direction-column mt-2",children:(0,i.jsx)(m.P,{ref:tN,reactionGroups:eP.reactionGroups,onReact:tH,canReact:eP.viewerCanReact})})]}),e0&&(0,i.jsx)(en,{comment:eP,commentBodyRef:tS,filePath:eV,isOutdated:eF,isThreadResolved:eM,databaseId:eP.databaseId,suggestedChangesConfig:e1,applySuggestedChangesValidationData:e0,viewerCanApplySuggestion:e2?.viewerCanApplySuggestion})]}),ts&&(0,i.jsx)(x.K,{title:"Delete comment?",confirmButtonContent:"Delete",confirmButtonType:"danger",confirmButtonLoading:th,onClose:tk,children:"Are you sure you want to delete this comment?"})]}),eE[148]=e0,eE[149]=eP,eE[150]=tY,eE[151]=ts,eE[152]=eV,eE[153]=tk,eE[154]=th,eE[155]=eF,eE[156]=tJ,eE[157]=eM,eE[158]=tH,eE[159]=e1,eE[160]=e2?.viewerCanApplySuggestion,eE[161]=eI):eI=eE[161],eE[162]!==tJ||eE[163]!==ew||eE[164]!==eD||eE[165]!==eI?(ej=(0,i.jsxs)("div",{className:H,"data-is-reply":tJ,children:[ew,eD,eI]}),eE[162]=tJ,eE[163]=ew,eE[164]=eD,eE[165]=eI,eE[166]=ej):ej=eE[166],eE[167]!==eP.id||eE[168]!==e9||eE[169]!==ne||eE[170]!==nt||eE[171]!==ev||eE[172]!==eC||eE[173]!==ex||eE[174]!==eN||eE[175]!==e_||eE[176]!==ej||eE[177]!==eY?(ek=(0,i.jsxs)("div",{ref:tX,id:ne,tabIndex:nt,"data-first-thread-comment":e9,"data-marker-navigation-comment-thread-id":eY,"data-marker-navigation-comment-id":nn,...ev,className:eC,children:[ex,eN,e_,ej]}),eE[167]=eP.id,eE[168]=e9,eE[169]=ne,eE[170]=nt,eE[171]=ev,eE[172]=eC,eE[173]=ex,eE[174]=eN,eE[175]=e_,eE[176]=ej,eE[177]=eY,eE[178]=ek):ek=eE[178],eE[179]!==eb||eE[180]!==ek?(eA=(0,i.jsx)(er.tL,{commands:eb,children:ek}),eE[179]=eb,eE[180]=ek,eE[181]=eA):eA=eE[181],eA}function eo(){setTimeout(es,800)}function es(){return h.cg?.location.reload()}el.displayName="ReviewThreadComment"},79134(e,t,n){n.d(t,{W:()=>s,j:()=>o});var i=n(74848),r=n(16522),a=n(96540);let l=(0,a.createContext)({});function o(e){let t,n,o=(0,r.c)(5),{children:s}=e,[d,c]=(0,a.useState)(!1);o[0]!==d?(t={isDialogOpen:d,setIsDialogOpen:c},o[0]=d,o[1]=t):t=o[1];let u=t;return o[2]!==s||o[3]!==u?(n=(0,i.jsx)(l,{value:u,children:s}),o[2]=s,o[3]=u,o[4]=n):n=o[4],n}l.displayName="DialogStateContext",o.displayName="DialogStateProvider";let s=()=>(0,a.use)(l)},57973(e,t,n){n.d(t,{Yf:()=>w.Yf,oO:()=>iz,Ao:()=>iV});var i=n(74848),r=n(16522),a=n(18813),l=n(96540),o=n(15019),s=n(206),d=n(38621),c=n(46249),u=n(26108),m=n(56341);function f(e,t="r"){(0,m.Zu)(`#${t}${e}`)}var h=n(94781),g=n(26316),p=n(70056),b=n(34164),v=n(32371),C=n(56392),x=n(6021),y=n(70503),L=n(71323),S=n(97283),N=n(87134),_=n(58989),w=n(31256);function D({selectedLineRange:e,leftLines:t,rightLines:n}){let i=!!n,{startOrientation:r,endOrientation:a}=e,l=c(r).findIndex(t=>(0,w.a2)(t,e.startLineNumber,e.startOrientation)),o=c(a).findIndex(t=>(0,w.a2)(t,e.endLineNumber,e.endOrientation)),s=l>=0&&o>=0;function d(e){if(!s||(0,w.Po)(e))return!1;let t=c((0,_.XU)(e.type)).indexOf(e);return t>=l&&t<=o}function c(e){var r;return i&&"left"!==("string"==typeof(r=e)?r:(0,_.XU)(r.type))?n:t}let u=c("left").filter(e=>d(e));return{selectedRightLines:c("right").filter(e=>d(e)),selectedLeftLines:u}}var I=n(27426),j=n(35205);let k=/^b:\d+-l:(?:\d+|null)-r:(?:\d+|null)$/;function A(e){return null!=e&&k.test(e)}function E({diffAnchor:e,diffLines:t,isSplitView:n,lineRange:i}){let r,a=new Set([]);if(0===t.length)return{selectedLineKeys:a};if(!i)return{selectedLineKeys:new Set([])};let{startLineNumber:l,startOrientation:o,endLineNumber:s,endOrientation:d}=i,c=t;if(n){let e=(0,w.Mk)(t);c=e.leftLines,r=e.rightLines}let u={diffAnchor:e,endLineNumber:s??l,endOrientation:d??o,startLineNumber:l,startOrientation:o},m=D({selectedLineRange:u,leftLines:c,rightLines:r});for(let e=0;e{let n=(0,l.useRef)(null),r=(0,l.useRef)(t.diffLines),a=(0,l.useRef)(t.isSplitView),o=(0,l.useRef)(t.hiddenFeatures);return n.current||(n.current=H({...t})),(0,l.useEffect)(()=>{n.current&&r.current.length!==t.diffLines.length&&(n.current.getState().diffLinesSliceUpdates.updateDiffLinesHash(t.diffLines),n.current.setState({storedCommentsMap:t.storedCommentsMap}),r.current=t.diffLines)},[t,t.diffLines]),(0,l.useEffect)(()=>{n.current&&a.current!==t.isSplitView&&(n.current.getState().diffLinesSliceUpdates.updateDiffView(t.isSplitView),a.current=t.isSplitView)},[t,t.isSplitView]),(0,l.useEffect)(()=>{n.current&&!function(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(o.current,t.hiddenFeatures)&&(n.current.setState({hiddenFeatures:t.hiddenFeatures}),o.current=t.hiddenFeatures)},[t,t.hiddenFeatures]),(0,i.jsx)(F,{value:n.current,children:e})};B.displayName="DiffStoreProvider";let H=e=>(0,S.y)()((0,N.lt)((...t)=>({...(e=>({dialogMode:{activeGridCellId:null},dialogModeActions:{enableDialogMode:t=>e(()=>({dialogMode:{activeGridCellId:t}}),void 0,"dialogMode#enabled"),disableDialogMode:()=>e(()=>({dialogMode:{activeGridCellId:null}}),void 0,"dialogMode#disabled")}}))(...t),...(({diffAnchor:e,path:t,diffLines:n,fileLineCount:i,isSplitView:r})=>(a,l)=>{let o=n.reduce((e,t)=>(t.key&&(e[t.key]=t),e),{}),{selectedLineKeys:s,selectedLineRange:d,startOrientation:c}=E({diffAnchor:e,diffLines:n,isSplitView:r,lineRange:function(e){let t=(0,I.EW)(g.fV.hash);if(!t||t[1]!==e)return;let n=t[2]?"L"===t[2]?"left":"right":void 0,i=t[3]?parseInt(t[3]):void 0,r=t[4]?"L"===t[4]?"left":"right":void 0,a=t[5]?parseInt(t[5]):void 0;if(n&&i)return{diffAnchor:e,endOrientation:r??n,endLineNumber:a??i,startOrientation:n,startLineNumber:i}}(e)}),u=T(s),m=R(s),f=n.reduce((e,t)=>{let n=t.key;return n&&s.has(n)&&(e[n]={isSelected:!0,isFirstSelected:u===n,isLastSelected:m===n}),e},{}),h=null;if(u){let e=o[u];if(e&&e.key&&c){let t="left"===c?e.left:e.right;t&&(h={lineNumber:t,orientation:c,shouldStartConversation:!1,lineKey:e.key})}}return{diffLines:{diffAnchor:e,_diffLines:n,_diffLinesHash:o,selectedLinesInfo:f,fileLineCount:i,firstLineSelectionOnDrag:h,_firstSelectedLineInfo:h?{lineKey:h.lineKey,lineNumber:h.lineNumber,orientation:h.orientation}:null,allSelectedLinesAreRetargetable:()=>{let e=!1;for(let t of l().diffLines.selectedLineKeys){let n=l().diffLines._diffLinesHash[t];if(n&&!(0,w.xB)(n)){e=!0;break}}return!e},getDiffLinesInfo:()=>l().diffLines._diffLines,getSplitDiffLinesFromLineRange:e=>{let t=(0,w.Mk)(l().diffLines._diffLines);return D({selectedLineRange:e,leftLines:t.leftLines,rightLines:t.rightLines})},getSelectedDiffLines:()=>{let e=[];for(let t of l().diffLines.selectedLineKeys){let n=l().diffLines._diffLinesHash[t];n&&e.push(n)}return e},getfirstLineSelectionOnDrag:()=>l().diffLines.firstLineSelectionOnDrag,getIsDraggingFromAddCommentButton:()=>l().diffLines.isDraggingFromAddCommentButton,getSelectedLineRange:()=>l().diffLines.selectedLineRange,hasSelectedLines:()=>l().diffLines.selectedLineKeys.size>0,isDraggingFromAddCommentButton:!1,isSplitView:r,selectedLineKeys:s,selectedLineRange:d},diffLinesSliceUpdates:{updateDiffLinesHash:e=>{let t=e.reduce((e,t)=>(t.key&&(e[t.key]=t),e),{});a(n=>({diffLines:{...n.diffLines,_diffLines:e,_diffLinesHash:t}}),void 0,"updateDiffLines")},updateDiffView:e=>a(t=>({diffLines:{...t.diffLines,isSplitView:e}}),void 0,"update diff view settings")},diffLinesActions:{clearFirstLineSelectionOnDrag:()=>a(e=>({diffLines:{...e.diffLines,firstLineSelectionOnDrag:null,isDraggingFromAddCommentButton:!1}}),void 0,"clearFirstLineSelectionOnDrag"),setIsDraggingFromAddCommentButton:e=>a(t=>({diffLines:{...t.diffLines,isDraggingFromAddCommentButton:e}}),void 0,`setIsDraggingFromAddCommentButton:${e}`),addLineToSelection:({lineKey:n,orientation:i},r)=>{let o;if(!n)return;let s=l().diffLines._diffLinesHash[n];if(!s)return;let d=l().diffLines.firstLineSelectionOnDrag,c=l().diffLines._firstSelectedLineInfo,u=l().diffLines.selectedLineRange;if(d&&n===d.lineKey||!u){let e="right"===i?s.right:s.left;if(!e)return;l().diffLinesActions.selectLine({lineKey:n,firstLineSelectionOnDrag:{lineNumber:e,orientation:i,lineKey:n,shouldStartConversation:!1}},r);return}if(!c)return;o=!function({current:e,currentOrientation:t,previous:n,previousOrientation:i}){return!!n&&("left"===i&&"left"===t&&!!e.left&&!!n.left&&n.left>e.left||"right"===i&&"right"===t&&!!e.right&&!!n.right&&n.right>e.right||"right"===i&&"left"===t&&!!e.right&&!!n.right&&n.right>e.right||"left"===i&&"right"===t&&!!e.left&&!!n.left&&n.left>e.left||!1)}({current:s,currentOrientation:i,previous:l().diffLines._diffLinesHash[c.lineKey],previousOrientation:c.orientation})?{...u,startLineNumber:c.lineNumber,startOrientation:c.orientation,endLineNumber:("left"===i?s?.left:s?.right)??-1,endOrientation:i}:{...u,startLineNumber:("left"===i?s?.left:s?.right)??-1,startOrientation:i,endLineNumber:c.lineNumber,endOrientation:c.orientation};let{selectedLineKeys:m,selectedLineRange:f}=E({diffAnchor:e,diffLines:l().diffLines._diffLines,isSplitView:l().diffLines.isSplitView,lineRange:o}),h=T(m),p=R(m),b=Array.from(m).reduce((e,t)=>(e[t]={isFirstSelected:t===h,isLastSelected:t===p,isSelected:!0},e),{});if(!f?.endLineNumber||!f?.startLineNumber)return;let v=new $.J(f,t);g.cg?.dispatchEvent(v),a(e=>({diffLines:{...e.diffLines,selectedLineKeys:m,selectedLinesInfo:b,selectedLineRange:f}}),void 0,"addLineToSelection"),r(f)},clearSelectedLines:()=>{a(e=>({diffLines:{...e.diffLines,firstLineSelectionOnDrag:null,selectedLineKeys:new Set([]),selectedLinesInfo:{},selectedLineRange:void 0,_firstSelectedLineInfo:null}}),void 0,"clearSelectedLines")},selectLine:({lineKey:e,firstLineSelectionOnDrag:n},i)=>{if(!e)return;let r=l().diffLines._diffLinesHash[e];if(!r)return;let o={[e]:{isFirstSelected:!0,isLastSelected:!0,isSelected:!0}},s="left"===n.orientation?r.left:r.right;if(!s)return;let d={diffAnchor:l().diffLines.diffAnchor,endLineNumber:s,endOrientation:n.orientation,startLineNumber:s,startOrientation:n.orientation},c=new $.J(d,t);g.cg?.dispatchEvent(c),a(t=>({diffLines:{...t.diffLines,firstLineSelectionOnDrag:{...n,lineKey:e},selectedLineKeys:new Set([e]),selectedLinesInfo:o,selectedLineRange:d,_firstSelectedLineInfo:{lineKey:e,lineNumber:n.lineNumber,orientation:n.orientation}}}),void 0,"selectLine"),i(d)},selectMultipleLines:({startLineKey:n,endLineKey:i,startOrientation:r,endOrientation:o,firstLineSelectionOnDrag:s},d)=>{if(!n||!i||!s)return;let c=l().diffLines._diffLinesHash[n],u=l().diffLines._diffLinesHash[i];if(!c||!u||!c.left&&!c.right||!u.left&&!u.right)return;let m={diffAnchor:e,endLineNumber:("right"===o?u.right:u.left)??-1,endOrientation:o,startLineNumber:("right"===r?c.right:c.left)??-1,startOrientation:r},{selectedLineKeys:f,selectedLineRange:h}=E({diffAnchor:e,diffLines:l().diffLines._diffLines,isSplitView:l().diffLines.isSplitView,lineRange:m}),p=T(f),b=R(f),v=Array.from(f).reduce((e,t)=>(e[t]={isFirstSelected:t===p,isLastSelected:t===b,isSelected:!0},e),{});if(!h?.endLineNumber||!h?.startLineNumber)return;let C=new $.J(h,t);g.cg?.dispatchEvent(C),a(e=>({diffLines:{...e.diffLines,selectedLinesInfo:v,selectedLineKeys:f,firstLineSelectionOnDrag:s,selectedLineRange:h,_firstSelectedLineInfo:{lineNumber:s.lineNumber,orientation:s.orientation,lineKey:s.lineKey}}}),void 0,"selectMultipleLines"),d(h)}}}})(e)(...t),...(({hiddenFeatures:e})=>()=>({hiddenFeatures:e}))(e)(...t),...(({addInjectedContextLines:e})=>()=>({injectedContextLinesActions:{addInjectedContextLines:e}}))(e)(...t),...(({startNewConversationForLineOrFileMap:e})=>(t,n)=>({startNewConversationForLineOrFileMap:e,getMoveNewCommentDataForLine:e=>n().startNewConversationForLineOrFileMap[e],addStartNewCommentOnLine:(t,n,i)=>{e[t]={diffLineKey:i,startNewComment:n}}}))(e)(...t),...(({newTreeEntry:e,oldTreeEntry:t})=>()=>({treeEntries:{newTreeEntry:e,oldTreeEntry:t}}))(e)(...t),...(({storedCommentsMap:e})=>(t,n)=>({storedCommentsMap:e,getStoredCommentDataForLine:e=>n().storedCommentsMap[e],updateStoredCommentOnLine:(e,i)=>{!i&&n().storedCommentsMap[e]?t(t=>({storedCommentsMap:{...t.storedCommentsMap,[e]:!1}}),void 0,"updateDiffLines"):i&&!n().storedCommentsMap[e]&&(n().storedCommentsMap[e]=!0)}}))(e)(...t),...(e=>({actionBarVisibility:{activeActionBarCellId:null,focusedActionBarCellId:null},showActionBar:t=>e(e=>({actionBarVisibility:{activeActionBarCellId:t,focusedActionBarCellId:e.actionBarVisibility.focusedActionBarCellId}}),void 0,`actionBarVisibility#show:${t}`),hideActionBar:t=>e(e=>e.actionBarVisibility.activeActionBarCellId===t?{actionBarVisibility:{activeActionBarCellId:null,focusedActionBarCellId:e.actionBarVisibility.focusedActionBarCellId}}:e,void 0,`actionBarVisibility#hide:${t}`),hideAllActionBars:()=>e(()=>({actionBarVisibility:{activeActionBarCellId:null,focusedActionBarCellId:null}}),void 0,"actionBarVisibility#hideAll"),setFocusedActionBar:t=>e(e=>({actionBarVisibility:{activeActionBarCellId:e.actionBarVisibility.activeActionBarCellId,focusedActionBarCellId:t}}),void 0,`actionBarVisibility#setFocused:${t}`),clearFocusedActionBar:()=>e(e=>({actionBarVisibility:{activeActionBarCellId:e.actionBarVisibility.activeActionBarCellId,focusedActionBarCellId:null}}),void 0,"actionBarVisibility#clearFocused")}))(...t)}),{name:`diff-store-${e.diffAnchor}`})),P=e=>{let t,n=(0,r.c)(2);return n[0]!==e?(t=t=>!!e&&t.dialogMode.activeGridCellId===e,n[0]=e,n[1]=t):t=n[1],M(t)},K={isSelected:!1,isFirstSelected:!1,isLastSelected:!1},U=e=>{let t,n=(0,r.c)(2);return n[0]!==e?(t=t=>e&&t.diffLines.selectedLinesInfo[e]||K,n[0]=e,n[1]=t):t=n[1],M(t)},V=e=>{let t,n=(0,r.c)(2);return n[0]!==e?(t=t=>t.storedCommentsMap[e],n[0]=e,n[1]=t):t=n[1],M(t)},z=e=>{let t,n=(0,r.c)(2);return n[0]!==e?(t=t=>!!e&&(t.actionBarVisibility.focusedActionBarCellId===e||t.actionBarVisibility.activeActionBarCellId===e),n[0]=e,n[1]=t):t=n[1],M(t)};function q(e){return e.diffLines.getSplitDiffLinesFromLineRange}function G(e){return e.diffLines.getSelectedDiffLines}function W(e){return e.diffLines.getDiffLinesInfo}function X(e){return e.diffLines.getfirstLineSelectionOnDrag}function J(e){return e.diffLines.getSelectedLineRange}function Q(e){return e.diffLines.getIsDraggingFromAddCommentButton}function Y(e){return e.diffLines.hasSelectedLines}function Z(e){return e.hiddenFeatures}function ee(e){return e.dialogModeActions}function et(e){return e.diffLines.diffAnchor}function en(e){return e.diffLines.fileLineCount}function ei(e){return e.diffLinesActions}function er(e){return e.injectedContextLinesActions}function ea(e){return e.treeEntries}function el(e){return e.getMoveNewCommentDataForLine}function eo(e){return e.updateStoredCommentOnLine}function es(e){return e.diffLines.allSelectedLinesAreRetargetable}function ed(e){return e.hideActionBar}function ec(e){return e.showActionBar}function eu(e){return e.setFocusedActionBar}function em(e){return e.clearFocusedActionBar}var ef=n(49481);function eh({diffAnchor:e,endLineNumber:t,endOrientation:n,startLineNumber:i,startOrientation:r}){if(i&&t){var a;(0,I.i8)({diffAnchor:e,endLineNumber:t,endOrientation:n,startLineNumber:i,startOrientation:r}),(a={diffAnchor:e,endLineNumber:t,endOrientation:n,startLineNumber:i,startOrientation:r}).startLineNumber===a.endLineNumber&&a.startOrientation===a.endOrientation?(0,ef.i)(`${"left"===a.startOrientation?"L":"R"}${a.startLineNumber} selected.`):(0,ef.i)(`${"left"===a.startOrientation?"L":"R"}${a.startLineNumber} to ${"left"===a.endOrientation?"L":"R"}${a.endLineNumber} selected.`)}}var eg=n(68938),ep=n(56703);let eb="comment",ev="review";function eC(e){let t,n,a,o,s,d,c,u,m,f,L,S,N,_,D,I,j,k,A,E,R=(0,r.c)(93),{batchingEnabled:T,condensed:O,fileLevelComment:$,filePath:F,focusOnMount:B,isReplying:H,lineNumber:P,onAddComment:K,onCancelComment:U,onPersistedCommentExists:V,quotedText:z,side:q,startLineNumber:G,threadId:W,suggestedChangesConfig:X,commentLineChangeConfig:J}=e,Q=void 0===z?"":z,[Y,Z]=(0,l.useState)(Q),[ee,et]=(0,l.useState)(null),en=(0,l.useRef)(Q),[er,ea]=(0,l.useState)(),el=(0,l.useRef)(null),es=(0,l.useRef)(null),ed=(0,y.it)(),ec=M(eo),eu=(0,l.useRef)(void 0),{selectMultipleLines:em,clearSelectedLines:ef}=M(ei);R[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{(0,ep.k)(e??"",100),ea(e)},R[0]=t):t=R[0];let eC=t,ex=null!==ee,ey=(0,y.Kp)(),{persistCommentToStorage:eL,removePersistedCommentFromStorage:eS,persistCommentOnGivenLineToStorage:eN}=(0,v.L4)({diffSide:q,filePath:F,line:P,subjectId:ey,threadId:W,handlePersistedCommentExists:e=>{let{text:t,shouldFocus:n,startLine:i,startSide:r,startLineKey:a,endLineKey:l}=e;if(t){if(Z(t),n&&el.current&&(el.current.focus(),el.current.moveCursorToEnd(),e_({text:t,startLine:i,startSide:r,startLineKey:a,endLineKey:l}),i)){let e="LEFT"===q?"left":"right";em({endLineKey:l,endOrientation:e,startLineKey:a,startOrientation:e,firstLineSelectionOnDrag:{lineKey:a??"b:0-l:0-r:0",lineNumber:P??0,orientation:e,shouldStartConversation:!1}},eh)}V?.()}},fileLevelComment:!!$}),e_=eL;if(R[1]!==Q?(n=()=>{Q!==en.current&&(en.current=Q,Z(Q))},a=[Q],R[1]=Q,R[2]=n,R[3]=a):(n=R[2],a=R[3]),(0,l.useEffect)(n,a),R[4]!==ef||R[5]!==J||R[6]!==Y||R[7]!==F||R[8]!==P||R[9]!==U||R[10]!==eN||R[11]!==eS||R[12]!==em||R[13]!==q?(o=()=>{if(J){if(null!==(0,eg.T)(Y))return void J.setErrorMessage("Changing the line number of a comment with a suggested change is not supported.");if(J.closeLineMovingDialog(),eN({text:Y,givenLineDiffSide:J.diffSide,givenFilePath:F,givenLine:J.endLineNumber,shouldBeFileLevelComment:J.isFileLevelComment,startLine:J.startLineNumber,startLineKey:J.startDiffLineKey,endLineKey:J.endDiffLineKey}),eS(),P!==J.endLineNumber||J.isFileLevelComment)J.startConversationOnNewLine(),U?.(!1);else if(J.endDiffLineKey&&J.startDiffLineKey&&eu.current!==J){eu.current=J;let e="LEFT"===q?"left":"right";em({endLineKey:J.endDiffLineKey,endOrientation:e,startLineKey:J.startDiffLineKey,startOrientation:e,firstLineSelectionOnDrag:{lineKey:J.startDiffLineKey??"b:0-l:0-r:0",lineNumber:P??0,orientation:e,shouldStartConversation:!1}},eh)}else J.startDiffLineKey||ef()}},s=[ef,J,Y,F,P,U,eN,eS,em,q],R[4]=ef,R[5]=J,R[6]=Y,R[7]=F,R[8]=P,R[9]=U,R[10]=eN,R[11]=eS,R[12]=em,R[13]=q,R[14]=o,R[15]=s):(o=R[14],s=R[15]),(0,l.useEffect)(o,s),R[16]!==B?(c=()=>{if(B){let e=setTimeout(()=>{if(g.XC&&g.cg){if(es.current){let e=es.current,t=e.getBoundingClientRect(),n=g.XC?.documentElement.clientHeight||0;if(!(t.top>=0&&t.bottom<=(g.cg?.innerHeight||n))){let i=t.top,r=g.XC?.documentElement.getBoundingClientRect().top||0,a=.6666666666666666*e.clientHeight;g.cg?.scrollTo({top:i-r-.6666666666666666*n+a,behavior:"smooth"})}}el.current&&(el.current.focus(),el.current.moveCursorToEnd())}},100);return()=>{window.clearTimeout(e)}}},d=[B],R[16]=B,R[17]=d,R[18]=c):(d=R[17],c=R[18]),(0,l.useEffect)(c,d),R[19]!==Y||R[20]!==H||R[21]!==ex||R[22]!==P||R[23]!==K||R[24]!==U||R[25]!==eS||R[26]!==q||R[27]!==X?.sourceContentFromDiffLines||R[28]!==ec){let e,t=e=>{let{submitBatch:t,action:n}=e,i="Failed to save comment";if(ex)return;if(!Y.trim())return void eC(`${i}: Body can't be blank`);et(n),ea(void 0),eC(void 0);let r=(0,C.u)(Y,X?.sourceContentFromDiffLines??"");if(!r.isValid){eC(r.errorMessage),ea(r.errorMessage),et(null);return}void 0===P||H||ec((0,w.oH)(P,q??"RIGHT"),!1),K?.({commentText:Y,onCompleted(){et(null),u()},onError(e){et(null),void 0===P||H||ec((0,w.oH)(P,q??"RIGHT"),!0),e.message&&(i=`${i}: ${e.message}`),eC(i)},submitBatch:t})};m=()=>{t({submitBatch:!1,action:ev})},f=()=>{t({submitBatch:!0,action:eb})},R[32]!==H||R[33]!==P||R[34]!==U||R[35]!==eS||R[36]!==q||R[37]!==ec?(e=()=>{void 0===P||H||ec((0,w.oH)(P,q??"RIGHT"),!1),eS(),Z(""),U?.()},R[32]=H,R[33]=P,R[34]=U,R[35]=eS,R[36]=q,R[37]=ec,R[38]=e):e=R[38],u=e,R[19]=Y,R[20]=H,R[21]=ex,R[22]=P,R[23]=K,R[24]=U,R[25]=eS,R[26]=q,R[27]=X?.sourceContentFromDiffLines,R[28]=ec,R[29]=u,R[30]=m,R[31]=f}else u=R[29],m=R[30],f=R[31];R[39]!==H||R[40]!==P||R[41]!==e_||R[42]!==q||R[43]!==G||R[44]!==ec?(L=e=>{eC(void 0),void 0===P||H||ec((0,w.oH)(P,q??"RIGHT"),e.trim().length>0),e_({text:e,startLine:G,startSide:G?q:void 0}),Z(e)},R[39]=H,R[40]=P,R[41]=e_,R[42]=q,R[43]=G,R[44]=ec,R[45]=L):L=R[45];let ew=L;R[46]!==f?(S={"pull-requests-conversations:submit-comment-and-review":f},R[46]=f,R[47]=S):S=R[47],R[48]!==u||R[49]!==Y?(N=e=>{"Escape"!==e.key||Y.trim()?e.stopPropagation():(e.preventDefault(),u())},R[48]=u,R[49]=Y,R[50]=N):N=R[50];let eD=T?m:f,eI=O||H?"AddCommentEditor-module__hideMarkdownFooter__XhAMG":"AddCommentEditor-module__showMarkdownFooter__YwCfZ",ej=H&&"AddCommentEditor-module__isReplying__jv7w0",ek=O&&"AddCommentEditor-module__condensed__LwVFY";return R[51]!==eI||R[52]!==ej||R[53]!==ek?(_=(0,b.$)("AddCommentEditor-module__ConversationCommentBox__qxXdE",eI,ej,ek),R[51]=eI,R[52]=ej,R[53]=ek,R[54]=_):_=R[54],R[55]!==u||R[56]!==U?(D=U&&(0,i.jsx)(h.x,{className:"py-1 px-2",variant:"default",onClick:u,children:"Cancel"}),R[55]=u,R[56]=U,R[57]=D):D=R[57],R[58]!==T||R[59]!==ed||R[60]!==Y||R[61]!==f||R[62]!==H||R[63]!==ex||R[64]!==ee?(I=!ed&&(0,i.jsx)(h.x,{className:"py-1 px-2",variant:T?"default":"primary",onClick:f,ref:es,loading:ee===eb,inactive:ex||0===Y.trim().length,children:H?"Reply":"Comment"}),R[58]=T,R[59]=ed,R[60]=Y,R[61]=f,R[62]=H,R[63]=ex,R[64]=ee,R[65]=I):I=R[65],R[66]!==T||R[67]!==ed||R[68]!==Y||R[69]!==m||R[70]!==ex||R[71]!==ee?(j=T&&(0,i.jsx)(h.x,{className:"py-1 px-2",variant:"primary",onClick:m,loading:ee===ev,inactive:ex||0===Y.trim().length,children:ed?"Add review comment":"Start a review"}),R[66]=T,R[67]=ed,R[68]=Y,R[69]=m,R[70]=ex,R[71]=ee,R[72]=j):j=R[72],R[73]!==Y||R[74]!==er||R[75]!==F||R[76]!==ew||R[77]!==ex||R[78]!==P||R[79]!==G||R[80]!==X||R[81]!==eD||R[82]!==_||R[83]!==D||R[84]!==I||R[85]!==j?(k=(0,i.jsxs)(x.S,{ref:el,label:"Add diff comment",value:Y,onChange:ew,onPrimaryAction:eD,suggestedChangesConfig:X,markdownErrorMessage:er,lineNumber:P,filePath:F,startLineNumber:G,disabled:ex,className:_,children:[D,I,j]}),R[73]=Y,R[74]=er,R[75]=F,R[76]=ew,R[77]=ex,R[78]=P,R[79]=G,R[80]=X,R[81]=eD,R[82]=_,R[83]=D,R[84]=I,R[85]=j,R[86]=k):k=R[86],R[87]!==N||R[88]!==k?(A=(0,i.jsx)("div",{className:"AddCommentEditor-module__AddCommentEditor__SOA0y",onKeyDown:N,children:k}),R[87]=N,R[88]=k,R[89]=A):A=R[89],R[90]!==S||R[91]!==A?(E=(0,i.jsx)(p.tL,{commands:S,children:A}),R[90]=S,R[91]=A,R[92]=E):E=R[92],E}eC.displayName="AddCommentEditor";var ex=n(21373),ey=n(61398),eL=n(15837),eS=n(7624),eN=n(45438),e_=n(38750),ew=n(67323),eD=n(18990);function eI(e){let t,n,a,o,s,c,u=(0,r.c)(25),{ariaLabelId:m,currentLineNumberText:f,setCommentLineChangeConfig:h,baseEndLineNumber:g,diffSide:p,baseStartLineNumber:b}=e,[v,C]=(0,l.useState)(!1);u[0]!==g||u[1]!==b?(t=()=>b&&g?"lineRange":g?"line":"file",u[0]=g,u[1]=b,u[2]=t):t=u[2];let[x,y]=(0,l.useState)(t),[L,S]=(0,l.useState)("LEFT"===p),[N,_]=(0,l.useState)(b?String(b):""),[w,D]=(0,l.useState)(g?String(g):""),[I,j]=(0,l.useState)(""),k=M(el),A=(0,l.useRef)(null);u[3]!==w||u[4]!==k||u[5]!==L||u[6]!==x||u[7]!==h||u[8]!==N?(n=()=>{var e,t,n;let i,r,a=k(eE(L,Number(w),"file"===x)),l=k(eE(L,Number(N),"file"===x)),o=a?.startNewComment,s=a?.diffLineKey,d=l?.diffLineKey;(e="lineRange"===x?N:void 0,t=w,i=Number(e),(Number.isInteger(r=Number(t))&&r>0&&(void 0===e||Number.isInteger(i)&&i>0&&i<=r)||"file"===x)&&o&&s)?h({diffSide:(n={isLeftSide:L,startLineNumber:"lineRange"===x?Number(N):void 0,endDiffLineKey:s,endLineNumber:Number(w),isFileLevelComment:"file"===x,startDiffLineKey:"lineRange"===x?d:void 0,startConversationOnNewLine:o,closeLineMovingDialog:()=>C(!1),setErrorMessage:e=>j(e)}).isLeftSide?"LEFT":"RIGHT",startLineNumber:n.startLineNumber,endLineNumber:n.endLineNumber,isFileLevelComment:n.isFileLevelComment,startDiffLineKey:n.startDiffLineKey,endDiffLineKey:n.endDiffLineKey,setErrorMessage:n.setErrorMessage,startConversationOnNewLine:n.startConversationOnNewLine,closeLineMovingDialog:n.closeLineMovingDialog}):j("Please enter a valid line number or range.")},u[3]=w,u[4]=k,u[5]=L,u[6]=x,u[7]=h,u[8]=N,u[9]=n):n=u[9];let E=n;return u[10]===Symbol.for("react.memo_cache_sentinel")?(a=()=>C(!0),u[10]=a):a=u[10],u[11]!==m||u[12]!==f?(o=(0,i.jsx)(ex.Q,{"aria-labelledby":m,"aria-description":"Select to change location",ref:A,type:"button",size:"small",onClick:a,trailingAction:d.TriangleDownIcon,children:f}),u[11]=m,u[12]=f,u[13]=o):o=u[13],u[14]!==w||u[15]!==I||u[16]!==v||u[17]!==L||u[18]!==x||u[19]!==N||u[20]!==E?(s=v&&(0,i.jsx)(ey.l,{onClose:()=>C(!1),returnFocusRef:A,title:"Add comment on",width:"medium",footerButtons:[{buttonType:"default",content:"Cancel",onClick:()=>{C(!1)}},{buttonType:"primary",content:"Save",onClick:E}],children:(0,i.jsxs)(eL.A,{name:"line-number-selection",onChange:e=>{y(e)},children:[(0,i.jsx)(eL.A.Label,{}),(0,i.jsxs)(eS.A,{children:[(0,i.jsx)(eN.A,{value:"line",defaultChecked:"line"===x}),(0,i.jsx)(eS.A.Label,{children:"Line number"}),"line"===x&&(0,i.jsxs)(eS.A.Caption,{className:"d-flex align-items-center",children:[(0,i.jsx)(eA,{isLeftSelected:L,setIsLeftSelected:S}),(0,i.jsx)(e_.A,{autoComplete:"off",className:"ml-1","aria-label":"Line number",name:"lineNumber",value:w,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&E()}})]})]}),(0,i.jsxs)(eS.A,{children:[(0,i.jsx)(eN.A,{value:"lineRange",defaultChecked:"lineRange"===x}),(0,i.jsx)(eS.A.Label,{children:"Line range"}),"lineRange"===x&&(0,i.jsxs)(eS.A.Caption,{className:"d-flex align-items-center",children:[(0,i.jsx)(eA,{isLeftSelected:L,setIsLeftSelected:S}),(0,i.jsx)(e_.A,{autoComplete:"off",className:"ml-1","aria-label":"Line number",name:"lineNumber",value:N,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"===e.key&&E()}}),(0,i.jsx)(d.ArrowRightIcon,{className:"mt-2 mx-2"}),(0,i.jsx)(e_.A,{autoComplete:"off",className:"ml-1","aria-label":"Line number",name:"lineNumber",value:w,onChange:e=>D(e.target.value),onKeyDown:e=>{"Enter"===e.key&&E()}})]})]}),(0,i.jsxs)(eS.A,{children:[(0,i.jsx)(eN.A,{value:"file",defaultChecked:"file"===x}),(0,i.jsx)(eS.A.Label,{children:"File"})]}),I&&(0,i.jsx)(eL.A.Validation,{variant:"error",children:I})]})}),u[14]=w,u[15]=I,u[16]=v,u[17]=L,u[18]=x,u[19]=N,u[20]=E,u[21]=s):s=u[21],u[22]!==o||u[23]!==s?(c=(0,i.jsxs)("div",{className:"ml-1",children:[o,s]}),u[22]=o,u[23]=s,u[24]=c):c=u[24],c}eI.displayName="ChangeCommentLineNumberButton";let ej="Left (L)",ek="Right (R)";function eA(e){let t,n,a,l,o,s=(0,r.c)(12),{isLeftSelected:d,setIsLeftSelected:c}=e,u=d?ej:ek;return s[0]!==u?(t=(0,i.jsx)(ew.W.Button,{children:u}),s[0]=u,s[1]=t):t=s[1],s[2]!==c?(n=(0,i.jsx)(eD.l.Item,{onSelect:()=>{c(!0)},children:ej}),s[2]=c,s[3]=n):n=s[3],s[4]!==c?(a=(0,i.jsx)(eD.l.Item,{onSelect:()=>{c(!1)},children:ek}),s[4]=c,s[5]=a):a=s[5],s[6]!==n||s[7]!==a?(l=(0,i.jsx)(ew.W.Overlay,{children:(0,i.jsxs)(eD.l,{children:[n,a]})}),s[6]=n,s[7]=a,s[8]=l):l=s[8],s[9]!==t||s[10]!==l?(o=(0,i.jsxs)(ew.W,{children:[t,l]}),s[9]=t,s[10]=l,s[11]=o):o=s[11],o}function eE(e,t,n){return n?"F0":`${e?"L":"R"}${t}`}eA.displayName="MoveCommentLineNumberDropdown";var eR=n(6877);function eT(e){let t,n,a,o,m,h,g,p,b,v,C,x,y,L,S,N,_,w,D,I,j,k=(0,r.c)(56);if(k[0]!==e){let{addCommentDialogTitle:i,isLeftSide:r,fileLevelComment:l,filePath:s,focusOnMount:d,lineNumber:c,onAddComment:u,onClose:f,viewerData:x,threadsConnectionId:y,showOnCloseIcon:L,...S}=e;t=i,o=r,n=l,a=s,b=d,m=c,h=u,g=f,C=x,v=L,p=S,k[0]=e,k[1]=t,k[2]=n,k[3]=a,k[4]=o,k[5]=m,k[6]=h,k[7]=g,k[8]=p,k[9]=b,k[10]=v,k[11]=C}else t=k[1],n=k[2],a=k[3],o=k[4],m=k[5],h=k[6],g=k[7],p=k[8],b=k[9],v=k[10],C=k[11];let A=void 0===b||b,E=void 0===v||v,[R,T]=(0,l.useState)(void 0),O=(0,eR.u)("move_new_comments_ui")&&!1,{disableDialogMode:$}=M(ee);k[12]!==h?(x=e=>{let{commentText:t,onCompleted:n,onError:i,submitBatch:r}=e;h({text:t,onError:i,onCompleted:(e,t)=>{t&&f(t.toString()),n?.(e,t)},submitBatch:r})},k[12]=h,k[13]=x):x=k[13];let F=x;k[14]!==$||k[15]!==g?(y=()=>{g?.(),$()},k[14]=$,k[15]=g,k[16]=y):y=k[16];let B=y,H=`diff-comment-positioning-${(0,l.useId)()}`,P=C.avatarUrl||"";k[17]!==P||k[18]!==C.login?(L=(0,i.jsx)(s.r,{alt:C.login,size:24,src:P,className:"mr-2"}),k[17]=P,k[18]=C.login,k[19]=L):L=k[19],k[20]!==t||k[21]!==n||k[22]!==O?(S=!O&&(n?(0,i.jsx)(i.Fragment,{children:"Add comment on file"}):(0,i.jsx)("span",{children:t?`Add a comment on ${t}`:"Add a comment"})),k[20]=t,k[21]=n,k[22]=O,k[23]=S):S=k[23],k[24]!==t||k[25]!==H||k[26]!==n||k[27]!==o||k[28]!==m||k[29]!==O||k[30]!==p?(N=O&&(0,i.jsxs)("div",{className:"d-flex flex-items-center",id:H,children:[(0,i.jsxs)("div",{className:"pt-1",children:["Add ",n?"":"a"," comment on "]}),(0,i.jsx)(eI,{ariaLabelId:H,currentLineNumberText:n?"file":t??"",baseEndLineNumber:m,baseStartLineNumber:p.startLineNumber,diffSide:o?"LEFT":"RIGHT",setCommentLineChangeConfig:T})]}),k[24]=t,k[25]=H,k[26]=n,k[27]=o,k[28]=m,k[29]=O,k[30]=p,k[31]=N):N=k[31],k[32]!==L||k[33]!==S||k[34]!==N?(_=(0,i.jsxs)(c.A,{as:"h4",className:"f5 ml-1 pt-1 pb-2 d-flex",children:[L,S,N]}),k[32]=L,k[33]=S,k[34]=N,k[35]=_):_=k[35],k[36]!==g||k[37]!==B||k[38]!==E?(w=g&&E&&(0,i.jsx)(u.K,{variant:"invisible",icon:d.XIcon,onClick:B,"aria-label":"Cancel"}),k[36]=g,k[37]=B,k[38]=E,k[39]=w):w=k[39],k[40]!==w||k[41]!==_?(D=(0,i.jsxs)("div",{className:"d-flex flex-justify-between flex-items-center",children:[_,w]}),k[40]=w,k[41]=_,k[42]=D):D=k[42];let K=n??!1,U=o?"LEFT":"RIGHT";return k[43]!==R||k[44]!==a||k[45]!==A||k[46]!==F||k[47]!==m||k[48]!==B||k[49]!==p||k[50]!==K||k[51]!==U?(I=(0,i.jsx)(eC,{focusOnMount:A,condensed:!1,fileLevelComment:K,filePath:a,lineNumber:m,onAddComment:F,onCancelComment:B,commentLineChangeConfig:R,side:U,...p}),k[43]=R,k[44]=a,k[45]=A,k[46]=F,k[47]=m,k[48]=B,k[49]=p,k[50]=K,k[51]=U,k[52]=I):I=k[52],k[53]!==D||k[54]!==I?(j=(0,i.jsxs)("div",{className:"px-2 pb-2 pt-1",children:[D,I]}),k[53]=D,k[54]=I,k[55]=j):j=k[55],j}eT.displayName="StartThreadComment";var eO=n(49242),e$=n(40846),eF=n(97286),eM=n(16497),eB=n(7478);function eH(e){let t,n,a,l,o,s,d=(0,r.c)(29),{queryConfig:c,initialData:u}=e;if(u&&(u.proseDiffHtml||u.renderInfo||u.dependencyDiffPath)){let e;d[0]!==u.dependencyDiffPath||d[1]!==u.proseDiffHtml||d[2]!==u.renderInfo?(e={proseDiffHtml:u.proseDiffHtml,renderInfo:u.renderInfo,dependencyDiffPath:u.dependencyDiffPath},d[0]=u.dependencyDiffPath,d[1]=u.proseDiffHtml,d[2]=u.renderInfo,d[3]=e):e=d[3],s=e}let m=c?.key,f=c?.args;d[4]!==m||d[5]!==f?(t=[m,f],d[4]=m,d[5]=f,d[6]=t):t=d[6],d[7]!==c?(n=async()=>await c?.fetcher(c.args)||{},d[7]=c,d[8]=n):n=d[8];let h=!!c;d[9]!==s||d[10]!==t||d[11]!==n||d[12]!==h?(a={queryKey:t,queryFn:n,initialData:s,staleTime:1/0,enabled:h},d[9]=s,d[10]=t,d[11]=n,d[12]=h,d[13]=a):a=d[13];let g=(0,eF.I)(a);d[14]!==s||d[15]!==c||d[16]!==g?(l=c?g:{data:s,isLoading:!1},d[14]=s,d[15]=c,d[16]=g,d[17]=l):l=d[17];let{data:p,isLoading:b}=l;d[18]!==p?(o=p||{},d[18]=p,d[19]=o):o=d[19];let{proseDiffHtml:v,renderInfo:C,dependencyDiffPath:x}=o;if(b){let e;return d[20]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)("div",{className:"d-flex flex-justify-center tmp-p-4",children:(0,i.jsx)(eB.A,{size:"large"})}),d[20]=e):e=d[20],e}if(v){let e;return d[21]!==v?(e=(0,i.jsx)("div",{className:"prose-diff position-relative",children:(0,i.jsx)(eM.vb,{html:v})}),d[21]=v,d[22]=e):e=d[22],e}if(C){let e;return d[23]!==C?(e=(0,i.jsx)(eO.default,{...C,viewportClassName:"RichDiff-module__fileRendererViewport__wcmGL",iframeClassName:"RichDiff-module__fileRendererIframe__w06bk"}),d[23]=C,d[24]=e):e=d[24],e}if(x){let e,t;return d[25]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsxs)("div",{className:"text-center tmp-py-3",children:[(0,i.jsx)(eB.A,{size:"medium"}),(0,i.jsx)("p",{className:"color-fg-muted my-2",children:"Loading Dependency Review..."})]}),d[25]=e):e=d[25],d[26]!==x?(t=(0,i.jsx)("div",{children:(0,i.jsx)(e$.x,{src:x,children:e})}),d[26]=x,d[27]=t):t=d[27],t}{let e;return d[28]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)("div",{className:"d-flex flex-justify-center tmp-p-4",children:"This rich diff is not supported at the moment."}),d[28]=e):e=d[28],e}}eH.displayName="RichDiff";var eP=n(82845),eK=n(24016),eU=n(83223);function eV(e){let t,n,a,o,s,c,u,m,f,h,g=(0,r.c)(27),{children:p,helpText:v,helpUrl:C,onLoadDiff:x,diffAnchor:y}=e,L=C&&v,[S,N]=(0,l.useState)("initial");g[0]!==x?(t=async()=>{try{N("loading"),await x()}catch{N("error")}},g[0]=x,g[1]=t):t=g[1];let _=t;return g[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,b.$)("HiddenDiffPatch-module__gridColumnTemplate__o4otv"),g[2]=n):n=g[2],g[3]===Symbol.for("react.memo_cache_sentinel")?(a={maxWidth:"340px"},g[3]=a):a=g[3],g[4]===Symbol.for("react.memo_cache_sentinel")?(o=(0,i.jsx)("svg",{"aria-hidden":!0,height:"84",style:a,viewBox:"0 0 340 84",xmlns:"http://www.w3.org/2000/svg",children:(0,i.jsx)("path",{clipPath:"url(#diff-placeholder)",d:"M0 0h340v84H0z",fillRule:"evenodd",style:{fill:"var(--bgColor-muted, var(--color-canvas-subtle))"}})}),g[4]=o):o=g[4],g[5]!==S?(s="loading"===S&&(0,i.jsx)(eB.A,{size:"medium"}),g[5]=S,g[6]=s):s=g[6],g[7]!==S?(c="error"===S&&(0,i.jsx)(d.AlertIcon,{size:24}),g[7]=S,g[8]=c):c=g[8],g[9]!==S||g[10]!==_?(u="initial"===S&&(0,i.jsx)(ex.Q,{className:"h4 mx-auto fgColor-accent",variant:"invisible",onClick:()=>{_(),N("loading")},children:"Load Diff"}),g[9]=S,g[10]=_,g[11]=u):u=g[11],g[12]!==p||g[13]!==v||g[14]!==C||g[15]!==S||g[16]!==_||g[17]!==L?(m="error"===S?(0,i.jsxs)("span",{className:"fgColor-muted mt-1",children:["The contents of the file couldn't be loaded."," ",(0,i.jsx)(eU.A,{inline:!0,as:"button",onClick:()=>{_(),N("loading")},children:"Retry"})]}):(0,i.jsxs)("span",{className:"fgColor-muted mt-1",children:[p,L&&(0,i.jsx)(eU.A,{inline:!0,href:C,children:v})]}),g[12]=p,g[13]=v,g[14]=C,g[15]=S,g[16]=_,g[17]=L,g[18]=m):m=g[18],g[19]!==s||g[20]!==c||g[21]!==u||g[22]!==m?(f=(0,i.jsxs)("div",{className:n,children:[o," ",(0,i.jsxs)("div",{className:"d-flex flex-justify-center flex-column flex-column text-center flex-items-center",children:[s,c,u,m]})]}),g[19]=s,g[20]=c,g[21]=u,g[22]=m,g[23]=f):f=g[23],g[24]!==y||g[25]!==f?(h=(0,i.jsx)("div",{className:"tmp-px-3 tmp-py-4 fgColor-muted","data-diff-anchor":y,children:f}),g[24]=y,g[25]=f,g[26]=h):h=g[26],h}eV.displayName="HiddenDiffPatch";var ez=n(72609),eq=n(39879);let eG="final-hunk-header-line";function eW(e,t){return e.startBlobLineNumber-t.startBlobLineNumber}function eX(e,t){if("HUNK"===e.type&&e.__id===eG)return{currentHunk:t[t.length-1],previousHunk:t[t.length-2]};let n=t.sort(eW).findIndex(t=>t.startBlobLineNumber<=e.blobLineNumber&&t.endBlobLineNumber>=e.blobLineNumber);return{currentHunk:t[n],nextHunk:t[n+1],previousHunk:t[n-1]}}function eJ(e){let t,n=[],i=0;for(let r=1;r{let t=e.id;return{...e,id:t}}),this.markerComments=e.reduce((e,t)=>{let n=document.querySelectorAll(`[data-marker-navigation-comment-thread-id="${t.id}"]`);if(n){let i=Array.from(n).map(e=>({id:e.getAttribute("data-marker-navigation-comment-id")}));return{...e,[t.id.toString()]:i}}return e},{}),t&&!n){const e=this.markers.findIndex(e=>e.id.toString()===t.toString());-1!==e&&(this.currentMarkerPosition={markerId:t,index:e})}}focusMarker(e){let t=this.markers.findIndex(t=>t.id.toString()===e.toString());-1!==t&&(this.currentMarkerPosition={markerId:e,index:t})}get focusedMarker(){if(this.currentMarkerPosition)return this.markers[this.currentMarkerPosition.index]}moveToFirstComment(e){if(0!==this.markers.length&&!e)return}moveToNextMarker(e,t){let n;if(0===this.markers.length)return;if(t){let e=t.closest("[data-marker-id]"),n=e?.getAttribute("data-marker-id");n&&(this.currentMarkerPosition={markerId:n,index:this.markers.findIndex(e=>e.id.toString()===n.toString())})}if(!this.currentMarkerPosition){let t="ArrowUp"===e?this.markers.length-1:0,n=this.markers[t];if(!n)return;return this.currentMarkerPosition={markerId:n.id,index:t},this.markers[t]}let i=0===this.currentMarkerPosition.index,r=this.currentMarkerPosition.index===this.markers.length-1;switch(e){case"ArrowDown":if(r)return;n=(this.currentMarkerPosition.index+1)%this.markers.length;break;case"ArrowUp":if(i)return;n=(this.currentMarkerPosition.index-1+this.markers.length)%this.markers.length;break;default:return}let a=this.markers[n];if(a)return this.currentMarkerPosition={markerId:a.id,index:n},a}moveToNextMarkerItem(e,t){let n;if(!t||!this.markerComments)return;let i=t.closest("[data-marker-id]"),r=i?.getAttribute("data-marker-id");if(!i||!r)return;let a=this.markerComments[r]||[];if(0===a.length)return;let l=t.getAttribute("data-marker-navigation-comment-id"),o=a.findIndex(e=>e.id===l);if(-1===o)return;let s=o===a.length-1;switch(e){case"ArrowDown":if(s)return;n=o+1;break;case"ArrowUp":if(0===o)return;n=o-1;break;default:return}let d=a[n];if(d)return this.currentMarkerCommentPosition={markerId:d.id,index:n},d}}function e3({containerRef:e,markers:t,disabled:n=!1,focusInStrategy:i="previous"}){let r=(0,l.useRef)(void 0),a=(0,l.useRef)(void 0);(0,l.useEffect)(()=>{a.current=new e2(t,r.current?.focusedMarker?.id||void 0),r.current=a.current},[t]);let o=(0,l.useCallback)((e,t,n)=>{let i=n.key,r=!e4(t)&&!e5(t)&&!e9(t)&&!e6(t);switch(!0){case r&&("ArrowUp"===i||"ArrowDown"===i||"ArrowRight"===i||"ArrowLeft"===i):return e8(t)||e7(t)||void 0;case"ArrowUp"===i||"ArrowDown"===i:if(a.current&&e4(t)){let e=a.current.moveToNextMarker(i,e7(t));if(e)return document.querySelector(`[data-marker-id="${e.id}"]`)||void 0;return t}if(a.current&&e6(t)){let e=a.current.moveToNextMarker(i,e6(t));if(e)return document.querySelector(`[data-marker-id="${e.id}"]`)||void 0;return t}if(a.current&&e9(t)){let e=a.current.moveToNextMarkerItem(i,e9(t));if(e)return document.querySelector(`[data-marker-navigation-comment-id="${e.id}"]`)||void 0;return t}if(a.current&&e5(t)){let e=a.current.moveToNextMarkerItem(i,t);if(e)return document.querySelector(`[data-marker-navigation-comment-id="${e.id}"]`)||void 0}return t;case"ArrowRight"===i:if(e5(t))return e8(t);if(e4(t))return t?.querySelector('[data-first-thread-comment="true"]')||void 0;return t;case"ArrowLeft"===i:if(e4(t))return e7(t);if(e6(t))return e6(t);if(e9(t))return e9(t);if(e5(t))return t?.closest("[data-marker-id]")||void 0;return t;default:return t??void 0}},[a]);return(0,eZ.G)({containerRef:e,bindKeys:e0,getNextFocusable:o,focusableElementFilter:e=>!n&&!!(e.hasAttribute("data-marker-id")&&e.hasAttribute("data-marker-navigation-comment-id")),focusInStrategy:i,disabled:n},[o,n]),{markerNavigator:a}}function e4(e){return!!e?.hasAttribute("data-marker-id")}function e5(e){return!!e?.hasAttribute("data-marker-navigation-comment-id")}function e6(e){return e?.closest("[data-marker-navigation-new-thread]")??void 0}function e7(e){return e?.closest("[data-marker-id]")??void 0}function e8(e){return e?.closest("[data-marker-navigation-comment-id]")??void 0}function e9(e){return e?.closest("[data-marker-navigation-thread-reply]")??void 0}var te=n(80655);let tt="a, audio, button, details, embed, iframe, img, input, keygen, label, object, select, textarea, video";function tn(e){for(let t of(e?.setAttribute("aria-hidden","false"),Array.from(e?.querySelectorAll("*")??[])))t?.setAttribute("aria-hidden","false");for(let t of Array.from(e?.querySelectorAll(tt)??[]))t.setAttribute("tabindex","0")}function ti(e){let t,n,i=(0,r.c)(7),{commentSubjectType:a,gridCellId:o,markerRef:s,isThread:d,thread:c}=e,u=void 0!==d&&d,m=P(o);i[0]!==a||i[1]!==m||i[2]!==u||i[3]!==s||i[4]!==c?(t=()=>{let e=null;if(!u||c){if(m)"commit"===a?e=setTimeout(()=>{tn(s.current)},100):tn(s.current);else{var t;t=s.current,t?.setAttribute("aria-hidden","true"),function e(n=0){setTimeout(()=>{let n=Array.from(t?.querySelectorAll("*")??[]),i=Array.from(t?.querySelectorAll(tt)??[]);if(0===i.length)return e(200);for(let e of n)e?.setAttribute("aria-hidden","true");for(let e of i)e.setAttribute("tabindex","-1")},n)}()}return()=>{e&&clearTimeout(e)}}},n=[m,a,s,u,c],i[0]=a,i[1]=m,i[2]=u,i[3]=s,i[4]=c,i[5]=t,i[6]=n):(t=i[5],n=i[6]),(0,l.useEffect)(t,n)}var tr=n(2827);function ta(e){let t,n,a,o,s=(0,r.c)(14),{annotation:d,gridCellId:c,isFirstMarker:u}=e,m=(0,l.useRef)(null),f=P(c);s[0]!==c?(t={commentSubjectType:"pull request",gridCellId:c,markerRef:m},s[0]=c,s[1]=t):t=s[1],ti(t);let h=`annotation_${d.databaseId}`,g=u?"mb-1":"mb-2";s[2]!==g?(n=(0,b.$)("border rounded-2 color-border-default color-shadow-small overflow-hidden",g,"InlineAnnotation-module__inlineAnnotation__ww6B1"),s[2]=g,s[3]=n):n=s[3];let p=`annotation-${d.id}`,v=`${d.id}`,C=f?0:-1;return s[4]!==d?(a=(0,i.jsx)(tr.YH,{annotation:d}),s[4]=d,s[5]=a):a=s[5],s[6]!==d.annotationLevel||s[7]!==h||s[8]!==n||s[9]!==p||s[10]!==v||s[11]!==C||s[12]!==a?(o=(0,i.jsx)("div",{id:h,ref:m,className:n,"data-level":d.annotationLevel,"data-testid":p,"data-marker-id":v,tabIndex:C,children:a}),s[6]=d.annotationLevel,s[7]=h,s[8]=n,s[9]=p,s[10]=v,s[11]=C,s[12]=a,s[13]=o):o=s[13],o}ta.displayName="InlineAnnotation";var tl=n(49861),to=n(36010),ts=n(51581),td=n(59134),tc=n(70944);function tu(){let e,t,n,a=(0,r.c)(3);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)(tc.E.Visual,{children:(0,i.jsx)(d.AlertIcon,{size:24,className:"fgColor-muted tmp-mt-3 tmp-mb-3"})}),a[0]=e):e=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(tc.E.Heading,{children:(0,i.jsx)("strong",{children:"Comments cannot be loaded right now"})}),a[1]=t):t=a[1],a[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)("div",{className:"position-relative",children:(0,i.jsxs)(tc.E,{border:!0,children:[e,t,(0,i.jsx)("div",{className:"mb-n2",children:(0,i.jsx)(tc.E.Description,{children:"Refresh the page or try again later"})}),(0,i.jsx)(tc.E.SecondaryAction,{href:"https://www.githubstatus.com/",children:"GitHub status"})]})}),a[2]=n):n=a[2],n}tu.displayName="CommentErrorFallback";let tm="InlineReviewThread-module__inlineReviewThreadHeading__o7jqD";var tf=n(34810),th=n(22766),tg=n(41431),tp=n(62764),tb=n(78431),tv=n(97665),tC=n(94747),tx=n(78597),ty=n(3079),tL=n(52392),tS=n(38468),tN=n(33874);function t_(e){let t,n,a,o,s,d,c,u,m,h,p=(0,r.c)(82),{batchingEnabled:b,commentAnchorPrefix:v,lineMarkersKey:C,disableDialogMode:x,enableDialogMode:L,filePath:S,gridCellId:N,isInlineComment:_,isInDialogMode:w,onDeleteLineComment:D,thread:I,threadPositionNumber:j,shouldLimitHeight:k,suggestedChangesConfig:A,viewerData:E,ghostUser:R}=e,T=void 0===k||k,[O,$]=(0,l.useState)(!1),[F,M]=(0,l.useState)(void 0),{sendAnalyticsEvent:B}=(0,ts.s)(),H=(0,y.Kp)(),P=(0,l.useRef)(null),K=(0,l.useRef)(null),{mutate:U}=function(e,t){let n,i,a,l=(0,r.c)(13),o=(0,y.Kp)(),s=(0,tv.jE)(),d=`${o}/page_data/${tp.uT.createReviewComment}`,{updateThread:c}=(0,y.an)(),{addPendingComment:u,clearPendingReview:m}=(0,y._N)();return l[0]!==d?(n=async e=>{let t=await (0,tx.Sr)(`${d}`,{method:"POST",headers:{Accept:"application/json"},body:e}),n=await (0,tb.hp)(t);return(0,tb.R)(t,n),n},l[0]=d,l[1]=n):n=l[1],l[2]!==u||l[3]!==o||l[4]!==m||l[5]!==e||l[6]!==t||l[7]!==s||l[8]!==c?(i=(n,i)=>(void 0!==i.submitBatch&&!i.submitBatch&&n.thread&&u(Number(n.thread.id)),i.submitBatch&&m(),c(Number(n.thread.id),e,t,e=>n.thread),s.invalidateQueries({queryKey:(0,ty.XG)(o)})),l[2]=u,l[3]=o,l[4]=m,l[5]=e,l[6]=t,l[7]=s,l[8]=c,l[9]=i):i=l[9],l[10]!==n||l[11]!==i?(a={mutationFn:n,onSuccess:i},l[10]=n,l[11]=i,l[12]=a):a=l[12],(0,tC.n)(a)}(S,C),{baseOid:V,headOid:z}=(0,y.E4)();p[0]!==U||p[1]!==z||p[2]!==S||p[3]!==B||p[4]!==V||p[5]!==I.commentsData?.comments?(t=e=>{let{commentText:t,onCompleted:n,onError:i,submitBatch:r}=e,a=I.commentsData?.comments[I.commentsData?.comments.length-1];U({text:t,submitBatch:r,inReplyTo:a?.databaseId,path:S,comparisonEndOid:z,comparisonStartOid:V},{onError:i,onSuccess:e=>{var t;(t=e.comment.databaseId)&&f(t.toString()),n?.()}}),B("comments.add","ADD_COMMENT_BUTTON")},p[0]=U,p[1]=z,p[2]=S,p[3]=B,p[4]=V,p[5]=I.commentsData?.comments,p[6]=t):t=p[6];let q=t;p[7]!==B?(n=()=>{$(!1),M(void 0),B("comments.cancel_thread_reply","CANCEL_REVIEW_THREAD_BUTTON"),g.cg?.requestAnimationFrame(()=>P.current?.focus())},p[7]=B,p[8]=n):n=p[8];let G=n;p[9]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{M(e),$(!0)},p[9]=a):a=p[9];let W=a;if(!I.commentsData||null===I.commentsData.comments||I.commentsData.comments.length<1)return null;p[10]!==I?(o=(0,tL.Lm)(I),p[10]=I,p[11]=o):o=p[11];let X=o;p[12]!==X||p[13]!==I.subjectType?(s=I.subjectType?.toLowerCase()==="line"?{lineRange:X}:void 0,p[12]=X,p[13]=I.subjectType,p[14]=s):s=p[14];let J=s;p[15]!==O?(d=e=>{K.current===e.target&&(O?K.current?.querySelector("textarea")?.focus():P.current?.focus())},p[15]=O,p[16]=d):d=p[16];let Q=d;if(p[17]!==J||p[18]!==H||p[19]!==v||p[20]!==x||p[21]!==L||p[22]!==S||p[23]!==R||p[24]!==N||p[25]!==w||p[26]!==_||p[27]!==C||p[28]!==D||p[29]!==A||p[30]!==I.commentsData.__id||p[31]!==I.commentsData.comments||p[32]!==I.id||p[33]!==I.isResolved||p[34]!==I.positioning?.isOutdated||p[35]!==j||p[36]!==E){let e;p[38]!==J||p[39]!==H||p[40]!==v||p[41]!==x||p[42]!==L||p[43]!==S||p[44]!==R||p[45]!==N||p[46]!==w||p[47]!==_||p[48]!==C||p[49]!==D||p[50]!==A||p[51]!==I.commentsData.__id||p[52]!==I.commentsData.comments.length||p[53]!==I.id||p[54]!==I.isResolved||p[55]!==I.positioning?.isOutdated||p[56]!==j||p[57]!==E?(e=(e,t)=>(function(e,t){return e.reviewVariantType===te.hH.Automated&&0===t})(e,t)?(0,i.jsx)(to.t,{fallback:(0,i.jsx)(tS.k,{}),boundaryName:"AutomatedReviewThreadComment",children:(0,i.jsx)(tS.y,{anchorPrefix:v,basePath:H,comment:e,isAnchorable:!0,isInDialogMode:w,isOutdated:I.positioning?.isOutdated,onQuoteReply:W,threadId:I.id,threadPositionNumber:j},e.id)},e.id):(0,i.jsx)(tN.U,{lineMarkersKey:C,isAnchorable:!0,index:t,threadPositionNumber:j,isFirstComment:0===t,isInlineComment:_,isLastChild:t===(I.commentsData?.comments.length??0)-1,anchorPrefix:v,comment:e,commentConnectionId:I.commentsData?.__id,disableDialogMode:x,enableDialogMode:L,filePath:S,gridCellId:N,isInDialogMode:w,isOutdated:I.positioning?.isOutdated,threadId:I.id,onDeleteLineComment:D,onQuoteReply:W,threadCommentCount:I.commentsData?.comments.length,isThreadResolved:!!I.isResolved,suggestedChangesConfig:A,applySuggestedChangesValidationData:J,viewerData:E,ghostUser:R},e.id),p[38]=J,p[39]=H,p[40]=v,p[41]=x,p[42]=L,p[43]=S,p[44]=R,p[45]=N,p[46]=w,p[47]=_,p[48]=C,p[49]=D,p[50]=A,p[51]=I.commentsData.__id,p[52]=I.commentsData.comments.length,p[53]=I.id,p[54]=I.isResolved,p[55]=I.positioning?.isOutdated,p[56]=j,p[57]=E,p[58]=e):e=p[58],c=I.commentsData.comments.map(e),p[17]=J,p[18]=H,p[19]=v,p[20]=x,p[21]=L,p[22]=S,p[23]=R,p[24]=N,p[25]=w,p[26]=_,p[27]=C,p[28]=D,p[29]=A,p[30]=I.commentsData.__id,p[31]=I.commentsData.comments,p[32]=I.id,p[33]=I.isResolved,p[34]=I.positioning?.isOutdated,p[35]=j,p[36]=E,p[37]=c}else c=p[37];return p[59]!==I.reviewCommentsLimit||p[60]!==I.reviewCommentsLimitExceeded?(u=I.reviewCommentsLimitExceeded&&(0,i.jsx)(tg.l,{"aria-label":"Warning",title:"Warning",variant:"warning",hideTitle:!0,description:`Only the first ${(I.reviewCommentsLimit||0)-1} replies are currently being shown.`,className:"tmp-m-3"}),p[59]=I.reviewCommentsLimit,p[60]=I.reviewCommentsLimitExceeded,p[61]=u):u=p[61],p[62]!==q||p[63]!==b||p[64]!==G||p[65]!==S||p[66]!==Q||p[67]!==w||p[68]!==O||p[69]!==X?.endLineNumber||p[70]!==X?.startLineNumber||p[71]!==F||p[72]!==B||p[73]!==A||p[74]!==I.id||p[75]!==I.viewerCanReply?(m=I.viewerCanReply&&(0,i.jsxs)("div",{id:th.Bq.issueCommentComposer,className:"rounded-bottom-2 p-2 bgColor-inset","data-marker-navigation-comment-thread-id":I.id,"data-marker-navigation-comment-id":`${I.id}-reply-comment`,"data-marker-navigation-thread-reply":!0,tabIndex:w?0:-1,onFocus:Q,ref:K,children:[O&&(0,i.jsx)(eC,{startLineNumber:X?.startLineNumber,lineNumber:X?.endLineNumber,batchingEnabled:b,condensed:!1,fileLevelComment:!0,filePath:S,focusOnMount:!0,isReplying:!0,onCancelComment:G,quotedText:F,threadId:I.id,onAddComment:q,suggestedChangesConfig:A}),!O&&(0,i.jsx)(tf.z,{ref:P,onClick:()=>{B("comments.start_thread_reply","REPLY_TO_THREAD_INPUT_BUTTON"),$(!0)},children:"Write a reply"})]}),p[62]=q,p[63]=b,p[64]=G,p[65]=S,p[66]=Q,p[67]=w,p[68]=O,p[69]=X?.endLineNumber,p[70]=X?.startLineNumber,p[71]=F,p[72]=B,p[73]=A,p[74]=I.id,p[75]=I.viewerCanReply,p[76]=m):m=p[76],p[77]!==T||p[78]!==m||p[79]!==c||p[80]!==u?(h=(0,i.jsx)("div",{"data-testid":"review-thread",children:(0,i.jsxs)("div",{className:"ReviewThread-module__ReviewThreadContainer__TvwhT","data-limit-height":T,children:[c,u,m]})}),p[77]=T,p[78]=m,p[79]=c,p[80]=u,p[81]=h):h=p[81],h}t_.displayName="ReviewThread";var tw=n(4925);function tD(e){let t=(0,r.c)(13),{thread:n}=e,a=n.positioning??("subject"in n?n.subject:void 0);if(void 0===a)return null;if(!a.endDiffSide||!a.endLine){let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,i.jsx)("h2",{className:tm,children:"Comment on file"}),t[0]=e):e=t[0],e}let l="LEFT"===a.endDiffSide?"L":"R";if(a.startLine&&a.startDiffSide&&a.startLine!==a.endLine){let e,n,r,l="LEFT"===a.startDiffSide?"L":"R",o="LEFT"===a.endDiffSide?"L":"R",s=a.startLine??"";t[4]!==l||t[5]!==s?(e=(0,i.jsxs)("span",{className:"text-semibold fgColor-default",children:[l,s]}),t[4]=l,t[5]=s,t[6]=e):e=t[6];let d=a.endLine??"";return t[7]!==o||t[8]!==d?(n=(0,i.jsxs)("span",{className:"text-semibold fgColor-default",children:[o,d]}),t[7]=o,t[8]=d,t[9]=n):n=t[9],t[10]!==e||t[11]!==n?(r=(0,i.jsxs)("h2",{className:tm,children:["Comment on lines"," ",e," ","to"," ",n]}),t[10]=e,t[11]=n,t[12]=r):r=t[12],r}{let e,n=a.endLine??"";return t[1]!==l||t[2]!==n?(e=(0,i.jsxs)("h2",{className:tm,children:["Comment on line"," ",(0,i.jsxs)("span",{className:"text-semibold fgColor-default",children:[l,n]})]}),t[1]=l,t[2]=n,t[3]=e):e=t[3],e}}function tI(e){let t,n,a,l,o,s=(0,r.c)(19),{thread:c,isCollapsed:m,isFirstThread:f,onToggleCollapsed:h,showLabels:g}=e,p=void 0===g||g,v="commentsData"in c,C=v&&c.commentsData?.comments[0]?.reviewVariantType===te.hH.Automated?c.commentsData?.comments[0]?.automatedComment:null,x=v&&!!c.isResolved,y=!!(C&&C.dismissable);s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,b.$)("px-1","InlineReviewThread-module__ReviewThreadContainer__iFcNZ"),s[0]=t):t=s[0];let L=m?"Expand comment":"Collapse comment",S=m?d.ChevronRightIcon:d.ChevronDownIcon;return s[1]!==f||s[2]!==h||s[3]!==L||s[4]!==S?(n=(0,i.jsx)(u.K,{"aria-label":L,icon:S,size:"small",variant:"invisible",onClick:h,"data-is-first-collapse-button":f}),s[1]=f,s[2]=h,s[3]=L,s[4]=S,s[5]=n):n=s[5],s[6]!==c?(a=(0,i.jsx)(tD,{thread:c}),s[6]=c,s[7]=a):a=s[7],s[8]!==C?.isDismissed||s[9]!==C?.isFixed||s[10]!==y||s[11]!==x||s[12]!==p||s[13]!==c?(l=p&&(0,i.jsxs)("div",{className:"InlineReviewThread-module__ResolvableContainer__hBgdw",children:[c.positioning?.isOutdated&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Outdated"}),x&&!y&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Resolved"}),C?.isDismissed&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Dismissed"}),C?.isFixed&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Fixed"})]}),s[8]=C?.isDismissed,s[9]=C?.isFixed,s[10]=y,s[11]=x,s[12]=p,s[13]=c,s[14]=l):l=s[14],s[15]!==n||s[16]!==a||s[17]!==l?(o=(0,i.jsxs)("div",{className:t,children:[n,a,l]}),s[15]=n,s[16]=a,s[17]=l,s[18]=o):o=s[18],o}tD.displayName="ThreadBanner",tI.displayName="ReviewThreadHeader";var tj=n(43029),tk=n(53572),tA=n(23666),tE=n(7909);function tR(e){if(e?.commentsData?.comments[0]?.automatedComment){let t=e.commentsData?.comments[0]?.automatedComment;return{...e,isResolved:!1,resolvedBy:void 0,commentsData:{...e.commentsData,comments:[{...e.commentsData.comments[0],automatedComment:{...t,isDismissed:!1,viewerCanDismiss:!0,viewerCanReopen:!1}},...e.commentsData.comments.slice(1)]}}}}var tT=n(56373);function tO(e){let t,n,a,l=(0,r.c)(20),{automatedComment:o,thread:s,filePath:d,lineMarkersKey:c,setErrorMessage:u,setIsCollapsed:m,safeLocalStorage:f}=e,{mutate:h,isPending:g,error:p}=function(e,t){let n,i,a,l,o=(0,r.c)(12),s=(0,y.Kp)();o[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,tE.cj)(),o[0]=n):n=o[0];let d=n,c=(0,tv.jE)(),{updateThread:u}=(0,y.an)();return o[1]!==s?(i=async e=>{let{automatedReviewCommentId:t,reason:n,resolutionNote:i}=e,r=(0,tA.L7I)({basePath:s,automatedReviewCommentId:t}),a=await (0,tb.q$)(r,{method:"PUT",body:{reason:n,resolution_note:i}});(0,tb.R)(a)},o[1]=s,o[2]=i):i=o[2],o[3]!==s||o[4]!==e||o[5]!==t||o[6]!==c||o[7]!==u?(a=(n,i)=>{u(Number(i.threadId),e,t,e=>{if(e?.commentsData?.comments[0]?.automatedComment){let t=e.commentsData?.comments[0]?.automatedComment;return{...e,isResolved:!0,resolvedBy:d,commentsData:{...e.commentsData,comments:[{...e.commentsData.comments[0],automatedComment:{...t,isDismissed:!0,viewerCanDismiss:!1,viewerCanReopen:!0}},...e.commentsData.comments.slice(1)]}}}}),c.invalidateQueries({queryKey:(0,ty.XG)(s)})},o[3]=s,o[4]=e,o[5]=t,o[6]=c,o[7]=u,o[8]=a):a=o[8],o[9]!==i||o[10]!==a?(l={mutationFn:i,onSuccess:a},o[9]=i,o[10]=a,o[11]=l):l=o[11],(0,tC.n)(l)}(d,c);l[0]!==o.id||l[1]!==h||l[2]!==f||l[3]!==u||l[4]!==m||l[5]!==s.id?(t=(e,t)=>{let{reason:n,resolutionNote:i}=e,{onSuccess:r}=t;h({automatedReviewCommentId:o.id,threadId:s.id,reason:n,resolutionNote:i},{onError:()=>u("Failed to dismiss"),onSuccess:()=>{r(),m(!0),f.removeItem(`reviewThreadIsCollapsed_${s.id}`)}})},l[0]=o.id,l[1]=h,l[2]=f,l[3]=u,l[4]=m,l[5]=s.id,l[6]=t):t=l[6];let b=t,{mutate:v,isPending:C}=function(e,t){let n,i,a,l=(0,r.c)(11),o=(0,y.Kp)(),s=(0,tv.jE)(),{updateThread:d}=(0,y.an)();return l[0]!==o?(n=async e=>{let{automatedReviewCommentId:t}=e,n=(0,tA.Aav)({basePath:o,automatedReviewCommentId:t}),i=await (0,tb.q$)(n,{method:"PUT"});(0,tb.R)(i)},l[0]=o,l[1]=n):n=l[1],l[2]!==o||l[3]!==e||l[4]!==t||l[5]!==s||l[6]!==d?(i=(n,i)=>{d(Number(i.threadId),e,t,tR),s.invalidateQueries({queryKey:(0,ty.XG)(o)})},l[2]=o,l[3]=e,l[4]=t,l[5]=s,l[6]=d,l[7]=i):i=l[7],l[8]!==n||l[9]!==i?(a={mutationFn:n,onSuccess:i},l[8]=n,l[9]=i,l[10]=a):a=l[10],(0,tC.n)(a)}(d,c);l[7]!==o.id||l[8]!==v||l[9]!==f||l[10]!==u||l[11]!==m||l[12]!==s.id?(n=()=>{v({automatedReviewCommentId:o.id,threadId:s.id},{onError:()=>u("Failed to reopen"),onSuccess:()=>{m(!1),f.removeItem(`reviewThreadIsCollapsed_${s.id}`)}})},l[7]=o.id,l[8]=v,l[9]=f,l[10]=u,l[11]=m,l[12]=s.id,l[13]=n):n=l[13];let x=n,L=g||C;return l[14]!==o||l[15]!==p||l[16]!==b||l[17]!==x||l[18]!==L?(a=(0,i.jsx)(tT.K,{automatedComment:o,dismissError:p,isButtonDisabled:L,onDismiss:b,onReopen:x,className:"p-2 border-top"}),l[14]=o,l[15]=p,l[16]=b,l[17]=x,l[18]=L,l[19]=a):a=l[19],a}function t$(e){let t,n,a,o,s,c,u,m,f,h,g,p,b,v,C,x,L,S,N,_,w,D,I,k,A,E,R=(0,r.c)(84);R[0]!==e?({fileAnchor:t,filePath:n,gridCellId:o,onDeleteLineComment:u,threadId:h,threadPositionNumber:g,lineMarkersKey:c,threadsConnectionId:p,isFirstThread:s,ghostUser:a,suggestedChangesConfig:f,...m}=e,R[0]=e,R[1]=t,R[2]=n,R[3]=a,R[4]=o,R[5]=s,R[6]=c,R[7]=u,R[8]=m,R[9]=f,R[10]=h,R[11]=g,R[12]=p):(t=R[1],n=R[2],a=R[3],o=R[4],s=R[5],c=R[6],u=R[7],m=R[8],f=R[9],h=R[10],g=R[11],p=R[12]);let T=(0,y._W)(h,n,c),{mutate:O}=(0,tj.H)(n,c),$=()=>{T&&(O({threadId:T.id},{onError:()=>V("Failed to resolve thread"),onSuccess:()=>{G(!0),B.removeItem(`reviewThreadIsCollapsed_${h}`)}}),en("comments.resolve_thread","RESOLVE_CONVERSATION_BUTTON"))},F=(0,l.useRef)(null),B=(0,j.A)("localStorage"),H=T?.isResolved,[K,U]=(0,l.useState)(""),V=U,[z,q]=(0,l.useState)(H??!1),G=q,W=P(o),{disableDialogMode:X,enableDialogMode:J}=M(ee);R[13]!==H||R[14]!==h?(b=[H,h],R[13]=H,R[14]=h,R[15]=b):b=R[15],(0,l.useEffect)(()=>{let e=localStorage.getItem(`reviewThreadIsCollapsed_${h}`);null!==e?G(JSON.parse(e)):H&&G(!0)},b);let Q=(0,y.zK)();R[16]!==Q||R[17]!==T?(v=[Q,T],R[16]=Q,R[17]=T,R[18]=v):v=R[18],(0,l.useEffect)(()=>{null==Q||T?.commentsData?.comments.some(e=>e.databaseId===Q)&&G(!1)},v);let Y=()=>{window.requestAnimationFrame(()=>{B.setItem(`reviewThreadIsCollapsed_${h}`,JSON.stringify(!z))}),G(tM)};R[19]!==o||R[20]!==T?(C={commentSubjectType:"pull request",gridCellId:o,markerRef:F,isThread:!0,thread:T},R[19]=o,R[20]=T,R[21]=C):C=R[21],ti(C);e:{let e=T?.positioning??T?.subject;if(!e){x=void 0;break e}if(t&&T&&e.startDiffSide&&e.endDiffSide&&e.startLine&&e.endLine&&f?.configureSuggestedChangesFromLineRange){let n,i=e.startLine??e.endLine,r=e.startDiffSide??e.endDiffSide,a="LEFT"===e.endDiffSide?"left":"right",l="LEFT"===r?"left":"right",o="LEFT"===r?"left":"right";if(R[22]!==t||R[23]!==e.endLine||R[24]!==i||R[25]!==f||R[26]!==a||R[27]!==l||R[28]!==o){let r={diffAnchor:t,endLineNumber:e.endLine,endOrientation:a,startLineNumber:i,startOrientation:l,firstSelectedLineNumber:i,firstSelectedOrientation:o};n=f?.configureSuggestedChangesFromLineRange(r),R[22]=t,R[23]=e.endLine,R[24]=i,R[25]=f,R[26]=a,R[27]=l,R[28]=o,R[29]=n}else n=R[29];x=n;break e}x=void 0}let Z=x,{sendAnalyticsEvent:et}=(0,ts.s)(),en=et,{mutate:ei}=(0,tk.i)(n,c);R[30]!==B||R[31]!==en||R[32]!==V||R[33]!==G||R[34]!==T||R[35]!==ei?(L=()=>{T&&(ei({threadId:T.id},{onError:()=>V("Failed to unresolve thread"),onSuccess:()=>{G(!1),B.removeItem(`reviewThreadIsCollapsed_${T.id}`)}}),en("comments.unresolve_thread","RESOLVE_CONVERSATION_BUTTON"))},R[30]=B,R[31]=en,R[32]=V,R[33]=G,R[34]=T,R[35]=ei,R[36]=L):L=R[36];let er=L,ea=T?.commentsData?.comments[0]?.reviewVariantType===te.hH.Automated?T.commentsData?.comments[0]?.automatedComment:null,el=!!(ea&&ea.dismissable),eo=ea&&ea.source===te.vk.LicenseCompliance;if(!T||!((T.commentsData?.comments?.length??0)>0))return null;let es=!!T.isResolved;R[37]===Symbol.for("react.memo_cache_sentinel")?(S=(0,tE.M3)(),R[37]=S):S=R[37];let ed=S;R[38]!==T.commentsData?.comments?(N=ed&&T.commentsData?.comments?.some(tF),R[38]=T.commentsData?.comments,R[39]=N):N=R[39];let ec=N,eu=T.commentsData?.comments?.[0]?.createdAt,em=T.commentsData?.comments?.[0]?.author?.login??"Unknown Author",ef=`${H?"Unresolve":"Resolve"} comment`;if(eu){let e;R[40]!==eu?(e=(0,tl.C)(new Date(eu)),R[40]=eu,R[41]=e):e=R[41];let t=e;ef=`${H?"Unresolve":"Resolve"} ${em}'s comment, ${t}`}return R[42]===Symbol.for("react.memo_cache_sentinel")?(_=(0,i.jsx)(tu,{}),R[42]=_):_=R[42],R[43]!==Y||R[44]!==z||R[45]!==s||R[46]!==T?(w=(0,i.jsx)(tI,{thread:T,isCollapsed:z,isFirstThread:s,onToggleCollapsed:Y}),R[43]=Y,R[44]=z,R[45]=s,R[46]=T,R[47]=w):w=R[47],R[48]===Symbol.for("react.memo_cache_sentinel")?(D=(0,i.jsxs)("div",{className:"InlineReviewThread-module__ThreadLoading__JOBQj",children:[(0,i.jsx)(eB.A,{}),(0,i.jsx)("p",{children:"Loading comments"})]}),R[48]=D):D=R[48],R[49]!==K?(I=K&&(0,i.jsxs)(td.A,{variant:"danger",className:"m-2",children:[(0,i.jsx)(d.StopIcon,{className:"mr-2"}),K]}),R[49]=K,R[50]=I):I=R[50],R[51]!==ea||R[52]!==Z||R[53]!==X||R[54]!==J||R[55]!==n||R[56]!==a||R[57]!==o||R[58]!==$||R[59]!==er||R[60]!==z||R[61]!==el||R[62]!==W||R[63]!==ec||R[64]!==H||R[65]!==es||R[66]!==eo||R[67]!==c||R[68]!==u||R[69]!==ef||R[70]!==m||R[71]!==B||R[72]!==V||R[73]!==G||R[74]!==T||R[75]!==g||R[76]!==p?(k=!z&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t_,{lineMarkersKey:c,disableDialogMode:X,enableDialogMode:J,filePath:n,gridCellId:o,onDeleteLineComment:u,isInlineComment:!0,isInDialogMode:W,thread:T,threadPositionNumber:g,threadsConnectionId:p,suggestedChangesConfig:Z,shouldLimitHeight:!1,...m,ghostUser:a}),ec&&!el&&!eo&&(0,i.jsxs)("div",{className:"d-flex flex-items-center p-2 border-top flex-wrap",children:[(0,i.jsx)(ex.Q,{"aria-label":ef,onClick:es?er:$,className:"mr-2",children:H?"Unresolve comment":"Resolve comment"}),es&&T.resolvedBy&&(0,i.jsxs)("span",{className:"fgColor-muted f6",children:[(0,i.jsx)("b",{children:T.resolvedBy})," marked this comment as resolved"]})]}),el&&ea&&(0,i.jsx)(tO,{automatedComment:ea,thread:T,filePath:n,lineMarkersKey:c,setErrorMessage:V,setIsCollapsed:G,safeLocalStorage:B})]}),R[51]=ea,R[52]=Z,R[53]=X,R[54]=J,R[55]=n,R[56]=a,R[57]=o,R[58]=$,R[59]=er,R[60]=z,R[61]=el,R[62]=W,R[63]=ec,R[64]=H,R[65]=es,R[66]=eo,R[67]=c,R[68]=u,R[69]=ef,R[70]=m,R[71]=B,R[72]=V,R[73]=G,R[74]=T,R[75]=g,R[76]=p,R[77]=k):k=R[77],R[78]!==I||R[79]!==k?(A=(0,i.jsxs)(l.Suspense,{fallback:D,children:[I,k]}),R[78]=I,R[79]=k,R[80]=A):A=R[80],R[81]!==w||R[82]!==A?(E=(0,i.jsx)(to.t,{boundaryName:"InlineReviewThread",fallback:_,children:(0,i.jsxs)("div",{className:"rounded-2 bgColor-default",ref:F,children:[w,A]})}),R[81]=w,R[82]=A,R[83]=E):E=R[83],E}function tF(e){return e.state?.toUpperCase()!=="PENDING"}function tM(e){return!e}tO.displayName="InlineAutomatedReviewThreadActions",t$.displayName="InlineReviewThread";var tB=n(30572);function tH(e){let t,n,a,o,s,d,c,u,m,f,h,g,p=(0,r.c)(34),{thread:v,isFirstMarker:C,isLastThread:x,isInDialogMode:L}=e;p[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,j.A)("localStorage"),p[0]=t):t=p[0];let S=t,N=(0,l.useRef)(null),[_,w]=(0,l.useState)(!1),{updateThread:D}=(0,y.an)(),[I,k]=(0,l.useState)(!1);p[1]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{let e=N.current;if(!e)return;let t=new IntersectionObserver(e=>{e[0]&&w(e[0].isIntersecting)},{threshold:.75});return t.observe(e),()=>t.disconnect()},p[1]=n):n=p[1],p[2]!==v.id?(a=[v.id],p[2]=v.id,p[3]=a):a=p[3],(0,l.useEffect)(n,a),p[4]!==v.id?(o=()=>{let e=localStorage.getItem(`reviewThreadIsCollapsed_${v.id}`);null!==e&&k(JSON.parse(e))},s=[v.id],p[4]=v.id,p[5]=o,p[6]=s):(o=p[5],s=p[6]),(0,l.useEffect)(o,s),p[7]!==_||p[8]!==v||p[9]!==D?(d=()=>{if(_&&v.positioning&&v?.commentsData&&v.hideUntilLoadedAndInView){let e=Number(v.id),t=v.positioning.path,n="RIGHT"===v.positioning.endDiffSide?"R":"L";D(e,t,null!==v.positioning.endLine&&void 0!==v.positioning.endLine?`${n}${v.positioning.endLine}`:"FILE",e=>e?{...e,hideUntilLoadedAndInView:!1,shouldNotRenderInDiffLines:!1}:v)}},c=[_,D,v],p[7]=_,p[8]=v,p[9]=D,p[10]=d,p[11]=c):(d=p[10],c=p[11]),(0,l.useEffect)(d,c),p[12]!==I||p[13]!==v.id?(u=()=>{window.requestAnimationFrame(()=>{S.setItem(`reviewThreadIsCollapsed_${v.id}`,JSON.stringify(!I))}),k(tP)},p[12]=I,p[13]=v.id,p[14]=u):u=p[14];let A=u,E=`review-thread-without-data-${v.id}`,R=x?"mb-1":"mb-2";p[15]!==R?(m=(0,b.$)("mt-1 border rounded-2 color-border-default color-shadow-small bgColor-default",R),p[15]=R,p[16]=m):m=p[16];let T=`review-thread-without-data-${v.id}`,O=`${v.id}`,$=void 0!==L&&L?0:-1;return p[17]!==A||p[18]!==I||p[19]!==C||p[20]!==v?(f=(0,i.jsx)(tI,{thread:v,isCollapsed:I,isFirstThread:C,onToggleCollapsed:A,showLabels:!1}),p[17]=A,p[18]=I,p[19]=C,p[20]=v,p[21]=f):f=p[21],p[22]!==I?(h=!I&&(0,i.jsx)(tB.G,{}),p[22]=I,p[23]=h):h=p[23],p[24]!==C||p[25]!==_||p[26]!==E||p[27]!==m||p[28]!==T||p[29]!==O||p[30]!==$||p[31]!==f||p[32]!==h?(g=(0,i.jsxs)("div",{ref:N,className:m,"data-testid":T,"data-first-marker":C,"data-marker-id":O,"data-is-in-view":_,tabIndex:$,children:[f,h]},E),p[24]=C,p[25]=_,p[26]=E,p[27]=m,p[28]=T,p[29]=O,p[30]=$,p[31]=f,p[32]=h,p[33]=g):g=p[33],g}function tP(e){return!e}tH.displayName="ReviewThreadWithoutData";var tK=n(1325),tU=n(19519);function tV(e,t){let n,i,a,l,o=(0,r.c)(16),{sendAnalyticsEvent:s}=(0,ts.s)(),d=M(q),c=(0,y.ww)(),u=M(J),{isServer:m}=(0,tU.V)();o[0]!==d||o[1]!==e?(n=function(t){var n;let i;if(!t||t.startLineNumber===t.endLineNumber&&t.startOrientation===t.endOrientation)return"DELETION"!==e.type;let r="right"===t.startOrientation&&"right"===t.endOrientation,a=d(t)?.selectedRightLines[0],l=a&&(0,w.qK)(a)&&(0,w.Ji)(a);return!!r&&!l||(n=t,!(i=d(n)?.selectedLeftLines)||!(i.length>0)||i.every(tz))},o[0]=d,o[1]=e,o[2]=n):n=o[2],o[3]!==d||o[4]!==m||o[5]!==e?(i=function(t){let n=t?d(t)?.selectedRightLines:[];if(t&&n&&n.length>1)return m?"":(0,w.Ls)(n);if(!e)return"";let[i]=(0,w.dv)(e.text,e.type);return i},o[3]=d,o[4]=m,o[5]=e,o[6]=i):i=o[6];let f=i;o[7]!==f||o[8]!==c||o[9]!==n||o[10]!==s?(a=function(e,t){let i=!!(n(e)&&!c);return{isValidSuggestionRange:i,showSuggestChangesButton:i,sourceContentFromDiffLines:i?f(e):void 0,onInsertSuggestedChange:()=>{s("diff.add_suggested_change","ADD_SUGGESTED_CHANGE_BUTTON")},shouldInsertSuggestedChange:t}},o[7]=f,o[8]=c,o[9]=n,o[10]=s,o[11]=a):a=o[11];let h=(0,tK.K)(a);return o[12]!==h||o[13]!==u||o[14]!==t?(l={getSelectedLineRange:u,configureSuggestedChangesFromLineRange:h,shouldStartNewConversationWithSuggestedChange:t},o[12]=h,o[13]=u,o[14]=t,o[15]=l):l=o[15],l}function tz(e){return"empty-diff-line"!==e&&"DELETION"!==e.type}let tq={[te.UZ.Failure]:0,[te.UZ.Warning]:1,[te.UZ.Notice]:2};function tG(e){let t,n=(0,r.c)(2);return n[0]!==e?(t=(0,i.jsx)(eY.j,{children:(0,i.jsx)(tW,{...e})}),n[0]=e,n[1]=t):t=n[1],t}function tW(e){let t,n,a,o,s,c,m,f,h,p,v,C,x,L,S,N,_,w,D,I,j,k,A,E,R,T,O,$,F,B,H,K,U,V,z,q,G,W,X,J=(0,r.c)(123);if(J[0]!==e){let{annotations:i,cellRef:r,diffLine:l,dispatchMarkersStatus:d,children:u,conversationListThreads:g,inlineMarkersRef:b,isRowSelected:y,lineMarkersKey:I,fileAnchor:j,filePath:k,gridCellId:A,gutterSizeOffset:E,lineType:R,onCloseConversationList:T,onCloseFocusMode:O,onDeleteLineComment:$,threadsConnectionId:F,shouldStartNewConversationWithSuggestedChange:M,ghostUser:B,shouldListenForEscapeKey:H,...P}=e;t=i,n=r,s=l,c=d,a=u,o=g,C=b,x=I,m=j,f=k,p=A,v=E,L=O,S=$,D=F,w=M,h=B,_=H,N=P,J[0]=e,J[1]=t,J[2]=n,J[3]=a,J[4]=o,J[5]=s,J[6]=c,J[7]=m,J[8]=f,J[9]=h,J[10]=p,J[11]=v,J[12]=C,J[13]=x,J[14]=L,J[15]=S,J[16]=N,J[17]=_,J[18]=w,J[19]=D}else t=J[1],n=J[2],a=J[3],o=J[4],s=J[5],c=J[6],m=J[7],f=J[8],h=J[9],p=J[10],v=J[11],C=J[12],x=J[13],L=J[14],S=J[15],N=J[16],_=J[17],w=J[18],D=J[19];let Q=P(p),{disableDialogMode:Y,enableDialogMode:Z}=M(ee),et=function(e,t,n){let i,a=(0,r.c)(5),{enableDialogMode:l}=M(ee);return a[0]!==t||a[1]!==n||a[2]!==l||a[3]!==e?(i=(i,r)=>{t.current?.classList.contains("diff-text-cell")&&(l(e),n("USER_EXPANDED_MARKERS"),(void 0===i?{shouldFocusFirstMarker:!0}:i).shouldFocusFirstMarker?setTimeout(()=>{t.current?.querySelector('[data-first-marker="true"]')?.focus()},0):r&&setTimeout(()=>{t.current?.querySelector(`[data-marker-id="${r}"]`)?.focus()},0))},a[0]=t,a[1]=n,a[2]=l,a[3]=e,a[4]=i):i=a[4],i}(p,n,c),en=tV(s,w);J[20]!==o?(I=o.filter(t1),J[20]=o,J[21]=I):I=J[21];let ei=I;J[22]!==o?(j=o.filter(tZ),J[22]=o,J[23]=j):j=J[23];let er=j,ea=(0,l.useRef)(null);J[24]!==t?(k=[...t].sort(tY),J[24]=t,J[25]=k):k=J[25];let el=k;e:{let e;if(a){let e,t;J[26]===Symbol.for("react.memo_cache_sentinel")?(e={id:"new-comment"},J[26]=e):e=J[26],J[27]!==el||J[28]!==ei||J[29]!==er?(t=[...ei,e,...er,...el],J[27]=el,J[28]=ei,J[29]=er,J[30]=t):t=J[30],A=t;break e}J[31]!==el||J[32]!==ei||J[33]!==er?(e=[...ei,...er,...el],J[31]=el,J[32]=ei,J[33]=er,J[34]=e):e=J[34],A=e}let eo=A,es=tQ;J[35]!==Y||J[36]!==p||J[37]!==L||J[38]!==_?(E=e=>{let t=e.target,n=e.target,i=n.closest(`[data-grid-cell-id=${p}]`);if(_&&i?.contains(t)&&e?.key==="Escape"){L(),Y(),i?.focus();return}if(i?.contains(t)&&"true"===n.getAttribute("data-exit-dialog-mode-button")&&!e?.shiftKey&&e?.key==="Tab"){e.preventDefault(),i?.querySelector('[data-is-first-collapse-button="true"]')?.focus();return}if(i?.contains(t)&&"true"===n.getAttribute("data-is-first-collapse-button")&&e?.shiftKey&&e?.key==="Tab"){e.preventDefault(),i?.querySelector('[data-exit-dialog-mode-button="true"]')?.focus();return}},J[35]=Y,J[36]=p,J[37]=L,J[38]=_,J[39]=E):E=J[39];let ed=E;J[40]!==Z||J[41]!==p||J[42]!==Q?(R=e=>{es(e),Q||Z(p)},J[40]=Z,J[41]=p,J[42]=Q,J[43]=R):R=J[43];let ec=R;J[44]!==Y||J[45]!==Q?(T=e=>{e.target&&Q&&(e.target.closest("[data-inline-markers]")||Y())},J[44]=Y,J[45]=Q,J[46]=T):T=J[46];let eu=T;J[47]!==eu?(O=()=>(g.XC?.addEventListener("mousedown",eu),()=>g.XC?.removeEventListener("mousedown",eu)),$=[eu],J[47]=eu,J[48]=O,J[49]=$):(O=J[48],$=J[49]),(0,l.useEffect)(O,$);let em=(0,y.mF)(),ef=(0,l.useRef)(null);J[50]!==t||J[51]!==o||J[52]!==et||J[53]!==em?(F=()=>{if(em&&ef.current!==em){let e=o.map(tJ),n=t.map(tX);(e.includes(em)||n.includes(em))&&(ef.current=em,et({shouldFocusFirstMarker:!1},em))}},B=[em,et,o,t],J[50]=t,J[51]=o,J[52]=et,J[53]=em,J[54]=F,J[55]=B):(F=J[54],B=J[55]),(0,l.useEffect)(F,B);let eh=!Q;J[56]!==eo||J[57]!==eh?(H={containerRef:ea,markers:eo,disabled:eh},J[56]=eo,J[57]=eh,J[58]=H):H=J[58],e3(H);let eg=Q?"InlineMarkers-module__markersDialogActive__gXOXF":"";J[59]!==eg?(K=(0,b.$)("d-flex pt-1",eg),J[59]=eg,J[60]=K):K=J[60];let ep=`-${v}`;J[61]!==ep?(U={marginRight:ep},J[61]=ep,J[62]=U):U=J[62];let eb=Q?"false":"true";if(J[63]!==m||J[64]!==f||J[65]!==h||J[66]!==p||J[67]!==Q||J[68]!==x||J[69]!==eo||J[70]!==S||J[71]!==N||J[72]!==en||J[73]!==D||J[74]!==ei){let e;J[76]!==m||J[77]!==f||J[78]!==h||J[79]!==p||J[80]!==Q||J[81]!==x||J[82]!==eo||J[83]!==S||J[84]!==N||J[85]!==en||J[86]!==D?(e=(e,t)=>(0,i.jsx)("div",{className:(0,b.$)("mt-1 border rounded-2 color-border-default color-shadow-small",t===eo.length-1?"mb-1":"mb-2"),"data-first-marker":0===t,"data-marker-id":`${e.id}`,tabIndex:Q?0:-1,children:(0,i.jsx)(t$,{threadPositionNumber:t+1,isFirstThread:0===t,filePath:f,lineMarkersKey:x,fileAnchor:m,gridCellId:p,onDeleteLineComment:S,threadId:e.id,threadsConnectionId:D,suggestedChangesConfig:en,ghostUser:h,...N})},`review-thread-${e.id}`),J[76]=m,J[77]=f,J[78]=h,J[79]=p,J[80]=Q,J[81]=x,J[82]=eo,J[83]=S,J[84]=N,J[85]=en,J[86]=D,J[87]=e):e=J[87],V=ei.map(e),J[63]=m,J[64]=f,J[65]=h,J[66]=p,J[67]=Q,J[68]=x,J[69]=eo,J[70]=S,J[71]=N,J[72]=en,J[73]=D,J[74]=ei,J[75]=V}else V=J[75];if(J[88]!==Q||J[89]!==ei.length||J[90]!==er){let e;J[92]!==Q||J[93]!==ei.length||J[94]!==er.length?(e=(e,t)=>{let n=0===ei.length&&0===t,r=er.length;return(0,i.jsx)(tH,{thread:e,isFirstMarker:n,isLastThread:t===r-1,isInDialogMode:Q},`review-thread-without-data-${e.id}`)},J[92]=Q,J[93]=ei.length,J[94]=er.length,J[95]=e):e=J[95],z=er.map(e),J[88]=Q,J[89]=ei.length,J[90]=er,J[91]=z}else z=J[91];if(J[96]!==p||J[97]!==eo||J[98]!==el){let e;J[100]!==p||J[101]!==eo?(e=(e,t)=>{let n=0===t&&e===eo[0];return(0,i.jsx)(ta,{annotation:e,gridCellId:p,isFirstMarker:n},`annotation-${e.id}`)},J[100]=p,J[101]=eo,J[102]=e):e=J[102],q=el.map(e),J[96]=p,J[97]=eo,J[98]=el,J[99]=q}else q=J[99];return J[103]!==a||J[104]!==V||J[105]!==z||J[106]!==q?(G=(0,i.jsxs)("div",{className:"InlineMarkers-module__markersWrapper__g3Aig",ref:ea,children:[V,z,a,q]}),J[103]=a,J[104]=V,J[105]=z,J[106]=q,J[107]=G):G=J[107],J[108]!==n||J[109]!==o.length||J[110]!==Y||J[111]!==Q||J[112]!==L?(W=Q&&(0,i.jsx)(u.K,{icon:d.UndoIcon,className:(0,b.$)("InlineMarkers-module__closeMarkersDialogButton__Re5bj","ml-2 position-relative",0===o.length?"mt-2":"mt-1"),"aria-label":"Return to code","data-exit-dialog-mode-button":"true",variant:"default",size:"small",onMouseUp:()=>{L(),Y(),n.current?.focus()},onKeyDown:e=>{("Enter"===e.key||"Space"===e.code)&&(L(),Y(),n.current?.focus())}}),J[108]=n,J[109]=o.length,J[110]=Y,J[111]=Q,J[112]=L,J[113]=W):W=J[113],J[114]!==ec||J[115]!==ed||J[116]!==C||J[117]!==K||J[118]!==U||J[119]!==eb||J[120]!==G||J[121]!==W?(X=(0,i.jsxs)("div",{className:K,style:U,"aria-hidden":eb,onFocus:ec,onClick:es,onKeyDown:ed,onKeyUp:es,onMouseDown:es,onMouseUp:es,"data-inline-markers":!0,ref:C,children:[G,W]}),J[114]=ec,J[115]=ed,J[116]=C,J[117]=K,J[118]=U,J[119]=eb,J[120]=G,J[121]=W,J[122]=X):X=J[122],X}function tX(e){return e.id}function tJ(e){return e.id}function tQ(e){return e.stopPropagation()}function tY(e,t){return tq[e.annotationLevel]-tq[t.annotationLevel]}function tZ(e){return e.hideUntilLoadedAndInView}function t1(e){return!e.hideUntilLoadedAndInView}function t0(e){let t,n=(0,r.c)(4),{line:i,isRowSelected:a}=e,l=M(es);e:{let e;if(!a){let e;n[0]!==i?(e=!!i&&(0,w.xB)(i),n[0]=i,n[1]=e):e=n[1],t=e;break e}n[2]!==l?(e=l(),n[2]=l,n[3]=e):e=n[3],t=e}return t}tG.displayName="InlineMarkers",tW.displayName="InlineMarkersInternal";var t2=n(18176);function t3(){let e,t,n,i=(0,r.c)(12),a=(0,y.Kp)(),l=(0,tv.jE)(),s=`${a}/page_data/${tp.uT.createReviewComment}`,{updateThread:d}=(0,y.an)(),{onCommentThreadAdded:c}=(0,y.Ud)(),{addPendingComment:u,clearPendingReview:m}=(0,y._N)();return i[0]!==s?(e=async e=>{let t=await (0,tx.Sr)(`${s}`,{method:"POST",headers:{Accept:"application/json"},body:e}),n=await (0,tb.hp)(t);return(0,tb.R)(t,n),n},i[0]=s,i[1]=e):e=i[1],i[2]!==u||i[3]!==a||i[4]!==m||i[5]!==c||i[6]!==l||i[7]!==d?(t=(e,t)=>{let n=t.subjectType===o.Wr.File?"FILE":"right"===t.side?`R${t.line}`:`L${t.line}`,i=t.startSide&&t.startLine?"right"===t.startSide?`R${t.startLine}`:`L${t.startLine}`:void 0;void 0!==t.submitBatch&&!t.submitBatch&&e.thread&&u(Number(e.thread.id)),t.submitBatch&&m(),d(Number(e.thread.id),t.path,n,()=>{let n=(0,t2.YY)(t);return e.thread.subject=n,e.thread.positioning=n,e.thread}),c({path:t.path,diffLineKey:n,startPosition:i,threadID:e.thread.id}),l.invalidateQueries({queryKey:(0,ty.XG)(a)})},i[2]=u,i[3]=a,i[4]=m,i[5]=c,i[6]=l,i[7]=d,i[8]=t):t=i[8],i[9]!==e||i[10]!==t?(n={mutationFn:e,onSuccess:t},i[9]=e,i[10]=t,i[11]=n):n=i[11],(0,tC.n)(n)}class t4{#e;#t;#n;#i;#r;#a;#l;constructor({filePath:e,newTreeEntry:t,oldTreeEntry:n,effectiveDiffRange:i,submitBatch:r,text:a}){this.#e=i.baseOid,this.#t=e,this.#n=i.headOid,this.#i=t,this.#r=n,this.#a=r,this.#l=a}fileRequestData(){return{...this.#o(),path:this.#t,subjectType:o.Wr.File}}lineRequestData(e){let{lineNumber:t,side:n}=e;return{...this.#o(),line:t,path:this.#s(n),positioning:{type:o.Wr.Line,baseCommitOid:this.#e,headCommitOid:this.#n,path:this.#s(n),line:t,commitOid:this.#d(n)},side:n,subjectType:o.Wr.Line}}multilineRequestData(e){let{endLineNumber:t,endSide:n,startLineNumber:i,startSide:r}=e;return{...this.#o(),line:t,path:this.#s(n),positioning:{baseCommitOid:this.#e,headCommitOid:this.#n,type:o.Wr.Multiline,startPath:this.#s(r),startLine:i,startCommitOid:this.#d(r),endPath:this.#s(n),endLine:t,endCommitOid:this.#d(n)},side:n,startLine:i,startSide:r,subjectType:o.Wr.Multiline}}#s(e){return"left"===e&&this.#r?.path&&this.#i?.path&&this.#r.path!==this.#i.path?this.#r.path:this.#t}#d(e){return"left"===e?this.#e:this.#n}#o(){return{comparisonEndOid:this.#n,comparisonStartOid:this.#e,text:this.#l,submitBatch:this.#a}}}function t5(e){let t,n,a,o,s,d,c,u,m,f,h,g,p,b,v,C,x=(0,r.c)(45);if(x[0]!==e){let{diffAnchor:i,isInDialogMode:r,isLeftSide:l,isOpen:f,isRowSelected:h,onCloseCommentDialog:g,onCommentCreated:p,diffLine:b,shouldStartNewConversationWithSuggestedChange:v,...C}=e;n=r,a=l,o=f,s=h,d=g,c=p,t=b,m=v,u=C,x[0]=e,x[1]=t,x[2]=n,x[3]=a,x[4]=o,x[5]=s,x[6]=d,x[7]=c,x[8]=u,x[9]=m}else t=x[1],n=x[2],a=x[3],o=x[4],s=x[5],d=x[6],c=x[7],u=x[8],m=x[9];let{sendAnalyticsEvent:L}=(0,ts.s)(),S=(0,l.useRef)(null),N=M(J);x[10]!==t||x[11]!==a||x[12]!==s?(f={line:t,isLeftSide:a,isRowSelected:s},x[10]=t,x[11]=a,x[12]=s,x[13]=f):f=x[13];let _=function(e){let t,n,i,a,l,o,s=(0,r.c)(18),{line:d,isLeftSide:c,isRowSelected:u}=e,m=M(G),f=M(J);s[0]!==u||s[1]!==d?(t={line:d,isRowSelected:u},s[0]=u,s[1]=d,s[2]=t):t=s[2];let h=t0(t);e:{let e,t;if(!u){n=d.blobLineNumber;break e}s[3]!==f?(e=f(),s[3]=f,s[4]=e):e=s[4];let i=e;if(!i){n=d.blobLineNumber;break e}if(!c){n=i.endLineNumber;break e}if(!h){n=i.endLineNumber??d.blobLineNumber;break e}if(s[5]!==m){let e=m();t=(0,w.Lp)(e),s[5]=m,s[6]=t}else t=s[6];let r=t.leftLines,a=r[r.length-1];n=a?.blobLineNumber??d.blobLineNumber}let g=n;t:{let e,t;if(!u){i=void 0;break t}s[7]!==f?(e=f(),s[7]=f,s[8]=e):e=s[8];let n=e;if(!n){i=void 0;break t}if(!c){i=n.startLineNumber;break t}if(!h){i=n?.startLineNumber;break t}if(s[9]!==m){let e=m();t=(0,w.Lp)(e),s[9]=m,s[10]=t}else t=s[10];let r=t.leftLines[0];i=r?.blobLineNumber}let p=i;n:{if(!d||!(0,w.xB)(d)){a=c;break n}if(!u||h){a=!1;break n}let e=f();a=e?"left"===e.endOrientation:c}let b=a;i:{if(!u){l=c;break i}if(h){l=!1;break i}let e=f();l=e?"left"===e.startOrientation:c}let v=l,C=!!p&&p!==g,x=p??void 0,y=b?"left":"right",L=C?v?"left":"right":void 0;return s[11]!==h||s[12]!==C||s[13]!==g||s[14]!==x||s[15]!==y||s[16]!==L?(o={lineNumber:g,startLineNumber:x,side:y,startSide:L,isMultiline:C,allLinesAreRetargetable:h},s[11]=h,s[12]=C,s[13]=g,s[14]=x,s[15]=y,s[16]=L,s[17]=o):o=s[17],o}(f),D=tV(t,m),{newTreeEntry:I,oldTreeEntry:j}=M(ea),{effectiveRange:k}=(0,y.L3)(),{baseOid:A,headOid:E}=(0,y.E4)(),R=(0,eR.u)("cotd_ui"),T=function(e){let t;if(e.isMultiline){let n="left"===e.startSide?"L":"R",i="left"===e.side?"L":"R";t=` lines ${n}${e.startLineNumber} to ${i}${e.lineNumber}`}else{let n="left"===e.side?"L":"R";t=` line ${n}${e.lineNumber}`}return t}(_),{mutate:O}=t3();x[14]!==R||x[15]!==O||x[16]!==t||x[17]!==k||x[18]!==E||x[19]!==I||x[20]!==j||x[21]!==c||x[22]!==u||x[23]!==_||x[24]!==A?(h=e=>{let{onCompleted:n,onError:i,submitBatch:r,text:a}=e;if(t)if(R){let e=new t4({filePath:u.filePath,newTreeEntry:I,oldTreeEntry:j,effectiveDiffRange:k,submitBatch:r,text:a});O(_.isMultiline?e.multilineRequestData({startLineNumber:_.startLineNumber,startSide:_.startSide,endLineNumber:_.lineNumber,endSide:_.side}):e.lineRequestData({lineNumber:_.lineNumber,side:_.side}),{onError:i,onSuccess:e=>{n?.(e.thread.id,e.comment?.databaseId),c?.()}})}else O({text:a,line:_.lineNumber,path:u.filePath,side:_.side,startSide:_.startSide,submitBatch:r,startLine:_.startLineNumber,comparisonEndOid:E,comparisonStartOid:A},{onError:i,onSuccess:e=>{n?.(e.thread.id,e.comment?.databaseId),c?.()}})},x[14]=R,x[15]=O,x[16]=t,x[17]=k,x[18]=E,x[19]=I,x[20]=j,x[21]=c,x[22]=u,x[23]=_,x[24]=A,x[25]=h):h=x[25];let $=h;e:{if(o&&D?.configureSuggestedChangesFromLineRange){let e;if(x[26]!==N||x[27]!==D){let t=N();e=D.configureSuggestedChangesFromLineRange(t,D?.shouldStartNewConversationWithSuggestedChange),x[26]=N,x[27]=D,x[28]=e}else e=x[28];g=e;break e}g=void 0}let F=g;if(!o)return null;x[29]===Symbol.for("react.memo_cache_sentinel")?(p=e=>{e.target===S.current&&S.current.querySelector("textarea")?.focus()},x[29]=p):p=x[29];let B=p,H=n?0:-1;x[30]!==d||x[31]!==L?(b=e=>{d(e),L("comments.cancel_thread_reply","CANCEL_REVIEW_THREAD_BUTTON")},x[30]=d,x[31]=L,x[32]=b):b=x[32];let P="left"===_.side;return x[33]!==T||x[34]!==F||x[35]!==$||x[36]!==u||x[37]!==_.lineNumber||x[38]!==_.startLineNumber||x[39]!==b||x[40]!==P?(v=(0,i.jsx)(eT,{onClose:b,showOnCloseIcon:!1,suggestedChangesConfig:F,onAddComment:$,addCommentDialogTitle:T,lineNumber:_.lineNumber,startLineNumber:_.startLineNumber,isLeftSide:P,...u}),x[33]=T,x[34]=F,x[35]=$,x[36]=u,x[37]=_.lineNumber,x[38]=_.startLineNumber,x[39]=b,x[40]=P,x[41]=v):v=x[41],x[42]!==H||x[43]!==v?(C=(0,i.jsx)("div",{className:"rounded-2 bgColor-default","data-marker-navigation-new-thread":!0,"data-marker-id":"new-comment",ref:S,tabIndex:H,onFocus:B,children:v}),x[42]=H,x[43]=v,x[44]=C):C=x[44],C}t5.displayName="StartConversation";let t6="ActionBar-module__actionBarHeight__dwJkU";var t7=n(64878);function t8(e){let t,n=(0,r.c)(4),{authorAvatarUrl:a,authorLogin:l,lineSpacingPreference:o}=e,s="compact"===o?18:20,c=`${l}'s avatar image with pending indicator`;return n[0]!==a||n[1]!==s||n[2]!==c?(t=(0,i.jsx)(t7.k,{altText:c,icon:d.DotFillIcon,iconColor:"var(--fgColor-attention, var(--color-attention-fg))",square:!1,size:s,src:a,backgroundClassName:"InProgressCommentIndicator-module__statusAvatarBackground__yiUfi",className:"InProgressCommentIndicator-module__statusAvatar__eRTUu"}),n[0]=a,n[1]=s,n[2]=c,n[3]=t):t=n[3],t}t8.displayName="InProgressCommentIndicator";var t9=n(13183),ne=n(51189),nt=n(22187);function nn(e){let t,n,a,l=(0,r.c)(13),{hasDraftComment:o,handleMouseLeaveAddCommentButton:s,handleMouseDownAddCommentButton:c,lineSpacingPreference:u,openStartConversationDialog:m,authorLogin:f,authorAvatarUrl:h}=e,{sendAnalyticsEvent:g}=(0,ts.s)(),p=(0,nt.J)();l[0]!==p||l[1]!==m||l[2]!==g?(t=e=>{let t=p();(0,t9.X)()?.registerCallback({event:e.nativeEvent,cb:e=>{g("diff-lines.inp_interaction","PRS_ADD_COMMENT_BUTTON_CLICK",{latency:e.latency}),(0,ne.au)({name:"PRS_ADD_COMMENT_BUTTON_CLICK",tags:t,value:e.latency})}}),m()},l[0]=p,l[1]=m,l[2]=g,l[3]=t):t=l[3];let v=t;return l[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,b.$)("d-flex","flex-row","ActionBar-module__addCommentButton__Z5ZZ6"),l[4]=n):n=l[4],l[5]!==h||l[6]!==f||l[7]!==c||l[8]!==s||l[9]!==v||l[10]!==o||l[11]!==u?(a=(0,i.jsx)("div",{"aria-hidden":!1,className:n,children:o?(0,i.jsx)(ex.Q,{"aria-label":"Continue comment in progress",size:"small",className:(0,b.$)("py-0","compact"===u?"ActionBar-module__addCommentButtonDraftCompact__m_rxJ":"ActionBar-module__addCommentButtonDraftRelaxed__tVF5m",t6),onClick:v,onKeyDown:ni,children:(0,i.jsx)(t8,{lineSpacingPreference:u,authorAvatarUrl:h,authorLogin:f})}):(0,i.jsx)(ex.Q,{icon:d.PlusIcon,"aria-label":"Add comment",size:"small","data-add-comment-button":!0,className:(0,b.$)("fgColor-muted","bgColor-accent-emphasis","borderColor-accent-emphasis","fgColor-onEmphasis","px-0","ActionBar-module__addCommentButtonNew__mlYWD",t6,"ActionBar-module__actionBarStartCommentWidth__pPdJV"),onKeyDown:ni,onClick:v,onMouseDown:c,onMouseLeave:s,onMouseUp:v})}),l[5]=h,l[6]=f,l[7]=c,l[8]=s,l[9]=v,l[10]=o,l[11]=u,l[12]=a):a=l[12],a}function ni(e){"Tab"===e.key&&e.shiftKey&&(e.preventDefault(),e.currentTarget.closest("td")?.focus())}nn.displayName="SimpleAddCommentButton";var nr=n(47819),na=n(99889),nl=n(51705),no=n(64714);let ns={ArrowLeft:e1.z0.ArrowHorizontal,ArrowDown:e1.z0.ArrowVertical,ArrowUp:e1.z0.ArrowVertical,ArrowRight:e1.z0.ArrowHorizontal,h:e1.z0.HL,j:e1.z0.JK,k:e1.z0.JK,l:e1.z0.HL,a:e1.z0.AD,s:e1.z0.WS,w:e1.z0.WS,d:e1.z0.AD,Tab:e1.z0.Tab,Home:e1.z0.HomeAndEnd,End:e1.z0.HomeAndEnd,Backspace:e1.z0.Backspace},nd=e1.z0.ArrowAll|e1.z0.HomeAndEnd|e1.z0.AD,nc={compact:{avatarSize:18},relaxed:{avatarSize:20}},nu={avatarUrl:"https://avatars.githubusercontent.com/ghost",id:"ghost",login:"ghost",url:"/ghost",__typename:"Author"};function nm({shouldAnimateRef:e,lineSpacingPreference:t="relaxed",threads:n,annotations:r}){(0,l.useEffect)(()=>{e?.current&&(e.current=!1)},[e]);let{avatarSize:a}=nc[t],o=n.length+r.length;if(0===o)return null;let d={},c=[];r.map(e=>{e?.annotationLevel&&c.push({id:e.id,level:e.annotationLevel})}),n.map(e=>e?.commentsData?.comments?.map(e=>{e?.author?d[e?.author.login]=e.author:nu?.login&&(d[nu.login]=nu)}));let u=[...c.sort((e,t)=>(no.GF[e.level]?.priority||0)<(no.GF[t.level]?.priority||0)?-1:1).map(t=>e?.current?(0,i.jsx)(no.S,{annotationLevel:t.level},t.id):(0,i.jsx)(no.Xh,{annotationLevel:t.level},t.id)),...Object.keys(d).map(e=>{let t=d[e]?.login,n=d[e]?.avatarUrl??(nu?.avatarUrl||" ");return(0,i.jsx)(s.r,{alt:t,size:20,src:n},t)})].slice(0,3),m=o>9?"9+":`${o}`;return(0,i.jsxs)("div",{className:(0,b.$)("d-flex","flex-justify-between","flex-items-center","CommentIndicator-module__commentIndicatorContainer__rTx6B"),children:[(0,i.jsx)(nl.A,{disableExpand:!0,size:a,className:(0,b.$)("CommentIndicator-module__AvatarStack__c4pM9","relaxed"===t?"CommentIndicator-module__Relaxed__yk0Ok":"CommentIndicator-module__Compact__irtUV"),children:u}),(0,i.jsx)("span",{className:(0,b.$)("fgColor-default","ml-1","pointer","commentIndicatorText","CommentIndicator-module__textStyles__tVmbv"),children:m})]})}nm.displayName="CommentIndicator";var nf=n(89437);function nh(e){let t,n,i,a,l=(0,r.c)(18),{currentHunk:o,nextHunk:s,previousHunk:d}=e,{addInjectedContextLines:c}=M(er),u=!!o&&0!==o.startBlobLineNumber,m=!!o&&!!s;l[0]!==c||l[1]!==u||l[2]!==o||l[3]!==d?(t=()=>{if(!u||!o)return;let e=d&&o&&d.endBlobLineNumber+20>o.startBlobLineNumber,t={start:Math.max(0,o.startBlobLineNumber-20),end:o.startBlobLineNumber};e&&(t.start=d.endBlobLineNumber+1),c(t)},l[0]=c,l[1]=u,l[2]=o,l[3]=d,l[4]=t):t=l[4];let f=t;l[5]!==c||l[6]!==m||l[7]!==o?(n=()=>{m&&o&&c({start:o.endBlobLineNumber+1,end:o.endBlobLineNumber+1+20})},l[5]=c,l[6]=m,l[7]=o,l[8]=n):n=l[8];let h=n;l[9]!==c||l[10]!==d?(i=()=>{d&&c({start:d.endBlobLineNumber+1,end:d.endBlobLineNumber+1+20})},l[9]=c,l[10]=d,l[11]=i):i=l[11];let g=i;return l[12]!==m||l[13]!==u||l[14]!==h||l[15]!==g||l[16]!==f?(a={expandStartOfHunk:f,expandEndOfHunk:h,expandEndOfPreviousHunk:g,canExpandEndOfHunk:m,canExpandStartOfHunk:u},l[12]=m,l[13]=u,l[14]=h,l[15]=g,l[16]=f,l[17]=a):a=l[17],a}var ng=n(79076);let np={left:"L",right:"R"},nb="Add comment",nv="Suggest change";function nC(e,t,n){let i=n&&!(0,w.xB)(t)?np.left:np.right;return`${e} on line ${i}${t.blobLineNumber}`}function nx(e){let t,n,a,l,o,s,c,u,m,f,h,g,p,b,v,C=(0,r.c)(63),{diffLine:x,handleStartConversationWithSuggestedChange:y,handleStartConversation:L,isLeftSide:S,isSplit:N}=e,{selectMultipleLines:_}=M(ei),D=M(G),I=M(J);C[0]!==I?(t=I(),C[0]=I,C[1]=t):t=C[1];let j=t;C[2]!==D?(n=(0,w.Lp)(D()),C[2]=D,C[3]=n):n=C[3];let k=n,A=!!j;C[4]!==x||C[5]!==A?(a={line:x,isRowSelected:A},C[4]=x,C[5]=A,C[6]=a):a=C[6];let E=t0(a),R=k.leftLines[0],T=k.leftLines[k.leftLines.length-1];C[7]!==k.leftLines?(l=k.leftLines.every(ny),C[7]=k.leftLines,C[8]=l):l=C[8];let O=l,$=k.rightLines[0],F=k.rightLines[k.rightLines.length-1],B=0===k.rightLines.length,H=0===k.leftLines.length;C[9]!==R||C[10]!==L||C[11]!==y||C[12]!==T||C[13]!==_||C[14]!==j?(o=(e,t)=>{j&&T&&R&&R.left&&T.left&&R.key&&(_({endLineKey:T.key,endOrientation:"left",startLineKey:R.key,startOrientation:"left",firstLineSelectionOnDrag:{lineKey:R.key,lineNumber:R.left,orientation:"left",shouldStartConversation:!1}},eh),t?.withSuggestedChange?y():L())},C[9]=R,C[10]=L,C[11]=y,C[12]=T,C[13]=_,C[14]=j,C[15]=o):o=C[15];let P=o;C[16]!==$||C[17]!==L||C[18]!==y||C[19]!==F||C[20]!==_||C[21]!==j?(s=(e,t)=>{j&&F&&$&&$.right&&F.right&&$.key&&(_({endLineKey:F.key,endOrientation:"right",startLineKey:$.key,startOrientation:"right",firstLineSelectionOnDrag:{lineKey:$.key,lineNumber:$.right,orientation:"right",shouldStartConversation:!1}},eh),t?.withSuggestedChange?y():L())},C[16]=$,C[17]=L,C[18]=y,C[19]=F,C[20]=_,C[21]=j,C[22]=s):s=C[22];let K=s,U="DELETION"!==x.type;e:{if(!j){c=!1;break e}if(j.startOrientation!==j.endOrientation||j.startLineNumber!==j.endLineNumber){c=!0;break e}c=!1}let V=c,z=!1,q=!1;if(j&&V){let e,t=np[j.startOrientation],n=np[j.endOrientation];if(f=` on lines ${t}${j.startLineNumber}-${n}${j.endLineNumber}`,R&&T){let e;(z=!0,C[23]!==R||C[24]!==T||C[25]!==B)?(e=R.left===T.left?B?` on line L${R.left}`:`, original line L${R.left}`:B?` on lines L${R.left}-L${T.right}`:`, original lines L${R.left}-L${T.left}`,C[23]=R,C[24]=T,C[25]=B,C[26]=e):e=C[26],u=e}if($&&F){let e;(q=!0,C[27]!==E||C[28]!==$||C[29]!==N||C[30]!==F||C[31]!==H)?(e=$.right===F.right?H||N&&E?` on line R${$.right}`:`, modified line R${F.right}`:H||N&&E?` on lines R${$.right}-R${F.right}`:`, modified lines R${$.right}-R${F.right}`,C[27]=E,C[28]=$,C[29]=N,C[30]=F,C[31]=H,C[32]=e):e=C[32],m=e}return C[33]!==E||C[34]!==O||C[35]!==U||C[36]!==L||C[37]!==y||C[38]!==K||C[39]!==P||C[40]!==N||C[41]!==B||C[42]!==m||C[43]!==u||C[44]!==q||C[45]!==z||C[46]!==f?(e=(0,i.jsx)(i.Fragment,{children:N?(0,i.jsx)(i.Fragment,{children:E?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eD.l.Item,{onSelect:K,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusIcon,{})}),nb+m,(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:"Alt+n"})})]}),(0,i.jsxs)(eD.l.Item,{onSelect:e=>K(e,{withSuggestedChange:!0}),children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusCircleIcon,{})}),nv+m]})]}):(0,i.jsxs)(i.Fragment,{children:[z?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eD.l.Item,{onSelect:P,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusIcon,{})}),nb+u,(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:B?"Alt+n":"Alt+Shift+N"})})]}),O&&(0,i.jsxs)(eD.l.Item,{onSelect:e=>P(e,{withSuggestedChange:!0}),children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusCircleIcon,{})}),nv+u]})]}):null,q?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eD.l.Item,{onSelect:K,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusIcon,{})}),nb+m,(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:"Alt+n"})})]}),(0,i.jsxs)(eD.l.Item,{onSelect:e=>K(e,{withSuggestedChange:!0}),children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusCircleIcon,{})}),nv+m]})]}):null]})}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(eD.l.Item,{onSelect:L,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusIcon,{})}),nb+f]}),U&&O&&(0,i.jsxs)(eD.l.Item,{onSelect:y,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusCircleIcon,{})}),nv+f]})]})}),C[33]=E,C[34]=O,C[35]=U,C[36]=L,C[37]=y,C[38]=K,C[39]=P,C[40]=N,C[41]=B,C[42]=m,C[43]=u,C[44]=q,C[45]=z,C[46]=f,C[47]=e):e=C[47],e}return C[48]===Symbol.for("react.memo_cache_sentinel")?(h=(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusIcon,{})}),C[48]=h):h=C[48],C[49]!==S||C[50]!==x?(g=nC(nb,x,S),C[49]=S,C[50]=x,C[51]=g):g=C[51],C[52]!==L||C[53]!==g?(p=(0,i.jsxs)(eD.l.Item,{onSelect:L,children:[h,g]}),C[52]=L,C[53]=g,C[54]=p):p=C[54],C[55]!==U||C[56]!==y||C[57]!==S||C[58]!==x?(b=U&&(0,i.jsxs)(eD.l.Item,{onSelect:y,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.PlusCircleIcon,{})}),nC(nv,x,S)]}),C[55]=U,C[56]=y,C[57]=S,C[58]=x,C[59]=b):b=C[59],C[60]!==p||C[61]!==b?(v=(0,i.jsxs)(i.Fragment,{children:[p,b]}),C[60]=p,C[61]=b,C[62]=v):v=C[62],v}function ny(e){return"DELETION"!==e.type}nx.displayName="StartConversationContextMenuItems";var nL=n(15582),nS=n(14864);function nN(e){let t,n,a,l,o,s,d,c=(0,r.c)(27);return c[0]!==e?(t=(0,i.jsx)(nj,{...e}),c[0]=e,c[1]=t):t=c[1],c[2]!==e.copilotChatReference||c[3]!==e.diffAnchor||c[4]!==e.diffLine||c[5]!==e.isLeftSide||c[6]!==e.viewerData.shouldDisplayComments?(n=e.viewerData.shouldDisplayComments&&(0,i.jsx)(nD,{diffAnchor:e.diffAnchor,diffLine:e.diffLine,fileDiffReference:e.copilotChatReference,isLeftSide:e.isLeftSide}),c[2]=e.copilotChatReference,c[3]=e.diffAnchor,c[4]=e.diffLine,c[5]=e.isLeftSide,c[6]=e.viewerData.shouldDisplayComments,c[7]=n):n=c[7],c[8]!==e.handleCopyCode?(a=(0,i.jsx)(nT,{handleCopyCode:e.handleCopyCode}),c[8]=e.handleCopyCode,c[9]=a):a=c[9],c[10]!==e.diffAnchor?(l=(0,i.jsx)(nI,{diffAnchor:e.diffAnchor}),c[10]=e.diffAnchor,c[11]=l):l=c[11],c[12]!==e.diffAnchor||c[13]!==e.diffLine||c[14]!==e.viewerData.shouldDisplayComments?(o=e.viewerData.shouldDisplayComments&&(0,i.jsx)(n_,{diffAnchor:e.diffAnchor,diffLine:e.diffLine}),c[12]=e.diffAnchor,c[13]=e.diffLine,c[14]=e.viewerData.shouldDisplayComments,c[15]=o):o=c[15],c[16]!==e.currentHunk||c[17]!==e.nextHunk||c[18]!==e.previousHunk?(s=(0,i.jsx)(n$,{currentHunk:e.currentHunk,nextHunk:e.nextHunk,previousHunk:e.previousHunk}),c[16]=e.currentHunk,c[17]=e.nextHunk,c[18]=e.previousHunk,c[19]=s):s=c[19],c[20]!==t||c[21]!==n||c[22]!==a||c[23]!==l||c[24]!==o||c[25]!==s?(d=(0,i.jsxs)(i.Fragment,{children:[t,n,a,l,o,s]}),c[20]=t,c[21]=n,c[22]=a,c[23]=l,c[24]=o,c[25]=s,c[26]=d):d=c[26],d}function n_(e){let t,n,a,l,o=(0,r.c)(8),{diffLine:s,diffAnchor:c}=e,u=M(J);o[0]!==c||o[1]!==u||o[2]!==s?(t=()=>{let e=u(),t=(0,w.j2)({line:s,range:e,fileAnchor:c});t&&(0,nL.D)(t)},o[0]=c,o[1]=u,o[2]=s,o[3]=t):t=o[3];let m=t;return o[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.LinkIcon,{})}),o[4]=n):n=o[4],o[5]===Symbol.for("react.memo_cache_sentinel")?(a=(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:"Mod+Alt+y"})}),o[5]=a):a=o[5],o[6]!==m?(l=(0,i.jsxs)(eD.l.Item,{onSelect:m,onMouseDown:nw,children:[n,"Copy link",a]}),o[6]=m,o[7]=l):l=o[7],l}function nw(e){window.getSelection()?.toString()!==""&&e.preventDefault()}nN.displayName="CellContextMenu",n_.displayName="CopyAnchorLink";let nD=e=>{let t,n,a=(0,r.c)(8),l=M(J);if(a[0]!==l||a[1]!==e.diffAnchor||a[2]!==e.diffLine||a[3]!==e.isLeftSide){let n=l();t=(0,w.Av)(n,e.diffLine,e.isLeftSide,e.diffAnchor),a[0]=l,a[1]=e.diffAnchor,a[2]=e.diffLine,a[3]=e.isLeftSide,a[4]=t}else t=a[4];let o=t;return e.fileDiffReference?(a[5]!==o||a[6]!==e.fileDiffReference?(n=(0,i.jsx)(nf.w,{showDivider:!0,selectedRange:o,fileDiffReference:e.fileDiffReference}),a[5]=o,a[6]=e.fileDiffReference,a[7]=n):n=a[7],n):null};function nI(e){let t,n,a,l,o=(0,r.c)(6),{diffAnchor:s}=e;o[0]!==s?(t=()=>{setTimeout(()=>{document.querySelector(`table[data-diff-anchor="${s}"]`)?.dispatchEvent(new KeyboardEvent("keydown",{key:"a",code:"KeyA",ctrlKey:!0}))})},o[0]=s,o[1]=t):t=o[1];let c=t;return o[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.MultiSelectIcon,{})}),o[2]=n):n=o[2],o[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:"Mod+a"})}),o[3]=a):a=o[3],o[4]!==c?(l=(0,i.jsxs)(eD.l.Item,{onSelect:c,children:[n,"Select all",a]}),o[4]=c,o[5]=l):l=o[5],l}function nj(e){let t,n,a,l,o=(0,r.c)(21),{diffLine:s,handleViewMarkersSelection:d,isLeftSide:c,isSplit:u,shouldDisplayCollapseComments:m,showStartConversation:f,startConversationCurrentLine:h,startConversationWithSuggestedChange:g,threads:p,annotations:b,viewerData:v}=e,C=b.length>0;return f||p||C?(o[0]!==s||o[1]!==c||o[2]!==u||o[3]!==f||o[4]!==h||o[5]!==g||o[6]!==v.shouldDisplayComments?(t=v.shouldDisplayComments&&f&&(0,i.jsx)(nx,{diffLine:s,handleStartConversation:h,handleStartConversationWithSuggestedChange:g,isLeftSide:c,isSplit:u}),o[0]=s,o[1]=c,o[2]=u,o[3]=f,o[4]=h,o[5]=g,o[6]=v.shouldDisplayComments,o[7]=t):t=o[7],o[8]!==b||o[9]!==s||o[10]!==d||o[11]!==c||o[12]!==u||o[13]!==m||o[14]!==p||o[15]!==v?(n=(0,i.jsx)(nk,{threads:p,annotations:b,diffLine:s,handleViewMarkersSelection:d,isLeftSide:c,isSplit:u,shouldDisplayCollapseComments:m,viewerData:v}),o[8]=b,o[9]=s,o[10]=d,o[11]=c,o[12]=u,o[13]=m,o[14]=p,o[15]=v,o[16]=n):n=o[16],o[17]===Symbol.for("react.memo_cache_sentinel")?(a=(0,i.jsx)(eD.l.Divider,{}),o[17]=a):a=o[17],o[18]!==t||o[19]!==n?(l=(0,i.jsxs)(i.Fragment,{children:[t,n,a]}),o[18]=t,o[19]=n,o[20]=l):l=o[20],l):null}function nk(e){let t,n=(0,r.c)(14),{diffLine:a,handleViewMarkersSelection:l,isLeftSide:o,isSplit:s,threads:d,annotations:c,shouldDisplayCollapseComments:u,viewerData:m}=e;if(m.commentsPreference===na.sI.Visible)return null;if(!s){let e,t;return n[0]!==l?(e=()=>l(),n[0]=l,n[1]=e):e=n[1],n[2]!==c||n[3]!==a||n[4]!==u||n[5]!==e||n[6]!==d?(t=(0,i.jsx)(nE,{threads:d,annotations:c,diffLine:a,onSelect:e,shouldDisplayCollapseComments:u}),n[2]=c,n[3]=a,n[4]=u,n[5]=e,n[6]=d,n[7]=t):t=n[7],t}return n[8]!==c||n[9]!==l||n[10]!==o||n[11]!==u||n[12]!==d?(t=(0,i.jsx)(nA,{threads:d,annotations:c,handleViewMarkersSelection:l,isLeftSide:o,shouldDisplayCollapseComments:u}),n[8]=c,n[9]=l,n[10]=o,n[11]=u,n[12]=d,n[13]=t):t=n[13],t}function nA(e){let t,n,a=(0,r.c)(13),{handleViewMarkersSelection:l,isLeftSide:o,shouldDisplayCollapseComments:s,threads:d,annotations:c}=e,u=d.length>0,m=c.length>0;if(o){let e,t;return a[0]!==l||a[1]!==u||a[2]!==s?(e=u&&(0,i.jsx)(nR,{text:s?"Collapse comments":"Expand comments",onSelect:()=>l("LEFT")}),a[0]=l,a[1]=u,a[2]=s,a[3]=e):e=a[3],a[4]!==e?(t=(0,i.jsx)(i.Fragment,{children:e}),a[4]=e,a[5]=t):t=a[5],t}return a[6]!==l||a[7]!==m||a[8]!==u||a[9]!==s?(t=(u||m)&&(0,i.jsx)(nR,{text:s?"Collapse comments":"Expand comments",onSelect:()=>l("RIGHT")}),a[6]=l,a[7]=m,a[8]=u,a[9]=s,a[10]=t):t=a[10],a[11]!==t?(n=(0,i.jsx)(i.Fragment,{children:t}),a[11]=t,a[12]=n):n=a[12],n}function nE(e){let t,n,a=(0,r.c)(5),{diffLine:l,onSelect:o,threads:s,annotations:d,shouldDisplayCollapseComments:c}=e;if(!(l&&(s.length>0||d.length>0)))return null;let u=c?"Collapse comments":"Expand comments";return a[0]!==o?(t=()=>o(),a[0]=o,a[1]=t):t=a[1],a[2]!==u||a[3]!==t?(n=(0,i.jsx)(nR,{text:u,onSelect:t}),a[2]=u,a[3]=t,a[4]=n):n=a[4],n}function nR(e){let t,n,a=(0,r.c)(4),{onSelect:l,text:o}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.CommentDiscussionIcon,{})}),a[0]=t):t=a[0],a[1]!==l||a[2]!==o?(n=(0,i.jsxs)(eD.l.Item,{onSelect:l,children:[t,o]}),a[1]=l,a[2]=o,a[3]=n):n=a[3],n}function nT(e){let t,n,a,l=(0,r.c)(4),{handleCopyCode:o}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.CopyIcon,{})}),l[0]=t):t=l[0],l[1]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(eD.l.TrailingVisual,{children:(0,i.jsx)(ng.U,{keys:"Mod+c"})}),l[1]=n):n=l[1],l[2]!==o?(a=(0,i.jsxs)(eD.l.Item,{onSelect:o,onMouseDown:nO,children:[t,"Copy",n]}),l[2]=o,l[3]=a):a=l[3],a}function nO(e){window.getSelection()?.toString()!==""&&e.preventDefault()}function n$(e){let t,n,a,l,o=(0,r.c)(12),{currentHunk:s,nextHunk:d,previousHunk:c}=e,u=M(Z);o[0]!==s||o[1]!==d||o[2]!==c?(t={currentHunk:s,nextHunk:d,previousHunk:c},o[0]=s,o[1]=d,o[2]=c,o[3]=t):t=o[3];let{canExpandStartOfHunk:m,canExpandEndOfHunk:f}=nh(t);return m||f||c||d?(o[4]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(eD.l.Divider,{}),o[4]=n):n=o[4],o[5]!==s||o[6]!==u||o[7]!==d||o[8]!==c?(a=u.has(nS.YR.expandLines)?null:(0,i.jsx)(nF,{currentHunk:s,nextHunk:d,previousHunk:c}),o[5]=s,o[6]=u,o[7]=d,o[8]=c,o[9]=a):a=o[9],o[10]!==a?(l=(0,i.jsxs)(i.Fragment,{children:[n,a]}),o[10]=a,o[11]=l):l=o[11],l):null}function nF(e){let t,n,a,l,o=(0,r.c)(13),{currentHunk:s,nextHunk:c,previousHunk:u}=e;o[0]!==s||o[1]!==c||o[2]!==u?(t={currentHunk:s,nextHunk:c,previousHunk:u},o[0]=s,o[1]=c,o[2]=u,o[3]=t):t=o[3];let{canExpandStartOfHunk:m,expandEndOfHunk:f,expandStartOfHunk:h,canExpandEndOfHunk:g}=nh(t);return o[4]!==m||o[5]!==h?(n=m&&(0,i.jsxs)(eD.l.Item,{onSelect:h,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.FoldUpIcon,{})}),"Expand above"]}),o[4]=m,o[5]=h,o[6]=n):n=o[6],o[7]!==g||o[8]!==f?(a=g&&(0,i.jsxs)(eD.l.Item,{onSelect:f,children:[(0,i.jsx)(eD.l.LeadingVisual,{children:(0,i.jsx)(d.FoldDownIcon,{})}),"Expand below"]}),o[7]=g,o[8]=f,o[9]=a):a=o[9],o[10]!==n||o[11]!==a?(l=(0,i.jsxs)(i.Fragment,{children:[n,a]}),o[10]=n,o[11]=a,o[12]=l):l=o[12],l}async function nM({diffLine:e,diffLines:t,getSelectedDiffLines:n,getSelectedLineRange:i,isSplit:r,isLeftSide:a}){let l,o=window.getSelection();if(o&&""!==o.toString())return void document.execCommand("copy");let s=n().length<=1;switch(!0){case s:l=nH(e);break;case r:l=nP({diffLines:t,diffOrientation:a?"left":"right",getSelectedLineRange:i});break;default:l=nB({diffLines:t,getSelectedLineRange:i})}await (0,nL.D)(l)}nD.displayName="CopilotListItems",nI.displayName="SelectAllListItem",nj.displayName="MarkerListItems",nk.displayName="ViewMarkerListItems",nA.displayName="SplitDiffMarkersListItems",nE.displayName="UnifiedDiffMarkerListItem",nR.displayName="MarkerListItem",nT.displayName="CopyContentListItems",n$.displayName="HunkListItems",nF.displayName="ExpandHunksListItems";let nB=({diffLines:e,getSelectedLineRange:t})=>{let n=t();if(!n)return"";let{startOrientation:i,endOrientation:r,startLineNumber:a,endLineNumber:l}=n,o=0,s=0;return e.length>1&&(o=e.findIndex(e=>"left"===i?e.left===a:e.right===a),s=e.findIndex(e=>"left"===r?e.left===l:e.right===l)),(0,w.Ls)(e.slice(o,s+1))},nH=e=>(0,w.Po)(e)||!e?"":(0,w.Ls)([e]),nP=({diffLines:e,diffOrientation:t,getSelectedLineRange:n})=>{if(void 0===t)return"";let i=n();if(!i)return"";let r=(0,w.Mk)(e),{selectedRightLines:a,selectedLeftLines:l}=D({selectedLineRange:i,leftLines:r.leftLines,rightLines:r.rightLines});return"left"===t?(0,w.Ls)(l):(0,w.Ls)(a)};function nK(e){let t,n,a,o,s,c,u,m,f,h,g=(0,r.c)(53),{showStartConversation:p,viewerData:v,openStartConversationDialog:C,threads:x,annotations:y,shouldDisplayMinimizedComments:L,diffAnchor:S,diffLine:N,isLeftSide:_,isSplit:w,nextHunk:D,previousHunk:I,currentHunk:j,copilotChatReference:k,shouldDisplayCollapseComments:A,toggleViewingMarkers:E,setShouldStartNewConversationWithSuggestedChange:R,setIsContextMenuOpen:T,contextMenuOpen:O}=e,$=(0,l.useRef)(null),F=x.reduce(nU,0),B=y.length,{commentsPreference:H,lineSpacingPreference:P}=v,K=M(W),U=M(G),V=M(J);g[0]!==N||g[1]!==K||g[2]!==U||g[3]!==V||g[4]!==_||g[5]!==w?(t=async()=>{let e=K();await nM({diffLine:N,diffLines:e,getSelectedDiffLines:U,getSelectedLineRange:V,isSplit:w,isLeftSide:_})},g[0]=N,g[1]=K,g[2]=U,g[3]=V,g[4]=_,g[5]=w,g[6]=t):t=g[6];let z=t,q=F+B>0&&H===na.sI.Collapsed;g[7]!==y.length||g[8]!==x.length||g[9]!==E?(n=e=>{(1===x.length||1===y.length)&&e.preventDefault(),E?.()},g[7]=y.length,g[8]=x.length,g[9]=E,g[10]=n):n=g[10];let X=n;return g[11]===Symbol.for("react.memo_cache_sentinel")?(a=(0,b.$)("d-flex","flex-row","ActionBar-module__action-bar-position__QToB4"),g[11]=a):a=g[11],g[12]!==y||g[13]!==O||g[14]!==X||g[15]!==P||g[16]!==L||g[17]!==x||g[18]!==q?(o=q&&L&&(0,i.jsx)(ex.Q,{"aria-expanded":O,"aria-label":"View comments",size:"small",className:(0,b.$)("py-0","px-1",t6),onClick:X,children:(0,i.jsx)(nm,{threads:x,annotations:y,lineSpacingPreference:P})}),g[12]=y,g[13]=O,g[14]=X,g[15]=P,g[16]=L,g[17]=x,g[18]=q,g[19]=o):o=g[19],g[20]!==O||g[21]!==T?(s=()=>T(!O),g[20]=O,g[21]=T,g[22]=s):s=g[22],g[23]===Symbol.for("react.memo_cache_sentinel")?(c=(0,b.$)("fgColor-muted","ActionBar-module__actionBarArrowSizing__T5m0o"),g[23]=c):c=g[23],g[24]!==O||g[25]!==T?(u=(0,i.jsx)(ew.W.Anchor,{children:(0,i.jsx)(ex.Q,{ref:$,"aria-haspopup":"true","aria-label":"More actions",icon:d.TriangleDownIcon,size:"small",className:c,onClick:()=>T(!O)})}),g[24]=O,g[25]=T,g[26]=u):u=g[26],g[27]!==y||g[28]!==k||g[29]!==j||g[30]!==S||g[31]!==N||g[32]!==z||g[33]!==_||g[34]!==w||g[35]!==D||g[36]!==C||g[37]!==I||g[38]!==R||g[39]!==A||g[40]!==p||g[41]!==x||g[42]!==E||g[43]!==v?(m=(0,i.jsx)(ew.W.Overlay,{width:"medium",children:(0,i.jsx)(eD.l,{children:(0,i.jsx)(nN,{threads:x,annotations:y,currentHunk:j,diffAnchor:S,diffLine:N,shouldDisplayCollapseComments:A,copilotChatReference:k,showStartConversation:p,handleCopyCode:z,handleViewMarkersSelection:E,isLeftSide:_,isSplit:w,nextHunk:D,previousHunk:I,startConversationCurrentLine:C,startConversationWithSuggestedChange:R,viewerData:v})})}),g[27]=y,g[28]=k,g[29]=j,g[30]=S,g[31]=N,g[32]=z,g[33]=_,g[34]=w,g[35]=D,g[36]=C,g[37]=I,g[38]=R,g[39]=A,g[40]=p,g[41]=x,g[42]=E,g[43]=v,g[44]=m):m=g[44],g[45]!==O||g[46]!==s||g[47]!==u||g[48]!==m?(f=(0,i.jsxs)(ew.W,{anchorRef:$,open:O,onOpenChange:s,children:[u,m]}),g[45]=O,g[46]=s,g[47]=u,g[48]=m,g[49]=f):f=g[49],g[50]!==o||g[51]!==f?(h=(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{"aria-hidden":!1,className:a,children:(0,i.jsxs)(nr.A,{className:"ActionBar-module__action-bar-button-group___4uda",children:[o,f]})})}),g[50]=o,g[51]=f,g[52]=h):h=g[52],h}function nU(e,t){return e+(t.commentsData?.comments.length??0)}nK.displayName="SimpleContextMenu";let nV=new Set,nz=!1,nq=e=>{let t=e.target instanceof Node?e.target:null;for(let e of nV){let{element:n,shouldIgnore:i,onPointerExit:r}=e;if(!n.isConnected){nV.delete(e);continue}if(t&&n.contains(t)){e.pendingExit=!1;continue}e.pendingExit=!0,i?.()||(e.pendingExit=!1,r())}0===nV.size&&nG()},nG=()=>{nz&&g.XC&&!(nV.size>0)&&(g.XC.removeEventListener("pointermove",nq),nz=!1)};function nW(e){let t,n,a,o,s,d,c,u,m,f,h=(0,r.c)(54),{ref:p,annotations:b,authorAvatarUrl:v,authorLogin:C,copilotChatReference:x,currentHunk:y,diffAnchor:L,diffLine:S,hasDraftComment:N,handleMouseLeaveAddCommentButton:_,handleMouseDownAddCommentButton:w,isLeftSide:D,isSplit:I,nextHunk:j,previousHunk:k,shouldDisplayCollapseComments:A,shouldDisplayMinimizedComments:E,shouldDisplayComments:R,threads:T,toggleViewingMarkers:O,viewerData:F,openStartConversationDialog:B,setIsContextMenuOpen:H,cellId:P,isAddCommentBoxOpen:K,filePath:U,contextMenuOpen:V}=e,z=M(J);e:{if(!R){t=!0;break e}if(K||!F.viewerCanComment){t=!1;break e}t=!0}let q=t,G=M(ed);h[0]!==P||h[1]!==G?(n=()=>{G(P)},h[0]=P,h[1]=G,h[2]=n):n=h[2];let W=(0,l.useEffectEvent)(n);h[3]!==p||h[4]!==V||h[5]!==W?(a=()=>{if(p?.current)return function(e){let{element:t}=e;if(!t)return()=>{};let n={...e,pendingExit:!1};return nV.add(n),!nz&&g.XC&&(g.XC.addEventListener("pointermove",nq),nz=!0),()=>{nV.delete(n),nG()}}({element:p?.current,shouldIgnore:()=>V,onPointerExit:W})},h[3]=p,h[4]=V,h[5]=W,h[6]=a):a=h[6],h[7]!==p||h[8]!==P||h[9]!==V?(o=[p,V,P],h[7]=p,h[8]=P,h[9]=V,h[10]=o):o=h[10],(0,l.useEffect)(a,o),h[11]!==L||h[12]!==S||h[13]!==U||h[14]!==z||h[15]!==D?(s=()=>{let e=z();e||(e={startLineNumber:S.blobLineNumber,endLineNumber:S.blobLineNumber,startOrientation:D?"left":"right",endOrientation:D?"left":"right",diffAnchor:L});let t=new $.L(e,U);g.cg?.dispatchEvent(t)},h[11]=L,h[12]=S,h[13]=U,h[14]=z,h[15]=D,h[16]=s):s=h[16];let X=s;h[17]!==v||h[18]!==C||h[19]!==w||h[20]!==_||h[21]!==N||h[22]!==X||h[23]!==B||h[24]!==q||h[25]!==F.lineSpacingPreference?(d=q&&(0,i.jsx)(nn,{hasDraftComment:N,handleMouseLeaveAddCommentButton:_,handleMouseDownAddCommentButton:w,lineSpacingPreference:F.lineSpacingPreference,openStartConversationDialog:()=>{B(!1),X()},authorLogin:C,authorAvatarUrl:v}),h[17]=v,h[18]=C,h[19]=w,h[20]=_,h[21]=N,h[22]=X,h[23]=B,h[24]=q,h[25]=F.lineSpacingPreference,h[26]=d):d=h[26],h[27]!==X||h[28]!==B?(c=()=>{B(!1),X()},u=()=>{B(!0),X()},h[27]=X,h[28]=B,h[29]=c,h[30]=u):(c=h[29],u=h[30]);let Q=E??!1;return h[31]!==b||h[32]!==V||h[33]!==x||h[34]!==y||h[35]!==L||h[36]!==S||h[37]!==D||h[38]!==I||h[39]!==j||h[40]!==k||h[41]!==H||h[42]!==A||h[43]!==q||h[44]!==c||h[45]!==u||h[46]!==Q||h[47]!==T||h[48]!==O||h[49]!==F?(m=(0,i.jsx)(nK,{showStartConversation:q,viewerData:F,openStartConversationDialog:c,setShouldStartNewConversationWithSuggestedChange:u,setIsContextMenuOpen:H,contextMenuOpen:V,threads:T,annotations:b,shouldDisplayMinimizedComments:Q,diffAnchor:L,diffLine:S,isLeftSide:D,isSplit:I,nextHunk:j,previousHunk:k,currentHunk:y,copilotChatReference:x,shouldDisplayCollapseComments:A,toggleViewingMarkers:O}),h[31]=b,h[32]=V,h[33]=x,h[34]=y,h[35]=L,h[36]=S,h[37]=D,h[38]=I,h[39]=j,h[40]=k,h[41]=H,h[42]=A,h[43]=q,h[44]=c,h[45]=u,h[46]=Q,h[47]=T,h[48]=O,h[49]=F,h[50]=m):m=h[50],h[51]!==m||h[52]!==d?(f=(0,i.jsxs)(i.Fragment,{children:[d,m]}),h[51]=m,h[52]=d,h[53]=f):f=h[53],f}function nX(e){let t,n,a,l=(0,r.c)(5),{isSplit:o}=e,s=!o&&"hunk-kebab-icon-unified";return l[0]!==s?(t=(0,b.$)("hunk-kebab-icon pr-2 pb-1",s),l[0]=s,l[1]=t):t=l[1],l[2]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(d.KebabHorizontalIcon,{}),l[2]=n):n=l[2],l[3]!==t?(a=(0,i.jsx)("div",{className:t,children:n}),l[3]=t,l[4]=a):a=l[4],a}nW.displayName="SimpleActionBar",nW.displayName="ActionBar",nX.displayName="HunkKebabIcon";class nJ{#c=[];#u=new Map;#m=new Set;focusedGridCell;lastSelectedGridCell;#f;#h;#g;constructor(e,t,n,i,r){this.#h=e,this.#g=t,this.#p(n,i),this.focusFirstGridCell(r)}moveToNextItem(e,t){let n,i=this.#u.get(this.focusedGridCell?.cellId??"");if(!i)return;let[r]=i,[,a]=i,l=!1;switch(("ArrowDown"===e||"ArrowUp"===e)&&this.#b(r)&&void 0!==this.#f&&(a=this.#f,l=!0),!0){case t&&"Home"===e:this.focusFirstGridCell();break;case t&&"End"===e:{let e=this.#c.length-1,t=this.#c[e]?.length;t&&(n=this.#c[e]?.[t-1]);break}case"ArrowUp"===e:this.#b(r-1)?(this.#v(r,a),n=this.#c[r-1]?.[0]):n=this.#c[r-1]?.[a];break;case"ArrowDown"===e:this.#b(r+1)?(this.#v(r,a),n=this.#c[r+1]?.[0]):n=this.#c[r+1]?.[a];break;case"ArrowLeft"===e:n=this.#c[r]?.[a-1];break;case"ArrowRight"===e:n=this.#c[r]?.[a+1]}return n&&(this.focusedGridCell=n),l&&n&&!n.isHunk&&(this.#f=void 0),this.focusedGridCell}reinitializeGrid(e,t){this.#p(e,t)}focusFirstGridCell(e){e&&this.#u.get(e)?this.focusGridCell(e):this.focusedGridCell=this.#c[0]?.[0]}focusGridCell(e){if(this.focusedGridCell?.cellId===e)return;let t=this.#u.get(e);if(!t)return;let[n,i]=t;this.focusedGridCell=this.#c[n]?.[i]}getNextSelectableCell(e){let t,n=this.getValidSelectableRowCell()||this.focusedGridCell,i=this.lastSelectedGridCell||n,r=this.#u.get(i?.cellId??"");if(!r)return;let[a,l]=r;if("ArrowUp"===e){let e=a-1;for(;!t&&e>=0;)t=this.#C({rowIndex:e,columnIndex:l}),e--}if("ArrowDown"===e){let e=a+1;for(;!t&&ee[0]&&!e[0].isHunk);return e?.find(e=>!e.isEmpty)}getLastCodeCell(){let e=this.#c.slice().reverse().find(e=>e[0]&&!e[0].isHunk);return e?.slice().reverse().find(e=>!e.isEmpty)}hasLine(e,t,n){let i=(0,w.qX)(this.#h,e,t),r=(0,w.u6)(i,0),a=this.#u.get(r);if(!a)return!1;let[l]=a;return!!n===this.#b(l)}#C({rowIndex:e,columnIndex:t}){let n=this.#c[e],i=n?.[t];switch(!0){case i?.isHunk:return;case i?.orientation==="left"&&i.isEmpty:return n?.[t+2];case i?.orientation==="right"&&i.isEmpty&&this.#g:return n?.[t-2];case i?.orientation==="right"&&i.isEmpty&&!this.#g:return n?.[t+1];default:return n?.[t]}}#p(e,t){this.#c=[],this.#u=new Map,this.#m=new Set;for(let n=0;n{0!==e.tabIndex&&(e.tabIndex=0)})}function nY({addLineToSelection:e,clearSelectedLines:t,containerRef:n,fileAnchor:i,getfirstLineSelectionOnDrag:a,isSplitDiff:o,leftLines:s,rightLines:d,selectMultipleLines:c,disabled:u}){var f;let h,g,p,b,v,C,x,y,L=(0,l.useRef)(void 0),S=(0,l.useMemo)(()=>new nJ(i,o,s,d,L.current?.focusedGridCell?.cellId),[i,o,s,d]);(0,l.useEffect)(()=>{L.current=S},[S]),(0,l.useEffect)(()=>{let e=n.current,t=()=>{S.clearLastSelectedCell()};return e?.addEventListener("mousedown",t),()=>e?.removeEventListener("mousedown",t)},[n,S]),f=L.current,(p=(0,r.c)(8))[0]!==n||p[1]!==i||p[2]!==S||p[3]!==s||p[4]!==f||p[5]!==d?(h=()=>{if(f&&document.activeElement){let e=function(e,t,n){let i=[];for(let r=0;r{let t=e.target.getAttribute("data-grid-cell-id");t&&S.focusGridCell(t)},x[0]=S,x[1]=b):b=x[1],y=b,x[2]!==n||x[3]!==y?(v=()=>{let e=n.current;return e?.addEventListener("focusin",y),()=>e?.removeEventListener("focusin",y)},C=[n,y],x[2]=n,x[3]=y,x[4]=v,x[5]=C):(v=x[4],C=x[5]),(0,l.useEffect)(v,C);let N=(0,l.useCallback)((n,i,r)=>{let l=S.getValidSelectableRowCell();switch(!0){case(r.metaKey||r.ctrlKey)&&"KeyA"===r.code:{let e=S.getFirstCodeCell(),t=S.getLastCodeCell();if(!e||!t)return i;return e.lineKey&&e.lineNumber&&e.orientation&&c({endLineKey:t.lineKey,endOrientation:t.orientation,startLineKey:e.lineKey,startOrientation:e.orientation,firstLineSelectionOnDrag:{lineKey:e.lineKey,lineNumber:e.lineNumber,orientation:e.orientation,shouldStartConversation:!1}},eh),i}case r.shiftKey&&"ArrowDown"===r.key:{let t=S.getNextSelectableCell("ArrowDown");if(!t||!l)return i;return a()?e({lineKey:t.lineKey,orientation:t.orientation},eh):l.lineKey&&l.lineNumber&&l.orientation&&c({endLineKey:t.lineKey,endOrientation:t.orientation,startLineKey:l.lineKey,startOrientation:l.orientation,firstLineSelectionOnDrag:{lineKey:l.lineKey,lineNumber:l.lineNumber,orientation:l.orientation,shouldStartConversation:!1}},eh),nZ(t.cellId),i}case r.shiftKey&&"ArrowUp"===r.key:{let t=S.getNextSelectableCell("ArrowUp");if(!t||!l)return i;return a()?e({lineKey:t.lineKey,orientation:t.orientation},eh):l.lineKey&&l.lineNumber&&l.orientation&&c({endLineKey:l.lineKey,endOrientation:l.orientation,startLineKey:t.lineKey,startOrientation:t.orientation,firstLineSelectionOnDrag:{lineKey:l.lineKey,lineNumber:l.lineNumber,orientation:l.orientation,shouldStartConversation:!1}},eh),nZ(t.cellId),i}case"ArrowLeft"===r.key&&r.metaKey&&r.shiftKey:return i;case(r.metaKey||r.altKey)&&"ArrowLeft"===r.key:return void(0,m.OE)();case(r.metaKey||r.altKey)&&"ArrowRight"===r.key:return void(0,m.Qb)();default:{let e=S.moveToNextItem(r.key,r.ctrlKey),n=e&&document.querySelector(`[data-grid-cell-id=${e.cellId}]`);return t(),S.clearLastSelectedCell(),n??void 0}}},[e,a,S,c,t]);return(0,eZ.G)({containerRef:n,bindKeys:nd,getNextFocusable:N,focusableElementFilter:e=>"TD"===e.tagName&&"gridcell"===e.getAttribute("role"),focusInStrategy:"previous",disabled:u},[N]),{gridNavigator:S}}function nZ(e){let t=g.XC?.querySelector(`[data-grid-cell-id=${e}]`);!function(e){if(!g.XC||!g.cg||!e)return!1;let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(g.cg.innerHeight||g.XC.documentElement.clientHeight)&&t.right<=(g.cg.innerWidth||g.XC.documentElement.clientWidth)}(t)&&t?.scrollIntoView({block:"nearest",inline:"nearest"})}function n1(e){var t;(t=e.key)in ns&&(ns[t]&nd)>0&&e.stopPropagation()}function n0(e){let t,n,a,o,s,d,c,u=(0,r.c)(22),{diffAnchor:m,diffLine:f,isSplit:h,renderHunkButton:g}=e,p=(0,l.useRef)(null),[b,v]=function(e){let t,n,i,a,o,s,d,c=(0,r.c)(17),[u,m]=(0,l.useState)(!1),[f,h]=(0,l.useState)(!1),g=u?0:-1;c[0]!==e?(t=t=>{e.current&&e.current.contains(t.relatedTarget)||m(!1)},c[0]=e,c[1]=t):t=c[1];let p=t;c[2]!==e?(n=()=>{e.current===document.activeElement&&m(!0)},c[2]=e,c[3]=n):n=c[3];let b=n;c[4]!==e?(i=t=>{e.current&&!e.current.contains(t.relatedTarget)&&m(!1),h(!1)},c[4]=e,c[5]=i):i=c[5];let v=i;c[6]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{e.stopPropagation(),h(!0)},c[6]=a):a=c[6];let C=a;c[7]!==p||c[8]!==b?(o={onFocus:b,onBlur:p},c[7]=p,c[8]=b,c[9]=o):o=c[9];let x=o,y=!f;c[10]!==g||c[11]!==v||c[12]!==y?(s={"aria-hidden":y,tabIndex:g,onBlur:v,onFocusCapture:C,onKeyDownCapture:n1},c[10]=g,c[11]=v,c[12]=y,c[13]=s):s=c[13];let L=s;return c[14]!==L||c[15]!==x?(d=[x,L],c[14]=L,c[15]=x,c[16]=d):d=c[16],d}(p);if(u[0]!==m||u[1]!==f){let e=(0,w.qX)(m,f,f);t=(0,w.u6)(e,0),u[0]=m,u[1]=f,u[2]=t}else t=u[2];let C=t;u[3]!==m||u[4]!==f.blobLineNumber||u[5]!==f.type?(n=(0,_.IQ)(m,(0,_.XU)(f.type),f.blobLineNumber),u[3]=m,u[4]=f.blobLineNumber,u[5]=f.type,u[6]=n):n=u[6];let x=n;u[7]===Symbol.for("react.memo_cache_sentinel")?(a={userSelect:"none",position:"relative",backgroundColor:"var(--bgColor-accent-muted, var(--color-accent-subtle))",flexGrow:1},u[7]=a):a=u[7],u[8]!==v||u[9]!==h||u[10]!==g?(o=g?.(v)??(0,i.jsx)(nX,{isSplit:h}),u[8]=v,u[9]=h,u[10]=g,u[11]=o):o=u[11];let y=f.html;return u[12]!==y?(s=(0,i.jsx)("code",{className:"diff-text-cell hunk",children:(0,i.jsx)(eM.$6,{className:"diff-text-inner color-fg-muted",html:y})}),u[12]=y,u[13]=s):s=u[13],u[14]!==o||u[15]!==s?(d=(0,i.jsxs)("div",{className:"d-flex flex-row",children:[o,s]}),u[14]=o,u[15]=s,u[16]=d):d=u[16],u[17]!==C||u[18]!==b||u[19]!==x||u[20]!==d?(c=(0,i.jsx)("td",{ref:p,colSpan:4,"data-grid-cell-id":C,"data-line-anchor":x,role:"gridcell",style:a,tabIndex:-1,valign:"top",className:"diff-hunk-cell focusable-grid-cell left-side",...b,children:d}),u[17]=C,u[18]=b,u[19]=x,u[20]=d,u[21]=c):c=u[21],c}n0.displayName="HunkCell";let n2="ExpandableHunkHeaderDiffLine-module__expand-up-and-down__LHSa8";function n3(e){let t,n,a,l,o,s,d,c,u,m,f,h,g=(0,r.c)(24);g[0]!==e?({direction:o,icon:t,isSplit:s,label:d,onClick:c,ariaLabel:a,className:l,...n}=e,g[0]=e,g[1]=t,g[2]=n,g[3]=a,g[4]=l,g[5]=o,g[6]=s,g[7]=d,g[8]=c):(t=g[1],n=g[2],a=g[3],l=g[4],o=g[5],s=g[6],d=g[7],c=g[8]);let{sendAnalyticsEvent:p}=(0,ts.s)();g[9]!==c||g[10]!==p?(u=()=>{c(),p("file_entry.expand_hunk","FILE_EXPANDER_BUTTON")},g[9]=c,g[10]=p,g[11]=u):u=g[11];let v=!s&&"ExpandableHunkHeaderDiffLine-module__expand-button-unified__H6Vo1";g[12]!==l||g[13]!==v?(m=(0,b.$)("Button Button--iconOnly Button--invisible","ExpandableHunkHeaderDiffLine-module__expand-button-line__Nw5Pq",v,l),g[12]=l,g[13]=v,g[14]=m):m=g[14];let C=a??d;return g[15]!==t?(f=(0,i.jsx)(t,{}),g[15]=t,g[16]=f):f=g[16],g[17]!==n||g[18]!==o||g[19]!==u||g[20]!==m||g[21]!==C||g[22]!==f?(h=(0,i.jsx)("button",{onClick:u,className:m,"aria-label":C,"data-direction":o,...n,children:f}),g[17]=n,g[18]=o,g[19]=u,g[20]=m,g[21]=C,g[22]=f,g[23]=h):h=g[23],h}function n4(e){let t,n,a,l,o,s,c,u,m,f,h,g=(0,r.c)(24),{currentHunk:p,diffAnchor:b,diffLine:v,isSplit:C,nextHunk:x,nextLine:y,previousHunk:L,prevLine:S}=e;g[0]!==p||g[1]!==x||g[2]!==L?(t={currentHunk:p,nextHunk:x,previousHunk:L},g[0]=p,g[1]=x,g[2]=L,g[3]=t):t=g[3];let{expandStartOfHunk:N,expandEndOfPreviousHunk:_}=nh(t),w=0===v.position&&0!==v.blobLineNumber||!S,D=!y,I=0===v.blobLineNumber,j=M(en),k=w||D,A=D&&S?.blobLineNumber===j;e:{if(k||v.blobLineNumber<=0){n=!1;break e}if(v.blobLineNumber-S.blobLineNumber<=20||y.blobLineNumber-v.blobLineNumber>=20){n=!0;break e}n=!1}let E=n;t:{if(k||A){a=!1;break t}if(v.blobLineNumber-S.blobLineNumber>20){a=!0;break t}a=!1}let R=a;n:{if(v.blobLineNumber<=0||I){l=!1;break n}if(w){l=!0;break n}l=!1}let T=l;i:{if(w||A){o=!1;break i}if(D){o=!0;break i}o=!1}let O=o;r:{switch(!0){case E:s="expand-all";break r;case R:s="expand-up-and-down";break r;case T:s="expand-up";break r;case O:s="expand-down";break r}s=void 0}let $=s;g[4]!==N?(c=()=>N(),g[4]=N,g[5]=c):c=g[5];let F=c;g[6]!==_?(u=()=>_(),g[6]=_,g[7]=u):u=g[7];let B=u;g[8]!==N?(m=()=>N(),g[8]=N,g[9]=m):m=g[9];let H=m,P=M(Z);g[10]!==$||g[11]!==F||g[12]!==H||g[13]!==B||g[14]!==P||g[15]!==C||g[16]!==y?.blobLineNumber||g[17]!==S?.blobLineNumber?(f=e=>{if(P.has(nS.YR.expandLines))return null;switch($){case"expand-all":return(0,i.jsx)(n3,{...e,direction:"all",icon:d.UnfoldIcon,isSplit:C,label:`Expand file from line ${S?.blobLineNumber||""} to line ${y?.blobLineNumber||""}`,onClick:H});case"expand-up-and-down":return(0,i.jsxs)("div",{className:"d-flex flex-column",children:[(0,i.jsx)(n3,{...e,direction:"down",icon:d.FoldDownIcon,isSplit:C,label:`Expand file down from line ${S?.blobLineNumber||""}`,className:n2,onClick:B}),(0,i.jsx)(n3,{...e,direction:"up",icon:d.FoldUpIcon,isSplit:C,label:`Expand file up from line ${y?.blobLineNumber||""}`,className:n2,onClick:F})]});case"expand-up":return(0,i.jsx)(n3,{...e,direction:"up",icon:d.FoldUpIcon,isSplit:C,label:`Expand file up from line ${y?.blobLineNumber||""}`,onClick:F});case"expand-down":return(0,i.jsx)(n3,{...e,direction:"down",icon:d.FoldDownIcon,isSplit:C,label:`Expand file down from line ${S?.blobLineNumber||""}`,onClick:B});default:return null}},g[10]=$,g[11]=F,g[12]=H,g[13]=B,g[14]=P,g[15]=C,g[16]=y?.blobLineNumber,g[17]=S?.blobLineNumber,g[18]=f):f=g[18];let K=f;return g[19]!==b||g[20]!==v||g[21]!==C||g[22]!==K?(h=(0,i.jsx)(n0,{renderHunkButton:K,diffAnchor:b,diffLine:v,isSplit:C}),g[19]=b,g[20]=v,g[21]=C,g[22]=K,g[23]=h):h=g[23],h}n3.displayName="ExpandButtonLine",n4.displayName="ExpandableHunkHeaderDiffLine";let n5=(0,l.memo)(function(e){let t,n,a,l,o=(0,r.c)(11),{lineHtml:s,lineType:d,lineTypeCharacter:c}=e,u="ADDITION"===d,m="DELETION"===d;return o[0]!==u||o[1]!==m?(t=(0,b.$)("diff-text syntax-highlighted-line",{addition:u,deletion:m}),o[0]=u,o[1]=m,o[2]=t):t=o[2],o[3]!==c?(n=c&&(0,i.jsx)("span",{className:"diff-text-marker",children:c}),o[3]=c,o[4]=n):n=o[4],o[5]!==s?(a=(0,i.jsx)(eM.$6,{html:s,className:"diff-text-inner"}),o[5]=s,o[6]=a):a=o[6],o[7]!==t||o[8]!==n||o[9]!==a?(l=(0,i.jsxs)("code",{className:t,children:[n,a]}),o[7]=t,o[8]=n,o[9]=a,o[10]=l):l=o[10],l});n5.displayName="LineTextWrapper";let n6="SimpleDiff-module__comment-indicator__iwZDp";function n7(e){let t,n,a=(0,r.c)(3),{children:l}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t={left:"-1px",zIndex:"1"},a[0]=t):t=a[0],a[1]!==l?(n=(0,i.jsx)("span",{className:"position-absolute",style:t,children:l}),a[1]=l,a[2]=n):n=a[2],n}n7.displayName="DiffCodeAlert";var n8=n(73673);let n9=e=>(e.target??void 0)?.nodeName==="TD",ie=e=>{let t=ii(e),n=t?.querySelector('[data-first-marker="true"]')??t?.querySelector("[data-marker-id]");n?.focus()},it=e=>{let t=ii(e);t?.querySelector('[data-marker-id="new-comment"]')?.querySelector("textarea")?.focus()},ii=e=>{let t=e.currentTarget.classList.contains("new-diff-line-number")?e.currentTarget.nextElementSibling:e.currentTarget;return t?.classList.contains("new-diff-line-number")&&(t=t?.nextElementSibling),t},ir=["CONTEXT","INJECTED_CONTEXT"],ia="focusable-grid-cell new-diff-line-number empty-diff-line left-side",il="focusable-grid-cell new-diff-line-number left-side",io=(0,l.memo)(function(e){let t,n,a,o,s,c,u,m,f,h,g,p,v,C,x,L=(0,r.c)(109),{diffLine:S,nextDiffLine:N,prevDiffLine:D,filePath:I,avatarURL:j,userLogin:k,viewerCanApplySuggestion:A,handleMouseDownOnNumberCell:E,handleMouseEnterCell:R,handleMouseUpRow:T,handleMouseLeaveAddCommentButton:O,handleMouseDownAddCommentButton:$,copilotChatReference:F,hunksData:B,viewerCanComment:H,shouldDisplayComments:K}=e,q="HUNK"===S.type,G="ADDITION"!==S.type,W="DELETION"!==S.type,X=U(S.key),J=M(et),{enableDialogMode:Q}=M(ee),Y=(0,w.qX)(J,S,S),Z=j??"",en=k??"",ei=A??!1,er=H??!1;L[0]!==Z||L[1]!==en||L[2]!==ei||L[3]!==er?(t={avatarUrl:Z,login:en,viewerCanApplySuggestion:ei,viewerCanComment:er},L[0]=Z,L[1]=en,L[2]=ei,L[3]=er,L[4]=t):t=L[4];let ea=t;L[5]!==S.type||L[6]!==X.isSelected?(n=(0,w.Yf)(S.type,!0,X.isSelected),L[5]=S.type,L[6]=X.isSelected,L[7]=n):n=L[7];let el=n;L[8]!==S.type||L[9]!==X.isSelected?(a=(0,w.Yf)(S.type,!1,X.isSelected),L[8]=S.type,L[9]=X.isSelected,L[10]=a):a=L[10];let eo=a;L[11]!==S.html||L[12]!==S.type?(o=(0,w.x_)(S.html,S.type),L[11]=S.html,L[12]=S.type,L[13]=o):o=L[13];let[es,ef]=o;L[14]!==ef?(s=ef&&["+","-"].includes(ef),L[14]=ef,L[15]=s):s=L[15];let eh=s,[eg,ep]=(0,l.useState)(!1),[eb,ev]=(0,l.useState)(!1);L[16]!==S||L[17]!==B?(c=eX(S,B),L[16]=S,L[17]=B,L[18]=c):c=L[18];let{currentHunk:eC,nextHunk:ex,previousHunk:ey}=c,eL=`inline-dialog-heading-${(0,l.useId)()}`,eS="DELETION"!==S.type?"RIGHT":"LEFT",eN="RIGHT"===eS?S.right:S.left;L[19]!==eN||L[20]!==eS?(u=(0,w.oH)(eN,eS),L[19]=eN,L[20]=eS,L[21]=u):u=L[21];let e_=u,ew=V(e_??""),{threads:eD,annotations:eI,commentsPreference:ej}=(0,y.rP)(I,e_??"");L[22]!==eD?(m=eD.filter(is),L[22]=eD,L[23]=m):m=L[23];let ek=m,eA=ek.length+eI.length!==0,eE=X.isSelected??!1,eR=ej===na.sI.Collapsed,[eT,eO]=(0,l.useState)(!1),e$=eA&&eR;L[24]!==e$?(f=(0,w.S4)({hasThreads:e$}),L[24]=e$,L[25]=f):f=L[25];let eF=f,eM=(0,y.zK)();e:{let e;if(null==eM||!eR){h=!1;break e}if(L[26]!==eM||L[27]!==ek){let t;L[29]!==eM?(t=e=>e.commentsData?.comments.some(e=>e.databaseId===eM),L[29]=eM,L[30]=t):t=L[30],e=ek.some(t),L[26]=eM,L[27]=ek,L[28]=e}else e=L[28];h=e}let eB=h||eT,eH=(0,l.useRef)(null),eP=(0,l.useRef)(null),eK="DELETION"===S.type,[eU,eV]=(0,l.useState)(ek.length>0||eI.length>0||ew),[ez,eq]=(0,l.useState)(ew??!1),eG=K&&(!eR||eB||ez)&&(eU||eA||ew||ez),eW=(0,w.u6)(Y,0),eJ=(0,w.u6)(Y,1),eY=(0,w.u6)(Y,2),eZ=P(eY);L[31]!==J||L[32]!==S.blobLineNumber||L[33]!==S.type?(g=(0,_.IQ)(J,(0,_.XU)(S.type),S.blobLineNumber),L[31]=J,L[32]=S.blobLineNumber,L[33]=S.type,L[34]=g):g=L[34];let e1=g;L[35]!==eY||L[36]!==Q||L[37]!==ew||L[38]!==eA||L[39]!==eq?(p=e=>{!function(e,{hasThreads:t,hasStoredComment:n,enableDialogMode:i,codeCellId:r,setIsNewConversationDialogOpen:a}){if("Enter"===e.key&&n9(e)){if(e.preventDefault(),n){i(r),it(e);return}if(t){i(r),ie(e);return}a(!0)}}(e,{hasThreads:eA,hasStoredComment:ew,codeCellId:eY,enableDialogMode:Q,setIsNewConversationDialogOpen:eq})},L[35]=eY,L[36]=Q,L[37]=ew,L[38]=eA,L[39]=eq,L[40]=p):p=L[40];let e0=p,e2=M(ec),e3=M(ed),e4=M(eu),e5=M(em),e6=z(eY);L[41]!==T||L[42]!==eq||L[43]!==eV?(v=()=>{let{shouldStartConversation:e}=T();e&&(eq(!0),eV(!0))},L[41]=T,L[42]=eq,L[43]=eV,L[44]=v):v=L[44];let e7=v;return L[45]!==eI||L[46]!==j||L[47]!==e5||L[48]!==eo||L[49]!==eY||L[50]!==eF||L[51]!==eB||L[52]!==eR||L[53]!==ej||L[54]!==F||L[55]!==eC||L[56]!==J||L[57]!==S||L[58]!==I||L[59]!==$||L[60]!==E||L[61]!==R||L[62]!==O||L[63]!==e0||L[64]!==ew||L[65]!==e3||L[66]!==eL||L[67]!==e6||L[68]!==eg||L[69]!==q||L[70]!==eZ||L[71]!==eK||L[72]!==ez||L[73]!==eE||L[74]!==eW||L[75]!==e1||L[76]!==es||L[77]!==e_||L[78]!==el||L[79]!==eS||L[80]!==ef||L[81]!==N||L[82]!==ex||L[83]!==D||L[84]!==ey||L[85]!==eJ||L[86]!==e4||L[87]!==ep||L[88]!==eq||L[89]!==ev||L[90]!==eV||L[91]!==eO||L[92]!==K||L[93]!==eG||L[94]!==eb||L[95]!==e2||L[96]!==G||L[97]!==eh||L[98]!==W||L[99]!==ek||L[100]!==k||L[101]!==eT||L[102]!==A||L[103]!==H||L[104]!==ea?(C=q?(0,i.jsx)(n4,{currentHunk:eC,diffAnchor:J,diffLine:S,isSplit:!1,nextHunk:ex,nextLine:N,previousHunk:ey,prevLine:D}):(0,i.jsxs)(i.Fragment,{children:[G?(0,i.jsxs)("td",{className:(0,b.$)(il,ir.includes(S.type)&&"diff-line-number-neutral"),"data-diff-side":"left","data-diff-line-key":S.key,"data-first-unified-line-number-cell":"true","data-grid-cell-id":eW,"data-line-number":S.left,"data-selected":eE,role:"gridcell",style:{backgroundColor:el},tabIndex:-1,onKeyDown:e0,onMouseDown:E,onMouseEnter:R,children:[eK&&S.hasHiddenUnicode&&(0,i.jsx)(n7,{children:(0,i.jsx)(n8.o,{})}),S.left]}):(0,i.jsx)("td",{style:{backgroundColor:el},"data-grid-cell-id":eW,"data-selected":eE,className:ia,role:"gridcell",onKeyDown:e0,tabIndex:-1}),W?(0,i.jsxs)("td",{className:(0,b.$)(il,ir.includes(S.type)&&"diff-line-number-neutral"),"data-diff-side":"right","data-diff-line-key":S.key,"data-first-unified-line-number-cell":"false","data-grid-cell-id":eJ,"data-line-number":S.right,"data-selected":eE,role:"gridcell",style:{backgroundColor:el},tabIndex:-1,onKeyDown:e0,onMouseDown:E,onMouseEnter:R,children:[!eK&&S.hasHiddenUnicode&&(0,i.jsx)(n7,{children:(0,i.jsx)(n8.o,{})}),S.right]}):(0,i.jsx)("td",{style:{backgroundColor:el},"data-grid-cell-id":eJ,"data-selected":eE,className:ia,role:"gridcell",onKeyDown:e0,tabIndex:-1}),(0,i.jsxs)("td",{"data-grid-cell-id":eY,className:"diff-text-cell focusable-grid-cell left-side",style:{backgroundColor:eo,paddingRight:eF},"data-diff-line-key":S.key,"data-line-anchor":e1,"data-diff-side":eS.toLowerCase(),"data-line-number":eK?S.left:S.right,"data-selected":eE,onKeyDown:e0,onMouseEnter:e=>{e2(eY),R(e)},onMouseLeave:()=>e3(eY),onFocus:()=>e4(eY),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||e5()},"aria-labelledby":eZ?eL:void 0,role:eZ?"dialog":"gridcell",ref:e=>{e6?eH.current=e:eH.current=null},tabIndex:-1,children:[eZ&&(0,i.jsx)("h1",{id:eL,className:"sr-only",children:"Comment view"}),(0,i.jsx)(n5,{lineHtml:es,lineType:S.type,lineTypeCharacter:eh?ef:void 0}),S.displayNoNewLineWarning&&(0,i.jsx)(d.NoEntryIcon,{size:16,className:"fgColor-danger"}),eG?(0,i.jsx)(tG,{diffLine:S,gridCellId:eY,gutterSizeOffset:eF,inlineMarkersRef:eP,cellRef:eH,fileAnchor:J,dispatchMarkersStatus:eQ.l,shouldListenForEscapeKey:!0,batchingEnabled:!0,lineMarkersKey:e_,annotations:eI,conversationListThreads:ek,filePath:I,onCloseFocusMode:eQ.l,isRowSelected:eE,lineType:S.type,shouldStartNewConversationWithSuggestedChange:eb,viewerData:ea,onCloseConversationList:()=>{eq(!1),eV(!1),ev(!1)},onDeleteLineComment:()=>{eq(!1),eV(!1),ev(!1)},children:(ez||ew)&&(0,i.jsx)("div",{className:(0,b.$)(" border rounded-2 color-border-default",(ek.length,"mt-2 mb-1")),children:(0,i.jsx)(t5,{diffLine:S,diffAnchor:J,batchingEnabled:!0,filePath:I,focusOnMount:!ew,isLeftSide:eK,isInDialogMode:!1,isOpen:!0,isRowSelected:eE,shouldStartNewConversationWithSuggestedChange:eb,viewerData:ea,onCloseCommentDialog:()=>{eH.current?.focus(),eq(!1),eV(!1),ev(!1)}})})}):null,(e6||eg)&&(0,i.jsx)(nW,{openStartConversationDialog:e=>{ev(e),eq(!0),eV(!0)},authorAvatarUrl:j??"",authorLogin:k??"",ref:eH,copilotChatReference:F,currentHunk:eC,diffAnchor:J,diffLine:S,threads:ek,annotations:eI,hasDraftComment:ew,handleMouseLeaveAddCommentButton:O,handleMouseDownAddCommentButton:$,isLeftSide:eK,isSplit:!1,filePath:I,nextHunk:ex,previousHunk:ey,shouldDisplayComments:K,shouldDisplayMinimizedComments:K,shouldDisplayCollapseComments:eB,setIsContextMenuOpen:ep,cellId:eY,contextMenuOpen:eg,isAddCommentBoxOpen:ez,toggleViewingMarkers:()=>eO(!eT),viewerData:{avatarUrl:j??"",diffViewPreference:"unified",lineSpacingPreference:"compact",login:k??"",commentsPreference:ej,shouldDisplayComments:K??!0,shouldDisplayEditOptions:!0,tabSizePreference:8,viewerCanComment:H??!1,viewerCanApplySuggestion:A??!1}}),(ek.length>0||eI.length>0)&&eR&&(0,i.jsx)("div",{"aria-hidden":"true",className:(0,b.$)("position-absolute top-0 d-flex user-select-none",n6),children:(0,i.jsx)(nm,{threads:ek,annotations:eI,lineSpacingPreference:"compact"})})]})]}),L[45]=eI,L[46]=j,L[47]=e5,L[48]=eo,L[49]=eY,L[50]=eF,L[51]=eB,L[52]=eR,L[53]=ej,L[54]=F,L[55]=eC,L[56]=J,L[57]=S,L[58]=I,L[59]=$,L[60]=E,L[61]=R,L[62]=O,L[63]=e0,L[64]=ew,L[65]=e3,L[66]=eL,L[67]=e6,L[68]=eg,L[69]=q,L[70]=eZ,L[71]=eK,L[72]=ez,L[73]=eE,L[74]=eW,L[75]=e1,L[76]=es,L[77]=e_,L[78]=el,L[79]=eS,L[80]=ef,L[81]=N,L[82]=ex,L[83]=D,L[84]=ey,L[85]=eJ,L[86]=e4,L[87]=ep,L[88]=eq,L[89]=ev,L[90]=eV,L[91]=eO,L[92]=K,L[93]=eG,L[94]=eb,L[95]=e2,L[96]=G,L[97]=eh,L[98]=W,L[99]=ek,L[100]=k,L[101]=eT,L[102]=A,L[103]=H,L[104]=ea,L[105]=C):C=L[105],L[106]!==e7||L[107]!==C?(x=(0,i.jsx)("tr",{className:"diff-line-row",onMouseUp:e7,children:C}),L[106]=e7,L[107]=C,L[108]=x):x=L[108],x});function is(e){return!e.shouldNotRenderInDiffLines}io.displayName="SimpleUnifiedDiffRow";let id=(0,l.memo)(function(e){let t,n,a,l=(0,r.c)(25),{diffAnchor:o,diffLines:s,filePath:d,tableRef:c,avatarURL:u,userLogin:m,viewerCanApplySuggestion:f,handleMouseDownOnNumberCell:h,handleMouseEnterCell:g,handleMouseUpRow:p,handleMouseLeaveAddCommentButton:b,handleMouseDownAddCommentButton:v,copilotChatReference:C,viewerCanComment:x,shouldDisplayComments:y}=e;l[0]!==s?(t=eJ(s),l[0]=s,l[1]=t):t=l[1];let L=t,{addLineToSelection:S,clearSelectedLines:N,selectMultipleLines:_}=M(ei),w=M(X);return l[2]!==S||l[3]!==N||l[4]!==o||l[5]!==w||l[6]!==_||l[7]!==s||l[8]!==c?(n={addLineToSelection:S,clearSelectedLines:N,containerRef:c,fileAnchor:o,getfirstLineSelectionOnDrag:w,isSplitDiff:!1,leftLines:s,selectMultipleLines:_,disabled:!1},l[2]=S,l[3]=N,l[4]=o,l[5]=w,l[6]=_,l[7]=s,l[8]=c,l[9]=n):n=l[9],nY(n),l[10]!==u||l[11]!==C||l[12]!==s||l[13]!==d||l[14]!==v||l[15]!==h||l[16]!==g||l[17]!==b||l[18]!==p||l[19]!==L||l[20]!==y||l[21]!==m||l[22]!==f||l[23]!==x?(a=s.map((e,t)=>{let n=`unified-diff-row-l:${e.left}-r:${e.right}-b:${e.blobLineNumber}`,r=s[t+1],a=s[t-1];return(0,i.jsx)(io,{hunksData:L,diffLine:e,nextDiffLine:r,prevDiffLine:a,filePath:d,handleMouseDownOnNumberCell:h,handleMouseEnterCell:g,handleMouseUpRow:p,handleMouseLeaveAddCommentButton:b,handleMouseDownAddCommentButton:v,copilotChatReference:C,avatarURL:u,userLogin:m,viewerCanApplySuggestion:f,viewerCanComment:x,shouldDisplayComments:y},n)}),l[10]=u,l[11]=C,l[12]=s,l[13]=d,l[14]=v,l[15]=h,l[16]=g,l[17]=b,l[18]=p,l[19]=L,l[20]=y,l[21]=m,l[22]=f,l[23]=x,l[24]=a):a=l[24],a});id.displayName="SimpleUnifiedDiffLines";let ic=["CONTEXT","INJECTED_CONTEXT"],iu="focusable-grid-cell empty-diff-line left-side",im="focusable-grid-cell new-diff-line-number left-side",ih="diff-text-cell v-align-top focusable-grid-cell",ig=(0,l.memo)(function(e){let t,n,a,o,s,c,u,m,f,h,g,p,v,C,x,L,S,N,D,I,j,k,A,E,R,T,O,$,F=(0,r.c)(154),{leftDiffLine:B,rightDiffLine:H,nextDiffLine:K,prevDiffLine:q,filePath:G,handleMouseDownOnNumberCell:W,handleMouseEnterCell:X,handleMouseUpRow:J,handleDiffSideCellSelectionBlocking:Q,handleMouseLeaveAddCommentButton:Y,handleMouseDownAddCommentButton:Z,copilotChatReference:en,avatarURL:ei,userLogin:er,viewerCanApplySuggestion:ea,hunksData:el,viewerCanComment:eo,shouldDisplayComments:es}=e,ef=B?.type==="HUNK",eh=M(et),eg=U(B?.key),ep=U(H?.key);if(F[0]!==eh||F[1]!==B||F[2]!==H){let e=(0,w.qX)(eh,B??"empty-diff-line",H);n=(0,w.u6)(e,0),t=(0,w.u6)(e,1),a=(0,w.u6)(e,2),o=(0,w.u6)(e,3),F[0]=eh,F[1]=B,F[2]=H,F[3]=t,F[4]=n,F[5]=a,F[6]=o}else t=F[3],n=F[4],a=F[5],o=F[6];let eb=o,{enableDialogMode:ev}=M(ee),eC=(eg.isSelected||ep.isSelected)??!1;F[7]!==eC||F[8]!==B?(s=B?(0,w.Yf)(B.type,!0,eC):"",F[7]=eC,F[8]=B,F[9]=s):s=F[9];let ex=s;F[10]!==eC||F[11]!==H?(c=H?(0,w.Yf)(H.type,!0,eC):"",F[10]=eC,F[11]=H,F[12]=c):c=F[12];let ey=c;F[13]!==eC||F[14]!==B?(u=B?(0,w.Yf)(B.type,!1,eC):"",F[13]=eC,F[14]=B,F[15]=u):u=F[15];let eL=u;F[16]!==eC||F[17]!==H?(m=H?(0,w.Yf)(H.type,!1,eC):"",F[16]=eC,F[17]=H,F[18]=m):m=F[18];let eS=m,eN=`inline-dialog-heading-${(0,l.useId)()}`,e_=P(t),ew=P(eb);F[19]!==B?(f=B?(0,w.x_)(B.html,B.type):[void 0,void 0],F[19]=B,F[20]=f):f=F[20];let[eD,eI]=f;F[21]!==eI?(h=eI&&["+","-"].includes(eI),F[21]=eI,F[22]=h):h=F[22];let ej=h;F[23]!==H?(g=H?(0,w.x_)(H.html,H.type):[void 0,void 0],F[23]=H,F[24]=g):g=F[24];let[ek,eA]=g;F[25]!==eA?(p=eA&&["+","-"].includes(eA),F[25]=eA,F[26]=p):p=F[26];let eE=p;F[27]!==B?(v=B?(0,w.oH)(B.left,"LEFT"):void 0,F[27]=B,F[28]=v):v=F[28];let eR=v,{threads:eT,annotations:eO}=(0,y.rP)(G,eR??"");F[29]!==eT?(C=eT.filter(ip),F[29]=eT,F[30]=C):C=F[30];let e$=C,eF=V(eR??""),eM=ei??"",eB=er??"",eH=ea??!1,eP=eo??!1;F[31]!==eM||F[32]!==eB||F[33]!==eH||F[34]!==eP?(x={avatarUrl:eM,login:eB,viewerCanApplySuggestion:eH,viewerCanComment:eP},F[31]=eM,F[32]=eB,F[33]=eH,F[34]=eP,F[35]=x):x=F[35];let eK=x;F[36]!==H?(L=H?(0,w.oH)(H.right,"RIGHT"):void 0,F[36]=H,F[37]=L):L=F[37];let eU=L,eV=V(eU??""),{threads:ez,annotations:eq,commentsPreference:eG}=(0,y.rP)(G,eU??"");F[38]!==ez?(S=ez.filter(ib),F[38]=ez,F[39]=S):S=F[39];let eW=S,eJ=eG===na.sI.Collapsed,[eY,eZ]=(0,l.useState)(!1),[e1,e0]=(0,l.useState)(!1),e2=(0,y.zK)();e:{let e;if(null==e2||!eJ){N=!1;break e}if(F[40]!==e$||F[41]!==e2){let t;F[43]!==e2?(t=e=>e.commentsData?.comments.some(e=>e.databaseId===e2),F[43]=e2,F[44]=t):t=F[44],e=e$.some(t),F[40]=e$,F[41]=e2,F[42]=e}else e=F[42];N=e}let e3=N;t:{let e;if(null==e2||!eJ){D=!1;break t}if(F[45]!==eW||F[46]!==e2){let t;F[48]!==e2?(t=e=>e.commentsData?.comments.some(e=>e.databaseId===e2),F[48]=e2,F[49]=t):t=F[49],e=eW.some(t),F[45]=eW,F[46]=e2,F[47]=e}else e=F[47];D=e}let e4=e3||eY,e5=D||e1,[e6,e7]=(0,l.useState)(eF??!1),[e8,e9]=(0,l.useState)(!1),[te,tt]=(0,l.useState)(!1),[tn,ti]=(0,l.useState)(eV??!1),[tr,ta]=(0,l.useState)(!1),[tl,to]=(0,l.useState)(!1),[ts,td]=(0,l.useState)(e$.length>0||eO.length>0||e6),[tc,tu]=(0,l.useState)(eW.length>0||eq.length>0||tn),tm=e$.length+eO.length!==0,tf=eW.length+eq.length!==0,th=tm&&eJ;F[50]!==th?(I=(0,w.S4)({hasThreads:th}),F[50]=th,F[51]=I):I=F[51];let tg=I,tp=tf&&eJ;F[52]!==tp?(j=(0,w.S4)({hasThreads:tp}),F[52]=tp,F[53]=j):j=F[53];let tb=j,tv=(0,w.Po)(B)?(0,w.Po)(H)?void 0:H:B,tC=es&&(!eJ||e4||e6)&&(ts||tm||eF||e6),tx=es&&(!eJ||e5||tn)&&(tc||tf||eV||tn),ty=(0,l.useRef)(null),tL=(0,l.useRef)(null),tS=(0,l.useRef)(null);F[54]!==ev||F[55]!==eF||F[56]!==tm||F[57]!==eV||F[58]!==tf||F[59]!==t||F[60]!==eb?(k=e=>{!function(e,{hasLeftThreads:t,hasRightThreads:n,hasRightStoredComment:i,hasLeftStoredComment:r,enableDialogMode:a,leftCodeCellId:l,rightCodeCellId:o,setIsLeftNewConversationDialogOpen:s,setIsRightNewConversationDialogOpen:d}){if("Enter"!==e.key||!n9(e))return;e.preventDefault();let c=e.currentTarget.getAttribute("data-diff-side");if("left"===c){if(r){a(l),it(e);return}if(t){a(l),ie(e);return}s(!0)}else if("right"===c){if(i){a(o),it(e);return}if(n){a(o),ie(e);return}d(!0)}}(e,{hasLeftThreads:tm,hasRightThreads:tf,hasRightStoredComment:eV,hasLeftStoredComment:eF,enableDialogMode:ev,leftCodeCellId:t,rightCodeCellId:eb,setIsLeftNewConversationDialogOpen:e7,setIsRightNewConversationDialogOpen:ti})},F[54]=ev,F[55]=eF,F[56]=tm,F[57]=eV,F[58]=tf,F[59]=t,F[60]=eb,F[61]=k):k=F[61];let tN=k,t_=M(ec),tw=M(ed),tD=M(eu),tI=M(em),tj=z(t),tk=z(eb);F[62]!==J||F[63]!==B||F[64]!==H?(A=e=>{let{shouldStartConversation:t}=J();if(t){let t=e.target,n=t.closest("[data-diff-side]")?.getAttribute("data-diff-side");"left"===n&&B?(e7(!0),td(!0)):"right"===n&&H?(ti(!0),tu(!0)):B?(e7(!0),td(!0)):H&&(ti(!0),tu(!0))}},F[62]=J,F[63]=B,F[64]=H,F[65]=A):A=F[65];let tA=A;if(!tv)return null;F[66]!==tv||F[67]!==el?(E=eX(tv,el),F[66]=tv,F[67]=el,F[68]=E):E=F[68];let{currentHunk:tE,nextHunk:tR,previousHunk:tT}=E;F[69]!==eh||F[70]!==B?.blobLineNumber||F[71]!==B?.type?(R=(0,_.IQ)(eh,(0,_.XU)(B?.type??"EMPTY"),B?.blobLineNumber??0),F[69]=eh,F[70]=B?.blobLineNumber,F[71]=B?.type,F[72]=R):R=F[72];let tO=R;F[73]!==eh||F[74]!==H?.blobLineNumber||F[75]!==H?.type?(T=(0,_.IQ)(eh,(0,_.XU)(H?.type??"EMPTY"),H?.blobLineNumber??0),F[73]=eh,F[74]=H?.blobLineNumber,F[75]=H?.type,F[76]=T):T=F[76];let t$=T;return F[77]!==ei||F[78]!==tI||F[79]!==eJ||F[80]!==eG||F[81]!==en||F[82]!==tE||F[83]!==eh||F[84]!==G||F[85]!==Q||F[86]!==Z||F[87]!==W||F[88]!==X||F[89]!==Y||F[90]!==tN||F[91]!==eF||F[92]!==eV||F[93]!==tw||F[94]!==eN||F[95]!==ef||F[96]!==tj||F[97]!==e8||F[98]!==e_||F[99]!==e6||F[100]!==tk||F[101]!==tr||F[102]!==ew||F[103]!==tn||F[104]!==eC||F[105]!==eO||F[106]!==eL||F[107]!==t||F[108]!==tg||F[109]!==e4||F[110]!==B||F[111]!==tO||F[112]!==eD||F[113]!==eR||F[114]!==ex||F[115]!==n||F[116]!==eI||F[117]!==e$||F[118]!==eY||F[119]!==K||F[120]!==tR||F[121]!==q||F[122]!==tT||F[123]!==eq||F[124]!==eS||F[125]!==eb||F[126]!==tb||F[127]!==e5||F[128]!==H||F[129]!==t$||F[130]!==ek||F[131]!==eU||F[132]!==ey||F[133]!==a||F[134]!==eA||F[135]!==eW||F[136]!==e1||F[137]!==tD||F[138]!==es||F[139]!==tC||F[140]!==tx||F[141]!==te||F[142]!==tl||F[143]!==t_||F[144]!==ej||F[145]!==eE||F[146]!==er||F[147]!==ea||F[148]!==eo||F[149]!==eK?(O=ef?(0,i.jsx)(n4,{currentHunk:tE,diffAnchor:eh,diffLine:B,isSplit:!0,nextHunk:tR,nextLine:K,previousHunk:tT,prevLine:q}):(0,i.jsxs)(i.Fragment,{children:[B?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("td",{className:(0,b.$)(im,ic.includes(B.type)&&"diff-line-number-neutral"),"data-diff-side":"left","data-diff-line-key":B.key,"data-grid-cell-id":n,"data-line-number":B.left,"data-selected":eC,onMouseDown:W,onMouseEnter:X,onKeyDown:tN,role:"gridcell",style:{backgroundColor:ex},tabIndex:-1,children:[B.hasHiddenUnicode&&(0,i.jsx)(n7,{children:(0,i.jsx)(n8.o,{})}),B.left]}),(0,i.jsxs)("td",{className:(0,b.$)(ih,"left-side-diff-cell"),"data-grid-cell-id":t,"data-diff-line-key":B.key,"data-diff-side":"left","data-line-number":B.left,"data-line-anchor":tO,"data-selected":eC,onKeyDown:tN,onMouseDown:Q,onMouseEnter:e=>{t_(t),X(e)},onMouseLeave:()=>tw(t),onFocus:()=>tD(t),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||tI()},"aria-labelledby":e_?eN:void 0,role:e_?"dialog":"gridcell",ref:e=>{tj?tL.current=e:tL.current=null},style:{backgroundColor:eL,paddingRight:tg},tabIndex:-1,children:[e_&&(0,i.jsx)("h1",{id:eN,className:"sr-only",children:"Comment view"}),(0,i.jsx)(n5,{lineHtml:eD??"",lineType:B.type,lineTypeCharacter:ej?eI:void 0}),B.displayNoNewLineWarning&&(0,i.jsx)(d.NoEntryIcon,{size:16,className:"fgColor-danger"}),tC&&(0,i.jsx)(tG,{diffLine:B,gridCellId:t,shouldListenForEscapeKey:!0,gutterSizeOffset:tg,inlineMarkersRef:ty,cellRef:tL,fileAnchor:eh,batchingEnabled:!0,dispatchMarkersStatus:eQ.l,lineMarkersKey:eR,annotations:eO,conversationListThreads:e$,filePath:G,onCloseFocusMode:eQ.l,isRowSelected:eC,lineType:B.type,onCloseConversationList:()=>{e7(!1),td(!1),tt(!1)},onDeleteLineComment:()=>{e7(!1),td(!1),tt(!1)},viewerData:eK,children:(e6||eF)&&(0,i.jsx)("div",{className:(0,b.$)(" border rounded-2 color-border-default","mt-2 mb-1"),children:(0,i.jsx)(t5,{diffLine:B,diffAnchor:eh,batchingEnabled:!0,filePath:G,focusOnMount:!eF,isLeftSide:!0,isInDialogMode:!1,isOpen:!0,isRowSelected:eC,viewerData:eK,shouldStartNewConversationWithSuggestedChange:te,onCloseCommentDialog:()=>{tL.current?.focus(),e7(!1),td(!1),tt(!1)}})})}),(tj||e8)&&(0,i.jsx)(nW,{openStartConversationDialog:e=>{tt(e),e7(!0),td(!0)},isAddCommentBoxOpen:e6,authorAvatarUrl:ei??"",authorLogin:er??"",ref:tL,copilotChatReference:en,currentHunk:tE,diffAnchor:eh,diffLine:B,threads:e$,annotations:eO,hasDraftComment:eF,handleMouseLeaveAddCommentButton:Y,handleMouseDownAddCommentButton:Z,isLeftSide:!0,isSplit:!0,contextMenuOpen:e8,setIsContextMenuOpen:e9,cellId:t,nextHunk:tR,previousHunk:tT,shouldDisplayComments:es,shouldDisplayMinimizedComments:es,shouldDisplayCollapseComments:e4,filePath:G,toggleViewingMarkers:()=>eZ(!eY),viewerData:{avatarUrl:ei??"",diffViewPreference:"split",lineSpacingPreference:"compact",login:er??"",commentsPreference:eG,shouldDisplayComments:es??!0,shouldDisplayEditOptions:!0,tabSizePreference:8,viewerCanComment:eo??!1,viewerCanApplySuggestion:ea??!1}}),(e$.length>0||eO.length>0)&&eJ&&(0,i.jsx)("div",{"aria-hidden":"true",className:(0,b.$)("position-absolute top-0 d-flex user-select-none",n6),children:(0,i.jsx)(nm,{threads:e$,annotations:eO,lineSpacingPreference:"compact"})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("td",{role:"gridcell",className:iu,tabIndex:-1}),(0,i.jsx)("td",{role:"gridcell",className:iu,tabIndex:-1})]}),H?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("td",{className:(0,b.$)(im,ic.includes(H.type)&&"diff-line-number-neutral"),"data-diff-side":"right","data-diff-line-key":H.key,"data-grid-cell-id":a,"data-line-number":H.right,"data-selected":eC,onKeyDown:tN,onMouseDown:W,onMouseEnter:X,role:"gridcell",style:{backgroundColor:ey},tabIndex:-1,children:[H.hasHiddenUnicode&&(0,i.jsx)(n7,{children:(0,i.jsx)(n8.o,{})}),H.right]}),(0,i.jsxs)("td",{className:(0,b.$)(ih,"right-side-diff-cell"),"data-grid-cell-id":eb,"data-diff-line-key":H.key,"data-diff-side":"right","data-line-anchor":t$,"data-line-number":H.right,"data-selected":eC,onKeyDown:tN,onMouseDown:Q,onMouseEnter:e=>{t_(eb),X(e)},onMouseLeave:()=>tw(eb),onFocus:()=>tD(eb),onBlur:e=>{let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||tI()},"aria-labelledby":ew?eN:void 0,role:ew?"dialog":"gridcell",ref:e=>{tk?tS.current=e:tS.current=null},style:{backgroundColor:eS,paddingRight:tb},tabIndex:-1,children:[ew&&(0,i.jsx)("h1",{id:eN,className:"sr-only",children:"Comment view"}),(0,i.jsx)(n5,{lineHtml:ek??"",lineType:H.type,lineTypeCharacter:eE?eA:void 0}),H.displayNoNewLineWarning&&(0,i.jsx)(d.NoEntryIcon,{size:16,className:"fgColor-danger"}),tx&&(0,i.jsx)(tG,{diffLine:H,gridCellId:eb,shouldListenForEscapeKey:!0,gutterSizeOffset:tb,inlineMarkersRef:ty,cellRef:tS,fileAnchor:eh,batchingEnabled:!0,dispatchMarkersStatus:eQ.l,lineMarkersKey:eU,annotations:eq,conversationListThreads:eW,filePath:G,viewerData:eK,onCloseFocusMode:eQ.l,isRowSelected:eC,lineType:H.type,onCloseConversationList:()=>{ti(!1),tu(!1),to(!1)},onDeleteLineComment:()=>{ti(!1),tu(!1),to(!1)},children:(tn||eV)&&(0,i.jsx)("div",{className:(0,b.$)(" border rounded-2 color-border-default","mt-2 mb-1"),children:(0,i.jsx)(t5,{diffLine:H,diffAnchor:eh,batchingEnabled:!0,filePath:G,focusOnMount:!eV,isLeftSide:!1,isInDialogMode:!1,isOpen:!0,isRowSelected:eC,shouldStartNewConversationWithSuggestedChange:tl,viewerData:eK,onCloseCommentDialog:()=>{tS.current?.focus(),ti(!1),tu(!1),to(!1)}})})}),(tk||tr)&&(0,i.jsx)(nW,{openStartConversationDialog:e=>{to(e),ti(!0),tu(!0)},authorAvatarUrl:ei??"",authorLogin:er??"",ref:tS,isAddCommentBoxOpen:tn,copilotChatReference:en,currentHunk:tE,diffAnchor:eh,diffLine:H,threads:eW,contextMenuOpen:tr,setIsContextMenuOpen:ta,cellId:eb,annotations:eq,hasDraftComment:eV,handleMouseLeaveAddCommentButton:Y,handleMouseDownAddCommentButton:Z,isLeftSide:!1,isSplit:!0,nextHunk:tR,previousHunk:tT,filePath:G,shouldDisplayComments:es,shouldDisplayMinimizedComments:es,shouldDisplayCollapseComments:e5,toggleViewingMarkers:()=>e0(!e1),viewerData:{avatarUrl:ei??"",diffViewPreference:"split",lineSpacingPreference:"compact",login:er??"",commentsPreference:eG,shouldDisplayComments:es??!0,shouldDisplayEditOptions:!0,tabSizePreference:8,viewerCanComment:eo??!1,viewerCanApplySuggestion:ea??!1}}),(eW.length>0||eq.length>0)&&eJ&&(0,i.jsx)("div",{"aria-hidden":"true",className:(0,b.$)("position-absolute top-0 d-flex user-select-none",n6),children:(0,i.jsx)(nm,{threads:eW,annotations:eq,lineSpacingPreference:"compact"})})]})]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("td",{role:"gridcell",className:iu,tabIndex:-1}),(0,i.jsx)("td",{role:"gridcell",className:iu,tabIndex:-1})]})]}),F[77]=ei,F[78]=tI,F[79]=eJ,F[80]=eG,F[81]=en,F[82]=tE,F[83]=eh,F[84]=G,F[85]=Q,F[86]=Z,F[87]=W,F[88]=X,F[89]=Y,F[90]=tN,F[91]=eF,F[92]=eV,F[93]=tw,F[94]=eN,F[95]=ef,F[96]=tj,F[97]=e8,F[98]=e_,F[99]=e6,F[100]=tk,F[101]=tr,F[102]=ew,F[103]=tn,F[104]=eC,F[105]=eO,F[106]=eL,F[107]=t,F[108]=tg,F[109]=e4,F[110]=B,F[111]=tO,F[112]=eD,F[113]=eR,F[114]=ex,F[115]=n,F[116]=eI,F[117]=e$,F[118]=eY,F[119]=K,F[120]=tR,F[121]=q,F[122]=tT,F[123]=eq,F[124]=eS,F[125]=eb,F[126]=tb,F[127]=e5,F[128]=H,F[129]=t$,F[130]=ek,F[131]=eU,F[132]=ey,F[133]=a,F[134]=eA,F[135]=eW,F[136]=e1,F[137]=tD,F[138]=es,F[139]=tC,F[140]=tx,F[141]=te,F[142]=tl,F[143]=t_,F[144]=ej,F[145]=eE,F[146]=er,F[147]=ea,F[148]=eo,F[149]=eK,F[150]=O):O=F[150],F[151]!==tA||F[152]!==O?($=(0,i.jsx)("tr",{className:"diff-line-row",onMouseUp:tA,children:O}),F[151]=tA,F[152]=O,F[153]=$):$=F[153],$});function ip(e){return!e.shouldNotRenderInDiffLines}function ib(e){return!e.shouldNotRenderInDiffLines}ig.displayName="SimpleSplitDiffRow";let iv=(0,l.memo)(function(e){let t,n,a,l=(0,r.c)(28),{diffAnchor:o,diffLines:s,filePath:d,avatarURL:c,userLogin:u,viewerCanApplySuggestion:m,handleMouseDownOnNumberCell:f,handleMouseEnterCell:h,handleMouseUpRow:g,handleDiffSideCellSelectionBlocking:p,handleMouseLeaveAddCommentButton:b,handleMouseDownAddCommentButton:v,copilotChatReference:C,viewerCanComment:x,shouldDisplayComments:y,tableRef:L}=e,{leftLines:S,rightLines:N}=function(e){let t,n,i=(0,r.c)(5);i[0]!==e?(t=function(e){let t=[],n=[],i=()=>{for(;t.length{let n=S[t],r=N[t],a=S[t-1],l=(0,w.Po)(S[t+1])?N[t+1]:S[t+1],o=`${(0,w.Po)(n)||!n?`empty-left-diff-${t}`:n.blobLineNumber}-${(0,w.Po)(r)||!r?`empty-right-diff-${t}`:r.blobLineNumber}`;return(0,i.jsx)(ig,{hunksData:_,leftDiffLine:n,rightDiffLine:r,prevDiffLine:a,nextDiffLine:l,filePath:d,handleMouseDownOnNumberCell:f,handleMouseEnterCell:h,handleMouseUpRow:g,handleDiffSideCellSelectionBlocking:p,handleMouseLeaveAddCommentButton:b,handleMouseDownAddCommentButton:v,copilotChatReference:C,avatarURL:c,userLogin:u,viewerCanApplySuggestion:m,viewerCanComment:x,shouldDisplayComments:y},o)}),l[11]=c,l[12]=C,l[13]=d,l[14]=p,l[15]=v,l[16]=f,l[17]=h,l[18]=b,l[19]=g,l[20]=_,l[21]=S,l[22]=N,l[23]=y,l[24]=u,l[25]=m,l[26]=x,l[27]=a):a=l[27],a});function iC(e){let t,n=(0,r.c)(3),{diffAnchor:a,children:l}=e;return n[0]!==l||n[1]!==a?(t=(0,i.jsx)("div",{className:"fgColor-muted p-2","data-diff-anchor":a,children:l}),n[0]=l,n[1]=a,n[2]=t):t=n[2],t}iv.displayName="SimpleSplitDiffLines",iC.displayName="PlainTextStatus";let ix=(0,l.memo)(function(e){let t,n=(0,r.c)(42),{diffEntryData:a,diffLinesManuallyUnhidden:l,baseHelpUrl:o,handleSetShowHiddenUnicodeCharacters:s,onHandleLoadDiff:d,copilotChatReference:c,hasExpandedAllRanges:u,isSplitView:m,showHiddenUnicodeCharacters:f,subjectId:h,tableAriaLabel:g,viewerData:p}=e,b=`diff-${a.pathDigest}`;if(a.isBinary){let e;return n[0]!==b?(e=(0,i.jsx)(iC,{diffAnchor:b,children:"Binary file not shown."}),n[0]=b,n[1]=e):e=n[1],e}if((0,eP.dK)(a)){let e;return n[2]!==b?(e=(0,i.jsx)(iC,{diffAnchor:b,children:"File renamed without changes."}),n[2]=b,n[3]=e):e=n[3],e}if((0,eP.Jc)(a)){let e;return n[4]!==b?(e=(0,i.jsx)(iC,{diffAnchor:b,children:"File copied without changes."}),n[4]=b,n[5]=e):e=n[5],e}if((0,eP.Sn)(a,a.status,a.oldTreeEntry?.mode,a.newTreeEntry?.mode)){let e;return n[6]!==b?(e=(0,i.jsx)(iC,{diffAnchor:b,children:"File mode changed."}),n[6]=b,n[7]=e):e=n[7],e}if(!l&&(0,eP.HI)(a)){let e,t,r=a.truncatedReason;return n[8]!==r?(e=(0,eP.l_)(r),n[8]=r,n[9]=e):e=n[9],n[10]!==b||n[11]!==d||n[12]!==e?(t=(0,i.jsx)(eV,{diffAnchor:b,onLoadDiff:d,children:e}),n[10]=b,n[11]=d,n[12]=e,n[13]=t):t=n[13],t}if((0,eP.s8)(a)){let e;return n[14]!==b?(e=(0,i.jsx)(iC,{diffAnchor:b,children:"Whitespace-only changes."}),n[14]=b,n[15]=e):e=n[15],e}if(!l&&(0,eP.lO)(a)){let e;return n[16]!==b||n[17]!==d?(e=(0,i.jsx)(eV,{diffAnchor:b,onLoadDiff:d,children:"This file was deleted."}),n[16]=b,n[17]=d,n[18]=e):e=n[18],e}if(!l&&(0,eP.xW)(a)){let e,t=`${o}/github/administering-a-repository/customizing-how-changed-files-appear-on-github`;return n[19]!==b||n[20]!==d||n[21]!==t?(e=(0,i.jsxs)(eV,{diffAnchor:b,helpText:"customizing how changed files appear on GitHub.",helpUrl:t,onLoadDiff:d,children:["Some generated files are not rendered by default. Learn more about"," "]}),n[19]=b,n[20]=d,n[21]=t,n[22]=e):e=n[22],e}if(a.isTooBig&&0===a.diffLines.length)if(l){let e,t,r=`${o}/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally`;return n[23]!==r?(e=(0,i.jsx)(eU.A,{inline:!0,href:r,children:"check out this pull request locally."}),n[23]=r,n[24]=e):e=n[24],n[25]!==b||n[26]!==e?(t=(0,i.jsxs)(iC,{diffAnchor:b,children:["Diff is too big to render. To view,"," ",e]}),n[25]=b,n[26]=e,n[27]=t):t=n[27],t}else{let e;return n[28]!==b||n[29]!==d?(e=(0,i.jsx)(eV,{diffAnchor:b,onLoadDiff:d,children:"Large diffs are not rendered by default."}),n[28]=b,n[29]=d,n[30]=e):e=n[30],e}return a.diffLines?(n[31]!==c||n[32]!==b||n[33]!==a||n[34]!==s||n[35]!==u||n[36]!==m||n[37]!==f||n[38]!==h||n[39]!==g||n[40]!==p?(t=(0,i.jsx)(iy,{diffAnchor:b,diffEntryData:a,viewerData:p,copilotChatReference:c,handleSetShowHiddenUnicodeCharacters:s,hasExpandedAllRanges:u,isSplitView:m,showHiddenUnicodeCharacters:f,subjectId:h,tableAriaLabel:g}),n[31]=c,n[32]=b,n[33]=a,n[34]=s,n[35]=u,n[36]=m,n[37]=f,n[38]=h,n[39]=g,n[40]=p,n[41]=t):t=n[41],t):null});function iy(e){let t,n,a,s,d,c,u,f,h,g,p,v,C,x,L,S,N,w,D,I,j=(0,r.c)(93),{diffAnchor:k,viewerData:E,diffEntryData:R,copilotChatReference:T,handleSetShowHiddenUnicodeCharacters:O,hasExpandedAllRanges:$,isSplitView:F,showHiddenUnicodeCharacters:B,tableAriaLabel:H}=e,P=(0,l.useRef)(null),{clearSelectedLines:K,clearFirstLineSelectionOnDrag:U,setIsDraggingFromAddCommentButton:V}=M(ei),z=M(X),q=M(Q),[W,Z]=(0,l.useState)(null),ee=R.newTreeEntry?.lineCount??R.oldTreeEntry?.lineCount??0;e:{let e=R.diffLines[R.diffLines.length-1];if(e?.blobLineNumber&&e.blobLineNumber{!el&&ea()&&(K(),(0,ef.i)("Selection Cleared"))},a=[K,ea,el],j[3]=K,j[4]=ea,j[5]=el,j[6]=n,j[7]=a):(n=j[6],a=j[7]),(0,l.useEffect)(n,a),j[8]!==et?(s=(0,_.c7)(et),j[8]=et,j[9]=s):s=j[9];let eo=s;j[10]===Symbol.for("react.memo_cache_sentinel")?(d=e=>{Z(e.currentTarget.classList.contains("left-side-diff-cell")?"right":"left")},j[10]=d):d=j[10];let es=d;j[11]!==R.path||j[12]!==$?(c=e=>{if(e.shiftKey&&e.metaKey&&"ArrowLeft"===e.key&&!$&&e.target?.getAttribute("role")==="gridcell"){let e=document.querySelector(`.js-expand-all-difflines-button[data-file-path="${R.path}"]`);e?.dispatchEvent(new MouseEvent("click",{bubbles:!0,cancelable:!0}))}},j[11]=R.path,j[12]=$,j[13]=c):c=j[13];let ed=c,ec=M(J),eu=M(G);j[14]!==et||j[15]!==W||j[16]!==eu||j[17]!==ec||j[18]!==F?(u=async e=>{let t=document.getSelection();if(t&&t.rangeCount>=1){let n=[];for(let e=0;e{let t=e.target,n=t.getAttribute("data-diff-line-key"),i=t.getAttribute("data-diff-side");if(!A(n)||!(0,o.e)(i))return;let r=document.getSelection();r?.empty();let a=ex();(0,t9.X)()?.registerCallback({event:e.nativeEvent,cb:e=>{eC("diff-lines.inp_interaction","PULL_REQUESTS_DIFF_LINE_NUMBER_CLICK",{latency:e.latency}),(0,ne.au)({name:"PULL_REQUESTS_DIFF_LINE_NUMBER_CLICK",tags:a,value:e.latency})}});let l=eu();if(n&&1===l.length&&l[0]?.key===n&&null===z()){K(),(0,m.K3)();return}if(ec()&&e.shiftKey)return void ep({lineKey:n,orientation:i},eh);let s=t.getAttribute("data-line-number");s&&(eb({lineKey:n,firstLineSelectionOnDrag:{orientation:i,lineNumber:parseInt(s),shouldStartConversation:!1,lineKey:n}},eh),ev(R.pathDigest))},j[22]=ep,j[23]=K,j[24]=R.pathDigest,j[25]=z,j[26]=ex,j[27]=eu,j[28]=ec,j[29]=eb,j[30]=eC,j[31]=ev,j[32]=h):h=j[32];let ey=h;j[33]!==U||j[34]!==z||j[35]!==q||j[36]!==V?(g=()=>{let e=z(),t=q();return null!==e?U():t&&V(!1),{shouldStartConversation:t&&null!==e}},j[33]=U,j[34]=z,j[35]=q,j[36]=V,j[37]=g):g=j[37];let eL=g;j[38]!==ep||j[39]!==z?(p=e=>{if(1!==e.buttons)return;let t=e.target,n=t.closest("[data-diff-line-key]")?.getAttribute("data-diff-line-key"),i=t.closest("[data-diff-side]")?.getAttribute("data-diff-side");A(n)&&(0,o.e)(i)&&z()&&ep({lineKey:n,orientation:i},eh)},j[38]=ep,j[39]=z,j[40]=p):p=j[40];let eS=p;j[41]!==ec?(v=(e,t)=>{let n=ec();if(!n)return!1;let i="left"===e;return"right"===n.endOrientation&&!i&&n.endLineNumber===t||!!n&&"left"===n.endOrientation&&!!i&&n.endLineNumber===t},j[41]=ec,j[42]=v):v=j[42];let eN=v;j[43]!==ep||j[44]!==R.pathDigest||j[45]!==eN||j[46]!==el||j[47]!==eb||j[48]!==ev?(C=e=>{if(1!==e.buttons)return;let t=e.target,n=t.closest("[data-diff-line-key]")?.getAttribute("data-diff-line-key"),i=t.closest("[data-diff-side]")?.getAttribute("data-diff-side");if(!A(n)||!(0,o.e)(i)||!n)return;let r=t.closest("[data-selected]")?.getAttribute("data-selected"),a=t.closest("[data-line-number]")?.getAttribute("data-line-number"),l=a?parseInt(a,10):void 0;r||!l||eN(i,l)?ep({lineKey:n,orientation:i},eh):eb({lineKey:n,firstLineSelectionOnDrag:{lineNumber:l,orientation:i,lineKey:n,shouldStartConversation:!0}},eh),el||ev(R.pathDigest)},j[43]=ep,j[44]=R.pathDigest,j[45]=eN,j[46]=el,j[47]=eb,j[48]=ev,j[49]=C):C=j[49];let e_=C;j[50]!==K||j[51]!==eN||j[52]!==V?(x=e=>{V(!0);let t=e.target,n=t.closest("[data-diff-side]")?.getAttribute("data-diff-side"),i=t.closest("[data-line-number]")?.getAttribute("data-line-number"),r=i?parseInt(i,10):void 0;(0,o.e)(n)&&r&&!eN(n,r)&&K()},j[50]=K,j[51]=eN,j[52]=V,j[53]=x):x=j[53];let ew=x;j[54]!==eg||j[55]!==O||j[56]!==B?(L=eg&&(0,i.jsx)(ez.a,{isShown:B,toggleShowHiddenCharacters:()=>O(!B)}),j[54]=eg,j[55]=O,j[56]=B,j[57]=L):L=j[57];let eD="compact"===en;j[58]!==eD?(S=(0,b.$)("tab-size","width-full","DiffLines-module__tableLayoutFixed__Ui4OU",{"DiffLines-module__compact__Rvh2a":eD}),j[58]=eD,j[59]=S):S=j[59];let eI=`${eo}px`,ej=`${2*parseFloat(eo)}px`;return j[60]!==eI||j[61]!==ej?(N={"--line-number-cell-width":eI,"--line-number-cell-width-unified":ej},j[60]=eI,j[61]=ej,j[62]=N):N=j[62],j[63]!==T||j[64]!==k||j[65]!==R.path||j[66]!==et||j[67]!==ew||j[68]!==ey||j[69]!==eS||j[70]!==e_||j[71]!==eL||j[72]!==F||j[73]!==eo||j[74]!==E.avatarUrl||j[75]!==E.login||j[76]!==E.shouldDisplayComments||j[77]!==E.viewerCanApplySuggestion||j[78]!==E.viewerCanComment?(w=F?(0,i.jsx)(eK.wj,{lineWidth:eo,children:(0,i.jsx)(iv,{diffAnchor:k,diffLines:et,filePath:R.path,handleDiffSideCellSelectionBlocking:es,handleMouseDownOnNumberCell:ey,handleMouseEnterCell:eS,handleMouseUpRow:eL,handleMouseLeaveAddCommentButton:e_,handleMouseDownAddCommentButton:ew,copilotChatReference:T,avatarURL:E.avatarUrl,userLogin:E.login,viewerCanApplySuggestion:E.viewerCanApplySuggestion,viewerCanComment:E.viewerCanComment,shouldDisplayComments:E.shouldDisplayComments,tableRef:P})}):(0,i.jsx)(eK.Qe,{lineWidth:eo,children:(0,i.jsx)(id,{diffAnchor:k,diffLines:et,filePath:R.path,handleMouseDownOnNumberCell:ey,handleMouseEnterCell:eS,handleMouseUpRow:eL,handleMouseLeaveAddCommentButton:e_,handleMouseDownAddCommentButton:ew,copilotChatReference:T,avatarURL:E.avatarUrl,userLogin:E.login,viewerCanApplySuggestion:E.viewerCanApplySuggestion,viewerCanComment:E.viewerCanComment,shouldDisplayComments:E.shouldDisplayComments,tableRef:P})}),j[63]=T,j[64]=k,j[65]=R.path,j[66]=et,j[67]=ew,j[68]=ey,j[69]=eS,j[70]=e_,j[71]=eL,j[72]=F,j[73]=eo,j[74]=E.avatarUrl,j[75]=E.login,j[76]=E.shouldDisplayComments,j[77]=E.viewerCanApplySuggestion,j[78]=E.viewerCanComment,j[79]=w):w=j[79],j[80]!==k||j[81]!==W||j[82]!==ed||j[83]!==em||j[84]!==S||j[85]!==N||j[86]!==w||j[87]!==er||j[88]!==H?(D=(0,i.jsx)("table",{"aria-label":H,onKeyDown:ed,ref:P,className:S,"data-block-diff-cell-selection":W,"data-diff-anchor":k,"data-tab-size":er,"data-paste-markdown-skip":!0,onCopy:em,role:"grid",style:N,children:w}),j[80]=k,j[81]=W,j[82]=ed,j[83]=em,j[84]=S,j[85]=N,j[86]=w,j[87]=er,j[88]=H,j[89]=D):D=j[89],j[90]!==L||j[91]!==D?(I=(0,i.jsxs)(i.Fragment,{children:[L,D]}),j[90]=L,j[91]=D,j[92]=I):I=j[92],I}function iL(e){return(0,eq.Y)(e.text)}ix.displayName="DiffLines",iy.displayName="CodeDiffLines";var iS=n(72105),iN=n(46251),i_=n(16025);function iw(e){let t,n,a,l,o,s,c=(0,r.c)(28),{submodule:u}=e,{basePath:m,changedFiles:f,contentsUrl:h,newCommitOid:g,oldCommitOid:p,status:b,submoduleUrl:v}=u,C=u.summary.length>0&&u.contentsUrl&&"MODIFIED"===b;switch(b){case"ADDED":{let e;c[0]!==h||c[1]!==g?(e=(0,i.jsx)(ij,{commitOid:g,contentsUrl:h,type:"added"}),c[0]=h,c[1]=g,c[2]=e):e=c[2],t=e;break}case"DELETED":case"REMOVED":{let e;c[3]!==h||c[4]!==p?(e=(0,i.jsx)(ij,{commitOid:p,contentsUrl:h,type:"deleted"}),c[3]=h,c[4]=p,c[5]=e):e=c[5],t=e;break}default:{let e;c[6]!==f||c[7]!==h||c[8]!==g||c[9]!==p?(e=(0,i.jsx)(ik,{newCommitOid:g,oldCommitOid:p,changedFiles:f,contentsUrl:h}),c[6]=f,c[7]=h,c[8]=g,c[9]=p,c[10]=e):e=c[10],t=e}}let x=t,y=`tmp-px-3 py-2 ${C?"border-bottom bgColor-muted":""}`;return c[11]===Symbol.for("react.memo_cache_sentinel")?(n=(0,i.jsx)(d.FileSubmoduleIcon,{className:"fgColor-muted mr-2",size:16}),c[11]=n):n=c[11],c[12]!==m||c[13]!==v?(a=(0,i.jsx)(iD,{basePath:m,submoduleUrl:v}),c[12]=m,c[13]=v,c[14]=a):a=c[14],c[15]!==x||c[16]!==y||c[17]!==a?(l=(0,i.jsxs)("div",{className:y,children:[n,a,x]}),c[15]=x,c[16]=y,c[17]=a,c[18]=l):l=c[18],c[19]!==h||c[20]!==g||c[21]!==p||c[22]!==C||c[23]!==u.summary?(o=C&&(0,i.jsx)(eD.l,{className:"SubmoduleDiff-module__filesActionList__KgCK2",showDividers:!0,variant:"full",children:u.summary.map(e=>(0,i.jsx)(iA,{compareUrl:`${h}/compare/${p}...${g}`,linesAdded:e.linesAdded,linesDeleted:e.linesDeleted,path:e.path,pathDigest:e.pathDigest,status:e.status},e.pathDigest))}),c[19]=h,c[20]=g,c[21]=p,c[22]=C,c[23]=u.summary,c[24]=o):o=c[24],c[25]!==l||c[26]!==o?(s=(0,i.jsxs)("div",{children:[l,o]}),c[25]=l,c[26]=o,c[27]=s):s=c[27],s}function iD(e){let t,n,a=(0,r.c)(5),{basePath:l,submoduleUrl:o}=e;return a[0]!==l||a[1]!==o?(t=o?(0,i.jsx)(eU.A,{inline:!0,href:o,children:l}):l,a[0]=l,a[1]=o,a[2]=t):t=a[2],a[3]!==t?(n=(0,i.jsxs)(i.Fragment,{children:["Submodule"," ",t," "]}),a[3]=t,a[4]=n):n=a[4],n}function iI(e){return e.slice(0,7)}function ij(e){let t=(0,r.c)(13),{commitOid:n,contentsUrl:a,type:l}=e,o=void 0===n?"":n,s="added"===l?"added at":"deleted from";if(a){let e,n,r,l=`${a}/tree/${o}`;return t[0]!==o?(e=iI(o),t[0]=o,t[1]=e):e=t[1],t[2]!==l||t[3]!==e?(n=(0,i.jsx)(eU.A,{inline:!0,href:l,children:e}),t[2]=l,t[3]=e,t[4]=n):n=t[4],t[5]!==n||t[6]!==s?(r=(0,i.jsxs)(i.Fragment,{children:[s," ",n]}),t[5]=n,t[6]=s,t[7]=r):r=t[7],r}{let e,n;return t[8]!==o?(e=iI(o),t[8]=o,t[9]=e):e=t[9],t[10]!==e||t[11]!==s?(n=(0,i.jsxs)(i.Fragment,{children:[s," ",e]}),t[10]=e,t[11]=s,t[12]=n):n=t[12],n}}function ik(e){let t,n,a,l=(0,r.c)(12),{newCommitOid:o,oldCommitOid:s,changedFiles:d,contentsUrl:c}=e,u=void 0===o?"":o,m=void 0===s?"":s,f=void 0===d?0:d;l[0]!==f||l[1]!==c||l[2]!==u||l[3]!==m?(t=f>0&&c?`${f} ${1===f?"file":"files"}`:`from ${iI(m)} to ${iI(u)}`,l[0]=f,l[1]=c,l[2]=u,l[3]=m,l[4]=t):t=l[4];let h=t;return l[5]!==h||l[6]!==c||l[7]!==u||l[8]!==m?(n=c?(0,i.jsx)(eU.A,{inline:!0,href:`${c}/compare/${m}...${u}`,children:h}):h,l[5]=h,l[6]=c,l[7]=u,l[8]=m,l[9]=n):n=l[9],l[10]!==n?(a=(0,i.jsxs)(i.Fragment,{children:["updated"," ",n]}),l[10]=n,l[11]=a):a=l[11],a}function iA(e){let t,n,l,o,s,d,c=(0,r.c)(16),{compareUrl:u,linesAdded:m,linesDeleted:f,path:h,pathDigest:g,status:p}=e,b=`${u}#diff-${g}`;return c[0]!==p?(t=(0,i.jsx)(i_.E,{status:p}),c[0]=p,c[1]=t):t=c[1],c[2]!==h?(n=(0,i.jsx)("span",{className:"SubmoduleDiff-module__path__Ra2pU",children:h}),c[2]=h,c[3]=n):n=c[3],c[4]!==m||c[5]!==f?(l=(m>0||f>0)&&(0,i.jsxs)("div",{className:"d-flex flex-shrink-0 gap-1 flex-nowrap",children:[(0,i.jsx)("div",{className:"SubmoduleDiff-module__linesAdded__uCgg2",children:m>0&&(0,i.jsxs)(a.C,{isAddition:!0,children:["+",iE(m)]})}),(0,i.jsx)("div",{className:"SubmoduleDiff-module__linesDeleted__Qb7bx",children:f>0&&(0,i.jsxs)(a.C,{isAddition:!1,children:["-",iE(f)]})})]}),c[4]=m,c[5]=f,c[6]=l):l=c[6],c[7]!==n||c[8]!==l?(o=(0,i.jsxs)("div",{className:"d-flex gap-1 flex-justify-between width-full",children:[n,l]}),c[7]=n,c[8]=l,c[9]=o):o=c[9],c[10]!==t||c[11]!==o?(s=(0,i.jsxs)(iN.B,{gap:"condensed",direction:"horizontal",align:"center",className:"SubmoduleDiff-module__fileRow__oBxlW",children:[t,o]}),c[10]=t,c[11]=o,c[12]=s):s=c[12],c[13]!==b||c[14]!==s?(d=(0,i.jsx)(eD.l.LinkItem,{href:b,className:"SubmoduleDiff-module__fileRowLinkItem__SlLM_",children:s}),c[13]=b,c[14]=s,c[15]=d):d=c[15],d}function iE(e){return e>999?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}iw.displayName="SubmoduleDiff",iD.displayName="SubmodulePath",ij.displayName="SubmoduleCommitChange",ik.displayName="SubmoduleModified",iA.displayName="SubmoduleFileRow";let iR=({path:e,oid:t,repository:n})=>e&&t?{type:"file",url:(0,tA.IO9)({repo:n,commitish:t,action:"raw",path:e}),path:e,repoID:n.id,repoName:n.name,repoOwner:n.ownerLogin,ref:t,commitOID:t}:null;function iT(e){let t,n,a,o,s,c,m,f,h,g,p,v,C,x,L,S,N,_,w,D,I,k,A,E,R,T,O,$=(0,r.c)(72);if($[0]!==e){let{fileAnchor:i,filePath:r,thread:l,isFirstThread:d,ghostUser:c,manuallyUpdateCommentsWithThisThreadId:u,...m}=e;t=r,s=l,a=d,n=c,o=m,$[0]=e,$[1]=t,$[2]=n,$[3]=a,$[4]=o,$[5]=s}else t=$[1],n=$[2],a=$[3],o=$[4],s=$[5];let F=(0,l.useRef)(null);$[6]===Symbol.for("react.memo_cache_sentinel")?(c=(0,j.A)("localStorage"),$[6]=c):c=$[6];let M=c,B=s?.isResolved,[H,P]=(0,l.useState)(""),[K,U]=(0,l.useState)(B??!1);$[7]!==B||$[8]!==s.id?(m=()=>{let e=localStorage.getItem(`reviewThreadIsCollapsed_${s.id}`);null!==e?U(JSON.parse(e)):B&&U(!0)},f=[B,s.id],$[7]=B,$[8]=s.id,$[9]=m,$[10]=f):(m=$[9],f=$[10]),(0,l.useEffect)(m,f);let V=(0,y.zK)();e:{let e;if(null==V){h=!1;break e}$[11]!==V||$[12]!==s.commentsData?.comments?(e=s?.commentsData?.comments.some(e=>e.databaseId===V)??!1,$[11]=V,$[12]=s.commentsData?.comments,$[13]=e):e=$[13],h=e}let z=h,q=K&&!z;$[14]!==q||$[15]!==s.id?(g=()=>{window.requestAnimationFrame(()=>{M.setItem(`reviewThreadIsCollapsed_${s.id}`,JSON.stringify(!q))}),U(i$)},$[14]=q,$[15]=s.id,$[16]=g):g=$[16];let G=g,{sendAnalyticsEvent:W}=(0,ts.s)(),{mutate:X}=(0,tj.H)(t,"FILE");$[17]!==X||$[18]!==W||$[19]!==s?(p=()=>{s&&!s.isResolved&&(X({threadId:s.id},{onError:()=>P("Failed to resolve thread"),onSuccess:()=>{U(!0),M.removeItem(`reviewThreadIsCollapsed_${s.id}`)}}),W("comments.resolve_thread","RESOLVE_CONVERSATION_BUTTON"))},$[17]=X,$[18]=W,$[19]=s,$[20]=p):p=$[20];let J=p,{mutate:Q}=(0,tk.i)(t,"FILE");$[21]!==W||$[22]!==s||$[23]!==Q?(v=()=>{s&&(Q({threadId:s.id},{onError:()=>P("Failed to unresolve thread"),onSuccess:()=>{U(!1),M.removeItem(`reviewThreadIsCollapsed_${s.id}`)}}),W("comments.unresolve_thread","RESOLVE_CONVERSATION_BUTTON"))},$[21]=W,$[22]=s,$[23]=Q,$[24]=v):v=$[24];let Y=v;if(!s||!(s.commentsData?.comments&&s.commentsData.comments.length>0))return null;let Z=s?.commentsData?.comments[0]?.reviewVariantType===te.hH.Automated?s.commentsData?.comments[0]?.automatedComment:null,ee=Z&&Z.dismissable,et=Z&&Z.source===te.vk.LicenseCompliance,en=!!s.isResolved;$[25]===Symbol.for("react.memo_cache_sentinel")?(C=(0,tE.M3)(),$[25]=C):C=$[25];let ei=C;$[26]!==s.commentsData?.comments?(x=ei&&s.commentsData?.comments?.some(iO),$[26]=s.commentsData?.comments,$[27]=x):x=$[27];let er=x,ea=s.commentsData?.comments[0]?.createdAt,el=s.commentsData?.comments[0]?.author?.login??"Unknown Author",eo=`${B?"Unresolve":"Resolve"} comment`;if(ea){let e;$[28]!==ea?(e=(0,tl.C)(new Date(ea)),$[28]=ea,$[29]=e):e=$[29];let t=e;eo=`${B?"Unresolve":"Resolve"} ${el}'s comment, ${t}`}$[30]===Symbol.for("react.memo_cache_sentinel")?(L=(0,i.jsx)(tu,{}),$[30]=L):L=$[30],$[31]===Symbol.for("react.memo_cache_sentinel")?(S=(0,b.$)("px-1","FileReviewThread-module__ReviewThreadContainer__NSCqn"),$[31]=S):S=$[31];let es=q?"Expand comment":"Collapse comment",ed=q?d.ChevronRightIcon:d.ChevronDownIcon;return $[32]!==G||$[33]!==a||$[34]!==es||$[35]!==ed?(N=(0,i.jsx)(u.K,{"aria-label":es,icon:ed,size:"small",variant:"invisible",onClick:G,"data-is-first-collapse-button":a}),$[32]=G,$[33]=a,$[34]=es,$[35]=ed,$[36]=N):N=$[36],$[37]===Symbol.for("react.memo_cache_sentinel")?(_=(0,i.jsx)("h2",{className:"FileReviewThread-module__ReviewThreadHeading__Uv4bD",children:"Comment on file"}),$[37]=_):_=$[37],$[38]!==s.positioning?.isOutdated?(w=s.positioning?.isOutdated&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Outdated"}),$[38]=s.positioning?.isOutdated,$[39]=w):w=$[39],$[40]!==en?(D=en&&(0,i.jsx)(tw.A,{variant:"secondary",children:"Resolved"}),$[40]=en,$[41]=D):D=$[41],$[42]!==w||$[43]!==D?(I=(0,i.jsxs)("div",{className:"FileReviewThread-module__ReviewThreadInnerContainer__oGZcv",children:[w,D]}),$[42]=w,$[43]=D,$[44]=I):I=$[44],$[45]!==N||$[46]!==I?(k=(0,i.jsxs)("div",{className:S,children:[N,_,I]}),$[45]=N,$[46]=I,$[47]=k):k=$[47],$[48]===Symbol.for("react.memo_cache_sentinel")?(A=(0,i.jsxs)("div",{className:"FileReviewThread-module__SpinnerWrapper__Ed5Um",children:[(0,i.jsx)(eB.A,{}),(0,i.jsx)("p",{children:"Loading comments"})]}),$[48]=A):A=$[48],$[49]!==H?(E=H&&(0,i.jsxs)(td.A,{variant:"danger",className:"m-2",children:[(0,i.jsx)(d.StopIcon,{className:"mr-2"}),H]}),$[49]=H,$[50]=E):E=$[50],$[51]!==Z||$[52]!==ee||$[53]!==q||$[54]!==t||$[55]!==n||$[56]!==J||$[57]!==Y||$[58]!==er||$[59]!==B||$[60]!==en||$[61]!==et||$[62]!==eo||$[63]!==o||$[64]!==s?(R=!q&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(t_,{lineMarkersKey:"FILE",batchingEnabled:!0,filePath:t,gridCellId:`${t}-file-level-markers`,isInlineComment:!1,thread:s,shouldLimitHeight:!1,...o,ghostUser:n}),er&&!ee&&!et&&(0,i.jsxs)("div",{className:"d-flex flex-items-center p-2 border-top flex-wrap",children:[(0,i.jsx)(ex.Q,{"aria-label":eo,onClick:en?Y:J,className:"mr-2",children:B?"Unresolve comment":"Resolve comment"}),en&&s.resolvedBy&&(0,i.jsxs)("span",{className:"fgColor-muted f6",children:[(0,i.jsx)("b",{children:s.resolvedBy})," marked this comment as resolved"]})]}),ee&&(0,i.jsx)(tO,{automatedComment:Z,thread:s,filePath:t,lineMarkersKey:"FILE",setErrorMessage:P,setIsCollapsed:U,safeLocalStorage:M})]}),$[51]=Z,$[52]=ee,$[53]=q,$[54]=t,$[55]=n,$[56]=J,$[57]=Y,$[58]=er,$[59]=B,$[60]=en,$[61]=et,$[62]=eo,$[63]=o,$[64]=s,$[65]=R):R=$[65],$[66]!==E||$[67]!==R?(T=(0,i.jsxs)(l.Suspense,{fallback:A,children:[E,R]}),$[66]=E,$[67]=R,$[68]=T):T=$[68],$[69]!==k||$[70]!==T?(O=(0,i.jsx)(to.t,{boundaryName:"FileReviewThread",fallback:L,children:(0,i.jsxs)("div",{className:"rounded-2 bgColor-default",ref:F,children:[k,T]})}),$[69]=k,$[70]=T,$[71]=O):O=$[71],O}function iO(e){return e.state?.toUpperCase()!=="PENDING"}function i$(e){return!e}function iF(e){let t,n,a,o,s,d,c,u,m,f,h=(0,r.c)(33);if(h[0]!==e){let{conversationListThreads:i,filePath:r,manuallyUpdateCommentsWithThisThreadId:l,ghostUser:s,...d}=e;t=i,n=r,a=s,o=d,h[0]=e,h[1]=t,h[2]=n,h[3]=a,h[4]=o}else t=h[1],n=h[2],a=h[3],o=h[4];h[5]!==t?(s=t.filter(iB),h[5]=t,h[6]=s):s=h[6];let g=s;h[7]!==t?(d=t.filter(iM),h[7]=t,h[8]=d):d=h[8];let p=d,v=(0,l.useRef)(null);if(h[9]!==g||h[10]!==p?(c={containerRef:v,markers:[...g,...p],disabled:!1,focusInStrategy:"closest"},h[9]=g,h[10]=p,h[11]=c):c=h[11],e3(c),h[12]!==n||h[13]!==a||h[14]!==o||h[15]!==g||h[16]!==p.length){let e;h[18]!==n||h[19]!==a||h[20]!==o||h[21]!==g.length||h[22]!==p.length?(e=(e,t)=>(0,i.jsx)("div",{className:(0,b.$)("mt-1 border rounded-2 color-border-default color-shadow-small",t===g.length-1&&0===p.length?"mb-1":"mb-2"),"data-first-marker":0===t,"data-marker-id":`${e.id}`,tabIndex:0,children:(0,i.jsx)(iT,{viewerData:o.viewerData,filePath:n,thread:e,ghostUser:a},e.id)},`review-thread-${e.id}`),h[18]=n,h[19]=a,h[20]=o,h[21]=g.length,h[22]=p.length,h[23]=e):e=h[23],u=g.map(e),h[12]=n,h[13]=a,h[14]=o,h[15]=g,h[16]=p.length,h[17]=u}else u=h[17];if(h[24]!==g.length||h[25]!==p){let e;h[27]!==g.length||h[28]!==p.length?(e=(e,t)=>{let n=0===g.length&&0===t,r=p.length;return(0,i.jsx)(tH,{thread:e,isFirstMarker:n,isLastThread:t===r-1,isInDialogMode:!1},`file-review-thread-without-data-${e.id}`)},h[27]=g.length,h[28]=p.length,h[29]=e):e=h[29],m=p.map(e),h[24]=g.length,h[25]=p,h[26]=m}else m=h[26];return h[30]!==u||h[31]!==m?(f=(0,i.jsx)("div",{className:"d-flex pt-1 px-1",children:(0,i.jsxs)("div",{className:"InlineMarkers-module__fileMarkersWrapper__nDvmf",ref:v,children:[u,m]})}),h[30]=u,h[31]=m,h[32]=f):f=h[32],f}function iM(e){return e.hideUntilLoadedAndInView}function iB(e){return!e.hideUntilLoadedAndInView}iT.displayName="FileReviewThread",iF.displayName="FileMarkers";var iH=n(41230),iP=n(83914);let iK=new Set;function iU(e){let t,n,s,c,u,m,f,h,p,C,x,L,S,N,_,D,I,j,k,A,E,R,T=(0,r.c)(149),{ref:$,addFileCommentButtonRef:F,collapsed:M,currentUser:H,diffLines:P,diffManuallyExpanded:K,diffSize:U,helpUrl:V,estimatedDiffHeight:z,fileComments:q,headerStickyOffset:G,hiddenFeatures:W,isAddingFileComment:X,isBinary:J,isSelected:Q,isSubmodule:Y,isTooBig:Z,leftSideContent:ee,linesAdded:et,linesChanged:en,linesDeleted:ei,newTreeEntry:er,newCommitOid:ea,objectId:el,oldTreeEntry:eo,oldCommitOid:es,onToggleCollapse:ed,path:ec,pathDigest:eu,pullRequestGlobalRelayId:em,repository:ef,richDiffState:eh,rightSideContent:eg,setIsAddingFileComment:ep,hasExpandedAllRanges:eb,expandAllContextLines:ev,canExpandOrCollapseLines:eC,status:ex,submodule:ey,truncatedReason:eL,addInjectedContextLines:eS,loadDiff:eN}=e,e_=void 0===z?0:z,ew=void 0===W?iK:W,eD=void 0!==Q&&Q,eI=Y&&!!ey,ej=!eI&&!eh?.showRichDiff,[ek,eA]=(0,l.useState)(K),eE=(0,y.j5)(),{comparisonView:eO}=(0,y.L3)(),e$=(0,y.Kp)(),[eF,eM]=(0,l.useState)(!1);if(T[0]!==P||T[1]!==eF){let e;T[3]!==eF?(e=e=>{let t,n;return{...(t=!1,n=e,t=(0,eq.Y)(e.text),n={...n,hasHiddenUnicode:t},eF&&t&&(n=e.html?{...n,html:(0,iH.Gx)(e.html)??e.html}:{...n,text:(0,eq.TA)(e.text)}),n),key:`b:${e.blobLineNumber}-l:${e.left}-r:${e.right}`}},T[3]=eF,T[4]=e):e=T[4],t=P.map(e),T[0]=P,T[1]=eF,T[2]=t}else t=T[2];let eB=t;T[5]!==e$||T[6]!==P||T[7]!==ec?(n=function(e,t,n){let i={};for(let r of e){let e="DELETION"===r.type?"LEFT":"RIGHT",a=O((0,v.sI)({diffSide:e,filePath:t,line:("LEFT"===e?r.left:r.right)??r.blobLineNumber,subjectId:n},!1)),l="DELETION"!==r.type?"RIGHT":"LEFT",o="RIGHT"===l?r.right:r.left,s=(0,w.oH)(o,l),d=!!a?.text?.trim();s&&d&&(i[s]=!0)}return i}(P,ec,e$),T[5]=e$,T[6]=P,T[7]=ec,T[8]=n):n=T[8];let eP=n;T[9]!==H.hasCopilotAccess||T[10]!==J||T[11]!==Y||T[12]!==ea||T[13]!==er||T[14]!==es||T[15]!==eo||T[16]!==ec||T[17]!==eu||T[18]!==ef||T[19]!==ex?(s={isBinary:J,isSubmodule:Y,path:ec,status:ex,repository:ef,newCommitOid:ea,newTreeEntry:er,oldCommitOid:es,oldTreeEntry:eo,pathDigest:eu,hasCopilotAccess:H.hasCopilotAccess},T[9]=H.hasCopilotAccess,T[10]=J,T[11]=Y,T[12]=ea,T[13]=er,T[14]=es,T[15]=eo,T[16]=ec,T[17]=eu,T[18]=ef,T[19]=ex,T[20]=s):s=T[20];let eK=function(e){let t,n=(0,r.c)(8),{isBinary:i,isSubmodule:a,path:l,status:o,repository:s,newCommitOid:d,newTreeEntry:c,oldCommitOid:u,oldTreeEntry:m,pathDigest:f,hasCopilotAccess:h}=e;e:{let e;if(!(({hasCopilotAccess:e,isBinary:t,isSubmodule:n,path:i,repository:r,status:a})=>!!e&&!t&&!n&&!!i&&"DELETED"!==a&&"REMOVED"!==a&&!!r.id&&!!r.name&&!!r.ownerLogin&&!0)({isBinary:i,isSubmodule:a,path:l,status:o,repository:s,hasCopilotAccess:h})){t=void 0;break e}n[0]!==d||n[1]!==c||n[2]!==u||n[3]!==m||n[4]!==l||n[5]!==f||n[6]!==s?(e=(({newCommitOid:e,newTreeEntry:t,oldCommitOid:n,oldTreeEntry:i,path:r,pathDigest:a,repository:l})=>{let o=n&&e?(0,tA.IO9)({repo:l,commitish:n,action:"raw",path:r}):"";return{baseFile:iR({path:i?.path,oid:n,repository:l}),headFile:iR({path:t?.path,oid:e,repository:l}),baseBranchRef:n,id:`#diff-${a}`,type:"file-diff",url:o}})({newCommitOid:d,newTreeEntry:c,oldCommitOid:u,oldTreeEntry:m,path:l,pathDigest:f,repository:s}),n[0]=d,n[1]=c,n[2]=u,n[3]=m,n[4]=l,n[5]=f,n[6]=s,n[7]=e):e=n[7],t=e}return t}(s);T[21]!==eN?(c=async()=>{await eN(),eA(!0)},T[21]=eN,T[22]=c):c=T[22];let eU=c,{baseOid:eV,headOid:ez}=(0,y.E4)(),eG=(0,eR.u)("cotd_ui"),{effectiveRange:eW}=(0,y.L3)(),{mutate:eX}=t3();T[23]!==ep?(u=()=>{ep(!0)},T[23]=ep,T[24]=u):u=T[24];let eJ=u;T[25]!==eJ?(m={F0:{startNewComment:eJ,diffLineKey:"b:0-l:null-r:null"}},T[25]=eJ,T[26]=m):m=T[26];let eQ=m;T[27]!==eG||T[28]!==eX||T[29]!==eW||T[30]!==ez||T[31]!==ec||T[32]!==ep||T[33]!==eV?(f=e=>{let{onCompleted:t,onError:n,submitBatch:i,text:r}=e;eG?eX(new t4({filePath:ec,effectiveDiffRange:eW,submitBatch:i,text:r}).fileRequestData(),{onError:n,onSuccess:e=>{t?.(e.thread.id,e.comment.databaseId),ep(!1)}}):eX({text:r,path:ec,submitBatch:i,subjectType:o.Wr.File,comparisonEndOid:ez,comparisonStartOid:eV},{onError:n,onSuccess:e=>{t?.(e.thread.id,e.comment.databaseId),ep(!1)}})},T[27]=eG,T[28]=eX,T[29]=eW,T[30]=ez,T[31]=ec,T[32]=ep,T[33]=eV,T[34]=f):f=T[34];let eY=f;T[35]!==F||T[36]!==ep?(h=()=>{ep(!1),F?.current?.focus()},T[35]=F,T[36]=ep,T[37]=h):h=T[37];let eZ=h,e1=H?.avatarURL??"",e0=H?.splitPreference,e2=H?.login??"",e3=H?.lineSpacing,e4=H?.shouldDisplayComments,e5=H?.shouldDisplayEditOptions,e6=H?.tabSize??4,e7=H?.canComment,e8=H?.canApplySuggestion;T[38]!==e1||T[39]!==e0||T[40]!==e2||T[41]!==e3||T[42]!==e4||T[43]!==e5||T[44]!==e6||T[45]!==e7||T[46]!==e8?(p={avatarUrl:e1,diffViewPreference:e0,login:e2,lineSpacingPreference:e3,shouldDisplayComments:e4,shouldDisplayEditOptions:e5,tabSizePreference:e6,viewerCanComment:e7,viewerCanApplySuggestion:e8},T[38]=e1,T[39]=e0,T[40]=e2,T[41]=e3,T[42]=e4,T[43]=e5,T[44]=e6,T[45]=e7,T[46]=e8,T[47]=p):p=T[47];let e9=p,te=(0,l.useId)(),tt=`heading-${te}`;e:{if("split"===new URLSearchParams(g.cg?.location.search).get("diff")){C=!0;break e}C="split"===H.splitPreference}let tn=C,ti=er?.lineCount??eo?.lineCount??0;eo?.path,er?.path;t:{let e,t=eo?.path,n=er?.path;if(!t&&!n){x=void 0;break t}e="RENAMED"===ex?`${t} renamed to ${n}`:"DELETED"===ex||"REMOVED"===ex?t:n,x=`Diff for: ${e}`}let tr=x;T[48]!==eB||T[49]!==J||T[50]!==Z||T[51]!==en||T[52]!==ea||T[53]!==er||T[54]!==el||T[55]!==es||T[56]!==eo||T[57]!==ec||T[58]!==eu||T[59]!==ex||T[60]!==eL?(L={diffLines:eB,isBinary:J,isTooBig:Z,linesChanged:en,newTreeEntry:er,newCommitOid:ea,objectId:el,oldTreeEntry:eo,oldCommitOid:es,path:ec,pathDigest:eu,status:ex,truncatedReason:eL},T[48]=eB,T[49]=J,T[50]=Z,T[51]=en,T[52]=ea,T[53]=er,T[54]=el,T[55]=es,T[56]=eo,T[57]=ec,T[58]=eu,T[59]=ex,T[60]=eL,T[61]=L):L=T[61];let ta=L,tl=`diff-${eu}`,to=`diff-${eu}`;T[62]===Symbol.for("react.memo_cache_sentinel")?(S=(0,b.$)(iS.A.diffTargetable,iS.A.diff),T[62]=S):S=T[62];let ts=`${eu}_${eB.length}`,td=`auto ${e_}px`;T[63]!==td?(N={contentVisibility:"auto",containIntrinsicSize:td},T[63]=td,T[64]=N):N=T[64];let tc=`${void 0===G?0:G}px`;T[65]!==tc?(_={"--header-sticky-offset":tc},T[65]=tc,T[66]=_):_=T[66];let tu=`#diff-${eu}`,tm=eh?.richDiff?.canToggleRichDiff,tf=er?.mode,th=er?.path,tg=eo?.mode,tp=eo?.path;T[67]!==M||T[68]!==ed?(D=e=>ed(e,!M),T[67]=M,T[68]=ed,T[69]=D):D=T[69];let tb=eh?.onToggleRichDiff,tv=eh?.showRichDiff;return T[70]!==eC||T[71]!==M||T[72]!==U||T[73]!==ev||T[74]!==eb||T[75]!==tt||T[76]!==ew||T[77]!==J||T[78]!==eE||T[79]!==ee||T[80]!==et||T[81]!==en||T[82]!==ei||T[83]!==ec||T[84]!==eg||T[85]!==ex||T[86]!==tu||T[87]!==tm||T[88]!==tf||T[89]!==th||T[90]!==tg||T[91]!==tp||T[92]!==D||T[93]!==tb||T[94]!==tv?(I=(0,i.jsx)(a.B,{headingId:tt,hiddenFeatures:ew,areLinesExpanded:eb,canExpandOrCollapseLines:eC,fileLinkHref:tu,isCollapsed:M,isBinary:J,size:U,canToggleRichDiff:tm,linesAdded:et,linesChanged:en,linesDeleted:ei,newMode:tf,newPath:th,oldMode:tg,oldPath:tp,patchStatus:ex,path:ec,onToggleExpandAllLines:ev,onToggleFileCollapsed:D,onToggleDiffDisplay:tb,additionalLeftSideContent:ee,rightSideContent:eg,showRichDiff:tv,isInSingleFileMode:eE}),T[70]=eC,T[71]=M,T[72]=U,T[73]=ev,T[74]=eb,T[75]=tt,T[76]=ew,T[77]=J,T[78]=eE,T[79]=ee,T[80]=et,T[81]=en,T[82]=ei,T[83]=ec,T[84]=eg,T[85]=ex,T[86]=tu,T[87]=tm,T[88]=tf,T[89]=th,T[90]=tg,T[91]=tp,T[92]=D,T[93]=tb,T[94]=tv,T[95]=I):I=T[95],T[96]!==_||T[97]!==I?(j=(0,i.jsx)("div",{className:iS.A.diffHeaderWrapper,style:_,children:I}),T[96]=_,T[97]=I,T[98]=j):j=T[98],T[99]!==M||T[100]!==eK||T[101]!==ta||T[102]!==q||T[103]!==eY||T[104]!==eb||T[105]!==V||T[106]!==X||T[107]!==tn||T[108]!==ek||T[109]!==eZ||T[110]!==eU||T[111]!==ec||T[112]!==em||T[113]!==ef||T[114]!==eh||T[115]!==ej||T[116]!==eF||T[117]!==eI||T[118]!==ey||T[119]!==tr||T[120]!==e9?(k=M?null:(0,i.jsxs)("div",{className:"border position-relative rounded-bottom-2",children:[(0,i.jsx)(iP.nB,{full:!0,repo:ef,refName:ta.newCommitOid||"",filePath:ta.path}),(0,i.jsxs)(i.Fragment,{children:[q.length>0&&(0,i.jsx)(iF,{conversationListThreads:q,filePath:ec}),X&&(0,i.jsx)("div",{className:(0,b.$)("border rounded-2 color-border-default m-1 rounded-2 bgColor-default",iS.A.diffAddFileThread),children:(0,i.jsx)(eT,{batchingEnabled:!0,filePath:ec,fileLevelComment:!0,isLeftSide:void 0,viewerData:e9,onAddComment:eY,onClose:eZ})})]}),eI&&(0,i.jsx)(iw,{submodule:ey}),eh?.showRichDiff&&(0,i.jsx)(eH,{queryConfig:eh.queryConfig,initialData:eh.richDiff}),ej&&(0,i.jsx)(ix,{hasExpandedAllRanges:eb,copilotChatReference:eK,diffEntryData:ta,baseHelpUrl:V,subjectId:em||"",viewerData:e9,isSplitView:tn,diffLinesManuallyUnhidden:ek,handleSetShowHiddenUnicodeCharacters:eM,onHandleLoadDiff:eU,showHiddenUnicodeCharacters:eF,tableAriaLabel:tr})]}),T[99]=M,T[100]=eK,T[101]=ta,T[102]=q,T[103]=eY,T[104]=eb,T[105]=V,T[106]=X,T[107]=tn,T[108]=ek,T[109]=eZ,T[110]=eU,T[111]=ec,T[112]=em,T[113]=ef,T[114]=eh,T[115]=ej,T[116]=eF,T[117]=eI,T[118]=ey,T[119]=tr,T[120]=e9,T[121]=k):k=T[121],T[122]!==e_||T[123]!==tt||T[124]!==eD||T[125]!==$||T[126]!==to||T[127]!==ts||T[128]!==N||T[129]!==j||T[130]!==k?(A=(0,i.jsxs)("div",{"data-estimated-height":e_,role:"region",ref:$,"aria-labelledby":tt,id:to,className:S,"data-targeted":eD,style:N,children:[j,k]},ts),T[122]=e_,T[123]=tt,T[124]=eD,T[125]=$,T[126]=to,T[127]=ts,T[128]=N,T[129]=j,T[130]=k,T[131]=A):A=T[131],T[132]!==eO||T[133]!==eE?(E=eE&&(0,i.jsxs)("div",{className:iS.A.diffFooter,children:[(0,i.jsx)(d.InfoIcon,{size:16,"aria-hidden":"true"}),(0,i.jsx)("span",{className:"text-center",children:function(e){switch(e){case"COMMIT":return"Due to the large number of changes in the selected commit, only one file is being shown at a time.";case"RANGE":return"Due to the large number of changes in the selected commit range, only one file is being shown at a time.";default:return"Due to the large number of changes in this pull request, only one file is being shown at a time."}}(eO)})]}),T[132]=eO,T[133]=eE,T[134]=E):E=T[134],T[135]!==eS||T[136]!==eB||T[137]!==ti||T[138]!==ew||T[139]!==tn||T[140]!==er||T[141]!==eo||T[142]!==ec||T[143]!==eQ||T[144]!==eP||T[145]!==tl||T[146]!==A||T[147]!==E?(R=(0,i.jsxs)(B,{addInjectedContextLines:eS,diffAnchor:tl,diffLines:eB,fileLineCount:ti,path:ec,startNewConversationForLineOrFileMap:eQ,hiddenFeatures:ew,isSplitView:tn,oldTreeEntry:eo,newTreeEntry:er,storedCommentsMap:eP,children:[A,E]}),T[135]=eS,T[136]=eB,T[137]=ti,T[138]=ew,T[139]=tn,T[140]=er,T[141]=eo,T[142]=ec,T[143]=eQ,T[144]=eP,T[145]=tl,T[146]=A,T[147]=E,T[148]=R):R=T[148],R}function iV(e){let t,n,o,s,c,u=(0,r.c)(24),{path:m,pathDigest:f,linesAdded:h,linesChanged:g,linesDeleted:p,oldTreeEntry:v,newTreeEntry:C,status:x}=e,y=(0,l.useId)(),L=`heading-${y}`,[S,N]=(0,l.useState)(!1),_=`diff-${f}`;u[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,b.$)(iS.A.diffTargetable,iS.A.diff),u[0]=t):t=u[0];let w=`${f}_error`,D=C?.mode,I=C?.path,j=v?.mode,k=v?.path;return u[1]!==S?(n=()=>N(!S),u[1]=S,u[2]=n):n=u[2],u[3]!==L||u[4]!==S||u[5]!==h||u[6]!==g||u[7]!==p||u[8]!==m||u[9]!==x||u[10]!==D||u[11]!==I||u[12]!==j||u[13]!==k||u[14]!==n?(o=(0,i.jsx)("div",{className:iS.A.diffHeaderWrapper,children:(0,i.jsx)(a.B,{headingId:L,isCollapsed:S,isBinary:!1,linesAdded:h,linesChanged:g,linesDeleted:p,newMode:D,newPath:I,oldMode:j,oldPath:k,patchStatus:x,path:m,onToggleFileCollapsed:n})}),u[3]=L,u[4]=S,u[5]=h,u[6]=g,u[7]=p,u[8]=m,u[9]=x,u[10]=D,u[11]=I,u[12]=j,u[13]=k,u[14]=n,u[15]=o):o=u[15],u[16]!==S?(s=!S&&(0,i.jsx)("div",{className:"border position-relative rounded-bottom-2",children:(0,i.jsxs)(tc.E,{children:[(0,i.jsx)(tc.E.Visual,{children:(0,i.jsx)(d.AlertIcon,{size:"medium",className:"fgColor-muted"})}),(0,i.jsx)(tc.E.Heading,{as:"h4",children:"There was an issue loading this file"}),(0,i.jsxs)(tc.E.Description,{children:[" ","Try refreshing the page or if the problem persists"," ",(0,i.jsx)("a",{className:"fgColor-muted",href:"https://support.github.com/",children:(0,i.jsx)("u",{children:"contact support"})}),"."]})]})}),u[16]=S,u[17]=s):s=u[17],u[18]!==L||u[19]!==_||u[20]!==s||u[21]!==w||u[22]!==o?(c=(0,i.jsxs)("div",{role:"region","aria-labelledby":L,id:_,className:t,children:[o,s]},w),u[18]=L,u[19]=_,u[20]=s,u[21]=w,u[22]=o,u[23]=c):c=u[23],c}iU.displayName="DiffUnmemoized",iV.displayName="DiffErrorFallback";let iz=(0,l.memo)(iU);iz.displayName="Diff"},68938(e,t,n){function i(e){return[...e.querySelectorAll(".js-blob-code-addition")].map(e=>e.textContent).filter(e=>null!==e)}function r(e){if(!e||e.length>1e5)return null;let t=e.split(/\r?\n/),n=!1,i="",r=[];for(let e=0;e0){let t=RegExp(`^ {0,${i.length}}`);e=a.replace(t,"")}r.push(e)}else{let e=a.match(/^( {0,3})(`{3,}|~{3,})suggestion[ \t]*$/);if(e){n=!0,i=e[1]||"";continue}}}return null}n.d(t,{T:()=>r,y:()=>i})},31256(e,t,n){n.d(t,{Av:()=>_,Ji:()=>f,Lp:()=>C,Ls:()=>S,Mk:()=>v,Po:()=>u,S4:()=>L,Yf:()=>w,a2:()=>o,dT:()=>N,dv:()=>g,j2:()=>y,oH:()=>s,qK:()=>m,qX:()=>d,u6:()=>c,xB:()=>h,x_:()=>p});var i=n(58989),r=n(27426),a=n(14864),l=n(15019);function o(e,t,n){return"left"===n?!u(e)&&e.left===t:!u(e)&&(0,i.XU)(e.type)===n&&e.right===t}function s(e,t){return"LEFT"===t?`L${e}`:`R${e}`}function d(e,t,n){let i=`-${u(t)||"number"!=typeof t?.left?"empty":t?.left}`,r=n?`-${u(n)||"number"!=typeof n.right?"empty":n.right}`:"";return`${e}${i}${r}`}function c(e,t){return`${e}-${t}`}function u(e){return void 0===e||!!e&&e===l.Vv}function m(e){return!!e&&e!==l.Vv}function f(e){return"CONTEXT"===e.type}function h(e){return u(e)||f(e)||"INJECTED_CONTEXT"===e.type}function g(e,t){return t===a.w$.Empty||t===a.w$.Hunk?[e,void 0]:b(e,a.JF[t])}function p(e,t){let n;switch(t){case a.w$.Addition:n=a.JF[a.w$.Addition];break;case a.w$.Deletion:n=a.JF[a.w$.Deletion];break;case a.w$.Context:case a.w$.InjectedContext:n=a.JF[a.w$.Context]}return b(e,n)}function b(e,t){if(!t||!e.startsWith(t))return[e,void 0];let n=e[0];return[e.substring(1),n]}function v(e){let t=[],n=[],i=()=>{for(;t.length=a?(0,r.j$)(t):function(e,t){let n=x(e),i=n?e.left:e.right,a=n?"left":"right";if(null!==i)return(0,r.j$)({diffAnchor:t,endLineNumber:i,endOrientation:a,startLineNumber:i,startOrientation:a})}(e,n)}else t&&(i=(0,r.j$)(t));if(i)return`${a}${l}#${i}`}function L({hasThreads:e}){return e?"80px":"24px"}let S=e=>e?e.filter(e=>!u(e)).map(e=>{var t;let[n]=p((t=e.html,new DOMParser().parseFromString(t,"text/html").documentElement.textContent||""),e.type);return n}).join("\n"):"";function N(e){return!!(e.text.length<1&&("CONTEXT"===e.type||"INJECTED_CONTEXT"===e.type)||("DELETION"===e.type||"ADDITION"===e.type)&&1===e.text.length&&["+","-"].includes(e.text.charAt(0)))}let _=(e,t,n,i)=>{let r;if(e)return e;if(!u(t)){let e=(n?t.left:t.right)??0,a=n?"left":"right";r={startOrientation:a,endOrientation:a,startLineNumber:e,endLineNumber:e,diffAnchor:i}}return r};function w(e,t=!1,n=!1){let i;if(n)return"";switch(e){case"ADDITION":i=t?"var(--diffBlob-additionNum-bgColor, var(--diffBlob-addition-bgColor-num))":"var(--diffBlob-additionLine-bgColor, var(--diffBlob-addition-bgColor-line))";break;case"DELETION":i=t?"var(--diffBlob-deletionNum-bgColor, var(--diffBlob-deletion-bgColor-num))":"var(--diffBlob-deletionLine-bgColor, var(--diffBlob-deletion-bgColor-line))";break;case"HUNK":i=t?"var(--diffBlob-hunkNum-bgColor-rest, var(--diffBlob-hunk-bgColor-num))":"var(--diffBlob-hunkLine-bgColor, var(--bgColor-accent-muted))";break;case"EMPTY":i=t?"var(--diffBlob-emptyNum-bgColor, var(--diffBlob-hunk-bgColor-num))":"var(--diffBlob-emptyLine-bgColor, var(--bgColor-accent-muted))";break;default:i="var(--bgColor-default)"}return i}},32371(e,t,n){n.d(t,{L4:()=>c,sI:()=>d});var i=n(16522),r=n(35205),a=n(96540);let{getItem:l,removeItem:o,setItem:s}=(0,r.D)("localStorage"),d=(e,t)=>{let{diffSide:n,filePath:i,line:r,subjectId:a}=e;if(t)return`PullRequest:${a}-File:${i}`;if(void 0!==r&&void 0!==n)return`PullRequest:${a}-File:${i}-Line:${r}-DiffSide:${n}`;throw Error("Cannot build diff line comment cache key for a comment without a line number or diff side")};function c(e){let t,n,r,c,u,m,f=(0,i.c)(16),{diffSide:h,filePath:g,handlePersistedCommentExists:p,line:b,subjectId:v,threadId:C,fileLevelComment:x}=e;e:{let e;if(C){t=C;break e}f[0]!==h||f[1]!==x||f[2]!==g||f[3]!==b||f[4]!==v||f[5]!==C?(e=C??d({diffSide:h,filePath:g,line:b,subjectId:v},x),f[0]=h,f[1]=x,f[2]=g,f[3]=b,f[4]=v,f[5]=C,f[6]=e):e=f[6],t=e}let y=t,{hasPersistedComment:L,removePersistedCommentFromStorage:S}=(u=l(y),m=!!u?.text?.trim(),(0,a.useEffect)(()=>{m&&p?.(u)},[m]),{hasPersistedComment:m,removePersistedCommentFromStorage:()=>{o(y),m=!1,u=null}});f[7]!==y?(n=e=>{let t={text:e.text};e.startLine&&e.startSide&&(t={...t,startLine:e.startLine,startSide:e.startSide}),s(y,t)},f[7]=y,f[8]=n):n=f[8];let N=n;f[9]!==v?(r=e=>{let t={shouldFocus:!0};e.text&&(t={...t,text:e.text}),e.startLine&&(t={...t,startLine:e.startLine,startSide:e.givenLineDiffSide,startLineKey:e.startLineKey,endLineKey:e.endLineKey}),s(d({diffSide:e.givenLineDiffSide,filePath:e.givenFilePath,line:e.givenLine,subjectId:v},e.shouldBeFileLevelComment),t)},f[9]=v,f[10]=r):r=f[10];let _=r;return f[11]!==L||f[12]!==_||f[13]!==N||f[14]!==S?(c={hasPersistedComment:L,persistCommentToStorage:N,persistCommentOnGivenLineToStorage:_,removePersistedCommentFromStorage:S},f[11]=L,f[12]=_,f[13]=N,f[14]=S,f[15]=c):c=f[15],c}},15019(e,t,n){function i(e){return"left"===e||"right"===e}n.d(t,{Vv:()=>r,Wr:()=>a,e:()=>i});let r="empty-diff-line",a={Line:"line",Multiline:"multiline",File:"file"}},14628(e,t,n){n.d(t,{J:()=>r,L:()=>i});class i extends Event{endLineNumber;endOrientation;filePath;startOrientation;startLineNumber;constructor(e,t){super("DiffAddCommentButtonClickedEvent",{bubbles:!0,cancelable:!0,composed:!0}),this.startLineNumber=e.startLineNumber,this.endLineNumber=e.endLineNumber,this.startOrientation=e.startOrientation,this.endOrientation=e.endOrientation,this.filePath=t}}class r extends Event{endLineNumber;endOrientation;filePath;startOrientation;startLineNumber;constructor(e,t){super("DiffSelectedLineEvent",{bubbles:!0,cancelable:!0,composed:!0}),this.startLineNumber=e.startLineNumber,this.endLineNumber=e.endLineNumber,this.startOrientation=e.startOrientation,this.endOrientation=e.endOrientation,this.filePath=t}}},56392(e,t,n){function i(e,t){for(let n of function e(t,n=[]){var i,a;let l;if(""===t)return n;let o=t.match(r());if(!o)return n;let s=o.groups.fence;if(!s)return n;let d=s.includes("~")?"~":"`",c=t.match((l=r([i=d],a=s.length),RegExp(`${l.source}(?:\r? )(?.*?)(?:\r? )^ {0,3}${i}{${a},}[ ]*$`,"ms")));if(!c)return n;let u=0,m=o.groups.indent;""!==m&&(u=m.length);let f=c.groups.suggestion;if(u>0){let e=RegExp(`^ {0,${u}}`,"m");f=f.replace(e,"")}return n.push(f),e(t.slice(c.index+c[0].length),n)}(e))if(n===t)return{isValid:!1,errorMessage:"Suggested change cannot be the same as the original line"};return{isValid:!0,errorMessage:""}}function r(e=["`","~"],t){let n=t?`{${t}}`:"{3,}",i=e.map(e=>`${e}${n}`);return RegExp(`^(? {0,3})(?${i.join("|")})suggestion[ ]*$`,"m")}n.d(t,{u:()=>i})},14193(e,t,n){n.d(t,{G:()=>i});let i=n(2501).$h.create("pull-requests")},43029(e,t,n){n.d(t,{H:()=>u});var i=n(16522),r=n(78431),a=n(62764),l=n(97665),o=n(94747),s=n(3079),d=n(70503),c=n(7909);function u(e,t){let n,u,m,f,h=(0,i.c)(12),g=(0,d.Kp)();h[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,c.cj)(),h[0]=n):n=h[0];let p=n,b=`${g}/page_data/${a.uT.resolveThread}`,v=(0,l.jE)(),{updateThread:C}=(0,d.an)();return h[1]!==b?(u=async e=>{let{threadId:t}=e,n=await (0,r.q$)(b,{method:"POST",body:{threadId:t}});(0,r.R)(n)},h[1]=b,h[2]=u):u=h[2],h[3]!==g||h[4]!==e||h[5]!==t||h[6]!==v||h[7]!==C?(m=(n,i)=>(C(Number(i.threadId),e,t,e=>{if(e)return{...e,isResolved:!0,resolvedBy:p}}),v.invalidateQueries({queryKey:(0,s.XG)(g)})),h[3]=g,h[4]=e,h[5]=t,h[6]=v,h[7]=C,h[8]=m):m=h[8],h[9]!==u||h[10]!==m?(f={mutationFn:u,onSuccess:m},h[9]=u,h[10]=m,h[11]=f):f=h[11],(0,o.n)(f)}},53572(e,t,n){n.d(t,{i:()=>c});var i=n(16522),r=n(78431),a=n(62764),l=n(97665),o=n(94747),s=n(3079),d=n(70503);function c(e,t){let n,c,m,f=(0,i.c)(11),h=(0,d.Kp)(),g=`${h}/page_data/${a.uT.unresolveThread}`,p=(0,l.jE)(),{updateThread:b}=(0,d.an)();return f[0]!==g?(n=async e=>{let{threadId:t}=e,n=await (0,r.q$)(g,{method:"POST",body:{threadId:t}});(0,r.R)(n)},f[0]=g,f[1]=n):n=f[1],f[2]!==h||f[3]!==e||f[4]!==t||f[5]!==p||f[6]!==b?(c=(n,i)=>(b(Number(i.threadId),e,t,u),p.invalidateQueries({queryKey:(0,s.XG)(h)})),f[2]=h,f[3]=e,f[4]=t,f[5]=p,f[6]=b,f[7]=c):c=f[7],f[8]!==n||f[9]!==c?(m={mutationFn:n,onSuccess:c},f[8]=n,f[9]=c,f[10]=m):m=f[10],(0,o.n)(m)}function u(e){if(e)return{...e,isResolved:!1,resolvedBy:void 0}}},3079(e,t,n){n.d(t,{CB:()=>f,XG:()=>u,jM:()=>m});var i=n(16522),r=n(62764),a=n(15610),l=n(78597),o=n(60815),s=n(35800),d=n(70503),c=n(18176);function u(e){return[r.uT.threadPreviews,e]}function m(e){let t=e.subject?.endDiffSide==="RIGHT"?"R":"L",n=e.subjectType?.toUpperCase()==="FILE",i=e.positioning?.path??e.path??"",r=n||e.subject?.endLine&&""!==i?i:c.Ao,a=n?"FILE":c.Ao;return{filePath:r,lineKey:e.subject?.endLine?`${t}${e.subject.endLine}`:a}}function f(e){let t,n,c,f,g=(0,i.c)(11),{pathName:p}=e,b=(0,d.ls)(),{updateThread:v}=(0,d.an)();if(g[0]!==p?(t=u(p),g[0]=p,g[1]=t):t=g[1],g[2]!==p)n=`${p}/page_data/${r.uT.threadPreviews}`,g[2]=p,g[3]=n;else n=g[3];return g[4]!==b||g[5]!==v?(c=async e=>{let{pageParam:t}=e,n=await (0,l.QJ)(t);if(!n.ok)throw Error(`Failed to fetch thread previews from ${t}: HTTP ${n.status}`);let i=await n.json(),r=n.headers.get("Link"),a=(0,o.N)(r,"next"),d=[];for(let e of(i.length>0&&(d=(0,s.UF)(i[0])?i.map(s.OA):i),d)){let t=e.path??"",n=e.subject?.endDiffSide==="RIGHT"?"R":"L",i=e.subject?.originalEndLine?`${n}${e.subject.originalEndLine}`:"FILE",r=b(Number(e.id));if(r){let{filePath:n,lineKey:i}=m(r),a={endLine:e.subject?.endLine,endDiffSide:e.subject?.endDiffSide,isOutdated:e.isOutdated||!1,path:t,startDiffSide:e.subject?.startDiffSide,startLine:e.subject?.startLine};v(Number(e.id),n,i,()=>({...r,positioning:a,subject:{...r.subject,diffLines:e.subject?.diffLines}}))}else v(Number(e.id),t,i,()=>({...e,shouldNotRenderInDiffLines:!0}))}return{data:d,nextUrl:a}},g[4]=b,g[5]=v,g[6]=c):c=g[6],g[7]!==t||g[8]!==n||g[9]!==c?(f={queryKey:t,initialPageParam:n,queryFn:c,getNextPageParam:h,staleTime:1/0},g[7]=t,g[8]=n,g[9]=c,g[10]=f):f=g[10],(0,a.U)(f)}function h(e){return e.nextUrl??void 0}},35800(e,t,n){function i(e){return null!==e&&"object"==typeof e&&"previewInfo"in e}function r(e){return e.commentsData?.comments?.[0]}function a(e){return{id:e.previewInfo.threadId,isOutdated:e.previewInfo.isOutdated,line:e.previewInfo.line,subject:e.previewInfo.subject,commentsData:e.previewInfo.firstComment?{comments:[e.previewInfo.firstComment]}:void 0,commentCount:e.previewInfo.threadPreviewComments.length,path:e.previewInfo.path,originalDiffPathUri:e.previewInfo.originalDiffPathUri}}n.d(t,{IV:()=>r,OA:()=>a,UF:()=>i})},28832(e,t,n){n.d(t,{j:()=>l});var i=n(40604),r=n(14193),a=n(24222);let l=r.G.createQueryRouteConfig("pullRequestsLayoutRoute",{path:"/:owner/:repo/pull/:pr_number",queries:[(0,a.Y)({queryDeps:({pathname:e})=>({pathname:`${e}/_layout`})}),{queryName:"tabCounts",queryDeps:({params:e})=>({pathname:`/${e.owner}/${e.repo}/pull/${e.pr_number}/page_data/tab_counts`}),queryFn:async e=>(0,i.X)(e)},{queryName:"diffstat",queryDeps:({params:e})=>({pathname:`/${e.owner}/${e.repo}/pull/${e.pr_number}/page_data/diffstat`}),queryFn:async e=>(0,i.X)(e)}]})},45088(e,t,n){n.d(t,{n:()=>g,Z:()=>h});var i=n(74848),r=n(96540),a=n(71323),l=n(97283),o=n(87134);n(16522),n(78597),n(49671);var s=n(62764),d=n(28832),c=n(26941),u=n(53035),m=n(37337);let f=(0,r.createContext)(null);function h(e){let t=(0,r.use)(f);if(!t)throw Error("Missing PullRequestAnalyticsStoreProvider in the tree");return(0,a.P)(t,e)}f.displayName="PullRequestAnalyticsStoreContext";let g=({initData:e,children:t})=>{let n=(0,r.useRef)(null),a=function(){if(m.X3||!(0,u.E)())return;let{data:e}=(0,c.xX)(d.j,s.uT.diffstat);return e?.diffstat}();return n.current||(n.current=p(e)),(0,r.useEffect)(()=>{var e;n.current&&a&&n.current.setState({diffSizeCategory:void 0===(e=a.linesChanged)?"unknown":e<100?"xs":e<500?"s":e<1e3?"m":e<5e3?"l":e<1e4?"xl":"xxl"})},[a]),(0,i.jsx)(f,{value:n.current,children:t})};g.displayName="PullRequestAnalyticsStoreProvider";let p=e=>(0,l.y)()((0,o.lt)((t,n)=>({...e,virtualizationEnabled:!0===e.virtualizationEnabled?"true":"false",diffSizeCategory:"unknown",getINPDiffTags:()=>({diffVersion:n().diffVersion,diffSizeCategory:n().diffSizeCategory,virtualizationEnabled:n().virtualizationEnabled})}),{name:"analytics-store"}))},22187(e,t,n){n.d(t,{J:()=>r});var i=n(45088);let r=()=>(0,i.Z)(a);function a(e){return e.getINPDiffTags}},60815(e,t,n){n.d(t,{N:()=>i});function i(e,t){if(!e)return null;let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=RegExp(`<([^>]+)>;\\s*rel=["']?${n}["']?`,"i"),r=e.match(i);return r?.[1]??null}},89413(e,t,n){n.d(t,{Dg:()=>l,L_:()=>a,M0:()=>o});var i=n(51189),r=n(96540);function a(){let e=performance.memory;return e?.usedJSHeapSize&&e?.jsHeapSizeLimit?Math.round(e.usedJSHeapSize/e.jsHeapSizeLimit*1e4)/100:null}function l(){let e=performance.memory;return e?.usedJSHeapSize??null}function o({intervalMs:e=5e3,maxDatapoints:t=20,statName:n,tags:a}){(0,r.useEffect)(()=>{let r;if(!performance||!("memory"in performance)||t<=0)return;let l=0,o=()=>{document.hidden&&s()},s=()=>{void 0!==r&&(clearInterval(r),r=void 0),document.removeEventListener("visibilitychange",o)},d=()=>{!function({statName:e,tags:t}){requestIdleCallback(()=>{let n,r=(n=performance.memory,n?.usedJSHeapSize?Math.round(n.usedJSHeapSize/1024/1024*10)/10:null);r&&(0,i.au)({name:e,value:r,tags:t})})}({statName:n,tags:a}),++l>=t&&s()};return d(),l{s()}},[e,t,n,a])}},59518(e,t,n){n.d(t,{n:()=>l});var i=n(51189),r=n(26316),a=n(89413);function l(e=.1){if(Math.random()>e)return()=>{};let t=(0,a.Dg)();if(null===t)return()=>{};let n=t,o=0,s=0,d=(e,t)=>{(0,i.au)({requestUrl:window.location.href,name:e,value:t})},c=(e,t)=>{"u">typeof requestIdleCallback?requestIdleCallback(()=>d(e,t)):setTimeout(()=>d(e,t),0)},u=()=>{if(o>=20)return void clearInterval(m);let e=(0,a.Dg)();if(null===e)return;n=Math.max(n,e);let t=Math.round(e/1024/1024*100)/100;if(2>Math.abs(t-s))return;o++,s=t,c("BROWSER_MEMORY_DIST_HEAP_USED",t);let i=(0,a.L_)();null!==i&&c("BROWSER_MEMORY_DIST_HEAP_UTILIZATION",i)},m=setInterval(u,3e4),f=()=>{if(r.XC?.visibilityState==="hidden"){let e=(0,a.Dg)();null!==e&&(c("BROWSER_MEMORY_DIST_SESSION_GROWTH",Math.round((e-t)/1024/1024*100)/100),c("BROWSER_MEMORY_DIST_SESSION_MAX",Math.round(n/1024/1024*100)/100))}};r.XC?.addEventListener("visibilitychange",f);let h=setTimeout(u,5e3);return()=>{clearInterval(m),clearTimeout(h),r.XC?.removeEventListener("visibilitychange",f)}}},13183(e,t,n){function i(){return!!document.querySelector('react-app[data-lazy="true"]')}function r(){return!!document.querySelector('react-app[data-alternate="true"]')}function a(){return!!document.querySelector("header.AppHeader")}function l(){return performance.getEntriesByType("resource").some(e=>"fetch"===e.initiatorType&&e.name.includes("_graphql?"))}function o(){return performance.getEntriesByType("resource").some(e=>"script"===e.initiatorType)}n.d(t,{Dk:()=>a,NT:()=>c,X:()=>d,_:()=>i,aE:()=>l,u$:()=>r,xF:()=>o}),n(73537),n(59518);let s=null;function d(){return s}function c(e){s=e}}}]); //# sourceMappingURL=82458-1043a8b96b223959-36b3cb18ee19dcad.js.map