import e from"../../node_modules/lodash/identity.js";import l from"../../node_modules/lodash/isArray.js";import o from"../../node_modules/lodash/isEmpty.js";import a from"../../node_modules/lodash/isNull.js";import t from"react";import r from"../../node_modules/react-select/dist/react-select.esm.js";import s from"../../node_modules/react-select/creatable/dist/react-select-creatable.esm.js";import i from"./ClearIndicator.js";import n from"./DropdownIndicator.js";import m from"./MultiValueRemove.js";import{reactSelectStyles as d}from"./TypeaheadStyles.js";const u=e=>l(e)?e.map((e=>({label:e,value:e}))):{label:e,value:e},p=e=>a(e)?[]:l(e)?e.map((e=>e.label)):[e.label];function c({"aria-label":l,allowNew:a=!1,disabled:c=!1,id:b,isLoading:f,menuPortalTarget:h,multiple:j=!1,onBlur:g,onChange:C,options:y,placeholder:v,selected:I,isClearable:_}){const w={ClearIndicator:i,DropdownIndicator:n,MultiValueRemove:m};return a?t.createElement(s,{"aria-label":l,components:w,formatCreateLabel:e,inputId:b,isDisabled:c,isLoading:f,isMulti:j,isValidNewOption:(e,l)=>!o(e)&&!(y.includes(e)||l.includes(e)),menuPlacement:"auto",menuPortalTarget:h,onBlur:g,onChange:e=>C?.(p(e)),options:[{options:u(y)}],placeholder:v,styles:d,value:I?u(I):null,isClearable:_}):t.createElement(r,{"aria-label":l,components:w,inputId:b,isDisabled:c,isLoading:f,isMulti:j,menuPlacement:"auto",menuPortalTarget:h,onBlur:g,onChange:e=>C?.(p(e)),options:[{options:u(y)}],placeholder:v,styles:d,value:I?u(I):null,isClearable:_})}export{c as default};
//# sourceMappingURL=StringTypeahead.js.map
