/*! * vue-treeselect v0.4.0 | (c) 2017-2019 Riophae Lee * Released under the MIT License. * https://vue-treeselect.js.org/ */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Vue")):"function"==typeof define&&define.amd?define(["Vue"],t):"object"==typeof exports?exports.VueTreeselect=t(require("Vue")):e.VueTreeselect=t(e.Vue)}(window,(function(e){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=36)}([function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t){var n=/^(attrs|props|on|nativeOn|class|style|hook)$/;function i(e,t){return function(){e&&e.apply(this,arguments),t&&t.apply(this,arguments)}}e.exports=function(e){return e.reduce((function(e,t){var r,o,s,a,l;for(s in t)if(r=e[s],o=t[s],r&&n.test(s))if("class"===s&&("string"==typeof r&&(l=r,e[s]=r={},r[l]=!0),"string"==typeof o&&(l=o,t[s]=o={},o[l]=!0)),"on"===s||"nativeOn"===s||"hook"===s)for(a in o)r[a]=i(r[a],o[a]);else if(Array.isArray(r))e[s]=r.concat(o);else if(Array.isArray(o))e[s]=[r].concat(o);else for(a in o)r[a]=o[a];else e[s]=t[s];return e}),{})}},function(e,t,n){var i=n(21),r=n(22),o=n(23);e.exports=function(e){return i(e)||r(e)||o()}},function(e,t){e.exports=function(){}},function(e,t,n){var i=n(5),r=n(24),o=n(7),s="Expected a function",a=Math.max,l=Math.min;e.exports=function(e,t,n){var c,u,d,h,f,p,v=0,m=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError(s);function S(t){var n=c,i=u;return c=u=void 0,v=t,h=e.apply(i,n)}function O(e){var n=e-p;return void 0===p||n>=t||n<0||g&&e-v>=d}function b(){var e=r();if(O(e))return _(e);f=setTimeout(b,function(e){var n=t-(e-p);return g?l(n,d-(e-v)):n}(e))}function _(e){return f=void 0,y&&c?S(e):(c=u=void 0,h)}function E(){var e=r(),n=O(e);if(c=arguments,u=this,p=e,n){if(void 0===f)return function(e){return v=e,f=setTimeout(b,t),m?S(e):h}(p);if(g)return clearTimeout(f),f=setTimeout(b,t),S(p)}return void 0===f&&(f=setTimeout(b,t)),h}return t=o(t)||0,i(n)&&(m=!!n.leading,d=(g="maxWait"in n)?a(o(n.maxWait)||0,t):d,y="trailing"in n?!!n.trailing:y),E.cancel=function(){void 0!==f&&clearTimeout(f),v=0,c=p=u=f=void 0},E.flush=function(){return void 0===f?h:_(r())},E}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var i=n(25),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();e.exports=o},function(e,t,n){var i=n(5),r=n(27),o=NaN,s=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(r(e))return o;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(s,"");var n=l.test(e);return n||c.test(e)?u(e.slice(2),n?2:8):a.test(e)?o:+e}},function(e,t,n){var i=n(6).Symbol;e.exports=i},function(e,t){e.exports=function(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}},function(e,t,n){var i=n(32);e.exports=function(e){return i(2,e)}},function(e,t){e.exports=function(e){return e}},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},function(e,t,n){var i=n(18),r=n(19),o=n(20);e.exports=function(e,t){return i(e)||r(e,t)||o()}},function(e,t,n){"use strict";e.exports=function(e,t){var n=t.length,i=e.length;if(i>n)return!1;if(i===n)return e===t;e:for(var r=0,o=0;r0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},function(e,t,n){var i=n(34);e.exports=function(e){var t=i(e),n=t%1;return t==t?n?t-n:t:0}},function(e,t,n){var i=n(7),r=1/0,o=17976931348623157e292;e.exports=function(e){return e?(e=i(e))===r||e===-r?(e<0?-1:1)*o:e==e?e:0:0===e?e:0}},function(e,t,n){},function(e,t,n){"use strict";n.r(t);var i=n(14),r=n.n(i),o=n(2),s=n.n(o),a=n(0),l=n.n(a),c=n(15),u=n.n(c),d=n(3),h=n.n(d).a;function f(e){return function(t){if("mousedown"===t.type&&0===t.button){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;rn.bottom?e.scrollTop=Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight):i.top-r0},single:function(){return!this.multiple},visibleOptionIds:function(){var e=this,t=[];return this.traverseAllNodesByIndex((function(n){if(e.localSearch.active&&!e.shouldOptionBeIncludedInSearchResult(n)||t.push(n.id),n.isBranch&&!e.shouldExpand(n))return!1})),t},hasVisibleOptions:function(){return 0!==this.visibleOptionIds.length},showCountOnSearchComputed:function(){return"boolean"==typeof this.showCountOnSearch?this.showCountOnSearch:this.showCount},hasBranchNodes:function(){return this.forest.normalizedOptions.some((function(e){return e.isBranch}))},shouldFlattenOptions:function(){return this.localSearch.active&&this.flattenSearchResults}},watch:{alwaysOpen:function(e){e?this.openMenu():this.closeMenu()},branchNodesFirst:function(){this.initialize()},disabled:function(e){e&&this.menu.isOpen?this.closeMenu():e||this.menu.isOpen||!this.alwaysOpen||this.openMenu()},flat:function(){this.initialize()},internalValue:function(e,t){Q(e,t)&&this.$emit("input",this.getValue(),this.getInstanceId())},matchKeys:function(){this.initialize()},multiple:function(e){e&&this.buildForestState()},options:{handler:function(){this.async||(this.initialize(),this.rootOptionsStates.isLoaded=Array.isArray(this.options))},deep:!0,immediate:!0},"trigger.searchQuery":function(){this.async?this.handleRemoteSearch():this.handleLocalSearch(),this.$emit("search-change",this.trigger.searchQuery,this.getInstanceId())},value:function(){var e=this.extractCheckedNodeIdsFromValue();Q(e,this.internalValue)&&this.fixSelectedNodeIds(e)}},methods:{verifyProps:function(){var e=this;if(h((function(){return!e.async||e.searchable}),(function(){return'For async search mode, the value of "searchable" prop must be true.'})),null!=this.options||this.loadOptions||h((function(){return!1}),(function(){return'Are you meant to dynamically load options? You need to use "loadOptions" prop.'})),this.flat&&h((function(){return e.multiple}),(function(){return'You are using flat mode. But you forgot to add "multiple=true"?'})),!this.flat){["autoSelectAncestors","autoSelectDescendants","autoDeselectAncestors","autoDeselectDescendants"].forEach((function(t){h((function(){return!e[t]}),(function(){return'"'.concat(t,'" only applies to flat mode.')}))}))}},resetFlags:function(){this._blurOnSelect=!1},initialize:function(){var e=this.async?this.getRemoteSearchEntry().options:this.options;if(Array.isArray(e)){var t=this.forest.nodeMap;this.forest.nodeMap=B(),this.keepDataOfSelectedNodes(t),this.forest.normalizedOptions=this.normalize(null,e,t),this.fixSelectedNodeIds(this.internalValue)}else this.forest.normalizedOptions=[]},getInstanceId:function(){return null==this.instanceId?this.id:this.instanceId},getValue:function(){var e=this;if("id"===this.valueFormat)return this.multiple?this.internalValue.slice():this.internalValue[0];var t=this.internalValue.map((function(t){return e.getNode(t).raw}));return this.multiple?t:t[0]},getNode:function(e){return h((function(){return null!=e}),(function(){return"Invalid node id: ".concat(e)})),null==e?null:e in this.forest.nodeMap?this.forest.nodeMap[e]:this.createFallbackNode(e)},createFallbackNode:function(e){var t=this.extractNodeFromValue(e),n={id:e,label:this.enhancedNormalizer(t).label||"".concat(e," (unknown)"),ancestors:[],parentNode:null,isFallbackNode:!0,isRootNode:!0,isLeaf:!0,isBranch:!1,isDisabled:!1,isNew:!1,index:[-1],level:0,raw:t};return this.$set(this.forest.nodeMap,e,n)},extractCheckedNodeIdsFromValue:function(){var e=this;return null==this.value?[]:"id"===this.valueFormat?this.multiple?this.value.slice():[this.value]:(this.multiple?this.value:[this.value]).map((function(t){return e.enhancedNormalizer(t)})).map((function(e){return e.id}))},extractNodeFromValue:function(e){var t=this,n={id:e};return"id"===this.valueFormat?n:W(this.multiple?Array.isArray(this.value)?this.value:[]:this.value?[this.value]:[],(function(n){return n&&t.enhancedNormalizer(n).id===e}))||n},fixSelectedNodeIds:function(e){var t=this,n=[];if(this.single||this.flat||this.disableBranchNodes||"ALL"===this.valueConsistsOf)n=e;else if("BRANCH_PRIORITY"===this.valueConsistsOf)e.forEach((function(e){n.push(e);var i=t.getNode(e);i.isBranch&&t.traverseDescendantsBFS(i,(function(e){n.push(e.id)}))}));else if("LEAF_PRIORITY"===this.valueConsistsOf)for(var i=B(),r=e.slice();r.length;){var o=r.shift(),s=this.getNode(o);n.push(o),s.isRootNode||(s.parentNode.id in i||(i[s.parentNode.id]=s.parentNode.children.length),0==--i[s.parentNode.id]&&r.push(s.parentNode.id))}else if("ALL_WITH_INDETERMINATE"===this.valueConsistsOf)for(var a=B(),l=e.filter((function(e){var n=t.getNode(e);return n.isLeaf||0===n.children.length}));l.length;){var c=l.shift(),u=this.getNode(c);n.push(c),u.isRootNode||(u.parentNode.id in a||(a[u.parentNode.id]=u.parentNode.children.length),0==--a[u.parentNode.id]&&l.push(u.parentNode.id))}Q(this.forest.selectedNodeIds,n)&&(this.forest.selectedNodeIds=n),this.buildForestState()},keepDataOfSelectedNodes:function(e){var t=this;this.forest.selectedNodeIds.forEach((function(n){if(e[n]){var i=ie({},e[n],{isFallbackNode:!0});t.$set(t.forest.nodeMap,n,i)}}))},isSelected:function(e){return!0===this.forest.selectedNodeMap[e.id]},traverseDescendantsBFS:function(e,t){if(e.isBranch)for(var n=e.children.slice();n.length;){var i=n[0];i.isBranch&&n.push.apply(n,s()(i.children)),t(i),n.shift()}},traverseDescendantsDFS:function(e,t){var n=this;e.isBranch&&e.children.forEach((function(e){n.traverseDescendantsDFS(e,t),t(e)}))},traverseAllNodesDFS:function(e){var t=this;this.forest.normalizedOptions.forEach((function(n){t.traverseDescendantsDFS(n,e),e(n)}))},traverseAllNodesByIndex:function(e){!function t(n){n.children.forEach((function(n){!1!==e(n)&&n.isBranch&&t(n)}))}({children:this.forest.normalizedOptions})},toggleClickOutsideEvent:function(e){e?document.addEventListener("mousedown",this.handleClickOutside,!1):document.removeEventListener("mousedown",this.handleClickOutside,!1)},getValueContainer:function(){return this.$refs.control.$refs["value-container"]},getInput:function(){return this.getValueContainer().$refs.input},focusInput:function(){this.getInput().focus()},blurInput:function(){this.getInput().blur()},handleMouseDown:f((function(e){(e.preventDefault(),e.stopPropagation(),this.disabled)||(this.getValueContainer().$el.contains(e.target)&&!this.menu.isOpen&&(this.openOnClick||this.trigger.isFocused)&&this.openMenu(),this._blurOnSelect?this.blurInput():this.focusInput(),this.resetFlags())})),handleClickOutside:function(e){this.$refs.wrapper&&!this.$refs.wrapper.contains(e.target)&&(this.blurInput(),this.closeMenu())},handleLocalSearch:function(){var e=this,t=this.trigger.searchQuery,n=function(){return e.resetHighlightedOptionWhenNecessary(!0)};if(!t)return this.localSearch.active=!1,n();this.localSearch.active=!0,this.localSearch.noResults=!0,this.traverseAllNodesDFS((function(t){var n;t.isBranch&&(t.isExpandedOnSearch=!1,t.showAllChildrenOnSearch=!1,t.isMatched=!1,t.hasMatchedDescendants=!1,e.$set(e.localSearch.countMap,t.id,(n={},l()(n,"ALL_CHILDREN",0),l()(n,"ALL_DESCENDANTS",0),l()(n,"LEAF_CHILDREN",0),l()(n,"LEAF_DESCENDANTS",0),n)))}));var i=t.trim().toLocaleLowerCase(),r=i.replace(/\s+/g," ").split(" ");this.traverseAllNodesDFS((function(t){e.searchNested&&r.length>1?t.isMatched=r.every((function(e){return oe(!1,e,t.nestedSearchLabel)})):t.isMatched=e.matchKeys.some((function(n){return oe(!e.disableFuzzyMatching,i,t.lowerCased[n])})),t.isMatched&&(e.localSearch.noResults=!1,t.ancestors.forEach((function(t){return e.localSearch.countMap[t.id].ALL_DESCENDANTS++})),t.isLeaf&&t.ancestors.forEach((function(t){return e.localSearch.countMap[t.id].LEAF_DESCENDANTS++})),null!==t.parentNode&&(e.localSearch.countMap[t.parentNode.id].ALL_CHILDREN+=1,t.isLeaf&&(e.localSearch.countMap[t.parentNode.id].LEAF_CHILDREN+=1))),(t.isMatched||t.isBranch&&t.isExpandedOnSearch)&&null!==t.parentNode&&(t.parentNode.isExpandedOnSearch=!0,t.parentNode.hasMatchedDescendants=!0)})),n()},handleRemoteSearch:function(){var e=this,t=this.trigger.searchQuery,n=this.getRemoteSearchEntry(),i=function(){e.initialize(),e.resetHighlightedOptionWhenNecessary(!0)};if((""===t||this.cacheOptions)&&n.isLoaded)return i();this.callLoadOptionsProp({action:"ASYNC_SEARCH",args:{searchQuery:t},isPending:function(){return n.isLoading},start:function(){n.isLoading=!0,n.isLoaded=!1,n.loadingError=""},succeed:function(r){n.isLoaded=!0,n.options=r,e.trigger.searchQuery===t&&i()},fail:function(e){n.loadingError=se(e)},end:function(){n.isLoading=!1}})},getRemoteSearchEntry:function(){var e=this,t=this.trigger.searchQuery,n=this.remoteSearch[t]||ie({},{isLoaded:!1,isLoading:!1,loadingError:""},{options:[]});if(this.$watch((function(){return n.options}),(function(){e.trigger.searchQuery===t&&e.initialize()}),{deep:!0}),""===t){if(Array.isArray(this.defaultOptions))return n.options=this.defaultOptions,n.isLoaded=!0,n;if(!0!==this.defaultOptions)return n.isLoaded=!0,n}return this.remoteSearch[t]||this.$set(this.remoteSearch,t,n),n},shouldExpand:function(e){return this.localSearch.active?e.isExpandedOnSearch:e.isExpanded},shouldOptionBeIncludedInSearchResult:function(e){return!!e.isMatched||(!(!e.isBranch||!e.hasMatchedDescendants||this.flattenSearchResults)||!(e.isRootNode||!e.parentNode.showAllChildrenOnSearch))},shouldShowOptionInMenu:function(e){return!(this.localSearch.active&&!this.shouldOptionBeIncludedInSearchResult(e))},getControl:function(){return this.$refs.control.$el},getMenu:function(){var e=(this.appendToBody?this.$refs.portal.portalTarget:this).$refs.menu.$refs.menu;return e&&"#comment"!==e.nodeName?e:null},setCurrentHighlightedOption:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.menu.current;if(null!=i&&i in this.forest.nodeMap&&(this.forest.nodeMap[i].isHighlighted=!1),this.menu.current=e.id,e.isHighlighted=!0,this.menu.isOpen&&n){var r=function(){var n=t.getMenu(),i=n.querySelector('.vue-treeselect__option[data-id="'.concat(e.id,'"]'));i&&p(n,i)};this.getMenu()?r():this.$nextTick(r)}},resetHighlightedOptionWhenNecessary:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.menu.current;!e&&null!=t&&t in this.forest.nodeMap&&this.shouldShowOptionInMenu(this.getNode(t))||this.highlightFirstOption()},highlightFirstOption:function(){if(this.hasVisibleOptions){var e=this.visibleOptionIds[0];this.setCurrentHighlightedOption(this.getNode(e))}},highlightPrevOption:function(){if(this.hasVisibleOptions){var e=this.visibleOptionIds.indexOf(this.menu.current)-1;if(-1===e)return this.highlightLastOption();this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[e]))}},highlightNextOption:function(){if(this.hasVisibleOptions){var e=this.visibleOptionIds.indexOf(this.menu.current)+1;if(e===this.visibleOptionIds.length)return this.highlightFirstOption();this.setCurrentHighlightedOption(this.getNode(this.visibleOptionIds[e]))}},highlightLastOption:function(){if(this.hasVisibleOptions){var e=P()(this.visibleOptionIds);this.setCurrentHighlightedOption(this.getNode(e))}},resetSearchQuery:function(){this.trigger.searchQuery=""},closeMenu:function(){!this.menu.isOpen||!this.disabled&&this.alwaysOpen||(this.saveMenuScrollPosition(),this.menu.isOpen=!1,this.toggleClickOutsideEvent(!1),this.resetSearchQuery(),this.$emit("close",this.getValue(),this.getInstanceId()))},openMenu:function(){this.disabled||this.menu.isOpen||(this.menu.isOpen=!0,this.$nextTick(this.resetHighlightedOptionWhenNecessary),this.$nextTick(this.restoreMenuScrollPosition),this.options||this.async||this.loadRootOptions(),this.toggleClickOutsideEvent(!0),this.$emit("open",this.getInstanceId()))},toggleMenu:function(){this.menu.isOpen?this.closeMenu():this.openMenu()},toggleExpanded:function(e){var t;this.localSearch.active?(t=e.isExpandedOnSearch=!e.isExpandedOnSearch)&&(e.showAllChildrenOnSearch=!0):t=e.isExpanded=!e.isExpanded,t&&!e.childrenStates.isLoaded&&this.loadChildrenOptions(e)},buildForestState:function(){var e=this,t=B();this.forest.selectedNodeIds.forEach((function(e){t[e]=!0})),this.forest.selectedNodeMap=t;var n=B();this.multiple&&(this.traverseAllNodesByIndex((function(e){n[e.id]=0})),this.selectedNodes.forEach((function(t){n[t.id]=2,e.flat||e.disableBranchNodes||t.ancestors.forEach((function(t){e.isSelected(t)||(n[t.id]=1)}))}))),this.forest.checkedStateMap=n},enhancedNormalizer:function(e){return ie({},e,{},this.normalizer(e,this.getInstanceId()))},normalize:function(e,t,n){var i=this,o=t.map((function(e){return[i.enhancedNormalizer(e),e]})).map((function(t,o){var s=r()(t,2),a=s[0],c=s[1];i.checkDuplication(a),i.verifyNodeShape(a);var u=a.id,d=a.label,f=a.children,p=a.isDefaultExpanded,v=null===e,m=v?0:e.level+1,g=Array.isArray(f)||null===f,y=!g,S=!!a.isDisabled||!i.flat&&!v&&e.isDisabled,O=!!a.isNew,b=i.matchKeys.reduce((function(e,t){return ie({},e,l()({},t,(n=a[t],"string"==typeof n?n:"number"!=typeof n||w(n)?"":n+"").toLocaleLowerCase()));var n}),{}),_=v?b.label:e.nestedSearchLabel+" "+b.label,E=i.$set(i.forest.nodeMap,u,B());if(i.$set(E,"id",u),i.$set(E,"label",d),i.$set(E,"level",m),i.$set(E,"ancestors",v?[]:[e].concat(e.ancestors)),i.$set(E,"index",(v?[]:e.index).concat(o)),i.$set(E,"parentNode",e),i.$set(E,"lowerCased",b),i.$set(E,"nestedSearchLabel",_),i.$set(E,"isDisabled",S),i.$set(E,"isNew",O),i.$set(E,"isMatched",!1),i.$set(E,"isHighlighted",!1),i.$set(E,"isBranch",g),i.$set(E,"isLeaf",y),i.$set(E,"isRootNode",v),i.$set(E,"raw",c),g){var N,L=Array.isArray(f);i.$set(E,"childrenStates",ie({},{isLoaded:!1,isLoading:!1,loadingError:""},{isLoaded:L})),i.$set(E,"isExpanded","boolean"==typeof p?p:mo+40,c=a>o+40;r.top>=0&&r.top<=s||r.top<0&&r.bottom>0?"auto"!==e.openDirection?e.menu.placement=Pe[e.openDirection]:e.menu.placement=l||!c?"bottom":"top":e.closeMenu()}},setupMenuSizeWatcher:function(){var e=this.instance.getMenu();this.menuSizeWatcher||(this.menuSizeWatcher={remove:N(e,this.adjustMenuOpenDirection)})},setupMenuResizeAndScrollEventListeners:function(){var e=this.instance.getControl();this.menuResizeAndScrollEventListeners||(this.menuResizeAndScrollEventListeners={remove:x(e,this.adjustMenuOpenDirection)})},removeMenuSizeWatcher:function(){this.menuSizeWatcher&&(this.menuSizeWatcher.remove(),this.menuSizeWatcher=null)},removeMenuResizeAndScrollEventListeners:function(){this.menuResizeAndScrollEventListeners&&(this.menuResizeAndScrollEventListeners.remove(),this.menuResizeAndScrollEventListeners=null)}},render:function(){var e=arguments[0];return e("div",{ref:"menu-container",class:"vue-treeselect__menu-container",style:this.menuContainerStyle},[e("transition",{attrs:{name:"vue-treeselect__menu--transition"}},[this.renderMenu()])])}},void 0,void 0,!1,null,null,null);He.options.__file="src/components/Menu.vue";var We=He.exports,Qe=n(17),Ye=n.n(Qe);function qe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}var Ke,Xe={name:"vue-treeselect--portal-target",inject:["instance"],watch:{"instance.menu.isOpen":function(e){e?this.setupHandlers():this.removeHandlers()},"instance.menu.placement":function(){this.updateMenuContainerOffset()}},created:function(){this.controlResizeAndScrollEventListeners=null,this.controlSizeWatcher=null},mounted:function(){this.instance.menu.isOpen&&this.setupHandlers()},methods:{setupHandlers:function(){this.updateWidth(),this.updateMenuContainerOffset(),this.setupControlResizeAndScrollEventListeners(),this.setupControlSizeWatcher()},removeHandlers:function(){this.removeControlResizeAndScrollEventListeners(),this.removeControlSizeWatcher()},setupControlResizeAndScrollEventListeners:function(){var e=this.instance.getControl();this.controlResizeAndScrollEventListeners||(this.controlResizeAndScrollEventListeners={remove:x(e,this.updateMenuContainerOffset)})},setupControlSizeWatcher:function(){var e=this,t=this.instance.getControl();this.controlSizeWatcher||(this.controlSizeWatcher={remove:N(t,(function(){e.updateWidth(),e.updateMenuContainerOffset()}))})},removeControlResizeAndScrollEventListeners:function(){this.controlResizeAndScrollEventListeners&&(this.controlResizeAndScrollEventListeners.remove(),this.controlResizeAndScrollEventListeners=null)},removeControlSizeWatcher:function(){this.controlSizeWatcher&&(this.controlSizeWatcher.remove(),this.controlSizeWatcher=null)},updateWidth:function(){var e=this.instance,t=this.$el,n=e.getControl().getBoundingClientRect();t.style.width=n.width+"px"},updateMenuContainerOffset:function(){var e=this.instance,t=e.getControl(),n=this.$el,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),o="bottom"===e.menu.placement?i.height:0,s=Math.round(i.left-r.left)+"px",a=Math.round(i.top-r.top+o)+"px";this.$refs.menu.$refs["menu-container"].style[W(["transform","webkitTransform","MozTransform","msTransform"],(function(e){return e in document.body.style}))]="translate(".concat(s,", ").concat(a,")")}},render:function(){var e=arguments[0],t=this.instance,n=["vue-treeselect__portal-target",t.wrapperClass],i={zIndex:t.zIndex};return e("div",{class:n,style:i,attrs:{"data-instance-id":t.getInstanceId()}},[e(We,{ref:"menu"})])},destroyed:function(){this.removeHandlers()}},Ue=ue({name:"vue-treeselect--menu-portal",created:function(){this.portalTarget=null},mounted:function(){this.setup()},destroyed:function(){this.teardown()},methods:{setup:function(){var e=document.createElement("div");document.body.appendChild(e),this.portalTarget=new Ye.a(function(e){for(var t=1;t