import{jsx as o}from"react/jsx-runtime";import{forwardRef as e}from"react";import s from"classnames";import t from"../TextField/TextField.js";import a from"../../hooks/useMergeRefs.js";import{SearchType as i,SearchTypeClass as n,SearchDefaultIconNames as r}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 n[o]||""}var C=e((function(e,n){var v=e.secondaryIconName,C=void 0===v?d:v,h=e.iconName,I=void 0===h?m:h,j=e.onChange,N=void 0===j?l:j,R=e.autoFocus,S=void 0!==R&&R,T=e.value,g=void 0===T?"":T,A=e.placeholder,F=void 0===A?"":A,b=e.disabled,x=void 0!==b&&b,y=e.debounceRate,E=void 0===y?200:y,_=e.onBlur,z=void 0===_?l:_,H=e.onFocus,k=void 0===H?l:H,w=e.wrapperClassName,B=void 0===w?"":w,D=e.setRef,L=e.autoComplete,O=void 0===L?"off":L,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?r:oo,so=e.loading,to=void 0!==so&&so,ao=a({refs:[n,void 0===D?l:D]});return o(t,{id:K,dataTestId:c(u.SEARCH,K),iconName:I,value:g,onChange:N,autoFocus:S,placeholder:F,disabled:x,debounceRate:E,className:s(G,"search_component",f(q)),secondaryIconName:C,secondaryDataTestId:c(u.CLEAN_SEARCH_BUTTON,K),wrapperClassName:s(B,"search_component_wrapper"),onBlur:z,onFocus:k,ref:ao,autoComplete:O,size:M,clearOnIconClick:!0,validation:V,inputAriaLabel:W,searchResultsContainerId:Y,activeDescendant:$,iconsNames:eo,type:p.SEARCH,role:"search",loading:to,onIconClick:function(){return console.log("test")}})}));Object.assign(C,{sizes:v,types:i,defaultTestId:u.SEARCH});var h=C;export{h as default};
