{"version":3,"sources":["../../../src/components/Notifications.tsx"],"sourcesContent":["import type { NotificationActionClickHandler, NotificationClickHandler } from '@novu/js/ui';\nimport React, { useMemo } from 'react';\nimport { useNotificationOutlets } from '../hooks/internal/useNotificationOutlets';\nimport { NoRendererProps, NotificationRendererProps, SubjectBodyRendererProps } from '../utils/types';\nimport { Mounter } from './Mounter';\nimport { OutletScope } from './OutletScope';\n\nexport type NotificationProps = {\n  onNotificationClick?: NotificationClickHandler;\n  onPrimaryActionClick?: NotificationActionClickHandler;\n  onSecondaryActionClick?: NotificationActionClickHandler;\n} & (NotificationRendererProps | SubjectBodyRendererProps | NoRendererProps);\n\nconst NotificationsMount = (props: NotificationProps) => {\n  const { onNotificationClick, onPrimaryActionClick, onSecondaryActionClick } = props;\n  const outlets = useNotificationOutlets(props);\n\n  const mountProps = useMemo(\n    () => ({ ...outlets, onNotificationClick, onPrimaryActionClick, onSecondaryActionClick }),\n    [outlets, onNotificationClick, onPrimaryActionClick, onSecondaryActionClick]\n  );\n\n  return <Mounter name=\"Notifications\" props={mountProps} />;\n};\n\nexport const Notifications = React.memo((props: NotificationProps) => (\n  <OutletScope>\n    <NotificationsMount {...props} />\n  </OutletScope>\n));\n\nNotifications.displayName = 'Notifications';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAA+B;AAC/B,oCAAuC;AAEvC,qBAAwB;AACxB,yBAA4B;AAiBnB;AATT,IAAM,qBAAqB,CAAC,UAA6B;AACvD,QAAM,EAAE,qBAAqB,sBAAsB,uBAAuB,IAAI;AAC9E,QAAM,cAAU,sDAAuB,KAAK;AAE5C,QAAM,iBAAa;AAAA,IACjB,OAAO,EAAE,GAAG,SAAS,qBAAqB,sBAAsB,uBAAuB;AAAA,IACvF,CAAC,SAAS,qBAAqB,sBAAsB,sBAAsB;AAAA,EAC7E;AAEA,SAAO,4CAAC,0BAAQ,MAAK,iBAAgB,OAAO,YAAY;AAC1D;AAEO,IAAM,gBAAgB,aAAAA,QAAM,KAAK,CAAC,UACvC,4CAAC,kCACC,sDAAC,sBAAoB,GAAG,OAAO,GACjC,CACD;AAED,cAAc,cAAc;","names":["React"]}