(window.webpackJsonp=window.webpackJsonp||[]).push([[144],{677:function(e,t,n){"use strict";n.r(t);n(41),n(52),n(17),n(26),n(33),n(27),n(8);var r={props:{value:{type:Array,default:function(){return[]}},items:{type:Array,default:function(){return[]}},label:String},data:function(){return{showMenu:!1,menu:null,clickOutsideObj:{handler:this.closeMenu,events:["mousedown"],isActive:!0}}},computed:{selected:{get:function(){return this.value},set:function(e){this.$emit("input",e)}},selectedItems:function(){var e=this;return(this.value||[]).map((function(t){return e.items.find((function(i){return i.value===t}))||{text:t,value:t}}))}},methods:{recalcMenuPos:function(){if(this.menu&&this.$refs.inputWrapper){var e=this.$refs.inputWrapper.getBoundingClientRect();this.menu.style.top=e.y+e.height-4+"px",this.menu.style.left=e.x+"px",this.menu.style.width=e.width+"px"}},unmountMountMenu:function(){if(this.$refs.menu&&this.$refs.inputWrapper){this.menu=this.$refs.menu;var e=this.$refs.inputWrapper.getBoundingClientRect();this.menu.remove(),document.body.appendChild(this.menu),this.menu.style.top=e.y+e.height-4+"px",this.menu.style.left=e.x+"px",this.menu.style.width=e.width+"px"}},clickedOption:function(e,t){var n=this;e&&(e.stopPropagation(),e.preventDefault());var r=null;r=this.selected.includes(t.value)?this.selected.filter((function(s){return s!==t.value})):this.selected.concat([t.value]),this.$emit("input",r),this.$nextTick((function(){n.recalcMenuPos()}))},closeMenu:function(){this.showMenu=!1,this.removeListener()},clickWrapper:function(){this.showMenu=!this.showMenu,this.showMenu?this.setListener():this.removeListener()},removeItem:function(e){var t=this,n=this.selected.filter((function(i){return i!==e}));this.$emit("input",n),this.$nextTick((function(){t.recalcMenuPos()}))},scroll:function(){this.recalcMenuPos()},setListener:function(){document.addEventListener("scroll",this.scroll,!0)},removeListener:function(){document.removeEventListener("scroll",this.scroll,!0)}},mounted:function(){},beforeDestroy:function(){this.menu&&this.menu.remove()}},l=n(4),component=Object(l.a)(r,(function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.clickOutsideObj,expression:"clickOutsideObj"}],staticClass:"w-full"},[t("p",{staticClass:"px-1 text-sm font-semibold"},[e._v(e._s(e.label))]),e._v(" "),t("div",{ref:"wrapper",staticClass:"relative"},[t("div",{ref:"inputWrapper",staticClass:"flex-wrap relative w-full shadow-xs flex items-center bg-primary border border-gray-600 rounded-md px-2 py-1 cursor-pointer",staticStyle:{"min-height":"40px"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.clickWrapper.apply(null,arguments)},mouseup:function(e){e.stopPropagation(),e.preventDefault()},mousedown:function(e){e.preventDefault()}}},e._l(e.selectedItems,(function(n){return t("div",{key:n.value,staticClass:"rounded-full px-2 py-1 ma-0.5 text-xs bg-bg flex flex-nowrap whitespace-nowrap items-center relative"},[t("div",{staticClass:"w-full h-full rounded-full absolute top-0 left-0 opacity-0 hover:opacity-100 px-1 bg-bg/75 flex items-center justify-end cursor-pointer"},[t("span",{staticClass:"material-symbols text-white hover:text-error",staticStyle:{"font-size":"1.1rem"},on:{click:function(t){return t.stopPropagation(),e.removeItem(n.value)}}},[e._v("close")])]),e._v("\n        "+e._s(n.text)+"\n      ")])})),0),e._v(" "),t("transition",{attrs:{name:"menu"}},[t("ul",{directives:[{name:"show",rawName:"v-show",value:e.showMenu,expression:"showMenu"}],ref:"menu",staticClass:"absolute z-60 -mt-px w-full bg-primary border border-black-200 shadow-lg max-h-56 rounded-md py-1 text-base ring-1 ring-black/5 overflow-auto focus:outline-hidden sm:text-sm",attrs:{role:"listbox","aria-labelledby":"listbox-label"}},[e._l(e.items,(function(n){return[t("li",{key:n.value,staticClass:"text-gray-50 select-none relative py-2 pr-9 cursor-pointer hover:bg-black-400",attrs:{role:"option"},on:{click:function(t){return e.clickedOption(t,n)},mouseup:function(e){e.stopPropagation(),e.preventDefault()},mousedown:function(e){e.preventDefault()}}},[t("p",{staticClass:"font-normal ml-3 block truncate"},[e._v(e._s(n.text))]),e._v(" "),e.selected.includes(n.value)?t("div",{staticClass:"text-yellow-400 absolute inset-y-0 right-0 my-auto w-5 h-5 mr-3 overflow-hidden"},[t("span",{staticClass:"material-symbols text-xl"},[e._v("check")])]):e._e()])]})),e._v(" "),e.items.length?e._e():t("li",{staticClass:"text-gray-50 select-none relative py-2 pr-9",attrs:{role:"option"}},[t("div",{staticClass:"flex items-center justify-center"},[t("span",{staticClass:"font-normal"},[e._v(e._s(e.$strings.MessageNoItems))])])])],2)])],1)])}),[],!1,null,null,null);t.default=component.exports}}]);