{"version":3,"file":"Modal.mjs","sources":["../../../src/components/Modal/Modal.tsx"],"sourcesContent":["import {\n  Dialog,\n  DialogPanel,\n  DialogTitle,\n  Transition,\n} from '@headlessui/react';\nimport clsx from 'clsx';\nimport type { MutableRefObject, ReactNode } from 'react';\nimport React from 'react';\n\nimport {\n  assertEdsUsage,\n  assertNoRemovedProp,\n  type WithRemovedProps,\n} from '../../util/logging';\nimport type { ExtractProps } from '../../util/utility-types';\nimport type { Size } from '../../util/variant-types';\n\nimport Button from '../Button';\nimport Heading from '../Heading';\nimport { useSemanticIcon } from '../Icon';\nimport ScrollWrapper from '../ScrollWrapper';\nimport Text from '../Text';\n\nimport styles from './Modal.module.css';\n\ntype ModalContentProps = {\n  // Component API\n  /**\n   * Optional aria-label for the modal.\n   *\n   * If undefined, the headingText of the Modal.Header will be used.\n   * If there is no Modal.Header, an aria-label is required.\n   */\n  'aria-label'?: string;\n  /**\n   * Additional classnames passed in for styling.\n   */\n  className?: string;\n  /**\n   * Contents of the modal. Only `Modal.Header`, `Modal.Body`, and `Modal.Footer` are allowed\n   * as direct children; anything else logs an error.\n   */\n  children: ReactNode;\n  /**\n   * Hides the close button in the top right of the modal.\n   *\n   * **Default is `false`**.\n   */\n  hideCloseButton?: boolean;\n  /**\n   * A ref to an element that should receive focus when the modal first opens.\n   *\n   * If undefined, the first focusable element (usually the close button) will be used.\n   *\n   * ```\n   * const inputFieldRef = useRef();\n   *\n   * <Modal initialFocus={inputFieldRef}>\n   *   ...\n   *   <InputField ref={inputFieldRef} />\n   * </Modal>\n   * ```\n   */\n  initialFocus?: MutableRefObject<HTMLElement | null>;\n  /**\n   * Method called when the close button is clicked. Use this to hide the modal.\n   * This should be used to also reset the `open` state.\n   *\n   * This is required even if you don't have a close button so the ESC key can close the modal.\n   *\n   * Closing is cancellable by passing in a function that returns `void` or by not altering the state.\n   *\n   * ```\n   * const [isOpen, setIsOpen] = useState(true);\n   * // ....\n   *\n   * <Modal open={isOpen} onClose={() => setIsOpen(false)}>\n   *  ...\n   * </Modal>\n   * ```\n   */\n  onClose: () => void;\n  /**\n   * CSS properties defined for the modal's content element. Includes the component's CSS Custom Properties:\n   *\n   * - `--modal-content__border`\n   */\n  style?: ModalContentCSSProperties;\n  // Design API\n  open?: boolean;\n  /**\n   * The modal's footprint at each breakpoint:\n   * - `\"sm\"` is a compact floating surface that sizes to its content, up to 480px tall\n   * - `\"lg\"` fills the viewport at the smallest breakpoint. Above it, it sizes to its content,\n   *   up to the viewport height less a margin\n   * - `\"full\"` takes the whole viewport at every breakpoint\n   *\n   * Height is managed for you at all three. The body takes whatever space the header and\n   * footer leave over and scrolls once the content outgrows it, so the actions stay on screen\n   * however long the content runs. The exception is a viewport under 320px tall, too short to\n   * seat the header and footer and still leave a body worth scrolling, where the modal scrolls\n   * as a whole instead and the footer does go off screen.\n   *\n   * **Default is `\"lg\"`**.\n   */\n  size?: Extract<Size, 'sm' | 'lg'> | 'full';\n};\n\nexport interface ModalContentCSSProperties extends React.CSSProperties {\n  /**\n   * Custom property to customize the border color of this component\n   */\n  '--modal-content__border'?: string;\n}\n\ntype ModalProps = ModalContentProps & {\n  /**\n   * Whether or not the modal is visible. Recommend using `useState` to set this\n   * variable instead of a boolean literal, to avoid component control issues.\n   * @see https://headlessui.com/react/dialog\n   *\n   * ```\n   * const [isOpen, setIsOpen] = useState(true);\n   * // ....\n   *\n   * <Modal open={isOpen}>\n   *  ...\n   * </Modal>\n   * ```\n   */\n  open: boolean;\n  /**\n   * Additional classnames passed in for the modal container.\n   */\n  modalContainerClassName?: string;\n  /**\n   * Asks the user to confirm before the modal closes, so unsaved work in it isn't lost to a\n   * stray ESC key, overlay click, or close button click. Uses the browser's `window.confirm`.\n   *\n   * - `true` always asks\n   * - a function is called at close time, and asks only when it returns `true`. Use it to check\n   *   whether the modal's state is dirty\n   *\n   * Only warn when closing actually loses something. Check how the modal's state is held:\n   *\n   * - **State resets on close** (it lives inside the modal's children, which unmount, or\n   *   `onClose` clears it): closing is destructive, so warn\n   * - **State survives close** (it is held above the modal and not cleared): reopening brings\n   *   the fields back, so closing loses nothing. Don't warn; the prompt only adds friction\n   *\n   * To warn, the state has to be readable where `Modal` renders. Lift it out of the modal's\n   * children, clear it in `onClose`, and pass a function that compares it against its starting\n   * values. A function keeps an untouched modal closing without a prompt; `true` asks every\n   * time, and fits only when any open modal holds work worth keeping.\n   *\n   * This covers only the closes the modal triggers itself: ESC, an overlay click, and the close\n   * button. A button you put in `Modal.Footer` calls your own handler, so check there too if it\n   * discards work.\n   *\n   * ```\n   * const [draft, setDraft] = useState('');\n   * const handleClose = () => {\n   *   setIsOpen(false);\n   *   setDraft(''); // closing discards the draft, so warn while there is one\n   * };\n   * // ....\n   *\n   * <Modal warnOnClose={() => draft !== ''} onClose={handleClose} open={isOpen}>\n   *  ...\n   * </Modal>\n   * ```\n   *\n   * **Default is `false`**.\n   */\n  warnOnClose?: boolean | (() => boolean);\n  /**\n   * The question `window.confirm` asks when `warnOnClose` applies. Name what will be lost, for\n   * example `\"Discard this note?\"`, so the user can answer without guessing.\n   *\n   * **Default is `\"You have unsaved changes. Close anyway?\"`**.\n   */\n  warnOnCloseMessage?: string;\n};\n\ntype ModalTitleProps = ExtractProps<typeof Heading> & {\n  // Component API\n  /**\n   * Contents for the modal title.\n   */\n  children: ReactNode;\n  /**\n   * CSS class names that can be appended to the component.\n   */\n  className?: string;\n};\n\ntype ModalSubTitleProps = ExtractProps<typeof Text> & {\n  // Component API\n  /**\n   * Contents for the modal title.\n   */\n  children: ReactNode;\n  /**\n   * CSS class names that can be appended to the component.\n   */\n  className?: string;\n};\n\ntype ModalBodyProps = {\n  // Component API\n  /**\n   * Child node(s) that can be nested inside component. `Modal.Header`,\n   * `Modal.Body`, and `Modal.Footer` are the only permissible children of the Modal.\n   */\n  children: ReactNode;\n  /**\n   * CSS class names that can be appended to the component.\n   */\n  className?: string;\n};\n\ntype ModalHeaderProps = {\n  // Component API\n  /**\n   * Child node(s) to place inside the Modal header.\n   * Should include the <Modal.Title>\n   */\n  children: ReactNode;\n  /**\n   * CSS class names that can be appended to the component.\n   */\n  className?: string;\n  // Design API\n};\n\ntype ModalFooterProps = {\n  // Component API\n  /**\n   * Child node(s) to place inside the Modal footer.\n   */\n  children: ReactNode;\n  /**\n   * CSS class names that can be appended to the component.\n   */\n  className?: string;\n  // Design API\n};\n\n/**\n * Helper function to determine whether a set of children contain a `ModalTitle` or `Modal.Title` child\n *\n * @param children component children (ReactNode)\n * @returns boolean representing whether the set of children (recursive) has a `ModalTitle` or `Modal.Title`\n */\nfunction childrenHaveModalTitle(children?: ReactNode): boolean {\n  // TODO: this could be a common utility function for other use cases, or from a library\n  const childrenArray = React.Children.toArray(children);\n  return childrenArray.some((child) => {\n    // `ReactNode` covers strings, numbers, bigints and promises as of React 19,\n    // none of which carry `props`.\n    if (typeof child !== 'object' || !('props' in child)) {\n      return false;\n    }\n    const { children: grandchildren } = child.props as {\n      children?: ReactNode;\n    };\n    if (\n      child.type &&\n      typeof child.type !== 'string' &&\n      (child.type?.name === 'ModalTitle' || child.type?.name === 'Modal.Title')\n    ) {\n      return true;\n    } else if (grandchildren) {\n      return childrenHaveModalTitle(grandchildren);\n    }\n    return false;\n  });\n}\n\n/**\n * Helper function to determine whether a set of children has anything other than `Modal.Header`,\n * `Modal.Body`, or `Modal.Footer` at the top level. Fragments are looked through, since they\n * add nothing to the DOM, and empty children (`null`, `false`, `undefined`) are skipped, so\n * conditionally rendered sections are fine.\n *\n * @param children component children (ReactNode)\n * @returns boolean representing whether any top-level child is not one of the three sections\n */\nfunction childrenHaveNonSectionChild(children?: ReactNode): boolean {\n  return React.Children.toArray(children).some((child) => {\n    if (!React.isValidElement(child)) {\n      return true;\n    }\n    if (child.type === React.Fragment) {\n      return childrenHaveNonSectionChild(\n        (child.props as { children?: ReactNode }).children,\n      );\n    }\n    return (\n      child.type !== ModalHeader &&\n      child.type !== ModalBody &&\n      child.type !== ModalFooter\n    );\n  });\n}\n\n// Mirrors `$eds-bp-sm`, which CSS custom properties can't carry into a media query.\nconst EDS_BP_SM = '600px';\n\n/**\n * The actual modal, without the dark overlay behind it.\n *\n * This is only exported for testing purposes; please do not import and use this directly.\n */\nconst ModalContent = (props: ModalContentProps) => {\n  const {\n    children,\n    className,\n    hideCloseButton = false,\n    open,\n    onClose,\n    size = 'lg',\n    // TODO(next-major): remove, with the asserts below.\n    height: removedHeight,\n    overlayEmphasis: removedOverlayEmphasis,\n    ...other\n  } = props as WithRemovedProps<\n    ModalContentProps,\n    'height' | 'overlayEmphasis'\n  >;\n\n  // TODO(next-major): remove.\n  assertNoRemovedProp(\n    'Modal/.Content',\n    'height',\n    'It manages its own height now: the body scrolls once the content outgrows the space the header and footer leave over.',\n    removedHeight,\n  );\n\n  // TODO(next-major): remove.\n  assertNoRemovedProp(\n    'Modal/.Content',\n    'overlayEmphasis',\n    'Every modal draws the low-emphasis overlay now.',\n    removedOverlayEmphasis,\n  );\n\n  assertEdsUsage(\n    [childrenHaveNonSectionChild(children)],\n    'Modal only takes Modal.Header, Modal.Body, and Modal.Footer as direct children. The modal lays out and scrolls those three sections, so anything else placed alongside them breaks that layout. Move the content into one of the sections, usually Modal.Body.',\n    'error',\n  );\n\n  const componentClassName = clsx(\n    styles['modal__content'],\n    size && styles[`modal__content--${size}`],\n    open && styles[`modal__content--is-open`],\n    className,\n  );\n\n  // The close button is semantic: it is the same affordance as every other close in the\n  // app, so it is set once through `IconProvider` rather than per modal.\n  const closeIcon = useSemanticIcon('close');\n\n  // Shrinks an lg modal to its content when that content is shorter than the lg max height\n  // (`100dvh - spacing-size-12`). Taller content keeps the CSS max height and the body scrolls.\n  // Below `$eds-bp-sm` the lg modal is full-bleed, so it keeps the full screen there.\n  const contentRef = React.useRef<HTMLDivElement>(null);\n  const consumerMaxHeight = other.style?.maxHeight;\n  React.useEffect(() => {\n    const content = contentRef.current;\n    // a max-height passed in through `style` is the consumer's call, so leave it to them\n    if (!content || size !== 'lg' || consumerMaxHeight !== undefined) return;\n\n    const sections = Array.from(\n      content.querySelectorAll<HTMLElement>(\n        `:scope > .${styles['modal-header']}, :scope > .${styles['modal-footer']}`,\n      ),\n    );\n    // the body's ScrollWrapper inner, which holds Modal.Body's children\n    const scroller = content.querySelector<HTMLElement>(\n      `:scope > .${styles['modal-body']} > * > *`,\n    );\n\n    // what the fit last wrote, so cleanup can tell it apart from a consumer's value\n    let fittedMaxHeight = '';\n    const setMaxHeight = (value: string) => {\n      fittedMaxHeight = value;\n      content.style.maxHeight = value;\n    };\n\n    const measureBodyContent = (scroller: HTMLElement) => {\n      // Read fresh each time, since a stateful child can add or remove siblings after opening.\n      // Skip hidden children: with no box, their zero rect would throw off the measurement.\n      const bodyChildren = Array.from(scroller.children).filter(\n        (child) => child.getClientRects().length > 0,\n      );\n      const first = bodyChildren[0];\n      const last = bodyChildren[bodyChildren.length - 1];\n      if (!first) {\n        // plain text has no element to measure, so measure the text itself\n        const range = document.createRange();\n        range.selectNodeContents(scroller);\n        return range.getBoundingClientRect().height;\n      }\n      return (\n        last.getBoundingClientRect().bottom -\n        first.getBoundingClientRect().top +\n        parseFloat(getComputedStyle(first).marginTop) +\n        parseFloat(getComputedStyle(last).marginBottom)\n      );\n    };\n\n    const fitToContent = () => {\n      if (!window.matchMedia(`(min-width: ${EDS_BP_SM})`).matches) {\n        setMaxHeight('');\n        return;\n      }\n\n      // Everything around the body's content: header, footer, body padding, and border. Without\n      // a body, that's the header and footer plus the border.\n      const chrome = scroller\n        ? content.offsetHeight - scroller.clientHeight\n        : sections.reduce((sum, section) => {\n            // flex items' margins don't collapse, so each one adds to the height\n            const { marginTop, marginBottom } = getComputedStyle(section);\n            return (\n              sum +\n              section.offsetHeight +\n              parseFloat(marginTop) +\n              parseFloat(marginBottom)\n            );\n          }, 0) +\n          content.offsetHeight -\n          content.clientHeight;\n      const bodyContentHeight = scroller ? measureBodyContent(scroller) : 0;\n      // The close button is positioned out of the flow, so nothing above counts it. Without a\n      // header, a short body can leave the modal shorter than the button, clipping it.\n      const closeButton = content.querySelector<HTMLElement>(\n        `:scope > .${styles['modal__close-button']}`,\n      );\n      const closeButtonBottom = closeButton\n        ? closeButton.offsetTop +\n          closeButton.offsetHeight +\n          content.offsetHeight -\n          content.clientHeight\n        : 0;\n      // a little extra room so the body does not scroll by a pixel or two from rounding\n      const total = Math.max(chrome + bodyContentHeight + 4, closeButtonBottom);\n\n      const largeHeight =\n        window.innerHeight -\n        parseFloat(\n          getComputedStyle(document.documentElement).getPropertyValue(\n            '--eds-spacing-size-12',\n          ),\n        );\n      // an empty value hands max-height back to the stylesheet\n      setMaxHeight(total < largeHeight ? `${total}px` : '');\n    };\n\n    fitToContent();\n    // Without ResizeObserver, content that changes size after opening waits for a window resize.\n    const observer =\n      typeof ResizeObserver === 'undefined'\n        ? undefined\n        : new ResizeObserver(fitToContent);\n    const observeAll = () =>\n      [\n        content,\n        ...sections,\n        ...(scroller ? [scroller, ...Array.from(scroller.children)] : []),\n      ].forEach((el) => observer?.observe(el));\n    observeAll();\n    // Changes inside the body that resize nothing observable: children added later (which also\n    // need observing), text React updates in place, and class or style edits that only move\n    // margins.\n    const mutationObserver = new MutationObserver(() => {\n      // start over, so children that have left the body stop being observed\n      observer?.disconnect();\n      observeAll();\n      fitToContent();\n    });\n    if (scroller) {\n      mutationObserver.observe(scroller, {\n        attributeFilter: ['class', 'style'],\n        characterData: true,\n        childList: true,\n        subtree: true,\n      });\n    }\n    window.addEventListener('resize', fitToContent);\n    return () => {\n      observer?.disconnect();\n      mutationObserver.disconnect();\n      window.removeEventListener('resize', fitToContent);\n      // React commits a new consumer max-height before this runs, so only clear the fit's own\n      if (content.style.maxHeight === fittedMaxHeight) {\n        content.style.maxHeight = '';\n      }\n    };\n  }, [children, consumerMaxHeight, size]);\n\n  return (\n    <div className={componentClassName} ref={contentRef} {...other}>\n      {!hideCloseButton && (\n        <Button\n          aria-label=\"close\"\n          className={styles['modal__close-button']}\n          context=\"default\"\n          icon={closeIcon}\n          iconLayout=\"icon-only\"\n          onClick={onClose}\n          rank=\"tertiary\"\n          variant=\"neutral\"\n        ></Button>\n      )}\n      {children}\n    </div>\n  );\n};\n\n/**\n * ## Usage\n *\n * | Type/Use | Description | Example |\n * |----------|-------------|---------|\n * | Standard | Central overlay with focus trap, used for focused tasks or messages. | Form entry; settings dialogs; confirmations. |\n * | Confirmation | Asks the user to confirm or cancel a critical action. | Deletion prompts; submitting irreversible actions. |\n * | Alert | Displays an important message, usually with a single dismiss button. | Error notifications; access denied messages. |\n * | Full-screen | Takes up the entire viewport for complex or immersive tasks. | Onboarding; mobile workflows; media viewers. |\n * | Success/Feedback | Provides positive feedback after a completed action. | Success confirmation; \"Thanks for submitting\" messages. |\n *\n * ### Best Practices\n *\n * * Modals are disruptive and should be used sparingly.\n * * Use a modal to request minimal amounts of information from a user. Don't request large forms of information inside a modal.\n * * Don't use a modal when a separate, designated URL is desired.\n * * Show one modal at a time. Don't place a modal on top of another modal. This can create usability issues.\n * * For important error notifications, use Inline Notification or Banner.\n * * For short messaging confirming successful interactions, such as \"Email sent\", use Inline Notification or Toast.\n *\n * ### Warning on close\n *\n * `warnOnClose` asks the user to confirm before the modal closes. Use it only when closing throws work away.\n *\n * * Warn when the modal's state resets on close, like a partly filled form that comes back empty on reopening.\n * * Don't warn when the state survives closing and reopening. Nothing is lost, so the prompt is only friction.\n * * Pass a function that checks for changes, so a modal the user hasn't touched closes without asking.\n * * Footer buttons that discard work, like Cancel, call your own handler. Check there too.\n *\n * ## Content & Accessibility\n *\n * ### Do's\n *\n * * Use a primary title, body text, and a primary CTA. All other modal content is optional.\n * * Use a verb-noun question or statement for the primary title.\n * * Ensure people can scan the heading and CTAs and know what to do even if they skip the body text.\n * * Keep primary titles and subtitles to a max of 2 lines each.\n * * Use either a short phrase or a full sentence for subtitles.\n * * Keep section titles to less than 1 line; preferably a short phrase.\n * * Break up information with section titles for scanability.\n * * Try to avoid scrolling text within a modal.\n *\n * ### Don'ts\n *\n * * Include long headings or body text. The more words, the less likely people are to read any of it.\n * * Include long passages of informative text in a modal. Use a short summary and then link to a help article, FAQ etc.\n * * Avoid applying inline stylistic modifications to the Modal.Title sub-component. Use the defaults or preset props where present.\n *\n * ## Resources\n *\n * * https://headlessui.dev/react/dialog\n */\nexport const Modal = (props: ModalProps) => {\n  const {\n    'aria-label': ariaLabel,\n    initialFocus,\n    modalContainerClassName,\n    onClose,\n    open,\n    warnOnClose = false,\n    warnOnCloseMessage = 'You have unsaved changes. Close anyway?',\n    ...rest\n  } = props;\n\n  const handleClose = () => {\n    const shouldWarn =\n      typeof warnOnClose === 'function' ? warnOnClose() : warnOnClose;\n    // the browser's own prompt, which blocks until the user answers\n    // eslint-disable-next-line no-alert\n    if (shouldWarn && !window.confirm(warnOnCloseMessage)) {\n      return;\n    }\n    onClose();\n  };\n\n  assertEdsUsage(\n    [!childrenHaveModalTitle(rest.children) && !ariaLabel],\n    \"You must use the Modal.Title helper component or pass in an aria-label when using the Modal. The Modal uses the Modal.Title to describe the modal to screen readers using aria-labelledby. If you're not using the Modal.Title component, you can pass in an aria-label instead.\",\n    'error',\n  );\n\n  const componentClassName = clsx(styles['modal'], modalContainerClassName);\n\n  return (\n    <Transition\n      as={React.Fragment}\n      enter={styles['modal__transition--enter']}\n      enterFrom={styles['modal__transition--enterFrom']}\n      enterTo={styles['modal__transition--enterTo']}\n      leave={styles['modal__transition--leave']}\n      leaveFrom={styles['modal__transition--leaveFrom']}\n      leaveTo={styles['modal__transition--leaveTo']}\n      show={open}\n    >\n      <Dialog\n        aria-label={ariaLabel}\n        className={componentClassName}\n        initialFocus={initialFocus}\n        // Passing onClose to the Dialog allows it to close the modal when the ESC key is triggered.\n        onClose={handleClose}\n      >\n        <div className={styles['modal__overlay']} />\n        <DialogPanel className={styles['modal__panel']}>\n          <ModalContent onClose={handleClose} open={open} {...rest} />\n        </DialogPanel>\n      </Dialog>\n    </Transition>\n  );\n};\n\n/**\n * Component defines the body of the modal.\n *\n * The body scrolls its content, so however long that content is, it does not push the header\n * and footer off the viewport. Below 320px of viewport height there is no room to scroll the\n * body within and the modal scrolls as a whole, which is the one case where the footer does\n * move off screen.\n *\n * `ScrollWrapper` leaves the region it scrolls in the tab order, which is how a keyboard user\n * reaches the rest of it; this element only sizes that region, so it stays out of the tab\n * order itself.\n */\nconst ModalBody = (props: ModalBodyProps) => {\n  const {\n    children,\n    className,\n    // TODO(next-major): remove, with the assert below.\n    height: removedHeight,\n    ...other\n  } = props as WithRemovedProps<ModalBodyProps, 'height'>;\n\n  // TODO(next-major): remove.\n  assertNoRemovedProp(\n    'Modal.Body',\n    'height',\n    'The body scrolls its own content, at every modal size.',\n    removedHeight,\n  );\n\n  return (\n    <div className={clsx(styles['modal-body'], className)} {...other}>\n      <ScrollWrapper shadowType=\"cover\">{children}</ScrollWrapper>\n    </div>\n  );\n};\n\n/**\n * Component defines the Footer section of the modal.\n */\nconst ModalFooter = ({ children, className, ...other }: ModalFooterProps) => {\n  return (\n    <div className={clsx(styles['modal-footer'], className)} {...other}>\n      {children}\n    </div>\n  );\n};\n\n/**\n * Component defines the Header section of the modal.\n */\nconst ModalHeader = ({ children, className, ...other }: ModalHeaderProps) => {\n  const componentClassName = clsx(styles['modal-header'], className);\n  return (\n    <div className={componentClassName} {...other}>\n      {children}\n    </div>\n  );\n};\n\n/**\n * Component defines the Title section of the modal.\n */\nconst ModalTitle = ({\n  children,\n  className,\n  preset = 'title-lg',\n  ...other\n}: ModalTitleProps) => {\n  const componentClassName = clsx(styles['modal-title'], className);\n  return (\n    <DialogTitle as={React.Fragment}>\n      <Heading\n        as=\"h2\"\n        className={componentClassName}\n        preset={preset}\n        {...other}\n      >\n        {children}\n      </Heading>\n    </DialogTitle>\n  );\n};\n\nconst ModalSubTitle = ({\n  children,\n  className,\n  preset = 'body-md',\n  ...other\n}: ModalSubTitleProps) => {\n  const componentClassName = clsx(styles['modal-sub-title'], className);\n  return (\n    <Text as=\"div\" className={componentClassName} preset={preset} {...other}>\n      {children}\n    </Text>\n  );\n};\n\nModal.displayName = 'Modal';\nModalTitle.displayName = 'Modal.Title';\nModalSubTitle.displayName = 'Modal.SubTitle';\nModalBody.displayName = 'Modal.Body';\nModalFooter.displayName = 'Modal.Footer';\nModalHeader.displayName = 'Modal.Header';\nModalContent.displayName = 'Modal.Content';\n\nModal.Header = ModalHeader;\nModal.Content = ModalContent;\nModal.Title = ModalTitle;\nModal.SubTitle = ModalSubTitle;\nModal.Body = ModalBody;\nModal.Footer = ModalFooter;\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AAyPA;;;;;AAKG;AACH,SAAS,sBAAsB,CAAC,QAAoB,EAAA;;IAElD,MAAM,aAAa,GAAGA,cAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC;AACtD,IAAA,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,KAAI;;;;AAGlC,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,EAAE,OAAO,IAAI,KAAK,CAAC,EAAE;AACpD,YAAA,OAAO,KAAK;QACd;QACA,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC,KAEzC;QACD,IACE,KAAK,CAAC,IAAI;AACV,YAAA,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ;aAC7B,CAAA,MAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,MAAK,YAAY,IAAI,CAAA,CAAA,EAAA,GAAA,KAAK,CAAC,IAAI,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,MAAA,GAAA,EAAA,CAAE,IAAI,MAAK,aAAa,CAAC,EACzE;AACA,YAAA,OAAO,IAAI;QACb;aAAO,IAAI,aAAa,EAAE;AACxB,YAAA,OAAO,sBAAsB,CAAC,aAAa,CAAC;QAC9C;AACA,QAAA,OAAO,KAAK;AACd,IAAA,CAAC,CAAC;AACJ;AAEA;;;;;;;;AAQG;AACH,SAAS,2BAA2B,CAAC,QAAoB,E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