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Z,WAAYiZ,EAAWqB,aAAa,CACpC5W,QAASuV,EAAWsB,OAAO,CAC3BC,QAASvB,QAAAA,EAAAA,EAAWuB,OAAAA,GAAXvB,KAAAA,IAAAA,EAAAA,EAAsB,GAC/BnhB,YAAamhB,EAAWnhB,WAAW,CACnC6V,eAAgBsL,EAAWtL,cAAc,CACzCwK,cAAAA,GAEJ,CAEA,SAASyB,GAA0B9Z,CAAsB,EACvD,MAAO,iBACLyC,UAAWzC,EAAWyC,SAAS,CAC/B+E,SAAUxH,EAAWwH,QAAQ,CAC7BC,WA8BKkT,CA9BOC,CA6BwBC,QAAQ,EAAI7a,EAAW8a,wBAAwB,CACjE,WAAa,WA7B/BpT,WAAY1H,EAAW+a,eAAe,EAAI/a,EAAWgb,qBAAqB,EAEtEhb,EAAWuY,WAAW,EAAI,CAAEmC,QAAS1a,EAAWuY,WAAW,GAAC,CAChEpR,cAAe8T,GAAkBjb,EAAWkb,kBAAkB,CAAE,gBAChEnN,YAAaoN,SAqDRA,CACkC,EAEzC,GAAIxkB,EACF,MAAO,CACLD,IAFa,IAEJC,EAAYykB,SAAS,CAC9BzkB,YAAaA,EAAY0kB,OAAO,CAChCzkB,kBAAmBD,EAAYb,WAAW,CAAG,cAAW8Y,CAC1D,CAGJ,EAhEgC5O,EAAWrJ,WAAW,EAClDyQ,iBAAkB6T,GAAkBjb,EAAWkb,kBAAkB,CAAE,oBAEvE,CAEA,SAASD,GACPC,CAAyC,CACzC1kB,CAAiC,EAEjC,OAAO0kB,EAAmBzd,MAAM,CAAC,SAAC6d,CAAAA,SAAaA,EAAS9kB,IAAI,GAAKA,GACnE","sources":["webpack://_N_E/../../libs/osc/brand-buttons/src/lib/brand-icon.tsx","webpack://_N_E/../../libs/osc/brand-buttons/src/lib/util/button.ts","webpack://_N_E/../../libs/osc/brand-buttons/src/lib/brand-link.tsx","webpack://_N_E/../../libs/osc/brand-buttons/src/lib/brand-button.tsx","webpack://_N_E/../../libs/osc/brand-buttons/src/lib/index.ts","webpack://_N_E/../../libs/osc/brand-buttons/src/index.ts","webpack://_N_E/../../libs/osc/caption/src/lib/caption.tsx","webpack://_N_E/../../libs/osc/caption/src/lib/index.ts","webpack://_N_E/../../libs/osc/caption/src/index.ts","webpack://_N_E/../../libs/osc/slider/src/lib/use-inline-gradient.tsx","webpack://_N_E/../../libs/osc/slider/src/lib/use-resize-observer.tsx","webpack://_N_E/../../libs/osc/slider/src/lib/thumb-labels.tsx","webpack://_N_E/../../libs/osc/slider/src/lib/slider.tsx","webpack://_N_E/../../libs/osc/slider/src/lib/index.ts","webpack://_N_E/../../libs/osc/slider/src/index.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-autoplay.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/add-track.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-track-query.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-fade-controls.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/matchers.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/metrics.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/classes.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.volume-slider.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-control-menu.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/cue.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/util/event-emitter.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-video-player.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.player.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.control-button.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.control-icon.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.control-menu.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.control-list.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.control-item.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.settings-menu.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.controls.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.captions.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.transcripts.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/hooks/use-video-player-classnames.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.markup.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.tsx","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.mapper.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/index.ts","webpack://_N_E/../../libs/osc/video-player/src/index.ts","webpack://_N_E/../../libs/osc/video-player/src/lib/video-player.css"],"sourcesContent":["import classnames from 'classnames';\nimport { Icon } from '@dx-ui/osc-icon';\nimport type { IconProps } from '@dx-ui/osc-icon';\n\nexport function BrandIcon(props: IconProps) {\n return (\n <span className=\"inline-block self-center\">\n <Icon {...props} className={classnames(props.className)} />\n </span>\n );\n}\n","import classnames from 'classnames';\n\nexport type Variant = 'solid' | 'outline';\n\nexport type ClassNamesArgs = Partial<{\n brandComponentTheme: CmsBrandComponentTheme;\n variant: Variant;\n}>;\n\nexport function getClassnames({ brandComponentTheme: theme, variant }: ClassNamesArgs) {\n const isDark = theme === 'dark';\n const isLight = theme === 'light';\n const isSolid = variant === 'solid';\n const isOutline = variant === 'outline';\n return classnames('btn-brand motion-safe:transition', {\n 'btn-brand-solid': isSolid && !isLight && !isDark,\n 'btn-brand-outline': isOutline && !isLight && !isDark,\n 'btn-brand-dark': isDark && !isSolid && !isOutline,\n 'btn-brand-dark-outline': isDark && isOutline,\n 'btn-brand-dark-solid': isDark && isSolid,\n 'btn-brand-light': isLight && !isSolid && !isOutline,\n 'btn-brand-light-outline': isLight && isOutline,\n 'btn-brand-light-solid': isLight && isSolid,\n });\n}\n","import type { Icon } from '@dx-ui/osc-icon';\nimport { Link } from '@dx-ui/osc-link';\nimport cx from 'classnames';\nimport type { MouseEvent } from 'react';\nimport { forwardRef } from 'react';\nimport { BrandIcon } from './brand-icon';\nimport type { Variant } from './util/button';\nimport { getClassnames } from './util/button';\n\nexport interface BrandLinkProps extends Omit<Link, 'label'> {\n label: React.ReactNode;\n /** Add Icon props to buttons with Icons */\n iconProps?: React.ComponentProps<typeof Icon>;\n /** Brand color themes, \"light\" | \"dark\" */\n brandComponentTheme?: CmsBrandComponentTheme;\n /** Button variant */\n variant?: Variant;\n /** OnClick callback */\n onClick?: (e: MouseEvent<HTMLAnchorElement>) => void;\n metricsOnClick?: () => void;\n /** Icon alignment, \"before\" | \"after\" */\n iconAlign?: 'before' | 'after';\n}\n\nexport const BrandLink = forwardRef<HTMLAnchorElement, BrandLinkProps>(\n (\n {\n label,\n iconProps,\n brandComponentTheme,\n variant,\n onClick,\n metricsOnClick,\n iconAlign = 'before',\n ...linkProps\n },\n ref\n ) => (\n <Link\n {...linkProps}\n ref={ref}\n anchorClassName={cx(\n linkProps.anchorClassName,\n getClassnames({ brandComponentTheme, variant })\n )}\n className={cx('gap-2', linkProps.className)}\n isNewWindow={linkProps.isNewWindow || false}\n url={linkProps.url}\n showNewWindowIcon={(linkProps.showNewWindowIcon && linkProps.isNewWindow) || false}\n underline={false}\n data-testid=\"CTALinkE2ETest\"\n onClick={(e) => {\n onClick?.(e);\n metricsOnClick?.();\n }}\n >\n {iconAlign === 'before' && iconProps ? <BrandIcon {...iconProps} /> : null}\n {label}\n {iconAlign === 'after' && iconProps ? <BrandIcon {...iconProps} /> : null}\n </Link>\n )\n);\n\nBrandLink.displayName = 'BrandLink';\n\nexport default BrandLink;\n","import type { Icon } from '@dx-ui/osc-icon';\nimport cx from 'classnames';\nimport { forwardRef } from 'react';\nimport { BrandIcon } from './brand-icon';\nimport type { Variant } from './util/button';\nimport { getClassnames } from './util/button';\n\nexport interface BrandButtonProps extends Omit<React.ComponentPropsWithoutRef<'button'>, 'type'> {\n /** Button label */\n label?: React.ReactNode;\n /** Add Icon props to buttons with Icons */\n iconProps?: React.ComponentProps<typeof Icon>;\n /** Brand color themes, \"light\" | \"dark\" */\n brandComponentTheme?: CmsBrandComponentTheme;\n /** Button variant */\n variant?: Variant;\n /** Icon alignment, \"before\" | \"after\" */\n iconAlign?: 'before' | 'after';\n}\n\n/** This is a one stop shop for all brand button needs, to add style exceptions so all buttons stay up to day. Check out some of the exceptions on Curio and Waldorf. */\nexport const BrandButton = forwardRef<HTMLButtonElement, BrandButtonProps>(\n (\n { label, variant, iconProps, brandComponentTheme, iconAlign = 'before', ...buttonProps },\n ref\n ) => (\n <button\n type=\"button\"\n {...buttonProps}\n ref={ref}\n className={cx(buttonProps.className, getClassnames({ brandComponentTheme, variant }))}\n data-testid=\"CTAButtonE2ETest\"\n >\n <span className=\"flex gap-2\" data-testid=\"buttonContentParent\">\n {iconAlign === 'before' && iconProps ? <BrandIcon {...iconProps} /> : null}\n {label}\n {iconAlign === 'after' && iconProps ? <BrandIcon {...iconProps} /> : null}\n </span>\n </button>\n )\n);\n\nBrandButton.displayName = 'BrandButton';\n\nexport default BrandButton;\n","export * from './brand-link';\nexport * from './brand-button';\n","export * from './lib';\nexport type { Variant } from './lib/util/button';\n","import type * as React from 'react';\nimport cx from 'classnames';\n\nexport type CaptionProps = {\n /**\n * Optional, provides the text content for the caption\n */\n caption?: string;\n /**\n * Optional link url\n */\n captionLink?: string;\n /**\n * Optional link target\n */\n captionLinkTarget?: string;\n /**\n * Optional metrics data\n */\n metricsOnClick?: () => void;\n /*\n * Optional alignment, default is end\n */\n align?: 'start' | 'end';\n};\n\n/**\n * Image caption is an optional prop that is consumed by other components, this cheese does not stand alone. Can be text only or a clickable link.\n */\nexport const Caption: React.FC<CaptionProps> = ({\n caption,\n captionLink,\n captionLinkTarget,\n align = 'end',\n metricsOnClick,\n}) => {\n const captionClasses =\n 'flex absolute top-0 items-center justify-center flex-auto text-xs mx-4 mt-4 mb-0 py-2 px-4 bg-bg-inverse text-text-overlay opacity-80 p-2 no-underline caption-main-text';\n\n if (!caption && !captionLink) {\n return null;\n }\n\n return (\n <figcaption data-testid=\"caption-container\">\n {captionLink ? (\n <a\n data-e2e=\"linkedCaption\"\n data-testid=\"img-caption-link\"\n className={cx(captionClasses, 'cursor-pointer', {\n 'end-0': align === 'end',\n 'start-0': align === 'start',\n })}\n href={captionLink}\n onClick={() => metricsOnClick?.()}\n target={captionLinkTarget}\n >\n {caption}\n </a>\n ) : (\n <div\n data-osc-product=\"osc-caption\"\n className={cx(captionClasses, 'pointer-events-none cursor-default', {\n 'end-0': align === 'end',\n 'start-0': align === 'start',\n })}\n >\n {caption}\n </div>\n )}\n </figcaption>\n );\n};\n","export * from './caption';\n","export * from './lib';\n","import type { CSSProperties } from 'react';\nimport type { PossibleThumbs, TSlider } from './slider.types';\n\ntype UseInlineGradient = Pick<\n TSlider<PossibleThumbs, PossibleThumbs>,\n 'disabled' | 'offColor' | 'onColor' | 'orientation' | 'brandComponentTheme' | 'variant'\n> & {\n /**\n * Array of 3-tuples. First value determines \"on\" or \"off\", 0 or 1, respectively.\n * The remainder specify the `on` percentages in the gradient [0,10], [40,50].\n */\n values: Tuple<3, number>[];\n /** Whether the language displayed on the page is right to left */\n isRtlLanguage?: boolean;\n};\n\nexport const defaultColorVariables = {\n offColor: 'color-border-form',\n onColor: 'color-primary',\n disabledColor: 'color-bg-disabled',\n} as const;\n\nexport const primaryColorVariables = {\n offColor: 'color-primary',\n onColor: 'color-primary',\n} as const;\n\nconst customColorVariables = {\n offColor: 'slider-gradient-off-color',\n onColor: 'slider-gradient-on-color',\n};\n\n/**\n * This hook is used specifically to return css for the horizontal gradient in the `Slider` component\n * using the colors from the [style guide](/?path=/docs/library-styles-colors--colors)\n *\n * > Ideally this inline styling could eventually be replaced with css vars via TW plugin.\n */\nexport const useInlineGradient = ({\n values,\n disabled = false,\n offColor = defaultColorVariables.offColor,\n onColor = defaultColorVariables.onColor,\n isRtlLanguage = false,\n orientation = 'horizontal',\n variant = 'default',\n brandComponentTheme,\n}: UseInlineGradient): CSSProperties => {\n const direction = getDirection({ isRtlLanguage, orientation });\n const { on: gradientOnColor, off: gradientOffColor } = getGradientColors({\n brandComponentTheme,\n variant,\n offColor,\n onColor,\n });\n const gradientDisabledColor = `var(--${defaultColorVariables.disabledColor})`;\n const on = `rgb(${disabled ? gradientDisabledColor : gradientOnColor})`;\n const off = `rgb(${disabled ? gradientDisabledColor : gradientOffColor})`;\n const collect = values.reduce((prev, val) => {\n /** first value determines if section is filled or not */\n const filled = Boolean(val[0]);\n return `${prev}, ${filled ? on : off} ${val[1]}%, ${filled ? on : off} ${val[2]}%`;\n }, ``);\n const background = `linear-gradient(to ${direction}${collect})`;\n return { background };\n};\n\nfunction getDirection({\n orientation,\n isRtlLanguage,\n}: Pick<UseInlineGradient, 'orientation' | 'isRtlLanguage'>) {\n if (orientation === 'vertical') {\n return 'top';\n }\n if (isRtlLanguage) {\n return 'left';\n }\n return 'right';\n}\n\nfunction getGradientColors({\n brandComponentTheme,\n variant,\n onColor,\n offColor,\n}: Pick<UseInlineGradient, 'brandComponentTheme' | 'variant' | 'offColor' | 'onColor'>) {\n const themeSuffix = brandComponentTheme ? `-${brandComponentTheme}` : '';\n const presetVariables = variant === 'primary' ? primaryColorVariables : { onColor, offColor };\n return {\n off: `var(--${customColorVariables.offColor}${themeSuffix}, var(--${presetVariables.offColor}))`,\n on: `var(--${customColorVariables.onColor}${themeSuffix}, var(--${presetVariables.onColor}))`,\n };\n}\n\nexport default useInlineGradient;\n","import { useIsomorphicLayoutEffect } from 'usehooks-ts';\nimport { useState, useCallback } from 'react';\n\nconst emptyRect = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n width: 0,\n height: 0,\n} as DOMRect;\n\n/**\n * This custom useResizeObserver hook fixes an issue with label alignment for the slider in Safari.\n * @param initialRect partial DOMRect to be used before measure. defaults to empty rect\n * @todo add debounce or raf throttle\n */\nexport const useResizeObserver = (initialRect: Partial<DOMRect> = emptyRect) => {\n const [element, setElement] = useState<HTMLElement | null>();\n const [rect, setRect] = useState<DOMRect>(initialRect as Readonly<DOMRect>);\n\n const ref = useCallback((e: HTMLElement | null) => {\n setElement(e);\n }, []);\n\n useIsomorphicLayoutEffect(() => {\n const ro = new ResizeObserver((entries) => {\n setRect(entries[0] ? entries[0].contentRect : (initialRect as Readonly<DOMRect>));\n });\n if (element) {\n ro.observe(element);\n }\n return () => {\n element && ro.unobserve(element);\n setRect(emptyRect);\n };\n }, [element, initialRect]);\n\n return [ref, rect] as const;\n};\n","import { forwardRef, useRef, useState } from 'react';\nimport type { ReactNode } from 'react';\nimport { useIsomorphicLayoutEffect } from 'usehooks-ts';\n// Using a custom useResizeObserver hook due to a label alignment issue with the slider in Safari when the useResizeObserver hook from usehooks-ts is used.\n// This is likely happening because of how on initial mount the bounding box size is not recorded.\nimport { useResizeObserver } from './use-resize-observer';\nimport cx from 'classnames';\nimport type { PossibleThumbs } from './slider.types';\n\ntype TThumbLabelProps<T extends PossibleThumbs, U extends T> = {\n /** Whether the language is written right to left */\n isRtlLanguage: boolean;\n /** A tuple of labels corresponding to each input value, they are screen reader only labels and add additional context to the visible labels shown */\n inputLabels: Tuple<U, string>;\n /** array of labels */\n labels: string[] | ReactNode[];\n /** Whether the thumb label is displayed as text or a tooltip */\n labelType: 'text' | 'tooltip';\n /** array of normalized positions of label thumbs along the track */\n valueRatios: number[];\n};\n\n// the thumb diameter\nexport const THUMB_W = 28;\n// the distance at which labels are joined with a LabelJoin\nexport const LABEL_JOIN_DISTANCE = 20;\nexport const JOIN_LABEL_LENGTH = 6;\n\nconst LABEL_JOIN_CENTER = LABEL_JOIN_DISTANCE / 2 + JOIN_LABEL_LENGTH / 2;\n\nconst tooltipClasses =\n 'relative h-max bg-bg text-text-alt text-left text-xs font-normal px-4 py-2.5 w-max border border-border';\n\nconst textClasses =\n 'absolute inline-block w-20 max-w-max -translate-x-2/4 whitespace-nowrap text-center font-bold';\n\nconst calculateLabelPositions = (\n trackRect: DOMRect,\n valueRatios: number[],\n labelRefs: HTMLElement[],\n isRtlLanguage: boolean\n) => {\n const labelRects = labelRefs?.map((label) => label.getBoundingClientRect());\n const xCoordinates = labelRects?.map((rect, i) => {\n let x =\n (trackRect?.width - THUMB_W) * (valueRatios[i] as number) + THUMB_W / 2 - rect?.width / 2;\n if (x < trackRect?.left) {\n x = 0;\n } else if (x + rect?.width > trackRect?.right) {\n x = trackRect?.right - rect?.width;\n }\n return isRtlLanguage ? -x : x;\n });\n\n if (isRtlLanguage) {\n xCoordinates.reverse();\n }\n\n return { xCoordinates, labelRects };\n};\n\nconst adjustLabelOverlaps = (\n xCoordinates: number[],\n labelRects: DOMRect[],\n trackRect: DOMRect,\n isRtlLanguage: boolean\n) => {\n const joinLabelXCoordinates = Array<number | null>(xCoordinates?.length).fill(null);\n\n for (let i = 0; i < xCoordinates.length - 1; i++) {\n const overlap =\n (xCoordinates[i] as number) +\n LABEL_JOIN_DISTANCE +\n (labelRects[i] as DOMRect)?.width -\n (xCoordinates[i + 1] as number);\n if (overlap > 0) {\n const limits = isRtlLanguage\n ? {\n left: -(trackRect.right - (labelRects[i] as DOMRect)?.width),\n right: 0,\n track: trackRect?.left,\n }\n : {\n left: 0,\n right: trackRect.right - (labelRects[i + 1] as DOMRect)?.width,\n track: trackRect.right,\n };\n\n if ((xCoordinates[i] as number) - overlap / 2 < limits?.left) {\n xCoordinates[i] = limits?.left;\n xCoordinates[i + 1] =\n (xCoordinates[i] as number) + (labelRects[i] as DOMRect)?.width + LABEL_JOIN_DISTANCE;\n } else if (\n (xCoordinates[i + 1] as number) + (labelRects[i + 1] as DOMRect)?.width + overlap / 2 >\n limits.track\n ) {\n xCoordinates[i + 1] = limits.right;\n xCoordinates[i] =\n (xCoordinates[i + 1] as number) - (labelRects[i] as DOMRect)?.width - LABEL_JOIN_DISTANCE;\n } else {\n (xCoordinates[i] as number) -= overlap / 2;\n (xCoordinates[i + 1] as number) += overlap / 2;\n }\n joinLabelXCoordinates[i] = isRtlLanguage\n ? (xCoordinates[i] as number) + LABEL_JOIN_CENTER\n : (xCoordinates[i + 1] as number) - LABEL_JOIN_CENTER;\n }\n }\n\n for (let i = xCoordinates?.length - 1; i > 0; i--) {\n const overlap =\n (xCoordinates[i - 1] as number) +\n (labelRects[i - 1] as DOMRect)?.width +\n LABEL_JOIN_DISTANCE -\n (xCoordinates[i] as number);\n if (overlap > 0) {\n (xCoordinates[i - 1] as number) -= overlap;\n joinLabelXCoordinates[i - 1] = isRtlLanguage\n ? (xCoordinates[i - 1] as number) + LABEL_JOIN_DISTANCE - JOIN_LABEL_LENGTH\n : (xCoordinates[i] as number) - LABEL_JOIN_DISTANCE + JOIN_LABEL_LENGTH;\n }\n }\n\n if (isRtlLanguage) {\n const overlap = xCoordinates[0] as number;\n const limit = -trackRect.right + (labelRects[labelRects?.length - 1] as DOMRect)?.width;\n if (overlap < limit) {\n xCoordinates[0] = limit;\n for (let i = 0; i < xCoordinates?.length - 1; i++) {\n if (joinLabelXCoordinates[i] !== null) {\n joinLabelXCoordinates[i] =\n (xCoordinates[i] as number) + LABEL_JOIN_DISTANCE - JOIN_LABEL_LENGTH;\n xCoordinates[i + 1] =\n (xCoordinates[i] as number) + (labelRects[i] as DOMRect)?.width + LABEL_JOIN_DISTANCE;\n } else break;\n }\n }\n } else {\n const overlap = -(xCoordinates[0] as number);\n if (overlap > 0) {\n (xCoordinates[0] as number) += overlap;\n for (let i = 0; i < xCoordinates?.length - 1; i++) {\n if (joinLabelXCoordinates[i] !== null) {\n joinLabelXCoordinates[i] = (joinLabelXCoordinates[i] as number) + overlap;\n (xCoordinates[i + 1] as number) += overlap;\n } else break;\n }\n }\n }\n\n return joinLabelXCoordinates;\n};\n\ntype LabelProps = {\n /** Screenreader only label to give additional context to the visible labels */\n additionalLabel?: string;\n id: string;\n /** Label content */\n label: string | ReactNode;\n /** The horizontal position for the label center correctly over the thumb */\n labelPosition?: number;\n /** Whether the label is shown as text or in a tooltip */\n labelType: string;\n};\n\nfunction getTooltipTopOffset({ tooltipRect }: { tooltipRect?: DOMRect }) {\n return tooltipRect ? tooltipRect?.height + 2 : 0;\n}\n\nconst Label = forwardRef<HTMLSpanElement, LabelProps>(\n ({ additionalLabel, id, label, labelPosition, labelType }, forwardedRef) => {\n return (\n <span\n id={id}\n key={id}\n ref={forwardedRef}\n className={labelType === 'tooltip' ? tooltipClasses : textClasses}\n style={{ transform: `translateX(${labelPosition}px` }}\n >\n <span aria-hidden=\"true\">{label}</span>\n <span className=\"sr-only\">{additionalLabel}</span>\n </span>\n );\n }\n);\n\nLabel.displayName = 'Label';\n\n/**\n * smart positioned text labels that position themselves as close to centered over their corresponding thumb positions\n * as possible. valueRatios[] are normalized thumb positions from 0 to 1. A layout effect and resize observer hook is used to prevent overlaps\n * @todo the layout effect is O(n) and could possibly be improved, and definitely cleaned up a bit\n */\nconst ThumbLabels = <T extends PossibleThumbs, U extends T>({\n inputLabels,\n isRtlLanguage,\n labels,\n labelType = 'text',\n valueRatios,\n}: TThumbLabelProps<T, U>) => {\n const [trackRef, trackRect] = useResizeObserver();\n const [labelsX, setLabelsX] = useState<number[]>([]);\n const labelRefs = useRef<HTMLElement[]>([]).current;\n const [labelElementRects, setLabelRects] = useState<DOMRect[]>([]);\n const [joinLabelXCoordinates, setJoinLabelXCoordinates] = useState<Array<number | null>>([]);\n const [topOffsetState, setTopOffset] = useState<number>(0);\n\n useIsomorphicLayoutEffect(() => {\n const { xCoordinates, labelRects } = calculateLabelPositions(\n trackRect,\n valueRatios,\n labelRefs,\n isRtlLanguage\n );\n setLabelRects(labelRects);\n const topOffset = getTooltipTopOffset({\n tooltipRect: labelElementRects[0],\n });\n setTopOffset(topOffset);\n const joinLabelXCoordinates = adjustLabelOverlaps(\n xCoordinates,\n labelRects,\n trackRect,\n isRtlLanguage\n );\n setJoinLabelXCoordinates(joinLabelXCoordinates);\n setLabelsX(xCoordinates);\n }, [trackRect, valueRatios, isRtlLanguage, topOffsetState, setTopOffset]);\n\n return (\n <span\n ref={trackRef}\n className={cx('absolute flex size-full justify-between', {\n '-top-5': labelType === 'text',\n '-z-1': labelType === 'tooltip',\n })}\n style={labelType === 'tooltip' ? { top: `-${topOffsetState}px` } : {}}\n >\n {labels?.map((label: ReactNode, i: number) => {\n return (\n <Label\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n id={`slider-thumb-label-${i}`}\n label={label}\n ref={(ref) => {\n if (ref) {\n // eslint-disable-next-line react-compiler/react-compiler\n labelRefs[i] = ref;\n }\n }}\n labelPosition={labelsX[i]}\n labelType={labelType}\n additionalLabel={inputLabels[i]}\n />\n );\n })}\n {joinLabelXCoordinates\n .filter((value: number | null) => value !== null)\n .map((value: number | null, i: number) => (\n <span\n className=\"text-text-alt absolute inline-block text-center before:content-['-']\"\n aria-hidden=\"true\"\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n style={{\n transform: `translateX(${value}px)`,\n }}\n />\n ))}\n </span>\n );\n};\n\nexport default ThumbLabels;\n","import { useRef } from 'react';\nimport * as SliderPrimitive from '@radix-ui/react-slider';\nimport type { PossibleThumbs, TSlider } from './slider.types';\nimport useInlineGradient, { defaultColorVariables } from './use-inline-gradient';\nimport cx from 'classnames';\nimport ThumbLabels from './thumb-labels';\nimport { isRtl } from '@dx-ui/utilities-get-language-direction';\n\n/**\n * A slider component that can have multiple thumbs. Each thumb can have a label and a value.\n * @see [Radix UI React Slider](https://www.radix-ui.com/primitives/docs/components/slider)\n */\nexport const Slider = <T extends PossibleThumbs, U extends T>({\n disabled = false,\n fillIndex = 0,\n hiddenLegend = false,\n inputLabels,\n labelType = 'text',\n language,\n max = 1,\n maxLabel,\n min = 0,\n minLabel,\n offColor = defaultColorVariables.offColor,\n onChange,\n onColor = defaultColorVariables.onColor,\n step = 1,\n thumbLabelFn,\n title,\n values,\n orientation = 'horizontal',\n variant = 'default',\n brandComponentTheme,\n}: TSlider<T, U>) => {\n const isRtlLanguage = isRtl(language);\n const isDefault = variant === 'default';\n const isPrimary = variant === 'primary';\n const isDark = brandComponentTheme === 'dark';\n const isLight = brandComponentTheme === 'light';\n const isVertical = orientation === 'vertical';\n const isHorizontal = orientation === 'horizontal';\n const thumbRef = useRef<HTMLSpanElement>(null);\n\n const valueRatios = values.map((val) => {\n /** set each input's ratio between min and max. always clamped between 0 and 1 */\n let valueRatio = (val - min) / (max - min);\n if (valueRatio < 0) valueRatio = 0;\n else if (valueRatio > 1) valueRatio = 1;\n return valueRatio;\n });\n\n /** collect fill areas for thumb track. alternates 'on', 'off' */\n const areas = values.map((_, i) => i % 2);\n /** add starting fill index. do we start with 'on' or 'off' */\n const fillAreas: OneLonger<Tuple<U, number>> =\n fillIndex === 1\n ? ([fillIndex, ...areas] as OneLonger<Tuple<U, number>>)\n : ([...areas, fillIndex] as OneLonger<Tuple<U, number>>);\n /** list of gradient values for thu */\n const gradValues = fillAreas.reduce((prev, filled, i) => {\n prev.push([\n filled,\n i === 0 ? 0 : (valueRatios[i - 1] as number) * 100,\n i === fillAreas.length - 1 ? 100 : (valueRatios[i] as number) * 100,\n ]);\n return prev;\n }, [] as Array<Tuple<3, number>>);\n\n const inlineGradProps = useInlineGradient({\n values: gradValues,\n disabled,\n onColor,\n offColor,\n isRtlLanguage,\n orientation,\n brandComponentTheme,\n });\n const defaultLabelFn = (val: number) => `${val}`;\n const thumbLabels = values.map(thumbLabelFn || defaultLabelFn) as Tuple<U, string>;\n const labels = isRtlLanguage ? thumbLabels.reverse() : thumbLabels;\n const WrapperElement = values.length > 1 ? 'fieldset' : 'div';\n const TitleElement = values.length > 1 ? 'legend' : 'p';\n\n return (\n <WrapperElement\n className={cx('px-0.5', {\n 'text-text-disabled': disabled,\n 'h-full py-4': isVertical,\n 'mb-8 pt-8': isHorizontal,\n })}\n >\n <TitleElement\n className={cx('label w-full', {\n 'mb-4': labelType === 'tooltip',\n 'sr-only': hiddenLegend,\n })}\n >\n {title}\n </TitleElement>\n <div\n className={cx({\n 'relative z-10': labelType === 'tooltip',\n 'h-full': isVertical,\n })}\n >\n <SliderPrimitive.Root\n className={cx('relative flex touch-none select-none', {\n 'h-full justify-center': isVertical,\n 'h-10 w-full items-center': isHorizontal,\n })}\n dir={isRtlLanguage ? 'rtl' : 'ltr'}\n disabled={disabled}\n max={max}\n min={min}\n minStepsBetweenThumbs={1}\n name={title}\n step={step}\n onValueChange={onChange}\n value={values}\n orientation={orientation}\n >\n <SliderPrimitive.Track\n className={cx('slider-track', {\n 'slider-track--vertical': isVertical,\n 'slider-track--horizontal': isHorizontal,\n })}\n data-testid=\"slider-track\"\n style={{ ...inlineGradProps }}\n >\n <SliderPrimitive.Range className=\"slider-range\" />\n </SliderPrimitive.Track>\n {values.map((_value, i) => {\n return (\n <SliderPrimitive.Thumb\n // eslint-disable-next-line react/no-array-index-key\n key={i}\n className={cx('slider-thumb group', {\n 'slider-thumb--horizontal': isHorizontal,\n 'slider-thumb--vertical': isVertical,\n 'slider-thumb--disabled': disabled,\n 'slider-thumb--default': isDefault,\n 'slider-thumb--primary': isPrimary,\n 'slider-thumb--dark': isDark,\n 'slider-thumb--light': isLight,\n })}\n // radix applies this name attribute to the generated input field rendered\n name={`slider-input-${i}`}\n // this id is applied to the span radix renders as the thumb\n id={`slider-thumb-${i}`}\n aria-valuetext={labels[i]}\n asChild\n {...(isHorizontal && { 'aria-labelledby': `slider-thumb-label-${i}` })}\n {...(isVertical && { 'aria-label': inputLabels[i] })}\n >\n <span ref={thumbRef} className=\"relative block\">\n {labelType === 'tooltip' ? (\n // Tooltip arrow styles to ensure the arrow follows the tooltip correctly\n <span\n className={cx(\n 'relative block size-full',\n 'after:bg-bg after:border-border after:absolute after:-top-4 after:left-[calc(50%_-_6px)] after:inline-block after:size-3 after:rotate-[-135deg] after:border-l after:border-t group-hover:after:-top-[19px] group-focus:after:-top-[19px]'\n )}\n />\n ) : null}\n </span>\n </SliderPrimitive.Thumb>\n );\n })}\n {isHorizontal ? (\n <ThumbLabels\n labels={labels}\n inputLabels={inputLabels}\n valueRatios={valueRatios}\n labelType={labelType}\n isRtlLanguage={isRtlLanguage}\n />\n ) : null}\n </SliderPrimitive.Root>\n </div>\n {minLabel && maxLabel ? (\n <div className=\"relative flex justify-between\">\n <div aria-hidden=\"true\">{minLabel}</div>\n <div aria-hidden=\"true\">{maxLabel}</div>\n </div>\n ) : null}\n </WrapperElement>\n );\n};\n\nexport default Slider;\n","export * from './slider';\nexport * from './slider.types';\n","export * from './lib';\n","import { useIsClient } from 'usehooks-ts';\nimport { getIsReducedMotion } from '@dx-ui/utilities-accessibility';\n\ntype UseAutoPlayOptions = { isAutoPlay: boolean };\n\nexport function useAutoPlay({ isAutoPlay = true }: UseAutoPlayOptions = { isAutoPlay: true }) {\n const isClient = useIsClient();\n const isReducedMotion = getIsReducedMotion();\n return isClient && isAutoPlay && !isReducedMotion;\n}\n","import { logWarning } from '@dx-ui/framework-logger';\nimport type { Track } from '../video-player.controls';\n\n/**\n * Asynchronously adds a track element to a video element for closed captions.\n *\n * - This is done imperatively vs declaratively so the cues are available when the VTT is loaded.\n * - The track element is hidden by default so the native captions do not display.\n */\nexport async function addTrackAsync(\n videoElement: HTMLVideoElement,\n track: Track\n): Promise<HTMLTrackElement | null> {\n const trackElement = document.createElement('track');\n trackElement.id = getTrackId(track);\n trackElement.label = track.label;\n trackElement.srclang = track.language;\n trackElement.kind = 'metadata';\n trackElement.track.mode = 'hidden';\n trackElement.dataset.type = track.type;\n videoElement.append(trackElement);\n\n return new Promise((resolve) => {\n trackElement.onload = () => {\n resolve(trackElement);\n };\n trackElement.onerror = () => {\n logWarning(\n 'OSCVideoPlayer',\n new Error('track onerror'),\n `Failed to fetch track ${track.url}`\n );\n videoElement.removeChild(trackElement);\n resolve(null);\n };\n trackElement.src = track.url;\n });\n}\n\nfunction getTrackId(track: Track) {\n return [track.language, track.label, track.url].filter(Boolean).join('-').toLowerCase();\n}\n","import { useId, useMemo } from 'react';\nimport { useQuery } from '@tanstack/react-query';\nimport { addTrackAsync } from '../util/add-track';\nimport { logWarning } from '@dx-ui/framework-logger';\n\nimport type { VideoPlayerProps } from './use-video-player';\nimport type { VideoTrack } from '../video-player.controls';\n\ntype UseTrackQueryOptions = VideoPlayerProps & {\n videoElement: React.RefObject<HTMLVideoElement>;\n};\n\n/**\n * Hook that asynchronously fetches and adds tracks to the video element.\n *\n * @see addTrackAsync\n */\nexport function useTrackQuery(options: UseTrackQueryOptions) {\n const id = useId();\n const videoElement = options.videoElement.current;\n const hasCaptions = Boolean(options.captionTracks?.length);\n const hasTranscripts = Boolean(options.transcriptTracks?.length);\n const hasAudioTracks = Boolean(options.audioTracks?.length);\n const hasTracks = hasCaptions || hasTranscripts || hasAudioTracks;\n const { defaultVideoTrack, baseVideoTrack } = useBaseTracks(options);\n const allTracks = useMemo(() => getFetchableTracks(options), [options]);\n\n const { data: videoTracks = [defaultVideoTrack] } = useQuery({\n enabled: Boolean(hasTracks && videoElement),\n queryKey: [`video:${id}`],\n queryFn: async () => {\n return Promise.all(\n allTracks.map((track) => addTrackAsync(videoElement as HTMLVideoElement, track))\n )\n .then((htmlTracks) => {\n return [baseVideoTrack, ...(options?.audioTracks || [])].map((videoTrack) => ({\n ...videoTrack,\n captionTracks: matchTracks({\n htmlTracks,\n videoTrack,\n type: 'captionTracks',\n }),\n transcriptTracks: matchTracks({\n htmlTracks,\n videoTrack,\n type: 'transcriptTracks',\n }),\n }));\n })\n .catch((error) => {\n logWarning('OSCVideoPlayer', error, 'Failed to fetch video tracks');\n return [defaultVideoTrack];\n });\n },\n });\n\n return videoTracks;\n}\n\nfunction getFetchableTracks(options: UseTrackQueryOptions) {\n const baseTracks = [...(options?.captionTracks || []), ...(options?.transcriptTracks || [])];\n const additionalTracks =\n options?.audioTracks?.flatMap((videoTrack) => [\n ...(videoTrack.captionTracks || []),\n ...(videoTrack.transcriptTracks || []),\n ]) || [];\n const tracksMap = new Map(\n [...baseTracks, ...additionalTracks].map((item) => [Object.values(item).join('-'), item])\n );\n return Array.from(tracksMap.values());\n}\n\nfunction matchTracks({\n htmlTracks,\n videoTrack,\n type,\n}: {\n htmlTracks: Awaited<ReturnType<typeof addTrackAsync>>[];\n videoTrack: NonNullable<VideoPlayerProps['audioTracks']>[number];\n type: keyof Pick<VideoTrack, 'captionTracks' | 'transcriptTracks'>;\n}) {\n return htmlTracks.filter((htmlTrack): htmlTrack is HTMLTrackElement =>\n (videoTrack[type] ?? []).some(\n (track) =>\n track.type === htmlTrack?.dataset.type &&\n track.label === htmlTrack.label &&\n track.url === htmlTrack.src\n )\n );\n}\n\nfunction useBaseTracks(options: UseTrackQueryOptions) {\n const baseVideoTrack = {\n videoUrl: options.videoUrl,\n videoGroup: options.videoGroup,\n videoLabel: options.videoLabel,\n captionTracks: options.captionTracks,\n transcriptTracks: options.transcriptTracks,\n };\n const defaultVideoTrack = {\n ...baseVideoTrack,\n captionTracks: [],\n transcriptTracks: [],\n };\n return {\n baseVideoTrack,\n defaultVideoTrack,\n };\n}\n","import { useCallback, useEffect, useRef } from 'react';\nimport { useBoolean, useEventListener } from 'usehooks-ts';\nimport type { VideoPlayerProps, PlayerState, useVideoPlayer } from './use-video-player';\n\ntype UseFadeControlsOptions = VideoPlayerProps &\n PlayerState & {\n videoElement: ReturnType<typeof useVideoPlayer>['videoProps']['videoElement'];\n };\n\nconst FADE_TIMEOUT_IN_MS = 3000;\n\n/**\n * Hook to manage the visibility of video controls.\n */\nexport function useFadeControls(props: UseFadeControlsOptions) {\n const { isPlaying, wrapperElement, videoElement, shouldControlsRemainVisible } = props;\n const elementRef = (wrapperElement || videoElement) as React.RefObject<HTMLElement>;\n const { value: isVisible, setTrue: setVisible, setFalse: setHidden } = useBoolean(true);\n const timeout = useRef(0);\n\n const hideControls = useCallback(() => {\n if (!shouldControlsRemainVisible) {\n if (isPlaying) {\n setHidden();\n }\n window.clearTimeout(timeout.current);\n }\n }, [setHidden, isPlaying, shouldControlsRemainVisible]);\n\n const showControls = useCallback(() => {\n setVisible();\n window.clearTimeout(timeout.current);\n }, [setVisible]);\n\n const fadeControls = useCallback(() => {\n if (isPlaying && !shouldControlsRemainVisible) {\n timeout.current = window.setTimeout(hideControls, FADE_TIMEOUT_IN_MS);\n }\n }, [hideControls, isPlaying, shouldControlsRemainVisible]);\n\n const handleKeyup = useCallback(\n (event: KeyboardEvent) => {\n if (!shouldControlsRemainVisible) {\n const isInteracting = elementRef.current?.contains(event.target as HTMLElement);\n isInteracting ? showControls() : hideControls();\n }\n },\n [elementRef, hideControls, showControls, shouldControlsRemainVisible]\n );\n\n useEffect(() => {\n isVisible || shouldControlsRemainVisible ? showControls() : fadeControls();\n }, [fadeControls, isVisible, showControls, shouldControlsRemainVisible]);\n\n useEventListener('mousemove', showControls, elementRef);\n useEventListener('mouseleave', hideControls, elementRef);\n useEventListener('keyup', handleKeyup);\n\n return { isVisible };\n}\n","import type { TrackOption, VideoTrack } from '../video-player.controls';\n\ntype FindArgs = {\n activeTrack: TrackOption;\n selectedVideoTrack: VideoTrack;\n};\n\n/**\n * @see findTrack\n */\nexport function findCaption({ selectedVideoTrack, activeTrack }: FindArgs) {\n return findTrack(selectedVideoTrack?.captionTracks, activeTrack);\n}\n\n/**\n * @see findTrack\n */\nexport function findTranscript({ selectedVideoTrack, activeTrack }: FindArgs) {\n return findTrack(selectedVideoTrack?.transcriptTracks, activeTrack);\n}\n\n/**\n * Attempts to find the related track based on the active track.\n */\nfunction findTrack(tracks: TrackOption[], activeTrack: TrackOption) {\n return tracks.find((track) => track.srclang === activeTrack.srclang) || tracks[0] || null;\n}\n","import set from 'lodash/set';\n\nexport function getMetricsTrackName(htmlTrack: HTMLTrackElement | null) {\n return htmlTrack ? formatName(htmlTrack.label) : 'off';\n}\n\nexport function getMetricsVideoName(videoName: string) {\n return formatName(videoName);\n}\n\nexport type Events =\n | 'user_play'\n | 'autoplay'\n | 'sound'\n | 'cc'\n | `sub_${string}`\n | `audiotrack_${string}`\n | `transcript_${string}`;\n\nexport function trackEvent(eventName: Events, videoName: string) {\n if (window._satellite && window.digitalData) {\n set(window.digitalData, 'click.clickID', `video_${eventName}`);\n set(window.digitalData, 'page.attributes.videoName', videoName);\n window._satellite.track?.('global_click');\n }\n}\n\nfunction formatName(name: string) {\n return name\n .replace(/[^a-zA-Z0-9 ]/g, '')\n .replace(/\\s/g, '_')\n .toLowerCase();\n}\n","import classnames from 'classnames';\n\ntype Args = {\n brandComponentTheme?: CmsBrandComponentTheme;\n};\n\nexport const getTextColorClasses = ({ brandComponentTheme }: Args) => {\n const isLight = brandComponentTheme === 'light';\n const isDark = brandComponentTheme === 'dark';\n return classnames({\n 'text-primary brand-ht:text-text-inverse': isLight,\n 'text-text-inverse brand-es:!text-primary brand-gu:!text-primary brand-hi-refresh:!text-primary brand-nd:!text-primary':\n isDark,\n });\n};\n\nexport const getBackgroundColorClasses = ({ brandComponentTheme }: Args) => {\n const isDark = brandComponentTheme === 'dark';\n const isLight = brandComponentTheme === 'light';\n return classnames({\n 'bg-bg brand-ey:bg-bg-light brand-ou:bg-secondary': !isDark && !isLight,\n 'bg-bg-dark brand-es:bg-bg brand-gu:bg-bg brand-hi-refresh:bg-bg brand-nd:bg-bg': isDark,\n 'bg-bg-light brand-es:bg-bg brand-ey:bg-bg brand-gu:bg-bg brand-hi-refresh:bg-bg brand-nd:bg-bg':\n isLight,\n });\n};\n\nexport const getClasses = ({ brandComponentTheme }: Args) => {\n return classnames(\n getTextColorClasses({ brandComponentTheme }),\n getBackgroundColorClasses({ brandComponentTheme })\n );\n};\n","import { useIsClient } from 'usehooks-ts';\nimport { Slider } from '@dx-ui/osc-slider';\nimport classnames from 'classnames';\nimport { useTranslation } from 'next-i18next';\nimport { getClasses } from './util/classes';\nimport type { VideoControlsProps } from './video-player.controls';\nimport type { PlayerState, useVideoPlayer } from './hooks/use-video-player';\n\ntype VolumeSliderProps = Pick<VideoControlsProps, 'brandComponentTheme'> &\n Pick<ReturnType<typeof useVideoPlayer>['videoControlsProps'], 'updateVolume' | 'playerState'>;\n\nconst volumeConfig = {\n min: 0,\n max: 100,\n step: 5,\n};\n\nexport const lowestVolume: PlayerState['volume'] = [volumeConfig.step];\n\nexport const initialVolume: PlayerState['volume'] = [\n Math.max(volumeConfig.step, Math.floor(volumeConfig.max / 2)),\n];\n\nexport function VolumeSlider({\n brandComponentTheme,\n playerState,\n updateVolume,\n}: VolumeSliderProps) {\n const isClient = useIsClient();\n const { t, i18n } = useTranslation('osc-video-player');\n const isDark = brandComponentTheme === 'dark';\n const volume = playerState.isMuted ? 0 : playerState.volume[0];\n\n if (!isClient) {\n return null;\n }\n\n return (\n <form\n className={classnames(\n 'sr-only !absolute bottom-12 shadow group-has-[:focus]:not-sr-only',\n 'group-has-[:focus]:!h-32 group-has-[:focus]:!w-full group-has-[:focus]:lg:!h-40',\n 'group-hover:not-sr-only group-hover:!h-32 group-hover:!w-full group-hover:lg:!h-40',\n getClasses({ brandComponentTheme })\n )}\n >\n <Slider\n title={t('volume.label')}\n hiddenLegend={true}\n inputLabels={[t('volume.button')]}\n thumbLabelFn={() => t('volume.ariaLabel', { volume })}\n values={[volume]}\n onChange={updateVolume}\n language={i18n.language}\n min={volumeConfig.min}\n max={volumeConfig.max}\n step={volumeConfig.step}\n fillIndex={1}\n orientation=\"vertical\"\n onColor={isDark ? 'color-bg' : 'color-primary'}\n variant=\"primary\"\n brandComponentTheme={brandComponentTheme}\n />\n </form>\n );\n}\n","import { useEventListener, useOnClickOutside, useToggle } from 'usehooks-ts';\nimport { useId, useRef } from 'react';\nimport { getKeyDownNavigation } from '@dx-ui/utilities-accessibility';\n\n/**\n * Hook to manage the state of a popup menu.\n */\nexport function useMenu() {\n const menuId = useId();\n const popupButtonRef = useRef<React.ElementRef<'button'>>(null);\n const popupMenuRef = useRef<React.ElementRef<'div'>>(null);\n const [isOpen, toggleMenu, setIsOpen] = useToggle();\n const closeMenu = () => setIsOpen(false);\n\n return {\n menuId,\n isOpen,\n toggleMenu,\n closeMenu,\n popupButtonRef,\n popupMenuRef,\n };\n}\n\ntype UseEventListenersOptions = Pick<\n ReturnType<typeof useMenu>,\n 'popupButtonRef' | 'popupMenuRef'\n> & {\n resetMenu: VoidFunction;\n};\n\n/**\n * Hook to manage event listeners for a popup menu.\n */\nexport function useEventListeners(options: UseEventListenersOptions) {\n const { popupButtonRef, popupMenuRef, resetMenu } = options;\n const focusButton = () => popupButtonRef.current?.focus();\n\n useOnClickOutside(popupMenuRef, (event) => {\n if (!popupButtonRef.current?.contains(event.target as HTMLElement)) {\n resetMenu();\n }\n });\n\n useEventListener(\n 'keydown',\n (event) => {\n event.stopPropagation();\n switch (event.key) {\n case 'Tab':\n window.requestAnimationFrame(() => {\n if (!popupMenuRef.current?.contains(document.activeElement)) {\n resetMenu();\n focusButton();\n }\n });\n break;\n case 'Escape':\n resetMenu();\n focusButton();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n {\n const activeList = popupMenuRef.current?.querySelector('ul');\n const elements = Array.from(activeList?.querySelectorAll('button') || []);\n const onKeyDownNavigation = getKeyDownNavigation({ elements });\n onKeyDownNavigation(event);\n }\n break;\n default:\n break;\n }\n },\n popupMenuRef\n );\n}\n","/**\n * Ensures the cue has text content.\n */\nexport function isValidCue(cue: VTTCue) {\n return cue.text.trim().length > 0;\n}\n\n/**\n * Generates a unique cue id.\n */\nexport function getCueId(cue: VTTCue) {\n return ['cue', cue.id, crypto.randomUUID()].filter(Boolean).join('-');\n}\n\n/**\n * Parses the VTTCue text and returns the text content.\n */\nexport function getCueText(cue: VTTCue) {\n try {\n const fragment = cue.getCueAsHTML();\n const text = fragment.textContent || '';\n const html = new XMLSerializer().serializeToString(fragment);\n return { text, html };\n } catch {\n return { text: cue.text, html: cue.text };\n }\n}\n\n/**\n * The smallest buffer to add to the cue startTime when adjusting the\n * video currentTime due to precision mismatch related to activeCues.\n * https://stackoverflow.com/questions/55777551/how-do-i-avoid-floating-point-rounding-errors-in-webvtt\n */\nexport const CUE_BUFFER = 0.00001;\n","import type { useId } from 'react';\n\nexport type EventType = ValuesOf<typeof VIDEO_EVENTS>;\n\nexport type VideoEventDetail = {\n type: EventType;\n id: ReturnType<typeof useId>;\n};\n\nexport const VIDEO_EVENTS = {\n PAUSE_OTHERS: 'pause-others',\n PAUSE_SELF: 'pause-self',\n} as const;\n\nexport const VIDEO_UPDATE_EVENT = 'video-player-update';\n\nexport const dispatchVideoEvent = (detail: VideoEventDetail) => {\n window.dispatchEvent(new CustomEvent<VideoEventDetail>(VIDEO_UPDATE_EVENT, { detail }));\n};\n","import { useRef, useState, useEffect, useCallback, useId } from 'react';\nimport { useEventListener } from 'usehooks-ts';\nimport { useAutoPlay } from './use-autoplay';\nimport { useTrackQuery } from '../hooks/use-track-query';\nimport { useFadeControls } from './use-fade-controls';\nimport { findCaption, findTranscript } from '../util/matchers';\nimport { getMetricsTrackName, getMetricsVideoName, trackEvent } from '../util/metrics';\n\nimport type { VideoTrack, TrackOption, BaseVideoTrack } from '../video-player.controls';\nimport { initialVolume, lowestVolume } from '../video-player.volume-slider';\nimport { useMenu } from './use-control-menu';\nimport { CUE_BUFFER } from '../util/cue';\nimport type { VideoEventDetail } from '../util/event-emitter';\nimport { dispatchVideoEvent, VIDEO_EVENTS, VIDEO_UPDATE_EVENT } from '../util/event-emitter';\nimport type { VideoProps } from '../video-player.player';\n\nexport type VideoPlayerProps = BaseVideoTrack &\n Pick<VideoProps, 'isAutoPlay' | 'captionData'> &\n Partial<{\n hasAudio: boolean;\n playerId: ReturnType<typeof useId>;\n audioTracks: BaseVideoTrack[];\n wrapperElement: React.RefObject<HTMLDivElement>;\n shouldControlsRemainVisible?: boolean;\n }>;\n\nexport type PlayerState = {\n isMuted: boolean;\n isPlaying: boolean;\n showCaptions: boolean;\n activeCaptionTrack: TrackOption | null;\n activeTranscript: TrackOption | null;\n activeVideoTrack: VideoTrack | null;\n volume: Tuple<1, number>;\n};\n\nconst defaultPlayerState: PlayerState = {\n isMuted: true,\n isPlaying: true,\n showCaptions: false,\n activeCaptionTrack: null,\n activeTranscript: null,\n activeVideoTrack: null,\n volume: initialVolume,\n};\n\n/**\n * Hook to manage the state and behavior of the video player.\n */\nexport function useVideoPlayer(props: VideoPlayerProps) {\n const videoElement = useRef<HTMLVideoElement>(null);\n const internalPlayerId = useId();\n const playerId = props.playerId ?? internalPlayerId;\n const hasAudio = props.hasAudio ?? true;\n const hookProps = { ...props, videoElement };\n const [playerState, setPlayerState] = useState<PlayerState>(() => {\n try {\n const videoPlayerSettings: Partial<PlayerState> = JSON.parse(\n localStorage.getItem('videoPlayerSettings') || '{}'\n );\n return { ...defaultPlayerState, ...videoPlayerSettings };\n } catch {\n return defaultPlayerState;\n }\n });\n const optionsState = useTrackQuery(hookProps);\n const controlsState = useFadeControls({ ...hookProps, ...playerState });\n const settingsMenu = useMenu();\n const activeVideo = playerState.activeVideoTrack || optionsState[0];\n const videoName = getMetricsVideoName(props.videoName ?? '');\n\n const playVideo = useCallback(() => {\n void videoElement.current?.play()?.catch(() => null);\n }, []);\n\n const pauseVideo = useCallback(() => videoElement.current?.pause(), []);\n\n const muteVideo = useCallback(() => {\n if (videoElement.current) {\n videoElement.current.muted = true;\n videoElement.current.volume = 0;\n }\n }, []);\n\n const unmuteVideo = useCallback(([volume]: PlayerState['volume']) => {\n if (videoElement.current) {\n videoElement.current.muted = false;\n videoElement.current.volume = volume / 100;\n }\n }, []);\n\n function togglePlayButton() {\n setPlayerState((playerState) => {\n const isPlaying = !playerState.isPlaying;\n if (isPlaying) {\n playVideo();\n if (hasAudio) {\n dispatchVideoEvent({ type: VIDEO_EVENTS.PAUSE_OTHERS, id: playerId });\n }\n trackEvent('user_play', videoName);\n } else {\n pauseVideo();\n }\n return { ...playerState, isPlaying };\n });\n }\n\n function persistSettings(state: Partial<PlayerState>) {\n localStorage.setItem('videoPlayerSettings', JSON.stringify(state));\n }\n\n function performAudioActions({ isMuted, isPlaying, volume }: PlayerState) {\n if (isMuted) {\n muteVideo();\n } else {\n unmuteVideo(volume);\n if (isPlaying) {\n dispatchVideoEvent({ type: VIDEO_EVENTS.PAUSE_OTHERS, id: playerId });\n }\n }\n persistSettings({ volume });\n }\n\n function updateVolume(volume: PlayerState['volume']) {\n setPlayerState((playerState) => {\n const isMuted = volume[0] <= 0;\n const state = { ...playerState, isMuted, volume };\n performAudioActions(state);\n return state;\n });\n }\n\n function toggleMuteButton() {\n setPlayerState((playerState) => {\n const isMuted = !playerState.isMuted;\n const volume = playerState.volume[0] <= 0 ? lowestVolume : playerState.volume;\n const state = { ...playerState, isMuted, volume };\n trackEvent('sound', videoName);\n performAudioActions(state);\n return state;\n });\n }\n\n function toggleCaptions() {\n setPlayerState((playerState) => {\n trackEvent('cc', videoName);\n const showCaptions = !playerState.showCaptions;\n return { ...playerState, showCaptions };\n });\n }\n\n function updateCaption(selectedCaption: PlayerState['activeCaptionTrack']) {\n setPlayerState((playerState) => {\n const isSingleCaption = (activeVideo?.captionTracks?.length ?? 1) === 1;\n const trackName = getMetricsTrackName(selectedCaption);\n const eventName = isSingleCaption ? 'cc' : (`sub_${trackName}` as const);\n trackEvent(eventName, videoName);\n return {\n ...playerState,\n showCaptions: Boolean(selectedCaption),\n activeCaptionTrack: selectedCaption || playerState.activeCaptionTrack,\n };\n });\n }\n\n function updateTranscript(selectedTranscript: PlayerState['activeTranscript']) {\n setPlayerState((playerState) => {\n const trackName = getMetricsTrackName(selectedTranscript);\n const eventName = `transcript_${trackName}` as const;\n trackEvent(eventName, videoName);\n return { ...playerState, activeTranscript: selectedTranscript };\n });\n }\n\n function updateAudioTrack(selectedVideoTrack: NonNullable<PlayerState['activeVideoTrack']>) {\n setPlayerState((playerState) => {\n if (playerState.activeVideoTrack?.videoUrl === selectedVideoTrack.videoUrl) {\n return playerState;\n }\n\n const activeCaptionTrack = playerState.activeCaptionTrack\n ? findCaption({ selectedVideoTrack, activeTrack: playerState.activeCaptionTrack })\n : null;\n\n const activeTranscript = playerState.activeTranscript\n ? findTranscript({ selectedVideoTrack, activeTrack: playerState.activeTranscript })\n : null;\n\n if (videoElement.current) {\n const isGroupMatch = activeVideo?.videoGroup === selectedVideoTrack.videoGroup;\n const currentTime = isGroupMatch ? videoElement.current.currentTime : 0;\n videoElement.current.src = selectedVideoTrack.videoUrl;\n videoElement.current.currentTime = currentTime;\n }\n\n const videoLabel = getMetricsVideoName(selectedVideoTrack.videoLabel || '');\n const eventName = `audiotrack_${videoLabel}` as const;\n trackEvent(eventName, videoName);\n playerState.isPlaying ? playVideo() : pauseVideo();\n\n return {\n ...playerState,\n activeTranscript,\n activeCaptionTrack,\n activeVideoTrack: selectedVideoTrack,\n };\n });\n }\n\n function closeTranscript() {\n updateTranscript(null);\n settingsMenu.popupButtonRef.current?.focus();\n }\n\n function onCueSelect(cue: VTTCue) {\n if (videoElement.current) {\n const adjustedTime = cue.startTime + CUE_BUFFER;\n videoElement.current.currentTime = adjustedTime;\n }\n }\n\n const isAutoPlay = useAutoPlay({\n isAutoPlay: props.isAutoPlay ?? defaultPlayerState.isPlaying,\n });\n\n useEffect(() => {\n setPlayerState((playerState) => {\n if (isAutoPlay) {\n muteVideo();\n playVideo();\n } else {\n unmuteVideo(playerState.volume);\n pauseVideo();\n }\n return {\n ...playerState,\n isMuted: isAutoPlay,\n isPlaying: isAutoPlay,\n };\n });\n }, [isAutoPlay, muteVideo, pauseVideo, playVideo, unmuteVideo]);\n\n useEffect(() => {\n if (playerState.showCaptions) {\n const inActiveCaptionTracks = (activeVideo?.captionTracks ?? []).filter(\n (option): option is HTMLTrackElement => option.src !== playerState.activeCaptionTrack?.src\n );\n\n if (inActiveCaptionTracks.length) {\n inActiveCaptionTracks.forEach((track) => {\n track.track.oncuechange = null;\n });\n }\n\n if (playerState.activeCaptionTrack) {\n playerState.activeCaptionTrack.track.oncuechange = () => {\n setPlayerState((playerState) => ({\n ...playerState,\n activeCaptionTrack: playerState.activeCaptionTrack,\n }));\n };\n }\n } else {\n if (playerState.activeCaptionTrack) {\n playerState.activeCaptionTrack.track.oncuechange = null;\n }\n }\n }, [activeVideo?.captionTracks, playerState.activeCaptionTrack, playerState.showCaptions]);\n\n useEventListener('metrics-ready', () => {\n if (isAutoPlay && videoName) {\n trackEvent('autoplay', videoName);\n }\n });\n\n useEventListener(VIDEO_UPDATE_EVENT, (event: CustomEvent<VideoEventDetail>) => {\n const isPauseOthersEvent = event.detail.type === VIDEO_EVENTS.PAUSE_OTHERS;\n const isPauseSelfEvent = event.detail.type === VIDEO_EVENTS.PAUSE_SELF;\n const isPauseEvent = isPauseOthersEvent || isPauseSelfEvent;\n\n if (hasAudio && playerState.isPlaying && isPauseEvent) {\n const isOtherVideo = event.detail.id !== playerId;\n const isSameVideo = event.detail.id === playerId;\n const shouldPauseAll = isPauseOthersEvent && isOtherVideo;\n const shouldPauseSelf = isPauseSelfEvent && isSameVideo;\n if (shouldPauseAll || shouldPauseSelf) {\n togglePlayButton();\n }\n }\n });\n\n return {\n videoProps: {\n videoElement,\n },\n videoCaptionProps: {\n showCaptions: playerState.showCaptions,\n activeCaptionTrack: playerState.activeCaptionTrack,\n },\n videoTranscriptProps: {\n activeTranscript: playerState.activeTranscript,\n closeTranscript,\n onCueSelect,\n },\n videoControlsProps: {\n controlsState,\n activeVideo,\n playerState,\n optionsState,\n togglePlayButton,\n toggleMuteButton,\n toggleCaptions,\n settingsMenu,\n updateCaption,\n updateTranscript,\n updateAudioTrack,\n updateVolume,\n videoElement,\n hasAudio,\n },\n };\n}\n","import classnames from 'classnames';\nimport { Caption } from '@dx-ui/osc-caption';\nimport type { CaptionProps } from '@dx-ui/osc-caption';\nimport { logWarning } from '@dx-ui/framework-logger';\nimport { useAutoPlay } from './hooks/use-autoplay';\n\ntype VideoElement = React.ComponentProps<'video'>;\n\nexport type VideoProps = Omit<VideoElement, 'src' | 'autoPlay' | 'id' | 'poster'> & {\n /**\n * The location (URL) of the video file\n */\n videoUrl: NonNullable<VideoElement['src']>;\n /**\n * Ref that gets added to the video element.\n */\n videoElement: React.RefObject<HTMLVideoElement>;\n /**\n * The poster for the video\n */\n posterImageUrl?: VideoElement['poster'];\n videoId?: VideoElement['id'];\n /**\n * When present, the video will automatically start playing.\n */\n isAutoPlay?: VideoElement['autoPlay'];\n /**\n * Caption link and text\n */\n captionData?: CaptionProps;\n /**\n * Classname for the Video tag\n */\n videoClassName?: React.ComponentProps<'div'>['className'];\n /**\n * Classname for the Figure tag\n */\n figureClassName?: React.ComponentProps<'div'>['className'];\n};\n\n/**\n * Provides the ability to play videos on a continuous loop with optional caption.\n */\nexport function Video({\n videoUrl,\n posterImageUrl,\n videoElement,\n videoId,\n captionData,\n isAutoPlay = true,\n muted = isAutoPlay,\n figureClassName,\n videoClassName,\n ...rest\n}: VideoProps) {\n const preventPreload = posterImageUrl && !isAutoPlay;\n const autoPlay = useAutoPlay({ isAutoPlay });\n\n return (\n <figure className={figureClassName}>\n {videoUrl ? (\n <div className={classnames('relative w-full overflow-hidden', rest.className)}>\n <video\n id={videoId}\n data-testid=\"video-player\"\n loop\n playsInline\n {...rest}\n className={classnames('w-full bg-bg-alt object-cover', videoClassName)}\n src={videoUrl}\n poster={posterImageUrl}\n autoPlay={autoPlay}\n muted={muted}\n ref={videoElement}\n crossOrigin=\"anonymous\"\n preload={preventPreload ? 'none' : undefined}\n onError={(e) => {\n logWarning(\n 'OSCVideoPlayer',\n new Error('video onError'),\n `Failed to load ${videoUrl}`\n );\n rest.onError?.(e);\n }}\n />\n </div>\n ) : null}\n\n {captionData ? <Caption {...captionData} /> : null}\n </figure>\n );\n}\n","import classnames from 'classnames';\nimport { forwardRef } from 'react';\nimport type { VideoControlsProps } from './video-player.controls';\nimport { getClasses } from './util/classes';\n\ntype ControlButtonProps = Omit<React.ComponentProps<'button'>, 'type'> &\n Pick<VideoControlsProps, 'brandComponentTheme'> & {\n iconContent: React.ReactNode;\n wrapperClassName?: React.ComponentProps<'li'>['className'];\n };\n\nconst ControlButton = forwardRef<HTMLButtonElement, ControlButtonProps>(function ControlButton(\n props,\n ref\n) {\n const { brandComponentTheme, children, iconContent, wrapperClassName, ...buttonProps } = props;\n return (\n <li className={wrapperClassName}>\n <button\n {...buttonProps}\n ref={ref}\n type=\"button\"\n className={classnames(\n 'relative z-1 inline-flex size-12 items-center justify-center bg-bg focus:z-2',\n getClasses({ brandComponentTheme }),\n buttonProps.className\n )}\n >\n {iconContent}\n </button>\n {children}\n </li>\n );\n});\n\nexport { ControlButton };\n","import { Icon } from '@dx-ui/osc-icon';\nimport classnames from 'classnames';\nimport type { VideoControlsProps } from './video-player.controls';\n\nexport function ControlIcon({\n brandComponentTheme,\n ...iconProps\n}: React.ComponentProps<typeof Icon> & Pick<VideoControlsProps, 'brandComponentTheme'>) {\n const isDark = brandComponentTheme === 'dark';\n const isLight = brandComponentTheme === 'light';\n return (\n <Icon\n {...iconProps}\n className={classnames(\n 'fill-primary',\n {\n 'fill-text-inverse brand-es:fill-primary brand-gu:fill-primary brand-hi-refresh:fill-primary brand-nd:fill-primary':\n isDark,\n 'brand-ht:fill-text-inverse': isLight,\n },\n iconProps.className\n )}\n />\n );\n}\n","import { useEffect, useState } from 'react';\nimport classnames from 'classnames';\nimport type { useMenu } from './hooks/use-control-menu';\nimport type { VideoControlsProps } from './video-player.controls';\nimport { getClasses } from './util/classes';\n\nexport function ControlMenu(\n props: ReturnType<typeof useMenu> &\n Pick<VideoControlsProps, 'brandComponentTheme'> &\n Pick<React.ComponentProps<'div'>, 'children' | 'className'> & {\n wrapperRef: React.RefObject<HTMLElement>;\n }\n) {\n const { brandComponentTheme, menuId, popupMenuRef, isOpen, children, className } = props;\n const isDark = brandComponentTheme === 'dark';\n const maxHeight = useSafeMaxHeight(props);\n\n return (\n <div\n id={menuId}\n ref={popupMenuRef}\n style={maxHeight ? { maxHeight: `${maxHeight}px` } : {}}\n className={classnames(\n 'absolute bottom-full start-0 w-full border-y border-border shadow-md md:min-w-60',\n getClasses({ brandComponentTheme }),\n {\n 'overflow-y-auto overscroll-contain': Boolean(maxHeight),\n 'border-bg-dark': isDark,\n 'motion-safe:animate-fadein': isOpen,\n 'motion-safe:animate-fadeout': !isOpen,\n hidden: !isOpen,\n },\n className\n )}\n >\n {children}\n </div>\n );\n}\n\nfunction useSafeMaxHeight(props: React.ComponentProps<typeof ControlMenu>) {\n const [maxHeight, setMaxHeight] = useState<number | null>(null);\n const { isOpen, wrapperRef, popupMenuRef, popupButtonRef } = props;\n\n useEffect(() => {\n const wrapperRect = wrapperRef.current?.getBoundingClientRect();\n const menuRect = popupMenuRef.current?.getBoundingClientRect();\n const buttonRect = popupButtonRef.current?.getBoundingClientRect();\n\n setMaxHeight(() => {\n if (isOpen && menuRect && wrapperRect && buttonRect) {\n const offset = wrapperRect.bottom - menuRect.bottom;\n const buttonOffset = buttonRect.height / 2;\n return wrapperRect.height - offset - buttonOffset;\n }\n return null;\n });\n }, [isOpen, popupButtonRef, popupMenuRef, wrapperRef]);\n\n return maxHeight;\n}\n","import classnames from 'classnames';\nimport type { VideoControlsProps } from './video-player.controls';\nimport { getClasses } from './util/classes';\n\nexport function ControlList(\n props: Omit<React.ComponentProps<'ul'>, 'role'> & Pick<VideoControlsProps, 'brandComponentTheme'>\n) {\n const { children, brandComponentTheme, ...listProps } = props;\n\n return (\n <ul\n {...listProps}\n role=\"menu\"\n className={classnames(\n 'flex w-full flex-col divide-y divide-border motion-safe:animate-fadein',\n getClasses({ brandComponentTheme }),\n listProps.className\n )}\n >\n {children}\n </ul>\n );\n}\n","import classnames from 'classnames';\nimport type { VideoControlsProps } from './video-player.controls';\nimport { getTextColorClasses } from './util/classes';\n\nexport function ControlItem({\n brandComponentTheme,\n beforeSection,\n afterSection,\n children,\n wrapperClassName,\n ...buttonProps\n}: {\n beforeSection?: React.ReactNode;\n afterSection?: React.ReactNode;\n} & Omit<React.ComponentProps<'button'>, 'type'> &\n Pick<VideoControlsProps, 'brandComponentTheme'> & {\n wrapperClassName?: React.ComponentProps<'li'>['className'];\n }) {\n return (\n <li className={classnames('p-1.5', wrapperClassName)}>\n <button\n {...buttonProps}\n type=\"button\"\n className={classnames(\n 'relative flex w-full items-center gap-1 p-1 text-start focus:z-2',\n buttonProps.className\n )}\n >\n {beforeSection}\n <span\n className={classnames(\n 'text-primary underline',\n getTextColorClasses({ brandComponentTheme })\n )}\n >\n {children}\n </span>\n {afterSection}\n </button>\n </li>\n );\n}\n","import classnames from 'classnames';\nimport { useState } from 'react';\nimport { useTranslation } from 'next-i18next';\nimport type { useMenu } from './hooks/use-control-menu';\nimport { useEventListeners } from './hooks/use-control-menu';\nimport { ControlIcon } from './video-player.control-icon';\nimport { ControlButton } from './video-player.control-button';\nimport { ControlMenu } from './video-player.control-menu';\nimport { ControlList } from './video-player.control-list';\nimport { ControlItem } from './video-player.control-item';\nimport { getClasses } from './util/classes';\nimport type { Track, TrackOption, VideoControlsProps } from './video-player.controls';\nimport type { useVideoPlayer } from './hooks/use-video-player';\n\ntype SettingsMenuProps = Pick<VideoControlsProps, 'brandComponentTheme'> &\n Pick<\n ReturnType<typeof useVideoPlayer>['videoControlsProps'],\n | 'activeVideo'\n | 'updateAudioTrack'\n | 'updateCaption'\n | 'updateTranscript'\n | 'optionsState'\n | 'playerState'\n | 'videoElement'\n > & {\n menuProps: ReturnType<typeof useMenu>;\n };\n\nexport function SettingsMenu(props: SettingsMenuProps) {\n const { brandComponentTheme } = props;\n const { t } = useTranslation('osc-video-player');\n const menuOptions = useMenuOptions(props);\n const { isOpen, toggleMenu, menuId, popupButtonRef, popupMenuRef } = menuOptions;\n\n return (\n <ControlButton\n aria-label={t('settings')}\n aria-controls={menuId}\n aria-haspopup\n aria-expanded={isOpen}\n ref={popupButtonRef}\n onClick={toggleMenu}\n brandComponentTheme={brandComponentTheme}\n iconContent={\n <>\n <ControlIcon\n name=\"settings\"\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: isOpen })}\n />\n <ControlIcon\n name=\"settings\"\n variant=\"solid\"\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: !isOpen })}\n />\n </>\n }\n >\n <ControlMenu {...menuOptions} wrapperRef={props.videoElement}>\n {isOpen ? (\n <Menu\n {...props}\n {...menuOptions}\n popupButtonRef={popupButtonRef}\n popupMenuRef={popupMenuRef}\n />\n ) : null}\n </ControlMenu>\n </ControlButton>\n );\n}\n\ntype MenuProps = ReturnType<typeof useMenuOptions>;\ntype ControlMenuProps = SettingsMenuProps & MenuProps;\n\nfunction Menu({\n menuOptions,\n brandComponentTheme,\n closeMenu,\n popupButtonRef,\n popupMenuRef,\n goToMainMenu,\n}: ControlMenuProps) {\n function resetMenu() {\n closeMenu();\n goToMainMenu();\n }\n\n useEventListeners({\n popupMenuRef,\n popupButtonRef,\n resetMenu,\n });\n\n const selectedOption = menuOptions.find((option) => option.isSelected);\n const isDark = brandComponentTheme === 'dark';\n const isLight = brandComponentTheme === 'light';\n\n if (selectedOption) {\n return (\n <ControlList key={selectedOption.type} brandComponentTheme={brandComponentTheme}>\n {selectedOption.options.map((subOption) => (\n <ControlItem\n key={subOption.label}\n brandComponentTheme={brandComponentTheme}\n onClick={() => {\n selectedOption.onSelection(subOption.track);\n resetMenu();\n popupButtonRef.current?.focus();\n }}\n role=\"menuitemradio\"\n aria-checked={subOption.isSelected}\n autoFocus={subOption.isSelected}\n beforeSection={\n <ControlIcon\n size=\"sm\"\n name=\"check\"\n brandComponentTheme={brandComponentTheme}\n className={classnames({ '!fill-transparent': !subOption.isSelected })}\n />\n }\n >\n {subOption.label}\n </ControlItem>\n ))}\n <ControlItem\n key={selectedOption.type}\n brandComponentTheme={brandComponentTheme}\n wrapperClassName={classnames(\n { 'bg-bg-alt': !isLight && !isDark },\n getClasses({ brandComponentTheme })\n )}\n onClick={goToMainMenu}\n beforeSection={\n <ControlIcon\n size=\"sm\"\n name=\"arrowhead-left\"\n brandComponentTheme={brandComponentTheme}\n className=\"rtl:rotate-180\"\n />\n }\n autoFocus={!selectedOption.options.some((subOption) => subOption.isSelected)}\n aria-expanded={true}\n >\n {selectedOption.label}\n </ControlItem>\n </ControlList>\n );\n }\n\n return (\n <ControlList brandComponentTheme={brandComponentTheme}>\n {menuOptions.map((option, index) => (\n <ControlItem\n key={option.type}\n brandComponentTheme={brandComponentTheme}\n onClick={option.onMenuOptionClick}\n className=\"justify-between\"\n autoFocus={index === 0}\n aria-expanded={false}\n afterSection={\n <ControlIcon\n size=\"sm\"\n name=\"arrowhead-left\"\n brandComponentTheme={brandComponentTheme}\n className=\"rotate-180 rtl:rotate-0\"\n />\n }\n >\n {option.label}\n </ControlItem>\n ))}\n </ControlList>\n );\n}\n\ntype Option = {\n isSelected: boolean;\n label: TrackOption['label'];\n track: TrackOption | null;\n};\n\ntype SelectOption = Pick<Option, 'isSelected'> & {\n label: React.ReactNode;\n type: Track['type'];\n options: Option[];\n onSelection: (option: TrackOption | null) => void;\n onMenuOptionClick: () => void;\n};\n\nfunction useMenuOptions(options: SettingsMenuProps) {\n const { t } = useTranslation('osc-video-player');\n const [selectedOption, setSelectedOption] = useState<Track['type'] | 'mainMenu'>('mainMenu');\n const captionOptions = options.activeVideo?.captionTracks || [];\n const hasCaptions = captionOptions.length > 1;\n const hasAudioTracks = options.optionsState.length > 1;\n const transcriptOptions = options.activeVideo?.transcriptTracks || [];\n const hasTranscripts = transcriptOptions.length > 0;\n const goToMainMenu = () => setSelectedOption('mainMenu');\n\n const menuOptions = [\n hasCaptions && {\n type: 'captionTrack',\n label: (\n <>\n {t('subtitles')}/<abbr title={t('captions')}>{t('cc')}</abbr>\n </>\n ),\n isSelected: selectedOption === 'captionTrack',\n onSelection: options.updateCaption,\n onMenuOptionClick: () => setSelectedOption('captionTrack'),\n options: [\n {\n isSelected: !options.playerState.showCaptions,\n label: t('off'),\n track: null,\n },\n ...captionOptions.map((track) => ({\n isSelected:\n options.playerState.showCaptions &&\n options.playerState.activeCaptionTrack?.src === track.src,\n label: track.label,\n track,\n })),\n ],\n },\n hasAudioTracks && {\n type: 'audioTrack',\n label: t('audioTrack'),\n isSelected: selectedOption === 'audioTrack',\n onSelection: options.updateAudioTrack,\n onMenuOptionClick: () => setSelectedOption('audioTrack'),\n options: options.optionsState.map((track) => ({\n isSelected: options.activeVideo?.videoUrl === track.videoUrl,\n label: track.videoLabel,\n track,\n })),\n },\n hasTranscripts && {\n type: 'transcriptTrack',\n label: t('transcript'),\n isSelected: selectedOption === 'transcriptTrack',\n onSelection: options.updateTranscript,\n onMenuOptionClick: () => setSelectedOption('transcriptTrack'),\n options: [\n {\n isSelected: !options.playerState.activeTranscript,\n label: t('off'),\n track: null,\n },\n ...transcriptOptions.map((track) => ({\n isSelected: options.playerState.activeTranscript?.src === track.src,\n label: track.label,\n track,\n })),\n ],\n },\n ].filter(Boolean) as SelectOption[];\n\n return {\n ...options.menuProps,\n goToMainMenu,\n menuOptions,\n };\n}\n","import { useRef } from 'react';\nimport { useTranslation } from 'next-i18next';\nimport { useEventListener } from 'usehooks-ts';\nimport classnames from 'classnames';\nimport { ControlButton } from './video-player.control-button';\nimport { ControlIcon } from './video-player.control-icon';\nimport { SettingsMenu } from './video-player.settings-menu';\nimport { VolumeSlider } from './video-player.volume-slider';\nimport type { useVideoPlayer } from './hooks/use-video-player';\nimport { getKeyDownNavigation } from '@dx-ui/utilities-accessibility';\nimport { getClasses } from './util/classes';\n\nexport type Track = {\n type: StringWithAutocompleteOptions<'captionTrack' | 'transcriptTrack' | 'audioTrack'>;\n url: string;\n label: string;\n language: string;\n};\n\nexport type BaseVideoTrack = {\n videoGroup?: 'standard' | 'extended';\n videoLabel?: string;\n videoName?: string;\n videoUrl: string;\n isMuted?: boolean;\n altText?: string;\n captionTracks?: Track[];\n transcriptTracks?: Track[];\n};\n\nexport type TrackOption = HTMLTrackElement;\n\nexport type VideoTrack = Omit<BaseVideoTrack, 'captionTracks' | 'transcriptTracks'> & {\n captionTracks: TrackOption[];\n transcriptTracks: TrackOption[];\n};\n\nexport type VideoControlsProps = {\n /** Used to help with positioning of the controls */\n className?: string;\n /** For color theming */\n brandComponentTheme?: CmsBrandComponentTheme;\n videoVariant?: 'cinemagraph';\n};\n\n/**\n * A set of video controls for internal video sources that includes pause/play, mute/unmute, and closed captions.\n *\n * This should generally be used with the `useVideoPlayer` hook from `@dx-ui/osc-video-player`.\n * The hook provides the necessary state and functions to control the video player.\n * Consumers can spread the props from the videoControlsProps returned from the hook.\n *\n * Accepts className to add your own placement and styles to the component.\n */\nexport function VideoControls(\n props: ReturnType<typeof useVideoPlayer>['videoControlsProps'] & VideoControlsProps\n) {\n const {\n className,\n brandComponentTheme,\n controlsState,\n playerState,\n activeVideo,\n optionsState,\n toggleCaptions,\n toggleMuteButton,\n togglePlayButton,\n settingsMenu,\n updateCaption,\n updateTranscript,\n updateAudioTrack,\n updateVolume,\n videoVariant,\n hasAudio,\n videoElement,\n } = props;\n const { t } = useTranslation('osc-video-player');\n const listRef = useRef<React.ElementRef<'ul'>>(null);\n const hasCaptions = (activeVideo?.captionTracks || []).length > 0;\n const hasMultipleCaptions = (activeVideo?.captionTracks || []).length > 1;\n const hasTranscripts = (activeVideo?.transcriptTracks || []).length > 0;\n const hasAudioDescriptions = optionsState.length > 1;\n const hasSettings = hasMultipleCaptions || hasTranscripts || hasAudioDescriptions;\n const isSettingsMenuOpen = settingsMenu?.isOpen;\n const isCinemagraph = videoVariant === 'cinemagraph';\n\n useEventListener(\n 'keydown',\n (event) => {\n const target = event.target as HTMLButtonElement;\n if (event.key === 'ArrowLeft' || event.key === 'ArrowRight') {\n if (!target?.id?.includes('slider-thumb')) {\n event.preventDefault();\n const elements = Array.from(listRef.current?.querySelectorAll('button') || []);\n const onKeyDownNavigation = getKeyDownNavigation({ elements });\n onKeyDownNavigation(event);\n }\n }\n },\n listRef\n );\n\n const pauseButtonLabel = isCinemagraph ? t('pauseAnimation') : t('pause');\n const playButtonLabel = isCinemagraph ? t('playAnimation') : t('play');\n return (\n <div className={className} data-testid=\"video-controls\">\n <ul\n className={classnames(\n 'relative z-10 inline-flex divide-x divide-border bg-bg shadow-md motion-safe:transition-opacity rtl:divide-x-reverse',\n getClasses({ brandComponentTheme }),\n {\n 'opacity-100': controlsState.isVisible,\n 'opacity-0': !controlsState.isVisible,\n }\n )}\n data-testid=\"testBackgroundCss\"\n ref={listRef}\n >\n <ControlButton\n aria-label={playerState.isPlaying ? pauseButtonLabel : playButtonLabel}\n brandComponentTheme={brandComponentTheme}\n onClick={togglePlayButton}\n iconContent={\n <>\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: !playerState.isPlaying })}\n name=\"pause\"\n />\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: playerState.isPlaying })}\n name=\"play\"\n />\n </>\n }\n />\n {hasAudio ? (\n <ControlButton\n aria-label={playerState.isMuted ? t('unmute') : t('mute')}\n brandComponentTheme={brandComponentTheme}\n onClick={toggleMuteButton}\n wrapperClassName=\"group relative\"\n iconContent={\n <>\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: !playerState.isMuted })}\n name=\"sound-off\"\n />\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: playerState.isMuted })}\n name=\"sound-on\"\n />\n </>\n }\n >\n {!isSettingsMenuOpen ? (\n <VolumeSlider\n brandComponentTheme={brandComponentTheme}\n playerState={playerState}\n updateVolume={updateVolume}\n />\n ) : null}\n </ControlButton>\n ) : null}\n {hasCaptions ? (\n <ControlButton\n aria-label={t('captions')}\n aria-pressed={Boolean(playerState.activeCaptionTrack)}\n brandComponentTheme={brandComponentTheme}\n onClick={() => {\n const currentTrack = playerState.activeCaptionTrack;\n const firstTrack = activeVideo?.captionTracks?.[0] as HTMLTrackElement;\n currentTrack ? toggleCaptions() : updateCaption(firstTrack);\n }}\n iconContent={\n <>\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: !playerState.showCaptions })}\n variant=\"solid\"\n name=\"closed-captions\"\n />\n <ControlIcon\n brandComponentTheme={brandComponentTheme}\n className={classnames({ hidden: playerState.showCaptions })}\n name=\"closed-captions\"\n />\n </>\n }\n />\n ) : null}\n {hasSettings ? (\n <SettingsMenu\n brandComponentTheme={brandComponentTheme}\n activeVideo={activeVideo}\n optionsState={optionsState}\n playerState={playerState}\n updateAudioTrack={updateAudioTrack}\n updateTranscript={updateTranscript}\n updateCaption={updateCaption}\n menuProps={settingsMenu}\n videoElement={videoElement}\n />\n ) : null}\n </ul>\n </div>\n );\n}\n","import classnames from 'classnames';\nimport type { VideoControlsProps } from './video-player.controls';\nimport type { useVideoPlayer } from './hooks/use-video-player';\nimport { isValidCue, getCueText } from './util/cue';\n\ntype VideoCaptionsProps = ReturnType<typeof useVideoPlayer>['videoCaptionProps'] &\n Pick<VideoControlsProps, 'brandComponentTheme'> &\n React.ComponentProps<'div'>;\n\nexport function VideoCaptions({\n showCaptions,\n activeCaptionTrack,\n brandComponentTheme: _brandComponentTheme,\n ...elementProps\n}: VideoCaptionsProps) {\n const activeCues = showCaptions\n ? (Array.from(activeCaptionTrack?.track.activeCues ?? []) as VTTCue[]).filter(isValidCue)\n : [];\n\n if (activeCues.length) {\n return (\n <div\n {...elementProps}\n className={classnames(\n 'flex flex-col items-center justify-center overflow-auto bg-text/75 p-2 text-text-inverse lg:text-lg',\n elementProps.className\n )}\n >\n {activeCues.map((cue) => (\n <div\n key={cue.text}\n dangerouslySetInnerHTML={{\n __html: getCueText(cue).html,\n }}\n />\n ))}\n </div>\n );\n }\n\n return null;\n}\n","import type { VideoControlsProps } from './video-player.controls';\nimport type { useVideoPlayer } from './hooks/use-video-player';\nimport { useTranslation } from 'next-i18next';\nimport { Icon } from '@dx-ui/osc-icon';\nimport classnames from 'classnames';\nimport { useState, useMemo, useRef, useEffect, useCallback } from 'react';\nimport { useEventListener, useBoolean } from 'usehooks-ts';\nimport { getKeyDownNavigation } from '@dx-ui/utilities-accessibility';\nimport { BrandButton } from '@dx-ui/osc-brand-buttons';\nimport { isValidCue, getCueText, getCueId } from './util/cue';\nimport './video-player.css';\n\ntype PlayerTranscriptProps = ReturnType<typeof useVideoPlayer>['videoTranscriptProps'];\n\ntype VideoTranscriptProps = PlayerTranscriptProps &\n Pick<VideoControlsProps, 'brandComponentTheme'> &\n React.ComponentProps<'div'>;\n\ntype TranscriptProps = VideoTranscriptProps & {\n activeTranscript: NonNullable<VideoTranscriptProps['activeTranscript']>;\n};\n\nexport function VideoTranscript(props: VideoTranscriptProps) {\n return props.activeTranscript ? (\n <Transcript {...props} activeTranscript={props.activeTranscript} />\n ) : null;\n}\n\nfunction Transcript({\n activeTranscript,\n closeTranscript,\n onCueSelect,\n brandComponentTheme,\n ...elementProps\n}: TranscriptProps) {\n const { t } = useTranslation('osc-video-player');\n\n return (\n <div {...elementProps} className={classnames('relative bg-bg p-4', elementProps.className)}>\n <div className=\"flex w-full items-center justify-between p-1\">\n <h3 className=\"flex items-center pb-2 font-semibold\">\n <Icon className=\"me-2\" name=\"transcripts\" />\n {t('transcript')}\n </h3>\n <button aria-label={t('close')} type=\"button\" onClick={closeTranscript} autoFocus>\n <Icon name=\"close\" />\n </button>\n </div>\n <TranscriptList\n key={activeTranscript.track.id}\n activeTranscript={activeTranscript}\n brandComponentTheme={brandComponentTheme}\n closeTranscript={closeTranscript}\n onCueSelect={onCueSelect}\n />\n </div>\n );\n}\n\nfunction useCues(activeTranscript: TranscriptProps['activeTranscript']) {\n const allCues = useMemo(() => getCues(activeTranscript), [activeTranscript]);\n const [{ activeCues, lastActiveCue }, setActiveCues] = useState<{\n activeCues: VTTCue[];\n lastActiveCue: VTTCue;\n }>(() => {\n const activeCues = getActiveCues(activeTranscript);\n const lastActiveCue = activeCues[activeCues.length - 1] || (allCues[0] as VTTCue);\n return { activeCues, lastActiveCue };\n });\n\n function updateCues() {\n setActiveCues((cueState) => {\n const activeCues = getActiveCues(activeTranscript);\n const activeCue = activeCues[activeCues.length - 1];\n const lastActiveCue = activeCue || cueState.lastActiveCue;\n return { activeCues, lastActiveCue };\n });\n }\n\n return {\n allCues,\n activeCues,\n lastActiveCue,\n updateCues,\n };\n}\n\nfunction TranscriptList({\n activeTranscript,\n closeTranscript,\n onCueSelect,\n brandComponentTheme,\n}: Pick<\n TranscriptProps,\n 'activeTranscript' | 'closeTranscript' | 'onCueSelect' | 'brandComponentTheme'\n>) {\n const { t } = useTranslation('osc-video-player');\n const listRef = useRef<React.ElementRef<'ol'>>(null);\n const { value: isSyncing, setTrue: startSync, setFalse: stopSync } = useBoolean(true);\n const [focusedButton, setFocusedButton] = useState<HTMLButtonElement | null>(null);\n const activeTranscriptRef = useRef(activeTranscript);\n const { allCues, activeCues, lastActiveCue, updateCues } = useCues(activeTranscript);\n const isAutoScrolling = useRef(activeCues.length > 0);\n\n const onKeyDownNavigation = getKeyDownNavigation({\n elements: getAllButtons(listRef),\n onNextFocus: setFocusedButton,\n onPreviousFocus: setFocusedButton,\n });\n\n const onScroll = () => {\n if (!isAutoScrolling.current) {\n stopSync();\n }\n };\n\n const onScrollEnd = () => {\n isAutoScrolling.current = false;\n };\n\n const scrollToActiveCue = useCallback(() => {\n const firstActiveCue = activeCues[0];\n if (listRef.current && firstActiveCue && isSyncing) {\n const activeButton = getActiveButton(listRef, firstActiveCue);\n if (activeButton && activeButton.parentElement) {\n const { offsetTop, offsetHeight } = activeButton.parentElement;\n const { marginTop, marginBottom } = window.getComputedStyle(activeButton.parentElement);\n const itemMargins = parseInt(marginTop, 10) + parseInt(marginBottom, 10);\n const itemOffset = offsetTop - offsetHeight - itemMargins;\n const top = itemOffset - listRef.current.offsetTop;\n isAutoScrolling.current = true;\n listRef.current.scrollTo({ top });\n }\n }\n }, [isSyncing, activeCues]);\n\n const onKeyDown = (event: KeyboardEvent) => {\n event.stopPropagation();\n switch (event.key) {\n case 'Escape':\n closeTranscript();\n break;\n case 'ArrowUp':\n case 'ArrowDown':\n onKeyDownNavigation(event);\n break;\n default:\n break;\n }\n };\n\n useEffect(scrollToActiveCue, [scrollToActiveCue]);\n useEventListener('cuechange', updateCues, activeTranscriptRef);\n useEventListener('scroll', onScroll, listRef);\n useEventListener('scrollend', onScrollEnd, listRef);\n useEventListener('keydown', onKeyDown, listRef);\n\n return (\n <>\n <ol\n className={classnames(\n 'max-h-64 space-y-1 overflow-y-auto overscroll-contain motion-safe:scroll-smooth sm:max-h-80',\n {\n 'pb-10': !isSyncing,\n }\n )}\n ref={listRef}\n data-testid=\"video-player-transcript-list\"\n >\n {allCues.map((cue) => {\n const isActive = activeCues.includes(cue);\n const isFocusable = focusedButton\n ? focusedButton.dataset.id === cue.id\n : lastActiveCue === cue;\n return (\n <TranscriptLine\n isActive={isActive}\n isFocusable={isFocusable}\n cue={cue}\n key={cue.id}\n onCueSelect={onCueSelect}\n />\n );\n })}\n </ol>\n {!isSyncing ? (\n <BrandButton\n className=\"absolute bottom-2 start-1/2 -translate-x-1/2 text-sm rtl:translate-x-1/2\"\n onClick={() => {\n isAutoScrolling.current = true;\n startSync();\n setFocusedButton(null);\n getActiveButton(listRef, lastActiveCue)?.focus();\n }}\n label={t('sync')}\n brandComponentTheme={brandComponentTheme}\n variant=\"solid\"\n />\n ) : null}\n </>\n );\n}\n\nfunction TranscriptLine({\n cue,\n onCueSelect,\n isActive,\n isFocusable,\n}: Pick<TranscriptProps, 'onCueSelect'> & {\n cue: VTTCue;\n isActive: boolean;\n isFocusable: boolean;\n}) {\n const { t } = useTranslation('osc-video-player');\n const { text, html } = getCueText(cue);\n return (\n <li className=\"p-1\">\n <button\n type=\"button\"\n className={classnames('flex items-baseline gap-3 rounded-sm p-1 hover:bg-bg-alt', {\n 'bg-bg-alt': isActive,\n })}\n onClick={() => onCueSelect(cue)}\n tabIndex={isFocusable ? 0 : -1}\n data-id={cue.id}\n aria-current={isActive ? 'time' : false}\n aria-label={t('time', {\n minutes: t('minute', { count: floorMinutes(cue.startTime) }),\n seconds: t('second', { count: floorSeconds(cue.startTime) }),\n text,\n })}\n >\n <span className=\"font-semibold tabular-nums text-primary underline\">\n {formatTime(cue.startTime)}\n </span>\n <span className=\"text-start\" dangerouslySetInnerHTML={{ __html: html }} />\n </button>\n </li>\n );\n}\n\nfunction getActiveCues(activeTranscript: TranscriptProps['activeTranscript']) {\n return (Array.from(activeTranscript.track.activeCues || []) as VTTCue[]).filter(isValidCue);\n}\n\nfunction getCues(activeTranscript: TranscriptProps['activeTranscript']) {\n return (Array.from(activeTranscript.track.cues || []) as VTTCue[])\n .filter(isValidCue)\n .map((cue) => {\n cue.id = cue.id || getCueId(cue);\n return cue;\n });\n}\n\nfunction formatTime(time: number) {\n const minFmt = padTime(floorMinutes(time));\n const secFmt = padTime(floorSeconds(time));\n return `${minFmt}:${secFmt}`;\n}\n\nconst floorMinutes = (time: number) => Math.floor(time / 60);\nconst floorSeconds = (time: number) => Math.floor(time % 60);\nconst padTime = (time: number) => time.toString().padStart(2, '0');\n\nfunction getActiveButton(\n listRef: React.RefObject<HTMLUListElement>,\n cue: VTTCue\n): HTMLButtonElement | null {\n return (listRef.current?.querySelector(`[data-id=\"${cue.id}\"]`) as HTMLButtonElement) || null;\n}\n\nfunction getAllButtons(listRef: React.RefObject<HTMLUListElement>): HTMLButtonElement[] {\n return Array.from(listRef.current?.querySelectorAll('li > button') || []);\n}\n","import classnames from 'classnames';\nimport { useMemo } from 'react';\n\ntype UseVideoPlayerClassesProps = Partial<{ isLandscape: boolean }>;\n\nexport function useVideoPlayerClasses({ isLandscape = true }: UseVideoPlayerClassesProps) {\n const baseControlsClasses = 'absolute -bottom-6 start-1/2 z-10 -translate-x-1/2';\n\n return useMemo(\n () => ({\n captionClassNames: classnames(\n 'absolute inset-x-0 bottom-8 mx-auto w-[calc(100%-2rem)] sm:max-w-fit',\n {\n 'sm:bottom-16 sm:mb-2': isLandscape,\n }\n ),\n controlsClassNames: {\n default: classnames(baseControlsClasses, 'rtl:translate-x-1/2', {\n 'sm:bottom-4 sm:start-4 sm:translate-x-0 sm:rtl:translate-x-0': isLandscape,\n }),\n center: classnames(baseControlsClasses, 'lg:bottom-4 rtl:translate-x-1/2'),\n left: classnames(baseControlsClasses, 'lg:bottom-4 lg:start-4 lg:translate-x-0'),\n right: classnames(\n baseControlsClasses,\n 'lg:bottom-4 lg:end-4 lg:start-auto lg:translate-x-0'\n ),\n },\n transcriptClassNames: 'container p-4 pt-8 sm:pt-4',\n wrapperClassNames: 'relative',\n }),\n [isLandscape]\n );\n}\n","import Head from 'next/head';\n\ntype Schema = {\n name: string;\n logo: string;\n description: string;\n thumbnailUrl: string;\n uploadDate: string;\n duration: string;\n embedUrl: string;\n};\n\nexport type VideoPlayerMarkupProps = {\n markupSchemas?: Schema[] | null;\n};\n\nexport const VideoPlayerMarkup: React.FC<VideoPlayerMarkupProps> = ({ markupSchemas }) => {\n return markupSchemas?.map(\n ({ name, logo, description, thumbnailUrl, uploadDate, duration, embedUrl }) => (\n <Head key={name}>\n <script\n data-testid=\"video-markup-schema\"\n type=\"application/ld+json\"\n dangerouslySetInnerHTML={{\n __html: JSON.stringify({\n '@context': 'http://schema.org',\n '@type': 'VideoObject',\n name,\n logo,\n description,\n thumbnailUrl,\n uploadDate,\n duration,\n embedUrl,\n }),\n }}\n />\n </Head>\n )\n );\n};\n","import { useRef } from 'react';\nimport classnames from 'classnames';\nimport { useVideoPlayer } from './hooks/use-video-player';\nimport { Video } from './video-player.player';\nimport { VideoControls } from './video-player.controls';\nimport { VideoCaptions } from './video-player.captions';\nimport { VideoTranscript } from './video-player.transcripts';\nimport { useVideoPlayerClasses } from './hooks/use-video-player-classnames';\nimport { VideoPlayerMarkup } from './video-player.markup';\n\ntype HookProps = Parameters<typeof useVideoPlayer>[0];\ntype VideoProps = Omit<React.ComponentProps<typeof Video>, 'videoElement' | 'isAutoPlay'>;\ntype CaptionProps = Pick<React.ComponentProps<typeof VideoCaptions>, 'className'>;\ntype TranscriptProps = Pick<React.ComponentProps<typeof VideoTranscript>, 'className'>;\ntype ControlsProps = Pick<React.ComponentProps<typeof VideoControls>, 'className' | 'videoVariant'>;\ntype Orientation = 'portrait' | 'landscape';\n\ntype VideoPlayerProps = HookProps &\n VideoProps &\n Partial<{\n brandComponentTheme: CmsBrandComponentTheme;\n videoCaptionsProps: CaptionProps;\n videoControlsProps: ControlsProps;\n videoTranscriptProps: TranscriptProps;\n wrapperClassName: React.ComponentProps<'div'>['className'];\n orientation: Orientation;\n altText: string | undefined;\n }> & {\n markupSchemas?: React.ComponentProps<typeof VideoPlayerMarkup>['markupSchemas'];\n };\n\n/**\n * Native video player that composes a number of components to render a video with\n * support for closed captions, audio descriptions, and transcripts.\n *\n * @note Does not support ABS (Adaptive bitrate streaming).\n */\nexport function VideoPlayer({\n videoCaptionsProps,\n videoControlsProps,\n videoTranscriptProps,\n audioTracks,\n captionTracks,\n transcriptTracks,\n brandComponentTheme,\n videoGroup = 'standard',\n videoLabel,\n videoName,\n wrapperClassName,\n orientation = 'landscape',\n markupSchemas,\n hasAudio,\n ...videoProps\n}: VideoPlayerProps) {\n const wrapperElement = useRef<React.ElementRef<'div'>>(null);\n const isLandscape = orientation === 'landscape';\n const playerClasses = useVideoPlayerClasses({ isLandscape });\n const playerProps = useVideoPlayer({\n ...videoProps,\n hasAudio,\n videoGroup,\n videoLabel,\n videoName,\n wrapperElement,\n audioTracks,\n captionTracks,\n transcriptTracks,\n });\n\n return (\n <>\n <div\n className={classnames(playerClasses.wrapperClassNames, wrapperClassName)}\n ref={wrapperElement}\n >\n <Video {...videoProps} {...playerProps.videoProps} />\n <VideoCaptions\n {...videoCaptionsProps}\n {...playerProps.videoCaptionProps}\n brandComponentTheme={brandComponentTheme}\n className={classnames(playerClasses.captionClassNames, videoCaptionsProps?.className)}\n />\n <VideoControls\n {...videoControlsProps}\n {...playerProps.videoControlsProps}\n brandComponentTheme={brandComponentTheme}\n className={classnames(\n playerClasses.controlsClassNames['default'],\n videoControlsProps?.className\n )}\n />\n </div>\n <VideoTranscript\n {...playerProps.videoTranscriptProps}\n brandComponentTheme={brandComponentTheme}\n className={classnames(playerClasses.transcriptClassNames, videoTranscriptProps?.className)}\n />\n <VideoPlayerMarkup markupSchemas={markupSchemas} />\n </>\n );\n}\n","import type { Multimedia as AwardMultimedia } from 'dx-shared-schema/dist/types/couchbase/award';\nimport type { Multimedia as BrandMultimedia } from 'dx-shared-schema/dist/types/couchbase/brand';\nimport type { Multimedia as EventMultimedia } from 'dx-shared-schema/dist/types/couchbase/event';\nimport type { Multimedia as PartnerMultimedia } from 'dx-shared-schema/dist/types/couchbase/partner';\nimport type { Multimedia as LocationMultimedia } from 'dx-shared-schema/dist/types/couchbase/location';\nimport type { Multimedia as PlaceMultimedia } from 'dx-shared-schema/dist/types/couchbase/place';\nimport type { Multimedia as StoryMultimedia } from 'dx-shared-schema/dist/types/couchbase/story';\nimport type { VideoPlayer } from './video-player';\nimport type { VideoPlayerMarkup } from './video-player.markup';\nimport type { VideoPlayerProps } from './hooks/use-video-player';\nimport { env } from '@dx-ui/framework-env';\nimport groupBy from 'lodash/groupBy';\n\ntype AllMultimedia =\n | AwardMultimedia\n | BrandMultimedia\n | EventMultimedia\n | PartnerMultimedia\n | LocationMultimedia\n | PlaceMultimedia\n | StoryMultimedia;\n\ntype Metadata = AllMultimedia['multimediaMetadata'][number];\n\n// NOTE: Re-construct these types to resolve the incompatible types between dx-shared-schema and Core+ types\nexport type Multimedia = Omit<AllMultimedia, 'multimediaMetadata' | 'orientation'> & {\n multimediaMetadata: MultimediaMetadatum[];\n orientation: AllMultimedia['orientation'];\n};\n\nexport type MultimediaMetadatum = Omit<Metadata, 'language' | 'type'> & {\n language: string;\n type: Metadata['type'];\n};\n\ntype MappedPage = { brandCode?: string; pathname?: string };\n\nexport function mapMultimediaListToVideoProps({\n multimedia,\n mappedPage,\n groupIdentifier = multimedia[0]?.groupIdentifier || null,\n}: {\n multimedia: Multimedia[];\n mappedPage: MappedPage;\n groupIdentifier?: string | null;\n}): React.ComponentProps<typeof VideoPlayer> {\n const [firstVideo, ...additionalVideos] = groupMultimedia(multimedia, groupIdentifier);\n const videoTrack = mapMultimediaToVideoTrack(firstVideo);\n\n const markupSchemas: Required<React.ComponentProps<typeof VideoPlayerMarkup>['markupSchemas']> =\n multimedia\n .filter((multimedia) => multimedia.description)\n .map((multimedia) =>\n mapVideoMarkup(multimedia as ValidatedVideoMarkupMultimedia, mappedPage)\n );\n\n return {\n ...videoTrack,\n audioTracks: additionalVideos.map(mapMultimediaToVideoTrack),\n isAutoPlay: firstVideo.videoAutoPlay,\n isMuted: firstVideo.noAudio,\n altText: firstVideo.altText ?? '',\n orientation: firstVideo.orientation,\n posterImageUrl: firstVideo.posterImageUrl,\n markupSchemas,\n };\n}\n\nfunction mapMultimediaToVideoTrack(multimedia: Multimedia): Omit<VideoPlayerProps, 'audioTracks'> {\n return {\n videoName: multimedia.videoName,\n videoUrl: multimedia.videoUrl,\n videoGroup: getVideoGroup(multimedia),\n videoLabel: multimedia.audioTrackLabel || multimedia.alternativeVideoLabel,\n //description field is an interim measure. Here is long term solution https://jira.hilton.com/browse/NHCBP-5914\n ...(multimedia.description && { altText: multimedia.description }),\n captionTracks: filterByTrackType(multimedia.multimediaMetadata, 'captionTrack'),\n captionData: mapCaptionData(multimedia.captionLink),\n transcriptTracks: filterByTrackType(multimedia.multimediaMetadata, 'transcriptTrack'),\n };\n}\n\nfunction filterByTrackType(\n multimediaMetadata: MultimediaMetadatum[],\n type: MultimediaMetadatum['type']\n) {\n return multimediaMetadata.filter((metadata) => metadata.type === type);\n}\n\nfunction groupMultimedia(multimediaList: Multimedia[], groupIdentifier: string | null) {\n return (\n groupBy(multimediaList, (multimedia) => multimedia.groupIdentifier || null)[\n String(groupIdentifier)\n ] || []\n ).toSorted((a, b) => Number(b.primaryVideo ?? 0) - Number(a.primaryVideo ?? 0)) as [\n Multimedia,\n ...Multimedia[]\n ];\n}\n\nfunction getVideoGroup(multimedia: Multimedia): NonNullable<VideoPlayerProps['videoGroup']> {\n const isExtended = Boolean(multimedia.extended || multimedia.extendedAudioDescription);\n return isExtended ? 'extended' : 'standard';\n}\n\ntype NoUndefinedField<T> = { [P in keyof T]: Exclude<T[P], null | undefined> };\n\ntype ValidatedVideoMarkupMultimedia = NoUndefinedField<\n Required<\n Pick<\n Multimedia,\n 'videoName' | 'description' | 'posterImageUrl' | 'uploadDatetime' | 'videoDuration'\n >\n >\n>;\n\nfunction mapVideoMarkup(multimedia: ValidatedVideoMarkupMultimedia, mappedPage: MappedPage) {\n const { brandCode = 'WW', pathname = '' } = mappedPage;\n const baseUrl = env('OHW_BASE_URL', 'https://www.hilton.com');\n return {\n name: multimedia.videoName,\n logo: new URL(`/modules/assets/svgs/logos/${brandCode}.svg`, baseUrl).toString(),\n description: multimedia.description,\n thumbnailUrl: multimedia.posterImageUrl,\n uploadDate: multimedia.uploadDatetime.toString(),\n duration: multimedia.videoDuration,\n embedUrl: new URL(pathname, baseUrl).toString(),\n };\n}\n\nfunction mapCaptionData(\n captionLink: AllMultimedia['captionLink']\n): VideoPlayerProps['captionData'] {\n if (captionLink) {\n return {\n caption: captionLink.linkLabel,\n captionLink: captionLink.linkUrl,\n captionLinkTarget: captionLink.isNewWindow ? '_blank' : undefined,\n };\n }\n return undefined;\n}\n","export * from './video-player';\nexport * from './video-player.player';\nexport * from './video-player.captions';\nexport * from './video-player.controls';\nexport * from './video-player.transcripts';\nexport * from './hooks/use-video-player';\nexport * from './hooks/use-video-player-classnames';\nexport * from './video-player.markup';\nexport * from './video-player.mapper';\nexport * from './util/event-emitter';\n","export * from './lib';\n","// extracted by mini-css-extract-plugin"],"names":["BrandIcon","props","span","className","Icon","classnames","getClassnames","brandComponentTheme","variant","isDark","theme","isLight","isSolid","isOutline","BrandLink","forwardRef","ref","label","iconProps","onClick","metricsOnClick","iconAlign","linkProps","Link","anchorClassName","cx","isNewWindow","url","showNewWindowIcon","underline","data-testid","e","displayName","BrandButton","buttonProps","button","type","Caption","caption","captionLink","captionLinkTarget","align","captionClasses","figcaption","a","data-e2e","href","target","div","data-osc-product","defaultColorVariables","offColor","onColor","disabledColor","customColorVariables","useInlineGradient","themeSuffix","values","disabled","isRtlLanguage","orientation","direction","getDirection","getGradientColors","presetVariables","primaryColorVariables","off","on","gradientDisabledColor","gradientOnColor","gradientOffColor","collect","reduce","prev","val","filled","Boolean","background","emptyRect","top","right","bottom","left","width","height","useResizeObserver","initialRect","useState","element","setElement","rect","setRect","useCallback","useIsomorphicLayoutEffect","ro","ResizeObserver","entries","contentRect","observe","unobserve","trackRect","valueRatios","labelRefs","labelRects","map","getBoundingClientRect","xCoordinates","i","x","THUMB_W","reverse","adjustLabelOverlaps","joinLabelXCoordinates","Array","length","fill","overlap","LABEL_JOIN_DISTANCE","limits","track","LABEL_JOIN_CENTER","JOIN_LABEL_LENGTH","limit","Label","forwardedRef","additionalLabel","id","labelPosition","labelType","textClasses","style","transform","aria-hidden","ThumbLabels","inputLabels","labels","trackRef","labelsX","setLabelsX","useRef","current","labelElementRects","setLabelRects","setJoinLabelXCoordinates","topOffsetState","setTopOffset","calculateLabelPositions","tooltipRect","topOffset","filter","value","Slider","fillIndex","hiddenLegend","language","max","maxLabel","min","minLabel","onChange","step","thumbLabelFn","title","isRtl","isDefault","isPrimary","isVertical","isHorizontal","thumbRef","valueRatio","areas","_","fillAreas","inlineGradProps","gradValues","push","thumbLabels","defaultLabelFn","WrapperElement","TitleElement","SliderPrimitive","dir","minStepsBetweenThumbs","name","onValueChange","_value","aria-valuetext","asChild","multimedia","useAutoPlay","isAutoPlay","isClient","useIsClient","isReducedMotion","getIsReducedMotion","addTrackAsync","videoElement","trackElement","document","createElement","getTrackId","join","toLowerCase","srclang","kind","mode","dataset","append","Promise","resolve","onload","onerror","logWarning","Error","removeChild","src","matchTracks","htmlTracks","videoTrack","htmlTrack","some","findTrack","tracks","activeTrack","find","getMetricsTrackName","formatName","trackEvent","eventName","videoName","window","_satellite","digitalData","set","replace","getTextColorClasses","getBackgroundColorClasses","lowestVolume","volumeConfig","Math","floor","VolumeSlider","playerState","updateVolume","useTranslation","t","i18n","volume","isMuted","form","getClasses","isValidCue","cue","text","trim","getCueText","fragment","getCueAsHTML","textContent","html","XMLSerializer","serializeToString","VIDEO_EVENTS","PAUSE_OTHERS","PAUSE_SELF","detail","dispatchEvent","CustomEvent","VIDEO_UPDATE_EVENT","defaultPlayerState","isPlaying","showCaptions","activeCaptionTrack","activeTranscript","activeVideoTrack","initialVolume","useVideoPlayer","defaultVideoTrack","options","hasCaptions","hasTranscripts","useBaseTracks","elementRef","useBoolean","setFalse","timeout","hideControls","showControls","toggleMenu","setIsOpen","internalPlayerId","useId","playerId","hasAudio","hookProps","videoPlayerSettings","JSON","parse","localStorage","getItem","setPlayerState","optionsState","useTrackQuery","captionTracks","transcriptTracks","hasAudioTracks","audioTracks","baseVideoTrack","videoUrl","videoGroup","videoLabel","allTracks","useMemo","getFetchableTracks","additionalTracks","flatMap","from","tracksMap","Map","baseTracks","item","Object","videoTracks","useQuery","enabled","hasTracks","queryKey","queryFn","all","then","catch","error","data","controlsState","useFadeControls","wrapperElement","shouldControlsRemainVisible","setTrue","setHidden","clearTimeout","setVisible","fadeControls","setTimeout","FADE_TIMEOUT_IN_MS","handleKeyup","event","isInteracting","contains","useEffect","isVisible","useEventListener","settingsMenu","menuId","useMenu","popupButtonRef","popupMenuRef","isOpen","useToggle","closeMenu","activeVideo","getMetricsVideoName","playVideo","play","pauseVideo","pause","muteVideo","muted","unmuteVideo","togglePlayButton","dispatchVideoEvent","performAudioActions","state","setItem","stringify","updateTranscript","selectedTranscript","trackName","inActiveCaptionTracks","option","forEach","oncuechange","isPauseSelfEvent","isPauseOthersEvent","isPauseEvent","isOtherVideo","isSameVideo","shouldPauseAll","shouldPauseSelf","videoProps","videoCaptionProps","videoTranscriptProps","closeTranscript","focus","onCueSelect","adjustedTime","startTime","CUE_BUFFER","currentTime","videoControlsProps","toggleMuteButton","toggleCaptions","updateCaption","isSingleCaption","selectedCaption","updateAudioTrack","selectedVideoTrack","findCaption","findTranscript","Video","posterImageUrl","videoId","captionData","figureClassName","videoClassName","rest","preventPreload","autoPlay","figure","video","loop","playsInline","poster","crossOrigin","preload","undefined","onError","ControlButton","children","iconContent","wrapperClassName","li","ControlIcon","ControlMenu","setMaxHeight","wrapperRef","maxHeight","useSafeMaxHeight","wrapperRect","menuRect","buttonRect","offset","buttonOffset","hidden","ControlList","listProps","ul","role","ControlItem","beforeSection","afterSection","SettingsMenu","setSelectedOption","transcriptOptions","menuOptions","useMenuOptions","selectedOption","captionOptions","abbr","isSelected","onSelection","onMenuOptionClick","menuProps","goToMainMenu","aria-label","aria-controls","aria-haspopup","aria-expanded","Menu","resetMenu","focusButton","useOnClickOutside","stopPropagation","key","requestAnimationFrame","activeElement","activeList","querySelector","elements","querySelectorAll","getKeyDownNavigation","subOption","aria-checked","autoFocus","size","index","VideoControls","videoVariant","listRef","hasMultipleCaptions","hasAudioDescriptions","isSettingsMenuOpen","isCinemagraph","includes","preventDefault","pauseButtonLabel","playButtonLabel","aria-pressed","currentTrack","firstTrack","hasSettings","VideoCaptions","elementProps","activeCues","dangerouslySetInnerHTML","__html","VideoTranscript","Transcript","h3","TranscriptList","focusedButton","setFocusedButton","activeTranscriptRef","useCues","allCues","getCues","cues","getCueId","crypto","randomUUID","getActiveCues","lastActiveCue","setActiveCues","updateCues","cueState","activeCue","isAutoScrolling","onKeyDownNavigation","getAllButtons","onNextFocus","onPreviousFocus","scrollToActiveCue","firstActiveCue","isSyncing","activeButton","getActiveButton","parentElement","offsetTop","offsetHeight","getComputedStyle","marginTop","marginBottom","itemOffset","parseInt","itemMargins","scrollTo","onScroll","onScrollEnd","onKeyDown","ol","isActive","isFocusable","TranscriptLine","startSync","tabIndex","data-id","aria-current","minutes","count","floorMinutes","seconds","floorSeconds","minFmt","padTime","time","secFmt","toString","padStart","useVideoPlayerClasses","isLandscape","baseControlsClasses","captionClassNames","controlsClassNames","default","center","transcriptClassNames","wrapperClassNames","VideoPlayerMarkup","markupSchemas","logo","description","thumbnailUrl","uploadDate","duration","embedUrl","Head","script","VideoPlayer","videoCaptionsProps","playerClasses","playerProps","mapMultimediaListToVideoProps","firstVideo","mappedPage","groupIdentifier","groupMultimedia","groupBy","multimediaList","String","toSorted","b","Number","primaryVideo","mapMultimediaToVideoTrack","baseUrl","mapVideoMarkup","brandCode","pathname","env","URL","uploadDatetime","videoDuration","additionalVideos","videoAutoPlay","noAudio","altText","isExtended","getVideoGroup","extended","extendedAudioDescription","audioTrackLabel","alternativeVideoLabel","filterByTrackType","multimediaMetadata","mapCaptionData","linkLabel","linkUrl","metadata"],"sourceRoot":"","ignoreList":[]}