"use strict";(globalThis.webpackChunksuperset=globalThis.webpackChunksuperset||[]).push([[5336],{52630:(e,t,a)=>{t.iB=t.YM=void 0;var r=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},n=s(a(67294)),i=s(a(45697)),o=a(2371);function s(e){return e&&e.__esModule?e:{default:e}}t.YM=function(e){var t=e.itemTypeToComponent,a=e.WrapperComponent,s=void 0===a?"div":a,l=function(e){var a=e.currentPage,i=e.totalPages,l=e.boundaryPagesRange,u=e.siblingPagesRange,c=e.hideEllipsis,g=e.hidePreviousAndNextPageLinks,d=e.hideFirstAndLastPageLinks,P=e.onChange,E=e.disabled,p=function(e,t){var a={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(a[r]=e[r]);return a}(e,["currentPage","totalPages","boundaryPagesRange","siblingPagesRange","hideEllipsis","hidePreviousAndNextPageLinks","hideFirstAndLastPageLinks","onChange","disabled"]),h=(0,o.getPaginationModel)({currentPage:a,totalPages:i,boundaryPagesRange:l,siblingPagesRange:u,hideEllipsis:c,hidePreviousAndNextPageLinks:g,hideFirstAndLastPageLinks:d}),b=function(e,t,a){return function(i){var o,s,l,u=e[i.type],c=(s=(o=i).value,l=o.isDisabled,function(){!l&&a&&t!==s&&a(s)});return n.default.createElement(u,r({onClick:c},i))}}(t,a,P);return n.default.createElement(s,p,h.map((function(e){return b(r({},e,{isDisabled:!!E}))})))};return l.propTypes={currentPage:i.default.number.isRequired,totalPages:i.default.number.isRequired,boundaryPagesRange:i.default.number,siblingPagesRange:i.default.number,hideEllipsis:i.default.bool,hidePreviousAndNextPageLinks:i.default.bool,hideFirstAndLastPageLinks:i.default.bool,onChange:i.default.func,disabled:i.default.bool},l},t.iB=o.ITEM_TYPES},94222:(e,t,a)=>{a.d(t,{Z:()=>c});var r=a(51995),n=a(61988),i=(a(67294),a(58593)),o=a(70707),s=a(90335),l=a(11965);function u(e,t,a){switch(e){case s.Z9.Working:return a.colors.primary.base;case s.Z9.Error:return a.colors.error.base;case s.Z9.Success:return t?a.colors.success.base:a.colors.alert.base;case s.Z9.Noop:return a.colors.success.base;case s.Z9.Grace:return a.colors.alert.base;default:return a.colors.grayscale.base}}function c({state:e,isReportEnabled:t=!1}){const a=(0,r.Fg)(),c={icon:o.Z.Check,label:"",status:""};switch(e){case s.Z9.Success:c.icon=t?o.Z.Check:o.Z.AlertSolidSmall,c.label=t?(0,n.t)("Report sent"):(0,n.t)("Alert triggered, notification sent"),c.status=s.Z9.Success;break;case s.Z9.Working:c.icon=o.Z.Running,c.label=t?(0,n.t)("Report sending"):(0,n.t)("Alert running"),c.status=s.Z9.Working;break;case s.Z9.Error:c.icon=o.Z.XSmall,c.label=t?(0,n.t)("Report failed"):(0,n.t)("Alert failed"),c.status=s.Z9.Error;break;case s.Z9.Noop:c.icon=o.Z.Check,c.label=(0,n.t)("Nothing triggered"),c.status=s.Z9.Noop;break;case s.Z9.Grace:c.icon=o.Z.AlertSolidSmall,c.label=(0,n.t)("Alert Triggered, In Grace Period"),c.status=s.Z9.Grace;break;default:c.icon=o.Z.Check,c.label=(0,n.t)("Nothing triggered"),c.status=s.Z9.Noop}const g=c.icon;return(0,l.tZ)(i.u,{title:c.label,placement:"bottomLeft"},(0,l.tZ)(g,{iconColor:u(c.status,t,a)}))}},90335:(e,t,a)=>{var r,n,i;a.d(t,{Z9:()=>r,bx:()=>i,ud:()=>n}),function(e){e.Success="Success",e.Working="Working",e.Error="Error",e.Noop="Not triggered",e.Grace="On Grace"}(r||(r={})),function(e){e.Email="Email",e.Slack="Slack"}(n||(n={})),function(e){e.General="generalSection",e.Content="contentSection",e.Alert="alertConditionSection",e.Schedule="scheduleSection",e.Notification="notificationSection"}(i||(i={}))},58883:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var r=a(51995),n=a(11965),i=a(61988),o=a(30381),s=a.n(o),l=a(67294),u=a(16550),c=a(73727),g=a(93139),d=a(58593),P=a(86074),E=a(14114),p=a(44814),h=a(94222),b=a(34858);const S=r.iK.div`
  ${({theme:e})=>n.iv`
    display: flex;
    flex-direction: row;

    a,
    Link {
      margin-left: ${4*e.gridUnit}px;
      font-size: ${e.typography.sizes.s};
      font-weight: ${e.typography.weights.normal};
      text-decoration: underline;
    }
  `}
`,f=(0,E.ZP)((function({addDangerToast:e,addSuccessToast:t,isReportEnabled:a}){const{alertId:r}=(0,u.UO)(),{state:{loading:o,resourceCount:E,resourceCollection:f},fetchData:_}=(0,b.Yi)(`report/${r}/log`,(0,i.t)("log"),e,!1),{state:{loading:I,resource:L},fetchResource:m}=(0,b.LE)("report",(0,i.t)("reports"),e);(0,l.useEffect)((()=>{null===r||I||m(r)}),[r]);const v=(0,l.useMemo)((()=>[{Cell:({row:{original:{state:e}}})=>(0,n.tZ)(h.Z,{state:e,isReportEnabled:a}),accessor:"state",Header:(0,i.t)("State"),size:"xs",disableSortBy:!0},{Cell:({row:{original:{uuid:e}}})=>e?e.slice(0,6):"none",accessor:"uuid",Header:(0,i.t)("Execution ID"),size:"xs",disableSortBy:!0},{Cell:({row:{original:{scheduled_dttm:e}}})=>s()(new Date(e)).format("YYYY-MM-DD hh:mm:ss a"),accessor:"scheduled_dttm",Header:(0,i.t)("Scheduled at (UTC)")},{Cell:({row:{original:{start_dttm:e}}})=>s()(new Date(e)).format("YYYY-MM-DD hh:mm:ss a"),Header:(0,i.t)("Start at (UTC)"),accessor:"start_dttm"},{Cell:({row:{original:{start_dttm:e,end_dttm:t}}})=>(0,p.zQ)(new Date(e).getTime(),new Date(t).getTime()),Header:(0,i.t)("Duration"),disableSortBy:!0},{accessor:"value",Header:(0,i.t)("Value")},{accessor:"error_message",Header:(0,i.t)("Error message"),Cell:({row:{original:{error_message:e=""}}})=>(0,n.tZ)(d.u,{title:e,placement:"topLeft"},(0,n.tZ)("span",null,e))}]),[a]),T=`/${a?"report":"alert"}/list/`,N=(0,i.t)("Alert"),A=(0,i.t)("Report");return(0,n.tZ)(l.Fragment,null,(0,n.tZ)(P.Z,{name:(0,n.tZ)(S,null,(0,n.tZ)("span",null,L?"Alert"===L.type?`${N}:`:"Report"===L.type?`${A}:`:null:null," ",null==L?void 0:L.name),(0,n.tZ)("span",null,(0,n.tZ)(c.rU,{to:T},(0,i.t)("Back to all"))))}),(0,n.tZ)(g.Z,{className:"execution-log-list-view",columns:v,count:E,data:f,fetchData:_,initialSort:[{id:"start_dttm",desc:!0}],loading:o,addDangerToast:e,addSuccessToast:t,refreshData:()=>{},pageSize:25}))}))},56590:(e,t)=>{t.ITEM_TYPES={PAGE:"PAGE",ELLIPSIS:"ELLIPSIS",FIRST_PAGE_LINK:"FIRST_PAGE_LINK",PREVIOUS_PAGE_LINK:"PREVIOUS_PAGE_LINK",NEXT_PAGE_LINK:"NEXT_PAGE_LINK",LAST_PAGE_LINK:"LAST_PAGE_LINK"},t.ITEM_KEYS={FIRST_ELLIPSIS:-1,SECOND_ELLIPSIS:-2,FIRST_PAGE_LINK:-3,PREVIOUS_PAGE_LINK:-4,NEXT_PAGE_LINK:-5,LAST_PAGE_LINK:-6}},53804:(e,t,a)=>{var r=a(56590);t.createFirstEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.FIRST_ELLIPSIS,value:e,isActive:!1}},t.createSecondEllipsis=function(e){return{type:r.ITEM_TYPES.ELLIPSIS,key:r.ITEM_KEYS.SECOND_ELLIPSIS,value:e,isActive:!1}},t.createFirstPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.FIRST_PAGE_LINK,key:r.ITEM_KEYS.FIRST_PAGE_LINK,value:1,isActive:1===t}},t.createPreviousPageLink=function(e){var t=e.currentPage;return{type:r.ITEM_TYPES.PREVIOUS_PAGE_LINK,key:r.ITEM_KEYS.PREVIOUS_PAGE_LINK,value:Math.max(1,t-1),isActive:1===t}},t.createNextPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.NEXT_PAGE_LINK,key:r.ITEM_KEYS.NEXT_PAGE_LINK,value:Math.min(a,t+1),isActive:t===a}},t.createLastPageLink=function(e){var t=e.currentPage,a=e.totalPages;return{type:r.ITEM_TYPES.LAST_PAGE_LINK,key:r.ITEM_KEYS.LAST_PAGE_LINK,value:a,isActive:t===a}},t.createPageFunctionFactory=function(e){var t=e.currentPage;return function(e){return{type:r.ITEM_TYPES.PAGE,key:e,value:e,isActive:e===t}}}},1158:(e,t)=>{t.createRange=function(e,t){for(var a=[],r=e;r<=t;r++)a.push(r);return a}},2371:(e,t,a)=>{var r=a(1158),n=a(53804);t.getPaginationModel=function(e){if(null==e)throw new Error("getPaginationModel(): options object should be a passed");var t=Number(e.totalPages);if(isNaN(t))throw new Error("getPaginationModel(): totalPages should be a number");if(t<0)throw new Error("getPaginationModel(): totalPages shouldn't be a negative number");var a=Number(e.currentPage);if(isNaN(a))throw new Error("getPaginationModel(): currentPage should be a number");if(a<0)throw new Error("getPaginationModel(): currentPage shouldn't be a negative number");if(a>t)throw new Error("getPaginationModel(): currentPage shouldn't be greater than totalPages");var i=null==e.boundaryPagesRange?1:Number(e.boundaryPagesRange);if(isNaN(i))throw new Error("getPaginationModel(): boundaryPagesRange should be a number");if(i<0)throw new Error("getPaginationModel(): boundaryPagesRange shouldn't be a negative number");var o=null==e.siblingPagesRange?1:Number(e.siblingPagesRange);if(isNaN(o))throw new Error("getPaginationModel(): siblingPagesRange should be a number");if(o<0)throw new Error("getPaginationModel(): siblingPagesRange shouldn't be a negative number");var s=Boolean(e.hidePreviousAndNextPageLinks),l=Boolean(e.hideFirstAndLastPageLinks),u=Boolean(e.hideEllipsis),c=u?0:1,g=[],d=n.createPageFunctionFactory(e);if(l||g.push(n.createFirstPageLink(e)),s||g.push(n.createPreviousPageLink(e)),1+2*c+2*o+2*i>=t){var P=r.createRange(1,t).map(d);g.push.apply(g,P)}else{var E=i,p=r.createRange(1,E).map(d),h=t+1-i,b=t,S=r.createRange(h,b).map(d),f=Math.min(Math.max(a-o,E+c+1),h-c-2*o-1),_=f+2*o,I=r.createRange(f,_).map(d);if(g.push.apply(g,p),!u){var L=f-1,m=(L===E+1?d:n.createFirstEllipsis)(L);g.push(m)}if(g.push.apply(g,I),!u){var v=_+1,T=(v===h-1?d:n.createSecondEllipsis)(v);g.push(T)}g.push.apply(g,S)}return s||g.push(n.createNextPageLink(e)),l||g.push(n.createLastPageLink(e)),g};var i=a(56590);t.ITEM_TYPES=i.ITEM_TYPES,t.ITEM_KEYS=i.ITEM_KEYS}}]);
//# sourceMappingURL=b3c201f379c79890e272.chunk.js.map