UNPKG

primevue

Version:

PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc

2 lines (1 loc) 40.2 kB
this.primevue=this.primevue||{},this.primevue.multiselect=function(e,t,i,n,o,l,s,r,a,c,u,d,p,h,f){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=m(t),v=m(i),y=m(n),g=m(o),O=m(l),x=m(s),I=m(r),S=m(a),k=m(c),V=m(d);function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}function L(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function w(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?L(Object(i),!0).forEach((function(t){F(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):L(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function F(e,t,i){var n;return(t="symbol"==C(n=E(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function E(e,t){if("object"!=C(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=C(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function D(e){return M(e)||T(e)||B(e)||P()}function P(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function B(e,t){if(e){if("string"==typeof e)return K(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?K(e,t):void 0}}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function M(e){if(Array.isArray(e))return K(e)}function K(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}var $={name:"MultiSelect",extends:{name:"BaseMultiSelect",extends:m(p).default,props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},placeholder:String,disabled:Boolean,inputId:{type:String,default:null},inputProps:{type:null,default:null},panelClass:{type:String,default:null},panelStyle:{type:null,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},closeButtonProps:{type:null,default:null},dataKey:null,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},appendTo:{type:String,default:"body"},display:{type:String,default:"comma"},selectedItemsLabel:{type:String,default:"{0} items selected"},maxSelectedLabels:{type:Number,default:null},selectionLimit:{type:Number,default:null},showToggleAll:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},checkboxIcon:{type:String,default:void 0},closeIcon:{type:String,default:void 0},dropdownIcon:{type:String,default:void 0},filterIcon:{type:String,default:void 0},loadingIcon:{type:String,default:void 0},removeTokenIcon:{type:String,default:void 0},selectAll:{type:Boolean,default:null},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},ariaLabel:{type:String,default:null},ariaLabelledby:{type:String,default:null}},style:m(h).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter","selectall-change"],outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,startRangeIndex:-1,searchTimeout:null,searchValue:"",selectOnFocus:!1,focusOnHover:!1,data:function(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,headerCheckboxFocused:!1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(e){this.id=e||u.UniqueComponentId()},options:function(){this.autoUpdateModel()}},mounted:function(){this.id=this.id||u.UniqueComponentId(),this.autoUpdateModel()},beforeUnmount:function(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(u.ZIndexUtils.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex:function(e,t){return this.virtualScrollerDisabled?e:t&&t(e).index},getOptionLabel:function(e){return this.optionLabel?u.ObjectUtils.resolveFieldData(e,this.optionLabel):e},getOptionValue:function(e){return this.optionValue?u.ObjectUtils.resolveFieldData(e,this.optionValue):e},getOptionRenderKey:function(e){return this.dataKey?u.ObjectUtils.resolveFieldData(e,this.dataKey):this.getOptionLabel(e)},getHeaderCheckboxPTOptions:function(e){return this.ptm(e,{context:{selected:this.allSelected,focused:this.headerCheckboxFocused}})},getCheckboxPTOptions:function(e,t,i,n){return this.ptm(n,{context:{selected:this.isSelected(e),focused:this.focusedOptionIndex===this.getOptionIndex(i,t),disabled:this.isOptionDisabled(e)}})},isOptionDisabled:function(e){return!(!this.maxSelectionLimitReached||this.isSelected(e))||!!this.optionDisabled&&u.ObjectUtils.resolveFieldData(e,this.optionDisabled)},isOptionGroup:function(e){return this.optionGroupLabel&&e.optionGroup&&e.group},getOptionGroupLabel:function(e){return u.ObjectUtils.resolveFieldData(e,this.optionGroupLabel)},getOptionGroupChildren:function(e){return u.ObjectUtils.resolveFieldData(e,this.optionGroupChildren)},getAriaPosInset:function(e){var t=this;return(this.optionGroupLabel?e-this.visibleOptions.slice(0,e).filter((function(e){return t.isOptionGroup(e)})).length:e)+1},show:function(e){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,e&&u.DomHandler.focus(this.$refs.focusInput)},hide:function(e){var t=this;setTimeout((function(){t.$emit("before-hide"),t.overlayVisible=!1,t.focusedOptionIndex=-1,t.searchValue="",t.resetFilterOnHide&&(t.filterValue=null),e&&u.DomHandler.focus(t.$refs.focusInput)}),0)},onFocus:function(e){this.disabled||(this.focused=!0,this.focusedOptionIndex=-1!==this.focusedOptionIndex?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",e))},onBlur:function(e){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",e)},onKeyDown:function(e){var t=this;if(this.disabled)e.preventDefault();else{var i=e.metaKey||e.ctrlKey;switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e);break;case"Home":this.onHomeKey(e);break;case"End":this.onEndKey(e);break;case"PageDown":this.onPageDownKey(e);break;case"PageUp":this.onPageUpKey(e);break;case"Enter":case"NumpadEnter":case"Space":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(e);break;default:if("KeyA"===e.code&&i){var n=this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,n),e.preventDefault();break}!i&&u.ObjectUtils.isPrintableCharacter(e.key)&&(!this.overlayVisible&&this.show(),this.searchOptions(e),e.preventDefault())}}},onContainerClick:function(e){this.disabled||this.loading||this.overlay&&this.overlay.contains(e.target)||(this.overlayVisible?this.hide(!0):this.show(!0))},onFirstHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?u.DomHandler.getFirstFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;u.DomHandler.focus(t)},onLastHiddenFocus:function(e){var t=e.relatedTarget===this.$refs.focusInput?u.DomHandler.getLastFocusableElement(this.overlay,':not([data-p-hidden-focusable="true"])'):this.$refs.focusInput;u.DomHandler.focus(t)},onCloseClick:function(){this.hide(!0)},onHeaderCheckboxFocus:function(){this.headerCheckboxFocused=!0},onHeaderCheckboxBlur:function(){this.headerCheckboxFocused=!1},onOptionSelect:function(e,t){var i=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1,o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!this.disabled&&!this.isOptionDisabled(t)){var l=null;l=this.isSelected(t)?this.modelValue.filter((function(e){return!u.ObjectUtils.equals(e,i.getOptionValue(t),i.equalityKey)})):[].concat(D(this.modelValue||[]),[this.getOptionValue(t)]),this.updateModel(e,l),-1!==n&&(this.focusedOptionIndex=n),o&&u.DomHandler.focus(this.$refs.focusInput)}},onOptionMouseMove:function(e,t){this.focusOnHover&&this.changeFocusedOptionIndex(e,t)},onOptionSelectRange:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(-1===i&&(i=this.findNearestSelectedOptionIndex(n,!0)),-1===n&&(n=this.findNearestSelectedOptionIndex(i)),-1!==i&&-1!==n){var o=Math.min(i,n),l=Math.max(i,n),s=this.visibleOptions.slice(o,l+1).filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,s)}},onFilterChange:function(e){var t=e.target.value;this.filterValue=t,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:e,value:t}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown:function(e){switch(e.code){case"ArrowDown":this.onArrowDownKey(e);break;case"ArrowUp":this.onArrowUpKey(e,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(e,!0);break;case"Home":this.onHomeKey(e,!0);break;case"End":this.onEndKey(e,!0);break;case"Enter":case"NumpadEnter":this.onEnterKey(e);break;case"Escape":this.onEscapeKey(e);break;case"Tab":this.onTabKey(e,!0)}},onFilterBlur:function(){this.focusedOptionIndex=-1},onFilterUpdated:function(){this.overlayVisible&&this.alignOverlay()},onOverlayClick:function(e){I.default.emit("overlay-click",{originalEvent:e,target:this.$el})},onOverlayKeyDown:function(e){if("Escape"===e.code)this.onEscapeKey(e)},onArrowDownKey:function(e){var t=-1!==this.focusedOptionIndex?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,this.startRangeIndex,t),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()},onArrowUpKey:function(e){if(e.altKey&&!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),e.preventDefault();else{var t=-1!==this.focusedOptionIndex?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();e.shiftKey&&this.onOptionSelectRange(e,t,this.startRangeIndex),this.changeFocusedOptionIndex(e,t),!this.overlayVisible&&this.show(),e.preventDefault()}},onArrowLeftKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(this.focusedOptionIndex=-1)},onHomeKey:function(e){var t=e.currentTarget;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){t.setSelectionRange(0,e.shiftKey?t.value.length:0),this.focusedOptionIndex=-1}else{var i=e.metaKey||e.ctrlKey,n=this.findFirstOptionIndex();e.shiftKey&&i&&this.onOptionSelectRange(e,n,this.startRangeIndex),this.changeFocusedOptionIndex(e,n),!this.overlayVisible&&this.show()}e.preventDefault()},onEndKey:function(e){var t=e.currentTarget;if(arguments.length>1&&void 0!==arguments[1]&&arguments[1]){var i=t.value.length;t.setSelectionRange(e.shiftKey?0:i,i),this.focusedOptionIndex=-1}else{var n=e.metaKey||e.ctrlKey,o=this.findLastOptionIndex();e.shiftKey&&n&&this.onOptionSelectRange(e,this.startRangeIndex,o),this.changeFocusedOptionIndex(e,o),!this.overlayVisible&&this.show()}e.preventDefault()},onPageUpKey:function(e){this.scrollInView(0),e.preventDefault()},onPageDownKey:function(e){this.scrollInView(this.visibleOptions.length-1),e.preventDefault()},onEnterKey:function(e){this.overlayVisible?-1!==this.focusedOptionIndex&&(e.shiftKey?this.onOptionSelectRange(e,this.focusedOptionIndex):this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex])):this.onArrowDownKey(e),e.preventDefault()},onEscapeKey:function(e){this.overlayVisible&&this.hide(!0),e.preventDefault()},onTabKey:function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]||(this.overlayVisible&&this.hasFocusableElements()?(u.DomHandler.focus(e.shiftKey?this.$refs.lastHiddenFocusableElementOnOverlay:this.$refs.firstHiddenFocusableElementOnOverlay),e.preventDefault()):(-1!==this.focusedOptionIndex&&this.onOptionSelect(e,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onShiftKey:function(){this.startRangeIndex=this.focusedOptionIndex},onOverlayEnter:function(e){u.ZIndexUtils.set("overlay",e,this.$primevue.config.zIndex.overlay),u.DomHandler.addStyles(e,{position:"absolute",top:"0",left:"0"}),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&u.DomHandler.focus(this.$refs.filterInput)},onOverlayAfterEnter:function(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave:function(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave:function(e){u.ZIndexUtils.clear(e)},alignOverlay:function(){"self"===this.appendTo?u.DomHandler.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=u.DomHandler.getOuterWidth(this.$el)+"px",u.DomHandler.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener:function(){var e=this;this.outsideClickListener||(this.outsideClickListener=function(t){e.overlayVisible&&e.isOutsideClicked(t)&&e.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener:function(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener:function(){var e=this;this.scrollHandler||(this.scrollHandler=new u.ConnectedOverlayScrollHandler(this.$refs.container,(function(){e.overlayVisible&&e.hide()}))),this.scrollHandler.bindScrollListener()},unbindScrollListener:function(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener:function(){var e=this;this.resizeListener||(this.resizeListener=function(){e.overlayVisible&&!u.DomHandler.isTouchDevice()&&e.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener:function(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},isOutsideClicked:function(e){return!(this.$el.isSameNode(e.target)||this.$el.contains(e.target)||this.overlay&&this.overlay.contains(e.target))},getLabelByValue:function(e){var t=this,i=(this.optionGroupLabel?this.flatOptions(this.options):this.options||[]).find((function(i){return!t.isOptionGroup(i)&&u.ObjectUtils.equals(t.getOptionValue(i),e,t.equalityKey)}));return i?this.getOptionLabel(i):null},getSelectedItemsLabel:function(){var e=/{(.*?)}/,t=this.selectedItemsLabel||this.$primevue.config.locale.selectionMessage;return e.test(t)?t.replace(t.match(e)[0],this.modelValue.length+""):t},onToggleAll:function(e){var t=this;if(null!==this.selectAll)this.$emit("selectall-change",{originalEvent:e,checked:!this.allSelected});else{var i=this.allSelected?[]:this.visibleOptions.filter((function(e){return t.isValidOption(e)})).map((function(e){return t.getOptionValue(e)}));this.updateModel(e,i)}this.headerCheckboxFocused=!0},removeOption:function(e,t){var i=this,n=this.modelValue.filter((function(e){return!u.ObjectUtils.equals(e,t,i.equalityKey)}));this.updateModel(e,n)},clearFilter:function(){this.filterValue=null},hasFocusableElements:function(){return u.DomHandler.getFocusableElements(this.overlay,':not([data-p-hidden-focusable="true"])').length>0},isOptionMatched:function(e){return this.isValidOption(e)&&this.getOptionLabel(e).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption:function(e){return u.ObjectUtils.isNotEmpty(e)&&!(this.isOptionDisabled(e)||this.isOptionGroup(e))},isValidSelectedOption:function(e){return this.isValidOption(e)&&this.isSelected(e)},isSelected:function(e){var t=this,i=this.getOptionValue(e);return(this.modelValue||[]).some((function(e){return u.ObjectUtils.equals(e,i,t.equalityKey)}))},findFirstOptionIndex:function(){var e=this;return this.visibleOptions.findIndex((function(t){return e.isValidOption(t)}))},findLastOptionIndex:function(){var e=this;return u.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidOption(t)}))},findNextOptionIndex:function(e){var t=this,i=e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidOption(e)})):-1;return i>-1?i+e+1:e},findPrevOptionIndex:function(e){var t=this,i=e>0?u.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidOption(e)})):-1;return i>-1?i:e},findFirstSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?this.visibleOptions.findIndex((function(t){return e.isValidSelectedOption(t)})):-1},findLastSelectedOptionIndex:function(){var e=this;return this.hasSelectedOption?u.ObjectUtils.findLastIndex(this.visibleOptions,(function(t){return e.isValidSelectedOption(t)})):-1},findNextSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e<this.visibleOptions.length-1?this.visibleOptions.slice(e+1).findIndex((function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i+e+1:-1},findPrevSelectedOptionIndex:function(e){var t=this,i=this.hasSelectedOption&&e>0?u.ObjectUtils.findLastIndex(this.visibleOptions.slice(0,e),(function(e){return t.isValidSelectedOption(e)})):-1;return i>-1?i:-1},findNearestSelectedOptionIndex:function(e){var t=-1;return this.hasSelectedOption&&(t=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?-1===(t=this.findPrevSelectedOptionIndex(e))?this.findNextSelectedOptionIndex(e):t:-1===(t=this.findNextSelectedOptionIndex(e))?this.findPrevSelectedOptionIndex(e):t),t>-1?t:e},findFirstFocusedOptionIndex:function(){var e=this.findFirstSelectedOptionIndex();return e<0?this.findFirstOptionIndex():e},findLastFocusedOptionIndex:function(){var e=this.findLastSelectedOptionIndex();return e<0?this.findLastOptionIndex():e},searchOptions:function(e){var t=this;this.searchValue=(this.searchValue||"")+e.key;var i=-1;-1===(i=-1!==this.focusedOptionIndex?-1===(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex((function(e){return t.isOptionMatched(e)})))?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex((function(e){return t.isOptionMatched(e)})):i+this.focusedOptionIndex:this.visibleOptions.findIndex((function(e){return t.isOptionMatched(e)})))&&-1===this.focusedOptionIndex&&(i=this.findFirstFocusedOptionIndex()),-1!==i&&this.changeFocusedOptionIndex(e,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout((function(){t.searchValue="",t.searchTimeout=null}),500)},changeFocusedOptionIndex:function(e,t){this.focusedOptionIndex!==t&&(this.focusedOptionIndex=t,this.scrollInView())},scrollInView:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1,t=-1!==e?"".concat(this.id,"_").concat(e):this.focusedOptionId,i=u.DomHandler.findSingle(this.list,'li[id="'.concat(t,'"]'));i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(-1!==e?e:this.focusedOptionIndex)},autoUpdateModel:function(){if(this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption){this.focusedOptionIndex=this.findFirstFocusedOptionIndex();var e=this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);this.updateModel(null,[e])}},updateModel:function(e,t){this.$emit("update:modelValue",t),this.$emit("change",{originalEvent:e,value:t})},flatOptions:function(e){var t=this;return(e||[]).reduce((function(e,i,n){e.push({optionGroup:i,group:!0,index:n});var o=t.getOptionGroupChildren(i);return o&&o.forEach((function(t){return e.push(t)})),e}),[])},overlayRef:function(e){this.overlay=e},listRef:function(e,t){this.list=e,t&&t(e)},virtualScrollerRef:function(e){this.virtualScroller=e}},computed:{visibleOptions:function(){var t=this,i=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){var n=e.FilterService.filter(i,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){var o=[];return(this.options||[]).forEach((function(e){var i=t.getOptionGroupChildren(e).filter((function(e){return n.includes(e)}));i.length>0&&o.push(w(w({},e),{},F({},"string"==typeof t.optionGroupChildren?t.optionGroupChildren:"items",D(i))))})),this.flatOptions(o)}return n}return i},label:function(){var e;if(this.modelValue&&this.modelValue.length){if(u.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue.length>this.maxSelectedLabels)return this.getSelectedItemsLabel();e="";for(var t=0;t<this.modelValue.length;t++)0!==t&&(e+=", "),e+=this.getLabelByValue(this.modelValue[t])}else e=this.placeholder;return e},chipSelectedItems:function(){return u.ObjectUtils.isNotEmpty(this.maxSelectedLabels)&&this.modelValue&&this.modelValue.length>this.maxSelectedLabels?this.modelValue.slice(0,this.maxSelectedLabels):this.modelValue},allSelected:function(){var e=this;return null!==this.selectAll?this.selectAll:u.ObjectUtils.isNotEmpty(this.visibleOptions)&&this.visibleOptions.every((function(t){return e.isOptionGroup(t)||e.isOptionDisabled(t)||e.isSelected(t)}))},hasSelectedOption:function(){return u.ObjectUtils.isNotEmpty(this.modelValue)},equalityKey:function(){return this.optionValue?null:this.dataKey},searchFields:function(){return this.filterFields||[this.optionLabel]},maxSelectionLimitReached:function(){return this.selectionLimit&&this.modelValue&&this.modelValue.length===this.selectionLimit},filterResultMessageText:function(){return u.ObjectUtils.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText:function(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText:function(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText:function(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText:function(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText:function(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText:function(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.modelValue.length):this.emptySelectionMessageText},focusedOptionId:function(){return-1!==this.focusedOptionIndex?"".concat(this.id,"_").concat(this.focusedOptionIndex):null},ariaSetSize:function(){var e=this;return this.visibleOptions.filter((function(t){return!e.isOptionGroup(t)})).length},toggleAllAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[this.allSelected?"selectAll":"unselectAll"]:void 0},closeAriaLabel:function(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},virtualScrollerDisabled:function(){return!this.virtualScrollerOptions}},directives:{ripple:k.default},components:{VirtualScroller:V.default,Portal:S.default,TimesIcon:O.default,SearchIcon:y.default,TimesCircleIcon:x.default,ChevronDownIcon:v.default,SpinnerIcon:g.default,CheckIcon:b.default}};function N(e){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},N(e)}function H(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function A(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?H(Object(i),!0).forEach((function(t){j(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):H(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function j(e,t,i){var n;return(t="symbol"==N(n=U(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function U(e,t){if("object"!=N(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=N(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var R=["id","disabled","placeholder","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],G=["onClick"],z=["checked","aria-label"],q=["value","placeholder","aria-owns","aria-activedescendant"],_=["aria-label"],W=["id"],Z=["id"],J=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove","data-p-highlight","data-p-focused","data-p-disabled"];return $.render=function(e,t,i,n,o,l){var s=f.resolveComponent("TimesCircleIcon"),r=f.resolveComponent("SpinnerIcon"),a=f.resolveComponent("VirtualScroller"),c=f.resolveComponent("Portal"),u=f.resolveDirective("ripple");return f.openBlock(),f.createElementBlock("div",f.mergeProps({ref:"container",class:e.cx("root"),onClick:t[15]||(t[15]=function(){return l.onContainerClick&&l.onContainerClick.apply(l,arguments)})},e.ptm("root"),{"data-pc-name":"multiselect"}),[f.createElementVNode("div",f.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[f.createElementVNode("input",f.mergeProps({ref:"focusInput",id:e.inputId,type:"text",readonly:"",disabled:e.disabled,placeholder:e.placeholder,tabindex:e.disabled?-1:e.tabindex,role:"combobox","aria-label":e.ariaLabel,"aria-labelledby":e.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":o.overlayVisible,"aria-controls":o.id+"_list","aria-activedescendant":o.focused?l.focusedOptionId:void 0,onFocus:t[0]||(t[0]=function(){return l.onFocus&&l.onFocus.apply(l,arguments)}),onBlur:t[1]||(t[1]=function(){return l.onBlur&&l.onBlur.apply(l,arguments)}),onKeydown:t[2]||(t[2]=function(){return l.onKeyDown&&l.onKeyDown.apply(l,arguments)})},A(A({},e.inputProps),e.ptm("hiddenInput"))),null,16,R)],16),f.createElementVNode("div",f.mergeProps({class:e.cx("labelContainer")},e.ptm("labelContainer")),[f.createElementVNode("div",f.mergeProps({class:e.cx("label")},e.ptm("label")),[f.renderSlot(e.$slots,"value",{value:e.modelValue,placeholder:e.placeholder},(function(){return["comma"===e.display?(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createTextVNode(f.toDisplayString(l.label||"empty"),1)],64)):"chip"===e.display?(f.openBlock(),f.createElementBlock(f.Fragment,{key:1},[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(l.chipSelectedItems,(function(t){return f.openBlock(),f.createElementBlock("div",f.mergeProps({key:l.getLabelByValue(t),class:e.cx("token")},e.ptm("token")),[f.renderSlot(e.$slots,"chip",{value:t},(function(){return[f.createElementVNode("span",f.mergeProps({class:e.cx("tokenLabel")},e.ptm("tokenLabel")),f.toDisplayString(l.getLabelByValue(t)),17)]})),e.disabled?f.createCommentVNode("",!0):f.renderSlot(e.$slots,"removetokenicon",{key:0,class:f.normalizeClass(e.cx("removeTokenIcon")),item:t,onClick:function(e){return l.removeOption(e,t)},removeCallback:function(e){return l.removeOption(e,t)}},(function(){return[e.removeTokenIcon?(f.openBlock(),f.createElementBlock("span",f.mergeProps({key:0,class:[e.cx("removeTokenIcon"),e.removeTokenIcon],onClick:f.withModifiers((function(e){return l.removeOption(e,t)}),["stop"])},e.ptm("removeTokenIcon")),null,16,G)):(f.openBlock(),f.createBlock(s,f.mergeProps({key:1,class:e.cx("removeTokenIcon"),onClick:f.withModifiers((function(e){return l.removeOption(e,t)}),["stop"])},e.ptm("removeTokenIcon")),null,16,["class","onClick"]))]}))],16)})),128)),e.modelValue&&0!==e.modelValue.length?f.createCommentVNode("",!0):(f.openBlock(),f.createElementBlock(f.Fragment,{key:0},[f.createTextVNode(f.toDisplayString(e.placeholder||"empty"),1)],64))],64)):f.createCommentVNode("",!0)]}))],16)],16),f.createElementVNode("div",f.mergeProps({class:e.cx("trigger")},e.ptm("trigger")),[e.loading?f.renderSlot(e.$slots,"loadingicon",{key:0,class:f.normalizeClass(e.cx("loadingIcon"))},(function(){return[e.loadingIcon?(f.openBlock(),f.createElementBlock("span",f.mergeProps({key:0,class:[e.cx("loadingIcon"),"pi-spin",e.loadingIcon],"aria-hidden":"true"},e.ptm("loadingIcon")),null,16)):(f.openBlock(),f.createBlock(r,f.mergeProps({key:1,class:e.cx("loadingIcon"),spin:"","aria-hidden":"true"},e.ptm("loadingIcon")),null,16,["class"]))]})):f.renderSlot(e.$slots,"dropdownicon",{key:1,class:f.normalizeClass(e.cx("dropdownIcon"))},(function(){return[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.dropdownIcon?"span":"ChevronDownIcon"),f.mergeProps({class:[e.cx("dropdownIcon"),e.dropdownIcon],"aria-hidden":"true"},e.ptm("dropdownIcon")),null,16,["class"]))]}))],16),f.createVNode(c,{appendTo:e.appendTo},{default:f.withCtx((function(){return[f.createVNode(f.Transition,f.mergeProps({name:"p-connected-overlay",onEnter:l.onOverlayEnter,onAfterEnter:l.onOverlayAfterEnter,onLeave:l.onOverlayLeave,onAfterLeave:l.onOverlayAfterLeave},e.ptm("transition")),{default:f.withCtx((function(){return[o.overlayVisible?(f.openBlock(),f.createElementBlock("div",f.mergeProps({key:0,ref:l.overlayRef,style:e.panelStyle,class:[e.cx("panel"),e.panelClass],onClick:t[13]||(t[13]=function(){return l.onOverlayClick&&l.onOverlayClick.apply(l,arguments)}),onKeydown:t[14]||(t[14]=function(){return l.onOverlayKeyDown&&l.onOverlayKeyDown.apply(l,arguments)})},A(A({},e.panelProps),e.ptm("panel"))),[f.createElementVNode("span",f.mergeProps({ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[3]||(t[3]=function(){return l.onFirstHiddenFocus&&l.onFirstHiddenFocus.apply(l,arguments)})},e.ptm("hiddenFirstFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16),f.renderSlot(e.$slots,"header",{value:e.modelValue,options:l.visibleOptions}),e.showToggleAll&&null==e.selectionLimit||e.filter?(f.openBlock(),f.createElementBlock("div",f.mergeProps({key:0,class:e.cx("header")},e.ptm("header")),[e.showToggleAll&&null==e.selectionLimit?(f.openBlock(),f.createElementBlock("div",f.mergeProps({key:0,class:e.cx("headerCheckboxContainer"),onClick:t[6]||(t[6]=function(){return l.onToggleAll&&l.onToggleAll.apply(l,arguments)})},e.ptm("headerCheckboxContainer")),[f.createElementVNode("div",f.mergeProps({class:"p-hidden-accessible"},e.ptm("hiddenInputWrapper"),{"data-p-hidden-accessible":!0}),[f.createElementVNode("input",f.mergeProps({type:"checkbox",readonly:"",checked:l.allSelected,"aria-label":l.toggleAllAriaLabel,onFocus:t[4]||(t[4]=function(){return l.onHeaderCheckboxFocus&&l.onHeaderCheckboxFocus.apply(l,arguments)}),onBlur:t[5]||(t[5]=function(){return l.onHeaderCheckboxBlur&&l.onHeaderCheckboxBlur.apply(l,arguments)})},e.ptm("headerCheckbox")),null,16,z)],16),f.createElementVNode("div",f.mergeProps({class:e.cx("headerCheckbox")},l.getHeaderCheckboxPTOptions("headerCheckbox")),[f.renderSlot(e.$slots,"headercheckboxicon",{allSelected:l.allSelected,class:f.normalizeClass(e.cx("headerCheckboxIcon"))},(function(){return[f.withDirectives((f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.checkboxIcon?"span":"CheckIcon"),f.mergeProps({class:[e.cx("headerCheckboxIcon"),j({},e.checkboxIcon,l.allSelected)]},l.getHeaderCheckboxPTOptions("headerCheckboxIcon")),null,16,["class"])),[[f.vShow,l.allSelected]])]}))],16)],16)):f.createCommentVNode("",!0),e.filter?(f.openBlock(),f.createElementBlock("div",f.mergeProps({key:1,class:e.cx("filterContainer")},e.ptm("filterContainer")),[f.createElementVNode("input",f.mergeProps({ref:"filterInput",type:"text",value:o.filterValue,onVnodeMounted:t[7]||(t[7]=function(){return l.onFilterUpdated&&l.onFilterUpdated.apply(l,arguments)}),class:e.cx("filterInput"),placeholder:e.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":o.id+"_list","aria-activedescendant":l.focusedOptionId,onKeydown:t[8]||(t[8]=function(){return l.onFilterKeyDown&&l.onFilterKeyDown.apply(l,arguments)}),onBlur:t[9]||(t[9]=function(){return l.onFilterBlur&&l.onFilterBlur.apply(l,arguments)}),onInput:t[10]||(t[10]=function(){return l.onFilterChange&&l.onFilterChange.apply(l,arguments)})},A(A({},e.filterInputProps),e.ptm("filterInput"))),null,16,q),f.renderSlot(e.$slots,"filtericon",{class:f.normalizeClass(e.cx("filterIcon"))},(function(){return[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.filterIcon?"span":"SearchIcon"),f.mergeProps({class:[e.cx("filterIcon"),e.filterIcon]},e.ptm("filterIcon")),null,16,["class"]))]}))],16)):f.createCommentVNode("",!0),e.filter?(f.openBlock(),f.createElementBlock("span",f.mergeProps({key:2,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenFilterResult"),{"data-p-hidden-accessible":!0}),f.toDisplayString(l.filterResultMessageText),17)):f.createCommentVNode("",!0),f.withDirectives((f.openBlock(),f.createElementBlock("button",f.mergeProps({class:e.cx("closeButton"),"aria-label":l.closeAriaLabel,onClick:t[11]||(t[11]=function(){return l.onCloseClick&&l.onCloseClick.apply(l,arguments)}),type:"button"},A(A({},e.closeButtonProps),e.ptm("closeButton"))),[f.renderSlot(e.$slots,"closeicon",{class:f.normalizeClass(e.cx("closeIcon"))},(function(){return[(f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.closeIcon?"span":"TimesIcon"),f.mergeProps({class:[e.cx("closeIcon"),e.closeIcon]},e.ptm("closeIcon")),null,16,["class"]))]}))],16,_)),[[u]])],16)):f.createCommentVNode("",!0),f.createElementVNode("div",f.mergeProps({class:e.cx("wrapper"),style:{"max-height":l.virtualScrollerDisabled?e.scrollHeight:""}},e.ptm("wrapper")),[f.createVNode(a,f.mergeProps({ref:l.virtualScrollerRef},e.virtualScrollerOptions,{items:l.visibleOptions,style:{height:e.scrollHeight},tabindex:-1,disabled:l.virtualScrollerDisabled,pt:e.ptm("virtualScroller")}),f.createSlots({content:f.withCtx((function(t){var i=t.styleClass,n=t.contentRef,s=t.items,r=t.getItemOptions,a=t.contentStyle,c=t.itemSize;return[f.createElementVNode("ul",f.mergeProps({ref:function(e){return l.listRef(e,n)},id:o.id+"_list",class:[e.cx("list"),i],style:a,role:"listbox","aria-multiselectable":"true"},e.ptm("list")),[(f.openBlock(!0),f.createElementBlock(f.Fragment,null,f.renderList(s,(function(t,i){return f.openBlock(),f.createElementBlock(f.Fragment,{key:l.getOptionRenderKey(t,l.getOptionIndex(i,r))},[l.isOptionGroup(t)?(f.openBlock(),f.createElementBlock("li",f.mergeProps({key:0,id:o.id+"_"+l.getOptionIndex(i,r),style:{height:c?c+"px":void 0},class:e.cx("itemGroup"),role:"option"},e.ptm("itemGroup")),[f.renderSlot(e.$slots,"optiongroup",{option:t.optionGroup,index:l.getOptionIndex(i,r)},(function(){return[f.createTextVNode(f.toDisplayString(l.getOptionGroupLabel(t.optionGroup)),1)]}))],16,Z)):f.withDirectives((f.openBlock(),f.createElementBlock("li",f.mergeProps({key:1,id:o.id+"_"+l.getOptionIndex(i,r),style:{height:c?c+"px":void 0},class:e.cx("item",{option:t,index:i,getItemOptions:r}),role:"option","aria-label":l.getOptionLabel(t),"aria-selected":l.isSelected(t),"aria-disabled":l.isOptionDisabled(t),"aria-setsize":l.ariaSetSize,"aria-posinset":l.getAriaPosInset(l.getOptionIndex(i,r)),onClick:function(e){return l.onOptionSelect(e,t,l.getOptionIndex(i,r),!0)},onMousemove:function(e){return l.onOptionMouseMove(e,l.getOptionIndex(i,r))}},l.getCheckboxPTOptions(t,r,i,"item"),{"data-p-highlight":l.isSelected(t),"data-p-focused":o.focusedOptionIndex===l.getOptionIndex(i,r),"data-p-disabled":l.isOptionDisabled(t)}),[f.createElementVNode("div",f.mergeProps({class:e.cx("checkboxContainer")},e.ptm("checkboxContainer")),[f.createElementVNode("div",f.mergeProps({class:e.cx("checkbox",{option:t})},l.getCheckboxPTOptions(t,r,i,"checkbox")),[f.renderSlot(e.$slots,"itemcheckboxicon",{selected:l.isSelected(t),class:f.normalizeClass(e.cx("checkboxIcon"))},(function(){return[f.withDirectives((f.openBlock(),f.createBlock(f.resolveDynamicComponent(e.checkboxIcon?"span":"CheckIcon"),f.mergeProps({class:[e.cx("checkboxIcon"),j({},e.checkboxIcon,l.isSelected(t))]},l.getCheckboxPTOptions(t,r,i,"checkboxIcon")),null,16,["class"])),[[f.vShow,l.isSelected(t)]])]}))],16)],16),f.renderSlot(e.$slots,"option",{option:t,index:l.getOptionIndex(i,r)},(function(){return[f.createElementVNode("span",f.normalizeProps(f.guardReactiveProps(e.ptm("option"))),f.toDisplayString(l.getOptionLabel(t)),17)]}))],16,J)),[[u]])],64)})),128)),o.filterValue&&(!s||s&&0===s.length)?(f.openBlock(),f.createElementBlock("li",f.mergeProps({key:0,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[f.renderSlot(e.$slots,"emptyfilter",{},(function(){return[f.createTextVNode(f.toDisplayString(l.emptyFilterMessageText),1)]}))],16)):!e.options||e.options&&0===e.options.length?(f.openBlock(),f.createElementBlock("li",f.mergeProps({key:1,class:e.cx("emptyMessage"),role:"option"},e.ptm("emptyMessage")),[f.renderSlot(e.$slots,"empty",{},(function(){return[f.createTextVNode(f.toDisplayString(l.emptyMessageText),1)]}))],16)):f.createCommentVNode("",!0)],16,W)]})),_:2},[e.$slots.loader?{name:"loader",fn:f.withCtx((function(t){return[f.renderSlot(e.$slots,"loader",{options:t.options})]})),key:"0"}:void 0]),1040,["items","style","disabled","pt"])],16),f.renderSlot(e.$slots,"footer",{value:e.modelValue,options:l.visibleOptions}),!e.options||e.options&&0===e.options.length?(f.openBlock(),f.createElementBlock("span",f.mergeProps({key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenEmptyMessage"),{"data-p-hidden-accessible":!0}),f.toDisplayString(l.emptyMessageText),17)):f.createCommentVNode("",!0),f.createElementVNode("span",f.mergeProps({role:"status","aria-live":"polite",class:"p-hidden-accessible"},e.ptm("hiddenSelectedMessage"),{"data-p-hidden-accessible":!0}),f.toDisplayString(l.selectedMessageText),17),f.createElementVNode("span",f.mergeProps({ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:t[12]||(t[12]=function(){return l.onLastHiddenFocus&&l.onLastHiddenFocus.apply(l,arguments)})},e.ptm("hiddenLastFocusableEl"),{"data-p-hidden-accessible":!0,"data-p-hidden-focusable":!0}),null,16)],16)):f.createCommentVNode("",!0)]})),_:3},16,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]})),_:3},8,["appendTo"])],16)},$}(primevue.api,primevue.icons.check,primevue.icons.chevrondown,primevue.icons.search,primevue.icons.spinner,primevue.icons.times,primevue.icons.timescircle,primevue.overlayeventbus,primevue.portal,primevue.ripple,primevue.utils,primevue.virtualscroller,primevue.basecomponent,primevue.multiselect.style,Vue);