@jledentu/vue-finder
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -0,1 +1,8 @@ | ||
## [2.1.2](https://github.com/jledentu/vue-finder/compare/v2.1.1...v2.1.2) (2023-05-05) | ||
### Performance Improvements | ||
* avoid update when expanding same node ([#207](https://github.com/jledentu/vue-finder/issues/207)) ([87b859e](https://github.com/jledentu/vue-finder/commit/87b859e99ffef1434724d9a2a206e1a02ee5fb90)) | ||
## [2.1.1](https://github.com/jledentu/vue-finder/compare/v2.1.0...v2.1.1) (2023-03-31) | ||
@@ -2,0 +9,0 @@ |
@@ -25,2 +25,2 @@ /** | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self)["vue-finder"]={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t=t&&t.hasOwnProperty("default")?t.default:t;var h="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,g=h||v||Function("return this")(),b=g.Symbol,y=Object.prototype,m=y.hasOwnProperty,_=y.toString,j=b?b.toStringTag:void 0;var O=Object.prototype.toString;var w=b?b.toStringTag:void 0;function D(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=m.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=_.call(e);return r&&(t?e[j]=n:delete e[j]),o}(e):function(e){return O.call(e)}(e)}function x(e){return null!=e&&"object"==typeof e}function C(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==D(e)}function M(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var E=Array.isArray,S=b?b.prototype:void 0,A=S?S.toString:void 0;function k(e){if("string"==typeof e)return e;if(E(e))return M(e,k)+"";if(C(e))return A?A.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function T(e){return e}function F(e){if(!N(e))return!1;var t=D(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var P,I=g["__core-js_shared__"],$=(P=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"";var B=Function.prototype.toString;function z(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var L=/^\[object .+?Constructor\]$/,V=Function.prototype,R=Object.prototype,W=V.toString,H=R.hasOwnProperty,Z=RegExp("^"+W.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(e){return!(!N(e)||(t=e,$&&$ in t))&&(F(e)?Z:L).test(z(e));var t}function U(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return q(n)?n:void 0}var G=U(g,"WeakMap");function X(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var J=Date.now;var K,Q,Y,ee=function(){try{var e=U(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=(K=ee?function(e,t){return ee(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:T,Q=0,Y=0,function(){var e=J(),t=16-(e-Y);if(Y=e,t>0){if(++Q>=800)return arguments[0]}else Q=0;return K.apply(void 0,arguments)});function ne(e){return e!=e}function re(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ne,n)}(e,t,0)>-1}var oe=/^(?:0|[1-9]\d*)$/;function ie(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t){return e===t||e!=e&&t!=t}var ue=Math.max;function de(e,t){return te(function(e,t,n){return t=ue(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=ue(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=r[o];return u[t]=n(a),X(e,this,u)}}(e,t,T),e+"")}function se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ce(e){return null!=e&&se(e.length)&&!F(e)}var le=Object.prototype;function fe(e){return x(e)&&"[object Arguments]"==D(e)}var pe=Object.prototype,he=pe.hasOwnProperty,ve=pe.propertyIsEnumerable,ge=fe(function(){return arguments}())?fe:function(e){return x(e)&&he.call(e,"callee")&&!ve.call(e,"callee")};var be="object"==typeof e&&e&&!e.nodeType&&e,ye=be&&"object"==typeof module&&module&&!module.nodeType&&module,me=ye&&ye.exports===be?g.Buffer:void 0,_e=(me?me.isBuffer:void 0)||function(){return!1},je={};function Oe(e){return function(t){return e(t)}}je["[object Float32Array]"]=je["[object Float64Array]"]=je["[object Int8Array]"]=je["[object Int16Array]"]=je["[object Int32Array]"]=je["[object Uint8Array]"]=je["[object Uint8ClampedArray]"]=je["[object Uint16Array]"]=je["[object Uint32Array]"]=!0,je["[object Arguments]"]=je["[object Array]"]=je["[object ArrayBuffer]"]=je["[object Boolean]"]=je["[object DataView]"]=je["[object Date]"]=je["[object Error]"]=je["[object Function]"]=je["[object Map]"]=je["[object Number]"]=je["[object Object]"]=je["[object RegExp]"]=je["[object Set]"]=je["[object String]"]=je["[object WeakMap]"]=!1;var we="object"==typeof e&&e&&!e.nodeType&&e,De=we&&"object"==typeof module&&module&&!module.nodeType&&module,xe=De&&De.exports===we&&h.process,Ce=function(){try{var e=De&&De.require&&De.require("util").types;return e||xe&&xe.binding&&xe.binding("util")}catch(e){}}(),Me=Ce&&Ce.isTypedArray,Ee=Me?Oe(Me):function(e){return x(e)&&se(e.length)&&!!je[D(e)]},Se=Object.prototype.hasOwnProperty;function Ae(e,t){var n=E(e),r=!n&&ge(e),o=!n&&!r&&_e(e),i=!n&&!r&&!o&&Ee(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],d=u.length;for(var s in e)!t&&!Se.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ie(s,d))||u.push(s);return u}var ke=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Ne=Object.prototype.hasOwnProperty;function Te(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||le))return ke(e);var t,n,r=[];for(var o in Object(e))Ne.call(e,o)&&"constructor"!=o&&r.push(o);return r}function Fe(e){return ce(e)?Ae(e):Te(e)}var Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/;function $e(e,t){if(E(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!C(e))||(Ie.test(e)||!Pe.test(e)||null!=t&&e in Object(t))}var Be=U(Object,"create");var ze=Object.prototype.hasOwnProperty;var Le=Object.prototype.hasOwnProperty;function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e,t){for(var n=e.length;n--;)if(ae(e[n][0],t))return n;return-1}Ve.prototype.clear=function(){this.__data__=Be?Be(null):{},this.size=0},Ve.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ve.prototype.get=function(e){var t=this.__data__;if(Be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ze.call(t,e)?t[e]:void 0},Ve.prototype.has=function(e){var t=this.__data__;return Be?void 0!==t[e]:Le.call(t,e)},Ve.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Be&&void 0===t?"__lodash_hash_undefined__":t,this};var We=Array.prototype.splice;function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=Re(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=Re(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return Re(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=Re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ze=U(g,"Map");function qe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ue.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ze||He),string:new Ve}},Ue.prototype.delete=function(e){var t=qe(this,e).delete(e);return this.size-=t?1:0,t},Ue.prototype.get=function(e){return qe(this,e).get(e)},Ue.prototype.has=function(e){return qe(this,e).has(e)},Ue.prototype.set=function(e,t){var n=qe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ge(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ge.Cache||Ue),n}Ge.Cache=Ue;var Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Je=/\\(\\)?/g,Ke=function(e){var t=Ge(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xe,(function(e,n,r,o){t.push(r?o.replace(Je,"$1"):n||e)})),t}));function Qe(e,t){return E(e)?e:$e(e,t)?[e]:Ke(function(e){return null==e?"":k(e)}(e))}function Ye(e){if("string"==typeof e||C(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Qe(t,e)).length;null!=e&&n<r;)e=e[Ye(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var rt=b?b.isConcatSpreadable:void 0;function ot(e){return E(e)||ge(e)||!!(rt&&e&&e[rt])}function it(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ot),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?it(u,t-1,n,r,o):nt(o,u):r||(o[o.length]=u)}return o}function at(e){var t=this.__data__=new He(e);this.size=t.size}at.prototype.clear=function(){this.__data__=new He,this.size=0},at.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},at.prototype.get=function(e){return this.__data__.get(e)},at.prototype.has=function(e){return this.__data__.has(e)},at.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!Ze||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ue(r)}return n.set(e,t),this.size=n.size,this};var ut=Object.prototype.propertyIsEnumerable,dt=Object.getOwnPropertySymbols,st=dt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(dt(e),(function(t){return ut.call(e,t)})))}:function(){return[]};function ct(e){return function(e,t,n){var r=t(e);return E(e)?r:nt(r,n(e))}(e,Fe,st)}var lt=U(g,"DataView"),ft=U(g,"Promise"),pt=U(g,"Set"),ht=z(lt),vt=z(Ze),gt=z(ft),bt=z(pt),yt=z(G),mt=D;(lt&&"[object DataView]"!=mt(new lt(new ArrayBuffer(1)))||Ze&&"[object Map]"!=mt(new Ze)||ft&&"[object Promise]"!=mt(ft.resolve())||pt&&"[object Set]"!=mt(new pt)||G&&"[object WeakMap]"!=mt(new G))&&(mt=function(e){var t=D(e),n="[object Object]"==t?e.constructor:void 0,r=n?z(n):"";if(r)switch(r){case ht:return"[object DataView]";case vt:return"[object Map]";case gt:return"[object Promise]";case bt:return"[object Set]";case yt:return"[object WeakMap]"}return t});var _t=mt,jt=g.Uint8Array;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ue;++t<n;)this.add(e[t])}function wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Dt(e,t){return e.has(t)}Ot.prototype.add=Ot.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ot.prototype.has=function(e){return this.__data__.has(e)};function xt(e,t,n,r,o,i){var a=1&n,u=e.length,d=t.length;if(u!=d&&!(a&&d>u))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var l=-1,f=!0,p=2&n?new Ot:void 0;for(i.set(e,t),i.set(t,e);++l<u;){var h=e[l],v=t[l];if(r)var g=a?r(v,h,l,t,e,i):r(h,v,l,e,t,i);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!wt(t,(function(e,t){if(!Dt(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){f=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Ct(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Mt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Et=b?b.prototype:void 0,St=Et?Et.valueOf:void 0;var At=Object.prototype.hasOwnProperty;var kt=Object.prototype.hasOwnProperty;function Nt(e,t,n,r,o,i){var a=E(e),u=E(t),d=a?"[object Array]":_t(e),s=u?"[object Array]":_t(t),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),l="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),f=d==s;if(f&&_e(e)){if(!_e(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new at),a||Ee(e)?xt(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new jt(e),new jt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=Ct;case"[object Set]":var d=1&r;if(u||(u=Mt),e.size!=t.size&&!d)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var c=xt(u(e),u(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(St)return St.call(e)==St.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var p=c&&kt.call(e,"__wrapped__"),h=l&&kt.call(t,"__wrapped__");if(p||h){var v=p?e.value():e,g=h?t.value():t;return i||(i=new at),o(v,g,n,r,i)}}return!!f&&(i||(i=new at),function(e,t,n,r,o,i){var a=1&n,u=ct(e),d=u.length;if(d!=ct(t).length&&!a)return!1;for(var s=d;s--;){var c=u[s];if(!(a?c in t:At.call(t,c)))return!1}var l=i.get(e),f=i.get(t);if(l&&f)return l==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++s<d;){var v=e[c=u[s]],g=t[c];if(r)var b=a?r(g,v,c,t,e,i):r(v,g,c,e,t,i);if(!(void 0===b?v===g||o(v,g,n,r,i):b)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var y=e.constructor,m=t.constructor;y!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))}function Tt(e,t,n,r,o){return e===t||(null==e||null==t||!x(e)&&!x(t)?e!=e&&t!=t:Nt(e,t,n,r,Tt,o))}function Ft(e){return e==e&&!N(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function It(e){var t=function(e){for(var t=Fe(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ft(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var d=(u=n[o])[0],s=e[d],c=u[1];if(a&&u[2]){if(void 0===s&&!(d in e))return!1}else{var l=new at;if(r)var f=r(s,c,d,e,t,l);if(!(void 0===f?Tt(c,s,3,r,l):f))return!1}}return!0}(n,e,t)}}function $t(e,t){return null!=e&&t in Object(e)}function Bt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Qe(t,e)).length,i=!1;++r<o;){var a=Ye(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&se(o)&&ie(a,o)&&(E(e)||ge(e))}(e,t,$t)}function zt(e){return $e(e)?(t=Ye(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return et(t,e)}}(e);var t}function Lt(e){return"function"==typeof e?e:null==e?T:"object"==typeof e?E(e)?function(e,t){return $e(e)&&Ft(t)?Pt(Ye(e),t):function(n){var r=tt(n,e);return void 0===r&&r===t?Bt(n,e):Tt(t,r,3)}}(e[0],e[1]):It(e):zt(e)}function Vt(e){return x(e)&&ce(e)}function Rt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Wt(e,t,n,r){var o=-1,i=re,a=!0,u=e.length,d=[],s=t.length;if(!u)return d;n&&(t=M(t,Oe(n))),r?(i=Rt,a=!1):t.length>=200&&(i=Dt,a=!1,t=new Ot(t));e:for(;++o<u;){var c=e[o],l=null==n?c:n(c);if(c=r||0!==c?c:0,a&&l==l){for(var f=s;f--;)if(t[f]===l)continue e;d.push(c)}else i(t,l,r)||d.push(c)}return d}var Ht=de((function(e,t){return Vt(e)?Wt(e,it(t,1,Vt,!0)):[]}));var Zt=de((function(e,t){var n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t);return Vt(n)&&(n=void 0),Vt(e)?Wt(e,it(t,1,Vt,!0),Lt(n)):[]}));var qt=pt&&1/Mt(new pt([,-0]))[1]==1/0?function(e){return new pt(e)}:function(){};var Ut=de((function(e){return function(e,t,n){var r=-1,o=re,i=e.length,a=!0,u=[],d=u;if(n)a=!1,o=Rt;else if(i>=200){var s=t?null:qt(e);if(s)return Mt(s);a=!1,o=Dt,d=new Ot}else d=t?[]:u;e:for(;++r<i;){var c=e[r],l=t?t(c):c;if(c=n||0!==c?c:0,a&&l==l){for(var f=d.length;f--;)if(d[f]===l)continue e;t&&d.push(l),u.push(c)}else o(d,l,n)||(d!==u&&d.push(l),u.push(c))}return u}(it(e,1,Vt,!0))}));function Gt(e,t){return e.id===t||!!e.children&&e.children.some((function(e){return Gt(e,t)}))}function Xt(e){var t={};return function e(n,r){if(n&&n.id&&(t[n.id]=u({},n,{},r?{parent:r}:{}),n.children))for(var o=0,i=n.children.length;o<i;++o)e(n.children[o],n.id)}(e),t}function Jt(e,t,n){var r=[];return function t(o){var i=n[o],a=(i.children||[]).map((function(e){return t(e.id)})).filter((function(e){return!e.toHide}));return 0!==a.length||e(i)?(r.push(o),u({},i,{children:a})):u({},i,{toHide:!0})}(t),r}var Kt=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n(this,t),e=l(this,d(t).call(this)),Object.defineProperty(c(e),"_root",{value:r,configurable:!1,writable:!0}),Object.defineProperty(c(e),"nodesMap",{value:Xt(r),configurable:!1,writable:!0}),e._initExpanded(o.defaultExpanded),e.selected=Object.values(e.nodesMap).filter((function(e){return e.selected})).map((function(e){return e.id})),e.filtered=[],o.filter&&(e.filter=o.filter),e.autoSelectDescendants=o.autoSelectDescendants,e.autoDeselectDescendants=o.autoDeselectDescendants,e._updateVisibleTree(),e.draggedNodeId=void 0,e}return 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}}),t&&s(e,t)}(t,e),o(t,[{key:"_initExpanded",value:function(e){e?this.expandNode(e):this.root&&this.root.id?(this.expanded=[this.root.id],this.expandedWithoutFilter=this.expanded):(this.expanded=[],this.expandedWithoutFilter=[])}},{key:"_updateVisibleTree",value:function(){this.visibleTree=this._computeVisibleTree(this.root.id,{expanded:this.expanded})}},{key:"_detachNodeFromParent",value:function(e){var t=this._getNode(e.parent);e.parent=void 0,t&&(t.children=Zt(t.children||[],[e],(function(e){return e.id})))}},{key:"_attachNodeToParent",value:function(e,t,n){this._detachNodeFromParent(e);var r,o=this._getNode(t);o&&(e.parent=o.id,r=n,o.children=null==r?[].concat(p(o.children||[]),[u({},e)]):[].concat(p((o.children||[]).slice(0,n)),[u({},e)],p((o.children||[]).slice(n))))}},{key:"_computeVisibleTree",value:function(e,t){var n=this,r=t.expanded,o=this._getNode(e);if(!o)return{};var i=o.children||[];return u({},o,{children:r.includes(o.id)?i.filter((function(e){return n.isNodeFiltered(e.id)})).map((function(e){return n._computeVisibleTree(e.id,{expanded:r})})):[],isLeaf:0===i.length})}},{key:"_getNode",value:function(e){return this.nodesMap[e]}},{key:"expandNode",value:function(e,t){var n,r;this.expanded=(n=e,r=this.nodesMap,function e(t){var n=r[t];return n?[].concat(p(e(n.parent)),[t]):[]}(n)),this.expandedWithoutFilter=this.expanded,this._updateVisibleTree(),this.trigger("expand",this.expanded,t)}},{key:"isNodeExpanded",value:function(e){return this.expanded.includes(e)}},{key:"selectNode",value:function(e,t){var n=(t?this.autoSelectDescendants:this.autoDeselectDescendants)?Jt((function(e){return!1!==e.selectable}),e,this.nodesMap):[e];this.selected=(t?Ut:Ht)(this.selected,n),this.trigger("select",this.selected)}},{key:"isNodeSelected",value:function(e){return this.selected.includes(e)}},{key:"isNodeFiltered",value:function(e){return!this._filter||this.filtered.includes(e)}},{key:"startDrag",value:function(e){Object.prototype.hasOwnProperty.call(this.nodesMap,e)&&(this.draggedNodeId=e)}},{key:"stopDrag",value:function(){this.draggedNodeId=void 0}},{key:"isParent",value:function(e,t){var n=this._getNode(e);return!!n&&Gt(n,t)}},{key:"dropOnNode",value:function(e,t){if(this.isDragging()&&!this.isNodeDragged(e)){var n=this._getNode(this.draggedNodeId);Gt(n,e)||(this._attachNodeToParent(n,e,t),this.expandNode(this.draggedNodeId,"drop"),this.draggedNodeId=void 0,this._updateVisibleTree(),this.trigger("move",{moved:n.id,to:e,index:t}))}}},{key:"isNodeDragged",value:function(e){return this.draggedNodeId===e}},{key:"isDragging",value:function(){return void 0!==this.draggedNodeId}},{key:"_applyFilter",value:function(){var e=this;this._filter?(this.expandedWithoutFilter.some((function(t){var n=e._getNode(t);return e._filter(n)||n.children&&n.children.some(e._filter)}))?this.expanded=this.expandedWithoutFilter:this.expanded=[this.root.id],this.filtered=Jt(this._filter,this.root.id,this.nodesMap)):this.filtered=[]}},{key:"root",get:function(){return this._root},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._root=t,this.nodesMap=Xt(t),this.expanded.length&&!this.expanded.some((function(t){return!e.nodesMap[t]}))||this._initExpanded(),this._applyFilter(),this._updateVisibleTree()}},{key:"filter",set:function(e){this._filter=e,this._applyFilter(),this._updateVisibleTree()}}]),t}(function(){function e(){n(this,e),this.listeners={}}return o(e,[{key:"on",value:function(e,t){this.listeners[e]=[].concat(p(this.listeners[e]||[]),[t])}},{key:"off",value:function(e,t){var n=this.listeners[e];n&&(this.listeners[e]=n.filter((function(e){return e===t})))}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this.listeners[e];o&&o.forEach((function(e){return e.apply(null,n)}))}}]),e}());function Qt(e,t){Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],o=n[1];e.style[r]=o}))}function Yt(e,t,n,r,o,i,a,u,d,s){"boolean"!=typeof a&&(d=u,u=a,a=!1);const c="function"==typeof n?n.options:n;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,o&&(c.functional=!0)),r&&(c._scopeId=r),i?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):t&&(l=a?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,u(e))}),l)if(c.functional){const e=c.render;c.render=function(t,n){return l.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return n}var en={name:"FinderItemArrow",props:{expanded:{type:Boolean,default:!1},theme:{type:Object,default:function(){}},item:{type:Object,default:function(){}}}},tn=function(e,t){return(0,t._c)("div",{staticClass:"arrow",style:Object.assign({},{expanded:t.props.expanded},t.props.theme.arrowColor&&{borderColor:t.props.theme.arrowColor})})};tn._withStripped=!0;var nn=Yt({render:tn,staticRenderFns:[]},void 0,en,"data-v-8d4a66ea",!0,void 0,!1,void 0,void 0,void 0),rn={name:"FinderListDropZone",props:{treeModel:{type:Object,required:!0},node:{type:Object,required:!0},dragEnabled:{type:[Boolean,Function],default:!1},index:{type:Number,default:void 0},options:{type:Object,default:function(){return{}}}},data:function(){return{dragCounter:0}},computed:{dragOver:function(){return this.treeModel.isDragging()&&this.canDrop&&this.dragCounter>0},theme:function(){return tt(this,"options.theme",{})},canDrag:function(){return"function"==typeof this.dragEnabled?this.dragEnabled(this.node):this.dragEnabled},canDrop:function(){return!this.treeModel.isParent(this.treeModel.draggedNodeId,this.node.id)&&(!this.options.canDrop||this.options.canDrop(this.node.id,this.treeModel.draggedNodeId))}},methods:{onDragEnter:function(){this.dragCounter++},onDragLeave:function(){this.dragCounter--},onDrop:function(e){e.preventDefault(),this.dragCounter=0,this.canDrop&&this.treeModel.isDragging()&&this.treeModel.dropOnNode(this.node.id,this.index)}}},on=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"drop-zone",class:{"drag-over":e.dragOver,dragging:e.treeModel.isDragging(),"no-drop":e.treeModel.isDragging()&&!e.canDrop},style:Object.assign({},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),on:{dragenter:function(t){return t.preventDefault(),e.onDragEnter(t)},dragleave:function(t){return t.preventDefault(),e.onDragLeave(t)},dragover:function(e){e.preventDefault()},drop:function(t){return t.preventDefault(),e.onDrop(t)}}},[e.options.dropZoneComponent?n(e.options.dropZoneComponent,{tag:"component",staticStyle:{"flex-grow":"1"},attrs:{dragging:e.treeModel.isDragging(),"drag-over":e.dragOver}}):e._e()],1)};on._withStripped=!0;var an=Yt({render:on,staticRenderFns:[]},void 0,rn,"data-v-8a4b9c90",!1,void 0,!1,void 0,void 0,void 0),un={name:"FinderItem",mixins:[an],props:{selectable:{type:Boolean,default:!1}},computed:{expanded:function(){return this.treeModel.isNodeExpanded(this.node.id)},selected:function(){return this.treeModel.isNodeSelected(this.node.id)},dragged:function(){return this.treeModel.isNodeDragged(this.node.id)},itemComponent:function(){return this.options.itemComponent||"div"},arrowComponent:function(){return this.options.arrowComponent||nn}},watch:{dragOver:function(e){var t=this;e&&this.canDrop&&!this.node.isLeaf?this.dragOverTimeout=setTimeout((function(){return t.treeModel.expandNode(t.node.id,"dragover")}),500):this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)},node:function(){this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)}},methods:{onMouseDown:function(){var e=this;this.mousedown=!0,setTimeout((function(){e.mousedown=!1}),100)},onClick:function(){this.treeModel.expandNode(this.node.id,"click")},onFocus:function(){this.mousedown||this.treeModel.expandNode(this.node.id,"focus")},onSelect:function(e){this.treeModel.selectNode(this.node.id,e.target.checked)},onDragStart:function(e){this.canDrag&&(this.options.dragImageComponent&&(this.appendGhost(),e.dataTransfer.setDragImage(this.ghost,0,0)),e.dataTransfer.setData("text/plain",this.node.id),this.treeModel.startDrag(this.node.id))},onDragOver:function(e){this.canDrag&&(e.preventDefault(),this.canDrop?e.dataTransfer.dropEffect="move":e.dataTransfer.dropEffect="none")},onDragEnd:function(){this.ghost&&(this.ghost.parentNode.removeChild(this.ghost),this.ghost=null),this.canDrag&&(this.options.hasDragHandle&&this.$el.setAttribute("draggable","false"),this.treeModel.stopDrag())},appendGhost:function(){var e=this;this.ghost=document.createElement("div");var n=document.createElement("div"),r=new t({render:function(t){return t(e.options.dragImageComponent,{props:{item:e.node}})}}).$mount(n);this.ghost.appendChild(r.$el),Qt(r.$el,{boxShadow:"0 3px 4px rgba(116, 116, 116, 0.3)"}),Qt(this.ghost,{position:"absolute",padding:"10px",top:"-1000px",boxSizing:"border-box",pointerEvents:"none"}),this.$el.ownerDocument.body.appendChild(this.ghost)}}},dn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"item",class:[e.node.cssClass||"",{expanded:e.expanded,draggable:e.canDrag&&!e.options.hasDragHandle,dragged:e.dragged,"has-drag-handle":e.canDrag&&e.options.hasDragHandle,"drag-over":e.dragOver,"no-drop":e.treeModel.isDragging()&&!e.canDrop}],style:Object.assign({},e.expanded&&e.theme.primaryColor&&{backgroundColor:e.theme.primaryColor},e.dragged&&e.theme.draggedItemBgColor&&{backgroundColor:e.theme.draggedItemBgColor},e.dragged&&e.theme.draggedItemBoxShadow&&{"box-shadow":e.theme.draggedItemBoxShadow},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),attrs:{role:"button",draggable:e.canDrag&&!e.options.hasDragHandle,"aria-expanded":e.node.isLeaf?void 0:e.expanded},on:{mousedown:e.onMouseDown,click:e.onClick,dragenter:e.onDragEnter,dragleave:e.onDragLeave,dragstart:e.onDragStart,dragover:e.onDragOver,drop:e.onDrop,dragend:e.onDragEnd,focus:e.onFocus}},[e.canDrag&&e.options.hasDragHandle?n("div",{staticClass:"drag-handle",on:{mousedown:function(t){return e.$el.setAttribute("draggable","true")},mouseup:function(t){return e.$el.setAttribute("draggable","false")}}},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14m6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6m0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14"}})])]):e._e(),e._v(" "),e.selectable?n("input",{attrs:{type:"checkbox",disabled:!1===e.node.selectable,"aria-label":e.node.label},domProps:{checked:e.selected},on:{click:function(e){e.stopPropagation()},change:e.onSelect}}):e._e(),e._v(" "),n(e.itemComponent,{tag:"component",staticClass:"inner-item",attrs:{item:e.node,expanded:e.expanded,dragged:e.dragged}},[e._t("default")],2),e._v(" "),e.node.isLeaf?e._e():n(e.arrowComponent,{tag:"component",attrs:{theme:e.theme,expanded:e.expanded,item:e.node}})],1)};dn._withStripped=!0;var sn=Yt({render:dn,staticRenderFns:[]},void 0,un,"data-v-1050ea25",!1,void 0,!1,void 0,void 0,void 0);function cn(e,t){var n=t.props,r=t.expandedItemIndex,o=n.items,i=n.options;return i.sortBy&&(o=p(o).sort(i.sortBy)),o.map((function(t,o){return[n.dragEnabled&&e(an,{key:"drop-zone-".concat(t.id),attrs:{node:n.parent,treeModel:n.treeModel,dragEnabled:n.dragEnabled,index:o,options:n.options}})].concat([e(sn,{key:"item-".concat(t.id),attrs:{node:t,treeModel:n.treeModel,selectable:n.selectable,dragEnabled:n.dragEnabled,options:n.options,tabindex:o===r?"0":"-1"}},[t.label])])}))}var ln=Yt({},void 0,{name:"FinderList",functional:!0,props:{parent:{type:Object,default:function(){return{}}},items:{type:Array,default:function(){return[]}},treeModel:{type:Object,required:!0},selectable:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},options:{type:Object,default:function(){return{}}},hasExpandedItem:{type:Boolean,default:!1}},render:function(e,t){var n=t.props,r=t.listeners,o=tt(n,"options.theme.separatorColor",""),i=tt(n,"options.theme.separatorWidth",""),a=u({},o&&{borderColor:o},{},i&&{borderWidth:i}),d=Math.max(0,n.items.findIndex((function(e){return n.treeModel.isNodeExpanded(e.id)})));return[e("div",{class:"list",style:a,on:{keydown:function(e){var t;"ArrowDown"===e.key?t=function(e){for(var t=e.nextSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.nextSibling}}(e.target):"ArrowUp"===e.key&&(t=function(e){for(var t=e.previousSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.previousSibling}}(e.target)),t&&t.focus()}}},[[].concat(p(cn(e,{props:n,listeners:r,expandedItemIndex:d})),[n.dragEnabled&&e(an,{class:"last",attrs:{treeModel:n.treeModel,node:n.parent,dragEnabled:n.dragEnabled,index:n.items.length,options:n.options}})])])]}},"data-v-3afed33d",void 0,void 0,!1,void 0,void 0,void 0);function fn(e,t,n){if(!n||!n.children||0===n.children.length)return null;var r=n.children.find((function(e){return t.treeModel.isNodeExpanded(e.id)})),o={sortBy:t.sortBy,itemComponent:t.itemComponent,arrowComponent:t.arrowComponent,dragImageComponent:t.dragImageComponent,dropZoneComponent:t.dropZoneComponent,theme:t.theme,hasDragHandle:t.hasDragHandle,canDrop:t.canDrop},i=e(ln,{ref:"rootList",attrs:{"tree-model":t.treeModel,parent:n,items:n.children,selectable:t.selectable,"drag-enabled":t.dragEnabled,options:o,"has-expanded-item":!!r}});return e("div",{class:"list-container"},[i,r&&fn(e,t,r)])}var pn=Yt({},void 0,{name:"Finder",components:{FinderList:ln},props:{tree:{type:Object,required:!0},selectable:{type:Boolean,default:!1},autoSelectDescendants:{type:Boolean,default:!1},autoDeselectDescendants:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},hasDragHandle:{type:Boolean,default:!1},canDrop:{type:Function,default:void 0},filter:{type:Function,default:void 0},sortBy:{type:Function,default:void 0},defaultExpanded:{type:String,default:void 0},itemComponent:{type:[String,Object],default:void 0},arrowComponent:{type:[String,Object],default:void 0},dragImageComponent:{type:[String,Object],default:void 0},dropZoneComponent:{type:[String,Object],default:void 0},theme:{type:Object,default:function(){return{}}},scrollAnimationDuration:{type:Number,default:200}},data:function(){return{treeModel:{}}},watch:{tree:function(e){this.treeModel.root=e},filter:function(e){this.treeModel.filter=e},autoSelectDescendants:function(e){this.treeModel.autoSelectDescendants=e},autoDeselectDescendants:function(e){this.treeModel.autoDeselectDescendants=e}},beforeCreate:function(){Object.defineProperty(this.$options.propsData,"tree",{configurable:!1})},created:function(){var e=this;this.treeModel=new Kt(this.tree,{filter:this.filter,defaultExpanded:this.defaultExpanded,autoSelectDescendants:this.autoSelectDescendants,autoDeselectDescendants:this.autoDeselectDescendants}),this.treeModel.on("expand",(function(t,n){"dragover"!==n&&e.$nextTick((function(){e._scrollToRight(e.scrollAnimationDuration)})),e.$emit("expand",{expanded:t,sourceEvent:n})})),this.treeModel.on("select",(function(t){e.$emit("select",{selected:t})})),this.treeModel.on("move",(function(t){var n=t.moved,r=t.to,o=t.index;e.$emit("move",{moved:n,to:r,index:o})}))},methods:{expand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";this.treeModel.expandNode(e,t)},_scrollToRight:function(e){var t=this,n=this.$el,r=n.scrollLeft,o=n.scrollWidth,i=n.offsetWidth;if(0!==e){var a=o-i-r;if(!(a<=0)){var u=performance.now(),d=0;window.requestAnimationFrame((function n(o){(d+=o-u)>=e?t.$el.scrollLeft=t.$el.scrollWidth:(u=o,t.$el.scrollLeft=function(e,t,n,r){return-n*(e/=r)*(e-2)+t}(d,r,a,e),window.requestAnimationFrame(n))}))}}else this.$el.scrollLeft=o}},render:function(e){return e("div",{class:"tree-container"},[this.treeModel&&fn(e,this,this.treeModel.visibleTree)])}},"data-v-5bea1df7",void 0,void 0,!1,void 0,void 0,void 0),hn={Finder:pn,install:function(e){e.component("Finder",pn)}},vn=Object.freeze({__proto__:null,default:hn,Finder:pn});"undefined"!=typeof window&&window.Vue&&window.Vue.use(hn),e.default=vn,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self)["vue-finder"]={},e.Vue)}(this,(function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function o(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function a(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?a(Object(n),!0).forEach((function(t){i(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?c(e):t}function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if(!(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e)))return;var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function p(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}t=t&&t.hasOwnProperty("default")?t.default:t;var h="object"==typeof global&&global&&global.Object===Object&&global,v="object"==typeof self&&self&&self.Object===Object&&self,g=h||v||Function("return this")(),b=g.Symbol,y=Object.prototype,m=y.hasOwnProperty,_=y.toString,j=b?b.toStringTag:void 0;var O=Object.prototype.toString;var w=b?b.toStringTag:void 0;function x(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?function(e){var t=m.call(e,j),n=e[j];try{e[j]=void 0;var r=!0}catch(e){}var o=_.call(e);return r&&(t?e[j]=n:delete e[j]),o}(e):function(e){return O.call(e)}(e)}function D(e){return null!=e&&"object"==typeof e}function C(e){return"symbol"==typeof e||D(e)&&"[object Symbol]"==x(e)}function M(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var E=Array.isArray,S=b?b.prototype:void 0,A=S?S.toString:void 0;function k(e){if("string"==typeof e)return e;if(E(e))return M(e,k)+"";if(C(e))return A?A.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function N(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function T(e){return e}function F(e){if(!N(e))return!1;var t=x(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var P,I=g["__core-js_shared__"],$=(P=/[^.]+$/.exec(I&&I.keys&&I.keys.IE_PROTO||""))?"Symbol(src)_1."+P:"";var B=Function.prototype.toString;function z(e){if(null!=e){try{return B.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var L=/^\[object .+?Constructor\]$/,V=Function.prototype,R=Object.prototype,W=V.toString,H=R.hasOwnProperty,Z=RegExp("^"+W.call(H).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function q(e){return!(!N(e)||(t=e,$&&$ in t))&&(F(e)?Z:L).test(z(e));var t}function U(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return q(n)?n:void 0}var G=U(g,"WeakMap");function X(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var J=Date.now;var K,Q,Y,ee=function(){try{var e=U(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),te=(K=ee?function(e,t){return ee(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:T,Q=0,Y=0,function(){var e=J(),t=16-(e-Y);if(Y=e,t>0){if(++Q>=800)return arguments[0]}else Q=0;return K.apply(void 0,arguments)});function ne(e){return e!=e}function re(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var o=e.length,i=n+(r?1:-1);r?i--:++i<o;)if(t(e[i],i,e))return i;return-1}(e,ne,n)}(e,t,0)>-1}var oe=/^(?:0|[1-9]\d*)$/;function ie(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&oe.test(e))&&e>-1&&e%1==0&&e<t}function ae(e,t){return e===t||e!=e&&t!=t}var ue=Math.max;function de(e,t){return te(function(e,t,n){return t=ue(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=ue(r.length-t,0),a=Array(i);++o<i;)a[o]=r[t+o];o=-1;for(var u=Array(t+1);++o<t;)u[o]=r[o];return u[t]=n(a),X(e,this,u)}}(e,t,T),e+"")}function se(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function ce(e){return null!=e&&se(e.length)&&!F(e)}var le=Object.prototype;function fe(e){return D(e)&&"[object Arguments]"==x(e)}var pe=Object.prototype,he=pe.hasOwnProperty,ve=pe.propertyIsEnumerable,ge=fe(function(){return arguments}())?fe:function(e){return D(e)&&he.call(e,"callee")&&!ve.call(e,"callee")};var be="object"==typeof e&&e&&!e.nodeType&&e,ye=be&&"object"==typeof module&&module&&!module.nodeType&&module,me=ye&&ye.exports===be?g.Buffer:void 0,_e=(me?me.isBuffer:void 0)||function(){return!1},je={};function Oe(e){return function(t){return e(t)}}je["[object Float32Array]"]=je["[object Float64Array]"]=je["[object Int8Array]"]=je["[object Int16Array]"]=je["[object Int32Array]"]=je["[object Uint8Array]"]=je["[object Uint8ClampedArray]"]=je["[object Uint16Array]"]=je["[object Uint32Array]"]=!0,je["[object Arguments]"]=je["[object Array]"]=je["[object ArrayBuffer]"]=je["[object Boolean]"]=je["[object DataView]"]=je["[object Date]"]=je["[object Error]"]=je["[object Function]"]=je["[object Map]"]=je["[object Number]"]=je["[object Object]"]=je["[object RegExp]"]=je["[object Set]"]=je["[object String]"]=je["[object WeakMap]"]=!1;var we="object"==typeof e&&e&&!e.nodeType&&e,xe=we&&"object"==typeof module&&module&&!module.nodeType&&module,De=xe&&xe.exports===we&&h.process,Ce=function(){try{var e=xe&&xe.require&&xe.require("util").types;return e||De&&De.binding&&De.binding("util")}catch(e){}}(),Me=Ce&&Ce.isTypedArray,Ee=Me?Oe(Me):function(e){return D(e)&&se(e.length)&&!!je[x(e)]},Se=Object.prototype.hasOwnProperty;function Ae(e,t){var n=E(e),r=!n&&ge(e),o=!n&&!r&&_e(e),i=!n&&!r&&!o&&Ee(e),a=n||r||o||i,u=a?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],d=u.length;for(var s in e)!t&&!Se.call(e,s)||a&&("length"==s||o&&("offset"==s||"parent"==s)||i&&("buffer"==s||"byteLength"==s||"byteOffset"==s)||ie(s,d))||u.push(s);return u}var ke=function(e,t){return function(n){return e(t(n))}}(Object.keys,Object),Ne=Object.prototype.hasOwnProperty;function Te(e){if(n=(t=e)&&t.constructor,t!==("function"==typeof n&&n.prototype||le))return ke(e);var t,n,r=[];for(var o in Object(e))Ne.call(e,o)&&"constructor"!=o&&r.push(o);return r}function Fe(e){return ce(e)?Ae(e):Te(e)}var Pe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ie=/^\w*$/;function $e(e,t){if(E(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!C(e))||(Ie.test(e)||!Pe.test(e)||null!=t&&e in Object(t))}var Be=U(Object,"create");var ze=Object.prototype.hasOwnProperty;var Le=Object.prototype.hasOwnProperty;function Ve(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Re(e,t){for(var n=e.length;n--;)if(ae(e[n][0],t))return n;return-1}Ve.prototype.clear=function(){this.__data__=Be?Be(null):{},this.size=0},Ve.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Ve.prototype.get=function(e){var t=this.__data__;if(Be){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ze.call(t,e)?t[e]:void 0},Ve.prototype.has=function(e){var t=this.__data__;return Be?void 0!==t[e]:Le.call(t,e)},Ve.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Be&&void 0===t?"__lodash_hash_undefined__":t,this};var We=Array.prototype.splice;function He(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}He.prototype.clear=function(){this.__data__=[],this.size=0},He.prototype.delete=function(e){var t=this.__data__,n=Re(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)},He.prototype.get=function(e){var t=this.__data__,n=Re(t,e);return n<0?void 0:t[n][1]},He.prototype.has=function(e){return Re(this.__data__,e)>-1},He.prototype.set=function(e,t){var n=this.__data__,r=Re(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var Ze=U(g,"Map");function qe(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Ue(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Ue.prototype.clear=function(){this.size=0,this.__data__={hash:new Ve,map:new(Ze||He),string:new Ve}},Ue.prototype.delete=function(e){var t=qe(this,e).delete(e);return this.size-=t?1:0,t},Ue.prototype.get=function(e){return qe(this,e).get(e)},Ue.prototype.has=function(e){return qe(this,e).has(e)},Ue.prototype.set=function(e,t){var n=qe(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ge(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a)||i,a};return n.cache=new(Ge.Cache||Ue),n}Ge.Cache=Ue;var Xe=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Je=/\\(\\)?/g,Ke=function(e){var t=Ge(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Xe,(function(e,n,r,o){t.push(r?o.replace(Je,"$1"):n||e)})),t}));function Qe(e,t){return E(e)?e:$e(e,t)?[e]:Ke(function(e){return null==e?"":k(e)}(e))}function Ye(e){if("string"==typeof e||C(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function et(e,t){for(var n=0,r=(t=Qe(t,e)).length;null!=e&&n<r;)e=e[Ye(t[n++])];return n&&n==r?e:void 0}function tt(e,t,n){var r=null==e?void 0:et(e,t);return void 0===r?n:r}function nt(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var rt=b?b.isConcatSpreadable:void 0;function ot(e){return E(e)||ge(e)||!!(rt&&e&&e[rt])}function it(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=ot),o||(o=[]);++i<a;){var u=e[i];t>0&&n(u)?t>1?it(u,t-1,n,r,o):nt(o,u):r||(o[o.length]=u)}return o}function at(e){var t=this.__data__=new He(e);this.size=t.size}at.prototype.clear=function(){this.__data__=new He,this.size=0},at.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},at.prototype.get=function(e){return this.__data__.get(e)},at.prototype.has=function(e){return this.__data__.has(e)},at.prototype.set=function(e,t){var n=this.__data__;if(n instanceof He){var r=n.__data__;if(!Ze||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Ue(r)}return n.set(e,t),this.size=n.size,this};var ut=Object.prototype.propertyIsEnumerable,dt=Object.getOwnPropertySymbols,st=dt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var a=e[n];t(a,n,e)&&(i[o++]=a)}return i}(dt(e),(function(t){return ut.call(e,t)})))}:function(){return[]};function ct(e){return function(e,t,n){var r=t(e);return E(e)?r:nt(r,n(e))}(e,Fe,st)}var lt=U(g,"DataView"),ft=U(g,"Promise"),pt=U(g,"Set"),ht=z(lt),vt=z(Ze),gt=z(ft),bt=z(pt),yt=z(G),mt=x;(lt&&"[object DataView]"!=mt(new lt(new ArrayBuffer(1)))||Ze&&"[object Map]"!=mt(new Ze)||ft&&"[object Promise]"!=mt(ft.resolve())||pt&&"[object Set]"!=mt(new pt)||G&&"[object WeakMap]"!=mt(new G))&&(mt=function(e){var t=x(e),n="[object Object]"==t?e.constructor:void 0,r=n?z(n):"";if(r)switch(r){case ht:return"[object DataView]";case vt:return"[object Map]";case gt:return"[object Promise]";case bt:return"[object Set]";case yt:return"[object WeakMap]"}return t});var _t=mt,jt=g.Uint8Array;function Ot(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new Ue;++t<n;)this.add(e[t])}function wt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function xt(e,t){return e.has(t)}Ot.prototype.add=Ot.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Ot.prototype.has=function(e){return this.__data__.has(e)};function Dt(e,t,n,r,o,i){var a=1&n,u=e.length,d=t.length;if(u!=d&&!(a&&d>u))return!1;var s=i.get(e),c=i.get(t);if(s&&c)return s==t&&c==e;var l=-1,f=!0,p=2&n?new Ot:void 0;for(i.set(e,t),i.set(t,e);++l<u;){var h=e[l],v=t[l];if(r)var g=a?r(v,h,l,t,e,i):r(h,v,l,e,t,i);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!wt(t,(function(e,t){if(!xt(p,t)&&(h===e||o(h,e,n,r,i)))return p.push(t)}))){f=!1;break}}else if(h!==v&&!o(h,v,n,r,i)){f=!1;break}}return i.delete(e),i.delete(t),f}function Ct(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Mt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var Et=b?b.prototype:void 0,St=Et?Et.valueOf:void 0;var At=Object.prototype.hasOwnProperty;var kt=Object.prototype.hasOwnProperty;function Nt(e,t,n,r,o,i){var a=E(e),u=E(t),d=a?"[object Array]":_t(e),s=u?"[object Array]":_t(t),c="[object Object]"==(d="[object Arguments]"==d?"[object Object]":d),l="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s),f=d==s;if(f&&_e(e)){if(!_e(t))return!1;a=!0,c=!1}if(f&&!c)return i||(i=new at),a||Ee(e)?Dt(e,t,n,r,o,i):function(e,t,n,r,o,i,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!i(new jt(e),new jt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return ae(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var u=Ct;case"[object Set]":var d=1&r;if(u||(u=Mt),e.size!=t.size&&!d)return!1;var s=a.get(e);if(s)return s==t;r|=2,a.set(e,t);var c=Dt(u(e),u(t),r,o,i,a);return a.delete(e),c;case"[object Symbol]":if(St)return St.call(e)==St.call(t)}return!1}(e,t,d,n,r,o,i);if(!(1&n)){var p=c&&kt.call(e,"__wrapped__"),h=l&&kt.call(t,"__wrapped__");if(p||h){var v=p?e.value():e,g=h?t.value():t;return i||(i=new at),o(v,g,n,r,i)}}return!!f&&(i||(i=new at),function(e,t,n,r,o,i){var a=1&n,u=ct(e),d=u.length;if(d!=ct(t).length&&!a)return!1;for(var s=d;s--;){var c=u[s];if(!(a?c in t:At.call(t,c)))return!1}var l=i.get(e),f=i.get(t);if(l&&f)return l==t&&f==e;var p=!0;i.set(e,t),i.set(t,e);for(var h=a;++s<d;){var v=e[c=u[s]],g=t[c];if(r)var b=a?r(g,v,c,t,e,i):r(v,g,c,e,t,i);if(!(void 0===b?v===g||o(v,g,n,r,i):b)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var y=e.constructor,m=t.constructor;y!=m&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m)&&(p=!1)}return i.delete(e),i.delete(t),p}(e,t,n,r,o,i))}function Tt(e,t,n,r,o){return e===t||(null==e||null==t||!D(e)&&!D(t)?e!=e&&t!=t:Nt(e,t,n,r,Tt,o))}function Ft(e){return e==e&&!N(e)}function Pt(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}}function It(e){var t=function(e){for(var t=Fe(e),n=t.length;n--;){var r=t[n],o=e[r];t[n]=[r,o,Ft(o)]}return t}(e);return 1==t.length&&t[0][2]?Pt(t[0][0],t[0][1]):function(n){return n===e||function(e,t,n,r){var o=n.length,i=o,a=!r;if(null==e)return!i;for(e=Object(e);o--;){var u=n[o];if(a&&u[2]?u[1]!==e[u[0]]:!(u[0]in e))return!1}for(;++o<i;){var d=(u=n[o])[0],s=e[d],c=u[1];if(a&&u[2]){if(void 0===s&&!(d in e))return!1}else{var l=new at;if(r)var f=r(s,c,d,e,t,l);if(!(void 0===f?Tt(c,s,3,r,l):f))return!1}}return!0}(n,e,t)}}function $t(e,t){return null!=e&&t in Object(e)}function Bt(e,t){return null!=e&&function(e,t,n){for(var r=-1,o=(t=Qe(t,e)).length,i=!1;++r<o;){var a=Ye(t[r]);if(!(i=null!=e&&n(e,a)))break;e=e[a]}return i||++r!=o?i:!!(o=null==e?0:e.length)&&se(o)&&ie(a,o)&&(E(e)||ge(e))}(e,t,$t)}function zt(e){return $e(e)?(t=Ye(e),function(e){return null==e?void 0:e[t]}):function(e){return function(t){return et(t,e)}}(e);var t}function Lt(e){return"function"==typeof e?e:null==e?T:"object"==typeof e?E(e)?function(e,t){return $e(e)&&Ft(t)?Pt(Ye(e),t):function(n){var r=tt(n,e);return void 0===r&&r===t?Bt(n,e):Tt(t,r,3)}}(e[0],e[1]):It(e):zt(e)}function Vt(e){return D(e)&&ce(e)}function Rt(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}function Wt(e,t,n,r){var o=-1,i=re,a=!0,u=e.length,d=[],s=t.length;if(!u)return d;n&&(t=M(t,Oe(n))),r?(i=Rt,a=!1):t.length>=200&&(i=xt,a=!1,t=new Ot(t));e:for(;++o<u;){var c=e[o],l=null==n?c:n(c);if(c=r||0!==c?c:0,a&&l==l){for(var f=s;f--;)if(t[f]===l)continue e;d.push(c)}else i(t,l,r)||d.push(c)}return d}var Ht=de((function(e,t){return Vt(e)?Wt(e,it(t,1,Vt,!0)):[]}));var Zt=de((function(e,t){var n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t);return Vt(n)&&(n=void 0),Vt(e)?Wt(e,it(t,1,Vt,!0),Lt(n)):[]}));var qt=pt&&1/Mt(new pt([,-0]))[1]==1/0?function(e){return new pt(e)}:function(){};var Ut=de((function(e){return function(e,t,n){var r=-1,o=re,i=e.length,a=!0,u=[],d=u;if(n)a=!1,o=Rt;else if(i>=200){var s=t?null:qt(e);if(s)return Mt(s);a=!1,o=xt,d=new Ot}else d=t?[]:u;e:for(;++r<i;){var c=e[r],l=t?t(c):c;if(c=n||0!==c?c:0,a&&l==l){for(var f=d.length;f--;)if(d[f]===l)continue e;t&&d.push(l),u.push(c)}else o(d,l,n)||(d!==u&&d.push(l),u.push(c))}return u}(it(e,1,Vt,!0))}));function Gt(e,t){return e.id===t||!!e.children&&e.children.some((function(e){return Gt(e,t)}))}function Xt(e){var t={};return function e(n,r){if(n&&n.id&&(t[n.id]=u({},n,{},r?{parent:r}:{}),n.children))for(var o=0,i=n.children.length;o<i;++o)e(n.children[o],n.id)}(e),t}function Jt(e,t,n){var r=[];return function t(o){var i=n[o],a=(i.children||[]).map((function(e){return t(e.id)})).filter((function(e){return!e.toHide}));return 0!==a.length||e(i)?(r.push(o),u({},i,{children:a})):u({},i,{toHide:!0})}(t),r}var Kt=function(e){function t(){var e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n(this,t),e=l(this,d(t).call(this)),Object.defineProperty(c(e),"_root",{value:r,configurable:!1,writable:!0}),Object.defineProperty(c(e),"nodesMap",{value:Xt(r),configurable:!1,writable:!0}),e._initExpanded(o.defaultExpanded),e.selected=Object.values(e.nodesMap).filter((function(e){return e.selected})).map((function(e){return e.id})),e.filtered=[],o.filter&&(e.filter=o.filter),e.autoSelectDescendants=o.autoSelectDescendants,e.autoDeselectDescendants=o.autoDeselectDescendants,e._updateVisibleTree(),e.draggedNodeId=void 0,e}return 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}}),t&&s(e,t)}(t,e),o(t,[{key:"_initExpanded",value:function(e){e?this.expandNode(e):this.root&&this.root.id?(this.expanded=[this.root.id],this.expandedWithoutFilter=this.expanded):(this.expanded=[],this.expandedWithoutFilter=[])}},{key:"_updateVisibleTree",value:function(){this.visibleTree=this._computeVisibleTree(this.root.id,{expanded:this.expanded})}},{key:"_detachNodeFromParent",value:function(e){var t=this._getNode(e.parent);e.parent=void 0,t&&(t.children=Zt(t.children||[],[e],(function(e){return e.id})))}},{key:"_attachNodeToParent",value:function(e,t,n){this._detachNodeFromParent(e);var r,o=this._getNode(t);o&&(e.parent=o.id,r=n,o.children=null==r?[].concat(p(o.children||[]),[u({},e)]):[].concat(p((o.children||[]).slice(0,n)),[u({},e)],p((o.children||[]).slice(n))))}},{key:"_computeVisibleTree",value:function(e,t){var n=this,r=t.expanded,o=this._getNode(e);if(!o)return{};var i=o.children||[];return u({},o,{children:r.includes(o.id)?i.filter((function(e){return n.isNodeFiltered(e.id)})).map((function(e){return n._computeVisibleTree(e.id,{expanded:r})})):[],isLeaf:0===i.length})}},{key:"_getNode",value:function(e){return this.nodesMap[e]}},{key:"expandNode",value:function(e,t){var n,r;this.expanded&&e===this.expanded[this.expanded.length-1]||(this.expanded=(n=e,r=this.nodesMap,function e(t){var n=r[t];return n?[].concat(p(e(n.parent)),[t]):[]}(n)),this.expandedWithoutFilter=this.expanded,this._updateVisibleTree(),this.trigger("expand",this.expanded,t))}},{key:"isNodeExpanded",value:function(e){return this.expanded.includes(e)}},{key:"selectNode",value:function(e,t){var n=(t?this.autoSelectDescendants:this.autoDeselectDescendants)?Jt((function(e){return!1!==e.selectable}),e,this.nodesMap):[e];this.selected=(t?Ut:Ht)(this.selected,n),this.trigger("select",this.selected)}},{key:"isNodeSelected",value:function(e){return this.selected.includes(e)}},{key:"isNodeFiltered",value:function(e){return!this._filter||this.filtered.includes(e)}},{key:"startDrag",value:function(e){Object.prototype.hasOwnProperty.call(this.nodesMap,e)&&(this.draggedNodeId=e)}},{key:"stopDrag",value:function(){this.draggedNodeId=void 0}},{key:"isParent",value:function(e,t){var n=this._getNode(e);return!!n&&Gt(n,t)}},{key:"dropOnNode",value:function(e,t){if(this.isDragging()&&!this.isNodeDragged(e)){var n=this._getNode(this.draggedNodeId);Gt(n,e)||(this._attachNodeToParent(n,e,t),this.expandNode(this.draggedNodeId,"drop"),this.draggedNodeId=void 0,this._updateVisibleTree(),this.trigger("move",{moved:n.id,to:e,index:t}))}}},{key:"isNodeDragged",value:function(e){return this.draggedNodeId===e}},{key:"isDragging",value:function(){return void 0!==this.draggedNodeId}},{key:"_applyFilter",value:function(){var e=this;this._filter?(this.expandedWithoutFilter.some((function(t){var n=e._getNode(t);return e._filter(n)||n.children&&n.children.some(e._filter)}))?this.expanded=this.expandedWithoutFilter:this.expanded=[this.root.id],this.filtered=Jt(this._filter,this.root.id,this.nodesMap)):this.filtered=[]}},{key:"root",get:function(){return this._root},set:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._root=t,this.nodesMap=Xt(t),this.expanded.length&&!this.expanded.some((function(t){return!e.nodesMap[t]}))||this._initExpanded(),this._applyFilter(),this._updateVisibleTree()}},{key:"filter",set:function(e){this._filter=e,this._applyFilter(),this._updateVisibleTree()}}]),t}(function(){function e(){n(this,e),this.listeners={}}return o(e,[{key:"on",value:function(e,t){this.listeners[e]=[].concat(p(this.listeners[e]||[]),[t])}},{key:"off",value:function(e,t){var n=this.listeners[e];n&&(this.listeners[e]=n.filter((function(e){return e===t})))}},{key:"trigger",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=this.listeners[e];o&&o.forEach((function(e){return e.apply(null,n)}))}}]),e}());function Qt(e,t){Object.entries(t).forEach((function(t){var n=f(t,2),r=n[0],o=n[1];e.style[r]=o}))}function Yt(e,t,n,r,o,i,a,u,d,s){"boolean"!=typeof a&&(d=u,u=a,a=!1);const c="function"==typeof n?n.options:n;let l;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,o&&(c.functional=!0)),r&&(c._scopeId=r),i?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,d(e)),e&&e._registeredComponents&&e._registeredComponents.add(i)},c._ssrRegister=l):t&&(l=a?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,u(e))}),l)if(c.functional){const e=c.render;c.render=function(t,n){return l.call(n),e(t,n)}}else{const e=c.beforeCreate;c.beforeCreate=e?[].concat(e,l):[l]}return n}var en={name:"FinderItemArrow",props:{expanded:{type:Boolean,default:!1},theme:{type:Object,default:function(){}},item:{type:Object,default:function(){}}}},tn=function(e,t){return(0,t._c)("div",{staticClass:"arrow",style:Object.assign({},{expanded:t.props.expanded},t.props.theme.arrowColor&&{borderColor:t.props.theme.arrowColor})})};tn._withStripped=!0;var nn=Yt({render:tn,staticRenderFns:[]},void 0,en,"data-v-8d4a66ea",!0,void 0,!1,void 0,void 0,void 0),rn={name:"FinderListDropZone",props:{treeModel:{type:Object,required:!0},node:{type:Object,required:!0},dragEnabled:{type:[Boolean,Function],default:!1},index:{type:Number,default:void 0},options:{type:Object,default:function(){return{}}}},data:function(){return{dragCounter:0}},computed:{dragOver:function(){return this.treeModel.isDragging()&&this.canDrop&&this.dragCounter>0},theme:function(){return tt(this,"options.theme",{})},canDrag:function(){return"function"==typeof this.dragEnabled?this.dragEnabled(this.node):this.dragEnabled},canDrop:function(){return!this.treeModel.isParent(this.treeModel.draggedNodeId,this.node.id)&&(!this.options.canDrop||this.options.canDrop(this.node.id,this.treeModel.draggedNodeId))}},methods:{onDragEnter:function(){this.dragCounter++},onDragLeave:function(){this.dragCounter--},onDrop:function(e){e.preventDefault(),this.dragCounter=0,this.canDrop&&this.treeModel.isDragging()&&this.treeModel.dropOnNode(this.node.id,this.index)}}},on=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"drop-zone",class:{"drag-over":e.dragOver,dragging:e.treeModel.isDragging(),"no-drop":e.treeModel.isDragging()&&!e.canDrop},style:Object.assign({},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),on:{dragenter:function(t){return t.preventDefault(),e.onDragEnter(t)},dragleave:function(t){return t.preventDefault(),e.onDragLeave(t)},dragover:function(e){e.preventDefault()},drop:function(t){return t.preventDefault(),e.onDrop(t)}}},[e.options.dropZoneComponent?n(e.options.dropZoneComponent,{tag:"component",staticStyle:{"flex-grow":"1"},attrs:{dragging:e.treeModel.isDragging(),"drag-over":e.dragOver}}):e._e()],1)};on._withStripped=!0;var an=Yt({render:on,staticRenderFns:[]},void 0,rn,"data-v-8a4b9c90",!1,void 0,!1,void 0,void 0,void 0),un={name:"FinderItem",mixins:[an],props:{selectable:{type:Boolean,default:!1}},computed:{expanded:function(){return this.treeModel.isNodeExpanded(this.node.id)},selected:function(){return this.treeModel.isNodeSelected(this.node.id)},dragged:function(){return this.treeModel.isNodeDragged(this.node.id)},itemComponent:function(){return this.options.itemComponent||"div"},arrowComponent:function(){return this.options.arrowComponent||nn}},watch:{dragOver:function(e){var t=this;e&&this.canDrop&&!this.node.isLeaf?this.dragOverTimeout=setTimeout((function(){return t.treeModel.expandNode(t.node.id,"dragover")}),500):this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)},node:function(){this.dragOverTimeout&&clearTimeout(this.dragOverTimeout)}},methods:{onMouseDown:function(){var e=this;this.mousedown=!0,setTimeout((function(){e.mousedown=!1}),100)},onClick:function(){this.treeModel.expandNode(this.node.id,"click")},onFocus:function(){this.mousedown||this.treeModel.expandNode(this.node.id,"focus")},onSelect:function(e){this.treeModel.selectNode(this.node.id,e.target.checked)},onDragStart:function(e){this.canDrag&&(this.options.dragImageComponent&&(this.appendGhost(),e.dataTransfer.setDragImage(this.ghost,0,0)),e.dataTransfer.setData("text/plain",this.node.id),this.treeModel.startDrag(this.node.id))},onDragOver:function(e){this.canDrag&&(e.preventDefault(),this.canDrop?e.dataTransfer.dropEffect="move":e.dataTransfer.dropEffect="none")},onDragEnd:function(){this.ghost&&(this.ghost.parentNode.removeChild(this.ghost),this.ghost=null),this.canDrag&&(this.options.hasDragHandle&&this.$el.setAttribute("draggable","false"),this.treeModel.stopDrag())},appendGhost:function(){var e=this;this.ghost=document.createElement("div");var n=document.createElement("div"),r=new t({render:function(t){return t(e.options.dragImageComponent,{props:{item:e.node}})}}).$mount(n);this.ghost.appendChild(r.$el),Qt(r.$el,{boxShadow:"0 3px 4px rgba(116, 116, 116, 0.3)"}),Qt(this.ghost,{position:"absolute",padding:"10px",top:"-1000px",boxSizing:"border-box",pointerEvents:"none"}),this.$el.ownerDocument.body.appendChild(this.ghost)}}},dn=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"item",class:[e.node.cssClass||"",{expanded:e.expanded,draggable:e.canDrag&&!e.options.hasDragHandle,dragged:e.dragged,"has-drag-handle":e.canDrag&&e.options.hasDragHandle,"drag-over":e.dragOver,"no-drop":e.treeModel.isDragging()&&!e.canDrop}],style:Object.assign({},e.expanded&&e.theme.primaryColor&&{backgroundColor:e.theme.primaryColor},e.dragged&&e.theme.draggedItemBgColor&&{backgroundColor:e.theme.draggedItemBgColor},e.dragged&&e.theme.draggedItemBoxShadow&&{"box-shadow":e.theme.draggedItemBoxShadow},e.dragOver&&e.theme.primaryColor&&{borderColor:e.theme.primaryColor},e.dragOver&&e.theme.dropZoneBgColor&&{backgroundColor:e.theme.dropZoneBgColor}),attrs:{role:"button",draggable:e.canDrag&&!e.options.hasDragHandle,"aria-expanded":e.node.isLeaf?void 0:e.expanded},on:{mousedown:e.onMouseDown,click:e.onClick,dragenter:e.onDragEnter,dragleave:e.onDragLeave,dragstart:e.onDragStart,dragover:e.onDragOver,drop:e.onDrop,dragend:e.onDragEnd,focus:e.onFocus}},[e.canDrag&&e.options.hasDragHandle?n("div",{staticClass:"drag-handle",on:{mousedown:function(t){return e.$el.setAttribute("draggable","true")},mouseup:function(t){return e.$el.setAttribute("draggable","false")}}},[n("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"}},[n("path",{attrs:{d:"M7 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 2m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 7 14m6-8a2 2 0 1 0-.001-4.001A2 2 0 0 0 13 6m0 2a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 8m0 6a2 2 0 1 0 .001 4.001A2 2 0 0 0 13 14"}})])]):e._e(),e._v(" "),e.selectable?n("input",{attrs:{type:"checkbox",disabled:!1===e.node.selectable,"aria-label":e.node.label},domProps:{checked:e.selected},on:{click:function(e){e.stopPropagation()},change:e.onSelect}}):e._e(),e._v(" "),n(e.itemComponent,{tag:"component",staticClass:"inner-item",attrs:{item:e.node,expanded:e.expanded,dragged:e.dragged}},[e._t("default")],2),e._v(" "),e.node.isLeaf?e._e():n(e.arrowComponent,{tag:"component",attrs:{theme:e.theme,expanded:e.expanded,item:e.node}})],1)};dn._withStripped=!0;var sn=Yt({render:dn,staticRenderFns:[]},void 0,un,"data-v-1050ea25",!1,void 0,!1,void 0,void 0,void 0);function cn(e,t){var n=t.props,r=t.expandedItemIndex,o=n.items,i=n.options;return i.sortBy&&(o=p(o).sort(i.sortBy)),o.map((function(t,o){return[n.dragEnabled&&e(an,{key:"drop-zone-".concat(t.id),attrs:{node:n.parent,treeModel:n.treeModel,dragEnabled:n.dragEnabled,index:o,options:n.options}})].concat([e(sn,{key:"item-".concat(t.id),attrs:{node:t,treeModel:n.treeModel,selectable:n.selectable,dragEnabled:n.dragEnabled,options:n.options,tabindex:o===r?"0":"-1"}},[t.label])])}))}var ln=Yt({},void 0,{name:"FinderList",functional:!0,props:{parent:{type:Object,default:function(){return{}}},items:{type:Array,default:function(){return[]}},treeModel:{type:Object,required:!0},selectable:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},options:{type:Object,default:function(){return{}}},hasExpandedItem:{type:Boolean,default:!1}},render:function(e,t){var n=t.props,r=t.listeners,o=tt(n,"options.theme.separatorColor",""),i=tt(n,"options.theme.separatorWidth",""),a=u({},o&&{borderColor:o},{},i&&{borderWidth:i}),d=Math.max(0,n.items.findIndex((function(e){return n.treeModel.isNodeExpanded(e.id)})));return[e("div",{class:"list",style:a,on:{keydown:function(e){var t;"ArrowDown"===e.key?t=function(e){for(var t=e.nextSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.nextSibling}}(e.target):"ArrowUp"===e.key&&(t=function(e){for(var t=e.previousSibling;t;){if(t.classList&&t.classList.contains("item"))return t;t=t.previousSibling}}(e.target)),t&&t.focus()}}},[[].concat(p(cn(e,{props:n,listeners:r,expandedItemIndex:d})),[n.dragEnabled&&e(an,{class:"last",attrs:{treeModel:n.treeModel,node:n.parent,dragEnabled:n.dragEnabled,index:n.items.length,options:n.options}})])])]}},"data-v-3afed33d",void 0,void 0,!1,void 0,void 0,void 0);function fn(e,t,n){if(!n||!n.children||0===n.children.length)return null;var r=n.children.find((function(e){return t.treeModel.isNodeExpanded(e.id)})),o={sortBy:t.sortBy,itemComponent:t.itemComponent,arrowComponent:t.arrowComponent,dragImageComponent:t.dragImageComponent,dropZoneComponent:t.dropZoneComponent,theme:t.theme,hasDragHandle:t.hasDragHandle,canDrop:t.canDrop},i=e(ln,{ref:"rootList",attrs:{"tree-model":t.treeModel,parent:n,items:n.children,selectable:t.selectable,"drag-enabled":t.dragEnabled,options:o,"has-expanded-item":!!r}});return e("div",{class:"list-container"},[i,r&&fn(e,t,r)])}var pn=Yt({},void 0,{name:"Finder",components:{FinderList:ln},props:{tree:{type:Object,required:!0},selectable:{type:Boolean,default:!1},autoSelectDescendants:{type:Boolean,default:!1},autoDeselectDescendants:{type:Boolean,default:!1},dragEnabled:{type:[Boolean,Function],default:!1},hasDragHandle:{type:Boolean,default:!1},canDrop:{type:Function,default:void 0},filter:{type:Function,default:void 0},sortBy:{type:Function,default:void 0},defaultExpanded:{type:String,default:void 0},itemComponent:{type:[String,Object],default:void 0},arrowComponent:{type:[String,Object],default:void 0},dragImageComponent:{type:[String,Object],default:void 0},dropZoneComponent:{type:[String,Object],default:void 0},theme:{type:Object,default:function(){return{}}},scrollAnimationDuration:{type:Number,default:200}},data:function(){return{treeModel:{}}},watch:{tree:function(e){this.treeModel.root=e},filter:function(e){this.treeModel.filter=e},autoSelectDescendants:function(e){this.treeModel.autoSelectDescendants=e},autoDeselectDescendants:function(e){this.treeModel.autoDeselectDescendants=e}},beforeCreate:function(){Object.defineProperty(this.$options.propsData,"tree",{configurable:!1})},created:function(){var e=this;this.treeModel=new Kt(this.tree,{filter:this.filter,defaultExpanded:this.defaultExpanded,autoSelectDescendants:this.autoSelectDescendants,autoDeselectDescendants:this.autoDeselectDescendants}),this.treeModel.on("expand",(function(t,n){"dragover"!==n&&e.$nextTick((function(){e._scrollToRight(e.scrollAnimationDuration)})),e.$emit("expand",{expanded:t,sourceEvent:n})})),this.treeModel.on("select",(function(t){e.$emit("select",{selected:t})})),this.treeModel.on("move",(function(t){var n=t.moved,r=t.to,o=t.index;e.$emit("move",{moved:n,to:r,index:o})}))},methods:{expand:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"api";this.treeModel.expandNode(e,t)},_scrollToRight:function(e){var t=this,n=this.$el,r=n.scrollLeft,o=n.scrollWidth,i=n.offsetWidth;if(0!==e){var a=o-i-r;if(!(a<=0)){var u=performance.now(),d=0;window.requestAnimationFrame((function n(o){(d+=o-u)>=e?t.$el.scrollLeft=t.$el.scrollWidth:(u=o,t.$el.scrollLeft=function(e,t,n,r){return-n*(e/=r)*(e-2)+t}(d,r,a,e),window.requestAnimationFrame(n))}))}}else this.$el.scrollLeft=o}},render:function(e){return e("div",{class:"tree-container"},[this.treeModel&&fn(e,this,this.treeModel.visibleTree)])}},"data-v-5bea1df7",void 0,void 0,!1,void 0,void 0,void 0),hn={Finder:pn,install:function(e){e.component("Finder",pn)}},vn=Object.freeze({__proto__:null,default:hn,Finder:pn});"undefined"!=typeof window&&window.Vue&&window.Vue.use(hn),e.default=vn,Object.defineProperty(e,"__esModule",{value:!0})})); |
{ | ||
"name": "@jledentu/vue-finder", | ||
"description": "A Vue.js component to display hierarchical data", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "main": "dist/vue-finder.common.js", |
@@ -428,4 +428,17 @@ import { mount } from "@vue/test-utils"; | ||
}); | ||
it("should not emit the `expand` event when expanding the already expanded node", async () => { | ||
const wrapper = mount(Finder, { | ||
propsData: { | ||
tree, | ||
selectable: true, | ||
defaultExpanded: "test112" | ||
} | ||
}); | ||
wrapper.vm.expand("test112"); | ||
expect(wrapper.emitted().expand).toBeFalsy(); | ||
}); | ||
}); | ||
}); | ||
}); |
@@ -123,2 +123,5 @@ import { isNil, union, difference, differenceBy } from "lodash-es"; | ||
expandNode(nodeId, sourceEvent) { | ||
if (this.expanded && nodeId === this.expanded[this.expanded.length - 1]) { | ||
return; | ||
} | ||
this.expanded = path(nodeId, this.nodesMap); | ||
@@ -125,0 +128,0 @@ this.expandedWithoutFilter = this.expanded; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
579679
16150