@airporting/integrations-app 0.4.123 → 0.4.125

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.
package/dist/mf/6124.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["6124"],{160:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>_extends});function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}},4707:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>_objectWithoutPropertiesLoose});function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if(({}).hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}},391:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Notifications:()=>Notifications,cleanNotifications:()=>cleanNotifications,notifications:()=>notifications_store_notifications,hideNotification:()=>hideNotification,showNotification:()=>showNotification,createNotificationsStore:()=>createNotificationsStore,updateNotificationsState:()=>updateNotificationsState,cleanNotificationsQueue:()=>cleanNotificationsQueue,notificationsStore:()=>notificationsStore,updateNotification:()=>updateNotification,useNotifications:()=>useNotifications});var index_mjs_=__webpack_require__(8403);var index_js_=__webpack_require__(7060);var index_js_default=/*#__PURE__*/__webpack_require__.n(index_js_);"use client";function createStore(initialState){let state=initialState;let initialized=false;const listeners=/* @__PURE__ */new Set;return{getState(){return state},updateState(value){state="function"==typeof value?value(state):value},setState(value){this.updateState(value);listeners.forEach(listener=>listener(state))},initialize(value){if(!initialized){state=value;initialized=true}},subscribe(callback){listeners.add(callback);return()=>listeners.delete(callback)}}}function useStore(store){return(0,index_js_.useSyncExternalStore)(store.subscribe,()=>store.getState(),()=>store.getState())}"use client";function getDistributedNotifications(data,defaultPosition,limit){const queue=[];const notifications2=[];const count={};for(const item of data){const position=item.position||defaultPosition;count[position]=count[position]||0;count[position]+=1;if(count[position]<=limit)notifications2.push(item);else queue.push(item)}return{notifications:notifications2,queue}}const createNotificationsStore=()=>createStore({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5});const notificationsStore=createNotificationsStore();const useNotifications=(store=notificationsStore)=>useStore(store);function updateNotificationsState(store,update){const state=store.getState();const notifications2=update([...state.notifications,...state.queue]);const updated=getDistributedNotifications(notifications2,state.defaultPosition,state.limit);store.setState({notifications:updated.notifications,queue:updated.queue,limit:state.limit,defaultPosition:state.defaultPosition})}function showNotification(notification,store=notificationsStore){const id=notification.id||(0,index_mjs_.randomId)();updateNotificationsState(store,notifications2=>{if(notification.id&&notifications2.some(n=>n.id===notification.id))return notifications2;return[...notifications2,{...notification,id}]});return id}function hideNotification(id,store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.filter(notification=>{if(notification.id===id){notification.onClose?.(notification);return false}return true}));return id}function updateNotification(notification,store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.map(item=>{if(item.id===notification.id)return{...item,...notification};return item}));return notification.id}function cleanNotifications(store=notificationsStore){updateNotificationsState(store,()=>[])}function cleanNotificationsQueue(store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.slice(0,store.getState().limit))}const notifications_store_notifications={show:showNotification,hide:hideNotification,update:updateNotification,clean:cleanNotifications,cleanQueue:cleanNotificationsQueue,updateState:updateNotificationsState};var jsx_runtime=__webpack_require__(4848);var objectWithoutPropertiesLoose=__webpack_require__(4707);function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _inheritsLoose(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,_setPrototypeOf(t,o)}var react_dom_index_js_=__webpack_require__(4594);var react_dom_index_js_default=/*#__PURE__*/__webpack_require__.n(react_dom_index_js_);const config={disabled:false};const TransitionGroupContext=index_js_default().createContext(null);var reflow_forceReflow=function(node){return node.scrollTop};var UNMOUNTED="unmounted";var EXITED="exited";var ENTERING="entering";var ENTERED="entered";var EXITING="exiting";var Transition_Transition=/*#__PURE__*/function(_React$Component){_inheritsLoose(Transition,_React$Component);function Transition(props,context){var _this;_this=_React$Component.call(this,props,context)||this;var parentGroup=context;var appear=parentGroup&&!parentGroup.isMounting?props.enter:props.appear;var initialStatus;_this.appearStatus=null;if(props.in)if(appear){initialStatus=EXITED;_this.appearStatus=ENTERING}else initialStatus=ENTERED;else initialStatus=props.unmountOnExit||props.mountOnEnter?UNMOUNTED:EXITED;_this.state={status:initialStatus};_this.nextCallback=null;return _this}Transition.getDerivedStateFromProps=function(_ref,prevState){var nextIn=_ref.in;if(nextIn&&prevState.status===UNMOUNTED)return{status:EXITED};return null};var _proto=Transition.prototype;_proto.componentDidMount=function(){this.updateStatus(true,this.appearStatus)};_proto.componentDidUpdate=function(prevProps){var nextStatus=null;if(prevProps!==this.props){var status=this.state.status;if(this.props.in){if(status!==ENTERING&&status!==ENTERED)nextStatus=ENTERING}else if(status===ENTERING||status===ENTERED)nextStatus=EXITING}this.updateStatus(false,nextStatus)};_proto.componentWillUnmount=function(){this.cancelNextCallback()};_proto.getTimeouts=function(){var timeout=this.props.timeout;var exit,enter,appear;exit=enter=appear=timeout;if(null!=timeout&&"number"!=typeof timeout){exit=timeout.exit;enter=timeout.enter;appear=void 0!==timeout.appear?timeout.appear:enter}return{exit:exit,enter:enter,appear:appear}};_proto.updateStatus=function(mounting,nextStatus){if(void 0===mounting)mounting=false;if(null!==nextStatus){this.cancelNextCallback();if(nextStatus===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var node=this.props.nodeRef?this.props.nodeRef.current:react_dom_index_js_default().findDOMNode(this);if(node)reflow_forceReflow(node)}this.performEnter(mounting)}else this.performExit()}else if(this.props.unmountOnExit&&this.state.status===EXITED)this.setState({status:UNMOUNTED})};_proto.performEnter=function(mounting){var _this2=this;var enter=this.props.enter;var appearing=this.context?this.context.isMounting:mounting;var _ref2=this.props.nodeRef?[appearing]:[react_dom_index_js_default().findDOMNode(this),appearing],maybeNode=_ref2[0],maybeAppearing=_ref2[1];var timeouts=this.getTimeouts();var enterTimeout=appearing?timeouts.appear:timeouts.enter;if(!mounting&&!enter||config.disabled)return void this.safeSetState({status:ENTERED},function(){_this2.props.onEntered(maybeNode)});this.props.onEnter(maybeNode,maybeAppearing);this.safeSetState({status:ENTERING},function(){_this2.props.onEntering(maybeNode,maybeAppearing);_this2.onTransitionEnd(enterTimeout,function(){_this2.safeSetState({status:ENTERED},function(){_this2.props.onEntered(maybeNode,maybeAppearing)})})})};_proto.performExit=function(){var _this3=this;var exit=this.props.exit;var timeouts=this.getTimeouts();var maybeNode=this.props.nodeRef?void 0:react_dom_index_js_default().findDOMNode(this);if(!exit||config.disabled)return void this.safeSetState({status:EXITED},function(){_this3.props.onExited(maybeNode)});this.props.onExit(maybeNode);this.safeSetState({status:EXITING},function(){_this3.props.onExiting(maybeNode);_this3.onTransitionEnd(timeouts.exit,function(){_this3.safeSetState({status:EXITED},function(){_this3.props.onExited(maybeNode)})})})};_proto.cancelNextCallback=function(){if(null!==this.nextCallback){this.nextCallback.cancel();this.nextCallback=null}};_proto.safeSetState=function(nextState,callback){callback=this.setNextCallback(callback);this.setState(nextState,callback)};_proto.setNextCallback=function(callback){var _this4=this;var active=true;this.nextCallback=function(event){if(active){active=false;_this4.nextCallback=null;callback(event)}};this.nextCallback.cancel=function(){active=false};return this.nextCallback};_proto.onTransitionEnd=function(timeout,handler){this.setNextCallback(handler);var node=this.props.nodeRef?this.props.nodeRef.current:react_dom_index_js_default().findDOMNode(this);var doesNotHaveTimeoutOrListener=null==timeout&&!this.props.addEndListener;if(!node||doesNotHaveTimeoutOrListener)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var _ref3=this.props.nodeRef?[this.nextCallback]:[node,this.nextCallback],maybeNode=_ref3[0],maybeNextCallback=_ref3[1];this.props.addEndListener(maybeNode,maybeNextCallback)}if(null!=timeout)setTimeout(this.nextCallback,timeout)};_proto.render=function(){var status=this.state.status;if(status===UNMOUNTED)return null;var _this$props=this.props,children=_this$props.children,childProps=(_this$props.in,_this$props.mountOnEnter,_this$props.unmountOnExit,_this$props.appear,_this$props.enter,_this$props.exit,_this$props.timeout,_this$props.addEndListener,_this$props.onEnter,_this$props.onEntering,_this$props.onEntered,_this$props.onExit,_this$props.onExiting,_this$props.onExited,_this$props.nodeRef,(0,objectWithoutPropertiesLoose.A)(_this$props,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:null},"function"==typeof children?children(status,childProps):index_js_default().cloneElement(index_js_default().Children.only(children),childProps))};return Transition}(index_js_default().Component);Transition_Transition.contextType=TransitionGroupContext;Transition_Transition.propTypes={};function noop(){}Transition_Transition.defaultProps={in:false,mountOnEnter:false,unmountOnExit:false,appear:false,enter:true,exit:true,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop};Transition_Transition.UNMOUNTED=UNMOUNTED;Transition_Transition.EXITED=EXITED;Transition_Transition.ENTERING=ENTERING;Transition_Transition.ENTERED=ENTERED;Transition_Transition.EXITING=EXITING;const esm_Transition=Transition_Transition;var esm_extends=__webpack_require__(160);function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function getChildMapping(children,mapFn){var mapper=function(child){return mapFn&&(0,index_js_.isValidElement)(child)?mapFn(child):child};var result=Object.create(null);if(children)index_js_.Children.map(children,function(c){return c}).forEach(function(child){result[child.key]=mapper(child)});return result}function mergeChildMappings(prev,next){prev=prev||{};next=next||{};function getValueForKey(key){return key in next?next[key]:prev[key]}var nextKeysPending=Object.create(null);var pendingKeys=[];for(var prevKey in prev)if(prevKey in next){if(pendingKeys.length){nextKeysPending[prevKey]=pendingKeys;pendingKeys=[]}}else pendingKeys.push(prevKey);var i;var childMapping={};for(var nextKey in next){if(nextKeysPending[nextKey])for(i=0;i<nextKeysPending[nextKey].length;i++){var pendingNextKey=nextKeysPending[nextKey][i];childMapping[nextKeysPending[nextKey][i]]=getValueForKey(pendingNextKey)}childMapping[nextKey]=getValueForKey(nextKey)}for(i=0;i<pendingKeys.length;i++)childMapping[pendingKeys[i]]=getValueForKey(pendingKeys[i]);return childMapping}function getProp(child,prop,props){return null!=props[prop]?props[prop]:child.props[prop]}function getInitialChildMapping(props,onExited){return getChildMapping(props.children,function(child){return(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:true,appear:getProp(child,"appear",props),enter:getProp(child,"enter",props),exit:getProp(child,"exit",props)})})}function getNextChildMapping(nextProps,prevChildMapping,onExited){var nextChildMapping=getChildMapping(nextProps.children);var children=mergeChildMappings(prevChildMapping,nextChildMapping);Object.keys(children).forEach(function(key){var child=children[key];if(!(0,index_js_.isValidElement)(child))return;var hasPrev=key in prevChildMapping;var hasNext=key in nextChildMapping;var prevChild=prevChildMapping[key];var isLeaving=(0,index_js_.isValidElement)(prevChild)&&!prevChild.props.in;if(hasNext&&(!hasPrev||isLeaving))children[key]=(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:true,exit:getProp(child,"exit",nextProps),enter:getProp(child,"enter",nextProps)});else if(hasNext||!hasPrev||isLeaving){if(hasNext&&hasPrev&&(0,index_js_.isValidElement)(prevChild))children[key]=(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:prevChild.props.in,exit:getProp(child,"exit",nextProps),enter:getProp(child,"enter",nextProps)})}else children[key]=(0,index_js_.cloneElement)(child,{in:false})});return children}var values=Object.values||function(obj){return Object.keys(obj).map(function(k){return obj[k]})};var defaultProps={component:"div",childFactory:function(child){return child}};var TransitionGroup_TransitionGroup=/*#__PURE__*/function(_React$Component){_inheritsLoose(TransitionGroup,_React$Component);function TransitionGroup(props,context){var _this;_this=_React$Component.call(this,props,context)||this;var handleExited=_this.handleExited.bind(_assertThisInitialized(_this));_this.state={contextValue:{isMounting:true},handleExited:handleExited,firstRender:true};return _this}var _proto=TransitionGroup.prototype;_proto.componentDidMount=function(){this.mounted=true;this.setState({contextValue:{isMounting:false}})};_proto.componentWillUnmount=function(){this.mounted=false};TransitionGroup.getDerivedStateFromProps=function(nextProps,_ref){var prevChildMapping=_ref.children,handleExited=_ref.handleExited,firstRender=_ref.firstRender;return{children:firstRender?getInitialChildMapping(nextProps,handleExited):getNextChildMapping(nextProps,prevChildMapping,handleExited),firstRender:false}};_proto.handleExited=function(child,node){var currentChildMapping=getChildMapping(this.props.children);if(child.key in currentChildMapping)return;if(child.props.onExited)child.props.onExited(node);if(this.mounted)this.setState(function(state){var children=(0,esm_extends.A)({},state.children);delete children[child.key];return{children:children}})};_proto.render=function(){var _this$props=this.props,Component=_this$props.component,childFactory=_this$props.childFactory,props=(0,objectWithoutPropertiesLoose.A)(_this$props,["component","childFactory"]);var contextValue=this.state.contextValue;var children=values(this.state.children).map(childFactory);delete props.appear;delete props.enter;delete props.exit;if(null===Component)return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:contextValue},children);return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:contextValue},/*#__PURE__*/index_js_default().createElement(Component,props,children))};return TransitionGroup}(index_js_default().Component);TransitionGroup_TransitionGroup.propTypes={};TransitionGroup_TransitionGroup.defaultProps=defaultProps;const esm_TransitionGroup=TransitionGroup_TransitionGroup;var esm_index_mjs_=__webpack_require__(4763);"use client";const positions=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function getGroupedNotifications(notifications,defaultPosition){return notifications.reduce((acc,notification)=>{acc[notification.position||defaultPosition].push(notification);return acc},positions.reduce((acc,item)=>{acc[item]=[];return acc},{}))}"use client";const transforms={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"};const noTransform={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function getNotificationStateStyles({state,maxHeight,position,transitionDuration}){const[vertical,horizontal]=position.split("-");const property="center"===horizontal?`${vertical}-center`:horizontal;const commonStyles={opacity:0,maxHeight,transform:transforms[property],transitionDuration:`${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"};const inState={opacity:1,transform:noTransform[property]};const outState={opacity:0,maxHeight:0,transform:transforms[property]};const transitionStyles={entering:inState,entered:inState,exiting:outState,exited:outState};return{...commonStyles,...transitionStyles[state]}}"use client";function getAutoClose(autoClose,notificationAutoClose){if("number"==typeof notificationAutoClose)return notificationAutoClose;if(false===notificationAutoClose||false===autoClose)return false;return autoClose}"use client";const NotificationContainer=(0,index_js_.forwardRef)(({data,onHide,autoClose,...others},ref)=>{const{autoClose:_autoClose,message,...notificationProps}=data;const autoCloseDuration=getAutoClose(autoClose,data.autoClose);const autoCloseTimeout=(0,index_js_.useRef)(-1);const cancelAutoClose=()=>window.clearTimeout(autoCloseTimeout.current);const handleHide=()=>{onHide(data.id);cancelAutoClose()};const handleAutoClose=()=>{if("number"==typeof autoCloseDuration)autoCloseTimeout.current=window.setTimeout(handleHide,autoCloseDuration)};(0,index_js_.useEffect)(()=>{data.onOpen?.(data)},[]);(0,index_js_.useEffect)(()=>{handleAutoClose();return cancelAutoClose},[autoCloseDuration]);return/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Notification,{...others,...notificationProps,onClose:handleHide,ref,onMouseEnter:cancelAutoClose,onMouseLeave:handleAutoClose,children:message})});NotificationContainer.displayName="@mantine/notifications/NotificationContainer";"use client";var classes={root:"m_b37d9ac7",notification:"m_5ed0edd0"};"use client";const Notifications_Transition=esm_Transition;const Notifications_defaultProps={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:(0,esm_index_mjs_.getDefaultZIndex)("overlay"),store:notificationsStore,withinPortal:true};const varsResolver=(0,esm_index_mjs_.createVarsResolver)((_,{zIndex,containerWidth})=>({root:{"--notifications-z-index":zIndex?.toString(),"--notifications-container-width":(0,esm_index_mjs_.rem)(containerWidth)}}));const Notifications=(0,esm_index_mjs_.factory)((_props,ref)=>{const props=(0,esm_index_mjs_.useProps)("Notifications",Notifications_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,position,autoClose,transitionDuration,containerWidth,notificationMaxHeight,limit,zIndex,store,portalProps,withinPortal,...others}=props;const theme=(0,esm_index_mjs_.useMantineTheme)();const data=useNotifications(store);const forceUpdate=(0,index_mjs_.useForceUpdate)();const shouldReduceMotion=(0,index_mjs_.useReducedMotion)();const refs=(0,index_js_.useRef)({});const previousLength=(0,index_js_.useRef)(0);const reduceMotion=theme.respectReducedMotion?shouldReduceMotion:false;const duration=reduceMotion?1:transitionDuration;const getStyles=(0,esm_index_mjs_.useStyles)({name:"Notifications",classes:classes,props,className,style,classNames,styles,unstyled,vars,varsResolver});(0,index_js_.useEffect)(()=>{store?.updateState(current=>({...current,limit:limit||5,defaultPosition:position}))},[limit,position]);(0,index_mjs_.useDidUpdate)(()=>{if(data.notifications.length>previousLength.current)setTimeout(()=>forceUpdate(),0);previousLength.current=data.notifications.length},[data.notifications]);const grouped=getGroupedNotifications(data.notifications,position);const groupedComponents=positions.reduce((acc,pos)=>{acc[pos]=grouped[pos].map(({style:notificationStyle,...notification})=>/* @__PURE__ */(0,jsx_runtime.jsx)(Notifications_Transition,{timeout:duration,onEnter:()=>refs.current[notification.id].offsetHeight,nodeRef:{current:refs.current[notification.id]},children:state=>/* @__PURE__ */(0,jsx_runtime.jsx)(NotificationContainer,{ref:node=>{if(node)refs.current[notification.id]=node},data:notification,onHide:id=>hideNotification(id,store),autoClose,...getStyles("notification",{style:{...getNotificationStateStyles({state,position:pos,transitionDuration:duration,maxHeight:notificationMaxHeight}),...notificationStyle}})})},notification.id));return acc},{});return/* @__PURE__ */(0,jsx_runtime.jsxs)(esm_index_mjs_.OptionalPortal,{withinPortal,...portalProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"top-center",ref,...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-center"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"top-left",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-left"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root",{className:esm_index_mjs_.RemoveScroll.classNames.fullWidth}),"data-position":"top-right",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-right"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root",{className:esm_index_mjs_.RemoveScroll.classNames.fullWidth}),"data-position":"bottom-right",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-right"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"bottom-left",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-left"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"bottom-center",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-center"]})})]})});Notifications.classes=classes;Notifications.displayName="@mantine/notifications/Notifications";Notifications.show=notifications_store_notifications.show;Notifications.hide=notifications_store_notifications.hide;Notifications.update=notifications_store_notifications.update;Notifications.clean=notifications_store_notifications.clean;Notifications.cleanQueue=notifications_store_notifications.cleanQueue;Notifications.updateState=notifications_store_notifications.updateState}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["6124"],{160:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>_extends});function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}},4707:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.d(__webpack_exports__,{A:()=>_objectWithoutPropertiesLoose});function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if(({}).hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n]}return t}},391:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{Notifications:()=>Notifications,cleanNotifications:()=>cleanNotifications,notifications:()=>notifications_store_notifications,hideNotification:()=>hideNotification,showNotification:()=>showNotification,createNotificationsStore:()=>createNotificationsStore,updateNotificationsState:()=>updateNotificationsState,cleanNotificationsQueue:()=>cleanNotificationsQueue,notificationsStore:()=>notificationsStore,updateNotification:()=>updateNotification,useNotifications:()=>useNotifications});var index_mjs_=__webpack_require__(2667);var index_js_=__webpack_require__(8556);var index_js_default=/*#__PURE__*/__webpack_require__.n(index_js_);"use client";function createStore(initialState){let state=initialState;let initialized=false;const listeners=/* @__PURE__ */new Set;return{getState(){return state},updateState(value){state="function"==typeof value?value(state):value},setState(value){this.updateState(value);listeners.forEach(listener=>listener(state))},initialize(value){if(!initialized){state=value;initialized=true}},subscribe(callback){listeners.add(callback);return()=>listeners.delete(callback)}}}function useStore(store){return(0,index_js_.useSyncExternalStore)(store.subscribe,()=>store.getState(),()=>store.getState())}"use client";function getDistributedNotifications(data,defaultPosition,limit){const queue=[];const notifications2=[];const count={};for(const item of data){const position=item.position||defaultPosition;count[position]=count[position]||0;count[position]+=1;if(count[position]<=limit)notifications2.push(item);else queue.push(item)}return{notifications:notifications2,queue}}const createNotificationsStore=()=>createStore({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5});const notificationsStore=createNotificationsStore();const useNotifications=(store=notificationsStore)=>useStore(store);function updateNotificationsState(store,update){const state=store.getState();const notifications2=update([...state.notifications,...state.queue]);const updated=getDistributedNotifications(notifications2,state.defaultPosition,state.limit);store.setState({notifications:updated.notifications,queue:updated.queue,limit:state.limit,defaultPosition:state.defaultPosition})}function showNotification(notification,store=notificationsStore){const id=notification.id||(0,index_mjs_.randomId)();updateNotificationsState(store,notifications2=>{if(notification.id&&notifications2.some(n=>n.id===notification.id))return notifications2;return[...notifications2,{...notification,id}]});return id}function hideNotification(id,store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.filter(notification=>{if(notification.id===id){notification.onClose?.(notification);return false}return true}));return id}function updateNotification(notification,store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.map(item=>{if(item.id===notification.id)return{...item,...notification};return item}));return notification.id}function cleanNotifications(store=notificationsStore){updateNotificationsState(store,()=>[])}function cleanNotificationsQueue(store=notificationsStore){updateNotificationsState(store,notifications2=>notifications2.slice(0,store.getState().limit))}const notifications_store_notifications={show:showNotification,hide:hideNotification,update:updateNotification,clean:cleanNotifications,cleanQueue:cleanNotificationsQueue,updateState:updateNotificationsState};var jsx_runtime=__webpack_require__(4848);var objectWithoutPropertiesLoose=__webpack_require__(4707);function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},_setPrototypeOf(t,e)}function _inheritsLoose(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,_setPrototypeOf(t,o)}var react_dom_index_js_=__webpack_require__(1772);var react_dom_index_js_default=/*#__PURE__*/__webpack_require__.n(react_dom_index_js_);const config={disabled:false};const TransitionGroupContext=index_js_default().createContext(null);var reflow_forceReflow=function(node){return node.scrollTop};var UNMOUNTED="unmounted";var EXITED="exited";var ENTERING="entering";var ENTERED="entered";var EXITING="exiting";var Transition_Transition=/*#__PURE__*/function(_React$Component){_inheritsLoose(Transition,_React$Component);function Transition(props,context){var _this;_this=_React$Component.call(this,props,context)||this;var parentGroup=context;var appear=parentGroup&&!parentGroup.isMounting?props.enter:props.appear;var initialStatus;_this.appearStatus=null;if(props.in)if(appear){initialStatus=EXITED;_this.appearStatus=ENTERING}else initialStatus=ENTERED;else initialStatus=props.unmountOnExit||props.mountOnEnter?UNMOUNTED:EXITED;_this.state={status:initialStatus};_this.nextCallback=null;return _this}Transition.getDerivedStateFromProps=function(_ref,prevState){var nextIn=_ref.in;if(nextIn&&prevState.status===UNMOUNTED)return{status:EXITED};return null};var _proto=Transition.prototype;_proto.componentDidMount=function(){this.updateStatus(true,this.appearStatus)};_proto.componentDidUpdate=function(prevProps){var nextStatus=null;if(prevProps!==this.props){var status=this.state.status;if(this.props.in){if(status!==ENTERING&&status!==ENTERED)nextStatus=ENTERING}else if(status===ENTERING||status===ENTERED)nextStatus=EXITING}this.updateStatus(false,nextStatus)};_proto.componentWillUnmount=function(){this.cancelNextCallback()};_proto.getTimeouts=function(){var timeout=this.props.timeout;var exit,enter,appear;exit=enter=appear=timeout;if(null!=timeout&&"number"!=typeof timeout){exit=timeout.exit;enter=timeout.enter;appear=void 0!==timeout.appear?timeout.appear:enter}return{exit:exit,enter:enter,appear:appear}};_proto.updateStatus=function(mounting,nextStatus){if(void 0===mounting)mounting=false;if(null!==nextStatus){this.cancelNextCallback();if(nextStatus===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var node=this.props.nodeRef?this.props.nodeRef.current:react_dom_index_js_default().findDOMNode(this);if(node)reflow_forceReflow(node)}this.performEnter(mounting)}else this.performExit()}else if(this.props.unmountOnExit&&this.state.status===EXITED)this.setState({status:UNMOUNTED})};_proto.performEnter=function(mounting){var _this2=this;var enter=this.props.enter;var appearing=this.context?this.context.isMounting:mounting;var _ref2=this.props.nodeRef?[appearing]:[react_dom_index_js_default().findDOMNode(this),appearing],maybeNode=_ref2[0],maybeAppearing=_ref2[1];var timeouts=this.getTimeouts();var enterTimeout=appearing?timeouts.appear:timeouts.enter;if(!mounting&&!enter||config.disabled)return void this.safeSetState({status:ENTERED},function(){_this2.props.onEntered(maybeNode)});this.props.onEnter(maybeNode,maybeAppearing);this.safeSetState({status:ENTERING},function(){_this2.props.onEntering(maybeNode,maybeAppearing);_this2.onTransitionEnd(enterTimeout,function(){_this2.safeSetState({status:ENTERED},function(){_this2.props.onEntered(maybeNode,maybeAppearing)})})})};_proto.performExit=function(){var _this3=this;var exit=this.props.exit;var timeouts=this.getTimeouts();var maybeNode=this.props.nodeRef?void 0:react_dom_index_js_default().findDOMNode(this);if(!exit||config.disabled)return void this.safeSetState({status:EXITED},function(){_this3.props.onExited(maybeNode)});this.props.onExit(maybeNode);this.safeSetState({status:EXITING},function(){_this3.props.onExiting(maybeNode);_this3.onTransitionEnd(timeouts.exit,function(){_this3.safeSetState({status:EXITED},function(){_this3.props.onExited(maybeNode)})})})};_proto.cancelNextCallback=function(){if(null!==this.nextCallback){this.nextCallback.cancel();this.nextCallback=null}};_proto.safeSetState=function(nextState,callback){callback=this.setNextCallback(callback);this.setState(nextState,callback)};_proto.setNextCallback=function(callback){var _this4=this;var active=true;this.nextCallback=function(event){if(active){active=false;_this4.nextCallback=null;callback(event)}};this.nextCallback.cancel=function(){active=false};return this.nextCallback};_proto.onTransitionEnd=function(timeout,handler){this.setNextCallback(handler);var node=this.props.nodeRef?this.props.nodeRef.current:react_dom_index_js_default().findDOMNode(this);var doesNotHaveTimeoutOrListener=null==timeout&&!this.props.addEndListener;if(!node||doesNotHaveTimeoutOrListener)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var _ref3=this.props.nodeRef?[this.nextCallback]:[node,this.nextCallback],maybeNode=_ref3[0],maybeNextCallback=_ref3[1];this.props.addEndListener(maybeNode,maybeNextCallback)}if(null!=timeout)setTimeout(this.nextCallback,timeout)};_proto.render=function(){var status=this.state.status;if(status===UNMOUNTED)return null;var _this$props=this.props,children=_this$props.children,childProps=(_this$props.in,_this$props.mountOnEnter,_this$props.unmountOnExit,_this$props.appear,_this$props.enter,_this$props.exit,_this$props.timeout,_this$props.addEndListener,_this$props.onEnter,_this$props.onEntering,_this$props.onEntered,_this$props.onExit,_this$props.onExiting,_this$props.onExited,_this$props.nodeRef,(0,objectWithoutPropertiesLoose.A)(_this$props,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:null},"function"==typeof children?children(status,childProps):index_js_default().cloneElement(index_js_default().Children.only(children),childProps))};return Transition}(index_js_default().Component);Transition_Transition.contextType=TransitionGroupContext;Transition_Transition.propTypes={};function noop(){}Transition_Transition.defaultProps={in:false,mountOnEnter:false,unmountOnExit:false,appear:false,enter:true,exit:true,onEnter:noop,onEntering:noop,onEntered:noop,onExit:noop,onExiting:noop,onExited:noop};Transition_Transition.UNMOUNTED=UNMOUNTED;Transition_Transition.EXITED=EXITED;Transition_Transition.ENTERING=ENTERING;Transition_Transition.ENTERED=ENTERED;Transition_Transition.EXITING=EXITING;const esm_Transition=Transition_Transition;var esm_extends=__webpack_require__(160);function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function getChildMapping(children,mapFn){var mapper=function(child){return mapFn&&(0,index_js_.isValidElement)(child)?mapFn(child):child};var result=Object.create(null);if(children)index_js_.Children.map(children,function(c){return c}).forEach(function(child){result[child.key]=mapper(child)});return result}function mergeChildMappings(prev,next){prev=prev||{};next=next||{};function getValueForKey(key){return key in next?next[key]:prev[key]}var nextKeysPending=Object.create(null);var pendingKeys=[];for(var prevKey in prev)if(prevKey in next){if(pendingKeys.length){nextKeysPending[prevKey]=pendingKeys;pendingKeys=[]}}else pendingKeys.push(prevKey);var i;var childMapping={};for(var nextKey in next){if(nextKeysPending[nextKey])for(i=0;i<nextKeysPending[nextKey].length;i++){var pendingNextKey=nextKeysPending[nextKey][i];childMapping[nextKeysPending[nextKey][i]]=getValueForKey(pendingNextKey)}childMapping[nextKey]=getValueForKey(nextKey)}for(i=0;i<pendingKeys.length;i++)childMapping[pendingKeys[i]]=getValueForKey(pendingKeys[i]);return childMapping}function getProp(child,prop,props){return null!=props[prop]?props[prop]:child.props[prop]}function getInitialChildMapping(props,onExited){return getChildMapping(props.children,function(child){return(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:true,appear:getProp(child,"appear",props),enter:getProp(child,"enter",props),exit:getProp(child,"exit",props)})})}function getNextChildMapping(nextProps,prevChildMapping,onExited){var nextChildMapping=getChildMapping(nextProps.children);var children=mergeChildMappings(prevChildMapping,nextChildMapping);Object.keys(children).forEach(function(key){var child=children[key];if(!(0,index_js_.isValidElement)(child))return;var hasPrev=key in prevChildMapping;var hasNext=key in nextChildMapping;var prevChild=prevChildMapping[key];var isLeaving=(0,index_js_.isValidElement)(prevChild)&&!prevChild.props.in;if(hasNext&&(!hasPrev||isLeaving))children[key]=(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:true,exit:getProp(child,"exit",nextProps),enter:getProp(child,"enter",nextProps)});else if(hasNext||!hasPrev||isLeaving){if(hasNext&&hasPrev&&(0,index_js_.isValidElement)(prevChild))children[key]=(0,index_js_.cloneElement)(child,{onExited:onExited.bind(null,child),in:prevChild.props.in,exit:getProp(child,"exit",nextProps),enter:getProp(child,"enter",nextProps)})}else children[key]=(0,index_js_.cloneElement)(child,{in:false})});return children}var values=Object.values||function(obj){return Object.keys(obj).map(function(k){return obj[k]})};var defaultProps={component:"div",childFactory:function(child){return child}};var TransitionGroup_TransitionGroup=/*#__PURE__*/function(_React$Component){_inheritsLoose(TransitionGroup,_React$Component);function TransitionGroup(props,context){var _this;_this=_React$Component.call(this,props,context)||this;var handleExited=_this.handleExited.bind(_assertThisInitialized(_this));_this.state={contextValue:{isMounting:true},handleExited:handleExited,firstRender:true};return _this}var _proto=TransitionGroup.prototype;_proto.componentDidMount=function(){this.mounted=true;this.setState({contextValue:{isMounting:false}})};_proto.componentWillUnmount=function(){this.mounted=false};TransitionGroup.getDerivedStateFromProps=function(nextProps,_ref){var prevChildMapping=_ref.children,handleExited=_ref.handleExited,firstRender=_ref.firstRender;return{children:firstRender?getInitialChildMapping(nextProps,handleExited):getNextChildMapping(nextProps,prevChildMapping,handleExited),firstRender:false}};_proto.handleExited=function(child,node){var currentChildMapping=getChildMapping(this.props.children);if(child.key in currentChildMapping)return;if(child.props.onExited)child.props.onExited(node);if(this.mounted)this.setState(function(state){var children=(0,esm_extends.A)({},state.children);delete children[child.key];return{children:children}})};_proto.render=function(){var _this$props=this.props,Component=_this$props.component,childFactory=_this$props.childFactory,props=(0,objectWithoutPropertiesLoose.A)(_this$props,["component","childFactory"]);var contextValue=this.state.contextValue;var children=values(this.state.children).map(childFactory);delete props.appear;delete props.enter;delete props.exit;if(null===Component)return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:contextValue},children);return /*#__PURE__*/index_js_default().createElement(TransitionGroupContext.Provider,{value:contextValue},/*#__PURE__*/index_js_default().createElement(Component,props,children))};return TransitionGroup}(index_js_default().Component);TransitionGroup_TransitionGroup.propTypes={};TransitionGroup_TransitionGroup.defaultProps=defaultProps;const esm_TransitionGroup=TransitionGroup_TransitionGroup;var esm_index_mjs_=__webpack_require__(2773);"use client";const positions=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function getGroupedNotifications(notifications,defaultPosition){return notifications.reduce((acc,notification)=>{acc[notification.position||defaultPosition].push(notification);return acc},positions.reduce((acc,item)=>{acc[item]=[];return acc},{}))}"use client";const transforms={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"};const noTransform={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function getNotificationStateStyles({state,maxHeight,position,transitionDuration}){const[vertical,horizontal]=position.split("-");const property="center"===horizontal?`${vertical}-center`:horizontal;const commonStyles={opacity:0,maxHeight,transform:transforms[property],transitionDuration:`${transitionDuration}ms, ${transitionDuration}ms, ${transitionDuration}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"};const inState={opacity:1,transform:noTransform[property]};const outState={opacity:0,maxHeight:0,transform:transforms[property]};const transitionStyles={entering:inState,entered:inState,exiting:outState,exited:outState};return{...commonStyles,...transitionStyles[state]}}"use client";function getAutoClose(autoClose,notificationAutoClose){if("number"==typeof notificationAutoClose)return notificationAutoClose;if(false===notificationAutoClose||false===autoClose)return false;return autoClose}"use client";const NotificationContainer=(0,index_js_.forwardRef)(({data,onHide,autoClose,...others},ref)=>{const{autoClose:_autoClose,message,...notificationProps}=data;const autoCloseDuration=getAutoClose(autoClose,data.autoClose);const autoCloseTimeout=(0,index_js_.useRef)(-1);const cancelAutoClose=()=>window.clearTimeout(autoCloseTimeout.current);const handleHide=()=>{onHide(data.id);cancelAutoClose()};const handleAutoClose=()=>{if("number"==typeof autoCloseDuration)autoCloseTimeout.current=window.setTimeout(handleHide,autoCloseDuration)};(0,index_js_.useEffect)(()=>{data.onOpen?.(data)},[]);(0,index_js_.useEffect)(()=>{handleAutoClose();return cancelAutoClose},[autoCloseDuration]);return/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Notification,{...others,...notificationProps,onClose:handleHide,ref,onMouseEnter:cancelAutoClose,onMouseLeave:handleAutoClose,children:message})});NotificationContainer.displayName="@mantine/notifications/NotificationContainer";"use client";var classes={root:"m_b37d9ac7",notification:"m_5ed0edd0"};"use client";const Notifications_Transition=esm_Transition;const Notifications_defaultProps={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:(0,esm_index_mjs_.getDefaultZIndex)("overlay"),store:notificationsStore,withinPortal:true};const varsResolver=(0,esm_index_mjs_.createVarsResolver)((_,{zIndex,containerWidth})=>({root:{"--notifications-z-index":zIndex?.toString(),"--notifications-container-width":(0,esm_index_mjs_.rem)(containerWidth)}}));const Notifications=(0,esm_index_mjs_.factory)((_props,ref)=>{const props=(0,esm_index_mjs_.useProps)("Notifications",Notifications_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,position,autoClose,transitionDuration,containerWidth,notificationMaxHeight,limit,zIndex,store,portalProps,withinPortal,...others}=props;const theme=(0,esm_index_mjs_.useMantineTheme)();const data=useNotifications(store);const forceUpdate=(0,index_mjs_.useForceUpdate)();const shouldReduceMotion=(0,index_mjs_.useReducedMotion)();const refs=(0,index_js_.useRef)({});const previousLength=(0,index_js_.useRef)(0);const reduceMotion=theme.respectReducedMotion?shouldReduceMotion:false;const duration=reduceMotion?1:transitionDuration;const getStyles=(0,esm_index_mjs_.useStyles)({name:"Notifications",classes:classes,props,className,style,classNames,styles,unstyled,vars,varsResolver});(0,index_js_.useEffect)(()=>{store?.updateState(current=>({...current,limit:limit||5,defaultPosition:position}))},[limit,position]);(0,index_mjs_.useDidUpdate)(()=>{if(data.notifications.length>previousLength.current)setTimeout(()=>forceUpdate(),0);previousLength.current=data.notifications.length},[data.notifications]);const grouped=getGroupedNotifications(data.notifications,position);const groupedComponents=positions.reduce((acc,pos)=>{acc[pos]=grouped[pos].map(({style:notificationStyle,...notification})=>/* @__PURE__ */(0,jsx_runtime.jsx)(Notifications_Transition,{timeout:duration,onEnter:()=>refs.current[notification.id].offsetHeight,nodeRef:{current:refs.current[notification.id]},children:state=>/* @__PURE__ */(0,jsx_runtime.jsx)(NotificationContainer,{ref:node=>{if(node)refs.current[notification.id]=node},data:notification,onHide:id=>hideNotification(id,store),autoClose,...getStyles("notification",{style:{...getNotificationStateStyles({state,position:pos,transitionDuration:duration,maxHeight:notificationMaxHeight}),...notificationStyle}})})},notification.id));return acc},{});return/* @__PURE__ */(0,jsx_runtime.jsxs)(esm_index_mjs_.OptionalPortal,{withinPortal,...portalProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"top-center",ref,...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-center"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"top-left",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-left"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root",{className:esm_index_mjs_.RemoveScroll.classNames.fullWidth}),"data-position":"top-right",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["top-right"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root",{className:esm_index_mjs_.RemoveScroll.classNames.fullWidth}),"data-position":"bottom-right",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-right"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"bottom-left",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-left"]})}),/* @__PURE__ */(0,jsx_runtime.jsx)(esm_index_mjs_.Box,{...getStyles("root"),"data-position":"bottom-center",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(esm_TransitionGroup,{children:groupedComponents["bottom-center"]})})]})});Notifications.classes=classes;Notifications.displayName="@mantine/notifications/Notifications";Notifications.show=notifications_store_notifications.show;Notifications.hide=notifications_store_notifications.hide;Notifications.update=notifications_store_notifications.update;Notifications.clean=notifications_store_notifications.clean;Notifications.cleanQueue=notifications_store_notifications.cleanQueue;Notifications.updateState=notifications_store_notifications.updateState}}]);
package/dist/mf/6702.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["6702"],{8861:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AreaChart:()=>AreaChart,BubbleChart:()=>BubbleChart,FunnelChart:()=>FunnelChart,RadialBarChart:()=>RadialBarChart,AreaGradient:()=>AreaGradient,CompositeChart:()=>CompositeChart,ChartTooltip:()=>ChartTooltip,DonutChart:()=>DonutChart,LineChart:()=>LineChart,RadarChart:()=>RadarChart,ChartLegend:()=>ChartLegend,Heatmap:()=>Heatmap,ScatterChart:()=>ScatterChart,PieChart:()=>PieChart,getSplitOffset:()=>getSplitOffset,getFilteredChartLegendPayload:()=>getFilteredChartLegendPayload,BarChart:()=>BarChart,Sparkline:()=>Sparkline,getFilteredChartTooltipPayload:()=>getFilteredChartTooltipPayload});var jsx_runtime=__webpack_require__(4848);var index_mjs_=__webpack_require__(4763);"use client";function getSeriesLabels(series){if(!series)return{};return series.reduce((acc,item)=>{const matchFound=item.name.search(/\./);if(matchFound>=0){const key=item.name.substring(matchFound+1);acc[key]=item.label;return acc}acc[item.name]=item.label;return acc},{})}"use client";var classes={tooltip:"m_e4d36c9b",tooltipLabel:"m_7f4bcb19",tooltipBody:"m_3de554dd",tooltipItemColor:"m_b30369b5",tooltipItem:"m_3de8964e",tooltipItemBody:"m_50186d10",tooltipItemName:"m_501dadf9",tooltipItemData:"m_50192318"};"use client";function updateChartTooltipPayload(payload){return payload.map(item=>{if(!item.payload||item.payload[item.name])return item;const matchFound=item.name.search(/\./);if(matchFound>=0){const newDataKey=item.name.substring(0,matchFound);const nestedPayload={...item.payload[newDataKey]};const shallowPayload=Object.entries(item.payload).reduce((acc,current)=>{const[k,v]=current;return k===newDataKey?acc:{...acc,[k]:v}},{});return{...item,name:item.name.substring(matchFound+1),payload:{...shallowPayload,...nestedPayload}}}return item})}function getFilteredChartTooltipPayload(payload,segmentId){const duplicatesFilter=updateChartTooltipPayload(payload.filter(item=>"none"!==item.fill||!item.color));if(!segmentId)return duplicatesFilter;return duplicatesFilter.filter(item=>item.name===segmentId)}function getData(item,type){if("radial"===type||"scatter"===type){if(Array.isArray(item.value))return item.value[1]-item.value[0];return item.value}if(Array.isArray(item.payload[item.dataKey]))return item.payload[item.dataKey][1]-item.payload[item.dataKey][0];return item.payload[item.name]}const defaultProps={type:"area",showColor:true};const ChartTooltip=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartTooltip",defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,payload,label,unit,type,segmentId,mod,series,valueFormatter,showColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"ChartTooltip",classes:classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartTooltipPayload(payload,segmentId);const scatterLabel="scatter"===type?payload[0]?.payload?.name:null;const labels=getSeriesLabels(series);const _label=label||scatterLabel;const items=filteredPayload.map(item=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{"data-type":type,...getStyles("tooltipItem"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemBody"),children:[showColor&&/* @__PURE__ */(0,jsx_runtime.jsx)("svg",{...getStyles("tooltipItemColor"),children:/* @__PURE__ */(0,jsx_runtime.jsx)("circle",{r:6,fill:(0,index_mjs_.getThemeColor)(item.color,theme),width:12,height:12,cx:6,cy:6})}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipItemName"),children:labels[item.name]||item.name})]}),/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemData"),children:["function"==typeof valueFormatter?valueFormatter(getData(item,type)):getData(item,type),unit||item.unit]})]},item?.key??item.name));return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{...getStyles("tooltip"),mod:[{type},mod],ref,...others,children:[_label&&/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipLabel"),children:_label}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipBody"),children:items})]})});ChartTooltip.displayName="@mantine/charts/ChartTooltip";"use client";var ChartLegend_module_css_classes={legend:"m_847eaf",legendItem:"m_17da7e62",legendItemColor:"m_6e236e21",legendItemName:"m_8ff56c0d"};"use client";function updateChartLegendPayload(payload){return payload.map(item=>{const newDataKey=item.dataKey?.split(".").pop();return{...item,dataKey:newDataKey,payload:{...item.payload,name:newDataKey,dataKey:newDataKey}}})}function getFilteredChartLegendPayload(payload){return updateChartLegendPayload(payload.filter(item=>"none"!==item.color))}const ChartLegend=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartLegend",null,_props);const{classNames,className,style,styles,unstyled,vars,payload,onHighlight,legendPosition,mod,series,showColor,centered,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"ChartLegend",classes:ChartLegend_module_css_classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartLegendPayload(payload);const labels=getSeriesLabels(series);const items=filteredPayload.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("legendItem"),onMouseEnter:()=>onHighlight(item.dataKey),onMouseLeave:()=>onHighlight(null),"data-without-color":false===showColor||void 0,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:item.color,size:12,...getStyles("legendItemColor"),withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("p",{...getStyles("legendItemName"),children:labels[item.dataKey]||item.dataKey})]},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,mod:[{position:legendPosition,centered},mod],...getStyles("legend"),...others,children:items})});ChartLegend.displayName="@mantine/charts/ChartLegend";var index_js_=__webpack_require__(7060);var es6_index_js_=__webpack_require__(287);"use client";function PointLabel({x,y,value,valueFormatter}){return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${x},${y})`,children:/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:0,dy:-8,dx:-10,textAnchor:"top",fill:"var(--chart-text-color, var(--mantine-color-dimmed))",fontSize:8,children:valueFormatter?valueFormatter(value):value})})}"use client";function AreaGradient({color,id,withGradient,fillOpacity}){return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:withGradient?/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"0%",stopColor:color,stopOpacity:fillOpacity}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"100%",stopColor:color,stopOpacity:.01})]}):/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{stopColor:color,stopOpacity:fillOpacity??.2})})})}AreaGradient.displayName="@mantine/charts/AreaGradient";"use client";function AreaSplit({offset,id,colors,fillOpacity}){const theme=(0,index_mjs_.useMantineTheme)();return/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[0],theme),stopOpacity:fillOpacity??.2}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[1],theme),stopOpacity:fillOpacity??.2})]})}AreaSplit.displayName="@mantine/charts/AreaSplit";"use client";function getSplitOffset({data,dataKey}){const dataMax=Math.max(...data.map(item=>item[dataKey]));const dataMin=Math.min(...data.map(item=>item[dataKey]));if(dataMax<=0)return 0;if(dataMin>=0)return 1;return dataMax/(dataMax-dataMin)}function getDefaultSplitOffset({data,series}){if(1===series.length){const dataKey=series[0].name;return getSplitOffset({data,dataKey})}return .5}"use client";var grid_chart_module_css_classes={root:"m_a50f3e58",container:"m_af9188cb",grid:"m_a50a48bc",axis:"m_a507a517",axisLabel:"m_2293801d",tooltip:"m_92b296cd"};"use client";function valueToPercent(value){return`${(100*value).toFixed(0)}%`}const AreaChart_defaultProps={withXAxis:true,withYAxis:true,withDots:true,withTooltip:true,connectNulls:true,strokeWidth:2,tooltipAnimationDuration:0,fillOpacity:.2,tickLine:"y",strokeDasharray:"5 5",curveType:"monotone",gridAxis:"x",type:"default",splitColors:["green.7","red.7"],orientation:"horizontal"};const varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const AreaChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("AreaChart",AreaChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,withGradient,dataKey,withXAxis,withYAxis,curveType,gridProps,withDots,tickLine,strokeDasharray,gridAxis,unit,yAxisProps,xAxisProps,dotProps,activeDotProps,strokeWidth,tooltipAnimationDuration,type,legendProps,tooltipProps,withLegend,withTooltip,areaChartProps,fillOpacity,splitColors,splitOffset,connectNulls,onMouseLeave,orientation,referenceLines,dir,valueFormatter,children,areaProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const baseId=(0,index_js_.useId)();const splitId=`${baseId}-split`;const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const isAnimationActive=(tooltipAnimationDuration||0)>0;const _withGradient="boolean"==typeof withGradient?withGradient:"default"===type;const stacked="stacked"===type||"percent"===type;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"AreaChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver});const dotsAreas=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),activeDot:{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps},dot:{fill:color,fillOpacity:dimmed?0:1,strokeWidth:2,r:4,...dotProps},key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:"none",strokeWidth,stroke:"none",isAnimationActive:false,connectNulls,stackId:stacked?"stack-dots":void 0,yAxisId:item.yAxisId||"left",..."function"==typeof areaProps?areaProps(item):areaProps})});const areas=series.map(item=>{const id=`${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g,"")}`;const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_js_.Fragment,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{color,withGradient:_withGradient,id,fillOpacity})}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{...getStyles("area"),activeDot:false,dot:false,name:item.name,type:curveType,dataKey:item.name,fill:"split"===type?`url(#${splitId})`:`url(#${id})`,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,stackId:stacked?"stack":void 0,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps})]},item.name)});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const tickFormatter="percent"===type?valueToPercent:valueFormatter;const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data,stackOffset:"percent"===type?"expand":void 0,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...areaChartProps,children:[referenceLinesItems,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),"split"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaSplit,{colors:splitColors,id:splitId,offset:splitOffset??getDefaultSplitOffset({data,series}),fillOpacity})}),areas,withDots&&dotsAreas,children]})})})});AreaChart.classes=grid_chart_module_css_classes;AreaChart.displayName="@mantine/charts/AreaChart";"use client";function BarChart_valueToPercent(value){return`${(100*value).toFixed(0)}%`}const BarChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",type:"default"};const BarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor,cursorFill,barLabelColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-cursor-fill":cursorFill?(0,index_mjs_.getThemeColor)(cursorFill,theme):void 0,"--chart-bar-label-color":barLabelColor?(0,index_mjs_.getThemeColor)(barLabelColor,theme):void 0}}));function calculateCumulativeTotal(waterfallData,dataKey){let start=0;let end=0;return waterfallData.map(item=>{if(item.standalone){for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey)item[prop]=[0,item[prop]]}else for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey){end+=item[prop];item[prop]=[start,end];start=end}return item})}function getBarFill(barProps,series){if("function"==typeof barProps)return barProps(series).fill;return barProps?.fill}const BarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BarChart",BarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,fillOpacity,barChartProps,type,orientation,dir,valueFormatter,children,barProps,xAxisLabel,yAxisLabel,withBarValueLabel,valueLabelProps,withRightYAxis,rightYAxisLabel,rightYAxisProps,minBarSize,maxBarWidth,mod,getBarColor,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const stacked="stacked"===type||"percent"===type;const tickFormatter="percent"===type?BarChart_valueToPercent:valueFormatter;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const inputData="waterfall"===type?calculateCumulativeTotal(data,dataKey):data;const getStyles=(0,index_mjs_.useStyles)({name:"BarChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BarChart_varsResolver});const bars=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:fillOpacity,strokeOpacity:dimmed?.2:0,stackId:stacked?"stack":item.stackId||void 0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},inputData.map((entry,index)=>{const cellColor=entry.color?(0,index_mjs_.getThemeColor)(entry.color,theme):"function"==typeof getBarColor?(0,index_mjs_.getThemeColor)(getBarColor(entry[item.name],item),theme):getBarFill(barProps,item)||color;return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:cellColor},`cell-${index}`)}),withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"vertical"===orientation?"right":"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>tickFormatter?.(val),..."function"==typeof valueLabelProps?valueLabelProps(item):valueLabelProps}))});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",mod:[{orientation},mod],...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.BarChart,{data:inputData,stackOffset:"percent"===type?"expand":void 0,layout:orientation,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...barChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"waterfall"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray,fill:"var(--chart-cursor-fill)"},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,type:"waterfall"===type?"scatter":void 0,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),bars,referenceLinesItems,children]})})})});BarChart.displayName="@mantine/charts/BarChart";BarChart.classes=grid_chart_module_css_classes;var esm_index_mjs_=__webpack_require__(8403);"use client";const LineChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone",gradientStops:[{offset:0,color:"red"},{offset:100,color:"blue"}]};const LineChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const LineChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("LineChart",LineChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,lineChartProps,connectNulls,fillOpacity,curveType,orientation,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,type,gradientStops,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,attributes,gridColor,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"LineChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:LineChart_varsResolver});const id=(0,esm_index_mjs_.useId)();const gradientId=`line-chart-gradient-${id}`;const stops=gradientStops?.map(stop=>/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:`${stop.offset}%`,stopColor:(0,index_mjs_.getThemeColor)(stop.color,theme)},stop.color));const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...dotProps}:false,activeDot:withDots?{fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...activeDotProps}:false,fill:color,stroke:"gradient"===type?`url(#${gradientId})`:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:fillOpacity,strokeOpacity:dimmed?.5:fillOpacity,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps})});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.LineChart,{data,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...lineChartProps,children:["gradient"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id:gradientId,x1:"0",y1:"0",x2:"0",y2:"1",children:stops})}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"gradient"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?valueFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,showColor:"gradient"!==type,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});LineChart.displayName="@mantine/charts/LineChart";LineChart.classes=grid_chart_module_css_classes;"use client";const Sparkline_classes={};const Sparkline_defaultProps={withGradient:true,connectNulls:true,fillOpacity:.6,strokeWidth:2,curveType:"linear"};function getTrendColor(data,trendColors){const first=data[0];const last=data[data.length-1];if(null===first||null===last)return trendColors.neutral||trendColors.positive;if(first<last)return trendColors.positive;if(first>last)return trendColors.negative;return trendColors.neutral||trendColors.positive}const Sparkline_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{color,data,trendColors})=>({root:{"--chart-color":trendColors?(0,index_mjs_.getThemeColor)(getTrendColor(data,trendColors),theme):color?(0,index_mjs_.getThemeColor)(color,theme):void 0}}));const Sparkline=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Sparkline",Sparkline_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withGradient,fillOpacity,curveType,strokeWidth,trendColors,connectNulls,areaProps,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Sparkline",classes:Sparkline_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:Sparkline_varsResolver});const id=(0,index_js_.useId)();const mappedData=(0,index_js_.useMemo)(()=>data.map((value,index)=>({value,index})),[data]);return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,dir:"ltr",children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data:mappedData,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{dataKey:"value",type:curveType,fill:`url(#${id})`,stroke:"var(--chart-color, var(--mantine-color-blue-filled))",isAnimationActive:false,connectNulls,strokeWidth,fillOpacity:1,...areaProps}),/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{id,color:"var(--chart-color, var(--mantine-color-blue-filled))",fillOpacity,withGradient})})]})})})});Sparkline.displayName="@mantine/charts/Sparkline";Sparkline.classes=Sparkline_classes;"use client";var DonutChart_module_css_classes={root:"m_a410e613",label:"m_ddb0bfe3"};"use client";const DonutChart_defaultProps={withTooltip:true,withLabelsLine:true,paddingAngle:0,thickness:20,size:160,strokeWidth:1,startAngle:0,endAngle:360,labelsType:"value",tooltipDataSource:"all"};const DonutChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType)return`${(100*(percent||0)).toFixed(0)}%`;if("function"==typeof valueFormatter)return valueFormatter(value||0);return value};const getLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:getLabelValue(labelsType,value,percent,valueFormatter)})});const DonutChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("DonutChart",DonutChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,thickness,strokeWidth,startAngle,endAngle,tooltipDataSource,chartLabel,children,pieChartProps,valueFormatter,strokeColor,labelsType,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"DonutChart",classes:DonutChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:DonutChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:size/2-thickness,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?getLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),chartLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",...getStyles("label"),children:chartLabel}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});DonutChart.displayName="@mantine/charts/DonutChart";DonutChart.classes=DonutChart_module_css_classes;"use client";var PieChart_module_css_classes={root:"m_cd8943fd"};"use client";const PieChart_defaultProps={withTooltip:false,withLabelsLine:true,paddingAngle:0,size:160,strokeWidth:1,startAngle:0,endAngle:360,tooltipDataSource:"all",labelsPosition:"outside",labelsType:"value"};const PieChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size,labelsPosition})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels&&"outside"===labelsPosition?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const PieChart_getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType&&"number"==typeof percent)return`${(100*percent).toFixed(0)}%`;if("function"==typeof valueFormatter&&"number"==typeof value)return valueFormatter(value);return value};const getInsideLabel=(labelsType,valueFormatter)=>({cx,cy,midAngle,innerRadius,outerRadius,value,percent})=>{const RADIAN=Math.PI/180;const radius=innerRadius+(outerRadius-innerRadius)*.5;const x=cx+radius*Math.cos(-(midAngle||0)*RADIAN);const y=cy+radius*Math.sin(-(midAngle||0)*RADIAN);return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,textAnchor:x>cx?"start":"end",dominantBaseline:"central",className:PieChart_module_css_classes.label,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})};const getOutsideLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})});const PieChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("PieChart",PieChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,strokeWidth,startAngle,endAngle,tooltipDataSource,children,pieChartProps,labelsPosition,valueFormatter,labelsType,strokeColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"PieChart",classes:PieChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:PieChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:0,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?"inside"===labelsPosition?getInsideLabel(labelsType||"value",valueFormatter):getOutsideLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine&&"outside"===labelsPosition?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});PieChart.displayName="@mantine/charts/PieChart";PieChart.classes=PieChart_module_css_classes;"use client";var RadarChart_module_css_classes={root:"m_1f271cf7",container:"m_cf06f58c"};"use client";const RadarChart_defaultProps={withPolarGrid:true,withPolarAngleAxis:true,withPolarRadiusAxis:false,withTooltip:false,withDots:false,tooltipAnimationDuration:0};const RadarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{gridColor,textColor})=>({root:{"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0}}));const RadarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadarChart",RadarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,dataKey,gridColor,textColor,radarProps,radarChartProps,polarGridProps,polarAngleAxisProps,polarRadiusAxisProps,tooltipProps,withPolarGrid,withPolarAngleAxis,withPolarRadiusAxis,withTooltip,tooltipAnimationDuration,children,withLegend,withDots,dotProps,activeDotProps,legendProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"RadarChart",classes:RadarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadarChart_varsResolver});const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const radars=series.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Radar,{name:item.name,dataKey:item.name,stroke:(0,index_mjs_.getThemeColor)(item.strokeColor||item.color,theme),fill:(0,index_mjs_.getThemeColor)(item.color,theme),fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||.4:.05:item.opacity||.4,dot:withDots?{fillOpacity:1,strokeOpacity:0,strokeWidth:1,fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...dotProps}:false,activeDot:withDots?{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...activeDotProps}:false,strokeOpacity:highlightedArea?highlightedArea===item.name?1:.1:1,isAnimationActive:false,..."function"==typeof radarProps?radarProps(item):radarProps},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadarChart,{data,...radarChartProps,children:[withPolarGrid&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarGrid,{stroke:"var(--chart-grid-color)",...polarGridProps}),withPolarAngleAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarAngleAxis,{dataKey,...polarAngleAxisProps}),withPolarRadiusAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarRadiusAxis,{stroke:"var(--chart-grid-color)",...polarRadiusAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...tooltipProps}),radars,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,series,centered:true,attributes}),...legendProps}),children]})})})});RadarChart.displayName="@mantine/charts/RadarChart";RadarChart.classes=RadarChart_module_css_classes;"use client";function getAxis(key,dataKey){return key===dataKey.x?"x":"y"}const ScatterChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x"};const ScatterChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const ScatterChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ScatterChart",ScatterChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,referenceLines,dir,withLegend,withTooltip,withXAxis,withYAxis,xAxisProps,yAxisProps,orientation,scatterChartProps,legendProps,data,gridAxis,tickLine,strokeDasharray,gridProps,tooltipAnimationDuration,tooltipProps,children,onMouseLeave,dataKey,textColor,gridColor,xAxisLabel,yAxisLabel,unit,labels,valueFormatter,scatterProps,pointLabels,attributes,...others}=props;const getFormatter=axis=>"function"==typeof valueFormatter?valueFormatter:valueFormatter?.[axis];const xFormatter=getFormatter("x");const yFormatter=getFormatter("y");const theme=(0,index_mjs_.useMantineTheme)();const mappedData=data.map(item=>({...item,data:item.data.map(point=>({...point,name:item.name}))}));const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"ScatterChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:ScatterChart_varsResolver});const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const scatters=mappedData.map((item,index)=>{const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Scatter,{data:item.data,fill:(0,index_mjs_.getThemeColor)(item.color,theme),isAnimationActive:false,fillOpacity:dimmed?.1:1,...scatterProps,children:[pointLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{dataKey:dataKey[pointLabels],fontSize:8,dy:10}),scatterProps?.children]},index)});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...scatterChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{type:"number",hide:!withXAxis,dataKey:dataKey.x,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,unit:unit?.x,tickFormatter:xFormatter,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{type:"number",hide:!withYAxis,axisLine:false,dataKey:dataKey.y,tickLine:withYTickLine?{stroke:"currentColor"}:false,tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},allowDecimals:true,unit:unit?.y,tickFormatter:yFormatter,...getStyles("axis"),...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{type:"scatter",label,payload:labels?payload?.map(item=>({...item,name:labels[getAxis(item.name,dataKey)]||item.name,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})):payload?.map(item=>({...item,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})),classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),...tooltipProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map((item,index)=>({...item,dataKey:data[index].name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),height:44,...legendProps}),referenceLinesItems,scatters]})})})});ScatterChart.displayName="@mantine/charts/ScatterChart";ScatterChart.classes=grid_chart_module_css_classes;"use client";function getDomain(data,key){const values=data.map(item=>item[key]);return[Math.min(...values),Math.max(...values)]}function BubbleChartTooltip({active,payload,getStyles,dataKey,valueFormatter}){if(active&&payload&&payload.length){const data=payload[0]&&payload[0].payload;return/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltip"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:data[dataKey.x]}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:valueFormatter?valueFormatter(data[dataKey.z]):data[dataKey.z]})]})})}return null}const BubbleChart_defaultProps={color:"blue.6",withTooltip:true};const BubbleChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const BubbleChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BubbleChart",BubbleChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,xAxisProps,yAxisProps,zAxisProps,tooltipProps,scatterProps,color,label,withTooltip,dataKey,range,valueFormatter,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"BubbleChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BubbleChart_varsResolver});const yAxisWidth=label?void 0:{width:0};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.XAxis,{type:"category",dataKey:dataKey.x,interval:0,tick:{fontSize:12,fill:"currentColor"},tickLine:{transform:"translate(0, -6)",stroke:"currentColor"},stroke:"currentColor",...getStyles("axis"),...xAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.YAxis,{type:"number",dataKey:dataKey.y,height:10,...yAxisWidth,tick:false,tickLine:false,axisLine:false,label:{value:label,position:"insideRight",fontSize:12,fill:"currentColor"},...getStyles("axis"),...yAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ZAxis,{type:"number",dataKey:dataKey.z,domain:getDomain(data,dataKey.z),range,...zAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:100,isAnimationActive:false,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:"3 3"},content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(BubbleChartTooltip,{dataKey,active:payload.active,payload:payload.payload,getStyles,valueFormatter}),...tooltipProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Scatter,{data,fill:(0,index_mjs_.getThemeColor)(color,theme),isAnimationActive:false,...scatterProps})]})})})});BubbleChart.displayName="@mantine/charts/BubbleChart";BubbleChart.classes=grid_chart_module_css_classes;"use client";const CompositeChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone"};const CompositeChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const CompositeChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("CompositeChart",CompositeChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,connectNulls,curveType,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,areaProps,barProps,withBarValueLabel,minBarSize,maxBarWidth,composedChartProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"CompositeChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:CompositeChart_varsResolver});const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;if("line"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:"var(--mantine-color-white)",stroke:color,...activeDotProps}:false,fill:color,stroke:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps});if("area"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:color,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps}:false,fillOpacity:dimmed?0:.2,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps});if("bar"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:1,strokeOpacity:dimmed?.2:0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>valueFormatter?.(val)}));return null});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,type:"number",tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ComposedChart,{data,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...composedChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,dataKey,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});CompositeChart.displayName="@mantine/charts/CompositeChart";CompositeChart.classes=grid_chart_module_css_classes;"use client";var RadialBarChart_module_css_classes={root:"m_cd2bd9e5",tooltip:"m_6bcc3420"};"use client";const RadialBarChart_defaultProps={barSize:20,startAngle:90,endAngle:-270,withBackground:true,withTooltip:true};const RadialBarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{emptyBackgroundColor})=>({root:{"--chart-empty-background":emptyBackgroundColor?(0,index_mjs_.getThemeColor)(emptyBackgroundColor,theme):void 0}}));const RadialBarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadialBarChart",RadialBarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,barSize,withBackground,dataKey,radialBarProps,radialBarChartProps,withLabels,withLegend,legendProps,withTooltip,tooltipProps,startAngle,endAngle,attributes,...others}=props;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const getStyles=(0,index_mjs_.useStyles)({name:"RadialBarChart",classes:RadialBarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadialBarChart_varsResolver});const theme=(0,index_mjs_.useMantineTheme)();const dataWithResolvedColor=data.map(({color,...item})=>{const resolvedColor=(0,index_mjs_.getThemeColor)(color,theme);return{...item,fill:resolvedColor,fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||1:.05:item.opacity||1}});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadialBarChart,{margin:{top:0,bottom:0,left:0,right:0},innerRadius:"10%",outerRadius:"100%",cx:"50%",cy:"50%",barSize,startAngle,endAngle,data:dataWithResolvedColor,...radialBarChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.RadialBar,{label:withLabels?{position:"insideStart",fill:"var(--mantine-color-white)",fontSize:12}:void 0,background:withBackground?{fill:"var(--chart-empty-background)"}:void 0,dataKey,isAnimationActive:false,...radialBarProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map(item=>({...item,dataKey:item.payload?.name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,centered:true,attributes}),...legendProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:0,isAnimationActive:false,cursor:{stroke:"var(--chart-cursor-color)"},content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Paper,{...getStyles("tooltip"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"sm",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:payload?.[0]?.payload.fill,size:12,withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload.name})]}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload[dataKey]})]}),...tooltipProps})]})})})});RadialBarChart.displayName="@mantine/core/RadialBarChart";RadialBarChart.classes=RadialBarChart_module_css_classes;"use client";var FunnelChart_module_css_classes={root:"m_80d531e7"};"use client";const FunnelChart_defaultProps={withTooltip:true,size:300,strokeWidth:1,withLabels:false,labelsPosition:"right",tooltipDataSource:"all"};const FunnelChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":(0,index_mjs_.rem)(size)}}));const FunnelChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("FunnelChart",FunnelChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,strokeWidth,withLabels,size,valueFormatter,children,funnelChartProps,funnelProps,labelsPosition,tooltipDataSource,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"FunnelChart",classes:FunnelChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:FunnelChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.FunnelChart,{...funnelChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Funnel,{data,dataKey:"value",isAnimationActive:false,stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth,...funnelProps,children:[withLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:labelsPosition,fill:"inside"===labelsPosition?"var(--chart-labels-color, var(--mantine-color-white))":"var(--chart-labels-color, var(--mantine-color-dimmed))",stroke:"none",fontFamily:"var(--mantine-font-family)",fontSize:14,dataKey:entry=>"function"==typeof valueFormatter?valueFormatter(entry.value):entry.value}),data.map((entry,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(entry.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index))]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});FunnelChart.displayName="@mantine/charts/FunnelChart";FunnelChart.classes=FunnelChart_module_css_classes;"use client";function getBoundaries({data,domain}){if(Array.isArray(domain))return domain;const values=Object.values(data);return[Math.min(...values),Math.max(...values)]}"use client";function getColumns(datesRange,splitMonths){if(!splitMonths)return datesRange.map((week,weekIndex)=>{const firstDay=week.find(d=>null!==d);const month=new Date(firstDay).getMonth();return{type:"column",month,weekIndex}});const tmp=[];datesRange.forEach((week,weekIndex)=>{const months=week.map(d=>d?new Date(d).getMonth():null);let firstMonth=null;let boundaryIndex=null;for(let i=0;i<months.length;i+=1)if(null!==months[i]){if(null===firstMonth)firstMonth=months[i];else if(months[i]!==firstMonth){boundaryIndex=i;break}}if(null===firstMonth)return;if(null===boundaryIndex)tmp.push({type:"column",month:firstMonth,weekIndex});else{let nextMonth=null;for(let i=boundaryIndex;i<months.length;i+=1)if(null!==months[i]){nextMonth=months[i];break}if(null===nextMonth)tmp.push({type:"column",month:firstMonth,weekIndex});else{tmp.push({type:"column",month:firstMonth,weekIndex});tmp.push({type:"column",month:nextMonth,weekIndex})}}});const columns=[];for(let i=0;i<tmp.length;i+=1){if(i>0&&tmp[i].month!==tmp[i-1].month)columns.push({type:"spacer"});columns.push(tmp[i])}return columns}function getFirstMonthColumnIndex(columns,month){for(let i=0;i<columns.length;i+=1){const c=columns[i];if("column"===c.type&&c.month===month)return i}return -1}"use client";function formatDate(date){return date.toISOString().split("T")[0]}function addDays(date,days){return new Date(date.getTime()+864e5*days)}function startOfWeek(date,firstDayOfWeek){let value=new Date(date);while(value.getDay()!==firstDayOfWeek)value=addDays(value,-1);return value}function endOfWeek(date,firstDayOfWeek){const day=date.getDay();const diff=(day<firstDayOfWeek?7:0)+day-firstDayOfWeek;return addDays(date,6-diff)}function getDatesRange({startDate,endDate,withOutsideDates=true,firstDayOfWeek=1}={}){const start=startDate?new Date(startDate):new Date(/* @__PURE__ */new Date().getFullYear()-1,/* @__PURE__ */new Date().getMonth(),/* @__PURE__ */new Date().getDate());const end=endDate?new Date(endDate):/* @__PURE__ */new Date;const startWeek=startOfWeek(start,firstDayOfWeek);const endWeek=endOfWeek(end,firstDayOfWeek);const dates=[];let current=startWeek;while(current<=endWeek){const week=Array.from({length:7},(_,i)=>{const day=addDays(current,i);return withOutsideDates||day>=start&&day<=end?formatDate(day):null});dates.push(week);current=addDays(current,7)}return dates}"use client";function getMonthsRange(weeksData){let position=0;let current=null;const result=[];weeksData.forEach(week=>{const day=null===week[0]?week[week.length-1]:week[0];const month=new Date(day).getMonth();if(current!==month){current=month;result.push({month:current,position,size:0})}result[result.length-1].size+=1;position+=1});return result}"use client";function getHeatColor({value,min,max,colors}){const percent=(value-min)/(max-min);const colorIndex=Math.round((colors.length-1)*percent);return colors[colorIndex]}"use client";function HeatmapSplitWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;const columns=getColumns(datesRange,true);return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:columns.map((col,columnIndex)=>{if("spacer"===col.type)return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`},`spacer-${columnIndex}`);const week=datesRange[col.weekIndex];const days=week.map((date,dayIndex)=>{if(!date)return null;if(new Date(date).getMonth()!==col.month)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},`${date}-${col.month}`)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},`col-${col.weekIndex}-${col.month}-${columnIndex}`)})})}"use client";function HeatmapWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:datesRange.map((week,weekIndex)=>{const days=week.map((date,dayIndex)=>{if(!date)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},date)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${weekIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},weekIndex)})})}"use client";function rotateWeekdaysNames(weekdayNames,firstDayOfWeek){const rotated=[...weekdayNames];for(let i=0;i<firstDayOfWeek;i+=1)rotated.push(rotated.shift());return rotated}"use client";var Heatmap_module_css_classes={root:"m_2ef228c3",rect:"m_2ef201c5",monthLabel:"m_7e977775",weekdayLabel:"m_c4b68f8d"};"use client";const Heatmap_defaultProps={monthLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdayLabels:["Sun","Mon","","Wed","","Fri",""],withOutsideDates:true,firstDayOfWeek:1,rectSize:10,weekdaysLabelsWidth:30,monthsLabelsHeight:14,gap:1,rectRadius:2,fontSize:12,colors:["var(--heatmap-level-1)","var(--heatmap-level-2)","var(--heatmap-level-3)","var(--heatmap-level-4)"]};const Heatmap=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Heatmap",Heatmap_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,startDate,endDate,withMonthLabels,withWeekdayLabels,weekdayLabels,withOutsideDates,monthLabels,firstDayOfWeek,rectSize=10,gap=1,rectRadius,domain,colors,weekdaysLabelsWidth,monthsLabelsHeight,fontSize,getTooltipLabel,withTooltip,tooltipProps,getRectProps,splitMonths,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Heatmap",classes:Heatmap_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars});const[hoveredRect,setHoveredRect]=(0,index_js_.useState)(null);const rectSizeWithGap=rectSize+gap;const weekdaysOffset=withWeekdayLabels?weekdaysLabelsWidth:0;const monthsOffset=withMonthLabels?monthsLabelsHeight:0;const[min,max]=getBoundaries({data,domain});const rotatedWeekdayLabels=(0,index_js_.useMemo)(()=>rotateWeekdaysNames(weekdayLabels,firstDayOfWeek),[weekdayLabels,firstDayOfWeek]);const datesRange=getDatesRange({startDate,endDate,withOutsideDates,firstDayOfWeek});const monthsRange=withMonthLabels||splitMonths?getMonthsRange(datesRange):[];const weeksProps={data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles};const weeks=splitMonths?/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapSplitWeeks,{...weeksProps}):/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapWeeks,{...weeksProps});const totalColumns=splitMonths?getColumns(datesRange,splitMonths).length:datesRange.length;const computeMonthLabelX=(monthPosition,monthIndex)=>{if(!splitMonths)return monthPosition*rectSizeWithGap+gap+weekdaysOffset;const firstMonth=monthsRange[monthIndex];const columns=getColumns(datesRange,splitMonths);const i=getFirstMonthColumnIndex(columns,firstMonth.month);const base=i>=0?i:monthPosition;return(base+1)*rectSizeWithGap+gap+weekdaysOffset};const monthsLabelsNodes=withMonthLabels&&monthLabels?monthsRange.map((month,monthIndex)=>{const minSize=splitMonths?2:3;if(month.size<minSize)return null;const monthLabel=monthLabels[month.month];return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:computeMonthLabelX(month.position,monthIndex),y:monthsLabelsHeight-4,width:month.size*rectSizeWithGap,fontSize,...getStyles("monthLabel"),children:monthLabel},monthIndex)}):null;const weekdayLabelsNodes=withWeekdayLabels&&weekdayLabels?rotatedWeekdayLabels.map((weekdayLabel,dayIndex)=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:(dayIndex+1)*rectSizeWithGap-gap+monthsOffset,width:weekdaysLabelsWidth,fontSize,...getStyles("weekdayLabel"),children:weekdayLabel},dayIndex)):null;const label=getTooltipLabel&&hoveredRect&&withTooltip?getTooltipLabel(hoveredRect):null;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{component:"svg",ref,width:rectSizeWithGap*totalColumns+gap+weekdaysOffset,height:7*rectSizeWithGap+gap+monthsOffset,...getStyles("root"),...others,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Tooltip.Floating,{label,disabled:!withTooltip||!label,position:"top",...tooltipProps,children:/* @__PURE__ */(0,jsx_runtime.jsxs)("g",{transform:`translate(${weekdaysOffset}, ${monthsOffset})`,"data-id":"all-weeks",children:[withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{fill:"transparent",width:rectSizeWithGap*totalColumns+gap,height:7*rectSizeWithGap+gap}),weeks]})}),weekdayLabelsNodes,monthsLabelsNodes]})});Heatmap.displayName="@mantine/charts/Heatmap";Heatmap.classes=Heatmap_module_css_classes}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["6702"],{8861:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{AreaChart:()=>AreaChart,BubbleChart:()=>BubbleChart,FunnelChart:()=>FunnelChart,RadialBarChart:()=>RadialBarChart,AreaGradient:()=>AreaGradient,CompositeChart:()=>CompositeChart,ChartTooltip:()=>ChartTooltip,DonutChart:()=>DonutChart,LineChart:()=>LineChart,RadarChart:()=>RadarChart,ChartLegend:()=>ChartLegend,Heatmap:()=>Heatmap,ScatterChart:()=>ScatterChart,PieChart:()=>PieChart,getSplitOffset:()=>getSplitOffset,getFilteredChartLegendPayload:()=>getFilteredChartLegendPayload,BarChart:()=>BarChart,Sparkline:()=>Sparkline,getFilteredChartTooltipPayload:()=>getFilteredChartTooltipPayload});var jsx_runtime=__webpack_require__(4848);var index_mjs_=__webpack_require__(2773);"use client";function getSeriesLabels(series){if(!series)return{};return series.reduce((acc,item)=>{const matchFound=item.name.search(/\./);if(matchFound>=0){const key=item.name.substring(matchFound+1);acc[key]=item.label;return acc}acc[item.name]=item.label;return acc},{})}"use client";var classes={tooltip:"m_e4d36c9b",tooltipLabel:"m_7f4bcb19",tooltipBody:"m_3de554dd",tooltipItemColor:"m_b30369b5",tooltipItem:"m_3de8964e",tooltipItemBody:"m_50186d10",tooltipItemName:"m_501dadf9",tooltipItemData:"m_50192318"};"use client";function updateChartTooltipPayload(payload){return payload.map(item=>{if(!item.payload||item.payload[item.name])return item;const matchFound=item.name.search(/\./);if(matchFound>=0){const newDataKey=item.name.substring(0,matchFound);const nestedPayload={...item.payload[newDataKey]};const shallowPayload=Object.entries(item.payload).reduce((acc,current)=>{const[k,v]=current;return k===newDataKey?acc:{...acc,[k]:v}},{});return{...item,name:item.name.substring(matchFound+1),payload:{...shallowPayload,...nestedPayload}}}return item})}function getFilteredChartTooltipPayload(payload,segmentId){const duplicatesFilter=updateChartTooltipPayload(payload.filter(item=>"none"!==item.fill||!item.color));if(!segmentId)return duplicatesFilter;return duplicatesFilter.filter(item=>item.name===segmentId)}function getData(item,type){if("radial"===type||"scatter"===type){if(Array.isArray(item.value))return item.value[1]-item.value[0];return item.value}if(Array.isArray(item.payload[item.dataKey]))return item.payload[item.dataKey][1]-item.payload[item.dataKey][0];return item.payload[item.name]}const defaultProps={type:"area",showColor:true};const ChartTooltip=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartTooltip",defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,payload,label,unit,type,segmentId,mod,series,valueFormatter,showColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"ChartTooltip",classes:classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartTooltipPayload(payload,segmentId);const scatterLabel="scatter"===type?payload[0]?.payload?.name:null;const labels=getSeriesLabels(series);const _label=label||scatterLabel;const items=filteredPayload.map(item=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{"data-type":type,...getStyles("tooltipItem"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemBody"),children:[showColor&&/* @__PURE__ */(0,jsx_runtime.jsx)("svg",{...getStyles("tooltipItemColor"),children:/* @__PURE__ */(0,jsx_runtime.jsx)("circle",{r:6,fill:(0,index_mjs_.getThemeColor)(item.color,theme),width:12,height:12,cx:6,cy:6})}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipItemName"),children:labels[item.name]||item.name})]}),/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("tooltipItemData"),children:["function"==typeof valueFormatter?valueFormatter(getData(item,type)):getData(item,type),unit||item.unit]})]},item?.key??item.name));return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{...getStyles("tooltip"),mod:[{type},mod],ref,...others,children:[_label&&/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipLabel"),children:_label}),/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltipBody"),children:items})]})});ChartTooltip.displayName="@mantine/charts/ChartTooltip";"use client";var ChartLegend_module_css_classes={legend:"m_847eaf",legendItem:"m_17da7e62",legendItemColor:"m_6e236e21",legendItemName:"m_8ff56c0d"};"use client";function updateChartLegendPayload(payload){return payload.map(item=>{const newDataKey=item.dataKey?.split(".").pop();return{...item,dataKey:newDataKey,payload:{...item.payload,name:newDataKey,dataKey:newDataKey}}})}function getFilteredChartLegendPayload(payload){return updateChartLegendPayload(payload.filter(item=>"none"!==item.color))}const ChartLegend=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ChartLegend",null,_props);const{classNames,className,style,styles,unstyled,vars,payload,onHighlight,legendPosition,mod,series,showColor,centered,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"ChartLegend",classes:ChartLegend_module_css_classes,props,className,style,classNames,styles,unstyled,attributes});if(!payload)return null;const filteredPayload=getFilteredChartLegendPayload(payload);const labels=getSeriesLabels(series);const items=filteredPayload.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsxs)("div",{...getStyles("legendItem"),onMouseEnter:()=>onHighlight(item.dataKey),onMouseLeave:()=>onHighlight(null),"data-without-color":false===showColor||void 0,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:item.color,size:12,...getStyles("legendItemColor"),withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("p",{...getStyles("legendItemName"),children:labels[item.dataKey]||item.dataKey})]},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,mod:[{position:legendPosition,centered},mod],...getStyles("legend"),...others,children:items})});ChartLegend.displayName="@mantine/charts/ChartLegend";var index_js_=__webpack_require__(8556);var es6_index_js_=__webpack_require__(973);"use client";function PointLabel({x,y,value,valueFormatter}){return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${x},${y})`,children:/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:0,dy:-8,dx:-10,textAnchor:"top",fill:"var(--chart-text-color, var(--mantine-color-dimmed))",fontSize:8,children:valueFormatter?valueFormatter(value):value})})}"use client";function AreaGradient({color,id,withGradient,fillOpacity}){return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:withGradient?/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"0%",stopColor:color,stopOpacity:fillOpacity}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:"100%",stopColor:color,stopOpacity:.01})]}):/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{stopColor:color,stopOpacity:fillOpacity??.2})})})}AreaGradient.displayName="@mantine/charts/AreaGradient";"use client";function AreaSplit({offset,id,colors,fillOpacity}){const theme=(0,index_mjs_.useMantineTheme)();return/* @__PURE__ */(0,jsx_runtime.jsxs)("linearGradient",{id,x1:"0",y1:"0",x2:"0",y2:"1",children:[/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[0],theme),stopOpacity:fillOpacity??.2}),/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset,stopColor:(0,index_mjs_.getThemeColor)(colors[1],theme),stopOpacity:fillOpacity??.2})]})}AreaSplit.displayName="@mantine/charts/AreaSplit";"use client";function getSplitOffset({data,dataKey}){const dataMax=Math.max(...data.map(item=>item[dataKey]));const dataMin=Math.min(...data.map(item=>item[dataKey]));if(dataMax<=0)return 0;if(dataMin>=0)return 1;return dataMax/(dataMax-dataMin)}function getDefaultSplitOffset({data,series}){if(1===series.length){const dataKey=series[0].name;return getSplitOffset({data,dataKey})}return .5}"use client";var grid_chart_module_css_classes={root:"m_a50f3e58",container:"m_af9188cb",grid:"m_a50a48bc",axis:"m_a507a517",axisLabel:"m_2293801d",tooltip:"m_92b296cd"};"use client";function valueToPercent(value){return`${(100*value).toFixed(0)}%`}const AreaChart_defaultProps={withXAxis:true,withYAxis:true,withDots:true,withTooltip:true,connectNulls:true,strokeWidth:2,tooltipAnimationDuration:0,fillOpacity:.2,tickLine:"y",strokeDasharray:"5 5",curveType:"monotone",gridAxis:"x",type:"default",splitColors:["green.7","red.7"],orientation:"horizontal"};const varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const AreaChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("AreaChart",AreaChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,withGradient,dataKey,withXAxis,withYAxis,curveType,gridProps,withDots,tickLine,strokeDasharray,gridAxis,unit,yAxisProps,xAxisProps,dotProps,activeDotProps,strokeWidth,tooltipAnimationDuration,type,legendProps,tooltipProps,withLegend,withTooltip,areaChartProps,fillOpacity,splitColors,splitOffset,connectNulls,onMouseLeave,orientation,referenceLines,dir,valueFormatter,children,areaProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const baseId=(0,index_js_.useId)();const splitId=`${baseId}-split`;const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const isAnimationActive=(tooltipAnimationDuration||0)>0;const _withGradient="boolean"==typeof withGradient?withGradient:"default"===type;const stacked="stacked"===type||"percent"===type;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"AreaChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver});const dotsAreas=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),activeDot:{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps},dot:{fill:color,fillOpacity:dimmed?0:1,strokeWidth:2,r:4,...dotProps},key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:"none",strokeWidth,stroke:"none",isAnimationActive:false,connectNulls,stackId:stacked?"stack-dots":void 0,yAxisId:item.yAxisId||"left",..."function"==typeof areaProps?areaProps(item):areaProps})});const areas=series.map(item=>{const id=`${baseId}-${item.color.replace(/[^a-zA-Z0-9]/g,"")}`;const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_js_.Fragment,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{color,withGradient:_withGradient,id,fillOpacity})}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{...getStyles("area"),activeDot:false,dot:false,name:item.name,type:curveType,dataKey:item.name,fill:"split"===type?`url(#${splitId})`:`url(#${id})`,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,stackId:stacked?"stack":void 0,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps})]},item.name)});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const tickFormatter="percent"===type?valueToPercent:valueFormatter;const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data,stackOffset:"percent"===type?"expand":void 0,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...areaChartProps,children:[referenceLinesItems,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),"split"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaSplit,{colors:splitColors,id:splitId,offset:splitOffset??getDefaultSplitOffset({data,series}),fillOpacity})}),areas,withDots&&dotsAreas,children]})})})});AreaChart.classes=grid_chart_module_css_classes;AreaChart.displayName="@mantine/charts/AreaChart";"use client";function BarChart_valueToPercent(value){return`${(100*value).toFixed(0)}%`}const BarChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",type:"default"};const BarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor,cursorFill,barLabelColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-cursor-fill":cursorFill?(0,index_mjs_.getThemeColor)(cursorFill,theme):void 0,"--chart-bar-label-color":barLabelColor?(0,index_mjs_.getThemeColor)(barLabelColor,theme):void 0}}));function calculateCumulativeTotal(waterfallData,dataKey){let start=0;let end=0;return waterfallData.map(item=>{if(item.standalone){for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey)item[prop]=[0,item[prop]]}else for(const prop in item)if("number"==typeof item[prop]&&prop!==dataKey){end+=item[prop];item[prop]=[start,end];start=end}return item})}function getBarFill(barProps,series){if("function"==typeof barProps)return barProps(series).fill;return barProps?.fill}const BarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BarChart",BarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,fillOpacity,barChartProps,type,orientation,dir,valueFormatter,children,barProps,xAxisLabel,yAxisLabel,withBarValueLabel,valueLabelProps,withRightYAxis,rightYAxisLabel,rightYAxisProps,minBarSize,maxBarWidth,mod,getBarColor,gridColor,textColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const stacked="stacked"===type||"percent"===type;const tickFormatter="percent"===type?BarChart_valueToPercent:valueFormatter;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const inputData="waterfall"===type?calculateCumulativeTotal(data,dataKey):data;const getStyles=(0,index_mjs_.useStyles)({name:"BarChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BarChart_varsResolver});const bars=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:fillOpacity,strokeOpacity:dimmed?.2:0,stackId:stacked?"stack":item.stackId||void 0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},inputData.map((entry,index)=>{const cellColor=entry.color?(0,index_mjs_.getThemeColor)(entry.color,theme):"function"==typeof getBarColor?(0,index_mjs_.getThemeColor)(getBarColor(entry[item.name],item),theme):getBarFill(barProps,item)||color;return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:cellColor},`cell-${index}`)}),withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"vertical"===orientation?"right":"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>tickFormatter?.(val),..."function"==typeof valueLabelProps?valueLabelProps(item):valueLabelProps}))});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:tickFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",mod:[{orientation},mod],...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.BarChart,{data:inputData,stackOffset:"percent"===type?"expand":void 0,layout:orientation,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...barChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"waterfall"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?tickFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray,fill:"var(--chart-cursor-fill)"},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,type:"waterfall"===type?"scatter":void 0,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),bars,referenceLinesItems,children]})})})});BarChart.displayName="@mantine/charts/BarChart";BarChart.classes=grid_chart_module_css_classes;var esm_index_mjs_=__webpack_require__(2667);"use client";const LineChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,fillOpacity:1,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone",gradientStops:[{offset:0,color:"red"},{offset:100,color:"blue"}]};const LineChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const LineChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("LineChart",LineChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,lineChartProps,connectNulls,fillOpacity,curveType,orientation,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,type,gradientStops,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,attributes,gridColor,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"LineChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:LineChart_varsResolver});const id=(0,esm_index_mjs_.useId)();const gradientId=`line-chart-gradient-${id}`;const stops=gradientStops?.map(stop=>/* @__PURE__ */(0,jsx_runtime.jsx)("stop",{offset:`${stop.offset}%`,stopColor:(0,index_mjs_.getThemeColor)(stop.color,theme)},stop.color));const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...dotProps}:false,activeDot:withDots?{fill:"gradient"===type?"var(--mantine-color-gray-7)":color,stroke:"gradient"===type?"white":color,...activeDotProps}:false,fill:color,stroke:"gradient"===type?`url(#${gradientId})`:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:fillOpacity,strokeOpacity:dimmed?.5:fillOpacity,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps})});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,..."vertical"===orientation?{dataKey,type:"category"}:{type:"number"},tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:"vertical"===orientation?void 0:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.LineChart,{data,layout:orientation,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...lineChartProps,children:["gradient"===type&&/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)("linearGradient",{id:gradientId,x1:"0",y1:"0",x2:"0",y2:"1",children:stops})}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,showColor:"gradient"!==type,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,..."vertical"===orientation?{type:"number"}:{dataKey},tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,tickFormatter:"vertical"===orientation?valueFormatter:void 0,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:"vertical"===orientation?{}:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,showColor:"gradient"!==type,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});LineChart.displayName="@mantine/charts/LineChart";LineChart.classes=grid_chart_module_css_classes;"use client";const Sparkline_classes={};const Sparkline_defaultProps={withGradient:true,connectNulls:true,fillOpacity:.6,strokeWidth:2,curveType:"linear"};function getTrendColor(data,trendColors){const first=data[0];const last=data[data.length-1];if(null===first||null===last)return trendColors.neutral||trendColors.positive;if(first<last)return trendColors.positive;if(first>last)return trendColors.negative;return trendColors.neutral||trendColors.positive}const Sparkline_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{color,data,trendColors})=>({root:{"--chart-color":trendColors?(0,index_mjs_.getThemeColor)(getTrendColor(data,trendColors),theme):color?(0,index_mjs_.getThemeColor)(color,theme):void 0}}));const Sparkline=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Sparkline",Sparkline_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withGradient,fillOpacity,curveType,strokeWidth,trendColors,connectNulls,areaProps,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Sparkline",classes:Sparkline_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:Sparkline_varsResolver});const id=(0,index_js_.useId)();const mappedData=(0,index_js_.useMemo)(()=>data.map((value,index)=>({value,index})),[data]);return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,dir:"ltr",children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.AreaChart,{data:mappedData,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Area,{dataKey:"value",type:curveType,fill:`url(#${id})`,stroke:"var(--chart-color, var(--mantine-color-blue-filled))",isAnimationActive:false,connectNulls,strokeWidth,fillOpacity:1,...areaProps}),/* @__PURE__ */(0,jsx_runtime.jsx)("defs",{children:/* @__PURE__ */(0,jsx_runtime.jsx)(AreaGradient,{id,color:"var(--chart-color, var(--mantine-color-blue-filled))",fillOpacity,withGradient})})]})})})});Sparkline.displayName="@mantine/charts/Sparkline";Sparkline.classes=Sparkline_classes;"use client";var DonutChart_module_css_classes={root:"m_a410e613",label:"m_ddb0bfe3"};"use client";const DonutChart_defaultProps={withTooltip:true,withLabelsLine:true,paddingAngle:0,thickness:20,size:160,strokeWidth:1,startAngle:0,endAngle:360,labelsType:"value",tooltipDataSource:"all"};const DonutChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType)return`${(100*(percent||0)).toFixed(0)}%`;if("function"==typeof valueFormatter)return valueFormatter(value||0);return value};const getLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:getLabelValue(labelsType,value,percent,valueFormatter)})});const DonutChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("DonutChart",DonutChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,thickness,strokeWidth,startAngle,endAngle,tooltipDataSource,chartLabel,children,pieChartProps,valueFormatter,strokeColor,labelsType,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"DonutChart",classes:DonutChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:DonutChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:size/2-thickness,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?getLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),chartLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:"50%",y:"50%",textAnchor:"middle",dominantBaseline:"middle",...getStyles("label"),children:chartLabel}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});DonutChart.displayName="@mantine/charts/DonutChart";DonutChart.classes=DonutChart_module_css_classes;"use client";var PieChart_module_css_classes={root:"m_cd8943fd"};"use client";const PieChart_defaultProps={withTooltip:false,withLabelsLine:true,paddingAngle:0,size:160,strokeWidth:1,startAngle:0,endAngle:360,tooltipDataSource:"all",labelsPosition:"outside",labelsType:"value"};const PieChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,withLabels,size,labelsPosition})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":withLabels&&"outside"===labelsPosition?(0,index_mjs_.rem)(size+80):(0,index_mjs_.rem)(size)}}));const PieChart_getLabelValue=(labelsType,value,percent,valueFormatter)=>{if("percent"===labelsType&&"number"==typeof percent)return`${(100*percent).toFixed(0)}%`;if("function"==typeof valueFormatter&&"number"==typeof value)return valueFormatter(value);return value};const getInsideLabel=(labelsType,valueFormatter)=>({cx,cy,midAngle,innerRadius,outerRadius,value,percent})=>{const RADIAN=Math.PI/180;const radius=innerRadius+(outerRadius-innerRadius)*.5;const x=cx+radius*Math.cos(-(midAngle||0)*RADIAN);const y=cy+radius*Math.sin(-(midAngle||0)*RADIAN);return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,textAnchor:x>cx?"start":"end",dominantBaseline:"central",className:PieChart_module_css_classes.label,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})};const getOutsideLabel=(labelsType,valueFormatter)=>({x,y,cx,cy,percent,value})=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x,y,cx,cy,textAnchor:x>cx?"start":"end",fill:"var(--chart-labels-color, var(--mantine-color-dimmed))",fontFamily:"var(--mantine-font-family)",fontSize:12,children:/* @__PURE__ */(0,jsx_runtime.jsx)("tspan",{x,children:PieChart_getLabelValue(labelsType,value,percent,valueFormatter)})});const PieChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("PieChart",PieChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,pieProps,paddingAngle,withLabels,withLabelsLine,size,strokeWidth,startAngle,endAngle,tooltipDataSource,children,pieChartProps,labelsPosition,valueFormatter,labelsType,strokeColor,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"PieChart",classes:PieChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:PieChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const cells=data.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.PieChart,{...pieChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Pie,{data,innerRadius:0,outerRadius:size/2,dataKey:"value",isAnimationActive:false,paddingAngle,startAngle,endAngle,label:withLabels?"inside"===labelsPosition?getInsideLabel(labelsType||"value",valueFormatter):getOutsideLabel(labelsType||"value",valueFormatter):false,labelLine:withLabelsLine&&"outside"===labelsPosition?{stroke:"var(--chart-label-color, var(--mantine-color-dimmed))",strokeWidth:1}:false,...pieProps,children:cells}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});PieChart.displayName="@mantine/charts/PieChart";PieChart.classes=PieChart_module_css_classes;"use client";var RadarChart_module_css_classes={root:"m_1f271cf7",container:"m_cf06f58c"};"use client";const RadarChart_defaultProps={withPolarGrid:true,withPolarAngleAxis:true,withPolarRadiusAxis:false,withTooltip:false,withDots:false,tooltipAnimationDuration:0};const RadarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{gridColor,textColor})=>({root:{"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0,"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0}}));const RadarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadarChart",RadarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,series,dataKey,gridColor,textColor,radarProps,radarChartProps,polarGridProps,polarAngleAxisProps,polarRadiusAxisProps,tooltipProps,withPolarGrid,withPolarAngleAxis,withPolarRadiusAxis,withTooltip,tooltipAnimationDuration,children,withLegend,withDots,dotProps,activeDotProps,legendProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"RadarChart",classes:RadarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadarChart_varsResolver});const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const radars=series.map((item,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Radar,{name:item.name,dataKey:item.name,stroke:(0,index_mjs_.getThemeColor)(item.strokeColor||item.color,theme),fill:(0,index_mjs_.getThemeColor)(item.color,theme),fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||.4:.05:item.opacity||.4,dot:withDots?{fillOpacity:1,strokeOpacity:0,strokeWidth:1,fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...dotProps}:false,activeDot:withDots?{fill:(0,index_mjs_.getThemeColor)(item.color,theme),stroke:(0,index_mjs_.getThemeColor)(item.color,theme),...activeDotProps}:false,strokeOpacity:highlightedArea?highlightedArea===item.name?1:.1:1,isAnimationActive:false,..."function"==typeof radarProps?radarProps(item):radarProps},index));return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadarChart,{data,...radarChartProps,children:[withPolarGrid&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarGrid,{stroke:"var(--chart-grid-color)",...polarGridProps}),withPolarAngleAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarAngleAxis,{dataKey,...polarAngleAxisProps}),withPolarRadiusAxis&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.PolarRadiusAxis,{stroke:"var(--chart-grid-color)",...polarRadiusAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...tooltipProps}),radars,withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,series,centered:true,attributes}),...legendProps}),children]})})})});RadarChart.displayName="@mantine/charts/RadarChart";RadarChart.classes=RadarChart_module_css_classes;"use client";function getAxis(key,dataKey){return key===dataKey.x?"x":"y"}const ScatterChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x"};const ScatterChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const ScatterChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("ScatterChart",ScatterChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,referenceLines,dir,withLegend,withTooltip,withXAxis,withYAxis,xAxisProps,yAxisProps,orientation,scatterChartProps,legendProps,data,gridAxis,tickLine,strokeDasharray,gridProps,tooltipAnimationDuration,tooltipProps,children,onMouseLeave,dataKey,textColor,gridColor,xAxisLabel,yAxisLabel,unit,labels,valueFormatter,scatterProps,pointLabels,attributes,...others}=props;const getFormatter=axis=>"function"==typeof valueFormatter?valueFormatter:valueFormatter?.[axis];const xFormatter=getFormatter("x");const yFormatter=getFormatter("y");const theme=(0,index_mjs_.useMantineTheme)();const mappedData=data.map(item=>({...item,data:item.data.map(point=>({...point,name:item.name}))}));const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"ScatterChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:ScatterChart_varsResolver});const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const scatters=mappedData.map((item,index)=>{const dimmed=shouldHighlight&&highlightedArea!==item.name;return/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Scatter,{data:item.data,fill:(0,index_mjs_.getThemeColor)(item.color,theme),isAnimationActive:false,fillOpacity:dimmed?.1:1,...scatterProps,children:[pointLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{dataKey:dataKey[pointLabels],fontSize:8,dy:10}),scatterProps?.children]},index)});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...scatterChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{type:"number",hide:!withXAxis,dataKey:dataKey.x,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,unit:unit?.x,tickFormatter:xFormatter,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{type:"number",hide:!withYAxis,axisLine:false,dataKey:dataKey.y,tickLine:withYTickLine?{stroke:"currentColor"}:false,tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},allowDecimals:true,unit:unit?.y,tickFormatter:yFormatter,...getStyles("axis"),...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{type:"scatter",label,payload:labels?payload?.map(item=>({...item,name:labels[getAxis(item.name,dataKey)]||item.name,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})):payload?.map(item=>({...item,value:getFormatter(getAxis(item.name,dataKey))?.(item.value)??item.value})),classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),...tooltipProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map((item,index)=>({...item,dataKey:data[index].name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series:data,attributes}),height:44,...legendProps}),referenceLinesItems,scatters]})})})});ScatterChart.displayName="@mantine/charts/ScatterChart";ScatterChart.classes=grid_chart_module_css_classes;"use client";function getDomain(data,key){const values=data.map(item=>item[key]);return[Math.min(...values),Math.max(...values)]}function BubbleChartTooltip({active,payload,getStyles,dataKey,valueFormatter}){if(active&&payload&&payload.length){const data=payload[0]&&payload[0].payload;return/* @__PURE__ */(0,jsx_runtime.jsx)("div",{...getStyles("tooltip"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:data[dataKey.x]}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:"sm",children:valueFormatter?valueFormatter(data[dataKey.z]):data[dataKey.z]})]})})}return null}const BubbleChart_defaultProps={color:"blue.6",withTooltip:true};const BubbleChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const BubbleChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("BubbleChart",BubbleChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,xAxisProps,yAxisProps,zAxisProps,tooltipProps,scatterProps,color,label,withTooltip,dataKey,range,valueFormatter,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"BubbleChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:BubbleChart_varsResolver});const yAxisWidth=label?void 0:{width:0};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ScatterChart,{children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.XAxis,{type:"category",dataKey:dataKey.x,interval:0,tick:{fontSize:12,fill:"currentColor"},tickLine:{transform:"translate(0, -6)",stroke:"currentColor"},stroke:"currentColor",...getStyles("axis"),...xAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.YAxis,{type:"number",dataKey:dataKey.y,height:10,...yAxisWidth,tick:false,tickLine:false,axisLine:false,label:{value:label,position:"insideRight",fontSize:12,fill:"currentColor"},...getStyles("axis"),...yAxisProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ZAxis,{type:"number",dataKey:dataKey.z,domain:getDomain(data,dataKey.z),range,...zAxisProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:100,isAnimationActive:false,cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray:"3 3"},content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(BubbleChartTooltip,{dataKey,active:payload.active,payload:payload.payload,getStyles,valueFormatter}),...tooltipProps}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Scatter,{data,fill:(0,index_mjs_.getThemeColor)(color,theme),isAnimationActive:false,...scatterProps})]})})})});BubbleChart.displayName="@mantine/charts/BubbleChart";BubbleChart.classes=grid_chart_module_css_classes;"use client";const CompositeChart_defaultProps={withXAxis:true,withYAxis:true,withTooltip:true,tooltipAnimationDuration:0,tickLine:"y",strokeDasharray:"5 5",gridAxis:"x",withDots:true,connectNulls:true,strokeWidth:2,curveType:"monotone"};const CompositeChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{textColor,gridColor})=>({root:{"--chart-text-color":textColor?(0,index_mjs_.getThemeColor)(textColor,theme):void 0,"--chart-grid-color":gridColor?(0,index_mjs_.getThemeColor)(gridColor,theme):void 0}}));const CompositeChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("CompositeChart",CompositeChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withLegend,legendProps,series,onMouseLeave,dataKey,withTooltip,withXAxis,withYAxis,gridAxis,tickLine,xAxisProps,yAxisProps,unit,tooltipAnimationDuration,strokeDasharray,gridProps,tooltipProps,referenceLines,withDots,dotProps,activeDotProps,strokeWidth,connectNulls,curveType,dir,valueFormatter,children,lineProps,xAxisLabel,yAxisLabel,withRightYAxis,rightYAxisLabel,rightYAxisProps,withPointLabels,areaProps,barProps,withBarValueLabel,minBarSize,maxBarWidth,composedChartProps,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const withXTickLine="none"!==gridAxis&&("x"===tickLine||"xy"===tickLine);const withYTickLine="none"!==gridAxis&&("y"===tickLine||"xy"===tickLine);const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const shouldHighlight=null!==highlightedArea;const handleMouseLeave=event=>{setHighlightedArea(null);onMouseLeave?.(event)};const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});const getStyles=(0,index_mjs_.useStyles)({name:"CompositeChart",classes:grid_chart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:CompositeChart_varsResolver});const lines=series.map(item=>{const color=(0,index_mjs_.getThemeColor)(item.color,theme);const dimmed=shouldHighlight&&highlightedArea!==item.name;if("line"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Line,{...getStyles("line"),key:item.name,name:item.name,dataKey:item.name,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:"var(--mantine-color-white)",stroke:color,...activeDotProps}:false,fill:color,stroke:color,strokeWidth,isAnimationActive:false,fillOpacity:dimmed?0:1,strokeOpacity:dimmed?.5:1,connectNulls,type:curveType,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof lineProps?lineProps(item):lineProps});if("area"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Area,{...getStyles("area"),key:item.name,name:item.name,type:curveType,dataKey:item.name,fill:color,strokeWidth,stroke:color,isAnimationActive:false,connectNulls,dot:withDots?{fillOpacity:dimmed?0:1,strokeOpacity:dimmed?0:1,strokeWidth:1,fill:color,stroke:color,...dotProps}:false,activeDot:withDots?{fill:theme.white,stroke:color,strokeWidth:2,r:4,...activeDotProps}:false,fillOpacity:dimmed?0:.2,strokeOpacity:dimmed?.5:1,strokeDasharray:item.strokeDasharray,yAxisId:item.yAxisId||"left",label:withPointLabels?/* @__PURE__ */(0,jsx_runtime.jsx)(PointLabel,{valueFormatter}):void 0,..."function"==typeof areaProps?areaProps(item):areaProps});if("bar"===item.type)return/* @__PURE__ */(0,index_js_.createElement)(es6_index_js_.Bar,{...getStyles("bar"),key:item.name,name:item.name,dataKey:item.name,fill:color,stroke:color,isAnimationActive:false,fillOpacity:dimmed?.1:1,strokeOpacity:dimmed?.2:0,yAxisId:item.yAxisId||"left",minPointSize:minBarSize,..."function"==typeof barProps?barProps(item):barProps},withBarValueLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:"top",fontSize:12,fill:"var(--chart-bar-label-color, var(--mantine-color-dimmed))",formatter:val=>valueFormatter?.(val)}));return null});const referenceLinesItems=referenceLines?.map((line,index)=>{const color=(0,index_mjs_.getThemeColor)(line.color,theme);return/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ReferenceLine,{stroke:line.color?color:"var(--chart-grid-color)",strokeWidth:1,yAxisId:line.yAxisId||"left",...line,label:{value:line.label,fill:line.color?color:"currentColor",fontSize:12,position:line.labelPosition??"insideBottomLeft"},...getStyles("referenceLine")},index)});const sharedYAxisProps={axisLine:false,type:"number",tickLine:withYTickLine?{stroke:"currentColor"}:false,allowDecimals:true,unit,tickFormatter:valueFormatter,...getStyles("axis")};return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),onMouseLeave:handleMouseLeave,dir:dir||"ltr",...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{...getStyles("container"),children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.ComposedChart,{data,maxBarSize:maxBarWidth,margin:{bottom:xAxisLabel?30:void 0,left:yAxisLabel?10:void 0,right:yAxisLabel?5:void 0},...composedChartProps,children:[withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"top",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload,onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"top",classNames:resolvedClassNames,styles:resolvedStyles,series,attributes}),...legendProps}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.XAxis,{hide:!withXAxis,dataKey,tick:{transform:"translate(0, 10)",fontSize:12,fill:"currentColor"},stroke:"",interval:"preserveStartEnd",tickLine:withXTickLine?{stroke:"currentColor"}:false,minTickGap:5,...getStyles("axis"),...xAxisProps,children:[xAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideBottom",offset:-20,fontSize:12,...getStyles("axisLabel"),children:xAxisLabel}),xAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"left",orientation:"left",tick:{transform:"translate(-10, 0)",fontSize:12,fill:"currentColor"},hide:!withYAxis,...sharedYAxisProps,...yAxisProps,children:[yAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideLeft",angle:-90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:yAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.YAxis,{yAxisId:"right",orientation:"right",tick:{transform:"translate(10, 0)",fontSize:12,fill:"currentColor"},hide:!withRightYAxis,...sharedYAxisProps,...rightYAxisProps,children:[rightYAxisLabel&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Label,{position:"insideRight",angle:90,textAnchor:"middle",fontSize:12,offset:-5,...getStyles("axisLabel"),children:rightYAxisLabel}),yAxisProps?.children]}),/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.CartesianGrid,{strokeDasharray,vertical:"y"===gridAxis||"xy"===gridAxis,horizontal:"x"===gridAxis||"xy"===gridAxis,...getStyles("grid"),...gridProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:0!==tooltipAnimationDuration,position:{y:0},cursor:{stroke:"var(--chart-grid-color)",strokeWidth:1,strokeDasharray},content:({label,payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{label,payload,unit,classNames:resolvedClassNames,styles:resolvedStyles,series,valueFormatter,attributes}),...tooltipProps}),lines,referenceLinesItems,children]})})})});CompositeChart.displayName="@mantine/charts/CompositeChart";CompositeChart.classes=grid_chart_module_css_classes;"use client";var RadialBarChart_module_css_classes={root:"m_cd2bd9e5",tooltip:"m_6bcc3420"};"use client";const RadialBarChart_defaultProps={barSize:20,startAngle:90,endAngle:-270,withBackground:true,withTooltip:true};const RadialBarChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{emptyBackgroundColor})=>({root:{"--chart-empty-background":emptyBackgroundColor?(0,index_mjs_.getThemeColor)(emptyBackgroundColor,theme):void 0}}));const RadialBarChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("RadialBarChart",RadialBarChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,barSize,withBackground,dataKey,radialBarProps,radialBarChartProps,withLabels,withLegend,legendProps,withTooltip,tooltipProps,startAngle,endAngle,attributes,...others}=props;const[highlightedArea,setHighlightedArea]=(0,index_js_.useState)(null);const getStyles=(0,index_mjs_.useStyles)({name:"RadialBarChart",classes:RadialBarChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:RadialBarChart_varsResolver});const theme=(0,index_mjs_.useMantineTheme)();const dataWithResolvedColor=data.map(({color,...item})=>{const resolvedColor=(0,index_mjs_.getThemeColor)(color,theme);return{...item,fill:resolvedColor,fillOpacity:highlightedArea?highlightedArea===item.name?item.opacity||1:.05:item.opacity||1}});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.RadialBarChart,{margin:{top:0,bottom:0,left:0,right:0},innerRadius:"10%",outerRadius:"100%",cx:"50%",cy:"50%",barSize,startAngle,endAngle,data:dataWithResolvedColor,...radialBarChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.RadialBar,{label:withLabels?{position:"insideStart",fill:"var(--mantine-color-white)",fontSize:12}:void 0,background:withBackground?{fill:"var(--chart-empty-background)"}:void 0,dataKey,isAnimationActive:false,...radialBarProps}),withLegend&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Legend,{verticalAlign:"bottom",content:payload=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartLegend,{payload:payload.payload?.map(item=>({...item,dataKey:item.payload?.name})),onHighlight:setHighlightedArea,legendPosition:legendProps?.verticalAlign||"bottom",classNames:resolvedClassNames,styles:resolvedStyles,centered:true,attributes}),...legendProps}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:0,isAnimationActive:false,cursor:{stroke:"var(--chart-cursor-color)"},content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Paper,{...getStyles("tooltip"),children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"sm",children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.ColorSwatch,{color:payload?.[0]?.payload.fill,size:12,withShadow:false}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload.name})]}),/* @__PURE__ */(0,jsx_runtime.jsx)("span",{children:payload?.[0]?.payload[dataKey]})]}),...tooltipProps})]})})})});RadialBarChart.displayName="@mantine/core/RadialBarChart";RadialBarChart.classes=RadialBarChart_module_css_classes;"use client";var FunnelChart_module_css_classes={root:"m_80d531e7"};"use client";const FunnelChart_defaultProps={withTooltip:true,size:300,strokeWidth:1,withLabels:false,labelsPosition:"right",tooltipDataSource:"all"};const FunnelChart_varsResolver=(0,index_mjs_.createVarsResolver)((theme,{strokeColor,labelColor,size})=>({root:{"--chart-stroke-color":strokeColor?(0,index_mjs_.getThemeColor)(strokeColor,theme):void 0,"--chart-labels-color":labelColor?(0,index_mjs_.getThemeColor)(labelColor,theme):void 0,"--chart-size":(0,index_mjs_.rem)(size)}}));const FunnelChart=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("FunnelChart",FunnelChart_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,withTooltip,tooltipAnimationDuration,tooltipProps,strokeWidth,withLabels,size,valueFormatter,children,funnelChartProps,funnelProps,labelsPosition,tooltipDataSource,attributes,...others}=props;const theme=(0,index_mjs_.useMantineTheme)();const getStyles=(0,index_mjs_.useStyles)({name:"FunnelChart",classes:FunnelChart_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars,varsResolver:FunnelChart_varsResolver});const{resolvedClassNames,resolvedStyles}=(0,index_mjs_.useResolvedStylesApi)({classNames,styles,props});return/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{ref,size,...getStyles("root"),...others,children:/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.ResponsiveContainer,{children:/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.FunnelChart,{...funnelChartProps,children:[/* @__PURE__ */(0,jsx_runtime.jsxs)(es6_index_js_.Funnel,{data,dataKey:"value",isAnimationActive:false,stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth,...funnelProps,children:[withLabels&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.LabelList,{position:labelsPosition,fill:"inside"===labelsPosition?"var(--chart-labels-color, var(--mantine-color-white))":"var(--chart-labels-color, var(--mantine-color-dimmed))",stroke:"none",fontFamily:"var(--mantine-font-family)",fontSize:14,dataKey:entry=>"function"==typeof valueFormatter?valueFormatter(entry.value):entry.value}),data.map((entry,index)=>/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Cell,{fill:(0,index_mjs_.getThemeColor)(entry.color,theme),stroke:"var(--chart-stroke-color, var(--mantine-color-body))",strokeWidth},index))]}),withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)(es6_index_js_.Tooltip,{animationDuration:tooltipAnimationDuration,isAnimationActive:false,content:({payload})=>/* @__PURE__ */(0,jsx_runtime.jsx)(ChartTooltip,{payload:data,classNames:resolvedClassNames,styles:resolvedStyles,type:"radial",segmentId:"segment"===tooltipDataSource?payload?.[0]?.name:void 0,valueFormatter,attributes}),...tooltipProps}),children]})})})});FunnelChart.displayName="@mantine/charts/FunnelChart";FunnelChart.classes=FunnelChart_module_css_classes;"use client";function getBoundaries({data,domain}){if(Array.isArray(domain))return domain;const values=Object.values(data);return[Math.min(...values),Math.max(...values)]}"use client";function getColumns(datesRange,splitMonths){if(!splitMonths)return datesRange.map((week,weekIndex)=>{const firstDay=week.find(d=>null!==d);const month=new Date(firstDay).getMonth();return{type:"column",month,weekIndex}});const tmp=[];datesRange.forEach((week,weekIndex)=>{const months=week.map(d=>d?new Date(d).getMonth():null);let firstMonth=null;let boundaryIndex=null;for(let i=0;i<months.length;i+=1)if(null!==months[i]){if(null===firstMonth)firstMonth=months[i];else if(months[i]!==firstMonth){boundaryIndex=i;break}}if(null===firstMonth)return;if(null===boundaryIndex)tmp.push({type:"column",month:firstMonth,weekIndex});else{let nextMonth=null;for(let i=boundaryIndex;i<months.length;i+=1)if(null!==months[i]){nextMonth=months[i];break}if(null===nextMonth)tmp.push({type:"column",month:firstMonth,weekIndex});else{tmp.push({type:"column",month:firstMonth,weekIndex});tmp.push({type:"column",month:nextMonth,weekIndex})}}});const columns=[];for(let i=0;i<tmp.length;i+=1){if(i>0&&tmp[i].month!==tmp[i-1].month)columns.push({type:"spacer"});columns.push(tmp[i])}return columns}function getFirstMonthColumnIndex(columns,month){for(let i=0;i<columns.length;i+=1){const c=columns[i];if("column"===c.type&&c.month===month)return i}return -1}"use client";function formatDate(date){return date.toISOString().split("T")[0]}function addDays(date,days){return new Date(date.getTime()+864e5*days)}function startOfWeek(date,firstDayOfWeek){let value=new Date(date);while(value.getDay()!==firstDayOfWeek)value=addDays(value,-1);return value}function endOfWeek(date,firstDayOfWeek){const day=date.getDay();const diff=(day<firstDayOfWeek?7:0)+day-firstDayOfWeek;return addDays(date,6-diff)}function getDatesRange({startDate,endDate,withOutsideDates=true,firstDayOfWeek=1}={}){const start=startDate?new Date(startDate):new Date(/* @__PURE__ */new Date().getFullYear()-1,/* @__PURE__ */new Date().getMonth(),/* @__PURE__ */new Date().getDate());const end=endDate?new Date(endDate):/* @__PURE__ */new Date;const startWeek=startOfWeek(start,firstDayOfWeek);const endWeek=endOfWeek(end,firstDayOfWeek);const dates=[];let current=startWeek;while(current<=endWeek){const week=Array.from({length:7},(_,i)=>{const day=addDays(current,i);return withOutsideDates||day>=start&&day<=end?formatDate(day):null});dates.push(week);current=addDays(current,7)}return dates}"use client";function getMonthsRange(weeksData){let position=0;let current=null;const result=[];weeksData.forEach(week=>{const day=null===week[0]?week[week.length-1]:week[0];const month=new Date(day).getMonth();if(current!==month){current=month;result.push({month:current,position,size:0})}result[result.length-1].size+=1;position+=1});return result}"use client";function getHeatColor({value,min,max,colors}){const percent=(value-min)/(max-min);const colorIndex=Math.round((colors.length-1)*percent);return colors[colorIndex]}"use client";function HeatmapSplitWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;const columns=getColumns(datesRange,true);return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:columns.map((col,columnIndex)=>{if("spacer"===col.type)return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`},`spacer-${columnIndex}`);const week=datesRange[col.weekIndex];const days=week.map((date,dayIndex)=>{if(!date)return null;if(new Date(date).getMonth()!==col.month)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},`${date}-${col.month}`)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${columnIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},`col-${col.weekIndex}-${col.month}-${columnIndex}`)})})}"use client";function HeatmapWeeks({data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles}){const rectSizeWithGap=rectSize+gap;return/* @__PURE__ */(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:datesRange.map((week,weekIndex)=>{const days=week.map((date,dayIndex)=>{if(!date)return null;const hasValue=date in data&&null!==data[date];const rectValue=hasValue?data[date]:null;return/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{width:rectSize,height:rectSize,x:gap,y:dayIndex*rectSizeWithGap+gap,rx:rectRadius,"data-empty":!hasValue||void 0,fill:hasValue?getHeatColor({value:data[date],min,max,colors}):void 0,onPointerEnter:withTooltip?()=>setHoveredRect({date,value:rectValue}):void 0,...getRectProps?.({date,value:rectValue}),...getStyles("rect")},date)});return/* @__PURE__ */(0,jsx_runtime.jsx)("g",{transform:`translate(${weekIndex*rectSizeWithGap}, 0)`,"data-id":"week",children:days},weekIndex)})})}"use client";function rotateWeekdaysNames(weekdayNames,firstDayOfWeek){const rotated=[...weekdayNames];for(let i=0;i<firstDayOfWeek;i+=1)rotated.push(rotated.shift());return rotated}"use client";var Heatmap_module_css_classes={root:"m_2ef228c3",rect:"m_2ef201c5",monthLabel:"m_7e977775",weekdayLabel:"m_c4b68f8d"};"use client";const Heatmap_defaultProps={monthLabels:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdayLabels:["Sun","Mon","","Wed","","Fri",""],withOutsideDates:true,firstDayOfWeek:1,rectSize:10,weekdaysLabelsWidth:30,monthsLabelsHeight:14,gap:1,rectRadius:2,fontSize:12,colors:["var(--heatmap-level-1)","var(--heatmap-level-2)","var(--heatmap-level-3)","var(--heatmap-level-4)"]};const Heatmap=(0,index_mjs_.factory)((_props,ref)=>{const props=(0,index_mjs_.useProps)("Heatmap",Heatmap_defaultProps,_props);const{classNames,className,style,styles,unstyled,vars,data,startDate,endDate,withMonthLabels,withWeekdayLabels,weekdayLabels,withOutsideDates,monthLabels,firstDayOfWeek,rectSize=10,gap=1,rectRadius,domain,colors,weekdaysLabelsWidth,monthsLabelsHeight,fontSize,getTooltipLabel,withTooltip,tooltipProps,getRectProps,splitMonths,attributes,...others}=props;const getStyles=(0,index_mjs_.useStyles)({name:"Heatmap",classes:Heatmap_module_css_classes,props,className,style,classNames,styles,unstyled,attributes,vars});const[hoveredRect,setHoveredRect]=(0,index_js_.useState)(null);const rectSizeWithGap=rectSize+gap;const weekdaysOffset=withWeekdayLabels?weekdaysLabelsWidth:0;const monthsOffset=withMonthLabels?monthsLabelsHeight:0;const[min,max]=getBoundaries({data,domain});const rotatedWeekdayLabels=(0,index_js_.useMemo)(()=>rotateWeekdaysNames(weekdayLabels,firstDayOfWeek),[weekdayLabels,firstDayOfWeek]);const datesRange=getDatesRange({startDate,endDate,withOutsideDates,firstDayOfWeek});const monthsRange=withMonthLabels||splitMonths?getMonthsRange(datesRange):[];const weeksProps={data,datesRange,rectSize,gap,rectRadius,min,max,colors,withTooltip,setHoveredRect,getRectProps,getStyles};const weeks=splitMonths?/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapSplitWeeks,{...weeksProps}):/* @__PURE__ */(0,jsx_runtime.jsx)(HeatmapWeeks,{...weeksProps});const totalColumns=splitMonths?getColumns(datesRange,splitMonths).length:datesRange.length;const computeMonthLabelX=(monthPosition,monthIndex)=>{if(!splitMonths)return monthPosition*rectSizeWithGap+gap+weekdaysOffset;const firstMonth=monthsRange[monthIndex];const columns=getColumns(datesRange,splitMonths);const i=getFirstMonthColumnIndex(columns,firstMonth.month);const base=i>=0?i:monthPosition;return(base+1)*rectSizeWithGap+gap+weekdaysOffset};const monthsLabelsNodes=withMonthLabels&&monthLabels?monthsRange.map((month,monthIndex)=>{const minSize=splitMonths?2:3;if(month.size<minSize)return null;const monthLabel=monthLabels[month.month];return/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:computeMonthLabelX(month.position,monthIndex),y:monthsLabelsHeight-4,width:month.size*rectSizeWithGap,fontSize,...getStyles("monthLabel"),children:monthLabel},monthIndex)}):null;const weekdayLabelsNodes=withWeekdayLabels&&weekdayLabels?rotatedWeekdayLabels.map((weekdayLabel,dayIndex)=>/* @__PURE__ */(0,jsx_runtime.jsx)("text",{x:0,y:(dayIndex+1)*rectSizeWithGap-gap+monthsOffset,width:weekdaysLabelsWidth,fontSize,...getStyles("weekdayLabel"),children:weekdayLabel},dayIndex)):null;const label=getTooltipLabel&&hoveredRect&&withTooltip?getTooltipLabel(hoveredRect):null;return/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Box,{component:"svg",ref,width:rectSizeWithGap*totalColumns+gap+weekdaysOffset,height:7*rectSizeWithGap+gap+monthsOffset,...getStyles("root"),...others,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Tooltip.Floating,{label,disabled:!withTooltip||!label,position:"top",...tooltipProps,children:/* @__PURE__ */(0,jsx_runtime.jsxs)("g",{transform:`translate(${weekdaysOffset}, ${monthsOffset})`,"data-id":"all-weeks",children:[withTooltip&&/* @__PURE__ */(0,jsx_runtime.jsx)("rect",{fill:"transparent",width:rectSizeWithGap*totalColumns+gap,height:7*rectSizeWithGap+gap}),weeks]})}),weekdayLabelsNodes,monthsLabelsNodes]})});Heatmap.displayName="@mantine/charts/Heatmap";Heatmap.classes=Heatmap_module_css_classes}}]);
package/dist/mf/7285.js CHANGED
@@ -1 +1 @@
1
- "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["7285"],{2004:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{updateContextModal:()=>events_updateContextModal,closeAllModals:()=>closeAllModals,updateModal:()=>events_updateModal,ModalsProvider:()=>ModalsProvider,openContextModal:()=>events_openContextModal,openConfirmModal:()=>events_openConfirmModal,closeModal:()=>events_closeModal,modals:()=>events_modals,openModal:()=>events_openModal,useModals:()=>useModals});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(7060);var index_mjs_=__webpack_require__(4763);var esm_index_mjs_=__webpack_require__(8403);"use client";const ModalsContext=(0,index_js_.createContext)(null);ModalsContext.displayName="@mantine/modals/ModalsContext";"use client";function useModals(){const ctx=(0,index_js_.useContext)(ModalsContext);if(!ctx)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return ctx}"use client";function ConfirmModal({id,cancelProps,confirmProps,labels={cancel:"",confirm:""},closeOnConfirm=true,closeOnCancel=true,groupProps,onCancel,onConfirm,children}){const{cancel:cancelLabel,confirm:confirmLabel}=labels;const ctx=useModals();const handleCancel=event=>{"function"==typeof cancelProps?.onClick&&cancelProps?.onClick(event);"function"==typeof onCancel&&onCancel();closeOnCancel&&ctx.closeModal(id)};const handleConfirm=event=>{"function"==typeof confirmProps?.onClick&&confirmProps?.onClick(event);"function"==typeof onConfirm&&onConfirm();closeOnConfirm&&ctx.closeModal(id)};return/* @__PURE__ */(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[children&&/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{mb:"md",children}),/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{mt:children?0:"md",justify:"flex-end",...groupProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",...cancelProps,onClick:handleCancel,children:cancelProps?.children||cancelLabel}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{...confirmProps,onClick:handleConfirm,children:confirmProps?.children||confirmLabel})]})]})}"use client";const[useModalsEvents,createEvent]=(0,index_mjs_.createUseExternalEvents)("mantine-modals");const events_openModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openModal")({...payload,modalId:id});return id};const events_openConfirmModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openConfirmModal")({...payload,modalId:id});return id};const events_openContextModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openContextModal")({...payload,modalId:id});return id};const events_closeModal=createEvent("closeModal");const closeAllModals=createEvent("closeAllModals");const events_updateModal=payload=>createEvent("updateModal")(payload);const events_updateContextModal=payload=>createEvent("updateContextModal")(payload);const events_modals={open:events_openModal,close:events_closeModal,closeAll:closeAllModals,openConfirmModal:events_openConfirmModal,openContextModal:events_openContextModal,updateModal:events_updateModal,updateContextModal:events_updateContextModal};"use client";function handleCloseModal(modal,canceled){if(canceled&&"confirm"===modal.type)modal.props.onCancel?.();modal.props.onClose?.()}function modalsReducer(state,action){switch(action.type){case"OPEN":return{current:action.modal,modals:[...state.modals,action.modal]};case"CLOSE":{const modal=state.modals.find(m=>m.id===action.modalId);if(!modal)return state;handleCloseModal(modal,action.canceled);const remainingModals=state.modals.filter(m=>m.id!==action.modalId);return{current:remainingModals[remainingModals.length-1]||state.current,modals:remainingModals}}case"CLOSE_ALL":if(!state.modals.length)return state;state.modals.concat().reverse().forEach(modal=>{handleCloseModal(modal,action.canceled)});return{current:state.current,modals:[]};case"UPDATE":{const{modalId,newProps}=action;const updatedModals=state.modals.map(modal=>{if(modal.id!==modalId)return modal;if("content"===modal.type||"confirm"===modal.type)return{...modal,props:{...modal.props,...newProps}};if("context"===modal.type)return{...modal,props:{...modal.props,...newProps,innerProps:{...modal.props.innerProps,...newProps.innerProps}}};return modal});const currentModal=state.current?.id===modalId?updatedModals.find(modal=>modal.id===modalId)||state.current:state.current;return{...state,modals:updatedModals,current:currentModal}}default:return state}}"use client";function separateConfirmModalProps(props){if(!props)return{confirmProps:{},modalProps:{}};const{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels,...others}=props;return{confirmProps:{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels},modalProps:{id,...others}}}function ModalsProvider({children,modalProps,labels,modals}){const[state,dispatch]=(0,index_js_.useReducer)(modalsReducer,{modals:[],current:null});const stateRef=(0,index_js_.useRef)(state);stateRef.current=state;const closeAll=(0,index_js_.useCallback)(canceled=>{dispatch({type:"CLOSE_ALL",canceled})},[stateRef,dispatch]);const openModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"content",props}});return id},[dispatch]);const openConfirmModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"confirm",props}});return id},[dispatch]);const openContextModal=(0,index_js_.useCallback)((modal,{modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"context",props,ctx:modal}});return id},[dispatch]);const closeModal=(0,index_js_.useCallback)((id,canceled)=>{dispatch({type:"CLOSE",modalId:id,canceled})},[stateRef,dispatch]);const updateModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);const updateContextModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);useModalsEvents({openModal,openConfirmModal,openContextModal:({modal,...payload})=>openContextModal(modal,payload),closeModal,closeContextModal:closeModal,closeAllModals:closeAll,updateModal,updateContextModal});const ctx={modalProps:modalProps||{},modals:state.modals,openModal,openConfirmModal,openContextModal,closeModal,closeContextModal:closeModal,closeAll,updateModal,updateContextModal};const getCurrentModal=()=>{const currentModal=stateRef.current.current;switch(currentModal?.type){case"context":{const{innerProps,...rest}=currentModal.props;const ContextModal=modals[currentModal.ctx];return{modalProps:rest,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ContextModal,{innerProps,context:ctx,id:currentModal.id})}}case"confirm":{const{modalProps:separatedModalProps,confirmProps:separatedConfirmProps}=separateConfirmModalProps(currentModal.props);return{modalProps:separatedModalProps,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ConfirmModal,{...separatedConfirmProps,id:currentModal.id,labels:currentModal.props.labels||labels})}}case"content":{const{children:currentModalChildren,...rest}=currentModal.props;return{modalProps:rest,content:currentModalChildren}}default:return{modalProps:{},content:null}}};const{modalProps:currentModalProps,content}=getCurrentModal();return/* @__PURE__ */(0,jsx_runtime.jsxs)(ModalsContext.Provider,{value:ctx,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Modal,{zIndex:(0,index_mjs_.getDefaultZIndex)("modal")+1,...modalProps,...currentModalProps,opened:state.modals.length>0,onClose:()=>closeModal(state.current?.id),children:content}),children]})}}}]);
1
+ "use strict";(globalThis["chunk_integrations_app"]=globalThis["chunk_integrations_app"]||[]).push([["7285"],{2004:function(__unused_webpack___webpack_module__,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{updateContextModal:()=>events_updateContextModal,closeAllModals:()=>closeAllModals,updateModal:()=>events_updateModal,ModalsProvider:()=>ModalsProvider,openContextModal:()=>events_openContextModal,openConfirmModal:()=>events_openConfirmModal,closeModal:()=>events_closeModal,modals:()=>events_modals,openModal:()=>events_openModal,useModals:()=>useModals});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(8556);var index_mjs_=__webpack_require__(2773);var esm_index_mjs_=__webpack_require__(2667);"use client";const ModalsContext=(0,index_js_.createContext)(null);ModalsContext.displayName="@mantine/modals/ModalsContext";"use client";function useModals(){const ctx=(0,index_js_.useContext)(ModalsContext);if(!ctx)throw new Error("[@mantine/modals] useModals hook was called outside of context, wrap your app with ModalsProvider component");return ctx}"use client";function ConfirmModal({id,cancelProps,confirmProps,labels={cancel:"",confirm:""},closeOnConfirm=true,closeOnCancel=true,groupProps,onCancel,onConfirm,children}){const{cancel:cancelLabel,confirm:confirmLabel}=labels;const ctx=useModals();const handleCancel=event=>{"function"==typeof cancelProps?.onClick&&cancelProps?.onClick(event);"function"==typeof onCancel&&onCancel();closeOnCancel&&ctx.closeModal(id)};const handleConfirm=event=>{"function"==typeof confirmProps?.onClick&&confirmProps?.onClick(event);"function"==typeof onConfirm&&onConfirm();closeOnConfirm&&ctx.closeModal(id)};return/* @__PURE__ */(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[children&&/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Box,{mb:"md",children}),/* @__PURE__ */(0,jsx_runtime.jsxs)(index_mjs_.Group,{mt:children?0:"md",justify:"flex-end",...groupProps,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",...cancelProps,onClick:handleCancel,children:cancelProps?.children||cancelLabel}),/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Button,{...confirmProps,onClick:handleConfirm,children:confirmProps?.children||confirmLabel})]})]})}"use client";const[useModalsEvents,createEvent]=(0,index_mjs_.createUseExternalEvents)("mantine-modals");const events_openModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openModal")({...payload,modalId:id});return id};const events_openConfirmModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openConfirmModal")({...payload,modalId:id});return id};const events_openContextModal=payload=>{const id=payload.modalId||(0,esm_index_mjs_.randomId)();createEvent("openContextModal")({...payload,modalId:id});return id};const events_closeModal=createEvent("closeModal");const closeAllModals=createEvent("closeAllModals");const events_updateModal=payload=>createEvent("updateModal")(payload);const events_updateContextModal=payload=>createEvent("updateContextModal")(payload);const events_modals={open:events_openModal,close:events_closeModal,closeAll:closeAllModals,openConfirmModal:events_openConfirmModal,openContextModal:events_openContextModal,updateModal:events_updateModal,updateContextModal:events_updateContextModal};"use client";function handleCloseModal(modal,canceled){if(canceled&&"confirm"===modal.type)modal.props.onCancel?.();modal.props.onClose?.()}function modalsReducer(state,action){switch(action.type){case"OPEN":return{current:action.modal,modals:[...state.modals,action.modal]};case"CLOSE":{const modal=state.modals.find(m=>m.id===action.modalId);if(!modal)return state;handleCloseModal(modal,action.canceled);const remainingModals=state.modals.filter(m=>m.id!==action.modalId);return{current:remainingModals[remainingModals.length-1]||state.current,modals:remainingModals}}case"CLOSE_ALL":if(!state.modals.length)return state;state.modals.concat().reverse().forEach(modal=>{handleCloseModal(modal,action.canceled)});return{current:state.current,modals:[]};case"UPDATE":{const{modalId,newProps}=action;const updatedModals=state.modals.map(modal=>{if(modal.id!==modalId)return modal;if("content"===modal.type||"confirm"===modal.type)return{...modal,props:{...modal.props,...newProps}};if("context"===modal.type)return{...modal,props:{...modal.props,...newProps,innerProps:{...modal.props.innerProps,...newProps.innerProps}}};return modal});const currentModal=state.current?.id===modalId?updatedModals.find(modal=>modal.id===modalId)||state.current:state.current;return{...state,modals:updatedModals,current:currentModal}}default:return state}}"use client";function separateConfirmModalProps(props){if(!props)return{confirmProps:{},modalProps:{}};const{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels,...others}=props;return{confirmProps:{id,children,onCancel,onConfirm,closeOnConfirm,closeOnCancel,cancelProps,confirmProps,groupProps,labels},modalProps:{id,...others}}}function ModalsProvider({children,modalProps,labels,modals}){const[state,dispatch]=(0,index_js_.useReducer)(modalsReducer,{modals:[],current:null});const stateRef=(0,index_js_.useRef)(state);stateRef.current=state;const closeAll=(0,index_js_.useCallback)(canceled=>{dispatch({type:"CLOSE_ALL",canceled})},[stateRef,dispatch]);const openModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"content",props}});return id},[dispatch]);const openConfirmModal=(0,index_js_.useCallback)(({modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"confirm",props}});return id},[dispatch]);const openContextModal=(0,index_js_.useCallback)((modal,{modalId,...props})=>{const id=modalId||(0,esm_index_mjs_.randomId)();dispatch({type:"OPEN",modal:{id,type:"context",props,ctx:modal}});return id},[dispatch]);const closeModal=(0,index_js_.useCallback)((id,canceled)=>{dispatch({type:"CLOSE",modalId:id,canceled})},[stateRef,dispatch]);const updateModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);const updateContextModal=(0,index_js_.useCallback)(({modalId,...newProps})=>{dispatch({type:"UPDATE",modalId,newProps})},[dispatch]);useModalsEvents({openModal,openConfirmModal,openContextModal:({modal,...payload})=>openContextModal(modal,payload),closeModal,closeContextModal:closeModal,closeAllModals:closeAll,updateModal,updateContextModal});const ctx={modalProps:modalProps||{},modals:state.modals,openModal,openConfirmModal,openContextModal,closeModal,closeContextModal:closeModal,closeAll,updateModal,updateContextModal};const getCurrentModal=()=>{const currentModal=stateRef.current.current;switch(currentModal?.type){case"context":{const{innerProps,...rest}=currentModal.props;const ContextModal=modals[currentModal.ctx];return{modalProps:rest,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ContextModal,{innerProps,context:ctx,id:currentModal.id})}}case"confirm":{const{modalProps:separatedModalProps,confirmProps:separatedConfirmProps}=separateConfirmModalProps(currentModal.props);return{modalProps:separatedModalProps,content:/* @__PURE__ */(0,jsx_runtime.jsx)(ConfirmModal,{...separatedConfirmProps,id:currentModal.id,labels:currentModal.props.labels||labels})}}case"content":{const{children:currentModalChildren,...rest}=currentModal.props;return{modalProps:rest,content:currentModalChildren}}default:return{modalProps:{},content:null}}};const{modalProps:currentModalProps,content}=getCurrentModal();return/* @__PURE__ */(0,jsx_runtime.jsxs)(ModalsContext.Provider,{value:ctx,children:[/* @__PURE__ */(0,jsx_runtime.jsx)(index_mjs_.Modal,{zIndex:(0,index_mjs_.getDefaultZIndex)("modal")+1,...modalProps,...currentModalProps,opened:state.modals.length>0,onClose:()=>closeModal(state.current?.id),children:content}),children]})}}}]);