import e from"react";import t from"../../../../Flex/Flex.js";import r from"../MultiSelectedValues/MultiSelectedValues.js";import l from"./DropdownInput.js";import{useDropdownContext as a}from"../../context/DropdownContext.js";import i from"./TriggerActions.js";import n from"./Trigger.module.scss.js";import{getStyle as o}from"../../../../../helpers/typesciptCssModulesHelper.js";import s from"classnames";import m from"./DropdownChip.js";var d=function(){var d,p=a(),u=p.selectedItems,c=void 0===u?[]:u,v=p.contextOnOptionRemove,f=p.multiline,g=p.disabled,b=p.readOnly,E=p.error,j=p.searchable,y=p.getToggleButtonProps,x=p.label,h=p.getLabelProps,O=p.ariaLabel;return e.createElement(t,{justify:"space-between",align:"center"},e.createElement("div",Object.assign({className:s(n.triggerWrapper,o(n,p.size))},j?{}:y({"aria-haspopup":"dialog","aria-labelledby":x?h().id:void 0,"aria-label":O||(x||null===(d=h())||void 0===d?void 0:d.id),"aria-disabled":g?"true":void 0,"aria-invalid":E?"true":void 0,"aria-readonly":b?"true":void 0})),c.length>0?e.createElement("div",{className:n.multiWrapper},f?e.createElement(t,{gap:"xs",wrap:!0},c.map((function(r,a){var i,n;return e.createElement(t,{key:(null!==(n=null!==(i=r.id)&&void 0!==i?i:r.value)&&void 0!==n?n:a)+""},e.createElement("div",{style:{flexShrink:0}},e.createElement(m,{item:r,onDelete:function(){null==v||v(r)},readOnly:b,disabled:g})),a===c.length-1&&e.createElement(l,{inputSize:"small"}))}))):e.createElement(r,{disabled:g,readOnly:b,selectedItems:c,onRemove:function(e){null==v||v(e)},renderInput:function(){return e.createElement(l,{inputSize:"small"})}})):e.createElement(l,null)),e.createElement(i,null))};export{d as default};
//# sourceMappingURL=MultiSelectTrigger.js.map
