@verifiedinc-public/shared-ui-elements 5.1.1 → 5.1.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{B as a,i as s,E as e,L as r,j as i,M as t,g as C,O as h,P as n,R as o,e as S,d as m,S as g,a as p,b as c,k as d,c as l,f as O,h as b,m as k}from"../../shared/SignupBigNumbers-
|
1
|
+
"use strict";import{B as a,i as s,E as e,L as r,j as i,M as t,g as C,O as h,P as n,R as o,e as S,d as m,S as g,a as p,b as c,k as d,c as l,f as O,h as b,m as k}from"../../shared/SignupBigNumbers-KLy-jTWw.mjs";export{a as BigNumber,s as EmptyChartSection,e as ErrorCodesChart,r as LoadingChartSection,i as MetricLastUpdated,t as MonthlySignupsOverviewTable,C as OneClickOverTimeChart,h as OneClickPercentageChart,n as PieChart,o as ReasonCodesChart,S as RiskScoreBarChart,m as RiskScorePieChart,g as SeriesChart,p as SeriesChartLegend,c as SeriesPercentageChart,d as SignupBigNumbers,l as SimpleBarChart,O as SimpleLegend,b as mapMonthlySignupsOverviewTableData,k as mapTimeSeriesData};
|
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{A as a,c as s,l as e,B as r,n as t,m as n,C as i,D as o,f as p,E as c,j as m,F as u,I as d,b as h,L as C,O as S,h as l,e as g,P,Q as B,R as I,S as k,d as b,k as T,T as L,g as O,a as y,V as R,i as f,t as v,u as E}from"../shared/index-
|
1
|
+
"use strict";import{A as a,c as s,l as e,B as r,n as t,m as n,C as i,D as o,f as p,E as c,j as m,F as u,I as d,b as h,L as C,O as S,h as l,e as g,P,Q as B,R as I,S as k,d as b,k as T,T as L,g as O,a as y,V as R,i as f,t as v,u as E}from"../shared/index-D1KaOXqB.mjs";import{a as D,b as A,P as F,S as N}from"../shared/PageSectionHeader-DdpDhBZG.mjs";import{B as M,C as x,i as H,E as W,L as j,j as w,M as Q,g as V,O as q,P as z,R as U,e as G,d as J,S as K,a as X,b as Y,k as Z,c as _,f as $,W as aa,h as sa,m as ea,u as ra}from"../shared/SignupBigNumbers-KLy-jTWw.mjs";import{SnackbarProvider as ta}from"notistack";export{a as AcceptTermsNotice,s as Alert,e as Backdrop,r as Banner,M as BigNumber,t as BrandFilterInput,n as Button,i as CredentialRequestsEditor,x as CustomAlertComponent,o as DateInput,p as DateRangeInput,c as EmailInput,H as EmptyChartSection,W as ErrorCodesChart,m as ExactBirthdayBanner,u as FullWidthAlert,d as Image,h as LegalLink,C as LinkButton,j as LoadingChartSection,w as MetricLastUpdated,Q as MonthlySignupsOverviewTable,S as OTPInput,l as OneClickForm,V as OneClickOverTimeChart,q as OneClickPercentageChart,D as PageHeader,A as PageSectionHeader,F as Paragraph,g as PhoneInput,z as PieChart,P as PrivacyPolicyNotice,B as QRCodeDisplay,U as ReasonCodesChart,I as ResendPhoneBanner,G as RiskScoreBarChart,J as RiskScorePieChart,k as SSNInput,N as SectionHeader,b as SelectInput,K as SeriesChart,X as SeriesChartLegend,Y as SeriesPercentageChart,Z as SignupBigNumbers,_ as SimpleBarChart,$ as SimpleLegend,ta as SnackbarProvider,T as TestPhoneNumbersBanner,L as TextButton,O as TimezoneInput,y as Typography,R as VerifiedImage,f as VerifiedIncLogo,aa as When,sa as mapMonthlySignupsOverviewTableData,ea as mapTimeSeriesData,v as toOption,E as useBrandFilterInput,ra as useSnackbar};
|
package/dist/index.mjs
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";import{A as s,c as e,l as r,B as t,n as o,m as i,C as n,D as m,f as l,E as u,j as p,F as d,I as c,b as h,L as S,O as g,h as C,e as f,P as k,Q as P,R as b,S as y,d as B,k as D,T,g as I,a as v,V as O,i as R,o as w,t as L,u as N}from"./shared/index-
|
1
|
+
"use strict";import{A as s,c as e,l as r,B as t,n as o,m as i,C as n,D as m,f as l,E as u,j as p,F as d,I as c,b as h,L as S,O as g,h as C,e as f,P as k,Q as P,R as b,S as y,d as B,k as D,T,g as I,a as v,V as O,i as R,o as w,t as L,u as N}from"./shared/index-D1KaOXqB.mjs";import{a as M,b as E,P as Y,S as x}from"./shared/PageSectionHeader-DdpDhBZG.mjs";import{B as F,C as z,i as A,E as G,L as W,j as U,M as V,g as j,O as H,P as q,R as Q,e as $,d as J,S as K,a as X,b as Z,k as _,c as aa,f as sa,W as ea,l as ra,o as ta,n as oa,p as ia,h as na,m as ma,u as la,q as ua}from"./shared/SignupBigNumbers-KLy-jTWw.mjs";import{b as pa,d as da,a as ca,j as ha,u as Sa,k as ga,e as Ca,c as fa,f as ka,g as Pa,h as ba,i as ya}from"./shared/useNavigatorOnline-LJuH4983.mjs";import{u as Ba,a as Da}from"./shared/useCopyToClipboard-_Ur9Q8Gv.mjs";import{a as Ta,u as Ia}from"./shared/useOnClickOutside-P5GTcgh8.mjs";import{u as va}from"./shared/useCounter-BV32zXDQ.mjs";import{u as Oa}from"./shared/useResizeObserver-D434c1uN.mjs";import{b as Ra,a as wa,v as La,e as Na,d as Ma,p as Ea,u as Ya,h as xa,j as Fa,g as za,o as Aa,s as Ga,m as Wa,c as Ua,l as Va,n as ja,q as Ha,f as qa,i as Qa,r as $a,z as Ja,t as Ka,x as Xa,k as Za,w as _a,y as as}from"./shared/shadows-Dhd7FrwF.mjs";import{wrapPromise as ss}from"./utils/wrapPromise/index.mjs";import{c as es,g as rs,a as ts,p as os,s as is,v as ns}from"./shared/phone-D5XIxT7-.mjs";import{masks as ms}from"./utils/masks/index.mjs";import{toCapitalize as ls,toSentenceCase as us}from"./utils/string/index.mjs";import{k as ps}from"./shared/formatKebabToPretty-Du43TgPC.mjs";import{M as ds,S as cs,U as hs,d as Ss,e as gs,f as Cs,g as fs,a as ks,s as Ps}from"./shared/unix.schema-CMYTtXco.mjs";import{p as bs}from"./shared/phone.schema-XBbyizhq.mjs";import{SnackbarProvider as ys}from"notistack";const Bs=a=>a.replace(/(\d{3})-?(\d{2})-?(\d{4})/,"\u2022\u2022\u2022-\u2022\u2022-$3");export{s as AcceptTermsNotice,e as Alert,r as Backdrop,t as Banner,F as BigNumber,o as BrandFilterInput,i as Button,n as CredentialRequestsEditor,z as CustomAlertComponent,m as DateInput,l as DateRangeInput,u as EmailInput,A as EmptyChartSection,G as ErrorCodesChart,p as ExactBirthdayBanner,d as FullWidthAlert,c as Image,h as LegalLink,S as LinkButton,W as LoadingChartSection,ds as MaskedAndUnmaskedSSNSchema,U as MetricLastUpdated,V as MonthlySignupsOverviewTable,g as OTPInput,C as OneClickForm,j as OneClickOverTimeChart,H as OneClickPercentageChart,M as PageHeader,E as PageSectionHeader,Y as Paragraph,f as PhoneInput,q as PieChart,k as PrivacyPolicyNotice,P as QRCodeDisplay,Q as ReasonCodesChart,b as ResendPhoneBanner,$ as RiskScoreBarChart,J as RiskScorePieChart,y as SSNInput,cs as SSNSchema,x as SectionHeader,B as SelectInput,K as SeriesChart,X as SeriesChartLegend,Z as SeriesPercentageChart,_ as SignupBigNumbers,aa as SimpleBarChart,sa as SimpleLegend,ys as SnackbarProvider,D as TestPhoneNumbersBanner,T as TextButton,I as TimezoneInput,v as Typography,hs as USDateSchema,O as VerifiedImage,R as VerifiedIncLogo,ea as When,Ra as black,wa as blue,La as colors,es as countries,Na as darkBlue,Ma as darkGreen,Ea as darkGrey,Ya as darkGreyContrast,xa as darkRed,Fa as darkYellow,Ss as descriptionSchema,gs as emailSchema,Cs as fieldSchema,ra as formatDateMMDDYYYY,ta as formatDateMMYY,oa as formatDateToTimestamp,ia as formatExtendedDate,fs as getDateSchemaWithPastValidation,rs as getPhoneData,ts as getPhoneDataByFieldName,ks as getUnixSchema,za as green,Aa as grey,Ga as greyContrast,Wa as infoContrast,ps as kebabCaseToPretty,Ua as lightBlue,Va as lightGreen,ja as lightGrey,Ha as lightGreyContrast,qa as lightRed,Qa as lightYellow,na as mapMonthlySignupsOverviewTableData,ma as mapTimeSeriesData,ms as masks,w as omitProperties,os as parseToPhoneNational,bs as phoneSchema,$a as red,Ja as shadows,is as sortByCountryName,Bs as ssnFormatter,Ps as stateSchema,Ka as textDisabled,Xa as theme,ls as toCapitalize,L as toOption,us as toSentenceCase,N as useBrandFilterInput,pa as useCallbackRef,Ba as useCopyToClipboard,va as useCounter,da as useDebounceValue,ca as useDisclosure,ha as useIntersectionObserver,Sa as useLocalStorage,ga as useNavigatorOnline,Ta as useOnClickOutside,Da as usePrevious,Ia as useQRCode,Oa as useResizeObserver,Ca as useScript,fa as useSearchParams,la as useSnackbar,ka as useThrottle,Pa as useToggle,ba as useWindowScroll,ya as useWindowSize,ua as uuidToHashedColor,ns as validatePhone,Za as warningContrast,_a as white,ss as wrapPromise,as as yellow};
|
@@ -18,4 +18,4 @@ __p += '`),he&&(E+=`' +
|
|
18
18
|
function print() { __p += __j.call(arguments, '') }
|
19
19
|
`:`;
|
20
20
|
`)+E+`return __p
|
21
|
-
}`;var ae=qc(function(){return ve(f,z+"return "+E).apply(o,h)});if(ae.source=E,va(ae))throw ae;return ae}function Lg(e){return xe(e).toLowerCase()}function Pg(e){return xe(e).toUpperCase()}function Vg(e,t,n){if(e=xe(e),e&&(n||t===o))return ts(e);if(!e||!(t=dt(t)))return e;var a=Rt(e),s=Rt(t),f=rs(a,s),h=ns(a,s)+1;return hr(a,f,h).join("")}function Wg(e,t,n){if(e=xe(e),e&&(n||t===o))return e.slice(0,is(e)+1);if(!e||!(t=dt(t)))return e;var a=Rt(e),s=ns(a,Rt(t))+1;return hr(a,0,s).join("")}function zg(e,t,n){if(e=xe(e),e&&(n||t===o))return e.replace(vi,"");if(!e||!(t=dt(t)))return e;var a=Rt(e),s=rs(a,Rt(t));return hr(a,s).join("")}function Gg(e,t){var n=Fe,a=V;if(De(t)){var s="separator"in t?t.separator:s;n="length"in t?ne(t.length):n,a="omission"in t?dt(t.omission):a}e=xe(e);var f=e.length;if(Nr(e)){var h=Rt(e);f=h.length}if(n>=f)return e;var y=n-Rr(a);if(y<1)return a;var v=h?hr(h,0,y).join(""):e.slice(0,y);if(s===o)return v+a;if(h&&(y+=v.length-y),ba(s)){if(e.slice(y).search(s)){var I,A=v;for(s.global||(s=Ri(s.source,xe(Ou.exec(s))+"g")),s.lastIndex=0;I=s.exec(A);)var E=I.index;v=v.slice(0,E===o?y:E)}}else if(e.indexOf(dt(s),y)!=y){var F=v.lastIndexOf(s);F>-1&&(v=v.slice(0,F))}return v+a}function Ug(e){return e=xe(e),e&&tp.test(e)?e.replace(_u,bd):e}var Bg=zr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),wa=Ks("toUpperCase");function Bc(e,t,n){return e=xe(e),t=n?o:t,t===o?hd(e)?wd(e):id(e):e.match(t)||[]}var qc=se(function(e,t){try{return ft(e,o,t)}catch(n){return va(n)?n:new J(n)}}),qg=Qt(function(e,t){return _t(t,function(n){n=Gt(n),Zt(e,n,ma(e[n],e))}),e});function Kg(e){var t=e==null?0:e.length,n=q();return e=t?Ne(e,function(a){if(typeof a[1]!="function")throw new xt(d);return[n(a[0]),a[1]]}):[],se(function(a){for(var s=-1;++s<t;){var f=e[s];if(ft(f[0],this,a))return ft(f[1],this,a)}})}function Zg(e){return bh(Ot(e,M))}function Oa(e){return function(){return e}}function Yg(e,t){return e==null||e!==e?t:e}var Qg=Ys(),Hg=Ys(!0);function ct(e){return e}function ja(e){return Ss(typeof e=="function"?e:Ot(e,M))}function Xg(e){return $s(Ot(e,M))}function Jg(e,t){return Is(e,Ot(t,M))}var ev=se(function(e,t){return function(n){return vn(n,e,t)}}),tv=se(function(e,t){return function(n){return vn(e,n,t)}});function Sa(e,t,n){var a=Ye(t),s=po(t,a);n==null&&!(De(t)&&(s.length||!a.length))&&(n=t,t=e,e=this,s=po(t,Ye(t)));var f=!(De(n)&&"chain"in n)||!!n.chain,h=Xt(e);return _t(s,function(y){var v=t[y];e[y]=v,h&&(e.prototype[y]=function(){var I=this.__chain__;if(f||I){var A=e(this.__wrapped__),E=A.__actions__=at(this.__actions__);return E.push({func:v,args:arguments,thisArg:e}),A.__chain__=I,A}return v.apply(e,sr([this.value()],arguments))})}),e}function rv(){return Qe._===this&&(Qe._=Id),this}function ka(){}function nv(e){return e=ne(e),se(function(t){return As(t,e)})}var ov=na(Ne),iv=na(Qu),av=na(Ii);function Kc(e){return la(e)?Ai(Gt(e)):Fh(e)}function uv(e){return function(t){return e==null?o:Sr(e,t)}}var sv=Hs(),cv=Hs(!0);function $a(){return[]}function Ia(){return!1}function lv(){return{}}function fv(){return""}function pv(){return!0}function dv(e,t){if(e=ne(e),e<1||e>it)return[];var n=D,a=Je(e,D);t=q(t),e-=D;for(var s=Ei(a,t);++n<e;)t(n);return s}function hv(e){return ee(e)?Ne(e,Gt):ht(e)?[e]:at(dc(xe(e)))}function yv(e){var t=++kd;return xe(e)+t}var mv=bo(function(e,t){return e+t},0),gv=oa("ceil"),vv=bo(function(e,t){return e/t},1),bv=oa("floor");function _v(e){return e&&e.length?fo(e,ct,Gi):o}function xv(e,t){return e&&e.length?fo(e,q(t,2),Gi):o}function wv(e){return Ju(e,ct)}function Ov(e,t){return Ju(e,q(t,2))}function jv(e){return e&&e.length?fo(e,ct,Ki):o}function Sv(e,t){return e&&e.length?fo(e,q(t,2),Ki):o}var kv=bo(function(e,t){return e*t},1),$v=oa("round"),Iv=bo(function(e,t){return e-t},0);function Av(e){return e&&e.length?Ti(e,ct):0}function Cv(e,t){return e&&e.length?Ti(e,q(t,2)):0}return l.after=Xy,l.ary=jc,l.assign=Pm,l.assignIn=Lc,l.assignInWith=Eo,l.assignWith=Vm,l.at=Wm,l.before=Sc,l.bind=ma,l.bindAll=qg,l.bindKey=kc,l.castArray=lm,l.chain=xc,l.chunk=b0,l.compact=_0,l.concat=x0,l.cond=Kg,l.conforms=Zg,l.constant=Oa,l.countBy=Ay,l.create=zm,l.curry=$c,l.curryRight=Ic,l.debounce=Ac,l.defaults=Gm,l.defaultsDeep=Um,l.defer=Jy,l.delay=em,l.difference=w0,l.differenceBy=O0,l.differenceWith=j0,l.drop=S0,l.dropRight=k0,l.dropRightWhile=$0,l.dropWhile=I0,l.fill=A0,l.filter=Ty,l.flatMap=Ny,l.flatMapDeep=Ry,l.flatMapDepth=Fy,l.flatten=gc,l.flattenDeep=C0,l.flattenDepth=T0,l.flip=tm,l.flow=Qg,l.flowRight=Hg,l.fromPairs=E0,l.functions=Hm,l.functionsIn=Xm,l.groupBy=Dy,l.initial=N0,l.intersection=R0,l.intersectionBy=F0,l.intersectionWith=D0,l.invert=eg,l.invertBy=tg,l.invokeMap=Py,l.iteratee=ja,l.keyBy=Vy,l.keys=Ye,l.keysIn=st,l.map=ko,l.mapKeys=ng,l.mapValues=og,l.matches=Xg,l.matchesProperty=Jg,l.memoize=Io,l.merge=ig,l.mergeWith=Pc,l.method=ev,l.methodOf=tv,l.mixin=Sa,l.negate=Ao,l.nthArg=nv,l.omit=ag,l.omitBy=ug,l.once=rm,l.orderBy=Wy,l.over=ov,l.overArgs=nm,l.overEvery=iv,l.overSome=av,l.partial=ga,l.partialRight=Cc,l.partition=zy,l.pick=sg,l.pickBy=Vc,l.property=Kc,l.propertyOf=uv,l.pull=W0,l.pullAll=bc,l.pullAllBy=z0,l.pullAllWith=G0,l.pullAt=U0,l.range=sv,l.rangeRight=cv,l.rearg=om,l.reject=By,l.remove=B0,l.rest=im,l.reverse=ha,l.sampleSize=Ky,l.set=lg,l.setWith=fg,l.shuffle=Zy,l.slice=q0,l.sortBy=Hy,l.sortedUniq=J0,l.sortedUniqBy=ey,l.split=Ng,l.spread=am,l.tail=ty,l.take=ry,l.takeRight=ny,l.takeRightWhile=oy,l.takeWhile=iy,l.tap=_y,l.throttle=um,l.thru=So,l.toArray=Rc,l.toPairs=Wc,l.toPairsIn=zc,l.toPath=hv,l.toPlainObject=Dc,l.transform=pg,l.unary=sm,l.union=ay,l.unionBy=uy,l.unionWith=sy,l.uniq=cy,l.uniqBy=ly,l.uniqWith=fy,l.unset=dg,l.unzip=ya,l.unzipWith=_c,l.update=hg,l.updateWith=yg,l.values=Br,l.valuesIn=mg,l.without=py,l.words=Bc,l.wrap=cm,l.xor=dy,l.xorBy=hy,l.xorWith=yy,l.zip=my,l.zipObject=gy,l.zipObjectDeep=vy,l.zipWith=by,l.entries=Wc,l.entriesIn=zc,l.extend=Lc,l.extendWith=Eo,Sa(l,l),l.add=mv,l.attempt=qc,l.camelCase=_g,l.capitalize=Gc,l.ceil=gv,l.clamp=gg,l.clone=fm,l.cloneDeep=dm,l.cloneDeepWith=hm,l.cloneWith=pm,l.conformsTo=ym,l.deburr=Uc,l.defaultTo=Yg,l.divide=vv,l.endsWith=xg,l.eq=Dt,l.escape=wg,l.escapeRegExp=Og,l.every=Cy,l.find=Ey,l.findIndex=yc,l.findKey=Bm,l.findLast=My,l.findLastIndex=mc,l.findLastKey=qm,l.floor=bv,l.forEach=wc,l.forEachRight=Oc,l.forIn=Km,l.forInRight=Zm,l.forOwn=Ym,l.forOwnRight=Qm,l.get=_a,l.gt=mm,l.gte=gm,l.has=Jm,l.hasIn=xa,l.head=vc,l.identity=ct,l.includes=Ly,l.indexOf=M0,l.inRange=vg,l.invoke=rg,l.isArguments=Ir,l.isArray=ee,l.isArrayBuffer=vm,l.isArrayLike=ut,l.isArrayLikeObject=We,l.isBoolean=bm,l.isBuffer=yr,l.isDate=_m,l.isElement=xm,l.isEmpty=wm,l.isEqual=Om,l.isEqualWith=jm,l.isError=va,l.isFinite=Sm,l.isFunction=Xt,l.isInteger=Tc,l.isLength=Co,l.isMap=Ec,l.isMatch=km,l.isMatchWith=$m,l.isNaN=Im,l.isNative=Am,l.isNil=Tm,l.isNull=Cm,l.isNumber=Mc,l.isObject=De,l.isObjectLike=Le,l.isPlainObject=jn,l.isRegExp=ba,l.isSafeInteger=Em,l.isSet=Nc,l.isString=To,l.isSymbol=ht,l.isTypedArray=Ur,l.isUndefined=Mm,l.isWeakMap=Nm,l.isWeakSet=Rm,l.join=L0,l.kebabCase=jg,l.last=St,l.lastIndexOf=P0,l.lowerCase=Sg,l.lowerFirst=kg,l.lt=Fm,l.lte=Dm,l.max=_v,l.maxBy=xv,l.mean=wv,l.meanBy=Ov,l.min=jv,l.minBy=Sv,l.stubArray=$a,l.stubFalse=Ia,l.stubObject=lv,l.stubString=fv,l.stubTrue=pv,l.multiply=kv,l.nth=V0,l.noConflict=rv,l.noop=ka,l.now=$o,l.pad=$g,l.padEnd=Ig,l.padStart=Ag,l.parseInt=Cg,l.random=bg,l.reduce=Gy,l.reduceRight=Uy,l.repeat=Tg,l.replace=Eg,l.result=cg,l.round=$v,l.runInContext=g,l.sample=qy,l.size=Yy,l.snakeCase=Mg,l.some=Qy,l.sortedIndex=K0,l.sortedIndexBy=Z0,l.sortedIndexOf=Y0,l.sortedLastIndex=Q0,l.sortedLastIndexBy=H0,l.sortedLastIndexOf=X0,l.startCase=Rg,l.startsWith=Fg,l.subtract=Iv,l.sum=Av,l.sumBy=Cv,l.template=Dg,l.times=dv,l.toFinite=Jt,l.toInteger=ne,l.toLength=Fc,l.toLower=Lg,l.toNumber=kt,l.toSafeInteger=Lm,l.toString=xe,l.toUpper=Pg,l.trim=Vg,l.trimEnd=Wg,l.trimStart=zg,l.truncate=Gg,l.unescape=Ug,l.uniqueId=yv,l.upperCase=Bg,l.upperFirst=wa,l.each=wc,l.eachRight=Oc,l.first=vc,Sa(l,function(){var e={};return Wt(l,function(t,n){Se.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=u,_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),_t(["drop","take"],function(e,t){de.prototype[e]=function(n){n=n===o?1:Ze(ne(n),0);var a=this.__filtered__&&!t?new de(this):this.clone();return a.__filtered__?a.__takeCount__=Je(n,a.__takeCount__):a.__views__.push({size:Je(n,D),type:e+(a.__dir__<0?"Right":"")}),a},de.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,a=n==Te||n==ke;de.prototype[e]=function(s){var f=this.clone();return f.__iteratees__.push({iteratee:q(s,3),type:n}),f.__filtered__=f.__filtered__||a,f}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");de.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");de.prototype[e]=function(){return this.__filtered__?new de(this):this[n](1)}}),de.prototype.compact=function(){return this.filter(ct)},de.prototype.find=function(e){return this.filter(e).head()},de.prototype.findLast=function(e){return this.reverse().find(e)},de.prototype.invokeMap=se(function(e,t){return typeof e=="function"?new de(this):this.map(function(n){return vn(n,e,t)})}),de.prototype.reject=function(e){return this.filter(Ao(q(e)))},de.prototype.slice=function(e,t){e=ne(e);var n=this;return n.__filtered__&&(e>0||t<0)?new de(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(t=ne(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},de.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},de.prototype.toArray=function(){return this.take(D)},Wt(de.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),s=l[a?"take"+(t=="last"?"Right":""):t],f=a||/^find/.test(t);s&&(l.prototype[t]=function(){var h=this.__wrapped__,y=a?[1]:arguments,v=h instanceof de,I=y[0],A=v||ee(h),E=function(pe){var he=s.apply(l,sr([pe],y));return a&&F?he[0]:he};A&&n&&typeof I=="function"&&I.length!=1&&(v=A=!1);var F=this.__chain__,z=!!this.__actions__.length,K=f&&!F,ae=v&&!z;if(!f&&A){h=ae?h:new de(this);var Z=e.apply(h,y);return Z.__actions__.push({func:So,args:[E],thisArg:o}),new wt(Z,F)}return K&&ae?e.apply(this,y):(Z=this.thru(E),K?a?Z.value()[0]:Z.value():Z)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Qn[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var s=arguments;if(a&&!this.__chain__){var f=this.value();return t.apply(ee(f)?f:[],s)}return this[n](function(h){return t.apply(ee(h)?h:[],s)})}}),Wt(de.prototype,function(e,t){var n=l[t];if(n){var a=n.name+"";Se.call(Pr,a)||(Pr[a]=[]),Pr[a].push({name:t,func:n})}}),Pr[vo(o,L).name]=[{name:"wrapper",func:o}],de.prototype.clone=Ud,de.prototype.reverse=Bd,de.prototype.value=qd,l.prototype.at=xy,l.prototype.chain=wy,l.prototype.commit=Oy,l.prototype.next=jy,l.prototype.plant=ky,l.prototype.reverse=$y,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Iy,l.prototype.first=l.prototype.head,fn&&(l.prototype[fn]=Sy),l},Fr=Od();_r?((_r.exports=Fr)._=Fr,ji._=Fr):Qe._=Fr}).call(Sn)}(oi,oi.exports);var Wx=oi.exports;const Tf=ol(Wx);function du({value:r,children:i}){return r?typeof i=="function"?w.jsx(w.Fragment,{children:i(r)}):w.jsx(w.Fragment,{children:i}):null}const Ef={},Vn={};function Wn(r,i){try{const o=(Ef[r]||(Ef[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(i).split("GMT")[1]||"";return o in Vn?Vn[o]:Mf(o,o.split(":"))}catch{if(r in Vn)return Vn[r];const o=r?.match(zx);return o?Mf(r,o.slice(1)):NaN}}const zx=/([+-]\d\d):?(\d\d)?/;function Mf(r,i){const o=+i[0],u=+(i[1]||0);return Vn[r]=o>0?o*60+u:o*60-u}class ar extends Date{constructor(...i){super(),i.length>1&&typeof i[i.length-1]=="string"&&(this.timeZone=i.pop()),this.internal=new Date,isNaN(Wn(this.timeZone,this))?this.setTime(NaN):i.length?typeof i[0]=="number"&&(i.length===1||i.length===2&&typeof i[1]!="number")?this.setTime(i[0]):typeof i[0]=="string"?this.setTime(+new Date(i[0])):i[0]instanceof Date?this.setTime(+i[0]):(this.setTime(+new Date(...i)),Rf(this),hu(this)):this.setTime(Date.now())}static tz(i,...o){return o.length?new ar(...o,i):new ar(Date.now(),i)}withTimeZone(i){return new ar(+this,i)}getTimezoneOffset(){return-Wn(this.timeZone,this)}setTime(i){return Date.prototype.setTime.apply(this,arguments),hu(this),+this}[Symbol.for("constructDateFrom")](i){return new ar(+new Date(i),this.timeZone)}}const Nf=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!Nf.test(r))return;const i=r.replace(Nf,"$1UTC");ar.prototype[i]&&(r.startsWith("get")?ar.prototype[r]=function(){return this.internal[i]()}:(ar.prototype[r]=function(){return Date.prototype[i].apply(this.internal,arguments),Gx(this),+this},ar.prototype[i]=function(){return Date.prototype[i].apply(this,arguments),hu(this),+this}))});function hu(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function Gx(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),Rf(r)}function Rf(r){const i=Wn(r.timeZone,r),o=new Date(+r);o.setUTCHours(o.getUTCHours()-1);const u=-new Date(+r).getTimezoneOffset(),c=-new Date(+o).getTimezoneOffset(),p=u-c,d=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();p&&d&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+p);const m=u-i;m&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m);const _=Wn(r.timeZone,r),b=-new Date(+r).getTimezoneOffset()-_,$=_!==i,M=b-m;if($&&M){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+M);const j=Wn(r.timeZone,r),N=_-j;N&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N))}}const Ux=r=>{let i=new Date(Number(r));if(!r){const p=new Date;i=new Date(p.getFullYear(),p.getMonth(),p.getDate())}const o=String(i.getDate()).padStart(2,"0"),u=String(i.getMonth()+1).padStart(2,"0"),c=i.getFullYear();return[u,o,c].join("/")},Bx=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",...i});function Ff(){return{enqueueSnackbar:(r,i="success",o)=>{o1(r,{severity:i,variant:"customAlertComponent",persist:!0,...o})},closeSnackbar:ul}}const qx=Bv(({id:r,message:i,severity:o,alertAction:u,sx:c,showCloseIcon:p=!0,persist:d,hideIconVariant:m,autoHideDuration:_,anchorOrigin:b,iconVariant:$,...M},j)=>w.jsx(n1,{ref:j,...M,children:w.jsx(Tv,{severity:o,action:w.jsxs(Ar,{ml:1,children:[w.jsx(du,{value:u,children:w.jsx(Yc,{size:"small",onClick:()=>{var N;return r&&((N=u?.onAction)==null?void 0:N.call(u,r))},color:"inherit",children:u?.icon})}),w.jsx(du,{value:!u&&p,children:w.jsx(Yc,{size:"small",onClick:()=>{ul(r)},color:"inherit",children:w.jsx(r1,{})})})]}),sx:{alignItems:"center",width:"320px",...c},children:i})})),Kx=r=>{let i=new Date(Number(r));if(!r){const p=new Date;i=new Date(p.getFullYear(),p.getMonth(),p.getDate())}const o=String(i.getDate()).padStart(2,"0"),u=String(i.getMonth()+1).padStart(2,"0"),c=i.getFullYear();return[u,o,c].join("/")},Zx=r=>{const i=new Date(r);return i.setUTCHours(12),String(+i)},yu=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{month:"short",day:"numeric",hour12:!1,...i}),mu=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",...i}),Df=r=>{var i;const o=((i=r.replace(/-/g,"").match(/.{1,2}/g))==null?void 0:i.map(m=>parseInt(m,16)))??[],u=o.reduce((m,_)=>(m+_)%256,0),c=o.slice(1).reduce((m,_)=>(m+_)%256,0),p=o.slice(2).reduce((m,_)=>(m+_)%256,0),d=m=>m.toString(16).padStart(2,"0");return console.log(`#${d(u)}${d(c)}${d(p)}`),`#${d(u)}${d(c)}${d(p)}`},Lf=Vx({createStyledComponent:kf("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(r,i)=>i.root}),componentName:"MuiGrid2",useThemeProps:r=>If({props:r,name:"MuiGrid2"})});function Yx({entry:r,payload:i,showUuid:o=!0}){const u=Na(j=>{var N,T,C;return(C=(T=(N=j.payload)==null?void 0:N.data)==null?void 0:T.reduce)==null?void 0:C.call(T,(O,L)=>O+L.value,0)},[]),c=Na(j=>{const N=new Fa(u(j)||0),T=i?.reduce((L,G)=>L+u(G),0)||0,C=new Fa(T),O=Number(N.div(C).times(100).toFixed(2,Fa.ROUND_DOWN));return isNaN(O)||!isFinite(O)?0:O},[u,i]),p=Ra(()=>u(r),[r,u]),d=Da(p),m=Ra(()=>Number(c(r)),[r,c]),_=Da(m),b=Na(j=>Math.floor(j).toLocaleString(),[]),$=Yv({type:"text/plain"}),M=Ff();return w.jsxs(Qv,{component:"li",direction:"row",spacing:1,sx:{color:r.color},layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[w.jsx(Ar,{sx:{width:"3px",height:"100%",backgroundColor:r.color,borderRadius:3}}),w.jsxs(Cr,{children:[w.jsxs(tr,{component:"p",variant:"caption",children:[w.jsx(Cr,{component:"span",display:"inline-flex",mr:.5,children:w.jsx(nl,{from:d??0,to:p,map:b,children:"0"})}),w.jsxs(Cr,{component:"span",direction:"row",display:"inline-flex",children:["(",w.jsx(nl,{from:_??0,to:m,map:b,children:"0"}),"%)"]})]}),w.jsx(tr,{variant:"body1",children:r.value}),r.payload.integrationType&&w.jsx(tr,{variant:"body2",children:r.payload.integrationType}),o&&r.payload.uuid&&w.jsxs(tr,{variant:"body2",sx:{cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:()=>{$.copy(r.payload.uuid).catch(()=>{}),M.enqueueSnackbar("UUID copied to clipboard","success")},children:[r.payload.uuid.slice(0,5),"..."]})]})]})}function Pf(r){const{payload:i}=r;return w.jsx(Lf,{container:!0,direction:"row",component:"ul",gap:2,sx:{mt:2,justifyContent:"flex-start",alignItem:"center",flexWrap:"wrap"},children:w.jsx(Zv,{children:i?.map(o=>w.jsx(Lf,{children:w.jsx(Yx,{entry:o,payload:i,showUuid:r.showUuid})},`item-${o.value}`))})})}function Vf(r){const i=rr();return w.jsx(Ar,{sx:{width:"100%",height:"100%",...r.sx},children:w.jsx(Mo,{children:w.jsxs(Fv,{width:500,height:300,margin:{top:5,right:60,left:20,bottom:5},children:[w.jsx(Aa,{vertical:!1}),w.jsx(Ca,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>yu(o,{timeZone:r.filter.timezone,hour12:!1,hour:"numeric"}),allowDuplicatedCategory:!1,tickLine:!1,fontSize:12,tickMargin:12}),w.jsx(Ta,{textAnchor:"end",dataKey:"value",tickLine:!1,tickFormatter:o=>Number(o).toLocaleString(),allowDecimals:!1,domain:[1,"dataMax"],children:r.label&&w.jsx(Ea,{value:r.label,angle:-90,position:"insideLeft",style:{textAnchor:"middle"}})}),w.jsx(Ma,{cursor:{stroke:i.palette.neutral.main,strokeWidth:1},formatter:o=>Number(o).toLocaleString(),labelFormatter:o=>mu(o,{timeZone:r.filter.timezone,hour12:!1})}),w.jsx(Xc,{content:w.jsx(Pf,{showUuid:r.showUuid})}),r.data.map(o=>qv(Dv,{uuid:o.uuid,integrationType:o.integrationType,key:o.uuid,name:o.name,dataKey:"value",data:o.chartData,type:"monotone",stroke:o.color,strokeWidth:2}))]})})})}const Qx=(r,i)=>{const o=new Map;return r.forEach(u=>{u.chartData.forEach(c=>{const p=new Date(c.date).getTime().toString();if(!o.has(p)){const d={date:p,total:0,diff:0,totalKey:"",originalTotal:0};i.forEach(({key:m})=>{d[m]=0,d[`${m}_absolute`]=0}),o.set(p,d)}i.forEach(({key:d})=>{const m=o.get(p),_=c[d],b=typeof _=="string"?_.trim()===""?0:parseInt(_,10):typeof _=="number"?_:0;m[`${d}_absolute`]=b,m[d]=0})})}),Array.from(o.values()).map(u=>{var c;const p=(c=i.find(_=>_.isTotal))==null?void 0:c.key,d=i.filter(_=>!_.isTotal).map(_=>_.key);if(!p||d.length===0)return u;const m=u[`${p}_absolute`];return u.originalTotal=m,u.total=m,u[p]=100,d.forEach(_=>{const b=u[`${_}_absolute`];let $;m===0?($="100.00",u[_]=100):($=m>0?new Ro(b.toString()).div(m).mul(100).toFixed(2,Ro.ROUND_DOWN):"0.00",u[_]=parseFloat($))}),{...u,totalKey:p}}).sort((u,c)=>parseInt(u.date)-parseInt(c.date))};function Wf(r){const i=rr(),o=Ra(()=>r.data?Qx(r.data,r.keyValues):[],[r.data,r.keyValues]);return console.log("test",o),w.jsx(Ar,{sx:{width:"100%",height:"100%",...r.sx},children:w.jsx(Mo,{width:"100%",height:"100%",children:w.jsxs(Lv,{data:o,width:500,height:300,margin:{top:5,right:60,left:20,bottom:5},children:[w.jsx(Aa,{strokeDasharray:"3 3"}),w.jsx(Ca,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:u=>yu(u,{timeZone:r.filter.timezone,hour12:!1,hour:"numeric"}),allowDuplicatedCategory:!1,tickLine:!1,fontSize:12,tickMargin:12}),w.jsx(Ta,{textAnchor:"end",tickLine:!1,tickFormatter:u=>`${u.toFixed(2)}%`}),w.jsx(Ma,{cursor:{stroke:i.palette.neutral.main,strokeWidth:1},labelFormatter:u=>mu(u,{timeZone:r.filter.timezone,hour12:!1}),formatter:(u,c,p)=>{const d=p.payload.totalKey,m=p.dataKey,_=m===d,b=p.payload[`${m}_absolute`],$=p.payload.originalTotal,M=_?null:$===0?"100.00":new Ro(b.toString()).div($).mul(100).toFixed(2,Ro.ROUND_DOWN);return[M?`${b.toLocaleString()} (${M}%)`:`${b.toLocaleString()} (TOTAL)`,c]}}),r.keyValues.sort((u,c)=>u.isTotal?-1:c.isTotal?1:0).map(u=>w.jsx(Pv,{type:"monotone",dataKey:u.key,name:u.name,stroke:u.color,fill:u.color,strokeWidth:2,fillOpacity:.6},u.key))]})})})}function zn(r){const i=Da(r.value),{ref:o}=i1({from:i??0,to:r.value,duration:1,map:r.map});return w.jsx(Qc,{sx:{p:3,flex:1,...r.sx},children:w.jsxs(Cr,{spacing:1,alignItems:"center",children:[w.jsx(tr,{ref:o,variant:"h4",fontWeight:"bold",children:r.initialValue}),w.jsx(tr,{color:"text.secondary",children:r.label})]})})}const zf={margin:{top:5,right:30,left:20,bottom:5}},Hx={tickLine:!1,fontSize:12,tickMargin:12},Xx={textAnchor:"end",tickLine:!1};function ii({data:r,series:i,xAxis:o,yAxis:u,tooltip:c,bar:p,referenceLines:d,referenceAreas:m,sx:_}){const b=rr(),$=j=>!j.isFront,M=j=>!!j.isFront;return w.jsx(Ar,{sx:{width:"100%",height:"100%",..._},children:w.jsx(Mo,{children:w.jsxs(Vv,{data:r,...zf,children:[w.jsx(Aa,{strokeDasharray:"3 3",vertical:!1}),w.jsx(Ca,{...Hx,...o}),w.jsx(Ta,{...Xx,...u}),w.jsx(Ma,{cursor:{stroke:b.palette.neutral.main,strokeWidth:1},...c}),d?.filter($).map((j,N)=>w.jsx(Jc,{...j},j.label??N)),m?.filter($).map((j,N)=>w.jsx(el,{...j},j.label??N)),i.map(j=>w.jsx(Wv,{name:j.key,dataKey:j.dataKey,fill:j.color,stackId:"stack",isAnimationActive:!1,...p},j.key)),d?.filter(M).map((j,N)=>w.jsx(Jc,{...j},j.label??N)),m?.filter(M).map((j,N)=>w.jsx(el,{...j},j.label??N))]})})})}function Jx({data:r,threshold:i=100,sx:o}){const u=rr(),c=Object.entries(r??{}).map(([d,m])=>({key:d,[d]:m})),p=c.map(({key:d})=>({key:d,dataKey:d,color:u.palette.error.light}));return w.jsx(ii,{sx:o,data:c,series:p,xAxis:{tickLine:!1,dataKey:"key"},yAxis:{tickLine:!1,domain:[0,`dataMax + ${i}`]},tooltip:{labelFormatter:d=>"Total"},referenceLines:[{y:i,stroke:u.palette.error.dark,strokeDasharray:"3 3",label:w.jsx(Ea,{value:"Unhealthy threshold",position:"insideBottomRight"}),isFront:!0}]})}function ew({data:r,threshold:i=100,sx:o}){const u=rr(),c=Object.entries(r??{}).map(([d,m])=>({key:d,[d]:m})),p=c.map(({key:d})=>({key:d,dataKey:d,color:u.palette.warning.light}));return w.jsx(ii,{sx:o,data:c,series:p,xAxis:{tickLine:!1,dataKey:"key"},yAxis:{tickLine:!1,domain:[0,`dataMax + ${i}`]},tooltip:{labelFormatter:d=>"Total"},referenceLines:[{y:i,stroke:u.palette.error.dark,strokeDasharray:"3 3",label:w.jsx(Ea,{value:"Unhealthy threshold",position:"insideBottomRight"}),isFront:!0}]})}function Gf({payload:r=[],hiddenItems:i,onToggle:o,legendLabel:u}){return w.jsx(Ar,{sx:{display:"flex",justifyContent:"center",gap:"20px",paddingTop:"20px"},children:r.map((c,p)=>{const d=i.has(c.payload.name);return w.jsxs("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",opacity:d?.4:1},onClick:()=>{o?.(c.payload)},children:[w.jsx("div",{style:{width:"12px",height:"12px",backgroundColor:c.color,marginRight:"8px",borderRadius:"2px"}}),w.jsx("span",{style:{color:c.color},children:u?`${u}: ${c.value}`:c.value})]},`legend-${p}`)})})}const tw=r=>{const i=Math.PI/180,{cx:o,cy:u,midAngle:c,innerRadius:p,outerRadius:d,startAngle:m,endAngle:_,fill:b,payload:$,percent:M,value:j,valueText:N,valuePercentage:T,needleVisible:C,customText:O,allActive:L}=r,G=Math.sin(-i*c),W=Math.cos(-i*c),fe=o+(d+5)*W,S=u+(d+5)*G,B=o+(d+15)*W,U=u+(d+15)*G,me=B+(W>=0?1:-1)*22,Me=U,Fe=W>=0?"start":"end",V=j.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),Y=()=>C||L?null:w.jsx("text",{x:o,y:u,dy:8,textAnchor:"middle",fill:"#333",fontSize:14,children:$.name});return w.jsxs("g",{children:[Y(),w.jsx(tl,{cx:o,cy:u,innerRadius:p,outerRadius:d,startAngle:m,endAngle:_,fill:b}),w.jsx(tl,{cx:o,cy:u,startAngle:m,endAngle:_,innerRadius:d+2,outerRadius:d+6,fill:b}),w.jsx("path",{d:`M${fe},${S}L${B},${U}L${me},${Me}`,stroke:b,fill:"none"}),w.jsx("circle",{cx:me,cy:Me,r:2,fill:b,stroke:"none"}),w.jsx("text",{x:me+(W>=0?1:-1)*12,y:Me,textAnchor:Fe,fill:"#333",fontSize:12,children:O||(N?`${N} ${V}`:V)}),T&&w.jsxs("text",{x:me+(W>=0?1:-1)*12,y:Me,dy:16,textAnchor:Fe,fill:"#999",fontSize:11,children:[`${(M*100).toFixed(2)}%`," (",V,")"]})]})},rw=r=>{const{value:i,data:o,color:u,innerRadius:c,outerRadius:p,boxDimensions:d,legendDimensions:m,valueText:_}=r,b=Math.PI/180;let $=0;o.forEach(Y=>{$+=Y.value});const M=d?d.width/2:150,j=(d?d.height/2:200)-m.height/2,N=180*(1-Math.max(0,Math.min(1,i/$))),T=(Number(c)+2*Number(p))/3,C=Math.sin(-b*N),O=Math.cos(-b*N),L=5,G=M-L,W=j,fe=G+L*C,S=W-L*O,B=G-L*C,U=W+L*O,me=G+T*O,Me=W+T*C,Fe=i.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),V=_??Fe;return w.jsxs(w.Fragment,{children:[w.jsx("circle",{cx:G,cy:W,r:L,fill:u,stroke:"none",style:{pointerEvents:"none"}},"needle-circle"),w.jsx("path",{d:`M${fe} ${S}L${B} ${U} L${me} ${Me} L${fe} ${S}`,stroke:"none",fill:u,style:{pointerEvents:"none"}},"needle-path"),w.jsx("text",{x:G+L,y:W+26,textAnchor:"middle",fill:"#333",fontSize:12,children:V},"needle-value")]})},nw=(r,i)=>({Allow:i.palette.success.main,Flag:i.palette.warning.main,Block:i.palette.error.main})[r]??i.palette.primary.main;function Uf({data:r,sx:i,legendLabel:o,legendToggle:u=!1,valueText:c="",valuePercentage:p=!0,pie:d,needleVisible:m=!1,needleValue:_,needleColor:b="#aaa",allActive:$=!1}){const{innerRadius:M=60,outerRadius:j=100}=d??{},N=rr(),[T,C]=No(void 0),[O,L]=No(new Set),G=Kv(null),[W,fe]=No(null),[S,B]=No(null),U=(V,Y)=>{$||C(Y)},me=()=>{$||C(void 0)},Me=V=>{u&&V&&L(Y=>{const ge=new Set(Y);return ge.has(V.name)?ge.delete(V.name):ge.size<r.length-1&&ge.add(V.name),ge})},Fe=r.map((V,Y)=>({...V,index:Y,value:O.has(V.name)?0:V.value}));return rl(()=>{const V=G.current;if(!V)return;const Y=new ResizeObserver(Te=>{var qe;const ke=(qe=Te[0])==null?void 0:qe.contentRect;ke&&fe(ke)});Y.observe(V);const ge=V.getBoundingClientRect();return fe(ge),()=>{Y.disconnect()}},[]),rl(()=>{var V;const Y=(V=G.current)==null?void 0:V.querySelector(".recharts-legend-wrapper");if(!Y){const qe=setInterval(()=>{var ke;const Ae=(ke=G.current)==null?void 0:ke.querySelector(".recharts-legend-wrapper");if(Ae){const it=Ae.getBoundingClientRect();B(it),clearInterval(qe)}},100);return()=>{clearInterval(qe)}}const ge=new ResizeObserver(qe=>{var ke;const Ae=(ke=qe[0])==null?void 0:ke.contentRect;Ae&&B(Ae)});ge.observe(Y);const Te=Y.getBoundingClientRect();return B(Te),()=>{ge.disconnect()}},[]),w.jsx(Ar,{ref:G,sx:{width:"100%",height:"100%","& g":{outline:"none"},...i},children:w.jsx(Mo,{children:w.jsxs(zv,{...zf,children:[w.jsx(Gv,{data:Fe,nameKey:"name",dataKey:"value",innerRadius:M,outerRadius:j,activeIndex:$?Fe.filter(V=>V.value>0).map(V=>V.index):T,activeShape:V=>tw({...V,valueText:c,valuePercentage:p,needleVisible:m,allActive:$}),paddingAngle:0,onMouseEnter:U,onMouseLeave:me,...d,children:Fe.map(V=>w.jsx(Uv,{fill:V.color??nw(V.name,N),opacity:O.has(V.name)?.5:1,stroke:"none"},V.name))}),w.jsx(Xc,{content:w.jsx(Gf,{legendLabel:o,hiddenItems:O,onToggle:Me})}),m&&_!==void 0&&W&&S&&rw({data:Fe,value:_,color:b,innerRadius:M,outerRadius:j,boxDimensions:W,legendDimensions:S,valueText:c})]})})})}function ow({sx:r,data:i,score:o=200,legendLabel:u}){const c=rr(),p=[{name:"Allow",customText:"0-299",value:i[0].value,color:c.palette.primary.main},{name:"Flag",customText:"300-599",value:i[1].value,color:c.palette.warning.main},{name:"Block",customText:"Over 600",value:i[2].value,color:c.palette.error.main}];return w.jsx(Uf,{data:p,legendToggle:!0,needleValue:o,legendLabel:u,allActive:!0,sx:r})}function iw({data:r,sx:i}){const o=rr(),u=(p=>{const d={};return p.forEach(m=>{Object.entries(m).forEach(([_,b])=>{const $=parseInt(_);$<=1e3&&(d[$]=(d[$]||0)+b)})}),Array.from({length:1001},(m,_)=>({key:_.toString(),value:d[_]||0}))})(r),c=[{key:"Risk Score",dataKey:"value",color:o.palette.error.main}];return w.jsx(ii,{data:u,series:c,sx:i,yAxis:{label:{value:"Count",angle:-90,position:"insideLeft"},domain:[0,"dataMax + 10"]},xAxis:{domain:[0,"dataMax"],interval:"preserveStartEnd"},tooltip:{labelFormatter:()=>"Risk Score",formatter:(p,d,m)=>[p,m.payload.key]},referenceAreas:[{x1:0,x2:299,fill:"#ffffff00",isFront:!1,label:"Allow"},{x1:300,x2:600,fill:o.palette.warning.light,isFront:!1,label:"Flag"},{x1:600,fill:o.palette.error.light,isFront:!1,label:"Block"}]})}const gu=()=>({regularChartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:500},smallChartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:300}});function Bf(r){return w.jsx(tr,{variant:"h6",fontWeight:"900",...r})}function qf(r){return w.jsx(tr,{variant:"h6",fontWeight:"400",...r})}function ai(){const r=gu();return w.jsxs(Cr,{sx:r.smallChartWrapper,children:[w.jsx(Bf,{children:"No data available for the selected period and brands"}),w.jsx(qf,{children:"Please select a different period or brand"})]})}function ui(){const r=gu();return w.jsxs(Cr,{sx:r.smallChartWrapper,children:[w.jsx(Bf,{children:"Loading..."}),w.jsx(qf,{children:"Preparing your chart data"})]})}function aw({data:r,isLoading:i,isFetching:o,isSuccess:u,filter:c,sx:p}){var d,m;const _=rr(),b=gu(),$={oneClickCreated:{key:"oneClickCreated",name:"Started",color:_.palette.neutral.main,isTotal:!0},oneClickSuccess:{key:"oneClickSuccess",name:"Finished",color:_.palette.primary.main}};return i?w.jsx(ui,{}):!r.length||!((m=(d=r[0])==null?void 0:d.chartData)!=null&&m.length)||!u?w.jsx(ai,{}):w.jsx(Wf,{data:r,keyValues:Object.values($),filter:c,sx:{...b.smallChartWrapper,opacity:o?.4:1,...p}})}const uw={chartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:500}};function sw({data:r,isLoading:i,isFetching:o,isSuccess:u,filter:c}){return i?w.jsx(ui,{}):!r.length||!u?w.jsx(ai,{}):w.jsx(Vf,{label:"Uniques",data:r,filter:c,sx:{...uw.chartWrapper,opacity:o?.4:1}})}function cw(r){const{brands:i,data:o,keyValue:u}=r,c=i.flatMap(({_raw:p})=>{var d;const m=o?.find(b=>b.brandUuid===p.brandUuid),_=(m?.interval??[]).map(b=>({date:+new Date(b.date),value:Number(b[u]||0)})).filter(b=>r.filterOutZeroValues?b.value>0:!0);return{uuid:p.brandUuid,name:p.brandName,integrationType:al(p.integrationType),color:((d=p.additionalData)==null?void 0:d.primaryColor)??Df(p.brandUuid),chartData:_}});return Tf.chain(c).sortBy(p=>p.name).toArray().value()}const lw=({data:r,brands:i})=>r.flatMap(o=>{const u=i.find(c=>c.brandUuid===o.brandUuid);return!u||!o.interval?[]:o.interval.map(c=>({month:new Date(c.date).toISOString(),brand:u.brandName,integrationType:al(u.integrationType),total:c.oneClickCreated,finished:c.oneClickSuccess,totalCost:c.totalCost}))}),fw=({data:r,isLoading:i,showTotalCost:o=!0})=>i?w.jsx(ui,{}):r!=null&&r.length?w.jsx(Ev,{component:Qc,children:w.jsxs(Mv,{children:[w.jsx(Nv,{children:w.jsxs(Hc,{children:[w.jsx($t,{children:"Month"}),w.jsx($t,{children:"Brand"}),w.jsx($t,{children:"Integration Type"}),w.jsx($t,{align:"right",children:"Started"}),w.jsx($t,{align:"right",children:"Finished"}),o&&w.jsx($t,{align:"right",children:"Total Cost"})]})}),w.jsx(Rv,{children:r.map(u=>w.jsxs(Hc,{children:[w.jsx($t,{children:new Date(u.month).toLocaleDateString(void 0,{month:"short",year:"numeric",timeZone:"UTC"})}),w.jsx($t,{children:u.brand}),w.jsx($t,{children:u.integrationType}),w.jsx($t,{align:"right",children:u.total}),w.jsx($t,{align:"right",children:u.finished}),o&&w.jsx($t,{align:"right",children:u.totalCost??"-"})]},`${u.brand}-${u.month}`))})]})}):w.jsx(ai,{});function pw({lastUpdated:r}){return w.jsxs(tr,{variant:"caption",color:"text.secondary",fontWeight:"600",children:["The data was last updated on"," ",Bx(r??Date.now(),{hour12:!1}),"."]})}const Kf=r=>new Intl.NumberFormat("en-US").format(Number(r.toFixed(0))),dw=r=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(r),hw=r=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(r),Zf={totalSignups:0,totalSuccess:0,totalCost:0,successRate:0};function yw(r){if(!(r!=null&&r.length))return Zf;const i=r.reduce((p,d)=>p+(d.overall.oneClickCreated||0),0),o=r.reduce((p,d)=>p+(d.overall.oneClickSuccess||0),0),u=r.reduce((p,d)=>{const m=d.overall.totalCost?Number(d.overall.totalCost.replace("$","").replace(/,/g,"")):0;return p+m},0),c=o/i;return{totalSignups:i,totalSuccess:o,totalCost:u,successRate:isNaN(c)?0:c}}function mw({chartData:r,isLoading:i=!0,hideTotalCost:o=!1}){const u=i?Zf:yw(r);return w.jsxs(Cr,{direction:"row",spacing:3,children:[w.jsx(zn,{label:"Total 1-Click Signups",value:u.totalSignups,initialValue:u.totalSignups,map:Kf}),w.jsx(zn,{label:"Finished 1-Click Signups",value:u.totalSuccess,initialValue:u.totalSuccess,map:Kf}),!o&&w.jsx(zn,{label:"Total Cost",value:u.totalCost,initialValue:u.totalCost,map:dw}),w.jsx(zn,{label:"Success Rate",value:u.successRate,initialValue:u.successRate,map:hw})]})}export{Ux as $,Sf as A,zn as B,qx as C,Bo as D,Jx as E,_1 as F,Hl as G,Ga as H,ou as I,Tf as J,uu as K,ui as L,fw as M,$l as N,aw as O,Uf as P,Il as Q,ew as R,Vf as S,su as T,qr as U,Pt as V,du as W,Af as X,Ja as Y,jf as Z,It as _,Pf as a,Wf as b,ii as c,ow as d,iw as e,Gf as f,sw as g,lw as h,ai as i,pw as j,mw as k,Kx as l,cw as m,Zx as n,yu as o,mu as p,Df as q,h1 as r,te as s,cu as t,Ff as u,vf as v,wl as w,kf as x,If as y,Ol as z};
|
21
|
+
}`;var ae=qc(function(){return ve(f,z+"return "+E).apply(o,h)});if(ae.source=E,va(ae))throw ae;return ae}function Lg(e){return xe(e).toLowerCase()}function Pg(e){return xe(e).toUpperCase()}function Vg(e,t,n){if(e=xe(e),e&&(n||t===o))return ts(e);if(!e||!(t=dt(t)))return e;var a=Rt(e),s=Rt(t),f=rs(a,s),h=ns(a,s)+1;return hr(a,f,h).join("")}function Wg(e,t,n){if(e=xe(e),e&&(n||t===o))return e.slice(0,is(e)+1);if(!e||!(t=dt(t)))return e;var a=Rt(e),s=ns(a,Rt(t))+1;return hr(a,0,s).join("")}function zg(e,t,n){if(e=xe(e),e&&(n||t===o))return e.replace(vi,"");if(!e||!(t=dt(t)))return e;var a=Rt(e),s=rs(a,Rt(t));return hr(a,s).join("")}function Gg(e,t){var n=Fe,a=V;if(De(t)){var s="separator"in t?t.separator:s;n="length"in t?ne(t.length):n,a="omission"in t?dt(t.omission):a}e=xe(e);var f=e.length;if(Nr(e)){var h=Rt(e);f=h.length}if(n>=f)return e;var y=n-Rr(a);if(y<1)return a;var v=h?hr(h,0,y).join(""):e.slice(0,y);if(s===o)return v+a;if(h&&(y+=v.length-y),ba(s)){if(e.slice(y).search(s)){var I,A=v;for(s.global||(s=Ri(s.source,xe(Ou.exec(s))+"g")),s.lastIndex=0;I=s.exec(A);)var E=I.index;v=v.slice(0,E===o?y:E)}}else if(e.indexOf(dt(s),y)!=y){var F=v.lastIndexOf(s);F>-1&&(v=v.slice(0,F))}return v+a}function Ug(e){return e=xe(e),e&&tp.test(e)?e.replace(_u,bd):e}var Bg=zr(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),wa=Ks("toUpperCase");function Bc(e,t,n){return e=xe(e),t=n?o:t,t===o?hd(e)?wd(e):id(e):e.match(t)||[]}var qc=se(function(e,t){try{return ft(e,o,t)}catch(n){return va(n)?n:new J(n)}}),qg=Qt(function(e,t){return _t(t,function(n){n=Gt(n),Zt(e,n,ma(e[n],e))}),e});function Kg(e){var t=e==null?0:e.length,n=q();return e=t?Ne(e,function(a){if(typeof a[1]!="function")throw new xt(d);return[n(a[0]),a[1]]}):[],se(function(a){for(var s=-1;++s<t;){var f=e[s];if(ft(f[0],this,a))return ft(f[1],this,a)}})}function Zg(e){return bh(Ot(e,M))}function Oa(e){return function(){return e}}function Yg(e,t){return e==null||e!==e?t:e}var Qg=Ys(),Hg=Ys(!0);function ct(e){return e}function ja(e){return Ss(typeof e=="function"?e:Ot(e,M))}function Xg(e){return $s(Ot(e,M))}function Jg(e,t){return Is(e,Ot(t,M))}var ev=se(function(e,t){return function(n){return vn(n,e,t)}}),tv=se(function(e,t){return function(n){return vn(e,n,t)}});function Sa(e,t,n){var a=Ye(t),s=po(t,a);n==null&&!(De(t)&&(s.length||!a.length))&&(n=t,t=e,e=this,s=po(t,Ye(t)));var f=!(De(n)&&"chain"in n)||!!n.chain,h=Xt(e);return _t(s,function(y){var v=t[y];e[y]=v,h&&(e.prototype[y]=function(){var I=this.__chain__;if(f||I){var A=e(this.__wrapped__),E=A.__actions__=at(this.__actions__);return E.push({func:v,args:arguments,thisArg:e}),A.__chain__=I,A}return v.apply(e,sr([this.value()],arguments))})}),e}function rv(){return Qe._===this&&(Qe._=Id),this}function ka(){}function nv(e){return e=ne(e),se(function(t){return As(t,e)})}var ov=na(Ne),iv=na(Qu),av=na(Ii);function Kc(e){return la(e)?Ai(Gt(e)):Fh(e)}function uv(e){return function(t){return e==null?o:Sr(e,t)}}var sv=Hs(),cv=Hs(!0);function $a(){return[]}function Ia(){return!1}function lv(){return{}}function fv(){return""}function pv(){return!0}function dv(e,t){if(e=ne(e),e<1||e>it)return[];var n=D,a=Je(e,D);t=q(t),e-=D;for(var s=Ei(a,t);++n<e;)t(n);return s}function hv(e){return ee(e)?Ne(e,Gt):ht(e)?[e]:at(dc(xe(e)))}function yv(e){var t=++kd;return xe(e)+t}var mv=bo(function(e,t){return e+t},0),gv=oa("ceil"),vv=bo(function(e,t){return e/t},1),bv=oa("floor");function _v(e){return e&&e.length?fo(e,ct,Gi):o}function xv(e,t){return e&&e.length?fo(e,q(t,2),Gi):o}function wv(e){return Ju(e,ct)}function Ov(e,t){return Ju(e,q(t,2))}function jv(e){return e&&e.length?fo(e,ct,Ki):o}function Sv(e,t){return e&&e.length?fo(e,q(t,2),Ki):o}var kv=bo(function(e,t){return e*t},1),$v=oa("round"),Iv=bo(function(e,t){return e-t},0);function Av(e){return e&&e.length?Ti(e,ct):0}function Cv(e,t){return e&&e.length?Ti(e,q(t,2)):0}return l.after=Xy,l.ary=jc,l.assign=Pm,l.assignIn=Lc,l.assignInWith=Eo,l.assignWith=Vm,l.at=Wm,l.before=Sc,l.bind=ma,l.bindAll=qg,l.bindKey=kc,l.castArray=lm,l.chain=xc,l.chunk=b0,l.compact=_0,l.concat=x0,l.cond=Kg,l.conforms=Zg,l.constant=Oa,l.countBy=Ay,l.create=zm,l.curry=$c,l.curryRight=Ic,l.debounce=Ac,l.defaults=Gm,l.defaultsDeep=Um,l.defer=Jy,l.delay=em,l.difference=w0,l.differenceBy=O0,l.differenceWith=j0,l.drop=S0,l.dropRight=k0,l.dropRightWhile=$0,l.dropWhile=I0,l.fill=A0,l.filter=Ty,l.flatMap=Ny,l.flatMapDeep=Ry,l.flatMapDepth=Fy,l.flatten=gc,l.flattenDeep=C0,l.flattenDepth=T0,l.flip=tm,l.flow=Qg,l.flowRight=Hg,l.fromPairs=E0,l.functions=Hm,l.functionsIn=Xm,l.groupBy=Dy,l.initial=N0,l.intersection=R0,l.intersectionBy=F0,l.intersectionWith=D0,l.invert=eg,l.invertBy=tg,l.invokeMap=Py,l.iteratee=ja,l.keyBy=Vy,l.keys=Ye,l.keysIn=st,l.map=ko,l.mapKeys=ng,l.mapValues=og,l.matches=Xg,l.matchesProperty=Jg,l.memoize=Io,l.merge=ig,l.mergeWith=Pc,l.method=ev,l.methodOf=tv,l.mixin=Sa,l.negate=Ao,l.nthArg=nv,l.omit=ag,l.omitBy=ug,l.once=rm,l.orderBy=Wy,l.over=ov,l.overArgs=nm,l.overEvery=iv,l.overSome=av,l.partial=ga,l.partialRight=Cc,l.partition=zy,l.pick=sg,l.pickBy=Vc,l.property=Kc,l.propertyOf=uv,l.pull=W0,l.pullAll=bc,l.pullAllBy=z0,l.pullAllWith=G0,l.pullAt=U0,l.range=sv,l.rangeRight=cv,l.rearg=om,l.reject=By,l.remove=B0,l.rest=im,l.reverse=ha,l.sampleSize=Ky,l.set=lg,l.setWith=fg,l.shuffle=Zy,l.slice=q0,l.sortBy=Hy,l.sortedUniq=J0,l.sortedUniqBy=ey,l.split=Ng,l.spread=am,l.tail=ty,l.take=ry,l.takeRight=ny,l.takeRightWhile=oy,l.takeWhile=iy,l.tap=_y,l.throttle=um,l.thru=So,l.toArray=Rc,l.toPairs=Wc,l.toPairsIn=zc,l.toPath=hv,l.toPlainObject=Dc,l.transform=pg,l.unary=sm,l.union=ay,l.unionBy=uy,l.unionWith=sy,l.uniq=cy,l.uniqBy=ly,l.uniqWith=fy,l.unset=dg,l.unzip=ya,l.unzipWith=_c,l.update=hg,l.updateWith=yg,l.values=Br,l.valuesIn=mg,l.without=py,l.words=Bc,l.wrap=cm,l.xor=dy,l.xorBy=hy,l.xorWith=yy,l.zip=my,l.zipObject=gy,l.zipObjectDeep=vy,l.zipWith=by,l.entries=Wc,l.entriesIn=zc,l.extend=Lc,l.extendWith=Eo,Sa(l,l),l.add=mv,l.attempt=qc,l.camelCase=_g,l.capitalize=Gc,l.ceil=gv,l.clamp=gg,l.clone=fm,l.cloneDeep=dm,l.cloneDeepWith=hm,l.cloneWith=pm,l.conformsTo=ym,l.deburr=Uc,l.defaultTo=Yg,l.divide=vv,l.endsWith=xg,l.eq=Dt,l.escape=wg,l.escapeRegExp=Og,l.every=Cy,l.find=Ey,l.findIndex=yc,l.findKey=Bm,l.findLast=My,l.findLastIndex=mc,l.findLastKey=qm,l.floor=bv,l.forEach=wc,l.forEachRight=Oc,l.forIn=Km,l.forInRight=Zm,l.forOwn=Ym,l.forOwnRight=Qm,l.get=_a,l.gt=mm,l.gte=gm,l.has=Jm,l.hasIn=xa,l.head=vc,l.identity=ct,l.includes=Ly,l.indexOf=M0,l.inRange=vg,l.invoke=rg,l.isArguments=Ir,l.isArray=ee,l.isArrayBuffer=vm,l.isArrayLike=ut,l.isArrayLikeObject=We,l.isBoolean=bm,l.isBuffer=yr,l.isDate=_m,l.isElement=xm,l.isEmpty=wm,l.isEqual=Om,l.isEqualWith=jm,l.isError=va,l.isFinite=Sm,l.isFunction=Xt,l.isInteger=Tc,l.isLength=Co,l.isMap=Ec,l.isMatch=km,l.isMatchWith=$m,l.isNaN=Im,l.isNative=Am,l.isNil=Tm,l.isNull=Cm,l.isNumber=Mc,l.isObject=De,l.isObjectLike=Le,l.isPlainObject=jn,l.isRegExp=ba,l.isSafeInteger=Em,l.isSet=Nc,l.isString=To,l.isSymbol=ht,l.isTypedArray=Ur,l.isUndefined=Mm,l.isWeakMap=Nm,l.isWeakSet=Rm,l.join=L0,l.kebabCase=jg,l.last=St,l.lastIndexOf=P0,l.lowerCase=Sg,l.lowerFirst=kg,l.lt=Fm,l.lte=Dm,l.max=_v,l.maxBy=xv,l.mean=wv,l.meanBy=Ov,l.min=jv,l.minBy=Sv,l.stubArray=$a,l.stubFalse=Ia,l.stubObject=lv,l.stubString=fv,l.stubTrue=pv,l.multiply=kv,l.nth=V0,l.noConflict=rv,l.noop=ka,l.now=$o,l.pad=$g,l.padEnd=Ig,l.padStart=Ag,l.parseInt=Cg,l.random=bg,l.reduce=Gy,l.reduceRight=Uy,l.repeat=Tg,l.replace=Eg,l.result=cg,l.round=$v,l.runInContext=g,l.sample=qy,l.size=Yy,l.snakeCase=Mg,l.some=Qy,l.sortedIndex=K0,l.sortedIndexBy=Z0,l.sortedIndexOf=Y0,l.sortedLastIndex=Q0,l.sortedLastIndexBy=H0,l.sortedLastIndexOf=X0,l.startCase=Rg,l.startsWith=Fg,l.subtract=Iv,l.sum=Av,l.sumBy=Cv,l.template=Dg,l.times=dv,l.toFinite=Jt,l.toInteger=ne,l.toLength=Fc,l.toLower=Lg,l.toNumber=kt,l.toSafeInteger=Lm,l.toString=xe,l.toUpper=Pg,l.trim=Vg,l.trimEnd=Wg,l.trimStart=zg,l.truncate=Gg,l.unescape=Ug,l.uniqueId=yv,l.upperCase=Bg,l.upperFirst=wa,l.each=wc,l.eachRight=Oc,l.first=vc,Sa(l,function(){var e={};return Wt(l,function(t,n){Se.call(l.prototype,n)||(e[n]=t)}),e}(),{chain:!1}),l.VERSION=u,_t(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){l[e].placeholder=l}),_t(["drop","take"],function(e,t){de.prototype[e]=function(n){n=n===o?1:Ze(ne(n),0);var a=this.__filtered__&&!t?new de(this):this.clone();return a.__filtered__?a.__takeCount__=Je(n,a.__takeCount__):a.__views__.push({size:Je(n,D),type:e+(a.__dir__<0?"Right":"")}),a},de.prototype[e+"Right"]=function(n){return this.reverse()[e](n).reverse()}}),_t(["filter","map","takeWhile"],function(e,t){var n=t+1,a=n==Te||n==ke;de.prototype[e]=function(s){var f=this.clone();return f.__iteratees__.push({iteratee:q(s,3),type:n}),f.__filtered__=f.__filtered__||a,f}}),_t(["head","last"],function(e,t){var n="take"+(t?"Right":"");de.prototype[e]=function(){return this[n](1).value()[0]}}),_t(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");de.prototype[e]=function(){return this.__filtered__?new de(this):this[n](1)}}),de.prototype.compact=function(){return this.filter(ct)},de.prototype.find=function(e){return this.filter(e).head()},de.prototype.findLast=function(e){return this.reverse().find(e)},de.prototype.invokeMap=se(function(e,t){return typeof e=="function"?new de(this):this.map(function(n){return vn(n,e,t)})}),de.prototype.reject=function(e){return this.filter(Ao(q(e)))},de.prototype.slice=function(e,t){e=ne(e);var n=this;return n.__filtered__&&(e>0||t<0)?new de(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==o&&(t=ne(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},de.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},de.prototype.toArray=function(){return this.take(D)},Wt(de.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),a=/^(?:head|last)$/.test(t),s=l[a?"take"+(t=="last"?"Right":""):t],f=a||/^find/.test(t);s&&(l.prototype[t]=function(){var h=this.__wrapped__,y=a?[1]:arguments,v=h instanceof de,I=y[0],A=v||ee(h),E=function(pe){var he=s.apply(l,sr([pe],y));return a&&F?he[0]:he};A&&n&&typeof I=="function"&&I.length!=1&&(v=A=!1);var F=this.__chain__,z=!!this.__actions__.length,K=f&&!F,ae=v&&!z;if(!f&&A){h=ae?h:new de(this);var Z=e.apply(h,y);return Z.__actions__.push({func:So,args:[E],thisArg:o}),new wt(Z,F)}return K&&ae?e.apply(this,y):(Z=this.thru(E),K?a?Z.value()[0]:Z.value():Z)})}),_t(["pop","push","shift","sort","splice","unshift"],function(e){var t=Qn[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",a=/^(?:pop|shift)$/.test(e);l.prototype[e]=function(){var s=arguments;if(a&&!this.__chain__){var f=this.value();return t.apply(ee(f)?f:[],s)}return this[n](function(h){return t.apply(ee(h)?h:[],s)})}}),Wt(de.prototype,function(e,t){var n=l[t];if(n){var a=n.name+"";Se.call(Pr,a)||(Pr[a]=[]),Pr[a].push({name:t,func:n})}}),Pr[vo(o,L).name]=[{name:"wrapper",func:o}],de.prototype.clone=Ud,de.prototype.reverse=Bd,de.prototype.value=qd,l.prototype.at=xy,l.prototype.chain=wy,l.prototype.commit=Oy,l.prototype.next=jy,l.prototype.plant=ky,l.prototype.reverse=$y,l.prototype.toJSON=l.prototype.valueOf=l.prototype.value=Iy,l.prototype.first=l.prototype.head,fn&&(l.prototype[fn]=Sy),l},Fr=Od();_r?((_r.exports=Fr)._=Fr,ji._=Fr):Qe._=Fr}).call(Sn)}(oi,oi.exports);var Wx=oi.exports;const Tf=ol(Wx);function du({value:r,children:i}){return r?typeof i=="function"?w.jsx(w.Fragment,{children:i(r)}):w.jsx(w.Fragment,{children:i}):null}const Ef={},Vn={};function Wn(r,i){try{const o=(Ef[r]||(Ef[r]=new Intl.DateTimeFormat("en-GB",{timeZone:r,hour:"numeric",timeZoneName:"longOffset"}).format))(i).split("GMT")[1]||"";return o in Vn?Vn[o]:Mf(o,o.split(":"))}catch{if(r in Vn)return Vn[r];const o=r?.match(zx);return o?Mf(r,o.slice(1)):NaN}}const zx=/([+-]\d\d):?(\d\d)?/;function Mf(r,i){const o=+i[0],u=+(i[1]||0);return Vn[r]=o>0?o*60+u:o*60-u}class ar extends Date{constructor(...i){super(),i.length>1&&typeof i[i.length-1]=="string"&&(this.timeZone=i.pop()),this.internal=new Date,isNaN(Wn(this.timeZone,this))?this.setTime(NaN):i.length?typeof i[0]=="number"&&(i.length===1||i.length===2&&typeof i[1]!="number")?this.setTime(i[0]):typeof i[0]=="string"?this.setTime(+new Date(i[0])):i[0]instanceof Date?this.setTime(+i[0]):(this.setTime(+new Date(...i)),Rf(this),hu(this)):this.setTime(Date.now())}static tz(i,...o){return o.length?new ar(...o,i):new ar(Date.now(),i)}withTimeZone(i){return new ar(+this,i)}getTimezoneOffset(){return-Wn(this.timeZone,this)}setTime(i){return Date.prototype.setTime.apply(this,arguments),hu(this),+this}[Symbol.for("constructDateFrom")](i){return new ar(+new Date(i),this.timeZone)}}const Nf=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(r=>{if(!Nf.test(r))return;const i=r.replace(Nf,"$1UTC");ar.prototype[i]&&(r.startsWith("get")?ar.prototype[r]=function(){return this.internal[i]()}:(ar.prototype[r]=function(){return Date.prototype[i].apply(this.internal,arguments),Gx(this),+this},ar.prototype[i]=function(){return Date.prototype[i].apply(this,arguments),hu(this),+this}))});function hu(r){r.internal.setTime(+r),r.internal.setUTCMinutes(r.internal.getUTCMinutes()-r.getTimezoneOffset())}function Gx(r){Date.prototype.setFullYear.call(r,r.internal.getUTCFullYear(),r.internal.getUTCMonth(),r.internal.getUTCDate()),Date.prototype.setHours.call(r,r.internal.getUTCHours(),r.internal.getUTCMinutes(),r.internal.getUTCSeconds(),r.internal.getUTCMilliseconds()),Rf(r)}function Rf(r){const i=Wn(r.timeZone,r),o=new Date(+r);o.setUTCHours(o.getUTCHours()-1);const u=-new Date(+r).getTimezoneOffset(),c=-new Date(+o).getTimezoneOffset(),p=u-c,d=Date.prototype.getHours.apply(r)!==r.internal.getUTCHours();p&&d&&r.internal.setUTCMinutes(r.internal.getUTCMinutes()+p);const m=u-i;m&&Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+m);const _=Wn(r.timeZone,r),b=-new Date(+r).getTimezoneOffset()-_,$=_!==i,M=b-m;if($&&M){Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+M);const j=Wn(r.timeZone,r),N=_-j;N&&(r.internal.setUTCMinutes(r.internal.getUTCMinutes()+N),Date.prototype.setUTCMinutes.call(r,Date.prototype.getUTCMinutes.call(r)+N))}}const Ux=r=>{let i=new Date(Number(r));if(!r){const p=new Date;i=new Date(p.getFullYear(),p.getMonth(),p.getDate())}const o=String(i.getDate()).padStart(2,"0"),u=String(i.getMonth()+1).padStart(2,"0"),c=i.getFullYear();return[u,o,c].join("/")},Bx=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",...i});function Ff(){return{enqueueSnackbar:(r,i="success",o)=>{o1(r,{severity:i,variant:"customAlertComponent",persist:!0,...o})},closeSnackbar:ul}}const qx=Bv(({id:r,message:i,severity:o,alertAction:u,sx:c,showCloseIcon:p=!0,persist:d,hideIconVariant:m,autoHideDuration:_,anchorOrigin:b,iconVariant:$,...M},j)=>w.jsx(n1,{ref:j,...M,children:w.jsx(Tv,{severity:o,action:w.jsxs(Ar,{ml:1,children:[w.jsx(du,{value:u,children:w.jsx(Yc,{size:"small",onClick:()=>{var N;return r&&((N=u?.onAction)==null?void 0:N.call(u,r))},color:"inherit",children:u?.icon})}),w.jsx(du,{value:!u&&p,children:w.jsx(Yc,{size:"small",onClick:()=>{ul(r)},color:"inherit",children:w.jsx(r1,{})})})]}),sx:{alignItems:"center",width:"320px",...c},children:i})})),Kx=r=>{let i=new Date(Number(r));if(!r){const p=new Date;i=new Date(p.getFullYear(),p.getMonth(),p.getDate())}const o=String(i.getDate()).padStart(2,"0"),u=String(i.getMonth()+1).padStart(2,"0"),c=i.getFullYear();return[u,o,c].join("/")},Zx=r=>{const i=new Date(r);return i.setUTCHours(12),String(+i)},yu=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{month:"short",day:"numeric",hour12:!1,...i}),mu=(r,i)=>new Date(Number(r)).toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric",hour:"numeric",minute:"numeric",...i}),Df=r=>{var i;const o=((i=r.replace(/-/g,"").match(/.{1,2}/g))==null?void 0:i.map(m=>parseInt(m,16)))??[],u=o.reduce((m,_)=>(m+_)%256,0),c=o.slice(1).reduce((m,_)=>(m+_)%256,0),p=o.slice(2).reduce((m,_)=>(m+_)%256,0),d=m=>m.toString(16).padStart(2,"0");return`#${d(u)}${d(c)}${d(p)}`},Lf=Vx({createStyledComponent:kf("div",{name:"MuiGrid2",slot:"Root",overridesResolver:(r,i)=>i.root}),componentName:"MuiGrid2",useThemeProps:r=>If({props:r,name:"MuiGrid2"})});function Yx({entry:r,payload:i,showUuid:o=!0}){const u=Na(j=>{var N,T,C;return(C=(T=(N=j.payload)==null?void 0:N.data)==null?void 0:T.reduce)==null?void 0:C.call(T,(O,L)=>O+L.value,0)},[]),c=Na(j=>{const N=new Fa(u(j)||0),T=i?.reduce((L,G)=>L+u(G),0)||0,C=new Fa(T),O=Number(N.div(C).times(100).toFixed(2,Fa.ROUND_DOWN));return isNaN(O)||!isFinite(O)?0:O},[u,i]),p=Ra(()=>u(r),[r,u]),d=Da(p),m=Ra(()=>Number(c(r)),[r,c]),_=Da(m),b=Na(j=>Math.floor(j).toLocaleString(),[]),$=Yv({type:"text/plain"}),M=Ff();return w.jsxs(Qv,{component:"li",direction:"row",spacing:1,sx:{color:r.color},layout:"position",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[w.jsx(Ar,{sx:{width:"3px",height:"100%",backgroundColor:r.color,borderRadius:3}}),w.jsxs(Cr,{children:[w.jsxs(tr,{component:"p",variant:"caption",children:[w.jsx(Cr,{component:"span",display:"inline-flex",mr:.5,children:w.jsx(nl,{from:d??0,to:p,map:b,children:"0"})}),w.jsxs(Cr,{component:"span",direction:"row",display:"inline-flex",children:["(",w.jsx(nl,{from:_??0,to:m,map:b,children:"0"}),"%)"]})]}),w.jsx(tr,{variant:"body1",children:r.value}),r.payload.integrationType&&w.jsx(tr,{variant:"body2",children:r.payload.integrationType}),o&&r.payload.uuid&&w.jsxs(tr,{variant:"body2",sx:{cursor:"pointer","&:hover":{textDecoration:"underline"}},onClick:()=>{$.copy(r.payload.uuid).catch(()=>{}),M.enqueueSnackbar("UUID copied to clipboard","success")},children:[r.payload.uuid.slice(0,5),"..."]})]})]})}function Pf(r){const{payload:i}=r;return w.jsx(Lf,{container:!0,direction:"row",component:"ul",gap:2,sx:{mt:2,justifyContent:"flex-start",alignItem:"center",flexWrap:"wrap"},children:w.jsx(Zv,{children:i?.map(o=>w.jsx(Lf,{children:w.jsx(Yx,{entry:o,payload:i,showUuid:r.showUuid})},`item-${o.value}`))})})}function Vf(r){const i=rr();return w.jsx(Ar,{sx:{width:"100%",height:"100%",...r.sx},children:w.jsx(Mo,{children:w.jsxs(Fv,{width:500,height:300,margin:{top:5,right:60,left:20,bottom:5},children:[w.jsx(Aa,{vertical:!1}),w.jsx(Ca,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:o=>yu(o,{timeZone:r.filter.timezone,hour12:!1,hour:"numeric"}),allowDuplicatedCategory:!1,tickLine:!1,fontSize:12,tickMargin:12}),w.jsx(Ta,{textAnchor:"end",dataKey:"value",tickLine:!1,tickFormatter:o=>Number(o).toLocaleString(),allowDecimals:!1,domain:[1,"dataMax"],children:r.label&&w.jsx(Ea,{value:r.label,angle:-90,position:"insideLeft",style:{textAnchor:"middle"}})}),w.jsx(Ma,{cursor:{stroke:i.palette.neutral.main,strokeWidth:1},formatter:o=>Number(o).toLocaleString(),labelFormatter:o=>mu(o,{timeZone:r.filter.timezone,hour12:!1})}),w.jsx(Xc,{content:w.jsx(Pf,{showUuid:r.showUuid})}),r.data.map(o=>qv(Dv,{uuid:o.uuid,integrationType:o.integrationType,key:o.uuid,name:o.name,dataKey:"value",data:o.chartData,type:"monotone",stroke:o.color,strokeWidth:2}))]})})})}const Qx=(r,i)=>{const o=new Map;return r.forEach(u=>{u.chartData.forEach(c=>{const p=new Date(c.date).getTime().toString();if(!o.has(p)){const d={date:p,total:0,diff:0,totalKey:"",originalTotal:0};i.forEach(({key:m})=>{d[m]=0,d[`${m}_absolute`]=0}),o.set(p,d)}i.forEach(({key:d})=>{const m=o.get(p),_=c[d],b=typeof _=="string"?_.trim()===""?0:parseInt(_,10):typeof _=="number"?_:0;m[`${d}_absolute`]=b,m[d]=0})})}),Array.from(o.values()).map(u=>{var c;const p=(c=i.find(_=>_.isTotal))==null?void 0:c.key,d=i.filter(_=>!_.isTotal).map(_=>_.key);if(!p||d.length===0)return u;const m=u[`${p}_absolute`];return u.originalTotal=m,u.total=m,u[p]=100,d.forEach(_=>{const b=u[`${_}_absolute`];let $;m===0?($="100.00",u[_]=100):($=m>0?new Ro(b.toString()).div(m).mul(100).toFixed(2,Ro.ROUND_DOWN):"0.00",u[_]=parseFloat($))}),{...u,totalKey:p}}).sort((u,c)=>parseInt(u.date)-parseInt(c.date))};function Wf(r){const i=rr(),o=Ra(()=>r.data?Qx(r.data,r.keyValues):[],[r.data,r.keyValues]);return w.jsx(Ar,{sx:{width:"100%",height:"100%",...r.sx},children:w.jsx(Mo,{width:"100%",height:"100%",children:w.jsxs(Lv,{data:o,width:500,height:300,margin:{top:5,right:60,left:20,bottom:5},children:[w.jsx(Aa,{strokeDasharray:"3 3"}),w.jsx(Ca,{dataKey:"date",type:"number",domain:["dataMin","dataMax"],tickFormatter:u=>yu(u,{timeZone:r.filter.timezone,hour12:!1,hour:"numeric"}),allowDuplicatedCategory:!1,tickLine:!1,fontSize:12,tickMargin:12}),w.jsx(Ta,{textAnchor:"end",tickLine:!1,tickFormatter:u=>`${u.toFixed(2)}%`}),w.jsx(Ma,{cursor:{stroke:i.palette.neutral.main,strokeWidth:1},labelFormatter:u=>mu(u,{timeZone:r.filter.timezone,hour12:!1}),formatter:(u,c,p)=>{const d=p.payload.totalKey,m=p.dataKey,_=m===d,b=p.payload[`${m}_absolute`],$=p.payload.originalTotal,M=_?null:$===0?"100.00":new Ro(b.toString()).div($).mul(100).toFixed(2,Ro.ROUND_DOWN);return[M?`${b.toLocaleString()} (${M}%)`:`${b.toLocaleString()} (TOTAL)`,c]}}),r.keyValues.sort((u,c)=>u.isTotal?-1:c.isTotal?1:0).map(u=>w.jsx(Pv,{type:"monotone",dataKey:u.key,name:u.name,stroke:u.color,fill:u.color,strokeWidth:2,fillOpacity:.6},u.key))]})})})}function zn(r){const i=Da(r.value),{ref:o}=i1({from:i??0,to:r.value,duration:1,map:r.map});return w.jsx(Qc,{sx:{p:3,flex:1,...r.sx},children:w.jsxs(Cr,{spacing:1,alignItems:"center",children:[w.jsx(tr,{ref:o,variant:"h4",fontWeight:"bold",children:r.initialValue}),w.jsx(tr,{color:"text.secondary",children:r.label})]})})}const zf={margin:{top:5,right:30,left:20,bottom:5}},Hx={tickLine:!1,fontSize:12,tickMargin:12},Xx={textAnchor:"end",tickLine:!1};function ii({data:r,series:i,xAxis:o,yAxis:u,tooltip:c,bar:p,referenceLines:d,referenceAreas:m,sx:_}){const b=rr(),$=j=>!j.isFront,M=j=>!!j.isFront;return w.jsx(Ar,{sx:{width:"100%",height:"100%",..._},children:w.jsx(Mo,{children:w.jsxs(Vv,{data:r,...zf,children:[w.jsx(Aa,{strokeDasharray:"3 3",vertical:!1}),w.jsx(Ca,{...Hx,...o}),w.jsx(Ta,{...Xx,...u}),w.jsx(Ma,{cursor:{stroke:b.palette.neutral.main,strokeWidth:1},...c}),d?.filter($).map((j,N)=>w.jsx(Jc,{...j},j.label??N)),m?.filter($).map((j,N)=>w.jsx(el,{...j},j.label??N)),i.map(j=>w.jsx(Wv,{name:j.key,dataKey:j.dataKey,fill:j.color,stackId:"stack",isAnimationActive:!1,...p},j.key)),d?.filter(M).map((j,N)=>w.jsx(Jc,{...j},j.label??N)),m?.filter(M).map((j,N)=>w.jsx(el,{...j},j.label??N))]})})})}function Jx({data:r,threshold:i=100,sx:o}){const u=rr(),c=Object.entries(r??{}).map(([d,m])=>({key:d,[d]:m})),p=c.map(({key:d})=>({key:d,dataKey:d,color:u.palette.error.light}));return w.jsx(ii,{sx:o,data:c,series:p,xAxis:{tickLine:!1,dataKey:"key"},yAxis:{tickLine:!1,domain:[0,`dataMax + ${i}`]},tooltip:{labelFormatter:d=>"Total"},referenceLines:[{y:i,stroke:u.palette.error.dark,strokeDasharray:"3 3",label:w.jsx(Ea,{value:"Unhealthy threshold",position:"insideBottomRight"}),isFront:!0}]})}function ew({data:r,threshold:i=100,sx:o}){const u=rr(),c=Object.entries(r??{}).map(([d,m])=>({key:d,[d]:m})),p=c.map(({key:d})=>({key:d,dataKey:d,color:u.palette.warning.light}));return w.jsx(ii,{sx:o,data:c,series:p,xAxis:{tickLine:!1,dataKey:"key"},yAxis:{tickLine:!1,domain:[0,`dataMax + ${i}`]},tooltip:{labelFormatter:d=>"Total"},referenceLines:[{y:i,stroke:u.palette.error.dark,strokeDasharray:"3 3",label:w.jsx(Ea,{value:"Unhealthy threshold",position:"insideBottomRight"}),isFront:!0}]})}function Gf({payload:r=[],hiddenItems:i,onToggle:o,legendLabel:u}){return w.jsx(Ar,{sx:{display:"flex",justifyContent:"center",gap:"20px",paddingTop:"20px"},children:r.map((c,p)=>{const d=i.has(c.payload.name);return w.jsxs("div",{style:{display:"flex",alignItems:"center",cursor:"pointer",opacity:d?.4:1},onClick:()=>{o?.(c.payload)},children:[w.jsx("div",{style:{width:"12px",height:"12px",backgroundColor:c.color,marginRight:"8px",borderRadius:"2px"}}),w.jsx("span",{style:{color:c.color},children:u?`${u}: ${c.value}`:c.value})]},`legend-${p}`)})})}const tw=r=>{const i=Math.PI/180,{cx:o,cy:u,midAngle:c,innerRadius:p,outerRadius:d,startAngle:m,endAngle:_,fill:b,payload:$,percent:M,value:j,valueText:N,valuePercentage:T,needleVisible:C,customText:O,allActive:L}=r,G=Math.sin(-i*c),W=Math.cos(-i*c),fe=o+(d+5)*W,S=u+(d+5)*G,B=o+(d+15)*W,U=u+(d+15)*G,me=B+(W>=0?1:-1)*22,Me=U,Fe=W>=0?"start":"end",V=j.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),Y=()=>C||L?null:w.jsx("text",{x:o,y:u,dy:8,textAnchor:"middle",fill:"#333",fontSize:14,children:$.name});return w.jsxs("g",{children:[Y(),w.jsx(tl,{cx:o,cy:u,innerRadius:p,outerRadius:d,startAngle:m,endAngle:_,fill:b}),w.jsx(tl,{cx:o,cy:u,startAngle:m,endAngle:_,innerRadius:d+2,outerRadius:d+6,fill:b}),w.jsx("path",{d:`M${fe},${S}L${B},${U}L${me},${Me}`,stroke:b,fill:"none"}),w.jsx("circle",{cx:me,cy:Me,r:2,fill:b,stroke:"none"}),w.jsx("text",{x:me+(W>=0?1:-1)*12,y:Me,textAnchor:Fe,fill:"#333",fontSize:12,children:O||(N?`${N} ${V}`:V)}),T&&w.jsxs("text",{x:me+(W>=0?1:-1)*12,y:Me,dy:16,textAnchor:Fe,fill:"#999",fontSize:11,children:[`${(M*100).toFixed(2)}%`," (",V,")"]})]})},rw=r=>{const{value:i,data:o,color:u,innerRadius:c,outerRadius:p,boxDimensions:d,legendDimensions:m,valueText:_}=r,b=Math.PI/180;let $=0;o.forEach(Y=>{$+=Y.value});const M=d?d.width/2:150,j=(d?d.height/2:200)-m.height/2,N=180*(1-Math.max(0,Math.min(1,i/$))),T=(Number(c)+2*Number(p))/3,C=Math.sin(-b*N),O=Math.cos(-b*N),L=5,G=M-L,W=j,fe=G+L*C,S=W-L*O,B=G-L*C,U=W+L*O,me=G+T*O,Me=W+T*C,Fe=i.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}),V=_??Fe;return w.jsxs(w.Fragment,{children:[w.jsx("circle",{cx:G,cy:W,r:L,fill:u,stroke:"none",style:{pointerEvents:"none"}},"needle-circle"),w.jsx("path",{d:`M${fe} ${S}L${B} ${U} L${me} ${Me} L${fe} ${S}`,stroke:"none",fill:u,style:{pointerEvents:"none"}},"needle-path"),w.jsx("text",{x:G+L,y:W+26,textAnchor:"middle",fill:"#333",fontSize:12,children:V},"needle-value")]})},nw=(r,i)=>({Allow:i.palette.success.main,Flag:i.palette.warning.main,Block:i.palette.error.main})[r]??i.palette.primary.main;function Uf({data:r,sx:i,legendLabel:o,legendToggle:u=!1,valueText:c="",valuePercentage:p=!0,pie:d,needleVisible:m=!1,needleValue:_,needleColor:b="#aaa",allActive:$=!1}){const{innerRadius:M=60,outerRadius:j=100}=d??{},N=rr(),[T,C]=No(void 0),[O,L]=No(new Set),G=Kv(null),[W,fe]=No(null),[S,B]=No(null),U=(V,Y)=>{$||C(Y)},me=()=>{$||C(void 0)},Me=V=>{u&&V&&L(Y=>{const ge=new Set(Y);return ge.has(V.name)?ge.delete(V.name):ge.size<r.length-1&&ge.add(V.name),ge})},Fe=r.map((V,Y)=>({...V,index:Y,value:O.has(V.name)?0:V.value}));return rl(()=>{const V=G.current;if(!V)return;const Y=new ResizeObserver(Te=>{var qe;const ke=(qe=Te[0])==null?void 0:qe.contentRect;ke&&fe(ke)});Y.observe(V);const ge=V.getBoundingClientRect();return fe(ge),()=>{Y.disconnect()}},[]),rl(()=>{var V;const Y=(V=G.current)==null?void 0:V.querySelector(".recharts-legend-wrapper");if(!Y){const qe=setInterval(()=>{var ke;const Ae=(ke=G.current)==null?void 0:ke.querySelector(".recharts-legend-wrapper");if(Ae){const it=Ae.getBoundingClientRect();B(it),clearInterval(qe)}},100);return()=>{clearInterval(qe)}}const ge=new ResizeObserver(qe=>{var ke;const Ae=(ke=qe[0])==null?void 0:ke.contentRect;Ae&&B(Ae)});ge.observe(Y);const Te=Y.getBoundingClientRect();return B(Te),()=>{ge.disconnect()}},[]),w.jsx(Ar,{ref:G,sx:{width:"100%",height:"100%","& g":{outline:"none"},...i},children:w.jsx(Mo,{children:w.jsxs(zv,{...zf,children:[w.jsx(Gv,{data:Fe,nameKey:"name",dataKey:"value",innerRadius:M,outerRadius:j,activeIndex:$?Fe.filter(V=>V.value>0).map(V=>V.index):T,activeShape:V=>tw({...V,valueText:c,valuePercentage:p,needleVisible:m,allActive:$}),paddingAngle:0,onMouseEnter:U,onMouseLeave:me,...d,children:Fe.map(V=>w.jsx(Uv,{fill:V.color??nw(V.name,N),opacity:O.has(V.name)?.5:1,stroke:"none"},V.name))}),w.jsx(Xc,{content:w.jsx(Gf,{legendLabel:o,hiddenItems:O,onToggle:Me})}),m&&_!==void 0&&W&&S&&rw({data:Fe,value:_,color:b,innerRadius:M,outerRadius:j,boxDimensions:W,legendDimensions:S,valueText:c})]})})})}function ow({sx:r,data:i,score:o=200,legendLabel:u}){const c=rr(),p=[{name:"Allow",customText:"0-299",value:i[0].value,color:c.palette.primary.main},{name:"Flag",customText:"300-599",value:i[1].value,color:c.palette.warning.main},{name:"Block",customText:"Over 600",value:i[2].value,color:c.palette.error.main}];return w.jsx(Uf,{data:p,legendToggle:!0,needleValue:o,legendLabel:u,allActive:!0,sx:r})}function iw({data:r,sx:i}){const o=rr(),u=(p=>{const d={};return p.forEach(m=>{Object.entries(m).forEach(([_,b])=>{const $=parseInt(_);$<=1e3&&(d[$]=(d[$]||0)+b)})}),Array.from({length:1001},(m,_)=>({key:_.toString(),value:d[_]||0}))})(r),c=[{key:"Risk Score",dataKey:"value",color:o.palette.error.main}];return w.jsx(ii,{data:u,series:c,sx:i,yAxis:{label:{value:"Count",angle:-90,position:"insideLeft"},domain:[0,"dataMax + 10"]},xAxis:{domain:[0,"dataMax"],interval:"preserveStartEnd"},tooltip:{labelFormatter:()=>"Risk Score",formatter:(p,d,m)=>[p,m.payload.key]},referenceAreas:[{x1:0,x2:299,fill:"#ffffff00",isFront:!1,label:"Allow"},{x1:300,x2:600,fill:o.palette.warning.light,isFront:!1,label:"Flag"},{x1:600,fill:o.palette.error.light,isFront:!1,label:"Block"}]})}const gu=()=>({regularChartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:500},smallChartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:300}});function Bf(r){return w.jsx(tr,{variant:"h6",fontWeight:"900",...r})}function qf(r){return w.jsx(tr,{variant:"h6",fontWeight:"400",...r})}function ai(){const r=gu();return w.jsxs(Cr,{sx:r.smallChartWrapper,children:[w.jsx(Bf,{children:"No data available for the selected period and brands"}),w.jsx(qf,{children:"Please select a different period or brand"})]})}function ui(){const r=gu();return w.jsxs(Cr,{sx:r.smallChartWrapper,children:[w.jsx(Bf,{children:"Loading..."}),w.jsx(qf,{children:"Preparing your chart data"})]})}function aw({data:r,isLoading:i,isFetching:o,isSuccess:u,filter:c,sx:p}){var d,m;const _=rr(),b=gu(),$={oneClickCreated:{key:"oneClickCreated",name:"Started",color:_.palette.neutral.main,isTotal:!0},oneClickSuccess:{key:"oneClickSuccess",name:"Finished",color:_.palette.primary.main}};return i?w.jsx(ui,{}):!r.length||!((m=(d=r[0])==null?void 0:d.chartData)!=null&&m.length)||!u?w.jsx(ai,{}):w.jsx(Wf,{data:r,keyValues:Object.values($),filter:c,sx:{...b.smallChartWrapper,opacity:o?.4:1,...p}})}const uw={chartWrapper:{justifyContent:"center",alignItems:"center",width:"100%",height:500}};function sw({data:r,isLoading:i,isFetching:o,isSuccess:u,filter:c}){return i?w.jsx(ui,{}):!r.length||!u?w.jsx(ai,{}):w.jsx(Vf,{label:"Uniques",data:r,filter:c,sx:{...uw.chartWrapper,opacity:o?.4:1}})}function cw(r){const{brands:i,data:o,keyValue:u}=r,c=i.flatMap(({_raw:p})=>{var d;const m=o?.find(b=>b.brandUuid===p.brandUuid),_=(m?.interval??[]).map(b=>({date:+new Date(b.date),value:Number(b[u]||0)})).filter(b=>r.filterOutZeroValues?b.value>0:!0);return{uuid:p.brandUuid,name:p.brandName,integrationType:al(p.integrationType),color:((d=p.additionalData)==null?void 0:d.primaryColor)??Df(p.brandUuid),chartData:_}});return Tf.chain(c).sortBy(p=>p.name).toArray().value()}const lw=({data:r,brands:i})=>r.flatMap(o=>{const u=i.find(c=>c.brandUuid===o.brandUuid);return!u||!o.interval?[]:o.interval.map(c=>({month:new Date(c.date).toISOString(),brand:u.brandName,integrationType:al(u.integrationType),total:c.oneClickCreated,finished:c.oneClickSuccess,totalCost:c.totalCost}))}),fw=({data:r,isLoading:i,showTotalCost:o=!0})=>i?w.jsx(ui,{}):r!=null&&r.length?w.jsx(Ev,{component:Qc,children:w.jsxs(Mv,{children:[w.jsx(Nv,{children:w.jsxs(Hc,{children:[w.jsx($t,{children:"Month"}),w.jsx($t,{children:"Brand"}),w.jsx($t,{children:"Integration Type"}),w.jsx($t,{align:"right",children:"Started"}),w.jsx($t,{align:"right",children:"Finished"}),o&&w.jsx($t,{align:"right",children:"Total Cost"})]})}),w.jsx(Rv,{children:r.map(u=>w.jsxs(Hc,{children:[w.jsx($t,{children:new Date(u.month).toLocaleDateString(void 0,{month:"short",year:"numeric",timeZone:"UTC"})}),w.jsx($t,{children:u.brand}),w.jsx($t,{children:u.integrationType}),w.jsx($t,{align:"right",children:u.total}),w.jsx($t,{align:"right",children:u.finished}),o&&w.jsx($t,{align:"right",children:u.totalCost??"-"})]},`${u.brand}-${u.month}`))})]})}):w.jsx(ai,{});function pw({lastUpdated:r}){return w.jsxs(tr,{variant:"caption",color:"text.secondary",fontWeight:"600",children:["The data was last updated on"," ",Bx(r??Date.now(),{hour12:!1}),"."]})}const Kf=r=>new Intl.NumberFormat("en-US").format(Number(r.toFixed(0))),dw=r=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(r),hw=r=>new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}).format(r),Zf={totalSignups:0,totalSuccess:0,totalCost:0,successRate:0};function yw(r){if(!(r!=null&&r.length))return Zf;const i=r.reduce((p,d)=>p+(d.overall.oneClickCreated||0),0),o=r.reduce((p,d)=>p+(d.overall.oneClickSuccess||0),0),u=r.reduce((p,d)=>{const m=d.overall.totalCost?Number(d.overall.totalCost.replace("$","").replace(/,/g,"")):0;return p+m},0),c=o/i;return{totalSignups:i,totalSuccess:o,totalCost:u,successRate:isNaN(c)?0:c}}function mw({chartData:r,isLoading:i=!0,hideTotalCost:o=!1}){const u=i?Zf:yw(r);return w.jsxs(Cr,{direction:"row",spacing:3,children:[w.jsx(zn,{label:"Total 1-Click Signups",value:u.totalSignups,initialValue:u.totalSignups,map:Kf}),w.jsx(zn,{label:"Finished 1-Click Signups",value:u.totalSuccess,initialValue:u.totalSuccess,map:Kf}),!o&&w.jsx(zn,{label:"Total Cost",value:u.totalCost,initialValue:u.totalCost,map:dw}),w.jsx(zn,{label:"Success Rate",value:u.successRate,initialValue:u.successRate,map:hw})]})}export{Ux as $,Sf as A,zn as B,qx as C,Bo as D,Jx as E,_1 as F,Hl as G,Ga as H,ou as I,Tf as J,uu as K,ui as L,fw as M,$l as N,aw as O,Uf as P,Il as Q,ew as R,Vf as S,su as T,qr as U,Pt as V,du as W,Af as X,Ja as Y,jf as Z,It as _,Pf as a,Wf as b,ii as c,ow as d,iw as e,Gf as f,sw as g,lw as h,ai as i,pw as j,mw as k,Kx as l,cw as m,Zx as n,yu as o,mu as p,Df as q,h1 as r,te as s,cu as t,Ff as u,vf as v,wl as w,kf as x,If as y,Ol as z};
|