react-dropdown-tree-select
Version:
Lightweight, customizable and fast Dropdown Tree Select component for React
2 lines • 76.2 kB
JavaScript
/*! For license information please see react-dropdown-tree-select.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactDropdownTreeSelect",["react"],t):"object"==typeof exports?exports.ReactDropdownTreeSelect=t(require("react")):e.ReactDropdownTreeSelect=t(e.React)}(this,(e=>(()=>{var t={865:e=>{"use strict";e.exports=function(e,t){var r=e.filter(t);return 0!==r.length&&r.length!==e.length}},703:(e,t,r)=>{"use strict";var n=r(414);function o(){}function i(){}i.resetWarningCache=o,e.exports=function(){function e(e,t,r,o,i,a){if(a!==n){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:o};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},385:function(e,t,r){var n;n=function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=t,r.p="",r(0)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=r(8),c=i(a),l=i(r(6)),u=i(r(2)),s=r(1),f=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var o=e,i=t,a=r;n=!1,null===o&&(o=Function.prototype);var c=Object.getOwnPropertyDescriptor(o,i);if(void 0!==c){if("value"in c)return c.value;var l=c.get;if(void 0===l)return;return l.call(a)}var u=Object.getPrototypeOf(o);if(null===u)return;e=u,t=i,r=a,n=!0,c=u=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this.state={showLoader:!1,lastScrollTop:0,actionTriggered:!1,pullToRefreshThresholdBreached:!1},this.startY=0,this.currentY=0,this.dragging=!1,this.maxPullDownDistance=0,this.onScrollListener=this.onScrollListener.bind(this),this.throttledOnScrollListener=(0,u.default)(this.onScrollListener,150).bind(this),this.onStart=this.onStart.bind(this),this.onMove=this.onMove.bind(this),this.onEnd=this.onEnd.bind(this),this.getScrollableTarget=this.getScrollableTarget.bind(this)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"componentDidMount",value:function(){if(this._scrollableNode=this.getScrollableTarget(),this.el=this.props.height?this._infScroll:this._scrollableNode||window,this.el.addEventListener("scroll",this.throttledOnScrollListener),"number"==typeof this.props.initialScrollY&&this.el.scrollHeight>this.props.initialScrollY&&this.el.scrollTo(0,this.props.initialScrollY),this.props.pullDownToRefresh&&(this.el.addEventListener("touchstart",this.onStart),this.el.addEventListener("touchmove",this.onMove),this.el.addEventListener("touchend",this.onEnd),this.el.addEventListener("mousedown",this.onStart),this.el.addEventListener("mousemove",this.onMove),this.el.addEventListener("mouseup",this.onEnd),this.maxPullDownDistance=this._pullDown.firstChild.getBoundingClientRect().height,this.forceUpdate(),"function"!=typeof this.props.refreshFunction))throw new Error('Mandatory prop "refreshFunction" missing.\n Pull Down To Refresh functionality will not work\n as expected. Check README.md for usage\'')}},{key:"componentWillUnmount",value:function(){this.el.removeEventListener("scroll",this.throttledOnScrollListener),this.props.pullDownToRefresh&&(this.el.removeEventListener("touchstart",this.onStart),this.el.removeEventListener("touchmove",this.onMove),this.el.removeEventListener("touchend",this.onEnd),this.el.removeEventListener("mousedown",this.onStart),this.el.removeEventListener("mousemove",this.onMove),this.el.removeEventListener("mouseup",this.onEnd))}},{key:"componentWillReceiveProps",value:function(e){this.props.key===e.key&&this.props.dataLength===e.dataLength||this.setState({showLoader:!1,actionTriggered:!1,pullToRefreshThresholdBreached:!1})}},{key:"getScrollableTarget",value:function(){return this.props.scrollableTarget instanceof HTMLElement?this.props.scrollableTarget:"string"==typeof this.props.scrollableTarget?document.getElementById(this.props.scrollableTarget):(null===this.props.scrollableTarget&&console.warn("You are trying to pass scrollableTarget but it is null. This might\n happen because the element may not have been added to DOM yet.\n See https://github.com/ankeetmaini/react-infinite-scroll-component/issues/59 for more info.\n "),null)}},{key:"onStart",value:function(e){this.state.lastScrollTop||(this.dragging=!0,this.startY=e.pageY||e.touches[0].pageY,this.currentY=this.startY,this._infScroll.style.willChange="transform",this._infScroll.style.transition="transform 0.2s cubic-bezier(0,0,0.31,1)")}},{key:"onMove",value:function(e){this.dragging&&(this.currentY=e.pageY||e.touches[0].pageY,this.currentY<this.startY||(this.currentY-this.startY>=this.props.pullDownToRefreshThreshold&&this.setState({pullToRefreshThresholdBreached:!0}),this.currentY-this.startY>1.5*this.maxPullDownDistance||(this._infScroll.style.overflow="visible",this._infScroll.style.transform="translate3d(0px, "+(this.currentY-this.startY)+"px, 0px)")))}},{key:"onEnd",value:function(e){var t=this;this.startY=0,this.currentY=0,this.dragging=!1,this.state.pullToRefreshThresholdBreached&&this.props.refreshFunction&&this.props.refreshFunction(),requestAnimationFrame((function(){t._infScroll&&(t._infScroll.style.overflow="auto",t._infScroll.style.transform="none",t._infScroll.style.willChange="none")}))}},{key:"isElementAtBottom",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?.8:arguments[1],r=e===document.body||e===document.documentElement?window.screen.availHeight:e.clientHeight,n=(0,s.parseThreshold)(t);return n.unit===s.ThresholdUnits.Pixel?e.scrollTop+r>=e.scrollHeight-n.value:e.scrollTop+r>=n.value/100*e.scrollHeight}},{key:"onScrollListener",value:function(e){var t=this;"function"==typeof this.props.onScroll&&setTimeout((function(){return t.props.onScroll(e)}),0);var r=this.props.height||this._scrollableNode?e.target:document.documentElement.scrollTop?document.documentElement:document.body;this.state.actionTriggered||(this.isElementAtBottom(r,this.props.scrollThreshold)&&this.props.hasMore&&(this.setState({actionTriggered:!0,showLoader:!0}),this.props.next()),this.setState({lastScrollTop:r.scrollTop}))}},{key:"render",value:function(){var e=this,t=n({height:this.props.height||"auto",overflow:"auto",WebkitOverflowScrolling:"touch"},this.props.style),r=this.props.hasChildren||!(!this.props.children||!this.props.children.length),o=this.props.pullDownToRefresh&&this.props.height?{overflow:"auto"}:{};return c.default.createElement("div",{style:o},c.default.createElement("div",{className:"infinite-scroll-component "+(this.props.className||""),ref:function(t){return e._infScroll=t},style:t},this.props.pullDownToRefresh&&c.default.createElement("div",{style:{position:"relative"},ref:function(t){return e._pullDown=t}},c.default.createElement("div",{style:{position:"absolute",left:0,right:0,top:-1*this.maxPullDownDistance}},!this.state.pullToRefreshThresholdBreached&&this.props.pullDownToRefreshContent,this.state.pullToRefreshThresholdBreached&&this.props.releaseToRefreshContent)),this.props.children,!this.state.showLoader&&!r&&this.props.hasMore&&this.props.loader,this.state.showLoader&&this.props.hasMore&&this.props.loader,!this.props.hasMore&&this.props.endMessage))}}]),t}(a.Component);t.default=f,f.defaultProps={pullDownToRefreshContent:c.default.createElement("h3",null,"Pull down to refresh"),releaseToRefreshContent:c.default.createElement("h3",null,"Release to refresh"),pullDownToRefreshThreshold:100,disableBrowserPullToRefresh:!0},f.propTypes={next:l.default.func,hasMore:l.default.bool,children:l.default.node,loader:l.default.node.isRequired,scrollThreshold:l.default.oneOfType([l.default.number,l.default.string]),endMessage:l.default.node,style:l.default.object,height:l.default.number,scrollableTarget:l.default.node,hasChildren:l.default.bool,pullDownToRefresh:l.default.bool,pullDownToRefreshContent:l.default.node,releaseToRefreshContent:l.default.node,pullDownToRefreshThreshold:l.default.number,refreshFunction:l.default.func,onScroll:l.default.func,dataLength:l.default.number.isRequired,key:l.default.string},e.exports=t.default},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseThreshold=function(e){return"number"==typeof e?{unit:r.Percent,value:100*e}:"string"==typeof e?e.match(/^(\d*(\.\d+)?)px$/)?{unit:r.Pixel,value:parseFloat(e)}:e.match(/^(\d*(\.\d+)?)%$/)?{unit:r.Percent,value:parseFloat(e)}:(console.warn('scrollThreshold format is invalid. Valid formats: "120px", "50%"...'),n):(console.warn("scrollThreshold should be string or number"),n)};var r={Pixel:"Pixel",Percent:"Percent"};t.ThresholdUnits=r;var n={unit:r.Percent,value:.8}},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r){var n,o;return t||(t=250),function(){var i=r||this,a=+new Date,c=arguments;n&&a<n+t?(clearTimeout(o),o=setTimeout((function(){n=a,e.apply(i,c)}),t)):(n=a,e.apply(i,c))}},e.exports=t.default},function(e,t){"use strict";function r(e){return function(){return e}}var n=function(){};n.thatReturns=r,n.thatReturnsFalse=r(!1),n.thatReturnsTrue=r(!0),n.thatReturnsNull=r(null),n.thatReturnsThis=function(){return this},n.thatReturnsArgument=function(e){return e},e.exports=n},function(e,t,r){"use strict";e.exports=function(e,t,r,n,o,i,a,c){if(!e){var l;if(void 0===t)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,o,i,a,c],s=0;(l=new Error(t.replace(/%s/g,(function(){return u[s++]})))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(e,t,r){"use strict";var n=r(3),o=r(4),i=r(7);e.exports=function(){function e(e,t,r,n,a,c){c!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t};return r.checkPropTypes=n,r.PropTypes=r,r}},function(e,t,r){e.exports=r(5)()},function(e,t){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,r){t.exports=e}])},e.exports=n(r(787))},787:t=>{"use strict";t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{default:()=>Cr});var e=n(697),t=n.n(e),r=n(787),i=n.n(r),a=function(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()};const c=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,r){return t["data-".concat(a(r))]=e[r],t}),{})},l=function(e){return!e||Array.isArray(e)&&!e.length};var u,s;const f=("rdts",u=1,s=new WeakMap,{get:function(e){return s.has(e)||s.set(e,u++),"".concat("rdts").concat(s.get(e))},reset:function(){s=new WeakMap,u=1}}),p=function(e,t,r){if(Array.prototype.findIndex)return e.findIndex(t,r);if(!e)throw new TypeError("findIndex called on null or undefined");if("function"!=typeof t)throw new TypeError("findIndex predicate must be a function");for(var n=0;n<e.length;n++){var o=e[n];if(t.call(r,o,n,e))return n}return-1};function d(e,t){var r=function(e){return e?"#"===e[0]?{"aria-labelledby":e.substring(1).replace(/ #/g," ")}:{"aria-label":e}:{}}(e);return t&&(r["aria-labelledby"]="".concat(r["aria-labelledby"]||""," ").concat(t).trim()),r}function h(e){return h="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},h(e)}function y(){return y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},y.apply(this,arguments)}function b(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function g(e,t){return g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},g(e,t)}function v(e,t){if(t&&("object"===h(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return m(e)}function m(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O(e){return O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},O(e)}function w(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var P=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&g(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=O(n);if(o){var r=O(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return v(this,e)});function c(e){var t,r,n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),w(m(t=a.call(this,e)),"handleInputChange",(function(e){e.persist(),t.delayedCallback(e)})),t.delayedCallback=(r=function(e){return t.props.onInputChange(e.target.value)},300,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i=function(){n=null,r.apply(void 0,t)},a=!n;clearTimeout(n),n=setTimeout(i,300),a&&r.apply(void 0,t)}),t}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.inputRef,r=e.texts,n=void 0===r?{}:r,o=e.onFocus,a=e.onBlur,c=e.disabled,l=e.readOnly,u=e.onKeyDown,s=e.activeDescendant,f=e.inlineSearchInput;return i().createElement("input",y({type:"text",disabled:c,ref:t,className:"search",placeholder:f?n.inlineSearchPlaceholder||"Search...":n.placeholder||"Choose...",onKeyDown:u,onChange:this.handleInputChange,onFocus:o,onBlur:a,readOnly:l,"aria-activedescendant":s,"aria-autocomplete":u?"list":void 0},d(n.label)))}}])&&b(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);w(P,"propTypes",{tags:t().array,texts:t().object,onInputChange:t().func,onFocus:t().func,onBlur:t().func,onTagRemove:t().func,onKeyDown:t().func,inputRef:t().func,disabled:t().bool,readOnly:t().bool,activeDescendant:t().string,inlineSearchInput:t().bool});const S=P;function j(e){return j="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},j(e)}function k(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function T(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _(e,t){return _=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},_(e,t)}function E(e,t){if(t&&("object"===j(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return C(e)}function C(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function x(e){return x=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},x(e)}function R(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var N=function(e){return"".concat(e,"_tag")},D=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=x(n);if(o){var r=x(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return E(this,e)});function c(){var e;k(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return R(C(e=a.call.apply(a,[this].concat(r))),"handleClick",(function(t){var r=e.props,n=r.id,o=r.onDelete;t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),o(n,void 0!==(t.key||t.keyCode))})),R(C(e),"onKeyDown",(function(t){"Backspace"===t.key&&(e.handleClick(t),t.preventDefault())})),R(C(e),"onKeyUp",(function(t){(32===t.keyCode||["Delete","Enter"].indexOf(t.key)>-1)&&(e.handleClick(t),t.preventDefault())})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.id,r=e.label,n=e.labelRemove,o=void 0===n?"Remove":n,a=e.readOnly,c=e.disabled,l=N(t),u="".concat(t,"_button"),s=["tag-remove",a&&"readOnly",c&&"disabled"].filter(Boolean).join(" "),f=a||c;return i().createElement("span",{className:"tag",id:l,"aria-label":r},r,i().createElement("button",{id:u,onClick:f?void 0:this.handleClick,onKeyDown:f?void 0:this.onKeyDown,onKeyUp:f?void 0:this.onKeyUp,className:s,type:"button","aria-label":o,"aria-labelledby":"".concat(u," ").concat(l),"aria-disabled":f},"x"))}}])&&T(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);R(D,"propTypes",{id:t().string.isRequired,label:t().string.isRequired,onDelete:t().func,readOnly:t().bool,disabled:t().bool,labelRemove:t().string});const I=D;function M(e){return M="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},M(e)}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function A(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function F(e,t){return F=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},F(e,t)}function L(e,t){if(t&&("object"===M(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function V(e){return V=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},V(e)}function Y(){return Y=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Y.apply(this,arguments)}var K,q,U,H=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&F(e,t)}(l,e);var t,r,n,o,a=(n=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=V(n);if(o){var r=V(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return L(this,e)});function l(){return B(this,l),a.apply(this,arguments)}return t=l,r=[{key:"render",value:function(){var e=this.props,t=e.tags,r=e.onTagRemove,n=e.texts,o=void 0===n?{}:n,a=e.disabled,l=e.readOnly,u=e.children||i().createElement("span",{className:"placeholder"},o.placeholder||"Choose...");return i().createElement("ul",{className:"tag-list"},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return e.map((function(e){var a=e._id,l=e.label,u=e.tagClassName,s=e.dataset,f=e.tagLabel;return i().createElement("li",Y({className:["tag-item",u].filter(Boolean).join(" "),key:"tag-item-".concat(a)},c(s)),i().createElement(I,{label:f||l,id:a,onDelete:t,readOnly:r,disabled:n||e.disabled,labelRemove:o}))}))}(t,r,l,a,o.labelRemove),i().createElement("li",{className:"tag-item"},u))}}],r&&A(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.PureComponent);K=H,q="propTypes",U={tags:t().array,onTagRemove:t().func,readOnly:t().bool,disabled:t().bool,texts:t().object,children:t().node},q in K?Object.defineProperty(K,q,{value:U,enumerable:!0,configurable:!0,writable:!0}):K[q]=U;const W=H;function z(e){return z="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},z(e)}function $(){return $=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$.apply(this,arguments)}function J(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?J(Object(r),!0).forEach((function(t){ne(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function G(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Q(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function X(e,t){return X=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},X(e,t)}function ee(e,t){if(t&&("object"===z(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return te(e)}function te(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function re(e){return re=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},re(e)}function ne(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var oe=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&X(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=re(n);if(o){var r=re(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ee(this,e)});function c(){var e;G(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ne(te(e=a.call.apply(a,[this].concat(r))),"getAriaAttributes",(function(){var t=e.props,r=t.mode,n=t.texts,o=void 0===n?{}:n,i=t.showDropdown,a=t.clientId,c=t.tags,l="".concat(a,"_trigger"),u=[],s=d(o.label);return c&&c.length&&(s["aria-label"]&&u.push(l),c.forEach((function(e){u.push(N(e._id))})),s=d(o.label,u.join(" "))),Z({id:l,role:"button",tabIndex:e.props.tabIndex,"aria-haspopup":"simpleSelect"===r?"listbox":"tree","aria-expanded":i?"true":"false"},s)})),ne(te(e),"handleTrigger",(function(t){t.key&&13!==t.keyCode&&32!==t.keyCode&&40!==t.keyCode||t.key&&e.triggerNode&&e.triggerNode!==document.activeElement||(e.props.showDropdown||32!==t.keyCode||t.preventDefault(),e.props.onTrigger(t))})),e}return t=c,(r=[{key:"render",value:function(){var e=this,t=this.props,r=t.disabled,n=t.readOnly,o=t.showDropdown,a=["dropdown-trigger","arrow",r&&"disabled",n&&"readOnly",o&&"top",!o&&"bottom"].filter(Boolean).join(" ");return i().createElement("a",$({ref:function(t){e.triggerNode=t},className:a,onClick:r?void 0:this.handleTrigger,onKeyDown:r?void 0:this.handleTrigger},this.getAriaAttributes()),this.props.children)}}])&&Q(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);ne(oe,"propTypes",{onTrigger:t().func,disabled:t().bool,readOnly:t().bool,showDropdown:t().bool,mode:t().oneOf(["multiSelect","simpleSelect","radioSelect","hierarchical"]),texts:t().object,clientId:t().string,tags:t().array,tabIndex:t().number});const ie=oe;var ae=n(385),ce=n.n(ae);function le(e){return le="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},le(e)}function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function se(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fe(e,t){return fe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},fe(e,t)}function pe(e,t){if(t&&("object"===le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return de(e)}function de(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function he(e){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},he(e)}function ye(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var be=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fe(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=he(n);if(o){var r=he(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return pe(this,e)});function c(){var e;ue(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ye(de(e=a.call.apply(a,[this].concat(r))),"handleClick",(function(){var t=e.props,r=t.onAction,n=t.actionData;r&&r(n.nodeId,n.action)})),e}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.title,r=e.className,n=e.text,o=e.readOnly;return i().createElement("i",{title:t,className:r,onClick:o?void 0:this.handleClick},n)}}])&&se(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);ye(be,"propTypes",{title:t().string,text:t().string,className:t().string,actionData:t().object,onAction:t().func,readOnly:t().bool}),ye(be,"defaultProps",{onAction:function(){}});const ge=be;function ve(e){return ve="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},ve(e)}var me=["actions","id"];function Oe(){return Oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oe.apply(this,arguments)}function we(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?we(Object(r),!0).forEach((function(t){Ee(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):we(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function je(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ke(e,t){return ke=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ke(e,t)}function Te(e,t){if(t&&("object"===ve(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _e(e){return _e=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_e(e)}function Ee(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ce=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ke(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_e(n);if(o){var r=_e(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Te(this,e)});function c(){return Se(this,c),a.apply(this,arguments)}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.actions,r=e.id,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,me);return l(t)?null:t.map((function(e,t){var o=e.id||"action-".concat(t);return i().createElement(ge,Oe({key:o},n,e,{actionData:{action:Pe(Pe({},e),{},{id:o}),nodeId:r}}))}))}}])&&je(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);Ee(Ce,"propTypes",{id:t().string.isRequired,actions:t().array});const xe=Ce;function Re(e){return Re="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},Re(e)}var Ne=["checked","indeterminate","onChange","disabled","readOnly"];function De(){return De=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},De.apply(this,arguments)}function Ie(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Me(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Be(e,t){return Be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Be(e,t)}function Ae(e,t){if(t&&("object"===Re(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Fe(e){return Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Fe(e)}var Le=function(e){var t=e.checked,r=e.indeterminate;return function(e){e&&(e.checked=t,e.indeterminate=r)}},Ve=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Be(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Fe(n);if(o){var r=Fe(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Ae(this,e)});function c(){return Ie(this,c),a.apply(this,arguments)}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.checked,r=e.indeterminate,n=void 0!==r&&r,o=e.onChange,a=e.disabled,c=e.readOnly,l=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Ne),u=a||c;return i().createElement("input",De({type:"checkbox",ref:Le({checked:t,indeterminate:n}),onChange:o,disabled:u},l))}}])&&Me(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Ve,"propTypes",{checked:t().bool,indeterminate:t().bool,onChange:t().func,disabled:t().bool,readOnly:t().bool});const Ye=Ve;function Ke(e){return Ke="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},Ke(e)}var qe=["name","checked","onChange","disabled","readOnly"];function Ue(){return Ue=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ue.apply(this,arguments)}function He(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ze(e,t){return ze=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},ze(e,t)}function $e(e,t){if(t&&("object"===Ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Je(e){return Je=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},Je(e)}var Ze=function(e){var t=e.checked;return function(e){e&&(e.checked=t)}},Ge=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ze(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Je(n);if(o){var r=Je(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return $e(this,e)});function c(){return He(this,c),a.apply(this,arguments)}return t=c,(r=[{key:"render",value:function(){var e=this.props,t=e.name,r=e.checked,n=e.onChange,o=e.disabled,a=e.readOnly,c=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,qe),l=o||a;return i().createElement("input",Ue({type:"radio",name:t,ref:Ze({checked:r}),onChange:n,disabled:l},c))}}])&&We(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);!function(e,t,r){t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}(Ge,"propTypes",{name:t().string.isRequired,checked:t().bool,onChange:t().func,disabled:t().bool,readOnly:t().bool});const Qe=Ge;function Xe(e){return Xe="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},Xe(e)}function et(){return et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},et.apply(this,arguments)}function tt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function nt(e,t){return nt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},nt(e,t)}function ot(e,t){if(t&&("object"===Xe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return it(e)}function it(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},at(e)}function ct(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var lt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&nt(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=at(n);if(o){var r=at(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ot(this,e)});function c(){var e;tt(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return ct(it(e=a.call.apply(a,[this].concat(r))),"handleCheckboxChange",(function(t){var r=e.props,n=r.mode,o=r.id,i=r.onCheckboxChange;i(o,"simpleSelect"===n||"radioSelect"===n||t.target.checked),t.stopPropagation(),t.nativeEvent.stopImmediatePropagation()})),e}return t=c,r=[{key:"render",value:function(){var e=this.props,t=e.mode,r=e.title,n=e.label,o=e.id,a=e.partial,c=e.checked,l=this.props,u=l.value,s=l.disabled,f=l.showPartiallySelected,p=l.readOnly,d=l.clientId,h={className:"node-label"};"simpleSelect"===t&&!p&&!s&&(h.onClick=this.handleCheckboxChange);var y={id:o,value:u,checked:c,disabled:s,readOnly:p,tabIndex:-1},b=["checkbox-item","simpleSelect"===t&&"simple-select"].filter(Boolean).join(" ");return i().createElement("label",{title:r||n,htmlFor:o},"radioSelect"===t?i().createElement(Qe,et({name:d,className:"radio-item",onChange:this.handleCheckboxChange},y)):i().createElement(Ye,et({name:o,className:b,indeterminate:f&&a,onChange:this.handleCheckboxChange},y)),i().createElement("span",h,n))}}],r&&rt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);ct(lt,"propTypes",{id:t().string.isRequired,actions:t().array,title:t().string,label:t().string.isRequired,value:t().string.isRequired,checked:t().bool,partial:t().bool,disabled:t().bool,dataset:t().object,mode:t().oneOf(["multiSelect","simpleSelect","radioSelect","hierarchical"]),showPartiallySelected:t().bool,onCheckboxChange:t().func,readOnly:t().bool,clientId:t().string});const ut=lt;function st(e){return st="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},st(e)}function ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dt(e,t){return dt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},dt(e,t)}function ht(e,t){if(t&&("object"===st(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return yt(e)}function yt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function bt(e){return bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},bt(e)}function gt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var vt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&dt(e,t)}(c,e);var t,r,n,o,a=(n=c,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=bt(n);if(o){var r=bt(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return ht(this,e)});function c(){var e;ft(this,c);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return gt(yt(e=a.call.apply(a,[this].concat(r))),"onToggle",(function(t){t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.props.onNodeToggle(e.props.id)})),gt(yt(e),"onKeyDown",(function(t){"Enter"!==t.key&&32!==t.keyCode||(e.props.onNodeToggle(e.props.id),t.preventDefault())})),e}return t=c,r=[{key:"render",value:function(){var e=this.props,t=e.expanded,r=e.isLeaf,n=["toggle",t&&"expanded",!t&&"collapsed"].filter(Boolean).join(" ");return r?i().createElement("i",{role:"button",tabIndex:-1,className:n,style:{visibility:"hidden"},"aria-hidden":!0}):i().createElement("i",{role:"button",tabIndex:-1,className:n,onClick:this.onToggle,onKeyDown:this.onKeyDown,"aria-hidden":!0})}}],r&&pt(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),c}(r.PureComponent);gt(vt,"propTypes",{expanded:t().bool,isLeaf:t().bool,onNodeToggle:t().func,id:t().string});const mt=vt;function Ot(e){return Ot="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},Ot(e)}function wt(){return wt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wt.apply(this,arguments)}function Pt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function St(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function jt(e,t){return jt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},jt(e,t)}function kt(e,t){if(t&&("object"===Ot(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Tt(e)}function Tt(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _t(e){return _t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},_t(e)}function Et(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Ct=function(e){return l(e)},xt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jt(e,t)}(l,e);var t,r,n,o,a=(n=l,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=_t(n);if(o){var r=_t(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return kt(this,e)});function l(){var e;Pt(this,l);for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return Et(Tt(e=a.call.apply(a,[this].concat(r))),"getAriaAttributes",(function(){var t=e.props,r=t._children,n=t._depth,o=t.checked,i=t.disabled,a=t.expanded,c=t.readOnly,l=t.mode,u=t.partial,s={};return s.role="simpleSelect"===l?"option":"treeitem",s["aria-disabled"]=i||c,s["aria-selected"]=o,"simpleSelect"!==l&&(s["aria-checked"]=u?"mixed":o,s["aria-level"]=(n||0)+1,s["aria-expanded"]=r&&(a?"true":"false")),s})),e}return t=l,r=[{key:"render",value:function(){var e=this.props,t=e.mode,r=e.keepTreeOnSearch,n=e._id,o=e._children,a=e.dataset,l=e._depth,u=e.expanded,s=e.title,f=e.label,p=e.partial,d=e.checked,h=e.value,y=e.disabled,b=e.actions,g=e.onAction,v=e.searchModeOn,m=e.onNodeToggle,O=e.onCheckboxChange,w=e.showPartiallySelected,P=e.readOnly,S=e.clientId,j=function(e){var t=e.keepTreeOnSearch,r=e.keepChildrenOnSearch,n=e._children,o=e.matchInChildren,i=e.matchInParent,a=e.disabled,c=e.partial,l=e.hide,u=e.className,s=e.showPartiallySelected,f=e.readOnly,p=e.checked,d=e._focused;return["node",Ct(n)&&"leaf",!Ct(n)&&"tree",a&&"disabled",l&&"hide",t&&o&&"match-in-children",t&&r&&i&&"match-in-parent",s&&c&&"partial",f&&"readOnly",p&&"checked",d&&"focused",u].filter(Boolean).join(" ")}(this.props),k=r||!v?{paddingLeft:"".concat(20*(l||0),"px")}:{},T="".concat(n,"_li");return i().createElement("li",wt({className:j,style:k,id:T},c(a),this.getAriaAttributes()),i().createElement(mt,{isLeaf:Ct(o),ex