{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport genPurePanel from '../_util/PurePanel';\nimport { isValidElement } from '../_util/reactNode';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport Select from '../select';\nconst {\n  Option\n} = Select;\nfunction isSelectOptionOrSelectOptGroup(child) {\n  return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);\n}\nconst AutoComplete = (props, ref) => {\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    popupClassName,\n    dropdownClassName,\n    children,\n    dataSource\n  } = props;\n  const childNodes = toArray(children);\n  // ============================= Input =============================\n  let customizeInput;\n  if (childNodes.length === 1 && isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    [customizeInput] = childNodes;\n  }\n  const getInputElement = customizeInput ? () => customizeInput : undefined;\n  // ============================ Options ============================\n  let optionChildren;\n  // [Legacy] convert `children` or `dataSource` into option children\n  if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    optionChildren = children;\n  } else {\n    optionChildren = dataSource ? dataSource.map(item => {\n      if (isValidElement(item)) {\n        return item;\n      }\n      switch (typeof item) {\n        case 'string':\n          return /*#__PURE__*/React.createElement(Option, {\n            key: item,\n            value: item\n          }, item);\n        case 'object':\n          {\n            const {\n              value: optionValue\n            } = item;\n            return /*#__PURE__*/React.createElement(Option, {\n              key: optionValue,\n              value: optionValue\n            }, item.text);\n          }\n        default:\n          return undefined;\n      }\n    }) : [];\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    const warning = devUseWarning('AutoComplete');\n    warning.deprecated(!('dataSource' in props), 'dataSource', 'options');\n    process.env.NODE_ENV !== \"production\" ? warning(!customizeInput || !('size' in props), 'usage', 'You need to control style self instead of setting `size` when using customize input.') : void 0;\n    warning.deprecated(!dropdownClassName, 'dropdownClassName', 'popupClassName');\n  }\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('select', customizePrefixCls);\n  return /*#__PURE__*/React.createElement(Select, Object.assign({\n    ref: ref,\n    suffixIcon: null\n  }, omit(props, ['dataSource', 'dropdownClassName']), {\n    prefixCls: prefixCls,\n    popupClassName: popupClassName || dropdownClassName,\n    className: classNames(`${prefixCls}-auto-complete`, className),\n    mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,\n    // Internal api\n    getInputElement\n  }), optionChildren);\n};\nconst RefAutoComplete = /*#__PURE__*/React.forwardRef(AutoComplete);\n// We don't care debug panel\n/* istanbul ignore next */\nconst PurePanel = genPurePanel(RefAutoComplete);\nRefAutoComplete.Option = Option;\nRefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;\nif (process.env.NODE_ENV !== 'production') {\n  RefAutoComplete.displayName = 'AutoComplete';\n}\nexport default RefAutoComplete;","map":{"version":3,"names":["React","classNames","toArray","omit","genPurePanel","isValidElement","devUseWarning","ConfigContext","Select","Option","isSelectOptionOrSelectOptGroup","child","type","isSelectOption","isSelectOptGroup","AutoComplete","props","ref","prefixCls","customizePrefixCls","className","popupClassName","dropdownClassName","children","dataSource","childNodes","customizeInput","length","getInputElement","undefined","optionChildren","map","item","createElement","key","value","optionValue","text","process","env","NODE_ENV","warning","deprecated","getPrefixCls","useContext","Object","assign","suffixIcon","mode","SECRET_COMBOBOX_MODE_DO_NOT_USE","RefAutoComplete","forwardRef","PurePanel","_InternalPanelDoNotUseOrYouWillBeFired","displayName"],"sources":["/var/www/gavt/node_modules/antd/es/auto-complete/index.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport toArray from \"rc-util/es/Children/toArray\";\nimport omit from \"rc-util/es/omit\";\nimport genPurePanel from '../_util/PurePanel';\nimport { isValidElement } from '../_util/reactNode';\nimport { devUseWarning } from '../_util/warning';\nimport { ConfigContext } from '../config-provider';\nimport Select from '../select';\nconst {\n  Option\n} = Select;\nfunction isSelectOptionOrSelectOptGroup(child) {\n  return child && child.type && (child.type.isSelectOption || child.type.isSelectOptGroup);\n}\nconst AutoComplete = (props, ref) => {\n  const {\n    prefixCls: customizePrefixCls,\n    className,\n    popupClassName,\n    dropdownClassName,\n    children,\n    dataSource\n  } = props;\n  const childNodes = toArray(children);\n  // ============================= Input =============================\n  let customizeInput;\n  if (childNodes.length === 1 && isValidElement(childNodes[0]) && !isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    [customizeInput] = childNodes;\n  }\n  const getInputElement = customizeInput ? () => customizeInput : undefined;\n  // ============================ Options ============================\n  let optionChildren;\n  // [Legacy] convert `children` or `dataSource` into option children\n  if (childNodes.length && isSelectOptionOrSelectOptGroup(childNodes[0])) {\n    optionChildren = children;\n  } else {\n    optionChildren = dataSource ? dataSource.map(item => {\n      if (isValidElement(item)) {\n        return item;\n      }\n      switch (typeof item) {\n        case 'string':\n          return /*#__PURE__*/React.createElement(Option, {\n            key: item,\n            value: item\n          }, item);\n        case 'object':\n          {\n            const {\n              value: optionValue\n            } = item;\n            return /*#__PURE__*/React.createElement(Option, {\n              key: optionValue,\n              value: optionValue\n            }, item.text);\n          }\n        default:\n          return undefined;\n      }\n    }) : [];\n  }\n  if (process.env.NODE_ENV !== 'production') {\n    const warning = devUseWarning('AutoComplete');\n    warning.deprecated(!('dataSource' in props), 'dataSource', 'options');\n    process.env.NODE_ENV !== \"production\" ? warning(!customizeInput || !('size' in props), 'usage', 'You need to control style self instead of setting `size` when using customize input.') : void 0;\n    warning.deprecated(!dropdownClassName, 'dropdownClassName', 'popupClassName');\n  }\n  const {\n    getPrefixCls\n  } = React.useContext(ConfigContext);\n  const prefixCls = getPrefixCls('select', customizePrefixCls);\n  return /*#__PURE__*/React.createElement(Select, Object.assign({\n    ref: ref,\n    suffixIcon: null\n  }, omit(props, ['dataSource', 'dropdownClassName']), {\n    prefixCls: prefixCls,\n    popupClassName: popupClassName || dropdownClassName,\n    className: classNames(`${prefixCls}-auto-complete`, className),\n    mode: Select.SECRET_COMBOBOX_MODE_DO_NOT_USE,\n    // Internal api\n    getInputElement\n  }), optionChildren);\n};\nconst RefAutoComplete = /*#__PURE__*/React.forwardRef(AutoComplete);\n// We don't care debug panel\n/* istanbul ignore next */\nconst PurePanel = genPurePanel(RefAutoComplete);\nRefAutoComplete.Option = Option;\nRefAutoComplete._InternalPanelDoNotUseOrYouWillBeFired = PurePanel;\nif (process.env.NODE_ENV !== 'production') {\n  RefAutoComplete.displayName = 'AutoComplete';\n}\nexport default RefAutoComplete;"],"mappings":"AAAA,YAAY;;AAEZ,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,OAAO,MAAM,6BAA6B;AACjD,OAAOC,IAAI,MAAM,iBAAiB;AAClC,OAAOC,YAAY,MAAM,oBAAoB;AAC7C,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,aAAa,QAAQ,oBAAoB;AAClD,OAAOC,MAAM,MAAM,WAAW;AAC9B,MAAM;EACJC;AACF,CAAC,GAAGD,MAAM;AACV,SAASE,8BAA8BA,CAACC,KAAK,EAAE;EAC7C,OAAOA,KAAK,IAAIA,KAAK,CAACC,IAAI,KAAKD,KAAK,CAACC,IAAI,CAACC,cAAc,IAAIF,KAAK,CAACC,IAAI,CAACE,gBAAgB,CAAC;AAC1F;AACA,MAAMC,YAAY,GAAGA,CAACC,KAAK,EAAEC,GAAG,KAAK;EACnC,MAAM;IACJC,SAAS,EAAEC,kBAAkB;IAC7BC,SAAS;IACTC,cAAc;IACdC,iBAAiB;IACjBC,QAAQ;IACRC;EACF,CAAC,GAAGR,KAAK;EACT,MAAMS,UAAU,GAAGvB,OAAO,CAACqB,QAAQ,CAAC;EACpC;EACA,IAAIG,cAAc;EAClB,IAAID,UAAU,CAACE,MAAM,KAAK,CAAC,IAAItB,cAAc,CAACoB,UAAU,CA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