PageSourceSearch

https://berrydesk.com/assets/dashboard._workspaceId.analytics-BKcPByAm.js

js berrydesk.com collected 2026-09-24 14:12:07 UTC 44,557 bytes, 5 lines download raw bytes

1import{R as h,g as it,r as ie,j as s}from"./react-vendor-R5HqukZ7.js";import{eR as F,eS as Tt,b5 as Rt,bB as $t,bC as Dt,bD as Lt,bE as It,bF as _e,C,g as B,h as W,j as ue,H as Ne,v as Ct,k as G,ct as Bt,cu as Ft}from"./main-DlnAJxyQ.js";import{c as Mt,b as Kt}from"./convex-7T7TCS1I.js";import{b as P,r as ot,c as Wt,d as st,e as Vt,i as Z,h as Be,p as V,L as _,j as ct,k as Fe,l as lt,D as ut,m as ft,n as z,o as Y,S as zt,A as dt,q as Ut,s as Q,t as pt,u as re,v as mt,w as ht,G as vt,x as ve,y as yt,z as gt,E as qt,F as he,H as Me,I as Ht,J as Gt,K as Ke,g as bt,X as xt,Y as At,f as Zt,M as Yt,T as Xt,R as We,C as Jt,a as Ve,N as Qt}from"./generateCategoricalChart-B1lMV6d6.js";import"./motion-Pabu1yrW.js";import"./value-BGBiTkF3.js";var er=["points","className","baseLinePoints","connectNulls"];function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},ne.apply(this,arguments)}function tr(e,r){if(e==null)return{};var n=rr(e,r),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function rr(e,r){if(e==null)return{};var n={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(r.indexOf(t)>=0)continue;n[t]=e[t]}return n}function ze(e){return or(e)||ir(e)||ar(e)||nr()}function nr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ar(e,r){if(e){if(typeof e=="string")return Re(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Re(e,r)}}function ir(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function or(e){if(Array.isArray(e))return Re(e)}function Re(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}var Ue=function(r){return r&&r.x===+r.x&&r.y===+r.y},sr=function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return r.forEach(function(t){Ue(t)?n[n.length-1].push(t):n[n.length-1].length>0&&n.push([])}),Ue(r[0])&&n[n.length-1].push(r[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},fe=function(r,n){var t=sr(r);n&&(t=[t.reduce(function(o,i){return[].concat(ze(o),ze(i))},[])]);var a=t.map(function(o){return o.reduce(function(i,c,f){return"".concat(i).concat(f===0?"M":"L").concat(c.x,",").concat(c.y)},"")}).join("");return t.length===1?"".concat(a,"Z"):a},cr=function(r,n,t){var a=fe(r,t);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(fe(n.reverse(),t).slice(1))},lr=function(r){var n=r.points,t=r.className,a=r.baseLinePoints,o=r.connectNulls,i=tr(r,er);if(!n||!n.length)return null;var c=F("recharts-polygon",t);if(a&&a.length){var f=i.stroke&&i.stroke!=="none",l=cr(n,a,o);return h.createElement("g",{className:c},h.createElement("path",ne({},P(i,!0),{fill:l.slice(-1)==="Z"?i.fill:"none",stroke:"none",d:l})),f?h.createElement("path",ne({},P(i,!0),{fill:"none",d:fe(n,o)})):null,f?h.createElement("path",ne({},P(i,!0),{fill:"none",d:fe(a,o)})):null)}var u=fe(n,o);return h.createElement("path",ne({},P(i,!0),{fill:u.slice(-1)==="Z"?i.fill:"none",className:c,d:u}))},Ee,qe;function ur(){if(qe)return Ee;qe=1;var e=ot(),r=Wt(),n=st();function t(a,o){return a&&a.length?e(a,n(o,2),r):void 0}return Ee=t,Ee}var fr=ur();const dr=it(fr);var Te,He;function pr(){if(He)return Te;He=1;var e=ot(),r=st(),n=Vt();function t(a,o){return a&&a.length?e(a,r(o,2),n):void 0}return Te=t,Te}var mr=pr();const hr=it(mr);var vr=["cx","cy","angle","ticks","axisLine"],yr=["ticks","tick","angle","tickFormatter","stroke"];function oe(e){"@babel/helpers - typeof";return oe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},oe(e)}function de(){return de=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},de.apply(this,arguments)}function Ge(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,t)}return n}function X(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};
2r%2?Ge(Object(n),!0).forEach(function(t){je(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ge(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ze(e,r){if(e==null)return{};var n=gr(e,r),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function gr(e,r){if(e==null)return{};var n={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(r.indexOf(t)>=0)continue;n[t]=e[t]}return n}function br(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Ye(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,Pt(t.key),t)}}function xr(e,r,n){return r&&Ye(e.prototype,r),n&&Ye(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ar(e,r,n){return r=ge(r),jr(e,jt()?Reflect.construct(r,n||[],ge(e).constructor):r.apply(e,n))}function jr(e,r){if(r&&(oe(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pr(e)}function Pr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(jt=function(){return!!e})()}function ge(e){return ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ge(e)}function Or(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&$e(e,r)}function $e(e,r){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},$e(e,r)}function je(e,r,n){return r=Pt(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Pt(e){var r=kr(e,"string");return oe(r)=="symbol"?r:r+""}function kr(e,r){if(oe(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r);if(oe(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var Pe=(function(e){function r(){return br(this,r),Ar(this,r,arguments)}return Or(r,e),xr(r,[{key:"getTickValueCoord",value:function(t){var a=t.coordinate,o=this.props,i=o.angle,c=o.cx,f=o.cy;return V(c,f,a,i)}},{key:"getTickTextAnchor",value:function(){var t=this.props.orientation,a;switch(t){case"left":a="end";break;case"right":a="start";break;default:a="middle";break}return a}},{key:"getViewBox",value:function(){var t=this.props,a=t.cx,o=t.cy,i=t.angle,c=t.ticks,f=dr(c,function(u){return u.coordinate||0}),l=hr(c,function(u){return u.coordinate||0});return{cx:a,cy:o,startAngle:i,endAngle:i,innerRadius:l.coordinate||0,outerRadius:f.coordinate||0}}},{key:"renderAxisLine",value:function(){var t=this.props,a=t.cx,o=t.cy,i=t.angle,c=t.ticks,f=t.axisLine,l=Ze(t,vr),u=c.reduce(function(p,d){return[Math.min(p[0],d.coordinate),Math.max(p[1],d.coordinate)]},[1/0,-1/0]),m=V(a,o,u[0],i),v=V(a,o,u[1],i),g=X(X(X({},P(l,!1)),{},{fill:"none"},P(f,!1)),{},{x1:m.x,y1:m.y,x2:v.x,y2:v.y});return h.createElement("line",de({className:"recharts-polar-radius-axis-line"},g))}},{key:"renderTicks",value:function(){var t=this,a=this.props,o=a.ticks,i=a.tick,c=a.angle,f=a.tickFormatter,l=a.stroke,u=Ze(a,yr),m=this.getTickTextAnchor(),v=P(u,!1),g=P(i,!1),p=o.map(function(d,y){var b=t.getTickValueCoord(d),x=X(X(X(X({textAnchor:m,transform:"rotate(".concat(90-c,", ").concat(b.x,", ").concat(b.y,")")},v),{},{stroke:"none",fill:l},g),{},{index:y},b),{},{payload:d});return h.createElement(_,de({className:F("recharts-polar-radius-axis-tick",ct(i)),key:"tick-".concat(d.coordinate)},Fe(t.props,d,y)),r.renderTickItem(i,x,f?f(d.value,y):d.value))});return h.createElement(_,{className:"recharts-polar-radius-axis-ticks"},p)}},{key:"render",value:function(){var t=this.props,a=t.ticks,o=t.axisLine,i=t.tick;return!a||!a.length?null:h.createElement(_,{className:F("recharts-polar-radius-axis",this.props.className)},o&&this.renderAxisLine(),i&&this.renderTicks(),lt.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(t,a,o){var i;return h.isValidElement(t)?i=h.cloneElement(t,a):Z(t)?i=t(a):i=h.createElement(Be,de({},a,{className:"recharts-polar-radius-axis-tick-value"}),o),i}}])})(ie.PureComponent);je(Pe,"displayName","PolarRadiusAxis");je(Pe,"axisType","radiusAxis");
2je(Pe,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function se(e){"@babel/helpers - typeof";return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},se(e)}function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},ee.apply(this,arguments)}function Xe(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,t)}return n}function J(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?Xe(Object(n),!0).forEach(function(t){Oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Xe(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function wr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function Je(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,kt(t.key),t)}}function Sr(e,r,n){return r&&Je(e.prototype,r),n&&Je(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function _r(e,r,n){return r=be(r),Nr(e,Ot()?Reflect.construct(r,n||[],be(e).constructor):r.apply(e,n))}function Nr(e,r){if(r&&(se(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Er(e)}function Er(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ot=function(){return!!e})()}function be(e){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},be(e)}function Tr(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&De(e,r)}function De(e,r){return De=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},De(e,r)}function Oe(e,r,n){return r=kt(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function kt(e){var r=Rr(e,"string");return se(r)=="symbol"?r:r+""}function Rr(e,r){if(se(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r);if(se(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var $r=Math.PI/180,Qe=1e-5,ke=(function(e){function r(){return wr(this,r),_r(this,r,arguments)}return Tr(r,e),Sr(r,[{key:"getTickLineCoord",value:function(t){var a=this.props,o=a.cx,i=a.cy,c=a.radius,f=a.orientation,l=a.tickSize,u=l||8,m=V(o,i,c,t.coordinate),v=V(o,i,c+(f==="inner"?-1:1)*u,t.coordinate);return{x1:m.x,y1:m.y,x2:v.x,y2:v.y}}},{key:"getTickTextAnchor",value:function(t){var a=this.props.orientation,o=Math.cos(-t.coordinate*$r),i;return o>Qe?i=a==="outer"?"start":"end":o<-Qe?i=a==="outer"?"end":"start":i="middle",i}},{key:"renderAxisLine",value:function(){var t=this.props,a=t.cx,o=t.cy,i=t.radius,c=t.axisLine,f=t.axisLineType,l=J(J({},P(this.props,!1)),{},{fill:"none"},P(c,!1));if(f==="circle")return h.createElement(ut,ee({className:"recharts-polar-angle-axis-line"},l,{cx:a,cy:o,r:i}));var u=this.props.ticks,m=u.map(function(v){return V(a,o,i,v.coordinate)});return h.createElement(lr,ee({className:"recharts-polar-angle-axis-line"},l,{points:m}))}},{key:"renderTicks",value:function(){var t=this,a=this.props,o=a.ticks,i=a.tick,c=a.tickLine,f=a.tickFormatter,l=a.stroke,u=P(this.props,!1),m=P(i,!1),v=J(J({},u),{},{fill:"none"}
2,P(c,!1)),g=o.map(function(p,d){var y=t.getTickLineCoord(p),b=t.getTickTextAnchor(p),x=J(J(J({textAnchor:b},u),{},{stroke:"none",fill:l},m),{},{index:d,payload:p,x:y.x2,y:y.y2});return h.createElement(_,ee({className:F("recharts-polar-angle-axis-tick",ct(i)),key:"tick-".concat(p.coordinate)},Fe(t.props,p,d)),c&&h.createElement("line",ee({className:"recharts-polar-angle-axis-tick-line"},v,y)),i&&r.renderTickItem(i,x,f?f(p.value,d):p.value))});return h.createElement(_,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var t=this.props,a=t.ticks,o=t.radius,i=t.axisLine;return o<=0||!a||!a.length?null:h.createElement(_,{className:F("recharts-polar-angle-axis",this.props.className)},i&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(t,a,o){var i;return h.isValidElement(t)?i=h.cloneElement(t,a):Z(t)?i=t(a):i=h.createElement(Be,ee({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),i}}])})(ie.PureComponent);Oe(ke,"displayName","PolarAngleAxis");Oe(ke,"axisType","angleAxis");Oe(ke,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var ye;function ce(e){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ce(e)}function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},ae.apply(this,arguments)}function et(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,t)}return n}function A(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?et(Object(n),!0).forEach(function(t){L(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):et(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Dr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function tt(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,St(t.key),t)}}function Lr(e,r,n){return r&&tt(e.prototype,r),n&&tt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ir(e,r,n){return r=xe(r),Cr(e,wt()?Reflect.construct(r,n||[],xe(e).constructor):r.apply(e,n))}function Cr(e,r){if(r&&(ce(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Br(e)}function Br(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function wt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(wt=function(){return!!e})()}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},xe(e)}function Fr(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Le(e,r)}function Le(e,r){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},Le(e,r)}function L(e,r,n){return r=St(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function St(e){var r=Mr(e,"string");return ce(r)=="symbol"?r:r+""}function Mr(e,r){if(ce(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r);if(ce(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var U=(function(e){function r(n){var t;return Dr(this,r),t=Ir(this,r,[n]),L(t,"pieRef",null),L(t,"sectorRefs",[]),L(t,"id",ht("recharts-pie-")),L(t,"handleAnimationEnd",function(){var a=t.props.onAnimationEnd;t.setState({isAnimationFinished:!0}),Z(a)&&a()}),L(t,"handleAnimationStart",function(){var a=t.props.onAnimationStart;t.setState({isAnimationFinished:!1}),Z(a)&&a()}),t.state={isAnimationFinished:!n.isAnimationActive,prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,sectorToFocus:0},t}return Fr(r,e),Lr(r,[{key:"isActiveIndex",value:function(t){var a=this.props.activeIndex;return Array.isArray(a)?a.indexOf(t)!==-1:t===a}},{key:"hasActiveIndex",value:function(){var t=this.props.activeIndex;return Array.isArray(t)?t.length!==0:t||t===0}},{key:"renderLabels",value:function(t){var a=this.props.isAnimationActive;if(a&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.label,c=o.labelLine,f=o.dataKey,l=o.valueKey,u=P(this.props,!1),m=P(i,!1),v=P(c,!1),g=i&&i.offsetRadius||20,p=t.map(function(d,y){var b=(d.startAngle+d.endAngle)/2,x=V(d.cx,d.cy,d.outerRadius+g,b),w=A(A(A(A({},u),d),{},{stroke:"none"},m),{},{index:y,textAnchor:r.getTextAnchor(x.x,d.cx)},x),N=A(A(A(A({},u),d),{},{fill:"none",stroke:d.fill},v),{},{index:y,points:[V(d.cx,d.cy,d.outerRadius,b),x]}),j=f;return z(f)&&z(l)?j="value":z(f)&&(j=l),h.createElement(_,{key:"label-".concat(d.startAngle,"-").concat(d.endAngle,"-").concat(d.midAngle,"-").concat(y)},c&&r.renderLabelLineItem(c,N,"line"),r.renderLabelItem(i,w,Y(d,j)))});return h.createElement(_,{className:"recharts-pie-labels"},p)}},{key:"renderSectorsStatically",value:function(t){var a=this,o=this.props,i=o.activeShape,c=o.blendStroke,f=o.inactiveShape;return t.map(function(l,u){if(l?.startAngle===0&&l?.endAngle===0&&t.length!==1)return null;var m=a.isActiveIndex(u),v=f&&a.hasActiveIndex()?f:null,g=m?i:v,p=A(A({},l),{},{stroke:c?l.fill:l.stroke,tabIndex:-1});return h.createElement(_,ae({ref:function(y){y&&!a.sectorRefs.includes(y)&&a.sectorRefs.push(y)}
2,tabIndex:-1,className:"recharts-pie-sector"},Fe(a.props,l,u),{key:"sector-".concat(l?.startAngle,"-").concat(l?.endAngle,"-").concat(l.midAngle,"-").concat(u)}),h.createElement(zt,ae({option:g,isActive:m,shapeType:"sector"},p)))})}},{key:"renderSectorsWithAnimation",value:function(){var t=this,a=this.props,o=a.sectors,i=a.isAnimationActive,c=a.animationBegin,f=a.animationDuration,l=a.animationEasing,u=a.animationId,m=this.state,v=m.prevSectors,g=m.prevIsAnimationActive;return h.createElement(dt,{begin:c,duration:f,isActive:i,easing:l,from:{t:0},to:{t:1},key:"pie-".concat(u,"-").concat(g),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(p){var d=p.t,y=[],b=o&&o[0],x=b.startAngle;return o.forEach(function(w,N){var j=v&&v[N],E=N>0?Ut(w,"paddingAngle",0):0;if(j){var T=Q(j.endAngle-j.startAngle,w.endAngle-w.startAngle),O=A(A({},w),{},{startAngle:x+E,endAngle:x+T(d)+E});y.push(O),x=O.endAngle}else{var $=w.endAngle,S=w.startAngle,M=Q(0,$-S),k=M(d),D=A(A({},w),{},{startAngle:x+E,endAngle:x+k+E});y.push(D),x=D.endAngle}}),h.createElement(_,null,t.renderSectorsStatically(y))})}},{key:"attachKeyboardHandlers",value:function(t){var a=this;t.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var i=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[i].focus(),a.setState({sectorToFocus:i});break}case"ArrowRight":{var c=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[c].focus(),a.setState({sectorToFocus:c});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var t=this.props,a=t.sectors,o=t.isAnimationActive,i=this.state.prevSectors;return o&&a&&a.length&&(!i||!pt(i,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var t=this,a=this.props,o=a.hide,i=a.sectors,c=a.className,f=a.label,l=a.cx,u=a.cy,m=a.innerRadius,v=a.outerRadius,g=a.isAnimationActive,p=this.state.isAnimationFinished;if(o||!i||!i.length||!re(l)||!re(u)||!re(m)||!re(v))return null;var d=F("recharts-pie",c);return h.createElement(_,{tabIndex:this.props.rootTabIndex,className:d,ref:function(b){t.pieRef=b}},this.renderSectors(),f&&this.renderLabels(i),lt.renderCallByParent(this.props,null,!1),(!g||p)&&mt.renderCallByParent(this.props,i,!1))}}],[{key:"getDerivedStateFromProps",value:function(t,a){return a.prevIsAnimationActive!==t.isAnimationActive?{prevIsAnimationActive:t.isAnimationActive,prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:[],isAnimationFinished:!0}:t.isAnimationActive&&t.animationId!==a.prevAnimationId?{prevAnimationId:t.animationId,curSectors:t.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:t.sectors!==a.curSectors?{curSectors:t.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(t,a){return t>a?"start":t<a?"end":"middle"}},{key:"renderLabelLineItem",value:function(t,a,o){if(h.isValidElement(t))return h.cloneElement(t,a);if(Z(t))return t(a);var i=F("recharts-pie-label-line",typeof t!="boolean"?t.className:"");return h.createElement(ft,ae({},a,{key:o,type:"linear",className:i}))}},{key:"renderLabelItem",value:function(t,a,o){if(h.isValidElement(t))return h.cloneElement(t,a);var i=o;if(Z(t)&&(i=t(a),h.isValidElement(i)))return i;var c=F("recharts-pie-label-text",typeof t!="boolean"&&!Z(t)?t.className:"");return h.createElement(Be,ae({},a,{alignmentBaseline:"middle",className:c}),i)}}])})(ie.PureComponent);ye=U;L(U,"displayName","Pie");L(U,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!vt.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});L(U,"parseDeltaAngle",function(e,r){var n=ve(r-e),t=Math.min(Math.abs(r-e),360);return n*t});L(U,"getRealPieData",function(e){var r=e.data,n=e.children,t=P(e,!1),a=yt(n,gt);return r&&r.length?r.map(function(o,i){return A(A(A({payload:o},t),o),a&&a[i]&&a[i].props)}):a&&a.length?a.map(function(o){return A(A({},t),o.props)}):[]});L(U,"parseCoordinateOfPie",function(e,r){var n=r.top,t=r.left,a=r.width,o=r.height,i=qt(a,o),c=t+he(e.cx,a,a/2),f=n+he(e.cy,o,o/2),l=he(e.innerRadius,i,0),u=he(e.outerRadius,i,i*.8),m=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:f,innerRadius:l,outerRadius:u,maxRadius:m}});L(U,"getComposedData",function(e){var r=e.item,n=e.offset,t=r.type.defaultProps!==void 0?A
2(A({},r.type.defaultProps),r.props):r.props,a=ye.getRealPieData(t);if(!a||!a.length)return null;var o=t.cornerRadius,i=t.startAngle,c=t.endAngle,f=t.paddingAngle,l=t.dataKey,u=t.nameKey,m=t.valueKey,v=t.tooltipType,g=Math.abs(t.minAngle),p=ye.parseCoordinateOfPie(t,n),d=ye.parseDeltaAngle(i,c),y=Math.abs(d),b=l;z(l)&&z(m)?(Me(!1,`Use "dataKey" to specify the value of pie,
3      the props "valueKey" will be deprecated in 1.1.0`),b="value"):z(l)&&(Me(!1,`Use "dataKey" to specify the value of pie,
4      the props "valueKey" will be deprecated in 1.1.0`),b=m);var x=a.filter(function(O){return Y(O,b,0)!==0}).length,w=(y>=360?x:x-1)*f,N=y-x*g-w,j=a.reduce(function(O,$){var S=Y($,b,0);return O+(re(S)?S:0)},0),E;if(j>0){var T;E=a.map(function(O,$){var S=Y(O,b,0),M=Y(O,u,$),k=(re(S)?S:0)/j,D;$?D=T.endAngle+ve(d)*f*(S!==0?1:0):D=i;var q=D+ve(d)*((S!==0?g:0)+k*N),H=(D+q)/2,K=(p.innerRadius+p.outerRadius)/2,we=[{name:M,value:S,payload:O,dataKey:b,type:v}],Se=V(p.cx,p.cy,K,H);return T=A(A(A({percent:k,cornerRadius:o,name:M,tooltipPayload:we,midAngle:H,middleRadius:K,tooltipPosition:Se},O),p),{},{value:Y(O,b),startAngle:D,endAngle:q,payload:O,paddingAngle:ve(d)*f}),T})}return A(A({},p),{},{sectors:E,data:a})});var Kr=["type","layout","connectNulls","ref"],Wr=["key"];function le(e){"@babel/helpers - typeof";return le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},le(e)}function rt(e,r){if(e==null)return{};var n=Vr(e,r),t,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)t=o[a],!(r.indexOf(t)>=0)&&Object.prototype.propertyIsEnumerable.call(e,t)&&(n[t]=e[t])}return n}function Vr(e,r){if(e==null)return{};var n={};for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){if(r.indexOf(t)>=0)continue;n[t]=e[t]}return n}function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},pe.apply(this,arguments)}function nt(e,r){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,t)}return n}function R(e){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?nt(Object(n),!0).forEach(function(t){I(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function te(e){return Hr(e)||qr(e)||Ur(e)||zr()}function zr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ur(e,r){if(e){if(typeof e=="string")return Ie(e,r);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ie(e,r)}}function qr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hr(e){if(Array.isArray(e))return Ie(e)}function Ie(e,r){(r==null||r>e.length)&&(r=e.length);for(var n=0,t=new Array(r);n<r;n++)t[n]=e[n];return t}function Gr(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function at(e,r){for(var n=0;n<r.length;n++){var t=r[n];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,Nt(t.key),t)}}function Zr(e,r,n){return r&&at(e.prototype,r),n&&at(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yr(e,r,n){return r=Ae(r),Xr(e,_t()?Reflect.construct(r,n||[],Ae(e).constructor):r.apply(e,n))}function Xr(e,r){if(r&&(le(r)==="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Jr(e)}function Jr(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _t(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_t=function(){return!!e})()}function Ae(e){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ae(e)}function Qr(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),r&&Ce(e,r)}function Ce(e,r){return Ce=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,a){return t.__proto__=a,t},Ce(e,r)}function I(e,r,n){return r=Nt(r),r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function Nt(e){var r=en(e,"string");return le(r)=="symbol"?r:r+""}function en(e,r){if(le(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var t=n.call(e,r);if(le(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var me=(function(e){function r(){var n;Gr(this,r);for(var t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return n=Yr(this,r,[].concat(a)),I(n,"state",{isAnimationFinished:!0,totalLength:0}),I(n,"generateSimpleStrokeDasharray",function(i,c){return"".concat(c,"px ").concat(i-c,"px")}),I(n,"getStrokeDasharray",function(i,c,f){var l=f.reduce(function(b,x){return b+x});if(!l)return n.generateSimpleStrokeDasharray(c,i);for(var u=Math.floor(i/l),m=i%l,v=c-i,g=[],p=0,d=0;p<f.length;d+=f[p],++p)if(d+f[p]>m){g=[].concat(te(f.slice(0,p)),[m-d]);break}var y=g.length%2===0?[0,v]:[v];return[].concat(te(r.repeat(f,u)),te(g),y).map(function(b){return"".concat(b,"px")}).join(", ")}),I(n,"id",ht("recharts-line-")),I(n,"pathRef",function(i){n.mainCurve=i}),I(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),I(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}
5return Qr(r,e),Zr(r,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();this.setState({totalLength:t})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var t=this.getTotalLength();t!==this.state.totalLength&&this.setState({totalLength:t})}}},{key:"getTotalLength",value:function(){var t=this.mainCurve;try{return t&&t.getTotalLength&&t.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(t,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,i=o.points,c=o.xAxis,f=o.yAxis,l=o.layout,u=o.children,m=yt(u,Ht);if(!m)return null;var v=function(d,y){return{x:d.x,y:d.y,value:d.value,errorVal:Y(d.payload,y)}},g={clipPath:t?"url(#clipPath-".concat(a,")"):null};return h.createElement(_,g,m.map(function(p){return h.cloneElement(p,{key:"bar-".concat(p.props.dataKey),data:i,xAxis:c,yAxis:f,layout:l,dataPointFormatter:v})}))}},{key:"renderDots",value:function(t,a,o){var i=this.props.isAnimationActive;if(i&&!this.state.isAnimationFinished)return null;var c=this.props,f=c.dot,l=c.points,u=c.dataKey,m=P(this.props,!1),v=P(f,!0),g=l.map(function(d,y){var b=R(R(R({key:"dot-".concat(y),r:3},m),v),{},{index:y,cx:d.x,cy:d.y,value:d.value,dataKey:u,payload:d.payload,points:l});return r.renderDotItem(f,b)}),p={clipPath:t?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return h.createElement(_,pe({className:"recharts-line-dots",key:"dots"},p),g)}},{key:"renderCurveStatically",value:function(t,a,o,i){var c=this.props,f=c.type,l=c.layout,u=c.connectNulls;c.ref;var m=rt(c,Kr),v=R(R(R({},P(m,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:t},i),{},{type:f,layout:l,connectNulls:u});return h.createElement(ft,pe({},v,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(t,a){var o=this,i=this.props,c=i.points,f=i.strokeDasharray,l=i.isAnimationActive,u=i.animationBegin,m=i.animationDuration,v=i.animationEasing,g=i.animationId,p=i.animateNewValues,d=i.width,y=i.height,b=this.state,x=b.prevPoints,w=b.totalLength;return h.createElement(dt,{begin:u,duration:m,isActive:l,easing:v,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var j=N.t;if(x){var E=x.length/c.length,T=c.map(function(k,D){var q=Math.floor(D*E);if(x[q]){var H=x[q],K=Q(H.x,k.x),we=Q(H.y,k.y);return R(R({},k),{},{x:K(j),y:we(j)})}if(p){var Se=Q(d*2,k.x),Et=Q(y/2,k.y);return R(R({},k),{},{x:Se(j),y:Et(j)})}return R(R({},k),{},{x:k.x,y:k.y})});return o.renderCurveStatically(T,t,a)}var O=Q(0,w),$=O(j),S;if(f){var M="".concat(f).split(/[,\s]+/gim).map(function(k){return parseFloat(k)});S=o.getStrokeDasharray($,w,M)}else S=o.generateSimpleStrokeDasharray(w,$);return o.renderCurveStatically(c,t,a,{strokeDasharray:S})})}},{key:"renderCurve",value:function(t,a){var o=this.props,i=o.points,c=o.isAnimationActive,f=this.state,l=f.prevPoints,u=f.totalLength;return c&&i&&i.length&&(!l&&u>0||!pt(l,i))?this.renderCurveWithAnimation(t,a):this.renderCurveStatically(i,t,a)}},{key:"render",value:function(){var t,a=this.props,o=a.hide,i=a.dot,c=a.points,f=a.className,l=a.xAxis,u=a.yAxis,m=a.top,v=a.left,g=a.width,p=a.height,d=a.isAnimationActive,y=a.id;if(o||!c||!c.length)return null;var b=this.state.isAnimationFinished,x=c.length===1,w=F("recharts-line",f),N=l&&l.allowDataOverflow,j=u&&u.allowDataOverflow,E=N||j,T=z(y)?this.id:y,O=(t=P(i,!1))!==null&&t!==void 0?t:{r:3,strokeWidth:2},$=O.r,S=$===void 0?3:$,M=O.strokeWidth,k=M===void 0?2:M,D=Gt(i)?i:{},q=D.clipDot,H=q===void 0?!0:q,K=S*2+k;return h.createElement(_,{className:w},N||j?h.createElement("defs",null,h.createElement("clipPath",{id:"clipPath-".concat(T)},h.createElement("rect",{x:N?v:v-g/2,y:j?m:m-p/2,width:N?g:g*2,height:j?p:p*2})),!H&&h.createElement("clipPath",{id:"clipPath-dots-".concat(T)},h.createElement("rect",{x:v-K/2,y:m-K/2,width:g+K,height:p+K}))):null,!x&&this.renderCurve(E,T),this.renderErrorBar(E,T),(x||i)&&this.renderDots(E,H,T),(!d||b)&&mt.renderCallByParent(this.props,c))}}],[{key:"getDerivedStateFromProps",value:function(t,a){return t.animationId!==a.prevAnimationId?{prevAnimationId:t.animationId,curPoints:t.points,prevPoints:a.curPoints}:t.points!==a.curPoints?{curPoints:t.points}:null}},{key:"repeat",value:function(t,a){for(var o=t.length%2!==0?[].concat(te(t),[0]):t,i=[],c=0;c<a;++c)i=[].concat(te(i),te(o));return i}},{key:"renderDotItem",value:function(t,a){var o;if(h.isValidElement(t))o=h.cloneElement(t,a);else if(Z(t))o=t(a);else{var i=a.key,c=rt(a,Wr),f=F("recharts-line-dot",typeof t!="boolean"?t.className:"");o=h.createElement(ut,pe({key:i},c,{className:f}))}return o}}])})(ie.PureComponent);I(me,"displayName","Line");I(me,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendT
5ype:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!vt.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});I(me,"getComposedData",function(e){var r=e.props,n=e.xAxis,t=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,i=e.dataKey,c=e.bandSize,f=e.displayedData,l=e.offset,u=r.layout,m=f.map(function(v,g){var p=Y(v,i);return u==="horizontal"?{x:Ke({axis:n,ticks:a,bandSize:c,entry:v,index:g}),y:z(p)?null:t.scale(p),value:p,payload:v}:{x:z(p)?null:n.scale(p),y:Ke({axis:t,ticks:o,bandSize:c,entry:v,index:g}),value:p,payload:v}});return R({points:m,layout:u},l)});var tn=bt({chartName:"LineChart",GraphicalChild:me,axisComponents:[{axisType:"xAxis",AxisComp:xt},{axisType:"yAxis",AxisComp:At}],formatAxisMap:Zt}),rn=bt({chartName:"PieChart",GraphicalChild:U,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:ke},{axisType:"radiusAxis",AxisComp:Pe}],formatAxisMap:Yt,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}});function un(){const{workspaceId:e}=Tt.useParams(),{state:r}=Rt(),[n,t]=ie.useState("7days"),{startDate:a,endDate:o}=ie.useMemo(()=>{const u=Date.now();return{startDate:{"7days":u-10080*60*1e3,"30days":u-720*60*60*1e3,"90days":u-2160*60*60*1e3}[n]||u-10080*60*1e3,endDate:u}},[n]),{data:i,isLoading:c,error:f}=Mt(Kt.analytics.getWorkspaceAnalytics,e?{workspaceId:e,startDate:a,endDate:o}:"skip"),l=["#3b82f6","#8b5cf6","#ec4899","#f59e0b","#10b981"];return s.jsxs("div",{className:"flex-1 p-8 space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Analytics"}),s.jsx("p",{className:"text-sm text-muted-foreground mt-0.5",children:"Track performance and insights for your workspace"})]}),s.jsxs($t,{value:n,onValueChange:t,children:[s.jsx(Dt,{className:"w-[180px]",children:s.jsx(Lt,{})}),s.jsxs(It,{children:[s.jsx(_e,{value:"7days",children:"Last 7 days"}),s.jsx(_e,{value:"30days",children:"Last 30 days"}),s.jsx(_e,{value:"90days",children:"Last 90 days"})]})]})]}),f?s.jsx(C,{className:"border-destructive",children:s.jsxs(B,{children:[s.jsx(W,{className:"text-destructive",children:"Error Loading Analytics"}),s.jsx(ue,{children:f.message||"Failed to load analytics data"})]})}):c&&!i?s.jsx("div",{className:"grid grid-cols-4 gap-6 mb-8",children:[1,2,3,4].map(u=>s.jsx(C,{className:"animate-pulse",children:s.jsxs(B,{children:[s.jsx("div",{className:"h-4 bg-muted rounded w-2/3 mb-2"}),s.jsx("div",{className:"h-8 bg-muted rounded w-1/2"})]})},u))}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8",children:[s.jsxs(C,{children:[s.jsxs(B,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(W,{className:"text-sm font-medium",children:"Total Conversations"}),s.jsx(Ne,{icon:Ct,size:16,strokeWidth:2,className:"text-muted-foreground"})]}),s.jsxs(G,{children:[s.jsx("div",{className:"text-2xl font-bold",children:i?.metrics.totalConversations||0}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[i?.metrics.totalMessages||0," total messages"]})]})]}),s.jsxs(C,{children:[s.jsxs(B,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(W,{className:"text-sm font-medium",children:"Positive Feedback"}),s.jsx(Ne,{icon:Bt,size:16,strokeWidth:2,className:"text-green-600"})]}),s.jsxs(G,{children:[s.jsx("div",{className:"text-2xl font-bold",children:i?.metrics.thumbsUpMessages||0}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[i?.metrics.totalMessages?Math.round((i.metrics.thumbsUpMessages||0)/i.metrics.totalMessages*100):0,"% of messages"]})]})]}),s.jsxs(C,{children:[s.jsxs(B,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(W,{className:"text-sm font-medium",children:"Negative Feedback"}),s.jsx(Ne,{icon:Ft,size:16,strokeWidth:2,className:"text-red-600"})]}),s.jsxs(G,{children:[s.jsx("div",{className:"text-2xl font-bold",children:i?.metrics.thumbsDownMessages||0}),s.jsxs("p",{className:"text-xs text-muted-foreground",children:[i?.metrics.totalMessages?Math.round((i.metrics.thumbsDownMessages||0)/i.metrics.totalMessages*100):0,"% of messages"]})]})]}),s.jsxs(C,{children:[s.jsxs(B,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[s.jsx(W,{className:"text-sm font-medium",children:"Avg. Rating"}),s.jsx(Xt,{className:"h-4 w-4 text-muted-foreground"})]}),s.jsxs(G,{children:[s.jsxs("div",{className:"text-2xl font-bold",children:[i?.metrics.thumbsUpMessages&&i?.metrics.thumbsDownMessages?(i.metrics.thumbsUpMessages/(i.metrics.thumbsUpMessages+i.metrics.thumbsDownMessages)*100).toFixed(1):"—","%"]}),s.jsx("p",{className:"text-xs text-muted-foreground",children:"Satisfaction rate"})]})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-8",children:[s.jsxs(C,{children:[s.jsxs(B,{children:[s.jsx(W,{children:"Chats Started"}),s.jsx(ue,{children:"Number of conversations over time"})]}),s.jsx(G,{children:i?.chatsStarted.data&&i.chatsStarted.data.length>0?s.jsx(We,{width:"100%",height:300,children:s.jsxs(tn,{data:i.chatsStarted.data,children:[s.jsx(Jt,{strokeDasharray:"3 3"}),s.jsx(xt,{dataKey:"date"}),s.jsx(At,{}),s.jsx(Ve,{}),s.jsx(me,{type:"monotone",dataKey:"count",stroke:"#3b82f6",strokeWidth:2})]})}):s.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]}),s.jsxs(C,{children:[s.jsxs(B,{children:[s.jsx(W,{children:"Chats by Channel"}),s.jsx(ue,{children:"Distribution across different channels"})]}),s.jsx(G,{children:i?.chatsByChannel&&i.chatsByChannel.length>0?s.jsx(We,{width:"100%",height:300,children:s.jsxs(rn,{children:[s.jsx(U,{data:i.chatsByChannel,dataKey:"count",nameKey:"channel",cx:"50%",cy:"50%",outerRadius:100,label:!0,children:i.chatsByChannel.map((u,m)=>s.jsx(gt,{fill:l[m%l.length]},`cell-${m}`))}),s.jsx(Ve,{}),s.jsx(Qt,{})]})}):s.jsx("div",{className:"h-[300px] flex items-center justify-center text-muted-foreground",children:"No data available"})})]})]}),s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[s.jsxs(C,{children:[s.jsxs(B,{children:[s.jsx(W,{children:"Top Pages"}),s.jsx(ue,{children:"Most popular pages for chat widget"})]}),s.jsx(G,{children:i?.topPages&&i.topPages.length>0?s.jsx("div",{className:"space-y-3",children:i.topPages.slice(0,5).map((u,m)=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx("p",{className:"text-sm font-medium truncate",children:u.page})}),s.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[s.jsx("div",{className:"h-2 w-32 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-blue-600",style:{width:`${u.chats/(i.topPages[0]?.chats||1)*100}%`}})}),s.jsx("span",{className:"text-sm font-mono text-muted-foreground w-12 text-right",children:u.chats})]})]},m))}):s.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"No page data available"})})]}),s.jsxs(C,{children:[s.jsxs(B,{children:[s.jsx(W,{children:"Top Countries"}),s.jsx(ue,{children:"Geographic distribution of chats"})]}),s.jsx(G,{children:i?.chatsByCountry.data&&i.chatsByCountry.data.length>0?s.jsx("div",{className:"space-y-3",children:i.chatsByCountry.data.slice(0,5).map((u,m)=>s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[s.jsx("span",{className:"text-2xl",children:u.flag}),s.jsx("p",{className:"text-sm font-medium truncate",children:u.country})]}),s.jsxs("div",{className:"ml-4 flex items-center gap-3",children:[s.jsx("div",{className:"h-2 w-32 bg-muted rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-purple-600",style:{width:`${u.conversations/(i.chatsByCountry.data[0]?.conversations||1)*100}%`}})}),s.jsx("span",{className:"text-sm font-mono text-muted-foreground w-12 text-right",children:u.conversations})]})]},m))}):s.jsx("div",{className:"py-8 text-center text-muted-foreground",children:"No country data available"})})]})]})]})]})}export{un as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.