forked from bombastictranz/awesome
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
4815-8aed6dd0074f4692.js.download
1 lines (1 loc) · 14.7 KB
/
4815-8aed6dd0074f4692.js.download
1
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4815],{9411:function(e,t,n){var r=n(28165),i=n(99029),a=n(25760),o=n(52903),rootStyle=function(e){var t=e.isLight?a.zQ:a.vm;return(0,r.iv)("background:",t[e.status]||t.unknown,";border:",e.outlineWidth||0,"px solid ",i.w.neutral100,";border-radius:10px;height:",e.size,"px;width:",e.size,"px;;label:StatusCircle--rootStyle;")};t.Z=function(e){return(0,o.tZ)("div",{"aria-hidden":!0,css:rootStyle(e)})}},42413:function(e,t,n){n.d(t,{j:function(){return PointTooltip}});var r=n(81333),i=n(28165),a=n(19928),o=n.n(a),l=n(99029),s=n(3e3),c=n(55414),u=n(73026),d=n(32052),p=n(9411),b=n(95235),h=n(2784),f=n(98628),g=n(10391),y=n(69480),v=n(39479),m=n(52676),x=n(52903);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,b.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var w="13px",Z=(0,i.F4)({"0%":{opacity:0},"100%":{opacity:1}}),S={east:{left:"calc(100% + ".concat(w,")"),top:"50%",transform:"translateY(-50%)"},north:{bottom:"calc(100% + ".concat(w,")"),left:"50%",transform:"translateX(-50%)"},northeast:{bottom:"calc(100% + ".concat(w,")"),right:0},northwest:{bottom:"calc(100% + ".concat(w,")"),left:0},south:{left:"50%",top:"calc(100% + ".concat(w,")"),transform:"translateX(-50%)"},southeast:{right:0,top:"calc(100% + ".concat(w,")")},southwest:{left:0,top:"calc(100% + ".concat(w,")")},west:{right:"calc(100% + ".concat(w,")"),top:"50%",transform:"translateY(-50%)"}},k="south",M=(0,v.B)("Tooltip",{content:function(e){return[{display:"block"},!e.allowMultiline&&(0,m.Q)("singleLine",{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"})]},root:function(e,t){var n=e.position,r=void 0===n?k:n,i=e.allowMultiline,a=e.isInteractive;return[_objectSpread(_objectSpread({"&::before":{bottom:"-".concat(w),content:'""',left:"-".concat(w),position:"absolute",right:"-".concat(w),top:"-".concat(w),zIndex:-1},animation:"".concat(f.f.transitionDuration," ").concat(f.f.transitionTimingFunction," ").concat(Z),backgroundColor:l.w.gray,borderRadius:100,boxShadow:g.f.elevation5,color:l.w.white,display:"block",maxWidth:300,padding:"0 1em",position:"relative",textAlign:"center",zIndex:2},s.ZT.smallPrint1),{},{fontWeight:600}),r&&[{position:"absolute"},(0,m.Q)(r,S[r])],t&&(0,m.Q)("isMultiline",{borderRadius:10,padding:"10px 15px 15px 15px",textAlign:"left"}),!i&&(0,m.Q)("singleLine",{height:20}),!a&&(0,m.Q)("nonInteractive",{pointerEvents:"none"})]}}),correctPosition=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"south",t=arguments.length>1?arguments[1]:void 0,n=t.isTopIntersecting,r=t.isBottomIntersecting,i=t.isLeftIntersecting,a=t.isRightIntersecting;return r&&e.includes("south")?e.replace("south","north"):n&&e.includes("north")?e.replace("north","south"):i&&e.includes("west")?e.replace("west","east"):a&&e.includes("east")?e.replace("east","west"):i&&("south"===e||"north"===e)?"".concat(e,"west"):a&&("south"===e||"north"===e)?"".concat(e,"east"):e||"south"},Tooltip=function(e){var t=(0,h.useRef)(e.position||"south"),n=e.allowMultiline,i=(0,y.U)({threshold:.9,rootMargin:"-5px"}),a=(0,r.Z)(i,2),o=a[0],l=a[1],s=(null==l?void 0:l.isTopIntersecting)||(null==l?void 0:l.isLeftIntersecting)||(null==l?void 0:l.isRightIntersecting)||(null==l?void 0:l.isBottomIntersecting),c=(0,h.useMemo)(function(){return s&&t.current===e.position&&(t.current=correctPosition(e.position||"south",l)),t.current},[e.position,s,l]),u=_objectSpread(_objectSpread({},e),{},{position:c});return(0,x.tZ)("span",{"aria-hidden":e.ariaHidden,css:M.root(u,n),"data-testid":"tooltip-".concat(c),id:e.id,ref:o,role:"tooltip",children:(0,x.tZ)("span",{css:M.content(u),children:e.children})})};Tooltip.defaultProps={allowMultiline:!1,position:k};var j=(0,i.iv)("color:",l.w.success10,";margin-top:-10px;;label:PointTooltip--diffStyle;"),T=(0,i.iv)(s.ZT.paragraph3," align-items:center;color:",l.w.neutral100,";display:grid;grid-auto-flow:column;grid-gap:7px;justify-content:flex-start;;label:PointTooltip--statusStyle;"),L={name:"1usm1xc-PointTooltip--tipStyle",styles:"display:grid;grid-gap:20px;min-width:220px;label:PointTooltip--tipStyle;"},O=(0,i.iv)(s.ZT.paragraph3Semibold," color:",l.w.neutral100,";text-transform:none;;label:PointTooltip--titleStyle;");function PointTooltip(e){var t=e.diff,n=e.point,i=e.tipId,a=Object.entries(n.statuses||{billable:n.value});return(0,x.tZ)(Tooltip,{allowMultiline:!0,id:i,position:"north",children:(0,x.BX)("div",{css:L,children:[(0,x.tZ)("div",{css:O,children:n.formatted}),a.length>0?(0,x.BX)(x.HY,{children:[(0,x.tZ)(u.Z,{gap:5,getKey:function(e){return(0,r.Z)(e,1)[0]},itemRenderer:function(e){var t=(0,r.Z)(e,2),n=t[0],i=t[1];return(0,x.BX)("div",{css:T,children:[(0,x.tZ)(p.Z,{outlineWidth:2,size:8,status:n}),(0,x.tZ)(d.Z,{maxDecimals:0,children:i}),(0,x.tZ)("span",{children:"billable"===n?o()("Task",i):n})]},n)},items:a}),void 0!==t&&(0,x.BX)("span",{css:j,children:["+",(0,x.tZ)(d.Z,{maxDecimals:0,children:t})," Tasks"]})]}):(0,x.tZ)(c.x,{color:"neutral100",type:"paragraph3",children:"No Activity"})]})})}},54815:function(e,t,n){n.d(t,{Z:function(){return W}});var r=n(95235),i=n(81333),a=n(28165),o=n(2784),l=n(55414),s=n(61390),c=n(1283),u=n(12741),d=n(17471),p=n(24602),b=n(2357),h=n(95030),f=n(44001),g=n(82489),y=n(88657),v=n(93201),m=n(22438),x=n(57199),w=n(70278),Z=n(81692),S="yyyy-MM-dd",k={day:"EEEE, MMMM do",month:"MMMM, yyyy",year:"yyyy"};function getPointDateRange(e,t){return t===s.YT.day?{end:(0,h.Z)(e,S),start:(0,h.Z)(e,S)}:{end:(0,h.Z)((0,m.Z)(e),S),start:(0,h.Z)(e,S)}}var M=n(3e3),j=n(99029),T=n(52903),L=(0,a.iv)(M.ZT.paragraph3," text-align:center;white-space:nowrap;;label:MarkerLine--labelStyle;"),O={name:"yk66h6-MarkerLine--labelWrapperStyle",styles:"display:flex;justify-content:center;position:absolute;top:-25px;width:0px;label:MarkerLine--labelWrapperStyle;"},P={name:"xmz9bs-MarkerLine--leftStyle",styles:"justify-content:flex-end;label:MarkerLine--leftStyle;"},U={name:"1x36bow-MarkerLine--rightStyle",styles:"justify-content:flex-start;label:MarkerLine--rightStyle;"},B=(0,a.iv)("background:",j.w.neutral600,";color:",j.w.neutral700,";height:105%;justify-self:center;max-width:5px;min-width:1px;position:absolute;width:25%;;label:MarkerLine--rootStyle;");function MarkerLine(e){var t=e.marker,n=e.percent;return(0,T.tZ)("div",{css:B,children:(0,T.tZ)("span",{css:[O,n<10&&U,n>90&&P,";label:MarkerLine--MarkerLine;"],children:(0,T.tZ)("span",{css:L,children:t.label})})})}var I=n(43930),R=n(98628),_=n(26215),Y=n(17712),z=n(25760),X=n(42413),D={name:"skp7iq-UsageBar--barInnerStyle",styles:"height:100%;overflow:hidden;label:UsageBar--barInnerStyle;"};function UsageBar(e){var t=e.linkUrl,n=e.onClick,r=e.point,l=e.yRange,s=(0,o.useState)(!1),c=s[0],u=s[1],d="".concat(r.date.start,"_tip"),p=Math.max((r.value-l.min)/(l.max-l.min)*100,.5),b="".concat(Object.entries(r.statuses).map(function(e){var t=(0,i.Z)(e,2),n=t[0],r=t[1];return"".concat(r," ").concat(n," tasks")}).join(", ")||"No tasks"," on ").concat(r.formatted),h=(0,o.useMemo)(function(){if(t)return(0,Y.aE)(t,{end_datetime:r.date.end,start_datetime:r.date.start})},[t,r.date.end,r.date.start]),f=(0,o.useMemo)(function(){if(n)return function(){return n(r)}},[n,r]);return(0,T.BX)("div",{"aria-describedby":c?d:void 0,css:(0,a.iv)("height:",p,"%;position:relative;;label:UsageBar--barStyle;"),children:[(0,T.tZ)(_.r,{ariaLabel:b,href:h,onClick:f,children:(0,T.tZ)("div",{css:D,onMouseEnter:function(){return u(!0)},onMouseLeave:function(){return u(!1)},children:Object.entries(r.statuses).map(function(e){var t,n=(0,i.Z)(e,2),o=n[0],l=n[1];return(0,T.tZ)("div",{css:(t=(l||0)/r.value*100,(0,a.iv)("background-color:",c?z.zQ[o]:z.vm[o],";border-bottom-color:",j.w.neutral100,';border-bottom-width:1px;border-bottom-style:solid;content:" ";height:',t,"%;transition:",R.f.transitionValue,";&:first-of-type{border-right-width:0px;};label:UsageBar--barPartStyle;"))},o)})})}),c&&(0,T.tZ)(X.j,{point:r,tipId:d})]})}var E=n(33565),C=n(75990);function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(n),!0).forEach(function(t){(0,r.Z)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var G={name:"1x61hud-UsageTrend--graphStyle",styles:"display:grid;grid-auto-flow:column;grid-gap:3px;height:250px;padding-bottom:28px;padding-left:40px;position:relative;label:UsageTrend--graphStyle;"},K={name:"1rcn99j-UsageTrend--maxGraphStyle",styles:"justify-content:center;label:UsageTrend--maxGraphStyle;"},Q=(0,a.iv)("min-width:",66,"px;;label:UsageTrend--maxPointStyle;"),A=(0,a.iv)("align-items:flex-end;display:grid;max-width:",66,"px;position:relative;;label:UsageTrend--pointStyle;"),N={name:"1atzwg1-UsageTrend--yStyle",styles:"bottom:17px;height:calc(100% - 26px);position:absolute;width:100%;label:UsageTrend--yStyle;"};function UsageTrend(e){var t,n,r,m,S,M=e.ariaLabel,j=e.interval,L=void 0===j?s.YT.day:j,O=e.linkUrl,P=e.markers,U=void 0===P?[]:P,B=e.onBarClick,R=e.range,_=e.trend,Y=e.trendType,z=(0,c.a)(),X=(0,i.Z)(z,2),D=X[0],W=(null==(t=X[1])?void 0:null===(n=t.contentBoxSize)||void 0===n?void 0:null===(r=n[0])||void 0===r?void 0:r.inlineSize)||(null==t?void 0:null===(m=t.contentBoxSize)||void 0===m?void 0:m.inlineSize)||(null==t?void 0:null===(S=t.contentRect)||void 0===S?void 0:S.width)||0,F=(0,o.useMemo)(function(){return function(e){var t=e.dynamicBaseline,n=e.interval,r=e.markers,i=void 0===r?[]:r,a=e.range,o=e.showTasks,l=e.trend;if(!(null!=l&&l.length))return{points:[],yLabels:[],yRange:{max:0,min:0,step:0,steps:0}};var c=void 0!==t&&t?1/0:0,m=0,S=(0,d.Z)([new Date,(0,p.Z)(a.end)]),M=(0,p.Z)(a.start),j=(n===s.YT.day?(0,x.Z)(S,M):n===s.YT.month?(0,w.Z)(S,M):0)+1,T=j<10?1:j<20?2:j<100?Math.floor(j/6):Math.floor(j/4),L=Array.from({length:j},function(e,t){var r=n===s.YT.day?(0,y.Z)(M,t):(0,v.Z)(M,t),a=i.filter(function(e){return(0,b.Z)((0,p.Z)(e.date),r)}),u=function(e,t,n,r){if(n===s.YT.day){var i=(0,f.Z)(e);return{label:i,isGuide:t,subLabel:0===r||1===i?(0,h.Z)(e,"MMM"):null}}var a=(0,g.Z)(e);return{label:(0,h.Z)(e,"MMM"),isGuide:t,subLabel:0===r||0===a?(0,h.Z)(e,"yyyy"):null}}(r,t%T==0,n,t),d=l.find(function(e){return(0,b.Z)((0,p.Z)(e.date),r)});if(d){var x=(0,Z.G)(d.tasks,function(e,t){return!Number.isInteger(e)||e<=0||(o?"billable"!==t:"billable"===t)}),w=Object.values(x).reduce(function(e,t){return e+t},0);m=Math.max(m,w),c=Math.min(c,w);var S=(0,p.Z)(d.date);return{date:getPointDateRange(S,n),formatted:(0,h.Z)(S,k[n]),markers:a,statuses:x,value:w,xLabel:u}}return c=0,{date:getPointDateRange(r,n),formatted:(0,h.Z)(r,k[n]),markers:a,statuses:{},value:0,xLabel:u}}),O=function(e,t){var n=t-e;if(0===n)return{max:t,min:e,step:0,steps:1};var r=n/4;if(r<1)return{max:t,min:e,step:1,steps:t-e};var i=Math.pow(10,Math.ceil(Math.log10(r)-1)),a=Math.ceil(r/i)*i,o=(Math.ceil((e+1)/i)-1)*i;return{max:4*a+o,min:o,step:a,steps:4}}(c,m);return{points:L,yLabels:(0,u.Z)(Array.from({length:O.steps+1},function(e,t){return{percent:t/O.steps*100,value:O.min+t*O.step}})),yRange:O}}({interval:L,markers:U,range:R,showTasks:Y===I.r.tasks,trend:_})},[L,U,R,_,Y]),H=F.points,q=F.yLabels,V=F.yRange;if((null==_?void 0:_.length)===0)return null;var J=W/Math.max(H.length,1),$=J>66&&66*H.length+.02*W*(H.length-1)<=W;return V.max>0?(0,T.BX)("div",{"aria-label":M,css:[G,(0,a.iv)("grid-gap:",J<20?"3px":J<40?"4px":"2%",";;label:UsageTrend--gapStyle;"),$&&K,";label:UsageTrend--UsageTrend;"],ref:D,role:"figure",children:[(0,T.tZ)("div",{css:N,children:q.map(function(e,t){return(0,T.tZ)(C.Y,_objectSpread({idx:t,step:V.step},e),"ylabel_".concat(t))})}),H.map(function(e,t){return(0,T.BX)("div",{css:[A,$&&Q,";label:UsageTrend--UsageTrend;"],children:[(0,T.tZ)(UsageBar,{linkUrl:O,onClick:B,point:e,yRange:V}),(0,T.tZ)(E.u,_objectSpread(_objectSpread({},e.xLabel),{},{width:J})),e.markers.map(function(e,n){return(0,T.tZ)(MarkerLine,{marker:e,percent:100*(t/H.length)},n)})]},"xlabel_".concat(t))})]}):(0,T.BX)(l.x,{color:"neutral700",type:"paragraph3",children:["No ",Y===I.r.tasks?"tasks":"activity"," Found"]})}UsageTrend.defaultProps={ariaLabel:"Usage over time graph"};var W=UsageTrend},33565:function(e,t,n){n.d(t,{u:function(){return XLabel}});var r=n(28165),i=n(3e3),a=n(99029),o=n(52903),l=(0,r.iv)(i.ZT.paragraph3," bottom:-53px;color:",a.w.neutral700,";display:grid;grid-template-rows:1fr 1fr;justify-content:center;position:absolute;text-align:center;width:100%;;label:XLabel--rootStyle;"),s={name:"1nrpr6t-XLabel--subStyle",styles:"margin-top:-3px;label:XLabel--subStyle;"};function XLabel(e){var t=e.isGuide,n=e.label,r=e.subLabel;return!(e.width<22)||r||t?(0,o.BX)("div",{"aria-hidden":!0,css:l,children:[n&&(0,o.tZ)("div",{children:n}),r&&(0,o.tZ)("div",{css:s,children:r})]}):null}},75990:function(e,t,n){n.d(t,{Y:function(){return YLabel}});var r=n(28165),i=n(3e3),a=n(99029),o=n(32052),l=n(52903),s=(0,r.iv)(i.ZT.paragraph3," color:",a.w.neutral700,";height:24px;position:relative;text-align:right;z-index:2;;label:YLabel--yLabelStyle;"),c={name:"135m6kj-YLabel--yLabelInnerStyle",styles:"bottom:0px;position:absolute;right:0px;label:YLabel--yLabelInnerStyle;"},u=(0,r.iv)("background-color:",a.w.neutral400,';content:" ";height:1px;;label:YLabel--yLineStyle;');function YLabel(e){var t=e.idx,n=e.percent,i=e.step,a=e.value;return(0,l.BX)("div",{css:(0,r.iv)("align-items:center;bottom:",n,"%;display:grid;grid-gap:5px;grid-template-columns:30px 1fr;left:0;position:absolute;width:100%;;label:YLabel--yGuideStyle;"),children:[(0,l.tZ)("div",{css:s,children:(0,l.tZ)("div",{css:c,children:(0,l.tZ)(o.Z,{isAbbreviated:i>99,maxDecimals:1,children:a})})}),(0,l.tZ)("div",{css:u})]},"ylabel_".concat(t))}},43930:function(e,t,n){var r,i;n.d(t,{r:function(){return r}}),(i=r||(r={})).status="status",i.tasks="tasks"},1283:function(e,t,n){n.d(t,{a:function(){return useResize}});var r=n(81333),i=n(2784);function useResize(){var e=(0,i.useState)(null),t=e[0],n=e[1],a=(0,i.useState)(null),o=a[0],l=a[1],s=(0,i.useRef)(null);return(0,i.useEffect)(function(){var e=s.current;return e&&e.disconnect(),o&&(s.current=new ResizeObserver(function(e){return n((0,r.Z)(e,1)[0]||null)}),s.current.observe(o)),function(){return null==e?void 0:e.disconnect()}},[o]),[l,t]}}}]);