1"use strict";(self.webpackChunk_frontend_dashboard=self.webpackChunk_frontend_dashboard||[]).push([[9751],{54736:(e,t,n)=>{n.r(t),n.d(t,{BranchSummary:()=>Ao,default:()=>Eo});var r=n(31085),a=n(14041),s=n(19262),i=n(35118),o=n(20053),l=n(18971),u=n(56956),d=n(76093),c=n(14673),m=n(93954),v=n(33145),p=(n(84766),n(65398)),h=n.n(p),g=n(20467),f=n(43864),b=n(36977);const y="module-BranchSummaryHeader__avatarList__LDHMZ",_="module-BranchSummaryHeader__sidebarToggleButton__mpgpb",j="module-BranchSummaryHeader__branchSummaryHeader__kyMQU",x="module-BranchSummaryHeader__headerBottomBoxShadow__n9uUO",R="module-BranchSummaryHeader__subtitleLoader__cq6wu",C="module-BranchSummaryHeader__subtitleContainer__FE09F",N="module-BranchSummaryHeader__subtitleTextHighlight__oM9Li",w="module-BranchSummaryHeader__titleContentContainer__NaYLq",I="module-BranchSummaryHeader__branchNameContainer__FL8i8",S="module-BranchSummaryHeader__branchNameText__FyGGu",O="module-BranchSummaryHeader__childrenContainer__dZR0P";var k=function(e){var t=e.project;if(!t)return(0,r.jsx)("div",{className:C,children:(0,r.jsx)(g.nh,{width:300,height:18,backgroundColor:g.MF.gray100,foregroundColor:g.MF.gray200,className:R})});var n,a=t.committersThisMonthForBranch.length;return(0,r.jsx)("div",{className:C,children:t.runsPastMonthCountByBranch?a?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:y,children:(0,r.jsx)(g.Qp,{maxShown:3,entities:null!=(n=t.committersThisMonthForBranch.slice(0,3))?n:[],total:a})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:N,children:[Intl.NumberFormat().format(a)," ",h()("contributor",a)]})," ","and"," ",(0,r.jsxs)("span",{className:N,children:[Intl.NumberFormat().format(t.runsPastMonthCountByBranch)," ",h()("run",t.runsPastMonthCountByBranch)]})," ","over the last 30 days"]})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("span",{className:N,children:[Intl.NumberFormat().format(t.runsPastMonthCountByBranch)," ",h()("run",t.runsPastMonthCountByBranch)]})," ","over the last 30 days"]}):(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:N,children:"No runs"})," over the last 30 days"]})})};k.displayName="BranchSummarySubTitle";var P=function(e){var t=e.branchName,n=e.branchInfo,a=e.children,s=(0,f.Zz)()[1];return(0,r.jsxs)("div",{className:j,children:[(0,r.jsx)(b.V,{}),(0,r.jsx)("div",{className:x}),(0,r.jsxs)("div",{className:w,children:[(0,r.jsx)("a",{className:_,"data-cy":"branch-summary-sidebar-toggle",href:"#",title:"Show menu",onClick:function(e){return e.preventDefault(),s({type:"toggleSidebar"})},children:(0,r.jsx)(g.In,{name:"bars"})}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:I,children:[(0,r.jsx)(i.Sz4,{fontSize:"20px",color:"#9095AD"}),(0,r.jsx)("h1",{className:S,children:t})]}),(0,r.jsx)(k,{project:null==n?void 0:n.project})]})]}),(0,r.jsx)("div",{className:O,children:a})]})};P.displayName="BranchSummaryHeader";n(95790),n(99180),n(93831),n(28882);var B=n(64467),T=n(68032),L=n(59372),A=n(12840);const E="module-BranchRuns__branchRuns__ZArR_",D="module-BranchRuns__pagination__JdRvh",M="module-BranchRuns__newerRuns__k_vsO",F="module-BranchRuns__olderRuns__L4tmq",U="module-BranchRuns__runsList__dZqWj",z="module-BranchRuns__loadingContainer__p7GOi";var H=n(31116);function q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function V(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?q(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G=function(e){var t,n,a=e.isActive,i=e.projectId,o=e.branchName,l=(0,s.zy)(),u=(0,s.Zp)(),d=T.parse(l.search),c=(0,H.I)(),v=c.uiCovEnabled,p=c.accessibilityEnabled,h=Number(d.page)||1,g=(0,m.abh)({variables:{projectId:i,input:{page:h,branches:[o]},accessibilityFlagEnabled:p,interactivityFlagEnabled:v},skip:!a}),f=g.data,b=g.loading;if(!a)return null;var y=h>1,_=Boolean(null==f?void 0:f.project.runs.hasNextPage),j=!(null==f||null===(t=f.project.runs)||void 0===t||null===(n=t.nodes)||void 0===n?void 0:n.length);return(0,r.jsx)(Z,{data:f,loading:b,prevPage:y?function(){return u(decodeURI(l.pathname)+"?"+T.stringify(V({},d,{page:h-1})))}:void 0,nextPage:_?function(){return u(decodeURI(l.pathname)+"?"+T.stringify(V({},d,{page:h+1})))}:void 0,noRunsFound:j})};G.displayName="BranchRuns";var Z=function(e){var t=e.data,n=e.loading,a=e.prevPage,s=e.nextPage,i=e.noRunsFound;return(0,r.jsx)(g.YM,{className:z,active:n,fadeOnlyOnDeactivate:!0,spinner:(0,r.jsx)(A.A,{}
1),children:t&&(0,r.jsxs)("div",{className:E,children:[(0,r.jsx)("ul",{className:U,children:i&&!n?(0,r.jsx)("div",{className:"empty",children:(0,r.jsx)("p",{children:"No runs were found."})}):null==t?void 0:t.project.runs.nodes.map(function(e){return(0,r.jsx)(L._8,{run:e,projectId:e.project.id},e.id)})}),(0,r.jsxs)("footer",{className:D,children:[a&&(0,r.jsxs)(g.$n,{className:M+" btn-light","data-cy":"branch-runs-newer-page",onClick:a,children:[(0,r.jsx)("i",{className:"fa fa-long-arrow-left"})," Newer runs"]}),s&&(0,r.jsxs)(g.$n,{className:F+" btn-light","data-cy":"branch-runs-older-page",onClick:s,children:["Older runs ",(0,r.jsx)("i",{className:"fa fa-long-arrow-right"})]})]})]})})};Z.displayName="BranchRunsView";n(44436),n(30935);var W=n(40001),K=n(27235);function Q(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Q(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Q(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}n(98140);var X=n(7268),J=n(98587),$=n(46874);function ee(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var te="accessibilityResults",ne="uiCoverageResults",re=a.createContext(null),ae=function(){var e=a.useContext(re);if(!e)throw new Error("Cannot use AppQualityStatusContext outside of an AppQualityStatusContext.Provider");return e},se=function(e){var t,n,r,a,s=ae(),i=s.baseRun,o=s.targetRun;return"accessibility"===e?{baseRunReportAttempt:null==i||null===(r=i.accessibilityResults)||void 0===r?void 0:r.attempt,targetRunReportAttempt:null==o||null===(a=o.accessibilityResults)||void 0===a?void 0:a.attempt}:{baseRunReportAttempt:null==i||null===(t=i.uiCoverageResults)||void 0===t?void 0:t.attempt,targetRunReportAttempt:null==o||null===(n=o.uiCoverageResults)||void 0===n?void 0:n.attempt}},ie=function(e){var t=ae();return"accessibility"===e?t.a11yEmptyState:t.uiCovEmptyState},oe=function(e){var t,n,r,a,s=ae(),i=s.baseRun,o=s.targetRun,l=(0,J.A)(s,["baseRun","targetRun"]),u=!!(null==i?void 0:i.cancelOnFailure),d=!!(null==o?void 0:o.cancelOnFailure),c="accessibility"===e?l.a11yPartialReport:l.uiCovPartialReport,m="base"===(null==c?void 0:c.source)||"baseAndTarget"===(null==c?void 0:c.source)?(0,$.j)(null!=i?i:{}):void 0,v="target"===(null==c?void 0:c.source)||"baseAndTarget"===(null==c?void 0:c.source)?(0,$.j)(null!=o?o:{}):void 0,p="accessibility"===e?te:ne;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ee(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ee(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},c,{baseRunCancelOnFailure:u,targetRunCancelOnFailure:d,baseReportIssues:null!=(t=null==i||null===(n=i[p])||void 0===n?void 0:n.issues)?t:[],targetReportIssues:null!=(r=null==o||null===(a=o[p])||void 0===a?void 0:a.issues)?r:[],baseRunAnchorBuildNumber:m,targetRunAnchorBuildNumber:v})},le=(n(68291),n(72384)),ue={accessibility:"October 16, 2024","ui-coverage":"November 4, 2024"},de=function(e){var t=e.hasPaidPlan,n=e.variant,a=e.unsupportedOperation;return(0,r.jsx)(le.O_,{children:t&&!a?(0,r.jsx)(le.Cv,{variant:"white",href:"mailto:[email protected]",style:{display:"inline-flex"},label:"Contact support"}):void 0,dataCy:n+"-error-boundary",fill:!0,icon:(0,r.jsx)(i.g4T,{size:"48"}),primaryText:a?"Comparison not available":"Something went wrong",secondaryText:a?"Runs can only be compared against runs recorded after "+ue[n]+".":"There was a problem comparing these two runs. If the problem persists, please "+(t?"contact support":"try again later")+"."})};de.displayName="ErrorState";n(78527);const ce="module-LoadingState__loadingSpinner__VP09K",me="module-LoadingState__loadingMsg__ac07T";var ve=function(e){var t=e.variant,n=(0,a.useState)(!1),s=n[0],i=n[1];return(0,a.useLayoutEffect)(function(){var e=setTimeout(function(){i(!0)},5e3);return function(){return clearTimeout(e)}},[]),(0,r.jsxs)("div",{"data-cy":t+"-loading",className:ce,children:[(0,r.jsx)(A.A,{}),s&&(0,r.jsxs)("div",{className:me,"data-cy":t+"-loading-view-msg",children:[(0,r.jsx)("p",{children:"We are fetching the data needed for this comparison."}),(0,r.jsx)("p",{children:"For large reports, this may take a little while."})]})]})};ve.displayName="LoadingState";var pe=n(22884),he=function(e){var t=e.variant;return(0,r.jsx)(le.O_,{dataCy:t+"-not-ready",fill:!0,icon:(0,r.jsx)(pe.u4,{}),primaryText:"Changes are not ready yet",secondaryText:"The required data for this comparison is still being collected. Results will be available after all runs have processed."})};he.displayName="NotReady";var ge=function(e){var t=e.variant;return(0,r.jsx)(le.O_,{dataCy:t+"-no-changes-available",fill:!0,icon:(0,r.jsx)(pe.u4,{}),primaryText:"No changes available",secondaryText:"There is not enough data available to compare these two runs. If this is unexpected, please contact support."})};ge.displayName="NoComparison";var fe=n(21627),be=function(e){var t=e.variant,n=e.source;return(0,r.jsx)(le.O_,{dataCy:t+"-disabled",fill:!0,icon:"accessibility"===t?(0,r.jsx)(i.USF,{strokeColor:"gray-500",fillColor:"gray-50",secondaryFillColor:"white"}):(0,r.jsx)(i.MUy,{strokeColor:"gray-500",fillColor:"gray-50",secondaryFillColor:"white"}),primaryText:"Not available",secondaryText:(0,fe.Zi)(t)+" was not enabled for "+("baseAndTarget"===n?"either":"one")+" of these runs.",children:(0,r.jsx)(le.Cv,{variant:"white",href:"https://on.cypress.io/"+t,style:{display:"inline-flex"},label:"Learn more"})})};be.displayName="ProductDisabled";var ye=n(63511),_e=a.createContext(null),je=function(){var e=a.useContext(_e);if(!e)throw new Error("Cannot use BranchReviewContext outside of BranchReview");return e},xe=function(){var e=je().comparison,t=[];
1if((null==e?void 0:e.baseRun)||t.push("base"),(null==e?void 0:e.targetRun)||t.push("changed"),!t.length)return null;var n=1===t.length?t[0]:t[0]+" and "+t[1],a=1===t.length?"a "+t[0]+" run":n+" runs";return(0,r.jsx)(le.O_,{fill:!0,icon:(0,r.jsx)(i.g4T,{size:"48"}),primaryText:"Select a "+n+" run",secondaryText:"Select "+a+" to generate a comparison."})};xe.displayName="SelectRunPlaceholder";var Re=function(e){return null==e?void 0:e.includes(ye.q7)},Ce=function(e){var t=e.hasPaidPlan,n=e.reason,a=e.variant;switch(null==n?void 0:n.status){case"running":case"processing":return(0,r.jsx)(he,{variant:a});case"loading":return(0,r.jsx)(ve,{variant:a});case"disabled":return(0,r.jsx)(be,{variant:a,source:n.source});case"run-not-selected":return(0,r.jsx)(xe,{});case"no-report":return(0,r.jsx)(ge,{variant:a});case"operation-unsupported":return(0,r.jsx)(de,{variant:a,hasPaidPlan:t,unsupportedOperation:!0});default:return(0,r.jsx)(de,{variant:a,hasPaidPlan:t})}},Ne=["disabled","run-not-selected","error","running","no-report","processing","loading"],we=function(e){var t,n,r,a,s=e.run,i=e.productKey,o=e.source,l=e.productEnabled;return"RUNNING"===(null==s?void 0:s.status)?{source:o,status:"running"}:"PROCESSING"===(null==s||null===(t=s[i])||void 0===t?void 0:t.status)?{source:o,status:"processing"}:l&&(null==s?void 0:s[i])?s&&"NOTESTS"!==(null==s?void 0:s.status)&&"PROCESSING_FAILED"!==(null==s||null===(n=s[i])||void 0===n?void 0:n.status)&&void 0!==(null===(r=s[i])||void 0===r?void 0:r.coveragePercent)&&null!==(null===(a=s[i])||void 0===a?void 0:a.coveragePercent)?void 0:{source:o,status:"no-report"}:{source:o,status:"disabled"}},Ie=function(e){var t,n,r,a,s=e.baseRun,i=e.targetRun,o=e.productKey,l=e.productEnabled,u=we({run:i,productKey:o,source:"target",productEnabled:l}),d=we({run:s,productKey:o,source:"base",productEnabled:l});return u&&d?(t=u,n=d,r=Ne.indexOf(t.status),a=Ne.indexOf(n.status),r>a?n:(r===a&&(t.source="baseAndTarget"),t)):u||d},Se=function(e){var t,n=e.baseRun,r=e.targetRun,a=e.productKey,s=null==n?void 0:n[a],i=null==r?void 0:r[a],o=!!s&&("PROCESSED_WITH_ERRORS"===s.status||(0,$.S)(null!=n?n:{})),l=!!i&&("PROCESSED_WITH_ERRORS"===i.status||(0,$.S)(null!=r?r:{}));return o&&l?t="baseAndTarget":l?t="target":o&&(t="base"),{hasPartialReport:o||l,source:t}},Oe=(n(85146),n(26938)),ke=(n(68450),n(81648)),Pe=n(25992);const Be="module-Selections__container__gg0Nu",Te="module-Selections__header__ol1Kv",Le="module-Selections__commitsList__lcytY",Ae="module-Selections__commitInfo__cQe51",Ee="module-Selections__commitMessage__vcynD",De="module-Selections__changeRequestItem__vI6GC",Me="module-Selections__runListItem__Ev5je",Fe="module-Selections__isSelected__fjvyE",Ue="module-Selections__openInNewTab__ISWg5",ze="module-Selections__focus__Xw5tw",He="module-Selections__runInfo__XG39b",qe="module-Selections__isChangeRequestSelection__hmy7T",Ve="module-Selections__tooltip__uU91K",Ge="module-Selections__runStats___hfZA",Ze="module-Selections__tooltipPopper__OHirr",We="module-Selections__prInfo__FLVd8",Ke="module-Selections__dot__KG5za",Qe="module-Selections__bullet__LCYIH",Ye="module-Selections__runsList__r1nmx",Xe="module-Selections__prNumber__OQ7ft",Je="module-Selections__prTitle__tygch",$e="module-Selections__prStatusLabel__YQVv1",et="module-Selections__loadMore__YbfGj",tt="module-Selections__githubCTA__TVRo_",nt="module-Selections__changeRequestLoader__iYvOH",rt="module-Selections__error__lcgqH";var at=n(98258),st=n(49039),it=n(19998),ot=n(40895),lt=n(45250);const ut={crStatusLabel:"module-ChangeRequestStatus__crStatusLabel__oGzch",open:"module-ChangeRequestStatus__open__GsMM5",merged:"module-ChangeRequestStatus__merged__fXSQ9",closed:"module-ChangeRequestStatus__closed__kFhCM"};var dt=function(){return(0,r.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M3.5 12L3.5 4",stroke:"#747994",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M5 4C5 4.82843 4.32843 5.5 3.5 5.5C2.67157 5.5 2 4.82843 2 4C2 3.17157 2.67157 2.5 3.5 2.5C4.32843 2.5 5 3.17157 5 4ZM5 12C5 12.8284 4.32843 13.5 3.5 13.5C2.67157 13.5 2 12.8284 2 12C2 11.1716 2.67157 10.5 3.5 10.5C4.32843 10.5 5 11.1716 5 12ZM14 12C14 12.8284 13.3284 13.5 12.5 13.5C11.6716 13.5 11 12.8284 11 12C11 11.1716 11.6716 10.5 12.5 10.5C13.3284 10.5 14 11.1716 14 12ZM13 7.5C13 7.77614 12.7761 8 12.5 8C12.2239 8 12 7.77614 12 7.5C12 7.22386 12.2239 7 12.5 7C12.7761 7 13 7.22386 13 7.5ZM13 4C13 4.27614 12.7761 4.5 12.5 4.5C12.2239 4.5 12 4.27614 12 4C12 3.72386 12.2239 3.5 12.5 3.5C12.7761 3.5 13 3.72386 13 4Z",stroke:"#747994"})]})};dt.displayName="IconTechnologyPullRequestDraft";var ct=function(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{fill:"#632aa6",d:"M5.45 5.154A4.25 4.25 0 0 0 9.25 7.5h1.378a2.251 2.251 0 1 1 0 1.5H9.25A5.734 5.734 0 0 1 5 7.123v3.505a2.25 2.25 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.95-.218ZM4.25 13.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Zm8.5-4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5ZM5 3.25a.75.75 0 1 0 0 .005V3.25Z"})})};ct.displayName="IconTechnologyPullRequestMerged";var mt=function(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{fill:"#9f1331",d:"M3.25 1A2.25 2.25 0 0 1 4 5.372v5.256a2.251 2.251 0 1 1-1.5 0V5.372A2.251 2.251 0 0 1 3.25 1Zm9.5 5.5a.75.75 0 0 1 .75.75v3.378a2.251 2.251 0 1 1-1.5 0V7.25a.75.75 0 0 1 .75-.75Zm-2.03-5.273a.75.75 0 0 1 1.06 0l.97.97.97-.97a.748.748 0 0 1 1.265.332.75.75 0 0 1-.205.729l-.97.97.97.97a.751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018l-.97-.97-.97.97a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734l.97-.97-.97-.97a.75.75 0 0 1 0-1.06ZM2.5 3.25a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0ZM3.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Zm9.5 0a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})})};mt.displayName="IconTechnologyPullRequestClosed";var vt={open:function(){return(0,r.jsx)(i.i74,{size:"16"})},draft:function(){return(0,r.jsx)(dt,{})},merged:function(){return(0,r.jsx)(ct,{})},closed:function(){return(0,r.jsx)(mt,{})}},pt=function(e){var t=e.status,n=e.className,a=e.hideIcon;if(!t)return null;var s=vt[t];return(0,r.jsxs)("span",{className:(0,o.A)(ut.crStatusLabel,ut[t],n),children:[!a&&s&&(0,r.jsx)(s,{}),(0,lt.capitalize)(t)]})};pt.displayName="ChangeRequestStatusLabel";const ht="module-SelectionLoader__branchLoaderContainer__SnXBj",gt="module-SelectionLoader__branchLoader__Bxc4q";var ft=n(15885),bt=function(e){var t=e.dataCy,n=e.className,a=e.totalPlaceholders,s=void 0===a?5:a;return(0,r.jsx)("div",{"data-cy":t,className:(0,o.A)(n,ht),children:(0,lt.times)(s,function(e){return(0,r.jsx)("div",{className:gt,children:(0,r.jsx)(ft.Ay,{width:408,height:8,backgroundColor:g.MF.gray50,foregroundColor:g.MF.gray100})},e)})})};bt.displayName="SelectionLoader";var yt=function(e){var t=e.gitHubRepositoryUrl,n=e.projectId,a=e.defaultBranch,i=e.branchName;return t?(0,r.jsxs)("div",{className:tt,children:["For a pull request comparison,"," ",(0,r.jsx)("a",{href:t+"/compare/"+a+"..."+i,rel:"noopener noreferrer",target:"_blank",children:"create a pull request on GitHub."})]}):(0,r.jsxs)("div",{className:tt,children:["Improve your experience by viewing the comparison relevant to your pull request in review."," ",(0,r.jsx)(s.N_,{to:"/projects/"+n+"/settings/integrations",children:"Configure GitHub"})]})};yt.displayName="GitHubIntegrationCTA";var _t=function(e){var t=e.changeRequest,n=e.isSelected,s=e.onSelectRun,l=a.useState(!1),u=l[0],d=l[1],c=a.use
1State(!1),m=c[0],v=c[1],p=u||m;return t?(0,r.jsxs)("li",{"data-cy":"pr-"+t.number,"aria-selected":n,className:(0,o.A)(De,n?Fe:p&&ze),children:[(0,r.jsxs)(st.$,{"aria-label":"Select pull request #"+t.number+" for comparison",onFocusChange:v,className:We,onPress:s,children:[(0,r.jsx)(i.xHN,{strokeColor:n?"indigo-500":"gray-600"}),(0,r.jsxs)("div",{className:Xe,children:["PR #",t.number]}),(0,r.jsx)("span",{className:Ke,children:" ⢠"}),(0,r.jsx)("div",{className:Je,children:t.title}),(0,r.jsx)(pt,{hideIcon:!0,status:null==t?void 0:t.state,className:$e})]}),(0,r.jsx)(at.A,{placement:"left",popper:(0,r.jsx)("div",{"data-cy":"run-details-tooltip",children:"Tooltip content"}),"aria-hidden":!p,className:Ue,"data-cy":"run-link-with-tooltip",children:(0,r.jsx)(it.N,{onFocusChange:d,href:t.url,className:(0,o.A)(ot.bl,ot.uR["outline-light"]),target:"_blank","aria-label":"Open pull request #"+t.number+" in a new tab",children:(0,r.jsx)(i.JhV,{})})})]},t.number):null};_t.displayName="ChangeRequestItem";var jt=function(e){var t,n,s=e.changeRequests,i=e.activeChangeRequestIndex,o=e.onSelectChangeRequest,l=e.gitHubRepositoryUrl,u=e.projectId,d=e.defaultBranch,c=e.branchName,m=e.loadingChangeRequestList,v=(0,a.useState)(3),p=v[0],h=v[1],g=(0,a.useState)(null!=i?i:null),f=g[0],b=g[1],y=s&&s.length,_=a.useMemo(function(){return s?s.slice(0,p).map(function(e,t){return(0,r.jsx)(_t,{changeRequest:e,isSelected:t===f,onSelectRun:function(){b(t),o(t)}},t)}):null},[s,p,o,b,f]);m?t=(0,r.jsx)(bt,{dataCy:"br-latest-pr-loader",className:nt,totalPlaceholders:1}):t=(0,r.jsxs)(r.Fragment,{children:[!y&&(0,r.jsx)(yt,{gitHubRepositoryUrl:l,projectId:u,defaultBranch:d,branchName:c}),y?(0,r.jsx)("ul",{children:_}):null,(null!=(n=null==s?void 0:s.length)?n:0)>p&&(0,r.jsx)(ot.Ay,{className:et,variant:"outline-light",size:"24",onClick:function(){h(p+3)},children:"Load more pull requests"})]});return(0,r.jsxs)("div",{className:Be,"data-cy":"change-request-section",children:[(0,r.jsx)("div",{className:Te,children:y||m?"Latest pull requests":l?"No pull requests found":"Setup GitHub Integration"}),t]})};jt.displayName="ChangeRequestSelection";n(1569),n(24493),n(22892);var xt=n(95735),Rt=n(94167),Ct=function(e){var t=e.run,n=e.buildNumber,s=e.status,l=e.isLatestRun,u=e.isSelected,d=e.isChangeRequestSelection,c=e.onSelectRun,m=e.projectId,v=a.useState(!1),p=v[0],h=v[1],g=p,f=(0,H.I)().getRunSummaryUi;return(0,r.jsxs)("li",{"data-cy":"run-"+n,"aria-selected":u&&!d,className:(0,o.A)(Me,u?d?qe:Fe:g&&ze),children:[(0,r.jsxs)(st.$,{"aria-label":"Select run #"+n+" for comparison",onFocusChange:h,className:He,onPress:c,children:[(0,r.jsx)(Pe.FW,{status:s})," #",n,l&&(0,r.jsx)(xt.A,{color:u&&!d?"indigo":"gray",size:"16",children:"Latest run"})]}),(0,r.jsx)(Pe.xD,{className:Ue,popperClassName:Ze,tooltipEnabled:!0,tooltipDarkTheme:!0,tooltipContent:(0,r.jsx)(Pe.nP,{className:Ve,runStatsClassName:Ge,run:t,runStatusNumberDarkTheme:!0,tooltipDarkTheme:!0,getIntelligencePillUi:f}),tooltipInteractive:!1,children:(0,r.jsx)("a",{href:"/projects/"+m+"/runs/"+n+"/overview",className:(0,o.A)(ot.bl,ot.uR["outline-light"]),target:"_blank","aria-label":"Open run #"+n+" in a new tab",children:(0,r.jsx)(i.JhV,{})})})]},n)};Ct.displayName="RunListItem";var Nt=function(e){var t=e.activeChangeRequestIndex,n=e.buildNumber,s=e.onSelectRun,o=e.children,l=e.runs,u=e.loading,d=e.canLoadMoreRuns,c=e.onLoadMoreRuns,m=e.selectedRun,v=e.hideSelectedRun,p=-1!==t,h=(0,a.useMemo)(function(){return function(e){var t=[],n=null,r=-1;return e.forEach(function(e){var a,s,i;(null==e||null===(a=e.commit)||void 0===a?void 0:a.sha)!==(null===(s=n)||void 0===s?void 0:s.sha)?(n=null!=(i=e.commit)?i:null,r++,t.push({commit:n,runs:[e]})):t[r].runs.push(e)}),t}(l)},[l]),g=(0,a.useState)(n),f=g[0],b=g[1],y=null,_=function(e){var t=e.commit,n=e.groupIndex,a=e.runsList;return(0,r.jsxs)("li",{children:[(0,r.jsxs)("div",{className:Ae,"data-cy":"commit",children:[(0,r.jsx)(i.xbS,{strokeColor:"gray-500",fillColor:"gray-50"}),t.sha?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Rt.Y,{sha:t.sha,url:null,hideIcon:!0}),(0,r.jsx)("span",{className:Qe,children:"â¢"}),(0,r.jsx)("div",{className:Ee,title:t.message,children:t.message})]}):"Not provided"]}),(0,r.jsx)("ul",{className:Ye,"data-cy":"runs-list-container",children:a.map(function(e,t){return(0,r.jsx)(Ct,{run:e,projectId:e.project.id,buildNumber:e.buildNumber,status:e.status,isLatestRun:0===n&&0===t,isSelected:e.buildNumber===f,isChangeRequestSelection:p,onSelectRun:function(){b(e.buildNumber),s(e.buildNumber)}},e.buildNumber)})})]},t.sha+"-"+n)};y=u||l.length?h.map(function(e,t){var n=e.commit,r=e.runs;return _({commit:n,runsList:r,groupIndex:t})}):(0,r.jsx)(le.O_,{fill:!0,className:rt,icon:(0,r.jsx)(i.g4T,{size:"48"}),primaryText:"Something went wrong",secondaryText:"There was a problem with data loading. Our team has been notified. If the problem persists, please try again later."});var j=l.find(function(e){return e.buildNumber===(null==m?void 0:m.buildNumber)});return(0,r.jsxs)(r.Fragment,{children:[o,(0,r.jsxs)("div",{className:Be,"data-cy":"run-section",children:[(0,r.jsx)("div",{className:Te,children:"Latest runs"}),(0,r.jsx)("ul",{className:Le,"data-cy":"commits-list",children:(0,r.jsxs)(r.Fragment,{children:[y,u&&(0,r.jsx)(bt,{dataCy:"br-latest-runs-loader",totalPlaceholders:3})]})}),!u&&d&&(0,r.jsx)(ot.Ay,{className:et,variant:"outline-light",size:"24",onClick:c,children:"Load more runs"}),m&&!j&&!v&&(0,r.jsx)("ul",{className:Le,"data-cy":"commits-list",children:_({commit:m.commit,runsList:[m],groupIndex:-1})})]})]})};const wt="module-RunSelect__dialog__pse5d",It="module-RunSelect__dropdownTrigger__OqOSy",St="module-RunSelect__dropdownTriggerActive__GVX5Q",Ot="module-RunSelect__missingRu
1n__sbrto",kt="module-RunSelect__runType__DkEsQ",Pt="module-RunSelect__divider__FIbK2",Bt="module-RunSelect__branchName__fzkWY",Tt="module-RunSelect__branchesBackButton__xmFKh",Lt="module-RunSelect__defaultBranchTag__J2WEY";var At=n(54574),Et=n(25635);const Dt={selectedBranchRow:"module-BranchSelection__selectedBranchRow__gdHOG",searchBranchNameInput:"module-BranchSelection__searchBranchNameInput__EwsUO",divider:"module-BranchSelection__divider__dOYmw",noMatchesFound:"module-BranchSelection__noMatchesFound__eMjCg",searchBranchesContainer:"module-BranchSelection__searchBranchesContainer__j9ZA7"};var Mt=n(97910),Ft=n(20448),Ut=n(36212);function zt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var Ht=function(e){var t=e.projectId,n=e.setLoaded,a=e.variant,s=e.onBranchClick,i=e.branchName,o=e.defaultBranch,l=(0,Ut.Y)({projectId:t,setLoaded:n,variant:a,includeDefaultBranch:!0});if(!l)return null;var u=l.displayedBranches,d=l.loadMoreBranches,c=l.showLoadMore,m=l.page,v=l.isLoadingMore,p=u.map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zt(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e,{isSelected:i&&i===e.name})});return(0,r.jsx)("div",{children:u.length>0&&(0,r.jsx)(Ft.A,{id:"active-branches-list-section",projectId:t,branches:p,loadMoreBranches:d,showLoadMore:c,page:m,isLoadingMore:v,onBranchClick:s,defaultBranch:o,defaultBranchTagName:"Default branch",smallBranchRow:!0})})};Ht.displayName="BranchesList";var qt=function(e){var t=e.projectId,n=e.defaultBranch,s=e.branchName,i=e.onBranchClick,l=(0,a.useState)(!1),u=l[0],d=l[1],c=!u;return(0,r.jsx)(Et.U,{className:Dt.searchBranchesContainer,branchRowClassName:(0,o.A)(Dt.branchRow),divider:(0,r.jsx)("hr",{className:Dt.divider}),inputClassName:Dt.searchBranchNameInput,projectId:t,loading:c,branchesSectionLoadingComponent:(0,r.jsx)(bt,{}),onBranchClick:i,branchesList:(0,r.jsxs)(r.Fragment,{children:[c&&(0,r.jsx)(bt,{}),(0,r.jsx)(Ht,{defaultBranch:n,branchName:s,onBranchClick:i,projectId:t,variant:"active",setLoaded:function(){return d(!0)}})]}),noMatchesFoundComponent:function(e,t){return(0,r.jsx)(Mt.A,{msg:"No branches matched your search:",searchText:e,resetSearchHandler:t,className:Dt.noMatchesFound,iconSize:"24"})},smallBranchRow:!0})};qt.displayName="BranchSelection";var Vt=n(85495);function Gt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gt(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Wt=function(e){var t=e.branchName,n=e.type,a=e.buildNumber,s=e.status;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:(0,o.A)(kt,!a&&!s&&Ot),children:"base"===n?"Base":"Changed"}),(0,r.jsx)(i.Sz4,{className:"!text-gray-500"}),(0,r.jsx)("div",{className:Bt,children:t||K.u}),a&&s&&(0,r.jsx)(Pe.PB,{buildNumber:a,status:s,hasBorder:!0}),(0,r.jsx)(i.e6o,{className:"!text-gray-500"})]})},Kt=function(e){var t=e.branchName,n=e.projectId,r=e.skipQuery,s=void 0!==r&&r,i=a.useState(1),o=i[0],l=i[1],u=a.useState(!1),d=u[0],c=u[1],v=(0,H.I)(),p=v.uiCovEnabled,h=v.accessibilityEnabled,g=t!==K.u?t:null,f=(0,m.abh)({variables:{projectId:n,input:{page:1,branches:[g],perPage:10},accessibilityFlagEnabled:h,interactivityFlagEnabled:p,includeGroupInfo:!0,uniqueGroupsLimit:Vt.BV},skip:s}),b=f.data,y=f.loading,_=f.fetchMore,j=function(e,t){var n=t.fetchMoreResult;return n?(c(!1),{project:Zt({},e.project,{runs:Zt({}
1,n.project.runs,{hasNextPage:n.project.runs.hasNextPage,nodes:(0,lt.uniqBy)([].concat(e.project.runs.nodes,n.project.runs.nodes),"id")})})}):e},x=a.useMemo(function(){if(!b)return[];var e=null==b?void 0:b.project.runs.nodes,t=Math.ceil(e.length/10);return o!==t&&l(t),null==b?void 0:b.project.runs.nodes},[b,o]);return{runs:x,onLoadMoreRuns:function(){var e=o+1;c(!0),_({variables:{projectId:n,input:{page:e,branches:[g],perPage:10},accessibilityFlagEnabled:h,interactivityFlagEnabled:p},updateQuery:j}),l(e)},canLoadMoreRuns:(null==b?void 0:b.project.runs.hasNextPage)||!1,loadingRuns:y&&!x.length||d}},Qt=function(e){var t=e.branchName,n=e.projectId,a=e.buildNumber,s=e.status,i=e.onSelectRun,l=e.onSelectChangeRequest,u=e.changeRequests,d=e.activeChangeRequestIndex,c=e.gitHubRepositoryUrl,m=e.defaultBranch,v=e.loadingChangeRequestList,p=e.selectedRun,h=a&&s,g="target",f=Kt({branchName:t,projectId:n}),b=f.runs,y=f.onLoadMoreRuns,_=f.canLoadMoreRuns,j=f.loadingRuns;return(0,r.jsx)(ke.A,{buttonContent:(0,r.jsx)(Wt,{branchName:t,type:g,buildNumber:a,status:s}),buttonAttrs:{className:(0,o.A)(It,!h&&Ot),classNameIsOpen:St,"data-cy":g+"-run-dropdown-trigger"},dialogAttrs:{className:wt},dialogContent:function(e){var s=e.close;return(0,r.jsx)(Nt,{buildNumber:null!=a?a:null,activeChangeRequestIndex:d,onSelectRun:function(e){i(g,e),s()},runs:b,loading:j,canLoadMoreRuns:_,onLoadMoreRuns:y,selectedRun:p,children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(jt,{changeRequests:u||[],activeChangeRequestIndex:d,onSelectChangeRequest:function(e){l(e),s()},gitHubRepositoryUrl:c,projectId:n,defaultBranch:null!=m?m:"",branchName:null!=t?t:K.u,loadingChangeRequestList:v}),(0,r.jsx)("hr",{className:Pt})]})})},popoverAttrs:{placement:"bottom start"}})};Qt.displayName="TargetRunSelect";var Yt=function(e){var t=e.branchName,n=e.projectId,s=e.buildNumber,l=e.status,u=e.onSelectRun,d=e.activeChangeRequestIndex,c=e.defaultBranch,m=e.selectedRun,v="base",p=s&&l,h=(0,a.useState)(t),g=h[0],f=h[1],b=(0,a.useState)("Select a branch"===t),y=b[0],_=b[1],j=Kt({branchName:g,projectId:n,skipQuery:y}),x=j.runs,R=j.onLoadMoreRuns,C=j.canLoadMoreRuns,N=j.loadingRuns,w=function(e,t){f(e),_(t)},I=c&&g===c;return(0,r.jsx)(ke.A,{buttonContent:(0,r.jsx)(Wt,{branchName:t,type:v,buildNumber:s,status:l}),buttonAttrs:{className:(0,o.A)(It,!p&&Ot),classNameIsOpen:St,"data-cy":v+"-run-dropdown-trigger"},dialogAttrs:{className:wt},dialogContent:function(e){var a=e.close;return y?(0,r.jsx)(qt,{projectId:n,defaultBranch:c,branchName:g,onBranchClick:function(e){return w(e,!1)}}):(0,r.jsx)(Nt,{buildNumber:null!=s?s:null,activeChangeRequestIndex:d,onSelectRun:function(e){u(v,e),a()},runs:x,loading:N,canLoadMoreRuns:C,onLoadMoreRuns:R,selectedRun:m,hideSelectedRun:g!==t,children:(0,r.jsxs)("div",{"data-cy":"branches-back-button",className:Tt,children:[(0,r.jsx)(At.r,{direction:"left","data-cy":"nav-button-views-table","aria-label":"back to branches",onClick:function(e){e.preventDefault(),w(t,!0)}}),(0,r.jsx)(i.Sz4,{className:"!text-gray-500"}),g||K.u,I&&(0,r.jsx)(xt.A,{color:"gray",className:Lt,size:"16",children:"Default branch"})]})})},popoverAttrs:{placement:"bottom start",onOpenChange:function(){w(t,"Select a branch"===t)}}})};Yt.displayName="BaseRunSelect";const Xt="module-ReviewHeader__header___1UtO",Jt="module-ReviewHeader__flexContainer__qbPYt",$t="module-ReviewHeader__feedbackButton__k5SrS",en="module-ReviewHeader__runSelection__uBD2_";var tn=n(99420),nn=n.n(tn);const rn="module-BranchReviewBanner__banner__Z8DP6",an="module-BranchReviewBanner__changeRequestBanner__VMTs4",sn="module-BranchReviewBanner__titleContainer__LdARU",on="module-BranchReviewBanner__iconContainer__K6Ezo",ln="module-BranchReviewBanner__title__vr2Iz",un="module-BranchReviewBanner__sha__QPhy0",dn="module-BranchReviewBanner__runsInProgressBanner__jYPjV",cn="module-BranchReviewBanner__progressContent__j0zeP",mn="module-BranchReviewBanner__primaryText__aOUn_",vn="module-BranchReviewBanner__dot__xr7Fs",pn="module-BranchReviewBanner__secondaryText__bXtTy",hn="module-BranchReviewBanner__progressBar__poHCM",gn="module-BranchReviewBanner__crStatusLabel__C61KS",fn="module-BranchReviewBanner__crTitle__qp11q",bn="module-BranchReviewBanner__crLinkIcon__yoMtJ";
1var yn=function(){var e,t,n=je(),a=n.changeRequest,s=n.comparison;if(!a)return null;var o=(0,r.jsxs)("div",{children:["Updated"," ",nn()((null==s||null===(e=s.targetRun)||void 0===e?void 0:e.endTime)||(null==s||null===(t=s.targetRun)||void 0===t?void 0:t.createdAt)).fromNow()]});return o="merged"===a.state?(0,r.jsxs)("div",{children:["Merged ",nn()(a.closedAt).fromNow()]}):"closed"===a.state?(0,r.jsxs)("div",{children:["Closed ",nn()(a.closedAt).fromNow()]}):(0,r.jsxs)("div",{children:["Updated"," ",nn()((null==a?void 0:a.updatedAt)||(null==a?void 0:a.createdAt)).fromNow()]}),(0,r.jsxs)("div",{"data-cy":"change-request-banner",className:an,children:[(0,r.jsx)(pt,{status:null==a?void 0:a.state,className:gn}),(0,r.jsx)("span",{className:vn,children:" ⢠"}),(0,r.jsxs)("div",{children:["PR #",a.number]}),(0,r.jsx)("span",{className:vn,children:" ⢠"}),(0,r.jsx)("div",{className:fn,children:a.title}),(0,r.jsx)("a",{"data-cy":"change-request-pr-link",className:bn,href:a.url,target:"_blank","aria-label":"Open pull request in new tab",children:(0,r.jsx)(i.EVB,{strokeColor:"indigo-500",secondaryStrokeColor:"indigo-200"})}),(0,r.jsx)("span",{className:vn,children:" ⢠"}),(0,r.jsx)(i.pA5,{strokeColor:"gray-500"}),o]})};yn.displayName="ChangeRequestBanner";var _n=function(e){var t=e.baseRun,n=e.targetRun,a=e.targetFallbackUsed,s=void 0!==a&&a,o=e.baseFallbackUsed,l=void 0!==o&&o,u=[];if(t&&(null==t?void 0:t.hasOverlappingBuilds)&&!l&&u.push("Run #"+t.buildNumber),n&&(null==n?void 0:n.hasOverlappingBuilds)&&!s&&u.push("Run #"+n.buildNumber),0===u.length)return null;var d=u.length>1?(0,r.jsxs)(r.Fragment,{children:["commits on ",u[0]," and ",u[1]]}):(0,r.jsxs)(r.Fragment,{children:["commit on ",u[0]]});return(0,r.jsx)("div",{className:rn,"data-cy":"branch-review-multiple-runs-for-commit-banner",children:(0,r.jsxs)("div",{className:sn,children:[(0,r.jsx)("span",{className:on,children:(0,r.jsx)(i.Kip,{strokeColor:"indigo-500",fillColor:"indigo-100"})}),(0,r.jsxs)("div",{className:ln,children:["Multiple runs were found matching the ",d,"."]})]})})};_n.displayName="MultipleRunsForCommitBanner";var jn=function(e){var t=e.commitLabel,n=e.commitSha,a=e.commitUrl;return(0,r.jsxs)(r.Fragment,{children:[t,(0,r.jsx)(Rt.Y,{sha:n,url:a,hideIcon:!0,className:un})]})},xn=function(){var e=je(),t=e.changeRequest,n=e.comparison;if(!t)return null;var a=[],s=[];if(t.baseBranch&&!(null==n?void 0:n.foundBaseRun)||(null==n?void 0:n.fallbackRunUsedForBase)){var o=t.baseCommitSha,l=t.baseCommitUrl;a.push(jn({commitLabel:"base commit ",commitSha:o,commitUrl:l})),(null==n?void 0:n.fallbackRunUsedForBase)&&s.push("base")}if((null==t?void 0:t.targetBranch)&&(!n||!n.foundTargetRun)||(null==n?void 0:n.fallbackRunUsedForTarget)){var u=t.targetCommitSha,d=t.targetCommitUrl;a.push(jn({commitLabel:"change commit ",commitSha:u,commitUrl:d})),(null==n?void 0:n.fallbackRunUsedForTarget)&&s.push("change")}if(!a.length)return null;var c=a.length>1?(0,r.jsxs)(r.Fragment,{children:["Runs not found for the ",a[0]," or the ",a[1]]}):(0,r.jsxs)(r.Fragment,{children:["Run not found for the ",a[0]]}),m=0===s.length?null:2===s.length?" We have selected alternative runs to review.":" We have selected an alternative "+s[0]+" run to review.";return(0,r.jsx)("div",{className:rn,"data-cy":"branch-review-alternative-runs-banner",children:(0,r.jsxs)("div",{className:sn,children:[(0,r.jsx)("span",{className:on,children:(0,r.jsx)(i.Kip,{strokeColor:"indigo-500",fillColor:"indigo-100"})}),(0,r.jsxs)("div",{className:ln,children:[c," used in the pull request.",m]})]})})};xn.displayName="AlternativeRunsBanner";var Rn=n(9919),Cn=function(){var e,t,n,a,s=je(),i=s.project,l=s.comparison;if("RUNNING"===(null==l||null===(e=l.targetRun)||void 0===e?void 0:e.status)?n=null==l?void 0:l.targetRun:"RUNNING"===(null==l||null===(t=l.baseRun)||void 0===t?void 0:t.status)&&(n=null==l?void 0:l.baseRun),!n)return null;if(n.scheduledToCompleteAt&&!n.endTime){var u="soon",d=nn()(n.scheduledToCompleteAt).add(i.runCompletionDelay,"milliseconds");d.isAfter()&&(u=(0,Rn.AQ)(d)),a=(0,r.jsxs)("span",{className:pn,
1children:["Scheduled to complete ",u]})}else a=(0,r.jsxs)("span",{className:pn,children:[n.completedInstanceCount," of"," ",n.instances.totalCount," specs completed"]});return(0,r.jsxs)("div",{"data-cy":"runs-in-progress-banner",className:(0,o.A)(rn,dn),children:[(0,r.jsxs)("div",{className:cn,children:[(0,r.jsxs)("span",{className:mn,children:["#",n.buildNumber]}),(0,r.jsx)("span",{className:vn,children:" ⢠"}),(0,r.jsx)("span",{className:mn,children:"Testing in progress..."}),(0,r.jsx)("span",{className:vn,children:" ⢠"}),a]}),(0,r.jsx)("div",{className:hn,children:(0,r.jsx)(g.z2,{now:n.completedInstanceCount/n.instances.totalCount*100})})]})};function Nn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function wn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nn(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Cn.displayName="RunsInProgressBanner";var In=function(e){var t,n,a,s,o,l,u,d,c,m,v,p=je(),h=p.comparison,g=p.project,f=ae(),b=f.baseRun,y=f.targetRun,_=null===(t=g.defaultBranchNode)||void 0===t?void 0:t.name;(null==h?void 0:h.baseRun)?d=null!=(c=null==h?void 0:h.baseRun.commit.branch)?c:K.u:d=null!=(m=null==h||null===(v=h.targetRun)||void 0===v?void 0:v.commit.branch)?m:"Select a branch";return(0,r.jsxs)("div",{className:Xt,"data-cy":"review-header",children:[(0,r.jsxs)("div",{className:"flex items-center "+Jt,children:[(0,r.jsxs)("div",{className:en,children:[(0,r.jsx)(Yt,{branchName:d,buildNumber:null==h||null===(n=h.baseRun)||void 0===n?void 0:n.buildNumber,status:null==h||null===(a=h.baseRun)||void 0===a?void 0:a.status,onSelectRun:e.onSelectRun,projectId:null==g?void 0:g.id,activeChangeRequestIndex:e.activeChangeRequestIndex,defaultBranch:_,selectedRun:h.baseRun?wn({},h.baseRun,{uiCoverageResults:null==b?void 0:b.uiCoverageResults,accessibilityResults:null==b?void 0:b.accessibilityResults}):void 0}),(0,r.jsx)(i.XB6,{className:"rotate-90 text-gray-500"}),(0,r.jsx)(Qt,{branchName:e.branchName,buildNumber:null===(s=h.targetRun)||void 0===s?void 0:s.buildNumber,status:null===(o=h.targetRun)||void 0===o?void 0:o.status,onSelectRun:e.onSelectRun,projectId:null==g?void 0:g.id,onSelectChangeRequest:e.onSelectChangeRequest,changeRequests:e.changeRequests,activeChangeRequestIndex:e.activeChangeRequestIndex,gitHubRepositoryUrl:null===(l=g.githubIntegration)||void 0===l||null===(u=l.repository)||void 0===u?void 0:u.htmlUrl,defaultBranch:_,loadingChangeRequestList:e.loadingChangeRequestList,selectedRun:h.targetRun?wn({},h.targetRun,{uiCoverageResults:null==y?void 0:y.uiCoverageResults,accessibilityResults:null==y?void 0:y.accessibilityResults}):void 0})]}),(0,r.jsx)("div",{className:$t,children:(0,r.jsxs)(Oe.O,{url:"https://on.cypress.io/beta-feedback-branch-review",organizationId:g.organizationInfo.id,className:"bg-white whitespace-nowrap",variant:"outline-purple","aria-label":"Submit Feedback",children:[(0,r.jsx)(i.AT7,{"aria-hidden":!0,fillColor:"indigo-100"}),(0,r.jsx)("span",{"aria-hidden":!0,className:"ml-[8px] text-[14px]",children:"Submit Feedback"})]})})]}),(0,r.jsx)(yn,{}),(0,r.jsx)(xn,{}),(0,r.jsx)(_n,{targetRun:null==h?void 0:h.targetRun,baseRun:null==h?void 0:h.baseRun,targetFallbackUsed:!!(null==h?void 0:h.fallbackRunUsedForTarget),baseFallbackUsed:!!(null==h?void 0:h.fallbackRunUsedForBase)}),(0,r.jsx)(Cn,{})]})};In.displayName="ReviewHeader";n(25400),n(66542);const Sn={countContainer:"module-DetailedInsightCounts__countContainer__s3wBa",detailedInsightCounts:"module-DetailedInsightCounts__detailedInsightCounts__h0gOg",differentialSection:"module-DetailedInsightCounts__differentialSection__Ts7kE",differentialGroup:"module-DetailedInsightCounts__differentialGroup__Ry0Wu",differentialIndicator:"module-DetailedInsightCounts__differentialIndicator__IpflE",differentialCount:"module-DetailedInsightCounts__differentialCount__mkg5F",newGroup:"module-DetailedInsightCounts__newGroup__Vawsv",resolvedGroup:"module-DetailedInsightCounts__resolvedGroup__yVxCb",animatePending:"module-DetailedInsightCounts__animatePending___IWE3",pendingTotal:"module-DetailedInsightCounts__pendingTotal__Q0GJw",totalSection:"module-DetailedInsightCounts__totalSection__hyAUD",setThreeCharacterFixedWidth:"module-DetailedInsightCounts__setThreeCharacterFixedWidth__pgNZJ",skeleton:"module-DetailedInsightCounts__skeleton__FMryb"};var On={RESOLVED:"resolved",NEW:"new"},kn=function(e){var t=e.totalCount,n=e.isFlipped,a=e.isPending,s=e.isPercent,l=e.newCount,u=e.renderKey,d=e.hasError,c=void 0!==d&&d,m=e.resolvedCount,v=e.ariaNoun,p=void 0===v?"item":v,g=e.ariaAdjectives,f=void 0===g?On:g,b=e.ariaLabelOverrides,y=e.setThreeCharacterFixedWidth;
1if(c)return(0,r.jsx)("div",{className:Sn.skeleton,"data-cy":"insight-error",children:"-"});var _,j=function(e){var t=e.count,n=e.hideIfZero;if(!(void 0===t||0===t&&n))return t>999?Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t).toLowerCase()+(s?"%":""):t+(s?"%":"")},x=j({count:l,hideIfZero:!0}),R=(null==b?void 0:b.new)||x+" "+f.NEW+" "+h()(p,l),C=j({count:m,hideIfZero:!0}),N=(null==b?void 0:b.resolved)||C+" "+f.RESOLVED+" "+h()(p,m),w=j({count:t}),I=(null==b?void 0:b.total)||w+" total "+h()(p,t);(x||C)&&(_=(0,r.jsxs)("div",{className:Sn.differentialSection,children:[x&&(0,r.jsxs)("div",{className:(0,o.A)(Sn.differentialGroup,n?Sn.resolvedGroup:Sn.newGroup),children:[(0,r.jsx)(i.nar,{}),(0,r.jsx)("div",{className:(0,o.A)(Sn.differentialCount,y&&Sn.setThreeCharacterFixedWidth),"data-cy":"insight-new","aria-label":R,children:x})]}),C&&(0,r.jsxs)("div",{className:(0,o.A)(Sn.differentialGroup,n?Sn.newGroup:Sn.resolvedGroup),children:[(0,r.jsx)(i.gCR,{}),(0,r.jsx)("div",{className:(0,o.A)(Sn.differentialCount,y&&Sn.setThreeCharacterFixedWidth),"data-cy":"insight-resolved","aria-label":N,children:C})]})]}));var S=0!==t;return(0,r.jsxs)("div",{className:Sn.countContainer,children:[_,(0,r.jsx)("div",{className:(0,o.A)(Sn.totalSection,S?Sn.nonZeroCount:Sn.zeroCount,y&&Sn.setThreeCharacterFixedWidth,a&&Sn.animatePending),"data-cy":"insight-total","aria-label":I,children:w},u)]})};kn.displayName="DetailedInsightCounts";const Pn={insightItem:"module-InsightItem__insightItem__uukdP",activeIndicator:"module-InsightItem__activeIndicator__fjrNv",iconContainer:"module-InsightItem__iconContainer__CTd5y",typeLabel:"module-InsightItem__typeLabel__x5H3I",rightAlignContainer:"module-InsightItem__rightAlignContainer__FP_1w",chevron:"module-InsightItem__chevron__EL3XL",tagContainer:"module-InsightItem__tagContainer__g4VNR",skeleton:"module-InsightItem__skeleton__RqZQA",loadingIcon:"module-InsightItem__loadingIcon__MXZ0A",pendingContentLoader:"module-InsightItem__pendingContentLoader__m7PD_",zeroCount:"module-InsightItem__zeroCount__eg5qk",nonZeroCount:"module-InsightItem__nonZeroCount__I7HvI",animatePending:"module-InsightItem__animatePending__WurFc",pendingTotal:"module-InsightItem__pendingTotal__VThg1"};var Bn=function(e){var t=e.hasError,n=e.isLocked,a=e.isPending,s=e.isPercent,o=e.newCount,l=e.totalCount,u=e.resolvedCount,d=e.renderKey;return n?(0,r.jsx)("div",{className:Pn.tagContainer,"data-cy":"insight-locked",children:(0,r.jsx)(i.vSc,{strokeColor:"gray-500",fillColor:"gray-200"})}):t?(0,r.jsx)("div",{className:Pn.skeleton,"data-cy":"insight-error",children:"-"}):!a||l||u?(0,r.jsx)(kn,{totalCount:l,newCount:o,resolvedCount:u,isPending:a,isPercent:s,renderKey:d}):(0,r.jsx)("div",{className:Pn.tagContainer,"data-cy":"insight-loading",children:(0,r.jsx)(i.pEp,{size:"16",className:Pn.loadingIcon})})};Bn.displayName="InsightItemCount";const Tn="module-InsightSummary__insightSummary__q5eKK",Ln="module-InsightSummary__segment__hnqy6",An="module-InsightSummary__insight__kO4b0",En="module-InsightSummary__new__krBa_",Dn="module-InsightSummary__resolved__T0eHc",Mn="module-InsightSummary__total__bfUSq",Fn="module-InsightSummary__text__KRjfE";var Un=function(e){var t=e.newCount,n=void 0===t?0:t,a=e.existingCount,s=void 0===a?0:a,l=e.resolvedCount,u=void 0===l?0:l,d=e.isLoading,c=e.hasError;if(d||c)return null;var m=n>0?(0,r.jsxs)("div",{className:(0,o.A)(Ln,An,En),children:[(0,r.jsx)(i.nar,{}),(0,r.jsxs)("span",{className:(0,o.A)(Fn),children:[n," new"]})]}):null,v=s>0?(0,r.jsx)("div",{className:(0,o.A)(Ln,An),children:(0,r.jsxs)("span",{className:(0,o.A)(Fn),children:[s," existing"]})}):null,p=u>0?(0,r.jsxs)("div",{className:(0,o.A)(Ln,An,Dn),children:[(0,r.jsx)(i.gCR,{}),(0,r.jsxs)("span",{className:(0,o.A)(Fn),children:[u," resolved"]})]}):null,h=(0,r.jsx)("div",{className:(0,o.A)(Ln,Mn),children:(0,r.jsxs)("span",{className:(0,o.A)(Fn),children:[n+s||0," total"]})});return(0,r.jsxs)("div",{className:Tn,children:[m,p,v,h]})};Un.displayName="InsightSummary";n(96656),n(96104),n(96152),n(29416),n(21555),n(39170),n(34237),n(33111),n(94356),n(30488),n(45993),n(25152);var zn=n(61700),Hn=n(11262),qn=n(43605),Vn=n(81040),Gn=n(72814);const Zn={card:"module-GroupList__card__nQBpj",heading:"module-GroupList__heading__R8G7s",groups:"module-GroupList__groups__QDuTa",rowBorder:"module-GroupList__rowBorder__ap
1o5w",row:"module-GroupList__row__lAF8_",defaultIconStyle:"module-GroupList__defaultIconStyle__bLGRK",branchNameWrapper:"module-GroupList__branchNameWrapper__F_egU",groupCountWrapper:"module-GroupList__groupCountWrapper__zxACp",branchNameLabelWrapper:"module-GroupList__branchNameLabelWrapper__upgXm",branchName:"module-GroupList__branchName__peDpP",groupTestResults:"module-GroupList__groupTestResults__Z5SBy",expandedGroupResults:"module-GroupList__expandedGroupResults__fH8YT",group:"module-GroupList__group__noPt0",missingRun:"module-GroupList__missingRun__Y7X1M",statusIcon:"module-GroupList__statusIcon__U4Pqt",groupInfo:"module-GroupList__groupInfo__RTQOI",groupWrapper:"module-GroupList__groupWrapper__kPmrO",groupInfoWrapper:"module-GroupList__groupInfoWrapper__r8JaT",groupInfoLogosWrapper:"module-GroupList__groupInfoLogosWrapper__S5qq6",lineContainer:"module-GroupList__lineContainer__rK9I8",line:"module-GroupList__line__H9u9_",artifactControlsContainer:"module-GroupList__artifactControlsContainer__LjyMq"};var Wn=n(1117),Kn=n(52667),Qn=n(77038),Yn=n(17885),Xn=n(22163),Jn=function(){return(0,r.jsx)(i.VO6,{strokeColor:"gray-500"})};Jn.displayName="IconChevronUp";var $n=function(){return(0,r.jsx)(i.ost,{strokeColor:"gray-500"})};$n.displayName="IconChevronDown";var er=function(e){var t,n,a,s=e.groupName,l=e.expanded,u=e.data,d=e.handleSetExpanded,c=e.includeBorderStyle,m=e.branchName,v=e.missingRun,p=l?(0,r.jsx)(Jn,{}):(0,r.jsx)($n,{});if(!u||v)return(0,r.jsx)("div",{className:(0,o.A)(Zn.group,c&&Zn.rowBorder),children:(0,r.jsxs)("div",{className:Zn.missingRun,onClick:d,"data-cy":"group-list-cell",children:[(0,r.jsx)("div",{className:Zn.statusIcon,children:v?(0,r.jsx)(i.aGV,{strokeColor:"gray-500"}):(0,r.jsx)(i.S$r,{size:"16",strokeColor:"gray-200"})}),(0,r.jsx)("div",{children:(0,r.jsx)("span",{className:Zn.groupInfo,children:v?(0,r.jsxs)(r.Fragment,{children:["Run not found"," ","Base Run"!==m&&"Target Run"!==m&&"on branch "+m]}):(0,r.jsxs)(r.Fragment,{children:["Test not executed in"," ",s?"group "+s:"default group"]})})}),p]})});var h=(0,lt.find)(u.attempts,function(e){return"FAILED"===e.state}),g=(null===(t=u.attempts)||void 0===t?void 0:t.length)>1;return(0,r.jsxs)("div",{className:(0,o.A)(Zn.group,c&&Zn.rowBorder),children:[(0,r.jsxs)("div",{className:Zn.groupWrapper,onClick:d,"data-cy":"group-list-cell",children:[(0,r.jsx)("div",{className:Zn.statusIcon,children:(0,r.jsx)(zn.k,{status:u.status})}),(0,r.jsxs)("div",{className:Zn.groupInfoWrapper,children:[(0,r.jsx)("span",{className:Zn.groupInfo,children:u.groupName||"Default group"}),l&&(0,r.jsxs)("div",{className:Zn.groupInfoLogosWrapper,children:[(0,r.jsx)("span",{className:Zn.groupInfo,children:(0,r.jsx)(Kn.I,{os:u.os})}),(0,r.jsx)("span",{className:Zn.groupInfo,children:(0,Qn.G)(u.browser)}),u.rowAccessory&&(0,r.jsx)("span",{children:u.rowAccessory})]})]}),(0,r.jsx)("div",{className:Zn.artifactControlsContainer,children:(0,r.jsx)(Xn.x,{onReplayClick:(null==u?void 0:u.testResultData)&&u.onSelectReplay&&(0,Yn.e)(null==u||null===(n=u.testResultData)||void 0===n?void 0:n.capture)?function(){var e;null===(e=u.onSelectReplay)||void 0===e||e.call(u,1)}:void 0,disableAll:"RUNNING"===(null===(a=u.testResultData)||void 0===a?void 0:a.state),frag:u.testResultData,forceHideMoreDropdown:!0,forceHideChevron:!0,variant:"small"})}),p]}),l&&(0,r.jsxs)("div",{className:Zn.groupWrapper,"data-cy":"group-list-attempts",children:[(0,r.jsx)("div",{className:Zn.lineContainer,children:(0,r.jsx)("div",{className:Zn.line})}),(0,r.jsx)("div",{})]}),l&&(0,r.jsx)("div",{className:(0,o.A)(Zn.groupTestResults,Zn.expandedGroupResults),"data-cy":"spec-group-rows",children:(0,r.jsx)("div",{"data-cy":"test-results-drawer-attempts-and-error",className:Zn.attemptsAndErrors,children:u.attempts.map(function(e,t){var n,a,s;return(0,r.jsx)(Wn.X,{frag:u.testResultData,attempt:e,firstFailedAttempt:h,hasMultipleAttempts:g,testResultId:u.testResultId,onScreenshotClick:function(e){var t,n;null===(t=u.onSelectScreenshot)||void 0===t||t.call(u,null===(n=e[0])||void 0===n?void 0:n.id)},onVideoClick:u.onSelectVideo&&(null==u||null===(n=u.testResultData)||void 0===n||null===(a=n.video)||void 0===a?void 0:a.id)?function(e){var t;null===(t=u.onSelectVideo)||void 0===t||t.call(u,e)}:void 0,onReplayClick:(null==u?void 0:u.testResultData)&&u.onSelectReplay&&(0,Yn.e)(null==u||null===(s=u.testResultData)||void 0===s?void 0:s.capture)?function(){var t,n;null===(t=u.onSelectReplay)||void 0===t||t.call(u,null!=(n=e.attemptNumber)?n:1)}:void 0,isGroupList:!0,styleType:"branch-review"},t)})})})]})};er.displayName="RowCell";var tr=function(e){var t=e.groupName,n=e.group1,s=e.group2,i=e.branchName1,o=e.branchName2,l=e.missingBaseRun,u=(0,a.useState)((null==n?void 0:n.isInitiallyExpanded)||(null==s?void 0:s.isInitiallyExpanded)||!1),d=u[0],c=u[1],m=function(){c(!d)};return(0,r.jsxs)("div",{className:Zn.row,"data-cy":"group-list-row",children:[(0,r.jsx)(er,{groupName:t,expanded:d,data:n,handleSetExpanded:m,includeBorderStyle:!0,branchName:i,missingRu
1n:l}),(0,r.jsx)(er,{groupName:t,expanded:d,data:s,branchName:o,handleSetExpanded:m})]})};tr.displayName="GroupRow";var nr=function(e){var t=e.data,n=e.comparisonRunId,a=e.comparisonBranchName,s=e.baseRunId,i=e.baseBranchName,l=(0,lt.groupBy)(t,"rowKey");return(0,r.jsxs)("div",{className:Zn.card,children:[(0,r.jsx)("div",{className:(0,o.A)(Zn.heading,Zn.row),"data-cy":"group-list-header",children:[i,a].map(function(e,t){return(0,r.jsx)("div",{className:(0,o.A)(Zn.branchNameWrapper,t%2==0&&Zn.rowBorder),"data-cy":"group-list-branch-info",children:(0,r.jsx)("div",{className:Zn.branchNameLabelWrapper,title:e,children:(0,r.jsx)("span",{className:Zn.branchName,children:e})})},e)})}),(0,r.jsx)("div",{className:Zn.groups,children:Object.keys(l).map(function(e){return(0,r.jsx)(tr,{missingBaseRun:!s,groupName:"null"===l[e][0].groupName?null:l[e][0].groupName,branchName1:i,branchName2:a,group1:l[e].find(function(e){return e.branchName===i&&e.runId===s}),group2:l[e].find(function(e){return e.branchName===a&&e.runId===n})},e)})})]})};nr.displayName="GroupList";var rr=n(76206);const ar={container:"module-TestDiffContainer__container__ACDVi",toggleButton:"module-TestDiffContainer__toggleButton__jyfcE",sectionIsOpen:"module-TestDiffContainer__sectionIsOpen__WgFXd",isInnerSection:"module-TestDiffContainer__isInnerSection__AMncd",isLastCollapsedSection:"module-TestDiffContainer__isLastCollapsedSection__JTaZi",chevron:"module-TestDiffContainer__chevron__yjbwK",text:"module-TestDiffContainer__text__QETDs",durationText:"module-TestDiffContainer__durationText__xeyy6",diffSummary:"module-TestDiffContainer__diffSummary__t316v",diffSummaryContent:"module-TestDiffContainer__diffSummaryContent__Ls9hl",added:"module-TestDiffContainer__added__JihAn",removed:"module-TestDiffContainer__removed__fi5jo",spacer:"module-TestDiffContainer__spacer__XUHCw",body:"module-TestDiffContainer__body__ep2VE",visible:"module-TestDiffContainer__visible__NBjha"};var sr=function(e){var t=e.className;return(0,r.jsx)("svg",{className:t,width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M6 4H2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})};sr.displayName="IconActionSubtractXsmall";var ir={variables:{light:{addedBackground:g.MF.jade50,addedColor:g.MF.gray800,removedBackground:g.MF.red50,removedColor:g.MF.gray800}},diffContainer:{fontSize:"12px",color:g.MF.gray800},line:{border:"2px solid #fff",borderRadius:"2px",overflow:"hidden"}},or=function(e){var t=e.data,n=e.isFirstSection,s=e.isLastSection,l=e.isInitiallyExpanded,u=t.title,d=t.previousCode,c=t.currentCode,m=t.duration,v=(0,a.useState)(l||!1),p=v[0],h=v[1],g=(0,a.useState)(null),f=g[0],b=g[1],y=(0,a.useRef)(null);(0,a.useLayoutEffect)(function(){if(y.current){var e=y.current.querySelectorAll('tr[class$="-line"] > td[class$="-added"]:first-child'),t=y.current.querySelectorAll('tr[class$="-line"] > td[class$="-removed"]:first-child');b({added:e.length,removed:t.length})}},[d,c]);var _,j=p?i.VO6:i.ost;return f&&(f.added>0||f.removed>0)&&(_=(0,r.jsx)("div",{className:ar.diffSummary,children:(0,r.jsxs)("div",{className:ar.diffSummaryContent,children:[(0,r.jsx)(i.XZk,{className:ar.added}),(0,r.jsx)("span",{"data-cy":"test-diff-added-count",className:ar.added,children:f.added}),(0,r.jsx)("span",{className:ar.spacer}),(0,r.jsx)(sr,{className:ar.removed}),(0,r.jsx)("span",{"data-cy":"test-diff-removed-count",className:ar.removed,children:f.removed})]})})),(0,r.jsxs)("div",{"data-cy":"test-diff-section",className:"fs-exclude",children:[(0,r.jsx)("div",{className:ar.header,children:(0,r.jsxs)("button",{type:"button","data-cy":"test-diff-section-toggle",className:(0,o.A)(ar.toggleButton,p?ar.sectionIsOpen:s&&ar.isLastCollapsedSection,!n&&ar.isInnerSection),onClick:function(){h(!p)},children:[(0,r.jsx)(j,{className:ar.chevron}),(0,r.jsx)("span",{className:ar.text,children:u}),(0,r.jsx)("span",{className:(0,o.A)(ar.text,ar.durationText),children:m}),_]})}),(0,r.jsx)("div",{ref:y,className:(0,o.A)(ar.body,p&&ar.visible),children:(0,r.jsx)(rr.Ay,{styles:ir,oldValue:d,newValue:c,splitView:!1,hideLineNumbers:!0,showDiffOnly:!1,compareMethod:rr.J7.WORDS_WITH_SPACE,disableWordDiff:!0})})]})};or.displayName="TestDiff";var lr=function(e){var t=e.sections,n=t.length;return(0,r.jsx)("div",{className:ar.container,children:t.map(function(e,t){return(0,r.jsx)(or,{data:e,isFirstSection:0===t,isLastSection:t===n-1,isInitiallyExpanded:e.isInitiallyExpanded},e.sectionKey)})})};lr.displayName="TestDiffContainer";const ur="module-TestDetails__testDetails__j7aHj",dr="module-TestDetails__body__qx8Dy",cr="module-TestDetails__overflowContainer__m6nAx",mr="module-TestDetails__testTitle__zAAUj",vr="module-TestDetails__specIcon__J36v3",pr="module-TestDetails__specBasename__hSs5Z",hr="module-TestDetails__specExtension__UzWY1",gr="module-TestDetails__divider__Dovzo",fr="module-TestDetails__testStatusIcon__RL7s1",br="module-TestDetails__sectionHeading__Ege5W",yr="module-TestDetails__groups__h8SZg",_r="module-TestDetails__diff__RFFbo";n(98304);const jr="module-DuplicateTestNameBanner__container__nnrMw";var xr=function(e){var t=e.specShortPath;return(0,r.jsx)("div",{className:jr,"data-cy":"duplicate-test-name-banner",children:(0,r.jsxs)("span",{children:["We've found multiple test cases with the same name in"," ",(0,r.jsx)("b",{children:t.split(".")[0]}),t.replace(t.split(".")[0],""),", some results may be inaccurate"]})})};function Rr(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Cr(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Cr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}xr.displayName="DuplicateTestNameBanner";var Nr=function(e,t){return(0,lt.filter)(e.hooks,{name:t})},wr={beforeAll:"Before",beforeEach:"Before each",afterAll:"After",afterEach:"After each"},Ir=function(e){var t,n,o,l,u,d,c,v,p,h=e.test,f=e.spec,b=je(),y=b.project,_=b.comparison,j=b.changeRequest,x=null!=(t=(null==j?void 0:j.baseBranch)||(null==_||null===(n=_.baseRun)||void 0===n||null===(o=n.commit)||void 0===o?void 0:o.branch))?t:"Base Run",R=null!=(l=(null==j?void 0:j.targetBranch)||(null==_||null===(u=_.targetRun)||void 0===u||null===(d=u.commit)||void 0===d?void 0:d.branch))?l:"Target Run",C=function(e){for(var t,n=e.scope,r=(0,s.zy)(),i=(0,s.Zp)(),o=a.useRef(n||[]),l=T.parse(r.search),u={},d=Rr(o.current);!(t=d()).done;){var c=t.value;u[c]=l[c]}
1var m=a.useCallback(function(e,t){var n=new URLSearchParams(r.search);if(e){Object.keys(e).forEach(function(t){var r=e[t];r?n.set(t,String(r)):n.delete(t)});var a=n.toString();i(r.pathname+(a?"?"+a:""),t)}},[r.pathname,r.search,i]),v=a.useCallback(function(e){for(var t,n={},r=Rr(o.current);!(t=r()).done;)n[t.value]=void 0;m(n,e)},[m]);return[u,m,v]}({scope:["artifactType","artifactTestId","screenshotId","videoTimestamp","att","ts","pc"]}),N=C[0],w=C[1],I=C[2],S=function(e,t){var n=a.useMemo(function(){return t.matches?t.matches.reduce(function(e,t){return e.push(t.comparisonTestResultId),t.baselineTestResultId&&e.push(t.baselineTestResultId),e},[]):[]},[t]);return(0,m.zx1)({variables:{projectId:e,testResultIds:n},skip:!n.length})}(y.id,h),O=S.data,k=S.loading,P=function(e,t){var n=a.useMemo(function(){if(!t.matches)return{};var e=t.matches.find(function(e){return e.baselineTestResultId&&e.comparisonTestResultId})||t.matches[0];return{base:e.baselineTestResultId,comparison:e.comparisonTestResultId}},[t]),r=Object.values(n).filter(function(e){return!!e});return{query:(0,m.bGm)({variables:{projectId:e,testResultIds:r},skip:!r.length}),baseDefinitionTestResultId:n.base,comparisonDefinitionTestResultId:n.comparison}}(y.id,h),B=P.query,L=B.data,A=B.loading,E=P.baseDefinitionTestResultId,D=P.comparisonDefinitionTestResultId;O&&(null==N?void 0:N.artifactTestId)&&((p=O.testResultsById.find(function(e){return e.id===N.artifactTestId}))||I({replace:!0}));var M=a.useMemo(function(){var e;if(!_||!O||!h.matches)return[];var t=function(e){var t,n,a,s,i=e.rowKey,o=e.groupName,l=e.run,u=e.branchName,d=e.testResultId,c=e.fetchedTestResult,m=null===(t=l.groups)||void 0===t||null===(n=t.nodes)||void 0===n?void 0:n.find(function(e){return e.name===(o||"")});return{rowKey:i,runId:l.id,branchName:u,testResultId:d,status:c.state,groupName:o||null,os:(null==m||null===(a=m.os)||void 0===a?void 0:a.name)||"",browser:(null==m||null===(s=m.browser)||void 0===s?void 0:s.name)||"",rowAccessory:c.isFlaky?(0,r.jsx)(g.pG,{}):void 0,attempts:c.attempts||[],testResultData:c,onSelectReplay:function(e){w({artifactType:"replay",artifactTestId:c.id,att:e})},onSelectVideo:function(e){w({artifactType:"video",artifactTestId:c.id,videoTimestamp:e})},onSelectScreenshot:function(e){w({artifactType:"screenshots",artifactTestId:c.id,screenshotId:e})}}},n=null,a=null,s=null,i=null,o=[];h.matches.forEach(function(e){var r,l=e.baselineTestResultId,u=e.comparisonTestResultId,d=e.groupName,c=O.testResultsById.find(function(e){return e.id===l}),m=O.testResultsById.find(function(e){return e.id===u}),v=l+"-"+u+"-"+d;u&&m&&(o.push(t({rowKey:v,groupName:d,run:_.targetRun,branchName:R,testResultId:u,fetchedTestResult:m})),"FAILED"===(r=m).state&&(n=n||r.id,(0,Yn.e)(r.capture)&&(a=a||r.id)),r.isFlaky&&(s=s||r.id,(0,Yn.e)(r.capture)&&(i=i||r.id))),l&&c&&o.push(t({rowKey:v,groupName:d,run:_.baseRun,branchName:x,testResultId:l,fetchedTestResult:c}))});var l=(null==N?void 0:N.artifactTestId)||a||n||i||s||(null===(e=o[0])||void 0===e?void 0:e.testResultId);if(l){var u=o.find(function(e){return e.testResultId===l});u&&(u.isInitiallyExpanded=!0)}return o},[h,O,_,R,x,w,null==N?void 0:N.artifactTestId]),F=_&&(null===(c=_.baseRun)||void 0===c?void 0:c.id)===(null===(v=_.targetRun)||void 0===v?void 0:v.id),U=a.useMemo(function(){if(!f.shortPath)return!1;if(F)return!1;var e=M.filter(function(e){return e.branchName===x}).map(function(e){return e.testResultId}),t=M.filter(function(e){return e.branchName===R}).map(function(e){return e.testResultId});return e.length!==new Set(e).size||t.length!==new Set(t).size},[f,x,R,M,F]),z=a.useMemo(function(){if(!L)return[];var e=L.testResultsById.find(function(e){return e.id===E}),t=L.testResultsById.find(function(e){return e.id===D}),n=!1,r=function(r){for(var a=e?Nr(e.definition,r):[],s=t?Nr(t.definition,r):[],i=[],o=0;o<Math.max(a.length,s.length);o++){var l,u,d,c=(null==_?void 0:_.baseRun)?(null===(l=a[o])||void 0===l?void 0:l.body)||"":(null===(u=s[o])||void 0===u?void 0:u.body)||"",m=(null===(d=s[o])||void 0===d?void 0:d.body)||"",v=c!==m;
1n=n||v,i.push({sectionKey:r+"-"+o,title:wr[r],previousCode:c,currentCode:m,isInitiallyExpanded:v})}return i},a=[].concat(r("beforeAll"),r("beforeEach")),s=[].concat(r("afterEach"),r("afterAll")),i={sectionKey:"body",title:"Body",previousCode:(null==_?void 0:_.baseRun)?(null==e?void 0:e.definition.test.body)||"":(null==t?void 0:t.definition.test.body)||"",currentCode:(null==t?void 0:t.definition.test.body)||""};return i.isInitiallyExpanded=i.previousCode!==i.currentCode||!n,[].concat(a,[i],s)},[null==_?void 0:_.baseRun,L,E,D]);if(!_)return null;var H,q,V=k||A;return(0,r.jsxs)("div",{className:ur,children:[(0,r.jsx)("div",{className:dr,"data-cy":"insight-test-details-body",children:(0,r.jsxs)(g.YM,{className:cr,active:V,children:[(q=(f.shortPath||"").split(f.extension||"")[0],(0,r.jsxs)("div",{className:mr,children:[(0,r.jsx)(i.uVh,{strokeColor:"gray-500",fillColor:"gray-100",className:vr}),(0,r.jsx)("span",{className:pr,children:q}),(0,r.jsx)("span",{className:hr,children:f.extension}),(h.title||"").split("///").map(function(e,t){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)(i.UMd,{className:gr,strokeColor:"gray-300"}),0===t?(0,r.jsx)("span",{className:fr,children:(0,r.jsx)(zn.k,{status:h.groupedComparisonState})}):void 0,(0,r.jsx)("span",{children:e})]},t)})]})),U&&f.shortPath&&(0,r.jsx)(xr,{specShortPath:f.shortPath}),!V&&M.length&&_.targetRun?(0,r.jsx)("div",{className:yr,children:(0,r.jsx)(nr,{comparisonRunId:_.targetRun.id,comparisonBranchName:R,baseRunId:null===(H=_.baseRun)||void 0===H?void 0:H.id,baseBranchName:x,data:M})}):void 0,!V&&z.length?(0,r.jsxs)("div",{className:_r,children:[(0,r.jsx)("h4",{className:br,children:"Test Definition"}),(0,r.jsx)(lr,{sections:z})]}):void 0]})}),function(){var e,t;if(p&&"screenshots"===(null==N?void 0:N.artifactType)){var n=(0,qn.j0)(null!=(e=null===(t=p.screenshots)||void 0===t?void 0:t.nodes)?e:[]);n.length||I({replace:!0});var a=n.findIndex(function(e){return e.id===(null==N?void 0:N.screenshotId)});return(0,r.jsx)(Hn.A,{isOpen:!0,onClose:I,id:"branch-review-test-screenshots",allScreenshots:n,lightboxIndex:a})}}(),function(){var e,t,n,a;if(p&&"video"===(null==N?void 0:N.artifactType))return p.video||I({replace:!0}),(0,r.jsx)(Vn.p,{isOpen:!0,onClose:I,instanceId:null!=(e=null===(t=p.instance)||void 0===t?void 0:t.id)?e:"",videoTimestamp:null==N?void 0:N.videoTimestamp,videos:[{id:null===(n=p.video)||void 0===n?void 0:n.id,url:null===(a=p.video)||void 0===a?void 0:a.videoUrl}]})}(),function(){var e;if(p&&"replay"===(null==N?void 0:N.artifactType)){(0,Yn.e)(p.capture)||I({replace:!0});var t=p,n=t.id,a=t.run,s=t.instance;return(0,r.jsx)(Gn.r,{testUuid:n,run:a,spec:{title:s.spec.basename,group:(null===(e=s.group)||void 0===e?void 0:e.name)||"",os:s.os.name,browser:s.browser.formattedNameWithVersion},onHide:I,hasPaidPlan:y.organizationInfo.subscription.plan.isPaid})}}()]})};Ir.displayName="TestDetails";n(74874);var Sr=n(8856);const Or="module-SpecListSpecItem__specItem__TMJH4",kr="module-SpecListSpecItem__specNameContainer__mjte8",Pr="module-SpecListSpecItem__fileName__VuvdP",Br="module-SpecListSpecItem__extension__vhRnD",Tr="module-SpecListSpecItem__specInfoContainer__s8OZi",Lr="module-SpecListSpecItem__infoIcon__ZGwgd",Ar="module-SpecListSpecItem__infoLabel__olzPb",Er="module-SpecListSpecItem__infoDivider__wrqzs";var Dr=function(){return(0,r.jsx)("svg",{className:Lr,width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8ZM8 0C3.58172 0 0 3.58172 0 8C0 12.4183 3.58172 16 8 16C12.4183 16 16 12.4183 16 8C16 3.58172 12.4183 0 8 0ZM7.97363 8.00439C7.97363 9.62158 7.00684 10.5312 5.42041 10.5312C3.82959 10.5312 2.87158 9.61719 2.87158 8.00439V7.99561C2.87158 6.41357 3.86475 5.46875 5.42041 5.46875C6.98047 5.46875 7.97363 6.40039 7.97363 7.99561V8.00439ZM4.69971 8.00439C4.69971 8.77344 4.96777 9.19531 5.4248 9.19531C5.87305 9.19531 6.14551 8.76904 6.14551 8.00439V7.99561C6.14551 7.24414 5.85986 6.80469 5.42041 6.80469C4.97656 6.80469 4.69971 7.24414 4.69971 7.99561V8.00439ZM13.1284 8.83496C13.1284 9.88086 12.188 10.5312 10.7817 10.5312C9.25244 10.5312 8.45264 9.87646 8.34277 8.90967L8.33838 8.87012H10.0786L10.0874 8.90527C10.1577 9.18652 10.3774 9.35352 10.7817 9.35352C11.1289 9.35352 11.3442 9.23486 11.3442 9.0415V9.03711C11.3442 8.86133 11.1992 8.76025 10.7993 8.68555L9.92041 8.52295C8.95801 8.34717 8.44824 7.83301 8.44824 7.08154V7.07715C8.44824 6.0708 9.30518 5.46875 10.7158 5.46875C12.2188 5.46875 12.9834 6.21582 12.9834 7.09912V7.12988H11.3486L11.3442 7.09033C11.3179 6.86182 11.1025 6.64648 10.7158 6.64648C10.3862 6.64648 10.1709 6.76953 10.1709 6.97607V6.98047C10.1709 7.15186 10.2939 7.24854 10.7334 7.33203L11.6123 7.49463C12.6582 7.68799 13.1284 8.09668 13.1284 8.83057V8.83496Z",fill:g.MF.gray500})})};Dr.displayName="IconGenericOS";var Mr=function(){return(0,r.jsx)("span",{className:Er,children:"â¢"})};Mr.displayName="Divider";var Fr=function(e){var t=e.spec,n=(0,Sr.zK)(t.specDuration.min),a=(0,Sr.zK)(t.specDuration.max),s=n;return n!==a&&(s=s+" - "+a),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.shn,{className:Lr,size:"16",strokeColor:"gray-500",fillColor:"gray-100"}),(0,r.jsx)("span",{className:Ar,children:s})]})},Ur=function(e){var t=e.groups,n=t.length+" groups";return 1===t.length&&(n=t[0].name),n?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.HfG,{className:Lr,size:"16",strokeColor:"gray-500",fillColor:"gray-100"}),(0,r.jsx)("span",{className:Ar,children:n}),(0,r.jsx)(Mr,{})]}):null},zr=function(e){var t=e.groups,n=Array.from(t.reduce(function(e,t){return e.add(t.os.name),e},new Set)),a=(0,r.jsx)(Dr,{}),s=n.length+" operating systems";return 1===n.length&&(s=n[0],a=(0,r.jsx)("div",{className:Lr,children:(0,r.jsx)(Kn.I,{os:n[0]})})),(0,r.jsxs)(r.Fragment,{children:[a,(0,r.jsx)("span",{className:Ar,children:s})]})},Hr=function(e){var t=e.groups,n=Array.from(t.reduce(function(e,t){return e.add(t.browser.formattedName),e},new Set)),a=n.length+" browsers";return 1===n.length&&(a=n[0]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Qn.g,{browsers:n}),(0,r.jsx)("span",{className:Ar,children:a})]})},qr=function(e){var t=e.spec,n="E2E"===t.testingType?i.YIk:i.bqT,a="E2E"===t.testingType?"E2E":"Component";return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n,{className:Lr,strokeColor:"gray-500",fillColor:"gray-100"}),(0,r.jsx)("span",{className:Ar,children:a})]})},Vr=function(e){var t,n=e.spec,a=e.groups,s=e.style,i=(null==a||null===(t=a.nodes)||void 0===t?void 0:t.filter(function(e){return n.groupIds.indexOf(e.id)>=0}))||[];return(0,r.jsx)("div",{style:s,children:(0,r.jsxs)("div",{className:Or,"data-cy":"insight-spec-list-spec-item",children:[(0,r.jsxs)("div",{className:kr,children:[(0,r.jsx)("span",{className:Pr,children:n.shortPath.split(n.extension)[0]}),(0,r.jsx)("span",{className:Br,children:n.extension})]}),(0,r.jsxs)("div",{className:Tr,children:[(0,r.jsx)(Fr,{spec:n}),(0,r.jsx)(Mr,{}),(0,r.jsx)(Ur,{groups:i}),(0,r.jsx)(zr,{groups:i}),(0,r.jsx)(Mr,{}),(0,r.jsx)(Hr,{groups:i}),(0,r.jsx)(Mr,{}),(0,r.jsx)(qr,{spec:n})]})]})})};Vr.displayName="SpecListSpecItem";const Gr={sectionItem:"module-SpecListSectionItem__sectionItem__CfX1Z",label:"module-SpecListSectionItem__label__h_osV",new:"module-SpecListSectionItem__new__rLWQy",resolved:"module-SpecListSectionItem__resolved__ATDmr"};var Zr=function(e){var t,n=e.label,a=e.style,s=e.type;return s&&(t=Gr[s]),(0,r.jsx)("div",{style:a,children:(0,r.jsx)("div",{className:(0,o.A)(Gr.sectionItem,t),children:(0,r.jsx)("span",{className:Gr.label,children:n})})})};Zr.displayName="SpecListSectionItem";const Wr="module-SpecListTestItem__testItem__V7aUU",Kr="module-SpecListTestItem__isLastInSection__t1PNG",Qr="module-SpecListTestItem__icon__s6qKO",Yr="module-SpecListTestItem__titleSegment__g9c5M",Xr="module-SpecListTestItem__first__xO2Jg",Jr="module-SpecListTestItem__last__ZBo0o";function $r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var ea=function(e){var t=e.test,n=e.style,l=e.isLastInSection,u=(0,s.zy)(),d=a.useMemo(function(){return decodeURI(u.pathname)+"?"+T.stringify(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?$r(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},T.parse(u.search),{test:t.testKey}))},[u,t.testKey]),c=(t.title||"").split(" /// "),m=[];return t.insights.indexOf("ADDED")>=0&&m.push("added"),t.insights.indexOf("MODIFIED")>=0&&m.push("modified"),t.groupedComparisonIsFlaky&&m.push("flaky"),(0,r.jsx)("div",{style:n,children:(0,r.jsxs)(s.N_,{to:d,className:(0,o.A)(Wr,l&&Kr),children:[(0,r.jsx)("div",{className:Qr,children:(0,r.jsx)(zn.k,{status:t.groupedComparisonState})}),c.map(function(e,t){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsx)("div",{title:e,className:(0,o.A)(Yr,0===t&&Xr,t===c.length-1&&Jr),children:e}),t<c.length-1?(0,r.jsx)("div",{children:(0,r.jsx)(i.UMd,{size:"8",strokeColor:"gray-200"})}):void 0]},t)}),Na.filter(function(e){return m.includes(e.slug)}).map(function(e){return(0,r.jsx)("div",{className:Qr,"data-cy":e.slug+"-test-indicator",children:e.icon},e.slug)})]})})};ea.displayName="SpecListTestItem";const ta="module-RunningBuildPlaceholder__runStatus__MZR3Y",na="module-RunningBuildPlaceholder__specsCompleted__t4kG3";var ra=function(){return(0,r.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M40 8H8C6.34315 8 5 9.34315 5 11V16H43V11C43 9.34315 41.6569 8 40 8Z",fill:"#E1E3ED"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 8C6.34315 8 5 9.34315 5 11V16H43V11C43 9.34315 41.6569 8 40 8H8Z",fill:"#E1E3ED"}),(0,r.jsx)("path",{d:"M19 30L14 28L9 31V36H38C38.5523 36 39 35.5523 39 35V23L34 24L29 27L24 25L19 30Z",fill:"#E1E3ED"}),(0,r.jsx)("path",{d:"M19 12H39M43 11V37C43 38.6569 41.6569 40 40 40H24H16H8C6.34315 40 5 38.6569 5 37V11M43 11C43 9.34315 41.6569 8 40 8H8C6.34315 8 5 9.34315 5 11M43 11V16H5V11M39 23V35C39 35.5523 38.5523 36 38 36H9M39 23V21C39 20.4477 38.5523 20 38 20H10C9.44772 20 9 20.4477 9 21V36M39 23L34 24L29 27L24 25L19 30L14 28L9 31V36",stroke:"#9095AD",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,r.jsx)("path",{d:"M10 12C10 12.5523 9.55228 13 9 13C8.44772 13 8 12.5523 8 12C8 11.4477 8.44772 11 9 11C9.55228 11 10 11.4477 10 12Z",fill:"#9095AD"}),(0,r.jsx)("path",{d:"M13 12C13 12.5523 12.5523 13 12 13C11.4477 13 11 12.5523 11 12C11 11.4477 11.4477 11 12 11C12.5523 11 13 11.4477 13 12Z",fill:"#9095AD"}),(0,r.jsx)("path",{d:"M16 12C16 12.5523 15.5523 13 15 13C14.4477 13 14 12.5523 14 12C14 11.4477 14.4477 11 15 11C15.5523 11 16 11.4477 16 12Z",fill:"#9095AD"}),(0,r.jsx)("path",{d:"M39 36.9993C39 41.4175 35.4183 44.9993 31 44.9993C26.5817 44.9993 23 41.4175 23 36.9993C23 32.581 26.5817 28.9993 31 28.9993C35.4183 28.9993 39 32.581 39 36.9993Z",fill:"white"}),(0,r.jsx)("path",{d:"M37 36.9993C37 40.313 34.3137 42.9993 31 42.9993C27.6863 42.9993 25 40.313 25 36.9993C25 33.6856 27.6863 30.9993 31 30.9993C34.3137 30.9993 37 33.6856 37 36.9993Z",fill:"white"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M31 31.9993C28.2386 31.9993 26 34.2378 26 36.9993C26 39.7607 28.2386 41.9993 31 41.9993C33.7614 41.9993 36 39.7607 36 36.9993C36 34.2378 33.7614 31.9993 31 31.9993ZM24 36.9993C24 33.1333 27.134 29.9993 31 29.9993C34.866 29.9993 38 33.1333 38 36.9993C38 40.8653 34.866 43.9993 31 43.9993C27.134 43.9993 24 40.8653 24 36.9993Z",fill:"#C5C9FD"}),(0,r.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M30 30.9993C30 30.447 30.4477 29.9993 31 29.9993C34.866 29.9993 38 33.1333 38 36.9993C38 37.5516 37.5523 37.9993 37 37.9993C36.4477 37.9993 36 37.5516 36 36.9993C36 34.2378 33.7614 31.9993 31 31.9993C30.4477 31.9993 30 31.5516 30 30.9993Z",fill:"#4956E3"}),(0,r.jsx)("path",{d:"M36 36.9993C36 39.7607 33.7614 41.9993 31 41.9993C28.2386 41.9993 26 39.7607 26 36.9993C26 34.2378 28.2386 31.9993 31 31.9993C33.7614 31.9993 36 34.2378 36 36.9993Z",fill:"white"})]})};ra.displayName="IconTechnologyBrowserDashboardRunning";var aa=function(){var e,t,n,a=je(),s=a.project,i=a.changeRequest,o=a.comparison;return(null==o?void 0:o.targetRunIsFinalized)?(null==o?void 0:o.baseRunIsFinalized)||(t=null==o?void 0:o.baseRun,n=!(null==o?void 0:o.baseRun)&&(null==i?void 0:i.baseBranch)?null==i?void 0:i.baseBranch:void 0):(t=null==o?void 0:o.targetRun,n=null==i?void 0:i.targetBranch),(0,r.jsx)(le.O_,{icon:(0,r.jsx)(ra,{}),primaryText:"Testing in progress...",children:s.id&&t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:ta,children:(0,r.jsx)(Pe.CR,{run:t,branchOverride:n,openInNewTab:!0})}),(0,r.jsxs)("span",{className:na,children:[t.completedInstanceCount||0," of"," ",(null===(e=t.instances)||void 0===e?void 0:e.totalCount)||0," specs completed"]})]}):void 0})};aa.displayName="RunningBuildPlaceholder";const sa="module-UsageLimitPlaceholder__branchData__Ebt6T";var ia=function(){var e,t,n,a=(0,s.Zp)(),o=je(),l=o.project,u=o.comparison,d=l.organizationInfo.viewerIsOwnerOrAdmin,c=d?"Upgrade plan":"Contact admin",m=d?"/organizations/"+l.organizationInfo.id+"/pricing":"/organizations/"+l.organizationInfo.id+"/users";return(null==u||null===(e=u.targetRun)||void 0===e?void 0:e.isHiddenByUsageLimits)?n=null==u?void 0:u.targetRun:(null==u||null===(t=u.baseRun)||void 0===t?void 0:t.isHiddenByUsageLimits)&&(n=null==u?void 0:u.baseRun),(0,r.jsx)(le.O_,{icon:(0,r.jsx)(i.Lbr,{strokeColor:"gray-500"}),primaryText:"Youâve reached your monthly test result limit",secondaryText:(0,r.jsxs)("div",{children:["Your Cypress Cloud plan includes"," ",l.organizationInfo.subscription.plan.limits.tests," monthly recorded test results. Upgrade your plan now to view more test results.",(0,r.jsx)(Pe.CR,{run:n,className:sa})]}),children:l&&(0,r.jsx)(le.qj,{label:c,onClick:function(){a(m)}})})};ia.displayName="UsageLimitPlaceholder";var oa=n(97918),la=function(){var e,t,n,a=je(),s=a.project,i=a.comparison,o=s.organizationInfo.subscription.plan.limits.dataRetentionDays;(null==i||null===(e=i.targetRun)||void 0===e?void 0:e.isPastDataRetention)?n=null==i?void 0:i.targetRun:(null==i||null===(t=i.baseRun)||void 0===t?void 0:t.isPastDataRetention)&&(n=null==i?void 0:i.baseRun);var l=s.organizationInfo.viewerIsOwnerOrAdmin;return(0,r.jsx)(oa.k,{run:n,orgId:s.organizationInfo.id,dataRetentionDays:o,viewerIsOwnerOrAdmin:l,showRunInfo:!0})};la.displayName="DataRetentionPlaceholder";var ua=function(){var e=(0,s.Zp)(),t=je().project,n=t.organizationInfo.viewerIsOwnerOrAdmin,a=n?"Upgrade plan":"Contact admin",o=n?"/organizations/"+t.organizationInfo.id+"/pricing":"/organizations/"+t.organizationInfo.id+"/users";return(0,r.jsx)(le.O_,{icon:(0,r.jsx)(i.Lbr,{strokeColor:"gray-500",secondaryStrokeColor:"orange-400",secondaryFillColor:"orange-200"}),primaryText:"Flake detection unavailable",secondaryText:"See the history and severity of flake across your test runs. Available with Team plans.",children:(0,r.jsxs)(le.Ef,{children:[(0,r.jsx)(le.qj,{label:a,onClick:function(){e(o)}}),(0,r.jsx)(le.Cv,{label:"Learn more",onClick:function(){e("https://on.cypress.io/flake-detection")}})]})})};ua.displayName="FlakeDetectionPlaceholder";var da=function(e){var t=e.hasPaidPlan;return(0,r.jsx)(le.O_,{children:t?(0,r.jsx)(le.Cv,{variant:"white",href:"mailto:[email protected]",style:{display:"inline-flex"},label:"Contact support"}):void 0,dataCy:"insight-error",fill:!0,icon:(0,r.jsx)(i.g4T,{size:"48"}),primaryText:"Something went wrong",secondaryText:"There was a problem comparing these two runs. If the problem persists, please "+(t?"contact support":"try again later")+"."})};da.displayName="ErrorPlaceholder";var ca=n(34487);const ma="module-SpecList__specList__V9JFG",va="module-SpecList__body__L7_At";var pa=function(e){var t,n=e.type,a=je(),s=a.changeRequest,o=a.comparison,l=["failures","flaky","pending"].includes(n)&&"PASSED"===(null==o||null===(t=o.targetRun)||void 0===t?void 0:t.status),u="failures"===n?n:n+" tests";return(0,r.jsx)(le.O_,{dataCy:"insight-spec-empty-list",icon:l?(0,r.jsx)(i.z6c,{}):(0,r.jsx)(i.vjT,{}),primaryText:"No "+u+" "+(s?"on PR #"+s.number:"for comparison"),secondaryText:"There are no "+u+" to show."})};function ha(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ga(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ha(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ha(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fa(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ba(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ba(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ba(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}pa.displayName="EmptyInsights";var ya=["new","existing","resolved","present"],_a=function(e){var t=e.type,n=e.count;return"failures"===t?1===n?"failure":"failures":(0,lt.lowerCase)(t)},ja=function(e){var t,n=e.type,i=e.testCategories,o=e.listRef,l=je(),u=l.project,d=l.comparison,c=d||{},m=c.targetRun,v=c.baseRun,p=c.insights||{},h=p.tests,g=p.specs,f=(0,s.zy)(),b=a.useMemo(function(){return(null==h?void 0:h.reduce(function(e,t){return e[t.testKey]=t,e},{}))||{}},[h]),y=a.useMemo(function(){return(null==g?void 0:g.reduce(function(e,t){return e[t.id]=t,e},{}))||{}},[g]),_=a.useMemo(function(){for(var e,t={},r=fa([].concat((null==i?void 0:i.new)||[],(null==i?void 0:i.existing)||[],(null==i?void 0:i.resolved)||[],(null==i?void 0:i.present)||[]));!(e=r()).done;){var a=e.value,s=b[a],o=y[s.specHash];t[o.id]||(t[o.id]=ga({},o,{tests:[]})),t[o.id].tests.push(s)}var l=[];return Object.values(t).forEach(function(e){l.push({spec:e}),ya.forEach(function(t){var r=i[t];if(null==r?void 0:r.length){var a=r.filter(function(t){return b[t].specHash===e.id});if(a.length){"present"!==t&&l.push({subheader:{text:a.length+" "+t+" "+_a({type:n,count:a.length}),type:t}});var s=a.length-1;a.forEach(function(e,t){l.push({test:b[e],isLastInSection:t===s})})}}})}),l},[n,i,b,y]),j=_.length;if(!m||!v&&["added","modified"].includes(n))t=(0,r.jsx)(xe,{});else if(m.isHiddenByUsageLimits||v&&v.isHiddenByUsageLimits)t=(0,r.jsx)(ia,{});else if(m.isPastDataRetention||v&&v.isPastDataRetention)t=(0,r.jsx)(la,{});else if(d.insights)"flaky"!==n||u.organizationInfo.subscription.features.flakeUX?(null==d?void 0:d.targetRunIsFinalized)&&(!v||(null==d?void 0:d.baseRunIsFinalized))||j?0===j&&(t=(0,r.jsx)(pa,{type:n})):t=(0,r.jsx)(aa,{}):t=(0,r.jsx)(ua,{});else{var x=u.organizationInfo.subscription.plan.isPaid;t=(0,r.jsx)(da,{hasPaidPlan:x})}var R=null==f?void 0:f.state,C=R&&R.testKey?_.findIndex(function(e){return e.test&&e.test.testKey===R.testKey}):void 0;return(0,r.jsx)("div",{className:ma,children:(0,r.jsx)("div",{className:va,"data-cy":"insight-spec-list-body",children:t||(0,r.jsx)(ca.t$,{children:function(e){var t=e.height,a=e.width;return(0,r.jsx)(ca.B8,{ref:o,height:t,scrollToAlignment:"start",scrollToIndex:C,rowCount:j,rowHeight:function(e){var t=e.index,n=_[t];return n.test?t===j-1?64:40:n.spec?96:n.subheader?36:0},rowRenderer:function(e){var t=e.key,n=e.index,a=e.style,s=_[n];return s.test?(0,r.jsx)(ea,{test:s.test,isLastInSection:!!s.isLastInSection,style:a},t):s.spec&&(null==m?void 0:m.groups)?(0,r.jsx)(Vr,{spec:s.spec,groups:m.groups,style:a},t):s.subheader?(0,r.jsx)(Zr,{label:s.subheader.text,type:s.subheader.type,style:a},t):null},width:a},n)}})})})};function xa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ra(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xa(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xa(Object(n)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ca(e){return Ra({},e,{test:void 0,ruleId:void 0,categoryId:void 0})}ja.displayName="SpecList";var Na=[{slug:"failures",label:"Failures",icon:(0,r.jsx)(i.S9F,{strokeColor:"red-400"}),reduceQueryParams:Ca},{slug:"flaky",label:"Flaky",icon:(0,r.jsx)(i.V$B,{}),reduceQueryParams:Ca},{slug:"pending",label:"Pending",icon:(0,r.jsx)(i.V0W,{strokeColor:"gray-400"}),reduceQueryParams:Ca},{slug:"added",label:"Added",icon:(0,r.jsx)(i.iN7,{}),reduceQueryParams:Ca},{slug:"modified",label:"Modified",icon:(0,r.jsx)(i.Oul,{}),reduceQueryParams:Ca}],wa={slug:"tests",label:"Tests",enabled:!0,icon:(0,r.jsx)(i._Uc,{strokeColor:"gray-600",fillColor:"gray-200"}),insights:(0,r.jsx)("div",{}),items:Na},Ia=function(e,t,n,a){var s,o,l,u,d=e.project,c=e.comparison;if(!c)return[].concat(Na);var m=c.insights,v=d.organizationInfo.subscription.features.flakeUX,p=!c.baseRun,h=c.baseRun&&c.baseRunIsFinalized,g=c.baseRun&&!c.baseRunIsFinalized||!c.targetRunIsFinalized,f=g?((null==c||null===(s=c.baseRun)||void 0===s?void 0:s.completedInstanceCount)||"")+"-"+((null==c||null===(o=c.targetRun)||void 0===o?void 0:o.completedInstanceCount)||""):void 0;function b(e){var t=e.presentCount,n=void 0===t?0:t,a=e.newCount,s=void 0===a?0:a,i=e.existingCount,o=void 0===i?0:i,l=e.resolvedCount,u=void 0===l?0:l,d=e.errored,c=void 0!==d&&d,m=e.locked,v=void 0!==m&&m,p=n;return h&&(s||o||u)&&(p=s+o),(0,r.jsx)(Bn,{renderKey:f,isPending:g,newCount:h&&s||0,resolvedCount:h&&u||0,totalCount:p,hasError:c,isLocked:v})}function y(e){var t=e.newCount,n=void 0===t?0:t,a=e.existingCount,s=void 0===a?0:a,i=e.resolvedCount,o=void 0===i?0:i,l=e.errored,u=void 0!==l&&l;return h&&(0,r.jsx)(Un,{hasError:u,newCount:n||0,existingCount:s||0,resolvedCount:o||0})}var _="string"==typeof n.test?n.test:void 0,j=null==c||null===(l=c.insights)||void 0===l||null===(u=l.tests)||void 0===u?void 0:u.find(function(e){return e.testKey===_});function x(e){var n=e.slug,s=e.categories,i=c||{},o=i.targetRun,l=i.baseRun;if(_){var u,d,m=null==c||null===(u=c.insights)||void 0===u||null===(d=u.specs)||void 0===d?void 0:d.find(function(e){return e.id===(null==j?void 0:j.specHash)});return!j||!m||(null==o?void 0:o.isHiddenByUsageLimits)||(null==o?void 0:o.isPastDataRetention)||(null==l?void 0:l.isHiddenByUsageLimits)||(null==l?void 0:l.isPastDataRetention)?(t(Na[0].slug,{replace:!0},Ca),null):(0,r.jsx)(Ir,{test:j,spec:m})}if(a){var v=n+"-"+((null==o?void 0:o.isHiddenByUsageLimits)?"h":"")+((null==o?void 0:o.isPastDataRetention)?"p":"")+"-"+((null==l?void 0:l.isHiddenByUsageLimits)?"bh":"")+((null==l?void 0:l.isPastDataRetention)?"bp":""),p=h?s:{present:s.new};return(0,r.jsx)(ja,{listRef:a,type:n,testCategories:p},v)}}var R=function(e,n){t(e,{state:{testKey:n}},Ca)};return Na.map(function(e){var t,s,o,l,u,d,c,h,g,f,C,N,w,I,S,O,k,P,B,T,L,A,E,D;switch(e.beforeNavigate=function(){if(e.slug===n.insight){var t;if(_)R(e.slug,_);else null==a||null===(t=a.current)||void 0===t||t.scrollToRow(0);return!1}return!0},e.titleRow=(D=e.slug,j?(0,r.jsxs)(ot.Ay,{variant:"white",size:"24",onClick:function(){R(D,j.testKey)},className:"gap-2",children:[(0,r.jsx)(i.Gk,{}),"Back"]}):null),e.slug){case"failures":return Ra({},e,{insight:b({errored:!m,newCount:null==m||null===(t=m.newlyFailed)||void 0===t?void 0:t.length,existingCount:null==m||null===(s=m.latentFailed)||void 0===s?void 0:s.length,resolvedCount:null==m||null===(o=m.noLongerFailed)||void 0===o?void 0:o.length,presentCount:null==m||null===(l=m.newlyFailed)||void 0===l?void 0:l.length}),insightLong:y({errored:!m,newCount:null==m||null===(u=m.newlyFailed)||void 0===u?void 0:u.length,existingCount:null==m||null===(d=m.latentFailed)||void 0===d?void 0:d.length,resolvedCount:null==m||null===(c=m.noLongerFailed)||void 0===c?void 0:c.length}),insightBody:x({slug:"failures",categories:{new:null==m?void 0:m.newlyFailed,existing:null==m?void 0:m.latentFailed,resolved:null==m?void 0:m.noLongerFailed}})});case"flaky":return Ra({},e,{insight:b({locked:!v,errored:!m,newCount:null==m||null===(h=m.newlyFlaky)||void 0===h?void 0:h.length,existingCount:null==m||null===(g=m.latentFlaky)||void 0===g?void 0:g.length,resolvedCount:null==m||null===(f=m.noLongerFlaky)||void 0===f?void 0:f.length,presentCount:null==m||null===(C=m.newlyFlaky)||void 0===C?void 0:C.length}),insightLong:y({errored:!m,newCount:null==m||null===(N=m.newlyFlaky)||void 0===N?void 0:N.length,existingCount:null==m||null===(w=m.latentFlaky)||void 0===w?void 0:w.length,resolvedCount:null==m||null===(I=m.noLongerFlaky)||void 0===I?void 0:I.length}),insightBody:x({slug:"flaky",categories:{new:null==m?void 0:m.newlyFlaky,existing:null==m?void 0:m.latentFlaky,resolved:null==m?void 0:m.noLongerFlaky}})});
1case"pending":return Ra({},e,{insight:b({errored:!m,newCount:null==m||null===(S=m.newlyPending)||void 0===S?void 0:S.length,existingCount:null==m||null===(O=m.latentPending)||void 0===O?void 0:O.length,resolvedCount:null==m||null===(k=m.noLongerPending)||void 0===k?void 0:k.length,presentCount:null==m||null===(P=m.newlyPending)||void 0===P?void 0:P.length}),insightLong:y({errored:!m,newCount:null==m||null===(B=m.newlyPending)||void 0===B?void 0:B.length,existingCount:null==m||null===(T=m.latentPending)||void 0===T?void 0:T.length,resolvedCount:null==m||null===(L=m.noLongerPending)||void 0===L?void 0:L.length}),insightBody:x({slug:"pending",categories:{new:null==m?void 0:m.newlyPending,existing:null==m?void 0:m.latentPending,resolved:null==m?void 0:m.noLongerPending}})});case"added":return Ra({},e,{insight:b({presentCount:null==m||null===(A=m.added)||void 0===A?void 0:A.length,errored:!m||p}),insightBody:x({slug:"added",categories:{present:null==m?void 0:m.added}})});case"modified":return Ra({},e,{insight:b({presentCount:(null==m||null===(E=m.modified)||void 0===E?void 0:E.length)||0,errored:!m||p}),insightBody:x({slug:"modified",categories:{present:null==m?void 0:m.modified}})})}})},Sa=function(e,t,n,a){var s,i,o,l,u,d,c,m,v,p=(null===(s=e.comparison)||void 0===s||null===(i=s.targetRun)||void 0===i||null===(o=i.testResults)||void 0===o?void 0:o.totalCount)||0,h=(null===(l=e.comparison)||void 0===l||null===(u=l.baseRun)||void 0===u||null===(d=u.testResults)||void 0===d?void 0:d.totalCount)||0;return{insight:(0,r.jsx)(kn,{hasError:!(null===(c=e.comparison)||void 0===c?void 0:c.insights),totalCount:p,newCount:(null===(m=e.comparison)||void 0===m?void 0:m.baseRun)&&p>h?p-h:void 0,resolvedCount:(null===(v=e.comparison)||void 0===v?void 0:v.baseRun)&&p<h?h-p:void 0,isFlipped:!0}),items:Ia(e,t,n,a)}},Oa=n(36275),ka=n(11290),Pa=n(52478),Ba=n(3082),Ta=n(52379),La=n(25579),Aa=n(23400),Ea=n(99870),Da=n.n(Ea),Ma=function(e){var t=e.tooltipContent,n=e.viewCount,a=e.size,s=void 0===a?"16":a,o=e.className,l=e.dark,u=void 0!==l&&l;return(0,r.jsx)(g.m_,{overlay:function(){return t},placement:"top",children:(0,r.jsxs)(xt.A,{size:s,color:"white","data-cy":"views-count-tag",className:Da()(Aa.A.outlineTag,o),dark:u,children:[(0,r.jsx)(i.kUU,{size:"12",strokeColor:"gray-500"}),n]})})};Ma.displayName="ViewCountTag";const Fa="module-UICovInsightBody__bodyContainer__nEK3s",Ua="module-UICovInsightBody__placeholderContainer__KmUep",za="module-UICovInsightBody__tableContainer__zbrBn",Ha="module-UICovInsightBody__textTag__GErWb",qa="module-UICovInsightBody__grayTextTag__SHoe7",Va="module-UICovInsightBody__titleRow__EDxWC",Ga="module-UICovInsightBody__dataRow__tNDb0",Za="module-UICovInsightBody__dataRowTitleBlock__U3lbo",Wa="module-UICovInsightBody__icon__CaiiQ",Ka="module-UICovInsightBody__dataRowTagsBlock__Y955l",Qa="module-UICovInsightBody__dataRowEndSection___yuXd",Ya="module-UICovInsightBody__dataRowName__cVGoc",Xa="module-UICovInsightBody__seeMoreLinkContainer__qzriI",Ja="module-UICovInsightBody__seeMoreLink__u_TBA";function $a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var es=function(e){var t=e.children,n=e.className;return(0,r.jsx)("div",{className:(0,o.A)(za,n),children:t})};es.displayName="InsightTableContainer";var ts=function(e){var t=e.color,n=e.children;return(0,r.jsx)(xt.A,{color:t,size:"16",className:(0,o.A)(Ha,"white"===t&&qa),dark:"white"===t,children:n})};ts.displayName="InsightTextTag";var ns=function(e){var t=e.title,n=e.rows,a=e.variant,l=e.view,u=void 0!==l&&l,d=(0,s.zy)(),c=(0,s.Zp)();if(!n.length)return null;var m,v=T.parse(d.search),p="text-gray-700",g="white";return"new"===a?(p="text-red-500",g="red",m="up"):"resolved"===a&&(p="text-jade-500",g="jade",m="down"),(0,r.jsxs)(es,{children:[(0,r.jsxs)("div",{className:(0,o.A)(Va,p),children:[t.icon," ",t.label,(0,r.jsxs)(ts,{color:g,children:[m?"up"===m?(0,r.jsx)(i.nar,{}):(0,r.jsx)(i.gCR,{}):null,(0,r.jsx)("span",{children:t.count})]})]}),null==n?void 0:n.map(function(e){var n,a,o,l,m=u?e.href:d.pathname+"?"+T.stringify(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?$a(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},v,{itemId:(null===(n=e.referrerElementIds)||void 0===n?void 0:n[0])?null===(a=e.referrerElementIds)||void 0===a?void 0:a[0]:e.id})),p=null!=(o=e.viewCount)?o:e.referrerCount,g=e.rule&&!!e.memberCount&&(0,Ba.Wz)({rule:e.rule,mergedFromFormControl:e.mergedFromFormControl||!1},e.memberCount);return(0,r.jsxs)(s.N_,{to:m,onClick:function(e){e.preventDefault(),c(m)},className:Ga,children:[(0,r.jsxs)("div",{className:Za,children:[e.icon||t.icon?(0,r.jsx)("span",{className:Wa,children:null!=(l=e.icon)?l:t.icon}):void 0," ",(0,r.jsx)("span",{className:Ya,children:e.name})]}),(0,r.jsxs)("div",{className:Ka,children:[e.added&&(0,r.jsx)(La.v,{size:"20"}),e.visited&&(0,r.jsx)(Ta.P,{size:"20"}),(0,r.jsx)(ka.A,{interactionCount:e.interactionCount,size:"20"}),g&&(0,r.jsx)(Pa.a,{elementCount:e.memberCount,tooltipContent:g,size:"20"}),p&&(0,r.jsx)(Ma,{tooltipContent:p+" "+h()("view",p),viewCount:p,size:"20"})]}),u&&(0,r.jsx)("div",{className:Qa,children:(0,r.jsx)(i.JhV,{strokeColor:"indigo-500",secondaryStrokeColor:"indigo-200"})})]},e.name)})]})};ns.displayName="InsightTable";var rs=function(e){var t=e.variant,n=a.useMemo(function(){switch(null!=t?t:""){case"accessibility":return"No additions or changes to failed elements.";case"untested-links":return"No changes to untested links.";case"untested-elements":return"No changes to untested elements.";case"uicov-added":return"No elements, links or views were added.";default:return"No changes to results."}},[t]);return(0,r.jsx)(le.O_,{dataCy:"branch-review-no-changes",icon:(0,r.jsx)(i.vjT,{strokeColor:"gray-600"}),primaryText:"No changes",secondaryText:n,fill:!0})};rs.displayName="NoChangesPlaceholder";n(28443);function as(e,t){var n="branchReview.insights."+e;return{get:function(){var e=sessionStorage.getItem(n);return null!==e?(null==t?void 0:t(e))||JSON.parse(e):null},set:function(e){sessionStorage.setItem(n,JSON.stringify(e))},unset:function(){sessionStorage.removeItem(n)}}}var ss=as("accessibility-failed-elements.activeRuleId"),is=as("accessibility-failed-elements.activeCategoryId"),os="data-insight-details-body-id",ls=function(e){return document.querySelector("["+os+'="'+e+'"]')},us=n(35338),ds=function(e){var t=e.insightSlug,n=(0,a.useRef)(t),r=(0,s.zy)(),i=(r.state?r.state:{}).from===us.gC,o=(0,a.useMemo)(function(){return as(n.current+".scrollPosition",function(e){return parseFloat(e)})},[]);return(0,a.useLayoutEffect)(function(){var e=ls(n.current);if(i&&e){var t=o.get();null!==t&&(e.scrollTop=t,o.unset())}},[i,o]),(0,a.useLayoutEffect)(function(){var e=n.current;return function(){var t=ls(e),n=(null==t?void 0:t.scrollTop)||0;n>0&&o.set(n)}},[o]),o.get()};function cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cs(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var vs=(0,r.jsx)(i.x2z,{strokeColor:"gray-500"}),ps=(0,r.jsx)(i.wCz,{strokeColor:"gray-500"}),hs=(0,r.jsx)(i.QwQ,{strokeColor:"jade-400",fillColor:"transparent"}),gs=(0,r.jsx)(i.BBf,{strokeColor:"red-400",fillColor:"transparent"}),fs=function(e){var t=e.addedLinks,n=e.addedElements,s=e.addedViews,o=e.projectId,l=e.targetRunBuildNumber,u=a.useMemo(function(){return t.map(function(e){return ms({},e,{icon:e.tested?vs:ps})})},[t]),d=a.useMemo(function(){return n.map(function(e){return ms({},e,{icon:e.interactionCount&&e.interactionCount>0?hs:gs})})},[n]),c=a.useMemo(function(){return s.map(function(e){return ms({},e,{added:!0,icon:"component"===e.testingType?(0,r.jsx)(i.bqT,{fillColor:"transparent",strokeColor:"gray-400"}):(0,r.jsx)(i.kUU,{strokeColor:"gray-500"}),href:(0,Oa.c)(o,l,e.id)})})},[s,o,l]);
1return ds({insightSlug:"uicov-added"}),0===t.length&&0===n.length&&0===s.length?(0,r.jsx)(rs,{variant:"uicov-added"}):(0,r.jsxs)("div",{className:Fa,children:[(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.wk6,{strokeColor:"gray-500",secondaryStrokeColor:"gray-500"}),label:"Added links",count:u.length},rows:u,variant:"added"}),(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.Vwb,{strokeColor:"gray-500"}),label:"Added elements",count:d.length},rows:d,variant:"added"}),(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.QVE,{strokeColor:"gray-500"}),label:"Added views",count:c.length},rows:c,variant:"added",view:!0})]})};fs.displayName="UICovInsightBodyAdded";var bs=function(e){var t=e.newElements,n=e.resolvedElements,a=e.seeMoreLink,l=(null==t?void 0:t.length)>0||(null==n?void 0:n.length)>0;return ds({insightSlug:"uicov-untested-elements"}),(0,r.jsxs)("div",{className:(0,o.A)(Fa,!l&&Ua),children:[l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.BBf,{secondaryStrokeColor:"red-400",strokeColor:"red-400",fillColor:"transparent"}),label:"New untested elements",count:t.length},rows:t,variant:"new"}),(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.QwQ,{secondaryStrokeColor:"jade-400",strokeColor:"jade-400",fillColor:"transparent"}),label:"Resolved untested elements",count:n.length},rows:n,variant:"resolved"})]}):(0,r.jsx)(rs,{variant:"untested-elements"}),(0,r.jsxs)(es,{className:(0,o.A)(Va,Xa),children:[(0,r.jsx)("span",{children:"Existing untested elements"}),(0,r.jsx)(ts,{color:"white",children:a.count}),(0,r.jsx)(i.kYH,{fillColor:"gray-200",strokeColor:"transparent"}),(0,r.jsxs)(s.N_,{to:a.href,className:Ja,children:[a.label," ",(0,r.jsx)(i.EVB,{})]})]})]})};bs.displayName="UICovInsightBodyUntestedElements";var ys=function(e){var t=e.newLinks,n=e.resolvedLinks,a=e.seeMoreLink,l=t.length>0||n.length>0;return ds({insightSlug:"uicov-untested-links"}),(0,r.jsxs)("div",{className:(0,o.A)(Fa,!l&&Ua),children:[l?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.wCz,{strokeColor:"gray-500"}),label:"New untested links",count:t.length},rows:t,variant:"new"}),(0,r.jsx)(ns,{title:{icon:(0,r.jsx)(i.x2z,{strokeColor:"gray-500"}),label:"Resolved untested links",count:n.length},rows:n,variant:"resolved"})]}):(0,r.jsx)(rs,{variant:"untested-links"}),(0,r.jsxs)(es,{className:(0,o.A)(Va,Xa),children:[(0,r.jsx)("span",{children:"Existing untested links"}),(0,r.jsx)(ts,{color:"white",children:a.count}),(0,r.jsx)(i.kYH,{fillColor:"gray-200",strokeColor:"transparent"}),(0,r.jsxs)(s.N_,{to:a.href,className:Ja,children:[a.label," ",(0,r.jsx)(i.EVB,{})]})]})]})};ys.displayName="UICovInsightBodyUntestedLinks";var _s=function(e){var t=e.children,n=e.variant,a=e.isLoading,s=void 0!==a&&a,l=e.hasError,u=void 0!==l&&l,d=ae(),c=ie(n),m=(0,r.jsx)("div",{className:(0,o.A)(Pn.skeleton,Pn.animatePending),"data-cy":"insight-skeleton"}),v=(0,r.jsx)("div",{className:Pn.skeleton,"data-cy":"insight-placeholder",children:"-"});if(u)return v;if((0,lt.isEmpty)(d)||s)return m;switch(null==c?void 0:c.status){case"disabled":case"run-not-selected":case"no-report":case"error":case"operation-unsupported":return v;case"loading":return m;case"running":case"processing":return(0,r.jsx)("div",{className:Pn.tagContainer,"data-cy":"insight-loading",children:(0,r.jsx)(i.pEp,{size:"16",className:Pn.loadingIcon})});default:return t}};function js(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?js(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):js(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Rs=function(e){var t,n,s=e.variant,i=ae(),o="accessibility"===s?"accessibilityResults":"uiCoverageResults",l=null==i||null===(t=i.baseRun)||void 0===t?void 0:t[o],u=null==i||null===(n=i.targetRun)||void 0===n?void 0:n[o],d=a.useMemo(function(){var e,t,n=null!=(e=null==l?void 0:l.coveragePercent)?e:0,r=null!=(t=null==u?void 0:u.coveragePercent)?t:0,a=Math.round(r)-Math.round(n);return{totalCount:Math.round(r),newCount:a>0?Math.abs(a):void 0,resolvedCount:a<0?Math.abs(a):void 0}},[l,u]),c="accessibility"===s?{total:"Score of "+d.totalCount+"%",new:d.newCount+"% score improvement",resolved:d.resolvedCount+"% score regression"}:{total:"Coverage of "+d.totalCount+"%",new:d.newCount+"% coverage improvement",resolved:d.resolvedCount+"% reduction in coverage"};return(0,r.jsx)(_s,{variant:s,children:(0,r.jsx)(kn,xs({},d,{ariaLabelOverrides:c,isFlipped:!0,isPercent:!0}))})};Rs.displayName="ScoreInsight";var Cs=n(80686);const Ns="module-PartialReport__bodyContainer__rCBIH",ws="module-PartialReport__accessibilityBo
1dyContainer__nZzsB",Is="module-PartialReport__uiCovBodyContainer__IDvcl",Ss="module-PartialReport__titleRow__fZGdJ",Os="module-PartialReport__title__M7lIM",ks="module-PartialReport__titleMessage__Jslj8",Ps="module-PartialReport__statusLink__Lf3MJ",Bs="module-PartialReport__dataContainer__cl5Xd",Ts="module-PartialReport__issueContainer__UngSd",Ls="module-PartialReport__accordion__LmJNa";var As=n(31315),Es=function(e){var t=e.run,n=e.runIsFinalized;return(0,r.jsxs)(r.Fragment,{children:["Run",(0,r.jsx)(Pe.CR,{className:Ps,run:t,runIsPending:!n,openInNewTab:!0,displayBranchName:!1,tooltipDisabled:!0}),"has a partial report"]})},Ds=function(e){var t=e.issuesMap,n=e.issue,a=e.baseRun,s=e.targetRun,i=e.baseRunIsFinalized,o=e.targetRunIsFinalized,l=t[n],u=l.inBaseRun,d=l.inTargetRun;return(0,r.jsxs)("div",{className:Ts,"data-cy":"partial-report-issue",children:[n,u&&(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(Pe.CR,{className:Ps,run:a,runIsPending:!i,openInNewTab:!0,displayBranchName:!1,tooltipDisabled:!0})}),d&&(0,r.jsx)(Pe.CR,{className:Ps,run:s,runIsPending:!o,openInNewTab:!0,displayBranchName:!1,tooltipDisabled:!0})]})};Ds.displayName="ComparisonRunsIssue";var Ms=a.memo(function(e){var t=e.variant,n=je().comparison,a=oe(t),s=a.hasPartialReport,o=a.source,l=(0,J.A)(a,["hasPartialReport","source"]);if(!s||!n)return null;var u,d=n.baseRun,c=n.targetRun,m=n.baseRunIsFinalized,v=n.targetRunIsFinalized,p=function(e){var t=e.baseRunCancelOnFailure,n=void 0!==t&&t,r=e.targetRunCancelOnFailure,a=void 0!==r&&r,s=e.baseReportIssues,i=e.targetReportIssues,o=e.baseRunAnchorBuildNumber,l=e.targetRunAnchorBuildNumber,u=(0,Cs.gN)(n,s,o),d=u.issues,c=u.showHelpText,m=(0,Cs.gN)(a,i,l),v=m.issues,p=m.showHelpText,h={};return d.forEach(function(e){h[e]||(h[e]={}),h[e].inBaseRun=!0}),v.forEach(function(e){h[e]||(h[e]={}),h[e].inTargetRun=!0}),{comparisonRunsIssuesMap:h,showHelpText:c||p}}(l),h=p.comparisonRunsIssuesMap,g=p.showHelpText;"baseAndTarget"===o&&(u=function(e){return(0,r.jsx)(Ds,{issue:e,issuesMap:h,baseRun:d,targetRun:c,baseRunIsFinalized:m,targetRunIsFinalized:v})});var f=Object.keys(h),b=(0,Cs.G4)(f,g,u);return(0,r.jsx)("div",{className:Da()(Ns,{accessibility:ws,"ui-coverage":Is}[t]),children:(0,r.jsx)(es,{children:(0,r.jsx)(As.n,{className:Ls,iconPosition:"right",getIcon:function(e){return e?(0,r.jsx)(i.UMd,{size:"16",strokeColor:"gray-500"}):(0,r.jsx)(i.e6o,{strokeColor:"gray-500"})},renderToggle:function(){return(0,r.jsxs)("div",{className:Da()(Ss),"data-cy":t+"-partialReportTitle",children:[(0,r.jsx)(i.GCX,{strokeColor:"orange-400",fillColor:"transparent","data-cy":t+"-partialReportWarningIcon"}),(0,r.jsx)("span",{className:Os,children:"Partial report"}),(0,r.jsxs)("span",{className:ks,children:["â¢"," ","baseAndTarget"===o?"Both runs have partial reports":(0,r.jsx)(Es,{run:"base"===o?d:c,runIsFinalized:"base"===o?m:v})]})]})},renderCollapse:function(){return(0,r.jsx)("div",{"data-cy":t+"-partialReportIssues",className:Da()(Bs),children:b})}})})})}),Fs=function(e){var t=e.children,n=e.errorMsg,a=e.hasError,s=e.isLoading,i=e.hidePartialReportInsight,o=void 0!==i&&i,l=e.variant,u=e.onHasEmptyState,d=je().project.organizationInfo.subscription.plan.isPaid,c=function(e){var t=e.errorMsg,n=e.hasError,r=e.isLoading,a=e.currentReason;return n?Re(t)?{source:"query",status:"operation-unsupported"}:{source:"query",status:"error"}:a||(r?{source:"query",status:"loading"}:void 0)}({currentReason:ie(l),hasError:a,errorMsg:n,isLoading:s});return u&&u(!!c),c?(0,r.jsx)(Ce,{hasPaidPlan:d,reason:c,variant:l}):(0,r.jsxs)(v.A,{fallbackRender:function(){return(0,r.jsx)(de,{hasPaidPlan:d,variant:l})},children:[!o&&(0,r.jsx)(Ms,{variant:l}),t]})};function Us(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function zs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Us(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Us(Object(n)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hs(e){return zs({},e,{ruleId:void 0,categoryId:void 0})}Fs.displayName="AppQualityInsightBodyWrapper";var qs=[{slug:"uicov-untested-links",label:"Untested links",icon:(0,r.jsx)(i.wCz,{strokeColor:"gray-500"}),iconActive:(0,r.jsx)(i.wCz,{strokeColor:"indigo-500"}),reduceQueryParams:Hs},{slug:"uicov-untested-elements",label:"Untested elements",icon:(0,r.jsx)(i.BBf,{strokeColor:"gray-500",fillColor:"gray-50",secondaryStrokeColor:"red-400"}),iconActive:(0,r.jsx)(i.BBf,{strokeColor:"indigo-500",fillColor:"indigo-100",secondaryStrokeColor:"red-400"}),reduceQueryParams:Hs},{slug:"uicov-added",label:"Added",icon:(0,r.jsx)(i.iN7,{}),reduceQueryParams:Hs}],Vs=function(e){var t=e.newCount,n=void 0===t?0:t,a=e.existingCount,s=void 0===a?0:a,i=e.resolvedCount,o=void 0===i?0:i,l=e.isLoading,u=e.hasError;return(0,r.jsx)(_s,{variant:"ui-coverage",isLoading:l,hasError:u,children:(0,r.jsx)(kn,{newCount:n,resolvedCount:o,totalCount:n+s})})};Vs.displayName="Insight";var Gs=function(e){var t=e.linkCount,n=void 0===t?0:t,a=e.elementCount,s=void 0===a?0:a,o=e.viewCount,l=void 0===o?0:o,u=e.isLoading,d=e.hasError;return(0,r.jsx)(_s,{variant:"ui-coverage",isLoading:u,hasError:d,children:(0,r.jsxs)("div",{className:"rounded border border-solid border-gray-100 flex text-gray-700 font-medium bg-white text-[14px] h-[22px]",children:[(0,r.jsxs)("span",{"data-cy":"insight-link-count",className:"flex items-center gap-3 px-3 border-solid border-0 border-r border-gray-100",children:[(0,r.jsx)(i.sJR,{strokeColor:"gray-500"}),n]}),(0,r.jsxs)("span",{"data-cy":"insight-element-count",className:"flex items-center gap-3 px-3 border-solid border-0 border-r border-gray-100",children:[(0,r.jsx)(i.R4B,{size:"12",strokeColor:"gray-500"}),s]}),(0,r.jsxs)("span",{"data-cy":"insight-view-count",className:"flex items-center gap-3 px-3",children:[(0,r.jsx)(i.kUU,{size:"12",strokeColor:"gray-500"}),l]})]})})};Gs.displayName="InsightAdded";var Zs=function(e){var t=new Set,n=new Set;return e.forEach(function(e){!(0,Ba.BB)(e.discriminator)&&e.resolvedHref&&function(e){var r=(0,Ba.Dl)(e);if(r){var a=r.hostname,s=r.protocol,i=r.port;t.add(s),n.add(s+a+i)}}(e.resolvedHref)}),{protocols:t,hostnamesWithPort:n}},Ws=function(e){return(0,a.useMemo)(function(){return e?function(e){var t=Zs(e),n=t.protocols,r=t.hostnamesWithPort,a=1===n.size,s=1===r.size;return e.map(function(e){return e.name?e:zs({},e,{name:(0,Ba.pw)({groupDiscriminator:e.discriminator,resolvedHref:e.resolvedHref,href:e.href,allLinksHaveSameProtocol:a,allLinksHaveSameHostAndPort:s})})})}(e):null},[e])},Ks=function(e){var t,n,s,i,o,l,u,d,c,v,p,h,g=null===(t=e.comparison)||void 0===t?void 0:t.baseRun,f=null===(n=e.comparison)||void 0===n?void 0:n.targetRun,b=null!=(s=null===(i=e.comparison)||void 0===i||null===(o=i.targetRun)||void 0===o?void 0:o.buildNumber)?s:0,y=null==g?void 0:g.id,_=null!=(l=null==f?void 0:f.id)?l:"",j=ie("ui-coverage"),x=!(b&&y&&_&&!j),R=se("ui-coverage"),C=R.baseRunReportAttempt,N=R.targetRunReportAttempt,w=(0,ye.Zl)(m.yhu,function(e){var t,n;return null==e||null===(t=e.run)||void 0===t||null===(n=t.runComparison)||void 0===n?void 0:n.discoveryComparisonOrPoll})({variables:{baseRunUuid:y,targetRunUuid:_,baseRunReportAttempt:C,targetRunReportAttempt:N},skip:x}),I=null==w||null===(u=w.data)||void 0===u||null===(d=u.interactivityInsights)||void 0===d?void 0:d.elements,S=(0,a.useMemo)(function(){if(!I)return null;var e=I.newUntested,t=I.previouslyUntested;return zs({},I,{newUntested:(0,lt.orderBy)(e||[],["name"],"asc"),previouslyUntested:(0,lt.orderBy)(t||[],["name"],"asc")})},[I]),O=(0,ye.Zl)(m.unY,function(e){var t,n;return null==e||null===(t=e.run)||void 0===t||null===(n=t.runComparison)||void 0===n?void 0:n.discoveryComparisonOrPoll})({variables:{baseRunUuid:y,targetRunUuid:_,baseRunReportAttempt:C,targetRunReportAttempt:N},skip:x}),k=null==O||null===(c=O.data)||void 0===c||null===(v=c.interactivityInsights)||void 0===v?void 0:v.views,P=(0,a.useMemo)(function(){if(!k)return null;var e=k.newUntested,t=k.previouslyUntested;return zs({},k,{newUntested:(0,lt.orderBy)(e||[],["name"],"asc"),previouslyUntested:(0,lt.orderBy)(t||[],["name"],"asc")})},[k]),B=(0,ye.Zl)(m.Prq,function(e){var t,n;return null==e||null===(t=e.run)||void 0===t||null===(n=t.runComparison)||void 0===n?void 0:n.discoveryComparisonOrPoll})({variables:{baseRunUuid:y,targetRunUuid:_,baseRunReportAttempt:C,targetRunReportAttempt:N},skip:x}),T=null==B||null===(p=B.data)||void 0===p?void 0:p.interactivityInsights,L=Ws(null==T||null===(h=T.links)||void 0===h?void 0:h.added),A=(0,a.useMemo)(function(){var e,t,n;if(!T)return null;var r=null===(e=T.elements)||void 0===e?void 0:e.added,a=L||(null===(t=T.links)||void 0===t?void 0:t.added),s=null===(n=T.views)||void 0===n?void 0:n.added,i=zs({},T);return i.elements&&r&&(i.elements=zs({},i.elements,{added:(0,lt.orderBy)(r,["tested","name"],["asc"])})),i.links&&a&&(i.links=zs({},i.links,{added:(0,lt.orderBy)(a,["tested","name"],"asc")})),i.views&&s&&(i.views=zs({},i.views,{added:(0,lt.orderBy)(s,["name"],"asc")})),i},[T,L]);return qs.map(function(t){switch(t.slug){case"uicov-untested-links":var n,a=!!O.error,s=P||{},i=s.existingUntestedCount,o=s.newUntested,l=s.newUntestedCount,u=s.previouslyUntested,d={newCount:l,existingCount:i,resolvedCount:s.previouslyUntestedCount,isLoading:O.loading,hasError:a};return zs({},t,{insight:(0,r.jsx)(Vs,zs({},d)),insightLong:(0,r.jsx)(Un,zs({},d)),insightBody:(0,r.jsx)(Fs,{variant:"ui-coverage",errorMsg:null===(n=O.error)||void 0===n?void 0:n.message,hasError:a,isLoading:O.loading,children:(0,r.jsx)(ys,{newLinks:o||[],resolvedLinks:u||[],seeMoreLink:{count:i||0,label:"See all untested links on run #"+b,href:"/projects/"+e.project.id+"/runs/"+b+"/ui-coverage/untested-links"}})})});case"uicov-untested-elements":var c,m=!!w.error,v=S||{},p=v.existingUntestedCount,h=v.newUntested,g=v.newUntestedCount,f=v.previouslyUntested,y={newCount:g,existingCount:p,resolvedCount:v.previouslyUntestedCount,isLoading:w.loading,hasError:m};return zs({},t,{insight:(0,r.jsx)(Vs,zs({},y)),insightLong:(0,r.jsx)(Un,zs({},y)),insightBody:(0,r.jsx)(Fs,{variant:"ui-coverage",errorMsg:null===(c=w.error)||void 0===c?void 0:c.message,hasError:m,isLoading:w.loading,children:(0,r.jsx)(bs,{newElements:h||[],resolvedElements:f||[],seeMoreLink:{count:p||0,label:"See all untested elements on run #"+b,href:"/projects/"+e.project.id+"/runs/"+b+"/ui-coverage/untested-elements"}})})});case"uicov-added":var _,j=!!B.error,x=A||{},R=x.elements,C=x.links,N=x.views,I={linkCount:(null==C?void 0:C.addedCount)||0,elementCount:(null==R?void 0:R.addedCount)||0,viewCount:(null==N?void 0:N.addedCount)||0,isLoading:B.loading,hasError:j};return zs({},t,{insight:(0,r.jsx)(Gs,zs({},I)),insightLong:(0,r.jsx)(Gs,zs({},I)),insightBody:(0,r.jsx)(Fs,{variant:"ui-coverage",errorMsg:null===(_=B.error)||void 0===_?void 0:_.message,hasError:j,isLoading:B.loading,children:(0,r.jsx)(fs,{addedLinks:(null==C?void 0:C.added)||[],addedElements:(null==R?void 0:R.added)||[],addedViews:(null==N?void 0:N.added)||[],projectId:e.project.id,targetRunBuildNumber:b})})})}})},Qs=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return{insight:(0,r.jsx)(Rs,{variant:"ui-coverage"}),items:Ks.apply(void 0,[e].concat(n))}};n(78366);const Ys="module-InsightBody-accessibility__container__htJJP",Xs="module-RulesTable__table__tDi0e",Js="module-RulesTable__icon__s3oDN",$s="module-RulesTable__header__TSink",ei="module-RulesTable__newFailedElements__rQDB_",ti="module-RulesTable__resolvedElements__xFdGK",ni="module-RulesTable__existingFailedElements__ohHNI",ri="module-RulesTable__tagContainer__YoHAJ",ai="module-RulesTable__iconContainer__znqWJ",si="module-RulesTable__titleLabel__kH50B",ii="module-RulesTable__subtitleLabel__wcyXM",oi="module-RulesTable__headerTitle__CRR6a",li="module-RulesTable__viewAllButtonContainer__Yhvvb",ui="module-RulesTable__ruleContainer__fIIkG",di="module-RulesTable__expanded__HcZlH",ci="module-RulesTable__rule__PrvsD",mi="module-RulesTable__chevronIcon__SsVWL",vi="module-RulesTable__ruleHelp__judnm",pi="module-RulesTable__severity__MzL9f",hi="module-RulesTable__ruleName__nWXuq",gi="module-RulesTable__viewContainer__tbNVB",fi="module-RulesTable__view__NzMSZ",bi="module-RulesTable__allViewsRow__eKUkZ",yi="module-RulesTable__viewB
1orderContainer__cEHYY",_i="module-RulesTable__viewNameContainer__NGB1b",ji="module-RulesTable__viewName__gU_XE",xi="module-RulesTable__viewNameText__V7xDC",Ri="module-RulesTable__emptyMsg__pV7dh",Ci="module-RulesTable__statusLink__mBHOW",Ni="module-RulesTable__tooltipContainer__Ig0IN",wi="module-RulesTable__tooltipTitle__XuUC4",Ii="module-RulesTable__tooltipBody__jqGFB";var Si,Oi,ki={RESOLVED:"fewer",NEW:"more"},Pi="new-failed-elements",Bi="resolved-elements",Ti="existing-failed-elements",Li=((Si={})[Pi]="New failed elements",Si[Bi]="Resolved elements",Si[Ti]="Existing failed elements",Si),Ai=((Oi={})[Pi]="Explore these rules to see the locations of new failed elements for each rule.",Oi[Bi]="Explore these rules to see where failed elements appeared on the Base run, but do not appear in the Changed run.",Oi),Ei=function(e){return{totalCount:e.total,newCount:e.new,resolvedCount:e.resolved}},Di=n(6035),Mi=function(e){var t=e.size,n=void 0===t?"16":t,a=e.dark,s=void 0!==a&&a,i=e.tooltipContent;return(0,r.jsx)(Di.H,{tooltipContent:i,children:(0,r.jsx)(xt.A,{size:n,color:"white","data-cy":"removed-tag",dark:s,className:Da()(Aa.A.elementsTag,Aa.A.outlineTag,Aa.A.visitedTag,Aa.A.tagAdapter),children:(0,r.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("path",{d:"M1 9V3C1 1.89543 1.89543 1 3 1H9C10.1046 1 11 1.89543 11 3V9C11 10.1046 10.1046 11 9 11H3C1.89543 11 1 10.1046 1 9Z",fill:"white"}),(0,r.jsx)("path",{d:"M7.66667 6H4.33333M9 1H3C1.89543 1 1 1.89543 1 3V9C1 10.1046 1.89543 11 3 11H9C10.1046 11 11 10.1046 11 9V3C11 1.89543 10.1046 1 9 1Z",stroke:"#E45770",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})})};function Fi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ui(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fi(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Mi.displayName="RemovedTag";var zi=function(e){var t=e.expanded;return(0,r.jsx)("div",{children:t?(0,r.jsx)(i.ost,{"data-cy":"ruleIconChevronDown",className:Da()(Js,mi)}):(0,r.jsx)(i.UMd,{"data-cy":"ruleIconChevronRight",className:Da()(Js,mi)})})};zi.displayName="RuleIcon";var Hi=function(e){var t=e.status,n=e.targetRunNumber,a=e.baseRunNumber,s="Added",i=n,o=a;return"REMOVED"===t&&(s="Removed",i=a,o=n),(0,r.jsxs)("div",{className:Ni,"data-cy":"view-status-tooltip-"+t,children:[(0,r.jsxs)("div",{className:wi,children:[s," view"]}),(0,r.jsxs)("div",{className:Ii,children:[(0,r.jsxs)("div",{children:["This view was detected in run #",i," but is not present in run #",o]}),(0,r.jsx)("hr",{}),(0,r.jsxs)("div",{children:["If this is unexpected, check out"," ",(0,r.jsx)("a",{href:"https://on.cypress.io/accessibility-configuration-views",target:"_blank",children:"View configuration guide"})]})]})]})};Hi.displayName="ViewStatusTooltipContent";var qi=function(e){var t=e.viewId,n=e.url,a=(e.accessibilityTargetRunUrl,e.accessibilityBaseRunUrl),o=e.targetRunNumber,l=e.baseRunNumber,u=e.ruleId,d=e.diffCounts,c=e.status,m=e.testingType,v=e.icon,p=e.disabled,h=(0,s.zy)(),g=T.parse(h.search),f="All views"===n?"view-all":t,b=h.pathname+"?"+T.stringify(Ui({},g,{viewId:f,ruleId:u,categoryId:void 0})),y=void 0;return"REMOVED"===c?(b=a+"/"+f+"?ruleId="+u+"&status=fail",y=(0,r.jsx)(Mi,{size:"20",tooltipContent:(0,r.jsx)(Hi,{status:c,targetRunNumber:o,baseRunNumber:l})})):"ADDED"===c&&(y=(0,r.jsx)(La.v,{size:"20",tooltipContent:(0,r.jsx)(Hi,{status:c,targetRunNumber:o,baseRunNumber:l})})),(0,r.jsx)("div",{className:Da()(fi,"all-views"===f&&bi),"data-cy":"view",children:(0,r.jsxs)("div",{className:yi,children:[(0,r.jsxs)("div",{className:_i,"data-cy":"view-name",children:[v||("component"===m?(0,r.jsx)(i.bqT,{"data-cy":"icon-testing-type-component",className:Js}):(0,r.jsx)(i.kUU,{"data-cy":"icon-tested-view",className:Js})),p?(0,r.jsx)("span",{children:(0,r.jsx)("span",{className:Da()(xi,"text-gray-700"),children:n})}):(0,r.jsx)(s.N_,{"data-cy":f+"-link","data-view-id":f,to:b,className:ji,title:n,children:(0,r.jsx)("span",{className:xi,children:n})}),y]}),(0,r.jsx)(kn,Ui({},Ei(d),{ariaNoun:"element",ariaAdjectives:ki,setThreeCharacterFixedWidth:!0}))]})})};qi.displayName="ViewRow";var Vi=function(e){var t=e.views,n=e.impact,a=e.id,s=e.help,o=e.accessibilityTargetRunUrl,l=e.accessibilityBaseRunUrl,u=e.targetRunNumber,d=e.baseRunNumber,c=e.handleRowClick,m=e.expanded,v=e.categoryType,p=e.disableViewLinks,g=(0,J.A)(e,["views","impact","id","help","accessibilityTargetRunUrl","accessibilityBaseRunUrl","targetRunNumber","baseRunNumber","handleRowClick","expanded","categoryType","disableViewLinks"]);return(0,r.jsxs)("div",{"data-cy":"rules-table-container","data-failed-elements-section-id":v,className:Da()(ui,m&&di),children:[(0,r.jsx)("button",{"aria-expanded":m,"aria-controls":"branch-review-expanded-rule-"+a,"aria-label":"Expand views for rule "+s,"data-rule-row-id":a,onClick:function(){return null==c?void 0:c(v,a)},children:(0,r.jsxs)("div",{"data-cy":"rule-"+a,className:ci,children:[(0,r.jsxs)("div",{className:hi,children:[(0,r.jsx)(zi,{expanded:m}),(0,r.jsx)("div",{"data-cy":"rule-name",className:vi,children:s}),(0,r.jsxs)("div",{"data-cy":"severity-icon",className:ai,children:[(0,r.jsx)("div",{className:Js,children:(0,pe.y1)(n)}),(0,r.jsx)("div",{className:pi,children:n.charAt(0).toUpperCase()+n.slice(1)})]}),t.length>0&&(0,r.jsx)(Ma,{tooltipContent:t.length+" "+h()("view",t.length)+" "+h()("has",t.length)+" "+(v===Pi?"new failed elements":"resolved elements"),viewCount:t.length,size:"20"})]}),(0,r.jsx)(kn,Ui({},Ei(g.diffCounts),{ariaNoun:"element",ariaAdjectives:ki,setThreeCharacterFixedWidth:!0}))]})}),m&&(0,r.jsxs)("div",{className:gi,hidden:!m,id:"branch-review-expanded-rule-"+a,children:[v===Pi&&g.diffCounts.new>0?(0,r.jsx)(qi,{accessibilityTargetRunUrl:o,accessibilityBaseRunUrl:l,targetRunNumber:u,baseRunNumber:d,viewId:"all-views",id:"all-views",ruleId:a,url:"All views",testingType:"e2e",diffCounts:g.diffCounts,status:"EXISTING",icon:(0,r.jsx)(i.rhT,{className:Js}),disabled:p},"view-all-"+a):void 0,t.map(function(e){return(0,r.jsx)(qi,Ui({accessibilityTargetRunUrl:o,accessibilityBaseRunUrl:l,targetRunNumber:u,baseRunNumber:d,ruleId:a,disabled:p},e),e.url)})]})]})};Vi.displayName="RuleRow";var Gi=function(e,t,n){var a=function(e){var t="",n="";switch(e){case Pi:t="No new failed elements on run",n="when compared with run";break;
1case Bi:t="No failures detected on run",n="are resolved in run"}return{firstMsgHalf:t,secondMsgHalf:n}}(e),s=a.firstMsgHalf,i=a.secondMsgHalf;return(0,r.jsxs)(r.Fragment,{children:[s," ",(0,r.jsx)(Pe.CR,{className:Da()(Ci),run:e===Pi?n:t,openInNewTab:!0,displayBranchName:!1,tooltipDisabled:!0}),i," ",(0,r.jsx)(Pe.CR,{className:Da()(Ci),run:e===Pi?t:n,openInNewTab:!0,displayBranchName:!1,tooltipDisabled:!0})]})},Zi=function(e){var t=e.categoryType,n=e.elementCount,a=e.viewAllLink,o=e.additionalTitle,l=(0,s.Zp)(),u=null,d=null,c=null,m=null;switch(t){case Pi:u=(0,r.jsx)(i.BBf,{strokeColor:"red-400",fillColor:"transparent"}),d=Li[t],c=Ai[t],m=ei;break;case Bi:u=(0,r.jsx)(i.QwQ,{strokeColor:"jade-400",fillColor:"transparent"}),d=Li[t],c=Ai[t],m=ti;break;case Ti:d=Li[t],m=ni}return(0,r.jsxs)("div",{className:Da()($s,m),children:[(0,r.jsxs)("div",{className:Da()(oi,m),children:[u&&(0,r.jsx)("div",{className:Da()(ai,m),children:u}),(0,r.jsxs)("div",{className:"flex-auto overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center gap-[8px]",children:[(0,r.jsx)("span",{className:Da()(si,m),children:d}),(0,r.jsx)(xt.A,{color:"gray",className:Da()(ri,(n||0)>0&&m),size:"16","data-cy":t+"-element-count",children:n}),o]}),c&&(0,r.jsx)("div",{className:ii,title:c,children:c})]})]}),(0,r.jsx)("div",{className:li,children:a&&(0,r.jsx)(ot.Ay,{"data-cy":"view-all-failures-button",size:"32",variant:"outline-light",className:"bg-white",href:a,onClick:function(e){e.metaKey||(e.preventDefault(),l(a))},children:"View all"})})]})};Zi.displayName="FailedElementsTableHeader";var Wi=function(e){var t=e.categoryType,n=e.rules,a=e.targetRunNumber,i=e.baseRunNumber,o=e.activeRuleId,l=e.onRuleSelect,u=e.elementCount,d=e.viewAllLink,c=e.additionalTitle,m=je(),v=(0,s.RQ)("/projects/:slug/*"),p=null==v?void 0:v.pathnameBase,h=a&&p?p+"/runs/"+a+"/accessibility":"",g=i&&p?p+"/runs/"+i+"/accessibility":"";return(0,r.jsxs)("div",{"data-cy":t+"-table",className:Xs,"data-failed-elements-category-id":t,children:[(0,r.jsx)(Zi,{categoryType:t,elementCount:u||0,viewAllLink:d,additionalTitle:c}),function(){if(t===Ti)return null;if(!(null==n?void 0:n.length)){var e,s,u=null==m||null===(e=m.comparison)||void 0===e?void 0:e.baseRun,d=null==m||null===(s=m.comparison)||void 0===s?void 0:s.targetRun;return(0,r.jsx)("div",{className:Ri,children:Gi(t,u,d)})}return(0,r.jsx)(r.Fragment,{children:n.map(function(e){return(0,r.jsx)(Vi,Ui({categoryType:t,expanded:o===e.id,accessibilityTargetRunUrl:h,accessibilityBaseRunUrl:g,targetRunNumber:a,baseRunNumber:i,disableViewLinks:t===Bi,handleRowClick:l},e),e.id)})})}()]})};function Ki(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ki(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ki(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}Wi.displayName="FailedElementsTable";var Yi={critical:3,serious:2,moderate:1,minor:0},Xi=function(e){return e.sort(function(e,t){return e.impact===t.impact?e.diffCounts.new-t.diffCounts.new:Yi[t.impact]-Yi[e.impact]})},Ji=function(e,t){var n=t;return e===Pi&&(n=Qi({},t,{resolved:0})),e===Bi&&(n=Qi({},t,{new:0})),n},$i=function(e,t){return document.querySelector('[data-failed-elements-category-id="'+e+'"] [data-rule-row-id="'+t+'"]')},eo=function(e){var t=e.projectId,n=e.rules,o=e.targetRunNumber,l=e.baseRunNumber,u=e.totalElementInsightCounts,d=function(e){return(0,a.useMemo)(function(){var t=[],n=[];return null==e||e.forEach(function(e){var r=[],a=[];e.views.forEach(function(e){e.diffCounts.new>0&&r.push(Qi({},e,{diffCounts:Ji(Pi,e.diffCounts)})),e.diffCounts.resolved>0&&a.push(Qi({},e,{diffCounts:Ji(Bi,e.diffCounts)}))}),r.length>0&&t.push(Qi({},e,{diffCounts:Ji(Pi,e.diffCounts),views:r})),a.length>0&&n.push(Qi({},e,{diffCounts:Ji(Bi,e.diffCounts),views:a}))}),[{type:Pi,rules:Xi(t)},{type:Bi,rules:Xi(n)},{type:Ti,rules:[]}]},[e])}(n),c=(0,s.Zp)(),m=(0,s.zy)(),v=T.parse(m.search),p=v.ruleId||null,h=v.categoryId||null,g=a.useRef(null),f=a.useRef(null),b=a.useCallback(function(e){var t=e.categoryId,n=e.ruleId,r=e.viewId;c(decodeURI(m.pathname)+"?"+T.stringify(Qi({},v,{categoryId:t,ruleId:n,viewId:r})))},[m.pathname,c,v]),y=ds({insightSlug:"accessibility-failed-elements"});if((0,a.useLayoutEffect)(function(){if(p&&h&&null===y){var e=$i(h,p);e&&e.scrollIntoView({behavior:"instant"})}},[]),(0,a.useLayoutEffect)(function(){var e,t,n=ls("accessibility-failed-elements");if(n&&p&&((null===(e=g.current)||void 0===e?void 0:e.ruleId)!==p||(null===(t=g.current)||void 0===t?void 0:t.categoryId)===h)){var r,a=f.current,s=null===(r=$i(h,p))||void 0===r?void 0:r.getBoundingClientRect().top;if(a&&s){var i=a-s;i>0&&(n.scrollTop=n.scrollTop-i)}}p?(ss.set(p),is.set(h)):(ss.unset(),is.unset()),g.current={ruleId:p,categoryId:h}},[p,h]),!n||!o||!l)return null;if(!n.length)return(0,r.jsx)(rs,{variant:"accessibility"});var _=(null==u?void 0:u.newCount)||0,j=(null==u?void 0:u.resolvedCount)||0,x=(null==u?void 0:u.totalCount)||0;return(0,r.jsx)("div",{className:Ys,children:d.map(function(e){var n=e.type,a=e.rules,s=function(e,t){var n,r;e===h&&t===p||(n=e,r=t);var a=h&&p?$i(h,p):void 0,s=r&&n?$i(n,r):void 0;if(a&&s){var i=a.getBoundingClientRect().top,o=s.getBoundingClientRect().top;f.current=i<o?o:null}b({categoryId:n,ruleId:r})},u=null;switch(n){case Pi:u=(0,r.jsx)(Wi,{categoryType:n,rules:a,elementCount:_,targetRunNumber:o,baseRunNumber:l,activeRuleId:h===n?p:null,onRuleSelect:s,viewAllLink:_>
10?decodeURI(m.pathname)+"?"+T.stringify(Qi({},v,{viewId:"view-all",categoryId:void 0,ruleId:void 0})):void 0},n);break;case Bi:u=(0,r.jsx)(Wi,{categoryType:n,rules:a,elementCount:j,targetRunNumber:o,baseRunNumber:l,activeRuleId:h===n?p:null,onRuleSelect:s},n);break;case Ti:u=(0,r.jsx)(Wi,{categoryType:n,elementCount:x-_,additionalTitle:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.kYH,{fillColor:"gray-200",strokeColor:"transparent"}),(0,r.jsxs)("a",{href:"/projects/"+t+"/runs/"+o+"/accessibility/view-all?status=fail",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-[8px] font-normal",children:["See all failed elements on run #",o," ",(0,r.jsx)(i.EVB,{})]})]})},n)}return u})})};function to(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function no(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?to(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):to(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}eo.displayName="AccessibilityInsightBody";var ro=[{slug:"accessibility-failed-elements",label:"Failed elements",icon:(0,r.jsx)(i.BBf,{strokeColor:"gray-500",fillColor:"gray-50",secondaryStrokeColor:"red-400"})}],ao=function(){return{insight:(0,r.jsx)(Rs,{variant:"accessibility"}),items:(i=je(),o=i.project.id,l=null===(e=i.comparison)||void 0===e?void 0:e.baseRun,u=null===(t=i.comparison)||void 0===t?void 0:t.targetRun,d=null==l?void 0:l.id,c=null!=(n=null==u?void 0:u.id)?n:"",v=ie("accessibility"),p=!d||!c||!!v,h=se("accessibility"),g=h.baseRunReportAttempt,f=h.targetRunReportAttempt,b=(0,ye.Zl)(m.DIR,function(e){var t;return null==e||null===(t=e.run.runComparison)||void 0===t?void 0:t.discoveryComparisonOrPoll})({variables:{targetRunUuid:c,baseRunUuid:d,baseRunReportAttempt:g,targetRunReportAttempt:f},skip:p}),y=b.data,_=b.error,j=b.loading,x=null==y||null===(s=y.accessibilityInsights)||void 0===s?void 0:s.diffRules,R=null==x?void 0:x.diffCounts,C=null==x?void 0:x.rules,N=!!_,w=a.useMemo(function(){return!R||(null==v?void 0:v.status)||N?{totalCount:0}:Ei(R)},[R,null==v?void 0:v.status,N]),a.useMemo(function(){return ro.map(function(e){return no({},e,{insight:(0,r.jsx)(_s,{variant:"accessibility",isLoading:j,hasError:N,children:(0,r.jsx)(kn,no({},w,{ariaNoun:"element",ariaAdjectives:ki}))}),insightLong:(0,r.jsx)(_s,{variant:"accessibility",isLoading:j,hasError:N,children:(0,r.jsx)(Un,no({},w,{existingCount:w.totalCount-(w.newCount||0),isLoading:j,hasError:N}))}),insightBody:(0,r.jsx)(Fs,{errorMsg:null==_?void 0:_.message,hasError:N,isLoading:j,variant:"accessibility",children:(0,r.jsx)(eo,{projectId:o,targetRunNumber:null==u?void 0:u.buildNumber,baseRunNumber:null==l?void 0:l.buildNumber,totalElementInsightCounts:w,rules:C})})})})},[null==_?void 0:_.message,N,w,j,C,null==u?void 0:u.buildNumber,null==l?void 0:l.buildNumber,o]))};var e,t,n,s,i,o,l,u,d,c,v,p,h,g,f,b,y,_,j,x,R,C,N,w};function so(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var io=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a={tests:Sa.apply(void 0,n),uiCoverage:Qs.apply(void 0,n),accessibility:ao.apply(void 0,n)};return e.map(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?so(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):so(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e,{},a[e.slug])})};const oo={changeInsights:"module-ChangeInsights__changeInsights__KmZ9k",insightList:"module-ChangeInsights__insightList__MHv6M",insightListMainTitle:"module-ChangeInsights__insightListMainTitle__YeBoS",insightListSubTitle:"module-ChangeInsights__insightListSubTitle__SKZ6l",insightListSubTitleContainer:"module-ChangeInsights__insightListSubTitleContainer__xzh3V",header:"module-ChangeInsights__header__Z0VRC",titleLabel:"module-ChangeInsights__titleLabel__tC07K",insightListItem:"module-ChangeInsights__insightListItem__dmyVF",activeIndicator:"module-ChangeInsights__activeIndicator__TLxkx",labelContainer:"module-ChangeInsights__labelContainer__eieUP",selectedEnabled:"module-ChangeInsights__selectedEnabled__rHgkP",active:"module-ChangeInsights__active__hyKGU",insightDetails:"module-ChangeInsights__insightDetails__cwK_y",titleContainer:"module-ChangeInsights__titleContainer__DFjKP",titleIcon:"module-ChangeInsights__titleIcon__NNzOC"};function lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}var uo=function(e){var t=e.onNavigate,n=e.categories,l=e.activeInsight,u=(0,s.zy)(),d=u.pathname,c=u.search,m=T.parse(c);
1return(0,r.jsx)("nav",{className:oo.insightList,"aria-label":"Change Insights",children:n.map(function(e,u){return(0,r.jsxs)(a.Fragment,{children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:oo.insightListSubTitleContainer,children:[(0,r.jsxs)("span",{className:oo.insightListSubTitle,"data-cy":"insight-spec-list-category-title",children:[e.icon,e.label,e.hasPartialReport&&(0,r.jsx)(i.GCX,{strokeColor:"orange-400",fillColor:"transparent","data-cy":e.slug+"-warningIcon"})]}),e.insight]}),(0,r.jsx)("ul",{children:e.items.map(function(e){var n,a;if(e.disabled)return null;var i=l===e.slug,u=decodeURI(d)+"?"+T.stringify(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},null!=(n=null===(a=e.reduceQueryParams)||void 0===a?void 0:a.call(e,m))?n:m,{insight:e.slug}));return(0,r.jsx)("li",{children:(0,r.jsxs)(s.N_,{className:(0,o.A)(oo.insightListItem,oo.selectedEnabled,i&&oo.active),to:u,"data-insight-type":e.slug,onClick:function(n){var r,a;n.preventDefault(),(null==(r=null===(a=e.beforeNavigate)||void 0===a?void 0:a.call(e))||r)&&t(u)},children:[(0,r.jsx)("div",{className:oo.activeIndicator}),(0,r.jsxs)("div",{className:oo.labelContainer,title:e.label,children:[i&&e.iconActive?e.iconActive:e.icon,(0,r.jsx)("span",{className:oo.typeLabel,children:e.label})]}),e.insight]})},e.slug)})})]}),u<n.length-1&&(0,r.jsx)("hr",{})]},e.slug)})})};uo.displayName="ChangeInsightsMenu";var co=n(64750);const mo="module-InteractivityViewDiff__diffWrapper__kDQa3";var vo=n(38594),po=n(50941);n(37729);function ho(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function go(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ho(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ho(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var fo=function(e,t){var n,r,s,i,o=(0,a.useMemo)(function(){var t,n,r,a,s=(null==e||null===(t=e.elements)||void 0===t?void 0:t.tested)||[],i=(null==e||null===(n=e.elements)||void 0===n?void 0:n.untested)||[],o=(null==e||null===(r=e.groups)||void 0===r?void 0:r.tested)||[],l=(null==e||null===(a=e.groups)||void 0===a?void 0:a.untested)||[],u=[].concat(s,i),d=[].concat(o,l),c=[].concat(u,d),m=new Map(c.map(function(e){return"Discovery_InteractivityInsights_SummaryGroup"===e.__typename?[e.groupId,go({},e,{inGroup:!1})]:[e.id,go({},e,{inGroup:!1,groupId:""})]}));d.forEach(function(e){e.elementIds.forEach(function(t){var n=m.get(t);n&&(n.inGroup=!0,n.groupId=e.groupId)})});var v=function(e){var t=e.reduce(function(e,t){return e.push.apply(e,t.snapshots),e},[]);return Array.from(new Set(t))}(u);return{allViewItemsMap:m,allSnapshotIds:v}},[null==e||null===(n=e.elements)||void 0===n?void 0:n.tested,null==e||null===(r=e.elements)||void 0===r?void 0:r.untested,null==e||null===(s=e.groups)||void 0===s?void 0:s.tested,null==e||null===(i=e.groups)||void 0===i?void 0:i.untested]),l=o.allViewItemsMap,u=o.allSnapshotIds,d=(0,Ba.nT)(l),c=d.testedElements,m=d.untestedElements,v=d.testedGroups,p=d.untestedGroups,h=(0,a.useMemo)(function(){var e=[].concat(c),t=[].concat(m),n=[].concat(v),r=[].concat(p),a=e.filter(function(e){return"NAVIGABLE"===e.hrefType}),s=n.filter(function(e){return"ANCHOR HREF"===e.rule}),i=(0,Ba.nq)(a,s),o=i.protocols,l=i.hostnamesWithPort,u=1===o.size,d=1===l.size,h=(0,Ba.g$)({elements:e,groups:n,allLinksHaveSameProtocol:u,allLinksHaveSameHostAndPort:d,allLinksHaveSameViewProtocol:!1,allLinksHaveSameViewHostAndPort:!1});e=h.finalElements,n=h.finalGroups;var g=t.filter(function(e){return"NAVIGABLE"===e.hrefType}),f=r.filter(function(e){return"ANCHOR HREF"===e.rule}),b=(0,Ba.nq)(g,f),y=b.protocols,_=b.hostnamesWithPort,j=1===y.size,x=1===_.size,R=(0,Ba.g$)({elements:t,groups:r,allLinksHaveSameProtocol:u&&j,allLinksHaveSameHostAndPort:d&&x,allLinksHaveSameViewProtocol:!1,allLinksHaveSameViewHostAndPort:!1});return{formattedTestedElements:e,formattedUntestedElements:t=R.finalElements,formattedTestedGroups:n,formattedUntestedGroups:r=R.finalGroups}},[c,m,v,p]),g=h.formattedTestedElements,f=h.formattedUntestedElements,b=h.formattedTestedGroups,y=h.formattedUntestedGroups,_=(0,Ba.Mm)({formattedTestedElements:g,formattedUntestedElements:f,formattedTestedGroups:b,formattedUntestedGroups:y,snapshotId:t});return(0,a.useMemo)(function(){return{allViewItemsMap:l,allSnapshotIds:u,elements:{tested:g,untested:f},groups:{tested:b,untested:y},snapshot:_}},[l,u,_,g,f,b,y])},bo="UI Coverage",yo=(0,r.jsx)(i.BTO,{strokeColor:"gray-600",className:"ml-4"}),_o=function(e){var t,n,s=e.itemId,i=e.snapshotId,o=e.orgId,l=e.viewerIsMember,u=e.baseRunUuid,d=e.targetRunUuid,c=e.projectSlug,v=e.backButton,p=e.cypressAiDisabled,h=a.useState(!1),g=h[0],f=h[1],b=(0,Ba.ok)(),y=b.setSearchParams,_="true"===(0,b.getSearchParam)("filterBySnapshot"),j=ie("ui-coverage"),x=se("ui-coverage"),R=x.baseRun
1ReportAttempt,C=x.targetRunReportAttempt,N=vo.q.isEnabled("ui-coverage-snapshot-packing",{projectId:c}),w=(0,ye.Zl)(m.sul,function(e){var t,n;return null==e||null===(t=e.run)||void 0===t||null===(n=t.runComparison)||void 0===n?void 0:n.discoveryComparisonOrPoll})({variables:{baseRunUuid:u,targetRunUuid:d,baseRunReportAttempt:R,targetRunReportAttempt:C,useSnapshotPacking:N},skip:!u||!d||!!j}),I=w.data,S=w.loading,O=w.error,k=a.useMemo(function(){var e;return(0,po.k)(null==I||null===(e=I.interactivityInsights)||void 0===e?void 0:e.summary)},[I]),P=fo(k,i),B=P.allViewItemsMap,T=P.allSnapshotIds,L=P.elements,A=P.groups,E=P.snapshot,D=B.size>0,M=(0,Ba.sd)(s,B,i,y,S,D,T);return(0,r.jsxs)("div",{className:mo,"data-cy":"interactivity-view-diff",children:[g&&(0,r.jsx)(us.bD,{backButton:v,viewIcon:yo,viewName:bo}),(0,r.jsx)(Fs,{variant:"ui-coverage",isLoading:S,errorMsg:null==O?void 0:O.message,hasError:!!O||(null==I||null===(t=I.interactivityInsights)||void 0===t?void 0:t.summary)&&!D,onHasEmptyState:function(e){f(e)},hidePartialReportInsight:!0,children:(0,r.jsx)(co.X,{itemId:s,snapshotId:i,snapshotIds:M,orgId:o,projectSlug:c,runUuid:null!=d?d:"",viewerIsMember:l,filterBySnapshot:_,hideReportIssueButton:!0,itemCountIfFilteredBySnapshot:(null==E?void 0:E.elements.tested.length)+(null==E?void 0:E.elements.untested.length)+(null==E?void 0:E.groups.tested.length)+(null==E?void 0:E.groups.untested.length),setSearchParams:y,elements:_?E.elements:L,groups:_?E.groups:A,backButton:v,headerName:bo,headerIcon:yo,reportAttempt:C,testGenerationCompatible:null==I||null===(n=I.interactivityInsights)||void 0===n?void 0:n.testGenerationCompatible,cypressAiDisabled:p})})]})};_o.displayName="InteractivityViewDiff";var jo=n(59126),xo=function(e){var t=e.orgId,n=e.projectSlug,s=e.baseRunUuid,o=e.baseBuildNumber,l=e.targetRunUuid,u=e.targetRunNumber,d=e.viewId,c=e.backButton,m=a.useState(!1),v=m[0],p=m[1],h=a.useState(!1),g=h[0],f=h[1],b=se("accessibility"),y=b.baseRunReportAttempt,_=b.targetRunReportAttempt;return(0,r.jsxs)("div",{className:mo,"data-cy":"accessibility-view-diff",children:[g&&(0,r.jsx)(us.bD,{backButton:c,viewIcon:(0,r.jsx)(i.BTO,{strokeColor:"gray-600",className:"ml-4"}),viewName:"Accessibility"}),(0,r.jsx)(Fs,{variant:"accessibility",hasError:v,hidePartialReportInsight:!0,onHasEmptyState:function(e){f(e)},children:(0,r.jsx)(jo.A,{variant:"comparison",orgId:t,projectSlug:n,runUuid:null!=l?l:"",buildNumber:u,baseRunUuid:s,baseBuildNumber:o,viewId:d||"view-all",onErrorQuerying:function(){p(!0)},onEmptyState:function(e){f(e)},hideReportIssueButton:!0,backButton:c,baseRunReportAttempt:y,reportAttempt:_})})]})};function Ro(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ro(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ro(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}xo.displayName="AccessibilityViewDetails";var No=function(){var e,t,n=(0,s.zy)(),o=(0,s.Zp)(),l=T.parse(n.search),u=a.createRef(),d=(0,Ba.ok)().getSearchParam,c=je(),m=c.comparison,v=(0,a.useRef)(null),p=oe("accessibility"),h=oe("ui-coverage"),g=(t=null==p?void 0:p.hasPartialReport,{slug:"accessibility",label:(0,r.jsx)("span",{"data-cy":"accessibility-insight-label",style:{display:"flex",alignItems:"center",gap:"4px"},children:(0,r.jsx)("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:"Accessibility"})}),enabled:!0,icon:(0,r.jsx)(i.dSi,{strokeColor:"gray-600",fillColor:"gray-50"}),insights:(0,r.jsx)("div",{}),items:ro,hasPartialReport:t}),f=function(e){return{slug:"uiCoverage",label:(0,r.jsx)("span",{"data-cy":"uicov-insight-label",style:{display:"flex",alignItems:"center",gap:"4px"},children:(0,r.jsx)("span",{style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:"UI Coverage"})}),icon:(0,r.jsx)(i.BTO,{strokeColor:"gray-600"}),insights:(0,r.jsx)("div",{}),items:qs,enabled:!0,hasPartialReport:e}}(null==h?void 0:h.hasPartialReport),b=[wa,f,g],y=b.filter(function(e){return e.enabled}),_=(0,a.useCallback)(function(e,t,r){void 0===t&&(t={}),void 0===r&&(r=function(e){return e}),o(decodeURI(n.pathname)+"?"+T.stringify(Co({},r(l),{insight:e})),t)},[o,n.pathname,l]),j=function(e){var t=e.baseRun,n=e.targetRun,r=e.viewDiff;return t&&n?r():(_(x[0].items[0].slug,{replace:!0},function(e){return{baseRun:e.baseRun,changeRun:e.changeRun,changeRequest:e.changeRequest}}),null)},x=io(b,c,_,l,u).filter(function(e){return e.enabled}),R="string"==typeof l.insight?l.insight:void 0,C=x.find(function(e){return e.items.some(function(e){return e.slug===R})}),N=null==C?void 0:C.items,w=null==N?void 0:N.find(function(e){return e.slug===R&&!e.disabled}),I=a.useMemo(function(){return C&&w?w.titleRow?w.titleRow:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:o
1o.titleContainer,children:[C.icon,(0,r.jsx)("span",{className:oo.titleLabel,children:C.label}),(0,r.jsx)(i.UMd,{strokeColor:"gray-300"}),w.icon,(0,r.jsx)("h3",{className:oo.titleLabel,children:w.label})]}),null==w?void 0:w.insightLong]}):null},[w,C]);if((0,a.useLayoutEffect)(function(){v.current&&(v.current.scrollTop=0)},[null==w?void 0:w.slug]),a.useEffect(function(){R&&w||_(x[0].items[0].slug,{replace:!0})},[R,w,_,x]),!R||!w)return null;var S=c.comparison||{},O=S.baseRun,k=S.targetRun,P=d("itemId"),B=d("snapshotId");if((P||B)&&(null==w?void 0:w.slug.includes("uicov")))return j({baseRun:O,targetRun:k,viewDiff:function(){return(0,r.jsx)(_o,{itemId:P,snapshotId:B,orgId:c.project.organizationInfo.id,projectSlug:c.project.id,viewerIsMember:c.project.organizationInfo.viewerIsMember,baseRunUuid:O.id,targetRunUuid:k.id,backButton:{to:decodeURI(n.pathname)+"?"+T.stringify(Co({},l,{itemId:void 0,snapshotId:void 0,filterBySnapshot:void 0})),label:"Back to "+w.label},cypressAiDisabled:c.project.organizationInfo.cypressAiDisabled})}});var L=l.viewId;if((L||B)&&(null==w?void 0:w.slug.includes("accessibility"))){var A=ss.get()||void 0,E=is.get()||void 0;return j({baseRun:O,targetRun:k,viewDiff:function(){return(0,r.jsx)(xo,{viewId:L,orgId:c.project.organizationInfo.id,projectSlug:c.project.id,baseBuildNumber:O.buildNumber,baseRunUuid:O.id,targetRunNumber:k.buildNumber,targetRunUuid:k.id,backButton:{to:decodeURI(n.pathname)+"?"+T.stringify(Co({},l,{ruleId:A,categoryId:E,itemId:void 0,viewId:void 0,targetId:void 0,snapshotId:void 0,filterBySnapshot:void 0,impact:void 0,ruleset:void 0,status:void 0})),label:"Back to "+w.label}})}})}return(0,r.jsxs)("div",{className:oo.changeInsights,children:[(0,r.jsx)("div",{className:oo.insightListMainTitle,children:"Branch Review"}),(0,r.jsx)("div",{className:oo.header,"data-cy":"insight-spec-list-header",children:I}),(0,r.jsx)(uo,{categories:m?x:y,activeInsight:R,onNavigate:function(e){o(e),u.current&&u.current.scrollToRow(0)}}),(0,r.jsx)("div",Co({ref:v,className:oo.insightDetails,"data-cy":"change-insights-body-"+w.slug},(e={},e[os]=w.slug,e),{children:null==w?void 0:w.insightBody}))]})};No.displayName="ChangeInsights";const wo={branchReviewContainer:"module-BranchReview__branchReviewContainer__BWOk1",hasError:"module-BranchReview__hasError__zcHSf"};function Io(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function So(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach(function(t){(0,B.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Oo=function(e){var t,n,i,l=e.isActive,u=e.branchName,d=e.projectId,c=e.latestRunCommitSha,p=(0,s.zy)(),h=(0,s.Zp)(),f=T.parse(p.search),b=(0,a.useRef)(),y=(0,m.g24)({variables:{projectId:d,input:{targetBranchName:u},branchIsUnknown:u===K.u},skip:!l}),_=y.data,j=y.loading,x=null==_||null===(t=_.project)||void 0===t?void 0:t.changeRequests,R=null!=(n=null==x?void 0:x.findIndex(function(e){return e.number===Number(f.changeRequest)}))?n:-1,C=f.baseRun,N=f.changeRun;x&&(i=x[R])&&(b.current=i.number);var w=function(e){var t,n,r,s,i,o,l,u,d,c,v,p,h,g,f,b=e.project,y=e.branchName,_=e.changeRequest,j=e.changeRequestIndex,x=e.baseRunNumber,R=e.targetRunNumber,C=e.segmentSource,N=(0,m.hqS)()[0],w=(0,a.useRef)(null),I=-1!==j,S=!!x,O=!!R,k=!b||!I&&S,P=y===K.u?null:y;O&&(f={targetBuildNumber:Number(R)});var B=(0,m.Mg1)({variables:{projectId:null==b?void 0:b.id,runAttributes:Y({targetCommitSha:null==_?void 0:_.targetCommitSha,targetBranchName:P,baseCommitSha:null==_?void 0:_.baseCommitSha,baseBranchName:null==_?void 0:_.baseBranch,isChangeRequestComparison:!!_},f)},skip:k}),T=null==B||null===(t=B.data)||void 0===t||null===(n=t.project)||void 0===n?void 0:n.comparisonRuns,L=(0,m.mno)({variables:{buildNumber:x,projectId:null==b?void 0:b.id},skip:!b||I||!S}),A=(0,m.mno)({variables:{buildNumber:R,projectId:null==b?void 0:b.id},skip:!b||I||!O}),E=null!=(r=null==T||null===(s=T.baseRun)||void 0===s?void 0:s.id)?r:null==L||null===(i=L.data)||void 0===i||null===(o=i.runByBuildNumber)||void 0===o?void 0:o.id,D=null!=(l=null==T||null===(u=T.targetRun)||void 0===u?void 0:u.id)?l:(null==A||null===(d=A.data)||void 0===d||null===(c=d.runByBuildNumber)||void 0===c||null===(v=c.commit)||void 0===v?void 0:v.branch)===P?null==A||null===(p=A.data)||void 0===p||null===(h=p.runByBuildNumber)||void 0===h?void 0:h.id:void 0,M=!b||!D&&!E,F=(0,m.S4N)({variables:{targetRunUuid:D||E||"",baseRunUuid:!D&&E?null:E,uniqueGroupsLimit:W.M},skip:M}),U=null==F||null===(g=F.data)||void 0===g?void 0:g.run,z=((null==U?void 0:U.runComparison)||{}).baseRun,H="RUNNING"===(null==U?void 0:U.status)||"RUNNING"===(null==z?void 0:z.status),q=!(!H||U&&"RUNNING"===U.status||z&&"RUNNING"===z.status);q&&F.refetch(),a.useLayoutEffect(function(){var e;if(H&&!q)return null===(e=F.startPolling)||void 0===e||e.call(F,2e4),function(){var e;null===(e=F.stopPolling)||void 0===e||e.call(F)}},[H,q,F]);var V=B.loading||F.loading||A.loading||L.loading,G=a.useMemo(function(){var e,t;if(V||!b)return w.current;var n,r=(null==U?void 0:U.runComparison)||{},a=r.baseRun,s=r.testInsights,i={baseRun:null!=a?a:void 0,targetRun:null!=U?U:void 0,foundBaseRun:!!a,foundTargetRun:!!U,baseRunIsFinalized:"RUNNING"!==(null==a?void 0:a.status),targetRunIsFinalized:"RUNNING"!==(null==U?void 0:U.status),fallbackRunUsedForBase:null!=(e=null==T?void 0:T.fallbackRunUsedForBase)?e:void 0,fallbackRunUsedForTarget:null!=(t=null==T?void 0:T.fallbackRunUsedForTarget)?t:void 0,insights:s};null!==(null==T?void 0:T.targetRun)&&D||!U||null!==a||(i={baseRun:U,targetRun:void 0,foundBaseRun:!0,foundTargetRun:!1,baseRunIsFinalized:"RUNNING"!==(null==U?void 0:U.status),targetRunIsFinalized:!0,fallbackRunUsedForBase:null!=(n=null==T?void 0:T.fallbackRunUsedForTarget)?n:void 0,fallbackRunUsedForTarget:void 0,insights:null});var o={project:b,changeRequest:_,comparison:i};return w.current=o,o},[b,V,_,U,D,T]),Z=a.useRef();return a.useEffect(function(){var e=function(e){var t,n,r;if(!e||!e.comparison)return null;var a=e.project,s=e.changeRequest,i=e.comparison,o=i.fallbackRunUsedForTarget;return{orgId:a.organizationInfo.id,projectId:a.id,prNumber:null==s?void 0:s.number,prTitle:null==s?void 0:s.title,prStatus:null==s?void 0:s.state,prBaseBranch:null==s?void 0:s.baseBranch,prBaseSha:null==s?void 0:s.baseCommitSha,prFeatureBranch:null==s?void 0:s.targetBranch,prFeatureSha:null==s?void 0:s.targetCommitSha,baseRunId:null===(t=i.baseRun)||void 0===t?void 0:t.id,featureRunId:o?null:null===(n=i.targetRun)||void 0===n?void 0:n.id,fallbackFeatureRunId:o?null===(r=i.targetRun)||void 0===r?void 0:r.id:null}}(G);e&&Z.current!==e.prNumber&&(Z.current=e.prNumber,N({variables:{input:Y({},e,{source:C})}}))},[G,N,C]),{branchReviewContextValue:G,loading:V||q,error:B.error||F.error,isPolling:H&&!q}}({project:null==_?void 0:_.project,branchName:u,changeRequest:i,
1changeRequestIndex:R,baseRunNumber:C,targetRunNumber:N,segmentSource:"branch_review"}),I=w.branchReviewContextValue,S=w.loading,O=w.error,k=w.isPolling,P=function(e){var t,n,r,s,i,o,l,u,d,c,v,p,h,g,f,b,y,_=e.branchReviewContextValue,j=e.isLoading,x=e.hasError,R=e.isPolling,C=a.useRef(),N=(0,H.I)(),w=N.uiCovEnabled,I=N.accessibilityEnabled,S=function(e){var t,n,r,a=e.intelligenceEnabled,s=e.branchReviewContextValue,i=e.hasError,o=e.isLoading,l=e.isPolling;if(!a)return{skip:!0,skipReason:{a11yEmptyState:{source:"baseAndTarget",status:"disabled"},uiCovEmptyState:{source:"baseAndTarget",status:"disabled"}}};if(i)return{skip:!0,skipReason:{a11yEmptyState:{source:"cloud",status:"error"},uiCovEmptyState:{source:"cloud",status:"error"}}};if(o||l&&(null==s||null===(t=s.comparison)||void 0===t?void 0:t.targetRun)){var u=o?"loading":"running";return{skip:!0,skipReason:{a11yEmptyState:{source:"cloud",status:u},uiCovEmptyState:{source:"cloud",status:u}}}}var d=!(null==s||null===(n=s.comparison)||void 0===n?void 0:n.baseRun),c=!(null==s||null===(r=s.comparison)||void 0===r?void 0:r.targetRun),m=d&&c;return m||d||c?{skip:!0,skipReason:{a11yEmptyState:{source:m?"baseAndTarget":d?"base":"target",status:"run-not-selected"},uiCovEmptyState:{source:"target",status:"run-not-selected"}}}:{skip:!1,skipReason:{}}}({intelligenceEnabled:w||I,branchReviewContextValue:_,hasError:x,isLoading:j,isPolling:R}),O=S.skip,k=S.skipReason,P=(0,m.kE4)({variables:{baseRunUuid:null==_||null===(t=_.comparison)||void 0===t||null===(n=t.baseRun)||void 0===n?void 0:n.id,targetRunUuid:null!=(r=null==_||null===(s=_.comparison)||void 0===s||null===(i=s.targetRun)||void 0===i?void 0:i.id)?r:"",interactivityFlagEnabled:w,accessibilityFlagEnabled:I},skip:O}),B=(0,X.E2)({accessibilityResults:null==P||null===(o=P.data)||void 0===o||null===(l=o.run)||void 0===l?void 0:l.accessibilityResults,uiCoverageResults:null==P||null===(u=P.data)||void 0===u||null===(d=u.run)||void 0===d?void 0:d.uiCoverageResults}),T=(0,X.E2)({accessibilityResults:null==P||null===(c=P.data)||void 0===c||null===(v=c.run)||void 0===v||null===(p=v.runComparison)||void 0===p||null===(h=p.baseRun)||void 0===h?void 0:h.accessibilityResults,uiCoverageResults:null==P||null===(g=P.data)||void 0===g||null===(f=g.run)||void 0===f||null===(b=f.runComparison)||void 0===b||null===(y=b.baseRun)||void 0===y?void 0:y.uiCoverageResults}),L=B||T,A=P.startPolling,E=P.stopPolling;return a.useLayoutEffect(function(){if(L)return null==A||A(5e3),function(){null==E||E()}},[L,A,E]),{appQualityStatusContextValue:a.useMemo(function(){var e,t,n,r,a,s,i;if(O)return C.current=k,k;if(P.loading&&!L)return C.current?C.current:{a11yEmptyState:{source:"query",status:"loading"},uiCovEmptyState:{source:"query",status:"loading"}};if(P.error)return Re(null===(i=P.error)||void 0===i?void 0:i.message)?{a11yEmptyState:{source:"query",status:"operation-unsupported"},uiCovEmptyState:{source:"query",status:"operation-unsupported"}}:{a11yEmptyState:{source:"query",status:"error"},uiCovEmptyState:{source:"query",status:"error"}};var o=null!=(e=null==P||null===(t=P.data)||void 0===t?void 0:t.run)?e:void 0,l=null!=(n=null==P||null===(r=P.data)||void 0===r||null===(a=r.run)||void 0===a||null===(s=a.runComparison)||void 0===s?void 0:s.baseRun)?n:void 0;return{baseRun:l,targetRun:o,a11yEmptyState:Ie({baseRun:l,targetRun:o,productKey:te,productEnabled:I}),a11yPartialReport:Se({baseRun:l,targetRun:o,productKey:te}),uiCovEmptyState:Ie({baseRun:l,targetRun:o,productKey:ne,productEnabled:w}),uiCovPartialReport:Se({baseRun:l,targetRun:o,productKey:ne})}},[P.loading,P.error,P.data,L,O,k,I,w])}}({branchReviewContextValue:I,isLoading:j||S,hasError:!!O,isPolling:!!k}),B=P.appQualityStatusContextValue;if(!l)return null;if(x&&x.length&&!i&&!C&&!N){var L;if(b.current)x.findIndex(function(e){return e.number===b.current})>=0&&(L=b.current);if(!L){var E=x[0];(["open","draft"].includes(E.state)||E.targetCommitSha===c)&&(L=E.number)}if(L)return(0,r.jsx)(s.C5,{replace:!0,to:decodeURI(p.pathname)+"?"+T.stringify(So({},f,{baseRun:void 0,changeRun:void 0,changeRequest:L}))})}if(i&&C&&N)return(0,r.jsx)(s.C5,{replace:!0,to:decodeURI(p.pathname)+"?"+T.stringify(So({},f,{baseRun:void 0,changeRun:void 0}))});if(!(null==x?void 0:x.length)&&(null==I?void 0:I.comparison)&&Number(f.changeRequest))return(0,r.jsx)(s.C5,{replace:!0,to:decodeURI(p.pathname)+"?"+T.stringify(So({},f,{changeRequest:void 0}))});var D=function(){throw new Error(null==O?void 0:O.message)},M=null;if(I){var F=!j&&!(!S||k);M=(0,r.jsx)(_e.Provider,{value:I,children:(0,r.jsxs)(re.Provider,{value:B,children:[(0,r.jsx)(In,{branchName:u,changeRequests:x,activeChangeRequestIndex:R,loadingChangeRequestList:j,onSelectRun:function(e,t){var n,r;h(decodeURI(p.pathname)+"?"+T.stringify(So({},f,{changeRequest:void 0}
1,"base"===e?{baseRun:t,changeRun:null===(n=I.comparison.targetRun)||void 0===n?void 0:n.buildNumber}:{},{},"target"===e?{baseRun:null===(r=I.comparison.baseRun)||void 0===r?void 0:r.buildNumber,changeRun:t}:{})))},onSelectChangeRequest:function(e){var t=null==x?void 0:x[e];t&&(b.current=t.number,h(decodeURI(p.pathname)+"?"+T.stringify(So({},f,{baseRun:void 0,changeRun:void 0,changeRequest:t.number,insight:void 0,test:void 0}))))}}),(0,r.jsx)(g.YM,{className:(0,o.A)(wo.branchReviewContainer,wo.changeInsightsContainer,O&&wo.hasError),active:F,fadeOnlyOnDeactivate:!0,spinner:(0,r.jsx)(A.A,{}),children:(0,r.jsxs)(v.A,{children:[!!O&&(0,r.jsx)(D,{}),(0,r.jsx)(No,{},""+f.changeRequest)]},""+!!O)})]})})}return(0,r.jsx)("div",{className:wo.branchReviewContainer,children:(0,r.jsx)(g.YM,{className:wo.branchReviewContainer,active:!M,fadeOnlyOnDeactivate:!0,spinner:(0,r.jsx)(A.A,{}),children:(0,r.jsx)(v.A,{children:M})})})};Oo.displayName="BranchReview";const ko="module-BranchSummary__tabControlContainer__h_ZVU",Po="module-BranchSummary__branchSummaryContainer__n3XMj",Bo="module-BranchSummary__tabContentContainer__NyZD2",To="module-BranchSummary__tab__MaDPq";var Lo=function(){return(0,r.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,r.jsx)("path",{d:"M12 8L15 5M15 5L12 2M15 5H8M4 14L1 11M1 11L4 8M1 11H8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})};Lo.displayName="IconArrowsOpposing";var Ao=function(e){var t=e.projectId,n=e.branchName,a=decodeURIComponent(n),p=a===K.u,h=(0,m.k7A)({variables:{projectId:t,branchName:p?null:a}}),g=h.data,f=h.loading,b=(0,s.RQ)("/projects/:projectId/branches/:branchName/:activeTab");if(f)return(0,r.jsx)(c.T,{showLoaders:!0});if(0===(null==g?void 0:g.project.runs.nodes.length))return d.A.setNotification("No runs found for branch "+a+"."),(0,r.jsx)(s.C5,{to:"/projects/"+t+"/branches",replace:!0});if(!b||"overview"===b.params.activeTab)return(0,r.jsx)(s.C5,{to:"/projects/"+t+"/branches/"+n+"/review",replace:!0});var y="review"===b.params.activeTab,_="runs"===b.params.activeTab;return(0,r.jsx)("div",{className:Po,children:(0,r.jsxs)(v.A,{children:[(0,r.jsx)(P,{branchName:a,branchInfo:g,children:(0,r.jsxs)(u.I,{className:ko,children:[(0,r.jsxs)(l.f,{url:"/projects/"+t+"/branches/"+n+"/review",active:y,className:(0,o.A)(To),children:[(0,r.jsx)(Lo,{}),"Review"]}),(0,r.jsxs)(l.f,{url:"/projects/"+t+"/branches/"+n+"/runs",active:_,className:To,children:[(0,r.jsx)(i._Uc,{}),"Runs"]})]})}),(0,r.jsxs)("div",{className:Bo,children:[(0,r.jsx)(Oo,{isActive:y,projectId:t,branchName:a,latestRunCommitSha:null==g?void 0:g.project.runs.nodes[0].commit.sha}),(0,r.jsx)(G,{isActive:_,projectId:t,branchName:p?null:a})]})]})})};Ao.displayName="BranchSummary";const Eo=Ao},31315:(e,t,n)=>{n.d(t,{n:()=>l});var r=n(31085),a=n(20467),s=n(14041),i=n(99870),o=n.n(i),l=function(e){var t=e.renderCollapse,n=e.renderToggle,i=e.shouldBeCollapsed,l=void 0!==i&&i,u=e.className,d=e.iconPosition,c=void 0===d?"left":d,m=e.getIcon,v=(0,s.useState)(l),p=v[0],h=v[1],g=(0,r.jsx)(a.In,{name:p?"chevron-down":"chevron-up",className:"accordion__chevron"});return m&&(g=m(p)),(0,r.jsxs)("div",{className:o()("accordion",u),children:[(0,r.jsxs)("button",{className:"accordion__toggle","data-cy":"accordion-toggle",onClick:function(){return h(!p)},children:["left"===c&&g,n(),"right"===c&&g]}),!p&&(0,r.jsx)("div",{children:t()})]})};l.displayName="Accordion"},1117:(e,t,n)=>{n.d(t,{X:()=>R});n(96152),n(85146),n(21555),n(34237);var r=n(31085),a=n(20467),s=n(14041),i=n(35118),o=n(65398),l=n.n(o),u=n(20053),d=n(93954);var c=n(61123),m=n(17885),v=n(22163);const p="module-TestResultAttempt__multiplesAttempts__nr0B7",h="module-TestResultAttempt__singleAttempt__yWKIE",g="module-TestResultAttempt__iconStatus__WkMEu",f="module-TestResultAttempt__attempt__yXrqe",b="module-TestResultAttempt__line__x0qYo",y="module-TestResultAttempt__error__aEW1H",_="module-TestResultAttempt__branchReviewStyle__zeUxb",j="module-TestResultAttempt__isBottomAttempt__wiaMB";var x=function(e){var t=e.frag,n=e.attemptNumber,o=e.testResultId,u=e.testResultAttemptId,p=e.name,h=e.errorName,g=e.message,b=e.shouldBeCollapsed,_=e.impactedTestCasesCount,j=e.codeFrame,x=e.state,R=e.onScreenshotClick,C=e.screenshot,N=e.onVideoClick,w=e.onReplayClick,I=e.videoTimestamp,S=e.hasMultipleAttempts,O=(0,m.e)(null==t?void 0:t.capture),k=function(e){var t,n,r,a,i=e.testResultId,o=e.testResultAttemptId,l=Boolean(o),u=(0,s.use
1State)(!1),c=u[0],m=u[1],v=(0,s.useState)(!1),p=v[0],h=v[1];(0,s.useEffect)(function(){m(!1)},[]);var g=(0,d.__9)(),f=g[0],b=g[1],y=b.data,_=b.loading;return(0,s.useEffect)(function(){y&&i&&!c&&(m(!0),h(!0))},[y,i,c]),{isLoading:_&&!y,isExpanded:p,handleClick:function(){c?h(!p):f({variables:{id:i,testResultAttemptId:o,isAttempt:l}})},stack:l?null==y||null===(t=y.testResult)||void 0===t||null===(n=t.attemptErrorDetails)||void 0===n?void 0:n.stack:null==y||null===(r=y.testResult)||void 0===r||null===(a=r.errorDetails)||void 0===a?void 0:a.stack}}({testResultId:o,testResultAttemptId:u}),P=k.isLoading,B=k.stack,T=k.isExpanded,L=k.handleClick,A=(0,s.useState)(b),E=A[0],D=A[1],M="PASSED"!==x;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:f,"data-cy":"test-results-drawer-attempts-and-error-attempt",children:[(0,r.jsx)("span",{onClick:M?function(){return D(!E)}:void 0,children:p}),(0,r.jsx)(v.x,{onScreenshotClick:C?function(){return R([C])}:void 0,onVideoClick:I&&N?function(){return N(I)}:void 0,onReplayClick:t&&w&&O?function(){var e,t=null!=(e=null==n?void 0:n.toString())?e:"1";w(t)}:void 0,onChevronClick:M?function(){return D(!E)}:void 0,chevronContent:E?(0,r.jsx)(i.JMd,{className:"shrink-0"}):(0,r.jsx)(i._Bm,{className:"shrink-0"}),frag:t||void 0,variant:"small",forceHideChevron:!S&&!p,forceHideOutput:!0})]}),(0,r.jsx)("div",{className:y,"data-cy":"test-results-drawer-attempts-and-error-error",children:!E&&M&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"test-results-drawer__error-header",children:[h&&(0,r.jsxs)("div",{children:[(0,r.jsx)(a.In,{name:"exclamation-circle",className:"error-header-icon"}),h]}),_&&_>1&&(0,r.jsx)("div",{children:(0,r.jsxs)("span",{className:"error-header-impacted-test-cases",children:["causing ",(0,r.jsx)("b",{children:_})," failed test"," ",l()("result",_)]})})]}),g&&(0,r.jsx)("div",{className:"test-results-drawer__error",children:(0,r.jsxs)("pre",{className:"test-results-drawer__error-summary fs-exclude",children:[(0,r.jsx)(a.mC,{message:g}),P&&(0,r.jsx)("div",{className:"test-results-drawer__error-loading-overlay",children:(0,r.jsx)(a.In,{name:"spinner",spin:!0})})]})}),j&&(0,r.jsxs)("div",{className:"test-results-drawer__error-code-frame",children:[(0,r.jsx)("div",{className:"error-codeframe-header",children:j.repositoryFileUrl?(0,r.jsxs)("div",{className:"error-codeframe-header__file-name",children:[(0,r.jsx)(a.pR,{name:"spec",width:16}),(0,r.jsxs)("a",{href:j.repositoryFileUrl,target:"_blank",children:[j.originalFile,Boolean(j.line)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{children:"at line"}),j.line," "]})]})]}):(0,r.jsxs)("div",{className:"error-codeframe-header__file-name",children:[(0,r.jsx)(a.pR,{name:"spec",width:16}),j.originalFile,Boolean(j.line)&&":"+j.line,Boolean(j.column)&&":"+j.column]})}),(0,r.jsx)(c.nV,{frame:j.frame,line:j.line,language:j.language})]}),(0,r.jsxs)("div",{className:"test-results-drawer__error-stack fs-exclude",children:[(0,r.jsxs)("button",{className:"stack-toggle","data-cy":"error-stack-toggle",onClick:L,children:[(0,r.jsx)(a.In,{name:T?"caret-down":"caret-right",className:"stack-toggle__caret"}),"View stack trace"]}),T&&B]})]})})]})},R=function(e){var t,n,s,i,o=e.frag,l=e.attempt,d=e.testResultId,c=e.firstFailedAttempt,m=e.onScreenshotClick,v=e.onVideoClick,f=e.onReplayClick,y=e.hasMultipleAttempts,R=e.isGroupList,C=e.styleType,N=(0,u.A)((y||R)&&p,!y&&!R&&h,"branch-review"===C&&[_,(y||R)&&1===l.attemptNumber&&j]);return(0,r.jsxs)("div",{className:N,"data-cy":"test-results-drawer-attempts-and-error-row",children:[y&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:g,children:(0,r.jsx)(a.tv,{status:l.state})}),(0,r.jsx)("div",{className:b})]}),!y&&R&&(0,r.jsx)("div",{className:g,children:(0,r.jsx)(a.tv,{status:l.state})}),(0,r.jsx)(x,{frag:o,name:y||R?"Attempt "+l.attemptNumber:"",testResultId:d,testResultAttemptId:l.id,errorName:null===(t=l.errorDetails)||void 0===t?void 0:t.name,message:null===(n=l.errorDetails)||void 0===n?void 0:n.message,shouldBeCollapsed:Boolean((null==c?void 0:c.id)!==l.id),impactedTestCasesCount:null===(s=l.errorDetails)||void 0===s?void 0:s.impactedTestCasesCount,codeFrame:null===(i=l.errorDetails)||void 0===i?void 0:i.codeFrame,state:l.state,onScreenshotClick:m,screenshot:l.screenshot,videoTimestamp:l.videoTimestamp,onVideoClick:v,onReplayClick:f,hasMultipleAttempts:y,attemptNumber:l.attemptNumber})]})};R.displayName="TestResultAttempt"}}]); 2//# sourceMappingURL=org-project-branch-summary.1facf80fbe69c9b7f1fd.bundle.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.