Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
assets.3582.9bf1d89926b9972b5b0a.js Maven / Gradle / Ivy
"use strict";(self.webpackChunkopen_metadata=self.webpackChunkopen_metadata||[]).push([[3582,3590,3842,584],{3590:function(e,t,n){n.r(t),n.d(t,{ReactComponent:function(){return s}});var a,r=n(67294);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t=100&&l.createElement(be.Z,{className:"align-middle m-l-xs",component:we.ReactComponent,style:{fontSize:"16px"}})))},xe=n(7226),Ze=function(e){var t=e.type,n=e.header,s=e.subHeader,c=e.listAssets,u=ve.Z.getTabsInfo(),o=(0,a.CR)((0,l.useState)({results:[]}),2),g=o[0],p=o[1],h=(0,a.CR)((0,l.useState)({results:[]}),2),y=h[0],f=h[1],E=(0,a.CR)((0,l.useState)({results:[]}),2),A=E[0],I=E[1],N=(0,a.CR)((0,l.useState)(!0),2),D=N[0],v=N[1],S=(0,a.CR)((0,l.useState)([]),2),b=S[0],L=S[1],C=(0,a.CR)((0,l.useState)(""),2),j=C[0],w=C[1],T=(0,a.CR)((0,l.useState)(""),2),x=T[0],Z=T[1],O=(0,P.Gy)(),z=O.chartFilter,k=O.selectedDaysFilter,U=O.kpi,V=O.entitiesSummary,G=(0,M.io)(t),H=(0,l.useMemo)((function(){var e,n,r,i,s,l,c,u,o,d,m,p=0,h=null!==(e=g.results)&&void 0!==e?e:[],f=(0,re.groupBy)(h,"day"),M=Object.entries(f).map((function(e){var t=(0,a.CR)(e,2),n=t[0],r=t[1].reduce((function(e,t){var n,r;return(0,a.pi)((0,a.pi)({},e),((n={})[null!==(r=t.group)&&void 0!==r?r:"count"]=t.count,n))}),{});return(0,a.pi)({day:+n},r)})),E=(0,re.sortBy)(M,"day"),I=(0,re.omit)((0,re.last)(null!=E?E:{}),"day"),N=Object.entries(I).sort((function(e,t){var n=(0,a.CR)(e,2)[1];return(0,a.CR)(t,2)[1]-n})).map((function(e){return(0,a.CR)(e,1)[0]}));if(t===Q.l4.TotalDataAssets){var D=(0,re.reduce)(I,(function(e,t){return e+t}),0),v=(0,re.reduce)((0,re.omit)(null!==(n=(0,re.first)(E))&&void 0!==n?n:{},"day"),(function(e,t){return e+t}),0);p=v?(D-v)/v*100:0}else if(t===Q.l4.TotalDataAssetsByTier){var S=(0,re.reduce)(I,(function(e,t){return e+t}),0),b=(0,re.reduce)((0,re.omit)(null!==(r=(0,re.first)(E))&&void 0!==r?r:{},"day"),(function(e,t){return e+t}),0),L=Object.entries(f).map((function(e){var t=(0,a.CR)(e,2),n=t[0],r=t[1].filter((function(e){return"NoTier"!==e.group})).reduce((function(e,t){var n,r;return(0,a.pi)((0,a.pi)({},e),((n={})[null!==(r=t.group)&&void 0!==r?r:"count"]=t.count,n))}),{});return(0,a.pi)({day:+n},r)})),C=(0,re.sortBy)(L,"day"),j=(0,re.reduce)((0,re.omit)(null!==(i=(0,re.last)(C))&&void 0!==i?i:{},"day"),(function(e,t){return e+t}),0),w=(0,re.reduce)((0,re.omit)(null!==(s=(0,re.first)(C))&&void 0!==s?s:{},"day"),(function(e,t){return e+t}),0);p=(S?j/S*100:0)-(b?w/b*100:0)}else{var T=null!==(l=y.results)&&void 0!==l?l:[],Z=(0,re.groupBy)(T,"day"),O=Object.entries(Z).map((function(e){var t=(0,a.CR)(e,2),n=t[0],r=t[1].reduce((function(e,t){var n,r;return(0,a.pi)((0,a.pi)({},e),((n={})[null!==(r=t.group)&&void 0!==r?r:"count"]=t.count,n))}),{});return(0,a.pi)({day:+n},r)})),z=(0,re.sortBy)(O,"day"),k=(S=(0,re.reduce)((0,re.omit)(null!==(c=(0,re.last)(z))&&void 0!==c?c:{},"day"),(function(e,t){return e+t}),0),b=(0,re.reduce)((0,re.omit)(null!==(u=(0,re.first)(z))&&void 0!==u?u:{},"day"),(function(e,t){return e+t}),0),null!==(o=A.results)&&void 0!==o?o:[]),P=(0,re.sortBy)(k,"day");j=(0,re.reduce)((0,re.omit)(null!==(d=(0,re.last)(P))&&void 0!==d?d:{},"day"),(function(e,t){return e+t}),0),w=(0,re.reduce)((0,re.omit)(null!==(m=(0,re.first)(P))&&void 0!==m?m:{},"day"),(function(e,t){return e+t}),0),p=(S?j/S*100:0)-(b?w/b*100:0)}return{rightSideEntityList:N.filter((function(e){return(0,re.includes)((0,re.toLower)(e),(0,re.toLower)(x))})),latestData:I,graphData:E,changeInValue:p}}),[g.results,x]),B=H.rightSideEntityList,K=H.latestData,J=H.graphData,F=H.changeInValue,_=(0,l.useMemo)((function(){var e;if([Q.l4.PercentageOfDataAssetWithDescription,Q.l4.PercentageOfDataAssetWithOwner,Q.l4.PercentageOfServiceWithDescription,Q.l4.PercentageOfServiceWithOwner].includes(t)){var n=[Q.l4.PercentageOfDataAssetWithDescription,Q.l4.PercentageOfServiceWithDescription].includes(t)?Ne.e.PercentageOfDataAssetWithDescriptionKpi:Ne.e.PercentageOfDataAssetWithOwnerKpi;return null===(e=U.data.find((function(e){return e.dataInsightChart.name===n})))||void 0===e?void 0:e.targetValue}}),[U.data,t]),X=(0,l.useMemo)((function(){var e={results:[{count:0}]};switch(t){case Q.l4.TotalDataAssets:e=V[Q.l4.TotalDataAssetsSummaryCard];break;case Q.l4.PercentageOfDataAssetWithDescription:case Q.l4.PercentageOfServiceWithDescription:e=V[Q.l4.DataAssetsWithDescriptionSummaryCard];break;case Q.l4.PercentageOfDataAssetWithOwner:case Q.l4.PercentageOfServiceWithOwner:e=V[Q.l4.DataAssetsWithOwnerSummaryCard];break;case Q.l4.TotalDataAssetsByTier:e=V[Q.l4.TotalDataAssetsWithTierSummaryCard]}return(0,re.get)(e,"results.0.count",0)}),[t,V]),ee=(0,Y.$)().t,te=function(){w("")};(0,l.useEffect)((function(){(0,a.mG)(void 0,void 0,void 0,(function(){var e,n,r,i,s;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:v(!0),a.label=1;case 1:return a.trys.push([1,9,10,11]),e=(0,M.oK)(z.team,z.tier),[Q.l4.TotalDataAssets,Q.l4.TotalDataAssetsByTier].includes(t)?[3,3]:[4,(0,Q.fp)(Q.l4.TotalDataAssets,{start:z.startTs,end:z.endTs,filter:e})];case 2:n=a.sent(),f(n),a.label=3;case 3:return[Q.l4.PercentageOfServiceWithDescription,Q.l4.PercentageOfDataAssetWithDescription].includes(t)?[4,(0,Q.fp)(Q.l4.NumberOfDataAssetWithDescription,{start:z.startTs,end:z.endTs,filter:e})]:[3,5];case 4:return r=a.sent(),I(r),[3,7];case 5:return[Q.l4.PercentageOfServiceWithOwner,Q.l4.PercentageOfDataAssetWithOwner].includes(t)?[4,(0,Q.fp)(Q.l4.NumberOfDataAssetWithOwner,{start:z.startTs,end:z.endTs,filter:e})]:[3,7];case 6:r=a.sent(),I(r),a.label=7;case 7:return[4,(0,Q.fp)(t,{start:z.startTs,end:z.endTs,filter:e})];case 8:return i=a.sent(),p(i),[3,11];case 9:return s=a.sent(),(0,$.Eo)(s),[3,11];case 10:return v(!1),[7];case 11:return[2]}}))}))}),[z]);var ae=(0,l.useMemo)((function(){switch(t){case Q.l4.TotalDataAssets:return ee("label.total-entity",{entity:ee("label.asset-plural")})+(G?" %":"");case Q.l4.PercentageOfDataAssetWithDescription:return ee("label.completed-entity",{entity:ee("label.description")})+(G?" %":"");case Q.l4.PercentageOfDataAssetWithOwner:return ee("label.assigned-entity",{entity:ee("label.owner")})+(G?" %":"");case Q.l4.PercentageOfServiceWithDescription:return ee("label.completed-entity",{entity:ee("label.description")})+(G?" %":"");case Q.l4.PercentageOfServiceWithOwner:return ee("label.assigned-entity",{entity:ee("label.owner")})+(G?" %":"");case Q.l4.TotalDataAssetsByTier:return ee("label.assigned-entity",{entity:ee("label.tier")})+(G?" %":"");default:return""}}),[t,G]);return D||U.isLoading||0===g.results.length?l.createElement(R.Z,{className:"data-insight-card",id:t,loading:D,title:l.createElement(q.Z,{data:{header:n,subHeader:ee("message.field-insight",{field:ee("label.description-lowercase")})}})},l.createElement(ne.F,null)):l.createElement(R.Z,{className:"data-insight-card","data-testid":t+"-graph",id:t},l.createElement(r.Z,{gutter:m.ib.rowContainerGutter},l.createElement(i.Z,{span:m.ib.leftContainerSpan},l.createElement(q.Z,{data:{header:n,subHeader:s}}),l.createElement(W.h,{className:"m-t-lg",debounce:1,height:m.Rw,id:t+"-graph"},(0,M.QA)(J,B,b,j,G))),l.createElement(i.Z,{span:m.ib.rightContainerSpan},l.createElement(r.Z,{gutter:[8,16]},l.createElement(i.Z,{span:24},l.createElement(Te,{changeInValue:F,duration:k,label:ae,progress:(0,re.round)(X,2),showProgress:G,suffix:G||t===Q.l4.TotalDataAssetsByTier?"%":"",target:_})),l.createElement(i.Z,{span:24},l.createElement(Se.Z,{removeMargin:!0,searchValue:x,onSearch:Z})),l.createElement(i.Z,{className:"chart-card-right-panel-container",span:24},l.createElement(r.Z,{gutter:[8,8]},B.map((function(e,n){var a;return l.createElement(i.Z,{className:"entity-summary-container",key:e,span:24,onClick:function(){return function(e){L((function(t){return(0,De.Ss)(e,t)}))}(e)},onMouseEnter:function(){return function(e){w(e)}(e)},onMouseLeave:te},l.createElement(xe.Z,{entity:(0,re.startCase)(e),isActive:!b.length||b.includes(e),label:(0,re.round)(null!==(a=K[e])&&void 0!==a?a:0,2)+(G?"%":""),pluralize:![Q.l4.TotalDataAssetsByTier,Q.l4.PercentageOfServiceWithDescription,Q.l4.PercentageOfServiceWithOwner].includes(t),progress:K[e],strokeColor:m._J[n]}))})))),b.length>0&&l.createElement(i.Z,{className:"flex justify-end",span:24},l.createElement(Me.Z,{type:"link",onClick:function(){return L([])}},ee("label.clear"))))),c&&l.createElement(i.Z,{className:"d-flex justify-end",span:24},l.createElement(ue.Link,{"data-testid":"explore-asset-with-no-"+(t===Q.l4.PercentageOfDataAssetWithDescription?"description":"owner"),to:(0,d.rg)({tab:u[Ie.W.TABLE].path,isPersistFilters:!0,extraParameters:{queryFilter:JSON.stringify(t===Q.l4.PercentageOfDataAssetWithDescription?Ae.SL:Ae.qT)}})},l.createElement(Me.Z,{className:"text-primary d-flex items-center gap-1",size:"small",type:"text"},ee("label.explore-asset-plural-with-type",{type:t===Q.l4.PercentageOfDataAssetWithDescription?ee("label.no-description"):ee("label.no-owner")}),l.createElement(Ee.ReactComponent,{height:12,width:12}))))))},Oe=function(){var e=(0,P.Gy)().kpi,t=(0,Y.$)().t;return e.isLoading?l.createElement(fe.Z,null):l.createElement(r.Z,{gutter:[16,16]},l.createElement(i.Z,{span:24},l.createElement(Ze,{header:t("label.data-insight-total-entity-summary"),subHeader:t("message.total-entity-insight"),type:Q.l4.TotalDataAssets})),l.createElement(i.Z,{span:24},l.createElement(Ze,{listAssets:!0,header:t("label.data-insight-description-summary-type",{type:t("label.data-asset")}),subHeader:t("message.field-insight",{field:t("label.description-lowercase")}),type:Q.l4.PercentageOfDataAssetWithDescription})),l.createElement(i.Z,{span:24},l.createElement(Ze,{listAssets:!0,header:t("label.data-insight-owner-summary-type",{type:t("label.data-asset")}),subHeader:t("message.field-insight",{field:t("label.owner")}),type:Q.l4.PercentageOfDataAssetWithOwner})),l.createElement(i.Z,{span:24},l.createElement(Ze,{header:t("label.data-insight-description-summary-type",{type:t("label.service")}),subHeader:t("message.field-insight",{field:t("label.description-lowercase")}),type:Q.l4.PercentageOfServiceWithDescription})),l.createElement(i.Z,{span:24},l.createElement(Ze,{header:t("label.data-insight-owner-summary-type",{type:t("label.service")}),subHeader:t("message.field-insight",{field:t("label.owner")}),type:Q.l4.PercentageOfServiceWithOwner})),l.createElement(i.Z,{span:24},l.createElement(Ze,{header:t("label.data-insight-tier-summary"),subHeader:t("message.field-insight",{field:t("label.tier")}),type:Q.l4.TotalDataAssetsByTier})))},ze=n(74475),ke=n(28682),Pe=n(88816),Re=function(){var e=(0,c.UO)().tab,t=(0,c.k6)(),n=(0,l.useMemo)((function(){return $e.getLeftSideBar().map((function(e){var t=e.icon;return{key:e.key,label:e.label,icon:l.createElement(t,(0,a.pi)({},e.iconProps))}}))}),[]);return l.createElement(Pe.Z,{id:"data-insight"},l.createElement(ke.Z,{className:"data-insight-left-panel","data-testid":"data-insight-left-panel",items:n,mode:"inline",selectedKeys:[null!=e?e:f.N.DATA_ASSETS],onClick:function(e){t.push((0,M.zc)(e.key))}}))},Ye=n(94199),We=n(38780),Ue=n(8645),Ve=n(92342),Ge=n(71112),He=n(38048),Be=n(64632),Ke=n(87057),Je=n(48794),Fe=n(96094),_e=n(24671),Qe=function(){var e,t=(0,c.k6)(),n=(0,Je.N)().currentUser,r=null!==(e=null==n?void 0:n.isAdmin)&&void 0!==e&&e,s=(0,Y.$)().t,o=(0,g.BL)().permissions,m=(0,l.useMemo)((function(){return(0,E.P_)(y.OX.ViewAll,p.A.KPI,o)}),[o]),f=(0,a.CR)((0,l.useState)([]),2),M=f[0],A=f[1],I=(0,a.CR)((0,l.useState)(!1),2),N=I[0],D=I[1],v=(0,a.CR)((0,l.useState)(d.j2),2),S=v[0],b=v[1],L=(0,a.CR)((0,l.useState)(d.OQ),2),C=L[0],j=L[1],w=(0,a.CR)((0,l.useState)(),2),T=w[0],x=w[1],Z=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var t;return(0,a.Jh)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,3,4]),D(!0),[4,(0,Fe.Gw)({fields:[Be.GB.START_DATE,Be.GB.END_DATE,Be.GB.TARGET_VALUE,Be.GB.DATA_INSIGHT_CHART,Be.GB.METRIC_TYPE],limit:d.Ou,before:e&&e.before,after:e&&e.after})];case 1:return t=n.sent(),A(t.data),j(t.paging),[3,4];case 2:return n.sent(),A([]),j(d.OQ),[3,4];case 3:return D(!1),[7];case 4:return[2]}}))}))},O=(0,l.useMemo)((function(){return[{title:s("label.name"),dataIndex:"name",key:"name",render:function(e,t){return l.createElement(ue.Link,{to:(0,d.Vc)(e)},(0,_e.C_)(t))}},{title:s("label.description"),dataIndex:"description",key:"description",width:300,render:function(e){return e?l.createElement(He.Z,{markdown:e}):l.createElement("span",{"data-testid":"no-description"},s("label.no-entity",{entity:s("label.description")}))}},{title:s("label.start-entity",{entity:s("label.date")}),dataIndex:"startDate",key:"startDate",render:function(e){return l.createElement(ce.Z.Text,null,(0,oe.o0)(e))}},{title:s("label.end-date"),dataIndex:"endDate",key:"endDate",render:function(e){return l.createElement(ce.Z.Text,null,(0,oe.o0)(e))}},{title:s("label.target"),dataIndex:"targetValue",key:"targetValue",render:function(e,t){var n=t.metricType===Ke.m.Percentage?+e+"%":e;return l.createElement(ce.Z.Text,null,n)}},{title:s("label.metric-type"),dataIndex:"metricType",key:"metricType",render:function(e){return l.createElement(ce.Z.Text,null,e)}},{title:s("label.action-plural"),dataIndex:"actions",width:"80px",key:"actions",render:function(e,n){return l.createElement("div",{className:"d-flex items-center"},l.createElement(Ye.Z,{placement:"left",title:s(r?"label.edit":"message.no-permission-for-action")},l.createElement(Me.Z,{className:"flex-center","data-testid":"edit-action-"+(0,_e.C_)(n),disabled:!r,icon:l.createElement(We.ReactComponent,{width:"16px"}),type:"text",onClick:function(){return t.push((0,d.Vc)(n.name))}})),l.createElement(Ye.Z,{placement:"left",title:s(r?"label.delete":"message.no-permission-for-action")},l.createElement(Me.Z,{"data-testid":"delete-action-"+(0,_e.C_)(n),disabled:!r,icon:l.createElement(be.Z,{component:Ue.ReactComponent,style:{fontSize:"16px"}}),type:"text",onClick:function(){return x(n)}})))}}]}),[M]);(0,l.useEffect)((function(){Z()}),[]);var z=(0,l.useCallback)((function(){Z()}),[Z]),k=(0,l.useMemo)((function(){return m?l.createElement(ne.F,null):l.createElement(u.Z,{type:h.Wx.PERMISSION})}),[m]);return l.createElement(l.Fragment,null,l.createElement(i.Z,{span:24},l.createElement(me.Z,{bordered:!0,columns:O,"data-testid":"kpi-table",dataSource:M,loading:N,locale:{emptyText:k},pagination:!1,rowKey:"name",size:"small"})),M.length>d.Ou&&l.createElement(i.Z,{span:24},l.createElement(Ge.Z,{currentPage:S,pageSize:d.Ou,paging:C,pagingHandler:function(e){var t,n=e.cursorType,a=e.currentPage;n&&(b(a),Z(((t={})[n]=C[n],t)))}})),T&&l.createElement(Ve.Z,{afterDeleteAction:z,allowSoftDelete:!1,deleteMessage:s("message.are-you-sure-delete-entity",{entity:(0,_e.C_)(T)}),entityId:T.id,entityName:(0,_e.C_)(T),entityType:Be.py.KPI,visible:!(0,re.isUndefined)(T),onCancel:function(){return x(void 0)}}))},$e=new(function(){function e(){}return e.prototype.getLeftPanel=function(){return Re},e.prototype.getLeftSideBar=function(){return[{key:f.N.DATA_ASSETS,label:ze.Z.t("label.data-asset-plural"),icon:O.ReactComponent,iconProps:{className:"side-panel-icons"}},{key:f.N.APP_ANALYTICS,label:ze.Z.t("label.app-analytic-plural"),icon:z.ReactComponent,iconProps:{className:"side-panel-icons"}},{key:f.N.KPIS,label:ze.Z.t("label.kpi-uppercase-plural"),icon:k.ReactComponent,iconProps:{className:"side-panel-icons"}}]},e.prototype.getDataInsightTab=function(){return[{key:f.N.DATA_ASSETS,path:(0,M.zc)(f.N.DATA_ASSETS),component:Oe},{key:f.N.APP_ANALYTICS,path:(0,M.zc)(f.N.APP_ANALYTICS),component:ye},{key:f.N.KPIS,path:(0,M.zc)(f.N.KPIS),component:Qe}]},e}()),qe=n(16416),Xe=n(11484),et=n(46042),tt=n(82361),nt=function(e){var t,n=e.chartFilter,s=e.onScrollToChart,u=(0,c.UO)().tab,o=void 0===u?f.N.DATA_ASSETS:u,d=(0,a.CR)((0,l.useState)(!1),2),g=d[0],p=d[1],h=(0,a.CR)((0,l.useState)([]),2),y=h[0],E=h[1],A=(0,P.Gy)(),I=A.entitiesSummary,N=A.updateEntitySummary,D=(0,a.CR)((0,l.useState)(),2),v=D[0],S=D[1],b=(0,a.CR)((0,l.useState)(),2),L=b[0],C=b[1],j=(0,l.useMemo)((function(){return(0,M.gD)(I)}),[I,n]),w=(0,l.useMemo)((function(){return(0,M.nj)(y)}),[y,n]),T=(0,Y.$)().t;return(0,l.useEffect)((function(){(0,a.mG)(void 0,void 0,void 0,(function(){var e;return(0,a.Jh)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,(0,Xe.Xv)("Organization")];case 1:return e=t.sent(),C(e),[3,3];case 2:return t.sent(),[3,3];case 3:return[2]}}))}))}),[]),(0,l.useEffect)((function(){o===f.N.DATA_ASSETS&&(0,a.mG)(void 0,void 0,void 0,(function(){var e,t,r;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:p(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),e=(0,M.oK)(n.team,n.tier),[4,(0,Q.Me)([Q.l4.TotalDataAssetsSummaryCard,Q.l4.DataAssetsWithDescriptionSummaryCard,Q.l4.DataAssetsWithOwnerSummaryCard,Q.l4.TotalDataAssetsWithTierSummaryCard],{start:n.startTs,end:n.endTs,filter:e})];case 2:return t=a.sent(),N(t),[3,5];case 3:return r=a.sent(),(0,$.Eo)(r),[3,5];case 4:return p(!1),[7];case 5:return[2]}}))})),o===f.N.APP_ANALYTICS&&(0,a.mG)(void 0,void 0,void 0,(function(){var e,t,r,i;return(0,a.Jh)(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,3,4]),e=(0,a.pi)((0,a.pi)({},n),{dataInsightChartName:_.r.MostActiveUsers,dataReportIndex:F.t.WebAnalyticUserActivityReportDataIndex}),[4,(0,Q.Yu)(e)];case 1:return t=s.sent(),(null===(i=t.data)||void 0===i?void 0:i.length)&&S(t.data[0]),[3,4];case 2:return r=s.sent(),(0,$.Eo)(r),[3,4];case 3:return p(!1),[7];case 4:return[2]}}))})),o===f.N.APP_ANALYTICS&&(0,a.mG)(void 0,void 0,void 0,(function(){var e,t,r,i;return(0,a.Jh)(this,(function(s){switch(s.label){case 0:p(!0),s.label=1;case 1:return s.trys.push([1,3,4,5]),e=m.Md.map((function(e){var t=(0,a.pi)((0,a.pi)({},n),{dataInsightChartName:e.chart,dataReportIndex:e.index});return(0,Q.Yu)(t)})),[4,Promise.allSettled(e)];case 2:return t=s.sent(),r=t.map((function(e){if("fulfilled"===e.status)return e.value})).filter(Boolean),E(r),[3,5];case 3:return i=s.sent(),(0,$.Eo)(i),[3,5];case 4:return p(!1),[7];case 5:return[2]}}))}))}),[n,o]),l.createElement("div",{"data-testid":"summary-card"},l.createElement(ce.Z.Paragraph,{className:"font-medium"},T("label.data-insight-summary",{organization:null!==(t=(0,_e.C_)(L))&&void 0!==t?t:T("label.open-metadata")})),l.createElement(r.Z,{"data-testid":"summary-card-content",gutter:[16,16]},o===f.N.DATA_ASSETS&&l.createElement(l.Fragment,null,j.map((function(e){return l.createElement(i.Z,{"data-testid":"data-assets-summary",key:e.id,span:6,onClick:function(){return s(e.id)}},l.createElement(tt.e,{className:"summary-card-item",isLoading:g,showProgressBar:!1,title:e.label,total:0,value:e.latest+"\n "+(e.id===Q.l4.TotalDataAssets?"":"%")}))}))),o===f.N.APP_ANALYTICS&&l.createElement(l.Fragment,null,w.map((function(e){return l.createElement(i.Z,{"data-testid":"app-analytics-summary",key:e.id,span:6,onClick:function(){return s(e.id)}},l.createElement(tt.e,{className:"summary-card-item h-full",isLoading:g,showProgressBar:!1,title:e.label,total:0,value:e.latest+"\n "+(e.id.startsWith("Percentage")?"%":"")}))})),(null==v?void 0:v.userName)&&l.createElement(i.Z,{"data-testid":"summary-item-"+_.r.MostActiveUsers,key:_.r.MostActiveUsers,span:6},l.createElement(tt.e,{isLoading:g,showProgressBar:!1,title:T("label.most-active-user"),total:0,value:l.createElement(et.Z,{showUserName:!0,profileWidth:36,userName:v.userName})})))))},at=n(49101),rt=n(31011),it=function(e){var t=e.chartFilter,n=e.kpiList,s=e.viewKPIPermission,o=e.createKPIPermission,g=e.isKpiLoading,p=(0,Y.$)().t,y=(0,c.k6)(),f=(0,a.CR)((0,l.useState)({}),2),E=f[0],A=f[1],I=(0,a.CR)((0,l.useState)(),2),N=I[0],D=I[1],v=(0,a.CR)((0,l.useState)(!1),2),S=v[0],b=v[1],L=(0,a.CR)((0,l.useState)([]),2),C=L[0],j=L[1],w=(0,a.CR)((0,l.useState)(""),2),T=w[0],x=w[1],Z=function(e){return(0,a.mG)(void 0,void 0,void 0,(function(){var n,r;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:return[4,(0,Fe.CR)(null!==(r=e.fullyQualifiedName)&&void 0!==r?r:"",{startTs:t.startTs,endTs:t.endTs})];case 1:return n=a.sent(),[2,{name:e.name,data:n.results}]}}))}))},O=(0,l.useMemo)((function(){return n.reduce((function(e,t){var n;return e[null!==(n=t.fullyQualifiedName)&&void 0!==n?n:""]=t.metricType,e}),{})}),[n]),z=(0,l.useMemo)((function(){return Object.keys(E)}),[E]);return(0,l.useEffect)((function(){A({}),D(void 0)}),[t]),(0,l.useEffect)((function(){n.length&&((0,a.mG)(void 0,void 0,void 0,(function(){var e,t,r,i;return(0,a.Jh)(this,(function(a){switch(a.label){case 0:b(!0),a.label=1;case 1:return a.trys.push([1,3,4,5]),e=n.map(Z),[4,Promise.allSettled(e)];case 2:return t=a.sent(),r={},t.forEach((function(e){"fulfilled"===e.status&&(r[e.value.name]=e.value.data)})),A(r),[3,5];case 3:return i=a.sent(),(0,$.Eo)(i),[3,5];case 4:return b(!1),[7];case 5:return[2]}}))})),(0,a.mG)(void 0,void 0,void 0,(function(){var e,t,r,i;return(0,a.Jh)(this,(function(s){switch(s.label){case 0:b(!0),s.label=1;case 1:return s.trys.push([1,3,4,5]),e=n.map((function(e){var t;return(0,Fe.aN)(null!==(t=e.fullyQualifiedName)&&void 0!==t?t:"")})),[4,Promise.allSettled(e)];case 2:return t=s.sent(),r=t.reduce((function(e,t){var r,i,s;if("fulfilled"===t.status){var l=t.value,c=null!==(i=l.kpiFqn)&&void 0!==i?i:"",u=n.find((function(e){return e.fullyQualifiedName===c})),o=null==u?void 0:u.targetValue;if(!(0,re.isUndefined)(u)&&!(0,re.isUndefined)(o))return(0,a.pi)((0,a.pi)({},e),((r={})[c]=(0,a.pi)((0,a.pi)({},l),{target:o,metricType:null==u?void 0:u.metricType,startDate:null==u?void 0:u.startDate,endDate:null==u?void 0:u.endDate,displayName:null!==(s=u.displayName)&&void 0!==s?s:c}),r))}return e}),{}),D(r),[3,5];case 3:return i=s.sent(),(0,$.Eo)(i),[3,5];case 4:return b(!1),[7];case 5:return[2]}}))})))}),[n,t]),l.createElement(R.Z,{className:"data-insight-card","data-testid":"kpi-card",id:"kpi-charts",loading:S||g,title:l.createElement(q.Z,{data:{header:p("label.kpi-title"),subHeader:p("message.kpi-subtitle")}})},n.length?l.createElement(r.Z,{gutter:m.ib.rowContainerGutter},(0,re.isEmpty)(E)?l.createElement(i.Z,{className:"justify-center",span:24},s?l.createElement(ne.F,null):l.createElement(u.Z,{type:h.Wx.PERMISSION})):l.createElement(l.Fragment,null,l.createElement(i.Z,{span:m.ib.leftContainerSpan},l.createElement(W.h,{debounce:1,height:m.Rw,id:"kpi-chart"},l.createElement(U.w,{margin:m.ur},l.createElement(V.q,{stroke:d.KT,vertical:!1}),l.createElement(K.u,{content:l.createElement(M.WH,{timeStampKey:"day",valueFormatter:function(e,t){return(t?O[t]===Ke.m.Percentage:Ke.m.Number)?(0,re.round)(Number(e),2)+"%":e+""}})}),l.createElement(H.K,{allowDuplicatedCategory:!1,dataKey:"day",tickFormatter:oe.p6,type:"category"}),l.createElement(B.B,{dataKey:"count"}),l.createElement(G.D,{align:"left",content:function(e){return(0,M.Lt)(e,C)},key:"name",layout:"horizontal",verticalAlign:"top",wrapperStyle:{left:"0px",top:"0px"},onClick:function(e){j((function(t){return(0,De.Ss)(e.value,t)}))},onMouseEnter:function(e){x(e.value)},onMouseLeave:function(){x("")}}),z.map((function(e,t){return l.createElement(J.x,{data:E[e],dataKey:"count",hide:!(!C.length||e===T||C.includes(e)),key:e,name:e,stroke:m.uZ[t],strokeOpacity:(0,re.isEmpty)(T)||e===T?d.Vs:d.$Q,type:"monotone"})}))))),!(0,re.isUndefined)(N)&&!(0,re.isEmpty)(N)&&l.createElement(i.Z,{span:m.ib.rightContainerSpan},l.createElement(rt.Z,{kpiLatestResultsRecord:N})))):l.createElement(le.Z,{className:"w-full justify-center items-center",direction:"vertical"},l.createElement(u.Z,{button:l.createElement(Me.Z,{ghost:!0,icon:l.createElement(at.Z,null),type:"primary",onClick:function(){return y.push(d.Z6.ADD_KPI)}},p("label.add-entity",{entity:p("label.kpi-uppercase")})),className:"m-0",permission:o,size:h.NO.MEDIUM,type:o?h.Wx.ASSIGN:h.Wx.NO_DATA},o&&p("message.no-kpi-available-add-new-one"))))},st=n(72056),lt=function(e){var t=e.onScrollToChart,n=(0,P.Gy)(),s=n.teamFilter,u=n.tierFilter,o=n.chartFilter,m=n.onChartFilterChange,h=n.kpi,f=(0,c.UO)().tab,A=(0,c.k6)(),I=(0,Y.$)().t,N=(0,g.BL)().permissions,D=(0,M.Ou)(f),v=D.showDataInsightSummary,S=D.showKpiChart,b=(0,l.useMemo)((function(){return(0,E.P_)(y.OX.ViewAll,p.A.KPI,N)}),[N]),L=(0,l.useMemo)((function(){return(0,E.P_)(y.OX.Create,p.A.KPI,N)}),[N]);return l.createElement(r.Z,{gutter:[16,16]},l.createElement(i.Z,{span:24},l.createElement(le.Z,{className:"w-full justify-between items-start"},l.createElement("div",{"data-testid":"data-insight-header"},l.createElement(ce.Z.Title,{level:5},I("label.data-insight-plural")),l.createElement(ce.Z.Text,{className:"data-insight-label-text"},I("message.data-insight-subtitle"))),L&&l.createElement(Me.Z,{"data-testid":"add-kpi-btn",type:"primary",onClick:function(){A.push(d.Z6.ADD_KPI)}},I("label.add-entity",{entity:I("label.kpi-uppercase")})))),l.createElement(i.Z,{span:24},l.createElement(le.Z,{className:"w-full justify-between align-center"},l.createElement(le.Z,{className:"w-full",size:16},l.createElement(st.Z,(0,a.pi)({hideCounts:!0,label:I("label.team"),searchKey:"teams"},s)),l.createElement(st.Z,(0,a.pi)({hideCounts:!0,label:I("label.tier"),searchKey:"tier"},u))),l.createElement(le.Z,null,l.createElement(ce.Z,{className:"data-insight-label-text text-xs"},(0,oe.p6)(o.startTs)+" - "+(0,oe.p6)(o.endTs)),l.createElement(qe.Z,{handleDateRangeChange:m,showSelectedCustomRange:!1})))),v&&l.createElement(i.Z,{span:24},l.createElement(nt,{chartFilter:o,onScrollToChart:t})),S&&l.createElement(i.Z,{span:24},l.createElement(it,{chartFilter:o,createKPIPermission:L,isKpiLoading:h.isLoading,kpiList:h.data,viewKPIPermission:b})))},ct=function(){var e=(0,c.UO)().tab,t=(0,g.BL)().permissions,n=(0,c.k6)(),A=$e.getLeftPanel(),I=(0,l.useMemo)((function(){return[f.N.DATA_ASSETS,f.N.KPIS,f.N.APP_ANALYTICS,"dashboard"].includes(e)}),[e]),N=(0,l.useMemo)((function(){return(0,E.P_)(y.OX.ViewAll,p.A.DATA_INSIGHT_CHART,t)}),[t]),D=(0,l.useMemo)((function(){return(0,E.P_)(y.OX.ViewAll,p.A.KPI,t)}),[t]),v=(0,a.CR)((0,l.useState)(),2),S=v[0],b=v[1];(0,l.useLayoutEffect)((function(){if(S){var e=document.getElementById(S);e&&(e.scrollIntoView({block:"center",behavior:"smooth"}),b(void 0))}}),[S]);var L=(0,l.useMemo)((function(){return{noDataInsightPermission:!N&&(e===f.N.APP_ANALYTICS||e===f.N.DATA_ASSETS),noKPIPermission:!D&&e===f.N.KPIS,dataInsightTabs:$e.getDataInsightTab()}}),[N,D,e]),C=L.noDataInsightPermission,j=L.noKPIPermission,w=L.dataInsightTabs;return N||D?C||j?l.createElement(r.Z,{align:"middle",className:"w-full h-full",justify:"center"},l.createElement(i.Z,{span:24},l.createElement(u.Z,{type:h.Wx.PERMISSION}))):l.createElement(o.Z,{leftPanel:l.createElement(A,null),pageTitle:(0,s.t)("label.data-insight")},l.createElement(P.ZP,null,l.createElement(r.Z,{className:"page-container","data-testid":"data-insight-container",gutter:[16,16]},I&&l.createElement(i.Z,{span:24},l.createElement(lt,{onScrollToChart:function(e){m.HY.includes(e)?n.push((0,M.zc)(f.N.DATA_ASSETS)):n.push((0,M.zc)(f.N.APP_ANALYTICS)),b(e)}})),l.createElement(i.Z,{span:24},l.createElement(c.rs,null,w.map((function(e){return l.createElement(c.AW,{exact:!0,component:e.component,key:e.key,path:e.path})})),l.createElement(c.AW,{exact:!0,path:d.Z6.DATA_INSIGHT},l.createElement(c.l_,{to:(0,M.zc)()}))))))):l.createElement(u.Z,{type:h.Wx.PERMISSION})}}}]);