"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("../tslib.es6-C4EgNkz1.js"),z=require("classnames"),e=require("react"),o=require("../textbox-5DvabGMY.js"),N=require("../icons/ebay-icon-search-16/index.js"),_=require("../icons/ebay-icon-clear-16/index.js"),b=["large","small"],T=r=>{var{size:t,a11yClearButton:s,a11yControlsId:d,onClear:p=()=>{},className:f,placeholder:y="Filter",value:c,defaultValue:C,onInputChange:n,inputRef:m}=r,I=q.__rest(r,["size","a11yClearButton","a11yControlsId","onClear","className","placeholder","value","defaultValue","onInputChange","inputRef"]);const l=c!==void 0,[E,i]=e.useState(C||""),x=l?c:E,h=t&&b.includes(t)?t==="small"?"default":"large":void 0,v=(a,{value:u})=>{l||i(u),n&&n(a,{value:u})},g=a=>{l||i(""),n&&n(a,{value:""}),p(a,{value:""})},S=z("filter-input",t&&b.includes(t)&&`filter-input--${t}`,f);return e.createElement("span",{className:S},e.createElement(o.EbayTextbox,Object.assign({},I,{inputRef:m,value:x,onInputChange:v,fluid:!0,type:"search","aria-controls":d,placeholder:y,inputSize:h}),e.createElement(o.EbayTextboxPrefixIcon,{icon:e.createElement(N.EbayIconSearch16,null)}),s&&e.createElement(o.EbayTextboxPostfixIcon,{icon:e.createElement(_.EbayIconClear16,null),buttonAriaLabel:s,className:"filter-input__clear-btn",onClick:a=>g(a)})))};exports.EbayFilterInput=T;
