1"use strict";(self.webpackChunksmart_test=self.webpackChunksmart_test||[]).push([[457],{477457:(e,t,o)=>{o.r(t),o.d(t,{default:()=>Yr});var r=o(489379),a=o(12406),n=o(917585),l=o(908511),s=o(550495),i=o(848089),c=o(850704),d=o(493230),g=o(716491),h=o(182053),u=o(260899),x=o(843585),b=o(157339),p=o(409950),m=o(103636),f=o(801125),A=o(246879),y=o(580478),v=o(888369),j=o(471400),S=o(965471),w=o(244414);const C=(0,S.A)((0,w.jsx)("path",{d:"M5 20h14v-2H5zM19 9h-4V3H9v6H5l7 7z"}),"Download");var k=o(749715);const T=(0,S.A)((0,w.jsx)("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Clear");var D=o(102334),I=o(53777),F=o(225277),R=o(521671),M=o(707251),z=o(902235),E=o(783274),P=o(325333),W=o(8145),N=o(702046),O=o(766699),B=o(615769),L=o(47399),_=o(209213),U=o(201320),Y=o(434075),q=o(991434),H=o(874076),G=o(888465);const K="".concat("https://app.smartestqa.ai","/api/action-performance"),J={getActionPerformanceMetrics:async e=>{try{return(await G.Ay.get("".concat(K,"/metrics"),{params:e})).data}catch(t){throw console.error("Error fetching action performance metrics:",t),t}},getPerformanceSummary:async(e,t,o)=>{if(!e||"null"===e||"undefined"===e||isNaN(parseInt(e,10)))return console.warn("[getPerformanceSummary] projectId is invali
1d, request is skipped"),null;try{const r={projectId:e};t&&(r.startDate=t),o&&(r.endDate=o);return(await G.Ay.get("".concat(K,"/summary"),{params:r})).data}catch(r){throw console.error("Error fetching performance summary:",r),r}},getDashboardData:async e=>{try{return(await G.Ay.get("".concat(K,"/dashboard"),{params:e})).data}catch(t){throw console.error("Error fetching dashboard data:",t),t}}};var X=o(164624);const Z=o(559264),V="1565C0",$="6C63FF",Q="FFFFFF",ee="1976D2",te="FAFAFA",oe="F5F5F5",re="BDBDBD",ae="757575",ne="10B981",le="6366F1",se="F59E0B",ie="EF4444",ce="FEF2F2",de={EXCELLENT:{bg:"ECFDF5",font:"059669",icon:"\u25cf"},GOOD:{bg:"EEF2FF",font:"4F46E5",icon:"\u25cf"},AVERAGE:{bg:"FFFBEB",font:"D97706",icon:"\u25cf"},POOR:{bg:ce,font:"DC2626",icon:"\u25cf"},SLOW:{bg:ce,font:"DC2626",icon:"\u25cf"}},ge={style:"thin",color:{argb:"EEEEEE"}},he={top:ge,bottom:ge,left:ge,right:ge},ue=async e=>{let{data:t,summary:o,rangeType:r}=e;const a=new Z.Workbook;a.creator="Smartest";const n=a.addWorksheet("Action Performance",{views:[{showGridLines:!1}]});n.columns=[{width:28},{width:36},{width:14},{width:14},{width:18},{width:18},{width:20}],n.addRow([]);const l=n.addRow([]);l.height=40,n.mergeCells(l.number,1,l.number,7);const s=l.getCell(1);s.value=" ACTION PERFORMANCE REPORT",s.font={bold:!0,size:16,color:{argb:Q},name:"Segoe UI"},s.fill={type:"pattern",pattern:"solid",fgColor:{argb:V}},s.alignment={horizontal:"left",vertical:"middle"};const i=n.addRow([]);i.height=26,n.mergeCells(i.number,1,i.number,7);const c=i.getCell(1),d=r?r.replace(/([A-Z])/g," $1").trim():"Custom";c.value=" ".concat(d.toUpperCase()," \xb7 Generated ").concat((new Date).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"})),c.font={size:10,color:{argb:ae},name:"Segoe UI"},c.fill={type:"pattern",pattern:"solid",fgColor:{argb:oe}},c.alignment={horizontal:"left",vertical:"middle"},n.addRow([]).height=10;const g=[{label:"Total Actions",value:o.totalActions,color:$},{label:"Total Executions",value:o.totalExecutions.toLocaleString(),color:le},{label:"Avg Actual",value:"".concat(o.avgActualDuration.toFixed(2),"s"),color:ne},{label:"Avg Total",value:"".concat(o.avgTotalDuration.toFixed(2),"s"),color:se},{label:"Score",value:"".concat(o.performanceScore.toFixed(1),"%"),color:ie}],h=n.addRow(g.map((e=>e.label)));h.height=20,h.eachCell(((e,t)=>{t<=g.length&&(e.font={size:8,color:{argb:ae},name:"Segoe UI"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:te}},e.alignment={horizontal:"center",vertical:"bottom"},e.border={top:{style:"medium",color:{argb:g[t-1].color}}})}));const u=n.addRow(g.map((e=>e.value)));u.height=28,u.eachCell(((e,t)=>{t<=g.length&&(e.font={bold:!0,size:14,color:{argb:g[t-1].color},name:"Segoe UI"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:te}},e.alignment={horizontal:"center",vertical:"top"},e.border={bottom:ge})})),n.addRow([]).height=12;const x=n.addRow(["Action Name","Page","Test Cases","Executions","Avg Actual (sec)","Avg Total (sec)","Performance"]);x.height=30,x.eachCell((e=>{e.font={bold:!0,size:10,color:{argb:Q},name:"Segoe UI"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:ee}},e.alignment={horizontal:"center",vertical:"middle"},e.border=he})),x.getCell(1).alignment={horizontal:"left",vertical:"middle",indent:1},x.getCell(2).alignment={horizontal:"left",vertical:"middle",indent:1},t.forEach(((e,t)=>{const o=(e.performanceLevel||"").toUpperCase(),r=de[o],a=t%2===0?Q:te,l=n.addRow([e.actionName||"-",e.pageName||"-",e.testCaseCount||0,e.executionCount||0,parseFloat(parseFloat(e.avgActualDuration||0).toFixed(2)),parseFloat(parseFloat(e.avgTotalDuration||0).toFixed(2)),r?"".concat(r.icon," ").concat(e.performanceLevel):e.performanceLevel||"N/A"]);l.height=24,l.eachCell(((e,t)=>{e.font={size:10,color:{argb:"212121"},name:"Segoe UI"},e.fill={type:"pattern",pattern:"solid",fgColor:{argb:a}},e.alignment={horizontal:"center",vertical:"middle"},e.border=he,1===t&&(e.font={bold:!0,size:10,color:{argb:"212121"},name:"Segoe UI"},e.alignment={horizontal:"left",vertical:"middle",indent:1}
1),2===t&&(e.font={size:10,color:{argb:"424242"},name:"Segoe UI"},e.alignment={horizontal:"left",vertical:"middle",indent:1}),7===t&&r&&(e.fill={type:"pattern",pattern:"solid",fgColor:{argb:r.bg}},e.font={bold:!0,size:10,color:{argb:r.font},name:"Segoe UI"})}))}));const b=x.number+1,p=x.number+t.length;t.length>0&&(n.addConditionalFormatting({ref:"E".concat(b,":E").concat(p),rules:[{type:"dataBar",minLength:0,maxLength:100,cfvo:[{type:"min"},{type:"max"}],color:{argb:"FF10B981"}}]}),n.addConditionalFormatting({ref:"F".concat(b,":F").concat(p),rules:[{type:"dataBar",minLength:0,maxLength:100,cfvo:[{type:"min"},{type:"max"}],color:{argb:"FF6366F1"}}]})),n.addRow([]).height=8;const m=n.addRow([]);n.mergeCells(m.number,1,m.number,7);const f=m.getCell(1);f.value=" ".concat(t.length," records exported \xb7 Smartest Platform"),f.font={size:9,italic:!0,color:{argb:re},name:"Segoe UI"},f.alignment={horizontal:"left",vertical:"middle"};const A=await a.xlsx.writeBuffer(),y=new Blob([A],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}),v=window.URL.createObjectURL(y),j=document.createElement("a");j.href=v,j.download="action-performance-".concat((new Date).toISOString().split("T")[0],".xlsx"),j.click(),window.URL.revokeObjectURL(v)},xe="dashboard_actionPerf_dateRangeType",be="dashboard_actionPerf_dateRangeStart",pe="dashboard_actionPerf_dateRangeEnd",me="dashboard_actionPerf_sortBy",fe="dashboard_actionPerf_sortOrder",Ae=["actionName","pageName","testCaseCount","executionCount","avgActualDuration","avgTotalDuration","performanceLevel"],ye=["asc","desc"],ve=["today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisYear","lastYear","custom"],je="#FFFFFF",Se="#F6F8FA",we="#212529",Ce="#6c757d",ke="#212529",Te="#6c757d",De="rgba(0,0,0,0.15)",Ie="rgba(0,0,0,0.12)",Fe=e=>{const t=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate());let r,a;switch(e){case"today":r=o,a=new Date(o.getTime()+864e5-1);break;case"yesterday":r=new Date(o.getTime()-864e5),a=new Date(o.getTime()-1);break;case"thisWeek":{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1);break}case"lastWeek":{const e=t.getDay(),n=0===e?6:e-1,l=new Date(o.getTime()-24*n*60*60*1e3);r=new Date(l.getTime()-6048e5),a=new Date(l.getTime()-1);break}case"thisMonth":r=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break;case"lastMonth":r=new Date(t.getFullYear(),t.getMonth()-1,1),a=new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999);break;case"thisYear":r=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),11,31,23,59,59,999);break;case"lastYear":r=new Date(t.getFullYear()-1,0,1),a=new Date(t.getFullYear()-1,11,31,23,59,59,999);break;default:{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1)}}return{start:r.toISOString(),end:a.toISOString(),type:e}},Re=e=>{let{dateRange:t,onDateRangeChange:o,onActionNameClick:r}=e;const[a,n]=(0,p.useState)(!0),[l,s]=(0,p.useState)([]),[i,c]=(0,p.useState)({totalActions:0,totalExecutions:0,avgActualDuration:0,avgTotalDuration:0,performanceScore:0}),[u,x]=(0,p.useState)((()=>localStorage.getItem("dashboard_actionPerf_search")||"")),[m,f]=(0,p.useState)((()=>localStorage.getItem("dashboard_actionPerf_search")||"")),[A,j]=(0,p.useState)(!1),S=(0,p.useRef)(null),[G,K]=(0,p.useState)(0),[Z,V]=(0,p.useState)(5),[$,Q]=(0,p.useState)(0),[ee,te]=(0,p.useState)((()=>{try{const e=localStorage.getItem(me);if(e&&Ae.includes(e))return e}catch(e){console.error("Error reading sortBy from localStorage:",e)}return"executionCount"})),[oe,re]=(0,p.useState)((()=>{try{const e=localStorage.getItem(fe);if(e&&ye.includes(e))return e}catch(e){console.error("Error reading sortOrder from localStorage:",e)}return"desc"})),ae=localStorage.getItem("projectId"),[ne,le]=(0,p.useState)((()=>null!==t&&void 0!==t&&t.start&&null!==t&&void 0!==t&&t.end?t:(()=>{try{const e=localStorage.getItem(xe);if(e&&ve.includes(e)){if("custom"===e){const e=localStorage.getItem(be),t=localStorage.getItem(pe);if(e&&t)return{start:e,end:t,type:"custom"}}return Fe(e)}}catch(e){console.error("Error reading dateRange from localStorage:",e)}return Fe("thisWeek")})()));(0,p.useEffect)((()=>{try{localStorage.setItem(xe,ne.type||"thisWeek"),"custom"===ne.type&&ne.start&&ne.end&&(localStorage.setItem(be,ne.start),localStorage.setItem(pe,ne.end))}catch(e){console.error("Error saving dateRange to localStorage:",e)}}),[ne]);const se=e=>{if(!e)return null;try{return new Date(e).toISOString().slice(0,19)}catch(t){return null}},ie=(0,p.useCallback)((async()=>{n(!0);try{const e={projectId:ae,viewType:"BOTH",search:u,page:G,size:Z,sortBy:ee,sortOrder:oe};null!==ne&&void 0!==ne&&ne.start&&null!==ne&&void 0!==ne&&ne.end&&(e.startDate=se(ne.start),e.endDate=se(ne.end));const t=await J.getDashboardData(e);s((null===t||void 0===t?void 0:t.metrics)||[]),c((null===t||void 0===t?void 0:t.summary)||{totalActions:0,totalExecutions:0,avgActualDuration:0,avgTotalDuration:0,performanceScore:0}),Q((null===t||void 0===t?void 0:t.totalElements)||0)}catch(e){console.error("Error fetching action performance data:",e)}finally{n(!1)}}),[ae,ne,u,G,Z,ee,oe]);(0,p.useEffect)((()=>{null!==t&&void 0!==t&&t.start&&null!==t&&void 0!==t&&t.end&&le(t)}
1),[t]),(0,p.useEffect)((()=>{ie()}),[ie]);const ce=e=>{const t=e.target.value;f(t),S.current&&clearTimeout(S.current),S.current=setTimeout((()=>{x(t),K(0);try{localStorage.setItem("dashboard_actionPerf_search",t||"")}catch(e){}}),1e3)};(0,p.useEffect)((()=>()=>{S.current&&clearTimeout(S.current)}),[]);const de=e=>{let{label:t,value:o,bg:r,color:a}=e;return(0,w.jsx)(F.A,{variant:"outlined",label:(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"baseline",gap:.85},children:[(0,w.jsx)(h.A,{variant:"body2",sx:{fontSize:"0.60rem",fontWeight:600,color:"#6c757d",letterSpacing:"0.05em",lineHeight:1},children:t}),(0,w.jsx)(D.default,{sx:{fontSize:5,opacity:.55,color:"#6c757d"}}),(0,w.jsx)(h.A,{variant:"h5",sx:{fontSize:"0.78rem",fontWeight:600,color:a,lineHeight:1},children:o})]}),sx:{px:1,py:.55,height:30,borderRadius:1.6,bgcolor:r,borderColor:"transparent","& .MuiChip-label":{px:0,py:0}}})},ge=e=>{let{field:t,label:o,align:r="left",sx:a={}}=e;return(0,w.jsx)(R.A,{align:r,sx:a,children:(0,w.jsx)(M.A,{active:ee===t,direction:ee===t?oe:"asc",onClick:()=>(e=>{const t=ee===e&&"asc"===oe?"desc":"asc";re(t),te(e),K(0);try{localStorage.setItem(me,e),localStorage.setItem(fe,t)}catch(o){console.error("Error saving sort preferences to localStorage:",o)}})(t),sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit"},children:o})})};return(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",borderRadius:3,overflow:"hidden",bgcolor:je,border:"1px solid ".concat(De),boxShadow:"0 2px 10px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,w.jsxs)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(De),background:"linear-gradient(180deg, ".concat(je," 0%, #EEF2F6 100%)")},children:[(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,w.jsx)(g.A,{sx:{minWidth:0},children:(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:we,letterSpacing:"0.06em",fontSize:"1.1rem"},children:[y.A.getText("actionPerformanceMetrics"),(0,w.jsx)(E.A,{title:y.A.getText("actionPerformanceMetricsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]})}),(0,w.jsxs)(d.A,{direction:"row",spacing:1,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[(0,w.jsx)(v.A,{onDateRangeChange:(e,t,r)=>{le({start:e,end:t,type:r}),K(0),null===o||void 0===o||o(e,t,r)},defaultRange:ne.type||"thisWeek",appearance:{backgroundColor:"#fff",borderColor:De,textColor:we,iconColor:Ce,hoverBgColor:"rgba(0,0,0,0.03)"},slotSx:{button:{height:36,py:0,px:1.5,fontSize:"0.8125rem",borderRadius:2}}}),(0,w.jsx)(E.A,{title:y.A.getText("exportToCsv"),arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(P.A,{onClick:async()=>{try{const e={projectId:ae,viewType:"BOTH",search:u,page:0,size:$||1e3,sortBy:ee,sortOrder:oe};null!==ne&&void 0!==ne&&ne.start&&null!==ne&&void 0!==ne&&ne.end&&(e.startDate=se(ne.start),e.endDate=se(ne.end));const t=await J.getDashboardData(e),o=(null===t||void 0===t?void 0:t.metrics)||[];await ue({data:o,summary:i,rangeType:ne.type}),(0,b.M8)(y.A.getText("perfExportSuccess"),{variant:"success"})}catch(e){(0,b.M8)(y.A.getText("perfExportFailed"),{variant:"error"})}},size:"small",sx:{width:36,height:36,borderRadius:2,border:"1px solid ".concat(De),bgcolor:"#fff",color:Ce,"&:hover":{bgcolor:"rgba(0,0,0,0.03)"}},children:(0,w.jsx)(C,{fontSize:"small"})})})]})]}),(0,w.jsxs)(d.A,{direction:{xs:"column",md:"row"},spacing:1.25,alignItems:{xs:"stretch",md:"center"},sx:{mt:2},children:[(0,w.jsxs)(d.A,{direction:"row",spacing:.75,flexWrap:"wrap",useFlexGap:!0,sx:{rowGap:.75},children:[(0,w.jsx)(de,{label:y.A.getText("totalActions").toUpperCase(),value:i.totalActions,bg:"#e3f2fd",color:"#1976d2"}),(0,w.jsx)(de,{label:y.A.getText("totalExecutions").toUpperCase(),value:i.totalExecutions.toLocaleString(),bg:"#ede7f6",color:"#5e35b1"}),(0,w.jsx)(de,{label:y.A.getText("avgActual").toUpperCase(),value:"".concat(i.avgActualDuration.toFixed(2),"s"),bg:"#e8f5e9",color:"#2e7d32"}),(0,w.jsx)(de,{label:y.A.getText("avgTotal").toUpperCase(),value:"".concat(i.avgTotalDuration.toFixed(2),"s"),bg:"#e0f2f1",color:"#00695c"}),(0,w.jsx)(de,{label:y.A.getText("score").toUpperCase(),value:"".concat(i.performanceScore.toFixed(1),"%"),bg:"#fff3e0",color:"#ef6c00"})]}),(0,w.jsx)(g.A,{sx:{flex:1}}),(0,w.jsx)(W.A,{size:"small",variant:"outlined",placeholder:y.A.getText("searchActions"),value:m,onChange:ce,onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),InputProps:{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{mr:.5},children:(0,w.jsx)(k.A,{sx:{fontSize:18,color:Ce}})}),endAdornment:A&&m?(0,w.jsx)(N.A,{position:"end",children:(0,w.jsx)(P.A,{size:"small",edge:"end","aria-label":"clear",onClick:()=>ce({target:{value:""}}),sx:{p:.25},children:(0,w.jsx)(T,{sx:{fontSize:16}})})}):null},sx:{minWidth:{xs:"100%",md:320},"& .MuiOutlinedInput-root":{height:28,fontSize:"0.8rem",bgcolor:"#fff",borderRadius:2,"& fieldset":{borderColor:De},"&:hover fieldset":{borderColor:Ce},"&.Mui-focused fieldset":{borderColor:"rgba(0,0,0,0.28)"}},"& .MuiOutlinedInput-input":{py:.4}}})]})]}),a&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flexShrink:0,bgcolor:X.Ay.surface.sunken,borderBottom:"1px solid ".concat(De)},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:1,borderBottom:"none"}},children:[(0,w.jsxs)("colgroup",{children:[(0,w.jsx)("col",{style:{width:"18%"}}),(0,w.jsx)("col",{style:{width:"24%"}}),(0,w.jsx)("col",{style:{width:"10%"}}),(0,w.jsx)("col",{style:{width:"10%"}}),(0,w.jsx)("col",{style:{width:"13%"}}),(0,w.jsx)("col",{style:{width:"13%"}}),(0,w.jsx)("col",{style:{width:"12%"}})]}),(0,w.jsx)(L.A,{children:(0,w.jsxs)(_.A,{children:[(0,w.jsx)(ge,{field:"actionName",label:y.A.getText("actionName").toUpperCase(),sx:{width:"18%"}}),(0,w.jsx)(ge,{field:"pageName",label:y.A.getText("page").toUpperCase(),sx:{width:"24%"}}),(0,w.jsx)(ge,{field:"testCaseCount",label:y.A.getText("testCases").toUpperCase(),align:"center",sx:{width:"10%"}}),(0,w.jsx)(ge,{field:"executionCount",label:y.A.getText("executions").toUpperCase(),align:"center",sx:{width:"10%"}}),(0,w.jsx)(ge,{field:"avgActualDuration",label:"".concat(y.A.getText("avgActual").toUpperCase()," (").concat(y.A.getText("sec"),")"),align:"center",sx:{width:"13%"}}),(0,w.jsx)(ge,{field:"avgTotalDuration",label:"".concat(y.A.getText("avgTotal").toUpperCase()," (").concat(y.A.getText("sec"),")"),align:"center",sx:{width:"13%"}}),(0,w.jsx)(ge,{field:"performanceLevel",label:y.A.getText("performance").toUpperCase(),align:"center",sx:{width:"12%"}})]})})]})}
1),(0,w.jsx)(U.A,{sx:{flex:1,overflow:"auto",bgcolor:je,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:.7}},children:[(0,w.jsxs)("colgroup",{children:[(0,w.jsx)("col",{style:{width:"18%"}}),(0,w.jsx)("col",{style:{width:"24%"}}),(0,w.jsx)("col",{style:{width:"10%"}}),(0,w.jsx)("col",{style:{width:"10%"}}),(0,w.jsx)("col",{style:{width:"13%"}}),(0,w.jsx)("col",{style:{width:"13%"}}),(0,w.jsx)("col",{style:{width:"12%"}})]}),(0,w.jsxs)(Y.A,{children:[l.map(((e,t)=>{const o=(e=>{switch(e){case"EXCELLENT":return{color:"#16a34a",label:y.A.getText("perfLevelExcellent"),bgColor:"rgba(22,163,74,0.12)"};case"GOOD":return{color:"#0ea5e9",label:y.A.getText("perfLevelGood"),bgColor:"rgba(14,165,233,0.12)"};case"AVERAGE":return{color:"#f59e0b",label:y.A.getText("perfLevelAverage"),bgColor:"rgba(245,158,11,0.16)"};case"SLOW":return{color:"#ef4444",label:y.A.getText("perfLevelSlow"),bgColor:"rgba(239,68,68,0.12)"};default:return{color:Ce,label:y.A.getText("notAvailable"),bgColor:"rgba(0,0,0,0.06)"}}})(e.performanceLevel),a=e.testCaseCount||e.usageCount||0,n="".concat(e.actionId,"-").concat(e.pageName||"unknown","-").concat(t);return(0,w.jsxs)(_.A,{sx:{transition:"background-color 0.12s ease","&:hover":{backgroundColor:X.Ay.state.hover}},children:[(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:e.actionName||y.A.getText("notAvailable"),placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(g.A,{onClick:()=>r&&e.actionId&&r(e.actionId),sx:{cursor:r&&e.actionId?"pointer":"default",display:"inline-flex",alignItems:"center",gap:.75,maxWidth:"100%",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":r&&e.actionId?{bgcolor:"rgba(0,0,0,0.04)","& .action-name":{color:"#2563eb"},"& .dot-icon":{color:"#2563eb"}}:{}},children:(0,w.jsx)(h.A,{className:"action-name",variant:"body2",sx:{color:ke,fontWeight:800,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:e.actionName||y.A.getText("notAvailable")})})})}),(0,w.jsx)(R.A,{sx:{maxWidth:0},children:e.pageName?(0,w.jsx)(F.A,{label:e.pageName,size:"small",variant:"outlined",sx:{height:22,borderRadius:2,bgcolor:Se,borderColor:Ie,color:we,maxWidth:"100%","& .MuiChip-label":{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}}):(0,w.jsx)(h.A,{variant:"body2",sx:{color:Te},children:"-"})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(H.A,{actionId:e.actionId,projectId:ae,count:a,enableCaseNavigation:!0})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(F.A,{label:(e.executionCount||0).toLocaleString(),size:"small",variant:"outlined",sx:{height:22,borderRadius:2,fontSize:"0.75rem",fontWeight:900,bgcolor:Se,borderColor:Ie,color:we}})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsxs)(d.A,{spacing:.5,alignItems:"center",children:[(0,w.jsx)(h.A,{variant:"body2",sx:{fontWeight:700,color:ke},children:e.avgActualDuration?e.avgActualDuration.toFixed(2):"0.00"}),e.avgActualDuration>0?(0,w.jsx)(g.A,{sx:{width:72,height:6,borderRadius:999,bgcolor:"rgba(0,0,0,0.08)",overflow:"hidden"},children:(0,w.jsx)(g.A,{sx:{height:"100%",width:"".concat(Math.min(e.avgActualDuration/10*100,100),"%"),bgcolor:"#16a34a",borderRadius:999}})}):null]})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsxs)(d.A,{spacing:.5,alignItems:"center",children:[(0,w.jsx)(h.A,{variant:"body2",sx:{fontWeight:700,color:ke},children:e.avgTotalDuration?e.avgTotalDuration.toFixed(2):"0.00"}),e.avgTotalDuration>0?(0,w.jsx)(g.A,{sx:{width:72,height:6,borderRadius:999,bgcolor:"rgba(0,0,0,0.08)",overflow:"hidden"},children:(0,w.jsx)(g.A,{sx:{height:"100%",width:"".concat(Math.min(e.avgTotalDuration/10*100,100),"%"),bgcolor:"#0ea5e9",borderRadius:999}})}):null]})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(F.A,{label:o.label,size:"small",variant:"outlined",sx:{height:22,borderRadius:2,fontWeight:900,bgcolor:o.bgColor,borderColor:"transparent",color:o.color,minWidth:92}})})]},n)})),0===l.length&&!a&&(0,w.jsx)(_.A,{children:(0,w.jsx)(R.A,{colSpan:7,align:"center",sx:{py:4,fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:y.A.getText("noActionPerformanceDataAvailable")})})]})]})}),(0,w.jsx)(q.A,{component:"div",count:$,page:G,onPageChange:(e,t)=>
1K(t),rowsPerPage:Z,onRowsPerPageChange:e=>{V(parseInt(e.target.value,10)),K(0)},rowsPerPageOptions:[5,10,25,50],labelRowsPerPage:y.A.getText("rows"),sx:{bgcolor:je,color:Te,borderTop:"1px solid ".concat(De),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:Te},"& .MuiTablePagination-select":{color:we},"& .MuiIconButton-root":{color:Te}}})]})};var Me=o(820544),ze=o(258353);const Ee="dashboard_actionPie_selectedPage",Pe="#FFFFFF",We="#212529",Ne="#6c757d",Oe="rgba(0,0,0,0.15)",Be="#F6F8FA",Le="#22c55e",_e="#f59e0b",Ue="#e9ecef",Ye={total:0,linked:0,notLinked:0,coveragePercent:0},qe=e=>{let{refreshNotLinkedActionsData:t}=e;const o=localStorage.getItem("projectId"),[a,n]=(0,p.useState)([{label:y.A.getText("all"),value:"all"}]),[l,s]=(0,p.useState)(Ye),[i,c]=(0,p.useState)(!0),[u,x]=(0,p.useState)((()=>{const e=(()=>{try{const e=localStorage.getItem(Ee);if(e){const t=JSON.parse(e);if(t&&"object"===typeof t&&void 0!==t.value)return t.value}}catch(e){console.error("Error reading selectedPage from localStorage:",e)}return"all"})();return{label:"all"===e?y.A.getText("all"):e,value:e}}));(0,p.useEffect)((()=>{try{localStorage.setItem(Ee,JSON.stringify(u))}catch(e){console.error("Error saving selectedPage to localStorage:",e)}}),[u]);(0,p.useEffect)((()=>{(async()=>{try{const e=(await m.A.getActionPageNamesByActionType(o)).data||[],t=[{label:y.A.getText("all"),value:"all"},...e.map((e=>({label:e,value:e})))];n(t);const r=u.value;"all"===r||e.includes(r)||x({label:y.A.getText("all"),value:"all"})}catch(e){console.error("Action page names fetch error:",e)}})()}),[t]),(0,p.useEffect)((()=>{(async e=>{try{c(!0);const t=await m.A.getActionCoverageStats(o,e);s((null===t||void 0===t?void 0:t.data)||Ye)}catch(t){console.error("Coverage stats fetch error:",t),s(Ye)}finally{c(!1)}})(u.value)}),[u.value,t]);const b=l.total||0,f=l.linked||0,A=l.notLinked||0,v=l.coveragePercent||0,j=(0,p.useMemo)((()=>0===b?[{label:y.A.getText("noDataAvailable"),value:1,status:"noData"}]:[{label:y.A.getText("linkedActions"),value:f,status:"linked"},{label:y.A.getText("notLinkedActions"),value:A,status:"notLinked"}]),[b,f,A]),S=e=>{switch(e){case"linked":default:return Le;case"notLinked":return _e;case"noData":return Ue}};return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:450,maxHeight:520},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",display:"flex",flexDirection:"column",backgroundColor:Pe,border:"1px solid ".concat(Oe),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(Oe),background:"linear-gradient(180deg, ".concat(Pe," 0%, ").concat(Be," 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:2,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:We,fontSize:"1.1rem",minWidth:0},noWrap:!0,children:[y.A.getText("testCoverage"),(0,w.jsx)(E.A,{title:y.A.getText("testCoverageInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(Me.A,{options:a,value:u,onChange:(e,t)=>
1{x(t||{label:y.A.getText("all"),value:"all"})},getOptionLabel:e=>e.label,isOptionEqualToValue:(e,t)=>e.value===t.value,size:"small",sx:{width:170},renderInput:e=>(0,w.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{placeholder:y.A.getText("all"),size:"small",sx:{"& .MuiOutlinedInput-root":{backgroundColor:"#fff",borderRadius:2,boxShadow:"0 1px 0 rgba(0,0,0,0.03)","& .MuiOutlinedInput-notchedOutline":{borderColor:Oe},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0,0,0,0.18)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"rgba(0,0,0,0.28)"}}}}))})]})}),i&&(0,w.jsx)(O.A,{}),(0,w.jsxs)(g.A,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[(0,w.jsxs)(g.A,{sx:{width:"100%",maxWidth:360,display:"flex",justifyContent:"center",position:"relative"},children:[(0,w.jsx)(ze.r,{height:260,margin:{top:10,bottom:10,left:10,right:10},series:[{innerRadius:70,outerRadius:105,paddingAngle:3,cornerRadius:10,highlightScope:{highlight:"item",fade:"global"},faded:{innerRadius:70,additionalRadius:-8,color:"rgba(0,0,0,0.08)"},data:j.map((e=>(0,r.A)((0,r.A)({},e),{},{color:S(e.status)}))),arcLabel:e=>{if(0===b||"noData"===e.status)return"";const t=e.value/b*100;return t<.5?"":"".concat(t.toFixed(0),"%")}}],slotProps:{legend:{hidden:!0}}}),(0,w.jsx)(g.A,{sx:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,w.jsxs)(g.A,{sx:{textAlign:"center"},children:[(0,w.jsx)(h.A,{sx:{fontWeight:800,fontSize:22,color:We,lineHeight:1},children:0===b?"\u2014":"".concat(v,"%")}),(0,w.jsx)(h.A,{sx:{fontSize:12,color:Ne,mt:.5},children:y.A.getText("linkedActions")})]})})]}),(0,w.jsx)(d.A,{direction:"row",gap:1,flexWrap:"wrap",justifyContent:"center",sx:{mt:2},children:j.map(((e,t)=>(0,w.jsx)(F.A,{variant:"outlined",label:(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,w.jsx)(g.A,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:S(e.status)}}),(0,w.jsxs)(h.A,{sx:{fontSize:12,color:We},children:[e.label,": ",(0,w.jsx)("b",{children:e.value})]})]}),sx:{borderColor:Oe,bgcolor:Be,borderRadius:2,py:1.25,"& .MuiChip-label":{px:1.25}}},t)))})]})]})})};var He=o(142209),Ge=o(549691),Ke=o(6815),Je=o(508808),Xe=o(96319),Ze=o(796583),Ve=o(428170);const $e=e=>{let{src:t}=e;const[o,r]=(0,p.useState)(!0),[a,n]=(0,p.useState)(!1);return(0,p.useEffect)((()=>{t&&(r(!0),n(!1))}),[t]),!t||a?(0,w.jsxs)(g.A,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:8},children:[(0,w.jsx)(Ge.default,{sx:{fontSize:72,color:"#d0d0d0",mb:2}}),(0,w.jsx)(h.A,{variant:"body2",sx:{color:"#999",fontSize:"0.9rem"},children:y.A.getText("noScreenshotAvailable")||"No screenshot available"})]}):(0,w.jsxs)(w.Fragment,{children:[o&&(0,w.jsx)(g.A,{sx:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1},children:(0,w.jsx)(g.A,{sx:{width:44,height:44,border:"3px solid #e8e8e8",borderTop:"3px solid #1976d2",borderRadius:"50%",animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}})}),(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",p:3},children:(0,w.jsx)("img",{src:t,alt:"Screenshot",style:{maxWidth:"100%",maxHeight:"72vh",objectFit:"contain",display:"block",opacity:o?0:1,transition:"opacity 0.3s ease",borderRadius:"8px",boxShadow:o?"none":"0 4px 20px rgba(0,0,0,0.12)"},onLoad:()=>r(!1),onError:()=>{r(!1),n(!0)}})})]})},Qe=e=>{let{open:t,onClose:o,screenshotUrl:r,actionName:a}=e;return(0,w.jsxs)(Ze.A,{open:t,onClose:o,maxWidth:"lg",fullWidth:!0,PaperProps:{sx:{borderRadius:"16px",overflow:"hidden",maxHeight:"95vh",boxShadow:"0 24px 48px rgba(0, 0, 0, 0.2)"}},children:[(0,w.jsxs)(g.A,{sx:{fontSize:"1rem",fontWeight:600,color:"#1a1a1a",display:"flex",justifyContent:"space-between",alignItems:"center",py:2,px:3,borderBottom:"1px solid #eaeaea",backgroundColor:"#fff"},children:[(0,w.jsx)(g.A,{sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",pr:2,flex:1},children:a||"Screenshot"}),(0,w.jsx)(P.A,{onClick:o,size:"small",sx:{color:"#666",transition:"all 0.2s ease","&:hover":{backgroundColor:"rgba(0,0,0,0.06)",color:"#333"}},children:(0,w.jsx)(Xe.default,{fontSize:"small"})})]}),(0,w.jsx)(Ve.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",p:0,backgroundColor:"#f8f9fa",minHeight:450,position:"relative"},children:(0,w.jsx)($e,{src:r})}),(0,w.jsx)(g.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",py:1.5,backgroundColor:"#fff",borderTop:"1px solid #eaeaea"},children:(0,w.jsxs)(h.A,{sx:{fontSize:"0.75rem",color:"#999",display:"flex",alignItems:"center",gap:1},children:[(0,w.jsx)(g.A,{component:"span",sx:{px:.75,py:.25,bgcolor:"#f0f0f0",borderRadius:"4px",fontFamily:"monospace",fontSize:"0.7rem",fontWeight:500,color:"#666"},children:"ESC"}),y.A.getText("pressEscOrClickOutsideToClose")||"Press ESC or click outside to close"]})})]})};var et=o(228429),tt=o(318513);
1const ot="dashboard_errorSteps_dateRangeType",rt="dashboard_errorSteps_dateRangeStart",at="dashboard_errorSteps_dateRangeEnd",nt="dashboard_errorSteps_sortBy",lt="dashboard_errorSteps_sortOrder",st=["actionName","testCaseName"],it=["asc","desc"],ct=["today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisYear","lastYear","custom"],dt=e=>{const t=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate());let r,a;switch(e){case"today":r=o,a=new Date(o.getTime()+864e5-1);break;case"yesterday":r=new Date(o.getTime()-864e5),a=new Date(o.getTime()-1);break;case"thisWeek":{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1);break}case"lastWeek":{const e=t.getDay(),n=0===e?6:e-1,l=new Date(o.getTime()-24*n*60*60*1e3);r=new Date(l.getTime()-6048e5),a=new Date(l.getTime()-1);break}case"thisMonth":r=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break;case"lastMonth":r=new Date(t.getFullYear(),t.getMonth()-1,1),a=new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999);break;case"thisYear":r=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),11,31,23,59,59,999);break;case"lastYear":r=new Date(t.getFullYear()-1,0,1),a=new Date(t.getFullYear()-1,11,31,23,59,59,999);break;default:{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1)}}return{start:r.toISOString(),end:a.toISOString(),type:e}},gt=e=>{let{src:t,onClick:o,COLORS:r}=e;const[a,n]=(0,p.useState)(!0),[l,s]=(0,p.useState)(!1),[i,c]=(0,p.useState)(t);return(0,p.useEffect)((()=>{if(t){n(!0),s(!1),c(t);const e=new Image;e.onload=()=>{n(!1),s(!1)},e.onerror=()=>{n(!1),s(!0)},e.src=t}else n(!1),s(!0)}),[t]),l||!t?(0,w.jsx)(g.A,{sx:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"58px",height:"32px",borderRadius:2,border:"1px dashed ".concat(r.border),bgcolor:r.softBg,cursor:"default"},children:(0,w.jsx)(Ge.default,{sx:{color:"rgba(0,0,0,0.3)",fontSize:18}})}):(0,w.jsxs)(g.A,{onClick:a||l?void 0:o,sx:{display:"inline-flex",cursor:a?"default":"pointer",borderRadius:2,overflow:"hidden",border:"1px solid ".concat(r.border),boxShadow:"0 1px 4px rgba(0,0,0,0.08)",transition:"all 200ms ease",position:"relative",width:"58px",height:"32px",alignItems:"center",justifyContent:"center",bgcolor:a?r.softBg:"transparent","&:hover":a?{}:{transform:"scale(1.08) translateY(-2px)",boxShadow:"0 8px 20px rgba(0,0,0,0.15)",borderColor:r.link,"&::after":{opacity:1}},"&::after":a?{}:{content:'""',position:"absolute",inset:0,background:"rgba(37, 99, 235, 0.1)",opacity:0,transition:"opacity 200ms ease",pointerEvents:"none"}},children:[a&&(0,w.jsx)(g.A,{sx:{width:16,height:16,border:"2px solid #e8e8e8",borderTop:"2px solid #1976d2",borderRadius:"50%",animation:"spin 1s linear infinite","@keyframes spin":{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}}}),!a&&!l&&(0,w.jsx)("img",{src:i,alt:"Screenshot",style:{width:"58px",height:"32px",objectFit:"cover",display:"block"}})]})},ht=e=>{let{errorTestSteps:t,handleActionNameClick:o,setErrorTestSteps:r}=e;const[a,n]=(0,p.useState)(0),[l,s]=(0,p.useState)(5),[i,c]=(0,p.useState)(0),[u,x]=(0,p.useState)((()=>{try{const e=localStorage.getItem(nt);if(e&&st.includes(e))return e}catch(e){console.error("Error reading sortBy from localStorage:",e)}return"actionName"})),[b,m]=(0,p.useState)((()=>{try{const e=localStorage.getItem(lt);if(e&&it.includes(e))return e}catch(e){console.error("Error reading sortOrder from localStorage:",e)}return"asc"})),[f,A]=(0,p.useState)(!1),[j,S]=(0,p.useState)(""),[C,k]=(0,p.useState)(""),[T,D]=(0,p.useState)(!1),[F,P]=(0,p.useState)((()=>(()=>{try{const e=localStorage.getItem(ot);if(e&&ct.includes(e)){if("custom"===e){const e=localStorage.getItem(rt),t=localStorage.getItem(at);if(e&&t)return{start:e,end:t,type:"custom"}}return dt(e)}}catch(e){console.error("Error reading dateRange from localStorage:",e)}return dt("thisWeek")})())),W=(0,et.Zp)(),N={cardBg:"#FFFFFF",softBg:"#F6F8FA",headerText:"#212529",subText:"#565c61ff",border:"rgba(0, 0, 0, 0.15)",hoverBg:"rgba(0,0,0,0.03)",zebra:"rgba(0,0,0,0.015)",danger:"#ef4444",link:"#2563eb"};(0,p.useEffect)((()=>{try{localStorage.setItem(ot,F.type||"thisWeek"),"custom"===F.type&&F.start&&F.end&&(localStorage.setItem(rt,F.start),localStorage.setItem(at,F.end))}catch(e){console.error("Error saving dateRange to localStorage:",e)}}),[F]);const H=e=>{const t=u===e&&"asc"===b?"desc":"asc";m(t),x(e),n(0);try{localStorage.setItem(nt,e),localStorage.setItem(lt,t)}catch(o){console.error("Error saving sort preferences to localStorage:",o)}},G=(0,p.useCallback)((async()=>{try{var e,t;D(!0);const o=localStorage.getItem("projectId");if(!o)throw new Error("Project ID not found");const n=await tt.A.getErrorTestSteps(o,F.start,F.end,u,b,a,l);r((null===n||void 0===n?void 0:n.content)||[]),c(null!==(e=null===n||void 0===n?void 0:n.totalElements)&&void 0!==e?e:(null===n||void 0===n||null===(t=n.content)||void 0===t?void 0:t.length)||0)}catch(o){console.error("Error fetching error test steps:",o),r([]),c(0)}finally{D(!1)}}),[F,r,u,b,a,l]);(0,p.useEffect)((()=>{G()}),[G]);const K=(0,p.useMemo)((()=>t||[]),[t]);return(0,w.jsxs)(g.A,{sx:{width:"100%",maxWidth:"100%",height:"100%",minHeight:{xs:300,md:320},maxHeight:540,overflow:"hidden",borderRadius:3,boxShadow:"0 2px 10px rgba(0,0,0,0.15)"},children:[(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",maxWidth:"100%",height:"100%",borderRadius:3,overflow:"hidden",bgcolor:N.cardBg,border:"1px solid ".concat(N.border),boxShadow:"0 2px 10px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2,py:1.5,borderBottom:"1px solid ".concat(N.border),background:"linear-gradient(180deg, ".concat(N.cardBg," 0%, #EEF2F6 100%)"),overflow:"hidden"},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,sx:{minWidth:0}
1,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:N.headerText,fontSize:"1rem",flexShrink:0,whiteSpace:"nowrap"},children:[y.A.getText("errorTestSteps"),(0,w.jsx)(E.A,{title:y.A.getText("errorTestStepsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(v.A,{onDateRangeChange:(e,t,o)=>{P({start:e,end:t,type:o}),n(0)},defaultRange:F.type||"thisWeek",appearance:{backgroundColor:"#fff",borderColor:N.border,textColor:N.headerText,iconColor:N.subText,hoverBgColor:"rgba(0,0,0,0.03)"},slotSx:{button:{height:32,py:0,px:1,fontSize:"0.75rem",borderRadius:1.5,minWidth:100}}})]})}),T&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flexShrink:0,bgcolor:X.Ay.surface.sunken,borderBottom:"1px solid ".concat(N.border)},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:1,borderBottom:"none"}},children:[(0,w.jsxs)("colgroup",{children:[(0,w.jsx)("col",{style:{width:"30%"}}),(0,w.jsx)("col",{style:{width:"45%"}}),(0,w.jsx)("col",{style:{width:"25%"}})]}),(0,w.jsx)(L.A,{children:(0,w.jsxs)(_.A,{children:[(0,w.jsx)(R.A,{sx:{width:"30%"},children:(0,w.jsx)(M.A,{active:"actionName"===u,direction:"actionName"===u?b:"asc",onClick:()=>H("actionName"),sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit"},children:y.A.getText("actionName").toUpperCase()})}),(0,w.jsx)(R.A,{sx:{width:"45%"},children:(0,w.jsx)(M.A,{active:"testCaseName"===u,direction:"testCaseName"===u?b:"asc",onClick:()=>H("testCaseName"),sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit"},children:y.A.getText("testCaseName").toUpperCase()})}),(0,w.jsx)(R.A,{align:"center",sx:{width:"25%"},children:y.A.getText("screenShot").toUpperCase()})]})})]})}),(0,w.jsx)(U.A,{sx:{flex:1,overflow:"auto",bgcolor:N.cardBg,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===K.length?"100%":"auto","& .MuiTableCell-root":{py:.7}},children:[(0,w.jsxs)("colgroup",{children:[(0,w.jsx)("col",{style:{width:"30%"}}),(0,w.jsx)("col",{style:{width:"45%"}}),(0,w.jsx)("col",{style:{width:"25%"}})]}),(0,w.jsx)(Y.A,{children:0!==K.length||T?K.map(((e,t)=>{const r=(null===e||void 0===e?void 0:e.actionName)||"-",a=(null===e||void 0===e?void 0:e.testCaseName)||"-",n=null!==e&&void 0!==e&&e.screenshotUrl?(0,Ke.OO)(e.screenshotUrl):"";return(0,w.jsxs)(_.A,{sx:{transition:"background-color 0.12s ease","&:hover":{backgroundColor:X.Ay.state.hover},cursor:"default"},children:[(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:r,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>o(e),sx:{display:"flex",alignItems:"center",gap:.75,cursor:"pointer",userSelect:"none",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .action-name-text":{color:N.link}}},children:[(0,w.jsx)(He.default,{sx:{color:N.danger,fontSize:15,flexShrink:0,display:"block"}}),(0,w.jsx)(h.A,{className:"action-name-text",variant:"body2",sx:{color:N.headerText,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:r})]})})}),(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:a,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>{return t=e.testCaseId,void W("/test-case",{state:{testCaseId:t}});var t},sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.75,maxWidth:"100%",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .test-case-name":{color:N.link},"& .test-case-icon":{color:N.link}}},children:[(0,w.jsx)(h.A,{className:"test-case-name",variant:"body2",sx:{color:N.subText,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:a}),(0,w.jsx)(Je.default,{className:"test-case-icon",sx:{fontSize:14,color:"rgba(0,0,0,0.35)",flexShrink:0,transition:"color 0.2s ease"}})]})})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(gt,{src:n,onClick:()=>((e,t)=>{S(e),k(t||"Screenshot"),A(!0)})(n,r),COLORS:N})})]},t)})):(0,w.jsx)(_.A,{children:(0,w.jsx)(R.A,{colSpan:3,align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:y.A.getText("noErrorTestSteps")})})})]})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:i,rowsPerPage:l,page:a,onPageChange:(e,t)=>
1n(t),onRowsPerPageChange:e=>{s(parseInt(e.target.value,10)),n(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:N.cardBg,color:N.subText,borderTop:"1px solid ".concat(N.border),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:N.subText},"& .MuiTablePagination-select":{color:N.headerText},"& .MuiIconButton-root":{color:N.subText}}})]}),(0,w.jsx)(Qe,{open:f,onClose:()=>{A(!1),S(""),k("")},screenshotUrl:j,actionName:C})]})};var ut=o(793153),xt=o(558699),bt=o(914857),pt=o(46589),mt=o(381095),ft=o(980294),At=o(293245),yt=o(660158),vt=o(144813),jt=o(416335),St=o(485706),wt=o(256121);const Ct=e=>{if(!e)return null;try{return new Date(e).toISOString().slice(0,19)}catch(t){return console.error("Error formatting date:",t),null}},kt=(e,t)=>{if(!t)return e;const o=(0,r.A)({},e);return t.start&&(o.startDate=Ct(t.start)),t.end&&(o.endDate=Ct(t.end)),o},Tt="dashboard_errorPages_dateRangeType",Dt="dashboard_errorPages_dateRangeStart",It="dashboard_errorPages_dateRangeEnd",Ft=["today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisYear","lastYear","custom"],Rt=e=>{const t=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate());let r,a;switch(e){case"today":r=o,a=new Date(o.getTime()+864e5-1);break;case"yesterday":r=new Date(o.getTime()-864e5),a=new Date(o.getTime()-1);break;case"thisWeek":{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1);break}case"lastWeek":{const e=t.getDay(),n=0===e?6:e-1,l=new Date(o.getTime()-24*n*60*60*1e3);r=new Date(l.getTime()-6048e5),a=new Date(l.getTime()-1);break}case"thisMonth":default:r=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break;case"lastMonth":r=new Date(t.getFullYear(),t.getMonth()-1,1),a=new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999);break;case"thisYear":r=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),11,31,23,59,59,999);break;case"lastYear":r=new Date(t.getFullYear()-1,0,1),a=new Date(t.getFullYear()-1,11,31,23,59,59,999)}return{start:r.toISOString(),end:a.toISOString(),type:e}},Mt=()=>{const e=(0,bt.A)(),t=(0,pt.A)(e.breakpoints.down("sm")),[o,r]=(0,p.useState)([]),[a,n]=(0,p.useState)(!1),l=localStorage.getItem("projectId"),[s,i]=(0,p.useState)((()=>(()=>{try{const e=localStorage.getItem(Tt);if(e&&Ft.includes(e)){if("custom"===e){const e=localStorage.getItem(Dt),t=localStorage.getItem(It);if(e&&t)return{start:e,end:t,type:"custom"}}return Rt(e)}}catch(e){console.error("Error reading dateRange from localStorage:",e)}return Rt("thisMonth")})())),c="#FFFFFF",u="#F6F8FA",x="#212529",b="#6c757d",m="rgba(0,0,0,0.15)",f="rgba(0,0,0,0.08)",A="#ef4444";(0,p.useEffect)((()=>{try{localStorage.setItem(Tt,s.type||"thisMonth"),"custom"===s.type&&s.start&&s.end&&(localStorage.setItem(Dt,s.start),localStorage.setItem(It,s.end))}catch(e){console.error("Error saving dateRange to localStorage:",e)}}),[s]);const j=(0,p.useCallback)((async()=>{try{n(!0);let e={projectId:l};null!==s&&void 0!==s&&s.start&&null!==s&&void 0!==s&&s.end&&(e=kt(e,s));const o=await wt.default.getMostErrorPagesFromDetail(e.projectId,e.startDate,e.endDate);if(!o||0===o.length)return void r([]);const a=t?8:20;r(o.slice(0,a))}catch(e){console.error("Most Error Pages fetch error:",e),r([])}finally{n(!1)}}),[l,t,s]);(0,p.useEffect)((()=>{j()}),[j]);const S=0===o.length,C=o.length>0&&o.every((e=>0===((null===e||void 0===e?void 0:e.errorCount)||0))),k=e=>{var t,o;let{active:r,payload:a,label:n}=e;if(!r||null===a||void 0===a||!a.length)return null;const l=null!==(t=null===(o=a[0])||void 0===o?void 0:o.value)&&void 0!==t?t:0;return(0,w.jsxs)(g.A,{sx:{bgcolor:"#fff",border:"1px solid ".concat(m),borderRadius:2,px:1.25,py:1,boxShadow:"0 10px 30px rgba(0,0,0,0.10)"},children:[(0,w.jsx)(h.A,{sx:{fontSize:12,fontWeight:800,color:x},children:n}),(0,w.jsxs)(h.A,{sx:{fontSize:12,color:b,mt:.25},children:[(0,w.jsx)("b",{style:{color:A},children:l})," ",y.A.getText("errors")]})]})};return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:500,maxHeight:580},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",display:"flex",flexDirection:"column",bgcolor:c,border:"1px solid ".concat(m),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(m),background:"linear-gradient(180deg, ".concat(c," 0%, ").concat(u," 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",gap:2,children:[(0,w.jsx)(g.A,{sx:{minWidth:0}
1,children:(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:x,fontSize:"1.1rem"},children:[y.A.getText("pagesWithMostErrors"),(0,w.jsx)(E.A,{title:y.A.getText("pagesWithMostErrorsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]})}),(0,w.jsx)(v.A,{onDateRangeChange:(e,t,o)=>{i({start:e,end:t,type:o})},defaultRange:s.type||"thisMonth",appearance:{backgroundColor:"#fff",borderColor:m,textColor:x,iconColor:b,hoverBgColor:"rgba(0,0,0,0.03)"},slotSx:{button:{height:36,py:0,px:1.5,fontSize:"0.8125rem",borderRadius:2}}})]})}),a&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flex:1,p:2.25,display:"flex",flexDirection:"column"},children:S?(0,w.jsxs)(g.A,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:1.25,borderRadius:3,bgcolor:u,border:"1px dashed ".concat(m)},children:[(0,w.jsx)(xt.default,{sx:{fontSize:56,color:b,opacity:.35}}),(0,w.jsx)(h.A,{sx:{fontWeight:800,color:x},children:y.A.getText("noErrorData")}),(0,w.jsx)(h.A,{sx:{fontSize:12,color:b,textAlign:"center",maxWidth:360},children:y.A.getText("noPagesWithErrorsFound")})]}):C?(0,w.jsxs)(g.A,{sx:{flex:1,maxHeight:380,overflowY:"auto","&::-webkit-scrollbar":{width:6},"&::-webkit-scrollbar-track":{backgroundColor:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:3,transition:"background-color 0.2s"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.2)"}},children:[(0,w.jsxs)(g.A,{sx:{mb:1.5,display:"flex",alignItems:"center",gap:1,px:1.5,py:1,borderRadius:2,backgroundColor:"rgba(34,197,94,0.08)",border:"1px solid rgba(34,197,94,0.22)"},children:[(0,w.jsx)(ut.default,{sx:{fontSize:18,color:"#16a34a",flexShrink:0}}),(0,w.jsx)(h.A,{sx:{fontSize:"0.82rem",fontWeight:600,color:"#15803d",lineHeight:1.3,minWidth:0},children:y.A.getText("allPagesErrorFree")})]}),(0,w.jsx)(d.A,{spacing:1,children:o.map(((e,t)=>(0,w.jsx)(g.A,{sx:{px:1.5,py:1.25,bgcolor:u,borderRadius:2,border:"1px solid ".concat(m)},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",children:[(0,w.jsx)(h.A,{variant:"body2",sx:{fontWeight:700,color:x},children:e.pageName}),(0,w.jsx)(F.A,{size:"small",label:"0 ".concat(y.A.getText("errors")),sx:{height:22,borderRadius:2,bgcolor:"rgba(34,197,94,0.10)",color:"#16a34a",fontWeight:800}})]})},t)))})]}):(0,w.jsx)(g.A,{sx:{flex:1,minHeight:0,overflow:"hidden",display:"flex"},children:(0,w.jsx)(g.A,{sx:{flex:1,height:380,minHeight:380},children:(0,w.jsx)(mt.u,{width:"100%",height:"100%",children:(0,w.jsxs)(ft.E,{data:o,margin:{top:8,right:10,left:0,bottom:50},barCategoryGap:"14%",maxBarSize:42,children:[(0,w.jsx)("defs",{children:(0,w.jsxs)("linearGradient",{id:"errorGradientModern",x1:"0",y1:"0",x2:"0",y2:"1",children:[(0,w.jsx)("stop",{offset:"0%",stopColor:A,stopOpacity:.95}),(0,w.jsx)("stop",{offset:"100%",stopColor:A,stopOpacity:.55})]})}),(0,w.jsx)(At.d,{strokeDasharray:"3 3",stroke:f}),(0,w.jsx)(yt.W,{dataKey:"pageName",interval:0,tick:{angle:-45,textAnchor:"end",fontSize:9,fill:b},tickFormatter:e=>{if(!e)return"";return e.length>15?"".concat(e.substring(0,15),"..."):e},axisLine:{stroke:m},tickLine:{stroke:m},height:20}),(0,w.jsx)(vt.h,{domain:[0,"dataMax"],allowDecimals:!1,tickCount:5,tick:{fill:b,fontSize:11},axisLine:{stroke:m},tickLine:{stroke:m}}),(0,w.jsx)(jt.m,{cursor:{fill:"rgba(0,0,0,0.03)"},content:(0,w.jsx)(k,{})}),(0,w.jsx)(St.y,{dataKey:"errorCount",fill:"url(#errorGradientModern)",radius:[10,10,0,0],minPointSize:4,isAnimationActive:!0})]})})})})})]})})};var zt=o(807762),Et=o(719223);const Pt="#FFFFFF",Wt="#F6F8FA",Nt="#212529",Ot="#6c757d",Bt="#212529",Lt="#6c757d",_t="rgba(0,0,0,0.15)",Ut="#2563eb",Yt=e=>{let{handleActionNameClick:t,refreshNotLinkedActionsData:o}=e;const[r,a]=(0,p.useState)(0),[n,l]=(0,p.useState)(5),[s,i]=(0,p.useState)([]),[c,u]=(0,p.useState)(0),[x,b]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedActions_search")||"")),[f,A]=(0,p.useState)(!1),[v,j]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedActions_search")||"")),[S,C]=(0,p.useState)(!0),k=localStorage.getItem("projectId");(0,p.useEffect)((()=>{const e=setTimeout((()=>{j(x.trim());try{localStorage.setItem("dashboard_unlinkedActions_search",x||"")}catch(e){}}),1e3);return()=>clearTimeout(e)}),[x]),(0,p.useEffect)((()=>{a(0)}),[v]),(0,p.useEffect)((()=>{let e=!0;return C(!0),m.A.getNotLinkedToTestStepPaged(k,{page:r,size:n,name:v,sortDir:"asc"}).then((t=>{e&&(i((null===t||void 0===t?void 0:t.content)||[]),u((null===t||void 0===t?void 0:t.totalElements)||0))})).catch((t=>{e&&(console.error("Not linked actions fetch error:",t),i([]),u(0))})).finally((()=>{e&&C(!1)})),()=>{e=!1}}),[r,n,v,o]);return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:260,maxHeight:420},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",bgcolor:Pt,border:"1px solid ".concat(_t),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:1,borderBottom:"1px solid ".concat(_t),background:"linear-gradient(180deg, ".concat(Pt," 0%, rgba(0,0,0,0.02) 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{dis
1play:"inline-flex",alignItems:"center",fontWeight:600,color:Nt,fontSize:"1rem",minWidth:0},noWrap:!0,children:[y.A.getText("unlinkedActions")||"Unlinked Actions",(0,w.jsx)(E.A,{title:y.A.getText("unlinkedActionsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:15,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:"".concat(c),sx:{height:24,borderRadius:2,bgcolor:Wt,borderColor:_t,fontWeight:900,color:Ot}})]})}),S&&(0,w.jsx)(O.A,{sx:{height:3,"& .MuiLinearProgress-bar":{backgroundColor:"#1976d2"},backgroundColor:"rgba(25, 118, 210, 0.1)"}}),(0,w.jsx)(g.A,{sx:{pl:1.5,pr:2.25,py:.6,borderBottom:"1px solid ".concat(_t),bgcolor:"#EEF1F5",flexShrink:0},children:(0,w.jsx)(W.A,{size:"small",placeholder:y.A.getText("searchActions")||"Search Actions",value:x||"",title:x||"",onChange:e=>b(e.target.value),onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),InputProps:{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{mr:.5},children:(0,w.jsx)(Et.default,{sx:{fontSize:18,color:Ot}})}),endAdornment:f&&x?(0,w.jsx)(N.A,{position:"end",children:(0,w.jsx)(P.A,{size:"small","aria-label":"clear",onClick:()=>b(""),sx:{p:.25,color:Ot,"&:hover":{color:Ut}},children:(0,w.jsx)(zt.default,{sx:{fontSize:16}})})}):null},sx:{width:"60%","& .MuiOutlinedInput-root":{height:28,fontSize:"0.8rem",bgcolor:"#fff",borderRadius:2,"& fieldset":{borderColor:_t},"&:hover fieldset":{borderColor:Ot},"&.Mui-focused fieldset":{borderColor:Ut}},"& .MuiOutlinedInput-input":{py:.4}}})}),(0,w.jsx)(U.A,{sx:{flex:1,overflow:"auto",bgcolor:Pt,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsx)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===s.length?"100%":"auto","& tbody .MuiTableCell-root":{py:.8}},children:(0,w.jsx)(Y.A,{children:0!==s.length||S?0===s.length&&S?null:s.map(((e,o)=>{const r=(null===e||void 0===e?void 0:e.actionName)||"-";return(0,w.jsx)(_.A,{sx:{"&:hover":{backgroundColor:X.Ay.state.hover},transition:"background-color 0.12s ease",cursor:"default"},children:(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:r,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>t(e),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.75,maxWidth:"100%",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .action-name":{color:Ut},"& .dot-icon":{color:Ut}}},children:[(0,w.jsx)(D.default,{className:"dot-icon",sx:{fontSize:10,color:Ut,opacity:.85,flexShrink:0,transition:"color 0.2s ease"}}),(0,w.jsx)(h.A,{className:"action-name",variant:"body2",sx:{color:Ot,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:r})]})})})},(null===e||void 0===e?void 0:e.id)||"".concat(r,"-").concat(o))})):(0,w.jsx)(_.A,{children:(0,w.jsxs)(R.A,{align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:[(0,w.jsx)(h.A,{sx:{fontSize:"0.8rem",color:X.Ay.text.faint,mb:.5},children:x?y.A.getText("noResultsFound")||"No results found":y.A.getText("notLinkedActionNotFound")||"No unlinked actions found"}),x&&(0,w.jsx)(h.A,{variant:"body2",sx:{fontSize:"0.8rem",color:X.Ay.text.faint},children:y.A.getText("tryDifferentSearch")||"Try a different search term"})]})})})})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:c,rowsPerPage:n,page:r,onPageChange:(e,t)=>
1a(t),onRowsPerPageChange:e=>{l(parseInt(e.target.value,10)),a(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:Pt,color:Lt,borderTop:"1px solid ".concat(_t),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:Lt},"& .MuiTablePagination-select":{color:Bt},"& .MuiIconButton-root":{color:Lt}}})]})})},qt="#FFFFFF",Ht="#F6F8FA",Gt="#212529",Kt="#6c757d",Jt="#212529",Xt="#6c757d",Zt="rgba(0,0,0,0.15)",Vt="#2563eb",$t="#9c27b0",Qt=()=>{const e=localStorage.getItem("projectId"),t=(0,et.Zp)(),[o,r]=(0,p.useState)([]),[a,n]=(0,p.useState)(0),[l,s]=(0,p.useState)(0),[i,c]=(0,p.useState)(5),[u,x]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedRequirements_search")||"")),[b,m]=(0,p.useState)(!1),[f,v]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedRequirements_search")||"")),[j,S]=(0,p.useState)(!0);(0,p.useEffect)((()=>{const e=setTimeout((()=>{v(u.trim());try{localStorage.setItem("dashboard_unlinkedRequirements_search",u||"")}catch(e){}}),1e3);return()=>clearTimeout(e)}),[u]),(0,p.useEffect)((()=>{s(0)}),[f]),(0,p.useEffect)((()=>{let t=!0;return S(!0),A.A.getNotLinkedToTestCasePaged(e,{page:l,size:i,name:f,sortDir:"asc"}).then((e=>{t&&(r((null===e||void 0===e?void 0:e.content)||[]),n((null===e||void 0===e?void 0:e.totalElements)||0))})).catch((e=>{t&&(console.error("Not linked requirements fetch error:",e),r([]),n(0))})).finally((()=>{t&&S(!1)})),()=>{t=!1}}),[l,i,f]);return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:260,maxHeight:420},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",bgcolor:qt,border:"1px solid ".concat(Zt),boxShadow:"0 2px 10px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:1,borderBottom:"1px solid ".concat(Zt),background:"linear-gradient(180deg, ".concat(qt," 0%, #EEF2F6 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:Gt,fontSize:"1rem",minWidth:0},noWrap:!0,children:[y.A.getText("unlinkedRequirements")||"Unlinked Requirements",(0,w.jsx)(E.A,{title:y.A.getText("unlinkedRequirementsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:15,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:"".concat(a),sx:{height:24,borderRadius:2,bgcolor:Ht,borderColor:Zt,fontWeight:900,color:Kt}})]})}),j&&(0,w.jsx)(O.A,{sx:{height:3,"& .MuiLinearProgress-bar":{backgroundColor:"#1976d2"},backgroundColor:"rgba(25, 118, 210, 0.1)"}}),(0,w.jsx)(g.A,{sx:{pl:1.5,pr:2.25,py:.6,borderBottom:"1px solid ".concat(Zt),bgcolor:"#EEF1F5",flexShrink:0},children:(0,w.jsx)(W.A,{size:"small",placeholder:y.A.getText("searchRequirement")||"Search Requirement",value:u||"",title:u||"",onChange:e=>x(e.target.value),onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),InputProps:{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{mr:.5},children:(0,w.jsx)(Et.default,{sx:{fontSize:18,color:Kt}})}),endAdornment:b&&u?(0,w.jsx)(N.A,{position:"end",children:(0,w.jsx)(P.A,{size:"small","aria-label":"clear",onClick:()=>x(""),sx:{p:.25,color:Kt,"&:hover":{color:Vt}},children:(0,w.jsx)(zt.default,{sx:{fontSize:16}})})}):null},sx:{width:"60%","& .MuiOutlinedInput-root":{height:28,fontSize:"0.8rem",bgcolor:"#fff",borderRadius:2,"& fieldset":{borderColor:Zt},"&:hover fieldset":{borderColor:Kt},"&.Mui-focused fieldset":{borderColor:Vt}},"& .MuiOutlinedInput-input":{py:.4}}})}),(0,w.jsx)(U.A,{sx:{flex:1,overflow:"auto",bgcolor:qt,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsx)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===o.length?"100%":"auto","& tbody .MuiTableCell-root":{py:.8}},children:(0,w.jsx)(Y.A,{children:0!==o.length||j?0===o.length&&j?null:o.map(((e,o)=>{var r;const a=null!==e&&void 0!==e&&null!==(r=e.requirementName)&&void 0!==r&&r.trim()?e.requirementName:(null===e||void 0===e?void 0:e.requirementDescription)||"-";return(0,w.jsx)(_.A,{sx:{"&:hover":{backgroundColor:X.Ay.state.hover},transition:"background-color 0.12s ease",cursor:"default"},children:(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:a,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>(e=>{const o="SUB"===e.requirementType&&e.mainReqId?e.mainReqId:e.id;t("/requirements",{state:{requirementId:o}})})(e),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.75,maxWidth:"100%",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .requirement-name":{color:Vt},"& .requirement-icon":{color:Vt},"& .dot-icon":{color:Vt}}},children:[(0,w.jsx)(D.default,{className:"dot-icon",sx:{fontSize:10,
1color:$t,opacity:.85,flexShrink:0,transition:"color 0.2s ease"}}),(0,w.jsx)(h.A,{className:"requirement-name",variant:"body2",sx:{color:Kt,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:a}),(0,w.jsx)(Je.default,{className:"requirement-icon",sx:{fontSize:14,color:"rgba(0,0,0,0.35)",flexShrink:0,transition:"color 0.2s ease"}})]})})})},(null===e||void 0===e?void 0:e.id)||"".concat(a,"-").concat(o))})):(0,w.jsx)(_.A,{children:(0,w.jsxs)(R.A,{align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:[(0,w.jsx)(h.A,{sx:{fontSize:"0.8rem",color:X.Ay.text.faint,mb:.5},children:u?y.A.getText("noResultsFound")||"No results found":y.A.getText("notLinkedRequirementNotFound")||"No unlinked requirements found"}),u&&(0,w.jsx)(h.A,{variant:"body2",sx:{fontSize:"0.8rem",color:X.Ay.text.faint},children:y.A.getText("tryDifferentSearch")||"Try a different search term"})]})})})})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:a,rowsPerPage:i,page:l,onPageChange:(e,t)=>
1s(t),onRowsPerPageChange:e=>{c(parseInt(e.target.value,10)),s(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:qt,color:Xt,borderTop:"1px solid ".concat(Zt),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:Xt},"& .MuiTablePagination-select":{color:Jt},"& .MuiIconButton-root":{color:Xt}}})]})})};var eo=o(602955);const to="#FFFFFF",oo="#F6F8FA",ro="#212529",ao="#6c757d",no="#212529",lo="#6c757d",so="rgba(0,0,0,0.15)",io="#2563eb",co="#f59e0b",go=()=>{const e=(0,et.Zp)(),[t,o]=(0,p.useState)([]),[r,a]=(0,p.useState)(0),[n,l]=(0,p.useState)(0),[s,i]=(0,p.useState)(5),[c,u]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedTestCases_search")||"")),[x,b]=(0,p.useState)(!1),[m,f]=(0,p.useState)((()=>localStorage.getItem("dashboard_unlinkedTestCases_search")||"")),[A,v]=(0,p.useState)(!0),j=localStorage.getItem("projectId");(0,p.useEffect)((()=>{const e=setTimeout((()=>{f(c.trim());try{localStorage.setItem("dashboard_unlinkedTestCases_search",c||"")}catch(e){}}),1e3);return()=>clearTimeout(e)}),[c]),(0,p.useEffect)((()=>
1{l(0)}),[m]),(0,p.useEffect)((()=>{let e=!0;return v(!0),eo.A.getNotLinkedToTestSuitePaged(j,{page:n,size:s,name:m,sortDir:"asc"}).then((t=>{e&&(o((null===t||void 0===t?void 0:t.content)||[]),a((null===t||void 0===t?void 0:t.totalElements)||0))})).catch((t=>{e&&(console.error("Not linked test cases fetch error:",t),o([]),a(0))})).finally((()=>{e&&v(!1)})),()=>{e=!1}}),[n,s,m]);return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:260,maxHeight:420},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",bgcolor:to,border:"1px solid ".concat(so),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:1,borderBottom:"1px solid ".concat(so),background:"linear-gradient(180deg, ".concat(to," 0%, rgba(0,0,0,0.02) 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:ro,fontSize:"1rem",minWidth:0},noWrap:!0,children:[y.A.getText("unlinkedTestCases")||"Unlinked Test Cases",(0,w.jsx)(E.A,{title:y.A.getText("unlinkedTestCasesInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:15,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:"".concat(r),sx:{height:24,borderRadius:2,bgcolor:oo,borderColor:so,fontWeight:900,color:ao}})]})}),A&&(0,w.jsx)(O.A,{sx:{height:3,"& .MuiLinearProgress-bar":{backgroundColor:"#1976d2"},backgroundColor:"rgba(25, 118, 210, 0.1)"}}),(0,w.jsx)(g.A,{sx:{pl:1.5,pr:2.25,py:.6,borderBottom:"1px solid ".concat(so),bgcolor:"#EEF1F5",flexShrink:0},children:(0,w.jsx)(W.A,{size:"small",placeholder:y.A.getText("searchTestCases")||"Search Test Cases",value:c||"",title:c||"",onChange:e=>u(e.target.value),onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),InputProps:{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{mr:.5},children:(0,w.jsx)(Et.default,{sx:{fontSize:18,color:ao}})}),endAdornment:x&&c?(0,w.jsx)(N.A,{position:"end",children:(0,w.jsx)(P.A,{size:"small","aria-label":"clear",onClick:()=>u(""),sx:{p:.25,color:ao,"&:hover":{color:io}},children:(0,w.jsx)(zt.default,{sx:{fontSize:16}})})}):null},sx:{width:"60%","& .MuiOutlinedInput-root":{height:28,fontSize:"0.8rem",bgcolor:"#fff",borderRadius:2,"& fieldset":{borderColor:so},"&:hover fieldset":{borderColor:ao},"&.Mui-focused fieldset":{borderColor:io}},"& .MuiOutlinedInput-input":{py:.4}}})}),(0,w.jsx)(U.A,{sx:{flex:1,overflow:"auto",bgcolor:to,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsx)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===t.length?"100%":"auto","& tbody .MuiTableCell-root":{py:.8}},children:(0,w.jsx)(Y.A,{children:0!==t.length||A?0===t.length&&A?null:t.map(((t,o)=>{const r=(null===t||void 0===t?void 0:t.testCaseName)||(null===t||void 0===t?void 0:t.description)||"-";return(0,w.jsx)(_.A,{sx:{"&:hover":{backgroundColor:X.Ay.state.hover},transition:"background-color 0.12s ease",cursor:"default"},children:(0,w.jsx)(R.A,{sx:{maxWidth:0},children:(0,w.jsx)(E.A,{title:r,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>(t=>{const o=(null===t||void 0===t?void 0:t.testCaseId)||(null===t||void 0===t?void 0:t.id);o&&e("/test-case",{state:{testCaseId:o}})})(t),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.75,maxWidth:"100%",px:1,py:.5,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .test-case-name":{color:io},"& .test-case-icon":{color:io},"& .dot-icon":{color:io}}},children:[(0,w.jsx)(D.default,{className:"dot-icon",sx:{fontSize:10,
1color:co,opacity:.85,flexShrink:0,transition:"color 0.2s ease"}}),(0,w.jsx)(h.A,{className:"test-case-name",variant:"body2",sx:{color:ao,fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:r}),(0,w.jsx)(Je.default,{className:"test-case-icon",sx:{fontSize:14,color:"rgba(0,0,0,0.35)",flexShrink:0,transition:"color 0.2s ease"}})]})})})},(null===t||void 0===t?void 0:t.id)||(null===t||void 0===t?void 0:t.testCaseId)||"".concat(r,"-").concat(o))})):(0,w.jsx)(_.A,{children:(0,w.jsxs)(R.A,{align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:[(0,w.jsx)(h.A,{sx:{fontSize:"0.8rem",color:X.Ay.text.faint,mb:.5},children:c?y.A.getText("noResultsFound")||"No results found":y.A.getText("notLinkedTestCaseNotFound")||"No unlinked test cases found"}),c&&(0,w.jsx)(h.A,{variant:"body2",sx:{fontSize:"0.8rem",color:X.Ay.text.faint},children:y.A.getText("tryDifferentSearch")||"Try a different search term"})]})})})})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:r,rowsPerPage:s,page:n,onPageChange:(e,t)=>
1l(t),onRowsPerPageChange:e=>{i(parseInt(e.target.value,10)),l(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:to,color:lo,borderTop:"1px solid ".concat(so),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:lo},"& .MuiTablePagination-select":{color:no},"& .MuiIconButton-root":{color:lo}}})]})})};var ho=o(751069),uo=o(628810),xo=o(881705),bo=o(962628);const po="dashboard_reqSummary_tagInclude",mo="dashboard_reqSummary_tagExclude",fo="dashboard_reqSummary_priorityFilter",Ao="dashboard_reqSummary_sortBy",yo="dashboard_reqSummary_sortOrder",vo=["name","subRequirementsCount","aiScore","testCasesCount","executionsCount","successRate"],jo=["asc","desc"],So=[{value:"critical",label:"Critical",color:"#ef4444"},{value:"high",label:"High",color:"#f59e0b"},{value:"medium",label:"Medium",color:"#3b82f6"},{value:"low",label:"Low",color:"#22c55e"}],wo=e=>{try{const t=localStorage.getItem(e);if(t){const e=JSON.parse(t);if(Array.isArray(e))return e}}catch(t){console.error("Error reading array from localStorage:",t)}return[]},Co=()=>{const e=(0,et.Zp)(),[t,o]=(0,p.useState)([]),[r,a]=(0,p.useState)(0),[n,l]=(0,p.useState)(!0),[s,i]=(0,p.useState)((()=>{try{const e=localStorage.getItem(Ao);if(e&&vo.includes(e))return e}catch(e){console.error("Error reading sortBy from localStorage:",e)}return"successRate"})),[c,u]=(0,p.useState)((()=>{try{const e=localStorage.getItem(yo);if(e&&jo.includes(e))return e}catch(e){console.error("Error reading sortOrder from localStorage:",e)}return"desc"})),[x,b]=(0,p.useState)(0),[m,f]=(0,p.useState)(5),[v,j]=(0,p.useState)([]),[S,C]=(0,p.useState)((()=>wo(po))),[k,T]=(0,p.useState)((()=>wo(mo))),[D,W]=(0,p.useState)((()=>wo(fo))),[N,H]=(0,p.useState)(null),G=localStorage.getItem("projectId"),K="#FFFFFF",J="#212529",Z="#565c61ff",V="rgba(0, 0, 0, 0.15)";(0,p.useEffect)((()=>{(async()=>{try{var e;const t=await bo.A.getAllTags(),o=Array.isArray(t)?t:null!==(e=null===t||void 0===t?void 0:t.data)&&void 0!==e?e:[];j(o.map((e=>({id:String(e.id),name:e.name,color:e.color||"#90caf9"}))))}catch(t){console.error("Error fetching tags:",t)}})()}),[]),(0,p.useEffect)((()=>{try{localStorage.setItem(po,JSON.stringify(S)),localStorage.setItem(mo,JSON.stringify(k))}catch(e){console.error("Error saving tag filters to localStorage:",e)}}),[S,k]),(0,p.useEffect)((()=>{try{localStorage.setItem(fo,JSON.stringify(D))}catch(e){console.error("Error saving priority filter to localStorage:",e)}}),[D]);const $=(0,p.useCallback)((async()=>{try{var e,t;l(!0);const r={projectId:G,sortBy:s,sortOrder:c,page:x,size:m};D.length>0&&(r.priorities=D.join(",")),S.length>0&&(r.includeTagIds=S.join(",")),k.length>0&&(r.excludeTagIds=k.join(","));const n=await A.A.getDashboardSummary(r);o((null===n||void 0===n?void 0:n.requirements)||[]),a(null!==(e=null===n||void 0===n?void 0:n.totalElements)&&void 0!==e?e:(null===n||void 0===n||null===(t=n.requirements)||void 0===t?void 0:t.length)||0)}catch(r){console.error("Error fetching requirements summary:",r),o([]),a(0)}finally{l(!1)}}),[G,c,s,D,S,k,x,m]);(0,p.useEffect)((()=>{G&&"null"!==G?$():l(!1)}),[$,G]);const Q=(0,p.useMemo)((()=>[{id:"name",label:y.A.getText("requirement"),sortable:!0,width:"26%"},{id:"subRequirementsCount",label:y.A.getText("subReq"),sortable:!0,align:"center",width:"10%"},{id:"aiScore",label:y.A.getText("aiScore"),sortable:!0,align:"center",width:"11%"},{id:"testCasesCount",label:y.A.getText("testCases"),sortable:!0,align:"center",width:"14%"},{id:"executionsCount",label:y.A.getText("executions"),sortable:!0,align:"center",width:"17%"},{id:"successRate",label:y.A.getText("successRate"),sortable:!0,align:"center",width:"22%"}]),[]),ee=t,te=e=>e>=80?"#22c55e":e>=60?"#f59e0b":"#ef4444",oe=S.length+k.length+D.length,re=e=>{let{value:t,color:o="#6c757d",bg:r="transparent",border:a="rgba(0,0,0,0.18)"}=e;return(0,w.jsx)(F.A,{label:t,size:"small",variant:"transparent"===r?"outlined":"filled",sx:{height:22,minWidth:36,px:.8,borderRadius:1,fontWeight:700,fontSize:"0.75rem",color:o,bgcolor:r,borderColor:a,"& .MuiChip-label":{px:0}}})},ae=e=>{let{ai:t}=e;if(null===t||void 0===t)return(0,w.jsx)(re,{value:"N/A",color:"#6c757d",bg:"#f1f3f5",border:"rgba(0,0,0,0.08)"});const o=Math.round(t),r=o>=80?"#22c55e":o>=60?"#f59e0b":"#ef4444";
1return(0,w.jsx)(re,{value:o,color:"#fff",bg:r,border:"transparent"})};return(0,w.jsx)(g.A,{sx:{width:"100%",maxWidth:"100%",height:"100%",minHeight:{xs:300,md:320},maxHeight:540,overflow:"hidden",borderRadius:3,boxShadow:"0 2px 10px rgba(0,0,0,0.15)"},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",maxWidth:"100%",height:"100%",borderRadius:3,overflow:"hidden",bgcolor:K,border:"1px solid ".concat(V),boxShadow:"0 2px 10px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2,py:1.5,borderBottom:"1px solid ".concat(V),background:"linear-gradient(180deg, ".concat(K," 0%, #EEF2F6 100%)"),overflow:"hidden"},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:1,sx:{minWidth:0},children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:J,fontSize:"1rem",flexShrink:0,whiteSpace:"nowrap"},children:[y.A.getText("requirementsSummary"),(0,w.jsx)(E.A,{title:y.A.getText("requirementsSummaryInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsx)(d.A,{direction:"row",spacing:.75,alignItems:"center",sx:{flexShrink:1,minWidth:0},children:(0,w.jsx)(E.A,{title:y.A.getText("filter")||"Filter",enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(P.A,{size:"small",onClick:e=>H(e.currentTarget),sx:{border:"1px solid ".concat(V),borderRadius:1.5,p:.75,bgcolor:"#fff","&:hover":{bgcolor:"rgba(0,0,0,0.04)"}},children:(0,w.jsx)(uo.A,{variant:"dot",color:"primary",invisible:0===oe,children:(0,w.jsx)(ho.default,{sx:{fontSize:18,color:Z}})})})})})]})}),(0,w.jsx)(xo.A,{open:Boolean(N),anchorEl:N,onClose:()=>H(null),tags:v,includeIds:S,excludeIds:k,onChange:(e,t)=>
1{C(e),T(t),b(0)},getText:e=>y.A.getText(e)||e,width:300,maxHeight:400,showPipelineTypeFilter:!0,pipelineTypeMultiple:!0,pipelineTypeLabel:y.A.getText("severity")||"Severity",pipelineTypes:So.map((e=>({value:e.value,label:e.label}))),selectedPipelineType:D,onPipelineTypeChange:e=>{Array.isArray(e)?W(e):W((t=>t.includes(e)?t.filter((t=>t!==e)):[...t,e])),b(0)}}),n&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flexShrink:0,bgcolor:X.Ay.surface.sunken,borderBottom:"1px solid ".concat(V)},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:1,borderBottom:"none"}},children:[(0,w.jsx)("colgroup",{children:Q.map((e=>(0,w.jsx)("col",{style:{width:e.width||"auto"}},e.id)))}),(0,w.jsx)(L.A,{children:(0,w.jsx)(_.A,{children:Q.map((e=>(0,w.jsx)(R.A,{align:e.align||"left",sortDirection:s===e.id&&c,sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",letterSpacing:"0.01em",px:1},children:e.sortable?(0,w.jsx)(M.A,{active:s===e.id,direction:s===e.id?c:"asc",onClick:()=>(e=>{const t=s===e&&"asc"===c?"desc":"asc";u(t),i(e),b(0);try{localStorage.setItem(Ao,e),localStorage.setItem(yo,t)}catch(o){console.error("Error saving sort preferences to localStorage:",o)}})(e.id),sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit",maxWidth:"100%",minWidth:0,"& .MuiTableSortLabel-icon":{flexShrink:0}},children:(e.label||"").toUpperCase()}):(e.label||"").toUpperCase()},e.id)))})})]})}),(0,w.jsx)(U.A,{sx:{flex:1,overflowX:"hidden",overflowY:"auto",bgcolor:K,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===ee.length?"100%":"auto","& .MuiTableBody-root .MuiTableCell-root":{py:.7,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},children:[(0,w.jsx)("colgroup",{children:Q.map((e=>(0,w.jsx)("col",{style:{width:e.width||"auto"}},e.id)))}),(0,w.jsx)(Y.A,{children:0!==ee.length||n?ee.map((t=>{var o,r;const a=null!==(o=t.aiScore)&&void 0!==o?o:null,n=null!==(r=t.successRate)&&void 0!==r?r:0;return(0,w.jsxs)(_.A,{sx:{transition:"background-color 0.12s ease","&:hover":{backgroundColor:X.Ay.state.hover}},children:[(0,w.jsx)(R.A,{children:(0,w.jsx)(E.A,{title:t.name,placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(g.A,{onClick:()=>(t=>{const o="SUB"===(null===t||void 0===t?void 0:t.requirementType)&&t.mainReqId?t.mainReqId:t.id;e("/requirements",{state:{requirementId:o}})})(t),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:.5,maxWidth:"100%",px:.5,py:.25,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .requirement-name":{color:"#2563eb"},"& .requirement-icon":{color:"#2563eb"}}},children:[(0,w.jsx)(h.A,{className:"requirement-name",variant:"body2",sx:{fontWeight:700,color:J,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"color 0.2s ease"},children:t.name}),(0,w.jsx)(Je.default,{className:"requirement-icon",sx:{fontSize:14,color:"rgba(0,0,0,0.35)",flexShrink:0,transition:"color 0.2s ease"}})]})})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(re,{value:t.subRequirementsCount||0,color:"#6c757d",border:"rgba(0,0,0,0.22)"})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(ae,{ai:a})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(re,{value:t.testCasesCount||0,color:"#2563eb",border:"rgba(37,99,235,0.35)"})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(re,{value:t.executionsCount||0,color:"#6c757d",border:"rgba(0,0,0,0.22)"})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsxs)(d.A,{spacing:.75,alignItems:"center",children:[(0,w.jsx)(h.A,{sx:{fontWeight:900,color:te(n)},children:"".concat(n.toFixed(1),"%")}),(0,w.jsx)(g.A,{sx:{width:90,height:6,borderRadius:999,bgcolor:"rgba(0,0,0,0.08)",overflow:"hidden"},children:(0,w.jsx)(g.A,{sx:{height:"100%",width:"".concat(Math.max(0,Math.min(100,n)),"%"),bgcolor:te(n),borderRadius:999}})})]})})]},t.id)})):(0,w.jsx)(_.A,{children:(0,w.jsx)(R.A,{colSpan:6,align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:y.A.getText("noRequirementsFound")||"No requirements found"})})})]})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:r,rowsPerPage:m,page:x,onPageChange:(e,t)=>
1b(t),onRowsPerPageChange:e=>{f(parseInt(e.target.value,10)),b(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:K,color:Z,borderTop:"1px solid ".concat(V),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:Z},"& .MuiTablePagination-select":{color:J},"& .MuiIconButton-root":{color:Z}}})]})})};var ko=o(616497),To=o(137324),Do=o(434339),Io=o(562854),Fo=o(870610),Ro=o(23266),Mo=o(397497),zo=o(280489),Eo=o(752322),Po=o(315328),Wo=o(60771),No=o(846335);const Oo="dashboard_taskList_myTasksOnly",Bo="dashboard_taskList_currentProjectOnly",Lo="dashboard_taskList_search",_o="dashboard_taskList_status",Uo="dashboard_taskList_assignedTo",Yo="dashboard_taskList_sortBy",qo="dashboard_taskList_sortOrder",Ho=["name","createDate"],Go=["asc","desc"],Ko="#FFFFFF",Jo="#F6F8FA",Xo="#212529",Zo="#6c757d",Vo="#212529",$o="#6c757d",Qo="rgba(0,0,0,0.15)",er=["#0079BF","#70B500","#FF9F1A","#EB5A46","#F2D600","#C377E0","#FF78CB","#00C2E0","#51E898","#C4C9CC"],tr=e=>er[(e||0)%er.length],or=e=>{const t=String(e).replace("#","");return(.299*parseInt(t.substr(0,2),16)+.587*parseInt(t.substr(2,2),16)+.114*parseInt(t.substr(4,2),16))/255>.55?"#1a1a1a":"#fff"},rr=[{id:"name",align:"left",label:y.A.getText("name"),width:"42%",sortable:!0,sortKey:"name"},{id:"status",align:"left",label:y.A.getText("status"),width:"20%",sortable:!1},{id:"assignedTo",align:"left",label:y.A.getText("assignedTo"),width:"20%",sortable:!1},{id:"date",align:"left",label:y.A.getText("createDate"),width:"18%",sortable:!0,sortKey:"createDate"}],ar=e=>{let{status:t}=e;const o={[zo.A.Open]:{hex:"#1976d2",text:y.A.getText("open")},[zo.A.InProgress]:{hex:"#d97706",text:y.A.getText("inProgress")},[zo.A.Resolved]:{hex:"#16a34a",text:y.A.getText("resolved")},[zo.A.Closed]:{hex:"#dc2626",text:y.A.getText("closed")}}[t]||{hex:X.Ay.text.muted,text:t||"-"},r=o.hex;return(0,w.jsxs)(g.A,{component:"span",sx:{display:"inline-flex",alignItems:"center",gap:.75,px:1,py:.3,borderRadius:"999px",maxWidth:"100%",bgcolor:(0,Mo.X4)(r,.12),border:"1px solid ".concat((0,Mo.X4)(r,.32))},children:[(0,w.jsx)(g.A,{component:"span",sx:{width:8,height:8,borderRadius:"50%",bgcolor:r,flexShrink:0}}),(0,w.jsx)(g.A,{component:"span",sx:{fontSize:"0.75rem",fontWeight:600,color:Vo,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o.text})]})};function nr(){var e,t;const{users:o}=(0,Eo.A)(),{companyWithUserInfoData:r}=(0,Po.h)(),a="ROLE_SUPER_ADMIN"===(null===r||void 0===r||null===(e=r.smartRole)||void 0===e?void 0:e.roleType),n=a?localStorage.getItem("selectedCompanyId"):(null===r||void 0===r||null===(t=r.company)||void 0===t?void 0:t.companyId)||localStorage.getItem("selectedCompanyId"),[l,s]=(0,p.useState)([]),[i,c]=(0,p.useState)([]),[u,x]=(0,p.useState)(0),[m,f]=(0,p.useState)([]),[A,v]=(0,p.useState)([]),[j,S]=(0,p.useState)(0),[C,k]=(0,p.useState)(5),[T,D]=(0,p.useState)(null),[H,G]=(0,p.useState)(null),[K,J]=(0,p.useState)(!1),[Z,V]=(0,p.useState)(!0),[$,Q]=(0,p.useState)(!1),[ee,te]=(0,p.useState)({}),[oe,re]=(0,p.useState)(!1),[ae,ne]=(0,p.useState)(!1),[le,se]=(0,p.useState)([]),[ie,ce]=(0,p.useState)([]),[de,ge]=(0,p.useState)((()=>localStorage.getItem(Lo)||"")),[he,ue]=(0,p.useState)(!1),[xe,be]=(0,p.useState)((()=>localStorage.getItem(Lo)||""));(0,p.useEffect)((()=>{const e=setTimeout((()=>{be(de),S(0);try{localStorage.setItem(Lo,de||"")}catch(e){}}),1e3);return()=>clearTimeout(e)}),[de]);const pe=y.A.getText("searchByName"),me=pe&&"searchByName"!==pe?pe:"Search name",fe=(0,p.useRef)(null),Ae=(0,p.useRef)(null),[ye,ve]=(0,p.useState)((()=>{const e=localStorage.getItem(Oo);return null===e||"true"===e})),[je,Se]=(0,p.useState)((()=>{const e=localStorage.getItem(Bo);return null!==e&&"true"===e})),[we,Ce]=(0,p.useState)((()=>localStorage.getItem(_o)||"")),[ke,Te]=(0,p.useState)((()=>localStorage.getItem(Uo)||"")),[De,Ie]=(0,p.useState)((()=>{try{const e=localStorage.getItem(Yo);if(e&&Ho.includes(e))return e}catch(e){console.error("Error reading sortBy from localStorage:",e)}return"createDate"})),[Fe,Re]=(0,p.useState)((()=>{try{const e=localStorage.getItem(qo);if(e&&Go.includes(e))return e}catch(e){console.error("Error reading sortOrder from localStorage:",e)}return"desc"}));(0,p.useEffect)((()=>{localStorage.setItem(Oo,String(ye))}),[ye]),(0,p.useEffect)((()=>{localStorage.setItem(Bo,String(je))}),[je]),(0,p.useEffect)((()=>{localStorage.setItem(_o,we)}),[we]),(0,p.useEffect)((()=>{localStorage.setItem(Uo,ke)}),[ke]);const Me=(0,p.useCallback)((async()=>{try{V(!0);const e=await Wo.A.getDashboardTasks({currentProjectOnly:je,myTasksOnly:ye,search:xe||null,status:we||null,assignedTo:ke||null,sortBy:De,sortOrder:Fe,companyId:n,page:j,size:C});s(e.content),c(e.content),x(e.totalElements),f(e.statuses),v(e.assignedTos),J(!0)}catch(e){console.error("Defects load error:",e),s([]),c([]),x(0),J(!0)}finally{V(!1)}}),[je,ye,xe,De,Fe,we,ke,j,C,n]);(0,p.useEffect)((()=>{Me()}),[Me]),(0,p.useEffect)((()=>{let e=!1;return(async()=>{try{const t=await Wo.A.getDefectStatuses(a?n:null);e||ce((null===t||void 0===t?void 0:t.data)||[])}catch(t){e||ce([])}})(),()=>{e=!0}}),[n,a]);const ze=e=>{e.stopPropagation(),D(e.currentTarget)},Ee=()=>D(null),Pe=e=>{Ce(e),S(0),Ee()},We=e=>{e.stopPropagation(),G(e.currentTarget)},Ne=()=>G(null),Oe=e=>{Te(e),S(0),Ne()},Be=()=>{Q(!1),setTimeout((()=>{re(!1),te({}),se([])}),250)},Le=e=>{if(!e)return"-";const t=new Date(e),o=String(t.getDate()).padStart(2,"0"),r=String(t.getMonth()+1).padStart(2,"0"),a=t.getFullYear(),n=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return"".concat(o,"/").concat(r,"/").concat(a," ").concat(n,":").concat(l)},_e={[zo.A.Open]:y.A.getText("open"),[zo.A.InProgress]:y.A.getText("inProgress"),[zo.A.Resolved]:y.A.getText("resolved"),[zo.A.Closed]:y.A.getText("closed")},Ue=m,Ye=A,qe=i,He=e=>{let{onClick:t,hasFilter:o,buttonRef:r}=e;return(0,w.jsx)(E.A,{title:y.A.getText("filter")||"Filter",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsxs)(P.A,{ref:r,onClick:t,size:"small",sx:{ml:.25,width:24,height:24,borderRadius:2,border:"1px solid ".concat(Qo),bgcolor:Jo,color:Zo,position:"relative","&:hover":{bgcolor:"rgba(0,0,0,0.03)"}},children:[(0,w.jsx)(ho.default,{fontSize:"small"}),o&&(0,w.jsx)(g.A,{sx:{position:"absolute",top:2,right:2,width:8,height:8,borderRadius:"50%",bgcolor:"#1976d2",border:"1.5px solid #fff"}})]})})},Ge=e=>String(e||"").toLocaleUpperCase("tr-TR");return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:{xs:300,md:320},maxHeight:540},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",display:"flex",flexDirection:"column",bgcolor:Ko,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)",border:"1px solid ".concat(Qo)},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(Qo),background:"linear-gradient(180deg, ".concat(Ko," 0%, ").concat(Jo," 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,w.jsxs)(g.A,{sx:{minWidth:0}
1,children:[(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:Xo,fontSize:"1.1rem"},children:[y.A.getText("taskList"),(0,w.jsx)(E.A,{title:y.A.getText("taskListInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]}),(0,w.jsxs)(d.A,{direction:"row",spacing:1,alignItems:"center",sx:{mt:.75},flexWrap:"wrap",children:[we?(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:"".concat(y.A.getText("status"),": ").concat(_e[we]||we),onDelete:()=>Pe(""),sx:{height:23,borderRadius:2,bgcolor:Jo,borderColor:Qo,fontWeight:700,color:Zo}}):null,ke?(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:"".concat(y.A.getText("assignedTo"),": ").concat(ke),onDelete:()=>Oe(""),sx:{height:23,borderRadius:2,bgcolor:Jo,borderColor:Qo,fontWeight:700,color:Zo}}):null]})]}),(0,w.jsxs)(d.A,{direction:"row",spacing:2,alignItems:"center",flexWrap:"wrap",justifyContent:"flex-end",children:[(0,w.jsx)(ko.A,{control:(0,w.jsx)(To.A,{checked:ye,onChange:e=>ve(e.target.checked),size:"small",sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:Xo},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:Xo}}}),label:(0,w.jsx)(h.A,{variant:"body2",sx:{color:Xo,fontWeight:600,fontSize:13},children:y.A.getText("myTasks")}),sx:{m:0}}),(0,w.jsx)(ko.A,{control:(0,w.jsx)(To.A,{checked:je,onChange:e=>Se(e.target.checked),size:"small",sx:{"& .MuiSwitch-switchBase.Mui-checked":{color:Xo},"& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":{backgroundColor:Xo}}}),label:(0,w.jsx)(h.A,{variant:"body2",sx:{color:Xo,fontWeight:600,fontSize:13},children:y.A.getText("currentProject")}),sx:{m:0}})]})]})}),Z&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flexShrink:0,bgcolor:X.Ay.surface.sunken,borderBottom:"1px solid ".concat(Qo)},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:0,height:38,borderBottom:"none"}},children:[(0,w.jsx)("colgroup",{children:rr.map((e=>(0,w.jsx)("col",{style:{width:e.width}},e.id)))}),(0,w.jsx)(L.A,{children:(0,w.jsx)(_.A,{children:rr.map((e=>(0,w.jsx)(R.A,{align:e.align,title:e.label,sortDirection:!(!e.sortable||De!==e.sortKey)&&Fe,sx:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",bgcolor:"transparent"},children:"name"===e.id?(0,w.jsx)(W.A,{value:de,onChange:e=>ge(e.target.value),onClick:e=>e.stopPropagation(),onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),placeholder:me,size:"small",variant:"outlined",fullWidth:!0,InputProps:{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{mr:.5},children:(0,w.jsx)(Et.default,{sx:{fontSize:18,color:Zo}})}),endAdornment:he&&de?(0,w.jsx)(N.A,{position:"end",children:(0,w.jsx)(P.A,{size:"small",edge:"end","aria-label":"clear",onClick:()=>ge(""),sx:{p:.25},children:(0,w.jsx)(zt.default,{sx:{fontSize:16}})})}):null},sx:{my:.4,"& .MuiOutlinedInput-root":{height:28,fontSize:"0.8rem",bgcolor:"#fff",borderRadius:2,"& fieldset":{borderColor:Qo},"&:hover fieldset":{borderColor:Zo},"&.Mui-focused fieldset":{borderColor:"rgba(0,0,0,0.28)"}},"& .MuiOutlinedInput-input":{py:.4}}}):"status"===e.id?(0,w.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,sx:{minWidth:0,overflow:"hidden"},children:[(0,w.jsx)(g.A,{component:"span",sx:{lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ge(e.label)}),(0,w.jsx)(g.A,{sx:{flexShrink:0},children:(0,w.jsx)(He,{onClick:ze,hasFilter:!!we,buttonRef:fe})})]}):"assignedTo"===e.id?(0,w.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:.5,sx:{minWidth:0,overflow:"hidden"},children:[(0,w.jsx)(g.A,{component:"span",sx:{lineHeight:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ge(e.label)}),(0,w.jsx)(g.A,{sx:{flexShrink:0},children:(0,w.jsx)(He,{onClick:We,hasFilter:!!ke,buttonRef:Ae})})]}):e.sortable?(0,w.jsx)(M.A,{active:De===e.sortKey,direction:De===e.sortKey?Fe:"asc",onClick:()=>(e=>{const t=De===e&&"asc"===Fe?"desc":"asc";Re(t),Ie(e),S(0);try{localStorage.setItem(Yo,e),localStorage.setItem(qo,t)}catch(o){console.error("Error saving sort preferences to localStorage:",o)}})(e.sortKey),sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit",maxWidth:"100%",overflow:"hidden","& .MuiTableSortLabel-icon":{flexShrink:0}},children:(0,w.jsx)(g.A,{component:"span",sx:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"inline-block",maxWidth:"100%"},children:Ge(e.label)})}):Ge(e.label)},e.id)))})})]})}
1),(0,w.jsx)(U.A,{sx:{flex:1,overflowY:"auto",overflowX:"hidden",bgcolor:Ko,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%",height:0===qe.length?"100%":"auto","& tbody .MuiTableCell-root":{py:1.1}},children:[(0,w.jsx)("colgroup",{children:rr.map((e=>(0,w.jsx)("col",{style:{width:e.width}},e.id)))}),(0,w.jsx)(Y.A,{children:0===qe.length?(0,w.jsx)(_.A,{children:(0,w.jsx)(R.A,{colSpan:4,align:"center",sx:{verticalAlign:"middle",fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:y.A.getText("noTaskFound")})}):qe.map((e=>(0,w.jsxs)(_.A,{sx:{transition:"background-color 0.12s ease","&:hover":{backgroundColor:X.Ay.state.hover}},children:[(0,w.jsx)(R.A,{children:(0,w.jsx)(E.A,{title:e.name||"",placement:"top-start",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(g.A,{onClick:()=>(async e=>{const t=localStorage.getItem("projectId");te(e||{}),re(!0),se([]),Q(!0);const o=null===e||void 0===e?void 0:e.id;if(o)try{ne(!0);const e=await Wo.A.getDefectById(o,t);null!==e&&void 0!==e&&e.data&&te(e.data)}catch(r){console.error("Task detail load error:",r)}finally{ne(!1)}})(e),sx:{cursor:"pointer",display:"inline-flex",alignItems:"center",maxWidth:"100%",height:24,borderRadius:1,transition:"all 0.2s ease","&:hover":{bgcolor:"rgba(37, 99, 235, 0.08)","& .task-name":{color:"#2563eb"},"& .task-icon":{color:"#2563eb"}}},children:(0,w.jsx)(h.A,{className:"task-name",variant:"body2",noWrap:!0,sx:{maxWidth:300,fontWeight:700,color:Vo,transition:"color 0.2s ease"},children:e.name})})})}),(0,w.jsx)(R.A,{children:(0,w.jsx)(ar,{status:e.status})}),(0,w.jsx)(R.A,{children:(()=>{const t=e.assignees&&e.assignees.length>0?e.assignees:e.assignedTo?[{userId:e.assignedToUserId,userFullName:e.assignedTo}]:[];return 0===t.length?(0,w.jsx)(h.A,{variant:"body2",sx:{color:$o},children:"-"}):(0,w.jsx)(g.A,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-start"},children:(0,w.jsx)(Do.A,{max:3,sx:{"& .MuiAvatar-root":{width:24,height:24,fontSize:"0.65rem",fontWeight:700,lineHeight:1,border:"2px solid #fff",boxShadow:"0 1px 3px rgba(16,24,40,0.16)"}},children:t.map((e=>{return(0,w.jsx)(E.A,{enterDelay:500,enterNextDelay:500,title:e.userFullName||"",arrow:!0,children:(0,w.jsx)(Io.A,{sx:{bgcolor:tr(e.userId),color:or(tr(e.userId)),display:"flex",alignItems:"center",justifyContent:"center",lineHeight:1,textAlign:"center","& .MuiAvatar-fallback":{display:"none"}},children:(t=e.userFullName,t?t.split(" ").filter(Boolean).map((e=>{var t;return null===(t=e[0])||void 0===t?void 0:t.toUpperCase()})).join("").slice(0,2):"?")})},e.userId);var t}))})})})()}),(0,w.jsx)(R.A,{children:(0,w.jsx)(h.A,{variant:"body2",noWrap:!0,sx:{color:$o,fontWeight:600},children:Le(null===e||void 0===e?void 0:e.createDate)})})]},e.id)))})]})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:u,rowsPerPage:C,page:j,onPageChange:(e,t)=>
1S(t),onRowsPerPageChange:e=>{k(parseInt(e.target.value,10)),S(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:Ko,color:$o,borderTop:"1px solid ".concat(Qo),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:$o},"& .MuiTablePagination-select":{color:Xo},"& .MuiIconButton-root":{color:$o}}})]})}),(0,w.jsxs)(Fo.A,{anchorEl:T,open:Boolean(T),onClose:Ee,anchorReference:"anchorPosition",anchorPosition:T?{top:T.getBoundingClientRect().bottom+4,left:T.getBoundingClientRect().left}:void 0,PaperProps:{sx:{borderRadius:2,border:"1px solid ".concat(Qo),boxShadow:"0 12px 30px rgba(0,0,0,0.12)",minWidth:120}},children:[(0,w.jsx)(Ro.A,{onClick:()=>Pe(""),selected:""===we,children:y.A.getText("all")}),Ue.map((e=>(0,w.jsx)(Ro.A,{onClick:()=>Pe(e),selected:we===e,children:_e[e]||e},e)))]}),(0,w.jsxs)(Fo.A,{anchorEl:H,open:Boolean(H),onClose:Ne,anchorReference:"anchorPosition",anchorPosition:H?{top:H.getBoundingClientRect().bottom+4,left:H.getBoundingClientRect().left}:void 0,PaperProps:{sx:{borderRadius:2,border:"1px solid ".concat(Qo),boxShadow:"0 12px 30px rgba(0,0,0,0.12)",minWidth:120}},children:[(0,w.jsx)(Ro.A,{onClick:()=>Oe(""),selected:""===ke,children:y.A.getText("all")}),Ye.map((e=>(0,w.jsx)(Ro.A,{onClick:()=>Oe(e),selected:ke===e,children:e},e)))]}),(0,w.jsx)(No.A,{openAddUpdateDefectFormDialog:$,newDefect:ee,setNewDefect:te,users:o,editMode:oe,companyStatuses:ie,detailLoading:ae,handleAddOrUpdateDefect:async()=>{try{if(!ee.name)return void(0,b.M8)(y.A.getText("taskNameRequired")||"Please fill in task name.",{variant:"warning"});const e=localStorage.getItem("projectId");await Wo.A.updateDefect(ee.id,ee,e),Be(),Me()}catch(e){console.error("Task update error:",e),(0,b.M8)(y.A.getText("errorOccurred")||"An error occurred.",{variant:"error"})}},handleCloseAddUpdateDefectFormDialog:Be,fetchDefectsList:Me,pendingAttachments:le,setPendingAttachments:se})]})}var lr=o(173303);const sr="".concat("https://app.smartestqa.ai","/api/user-statistics"),ir={async getUserStatisTics(e){try{return(await G.Ay.get("".concat(sr,"/get/").concat(e))).data.data}catch(t){throw console.error("User Statistics fetch error:",t),t}},async getUserStatisTicsByLastMonth(e){try{return(await G.Ay.get("".concat(sr,"/get/last-month/").concat(e))).data.data}catch(t){throw console.error("User Statistics fetch error (last month):",t),t}},async getUserStatisTicsByLastWeek(e){try{return(await G.Ay.get("".concat(sr,"/get/last-week/").concat(e))).data.data}catch(t){throw console.error("User Statistics fetch error (last week):",t),t}},async getUserStatisTicsPaged(e){let{page:t=0,size:o=5,search:r="",sortBy:a="testCaseCount",sortOrder:n="desc",startDate:l=null,endDate:s=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{const i={};if(l&&s){const e=e=>{const t=new Date(e),o=e=>String(e).padStart(2,"0");return"".concat(t.getFullYear(),"-").concat(o(t.getMonth()+1),"-").concat(o(t.getDate()),"T").concat(o(t.getHours()),":").concat(o(t.getMinutes()),":").concat(o(t.getSeconds()))};i.startDate=e(l),i.endDate=e(s)}i.page=t,i.size=o,i.sortBy=a,i.sortOrder=n,r&&(i.search=r);return(await G.Ay.get("".concat(sr,"/get/paged/").concat(e),{params:i})).data.data}catch(i){throw console.error("User Statistics fetch error (paged):",i),i}},async getUserStatisTicsByDateRange(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"testCaseCount",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"desc";try{const l={};if(t&&o){const e=e=>{const t=new Date(e),o=e=>String(e).padStart(2,"0");return"".concat(t.getFullYear(),"-").concat(o(t.getMonth()+1),"-").concat(o(t.getDate()),"T").concat(o(t.getHours()),":").concat(o(t.getMinutes()),":").concat(o(t.getSeconds()))};l.startDate=e(t),l.endDate=e(o)}l.sortBy=a,l.sortOrder=n,console.log("\ud83d\udcca [UserStats] Fetching:",(0,r.A)({projectId:e},l));return(await G.Ay.get("".concat(sr,"/get/").concat(e),{params:l})).data.data}catch(l){throw console.error("User Statistics fetch error (date range):",l),l}}},cr="dashboard_userStats_dateRangeType",dr="dashboard_userStats_dateRangeStart",gr="dashboard_userStats_dateRangeEnd",hr="dashboard_userStats_sortBy",ur="dashboard_userStats_sortOrder",xr=["today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisYear","lastYear","custom"],br=["testCaseCount","pendingTaskCount"],pr=["asc","desc"],mr="dashboard_userStats_search",fr="#FFFFFF",Ar="#F6F8FA",yr="#212529",vr="#6c757d",jr="#6c757d",Sr="rgba(0,0,0,0.15)",wr="rgba(0,0,0,0.12)",Cr=e=>{const t=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate());let r,a;switch(e){case"today":r=o,a=new Date(o.getTime()+864e5-1);break;case"yesterday":r=new Date(o.getTime()-864e5),a=new Date(o.getTime()-1);break;case"thisWeek":{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1);break}case"lastWeek":{const e=t.getDay(),n=0===e?6:e-1,l=new Date(o.getTime()-24*n*60*60*1e3);r=new Date(l.getTime()-6048e5),a=new Date(l.getTime()-1);break}case"thisMonth":default:r=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break;case"lastMonth":r=new Date(t.getFullYear(),t.getMonth()-1,1),a=new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999);break;case"thisYear":r=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),11,31,23,59,59,999);break;case"lastYear":r=new Date(t.getFullYear()-1,0,1),a=new Date(t.getFullYear()-1,11,31,23,59,59,999)}return{start:r.toISOString(),end:a.toISOString(),type:e}};function kr(){const[e,t]=(0,p.useState)([]),[o,a]=(0,p.useState)(0),[n,l]=(0,p.useState)((()=>localStorage.getItem(mr)||"")),[s,i]=(0,p.useState)((()=>localStorage.getItem(mr)||"")),[c,u]=(0,p.useState)(0),[x,b]=(0,p.useState)(5),[m,f]=(0,p.useState)(!0),[A,j]=(0,p.useState)((()=>(()=>{try{const e=localStorage.getItem(cr);if(e&&xr.includes(e)){if("custom"===e){const e=localStorage.getItem(dr),t=localStorage.getItem(gr);if(e&&t)return{start:e,end:t,type:"custom"}}return Cr(e)}}catch(e){console.error("Error reading dateRange from localStorage:",e)}return Cr("thisMonth")})())),[S,C]=(0,p.useState)((()=>{try{const e=localStorage.getItem(hr);if(e&&br.includes(e))return e}catch(e){console.error("Error reading sortBy from localStorage:",e)}return"testCaseCount"})),[k,T]=(0,p.useState)((()=>{try{const e=localStorage.getItem(ur);if(e&&pr.includes(e))return e}catch(e){console.error("Error reading sortOrder from localStorage:",e)}return"desc"}));(0,p.useEffect)((()=>{try{localStorage.setItem(cr,A.type||"thisMonth"),"custom"===A.type&&A.start&&A.end&&(localStorage.setItem(dr,A.start),localStorage.setItem(gr,A.end))}catch(e){console.error("Error saving dateRange to localStorage:",e)}}),[A]),(0,p.useEffect)((()=>{try{localStorage.setItem(hr,S),localStorage.setItem(ur,k)}catch(e){console.error("Error saving sort preferences to localStorage:",e)}}),[S,k]),(0,p.useEffect)((()=>{const e=setTimeout((()=>{i(n.trim()),u(0);try{localStorage.setItem(mr,n||"")}catch(e){}}),1e3);return()=>clearTimeout(e)}),[n]);const D=(0,p.useCallback)((async()=>{try{f(!0);const e=localStorage.getItem("projectId"),o=await ir.getUserStatisTicsPaged(e,{page:c,size:x,search:s,sortBy:S,sortOrder:k,startDate:A.start,endDate:A.end});t(Array.isArray(null===o||void 0===o?void 0:o.content)?o.content:[]),a((null===o||void 0===o?void 0:o.totalElements)||0)}catch(e){console.error("User Statistics fetch error:",e),t([]),a(0)}finally{f(!1)}}),[A,S,k,c,x,s]);(0,p.useEffect)((()=>{D()}),[D]);const P=(0,p.useMemo)((()=>(e||[]).map((e=>
1null===e||void 0===e?void 0:e.fullName)).filter(Boolean)),[e]),H=e,G=(0,p.useRef)(null),[K,J]=(0,p.useState)(0);(0,p.useEffect)((()=>{const e=G.current;if(!e)return;const t=()=>{const t=Math.floor(e.clientHeight/45);J(Math.max(0,t-H.length))};let o;return t(),"undefined"!==typeof ResizeObserver&&(o=new ResizeObserver(t),o.observe(e)),()=>o&&o.disconnect()}),[H.length,m]);const Z=(0,p.useMemo)((()=>[{id:"fullName",label:y.A.getText("username").toUpperCase(),align:"left",width:"46%",sortable:!1},{id:"testCaseCount",label:y.A.getText("testCaseCount").toUpperCase(),align:"center",width:"27%",sortable:!0,sortKey:"testCaseCount"},{id:"pendingTaskCount",label:y.A.getText("pendingCases").toUpperCase(),align:"center",width:"27%",sortable:!0,sortKey:"pendingTaskCount"}]),[]);return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:320,maxHeight:540},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:3,overflow:"hidden",display:"flex",flexDirection:"column",bgcolor:fr,border:"1px solid ".concat(Sr),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(Sr),background:"linear-gradient(180deg, ".concat(fr," 0%, ").concat(Ar," 100%)")},children:(0,w.jsxs)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:[(0,w.jsx)(g.A,{sx:{minWidth:0},children:(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:yr,fontSize:"1.1rem"},children:[y.A.getText("userStatistics"),(0,w.jsx)(E.A,{title:y.A.getText("userStatisticsInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]})}),(0,w.jsx)(v.A,{onDateRangeChange:(e,t,o)=>{j({start:e,end:t,type:o}),u(0)},defaultRange:A.type||"thisMonth",appearance:{backgroundColor:"#fff",borderColor:Sr,textColor:yr,iconColor:vr,hoverBgColor:"rgba(0,0,0,0.03)"},slotSx:{button:{height:32,py:0,px:1.5,fontSize:"0.8125rem",borderRadius:2}}})]})}),m&&(0,w.jsx)(O.A,{}),(0,w.jsx)(g.A,{sx:{flexShrink:0,bgcolor:X.Ay.surface.sunken,borderBottom:"1px solid ".concat(Sr)},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& .MuiTableCell-root":{py:0,height:38,borderBottom:"none"}},children:[(0,w.jsx)("colgroup",{children:Z.map((e=>(0,w.jsx)("col",{style:{width:e.width}},e.id)))}),(0,w.jsx)(L.A,{children:(0,w.jsx)(_.A,{children:Z.map((e=>(0,w.jsx)(R.A,{align:e.align,sortDirection:!(!e.sortable||S!==e.sortKey)&&k,sx:{width:e.width},children:"fullName"===e.id?(0,w.jsx)(Me.A,{options:P,value:n,freeSolo:!0,size:"small",sx:{"& .MuiAutocomplete-clearIndicator":{p:.25},"& .MuiAutocomplete-clearIndicator .MuiSvgIcon-root":{fontSize:15}},onInputChange:(e,t)=>
1{u(0),l(t||"")},onChange:(e,t)=>{const o=(t||"").trim();l(t||""),i(o),u(0);try{localStorage.setItem(mr,t||"")}catch(r){}},renderInput:e=>(0,w.jsx)(W.A,(0,r.A)((0,r.A)({},e),{},{placeholder:y.A.getText("searchUsername"),size:"small",variant:"outlined",InputProps:(0,r.A)((0,r.A)({},e.InputProps),{},{startAdornment:(0,w.jsx)(N.A,{position:"start",sx:{ml:1,mr:.5},children:(0,w.jsx)(Et.default,{sx:{fontSize:18,color:vr}})})}),sx:{"& .MuiOutlinedInput-root":{height:28,borderRadius:2,bgcolor:"#fff",fontSize:"0.8rem","& fieldset":{borderColor:Sr},"&:hover fieldset":{borderColor:vr},"&.Mui-focused fieldset":{borderColor:"rgba(0,0,0,0.28)"}},"& .MuiAutocomplete-input":{paddingLeft:0},"& input":{py:.4}}}))}):e.sortable?(0,w.jsx)(M.A,{active:S===e.sortKey,direction:S===e.sortKey?k:"asc",onClick:()=>{return t=e.sortKey,T(S===t&&"asc"===k?"desc":"asc"),C(t),void u(0);var t},sx:{fontSize:"inherit",fontWeight:"inherit",color:"inherit"},children:e.label}):e.label},e.id)))})})]})}),(0,w.jsx)(U.A,{ref:G,sx:{flex:1,overflow:"auto",bgcolor:fr,scrollbarWidth:"thin",scrollbarColor:"transparent transparent","&:hover":{scrollbarColor:"rgba(0,0,0,0.25) transparent"},"&::-webkit-scrollbar":{width:8,height:8},"&::-webkit-scrollbar-thumb":{backgroundColor:"transparent",borderRadius:8,transition:"background-color 0.2s ease"},"&:hover::-webkit-scrollbar-thumb":{backgroundColor:"rgba(0,0,0,0.25)"}},children:(0,w.jsxs)(B.A,{size:"small",sx:{tableLayout:"fixed",width:"100%","& tbody .MuiTableCell-root":{py:1.1}},children:[(0,w.jsx)("colgroup",{children:Z.map((e=>(0,w.jsx)("col",{style:{width:e.width}},e.id)))}),(0,w.jsx)(Y.A,{children:0===H.length?(0,w.jsx)(_.A,{children:(0,w.jsx)(R.A,{colSpan:3,align:"center",sx:{py:4,fontSize:"0.8rem",color:X.Ay.text.faint,borderBottom:0},children:y.A.getText("noDataAvailable")})}):(0,w.jsxs)(w.Fragment,{children:[H.map(((e,t)=>(0,w.jsxs)(_.A,{sx:{transition:"background-color 0.12s ease","&:hover":{backgroundColor:X.Ay.state.hover}},children:[(0,w.jsx)(R.A,{children:(0,w.jsx)(lr.A,{name:e.fullName,maxWidth:240})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:e.testCaseCount||0,sx:{height:24,borderRadius:2,bgcolor:Ar,borderColor:wr,fontWeight:900,color:"#2563eb",minWidth:48}})}),(0,w.jsx)(R.A,{align:"center",children:(0,w.jsx)(F.A,{size:"small",variant:"outlined",label:e.pendingTaskCount||0,sx:{height:24,borderRadius:2,bgcolor:Ar,borderColor:wr,fontWeight:900,color:vr,minWidth:48}})})]},t))),Array.from({length:K}).map(((e,t)=>(0,w.jsx)(_.A,{sx:{height:45},children:(0,w.jsx)(R.A,{colSpan:Z.length,sx:{borderBottom:"none",p:0}})},"filler-".concat(t))))]})})]})}),(0,w.jsx)(q.A,{rowsPerPageOptions:[5,10,25,50],component:"div",count:o,rowsPerPage:x,page:c,onPageChange:(e,t)=>
1u(t),onRowsPerPageChange:e=>{b(parseInt(e.target.value,10)),u(0)},labelRowsPerPage:"".concat(y.A.getText("rows"),":"),sx:{bgcolor:fr,color:jr,borderTop:"1px solid ".concat(Sr),"& .MuiTablePagination-selectLabel, & .MuiTablePagination-displayedRows":{color:jr},"& .MuiTablePagination-select":{color:yr},"& .MuiIconButton-root":{color:jr}}})]})})}var Tr=o(446639),Dr=o(965429),Ir=o(425102);const Fr="dashboard_weeklyMetrics_visibleMetrics",Rr="#FFFFFF",Mr="#212529",zr="#6c757d",Er="rgba(0,0,0,0.15)",Pr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.12;const o=e.replace("#",""),r=parseInt(o.substring(0,2),16),a=parseInt(o.substring(2,4),16),n=parseInt(o.substring(4,6),16);return"rgba(".concat(r,", ").concat(a,", ").concat(n,", ").concat(t,")")},Wr=()=>{const e={testCases:!0,requirements:!0,reqScore:!0,successRate:!0,coverage:!0};try{const t=localStorage.getItem(Fr);if(t){const o=JSON.parse(t),r=Object.keys(e);if(r.every((e=>"boolean"===typeof o[e])))return o}}catch(t){console.error("Error reading visibleMetrics from localStorage:",t)}return e},Nr=()=>{const[e,t]=(0,p.useState)([]),[o,a]=(0,p.useState)(!0),[n,l]=(0,p.useState)(null),[i]=(0,p.useState)([{key:"testCases",name:y.A.getText("weeklyTestCasesLabel"),icon:"\ud83d\udcdd",color:"#1976d2",unit:"count"},{key:"requirements",name:y.A.getText("requirements"),icon:"\ud83d\udccb",color:"#9c27b0",unit:"count"},{key:"reqScore",name:y.A.getText("reqScore"),icon:"\u2b50",color:"#f57c00",unit:"score"},{key:"successRate",name:y.A.getText("successRate"),icon:"\u2705",color:"#2e7d32",unit:"percentage"},{key:"coverage",name:y.A.getText("coverage"),icon:"\ud83d\udcca",color:"#0288d1",unit:"percentage"}]),[c,u]=(0,p.useState)(Wr);(0,p.useEffect)((()=>{try{localStorage.setItem(Fr,JSON.stringify(c))}catch(e){console.error("Error saving visibleMetrics to localStorage:",e)}}),[c]);const x=(e,t)=>{const o=String(y.A.getText("monthsShort")||"").split(","),r=e=>{const t=new Date(e),r=o[t.getMonth()]||t.toLocaleDateString("en-US",{month:"short"});return"".concat(r," ").concat(t.getDate())};return"".concat(r(e),"-").concat(r(t))};(0,p.useEffect)((()=>{(async()=>{try{a(!0),l(null);const e=localStorage.getItem("projectId"),o=5;if(!e||"null"===e)return t([]),void a(!1);const r=(await A.A.getWeeklyMetrics(e,o)||[]).map((e=>{var t,o,r,a,n;return{week:e.week,weekLabel:"W".concat(e.week),dateRange:x(e.startDate,e.endDate),testCases:null!==(t=e.testCasesCreated)&&void 0!==t?t:0,requirements:null!==(o=e.requirementsCreated)&&void 0!==o?o:0,reqScore:Math.round(10*(null!==(r=e.avgRequirementScore)&&void 0!==r?r:0))/10,successRate:Math.round(10*(null!==(a=e.successRate)&&void 0!==a?a:0))/10,coverage:Math.round(10*(null!==(n=e.testCoverage)&&void 0!==n?n:0))/10}}));t(r)}catch(o){var e;console.error("Error fetching weekly metrics:",o),400!==(null===o||void 0===o||null===(e=o.response)||void 0===e?void 0:e.status)&&l((null===o||void 0===o?void 0:o.message)||"Failed to load weekly metrics"),t([])}finally{a(!1)}})()}),[]);const b=t=>{let{active:o,payload:r,label:a}=t;if(!o||null===r||void 0===r||!r.length)return null;const n=e.find((e=>e.weekLabel===a));return(0,w.jsxs)(z.A,{elevation:0,sx:{p:1.75,bgcolor:"rgba(255,255,255,0.98)",border:"1px solid ".concat(Er),borderRadius:2.5,minWidth:220,boxShadow:"0 14px 30px rgba(0,0,0,0.10)"},children:[(0,w.jsx)(h.A,{variant:"subtitle2",sx:{mb:1,color:Mr,fontWeight:800},children:(null===n||void 0===n?void 0:n.dateRange)||a}),r.map(((e,t)=>{var o,r,a;const n=i.find((t=>t.key===e.dataKey));let l=e.value;return"percentage"===(null===n||void 0===n?void 0:n.unit)&&(l="".concat(Number(null!==(o=e.value)&&void 0!==o?o:0).toFixed(1),"%")),"score"===(null===n||void 0===n?void 0:n.unit)&&(l="".concat(Number(null!==(r=e.value)&&void 0!==r?r:0).toFixed(1),"/10")),"count"===(null===n||void 0===n?void 0:n.unit)&&(l="".concat(Number(null!==(a=e.value)&&void 0!==a?a:0).toLocaleString())),(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"center",gap:1,mb:.75},children:[(0,w.jsx)(g.A,{sx:{width:10,height:10,bgcolor:e.color,borderRadius:999}}),(0,w.jsx)(h.A,{variant:"body2",sx:{flex:1,color:zr,fontWeight:700},children:e.name}),(0,w.jsx)(h.A,{variant:"body2",sx:{color:Mr,fontWeight:900},children:l})]},t)}))]})},m=t=>{let{x:o,y:r,payload:a}=t;const n=e.find((e=>e.weekLabel===a.value));return(0,w.jsxs)("g",{transform:"translate(".concat(o,",").concat(r,")"),children:[(0,w.jsx)("text",{x:0,y:0,dy:16,textAnchor:"middle",fill:Mr,fontSize:12,fontWeight:800,children:a.value}),(0,w.jsx)("text",{x:0,y:0,dy:32,textAnchor:"middle",fill:zr,fontSize:10,
1children:(null===n||void 0===n?void 0:n.dateRange)||""})]})},f=()=>(0,w.jsx)(d.A,{direction:"row",flexWrap:"wrap",useFlexGap:!0,justifyContent:"center",spacing:1,sx:{pb:1.25},children:i.map((e=>{const t=c[e.key];return(0,w.jsx)(F.A,{onClick:()=>{return t=e.key,void u((e=>(0,r.A)((0,r.A)({},e),{},{[t]:!e[t]})));var t},clickable:!0,size:"small",label:(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"center",gap:.75},children:[(0,w.jsx)(g.A,{sx:{width:10,height:10,borderRadius:"50%",bgcolor:e.color,opacity:t?1:.35}}),(0,w.jsx)(h.A,{sx:{fontSize:12,fontWeight:t?900:700,color:t?Mr:zr},children:e.name})]}),sx:{borderRadius:2,height:28,bgcolor:t?"rgba(0,0,0,0.02)":"rgba(0,0,0,0.01)",border:"1px solid ".concat(t?"rgba(0,0,0,0.10)":"rgba(0,0,0,0.06)"),"&:hover":{bgcolor:"rgba(0,0,0,0.04)"}}},e.key)}))});return(0,w.jsx)(g.A,{sx:{width:"100%",height:"100%",minHeight:600},children:(0,w.jsxs)(z.A,{elevation:0,sx:{width:"100%",height:"100%",borderRadius:2,overflow:"hidden",backgroundColor:Rr,border:"1px solid ".concat(Er),boxShadow:"0 2px 8px rgba(0, 0, 0, 0.16)",display:"flex",flexDirection:"column"},children:[(0,w.jsx)(g.A,{sx:{px:2.25,py:2,borderBottom:"1px solid ".concat(Er),background:"linear-gradient(180deg, ".concat(Rr," 0%, rgba(0,0,0,0.02) 100%)")},children:(0,w.jsx)(d.A,{direction:"row",justifyContent:"space-between",alignItems:"center",spacing:2,children:(0,w.jsx)(d.A,{spacing:.25,sx:{minWidth:0},children:(0,w.jsx)(d.A,{direction:"row",spacing:1,alignItems:"center",children:(0,w.jsxs)(h.A,{variant:"h6",sx:{display:"inline-flex",alignItems:"center",fontWeight:600,color:Mr,fontSize:"1.1rem"},noWrap:!0,children:[y.A.getText("weeklyMetricsDashboard"),(0,w.jsx)(E.A,{title:y.A.getText("weeklyMetricsDashboardInfo"),placement:"top",arrow:!0,enterDelay:500,enterNextDelay:500,children:(0,w.jsx)(I.default,{sx:{fontSize:16,color:"rgba(0,0,0,0.40)",cursor:"help",verticalAlign:"middle",ml:.5}})})]})})})})}),(0,w.jsx)(g.A,{sx:{flex:1,p:2,minHeight:420},children:o?(0,w.jsx)(g.A,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100%"},children:(0,w.jsx)(Tr.A,{})}):n?(0,w.jsx)(Dr.A,{severity:"error",sx:{m:2},children:n}):0===e.length?(0,w.jsx)(Dr.A,{severity:"info",sx:{m:2},children:y.A.getText("noDataAvailableForPeriod")}):(0,w.jsx)(mt.u,{width:"100%",height:"100%",children:(0,w.jsxs)(ft.E,{data:e,margin:{top:8,right:20,left:10,bottom:10},barGap:4,barCategoryGap:"18%",children:[(0,w.jsx)(At.d,{strokeDasharray:"3 3",stroke:Er,vertical:!1}),(0,w.jsx)(yt.W,{dataKey:"weekLabel",tick:(0,w.jsx)(m,{}),height:60}),(0,w.jsx)(vt.h,{domain:[0,100],ticks:[0,20,40,60,80,100],tick:{fontSize:12,fill:zr}}),(0,w.jsx)(jt.m,{content:(0,w.jsx)(b,{}),cursor:{fill:"rgba(0, 0, 0, 0.05)"}}),(0,w.jsx)(Ir.s,{content:(0,w.jsx)(f,{}),verticalAlign:"top",height:44}),i.map((e=>c[e.key]?(0,w.jsx)(St.y,{dataKey:e.key,name:e.name,fill:e.color,radius:[8,8,0,0],maxBarSize:34},e.key):null))]})})}),!o&&!n&&e.length>0&&(0,w.jsxs)(g.A,{sx:{p:1.75,backgroundColor:Rr,borderTop:"1px solid ".concat(Er)},children:[(0,w.jsxs)(h.A,{variant:"subtitle2",sx:{mb:1.25,color:Mr,fontWeight:900},children:["\ud83d\udcc8 ",e.length,"-",y.A.getText("weekTrends")," \u2022 ",y.A.getText("clickLegendToToggle")]}),(0,w.jsx)(d.A,{direction:"row",spacing:1.25,flexWrap:"wrap",useFlexGap:!0,children:i.map((t=>{if(!c[t.key])return null;const o=(t=>{var o,r,a,n;if(e.length<2)return{change:0,percentChange:0,isPositive:!1};const l=Number(null!==(o=null===(r=e[0])||void 0===r?void 0:r[t])&&void 0!==o?o:0),s=Number(null!==(a=null===(n=e[e.length-1])||void 0===n?void 0:n[t])&&void 0!==a?a:0)-l;return{change:s,percentChange:0!==l?(s/l*100).toFixed(1):"0.0",isPositive:s>0}})(t.key);let a=o.change;return"score"===t.unit&&(a="".concat(Number(o.change).toFixed(1)," pts")),"percentage"===t.unit&&(a="".concat(Number(o.change).toFixed(1),"%")),"count"===t.unit&&(a="".concat(Number(o.change).toLocaleString())),(0,w.jsx)(F.A,{icon:(0,w.jsx)(s.default,{sx:{fontSize:16,color:o.isPositive?"#28a745":"#dc3545",transform:o.isPositive?"none":"rotate(180deg)"}}),label:(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"center",gap:1.4},children:[(0,w.jsx)(h.A,{variant:"caption",sx:{color:zr,fontWeight:900,letterSpacing:"0.08em"},children:t.name}),(0,w.jsx)(D.default,{sx:{fontSize:6,color:t.color,opacity:.65}}),(0,w.jsxs)(h.A,{variant:"caption",sx:{fontWeight:900,color:o.isPositive?"#28a745":"#dc3545",fontSize:"0.92rem"},children:[o.isPositive?"+":"",a]}),(0,w.jsxs)(h.A,{variant:"caption",sx:{color:zr,fontWeight:800},children:["(",o.isPositive?"+":"",o.percentChange,"%)"]})]}),size:"small",variant:"outlined",sx:(0,r.A)((0,r.A)({height:34,px:1.2,borderRadius:2,border:"1px solid"},(n=t.color,{bgcolor:Pr(n,.1),borderColor:Pr(n,.18),"&:hover":{bgcolor:Pr(n,.14)}})),{}
1,{"& .MuiChip-label":{px:.6},"& .MuiChip-icon":{ml:.8}})},t.key);var n}))})]})]})})},Or="dashboard_reqSummary_dateRangeType",Br="dashboard_reqSummary_dateRangeStart",Lr="dashboard_reqSummary_dateRangeEnd",_r=["today","yesterday","thisWeek","lastWeek","thisMonth","lastMonth","thisYear","lastYear","custom"],Ur=e=>{const t=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate());let r,a;switch(e){case"today":r=o,a=new Date(o.getTime()+864e5-1);break;case"yesterday":r=new Date(o.getTime()-864e5),a=new Date(o.getTime()-1);break;case"thisWeek":{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1);break}case"lastWeek":{const e=t.getDay(),n=0===e?6:e-1,l=new Date(o.getTime()-24*n*60*60*1e3);r=new Date(l.getTime()-6048e5),a=new Date(l.getTime()-1);break}case"thisMonth":r=new Date(t.getFullYear(),t.getMonth(),1),a=new Date(t.getFullYear(),t.getMonth()+1,0,23,59,59,999);break;case"lastMonth":r=new Date(t.getFullYear(),t.getMonth()-1,1),a=new Date(t.getFullYear(),t.getMonth(),0,23,59,59,999);break;case"thisYear":r=new Date(t.getFullYear(),0,1),a=new Date(t.getFullYear(),11,31,23,59,59,999);break;case"lastYear":r=new Date(t.getFullYear()-1,0,1),a=new Date(t.getFullYear()-1,11,31,23,59,59,999);break;default:{const e=t.getDay(),n=0===e?6:e-1;r=new Date(o.getTime()-24*n*60*60*1e3),a=new Date(r.getTime()+6048e5-1)}}return{start:r.toISOString(),end:a.toISOString(),type:e}},Yr=()=>{var e,t;const[o,S]=(0,p.useState)([]),[C,k]=(0,p.useState)(!1),[T,D]=(0,p.useState)(null),[I,F]=(0,p.useState)(!1),[R,M]=(0,p.useState)("edit"),[z,E]=(0,p.useState)(null),[P,W]=p.useState(!1),[N,O]=p.useState(0),[B,L]=(0,p.useState)({totalRequirements:0,totalTestCases:0,totalExecutions:0,autoHealActionsCount:0,averageSuccessRate:0}),[_,U]=(0,p.useState)({formattedDuration:"0s",totalDurationInSeconds:0,readableFormat:"0 seconds"}),[Y,q]=(0,p.useState)(0),[H,G]=(0,p.useState)((()=>(()=>{try{const e=localStorage.getItem(Or);if(e&&_r.includes(e)){if("custom"===e){const e=localStorage.getItem(Br),t=localStorage.getItem(Lr);if(e&&t)return{start:e,end:t,type:"custom"}}return Ur(e)}}catch(e){console.error("Error reading dateRange from localStorage:",e)}return Ur("thisWeek")})())),K=localStorage.getItem("projectId"),J="#FFFFFF",X="#F6F8FA",Z="#212529",V="#6c757d",$="rgba(0,0,0,0.15)",Q="rgba(0,0,0,0.12)",ee=(0,p.useCallback)((async()=>{try{var e,t;const o=await A.A.getDashboardOverview(K,H.start,H.end);L(o||{});const r=Math.max(0,Math.round(Number(null!==(e=null===o||void 0===o?void 0:o.totalDuration)&&void 0!==e?e:0))||0),a=Math.floor(r/86400),n=Math.floor(r%86400/3600),l=Math.floor(r%3600/60),s=r%60;let i;i=a>0?"".concat(a," day").concat(a>1?"s":""," ").concat(n," hr").concat(1!==n?"s":""):n>0?"".concat(n," hour").concat(n>1?"s":""," ").concat(l," min"):l>0?"".concat(l," minute").concat(l>1?"s":""):"".concat(s," second").concat(1!==s?"s":""),U({days:a,hours:n,minutes:l,seconds:s,totalSeconds:r,readableFormat:i}),q(null!==(t=null===o||void 0===o?void 0:o.totalAutomationTasks)&&void 0!==t?t:0)}catch(o){console.error("[DASHBOARD] Overview statistics fetch error:",o),q(0)}}),[H]);(0,p.useEffect)((()=>{f.A.getProjectsByUserPermissions().then((()=>{})).catch((e=>{var t;console.error("Project fetch error:",e),403!==(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)&&(0,b.M8)(y.A.getText("projectLoadFailed"),{variant:"error",autoHideDuration:3e3})}))}),[]),(0,p.useEffect)((()=>{ee()}),[ee]);const te=(0,p.useCallback)((e=>{G(e);try{localStorage.setItem(Or,e.type||"thisWeek"),"custom"===e.type&&e.start&&e.end&&(localStorage.setItem(Br,e.start),localStorage.setItem(Lr,e.end))}catch(t){console.error("Error saving dateRange to localStorage:",t)}}),[]),oe=async function(e,t){if(e){D({id:e,actionName:arguments.length>2&&void 0!==arguments[2]?arguments[2]:null}),M("edit"),E(t),k(!0),F(!0);try{const t=await m.A.getActionById(e,K);D((null===t||void 0===t?void 0:t.data)||t)}catch(o){(0,b.M8)(y.A.getText("actionFetchError")||"Failed to load action",{variant:"error"}),k(!1)}finally{F(!1)}}},re=e=>{let{icon:t,value:o,label:r,color:a}=e;return(0,w.jsx)(i.A,{sx:{borderRadius:2,border:"1px solid ".concat($),background:"linear-gradient(180deg, ".concat(J," 0%, #EEF2F6 100%)"),boxShadow:"0 2px 10px rgba(0,0,0,0.15)",height:"100%",minWidth:0},children:(0,w.jsx)(c.A,{sx:{py:1.5,px:2,"&:last-child":{pb:1.5}},children:(0,w.jsxs)(d.A,{direction:"row",alignItems:"center",spacing:1.5,children:[(0,w.jsx)(g.A,{sx:{background:(null===a||void 0===a?void 0:a.bg)||"linear-gradient(180deg, ".concat(X," 0%, #EEF2F6 100%)"),border:"1px solid ".concat((null===a||void 0===a?void 0:a.border)||Q),borderRadius:"10px",p:1,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxShadow:"inset 0 1px 0 rgba(255,255,255,0.8)"},children:(0,w.jsx)(t,{sx:{color:(null===a||void 0===a?void 0:a.icon)||Z,fontSize:24}})}),(0,w.jsxs)(g.A,{sx:{minWidth:0,overflow:"hidden"},children:[(0,w.jsx)(h.A,{variant:"h5",fontWeight:700,sx:{color:Z,lineHeight:1.2,fontSize:"1.25rem"},children:o}),(0,w.jsx)(h.A,{variant:"caption",sx:{color:V,fontSize:"0.75rem",display:"block"},noWrap:!0,children:r})]})]})})})},ae={defects:{bg:"#fff0f0",border:"#ffcdd2",icon:"#e57373"},timeSaved:{bg:"#e3f2fd",border:"#90caf9",icon:"#42a5f5"},autoHeal:{bg:"#e8f5e9",border:"#a5d6a7",icon:"#66bb6a"},executions:{bg:"#fff3e0",border:"#ffcc80",icon:"#ffa726"},successRate:{bg:"#ede7f6",border:"#b39ddb",icon:"#7e57c2"}};return(0,w.jsxs)(g.A,{sx:{backgroundColor:"#fafafa",minHeight:"100vh",width:"100%",maxWidth:"100%",overflowX:"hidden",boxSizing:"border-box",p:2},children:[(0,w.jsxs)(g.A,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:1.5}
1,children:[(0,w.jsxs)(g.A,{id:"dashboard-stat-cards",sx:{display:"grid",gridTemplateColumns:{xs:"repeat(2, 1fr)",sm:"repeat(3, 1fr)",md:"repeat(5, 1fr)"},gap:1.5,flex:1},children:[(0,w.jsx)(re,{icon:a.default,value:Y,label:y.A.getText("defectsByAutomation"),color:ae.defects}),(0,w.jsx)(re,{icon:l.default,value:_.readableFormat||"0s",label:y.A.getText("timeSaved"),color:ae.timeSaved}),(0,w.jsx)(re,{icon:n.default,value:B.autoHealActionsCount||0,label:y.A.getText("autoHealActions"),color:ae.autoHeal}),(0,w.jsx)(re,{icon:l.default,value:B.totalExecutions,label:y.A.getText("executions"),color:ae.executions}),(0,w.jsx)(re,{icon:s.default,value:"".concat(null!==(e=null===(t=B.averageSuccessRate)||void 0===t?void 0:t.toFixed(1))&&void 0!==e?e:"0.0","%"),label:y.A.getText("successRate"),color:ae.successRate})]}),(0,w.jsx)(g.A,{sx:{ml:1.5,flexShrink:0,alignSelf:"center",display:"flex",alignItems:"center",gap:1},children:(0,w.jsx)(v.A,{defaultRange:H.type||"thisWeek",onDateRangeChange:(e,t,o)=>te({start:e,end:t,type:o}),iconColor:"rgba(0, 0, 0, 0.54)",activeIndicator:"all"!==((null===H||void 0===H?void 0:H.type)||"thisWeek"),iconOnly:!0})})]}),(0,w.jsxs)(u.Ay,{container:!0,spacing:2,sx:{mb:3},children:[(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,id:"dashboard-req-summary-wrapper",children:(0,w.jsx)(Co,{})}),(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,id:"dashboard-error-steps-wrapper",children:(0,w.jsx)(ht,{errorTestSteps:o,setErrorTestSteps:S,handleActionNameClick:async e=>{const t=null===e||void 0===e?void 0:e.actionId;if(t){D({id:t,actionName:null===e||void 0===e?void 0:e.actionName,screenShotPath:null===e||void 0===e?void 0:e.screenshotUrl}),M("edit"),E("errorTestSteps"),k(!0),F(!0);try{const e=await m.A.getActionById(t,K),o=(null===e||void 0===e?void 0:e.data)||e;D(o)}catch(o){(0,b.M8)(y.A.getText("actionFetchError")||"Failed to load action",{variant:"error"}),k(!1)}finally{F(!1)}}}})})]}),(0,w.jsxs)(u.Ay,{container:!0,spacing:2,sx:{mb:3,alignItems:"stretch"},children:[(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,sx:{display:"flex"},id:"dashboard-test-coverage-wrapper",children:(0,w.jsx)(qe,{refreshNotLinkedActionsData:N})}),(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,sx:{display:"flex"},id:"dashboard-most-errors-wrapper",children:(0,w.jsx)(Mt,{})})]}),(0,w.jsxs)(u.Ay,{container:!0,spacing:2,sx:{mb:3,alignItems:"stretch"},children:[(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,sx:{display:"flex"},id:"dashboard-task-list-wrapper",children:(0,w.jsx)(nr,{})}),(0,w.jsx)(u.Ay,{item:!0,xs:12,md:6,sx:{display:"flex"},id:"dashboard-user-stats-wrapper",children:(0,w.jsx)(kr,{})})]}),(0,w.jsx)(u.Ay,{container:!0,spacing:2,sx:{mb:3},children:(0,w.jsx)(u.Ay,{item:!0,xs:12,id:"dashboard-action-performance-wrapper",children:(0,w.jsx)(Re,{onActionNameClick:e=>oe(e,"actionPerformance")})})}),(0,w.jsx)(u.Ay,{container:!0,spacing:2,sx:{mb:3},children:(0,w.jsx)(u.Ay,{item:!0,xs:12,id:"dashboard-weekly-metrics-wrapper",children:(0,w.jsx)(Nr,{})})}),(0,w.jsxs)(u.Ay,{id:"dashboard-unlinked-section",container:!0,spacing:2,sx:{mb:3,alignItems:"stretch"},children:[(0,w.jsx)(u.Ay,{item:!0,xs:12,md:4,sx:{display:"flex"},children:(0,w.jsx)(Yt,{handleActionNameClick:e=>oe(null===e||void 0===e?void 0:e.id,"notLinkedActions",null===e||void 0===e?void 0:e.actionName),refreshNotLinkedActionsData:N})}),(0,w.jsx)(u.Ay,{item:!0,xs:12,md:4,sx:{display:"flex"},children:(0,w.jsx)(go,{})}),(0,w.jsx)(u.Ay,{item:!0,xs:12,md:4,sx:{display:"flex"},children:(0,w.jsx)(Qt,{})})]}),C&&T&&(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(x.A,{strategy:R,setAction:D,action:T,loading:I,handleActionFormSubmit:async()=>{try{await m.A.createAction(T),(0,b.M8)(y.A.getText("actionCreatedSuccess"),{variant:"success"}),k(!1)}catch(e){(0,b.M8)(y.A.getText("actionCreatedError"),{variant:"error"})}},handleActionFormUpdate:async()=>{try{await m.A.updateAction(T.id,T),(0,b.M8)(y.A.getText("actionUpdatedSuccess"),{variant:"success"}),k(!1),O((e=>e+1)),S((e=>e.map((e=>e.actionDTO&&e.actionDTO.id===T.id?(0,r.A)((0,r.A)({},e),{},{actionDTO:T}):e))))}catch(e){(0,b.M8)(y.A.getText("actionUpdatedError"),{variant:"error"})}},handleActionDialogClose:()=>k(!1),openForm:C,whichPage:z,handleDeleteAction:async()=>{W(!0)}}),(0,w.jsx)(j.A,{open:P,setOpen:W,handleDelete:()=>{m.A.deleteAction(T.id,K).then((()=>{const e="".concat(T.actionName||""," ").concat(y.A.getText("deletedSuccessfully"));(0,b.M8)(e,{variant:"success",autoHideDuration:3e3}),W(!1),k(!1),D(null),O((e=>e+1))})).catch((()=>{(0,b.M8)(y.A.getText("actionDeleteError")||"".concat(T.actionName||""," delete process failed."),{variant:"error",autoHideDuration:3e3})}))},selectedAction:T,whichPage:z})]})]})}}}]);
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.