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