{"version":3,"file":"Autocomplete.cjs","names":["_Autocomplete","require","_index","_jsxRuntime","autocompleteComponents","odysseyTokens","MuiAutocomplete","defaultProps","autoHighlight","autoSelect","blurOnSelect","clearIcon","jsx","CloseIcon","clearOnEscape","disableClearable","disabledItemsFocusable","disableListWrap","disablePortal","filterSelectedOptions","fullWidth","handleHomeEndKeys","includeInputInList","limitTags","openOnFocus","popupIcon","ChevronDownIcon","selectOnFocus","slotProps","paper","elevation","styleOverrides","root","marginBlockEnd","Spacing4","clearIndicator","marginRight","padding","Spacing1","endAdornment","ownerState","display","gap","top","right","insetBlockStart","Spacing2","insetInlineEnd","maxHeight","alignItems","whiteSpace","color","TypographyColorSubordinate","transform","disabled","readOnly","listbox","theme","borderWidth","BorderWidthMain","borderStyle","BorderStyleMain","borderColor","HueNeutral200","paddingBlock","paddingInline","borderRadius","BorderRadiusMain","autocompleteClasses","option","minHeight","Spacing3","BorderRadiusTight","backgroundColor","HueNeutral100","focused","focusVisible","boxShadow","mixins","insetFocusRing","TypographyColorAction","PalettePrimaryLighter","position","paddingInlineStart","marginBlockStart","loading","popupIndicator","popper","background","paddingBlockStart","ListboxComponent","undefined","height","inputRoot","HueNeutral50","maxWidth","TypographyLineLengthMax","Spacing6","exports"],"sources":["../../../../src/theme/components/Autocomplete.tsx"],"sourcesContent":["/*!\n * Copyright (c) 2026-present, Okta, Inc. and/or its affiliates. All rights reserved.\n * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the \"License.\")\n *\n * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n *\n * See the License for the specific language governing permissions and limitations under the License.\n */\n\nimport type { ThemeOptions } from \"@mui/material\";\n\nimport { autocompleteClasses } from \"@mui/material/Autocomplete\";\n\nimport type { GetComponentsProps } from \"./types.js\";\n\nimport { ChevronDownIcon, CloseIcon } from \"../../icons.generated/index.js\";\n\nexport const autocompleteComponents = ({\n  odysseyTokens,\n}: GetComponentsProps): Pick<\n  NonNullable<ThemeOptions[\"components\"]>,\n  \"MuiAutocomplete\"\n> => ({\n  MuiAutocomplete: {\n    defaultProps: {\n      autoHighlight: true,\n      autoSelect: false,\n      blurOnSelect: false,\n      clearIcon: <CloseIcon />,\n      clearOnEscape: true,\n      disableClearable: false,\n      disabledItemsFocusable: false,\n      disableListWrap: false,\n      disablePortal: false,\n      filterSelectedOptions: false,\n      fullWidth: false,\n      handleHomeEndKeys: true,\n      includeInputInList: true,\n      limitTags: -1,\n      openOnFocus: false,\n      popupIcon: <ChevronDownIcon />,\n      selectOnFocus: true,\n      slotProps: {\n        paper: {\n          elevation: 1,\n        },\n      },\n    },\n    styleOverrides: {\n      root: {\n        // MUI wraps Autocomplete in an outer div, making the inner MuiFormControl always :last-child of that wrapper (so its margin is always 0). Move the spacing responsibility here so :last-child works against form siblings.\n        marginBlockEnd: odysseyTokens.Spacing4,\n        \"&:last-child\": {\n          marginBlockEnd: 0,\n        },\n      },\n      clearIndicator: {\n        marginRight: \"unset\",\n        padding: odysseyTokens.Spacing1,\n      },\n      endAdornment: ({ ownerState }) => ({\n        display: \"flex\",\n        gap: odysseyTokens.Spacing1,\n        top: \"unset\",\n        right: \"unset\",\n        insetBlockStart: odysseyTokens.Spacing2,\n        insetInlineEnd: odysseyTokens.Spacing2,\n        maxHeight: \"unset\",\n        alignItems: \"center\",\n        whiteSpace: \"nowrap\",\n        color: odysseyTokens.TypographyColorSubordinate,\n        transform: \"none\",\n\n        ...(ownerState.disabled === true && {\n          display: \"none\",\n        }),\n\n        ...(ownerState.readOnly === true && {\n          display: \"none\",\n        }),\n      }),\n      listbox: ({ theme }) => ({\n        borderWidth: odysseyTokens.BorderWidthMain,\n        borderStyle: odysseyTokens.BorderStyleMain,\n        borderColor: odysseyTokens.HueNeutral200,\n        paddingBlock: odysseyTokens.Spacing2,\n        paddingInline: odysseyTokens.Spacing2,\n        borderRadius: odysseyTokens.BorderRadiusMain,\n\n        [`& .${autocompleteClasses.option}`]: {\n          minHeight: \"unset\",\n          paddingBlock: odysseyTokens.Spacing3,\n          paddingInline: odysseyTokens.Spacing4,\n          borderRadius: odysseyTokens.BorderRadiusTight,\n\n          [`&:hover`]: {\n            backgroundColor: odysseyTokens.HueNeutral100,\n          },\n\n          [`&.${autocompleteClasses.focused}`]: {\n            backgroundColor: odysseyTokens.HueNeutral100,\n          },\n\n          [`&.${autocompleteClasses.focusVisible}`]: {\n            backgroundColor: \"transparent\",\n            boxShadow: theme.mixins.insetFocusRing,\n\n            [`&:hover`]: {\n              backgroundColor: odysseyTokens.HueNeutral100,\n            },\n          },\n\n          [`&[aria-selected=\"true\"]`]: {\n            backgroundColor: \"transparent\",\n            color: odysseyTokens.TypographyColorAction,\n\n            [`&:hover`]: {\n              backgroundColor: odysseyTokens.PalettePrimaryLighter,\n            },\n\n            [`&.${autocompleteClasses.focused}`]: {\n              backgroundColor: odysseyTokens.PalettePrimaryLighter,\n            },\n          },\n        },\n        \"& > ul\": {\n          position: \"relative\",\n          paddingInlineStart: 0,\n          marginBlockStart: 0,\n          marginBlockEnd: 0,\n        },\n      }),\n      loading: {\n        paddingBlock: odysseyTokens.Spacing3,\n        paddingInline: odysseyTokens.Spacing4,\n        borderWidth: odysseyTokens.BorderWidthMain,\n        borderStyle: odysseyTokens.BorderStyleMain,\n        borderColor: odysseyTokens.HueNeutral200,\n        borderRadius: odysseyTokens.BorderRadiusMain,\n      },\n      popupIndicator: {\n        padding: odysseyTokens.Spacing1,\n        marginRight: \"unset\",\n      },\n      popper: ({ ownerState }) => ({\n        background: \"transparent\",\n        paddingBlockStart: odysseyTokens.Spacing1,\n        ...(ownerState.ListboxComponent !== undefined && {\n          maxHeight: \"40vh\",\n        }),\n      }),\n      paper: ({ ownerState }) => ({\n        /**\n         * ListboxComponent is used when `isVirtualized` prop is true.\n         * This style is needed to render the virtualized window. It renders out a parent div that needs a height to be set, otherwise the height is 0 and nothing appears.\n         */\n        ...(ownerState.ListboxComponent !== undefined && {\n          height: \"100%\",\n        }),\n      }),\n      inputRoot: ({ ownerState }) => ({\n        ...(ownerState.readOnly === true && {\n          backgroundColor: odysseyTokens.HueNeutral50,\n\n          [`&:not(:hover)`]: {\n            borderColor: \"transparent\",\n          },\n        }),\n\n        \".MuiChip-root\": {\n          // using 55ch - (48px(padding + clear button) + 4px) for spacing between chip and clear button to account for the 24px of padding on the right side of the container and the width of the clear button. Ensures chip does not enlarge the container or overlap the clear button\n          maxWidth: `calc(${odysseyTokens.TypographyLineLengthMax} - (${odysseyTokens.Spacing6} + ${odysseyTokens.Spacing6} + ${odysseyTokens.Spacing1}))`,\n        },\n      }),\n    },\n  },\n});\n"],"mappings":";;;;;;AAcA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAD,OAAA;AAA4E,IAAAE,WAAA,GAAAF,OAAA;AAlB5E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUO,MAAMG,sBAAsB,GAAGA,CAAC;EACrCC;AACkB,CAAC,MAGf;EACJC,eAAe,EAAE;IACfC,YAAY,EAAE;MACZC,aAAa,EAAE,IAAI;MACnBC,UAAU,EAAE,KAAK;MACjBC,YAAY,EAAE,KAAK;MACnBC,SAAS,EAAE,IAAAR,WAAA,CAAAS,GAAA,EAACV,MAAA,CAAAW,SAAS,IAAE,CAAC;MACxBC,aAAa,EAAE,IAAI;MACnBC,gBAAgB,EAAE,KAAK;MACvBC,sBAAsB,EAAE,KAAK;MAC7BC,eAAe,EAAE,KAAK;MACtBC,aAAa,EAAE,KAAK;MACpBC,qBAAqB,EAAE,KAAK;MAC5BC,SAAS,EAAE,KAAK;MAChBC,iBAAiB,EAAE,IAAI;MACvBC,kBAAkB,EAAE,IAAI;MACxBC,SAAS,EAAE,CAAC,CAAC;MACbC,WAAW,EAAE,KAAK;MAClBC,SAAS,EAAE,IAAAtB,W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