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AAajC,SACvBC,UAAWgC,EAAahC,UACxBF,QAASkC,EAAalC,QACtBD,MAAOmC,EAAanC,MACpBI,SAAUA,KACJ+B,EAAawC,SACfxC,EAAawC,SACf,IAILxD,IACCX,EAAAA,EAAAA,KAAA,OAAKF,UAAU,oBAAmBC,UAChCC,EAAAA,EAAAA,KAACC,EAAAA,EAAU,CACTC,IAAKS,EAAMT,IACXC,KAAMQ,EAAMR,KACZC,MAAOO,EAAMP,MACbC,KAAMM,EAAMN,KAAOM,EAAMN,KAAOC,EAAAA,GAAU8D,IAC1CC,MAAO1D,EAAM0D,MACbvE,UAAU,oBAIbN,IAASQ,EAAAA,EAAAA,KAAA,OAAKF,UAAU,cAAaC,SAAEP,KAC1CQ,EAAAA,EAAAA,KAAA,OAAKF,UAAU,cAAaC,SAAEA,MAClB,EAILuE,EAAeC,IASP,IATQ,UAC3BC,EAAY,MAAK,SACjBzE,EAAQ,UACRD,KACG2E,GAKJF,EACC,OACEvE,EAAAA,EAAAA,KAAA,OACEF,UAAW,iBAAiBA,IAC5BsB,MAAO,CAAEsD,cAAeF,MACpBC,EAAK1E,SAERA,GACG,C","sources":["components/Modal/CustomHeader/index.tsx","components/Modal/index.tsx"],"sourcesContent":["import { ReactElement } from 'react';\nimport { EIconSize } from 'utils/constants/app/ui';\nimport { GlobalIcon } from 'components/GlobalIcon';\nimport './index.less';\n\ntype TCustomHeaderProps = {\n  title: string;\n  iconLib: string;\n  iconName: string;\n  iconTheme: string;\n  onCancel?: () => void;\n};\n\nexport const CustomHeader = ({\n  title,\n  iconLib,\n  iconName,\n  iconTheme,\n  onCancel\n}: TCustomHeaderProps): ReactElement => {\n  return (\n    <div className=\"modalCustomHeader\">\n      <div className=\"modalCustomHeader__iconContainer\">\n        <GlobalIcon\n          lib={iconLib}\n          name={iconName}\n          theme={iconTheme}\n          size={EIconSize._24}\n          className=\"modalCustomHeader__icon\"\n        />\n        <span className=\"modalCustomHeader__title\">{title}</span>\n      </div>\n\n      <GlobalIcon\n        lib=\"generic\"\n        name=\"close\"\n        theme=\"default\"\n        size={EIconSize._20}\n        className=\"modal__close-icon\"\n        onClick={onCancel}\n      />\n    </div>\n  );\n};\n","import React, {\n  CSSProperties,\n  ReactElement,\n  useEffect,\n  useMemo,\n  useRef\n} from 'react';\nimport { useDispatch, useSelector } from 'react-redux';\nimport { ModalFuncProps } from 'antd';\nimport { v4 as uuidv4 } from 'uuid';\nimport { EIconSize, ModalPadding, ModalWidth } from 'utils/constants/app/ui';\nimport { isMobile } from 'utils/is-mobile';\nimport { CustomHeader } from './CustomHeader';\nimport { GlobalIcon } from 'components/GlobalIcon';\nimport { CustomModal } from 'newcomponents/UI/CustomModal';\nimport { usePopupScrollDisable } from 'hooks/usePopupScrollDisable';\nimport { useSearchParams } from 'hooks/useSearchParams';\nimport { setOpenedModals } from 'store/actions/app-data';\nimport { getOpenedModals } from 'store/selectors/app-data';\nimport { getBetslipOpen } from 'store/selectors/betslip';\nimport './index.less';\n\ntype Props = ModalFuncProps & {\n  title?: string | React.ReactNode | null;\n  visible: boolean;\n  closable?: boolean;\n  onCancel?: (arg0: React.UIEvent<HTMLElement, MouseEvent>) => void;\n  image?:\n    | {\n        lib: string;\n        name: string;\n        theme: string;\n        size?: number;\n        color?: string;\n      }\n    | false;\n  children: React.ReactNode;\n  closeIcon?: React.ReactNode;\n  maxWidth?: number | string;\n  align?: 'left' | 'center' | 'right';\n  maskClosable?: boolean;\n  padding?: number;\n  wrapperPadding?: number;\n  width?: number | string;\n  centered?: boolean;\n  bodyStyle?: Record<string, number | string>;\n  style?: Record<string, number | string>;\n  maskStyle?: Record<string, number | string>;\n  zIndex?: number;\n  contentPadding?: number | string;\n  className?: string;\n  renderInBody?: boolean;\n  preventScrollDisable?: boolean;\n  hideBorder?: boolean;\n  destroyOnClose?: boolean;\n  getContainer?: string | false;\n  wrapperContainerPadding?: string;\n  placement?: 'top' | 'bottom' | 'left' | 'right';\n  fullPage?: boolean;\n  borderRadius?: string;\n  footer?: ReactElement | null;\n  closeIconStyle?: CSSProperties;\n  fixBody?: boolean;\n  renderCloseIconInMask?: boolean;\n  customHeader?: {\n    title: string;\n    iconLib: string;\n    iconName: string;\n    iconTheme: string;\n    onClose: () => void;\n  };\n};\n\nexport const Modal = ({\n  title,\n  image,\n  children,\n  zIndex,\n  align = 'left',\n  maxWidth = ModalWidth.MAX_1272,\n  padding,\n  wrapperPadding,\n  bodyStyle,\n  style,\n  closeIcon,\n  visible,\n  preventScrollDisable = false,\n  hideBorder,\n  destroyOnClose = true,\n  fixBody = true,\n  customHeader,\n  contentPadding,\n  wrapClassName,\n  getContainer,\n  wrapperContainerPadding,\n  placement,\n  fullPage,\n  footer,\n  maskStyle,\n  borderRadius,\n  closeIconStyle,\n  ...rest\n}: Props): ReactElement => {\n  const dispatch = useDispatch();\n  const openedModals = useSelector(getOpenedModals);\n  const open = useSelector(getBetslipOpen);\n  const modalId = useRef(uuidv4());\n  const { accounts } = useSearchParams();\n\n  const _preventScrollDisable = useMemo(() => {\n    return (\n      !!accounts ||\n      openedModals.size > 0 ||\n      (open && isMobile()) ||\n      preventScrollDisable\n    );\n  }, [accounts, openedModals.size, open, preventScrollDisable]);\n\n  usePopupScrollDisable(visible, _preventScrollDisable, fixBody);\n\n  const updateOpenedModal = (updateType: 'add' | 'delete') => {\n    if (openedModals.size) {\n      const openedModalsCopy = new Set(openedModals);\n      openedModalsCopy[updateType](modalId.current);\n      dispatch(setOpenedModals(openedModalsCopy));\n    }\n  };\n\n  useEffect(() => {\n    if (visible) {\n      updateOpenedModal('add');\n\n      return () => {\n        updateOpenedModal('delete');\n      };\n    }\n  }, [visible]);\n\n  return (\n    <CustomModal\n      {...rest}\n      hideBorder={hideBorder || false}\n      wrapClassName={wrapClassName || ''}\n      zIndex={zIndex || 0}\n      borderRadius={borderRadius}\n      maxWidth={maxWidth || ''}\n      destroyOnClose={destroyOnClose || false}\n      getContainer={getContainer || ''}\n      wrapperPadding={wrapperContainerPadding}\n      placement={placement}\n      fullPage={fullPage}\n      contentPadding={customHeader ? 0 : contentPadding ? contentPadding : 0}\n      footer={footer}\n      maskStyle={maskStyle}\n      bodyStyle={\n        bodyStyle || {\n          padding: `${customHeader ? 0 : padding ?? ModalPadding.MOBILE_12}px`,\n          textAlign: align\n        }\n      }\n      style={\n        style || {\n          borderRadius: '12px',\n          padding: `${wrapperPadding ?? ModalPadding.WRAPPER_8}px`\n        }\n      }\n      closeIcon={\n        closeIcon || (\n          <GlobalIcon\n            lib=\"generic\"\n            name=\"closeFill\"\n            theme=\"default\"\n            size={EIconSize._24}\n            className=\"modal__close-icon\"\n          />\n        )\n      }\n      visible={visible}\n      closeIconStyle={closeIconStyle}\n    >\n      {customHeader && (\n        <CustomHeader\n          iconName={customHeader.iconName}\n          iconTheme={customHeader.iconTheme}\n          iconLib={customHeader.iconLib}\n          title={customHeader.title}\n          onCancel={() => {\n            if (customHeader.onClose) {\n              customHeader.onClose();\n            }\n          }}\n        />\n      )}\n      {image && (\n        <div className=\"modalImageWrapper\">\n          <GlobalIcon\n            lib={image.lib}\n            name={image.name}\n            theme={image.theme}\n            size={image.size ? image.size : EIconSize._72}\n            color={image.color}\n            className=\"modal__icon\"\n          />\n        </div>\n      )}\n      {!!title && <div className=\"modal-title\">{title}</div>}\n      <div className=\"modal__body\">{children}</div>\n    </CustomModal>\n  );\n};\n\nexport const ModalButtons = ({\n  direction = 'row',\n  children,\n  className,\n  ...props\n}: {\n  direction?: 'row' | 'column';\n  children: React.ReactNode;\n  className?: string;\n}): ReactElement => {\n  return (\n    <div\n      className={`modal__footer ${className}`}\n      style={{ flexDirection: direction }}\n      {...props}\n    >\n      {children}\n    </div>\n  );\n};\n"],"names":["CustomHeader","_ref","title","iconLib","iconName","iconTheme","onCancel","_jsxs","className","children","_jsx","GlobalIcon","lib","name","theme","size","EIconSize","_24","_20","onClick","Modal","image","zIndex","align","maxWidth","ModalWidth","MAX_1272","padding","wrapperPadding","bodyStyle","style","closeIcon","visible","preventScrollDisable","hideBorder","destroyOnClose","fixBody","customHeader","contentPadding","wrapClassName","getContainer","wrapperContainerPadding","placement","fullPage","footer","maskStyle","borderRadius","closeIconStyle","rest","dispatch","useDispatch","openedModals","useSelector","getOpenedModals","open","getBetslipOpen","modalId","useRef","uuidv4","accounts","useSearchParams","_preventScrollDisable","useMemo","isMobile","usePopupScrollDisable","updateOpenedModal","updateType","openedModalsCopy","Set","current","setOpenedModals","useEffect","CustomModal","ModalPadding","MOBILE_12","textAlign","WRAPPER_8","onClose","_72","color","ModalButtons","_ref2","direction","props","flexDirection"],"sourceRoot":""}