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AAM,EAAE,IAAM,CAAA,GAAA,mCAAQ,EAAE,cAAc,aAAa;QAAC;QAAc;KAAW;IAEvF,CAAA,GAAA,2DAAc,EAAE;QACd,IAAI,QAAQ,GAAG,CAAC,QAAQ,KAAK,gBAAgB,QAAQ;YACnD,IAAI,CAAC,WAAW,OAAO,EACrB,QAAQ,IAAI,CAAC;iBACR,IAAI,WAAW,OAAO,CAAC,SAAS,KAAK,aAC1C,QAAQ,IAAI,CAAC,CAAC,yEAAyE,EAAE,YAAY,QAAQ,EAAE,WAAW,OAAO,CAAC,SAAS,CAAC,2DAA2D,CAAC;QAE5M;IACF,GAAG;QAAC;QAAa;KAAO;IAExB,IAAI,WAAgB;QAAC,GAAG,UAAU;aAAE;IAAG;IACvC,IAAI,QACF,OAAO,OAAO,UAAU;IAG1B,qBAAO,0DAAC,aAAgB;AAC1B;AAMA,MAAM,0CAAoB,CAAC;AAGpB,MAAM,4CAAM,IAAI,MAAM,CAAC,GAAG;IAC/B,KAAI,MAAM,EAAE,WAAW;QACrB,IAAI,OAAO,gBAAgB,UACzB,OAAO;QAGT,IAAI,MAAM,uCAAiB,CAAC,YAAY;QACxC,IAAI,CAAC,KAAK;YACR,oBAAM,CAAA,GAAA,uBAAS,EAAE,iCAAW,IAAI,CAAC,MAAM;YACvC,uCAAiB,CAAC,YAAY,GAAG;QACnC;QAEA,OAAO;IACT;AACF","sources":["packages/react-aria-components/src/utils.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaLabelingProps, RefObject,  DOMProps as SharedDOMProps} from '@react-types/shared';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {AllHTMLAttributes, AnchorHTMLAttributes, Context, CSSProperties, DetailedHTMLProps, ForwardedRef, forwardRef, JSX, ReactElement, ReactNode, RefCallback, useCallback, useContext, useMemo, useRef, useState} from 'react';\nimport {useLayoutEffect} from 'react-aria/private/utils/useLayoutEffect';\nimport {useObjectRef} from 'react-aria/useObjectRef';\n\nexport const DEFAULT_SLOT = Symbol('default');\n\ninterface SlottedValue<T> {\n  slots?: Record<string | symbol, T>\n}\n\nexport type SlottedContextValue<T> = SlottedValue<T> | T | null | undefined;\nexport type ContextValue<T, E> = SlottedContextValue<WithRef<T, E>>;\n\ntype ProviderValue<T> = [Context<T>, T];\ntype ProviderValues<A, B, C, D, E, F, G, H, I, J, K, L> =\n  | [ProviderValue<A>]\n  | [ProviderValue<A>, ProviderValue<B>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>]\n  | [ProviderValue<A>, ProviderValue<B>, ProviderValue<C>, ProviderValue<D>, ProviderValue<E>, ProviderValue<F>, ProviderValue<G>, ProviderValue<H>, ProviderValue<I>, ProviderValue<J>, ProviderValue<K>, ProviderValue<L>];\n\ninterface ProviderProps<A, B, C, D, E, F, G, H, I, J, K, L> {\n  values: ProviderValues<A, B, C, D, E, F, G, H, I, J, K, L>,\n  children: ReactNode\n}\n\nexport function Provider<A, B, C, D, E, F, G, H, I, J, K, L>({values, children}: ProviderProps<A, B, C, D, E, F, G, H, I, J, K, L>): JSX.Element {\n  for (let [Context, value] of values) {\n    // @ts-ignore\n    children = <Context.Provider value={value}>{children}</Context.Provider>;\n  }\n\n  return children as JSX.Element;\n}\n\nexport interface StyleProps {\n  /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. */\n  className?: string,\n  /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. */\n  style?: CSSProperties\n}\n\nexport interface DOMProps extends StyleProps, SharedDOMProps {\n  /** The children of the component. */\n  children?: ReactNode\n}\n\nexport type ClassNameOrFunction<T> = string | ((values: T & {defaultClassName: string | undefined}) => string);\ntype StyleOrFunction<T> = CSSProperties | ((values: T & {defaultStyle: CSSProperties}) => CSSProperties | undefined);\n\nexport interface StyleRenderProps<T, E extends keyof React.JSX.IntrinsicElements = 'div'> extends DOMRenderProps<E, T> {\n  /** The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the element. A function may be provided to compute the class based on component state. */\n  className?: ClassNameOrFunction<T>,\n  /** The inline [style](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/style) for the element. A function may be provided to compute the style based on component state. */\n  style?: StyleOrFunction<T>\n}\n\nexport type ChildrenOrFunction<T> = ReactNode | ((values: T & {defaultChildren: ReactNode | undefined}) => ReactNode);\n\nexport interface RenderProps<T, E extends keyof React.JSX.IntrinsicElements = 'div'> extends StyleRenderProps<T, E> {\n  /** The children of the component. A function may be provided to alter the children based on component state. */\n  children?: ChildrenOrFunction<T>\n}\n\ninterface RenderPropsHookOptions<T, E extends keyof React.JSX.IntrinsicElements> extends RenderProps<T, E>, SharedDOMProps, AriaLabelingProps {\n  values: T,\n  defaultChildren?: ReactNode,\n  defaultClassName?: string,\n  defaultStyle?: CSSProperties\n}\n\ninterface RenderPropsHookRetVal<T, E extends keyof React.JSX.IntrinsicElements> {\n  className?: string,\n  style?: CSSProperties,\n  children?: ReactNode,\n  'data-rac': string,\n  render?: DOMRenderFunction<E, T>\n}\n\nexport function useRenderProps<T, E extends keyof React.JSX.IntrinsicElements>(props: RenderPropsHookOptions<T, E>): RenderPropsHookRetVal<T, E> {\n  let {\n    className,\n    style,\n    children,\n    defaultClassName = undefined,\n    defaultChildren = undefined,\n    defaultStyle,\n    values,\n    render\n  } = props;\n\n  return useMemo(() => {\n    let computedClassName: string | undefined;\n    let computedStyle: React.CSSProperties | undefined;\n    let computedChildren: React.ReactNode | undefined;\n\n    if (typeof className === 'function') {\n      computedClassName = className({...values, defaultClassName});\n    } else {\n      computedClassName = className;\n    }\n\n    if (typeof style === 'function') {\n      computedStyle = style({...values, defaultStyle: defaultStyle || {}});\n    } else {\n      computedStyle = style;\n    }\n\n    if (typeof children === 'function') {\n      computedChildren = children({...values, defaultChildren});\n    } else if (children == null) {\n      computedChildren = defaultChildren;\n    } else {\n      computedChildren = children;\n    }\n\n    return {\n      className: computedClassName ?? defaultClassName,\n      style: (computedStyle || defaultStyle) ? {...defaultStyle, ...computedStyle} : undefined,\n      children: computedChildren ?? defaultChildren,\n      'data-rac': '',\n      render: render ? (props => render(props, values)) : undefined\n    };\n  }, [className, style, children, defaultClassName, defaultChildren, defaultStyle, values, render]);\n}\n\n/**\n * A helper function that accepts a user-provided render prop value (either a static value or a function),\n * and combines it with another value to create a final result.\n */\nexport function composeRenderProps<T, U, V extends T>(\n  // https://stackoverflow.com/questions/60898079/typescript-type-t-or-function-t-usage\n  value: T extends any ? (T | ((renderProps: U) => V)) : never,\n  wrap: (prevValue: T, renderProps: U) => V\n): (renderProps: U) => V {\n  return (renderProps) => wrap(typeof value === 'function' ? value(renderProps) : value, renderProps);\n}\n\nexport type WithRef<T, E> = T & {ref?: ForwardedRef<E>};\nexport interface SlotProps {\n  /**\n   * A slot name for the component. Slots allow the component to receive props from a parent component.\n   * An explicit `null` value indicates that the local props completely override all props received from a parent.\n   */\n  slot?: string | null\n}\n\nexport function useSlottedContext<T>(context: Context<SlottedContextValue<T>>, slot?: string | null): T | null | undefined {\n  let ctx = useContext(context);\n  if (slot === null) {\n    // An explicit `null` slot means don't use context.\n    return null;\n  }\n  if (ctx && typeof ctx === 'object' && 'slots' in ctx && ctx.slots) {\n    let slotKey = slot || DEFAULT_SLOT;\n    if (!ctx.slots[slotKey]) {\n      let availableSlots = new Intl.ListFormat().format(Object.keys(ctx.slots).map(p => `\"${p}\"`));\n      let errorMessage = slot ? `Invalid slot \"${slot}\".` : 'A slot prop is required.';\n\n      throw new Error(`${errorMessage} Valid slot names are ${availableSlots}.`);\n    }\n    return ctx.slots[slotKey];\n  }\n  // @ts-ignore\n  return ctx;\n}\n\nexport function useContextProps<T, U extends SlotProps, E extends Element>(props: T & SlotProps, ref: ForwardedRef<E> | undefined, context: Context<ContextValue<U, E>>): [T, RefObject<E | null>] {\n  let ctx = useSlottedContext(context, props.slot) || {};\n  let {ref: contextRef, ...contextProps} = ctx as any;\n  let mergedRef = useObjectRef(useMemo(() => mergeRefs(ref, contextRef), [ref, contextRef]));\n  let mergedProps = mergeProps(contextProps, props) as unknown as T;\n\n  // mergeProps does not merge `style`. Adding this there might be a breaking change.\n  if (\n    'style' in contextProps &&\n    contextProps.style &&\n    'style' in props &&\n    props.style\n  ) {\n    if (typeof contextProps.style === 'function' || typeof props.style === 'function') {\n      // @ts-ignore\n      mergedProps.style = (renderProps) => {\n        let contextStyle = typeof contextProps.style === 'function' ? contextProps.style(renderProps) : contextProps.style;\n        let defaultStyle = {...renderProps.defaultStyle, ...contextStyle};\n        let style = typeof props.style === 'function'\n          ? props.style({...renderProps, defaultStyle})\n          : props.style;\n        return {...defaultStyle, ...style};\n      };\n    } else {\n      // @ts-ignore\n      mergedProps.style = {...contextProps.style, ...props.style};\n    }\n  }\n\n  return [mergedProps, mergedRef];\n}\n\nexport function useSlot(initialState: boolean | (() => boolean) = true): [RefCallback<Element>, boolean] {\n  // Initial state is typically based on the parent having an aria-label or aria-labelledby.\n  // If it does, this value should be false so that we don't update the state and cause a rerender when we go through the layoutEffect\n  let [hasSlot, setHasSlot] = useState(initialState);\n  let hasRun = useRef(false);\n\n  // A callback ref which will run when the slotted element mounts.\n  // This should happen before the useLayoutEffect below.\n  let ref = useCallback(el => {\n    hasRun.current = true;\n    setHasSlot(!!el);\n  }, []);\n\n  // If the callback hasn't been called, then reset to false.\n  useLayoutEffect(() => {\n    if (!hasRun.current) {\n      setHasSlot(false);\n    }\n  }, []);\n\n  return [ref, hasSlot];\n}\n\n/**\n * Filters out `data-*` attributes to keep them from being passed down and duplicated.\n * @param props\n */\nexport function removeDataAttributes<T>(props: T): T {\n  const prefix = /^(data-.*)$/;\n  let filteredProps = {} as T;\n\n  for (const prop in props) {\n    if (!prefix.test(prop)) {\n      filteredProps[prop] = props[prop];\n    }\n  }\n\n  return filteredProps;\n}\n\n// Override base type to change the default.\nexport interface RACValidation {\n  /**\n   * Whether to use native HTML form validation to prevent form submission\n   * when the value is missing or invalid, or mark the field as required\n   * or invalid via ARIA.\n   * @default 'native'\n   */\n  validationBehavior?: 'native' | 'aria'\n}\n\nexport type DOMRenderFunction<E extends keyof React.JSX.IntrinsicElements, T> = (props: React.JSX.IntrinsicElements[E], renderProps: T) => ReactElement;\nexport interface DOMRenderProps<E extends keyof React.JSX.IntrinsicElements, T> {\n  /**\n   * Overrides the default DOM element with a custom render function.\n   * This allows rendering existing components with built-in styles and behaviors\n   * such as router links, animation libraries, and pre-styled components.\n   * \n   * Requirements:\n   * \n   * * You must render the expected element type (e.g. if `<button>` is expected, you cannot render an `<a>`).\n   * * Only a single root DOM element can be rendered (no fragments).\n   * * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.\n   */\n  render?: DOMRenderFunction<E, T>\n}\n\n// Makes `href` required in AnchorHTMLAttributes\ntype LinkWithRequiredHref = Required<Pick<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>> & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'>;\n\n// Same as DOMRenderProps but specific for the case where the element could be a 'a' or 'div' element.\nexport interface PossibleLinkDOMRenderProps<Fallback extends keyof React.JSX.IntrinsicElements, T> {\n  /**\n   * Overrides the default DOM element with a custom render function.\n   * This allows rendering existing components with built-in styles and behaviors\n   * such as router links, animation libraries, and pre-styled components.\n   * \n   * Note: You can check if `'href' in props` in order to tell whether to render an `<a>` element.\n   * \n   * Requirements:\n   * \n   * * You must render the expected element type (e.g. if `<a>` is expected, you cannot render a `<button>`).\n   * * Only a single root DOM element can be rendered (no fragments).\n   * * You must pass through props and ref to the underlying DOM element, merging with your own prop as appropriate.\n   */\n  render?: (props: DetailedHTMLProps<LinkWithRequiredHref, HTMLAnchorElement> | React.JSX.IntrinsicElements[Fallback], renderProps: T) => ReactElement\n}\n\nfunction DOMElement(ElementType: string, props: DOMRenderProps<any, any> & AllHTMLAttributes<HTMLElement>, forwardedRef: ForwardedRef<HTMLElement>) {\n  let {render, ...otherProps} = props;\n  let elementRef = useRef<HTMLElement | null>(null);\n  let ref = useMemo(() => mergeRefs(forwardedRef, elementRef), [forwardedRef, elementRef]);\n\n  useLayoutEffect(() => {\n    if (process.env.NODE_ENV !== 'production' && render) {\n      if (!elementRef.current) {\n        console.warn('Ref was not connected to DOM element returned by custom `render` function. Did you forget to pass through or merge the `ref`?');\n      } else if (elementRef.current.localName !== ElementType) {\n        console.warn(`Unexpected DOM element returned by custom \\`render\\` function. Expected <${ElementType}>, got <${elementRef.current.localName}>. This may break the component behavior and accessibility.`);\n      }\n    }\n  }, [ElementType, render]);\n\n  let domProps: any = {...otherProps, ref};\n  if (render) {\n    return render(domProps, undefined);\n  }\n\n  return <ElementType {...domProps} />;\n}\n\ntype DOMComponents = {\n  [E in keyof React.JSX.IntrinsicElements]: (props: DOMRenderProps<E, any> & React.JSX.IntrinsicElements[E]) => ReactElement\n};\n\nconst domComponentCache = {};\n\n// Dynamically generates and caches components for each DOM element (e.g. `dom.button`).\nexport const dom = new Proxy({}, {\n  get(target, elementType) {\n    if (typeof elementType !== 'string') {\n      return undefined;\n    }\n\n    let res = domComponentCache[elementType];\n    if (!res) {\n      res = forwardRef(DOMElement.bind(null, elementType));\n      domComponentCache[elementType] = res;\n    }\n\n    return res;\n  }\n}) as DOMComponents;\n"],"names":[],"version":3,"file":"utils.cjs.map"}