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D,IAAI,wBAAwB,cAAc;IAE1C,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;QACrC,GAAG,KAAK;QACR,YAAY;IACd;IAEA,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;0BACR;QACA,QAAQ;wBACN;YACA,iBAAiB,mBAAmB;uBACpC;uBACA;uBACA;4BACA;wBACA;wBACA;uBACA;YACA,YAAY,cAAc;QAC5B;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,6CAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC,CAAA,GAAA,6BAAE,EAAE,KAAK;QACP,GAAG,CAAA,GAAA,qCAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,cAAc;QAC7B,sBAAoB,mBAAmB;QACvC,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;qBAC7B,0DAAC,CAAA,GAAA,6CAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Checkbox.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 */\nimport {\n  AriaCheckboxGroupProps,\n  useCheckboxGroup,\n  useCheckboxGroupItem\n} from 'react-aria/useCheckboxGroup';\n\nimport {AriaCheckboxProps, CheckboxAria, useCheckbox} from 'react-aria/useCheckbox';\nimport {CheckboxGroupState, useCheckboxGroupState} from 'react-stately/useCheckboxGroupState';\nimport {\n  ClassNameOrFunction,\n  ContextValue,\n  dom,\n  Provider,\n  RACValidation,\n  removeDataAttributes,\n  RenderProps,\n  SlotProps,\n  useContextProps,\n  useRenderProps,\n  useSlot,\n  useSlottedContext\n} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from 'react-aria/filterDOMProps';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {HoverEvents} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {mergeRefs} from 'react-aria/mergeRefs';\nimport React, {createContext, ForwardedRef, forwardRef, useContext, useMemo} from 'react';\nimport {TextContext} from './Text';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useHover} from 'react-aria/useHover';\nimport {useObjectRef} from 'react-aria/useObjectRef';\nimport {useToggleState} from 'react-stately/useToggleState';\nimport {VisuallyHidden} from 'react-aria/VisuallyHidden';\n\nexport interface CheckboxGroupProps\n  extends\n    Omit<\n      AriaCheckboxGroupProps,\n      | 'children'\n      | 'label'\n      | 'description'\n      | 'errorMessage'\n      | 'validationState'\n      | 'validationBehavior'\n    >,\n    RACValidation,\n    RenderProps<CheckboxGroupRenderProps, 'div'>,\n    SlotProps,\n    GlobalDOMAttributes<HTMLDivElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-CheckboxGroup'\n   */\n  className?: ClassNameOrFunction<CheckboxGroupRenderProps>;\n}\n\nexport interface CheckboxProps\n  extends\n    Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>,\n    HoverEvents,\n    RACValidation,\n    RenderProps<CheckboxRenderProps, 'label'>,\n    SlotProps,\n    Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-Checkbox'\n   */\n  className?: ClassNameOrFunction<CheckboxRenderProps>;\n  /**\n   * A ref for the HTML input element.\n   */\n  inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface CheckboxFieldProps\n  extends\n    Omit<AriaCheckboxProps, 'children' | 'validationState' | 'validationBehavior'>,\n    RACValidation,\n    RenderProps<CheckboxFieldRenderProps>,\n    SlotProps,\n    Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-CheckboxField'\n   */\n  className?: ClassNameOrFunction<CheckboxFieldRenderProps>;\n  /**\n   * A ref for the HTML input element.\n   */\n  inputRef?: RefObject<HTMLInputElement | null>;\n}\n\nexport interface CheckboxButtonProps\n  extends\n    HoverEvents,\n    RenderProps<CheckboxButtonRenderProps, 'label'>,\n    SlotProps,\n    GlobalDOMAttributes<HTMLLabelElement> {\n  /**\n   * The CSS [className](https://developer.mozilla.org/en-US/docs/Web/API/Element/className) for the\n   * element. A function may be provided to compute the class based on component state.\n   *\n   * @default 'react-aria-CheckboxButton'\n   */\n  className?: ClassNameOrFunction<CheckboxButtonRenderProps>;\n}\n\nexport interface CheckboxGroupRenderProps {\n  /**\n   * Whether the checkbox group is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * Whether the checkbox group is read only.\n   *\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean;\n  /**\n   * Whether the checkbox group is required.\n   *\n   * @selector [data-required]\n   */\n  isRequired: boolean;\n  /**\n   * Whether the checkbox group is invalid.\n   *\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean;\n  /**\n   * State of the checkbox group.\n   */\n  state: CheckboxGroupState;\n}\n\nexport interface CheckboxRenderProps {\n  /**\n   * Whether the checkbox is selected.\n   *\n   * @selector [data-selected]\n   */\n  isSelected: boolean;\n  /**\n   * Whether the checkbox is indeterminate.\n   *\n   * @selector [data-indeterminate]\n   */\n  isIndeterminate: boolean;\n  /**\n   * Whether the checkbox is currently hovered with a mouse.\n   *\n   * @selector [data-hovered]\n   */\n  isHovered: boolean;\n  /**\n   * Whether the checkbox is currently in a pressed state.\n   *\n   * @selector [data-pressed]\n   */\n  isPressed: boolean;\n  /**\n   * Whether the checkbox is focused, either via a mouse or keyboard.\n   *\n   * @selector [data-focused]\n   */\n  isFocused: boolean;\n  /**\n   * Whether the checkbox is keyboard focused.\n   *\n   * @selector [data-focus-visible]\n   */\n  isFocusVisible: boolean;\n  /**\n   * Whether the checkbox is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * Whether the checkbox is read only.\n   *\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean;\n  /**\n   * Whether the checkbox invalid.\n   *\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean;\n  /**\n   * Whether the checkbox is required.\n   *\n   * @selector [data-required]\n   */\n  isRequired: boolean;\n}\n\nexport interface CheckboxFieldRenderProps {\n  /**\n   * Whether the checkbox is selected.\n   *\n   * @selector [data-selected]\n   */\n  isSelected: boolean;\n  /**\n   * Whether the checkbox is indeterminate.\n   *\n   * @selector [data-indeterminate]\n   */\n  isIndeterminate: boolean;\n  /**\n   * Whether the checkbox is disabled.\n   *\n   * @selector [data-disabled]\n   */\n  isDisabled: boolean;\n  /**\n   * Whether the checkbox is read only.\n   *\n   * @selector [data-readonly]\n   */\n  isReadOnly: boolean;\n  /**\n   * Whether the checkbox invalid.\n   *\n   * @selector [data-invalid]\n   */\n  isInvalid: boolean;\n  /**\n   * Whether the checkbox is required.\n   *\n   * @selector [data-required]\n   */\n  isRequired: boolean;\n}\n\nexport interface CheckboxButtonRenderProps extends CheckboxRenderProps {}\n\nexport const CheckboxContext = createContext<ContextValue<CheckboxProps, HTMLLabelElement>>(null);\nexport const CheckboxFieldContext =\n  createContext<ContextValue<CheckboxFieldProps, HTMLDivElement>>(null);\nexport const CheckboxGroupContext =\n  createContext<ContextValue<CheckboxGroupProps, HTMLDivElement>>(null);\nexport const CheckboxGroupStateContext = createContext<CheckboxGroupState | null>(null);\n\n/**\n * A checkbox group allows a user to select multiple items from a list of options.\n */\nexport const CheckboxGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxGroup(\n  props: CheckboxGroupProps,\n  ref: ForwardedRef<HTMLDivElement>\n) {\n  [props, ref] = useContextProps(props, ref, CheckboxGroupContext);\n  let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n  let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n  let state = useCheckboxGroupState({\n    ...props,\n    validationBehavior\n  });\n  let [labelRef, label] = useSlot(!props['aria-label'] && !props['aria-labelledby']);\n  let {groupProps, labelProps, descriptionProps, errorMessageProps, ...validation} =\n    useCheckboxGroup(\n      {\n        ...props,\n        label,\n        validationBehavior\n      },\n      state\n    );\n\n  let renderProps = useRenderProps({\n    ...props,\n    values: {\n      isDisabled: state.isDisabled,\n      isReadOnly: state.isReadOnly,\n      isRequired: props.isRequired || false,\n      isInvalid: state.isInvalid,\n      state\n    },\n    defaultClassName: 'react-aria-CheckboxGroup'\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps, groupProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-readonly={state.isReadOnly || undefined}\n      data-required={props.isRequired || undefined}\n      data-invalid={state.isInvalid || undefined}\n      data-disabled={props.isDisabled || undefined}>\n      <Provider\n        values={[\n          [CheckboxGroupStateContext, state],\n          [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n          [\n            TextContext,\n            {\n              slots: {\n                description: descriptionProps,\n                errorMessage: errorMessageProps\n              }\n            }\n          ],\n          [FieldErrorContext, validation]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n\ninterface InternalCheckboxContextValue extends CheckboxAria {\n  inputRef: RefObject<HTMLInputElement | null>;\n  defaultClassName: string;\n  isIndeterminate?: boolean;\n  isRequired?: boolean;\n}\n\nconst InternalCheckboxContext = createContext<InternalCheckboxContextValue | null>(null);\n\n/**\n * A checkbox allows a user to select an item, with support for validation and help text.\n */\nexport const CheckboxField = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(\n  props: CheckboxFieldProps,\n  ref: ForwardedRef<HTMLDivElement>\n) {\n  let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n  [props, ref] = useContextProps(otherProps, ref, CheckboxFieldContext);\n  let groupState = useContext(CheckboxGroupStateContext);\n  let [aria, inputRef] = useCheckboxAria(props, userProvidedInputRef);\n  let {\n    descriptionProps,\n    errorMessageProps,\n    isSelected,\n    isDisabled,\n    isReadOnly,\n    isInvalid,\n    validationDetails,\n    validationErrors\n  } = aria;\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName: 'react-aria-CheckboxField',\n    values: {\n      isSelected,\n      isIndeterminate: props.isIndeterminate || false,\n      isDisabled,\n      isReadOnly,\n      isInvalid,\n      isRequired: props.isRequired || false\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n  delete DOMProps.onClick;\n\n  return (\n    <dom.div\n      {...mergeProps(DOMProps, renderProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-selected={isSelected || undefined}\n      data-indeterminate={props.isIndeterminate || undefined}\n      data-disabled={isDisabled || undefined}\n      data-readonly={isReadOnly || undefined}\n      data-invalid={isInvalid || undefined}\n      data-required={props.isRequired || undefined}>\n      <Provider\n        values={[\n          [\n            InternalCheckboxContext,\n            {\n              ...aria,\n              inputRef,\n              defaultClassName: 'react-aria-CheckboxButton',\n              isIndeterminate: props.isIndeterminate,\n              isRequired: props.isRequired\n            }\n          ],\n          [\n            TextContext,\n            {\n              slots: {\n                description: descriptionProps,\n                errorMessage: errorMessageProps\n              }\n            }\n          ],\n          // In a CheckboxGroup, validation is handled at the group level instead of repeated on each checkbox.\n          [FieldErrorContext, groupState ? null : {isInvalid, validationDetails, validationErrors}]\n        ]}>\n        {renderProps.children}\n      </Provider>\n    </dom.div>\n  );\n});\n\nfunction useCheckboxAria(\n  props: CheckboxProps | CheckboxFieldProps,\n  userProvidedInputRef: RefObject<HTMLInputElement | null> | null\n): [CheckboxAria, RefObject<HTMLInputElement | null>] {\n  let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n  let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n  let groupState = useContext(CheckboxGroupStateContext);\n  let inputRef = useObjectRef(\n    useMemo(\n      () => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null),\n      [userProvidedInputRef, props.inputRef]\n    )\n  );\n  let checkboxProps = {\n    ...removeDataAttributes(props),\n    children: typeof props.children === 'function' ? true : props.children,\n    value: props.value!,\n    validationBehavior\n  };\n\n  let aria = groupState\n    ? // eslint-disable-next-line react-hooks/rules-of-hooks\n      useCheckboxGroupItem(checkboxProps, groupState, inputRef)\n    : // eslint-disable-next-line react-hooks/rules-of-hooks\n      useCheckbox(checkboxProps, useToggleState(props), inputRef);\n  return [aria, inputRef];\n}\n\n/**\n * A checkbox allows a user to select multiple items from a list of individual items, or\n * to mark one individual item as selected.\n *\n * @deprecated Use CheckboxField + CheckboxButton instead.\n */\nexport const Checkbox = /*#__PURE__*/ (forwardRef as forwardRefType)(function Checkbox(\n  props: CheckboxProps,\n  ref: ForwardedRef<HTMLLabelElement>\n) {\n  let {inputRef: userProvidedInputRef = null, ...otherProps} = props;\n  [props, ref] = useContextProps(otherProps, ref, CheckboxContext);\n  let [aria, inputRef] = useCheckboxAria(props, userProvidedInputRef);\n\n  return (\n    <InternalCheckboxContext.Provider\n      value={{\n        ...aria,\n        inputRef,\n        defaultClassName: 'react-aria-Checkbox',\n        isIndeterminate: props.isIndeterminate,\n        isRequired: props.isRequired\n      }}>\n      <CheckboxButton {...props} ref={ref} />\n    </InternalCheckboxContext.Provider>\n  );\n});\n\n/**\n * A checkbox button is the clickable area of a checkbox, including the indicator and label.\n */\nexport const CheckboxButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function CheckboxButton(\n  props: CheckboxButtonProps,\n  ref: ForwardedRef<HTMLLabelElement>\n) {\n  let {\n    labelProps,\n    inputProps,\n    isSelected,\n    isDisabled,\n    isReadOnly,\n    isPressed,\n    isInvalid,\n    inputRef,\n    defaultClassName,\n    isIndeterminate,\n    isRequired\n  } = useContext(InternalCheckboxContext)!;\n  let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n  let isInteractionDisabled = isDisabled || isReadOnly;\n\n  let {hoverProps, isHovered} = useHover({\n    ...props,\n    isDisabled: isInteractionDisabled\n  });\n\n  let renderProps = useRenderProps({\n    ...props,\n    defaultClassName,\n    values: {\n      isSelected,\n      isIndeterminate: isIndeterminate || false,\n      isPressed,\n      isHovered,\n      isFocused,\n      isFocusVisible,\n      isDisabled,\n      isReadOnly,\n      isInvalid,\n      isRequired: isRequired || false\n    }\n  });\n\n  let DOMProps = filterDOMProps(props, {global: true});\n  delete DOMProps.id;\n  delete DOMProps.onClick;\n\n  return (\n    <dom.label\n      {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n      ref={ref}\n      slot={props.slot || undefined}\n      data-selected={isSelected || undefined}\n      data-indeterminate={isIndeterminate || undefined}\n      data-pressed={isPressed || undefined}\n      data-hovered={isHovered || undefined}\n      data-focused={isFocused || undefined}\n      data-focus-visible={isFocusVisible || undefined}\n      data-disabled={isDisabled || undefined}\n      data-readonly={isReadOnly || undefined}\n      data-invalid={isInvalid || undefined}\n      data-required={isRequired || undefined}>\n      <VisuallyHidden elementType=\"span\">\n        <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n      </VisuallyHidden>\n      {renderProps.children}\n    </dom.label>\n  );\n});\n"],"names":[],"version":3,"file":"Checkbox.cjs.map"}