1function _typeof(a){"@babel/helpers - typeof";_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(b){return typeof b}:function(b){return b&&"function"===typeof Symbol&&b.constructor===Symbol&&b!==Symbol.prototype?"symbol":typeof b};return _typeof(a)} 2function _extends(){_extends=Object.assign||function(a){for(var b=1;b<arguments.length;b++){var d=arguments[b],c;for(c in d)Object.prototype.hasOwnProperty.call(d,c)&&(a[c]=d[c])}return a};return _extends.apply(this,arguments)}function ownKeys(a,b){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(a);b&&(c=c.filter(function(f){return Object.getOwnPropertyDescriptor(a,f).enumerable}));d.push.apply(d,c)}return d} 3function _objectSpread(a){for(var b=1;b<arguments.length;b++){var d=null!=arguments[b]?arguments[b]:{};b%2?ownKeys(Object(d),!0).forEach(function(c){_defineProperty(a,c,d[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):ownKeys(Object(d)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(d,c))})}return a} 4function _defineProperty(a,b,d){b in a?Object.defineProperty(a,b,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[b]=d;return a}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");} 5function _unsupportedIterableToArray(a,b){if(a){if("string"===typeof a)return _arrayLikeToArray(a,b);var d=Object.prototype.toString.call(a).slice(8,-1);"Object"===d&&a.constructor&&(d=a.constructor.name);if("Map"===d||"Set"===d)return Array.from(a);if("Arguments"===d||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return _arrayLikeToArray(a,b)}}function _iterableToArray(a){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(a))return Array.from(a)} 6function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _arrayLikeToArray(a,b){if(null==b||b>a.length)b=a.length;for(var d=0,c=Array(b);d<b;d++)c[d]=a[d];return c}function asyncGeneratorStep(a,b,d,c,f,g,h){try{var e=a[g](h),k=e.value}catch(l){d(l);return}e.done?b(k):Promise.resolve(k).then(c,f)} 7function _asyncToGenerator(a){return function(){var b=this,d=arguments;return new Promise(function(c,f){function g(k){asyncGeneratorStep(e,c,f,g,h,"next",k)}function h(k){asyncGeneratorStep(e,c,f,g,h,"throw",k)}var e=a.apply(b,d);g(void 0)})}} 8Vue.component("multiselect",{data:function(){return{showDropdown:null,allOptions:[],selectedOptions:[],inputValue:"",translatedLabel:this.getString(this.label),translatedPlaceholder:this.getString(this.placeholder),filledInData:!1}},model:{prop:"selected",event:"input"},template:'\x3cdiv v-click-outside\x3d"clickOutside" class\x3d"multi-select-wrapper form-control" :class\x3d"{\'show\': showDropdown, \'hide\': showDropdown \x3d\x3d\x3d false, \'active\': selectedOptions.length \x3e 0, \'no-p-left\': noPaddingLeft}" :aria-label\x3d"ariaLabel"\x3e\n \x3ch4 v-if\x3d"label \x26\x26 showLabel" class\x3d"h4 label" :id\x3d"translatedLabel"\x3e{{translatedLabel}}\x3c/h4\x3e\n \x3cdiv class\x3d"dropdown-wrapper"\x3e\n \x3cinput type\x3d"text" class\x3d"input-hide" :value\x3d"getValue" :name\x3d"name"/\x3e\n \x3cinput type\x3d"text" autocomplete\x3d"on" v-model\x3d"inputValue" @click\x3d"toggleDropdown" :placeholder\x3d"showDropdown ? \'\' : translatedPlaceholder" class\x3d"textbox" :class\x3d"{\'has-left-icon\': showLeftIcon}" :aria-describedby\x3d"ariaDescribedby" tabindex\x3d"-1"/\x3e\n \x3cbutton @click\x3d"toggleDropdown" type\x3d"button" class\x3d"dropdown-btn left-button" v-if\x3d"showLeftIcon" tabindex\x3d"0" :aria-label\x3d"getAriaLabel()"\x3e\n \x3cslot\x3e\x3c/slot\x3e\n \x3c/button\x3e\n \x3cbutton type\x3d"button" @click\x3d"toggleDropdown" class\x3d"dropdown-btn" v-if\x3d"!showLeftIcon" :aria-label\x3d"getAriaLabel()" tabindex\x3d"0"\x3e\x3cspan class\x3d"icon icon-dropdown"\x3e\x3c/span\x3e\x3c/button\x3e\n \x3cdiv class\x3d"dropdown-listbox" v-if\x3d"allOptions.length !\x3d 0" :aria-hidden\x3d"[!showDropdown]" @keydown\x3d"trapFocus"\x3e\n \x3cdiv class\x3d"dropdown-listbox-content" v-if\x3d"showDropdown"\x3e\n \x3cdiv class\x3d"top-control"\x3e\n \x3cdiv class\x3d"head"\x3e\n \x3ch2 class\x3d"h1-s color-white" :id\x3d"getString(placeholder)"\x3e{{getString(placeholder)}}\x3c/h2\x3e\n \x3cbutton class\x3d"arrow-button" type\x3d"button" @click\x3d"toggleDropdown" :aria-label\x3d"getString(\'Hide overlay\')" :tabindex\x3d"showDropdown ? 0 : -1"\x3e\x3cspan class\x3d"icon icon-right-arrow-white"\x3e\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"actions"\x3e\n \x3cbutton class\x3d"control-btn paragraph-s" type\x3d"button" @click\x3d"selectAll" :tabindex\x3d"showDropdown ? 0 : -1"\x3e{{getString(\'Select all\')}}\x3c/button\x3e\n \x3cspan class\x3d"slash paragraph-s"\x3e/\x3c/span\x3e\n \x3cbutton class\x3d"control-btn paragraph-s" type\x3d"button" @click\x3d"deselectAll" :tabindex\x3d"showDropdown ? 0 : -1"\x3e{{getString(\'Deselect all\')}}\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"list-options" role\x3d"group" :aria-labelledby\x3d"getString(placeholder)"\x3e\n \x3cdiv class\x3d"option" v-for\x3d"(item, index) in filteredAllOptions" :key\x3d"index"\x3e \n \x3cinput :id\x3d"name + item.value" class\x3d"checkbox" type\x3d"checkbox" v-model\x3d"item.tick" :checked\x3d"item.tick" tabindex\x3d"-1"/\x3e\n \x3clabel :for\x3d"name + item.value" class\x3d"label" @click.prevent\x3d"nestedOptions ? selectAllChildren(item) : chooseItem(item, $event)" :tabindex\x3d"showDropdown ? 0 : -1" @keydown.enter.prevent\x3d"nestedOptions ? selectAllChildren(item) : chooseItem(item)"\x3e{{item.text}} \x3cspan v-if\x3d"item.total"\x3e({{item.total}}) \x3c/span\x3e\x3c/label\x3e \n \x3ctemplate v-if\x3d"item.filteredChildren \x26\x26 nestedOptions"\x3e\n \x3cdiv class\x3d"child-option" v-for\x3d"(child, childIndex) in item.filteredChildren" :key\x3d"childIndex"\x3e \n \x3cinput :id\x3d"name + child.value" class\x3d"checkbox" type\x3d"checkbox" v-model\x3d"child.tick" :checked\x3d"child.tick" tabindex\x3d"-1"/\x3e\n \x3clabel :for\x3d"name + child.value" class\x3d"label" @click.prevent\x3d"chooseItem(child, item, $event)" :tabindex\x3d"showDropdown ? 0 : -1" @keydown.enter.prevent\x3d"chooseItem(child, item)" \x3e{{child.text}} \x3cspan v-if\x3d"child.total"\x3e({{child.total}}) \x3c/span\x3e\x3c/label\x3e\n \x3c/div\x3e\n \x3c/template\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv v-else class\x3d"dropdown-listbox" :aria-hidden\x3d"[!showDropdown]"\x3e\n \x3cdiv class\x3d"dropdown-listbox-content"\x3e\n \x3cdiv class\x3d"top-control"\x3e\n \x3cdiv class\x3d"head"\x3e\n \x3ch2 class\x3d"h1-s color-white"\x3e{{getString(placeholder)}}\x3c/h2\x3e\n \x3cbutton type\x3d"button" class\x3d"arrow-button" @click\x3d"toggleDropdown" :aria-label\x3d"getString(\'Hide overlay\')" :tabindex\x3d"showDropdown ? 0 : -1"\x3e\x3cspan class\x3d"icon icon-right-arrow-white"\x3e\x3c/span\x3e\x3c/button\x3e\n \x3c/div\x3e\n \x3cdiv class\x3d"actions"\x3e\n \x3cbutton class\x3d"control-btn paragraph-s" type\x3d"button" @click\x3d"selectAll" :tabindex\x3d"showDropdown ? 0 : -1"\x3e{{getString(\'Select all\')}}\x3c/button\x3e\n \x3cspan class\x3d"slash paragraph-s"\x3e/\x3c/span\x3e\n \x3cbutton class\x3d"control-btn paragraph-s" type\x3d"button" @click\x3d"deselectAll" :tabindex\x3d"showDropdown ? 0 : -1"\x3e{{getString(\'Deselect all\')}}\x3c/button\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv v-if\x3d"showDropdown \x26\x26 allOptions.length \x3d\x3d\x3d 0" class\x3d"list-options no-options"\x3e\n \x3cspan class\x3d"color-white"\x3e \n {{getString(\'There is no option\')}}\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3cdiv v-if\x3d"showResults \x26\x26 selectedOptions.length \x3e 0" class\x3d"result-box m-xs-top"\x3e\n \x3cdiv v-for\x3d"(option, index) in selectedOptions" class\x3d"result-item infotext"\x3e\n \x3cspan\x3e{{option.text}}\x3c/span\x3e \n \x3cspan class\x3d"icon icon-times-white" @click\x3d"removeItem(option)"\x3e\n \x3cspan class\x3d"path1"\x3e\x3c/span\x3e\x3cspan class\x3d"path2"\x3e\x3c/span\x3e\x3cspan class\x3d"path3"\x3e\x3c/span\x3e\x3cspan class\x3d"path4"\x3e\x3c/span\x3e\n \x3c/span\x3e\n \x3c/div\x3e\n \x3c/div\x3e\n \x3c/div\x3e', 9computed:{getValue:function(){return this.selectedOptions&&this.selectedOptions.map(function(a){return a.value}).join(",")},filteredAllOptions:function(){var a=this,b=function(d){return-1!==d.text.toLowerCase().indexOf(a.inputValue.toLowerCase())};return this.allOptions.reduce(function g(c,f){var h=b(f),e=f.children&&f.children.some(b);f.children&&(f.filteredChildren=f.children.reduce(g,[]));(h||e)&&c.push(f);return c},[])}},methods:{onBlur:function(){this.$emit("blur")},toggleDropdown:function(){(this.showDropdown= 10!this.showDropdown)&&1280>
10=window.innerWidth?VueBus.preventBodyScroll():VueBus.allowBodyScroll()},updateTick:function(a,b){a.tick!==b&&this.$set(a,"tick",b)},chooseItem:function(a,b){var d=arguments,c=this;return _asyncToGenerator(regeneratorRuntime.mark(function g(){var h,e;return regeneratorRuntime.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return(h=2<d.length&&void 0!==d[2]?d[2]:null)&&h.preventDefault(),c.selectedOptions||(c.selectedOptions=[]),e=c.selectedOptions.findIndex(function(l){return l.value=== 11a.value}),-1===e?(c.updateTick(a,!0),c.selectedOptions.push(a)):(c.updateTick(a,!1),c.selectedOptions.splice(e,1),b&&c.updateTick(b,!1)),k.next=7,c.$nextTick();case 7:c.settingPlaceholder(),c.returnValueOnly?(c.$emit("input",c.selectedOptions.map(function(l){return l.value})),c.$emit("change",c.selectedOptions.map(function(l){return l.value}))):(c.$emit("input",c.selectedOptions),c.$emit("change",c.selectedOptions));case 9:case "end":return k.stop()}},g)}))()},removeItem:function(a){var b=this.selectedOptions.findIndex(function(e){return e.value=== 12a.value}),d=this.allOptions.findIndex(function(e){return e.value===a.value}),c;if(-1===d)for(var f=0;f<this.allOptions.length;f++){var g=this.allOptions[f];if(g.children){var h=g.children.findIndex(function(e){return e.value===a.value});-1!==h&&(c=f)}}this.selectedOptions[b].tick=!1;-1===d?(this.allOptions[c].children[h]=!1,this.allOptions[c].tick=!1):this.allOptions[d].tick=!1;this.selectedOptions.splice(b,1);this.settingPlaceholder();this.$emit("input",this.selectedOptions);this.$emit("change", 13this.selectedOptions)},clickOutside:function(){this.showDropdown&&1280<window.innerWidth&&(this.showDropdown=!1,VueBus.allowBodyScroll())},setAllOptions:function(a){this.allOptions.forEach(function(b){b.tick=a;b.children&&b.children.forEach(function(d){d.tick=a})})},selectAll:function(){this.selectedOptions=[].concat(_toConsumableArray(this.allOptions),_toConsumableArray(this.allOptions.flatMap(function(a){return a.children||[]})));this.returnValueOnly?(this.$emit("input",this.selectedOptions.map(function(a){return a.value})), 14this.$emit("change",this.selectedOptions.map(function(a){return a.value}))):(this.$emit("input",this.selectedOptions),this.$emit("change",this.selectedOptions));this.setAllOptions(!0);this.settingPlaceholder()},deselectAll:function(){this.selectedOptions.splice(0,this.selectedOptions.length);this.$emit("input",[]);this.$emit("change",this.selectedOptions);this.setAllOptions(!1);this.settingPlaceholder()},handleEscape:function(a){this.showDropdown&&"Escape"===a.key&&(this.showDropdown=!1)},trapFocus:function(a){if(this.showDropdown){var b= 15this.$el.querySelector(".dropdown-listbox-content");if(b){var d=b.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex\x3d"-1"])');if(0!==d.length){var c=1280<window.innerWidth?d[1]:d[0];d=d[d.length-1];var f="Tab"===a.key;"Tab"===a.key&&(a.shiftKey&&document.activeElement===c?(d.focus(),a.preventDefault()):a.shiftKey||document.activeElement!==d||(c.focus(),a.preventDefault()));f||this.labelsNavigation(b,a)}}}},labelsNavigation:function(a,b){a=a.querySelectorAll("label"); 16if(0!==a.length){a=Array.from(a);var d=a.indexOf(document.activeElement);if("ArrowDown"===b.key||"ArrowRight"===b.key){var c=(d+1)%a.length;a[c].focus();b.preventDefault()}if("ArrowUp"===b.key||"ArrowLeft"===b.key)c=(d-1+a.length)%a.length,a[c].focus(),b.preventDefault()}},selectAllChildren:function(a){var b=this;return _asyncToGenerator(regeneratorRuntime.mark(function c(){var f,g;return regeneratorRuntime.wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return(f=a.tick)?(a.tick=!1,a.children&& 17a.children.forEach(function(e){e.tick=!1}),b.selectedOptions=b.selectedOptions.filter(function(e){return e.value!==a.value&&!(a.children&&a.children.some(function(k){return k.value===e.value}))})):(a.tick=!0,a.children&&a.children.forEach(function(e){e.tick=!0;b.selectedOptions.some(function(k){return k.value===e.value})||b.selectedOptions.push(e)}),(g=b.selectedOptions.some(function(e){return e.value===a.value}))||b.selectedOptions.push(a)),b.$forceUpdate(),h.next=5,b.$nextTick();case 5:b.settingPlaceholder(), 18b.$emit("input",b.selectedOptions),b.$emit("change",b.selectedOptions);case 8:case "end":return h.stop()}},c)}))()},getString:function(a){return Granite.I18n.get(a)},handleOptions:function(){var a=this;this.allOptions=this.options.filter(function(b){return b.value}).map(function(b){var d=a.selected&&!!a.selected.some(function(c){return c.value===b.value});b.children&&(b.children=_toConsumableArray(b.children.filter(function(c){return c.value}).map(function(c){var f=!!a.selected.some(function(g){return g.value=== 19c.value});return c=_objectSpread(_objectSpread({},c),{},{tick:f})})));return _extends({},b,{tick:d})});this.allOptions=this.sorting?this.sort(this.allOptions):this.allOptions;this.selectedOptions=this.allOptions.filter(function(b){return!0===b.tick});this.allOptions.forEach(function(b){b.children&&b.children.length&&b.children.forEac
19h(function(d){d.tick&&a.selectedOptions.push(d)})});this.selectedOption&&0<this.selectedOption.length&&this.$emit("input",this.selectedOptions)},mountedData:function(){var a= 20this;this.apiUrl?findCountryContactService.getDropdownDataByUrl(this.apiUrl).then(function(b){a.allOptions=a.sorting?a.sort(b.data):a.res.data;a.handleOptions()}):(this.allOptions=this.options.filter(function(b){return b.value}).map(function(b){var d=a.selected&&a.selected.some(function(c){return"object"===_typeof(c)?c.value===b.value:c===b.value})?!0:!1;return _extends({},b,{tick:d})}),this.handleOptions());this.settingPlaceholder()},settingPlaceholder:function(){switch(this.selectedOptions.length){case 0:this.translatedPlaceholder= 21this.getString(this.placeholder);break;case 1:this.translatedPlaceholder=this.selectedOptions[0].text;break;default:this.translatedPlaceholder=this.getString(this.translatedLabel)+" (".concat(this.selectedOptions.length,")")}this.selectedOptions.length===this.allOptions.length&&this.selectedOptions.length&&(this.translatedPlaceholder=this.getString(this.placeholder)+" (".concat(this.allLabel,")"))},sort:function(a){return a.length?a.sort(function(b,d){b=b.text&&b.text.toUpperCase();d=d.text&&d.text.toUpperCase(); 22return b<d?-1:b>d?1:0}):[]},getAriaLabel:function(){var a="";if(this.ariaLabelledby){var b=document.getElementById(this.ariaLabelledby);b&&(a=b.textContent.trim())}else a=this.ariaLabel?this.ariaLabel:this.translatedLabel;b="function"===typeof this.getValue?this.getValue():this.getValue;return this.selectedOptions.length?"".concat(a,": ").concat(decodeURIComponent(b)):a}},props:{label:String,name:String,showLabel:{type:Boolean,"default":!0},apiUrl:{type:String,"default":""},allLabel:{type:String, 23"default":Granite.I18n.get("All")},placeholder:{type:String,"default":Granite.I18n.get("Select option")},options:{type:Array,"default":function(){return[]}},nestedOptions:!1,selected:{type:Array,"default":[]},showLeftIcon:{type:Boolean},noPaddingLeft:{type:Boolean,"default":!1},ariaLabel:{type:String,"default":""},sorting:{type:Boolean,"default":!1},showResults:{type:Boolean,"default":!1},returnValueOnly:{type:Boolean,"default":!1},isForm:{type:Boolean,"default":!1},ariaLabelledby:{type:String,required:!1}, 24ariaDescribedby:{type:String,required:!1}},watch:{options:function(a,b){this.isForm?this.isForm&&a&&b&&JSON.stringify(a)!==JSON.stringify(b)&&this.mountedData():this.mountedData()}},unmounted:function(){window.removeEventListener("keydown",this.handleEscape)},mounted:function(){this.mountedData();window.addEventListener("keydown",this.handleEscape)},updated:function(){var a=this;this.filledInData||(this.filledInData=!0,this.selectedOptions=this.selected,this.selectedOptions.length&&this.selectedOptions.forEach(function(b){a.allOptions.forEach(function f(c){c.id=== 25b.id?c.tick=!0:c.children&&(c.children.forEach(f),c.children.every(function(g){return g.tick})&&(c.tick=!0))})}))}});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.