From 15d4dcb5e88ed599c4802d2db961c05b1123fbc5 Mon Sep 17 00:00:00 2001 From: pvictor Date: Wed, 13 Nov 2024 09:59:46 +0100 Subject: [PATCH] Updated virtual-select to 1.0.46 --- DESCRIPTION | 2 +- NEWS.md | 1 + R/virtual-select.R | 2 +- inst/packer/virtual-select.js | 2 +- inst/packer/virtual-select.js.LICENSE.txt | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- 7 files changed, 13 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index f0a0b5ca..52076151 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: shinyWidgets Title: Custom Inputs Widgets for Shiny -Version: 0.8.7.9000 +Version: 0.8.7.9100 Authors@R: c( person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre", "cph")), person("Fanny", "Meyer", role = "aut"), diff --git a/NEWS.md b/NEWS.md index e88d62e0..3a0d4dd0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -2,6 +2,7 @@ shinyWidgets 0.8.8 ====================== * `knobInput()` and `switchInput()` are softly deprecated, since the JavaScript libraries used by those widgets are no longer actively maintained. +* Updated virtual-select to 1.0.46 (fix focus issue), see https://github.com/sa-si-dev/virtual-select/releases. shinyWidgets 0.8.7 diff --git a/R/virtual-select.R b/R/virtual-select.R index ea164571..7a5f7b5b 100644 --- a/R/virtual-select.R +++ b/R/virtual-select.R @@ -3,7 +3,7 @@ html_dependency_virtualselect <- function() { htmlDependency( name = "virtual-select", - version = "1.0.45", + version = "1.0.46", src = c(file = system.file("packer", package = "shinyWidgets")), script = "virtual-select.js", all_files = FALSE diff --git a/inst/packer/virtual-select.js b/inst/packer/virtual-select.js index 531dc32e..efc82fb5 100644 --- a/inst/packer/virtual-select.js +++ b/inst/packer/virtual-select.js @@ -1,2 +1,2 @@ /*! For license information please see virtual-select.js.LICENSE.txt */ -(()=>{var e={9917:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var i=o(1601),n=o.n(i),s=o(6314),r=o.n(s)()(n());r.push([e.id,"/*!\n * Tooltip v1.0.16\n * https://sa-si-dev.github.io/tooltip\n * Licensed under MIT (https://github.com/sa-si-dev/tooltip/blob/master/LICENSE)\n */\n.tooltip-comp{font-family:sans-serif;font-size:14px;line-height:20px;color:#fff;background-color:#212121;position:absolute;top:0;left:0;max-width:300px;padding:5px 10px;opacity:0;pointer-events:none;word-break:break-word;text-align:left;border-radius:2px}.tooltip-comp-arrow{position:absolute;z-index:1;width:16px;height:16px;overflow:hidden}.tooltip-comp-arrow::before{content:'';position:absolute;top:8px;left:8px;width:16px;height:16px;background-color:#212121;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.tooltip-comp-content{position:relative;z-index:2}.tooltip-comp.hide-arrow-icon .tooltip-comp-arrow{display:none}.tooltip-comp.position-bottom .tooltip-comp-arrow{margin-left:-8px;left:0;top:-15px}.tooltip-comp.position-top .tooltip-comp-arrow{margin-left:-8px;left:0;bottom:-15px}.tooltip-comp.position-right .tooltip-comp-arrow{margin-top:-8px;top:0;left:-15px}.tooltip-comp.position-left .tooltip-comp-arrow{margin-top:-8px;top:0;right:-15px}\n\n",""]);const a=r},4185:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var i=o(1601),n=o.n(i),s=o(6314),r=o.n(s)()(n());r.push([e.id,'/*!\n * Virtual Select v1.0.45\n * https://sa-si-dev.github.io/virtual-select\n * Licensed under MIT (https://github.com/sa-si-dev/virtual-select/blob/master/LICENSE)\n */\n@keyframes vscomp-animation-spin{to{transform:rotateZ(360deg)}}.vscomp-popup-active{overflow:hidden !important}.vscomp-ele{display:inline-block;max-width:250px;width:100%}.vscomp-wrapper{color:#333;display:inline-flex;flex-wrap:wrap;font-family:sans-serif;font-size:14px;position:relative;text-align:left;width:100%}.vscomp-wrapper *,.vscomp-wrapper *::before,.vscomp-wrapper *::after{box-sizing:border-box}.vscomp-wrapper:focus{outline:none}.vscomp-dropbox-wrapper{left:0;position:absolute;top:0}.vscomp-toggle-button{align-items:center;background-color:#fff;border:1px solid #ddd;cursor:pointer;display:flex;padding:7px 30px 7px 10px;position:relative;width:100%}.vscomp-value{height:20px;line-height:20px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vscomp-arrow{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;width:30px}.vscomp-arrow::after{transform:rotate(45deg);border:1px solid rgba(0,0,0,0);border-bottom-color:#111;border-right-color:#111;content:"";height:8px;margin-top:-6px;width:8px}.vscomp-clear-icon{height:12px;position:relative;width:12px}.vscomp-clear-icon::before,.vscomp-clear-icon::after{background-color:#999;content:"";height:12px;left:5px;position:absolute;top:0;width:2px}.vscomp-clear-icon::before{transform:rotate(45deg)}.vscomp-clear-icon::after{transform:rotate(-45deg)}.vscomp-clear-icon:hover::before,.vscomp-clear-icon:hover::after{background:#333}.vscomp-clear-button{align-items:center;border-radius:50%;display:none;height:24px;justify-content:center;margin-top:-12px;position:absolute;right:30px;top:50%;width:24px}.vscomp-clear-button:hover{background:#ccc}.vscomp-clear-button:hover .vscomp-clear-icon::before,.vscomp-clear-button:hover .vscomp-clear-icon::after{background-color:#333}.vscomp-dropbox-close-button{align-items:center;background-color:#fff;border-radius:50%;bottom:-48px;cursor:pointer;display:none;height:40px;justify-content:center;left:50%;margin-left:-20px;position:absolute;width:40px}.vscomp-value-tag.more-value-count{white-space:nowrap}.vscomp-dropbox-container{width:100%;z-index:2}.vscomp-dropbox{background-color:#fff;width:100%}.vscomp-options-container{max-height:210px;overflow:auto;position:relative}.vscomp-options-bottom-freezer{bottom:0;height:2px;left:0;position:absolute;right:0}.vscomp-option{align-items:center;cursor:pointer;display:flex;flex-wrap:wrap;height:40px;padding:0 15px;position:relative}.vscomp-option.selected{background-color:#eee}.vscomp-option.focused{background-color:#ccc}.vscomp-option.disabled{cursor:default;opacity:.5}.vscomp-option.group-title .vscomp-option-text{cursor:default;opacity:.6}.vscomp-option.group-title.selected{background-color:rgba(0,0,0,0)}.vscomp-option.group-option{padding-left:30px}.vscomp-new-option-icon{height:30px;position:absolute;right:0;top:0;width:30px}.vscomp-new-option-icon::before{border:15px solid #512da8;border-bottom-color:rgba(0,0,0,0);border-left-color:rgba(0,0,0,0);content:"";position:absolute;right:0;top:0}.vscomp-new-option-icon::after{align-items:center;color:#fff;content:"+";display:flex;font-size:18px;height:15px;justify-content:center;position:absolute;right:1px;top:0;width:15px}.vscomp-option-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.vscomp-option-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666;font-size:13px;line-height:15px;width:100%}.vscomp-search-container{align-items:center;border-bottom:1px solid #ddd;display:flex;height:40px;padding:0 5px 0 15px;position:relative}.vscomp-search-label,.vscomp-live-region,.vscomp-dropbox-container-top,.vscomp-dropbox-container-bottom{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.vscomp-search-input{background-color:rgba(0,0,0,0);border:0;color:inherit;font-size:15px;height:38px;padding:10px 0;width:calc(100% - 30px)}.vscomp-search-input:focus{outline:none}.vscomp-search-clear{align-items:center;color:#999;cursor:pointer;display:flex;font-size:25px;height:30px;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;width:30px}.vscomp-search-clear:hover{color:inherit}.vscomp-no-options,.vscomp-no-search-results{align-items:center;display:none;justify-content:center;padding:20px 10px}.vscomp-options-loader{display:none;padding:20px 0;text-align:center}.vscomp-options-loader::before{animation:vscomp-animation-spin .8s infinite linear;background-color:#fff;border-radius:50%;box-shadow:-4px -5px 3px -3px rgba(0,0,0,.3);content:"";display:inline-block;height:40px;opacity:.7;width:40px}.vscomp-ele[disabled]{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vscomp-ele[disabled] .vscomp-wrapper{opacity:.7;pointer-events:none}.vscomp-wrapper .checkbox-icon{display:inline-flex;height:15px;margin-right:10px;position:relative;width:15px}.vscomp-wrapper .checkbox-icon::after{transition-duration:.2s;border:2px solid #888;content:"";display:inline-block;height:100%;width:100%}.vscomp-wrapper .checkbox-icon.checked::after{transform:rotate(45deg) translate(1px, -4px);border-color:#512da8;border-left-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);width:50%}.vscomp-wrapper.show-as-popup .vscomp-dropbox-container{align-items:center;background-color:rgba(0,0,0,.5);display:flex;height:100vh;justify-content:center;left:0;opacity:1;overflow:auto;padding:0 10px;position:fixed;top:0;width:100vw}.vscomp-wrapper.show-as-popup .vscomp-dropbox{margin-top:-24px;max-height:calc(80% - 48px);max-width:500px;position:relative;width:80%}.vscomp-wrapper.show-as-popup .vscomp-dropbox-close-button{display:flex}.vscomp-wrapper.popup-position-left .vscomp-dropbox-container{justify-content:flex-start}.vscomp-wrapper.popup-position-right .vscomp-dropbox-container{justify-content:flex-end}.vscomp-wrapper.has-select-all .vscomp-toggle-all-button{align-items:center;cursor:pointer;display:flex}.vscomp-wrapper.has-select-all .vscomp-search-input,.vscomp-wrapper.has-select-all .vscomp-toggle-all-label{width:calc(100% - 55px)}.vscomp-wrapper.has-select-all .vscomp-toggle-all-label{display:none}.vscomp-wrapper:not(.has-search-input) .vscomp-toggle-all-button{width:100%}.vscomp-wrapper:not(.has-search-input) .vscomp-toggle-all-label{display:inline-block}.vscomp-wrapper.multiple .vscomp-option .vscomp-option-text{width:calc(100% - 25px)}.vscomp-wrapper.multiple .vscomp-option .vscomp-option-description{padding-left:25px}.vscomp-wrapper.multiple .vscomp-option.selected .checkbox-icon::after{transform:rotate(45deg) translate(1px, -4px);border-color:#512da8;border-left-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);width:50%}.vscomp-wrapper.focused .vscomp-toggle-button,.vscomp-wrapper:focus .vscomp-toggle-button{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.vscomp-wrapper.closed .vscomp-dropbox-container,.vscomp-wrapper.closed.vscomp-dropbox-wrapper{display:none}.vscomp-wrapper:not(.has-value) .vscomp-value{opacity:.5}.vscomp-wrapper.has-clear-button.has-value .vscomp-clear-button{display:flex}.vscomp-wrapper.has-clear-button .vscomp-toggle-button{padding-right:54px}.vscomp-wrapper.has-no-options .vscomp-options-container,.vscomp-wrapper.has-no-search-results .vscomp-options-container{display:none}.vscomp-wrapper.has-no-options .vscomp-no-options{display:flex}.vscomp-wrapper.has-no-search-results .vscomp-no-search-results{display:flex}.vscomp-wrapper.has-search-value .vscomp-search-clear{visibility:visible}.vscomp-wrapper.has-no-options .vscomp-toggle-all-button{opacity:.5;pointer-events:none}.vscomp-wrapper.keep-always-open .vscomp-toggle-button{padding-right:24px}.vscomp-wrapper.keep-always-open .vscomp-clear-button{right:5px}.vscomp-wrapper.keep-always-open .vscomp-arrow{display:none}.vscomp-wrapper.keep-always-open .vscomp-dropbox-container{position:relative;z-index:1}.vscomp-wrapper.keep-always-open .vscomp-dropbox{transition-duration:0s;border:1px solid #ddd;box-shadow:none}.vscomp-wrapper.keep-always-open.focused,.vscomp-wrapper.keep-always-open:focus,.vscomp-wrapper.keep-always-open:hover{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.vscomp-wrapper.server-searching .vscomp-options-list{display:none}.vscomp-wrapper.server-searching .vscomp-options-loader{display:block}.vscomp-wrapper.has-error .vscomp-toggle-button{border-color:#b00020}.vscomp-wrapper.show-value-as-tags .vscomp-toggle-button{padding:4px 22px 0 10px}.vscomp-wrapper.show-value-as-tags .vscomp-value{display:flex;flex-wrap:wrap;height:auto;min-height:28px;overflow:auto;text-overflow:unset;white-space:normal}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;align-items:center;border:1px solid #ddd;border-radius:20px;display:inline-flex;font-size:12px;line-height:16px;margin:0 4px 4px 0;max-width:100%;padding:2px 3px 2px 8px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag.more-value-count{padding-right:8px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:calc(100% - 20px)}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-clear-button{align-items:center;display:flex;height:20px;justify-content:center;width:20px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-clear-button .vscomp-clear-icon{transform:scale(0.8)}.vscomp-wrapper.show-value-as-tags .vscomp-arrow{height:34px}.vscomp-wrapper.show-value-as-tags .vscomp-clear-button{margin-top:0;top:5px}.vscomp-wrapper.show-value-as-tags.has-value .vscomp-arrow{display:none}.vscomp-wrapper.show-value-as-tags.has-value .vscomp-clear-button{right:2px}.vscomp-wrapper.show-value-as-tags:not(.has-value) .vscomp-toggle-button{padding-bottom:2px}.vscomp-wrapper.show-value-as-tags:not(.has-value) .vscomp-value{align-items:center;padding-bottom:3px}.vscomp-wrapper.text-direction-rtl{direction:rtl}.vscomp-wrapper.text-direction-rtl .vscomp-toggle-button{padding:7px 10px 7px 30px}.vscomp-wrapper.text-direction-rtl .vscomp-arrow{left:0;right:auto}.vscomp-wrapper.text-direction-rtl .vscomp-clear-button{left:30px;right:auto !important}.vscomp-wrapper.text-direction-rtl .checkbox-icon{margin-left:10px;margin-right:0}.vscomp-wrapper.text-direction-rtl .checkbox-icon.checked::after{transform:rotate(45deg) translate(-4px, 1px)}.vscomp-wrapper.text-direction-rtl .vscomp-search-container{padding:0 15px 0 5px}.vscomp-wrapper.text-direction-rtl .vscomp-toggle-all-label{text-align:right}.vscomp-wrapper.text-direction-rtl .vscomp-option{text-align:right}.vscomp-wrapper.text-direction-rtl .vscomp-option.group-option{padding-right:30px}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon{left:0;right:auto}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon::before{border-left-color:#512da8;border-right-color:rgba(0,0,0,0)}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon::after{left:1px;right:auto}.vscomp-wrapper.text-direction-rtl.multiple .vscomp-option.selected .checkbox-icon::after{transform:rotate(45deg) translate(-4px, 1px)}.vscomp-wrapper.text-direction-rtl.has-clear-button .vscomp-toggle-button{padding-left:54px}.vscomp-wrapper.text-direction-rtl.keep-always-open .vscomp-toggle-button{padding-left:24px}.vscomp-wrapper.text-direction-rtl.keep-always-open .vscomp-clear-button{left:5px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-toggle-button{padding:4px 10px 0 22px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-value-tag{margin:0 0 4px 4px;padding:2px 8px 2px 3px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-value-tag.more-value-count{padding-left:8px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags.has-value .vscomp-clear-button{left:2px}\n/*!\n * Popover v1.0.13\n * https://sa-si-dev.github.io/popover\n * Licensed under MIT (https://github.com/sa-si-dev/popover/blob/master/LICENSE)\n */\n.pop-comp-wrapper{display:none;position:absolute;top:0;left:0;opacity:0;color:#000;background-color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);text-align:left;flex-wrap:wrap;z-index:1}.pop-comp-arrow{position:absolute;z-index:1;width:16px;height:16px;overflow:hidden;pointer-events:none}.pop-comp-arrow::before{content:"";position:absolute;top:8px;left:8px;width:16px;height:16px;background-color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.pop-comp-content{position:relative;z-index:2}.pop-comp-wrapper.position-bottom>.pop-comp-arrow{margin-left:-8px;left:0;top:-15px}.pop-comp-wrapper.position-bottom>.pop-comp-arrow::before{box-shadow:0px 0px 2px 0 rgba(0,0,0,.14)}.pop-comp-wrapper.position-top>.pop-comp-arrow{margin-left:-8px;left:0;bottom:-15px}.pop-comp-wrapper.position-right>.pop-comp-arrow{margin-top:-8px;top:0;left:-15px}.pop-comp-wrapper.position-left>.pop-comp-arrow{margin-top:-8px;top:0;right:-15px}.pop-comp-disable-events{pointer-events:none}\n',""]);const a=r},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",i=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),i&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),i&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,i,n,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),t.push(c))}},t}},1601:e=>{"use strict";e.exports=function(e){return e[1]}},5072:e=>{"use strict";var t=[];function o(e){for(var o=-1,i=0;i{"use strict";var t={};e.exports=function(e,o){var i=function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(o)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,o)=>{"use strict";e.exports=function(e){var t=o.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(o){!function(e,t,o){var i="";o.supports&&(i+="@supports (".concat(o.supports,") {")),o.media&&(i+="@media ".concat(o.media," {"));var n=void 0!==o.layer;n&&(i+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),i+=o.css,n&&(i+="}"),o.media&&(i+="}"),o.supports&&(i+="}");var s=o.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,o)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5304:()=>{!function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oo-n-t.width?"left":"right",vertical:s>i-s-t.height?"top":"bottom"}}},{key:"getAbsoluteCoords",value:function(e){if(e){var t=e.getBoundingClientRect(),o=window.pageXOffset,i=window.pageYOffset;return{width:t.width,height:t.height,top:t.top+i,right:t.right+o,bottom:t.bottom+i,left:t.left+o}}}},{key:"getCoords",value:function(e){return e?e.getBoundingClientRect():{}}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"show",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";t.setStyle(e,"display",o)}},{key:"hide",value:function(e){t.setStyle(e,"display","none")}},{key:"getHideableParent",value:function(e){for(var t,o=e.parentElement;o;){var i=getComputedStyle(o).overflow;if(-1!==i.indexOf("scroll")||-1!==i.indexOf("auto")){t=o;break}o=o.parentElement}return t}}])&&function(e,t){for(var o=0;og?g-f:M:k+c>L&&("right"===C?s="left":k=L+fx?x-h:P:E+u>I&&("bottom"===C?s="top":E=I+hc-R&&(N=c-R):"left"!==C&&"right"!==C||((W=b/2+y-G)u-R&&(W=u-R)),o.setStyle(this.$arrowEle,"transform","translate3d(".concat(N,"px, ").concat(W,"px, 0) ").concat(K))}o.hide(this.$popperEle)}},{key:"resetPosition",value:function(){o.setStyle(this.$popperEle,"transform","none"),this.setPosition()}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.resetPosition,n=t.data;clearTimeout(this.exitDelayTimeout),clearTimeout(this.hideDurationTimeout),i&&this.resetPosition(),this.enterDelayTimeout=setTimeout((function(){var t=o.getData(e.$popperEle,"left"),i=o.getData(e.$popperEle,"top"),s="translate3d(".concat(t,"px, ").concat(i,"px, 0)"),r=e.showDuration;o.show(e.$popperEle,"inline-flex"),o.getCoords(e.$popperEle),o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",1),e.showDurationTimeout=setTimeout((function(){"function"==typeof e.afterShowCallback&&e.afterShowCallback(n)}),r)}),this.enterDelay)}},{key:"hide",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data;clearTimeout(this.enterDelayTimeout),clearTimeout(this.showDurationTimeout),this.exitDelayTimeout=setTimeout((function(){if(e.$popperEle){var i=o.getData(e.$popperEle,"fromLeft"),n=o.getData(e.$popperEle,"fromTop"),s="translate3d(".concat(i,"px, ").concat(n,"px, 0)"),r=e.hideDuration;o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",0),e.hideDurationTimeout=setTimeout((function(){o.hide(e.$popperEle),"function"==typeof e.afterHideCallback&&e.afterHideCallback(t)}),r)}}),this.exitDelay)}},{key:"updatePosition",value:function(){o.setStyle(this.$popperEle,"transitionDuration","0ms"),this.resetPosition();var e=o.getData(this.$popperEle,"left"),t=o.getData(this.$popperEle,"top");o.show(this.$popperEle,"inline-flex"),o.setStyle(this.$popperEle,"transform","translate3d(".concat(e,"px, ").concat(t,"px, 0)"))}}])&&function(e,t){for(var o=0;o1&&void 0!==arguments[1]&&arguments[1]}},{key:"convertToFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return void 0!==e?parseFloat(e):t}}],i&&e(o,i),t}();function o(e,t){for(var o=0;oe.offsetWidth}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"getScrollableParents",value:function(e){if(!e)return[];for(var t=[window],o=e.parentElement;o;){var i=getComputedStyle(o).overflow;-1===i.indexOf("scroll")&&-1===i.indexOf("auto")||t.push(o),o=o.parentElement}return t}}],i&&o(t,i),e}();!function(){if(!window.tooltipComponentInitiated){var e,o,n,s,r;window.tooltipComponentInitiated=!0;var a,l={},p=!1;c(),window.addEventListener("load",c)}function c(){p||(e=document.querySelector("body"))&&(document.addEventListener("mouseover",u),document.addEventListener("mouseout",h),document.addEventListener("touchmove",d),document.addEventListener("click",v),p=!0)}function u(p){if(!n){var c=p.target.closest("[data-tooltip]");c&&(n=c,function(){if(n){var p,c=t.convertToBoolean,u=t.convertToFloat,h=n.dataset;!(l={tooltip:h.tooltip,position:h.tooltipPosition||"auto",zIndex:u(h.tooltipZIndex,1),enterDelay:u(h.tooltipEnterDelay,0),exitDelay:u(h.tooltipExitDelay,0),fontSize:h.tooltipFontSize||"14px",margin:u(h.tooltipMargin,8),offset:u(h.tooltipOffset,5),showDuration:u(h.tooltipShowDuration,300),hideDuration:u(h.tooltipHideDuration,200),transitionDistance:u(h.tooltipTransitionDistance,10),ellipsisOnly:c(h.tooltipEllipsisOnly),allowHtml:c(h.tooltipAllowHtml),hideOnClick:c(h.tooltipHideOnClick,!0),hideArrowIcon:c(h.tooltipHideArrowIcon),alignment:h.tooltipAlignment||"left",maxWidth:h.tooltipMaxWidth||"300px",additionalClasses:h.tooltipAdditionalClasses}).tooltip||l.ellipsisOnly&&!i.hasEllipsis(n)?f():(o&&o.remove(),function(){var t="tooltip-comp";l.hideArrowIcon&&(t+=" hide-arrow-icon"),l.additionalClasses&&(t+=" "+l.additionalClasses);var n='
\n \n
\n
');e.insertAdjacentHTML("beforeend",n);var r=i.setStyle;o=document.querySelector(".tooltip-comp"),s=o.querySelector(".tooltip-comp-arrow");var a=o.querySelector(".tooltip-comp-content");l.allowHtml?a.innerHTML=l.tooltip:a.innerText=l.tooltip,r(o,"zIndex",l.zIndex),r(o,"fontSize",l.fontSize),r(o,"textAlign",l.alignment),r(o,"maxWidth",l.maxWidth)}(),p={$popperEle:o,$triggerEle:n,$arrowEle:s,position:l.position,margin:l.margin,offset:l.offset,enterDelay:l.enterDelay,exitDelay:l.exitDelay,showDuration:l.showDuration,hideDuration:l.hideDuration,transitionDistance:l.transitionDistance,zIndex:l.zIndex},(a=new PopperComponent(p)).show(),(r=i.getScrollableParents(n)).forEach((function(e){e.addEventListener("scroll",m)})))}}())}}function h(e){if(n){for(var t=e.relatedTarget;t;){if(t===n)return;t=t.parentNode}f()}}function d(){f()}function v(){l.hideOnClick&&f()}function f(){(o||n)&&(a&&a.hide(),r&&(r.forEach((function(e){e.removeEventListener("scroll",m)})),r=null),n=null)}function m(){f()}}()}()},5024:()=>{!function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);o1&&void 0!==arguments[1]&&arguments[1]}},{key:"isEmpty",value:function(e){var t=!1;return e?Array.isArray(e)?0===e.length&&(t=!0):"object"===o(e)&&0===Object.keys(e).length&&(t=!0):t=!0,t}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"removeItemFromArray",value:function(t,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Array.isArray(t)||!t.length)return t;var n=i?e(t):t,s=n.indexOf(o);return-1!==s&&n.splice(s,1),n}},{key:"removeArrayEmpty",value:function(e){return Array.isArray(e)&&e.length?e.filter((function(e){return!!e})):[]}},{key:"getRandomInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=Math.ceil(t),i=Math.floor(e);return Math.floor(Math.random()*(i-o-1))+o}},{key:"regexEscape",value:function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"normalizeString",value:function(e){return e.normalize("NFD").replace(/[^\w]/g,"")}},{key:"willTextOverflow",value:function(e,t){var o=document.createElement("div");o.style.position="absolute",o.style.visibility="hidden",o.style.whiteSpace="nowrap",o.style.fontSize=window.getComputedStyle(e).fontSize,o.style.fontFamily=window.getComputedStyle(e).fontFamily,o.textContent=t,document.body.appendChild(o);var i=o.clientWidth;return document.body.removeChild(o),i>e.clientWidth}},{key:"replaceDoubleQuotesWithHTML",value:function(e){return e.replace(/"/g,""")}},{key:"containsHTML",value:function(e){return/<[a-z][\s\S]*>/i.test(e)}}],s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),t}();function s(e){return s="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},s(e)}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){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 a(e,t){if(e){if("string"==typeof e)return l(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oe.offsetWidth}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setAttr",value:function(e,t,o){e&&e.setAttribute(t,o)}},{key:"setAttrFromEle",value:function(e,t,o,i){var n={};o.forEach((function(t){n[t]=e.getAttribute(t)})),o.forEach((function(e){var o=n[e];(o||-1!==i.indexOf(e)&&""===o)&&t.setAttribute(e,o)}))}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"setStyles",value:function(e,t){e&&t&&Object.keys(t).forEach((function(o){e.style[o]=t[o]}))}},{key:"setAria",value:function(e,t,o){var i=t;"role"!==i&&(i="aria-".concat(i)),e.setAttribute(i,o)}},{key:"getElements",value:function(e){return e?void 0===e.forEach?[e]:e:[]}},{key:"getElementsBySelector",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=void 0!==o?o:document;return""!==t&&(e=i.querySelectorAll(t)),void 0!==e?Array.from(e):[]}},{key:"addEvent",value:function(t,o,i){t&&n.removeArrayEmpty(o.split(" ")).forEach((function(o){e.getElements(t).forEach((function(e){e.addEventListener(o,i)}))}))}},{key:"dispatchEvent",value:function(t,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var n=e.getElements(t);setTimeout((function(){n.forEach((function(e){e.dispatchEvent(new CustomEvent(o,{bubbles:i}))}))}),0)}}},{key:"getAttributesText",value:function(e){var t="";return e?(Object.entries(e).forEach((function(e){var o=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,n,s,r=[],a=!0,l=!1;try{for(n=(t=t.call(e)).next,!2;!(a=(o=n.call(t)).done)&&(r.push(o.value),2!==r.length);a=!0);}catch(e){l=!0,i=e}finally{try{if(!a&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return r}}(e)||a(e,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),i=o[0],n=o[1];void 0!==n&&(t+=" ".concat(i,'="').concat(n,'" '))})),t):t}},{key:"convertPropToDataAttr",value:function(e){return e?"data-".concat(e).replace(/([A-Z])/g,"-$1").toLowerCase():""}},{key:"changeTabIndex",value:function(t,o){t?e.getElements(t).forEach((function(e){e.tabIndex=o})):console.log(t,"Invalid element provided.")}},{key:"removeEvent",value:function(t,o,i){t&&e.getElements(t).forEach((function(e){e.removeEventListener(o,i)}))}}],o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function h(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,i=new Array(t);o\n \n
\n
\n ").concat(this.placeholder,'\n
\n
\n
\n \n
\n
\n\n ').concat(this.renderDropbox({wrapperClasses:t}),"\n ");this.$ele.innerHTML=p,this.$body=document.querySelector("body"),this.$wrapper=this.$ele.querySelector(".vscomp-wrapper"),this.hasDropboxWrapper?(this.$allWrappers=[this.$wrapper,this.$dropboxWrapper],this.$dropboxContainer=this.$dropboxWrapper.querySelector(".vscomp-dropbox-container"),c.addClass(this.$dropboxContainer,"pop-comp-wrapper")):(this.$allWrappers=[this.$wrapper],this.$dropboxContainer=this.$wrapper.querySelector(".vscomp-dropbox-container")),this.$toggleButton=this.$ele.querySelector(".vscomp-toggle-button"),this.$clearButton=this.$ele.querySelector(".vscomp-clear-button"),this.$valueText=this.$ele.querySelector(".vscomp-value"),this.$hiddenInput=this.$ele.querySelector(".vscomp-hidden-input"),this.$dropbox=this.$dropboxContainer.querySelector(".vscomp-dropbox"),this.$dropboxCloseButton=this.$dropboxContainer.querySelector(".vscomp-dropbox-close-button"),this.$dropboxContainerBottom=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-bottom"),this.$dropboxContainerTop=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-top"),this.$search=this.$dropboxContainer.querySelector(".vscomp-search-wrapper"),this.$optionsContainer=this.$dropboxContainer.querySelector(".vscomp-options-container"),this.$optionsList=this.$dropboxContainer.querySelector(".vscomp-options-list"),this.$options=this.$dropboxContainer.querySelector(".vscomp-options"),this.$noOptions=this.$dropboxContainer.querySelector(".vscomp-no-options"),this.$noSearchResults=this.$dropboxContainer.querySelector(".vscomp-no-search-results"),this.afterRenderWrapper()}}},{key:"renderDropbox",value:function(e){var t=e.wrapperClasses,o="self"!==this.dropboxWrapper?document.querySelector(this.dropboxWrapper):null,i="vscomp-dropbox";this.additionalDropboxClasses&&(i+=" ".concat(this.additionalDropboxClasses));var n="vscomp-dropbox-container";this.additionalDropboxContainerClasses&&(n+=" ".concat(this.additionalDropboxContainerClasses));var s='
\n \n
\n
\n\n
\n
\n\n
\n
\n
\n
\n\n
\n
').concat(this.noOptionsText,'
\n
').concat(this.noSearchResultsText,'
\n\n \n
\n \n
');if(o){var r=document.createElement("div");return this.$dropboxWrapper=r,this.hasDropboxWrapper=!0,r.innerHTML=s,o.appendChild(r),c.addClass(r,"vscomp-dropbox-wrapper ".concat(t)),""}return this.hasDropboxWrapper=!1,s}},{key:"renderOptions",value:function(){var e,t=this,o="",i=this.getVisibleOptions(),s="",r="",a=!(!this.markSearchResults||!this.searchValue),l=this.labelRenderer,p=this.disableOptionGroupCheckbox,c=this.uniqueId,u=this.searchGroup,h="function"==typeof l,d=n.convertToBoolean,v="";if(a&&(e=new RegExp("(".concat(n.regexEscape(this.searchValue),")(?!([^<]+)?>)"),"gi")),this.multiple&&(s=''),this.allowNewOption){var f=this.getTooltipAttrText("New Option");r='")}i.forEach((function(i){var n,f=i.index,m="vscomp-option",b=t.getTooltipAttrText("",!0,!0),y=s,g="",x="",w="",S="",O="-1",k=d(i.isSelected),E="";if(i.classNames&&(m+=" ".concat(i.classNames)),i.isFocused&&(O="0",m+=" focused"),i.isDisabled&&(m+=" disabled",E='aria-disabled="true"'),i.isGroupTitle&&(v=i.label,m+=" group-title",p&&(y="")),k&&(m+=" selected"),i.isGroupOption){var C="";m+=" group-option",w='data-group-index="'.concat(i.groupIndex,'"'),i.customData?(v=void 0!==i.customData.group_name?"".concat(i.customData.group_name,", "):"",C=void 0!==i.customData.description?" ".concat(i.customData.description,","):"",S='aria-label="'.concat(v," ").concat(i.label,", ").concat(C,'"')):S='aria-label="'.concat(v,", ").concat(i.label,'"')}n=h?l(i):i.label,i.description&&(x='
").concat(i.description,"
")),i.isCurrentNew?(m+=" current-new",g+=r):!a||i.isGroupTitle&&!u||(n=n.replace(e,"$1")),o+='
\n ").concat(n,"\n \n ").concat(x,"\n ").concat(g,"\n
")})),v="",this.$options.innerHTML=o,this.$visibleOptions=this.$options.querySelectorAll(".vscomp-option"),this.afterRenderOptions()}},{key:"renderSearch",value:function(){if(this.hasSearchContainer){var e="",t="";this.multiple&&!this.disableSelectAll&&(e='\n \n '.concat(this.selectAllText,"\n ")),this.hasSearch&&(t='\n \n ×'));var o='
\n '.concat(e,"\n ").concat(t,"\n
");this.$search.innerHTML=o,this.$searchInput=this.$dropboxContainer.querySelector(".vscomp-search-input"),this.$searchClear=this.$dropboxContainer.querySelector(".vscomp-search-clear"),this.$toggleAllButton=this.$dropboxContainer.querySelector(".vscomp-toggle-all-button"),this.$toggleAllCheckbox=this.$dropboxContainer.querySelector(".vscomp-toggle-all-checkbox"),this.addEvent(this.$searchInput,"input","onSearch"),this.addEvent(this.$searchClear,"click","onSearchClear"),this.addEvent(this.$toggleAllButton,"click","onToggleAllOptions"),this.addEvent(this.$dropboxContainerBottom,"focus","onDropboxContainerTopOrBottomFocus"),this.addEvent(this.$dropboxContainerTop,"focus","onDropboxContainerTopOrBottomFocus")}}},{key:"addEvents",value:function(){this.addEvent(document,"click","onDocumentClick"),this.addEvent(this.$allWrappers,"keydown","onKeyDown"),this.addEvent(this.$toggleButton,"click","onToggleButtonClick"),this.addEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.addEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.addEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.addEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.addEvent(this.$options,"click","onOptionsClick"),this.addEvent(this.$options,"mouseover","onOptionsMouseOver"),this.addEvent(this.$options,"touchmove","onOptionsTouchMove"),this.addMutationObserver()}},{key:"addEvent",value:function(e,t,o){var i=this;e&&n.removeArrayEmpty(t.split(" ")).forEach((function(t){var n="".concat(o,"-").concat(t),s=i.events[n];s||(s=i[o].bind(i),i.events[n]=s),c.addEvent(e,t,s)}))}},{key:"removeEvents",value:function(){this.removeEvent(document,"click","onDocumentClick"),this.removeEvent(this.$allWrappers,"keydown","onKeyDown"),this.removeEvent(this.$toggleButton,"click","onToggleButtonClick"),this.removeEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.removeEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.removeEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.removeEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.removeEvent(this.$options,"click","onOptionsClick"),this.removeEvent(this.$options,"mouseover","onOptionsMouseOver"),this.removeEvent(this.$options,"touchmove","onOptionsTouchMove"),this.removeMutationObserver()}},{key:"removeEvent",value:function(e,t,o){var i=this;e&&n.removeArrayEmpty(t.split(" ")).forEach((function(t){var n="".concat(o,"-").concat(t),s=i.events[n];s&&c.removeEvent(e,t,s)}))}},{key:"onDocumentClick",value:function(e){var t=e.target.closest(".vscomp-wrapper");t!==this.$wrapper&&t!==this.$dropboxWrapper&&this.isOpened()&&this.closeDropbox()}},{key:"onKeyDown",value:function(e){var t=e.which||e.keyCode,o=w[t];if(document.activeElement===this.$searchInput&&e.shiftKey&&9===t)return e.preventDefault(),void(this.keepAlwaysOpen?this.$dropboxContainerTop.focus():this.closeDropbox());if(document.activeElement===this.$searchInput&&9===t)return e.preventDefault(),void this.focusFirstVisibleOption();if(27===t||"Escape"===e.key){var i=this.showAsPopup?this.$wrapper:this.$dropboxWrapper;if((document.activeElement===i||i.contains(document.activeElement))&&!this.keepAlwaysOpen)return void this.closeDropbox()}o&&this[o](e)}},{key:"onEnterPress",value:function(e){e.preventDefault(),this.isOpened()?this.selectFocusedOption():!1===this.$ele.disabled&&this.openDropbox()}},{key:"onDownArrowPress",value:function(e){e.preventDefault(),this.isOpened()?this.focusOption({direction:"next"}):this.openDropbox()}},{key:"onUpArrowPress",value:function(e){e.preventDefault(),this.isOpened()?this.focusOption({direction:"previous"}):this.openDropbox()}},{key:"onBackspaceOrDeletePress",value:function(e){e.target===this.$wrapper&&(e.preventDefault(),this.selectedValues.length>0&&this.reset())}},{key:"onToggleButtonClick",value:function(e){var t=e.target;t.closest(".vscomp-value-tag-clear-button")?this.removeValue(t.closest(".vscomp-value-tag")):t.closest(".toggle-button-child")||this.toggleDropbox()}},{key:"onClearButtonClick",value:function(e){"click"===e.type?this.reset():"keydown"!==e.type||"Enter"!==e.code&&"Space"!==e.code||(e.stopPropagation(),this.reset())}},{key:"onOptionsScroll",value:function(){this.setVisibleOptions()}},{key:"onOptionsClick",value:function(e){var t=e.target.closest(".vscomp-option");t&&!c.hasClass(t,"disabled")&&(c.hasClass(t,"group-title")?this.onGroupTitleClick(t):this.selectOption(t,{event:e}))}},{key:"onGroupTitleClick",value:function(e){if(e&&this.multiple&&!this.disableOptionGroupCheckbox){var t=!c.hasClass(e,"selected");this.toggleGroupTitleCheckbox(e,t),this.toggleGroupOptions(e,t)}}},{key:"onDropboxContainerClick",value:function(e){e.target.closest(".vscomp-dropbox")||this.closeDropbox()}},{key:"onDropboxCloseButtonClick",value:function(){this.closeDropbox()}},{key:"onOptionsMouseOver",value:function(e){var t=e.target.closest(".vscomp-option");t&&this.isOpened()&&(c.hasClass(t,"disabled")||c.hasClass(t,"group-title")?this.removeOptionFocus():this.focusOption({$option:t}))}},{key:"onOptionsTouchMove",value:function(){this.removeOptionFocus()}},{key:"onSearch",value:function(e){e.stopPropagation(),this.setSearchValue(e.target.value,!0)}},{key:"onSearchClear",value:function(){this.setSearchValue(""),this.focusSearchInput()}},{key:"onToggleAllOptions",value:function(){this.toggleAllOptions()}},{key:"onDropboxContainerTopOrBottomFocus",value:function(){this.closeDropbox()}},{key:"onResize",value:function(){this.setOptionsContainerHeight(!0)}},{key:"addMutationObserver",value:function(){var e=this;if(this.hasDropboxWrapper){var t=this.$ele;this.mutationObserver=new MutationObserver((function(o){var i=!1,n=!1;o.forEach((function(e){i||(i=f(e.addedNodes).some((function(e){return!(e!==t&&!e.contains(t))}))),n||(n=f(e.removedNodes).some((function(e){return!(e!==t&&!e.contains(t))})))})),n&&!i&&e.destroy()})),this.mutationObserver.observe(document.querySelector("body"),{childList:!0,subtree:!0})}}},{key:"removeMutationObserver",value:function(){this.mutationObserver.disconnect()}},{key:"beforeValueSet",value:function(e){this.toggleAllOptionsClass(!e&&void 0)}},{key:"beforeSelectNewValue",value:function(){var e=this,t=this.getNewOption(),o=t.index;this.newValues.push(t.value),this.setOptionProp(o,"isCurrentNew",!1),this.setOptionProp(o,"isNew",!0),setTimeout((function(){e.setSearchValue(""),e.focusSearchInput()}),0)}},{key:"afterRenderWrapper",value:function(){c.addClass(this.$ele,"vscomp-ele"),this.renderSearch(),this.setEleStyles(),this.setDropboxStyles(),this.setOptionsHeight(),this.setVisibleOptions(),this.setOptionsContainerHeight(),this.addEvents(),this.setEleProps(),this.keepAlwaysOpen||this.showAsPopup||this.initDropboxPopover(),this.initialSelectedValue?this.setValueMethod(this.initialSelectedValue,this.silentInitialValueSet):this.autoSelectFirstOption&&this.visibleOptions.length&&this.setValueMethod(this.visibleOptions[0].value,this.silentInitialValueSet),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),this.initialDisabled&&this.disable(),this.autofocus&&this.focus()}},{key:"afterRenderOptions",value:function(){var e=this.getVisibleOptions(),t=!this.options.length&&!this.hasServerSearch,o=!t&&!e.length;if((!this.allowNewOption||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(c.toggleClass(this.$allWrappers,"has-no-search-results",o),o?(c.setAttr(this.$noSearchResults,"tabindex","0"),c.setAttr(this.$noSearchResults,"aria-hidden","false")):(c.setAttr(this.$noSearchResults,"tabindex","-1"),c.setAttr(this.$noSearchResults,"aria-hidden","true"))),c.toggleClass(this.$allWrappers,"has-no-options",t),t?(c.setAttr(this.$noOptions,"tabindex","0"),c.setAttr(this.$noOptions,"aria-hidden","false")):(c.setAttr(this.$noOptions,"tabindex","-1"),c.setAttr(this.$noOptions,"aria-hidden","true")),this.setOptionAttr(),this.setOptionsPosition(),this.setOptionsTooltip(),document.activeElement!==this.$searchInput){var i=c.getElementsBySelector(".focused",this.$dropboxContainer)[0];void 0!==i&&i.focus()}}},{key:"afterSetOptionsContainerHeight",value:function(e){e&&this.showAsPopup&&this.setVisibleOptions()}},{key:"afterSetSearchValue",value:function(){var e=this;this.hasServerSearch?(clearInterval(this.serverSearchTimeout),this.serverSearchTimeout=setTimeout((function(){e.serverSearch()}),this.searchDelay)):this.setVisibleOptionsCount(),this.selectAllOnlyVisible&&this.toggleAllOptionsClass(),this.focusOption({focusFirst:!0})}},{key:"afterSetVisibleOptionsCount",value:function(){this.scrollToTop(),this.setOptionsHeight(),this.setVisibleOptions(),this.updatePosition()}},{key:"afterValueSet",value:function(){this.scrollToTop(),this.setSearchValue(""),this.renderOptions()}},{key:"afterSetOptions",value:function(e){e&&this.setSelectedProp(),this.setOptionsHeight(),this.setVisibleOptions(),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),e||this.reset()}},{key:"setProps",value:function(e){var t=this.setDefaultProps(e);this.setPropsFromElementAttr(t);var o=n.convertToBoolean;this.$ele=t.ele,this.dropboxWrapper=t.dropboxWrapper,this.valueKey=t.valueKey,this.labelKey=t.labelKey,this.descriptionKey=t.descriptionKey,this.aliasKey=t.aliasKey,this.optionHeightText=t.optionHeight,this.optionHeight=parseFloat(this.optionHeightText),this.multiple=o(t.multiple),this.hasSearch=o(t.search),this.searchByStartsWith=o(t.searchByStartsWith),this.searchGroup=o(t.searchGroup),this.hideClearButton=o(t.hideClearButton),this.autoSelectFirstOption=o(t.autoSelectFirstOption),this.hasOptionDescription=o(t.hasOptionDescription),this.silentInitialValueSet=o(t.silentInitialValueSet),this.allowNewOption=o(t.allowNewOption),this.markSearchResults=o(t.markSearchResults),this.showSelectedOptionsFirst=o(t.showSelectedOptionsFirst),this.disableSelectAll=o(t.disableSelectAll),this.keepAlwaysOpen=o(t.keepAlwaysOpen),this.showDropboxAsPopup=o(t.showDropboxAsPopup),this.hideValueTooltipOnSelectAll=o(t.hideValueTooltipOnSelectAll),this.showOptionsOnlyOnSearch=o(t.showOptionsOnlyOnSearch),this.selectAllOnlyVisible=o(t.selectAllOnlyVisible),this.alwaysShowSelectedOptionsCount=o(t.alwaysShowSelectedOptionsCount),this.alwaysShowSelectedOptionsLabel=o(t.alwaysShowSelectedOptionsLabel),this.disableAllOptionsSelectedText=o(t.disableAllOptionsSelectedText),this.showValueAsTags=o(t.showValueAsTags),this.disableOptionGroupCheckbox=o(t.disableOptionGroupCheckbox),this.enableSecureText=o(t.enableSecureText),this.setValueAsArray=o(t.setValueAsArray),this.disableValidation=o(t.disableValidation),this.initialDisabled=o(t.disabled),this.required=o(t.required),this.autofocus=o(t.autofocus),this.useGroupValue=o(t.useGroupValue),this.focusSelectedOptionOnOpen=o(t.focusSelectedOptionOnOpen),this.noOptionsText=t.noOptionsText,this.noSearchResultsText=t.noSearchResultsText,this.selectAllText=t.selectAllText,this.searchNormalize=t.searchNormalize,this.searchPlaceholderText=t.searchPlaceholderText,this.searchFormLabel=t.searchFormLabel,this.optionsSelectedText=t.optionsSelectedText,this.optionSelectedText=t.optionSelectedText,this.allOptionsSelectedText=t.allOptionsSelectedText,this.clearButtonText=t.clearButtonText,this.moreText=t.moreText,this.placeholder=t.placeholder,this.position=t.position,this.textDirection=t.textDirection,this.dropboxWidth=t.dropboxWidth,this.tooltipFontSize=t.tooltipFontSize,this.tooltipAlignment=t.tooltipAlignment,this.tooltipMaxWidth=t.tooltipMaxWidth,this.updatePositionThrottle=t.updatePositionThrottle,this.noOfDisplayValues=parseInt(t.noOfDisplayValues),this.zIndex=parseInt(t.zIndex),this.maxValues=parseInt(t.maxValues),this.minValues=parseInt(t.minValues),this.name=this.secureText(t.name),this.additionalClasses=t.additionalClasses,this.additionalDropboxClasses=t.additionalDropboxClasses,this.additionalDropboxContainerClasses=t.additionalDropboxContainerClasses,this.additionalToggleButtonClasses=t.additionalToggleButtonClasses,this.popupDropboxBreakpoint=t.popupDropboxBreakpoint,this.popupPosition=t.popupPosition,this.onServerSearch=t.onServerSearch,this.labelRenderer=t.labelRenderer,this.selectedLabelRenderer=t.selectedLabelRenderer,this.initialSelectedValue=0===t.selectedValue?"0":t.selectedValue,this.emptyValue=t.emptyValue,this.ariaLabelledby=t.ariaLabelledby,this.ariaLabelText=t.ariaLabelText,this.ariaLabelClearButtonText=t.ariaLabelClearButtonText,this.maxWidth=t.maxWidth,this.searchDelay=t.searchDelay,this.selectedValues=[],this.selectedOptions=[],this.newValues=[],this.events={},this.tooltipEnterDelay=200,this.searchValue="",this.searchValueOriginal="",this.isAllSelected=!1,(void 0===t.search&&this.multiple||this.allowNewOption||this.showOptionsOnlyOnSearch)&&(this.hasSearch=!0),this.hasServerSearch="function"==typeof this.onServerSearch,(this.maxValues||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(this.disableSelectAll=!0,this.disableOptionGroupCheckbox=!0),this.keepAlwaysOpen&&(this.dropboxWrapper="self"),this.showAsPopup=this.showDropboxAsPopup&&!this.keepAlwaysOpen&&window.innerWidth<=parseFloat(this.popupDropboxBreakpoint),this.hasSearchContainer=this.hasSearch||this.multiple&&!this.disableSelectAll,this.optionsCount=this.getOptionsCount(t.optionsCount),this.halfOptionsCount=Math.ceil(this.optionsCount/2),this.optionsHeight=this.getOptionsHeight(),this.uniqueId=this.getUniqueId()}},{key:"setDefaultProps",value:function(e){var t={dropboxWrapper:"self",valueKey:"value",labelKey:"label",descriptionKey:"description",aliasKey:"alias",ariaLabelText:"Options list",ariaLabelClearButtonText:"Clear button",optionsCount:5,noOfDisplayValues:50,optionHeight:"40px",noOptionsText:"No options found",noSearchResultsText:"No results found",selectAllText:"Select All",searchNormalize:!1,searchPlaceholderText:"Search...",searchFormLabel:"Search",clearButtonText:"Clear",moreText:"more...",optionsSelectedText:"options selected",optionSelectedText:"option selected",allOptionsSelectedText:"All",placeholder:"Select",position:"bottom left",zIndex:e.keepAlwaysOpen?1:2,tooltipFontSize:"14px",tooltipAlignment:"center",tooltipMaxWidth:"300px",updatePositionThrottle:100,name:"",additionalClasses:"",additionalDropboxClasses:"",additionalDropboxContainerClasses:"",additionalToggleButtonClasses:"",maxValues:0,showDropboxAsPopup:!0,popupDropboxBreakpoint:"576px",popupPosition:"center",hideValueTooltipOnSelectAll:!0,emptyValue:"",searchDelay:300,focusSelectedOptionOnOpen:!0};return e.hasOptionDescription&&(t.optionsCount=4,t.optionHeight="50px"),Object.assign(t,e)}},{key:"setPropsFromElementAttr",value:function(e){var t=e.ele;Object.keys(x).forEach((function(o){var i=t.getAttribute(o);-1===S.indexOf(o)||""!==i&&"true"!==i||(i=!0),i&&(e[x[o]]=i)}))}},{key:"setEleProps",value:function(){var t=this.$ele;t.virtualSelect=this,t.value=this.multiple?[]:"",t.name=this.name,t.disabled=!1,t.required=this.required,t.autofocus=this.autofocus,t.multiple=this.multiple,t.form=t.closest("form"),t.reset=e.reset,t.setValue=e.setValueMethod,t.setOptions=e.setOptionsMethod,t.setDisabledOptions=e.setDisabledOptionsMethod,t.setEnabledOptions=e.setEnabledOptionsMethod,t.toggleSelectAll=e.toggleSelectAll,t.isAllSelected=e.isAllSelected,t.addOption=e.addOptionMethod,t.getNewValue=e.getNewValueMethod,t.getDisplayValue=e.getDisplayValueMethod,t.getSelectedOptions=e.getSelectedOptionsMethod,t.getDisabledOptions=e.getDisabledOptionsMethod,t.open=e.openMethod,t.close=e.closeMethod,t.focus=e.focusMethod,t.enable=e.enableMethod,t.disable=e.disableMethod,t.destroy=e.destroyMethod,t.validate=e.validateMethod,t.toggleRequired=e.toggleRequiredMethod,this.hasDropboxWrapper&&(this.$dropboxWrapper.virtualSelect=this)}},{key:"setValueMethod",value:function(e,t){var o={},i={},n=[],s=this.multiple,r=e;if(r){if(Array.isArray(r)||(r=[r]),s){var a=this.maxValues;a&&r.length>a&&r.splice(a)}else r.length>1&&(r=[r[0]]);r=r.map((function(e){return e||0===e?e.toString():""})),this.useGroupValue&&(r=this.setGroupOptionsValue(r)),r.forEach((function(e,t){o[e]=!0,i[e]=t})),this.allowNewOption&&r&&this.setNewOptionsFromValue(r)}if(this.options.forEach((function(e){!0!==o[e.value]||e.isDisabled||e.isGroupTitle?e.isSelected=!1:(e.isSelected=!0,n.push(e.value))})),s)this.hasOptionGroup&&this.setGroupsSelectedProp(),n.sort((function(e,t){return i[e]-i[t]}));else{var l=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,n,s,r=[],a=!0,l=!1;try{for(n=(t=t.call(e)).next,!1;!(a=(o=n.call(t)).done)&&(r.push(o.value),1!==r.length);a=!0);}catch(e){l=!0,i=e}finally{try{if(!a&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return r}}(e)||m(e,1)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n);n=l[0]}this.beforeValueSet(),this.setValue(n,{disableEvent:t}),this.afterValueSet()}},{key:"setGroupOptionsValue",value:function(e){var t=[],o={},i={};return e.forEach((function(e){i[e]=!0})),this.options.forEach((function(e){var n=e.value,s=!0===i[n];e.isGroupTitle?s&&(o[e.index]=!0):(s||o[e.groupIndex])&&t.push(n)})),t}},{key:"setGroupsSelectedProp",value:function(){var e=this.isAllGroupOptionsSelected.bind(this);this.options.forEach((function(t){t.isGroupTitle&&(t.isSelected=e(t.index))}))}},{key:"setOptionsMethod",value:function(e,t){this.setOptions(e),this.afterSetOptions(t)}},{key:"setDisabledOptionsMethod",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setDisabledOptions(e,!0),t||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setDisabledOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[];if(e)if(!0===e)t&&this.options.forEach((function(e){return e.isDisabled=!0,o.push(e.value),e}));else{o=e.map((function(e){return e.toString()}));var i={};o.forEach((function(e){i[e]=!0})),t&&this.options.forEach((function(e){return e.isDisabled=!0===i[e.value],e}))}else t&&this.options.forEach((function(e){return e.isDisabled=!1,e}));this.disabledOptions=o}},{key:"setEnabledOptionsMethod",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setEnabledOptions(e),t||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setEnabledOptions",value:function(e){if(void 0!==e){var t=[];if(!0===e)this.options.forEach((function(e){return e.isDisabled=!1,e}));else{var o={};e.forEach((function(e){o[e]=!0})),this.options.forEach((function(e){var i=!0!==o[e.value];return e.isDisabled=i,i&&t.push(e.value),e}))}this.disabledOptions=t}}},{key:"setOptions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=[],i=this.disabledOptions.length,s=this.valueKey,r=this.labelKey,a=this.descriptionKey,l=this.aliasKey,p=this.hasOptionDescription,c=n.getString,u=n.convertToBoolean,h=this.secureText.bind(this),f=this.getAlias.bind(this),m=0,b=!1,y={},g=!1;this.disabledOptions.forEach((function(e){y[e]=!0})),Array.isArray(t)&&t.forEach((function t(x){var w;"object"!==v(x)&&(d(w={},s,x),d(w,r,x),x=w);var S=h(c(x[s])),O=h(c(x[r])),k=x.options,E=!!k,C={index:m,value:S,label:O,labelNormalized:e.searchNormalize?n.normalizeString(O).toLowerCase():O.toLowerCase(),alias:f(x[l]),isVisible:u(x.isVisible,!0),isNew:x.isNew||!1,isGroupTitle:E,classNames:x.classNames};if(g||""!==S||(g=!0),i&&(C.isDisabled=!0===y[S]),x.isGroupOption&&(C.isGroupOption=!0,C.groupIndex=x.groupIndex),p&&(C.description=h(c(x[a]))),x.customData&&(C.customData=x.customData),o.push(C),m+=1,E){var $=C.index;b=!0,k.forEach((function(e){e.isGroupOption=!0,e.groupIndex=$,t(e)}))}}));var x=o.length,w=this.$ele;w.options=o,w.length=x,this.options=o,this.visibleOptionsCount=x,this.lastOptionIndex=x-1,this.newValues=[],this.hasOptionGroup=b,this.hasEmptyValueOption=g,this.setSortedOptions()}},{key:"setServerOptions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.setOptionsMethod(t,!0);var o=this.selectedOptions,i=this.options,n=!1;if(o.length){var s={};n=!0,i.forEach((function(e){s[e.value]=!0})),o.forEach((function(e){!0!==s[e.value]&&(e.isVisible=!1,i.push(e))})),this.setOptionsMethod(i,!0)}this.allowNewOption&&this.searchValue&&(i.some((function(t){return t.label.toLowerCase()===e.searchValue}))||(n=!0,this.setNewOption())),n?(this.setVisibleOptionsCount(),this.multiple&&this.toggleAllOptionsClass(),this.setValueText()):this.updatePosition(),this.setVisibleOptionsCount(),c.removeClass(this.$allWrappers,"server-searching")}},{key:"setSelectedOptions",value:function(){this.selectedOptions=this.options.filter((function(e){return e.isSelected}))}},{key:"setSortedOptions",value:function(){var e=f(this.options);this.showSelectedOptionsFirst&&this.selectedValues.length&&(e=this.hasOptionGroup?this.sortOptionsGroup(e):this.sortOptions(e)),this.sortedOptions=e}},{key:"setVisibleOptions",value:function(){var e=f(this.sortedOptions),t=2*this.optionsCount,o=this.getVisibleStartIndex(),i=this.getNewOption(),n=o+t-1,s=0;i&&(i.visibleIndex=s,s+=1),e=e.filter((function(e){var t=!1;return e.isVisible&&!e.isCurrentNew&&(t=s>=o&&s<=n,e.visibleIndex=s,s+=1),t})),i&&(e=[i].concat(f(e))),this.visibleOptions=e,this.visibleOptionsCount=e.length,this.renderOptions()}},{key:"setOptionsPosition",value:function(e){var t=parseInt((e||this.getVisibleStartIndex())*this.optionHeight);this.$options.style.transform="translate3d(0, ".concat(t,"px, 0)"),c.setData(this.$options,"top",t)}},{key:"setOptionsTooltip",value:function(){var e=this,t=this.getVisibleOptions(),o=this.hasOptionDescription;t.forEach((function(t){var i=e.$dropboxContainer.querySelector('.vscomp-option[data-index="'.concat(t.index,'"]'));c.setData(i.querySelector(".vscomp-option-text"),"tooltip",t.label),o&&c.setData(i.querySelector(".vscomp-option-description"),"tooltip",t.description)}))}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.disableEvent,i=void 0!==o&&o,s=t.disableValidation,r=void 0!==s&&s;this.hasEmptyValueOption&&""===e||e?Array.isArray(e)?this.selectedValues=f(e):this.selectedValues=[e]:this.selectedValues=[];var a=this.getValue();this.$ele.value=a,this.$hiddenInput.value=this.getInputValue(a),this.isMaxValuesSelected=!!(this.maxValues&&this.maxValues<=this.selectedValues.length),this.toggleAllOptionsClass(),this.setValueText(),c.toggleClass(this.$allWrappers,"has-value",n.isNotEmpty(this.selectedValues)),c.toggleClass(this.$allWrappers,"max-value-selected",this.isMaxValuesSelected),r||this.validate(),i||c.dispatchEvent(this.$ele,"change",!0)}},{key:"setValueText",value:function(){var e=this,t=this.multiple,o=this.selectedValues,i=this.noOfDisplayValues,s=this.showValueAsTags,r=this.$valueText,a=this.selectedLabelRenderer,l=[],p=[],u=o.length,h=0,d=this.isAllSelected&&!this.hasServerSearch&&!this.disableAllOptionsSelectedText&&!s;if(d&&this.hideValueTooltipOnSelectAll)r.innerHTML="".concat(this.allOptionsSelectedText," (").concat(u,")");else{this.getSelectedOptions({fullDetails:!0,keepSelectionOrder:!0}).some((function(t){if(t.isCurrentNew)return!1;if(h>=i)return!0;var o=t.label;if("function"==typeof a&&(o=a(t)),l.push(o),h+=1,s){var c=n.willTextOverflow(r.parentElement,o)?e.getTooltipAttrText(o,!1,!0):"",u='\n ').concat(o,'\n \n \n \n ');p.push(u)}else p.push(o);return!1}));var v=u-i;v>0&&p.push('+ '.concat(v," ").concat(this.moreText,""));var f=l.join(", ");if(""===f)r.innerHTML=this.placeholder;else if(r.innerHTML=f,t){var m=this.maxValues;if(this.alwaysShowSelectedOptionsCount||c.hasEllipsis(r)||m||s){var b=''.concat(u,"");if(m&&(b+=' / '.concat(m,"")),d)r.innerHTML="".concat(this.allOptionsSelectedText," (").concat(u,")");else if(s)r.innerHTML=p.join(""),this.$valueTags=r.querySelectorAll(".vscomp-value-tag"),this.setValueTagAttr();else if(!this.alwaysShowSelectedOptionsLabel){var y=1===u?this.optionSelectedText:this.optionsSelectedText;r.innerHTML="".concat(b," ").concat(y)}}else p=[]}}var g="";0===u?g=this.placeholder:s||(g=p.join(", ")),s||c.setData(r,"tooltip",g),t&&(s?this.updatePosition():c.setData(r,"tooltipEllipsisOnly",0===u))}},{key:"setSearchValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==this.searchValueOriginal||o){t||(this.$searchInput.value=e);var i=e.replace(/\\/g,"").toLowerCase().trim();this.searchValue=i,this.searchValueOriginal=e,c.toggleClass(this.$allWrappers,"has-search-value",e),this.afterSetSearchValue()}}},{key:"setVisibleOptionsCount",value:function(){var e,t=0,o=!1,i=this.searchGroup,s=this.showOptionsOnlyOnSearch,r=this.searchByStartsWith,a=this.searchValue;a=this.searchNormalize?n.normalizeString(a):a;var l=this.isOptionVisible.bind(this);this.hasOptionGroup&&(e=this.getVisibleOptionGroupsMapping(a)),this.options.forEach((function(n){var p;n.isCurrentNew||(s&&!a?(n.isVisible=!1,p={isVisible:!1,hasExactOption:!1}):p=l({data:n,searchValue:a,hasExactOption:o,visibleOptionGroupsMapping:e,searchGroup:i,searchByStartsWith:r}),p.isVisible&&(t+=1),o||(o=p.hasExactOption))})),this.allowNewOption&&(a&&!o?(this.setNewOption(),t+=1):this.removeNewOption()),this.visibleOptionsCount=t,this.afterSetVisibleOptionsCount()}},{key:"setOptionProp",value:function(e,t,o){this.options[e]&&(this.options[e][t]=o)}},{key:"setOptionsHeight",value:function(){this.$optionsList.style.height="".concat(this.optionHeight*this.visibleOptionsCount,"px")}},{key:"setOptionsContainerHeight",value:function(e){var t;e?this.showAsPopup&&(this.optionsCount=this.getOptionsCount(),this.halfOptionsCount=Math.ceil(this.optionsCount/2),t=this.getOptionsHeight(),this.optionsHeight=t):(t=this.optionsHeight,this.keepAlwaysOpen&&(c.setStyle(this.$noOptions,"height",t),c.setStyle(this.$noSearchResults,"height",t))),c.setStyle(this.$optionsContainer,"max-height",t),this.afterSetOptionsContainerHeight(e)}},{key:"setNewOption",value:function(e){var t=e||this.searchValueOriginal.trim();if(t){var o=this.getNewOption();if(o){var i=o.index;this.setOptionProp(i,"value",this.secureText(t)),this.setOptionProp(i,"label",this.secureText(t))}else{var n={value:t,label:t};e?(n.isNew=!0,this.newValues.push(t)):n.isCurrentNew=!0,this.addOption(n)}}}},{key:"setSelectedProp",value:function(){var e={};this.selectedValues.forEach((function(t){e[t]=!0})),this.options.forEach((function(t){!0===e[t.value]&&(t.isSelected=!0)}))}},{key:"setNewOptionsFromValue",value:function(e){if(e){var t=this.setNewOption.bind(this),o={};this.options.forEach((function(e){o[e.value]=!0})),e.forEach((function(e){e&&!0!==o[e]&&t(e)}))}}},{key:"setDropboxWrapperWidth",value:function(){if(!this.showAsPopup){var e=this.dropboxWidth||"".concat(this.$wrapper.offsetWidth,"px");c.setStyle(this.$dropboxContainer,"max-width",e)}}},{key:"setEleStyles",value:function(){var e=this.maxWidth,t={};e&&(t["max-width"]=e),c.setStyles(this.$ele,t)}},{key:"setDropboxStyles",value:function(){var e=this.dropboxWidth,t={},o={"z-index":this.zIndex};e&&(this.showAsPopup?t["max-width"]=e:o.width=e),c.setStyles(this.$dropboxContainer,o),c.setStyles(this.$dropbox,t)}},{key:"setOptionAttr",value:function(){var e=this.$visibleOptions,t=this.options,o="".concat(this.optionHeight,"px"),i=c.setStyle,n=c.getData,s=c.setData;e&&e.length&&e.forEach((function(e){var r=t[n(e,"index")];i(e,"height",o),s(e,"value",r.value)}))}},{key:"setValueTagAttr",value:function(){var e=this.$valueTags;if(e&&e.length){var t=c.getData,o=c.setData,i=this.options;e.forEach((function(e){var n=t(e,"index");if(void 0!==n){var s=i[n];o(e,"value",s.value)}}))}}},{key:"setScrollTop",value:function(){var e=this.selectedValues;if(!this.showSelectedOptionsFirst&&this.focusSelectedOptionOnOpen&&0!==e.length){var t,o={};e.forEach((function(e){o[e]=!0})),this.options.some((function(e){return!!o[e.value]&&(t=e.visibleIndex,!0)})),t&&(this.$optionsContainer.scrollTop=this.optionHeight*t)}}},{key:"getVisibleOptions",value:function(){return this.visibleOptions||[]}},{key:"getValue",value:function(){return this.multiple?this.useGroupValue?this.getGroupValue():this.selectedValues:this.selectedValues[0]||""}},{key:"getGroupValue",value:function(){var e=[],t={};return this.options.forEach((function(o){if(o.isSelected){var i=o.value;o.isGroupTitle?i&&(t[o.index]=!0,e.push(i)):!0!==t[o.groupIndex]&&e.push(i)}})),e}},{key:"getInputValue",value:function(e){var t=e;return t&&t.length?this.setValueAsArray&&this.multiple&&(t=JSON.stringify(t)):t=this.emptyValue,t}},{key:"getFirstVisibleOptionIndex",value:function(){return Math.ceil(this.$optionsContainer.scrollTop/this.optionHeight)}},{key:"getVisibleStartIndex",value:function(){var e=this.getFirstVisibleOptionIndex()-this.halfOptionsCount;return e<0&&(e=0),e}},{key:"getTooltipAttrText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i={"data-tooltip":(n.containsHTML(e)?n.replaceDoubleQuotesWithHTML(e):e)||"","data-tooltip-enter-delay":this.tooltipEnterDelay,"data-tooltip-z-index":this.zIndex,"data-tooltip-font-size":this.tooltipFontSize,"data-tooltip-alignment":this.tooltipAlignment,"data-tooltip-max-width":this.tooltipMaxWidth,"data-tooltip-ellipsis-only":t,"data-tooltip-allow-html":o};return c.getAttributesText(i)}},{key:"getOptionObj",value:function(e){if(e){var t=n.getString,o=this.secureText.bind(this);return{index:e.index,value:o(t(e.value)),label:o(t(e.label)),description:o(t(e.description)),alias:this.getAlias(e.alias),isCurrentNew:e.isCurrentNew||!1,isNew:e.isNew||!1,isVisible:!0}}}},{key:"getNewOption",value:function(){var e=this.options[this.lastOptionIndex];if(e&&e.isCurrentNew)return e}},{key:"getOptionIndex",value:function(e){var t;return this.options.some((function(o){return o.value===e&&(t=o.index,!0)})),t}},{key:"getNewValue",value:function(){var e={};this.newValues.forEach((function(t){e[t]=!0}));var t=this.selectedValues.filter((function(t){return!0===e[t]}));return this.multiple?t:t[0]}},{key:"getAlias",value:function(e){var t=e;return t&&(t=(t=Array.isArray(t)?t.join(","):t.toString().trim()).toLowerCase()),t||""}},{key:"getDisplayValue",value:function(){var e=[];return this.options.forEach((function(t){t.isSelected&&e.push(t.label)})),this.multiple?e:e[0]||""}},{key:"getSelectedOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fullDetails,o=void 0!==t&&t,i=e.keepSelectionOrder,n=void 0!==i&&i,s=this.valueKey,r=this.labelKey,a=this.selectedValues,l=[];if(this.options.forEach((function(e){if(e.isSelected&&!e.isGroupTitle)if(o)l.push(e);else{var t,i=(d(t={},s,e.value),d(t,r,e.label),t);e.isNew&&(i.isNew=!0),e.customData&&(i.customData=e.customData),l.push(i)}})),n){var p={};a.forEach((function(e,t){p[e]=t})),l.sort((function(e,t){return p[e.value]-p[t.value]}))}return this.multiple||o?l:l[0]}},{key:"getDisabledOptions",value:function(){var e=this.valueKey,t=this.labelKey,o=this.disabledOptions,i={},n=[];return o.forEach((function(e){i[e]=!0})),this.options.forEach((function(o){var s,r=o.value,a=o.label;i[r]&&n.push((d(s={},e,r),d(s,t,a),s))})),n}},{key:"getVisibleOptionGroupsMapping",value:function(e){var t=this.options,o={},i=this.isOptionVisible.bind(this);return(t=this.structureOptionGroup(t)).forEach((function(t){o[t.index]=t.options.some((function(t){return i({data:t,searchValue:e}).isVisible}))})),o}},{key:"getOptionsCount",value:function(e){var t;if(this.showAsPopup){var o=80*window.innerHeight/100-48;this.hasSearchContainer&&(o-=40),t=Math.floor(o/this.optionHeight)}else t=parseInt(e);return t}},{key:"getOptionsHeight",value:function(){return"".concat(this.optionsCount*this.optionHeight,"px")}},{key:"getSibling",value:function(e,t){var o="next"===t?"nextElementSibling":"previousElementSibling",i=e;do{i&&(i=i[o])}while(c.hasClass(i,"disabled")||c.hasClass(i,"group-title"));return i}},{key:"getUniqueId",value:function(){var e=n.getRandomInt(1e4);return document.querySelector("#vscomp-ele-wrapper-".concat(e))?this.getUniqueId():e}},{key:"initDropboxPopover",value:function(){var e={ele:this.$ele,target:this.$dropboxContainer,position:this.position,zIndex:this.zIndex,margin:4,transitionDistance:30,hideArrowIcon:!0,disableManualAction:!0,disableUpdatePosition:!this.hasDropboxWrapper,updatePositionThrottle:this.updatePositionThrottle,afterShow:this.afterShowPopper.bind(this),afterHide:this.afterHidePopper.bind(this)};this.dropboxPopover=new PopoverComponent(e)}},{key:"openDropbox",value:function(e){this.isSilentOpen=e,e?c.setStyle(this.$dropboxContainer,"display","inline-flex"):(c.dispatchEvent(this.$ele,"beforeOpen"),c.setAria(this.$wrapper,"expanded",!0)),this.setDropboxWrapperWidth(),c.removeClass(this.$allWrappers,"closed"),c.changeTabIndex(this.$allWrappers,0),this.dropboxPopover&&!e?this.dropboxPopover.show():this.afterShowPopper()}},{key:"afterShowPopper",value:function(){var e=this.isSilentOpen;this.isSilentOpen=!1,e||(this.moveSelectedOptionsFirst(),this.setScrollTop(),c.addClass(this.$allWrappers,"focused"),this.showAsPopup?(c.addClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!0):this.focusElementOnOpen(),c.dispatchEvent(this.$ele,"afterOpen"))}},{key:"closeDropbox",value:function(e){this.isSilentClose=e,this.keepAlwaysOpen?this.removeOptionFocus():(e?c.setStyle(this.$dropboxContainer,"display",""):(c.dispatchEvent(this.$ele,"beforeClose"),c.setAria(this.$wrapper,"expanded",!1),c.setAria(this.$wrapper,"activedescendant","")),this.$wrapper.focus(),this.dropboxPopover&&!e?this.dropboxPopover.hide():this.afterHidePopper())}},{key:"afterHidePopper",value:function(){var e=this.isSilentClose;this.isSilentClose=!1,c.removeClass(this.$allWrappers,"focused"),this.removeOptionFocus(),!e&&this.isPopupActive&&(c.removeClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!1),c.addClass(this.$allWrappers,"closed"),e||(c.dispatchEvent(this.$ele,"afterClose"),(this.initialSelectedValue&&0===this.initialSelectedValue.length||this.selectedValues.length>0)&&this.focus())}},{key:"moveSelectedOptionsFirst",value:function(){this.showSelectedOptionsFirst&&(this.setSortedOptions(),this.$optionsContainer.scrollTop&&this.selectedValues.length?this.scrollToTop():this.setVisibleOptions())}},{key:"toggleDropbox",value:function(){this.isOpened()?this.closeDropbox():this.openDropbox()}},{key:"updatePosition",value:function(){this.dropboxPopover&&this.isOpened()&&this.$ele.updatePosition()}},{key:"isOpened",value:function(){return!c.hasClass(this.$wrapper,"closed")}},{key:"focusSearchInput",value:function(){var e=this.$searchInput;e&&e.focus()}},{key:"focusElementOnOpen",value:function(){var e=this.$searchInput,t=!this.options.length&&!this.hasServerSearch;if(e)t&&!this.allowNewOption?(c.setAttr(e,"disabled",""),this.$noOptions.focus()):(e.removeAttribute("disabled"),e.focus());else{var o=this.$dropbox.querySelector('[tabindex="0"]');void 0!==c.getData(o,"index")?this.focusOption({direction:"next"}):o?o.focus():this.focusFirstVisibleOption()}}},{key:"focusFirstVisibleOption",value:function(){var e=this.$optionsContainer.querySelector("[data-index='".concat(this.getFirstVisibleOptionIndex(),"']"));e?(c.hasClass(e,"group-title")&&(e=this.getSibling(e,"next")),c.setAttr(e,"tabindex","0"),this.$optionsContainer.scrollTop=this.optionHeight*this.getFirstVisibleOptionIndex(),this.focusOption({focusFirst:!0}),e.focus()):(e=this.$dropbox.querySelector('[tabindex="0"]'))&&e.focus()}},{key:"focusOption",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.direction,i=t.$option,n=t.focusFirst,s=this.$dropboxContainer.querySelector(".vscomp-option.focused");if(i)e=i;else if(!s||n){var r=this.getFirstVisibleOptionIndex();e=this.$dropboxContainer.querySelector('.vscomp-option[data-visible-index="'.concat(r,'"]')),(c.hasClass(e,"disabled")||c.hasClass(e,"group-title"))&&(e=this.getSibling(e,"next"))}else e=this.getSibling(s,o);e&&e!==s&&(s&&this.toggleOptionFocusedState(s,!1),this.toggleOptionFocusedState(e,!0),this.toggleFocusedProp(c.getData(e,"index"),!0),this.moveFocusedOptionToView(e))}},{key:"moveFocusedOptionToView",value:function(e){var t=e||this.$dropboxContainer.querySelector(".vscomp-option.focused");if(t){var o,i=this.$optionsContainer.getBoundingClientRect(),n=t.getBoundingClientRect(),s=i.top,r=i.bottom,a=i.height,l=n.top,p=n.bottom,u=n.height,h=t.offsetTop,d=c.getData(this.$options,"top","number");s>l?o=h+d:r1&&void 0!==arguments[1]?arguments[1]:{}).event;if(e){var o=!c.hasClass(e,"selected");if(o){if(this.multiple&&this.isMaxValuesSelected)return}else if(!this.multiple)return void this.closeDropbox();var i=this.selectedValues,s=c.getData(e,"value"),r=c.getData(e,"index","number"),a=c.hasClass(e,"current-new"),l=!1,p=this.lastSelectedOptionIndex;if(this.lastSelectedOptionIndex=null,this.toggleSelectedProp(r,o),o){if(this.multiple)i.push(s),this.toggleAllOptionsClass(),this.toggleGroupOptionsParent(e),t&&t.shiftKey&&(l=!0);else{i.length&&this.toggleSelectedProp(this.getOptionIndex(i[0]),!1),i=[s];var u=this.$dropboxContainer.querySelector(".vscomp-option.selected");u&&this.toggleOptionSelectedState(u,!1),this.closeDropbox(),a||this.setSearchValue("")}this.lastSelectedOptionIndex=r,this.toggleOptionSelectedState(e)}else this.multiple&&(this.toggleOptionSelectedState(e),n.removeItemFromArray(i,s),this.toggleAllOptionsClass(!1),this.toggleGroupOptionsParent(e,!1));a&&this.beforeSelectNewValue(),this.setValue(i),l&&this.selectRangeOptions(p,r)}}},{key:"selectFocusedOption",value:function(){this.selectOption(this.$dropboxContainer.querySelector(".vscomp-option.focused"))}},{key:"selectRangeOptions",value:function(e,t){var o=this;if("number"==typeof e&&!this.maxValues){var i,n,s=this.selectedValues,r=this.hasOptionGroup,a={};if(ei&&t0||""===this.searchValue)&&(t=this.isAllOptionsSelected(!0)),c.toggleClass(this.$toggleAllCheckbox,"checked",e||t),this.isAllSelected=e}}},{key:"isAllOptionsSelected",value:function(e){var t=!1;return this.options.length&&this.selectedValues.length&&(t=!this.options.some((function(t){return!t.isSelected&&!t.isDisabled&&!t.isGroupTitle&&(!e||t.isVisible)}))),t}},{key:"isAllGroupOptionsSelected",value:function(e){var t=!1;return this.options.length&&(t=!this.options.some((function(t){return!t.isSelected&&!t.isDisabled&&!t.isGroupTitle&&t.groupIndex===e}))),t}},{key:"toggleGroupOptionsParent",value:function(e,t){if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&e){var o=c.getData(e,"groupIndex");void 0!==o&&(o=parseInt(o));var i=this.$options.querySelector('.vscomp-option[data-index="'.concat(o,'"]')),n="boolean"==typeof t?t:this.isAllGroupOptionsSelected(o);this.toggleGroupTitleCheckbox(i,n),this.toggleGroupTitleProp(o,n)}}},{key:"toggleGroupTitleProp",value:function(e,t){var o="boolean"==typeof t?t:this.isAllGroupOptionsSelected(e);this.toggleSelectedProp(e,o)}},{key:"toggleGroupOptions",value:function(e,t){var o=this;if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&e){var i=c.getData(e,"index","number"),s=this.selectedValues,r=this.selectAllOnlyVisible,a={},l=n.removeItemFromArray;s.forEach((function(e){a[e]=!0})),this.options.forEach((function(e){if(!e.isDisabled&&e.groupIndex===i){var o=e.value;!t||r&&!e.isVisible?(e.isSelected=!1,a[o]&&l(s,o)):(e.isSelected=!0,a[o]||s.push(o))}})),this.toggleAllOptionsClass(!!t&&null),this.setValue(s),setTimeout((function(){o.renderOptions()}),0)}}},{key:"toggleGroupTitleCheckbox",value:function(e,t){if(e){var o=c.getData(e,"index","number");this.toggleSelectedProp(o,t),this.toggleOptionSelectedState(e,t)}}},{key:"toggleFocusedProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.focusedOptionIndex&&this.setOptionProp(this.focusedOptionIndex,"isFocused",!1),this.setOptionProp(e,"isFocused",t),this.focusedOptionIndex=e}},{key:"toggleSelectedProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setOptionProp(e,"isSelected",t)}},{key:"scrollToTop",value:function(){var e=!this.isOpened();e&&this.openDropbox(!0),this.$optionsContainer.scrollTop>0&&(this.$optionsContainer.scrollTop=0),e&&this.closeDropbox(!0)}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.options.forEach((function(e){e.isSelected=!1})),this.beforeValueSet(!0),this.setValue(null,{disableEvent:t,disableValidation:e}),this.afterValueSet(),e&&c.removeClass(this.$allWrappers,"has-error"),c.dispatchEvent(this.$ele,"reset")}},{key:"addOption",value:function(e,t){if(e){this.lastOptionIndex+=1;var o=this.getOptionObj(h(h({},e),{},{index:this.lastOptionIndex}));this.options.push(o),this.sortedOptions.push(o),t&&(this.visibleOptionsCount+=1,this.afterSetOptions())}}},{key:"removeOption",value:function(e){(e||0===e)&&(this.options.splice(e,1),this.lastOptionIndex-=1)}},{key:"removeNewOption",value:function(){var e=this.getNewOption();e&&this.removeOption(e.index)}},{key:"sortOptions",value:function(e){return e.sort((function(e,t){var o=e.isSelected||e.isAnySelected,i=t.isSelected||t.isAnySelected;return o||i?o&&(!i||e.index0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.virtualSelect.reset(e,t)}},{key:"setValueMethod",value:function(){var e;(e=this.virtualSelect).setValueMethod.apply(e,arguments)}},{key:"setOptionsMethod",value:function(){var e;(e=this.virtualSelect).setOptionsMethod.apply(e,arguments)}},{key:"setDisabledOptionsMethod",value:function(){var e;(e=this.virtualSelect).setDisabledOptionsMethod.apply(e,arguments)}},{key:"setEnabledOptionsMethod",value:function(){var e;(e=this.virtualSelect).setEnabledOptionsMethod.apply(e,arguments)}},{key:"toggleSelectAll",value:function(e){this.virtualSelect.toggleAllOptions(e)}},{key:"isAllSelected",value:function(){return this.virtualSelect.isAllSelected}},{key:"addOptionMethod",value:function(e){this.virtualSelect.addOption(e,!0)}},{key:"getNewValueMethod",value:function(){return this.virtualSelect.getNewValue()}},{key:"getDisplayValueMethod",value:function(){return this.virtualSelect.getDisplayValue()}},{key:"getSelectedOptionsMethod",value:function(e){return this.virtualSelect.getSelectedOptions(e)}},{key:"getDisabledOptionsMethod",value:function(){return this.virtualSelect.getDisabledOptions()}},{key:"openMethod",value:function(){return this.virtualSelect.openDropbox()}},{key:"closeMethod",value:function(){return this.virtualSelect.closeDropbox()}},{key:"focusMethod",value:function(){return this.virtualSelect.focus()}},{key:"enableMethod",value:function(){return this.virtualSelect.enable()}},{key:"disableMethod",value:function(){return this.virtualSelect.disable()}},{key:"destroyMethod",value:function(){return this.virtualSelect.destroy()}},{key:"validateMethod",value:function(){return this.virtualSelect.validate()}},{key:"toggleRequiredMethod",value:function(e){return this.virtualSelect.toggleRequired(e)}},{key:"onResizeMethod",value:function(){document.querySelectorAll(".vscomp-ele-wrapper").forEach((function(e){e.parentElement.virtualSelect.onResize()}))}}],o&&y(t.prototype,o),i&&y(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();document.addEventListener("reset",E.onFormReset),document.addEventListener("submit",E.onFormSubmit),window.addEventListener("resize",E.onResizeMethod),x=E.getAttrProps(),window.VirtualSelect=E,"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)}(),function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oo-n-t.width?"left":"right",vertical:s>i-s-t.height?"top":"bottom"}}},{key:"getAbsoluteCoords",value:function(e){if(e){var t=e.getBoundingClientRect(),o=window.pageXOffset,i=window.pageYOffset;return{width:t.width,height:t.height,top:t.top+i,right:t.right+o,bottom:t.bottom+i,left:t.left+o}}}},{key:"getCoords",value:function(e){return e?e.getBoundingClientRect():{}}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"show",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";t.setStyle(e,"display",o)}},{key:"hide",value:function(e){t.setStyle(e,"display","none")}},{key:"getHideableParent",value:function(e){for(var t,o=e.parentElement;o;){var i=getComputedStyle(o).overflow;if(-1!==i.indexOf("scroll")||-1!==i.indexOf("auto")){t=o;break}o=o.parentElement}return t}}],o&&function(e,t){for(var o=0;og?g-f:M:k+c>L&&("right"===C?s="left":k=L+fx?x-h:P:E+u>I&&("bottom"===C?s="top":E=I+hc-R&&(N=c-R):"left"!==C&&"right"!==C||((W=b/2+y-G)u-R&&(W=u-R)),o.setStyle(this.$arrowEle,"transform","translate3d(".concat(parseInt(N),"px, ").concat(parseInt(W),"px, 0) ").concat(K))}o.hide(this.$popperEle)}},{key:"resetPosition",value:function(){o.setStyle(this.$popperEle,"transform","none"),this.setPosition()}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.resetPosition,n=t.data;clearTimeout(this.exitDelayTimeout),clearTimeout(this.hideDurationTimeout),i&&this.resetPosition(),this.enterDelayTimeout=setTimeout((function(){var t=o.getData(e.$popperEle,"left"),i=o.getData(e.$popperEle,"top"),s="translate3d(".concat(parseInt(t),"px, ").concat(parseInt(i),"px, 0)"),r=e.showDuration;o.show(e.$popperEle,"inline-flex"),o.getCoords(e.$popperEle),o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",1),e.showDurationTimeout=setTimeout((function(){"function"==typeof e.afterShowCallback&&e.afterShowCallback(n)}),r)}),this.enterDelay)}},{key:"hide",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data;clearTimeout(this.enterDelayTimeout),clearTimeout(this.showDurationTimeout),this.exitDelayTimeout=setTimeout((function(){if(e.$popperEle){var i=parseInt(o.getData(e.$popperEle,"fromLeft")),n=parseInt(o.getData(e.$popperEle,"fromTop")),s="translate3d(".concat(i,"px, ").concat(n,"px, 0)"),r=e.hideDuration;o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",0),e.hideDurationTimeout=setTimeout((function(){o.hide(e.$popperEle),"function"==typeof e.afterHideCallback&&e.afterHideCallback(t)}),r)}}),this.exitDelay)}},{key:"updatePosition",value:function(){o.setStyle(this.$popperEle,"transitionDuration","0ms"),this.resetPosition();var e=parseInt(o.getData(this.$popperEle,"left")),t=parseInt(o.getData(this.$popperEle,"top"));o.show(this.$popperEle,"inline-flex"),o.setStyle(this.$popperEle,"transform","translate3d(".concat(e,"px, ").concat(t,"px, 0)"))}}],t&&function(e,t){for(var o=0;o1&&void 0!==arguments[1]&&arguments[1]}},{key:"removeArrayEmpty",value:function(e){return Array.isArray(e)&&e.length?e.filter((function(e){return!!e})):[]}},{key:"throttle",value:function(e,t){var o,i=0;return function(){for(var n=arguments.length,s=new Array(n),r=0;re.length)&&(t=e.length);for(var o=0,i=new Array(t);o'),e=this.$popover.querySelector(".pop-comp-arrow")),this.$arrowEle=e}}},{key:"destroy",value:function(){this.removeEvents()}}])&&c(t.prototype,o),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o,n}();h=f.getAttrProps(),window.PopoverComponent=f}()}},t={};function o(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={id:i,exports:{}};return e[i](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nc=void 0,(()=>{"use strict";const e=jQuery;var t=o.n(e);Shiny;var i=o(5072),n=o.n(i),s=o(7825),r=o.n(s),a=o(7659),l=o.n(a),p=o(5056),c=o.n(p),u=o(540),h=o.n(u),d=o(1113),v=o.n(d),f=o(4185),m={};m.styleTagTransform=v(),m.setAttributes=c(),m.insert=l().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=h(),n()(f.A,m),f.A&&f.A.locals&&f.A.locals,o(5024);var b=o(9917),y={};function g(e){var t,o,i=[];for(t in e)for(o=0;o({label:e,value:e})));else if("transpose"==e.type)t=g(e.choices);else if("transpose_group"==e.type){for(var o=e.choices,i=0;it()(e).find(".virtual-select"),getValue:e=>e.value,setValue:(e,t)=>{e.setValue(t)},subscribe:(e,o)=>{"change"==t()(e).attr("data-update")?t()(e).on("change.virtualSelectBinding",(function(e){o()})):t()(e).on("afterClose.virtualSelectBinding reset.virtualSelectBinding",(function(e){o()}))},unsubscribe:e=>{t()(e).off(".virtualSelectBinding")},receiveMessage:(e,o)=>{if(o.hasOwnProperty("label")){var i=t()("#"+e.id+"-label");!function(e,t){if(void 0!==e){if(1!==t.length)throw new Error("labelNode must be of length 1");Array.isArray(e)&&0===e.length?t.addClass("shiny-label-null"):(t.html(e),t.removeClass("shiny-label-null"))}}(o.label,i)}if(o.hasOwnProperty("options")){var n=x(o.options);e.setOptions(n)}o.hasOwnProperty("value")&&e.setValue(o.value),o.hasOwnProperty("disable")&&(o.disable?e.disable():e.enable()),o.hasOwnProperty("disabledChoices")&&e.setDisabledOptions(o.disabledChoices,!0),o.hasOwnProperty("open")&&(o.open?e.open():e.close())},initialize:e=>{var o=e.querySelector('script[data-for="'+e.id+'"]'),i=(o=JSON.parse(o.text)).config;i.options=x(o.options),i.onServerSearch&&(i.onServerSearch=window[i.onServerSearch]),i.labelRenderer&&(i.labelRenderer=window[i.labelRenderer]),i.ele=e,VirtualSelect.init(i),o.stateInput&&(t()(e).on("afterOpen",(function(t){Shiny.setInputValue(e.id+"_open",!0)})),t()(e).on("afterClose",(function(t){Shiny.setInputValue(e.id+"_open",!1)})))}}),Shiny.inputBindings.register(w,"shinyWidgets.virtualSelectBinding")})()})(); \ No newline at end of file +(()=>{var e={9917:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var i=o(1601),n=o.n(i),s=o(6314),r=o.n(s)()(n());r.push([e.id,"/*!\n * Tooltip v1.0.16\n * https://sa-si-dev.github.io/tooltip\n * Licensed under MIT (https://github.com/sa-si-dev/tooltip/blob/master/LICENSE)\n */\n.tooltip-comp{font-family:sans-serif;font-size:14px;line-height:20px;color:#fff;background-color:#212121;position:absolute;top:0;left:0;max-width:300px;padding:5px 10px;opacity:0;pointer-events:none;word-break:break-word;text-align:left;border-radius:2px}.tooltip-comp-arrow{position:absolute;z-index:1;width:16px;height:16px;overflow:hidden}.tooltip-comp-arrow::before{content:'';position:absolute;top:8px;left:8px;width:16px;height:16px;background-color:#212121;-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.tooltip-comp-content{position:relative;z-index:2}.tooltip-comp.hide-arrow-icon .tooltip-comp-arrow{display:none}.tooltip-comp.position-bottom .tooltip-comp-arrow{margin-left:-8px;left:0;top:-15px}.tooltip-comp.position-top .tooltip-comp-arrow{margin-left:-8px;left:0;bottom:-15px}.tooltip-comp.position-right .tooltip-comp-arrow{margin-top:-8px;top:0;left:-15px}.tooltip-comp.position-left .tooltip-comp-arrow{margin-top:-8px;top:0;right:-15px}\n\n",""]);const a=r},4185:(e,t,o)=>{"use strict";o.d(t,{A:()=>a});var i=o(1601),n=o.n(i),s=o(6314),r=o.n(s)()(n());r.push([e.id,'/*!\n * Virtual Select v1.0.46\n * https://sa-si-dev.github.io/virtual-select\n * Licensed under MIT (https://github.com/sa-si-dev/virtual-select/blob/master/LICENSE)\n */\n@keyframes vscomp-animation-spin{to{transform:rotateZ(360deg)}}.vscomp-popup-active{overflow:hidden !important}.vscomp-ele{display:inline-block;max-width:250px;width:100%}.vscomp-wrapper{color:#333;display:inline-flex;flex-wrap:wrap;font-family:sans-serif;font-size:14px;position:relative;text-align:left;width:100%}.vscomp-wrapper *,.vscomp-wrapper *::before,.vscomp-wrapper *::after{box-sizing:border-box}.vscomp-wrapper:focus{outline:none}.vscomp-dropbox-wrapper{left:0;position:absolute;top:0}.vscomp-toggle-button{align-items:center;background-color:#fff;border:1px solid #ddd;cursor:pointer;display:flex;padding:7px 30px 7px 10px;position:relative;width:100%}.vscomp-value{height:20px;line-height:20px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.vscomp-arrow{align-items:center;display:flex;height:100%;justify-content:center;position:absolute;right:0;top:0;width:30px}.vscomp-arrow::after{transform:rotate(45deg);border:1px solid rgba(0,0,0,0);border-bottom-color:#111;border-right-color:#111;content:"";height:8px;margin-top:-6px;width:8px}.vscomp-clear-icon{height:12px;position:relative;width:12px}.vscomp-clear-icon::before,.vscomp-clear-icon::after{background-color:#999;content:"";height:12px;left:5px;position:absolute;top:0;width:2px}.vscomp-clear-icon::before{transform:rotate(45deg)}.vscomp-clear-icon::after{transform:rotate(-45deg)}.vscomp-clear-icon:hover::before,.vscomp-clear-icon:hover::after{background:#333}.vscomp-clear-button{align-items:center;border-radius:50%;display:none;height:24px;justify-content:center;margin-top:-12px;position:absolute;right:30px;top:50%;width:24px}.vscomp-clear-button:hover{background:#ccc}.vscomp-clear-button:hover .vscomp-clear-icon::before,.vscomp-clear-button:hover .vscomp-clear-icon::after{background-color:#333}.vscomp-dropbox-close-button{align-items:center;background-color:#fff;border-radius:50%;bottom:-48px;cursor:pointer;display:none;height:40px;justify-content:center;left:50%;margin-left:-20px;position:absolute;width:40px}.vscomp-value-tag.more-value-count{white-space:nowrap}.vscomp-dropbox-container{width:100%;z-index:2}.vscomp-dropbox{background-color:#fff;width:100%}.vscomp-options-container{max-height:210px;overflow:auto;position:relative}.vscomp-options-bottom-freezer{bottom:0;height:2px;left:0;position:absolute;right:0}.vscomp-option{align-items:center;cursor:pointer;display:flex;flex-wrap:wrap;height:40px;padding:0 15px;position:relative}.vscomp-option.selected{background-color:#eee}.vscomp-option.focused{background-color:#ccc}.vscomp-option.disabled{cursor:default;opacity:.5}.vscomp-option.group-title .vscomp-option-text{cursor:default;opacity:.6}.vscomp-option.group-title.selected{background-color:rgba(0,0,0,0)}.vscomp-option.group-option{padding-left:30px}.vscomp-new-option-icon{height:30px;position:absolute;right:0;top:0;width:30px}.vscomp-new-option-icon::before{border:15px solid #512da8;border-bottom-color:rgba(0,0,0,0);border-left-color:rgba(0,0,0,0);content:"";position:absolute;right:0;top:0}.vscomp-new-option-icon::after{align-items:center;color:#fff;content:"+";display:flex;font-size:18px;height:15px;justify-content:center;position:absolute;right:1px;top:0;width:15px}.vscomp-option-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.vscomp-option-description{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#666;font-size:13px;line-height:15px;width:100%}.vscomp-search-container{align-items:center;border-bottom:1px solid #ddd;display:flex;height:40px;padding:0 5px 0 15px;position:relative}.vscomp-search-label,.vscomp-live-region,.vscomp-dropbox-container-top,.vscomp-dropbox-container-bottom{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.vscomp-search-input{background-color:rgba(0,0,0,0);border:0;color:inherit;font-size:15px;height:38px;padding:10px 0;width:calc(100% - 30px)}.vscomp-search-input:focus{outline:none}.vscomp-search-clear{align-items:center;color:#999;cursor:pointer;display:flex;font-size:25px;height:30px;justify-content:center;-webkit-user-select:none;-moz-user-select:none;user-select:none;visibility:hidden;width:30px}.vscomp-search-clear:hover{color:inherit}.vscomp-no-options,.vscomp-no-search-results{align-items:center;display:none;justify-content:center;padding:20px 10px}.vscomp-options-loader{display:none;padding:20px 0;text-align:center}.vscomp-options-loader::before{animation:vscomp-animation-spin .8s infinite linear;background-color:#fff;border-radius:50%;box-shadow:-4px -5px 3px -3px rgba(0,0,0,.3);content:"";display:inline-block;height:40px;opacity:.7;width:40px}.vscomp-ele[disabled]{cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;user-select:none}.vscomp-ele[disabled] .vscomp-wrapper{opacity:.7;pointer-events:none}.vscomp-wrapper .checkbox-icon{display:inline-flex;height:15px;margin-right:10px;position:relative;width:15px}.vscomp-wrapper .checkbox-icon::after{transition-duration:.2s;border:2px solid #888;content:"";display:inline-block;height:100%;width:100%}.vscomp-wrapper .checkbox-icon.checked::after{transform:rotate(45deg) translate(1px, -4px);border-color:#512da8;border-left-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);width:50%}.vscomp-wrapper.show-as-popup .vscomp-dropbox-container{align-items:center;background-color:rgba(0,0,0,.5);display:flex;height:100vh;justify-content:center;left:0;opacity:1;overflow:auto;padding:0 10px;position:fixed;top:0;width:100vw}.vscomp-wrapper.show-as-popup .vscomp-dropbox{margin-top:-24px;max-height:calc(80% - 48px);max-width:500px;position:relative;width:80%}.vscomp-wrapper.show-as-popup .vscomp-dropbox-close-button{display:flex}.vscomp-wrapper.popup-position-left .vscomp-dropbox-container{justify-content:flex-start}.vscomp-wrapper.popup-position-right .vscomp-dropbox-container{justify-content:flex-end}.vscomp-wrapper.has-select-all .vscomp-toggle-all-button{align-items:center;cursor:pointer;display:flex}.vscomp-wrapper.has-select-all .vscomp-search-input,.vscomp-wrapper.has-select-all .vscomp-toggle-all-label{width:calc(100% - 55px)}.vscomp-wrapper.has-select-all .vscomp-toggle-all-label{display:none}.vscomp-wrapper:not(.has-search-input) .vscomp-toggle-all-button{width:100%}.vscomp-wrapper:not(.has-search-input) .vscomp-toggle-all-label{display:inline-block}.vscomp-wrapper.multiple .vscomp-option .vscomp-option-text{width:calc(100% - 25px)}.vscomp-wrapper.multiple .vscomp-option .vscomp-option-description{padding-left:25px}.vscomp-wrapper.multiple .vscomp-option.selected .checkbox-icon::after{transform:rotate(45deg) translate(1px, -4px);border-color:#512da8;border-left-color:rgba(0,0,0,0);border-top-color:rgba(0,0,0,0);width:50%}.vscomp-wrapper.focused .vscomp-toggle-button,.vscomp-wrapper:focus .vscomp-toggle-button{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.vscomp-wrapper.closed .vscomp-dropbox-container,.vscomp-wrapper.closed.vscomp-dropbox-wrapper{display:none}.vscomp-wrapper:not(.has-value) .vscomp-value{opacity:.5}.vscomp-wrapper.has-clear-button.has-value .vscomp-clear-button{display:flex}.vscomp-wrapper.has-clear-button .vscomp-toggle-button{padding-right:54px}.vscomp-wrapper.has-no-options .vscomp-options-container,.vscomp-wrapper.has-no-search-results .vscomp-options-container{display:none}.vscomp-wrapper.has-no-options .vscomp-no-options{display:flex}.vscomp-wrapper.has-no-search-results .vscomp-no-search-results{display:flex}.vscomp-wrapper.has-search-value .vscomp-search-clear{visibility:visible}.vscomp-wrapper.has-no-options .vscomp-toggle-all-button{opacity:.5;pointer-events:none}.vscomp-wrapper.keep-always-open .vscomp-toggle-button{padding-right:24px}.vscomp-wrapper.keep-always-open .vscomp-clear-button{right:5px}.vscomp-wrapper.keep-always-open .vscomp-arrow{display:none}.vscomp-wrapper.keep-always-open .vscomp-dropbox-container{position:relative;z-index:1}.vscomp-wrapper.keep-always-open .vscomp-dropbox{transition-duration:0s;border:1px solid #ddd;box-shadow:none}.vscomp-wrapper.keep-always-open.focused,.vscomp-wrapper.keep-always-open:focus,.vscomp-wrapper.keep-always-open:hover{box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2)}.vscomp-wrapper.server-searching .vscomp-options-list{display:none}.vscomp-wrapper.server-searching .vscomp-options-loader{display:block}.vscomp-wrapper.has-error .vscomp-toggle-button{border-color:#b00020}.vscomp-wrapper.show-value-as-tags .vscomp-toggle-button{padding:4px 22px 0 10px}.vscomp-wrapper.show-value-as-tags .vscomp-value{display:flex;flex-wrap:wrap;height:auto;min-height:28px;overflow:auto;text-overflow:unset;white-space:normal}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;align-items:center;border:1px solid #ddd;border-radius:20px;display:inline-flex;font-size:12px;line-height:16px;margin:0 4px 4px 0;max-width:100%;padding:2px 3px 2px 8px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag.more-value-count{padding-right:8px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:calc(100% - 20px)}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-clear-button{align-items:center;display:flex;height:20px;justify-content:center;width:20px}.vscomp-wrapper.show-value-as-tags .vscomp-value-tag-clear-button .vscomp-clear-icon{transform:scale(0.8)}.vscomp-wrapper.show-value-as-tags .vscomp-arrow{height:34px}.vscomp-wrapper.show-value-as-tags .vscomp-clear-button{margin-top:0;top:5px}.vscomp-wrapper.show-value-as-tags.has-value .vscomp-arrow{display:none}.vscomp-wrapper.show-value-as-tags.has-value .vscomp-clear-button{right:2px}.vscomp-wrapper.show-value-as-tags:not(.has-value) .vscomp-toggle-button{padding-bottom:2px}.vscomp-wrapper.show-value-as-tags:not(.has-value) .vscomp-value{align-items:center;padding-bottom:3px}.vscomp-wrapper.text-direction-rtl{direction:rtl}.vscomp-wrapper.text-direction-rtl .vscomp-toggle-button{padding:7px 10px 7px 30px}.vscomp-wrapper.text-direction-rtl .vscomp-arrow{left:0;right:auto}.vscomp-wrapper.text-direction-rtl .vscomp-clear-button{left:30px;right:auto !important}.vscomp-wrapper.text-direction-rtl .checkbox-icon{margin-left:10px;margin-right:0}.vscomp-wrapper.text-direction-rtl .checkbox-icon.checked::after{transform:rotate(45deg) translate(-4px, 1px)}.vscomp-wrapper.text-direction-rtl .vscomp-search-container{padding:0 15px 0 5px}.vscomp-wrapper.text-direction-rtl .vscomp-toggle-all-label{text-align:right}.vscomp-wrapper.text-direction-rtl .vscomp-option{text-align:right}.vscomp-wrapper.text-direction-rtl .vscomp-option.group-option{padding-right:30px}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon{left:0;right:auto}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon::before{border-left-color:#512da8;border-right-color:rgba(0,0,0,0)}.vscomp-wrapper.text-direction-rtl .vscomp-new-option-icon::after{left:1px;right:auto}.vscomp-wrapper.text-direction-rtl.multiple .vscomp-option.selected .checkbox-icon::after{transform:rotate(45deg) translate(-4px, 1px)}.vscomp-wrapper.text-direction-rtl.has-clear-button .vscomp-toggle-button{padding-left:54px}.vscomp-wrapper.text-direction-rtl.keep-always-open .vscomp-toggle-button{padding-left:24px}.vscomp-wrapper.text-direction-rtl.keep-always-open .vscomp-clear-button{left:5px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-toggle-button{padding:4px 10px 0 22px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-value-tag{margin:0 0 4px 4px;padding:2px 8px 2px 3px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags .vscomp-value-tag.more-value-count{padding-left:8px}.vscomp-wrapper.text-direction-rtl.show-value-as-tags.has-value .vscomp-clear-button{left:2px}\n/*!\n * Popover v1.0.13\n * https://sa-si-dev.github.io/popover\n * Licensed under MIT (https://github.com/sa-si-dev/popover/blob/master/LICENSE)\n */\n.pop-comp-wrapper{display:none;position:absolute;top:0;left:0;opacity:0;color:#000;background-color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);text-align:left;flex-wrap:wrap;z-index:1}.pop-comp-arrow{position:absolute;z-index:1;width:16px;height:16px;overflow:hidden;pointer-events:none}.pop-comp-arrow::before{content:"";position:absolute;top:8px;left:8px;width:16px;height:16px;background-color:#fff;box-shadow:0 2px 2px 0 rgba(0,0,0,.14),0 3px 1px -2px rgba(0,0,0,.12),0 1px 5px 0 rgba(0,0,0,.2);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.pop-comp-content{position:relative;z-index:2}.pop-comp-wrapper.position-bottom>.pop-comp-arrow{margin-left:-8px;left:0;top:-15px}.pop-comp-wrapper.position-bottom>.pop-comp-arrow::before{box-shadow:0px 0px 2px 0 rgba(0,0,0,.14)}.pop-comp-wrapper.position-top>.pop-comp-arrow{margin-left:-8px;left:0;bottom:-15px}.pop-comp-wrapper.position-right>.pop-comp-arrow{margin-top:-8px;top:0;left:-15px}.pop-comp-wrapper.position-left>.pop-comp-arrow{margin-top:-8px;top:0;right:-15px}.pop-comp-disable-events{pointer-events:none}\n\n',""]);const a=r},6314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var o="",i=void 0!==t[5];return t[4]&&(o+="@supports (".concat(t[4],") {")),t[2]&&(o+="@media ".concat(t[2]," {")),i&&(o+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),o+=e(t),i&&(o+="}"),t[2]&&(o+="}"),t[4]&&(o+="}"),o})).join("")},t.i=function(e,o,i,n,s){"string"==typeof e&&(e=[[null,e,void 0]]);var r={};if(i)for(var a=0;a0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=s),o&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=o):c[2]=o),n&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=n):c[4]="".concat(n)),t.push(c))}},t}},1601:e=>{"use strict";e.exports=function(e){return e[1]}},5072:e=>{"use strict";var t=[];function o(e){for(var o=-1,i=0;i{"use strict";var t={};e.exports=function(e,o){var i=function(e){if(void 0===t[e]){var o=document.querySelector(e);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}(e);if(!i)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");i.appendChild(o)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},5056:(e,t,o)=>{"use strict";e.exports=function(e){var t=o.nc;t&&e.setAttribute("nonce",t)}},7825:e=>{"use strict";e.exports=function(e){var t=e.insertStyleElement(e);return{update:function(o){!function(e,t,o){var i="";o.supports&&(i+="@supports (".concat(o.supports,") {")),o.media&&(i+="@media ".concat(o.media," {"));var n=void 0!==o.layer;n&&(i+="@layer".concat(o.layer.length>0?" ".concat(o.layer):""," {")),i+=o.css,n&&(i+="}"),o.media&&(i+="}"),o.supports&&(i+="}");var s=o.sourceMap;s&&"undefined"!=typeof btoa&&(i+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),t.styleTagTransform(i,e,t.options)}(t,e,o)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},1113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},5304:()=>{!function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oo-n-t.width?"left":"right",vertical:s>i-s-t.height?"top":"bottom"}}},{key:"getAbsoluteCoords",value:function(e){if(e){var t=e.getBoundingClientRect(),o=window.pageXOffset,i=window.pageYOffset;return{width:t.width,height:t.height,top:t.top+i,right:t.right+o,bottom:t.bottom+i,left:t.left+o}}}},{key:"getCoords",value:function(e){return e?e.getBoundingClientRect():{}}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"show",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";t.setStyle(e,"display",o)}},{key:"hide",value:function(e){t.setStyle(e,"display","none")}},{key:"getHideableParent",value:function(e){for(var t,o=e.parentElement;o;){var i=getComputedStyle(o).overflow;if(-1!==i.indexOf("scroll")||-1!==i.indexOf("auto")){t=o;break}o=o.parentElement}return t}}])&&function(e,t){for(var o=0;og?g-f:M:k+c>L&&("right"===C?s="left":k=L+fx?x-h:P:E+u>I&&("bottom"===C?s="top":E=I+hc-R&&(N=c-R):"left"!==C&&"right"!==C||((W=b/2+y-G)u-R&&(W=u-R)),o.setStyle(this.$arrowEle,"transform","translate3d(".concat(N,"px, ").concat(W,"px, 0) ").concat(K))}o.hide(this.$popperEle)}},{key:"resetPosition",value:function(){o.setStyle(this.$popperEle,"transform","none"),this.setPosition()}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.resetPosition,n=t.data;clearTimeout(this.exitDelayTimeout),clearTimeout(this.hideDurationTimeout),i&&this.resetPosition(),this.enterDelayTimeout=setTimeout((function(){var t=o.getData(e.$popperEle,"left"),i=o.getData(e.$popperEle,"top"),s="translate3d(".concat(t,"px, ").concat(i,"px, 0)"),r=e.showDuration;o.show(e.$popperEle,"inline-flex"),o.getCoords(e.$popperEle),o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",1),e.showDurationTimeout=setTimeout((function(){"function"==typeof e.afterShowCallback&&e.afterShowCallback(n)}),r)}),this.enterDelay)}},{key:"hide",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data;clearTimeout(this.enterDelayTimeout),clearTimeout(this.showDurationTimeout),this.exitDelayTimeout=setTimeout((function(){if(e.$popperEle){var i=o.getData(e.$popperEle,"fromLeft"),n=o.getData(e.$popperEle,"fromTop"),s="translate3d(".concat(i,"px, ").concat(n,"px, 0)"),r=e.hideDuration;o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",0),e.hideDurationTimeout=setTimeout((function(){o.hide(e.$popperEle),"function"==typeof e.afterHideCallback&&e.afterHideCallback(t)}),r)}}),this.exitDelay)}},{key:"updatePosition",value:function(){o.setStyle(this.$popperEle,"transitionDuration","0ms"),this.resetPosition();var e=o.getData(this.$popperEle,"left"),t=o.getData(this.$popperEle,"top");o.show(this.$popperEle,"inline-flex"),o.setStyle(this.$popperEle,"transform","translate3d(".concat(e,"px, ").concat(t,"px, 0)"))}}])&&function(e,t){for(var o=0;o1&&void 0!==arguments[1]&&arguments[1]}},{key:"convertToFloat",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return void 0!==e?parseFloat(e):t}}],i&&e(o,i),t}();function o(e,t){for(var o=0;oe.offsetWidth}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"getScrollableParents",value:function(e){if(!e)return[];for(var t=[window],o=e.parentElement;o;){var i=getComputedStyle(o).overflow;-1===i.indexOf("scroll")&&-1===i.indexOf("auto")||t.push(o),o=o.parentElement}return t}}],i&&o(t,i),e}();!function(){if(!window.tooltipComponentInitiated){var e,o,n,s,r;window.tooltipComponentInitiated=!0;var a,l={},p=!1;c(),window.addEventListener("load",c)}function c(){p||(e=document.querySelector("body"))&&(document.addEventListener("mouseover",u),document.addEventListener("mouseout",h),document.addEventListener("touchmove",d),document.addEventListener("click",v),p=!0)}function u(p){if(!n){var c=p.target.closest("[data-tooltip]");c&&(n=c,function(){if(n){var p,c=t.convertToBoolean,u=t.convertToFloat,h=n.dataset;!(l={tooltip:h.tooltip,position:h.tooltipPosition||"auto",zIndex:u(h.tooltipZIndex,1),enterDelay:u(h.tooltipEnterDelay,0),exitDelay:u(h.tooltipExitDelay,0),fontSize:h.tooltipFontSize||"14px",margin:u(h.tooltipMargin,8),offset:u(h.tooltipOffset,5),showDuration:u(h.tooltipShowDuration,300),hideDuration:u(h.tooltipHideDuration,200),transitionDistance:u(h.tooltipTransitionDistance,10),ellipsisOnly:c(h.tooltipEllipsisOnly),allowHtml:c(h.tooltipAllowHtml),hideOnClick:c(h.tooltipHideOnClick,!0),hideArrowIcon:c(h.tooltipHideArrowIcon),alignment:h.tooltipAlignment||"left",maxWidth:h.tooltipMaxWidth||"300px",additionalClasses:h.tooltipAdditionalClasses}).tooltip||l.ellipsisOnly&&!i.hasEllipsis(n)?f():(o&&o.remove(),function(){var t="tooltip-comp";l.hideArrowIcon&&(t+=" hide-arrow-icon"),l.additionalClasses&&(t+=" "+l.additionalClasses);var n='
\n \n
\n
');e.insertAdjacentHTML("beforeend",n);var r=i.setStyle;o=document.querySelector(".tooltip-comp"),s=o.querySelector(".tooltip-comp-arrow");var a=o.querySelector(".tooltip-comp-content");l.allowHtml?a.innerHTML=l.tooltip:a.innerText=l.tooltip,r(o,"zIndex",l.zIndex),r(o,"fontSize",l.fontSize),r(o,"textAlign",l.alignment),r(o,"maxWidth",l.maxWidth)}(),p={$popperEle:o,$triggerEle:n,$arrowEle:s,position:l.position,margin:l.margin,offset:l.offset,enterDelay:l.enterDelay,exitDelay:l.exitDelay,showDuration:l.showDuration,hideDuration:l.hideDuration,transitionDistance:l.transitionDistance,zIndex:l.zIndex},(a=new PopperComponent(p)).show(),(r=i.getScrollableParents(n)).forEach((function(e){e.addEventListener("scroll",m)})))}}())}}function h(e){if(n){for(var t=e.relatedTarget;t;){if(t===n)return;t=t.parentNode}f()}}function d(){f()}function v(){l.hideOnClick&&f()}function f(){(o||n)&&(a&&a.hide(),r&&(r.forEach((function(e){e.removeEventListener("scroll",m)})),r=null),n=null)}function m(){f()}}()}()},5024:()=>{!function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);o1&&void 0!==arguments[1]&&arguments[1]}},{key:"isEmpty",value:function(e){var t=!1;return e?Array.isArray(e)?0===e.length&&(t=!0):"object"===o(e)&&0===Object.keys(e).length&&(t=!0):t=!0,t}},{key:"isNotEmpty",value:function(e){return!this.isEmpty(e)}},{key:"removeItemFromArray",value:function(t,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!Array.isArray(t)||!t.length)return t;var n=i?e(t):t,s=n.indexOf(o);return-1!==s&&n.splice(s,1),n}},{key:"removeArrayEmpty",value:function(e){return Array.isArray(e)&&e.length?e.filter((function(e){return!!e})):[]}},{key:"getRandomInt",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=Math.ceil(t),i=Math.floor(e);return Math.floor(Math.random()*(i-o-1))+o}},{key:"regexEscape",value:function(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"normalizeString",value:function(e){return e.normalize("NFD").replace(/[^\w]/g,"")}},{key:"willTextOverflow",value:function(e,t){var o=document.createElement("div");o.style.position="absolute",o.style.visibility="hidden",o.style.whiteSpace="nowrap",o.style.fontSize=window.getComputedStyle(e).fontSize,o.style.fontFamily=window.getComputedStyle(e).fontFamily,o.textContent=t,document.body.appendChild(o);var i=o.clientWidth;return document.body.removeChild(o),i>e.clientWidth}},{key:"replaceDoubleQuotesWithHTML",value:function(e){return e.replace(/"/g,""")}},{key:"containsHTML",value:function(e){return/<[a-z][\s\S]*>/i.test(e)}}],s&&i(n,s),Object.defineProperty(n,"prototype",{writable:!1}),t}();function s(e){return s="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},s(e)}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){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 a(e,t){if(e){if("string"==typeof e)return l(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oe.offsetWidth}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setAttr",value:function(e,t,o){e&&e.setAttribute(t,o)}},{key:"setAttrFromEle",value:function(e,t,o,i){var n={};o.forEach((function(t){n[t]=e.getAttribute(t)})),o.forEach((function(e){var o=n[e];(o||-1!==i.indexOf(e)&&""===o)&&t.setAttribute(e,o)}))}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"setStyles",value:function(e,t){e&&t&&Object.keys(t).forEach((function(o){e.style[o]=t[o]}))}},{key:"setAria",value:function(e,t,o){var i=t;"role"!==i&&(i="aria-".concat(i)),e.setAttribute(i,o)}},{key:"getElements",value:function(e){return e?void 0===e.forEach?[e]:e:[]}},{key:"getElementsBySelector",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=void 0!==o?o:document;return""!==t&&(e=i.querySelectorAll(t)),void 0!==e?Array.from(e):[]}},{key:"addEvent",value:function(t,o,i){t&&n.removeArrayEmpty(o.split(" ")).forEach((function(o){e.getElements(t).forEach((function(e){e.addEventListener(o,i)}))}))}},{key:"dispatchEvent",value:function(t,o){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var n=e.getElements(t);setTimeout((function(){n.forEach((function(e){e.dispatchEvent(new CustomEvent(o,{bubbles:i}))}))}),0)}}},{key:"getAttributesText",value:function(e){var t="";return e?(Object.entries(e).forEach((function(e){var o=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,n,s,r=[],a=!0,l=!1;try{for(n=(t=t.call(e)).next,!2;!(a=(o=n.call(t)).done)&&(r.push(o.value),2!==r.length);a=!0);}catch(e){l=!0,i=e}finally{try{if(!a&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return r}}(e)||a(e,2)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),i=o[0],n=o[1];void 0!==n&&(t+=" ".concat(i,'="').concat(n,'" '))})),t):t}},{key:"convertPropToDataAttr",value:function(e){return e?"data-".concat(e).replace(/([A-Z])/g,"-$1").toLowerCase():""}},{key:"changeTabIndex",value:function(t,o){t?e.getElements(t).forEach((function(e){e.tabIndex=o})):console.log(t,"Invalid element provided.")}},{key:"removeEvent",value:function(t,o,i){t&&e.getElements(t).forEach((function(e){e.removeEventListener(o,i)}))}}],o&&p(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();function u(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),o.push.apply(o,i)}return o}function h(e){for(var t=1;te.length)&&(t=e.length);for(var o=0,i=new Array(t);o\n \n
\n
\n ").concat(this.placeholder,'\n
\n
\n
\n \n
\n
\n\n ').concat(this.renderDropbox({wrapperClasses:t}),"\n ");this.$ele.innerHTML=p,this.$body=document.querySelector("body"),this.$wrapper=this.$ele.querySelector(".vscomp-wrapper"),this.hasDropboxWrapper?(this.$allWrappers=[this.$wrapper,this.$dropboxWrapper],this.$dropboxContainer=this.$dropboxWrapper.querySelector(".vscomp-dropbox-container"),c.addClass(this.$dropboxContainer,"pop-comp-wrapper")):(this.$allWrappers=[this.$wrapper],this.$dropboxContainer=this.$wrapper.querySelector(".vscomp-dropbox-container")),this.$toggleButton=this.$ele.querySelector(".vscomp-toggle-button"),this.$clearButton=this.$ele.querySelector(".vscomp-clear-button"),this.$valueText=this.$ele.querySelector(".vscomp-value"),this.$hiddenInput=this.$ele.querySelector(".vscomp-hidden-input"),this.$dropbox=this.$dropboxContainer.querySelector(".vscomp-dropbox"),this.$dropboxCloseButton=this.$dropboxContainer.querySelector(".vscomp-dropbox-close-button"),this.$dropboxContainerBottom=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-bottom"),this.$dropboxContainerTop=this.$dropboxContainer.querySelector(".vscomp-dropbox-container-top"),this.$search=this.$dropboxContainer.querySelector(".vscomp-search-wrapper"),this.$optionsContainer=this.$dropboxContainer.querySelector(".vscomp-options-container"),this.$optionsList=this.$dropboxContainer.querySelector(".vscomp-options-list"),this.$options=this.$dropboxContainer.querySelector(".vscomp-options"),this.$noOptions=this.$dropboxContainer.querySelector(".vscomp-no-options"),this.$noSearchResults=this.$dropboxContainer.querySelector(".vscomp-no-search-results"),this.afterRenderWrapper()}}},{key:"renderDropbox",value:function(e){var t=e.wrapperClasses,o="self"!==this.dropboxWrapper?document.querySelector(this.dropboxWrapper):null,i="vscomp-dropbox";this.additionalDropboxClasses&&(i+=" ".concat(this.additionalDropboxClasses));var n="vscomp-dropbox-container";this.additionalDropboxContainerClasses&&(n+=" ".concat(this.additionalDropboxContainerClasses));var s='
\n \n
\n
\n\n
\n
\n\n
\n
\n
\n
\n\n
\n
').concat(this.noOptionsText,'
\n
').concat(this.noSearchResultsText,'
\n\n \n
\n \n
');if(o){var r=document.createElement("div");return this.$dropboxWrapper=r,this.hasDropboxWrapper=!0,r.innerHTML=s,o.appendChild(r),c.addClass(r,"vscomp-dropbox-wrapper ".concat(t)),""}return this.hasDropboxWrapper=!1,s}},{key:"renderOptions",value:function(){var e,t=this,o="",i=this.getVisibleOptions(),s="",r="",a=!(!this.markSearchResults||!this.searchValue),l=this.labelRenderer,p=this.disableOptionGroupCheckbox,c=this.uniqueId,u=this.searchGroup,h="function"==typeof l,d=n.convertToBoolean,v="";if(a&&(e=new RegExp("(".concat(n.regexEscape(this.searchValue),")(?!([^<]+)?>)"),"gi")),this.multiple&&(s=''),this.allowNewOption){var f=this.getTooltipAttrText("New Option");r='")}i.forEach((function(i){var n,f=i.index,m="vscomp-option",b=t.getTooltipAttrText("",!0,!0),y=s,g="",x="",w="",S="",O="-1",k=d(i.isSelected),E="";if(i.classNames&&(m+=" ".concat(i.classNames)),i.isFocused&&(O="0",m+=" focused"),i.isDisabled&&(m+=" disabled",E='aria-disabled="true"'),i.isGroupTitle&&(v=i.label,m+=" group-title",p&&(y="")),k&&(m+=" selected"),i.isGroupOption){var C="";m+=" group-option",w='data-group-index="'.concat(i.groupIndex,'"'),i.customData?(v=void 0!==i.customData.group_name?"".concat(i.customData.group_name,", "):"",C=void 0!==i.customData.description?" ".concat(i.customData.description,","):"",S='aria-label="'.concat(v," ").concat(i.label,", ").concat(C,'"')):S='aria-label="'.concat(v,", ").concat(i.label,'"')}n=h?l(i):i.label,i.description&&(x='
").concat(i.description,"
")),i.isCurrentNew?(m+=" current-new",g+=r):!a||i.isGroupTitle&&!u||(n=n.replace(e,"$1")),o+='
\n ").concat(n,"\n \n ").concat(x,"\n ").concat(g,"\n
")})),v="",this.$options.innerHTML=o,this.$visibleOptions=this.$options.querySelectorAll(".vscomp-option"),this.afterRenderOptions()}},{key:"renderSearch",value:function(){if(this.hasSearchContainer){var e="",t="";this.multiple&&!this.disableSelectAll&&(e='\n \n '.concat(this.selectAllText,"\n ")),this.hasSearch&&(t='\n \n ×'));var o='
\n '.concat(e,"\n ").concat(t,"\n
");this.$search.innerHTML=o,this.$searchInput=this.$dropboxContainer.querySelector(".vscomp-search-input"),this.$searchClear=this.$dropboxContainer.querySelector(".vscomp-search-clear"),this.$toggleAllButton=this.$dropboxContainer.querySelector(".vscomp-toggle-all-button"),this.$toggleAllCheckbox=this.$dropboxContainer.querySelector(".vscomp-toggle-all-checkbox"),this.addEvent(this.$searchInput,"input","onSearch"),this.addEvent(this.$searchClear,"click","onSearchClear"),this.addEvent(this.$toggleAllButton,"click","onToggleAllOptions"),this.addEvent(this.$dropboxContainerBottom,"focus","onDropboxContainerTopOrBottomFocus"),this.addEvent(this.$dropboxContainerTop,"focus","onDropboxContainerTopOrBottomFocus")}}},{key:"addEvents",value:function(){this.addEvent(document,"click","onDocumentClick"),this.addEvent(this.$allWrappers,"keydown","onKeyDown"),this.addEvent(this.$toggleButton,"click","onToggleButtonClick"),this.addEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.addEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.addEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.addEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.addEvent(this.$options,"click","onOptionsClick"),this.addEvent(this.$options,"mouseover","onOptionsMouseOver"),this.addEvent(this.$options,"touchmove","onOptionsTouchMove"),this.addMutationObserver()}},{key:"addEvent",value:function(e,t,o){var i=this;e&&n.removeArrayEmpty(t.split(" ")).forEach((function(t){var n="".concat(o,"-").concat(t),s=i.events[n];s||(s=i[o].bind(i),i.events[n]=s),c.addEvent(e,t,s)}))}},{key:"removeEvents",value:function(){this.removeEvent(document,"click","onDocumentClick"),this.removeEvent(this.$allWrappers,"keydown","onKeyDown"),this.removeEvent(this.$toggleButton,"click","onToggleButtonClick"),this.removeEvent(this.$clearButton,"click keydown","onClearButtonClick"),this.removeEvent(this.$dropboxContainer,"click","onDropboxContainerClick"),this.removeEvent(this.$dropboxCloseButton,"click","onDropboxCloseButtonClick"),this.removeEvent(this.$optionsContainer,"scroll","onOptionsScroll"),this.removeEvent(this.$options,"click","onOptionsClick"),this.removeEvent(this.$options,"mouseover","onOptionsMouseOver"),this.removeEvent(this.$options,"touchmove","onOptionsTouchMove"),this.removeMutationObserver()}},{key:"removeEvent",value:function(e,t,o){var i=this;e&&n.removeArrayEmpty(t.split(" ")).forEach((function(t){var n="".concat(o,"-").concat(t),s=i.events[n];s&&c.removeEvent(e,t,s)}))}},{key:"onDocumentClick",value:function(e){var t=e.target.closest(".vscomp-wrapper");t!==this.$wrapper&&t!==this.$dropboxWrapper&&this.isOpened()&&this.closeDropbox()}},{key:"onKeyDown",value:function(e){var t=e.which||e.keyCode,o=w[t];if(document.activeElement===this.$searchInput&&e.shiftKey&&9===t)return e.preventDefault(),void(this.keepAlwaysOpen?this.$dropboxContainerTop.focus():(this.closeDropbox(),this.$wrapper.focus()));if(document.activeElement===this.$searchInput&&9===t)return e.preventDefault(),void this.focusFirstVisibleOption();if(27===t||"Escape"===e.key){var i=this.showAsPopup?this.$wrapper:this.$dropboxWrapper;if((document.activeElement===i||i.contains(document.activeElement))&&!this.keepAlwaysOpen)return this.closeDropbox(),void this.$wrapper.focus()}o&&this[o](e)}},{key:"onEnterPress",value:function(e){e.preventDefault(),this.isOpened()?this.selectFocusedOption():!1===this.$ele.disabled&&this.openDropbox()}},{key:"onDownArrowPress",value:function(e){e.preventDefault(),this.isOpened()?this.focusOption({direction:"next"}):this.openDropbox()}},{key:"onUpArrowPress",value:function(e){e.preventDefault(),this.isOpened()?this.focusOption({direction:"previous"}):this.openDropbox()}},{key:"onBackspaceOrDeletePress",value:function(e){e.target===this.$wrapper&&(e.preventDefault(),this.selectedValues.length>0&&this.reset())}},{key:"onToggleButtonClick",value:function(e){var t=e.target;t.closest(".vscomp-value-tag-clear-button")?this.removeValue(t.closest(".vscomp-value-tag")):t.closest(".toggle-button-child")||this.toggleDropbox()}},{key:"onClearButtonClick",value:function(e){"click"===e.type?this.reset():"keydown"!==e.type||"Enter"!==e.code&&"Space"!==e.code||(e.stopPropagation(),this.reset())}},{key:"onOptionsScroll",value:function(){this.setVisibleOptions()}},{key:"onOptionsClick",value:function(e){var t=e.target.closest(".vscomp-option");t&&!c.hasClass(t,"disabled")&&(c.hasClass(t,"group-title")?this.onGroupTitleClick(t):this.selectOption(t,{event:e}))}},{key:"onGroupTitleClick",value:function(e){if(e&&this.multiple&&!this.disableOptionGroupCheckbox){var t=!c.hasClass(e,"selected");this.toggleGroupTitleCheckbox(e,t),this.toggleGroupOptions(e,t)}}},{key:"onDropboxContainerClick",value:function(e){e.target.closest(".vscomp-dropbox")||this.closeDropbox()}},{key:"onDropboxCloseButtonClick",value:function(){this.closeDropbox()}},{key:"onOptionsMouseOver",value:function(e){var t=e.target.closest(".vscomp-option");t&&this.isOpened()&&(c.hasClass(t,"disabled")||c.hasClass(t,"group-title")?this.removeOptionFocus():this.focusOption({$option:t}))}},{key:"onOptionsTouchMove",value:function(){this.removeOptionFocus()}},{key:"onSearch",value:function(e){e.stopPropagation(),this.setSearchValue(e.target.value,!0)}},{key:"onSearchClear",value:function(){this.setSearchValue(""),this.focusSearchInput()}},{key:"onToggleAllOptions",value:function(){this.toggleAllOptions()}},{key:"onDropboxContainerTopOrBottomFocus",value:function(){this.closeDropbox()}},{key:"onResize",value:function(){this.setOptionsContainerHeight(!0)}},{key:"addMutationObserver",value:function(){var e=this;if(this.hasDropboxWrapper){var t=this.$ele;this.mutationObserver=new MutationObserver((function(o){var i=!1,n=!1;o.forEach((function(e){i||(i=f(e.addedNodes).some((function(e){return!(e!==t&&!e.contains(t))}))),n||(n=f(e.removedNodes).some((function(e){return!(e!==t&&!e.contains(t))})))})),n&&!i&&e.destroy()})),this.mutationObserver.observe(document.querySelector("body"),{childList:!0,subtree:!0})}}},{key:"removeMutationObserver",value:function(){this.mutationObserver.disconnect()}},{key:"beforeValueSet",value:function(e){this.toggleAllOptionsClass(!e&&void 0)}},{key:"beforeSelectNewValue",value:function(){var e=this,t=this.getNewOption(),o=t.index;this.newValues.push(t.value),this.setOptionProp(o,"isCurrentNew",!1),this.setOptionProp(o,"isNew",!0),setTimeout((function(){e.setSearchValue(""),e.focusSearchInput()}),0)}},{key:"afterRenderWrapper",value:function(){c.addClass(this.$ele,"vscomp-ele"),this.renderSearch(),this.setEleStyles(),this.setDropboxStyles(),this.setOptionsHeight(),this.setVisibleOptions(),this.setOptionsContainerHeight(),this.addEvents(),this.setEleProps(),this.keepAlwaysOpen||this.showAsPopup||this.initDropboxPopover(),this.initialSelectedValue?this.setValueMethod(this.initialSelectedValue,this.silentInitialValueSet):this.autoSelectFirstOption&&this.visibleOptions.length&&this.setValueMethod(this.visibleOptions[0].value,this.silentInitialValueSet),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),this.initialDisabled&&this.disable(),this.autofocus&&this.focus()}},{key:"afterRenderOptions",value:function(){var e=this.getVisibleOptions(),t=!this.options.length&&!this.hasServerSearch,o=!t&&!e.length;if((!this.allowNewOption||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(c.toggleClass(this.$allWrappers,"has-no-search-results",o),o?(c.setAttr(this.$noSearchResults,"tabindex","0"),c.setAttr(this.$noSearchResults,"aria-hidden","false")):(c.setAttr(this.$noSearchResults,"tabindex","-1"),c.setAttr(this.$noSearchResults,"aria-hidden","true"))),c.toggleClass(this.$allWrappers,"has-no-options",t),t?(c.setAttr(this.$noOptions,"tabindex","0"),c.setAttr(this.$noOptions,"aria-hidden","false")):(c.setAttr(this.$noOptions,"tabindex","-1"),c.setAttr(this.$noOptions,"aria-hidden","true")),this.setOptionAttr(),this.setOptionsPosition(),this.setOptionsTooltip(),document.activeElement!==this.$searchInput){var i=c.getElementsBySelector(".focused",this.$dropboxContainer)[0];void 0!==i&&i.focus()}}},{key:"afterSetOptionsContainerHeight",value:function(e){e&&this.showAsPopup&&this.setVisibleOptions()}},{key:"afterSetSearchValue",value:function(){var e=this;this.hasServerSearch?(clearInterval(this.serverSearchTimeout),this.serverSearchTimeout=setTimeout((function(){e.serverSearch()}),this.searchDelay)):this.setVisibleOptionsCount(),this.selectAllOnlyVisible&&this.toggleAllOptionsClass(),this.focusOption({focusFirst:!0})}},{key:"afterSetVisibleOptionsCount",value:function(){this.scrollToTop(),this.setOptionsHeight(),this.setVisibleOptions(),this.updatePosition()}},{key:"afterValueSet",value:function(){this.scrollToTop(),this.setSearchValue(""),this.renderOptions()}},{key:"afterSetOptions",value:function(e){e&&this.setSelectedProp(),this.setOptionsHeight(),this.setVisibleOptions(),this.showOptionsOnlyOnSearch&&this.setSearchValue("",!1,!0),e||this.reset()}},{key:"setProps",value:function(e){var t=this.setDefaultProps(e);this.setPropsFromElementAttr(t);var o=n.convertToBoolean;this.$ele=t.ele,this.dropboxWrapper=t.dropboxWrapper,this.valueKey=t.valueKey,this.labelKey=t.labelKey,this.descriptionKey=t.descriptionKey,this.aliasKey=t.aliasKey,this.optionHeightText=t.optionHeight,this.optionHeight=parseFloat(this.optionHeightText),this.multiple=o(t.multiple),this.hasSearch=o(t.search),this.searchByStartsWith=o(t.searchByStartsWith),this.searchGroup=o(t.searchGroup),this.hideClearButton=o(t.hideClearButton),this.autoSelectFirstOption=o(t.autoSelectFirstOption),this.hasOptionDescription=o(t.hasOptionDescription),this.silentInitialValueSet=o(t.silentInitialValueSet),this.allowNewOption=o(t.allowNewOption),this.markSearchResults=o(t.markSearchResults),this.showSelectedOptionsFirst=o(t.showSelectedOptionsFirst),this.disableSelectAll=o(t.disableSelectAll),this.keepAlwaysOpen=o(t.keepAlwaysOpen),this.showDropboxAsPopup=o(t.showDropboxAsPopup),this.hideValueTooltipOnSelectAll=o(t.hideValueTooltipOnSelectAll),this.showOptionsOnlyOnSearch=o(t.showOptionsOnlyOnSearch),this.selectAllOnlyVisible=o(t.selectAllOnlyVisible),this.alwaysShowSelectedOptionsCount=o(t.alwaysShowSelectedOptionsCount),this.alwaysShowSelectedOptionsLabel=o(t.alwaysShowSelectedOptionsLabel),this.disableAllOptionsSelectedText=o(t.disableAllOptionsSelectedText),this.showValueAsTags=o(t.showValueAsTags),this.disableOptionGroupCheckbox=o(t.disableOptionGroupCheckbox),this.enableSecureText=o(t.enableSecureText),this.setValueAsArray=o(t.setValueAsArray),this.disableValidation=o(t.disableValidation),this.initialDisabled=o(t.disabled),this.required=o(t.required),this.autofocus=o(t.autofocus),this.useGroupValue=o(t.useGroupValue),this.focusSelectedOptionOnOpen=o(t.focusSelectedOptionOnOpen),this.noOptionsText=t.noOptionsText,this.noSearchResultsText=t.noSearchResultsText,this.selectAllText=t.selectAllText,this.searchNormalize=t.searchNormalize,this.searchPlaceholderText=t.searchPlaceholderText,this.searchFormLabel=t.searchFormLabel,this.optionsSelectedText=t.optionsSelectedText,this.optionSelectedText=t.optionSelectedText,this.allOptionsSelectedText=t.allOptionsSelectedText,this.clearButtonText=t.clearButtonText,this.moreText=t.moreText,this.placeholder=t.placeholder,this.position=t.position,this.textDirection=t.textDirection,this.dropboxWidth=t.dropboxWidth,this.tooltipFontSize=t.tooltipFontSize,this.tooltipAlignment=t.tooltipAlignment,this.tooltipMaxWidth=t.tooltipMaxWidth,this.updatePositionThrottle=t.updatePositionThrottle,this.noOfDisplayValues=parseInt(t.noOfDisplayValues),this.zIndex=parseInt(t.zIndex),this.maxValues=parseInt(t.maxValues),this.minValues=parseInt(t.minValues),this.name=this.secureText(t.name),this.additionalClasses=t.additionalClasses,this.additionalDropboxClasses=t.additionalDropboxClasses,this.additionalDropboxContainerClasses=t.additionalDropboxContainerClasses,this.additionalToggleButtonClasses=t.additionalToggleButtonClasses,this.popupDropboxBreakpoint=t.popupDropboxBreakpoint,this.popupPosition=t.popupPosition,this.onServerSearch=t.onServerSearch,this.labelRenderer=t.labelRenderer,this.selectedLabelRenderer=t.selectedLabelRenderer,this.initialSelectedValue=0===t.selectedValue?"0":t.selectedValue,this.emptyValue=t.emptyValue,this.ariaLabelledby=t.ariaLabelledby,this.ariaLabelText=t.ariaLabelText,this.ariaLabelClearButtonText=t.ariaLabelClearButtonText,this.maxWidth=t.maxWidth,this.searchDelay=t.searchDelay,this.selectedValues=[],this.selectedOptions=[],this.newValues=[],this.events={},this.tooltipEnterDelay=200,this.searchValue="",this.searchValueOriginal="",this.isAllSelected=!1,(void 0===t.search&&this.multiple||this.allowNewOption||this.showOptionsOnlyOnSearch)&&(this.hasSearch=!0),this.hasServerSearch="function"==typeof this.onServerSearch,(this.maxValues||this.hasServerSearch||this.showOptionsOnlyOnSearch)&&(this.disableSelectAll=!0,this.disableOptionGroupCheckbox=!0),this.keepAlwaysOpen&&(this.dropboxWrapper="self"),this.showAsPopup=this.showDropboxAsPopup&&!this.keepAlwaysOpen&&window.innerWidth<=parseFloat(this.popupDropboxBreakpoint),this.hasSearchContainer=this.hasSearch||this.multiple&&!this.disableSelectAll,this.optionsCount=this.getOptionsCount(t.optionsCount),this.halfOptionsCount=Math.ceil(this.optionsCount/2),this.optionsHeight=this.getOptionsHeight(),this.uniqueId=this.getUniqueId()}},{key:"setDefaultProps",value:function(e){var t={dropboxWrapper:"self",valueKey:"value",labelKey:"label",descriptionKey:"description",aliasKey:"alias",ariaLabelText:"Options list",ariaLabelClearButtonText:"Clear button",optionsCount:5,noOfDisplayValues:50,optionHeight:"40px",noOptionsText:"No options found",noSearchResultsText:"No results found",selectAllText:"Select All",searchNormalize:!1,searchPlaceholderText:"Search...",searchFormLabel:"Search",clearButtonText:"Clear",moreText:"more...",optionsSelectedText:"options selected",optionSelectedText:"option selected",allOptionsSelectedText:"All",placeholder:"Select",position:"bottom left",zIndex:e.keepAlwaysOpen?1:2,tooltipFontSize:"14px",tooltipAlignment:"center",tooltipMaxWidth:"300px",updatePositionThrottle:100,name:"",additionalClasses:"",additionalDropboxClasses:"",additionalDropboxContainerClasses:"",additionalToggleButtonClasses:"",maxValues:0,showDropboxAsPopup:!0,popupDropboxBreakpoint:"576px",popupPosition:"center",hideValueTooltipOnSelectAll:!0,emptyValue:"",searchDelay:300,focusSelectedOptionOnOpen:!0};return e.hasOptionDescription&&(t.optionsCount=4,t.optionHeight="50px"),Object.assign(t,e)}},{key:"setPropsFromElementAttr",value:function(e){var t=e.ele;Object.keys(x).forEach((function(o){var i=t.getAttribute(o);-1===S.indexOf(o)||""!==i&&"true"!==i||(i=!0),i&&(e[x[o]]=i)}))}},{key:"setEleProps",value:function(){var t=this.$ele;t.virtualSelect=this,t.value=this.multiple?[]:"",t.name=this.name,t.disabled=!1,t.required=this.required,t.autofocus=this.autofocus,t.multiple=this.multiple,t.form=t.closest("form"),t.reset=e.reset,t.setValue=e.setValueMethod,t.setOptions=e.setOptionsMethod,t.setDisabledOptions=e.setDisabledOptionsMethod,t.setEnabledOptions=e.setEnabledOptionsMethod,t.toggleSelectAll=e.toggleSelectAll,t.isAllSelected=e.isAllSelected,t.addOption=e.addOptionMethod,t.getNewValue=e.getNewValueMethod,t.getDisplayValue=e.getDisplayValueMethod,t.getSelectedOptions=e.getSelectedOptionsMethod,t.getDisabledOptions=e.getDisabledOptionsMethod,t.open=e.openMethod,t.close=e.closeMethod,t.focus=e.focusMethod,t.enable=e.enableMethod,t.disable=e.disableMethod,t.destroy=e.destroyMethod,t.validate=e.validateMethod,t.toggleRequired=e.toggleRequiredMethod,this.hasDropboxWrapper&&(this.$dropboxWrapper.virtualSelect=this)}},{key:"setValueMethod",value:function(e,t){var o={},i={},n=[],s=this.multiple,r=e;if(r){if(Array.isArray(r)||(r=[r]),s){var a=this.maxValues;a&&r.length>a&&r.splice(a)}else r.length>1&&(r=[r[0]]);r=r.map((function(e){return e||0===e?e.toString():""})),this.useGroupValue&&(r=this.setGroupOptionsValue(r)),r.forEach((function(e,t){o[e]=!0,i[e]=t})),this.allowNewOption&&r&&this.setNewOptionsFromValue(r)}if(this.options.forEach((function(e){!0!==o[e.value]||e.isDisabled||e.isGroupTitle?e.isSelected=!1:(e.isSelected=!0,n.push(e.value))})),s)this.hasOptionGroup&&this.setGroupsSelectedProp(),n.sort((function(e,t){return i[e]-i[t]}));else{var l=function(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var o,i,n,s,r=[],a=!0,l=!1;try{for(n=(t=t.call(e)).next,!1;!(a=(o=n.call(t)).done)&&(r.push(o.value),1!==r.length);a=!0);}catch(e){l=!0,i=e}finally{try{if(!a&&null!=t.return&&(s=t.return(),Object(s)!==s))return}finally{if(l)throw i}}return r}}(e)||m(e,1)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(n);n=l[0]}this.beforeValueSet(),this.setValue(n,{disableEvent:t}),this.afterValueSet()}},{key:"setGroupOptionsValue",value:function(e){var t=[],o={},i={};return e.forEach((function(e){i[e]=!0})),this.options.forEach((function(e){var n=e.value,s=!0===i[n];e.isGroupTitle?s&&(o[e.index]=!0):(s||o[e.groupIndex])&&t.push(n)})),t}},{key:"setGroupsSelectedProp",value:function(){var e=this.isAllGroupOptionsSelected.bind(this);this.options.forEach((function(t){t.isGroupTitle&&(t.isSelected=e(t.index))}))}},{key:"setOptionsMethod",value:function(e,t){this.setOptions(e),this.afterSetOptions(t)}},{key:"setDisabledOptionsMethod",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setDisabledOptions(e,!0),t||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setDisabledOptions",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=[];if(e)if(!0===e)t&&this.options.forEach((function(e){return e.isDisabled=!0,o.push(e.value),e}));else{o=e.map((function(e){return e.toString()}));var i={};o.forEach((function(e){i[e]=!0})),t&&this.options.forEach((function(e){return e.isDisabled=!0===i[e.value],e}))}else t&&this.options.forEach((function(e){return e.isDisabled=!1,e}));this.disabledOptions=o}},{key:"setEnabledOptionsMethod",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setEnabledOptions(e),t||(this.setValueMethod(null),this.toggleAllOptionsClass()),this.setVisibleOptions()}},{key:"setEnabledOptions",value:function(e){if(void 0!==e){var t=[];if(!0===e)this.options.forEach((function(e){return e.isDisabled=!1,e}));else{var o={};e.forEach((function(e){o[e]=!0})),this.options.forEach((function(e){var i=!0!==o[e.value];return e.isDisabled=i,i&&t.push(e.value),e}))}this.disabledOptions=t}}},{key:"setOptions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],o=[],i=this.disabledOptions.length,s=this.valueKey,r=this.labelKey,a=this.descriptionKey,l=this.aliasKey,p=this.hasOptionDescription,c=n.getString,u=n.convertToBoolean,h=this.secureText.bind(this),f=this.getAlias.bind(this),m=0,b=!1,y={},g=!1;this.disabledOptions.forEach((function(e){y[e]=!0})),Array.isArray(t)&&t.forEach((function t(x){var w;"object"!==v(x)&&(d(w={},s,x),d(w,r,x),x=w);var S=h(c(x[s])),O=h(c(x[r])),k=x.options,E=!!k,C={index:m,value:S,label:O,labelNormalized:e.searchNormalize?n.normalizeString(O).toLowerCase():O.toLowerCase(),alias:f(x[l]),isVisible:u(x.isVisible,!0),isNew:x.isNew||!1,isGroupTitle:E,classNames:x.classNames};if(g||""!==S||(g=!0),i&&(C.isDisabled=!0===y[S]),x.isGroupOption&&(C.isGroupOption=!0,C.groupIndex=x.groupIndex),p&&(C.description=h(c(x[a]))),x.customData&&(C.customData=x.customData),o.push(C),m+=1,E){var $=C.index;b=!0,k.forEach((function(e){e.isGroupOption=!0,e.groupIndex=$,t(e)}))}}));var x=o.length,w=this.$ele;w.options=o,w.length=x,this.options=o,this.visibleOptionsCount=x,this.lastOptionIndex=x-1,this.newValues=[],this.hasOptionGroup=b,this.hasEmptyValueOption=g,this.setSortedOptions()}},{key:"setServerOptions",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.setOptionsMethod(t,!0);var o=this.selectedOptions,i=this.options,n=!1;if(o.length){var s={};n=!0,i.forEach((function(e){s[e.value]=!0})),o.forEach((function(e){!0!==s[e.value]&&(e.isVisible=!1,i.push(e))})),this.setOptionsMethod(i,!0)}this.allowNewOption&&this.searchValue&&(i.some((function(t){return t.label.toLowerCase()===e.searchValue}))||(n=!0,this.setNewOption())),n?(this.setVisibleOptionsCount(),this.multiple&&this.toggleAllOptionsClass(),this.setValueText()):this.updatePosition(),this.setVisibleOptionsCount(),c.removeClass(this.$allWrappers,"server-searching")}},{key:"setSelectedOptions",value:function(){this.selectedOptions=this.options.filter((function(e){return e.isSelected}))}},{key:"setSortedOptions",value:function(){var e=f(this.options);this.showSelectedOptionsFirst&&this.selectedValues.length&&(e=this.hasOptionGroup?this.sortOptionsGroup(e):this.sortOptions(e)),this.sortedOptions=e}},{key:"setVisibleOptions",value:function(){var e=f(this.sortedOptions),t=2*this.optionsCount,o=this.getVisibleStartIndex(),i=this.getNewOption(),n=o+t-1,s=0;i&&(i.visibleIndex=s,s+=1),e=e.filter((function(e){var t=!1;return e.isVisible&&!e.isCurrentNew&&(t=s>=o&&s<=n,e.visibleIndex=s,s+=1),t})),i&&(e=[i].concat(f(e))),this.visibleOptions=e,this.visibleOptionsCount=e.length,this.renderOptions()}},{key:"setOptionsPosition",value:function(e){var t=parseInt((e||this.getVisibleStartIndex())*this.optionHeight);this.$options.style.transform="translate3d(0, ".concat(t,"px, 0)"),c.setData(this.$options,"top",t)}},{key:"setOptionsTooltip",value:function(){var e=this,t=this.getVisibleOptions(),o=this.hasOptionDescription;t.forEach((function(t){var i=e.$dropboxContainer.querySelector('.vscomp-option[data-index="'.concat(t.index,'"]'));c.setData(i.querySelector(".vscomp-option-text"),"tooltip",t.label),o&&c.setData(i.querySelector(".vscomp-option-description"),"tooltip",t.description)}))}},{key:"setValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=t.disableEvent,i=void 0!==o&&o,s=t.disableValidation,r=void 0!==s&&s;this.hasEmptyValueOption&&""===e||e?Array.isArray(e)?this.selectedValues=f(e):this.selectedValues=[e]:this.selectedValues=[];var a=this.getValue();this.$ele.value=a,this.$hiddenInput.value=this.getInputValue(a),this.isMaxValuesSelected=!!(this.maxValues&&this.maxValues<=this.selectedValues.length),this.toggleAllOptionsClass(),this.setValueText(),c.toggleClass(this.$allWrappers,"has-value",n.isNotEmpty(this.selectedValues)),c.toggleClass(this.$allWrappers,"max-value-selected",this.isMaxValuesSelected),r||this.validate(),i||c.dispatchEvent(this.$ele,"change",!0)}},{key:"setValueText",value:function(){var e=this,t=this.multiple,o=this.selectedValues,i=this.noOfDisplayValues,s=this.showValueAsTags,r=this.$valueText,a=this.selectedLabelRenderer,l=[],p=[],u=o.length,h=0,d=this.isAllSelected&&!this.hasServerSearch&&!this.disableAllOptionsSelectedText&&!s;if(d&&this.hideValueTooltipOnSelectAll)r.innerHTML="".concat(this.allOptionsSelectedText," (").concat(u,")");else{this.getSelectedOptions({fullDetails:!0,keepSelectionOrder:!0}).some((function(t){if(t.isCurrentNew)return!1;if(h>=i)return!0;var o=t.label;if("function"==typeof a&&(o=a(t)),l.push(o),h+=1,s){var c=n.willTextOverflow(r.parentElement,o)?e.getTooltipAttrText(o,!1,!0):"",u='\n ').concat(o,'\n \n \n \n ');p.push(u)}else p.push(o);return!1}));var v=u-i;v>0&&p.push('+ '.concat(v," ").concat(this.moreText,""));var f=l.join(", ");if(""===f)r.innerHTML=this.placeholder;else if(r.innerHTML=f,t){var m=this.maxValues;if(this.alwaysShowSelectedOptionsCount||c.hasEllipsis(r)||m||s){var b=''.concat(u,"");if(m&&(b+=' / '.concat(m,"")),d)r.innerHTML="".concat(this.allOptionsSelectedText," (").concat(u,")");else if(s)r.innerHTML=p.join(""),this.$valueTags=r.querySelectorAll(".vscomp-value-tag"),this.setValueTagAttr();else if(!this.alwaysShowSelectedOptionsLabel){var y=1===u?this.optionSelectedText:this.optionsSelectedText;r.innerHTML="".concat(b," ").concat(y)}}else p=[]}}var g="";0===u?g=this.placeholder:s||(g=p.join(", ")),s||c.setData(r,"tooltip",g),t&&(s?this.updatePosition():c.setData(r,"tooltipEllipsisOnly",0===u))}},{key:"setSearchValue",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e!==this.searchValueOriginal||o){t||(this.$searchInput.value=e);var i=e.replace(/\\/g,"").toLowerCase().trim();this.searchValue=i,this.searchValueOriginal=e,c.toggleClass(this.$allWrappers,"has-search-value",e),this.afterSetSearchValue()}}},{key:"setVisibleOptionsCount",value:function(){var e,t=0,o=!1,i=this.searchGroup,s=this.showOptionsOnlyOnSearch,r=this.searchByStartsWith,a=this.searchValue;a=this.searchNormalize?n.normalizeString(a):a;var l=this.isOptionVisible.bind(this);this.hasOptionGroup&&(e=this.getVisibleOptionGroupsMapping(a)),this.options.forEach((function(n){var p;n.isCurrentNew||(s&&!a?(n.isVisible=!1,p={isVisible:!1,hasExactOption:!1}):p=l({data:n,searchValue:a,hasExactOption:o,visibleOptionGroupsMapping:e,searchGroup:i,searchByStartsWith:r}),p.isVisible&&(t+=1),o||(o=p.hasExactOption))})),this.allowNewOption&&(a&&!o?(this.setNewOption(),t+=1):this.removeNewOption()),this.visibleOptionsCount=t,this.afterSetVisibleOptionsCount()}},{key:"setOptionProp",value:function(e,t,o){this.options[e]&&(this.options[e][t]=o)}},{key:"setOptionsHeight",value:function(){this.$optionsList.style.height="".concat(this.optionHeight*this.visibleOptionsCount,"px")}},{key:"setOptionsContainerHeight",value:function(e){var t;e?this.showAsPopup&&(this.optionsCount=this.getOptionsCount(),this.halfOptionsCount=Math.ceil(this.optionsCount/2),t=this.getOptionsHeight(),this.optionsHeight=t):(t=this.optionsHeight,this.keepAlwaysOpen&&(c.setStyle(this.$noOptions,"height",t),c.setStyle(this.$noSearchResults,"height",t))),c.setStyle(this.$optionsContainer,"max-height",t),this.afterSetOptionsContainerHeight(e)}},{key:"setNewOption",value:function(e){var t=e||this.searchValueOriginal.trim();if(t){var o=this.getNewOption();if(o){var i=o.index;this.setOptionProp(i,"value",this.secureText(t)),this.setOptionProp(i,"label",this.secureText(t))}else{var n={value:t,label:t};e?(n.isNew=!0,this.newValues.push(t)):n.isCurrentNew=!0,this.addOption(n)}}}},{key:"setSelectedProp",value:function(){var e={};this.selectedValues.forEach((function(t){e[t]=!0})),this.options.forEach((function(t){!0===e[t.value]&&(t.isSelected=!0)}))}},{key:"setNewOptionsFromValue",value:function(e){if(e){var t=this.setNewOption.bind(this),o={};this.options.forEach((function(e){o[e.value]=!0})),e.forEach((function(e){e&&!0!==o[e]&&t(e)}))}}},{key:"setDropboxWrapperWidth",value:function(){if(!this.showAsPopup){var e=this.dropboxWidth||"".concat(this.$wrapper.offsetWidth,"px");c.setStyle(this.$dropboxContainer,"max-width",e)}}},{key:"setEleStyles",value:function(){var e=this.maxWidth,t={};e&&(t["max-width"]=e),c.setStyles(this.$ele,t)}},{key:"setDropboxStyles",value:function(){var e=this.dropboxWidth,t={},o={"z-index":this.zIndex};e&&(this.showAsPopup?t["max-width"]=e:o.width=e),c.setStyles(this.$dropboxContainer,o),c.setStyles(this.$dropbox,t)}},{key:"setOptionAttr",value:function(){var e=this.$visibleOptions,t=this.options,o="".concat(this.optionHeight,"px"),i=c.setStyle,n=c.getData,s=c.setData;e&&e.length&&e.forEach((function(e){var r=t[n(e,"index")];i(e,"height",o),s(e,"value",r.value)}))}},{key:"setValueTagAttr",value:function(){var e=this.$valueTags;if(e&&e.length){var t=c.getData,o=c.setData,i=this.options;e.forEach((function(e){var n=t(e,"index");if(void 0!==n){var s=i[n];o(e,"value",s.value)}}))}}},{key:"setScrollTop",value:function(){var e=this.selectedValues;if(!this.showSelectedOptionsFirst&&this.focusSelectedOptionOnOpen&&0!==e.length){var t,o={};e.forEach((function(e){o[e]=!0})),this.options.some((function(e){return!!o[e.value]&&(t=e.visibleIndex,!0)})),t&&(this.$optionsContainer.scrollTop=this.optionHeight*t)}}},{key:"getVisibleOptions",value:function(){return this.visibleOptions||[]}},{key:"getValue",value:function(){return this.multiple?this.useGroupValue?this.getGroupValue():this.selectedValues:this.selectedValues[0]||""}},{key:"getGroupValue",value:function(){var e=[],t={};return this.options.forEach((function(o){if(o.isSelected){var i=o.value;o.isGroupTitle?i&&(t[o.index]=!0,e.push(i)):!0!==t[o.groupIndex]&&e.push(i)}})),e}},{key:"getInputValue",value:function(e){var t=e;return t&&t.length?this.setValueAsArray&&this.multiple&&(t=JSON.stringify(t)):t=this.emptyValue,t}},{key:"getFirstVisibleOptionIndex",value:function(){return Math.ceil(this.$optionsContainer.scrollTop/this.optionHeight)}},{key:"getVisibleStartIndex",value:function(){var e=this.getFirstVisibleOptionIndex()-this.halfOptionsCount;return e<0&&(e=0),e}},{key:"getTooltipAttrText",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i={"data-tooltip":(n.containsHTML(e)?n.replaceDoubleQuotesWithHTML(e):e)||"","data-tooltip-enter-delay":this.tooltipEnterDelay,"data-tooltip-z-index":this.zIndex,"data-tooltip-font-size":this.tooltipFontSize,"data-tooltip-alignment":this.tooltipAlignment,"data-tooltip-max-width":this.tooltipMaxWidth,"data-tooltip-ellipsis-only":t,"data-tooltip-allow-html":o};return c.getAttributesText(i)}},{key:"getOptionObj",value:function(e){if(e){var t=n.getString,o=this.secureText.bind(this);return{index:e.index,value:o(t(e.value)),label:o(t(e.label)),description:o(t(e.description)),alias:this.getAlias(e.alias),isCurrentNew:e.isCurrentNew||!1,isNew:e.isNew||!1,isVisible:!0}}}},{key:"getNewOption",value:function(){var e=this.options[this.lastOptionIndex];if(e&&e.isCurrentNew)return e}},{key:"getOptionIndex",value:function(e){var t;return this.options.some((function(o){return o.value===e&&(t=o.index,!0)})),t}},{key:"getNewValue",value:function(){var e={};this.newValues.forEach((function(t){e[t]=!0}));var t=this.selectedValues.filter((function(t){return!0===e[t]}));return this.multiple?t:t[0]}},{key:"getAlias",value:function(e){var t=e;return t&&(t=(t=Array.isArray(t)?t.join(","):t.toString().trim()).toLowerCase()),t||""}},{key:"getDisplayValue",value:function(){var e=[];return this.options.forEach((function(t){t.isSelected&&e.push(t.label)})),this.multiple?e:e[0]||""}},{key:"getSelectedOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.fullDetails,o=void 0!==t&&t,i=e.keepSelectionOrder,n=void 0!==i&&i,s=this.valueKey,r=this.labelKey,a=this.selectedValues,l=[];if(this.options.forEach((function(e){if(e.isSelected&&!e.isGroupTitle)if(o)l.push(e);else{var t,i=(d(t={},s,e.value),d(t,r,e.label),t);e.isNew&&(i.isNew=!0),e.customData&&(i.customData=e.customData),l.push(i)}})),n){var p={};a.forEach((function(e,t){p[e]=t})),l.sort((function(e,t){return p[e.value]-p[t.value]}))}return this.multiple||o?l:l[0]}},{key:"getDisabledOptions",value:function(){var e=this.valueKey,t=this.labelKey,o=this.disabledOptions,i={},n=[];return o.forEach((function(e){i[e]=!0})),this.options.forEach((function(o){var s,r=o.value,a=o.label;i[r]&&n.push((d(s={},e,r),d(s,t,a),s))})),n}},{key:"getVisibleOptionGroupsMapping",value:function(e){var t=this.options,o={},i=this.isOptionVisible.bind(this);return(t=this.structureOptionGroup(t)).forEach((function(t){o[t.index]=t.options.some((function(t){return i({data:t,searchValue:e}).isVisible}))})),o}},{key:"getOptionsCount",value:function(e){var t;if(this.showAsPopup){var o=80*window.innerHeight/100-48;this.hasSearchContainer&&(o-=40),t=Math.floor(o/this.optionHeight)}else t=parseInt(e);return t}},{key:"getOptionsHeight",value:function(){return"".concat(this.optionsCount*this.optionHeight,"px")}},{key:"getSibling",value:function(e,t){var o="next"===t?"nextElementSibling":"previousElementSibling",i=e;do{i&&(i=i[o])}while(c.hasClass(i,"disabled")||c.hasClass(i,"group-title"));return i}},{key:"getUniqueId",value:function(){var e=n.getRandomInt(1e4);return document.querySelector("#vscomp-ele-wrapper-".concat(e))?this.getUniqueId():e}},{key:"initDropboxPopover",value:function(){var e={ele:this.$ele,target:this.$dropboxContainer,position:this.position,zIndex:this.zIndex,margin:4,transitionDistance:30,hideArrowIcon:!0,disableManualAction:!0,disableUpdatePosition:!this.hasDropboxWrapper,updatePositionThrottle:this.updatePositionThrottle,afterShow:this.afterShowPopper.bind(this),afterHide:this.afterHidePopper.bind(this)};this.dropboxPopover=new PopoverComponent(e)}},{key:"openDropbox",value:function(e){this.isSilentOpen=e,e?c.setStyle(this.$dropboxContainer,"display","inline-flex"):(c.dispatchEvent(this.$ele,"beforeOpen"),c.setAria(this.$wrapper,"expanded",!0)),this.setDropboxWrapperWidth(),c.removeClass(this.$allWrappers,"closed"),c.changeTabIndex(this.$allWrappers,0),this.dropboxPopover&&!e?this.dropboxPopover.show():this.afterShowPopper()}},{key:"afterShowPopper",value:function(){var e=this.isSilentOpen;this.isSilentOpen=!1,e||(this.moveSelectedOptionsFirst(),this.setScrollTop(),c.addClass(this.$allWrappers,"focused"),this.showAsPopup?(c.addClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!0):this.focusElementOnOpen(),c.dispatchEvent(this.$ele,"afterOpen"))}},{key:"closeDropbox",value:function(e){this.isSilentClose=e,this.keepAlwaysOpen?this.removeOptionFocus():(e?c.setStyle(this.$dropboxContainer,"display",""):(c.dispatchEvent(this.$ele,"beforeClose"),c.setAria(this.$wrapper,"expanded",!1),c.setAria(this.$wrapper,"activedescendant","")),this.dropboxPopover&&!e?this.dropboxPopover.hide():this.afterHidePopper())}},{key:"afterHidePopper",value:function(){var e=this.isSilentClose;this.isSilentClose=!1,c.removeClass(this.$allWrappers,"focused"),this.removeOptionFocus(),!e&&this.isPopupActive&&(c.removeClass(this.$body,"vscomp-popup-active"),this.isPopupActive=!1),c.addClass(this.$allWrappers,"closed"),e||(c.dispatchEvent(this.$ele,"afterClose"),(this.initialSelectedValue&&0===this.initialSelectedValue.length||this.selectedValues.length>0)&&this.focus())}},{key:"moveSelectedOptionsFirst",value:function(){this.showSelectedOptionsFirst&&(this.setSortedOptions(),this.$optionsContainer.scrollTop&&this.selectedValues.length?this.scrollToTop():this.setVisibleOptions())}},{key:"toggleDropbox",value:function(){this.isOpened()?this.closeDropbox():this.openDropbox()}},{key:"updatePosition",value:function(){this.dropboxPopover&&this.isOpened()&&this.$ele.updatePosition()}},{key:"isOpened",value:function(){return!c.hasClass(this.$wrapper,"closed")}},{key:"focusSearchInput",value:function(){var e=this.$searchInput;e&&e.focus()}},{key:"focusElementOnOpen",value:function(){var e=this.$searchInput,t=!this.options.length&&!this.hasServerSearch;if(e)t&&!this.allowNewOption?(c.setAttr(e,"disabled",""),this.$noOptions.focus()):(e.removeAttribute("disabled"),e.focus());else{var o=this.$dropbox.querySelector('[tabindex="0"]');void 0!==c.getData(o,"index")?this.focusOption({direction:"next"}):o?o.focus():this.focusFirstVisibleOption()}}},{key:"focusFirstVisibleOption",value:function(){var e=this.$optionsContainer.querySelector("[data-index='".concat(this.getFirstVisibleOptionIndex(),"']"));e?(c.hasClass(e,"group-title")&&(e=this.getSibling(e,"next")),c.setAttr(e,"tabindex","0"),this.$optionsContainer.scrollTop=this.optionHeight*this.getFirstVisibleOptionIndex(),this.focusOption({focusFirst:!0}),e.focus()):(e=this.$dropbox.querySelector('[tabindex="0"]'))&&e.focus()}},{key:"focusOption",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=t.direction,i=t.$option,n=t.focusFirst,s=this.$dropboxContainer.querySelector(".vscomp-option.focused");if(i)e=i;else if(!s||n){var r=this.getFirstVisibleOptionIndex();e=this.$dropboxContainer.querySelector('.vscomp-option[data-visible-index="'.concat(r,'"]')),(c.hasClass(e,"disabled")||c.hasClass(e,"group-title"))&&(e=this.getSibling(e,"next"))}else e=this.getSibling(s,o);e&&e!==s&&(s&&this.toggleOptionFocusedState(s,!1),this.toggleOptionFocusedState(e,!0),this.toggleFocusedProp(c.getData(e,"index"),!0),this.moveFocusedOptionToView(e))}},{key:"moveFocusedOptionToView",value:function(e){var t=e||this.$dropboxContainer.querySelector(".vscomp-option.focused");if(t){var o,i=this.$optionsContainer.getBoundingClientRect(),n=t.getBoundingClientRect(),s=i.top,r=i.bottom,a=i.height,l=n.top,p=n.bottom,u=n.height,h=t.offsetTop,d=c.getData(this.$options,"top","number");s>l?o=h+d:r1&&void 0!==arguments[1]?arguments[1]:{}).event;if(e){var o=!c.hasClass(e,"selected");if(o){if(this.multiple&&this.isMaxValuesSelected)return}else if(!this.multiple)return void this.closeDropbox();var i=this.selectedValues,s=c.getData(e,"value"),r=c.getData(e,"index","number"),a=c.hasClass(e,"current-new"),l=!1,p=this.lastSelectedOptionIndex;if(this.lastSelectedOptionIndex=null,this.toggleSelectedProp(r,o),o){if(this.multiple)i.push(s),this.toggleAllOptionsClass(),this.toggleGroupOptionsParent(e),t&&t.shiftKey&&(l=!0);else{i.length&&this.toggleSelectedProp(this.getOptionIndex(i[0]),!1),i=[s];var u=this.$dropboxContainer.querySelector(".vscomp-option.selected");u&&this.toggleOptionSelectedState(u,!1),this.closeDropbox(),a||this.setSearchValue("")}this.lastSelectedOptionIndex=r,this.toggleOptionSelectedState(e)}else this.multiple&&(this.toggleOptionSelectedState(e),n.removeItemFromArray(i,s),this.toggleAllOptionsClass(!1),this.toggleGroupOptionsParent(e,!1));a&&this.beforeSelectNewValue(),this.setValue(i),l&&this.selectRangeOptions(p,r)}}},{key:"selectFocusedOption",value:function(){this.selectOption(this.$dropboxContainer.querySelector(".vscomp-option.focused"))}},{key:"selectRangeOptions",value:function(e,t){var o=this;if("number"==typeof e&&!this.maxValues){var i,n,s=this.selectedValues,r=this.hasOptionGroup,a={};if(ei&&t0||""===this.searchValue)&&(t=this.isAllOptionsSelected(!0)),c.toggleClass(this.$toggleAllCheckbox,"checked",e||t),this.isAllSelected=e}}},{key:"isAllOptionsSelected",value:function(e){var t=!1;return this.options.length&&this.selectedValues.length&&(t=!this.options.some((function(t){return!t.isSelected&&!t.isDisabled&&!t.isGroupTitle&&(!e||t.isVisible)}))),t}},{key:"isAllGroupOptionsSelected",value:function(e){var t=!1;return this.options.length&&(t=!this.options.some((function(t){return!t.isSelected&&!t.isDisabled&&!t.isGroupTitle&&t.groupIndex===e}))),t}},{key:"toggleGroupOptionsParent",value:function(e,t){if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&e){var o=c.getData(e,"groupIndex");void 0!==o&&(o=parseInt(o));var i=this.$options.querySelector('.vscomp-option[data-index="'.concat(o,'"]')),n="boolean"==typeof t?t:this.isAllGroupOptionsSelected(o);this.toggleGroupTitleCheckbox(i,n),this.toggleGroupTitleProp(o,n)}}},{key:"toggleGroupTitleProp",value:function(e,t){var o="boolean"==typeof t?t:this.isAllGroupOptionsSelected(e);this.toggleSelectedProp(e,o)}},{key:"toggleGroupOptions",value:function(e,t){var o=this;if(this.hasOptionGroup&&!this.disableOptionGroupCheckbox&&e){var i=c.getData(e,"index","number"),s=this.selectedValues,r=this.selectAllOnlyVisible,a={},l=n.removeItemFromArray;s.forEach((function(e){a[e]=!0})),this.options.forEach((function(e){if(!e.isDisabled&&e.groupIndex===i){var o=e.value;!t||r&&!e.isVisible?(e.isSelected=!1,a[o]&&l(s,o)):(e.isSelected=!0,a[o]||s.push(o))}})),this.toggleAllOptionsClass(!!t&&null),this.setValue(s),setTimeout((function(){o.renderOptions()}),0)}}},{key:"toggleGroupTitleCheckbox",value:function(e,t){if(e){var o=c.getData(e,"index","number");this.toggleSelectedProp(o,t),this.toggleOptionSelectedState(e,t)}}},{key:"toggleFocusedProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.focusedOptionIndex&&this.setOptionProp(this.focusedOptionIndex,"isFocused",!1),this.setOptionProp(e,"isFocused",t),this.focusedOptionIndex=e}},{key:"toggleSelectedProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.setOptionProp(e,"isSelected",t)}},{key:"scrollToTop",value:function(){var e=!this.isOpened();e&&this.openDropbox(!0),this.$optionsContainer.scrollTop>0&&(this.$optionsContainer.scrollTop=0),e&&this.closeDropbox(!0)}},{key:"reset",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.options.forEach((function(e){e.isSelected=!1})),this.beforeValueSet(!0),this.setValue(null,{disableEvent:t,disableValidation:e}),this.afterValueSet(),e&&c.removeClass(this.$allWrappers,"has-error"),c.dispatchEvent(this.$ele,"reset")}},{key:"addOption",value:function(e,t){if(e){this.lastOptionIndex+=1;var o=this.getOptionObj(h(h({},e),{},{index:this.lastOptionIndex}));this.options.push(o),this.sortedOptions.push(o),t&&(this.visibleOptionsCount+=1,this.afterSetOptions())}}},{key:"removeOption",value:function(e){(e||0===e)&&(this.options.splice(e,1),this.lastOptionIndex-=1)}},{key:"removeNewOption",value:function(){var e=this.getNewOption();e&&this.removeOption(e.index)}},{key:"sortOptions",value:function(e){return e.sort((function(e,t){var o=e.isSelected||e.isAnySelected,i=t.isSelected||t.isAnySelected;return o||i?o&&(!i||e.index0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.virtualSelect.reset(e,t)}},{key:"setValueMethod",value:function(){var e;(e=this.virtualSelect).setValueMethod.apply(e,arguments)}},{key:"setOptionsMethod",value:function(){var e;(e=this.virtualSelect).setOptionsMethod.apply(e,arguments)}},{key:"setDisabledOptionsMethod",value:function(){var e;(e=this.virtualSelect).setDisabledOptionsMethod.apply(e,arguments)}},{key:"setEnabledOptionsMethod",value:function(){var e;(e=this.virtualSelect).setEnabledOptionsMethod.apply(e,arguments)}},{key:"toggleSelectAll",value:function(e){this.virtualSelect.toggleAllOptions(e)}},{key:"isAllSelected",value:function(){return this.virtualSelect.isAllSelected}},{key:"addOptionMethod",value:function(e){this.virtualSelect.addOption(e,!0)}},{key:"getNewValueMethod",value:function(){return this.virtualSelect.getNewValue()}},{key:"getDisplayValueMethod",value:function(){return this.virtualSelect.getDisplayValue()}},{key:"getSelectedOptionsMethod",value:function(e){return this.virtualSelect.getSelectedOptions(e)}},{key:"getDisabledOptionsMethod",value:function(){return this.virtualSelect.getDisabledOptions()}},{key:"openMethod",value:function(){return this.virtualSelect.openDropbox()}},{key:"closeMethod",value:function(){return this.virtualSelect.closeDropbox()}},{key:"focusMethod",value:function(){return this.virtualSelect.focus()}},{key:"enableMethod",value:function(){return this.virtualSelect.enable()}},{key:"disableMethod",value:function(){return this.virtualSelect.disable()}},{key:"destroyMethod",value:function(){return this.virtualSelect.destroy()}},{key:"validateMethod",value:function(){return this.virtualSelect.validate()}},{key:"toggleRequiredMethod",value:function(e){return this.virtualSelect.toggleRequired(e)}},{key:"onResizeMethod",value:function(){document.querySelectorAll(".vscomp-ele-wrapper").forEach((function(e){e.parentElement.virtualSelect.onResize()}))}}],o&&y(t.prototype,o),i&&y(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}();document.addEventListener("reset",E.onFormReset),document.addEventListener("submit",E.onFormSubmit),window.addEventListener("resize",E.onResizeMethod),x=E.getAttrProps(),window.VirtualSelect=E,"undefined"!=typeof NodeList&&NodeList.prototype&&!NodeList.prototype.forEach&&(NodeList.prototype.forEach=Array.prototype.forEach)}(),function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):void 0}}(e)||function(){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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,i=new Array(t);oo-n-t.width?"left":"right",vertical:s>i-s-t.height?"top":"bottom"}}},{key:"getAbsoluteCoords",value:function(e){if(e){var t=e.getBoundingClientRect(),o=window.pageXOffset,i=window.pageYOffset;return{width:t.width,height:t.height,top:t.top+i,right:t.right+o,bottom:t.bottom+i,left:t.left+o}}}},{key:"getCoords",value:function(e){return e?e.getBoundingClientRect():{}}},{key:"getData",value:function(e,t,o){if(e){var i=e?e.dataset[t]:"";return"number"===o?i=parseFloat(i)||0:"true"===i?i=!0:"false"===i&&(i=!1),i}}},{key:"setData",value:function(e,t,o){e&&(e.dataset[t]=o)}},{key:"setStyle",value:function(e,t,o){e&&(e.style[t]=o)}},{key:"show",value:function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"block";t.setStyle(e,"display",o)}},{key:"hide",value:function(e){t.setStyle(e,"display","none")}},{key:"getHideableParent",value:function(e){for(var t,o=e.parentElement;o;){var i=getComputedStyle(o).overflow;if(-1!==i.indexOf("scroll")||-1!==i.indexOf("auto")){t=o;break}o=o.parentElement}return t}}],o&&function(e,t){for(var o=0;og?g-f:M:k+c>L&&("right"===C?s="left":k=L+fx?x-h:P:E+u>I&&("bottom"===C?s="top":E=I+hc-R&&(N=c-R):"left"!==C&&"right"!==C||((W=b/2+y-G)u-R&&(W=u-R)),o.setStyle(this.$arrowEle,"transform","translate3d(".concat(parseInt(N),"px, ").concat(parseInt(W),"px, 0) ").concat(K))}o.hide(this.$popperEle)}},{key:"resetPosition",value:function(){o.setStyle(this.$popperEle,"transform","none"),this.setPosition()}},{key:"show",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.resetPosition,n=t.data;clearTimeout(this.exitDelayTimeout),clearTimeout(this.hideDurationTimeout),i&&this.resetPosition(),this.enterDelayTimeout=setTimeout((function(){var t=o.getData(e.$popperEle,"left"),i=o.getData(e.$popperEle,"top"),s="translate3d(".concat(parseInt(t),"px, ").concat(parseInt(i),"px, 0)"),r=e.showDuration;o.show(e.$popperEle,"inline-flex"),o.getCoords(e.$popperEle),o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",1),e.showDurationTimeout=setTimeout((function(){"function"==typeof e.afterShowCallback&&e.afterShowCallback(n)}),r)}),this.enterDelay)}},{key:"hide",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).data;clearTimeout(this.enterDelayTimeout),clearTimeout(this.showDurationTimeout),this.exitDelayTimeout=setTimeout((function(){if(e.$popperEle){var i=parseInt(o.getData(e.$popperEle,"fromLeft")),n=parseInt(o.getData(e.$popperEle,"fromTop")),s="translate3d(".concat(i,"px, ").concat(n,"px, 0)"),r=e.hideDuration;o.setStyle(e.$popperEle,"transitionDuration",r+"ms"),o.setStyle(e.$popperEle,"transform",s),o.setStyle(e.$popperEle,"opacity",0),e.hideDurationTimeout=setTimeout((function(){o.hide(e.$popperEle),"function"==typeof e.afterHideCallback&&e.afterHideCallback(t)}),r)}}),this.exitDelay)}},{key:"updatePosition",value:function(){o.setStyle(this.$popperEle,"transitionDuration","0ms"),this.resetPosition();var e=parseInt(o.getData(this.$popperEle,"left")),t=parseInt(o.getData(this.$popperEle,"top"));o.show(this.$popperEle,"inline-flex"),o.setStyle(this.$popperEle,"transform","translate3d(".concat(e,"px, ").concat(t,"px, 0)"))}}],t&&function(e,t){for(var o=0;o1&&void 0!==arguments[1]&&arguments[1]}},{key:"removeArrayEmpty",value:function(e){return Array.isArray(e)&&e.length?e.filter((function(e){return!!e})):[]}},{key:"throttle",value:function(e,t){var o,i=0;return function(){for(var n=arguments.length,s=new Array(n),r=0;re.length)&&(t=e.length);for(var o=0,i=new Array(t);o'),e=this.$popover.querySelector(".pop-comp-arrow")),this.$arrowEle=e}}},{key:"destroy",value:function(){this.removeEvents()}}])&&c(t.prototype,o),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,o,n}();h=f.getAttrProps(),window.PopoverComponent=f}()}},t={};function o(i){var n=t[i];if(void 0!==n)return n.exports;var s=t[i]={id:i,exports:{}};return e[i](s,s.exports,o),s.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.nc=void 0,(()=>{"use strict";const e=jQuery;var t=o.n(e);Shiny;var i=o(5072),n=o.n(i),s=o(7825),r=o.n(s),a=o(7659),l=o.n(a),p=o(5056),c=o.n(p),u=o(540),h=o.n(u),d=o(1113),v=o.n(d),f=o(4185),m={};m.styleTagTransform=v(),m.setAttributes=c(),m.insert=l().bind(null,"head"),m.domAPI=r(),m.insertStyleElement=h(),n()(f.A,m),f.A&&f.A.locals&&f.A.locals,o(5024);var b=o(9917),y={};function g(e){var t,o,i=[];for(t in e)for(o=0;o({label:e,value:e})));else if("transpose"==e.type)t=g(e.choices);else if("transpose_group"==e.type){for(var o=e.choices,i=0;it()(e).find(".virtual-select"),getValue:e=>e.value,setValue:(e,t)=>{e.setValue(t)},subscribe:(e,o)=>{"change"==t()(e).attr("data-update")?t()(e).on("change.virtualSelectBinding",(function(e){o()})):t()(e).on("afterClose.virtualSelectBinding reset.virtualSelectBinding",(function(e){o()}))},unsubscribe:e=>{t()(e).off(".virtualSelectBinding")},receiveMessage:(e,o)=>{if(o.hasOwnProperty("label")){var i=t()("#"+e.id+"-label");!function(e,t){if(void 0!==e){if(1!==t.length)throw new Error("labelNode must be of length 1");Array.isArray(e)&&0===e.length?t.addClass("shiny-label-null"):(t.html(e),t.removeClass("shiny-label-null"))}}(o.label,i)}if(o.hasOwnProperty("options")){var n=x(o.options);e.setOptions(n)}o.hasOwnProperty("value")&&e.setValue(o.value),o.hasOwnProperty("disable")&&(o.disable?e.disable():e.enable()),o.hasOwnProperty("disabledChoices")&&e.setDisabledOptions(o.disabledChoices,!0),o.hasOwnProperty("open")&&(o.open?e.open():e.close())},initialize:e=>{var o=e.querySelector('script[data-for="'+e.id+'"]'),i=(o=JSON.parse(o.text)).config;i.options=x(o.options),i.onServerSearch&&(i.onServerSearch=window[i.onServerSearch]),i.labelRenderer&&(i.labelRenderer=window[i.labelRenderer]),i.ele=e,VirtualSelect.init(i),o.stateInput&&(t()(e).on("afterOpen",(function(t){Shiny.setInputValue(e.id+"_open",!0)})),t()(e).on("afterClose",(function(t){Shiny.setInputValue(e.id+"_open",!1)})))}}),Shiny.inputBindings.register(w,"shinyWidgets.virtualSelectBinding")})()})(); \ No newline at end of file diff --git a/inst/packer/virtual-select.js.LICENSE.txt b/inst/packer/virtual-select.js.LICENSE.txt index ddb85246..6e28cac1 100644 --- a/inst/packer/virtual-select.js.LICENSE.txt +++ b/inst/packer/virtual-select.js.LICENSE.txt @@ -5,7 +5,7 @@ */ /*! - * Virtual Select v1.0.45 + * Virtual Select v1.0.46 * https://sa-si-dev.github.io/virtual-select * Licensed under MIT (https://github.com/sa-si-dev/virtual-select/blob/master/LICENSE) */ diff --git a/package-lock.json b/package-lock.json index bdbc7136..933ae634 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "slim-select": "^2.9.2", "style-loader": "^3.3.1", "vanilla-calendar-pro": "^2.9.10", - "virtual-select-plugin": "^1.0.45", + "virtual-select-plugin": "^1.0.46", "webpack": "^5.95.0", "webpack-cli": "^4.9.1", "webpack-merge": "^5.8.0", @@ -1593,9 +1593,9 @@ "dev": true }, "node_modules/virtual-select-plugin": { - "version": "1.0.45", - "resolved": "https://registry.npmjs.org/virtual-select-plugin/-/virtual-select-plugin-1.0.45.tgz", - "integrity": "sha512-mxpX/aCwqxkTBicRi75MipHbblR3YQQw/2Sd65uT5fcKKeGOGUzfp7IHwNHjbWbXgy8VwregjYM4qbUbCaENRA==", + "version": "1.0.46", + "resolved": "https://registry.npmjs.org/virtual-select-plugin/-/virtual-select-plugin-1.0.46.tgz", + "integrity": "sha512-9rTrHZs1HBgGioyVODfinjNQThRDT1NnrVq0fzBMwU+sBLwdNQrTUoFvh3up8+aKKNRJok0TAB9wNwT4njRWsg==", "dev": true, "dependencies": { "tooltip-plugin": "^1.0.16" @@ -2912,9 +2912,9 @@ "dev": true }, "virtual-select-plugin": { - "version": "1.0.45", - "resolved": "https://registry.npmjs.org/virtual-select-plugin/-/virtual-select-plugin-1.0.45.tgz", - "integrity": "sha512-mxpX/aCwqxkTBicRi75MipHbblR3YQQw/2Sd65uT5fcKKeGOGUzfp7IHwNHjbWbXgy8VwregjYM4qbUbCaENRA==", + "version": "1.0.46", + "resolved": "https://registry.npmjs.org/virtual-select-plugin/-/virtual-select-plugin-1.0.46.tgz", + "integrity": "sha512-9rTrHZs1HBgGioyVODfinjNQThRDT1NnrVq0fzBMwU+sBLwdNQrTUoFvh3up8+aKKNRJok0TAB9wNwT4njRWsg==", "dev": true, "requires": { "tooltip-plugin": "^1.0.16" diff --git a/package.json b/package.json index 20729f91..9c52516d 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "slim-select": "^2.9.2", "style-loader": "^3.3.1", "vanilla-calendar-pro": "^2.9.10", - "virtual-select-plugin": "^1.0.45", + "virtual-select-plugin": "^1.0.46", "webpack": "^5.95.0", "webpack-cli": "^4.9.1", "webpack-merge": "^5.8.0",