import{jsx as o}from"react/jsx-runtime";import{forwardRef as e}from"react";import s from"classnames";import a from"../TextField/TextField.js";import t from"../../hooks/useMergeRefs.js";import{SearchType as i,SearchTypeClass as r,SearchDefaultIconNames as n}from"./SearchConstants.js";import{getTestId as c}from"../../tests/testIds.js";import d from"../Icon/Icons/components/CloseSmall.js";import m from"../Icon/Icons/components/Search.js";import{NOOP as l}from"../../utils/function-utils.js";import{TextFieldTextType as p}from"../TextField/TextFieldConstants.js";import{ComponentDefaultTestId as u}from"../../tests/constants.js";import"./Search.scss.js";import{BASE_SIZES as v}from"../../constants/sizes.js";function f(o){return r[o]||""}var C=e((function(e,r){var v=e.secondaryIconName,C=void 0===v?d:v,h=e.iconName,j=void 0===h?m:h,I=e.onChange,N=void 0===I?l:I,R=e.autoFocus,S=void 0!==R&&R,T=e.value,A=void 0===T?"":T,F=e.placeholder,b=void 0===F?"":F,g=e.disabled,x=void 0!==g&&g,y=e.debounceRate,E=void 0===y?200:y,_=e.onBlur,z=void 0===_?l:_,H=e.onFocus,w=void 0===H?l:H,B=e.wrapperClassName,D=void 0===B?"":B,L=e.setRef,O=e.autoComplete,k=void 0===O?"off":O,U=e.size,M=void 0===U?"large":U,Q=e.type,q=void 0===Q?i.SQUARE:Q,G=e.className,J=e.id,K=void 0===J?"search":J,P=e.validation,V=void 0===P?null:P,W=e.inputAriaLabel,X=e.searchResultsContainerId,Y=void 0===X?"":X,Z=e.activeDescendant,$=void 0===Z?"":Z,oo=e.iconNames,eo=void 0===oo?n:oo,so=e.loading,ao=void 0!==so&&so,to=t({refs:[r,void 0===L?l:L]});return o(a,{id:K,dataTestId:c(u.SEARCH,K),iconName:j,value:A,onChange:N,autoFocus:S,placeholder:b,disabled:x,debounceRate:E,className:s(G,"search_component",f(q)),secondaryIconName:C,secondaryDataTestId:c(u.CLEAN_SEARCH_BUTTON,K),wrapperClassName:s(D,"search_component_wrapper"),onBlur:z,onFocus:w,ref:to,autoComplete:k,size:M,clearOnIconClick:!0,validation:V,inputAriaLabel:W,searchResultsContainerId:Y,activeDescendant:$,iconsNames:eo,type:p.SEARCH,role:"search",loading:ao})}));Object.assign(C,{sizes:v,types:i,defaultTestId:u.SEARCH});var h=C;export{h as default};
