!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{var n=r();for(var t in n)("object"==typeof exports?exports:e)[t]=n[t]}}(window,(function(){return function(e){var r={};function n(t){if(r[t])return r[t].exports;var o=r[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=r,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},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,r){if(1&r&&(e=n(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(n.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)n.d(t,o,function(r){return e[r]}.bind(null,o));return t},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.p="./",n(n.s=18)}({18:function(e,r,n){"use strict";n.r(r),n.d(r,"isAncestor",(function(){return t})),n.d(r,"listToTree",(function(){return o})),n.d(r,"treeToList",(function(){return i})),n.d(r,"getTreeLabelByValue",(function(){return u}));var t=function e(r,n,t){return void 0===t&&(t=function(e,r){return e.id===r.id}),!!(n&&n.id&&r.children&&r.children.length)&&r.children.some((function(r){return!!t(r,n)||!(!r.children||!r.children.length)&&e(r,n)}))},o=function(e,r){var n=r||{},t=n.key,o=void 0===t?"id":t,i=n.parent,u=void 0===i?"parentId":i,l=n.children,c=void 0===l?"children":l,f=e.reduce((function(e,r){return e[r[o]]=r,r[c]=[],e}),{});return e.filter((function(e){return f[e[u]]&&f[e[u]][c].push(e),!e[u]}))},i=function e(r,n){return void 0===n&&(n=[]),r.forEach((function(r){n.push(r),r.children&&e(r.children,n)})),n},u=function(e){var r,n=e.tree,t=e.value,o=e.labelKey,i=void 0===o?"name":o,u=e.valueKey,l=void 0===u?"code":u,c=e.childrenKey;return function e(n){var t=n.tree,o=n.value,i=n.labelKey,u=n.valueKey,l=n.childrenKey;if(!Array.isArray(t))return!1;for(var c=0;c<t.length;c++){var f=t[c];if(f[u]===o&&!f[l])return r=f[i];f[l]&&Array.isArray(f[l])&&e({tree:f[l],value:o,labelKey:i,valueKey:u,childrenKey:l})}}({tree:n,value:t,labelKey:i,valueKey:l,childrenKey:void 0===c?"children":c}),r}}})}));
//# sourceMappingURL=tree.js.map