Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@labshare/data-structures

Package Overview
Dependencies
Maintainers
16
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@labshare/data-structures - npm Package Compare versions

Comparing version 3.1.5 to 3.2.0

bidirectional-tuple-set/bidirectional-tuple-set.d.ts

16

bundles/labshare-data-structures.umd.min.js

@@ -1,2 +0,16 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("uuid/v4"),require("lodash"),require("object-hash")):"function"==typeof define&&define.amd?define("@labshare/data-structures",["exports","uuid/v4","lodash","object-hash"],e):e(((t=t||self).labshare=t.labshare||{},t.labshare["data-structures"]={}),t.uuidImported,t.lodash,t.objectHashImported)}(this,function(t,e,n,r){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function o(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function s(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(o(arguments[e]));return t}var a=function(t,e){var n=t.plugins,r=t.state,o=t.props,s=e.reduce(function(t,e){var s,a=n[e].onInit(r,o[e]),u=a.props,f=a.state;return{props:i({},t.props,(s={},s[e]=u,s)),state:f}},{props:i({},o),state:i({},r)});return i({},t,s)},u=function(t,e,n,r){var o=r.plugins,s=r.state,a=r.props;if("onBeforeAdd"===t){var u={continue:!0,message:null,value:e};return 0===Object.keys(o).length&&1===e.length?{continue:!0,message:null,value:e[0]}:Object.keys(o).reduce(function(r,i){var u=o[i][t];u||(u=function(){return{continue:!0,message:null,value:e}});var f=u(e,n,a[i],s);if(!0!==f.continue)throw new Error("Plugin "+i+" did not allow insertion: "+f.message);return f},u)}return Object.keys(o).reduce(function(r,u){var f,h=(0,o[u][t])(e,n,a[u],s);return{plugins:o,props:i({},r.props,(f={},f[u]=h,f)),state:s}},r)},f=r;function h(t){return{fromArray:function(e,n){var r=this;JSON.parse(JSON.stringify(e));var o={plugins:t,props:n||{size:e.length},state:e.reduce(function(t,e){var n;return i({},t,((n={})[r.hashOf(e)]=e,n))},{})},s=Object.keys(t),u=a(o,s);return new d(u)},hashOf:function(t){return f(t,{respectType:!1,algorithm:"sha1"})},fromJSON:function(e){var n=JSON.parse(e);return d.addPlugins(t).fromArray(n.state,n.props)},addPlugins:function(e){return h(i({},t,e))},removePlugins:function(e){return h(n.omit(i({},t),e))},filterPlugins:function(e){return h(i({},t)).removePlugins(n.difference(Object.keys(t),e))},getActivePlugins:function(){return Object.keys(t)}}}var d=function(){function t(t){var e=this;this.statePropsPlugins=t,this.getActivePlugins=function(){return Object.keys(e.statePropsPlugins.plugins)}}return t.prototype.add=function(e){var n=t.hashOf(e);if(e=u("onBeforeAdd",[e],[n],this.statePropsPlugins).value,t.hashOf(e)in this.statePropsPlugins.state)throw new Error("Value "+e+" is already contained in the set");return this.merge(e)},t.prototype.merge=function(e,n){if(e instanceof t)throw new Error("Please use union for merging two sets");var r=t.hashOf(e);return this.mergeHash(r,e)},t.prototype.mergeHash=function(e,n){var r,o=!(e in this.statePropsPlugins.state);n=u("onBeforeAdd",[n],[e],this.statePropsPlugins).value;var s={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:t.hashOf(n)in this.statePropsPlugins.state?this.statePropsPlugins.props.size:this.statePropsPlugins.props.size+1}),state:i({},this.statePropsPlugins.state,(r={},r[e]=n,r))};return o&&(s=u("onAdd",[n],[e],s)),new t(s)},t.prototype.mergeArray=function(t){return t.reduce(function(t,e){return t.merge(e)},this)},t.prototype.remove=function(e){var r=t.hashOf(e);if(!(r in this.statePropsPlugins.state))throw new Error("There is no value "+e+" in the set.");var o={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:this.statePropsPlugins.props.size-1}),state:n.omit(this.statePropsPlugins.state,[r])};return new t(o=u("onRemove",[e],[r],o))},t.prototype.removeHash=function(t){return this.removeHashes([t])},t.prototype.removeHashes=function(e){var r=this;if(0===e.length)return this;e.forEach(function(t){if(!(t in r.statePropsPlugins.state))throw new Error("Could not remove hash from SSet: hash '"+t+"' does not exist in the set")});var o=n.omit(this.statePropsPlugins.state,e);if(e.length>=.5*this.size()){var s=n.reduce(o,function(t,e){return t.push(e),t},[]);return t.addPlugins(this.statePropsPlugins.plugins).fromArray(s)}var a={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:this.statePropsPlugins.props.size-e.length}),state:o};return new t(a=u("onRemove",e.map(function(t){return r.statePropsPlugins.state[t]}),e,a))},t.prototype.union=function(t){return this.internalTwoSetsOperations(["union"],this,t).union},t.prototype.difference=function(t){var e=this.internalTwoSetsOperations(["difference"],this,t).difference;return e.probEquals(this)?this:e},t.prototype.symmetricDifference=function(t){var e=this.internalTwoSetsOperations(["union","intersection"],this,t),n=e.union,r=e.intersection;return this.internalTwoSetsOperations(["difference"],n,r).difference},t.prototype.intersection=function(t){return this.internalTwoSetsOperations(["intersection"],this,t).intersection},t.prototype.map=function(e){var n=t.fromArray([]);return this.forEach(function(t){return n=n.add(e(t))}),n},t.prototype.filter=function(t){var e=this,n=[];return this.forEach(function(e,r){t(e,r)||n.push(r)}),e=e.removeHashes(n)},t.prototype.size=function(){return this.statePropsPlugins.props.size},t.prototype.$=function(t,e){void 0===e&&(e=[]);var n=this.statePropsPlugins,r=n.state,i=n.props;return n.plugins[t].API(r,i[t],this,e)},t.prototype.addPlugins=function(e){var n=this.statePropsPlugins.plugins,r=t.fromArray(Object.keys(n)),o=Object.keys(e),s=t.fromArray(o);if(!r.isDisjoint(s)){var u=s.intersection(r),f=u.size()>1?"s":"",h=u.size()>1?"are":"is";throw new Error("Could not add plugin"+f+" to SSet: Plugin"+f+" '"+u.toArray().join(", ")+"' "+h+" already active")}return this.statePropsPlugins=i({},this.statePropsPlugins,{plugins:i({},this.statePropsPlugins.plugins,e)}),new t(a(this.statePropsPlugins,o))},t.prototype.removePlugins=function(e){var r=this,o=e.reduce(function(t,e){if(!(e in r.statePropsPlugins.plugins))throw new Error("Could not remove plugin from SSet: Plugin '"+e+"' does not exist in this SSet");return r.statePropsPlugins.plugins[e].onDestroy(),n.omit(t,[e])},i({},this.statePropsPlugins.plugins));return new t(i({},this.statePropsPlugins,{plugins:o}))},t.prototype.filterPlugins=function(t){return this.removePlugins(n.difference(this.getActivePlugins(),t))},t.prototype.isSubset=function(t){return this.difference(t).isEmpty()},t.prototype.isSuperset=function(t){return t.difference(this).isEmpty()},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.hasSet=function(t){return this.isSuperset(t)},t.prototype.inSet=function(t){return this.isSubset(t)},t.prototype.has=function(e){return t.hashOf(e)in this.statePropsPlugins.state},t.prototype.getOne=function(){var t=this;return this.getSortedKeysArray().map(function(e){return t.statePropsPlugins.state[e]})[0]},t.prototype[Symbol.iterator]=function(){return{items:this.toArray(),next:function(){return{done:0===this.items.length,value:this.items.shift()}}}},t.prototype.forEach=function(t){var e=this,n=this.getSortedKeysArray();n.forEach(function(r,i){t(e.statePropsPlugins.state[r],r,i+1===n.length)})},t.prototype.every=function(t){var e=!0;return this.forEach(function(n){!0!==t(n)&&(e=!1)}),e},t.prototype.some=function(t){var e=!1;return this.forEach(function(n){!0===t(n)&&(e=!0)}),e},t.prototype.find=function(t){var e;return this.forEach(function(n){!0===t(n)&&(e=n)}),e},t.prototype.reduce=function(t,e){return this.forEach(function(n){e=t(e,n)}),e},t.prototype.toArray=function(){var t=[];return this.forEach(function(e){return t.push(e)}),t},t.prototype.changesTo=function(t){return{changes:{difference:this.difference(t),union:t.difference(this)},from:this,to:t}},t.prototype.changesFrom=function(t){return t.changesTo(this)},t.prototype.applyChanges=function(t){return this.union(t.union).difference(t.difference)},t.prototype.revertChanges=function(t){return this.union(t.difference).difference(t.union)},t.prototype.equals=function(t){return this===t||this.symmetricDifference(t).isEmpty()},t.prototype.probEquals=function(t){return this===t},t.prototype.toJSON=function(){return{props:i({},this.statePropsPlugins.props),state:this.toArray()}},t.prototype.isDisjoint=function(t){return this.intersection(t).isEmpty()},t.prototype.getByHash=function(t){var e=this.statePropsPlugins.state;if(t in e)return e[t];throw new Error("No item in the set corresponds to hash '"+t+"'")},t.prototype.hasHash=function(t){return t in this.statePropsPlugins.state},t.prototype.internalTwoSetsOperations=function(t,e,n){var r=o(function(t,e){return t.size()<e.size()?[t,e]:[e,t]}(e,n),2),i=r[0],a=r[1],u=function(t,e,n,r){var i=[{set:n,hashes:[]},function(t,e,n,r,i){return n&&t.hashes.push(r),!0===i?{set:t.set.removeHashes(t.hashes)}:t}],o=[{set:r,hashes:[]},function(t,e,n,r,i){return n&&t.hashes.push(r),!0===i?{set:t.set.removeHashes(t.hashes)}:t}];return{difference:t===n?i:o,intersection:[{set:r},function(t,e,n,r){return{set:n?t.set:t.set.removeHash(r)}}],oppositeDifference:t===n?o:i,union:[{set:n},function(t,e,n,r){return{set:t.set.mergeHash(r,e)}}]}}(e,0,a,i),f=t.map(function(t){return s([t],u[t])});return i.forEach(function(t,e,n){var r=a.hasHash(e);f.forEach(function(i){i[1]=i[2](i[1],t,r,e,n)})}),f.reduce(function(t,e){return t[e[0]]=e[1].set,t},{})},t.prototype.getSortedKeysArray=function(){return Object.keys(this.statePropsPlugins.state).sort()},t.fromArray=h({}).fromArray,t.hashOf=h({}).hashOf,t.fromJSON=h({}).fromJSON,t.addPlugins=h({}).addPlugins,t.removePlugins=h({}).removePlugins,t.getActivePlugins=h({}).getActivePlugins,t.filterPlugins=h({}).filterPlugins,t}(),p=function(){function t(t){this.internal=t}return t.fromEmpty=function(){return new t({state:c.fromObject({})})},t.fromArray=function(e){var n=e.map(function(t){return[t,!0]});return new t({state:c.fromPairs(n)})},t.prototype.add=function(e){if(this.internal.state.has(e))throw new Error("Could not add '"+e+"' to StringSet: Item already exists");return new t({state:this.internal.state.add(e,!0)})},t.prototype.merge=function(e){return this.internal.state.has(e)?this:new t({state:this.internal.state.add(e,!0)})},t.prototype.isEmpty=function(){return this.internal.state.isEmpty()},t.prototype.size=function(){return this.internal.state.size()},t.prototype.has=function(t){return this.internal.state.has(t)},t.prototype.remove=function(e){if(!this.internal.state.has(e))throw new Error("Could not remove from StringSet: item '"+e+"' does not exist");return new t({state:this.internal.state.remove(e)})},t.prototype.removeMany=function(e){return new t({state:this.internal.state.removeMany(e)})},t.prototype.intersection=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.internal.state).keysIntersection.apply(t,s(e.map(function(t){return t.asPointerMap()})))},t.prototype.filter=function(e){return new t({state:this.internal.state.filter(e)})},t.prototype.forEach=function(t){this.internal.state.forEach(t)},t.prototype.toObject=function(){return this.internal.state.toObject()},t.prototype.union=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new t({state:(e=this.internal.state).keysUnion.apply(e,s(n))})},t.prototype.first=function(){return this.internal.state.firstKey()},t.prototype.toArray=function(){return this.internal.state.keysArray()},t.prototype.asPointerMap=function(){return this.internal.state},t}(),c=function(){function t(t){this.internal=t}return t.fromObject=function(e){return new t({props:{size:Object.keys(e).length},state:e})},t.keyInEvery=function(t,e){return e.reduce(function(e,n){return!1!==e&&n.has(t)},!0)},t.fromPairs=function(e){var n=0,r=e.reduce(function(t,e){if(n+=1,e[0]in t)throw new Error("Could not create PointerMap: Pairs contain duplicate key '"+e[0]+"'");return t[e[0]]=e[1],t},{});return new t({props:{size:n},state:r})},t.prototype.size=function(){return this.internal.props.size},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.has=function(t,e){var n=this.internal.state;return t in n&&(!e||n[t]===e)},t.prototype.add=function(e,n){var r;if(this.has(e))throw new Error("Could not add to PointerMap: key '"+e+"' already exists");return new t({props:{size:this.internal.props.size+1},state:i({},this.internal.state,(r={},r[e]=void 0===n||n,r))})},t.prototype.keysUnion=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.reduce(function(t,e){var n=t;return e.forEach(function(t,e){n.has(t)||(n=n.add(t,e))}),n},this);return n},t.prototype.set=function(e,n){var r,o=this.has(e);return new t({props:{size:this.internal.props.size+(o?0:1)},state:i({},this.internal.state,(r={},r[e]=n,r))})},t.prototype.setMany=function(e){var r=this,o=i({},this.internal.state),s=this.internal.props.size;return n.forEach(e,function(t,e){var n=r.has(e);s+=n?0:1,o[e]=t}),new t({props:{size:s},state:o})},t.prototype.remove=function(t){return this.removeMany([t])},t.prototype.removeMany=function(e){var n=this,r=Object.assign({},this.internal.state);return e.forEach(function(t){if(!n.has(t))throw new Error("Could not remove from PointerMap: key '"+t+"' does not exist");delete r[t]}),new t({props:{size:this.internal.props.size-e.length},state:r})},t.prototype.get=function(t){if(!this.has(t))throw new Error("Could not get from PointerMap: key '"+t+"' does not exist");return this.internal.state[t]},t.prototype.toObject=function(){return i({},this.internal.state)},t.prototype.keysIntersection=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=(e=s([this],e)).reduce(function(t,e){return e.size()<t.size?{item:e,size:e.size()}:t},{item:null,size:1/0});return r.item.reduce(function(n,r,i){return t.keyInEvery(i,e)?n.add(i):n},p.fromEmpty())},t.prototype.filter=function(e,n){var r=this,i=t.fromObject({});return this.forEach(function(t){!0===e(t)&&(i=i.add(t,!!n||r.internal.state[t]))}),i},t.prototype.forEach=function(t){var e=this;Object.keys(this.internal.state).forEach(function(n){return t(n,e.internal.state[n])})},t.prototype.firstKey=function(){var t,e=this.internal.state;return n.forEach(e,function(e,n){return t=n,!1}),t},t.prototype.toPairs=function(){var t=this.internal,e=t.state;t.items;return Object.keys(e).map(function(t){return[t,e[t]]})},t.prototype.keysArray=function(){var t=this.internal,e=t.state;t.items;return Object.keys(e)},t.prototype.keysSet=function(){return p.fromArray(this.keysArray())},t.prototype.reduce=function(t,e){var n=this.internal.state;return Object.keys(n).reduce(function(e,r){return t(e,n[r],r)},e)},t}(),l=function(t,e){var n=t.state,r=t.props.size;return function(t,i){if(void 0===t)return{state:n,props:{size:r}};n.has(t)||(n=n.add(t,p.fromEmpty()));var o,s=n.get(t);if(s.has(i))throw new Error(e(t,i));return o=s.add(i),n=n.set(t,o),{props:{size:r+1},state:n}}},g=function(){function t(t){this.internal=t}return t.fromPairs=function(e){var n=c.fromObject({}),r=e.reduce(function(t,e){return l(t,function(t,e){return"Could not create MultiMap: Pairs contain duplicate path '"+t+"' -> '"+e+"'"})(e[0],e[1])},{props:{size:0},state:n});return new t(i({},r))},t.prototype.add=function(e,n){return new t(i({},l(this.internal,function(t,e){return"Could not add to MultiMap: Path '"+t+"' -> '"+e+"' already exists"})(e,n)))},t.prototype.has=function(t,e){return this.internal.state.has(t)&&(void 0===e||this.internal.state.get(t).has(e))},t.prototype.getOne=function(t){return this.internal.state.get(t).first()},t.prototype.from=function(t){var e=this.internal.state;if(!e.has(t))throw new Error("Could not read from MultiMap: key '"+t+"' does not exist");return e.get(t)},t.prototype.remove=function(t,e){var n,r,i=this.internal;i.state,i.props.size;return void 0===e?this.removeMany(((n={})[t]=!0,n)):this.removeMany(((r={})[t]=[e],r))},t.prototype.removeMany=function(e){var n=this.internal.state,r=[],i={},s=this.size();Object.keys(e).map(function(t){return[t,e[t]]}).forEach(function(t){var e=o(t,2),a=e[0],u=e[1];if(!n.has(a))throw new Error("Could not remove from MultiMap: key '"+a+"' does not exist");if("boolean"==typeof u)s-=n.get(a).size(),r.push(a);else{var f=n.get(a);u.forEach(function(t){if(!f.has(t))throw new Error("Could not remove from MultiMap: path '"+a+"' -> '"+t+"' does not exist")}),s-=u.length;var h=f.removeMany(u);0===h.size()?r.push(a):i[a]=h}});var a=n.removeMany(r).setMany(i);return new t({props:{size:s},state:a})},t.prototype.toObject=function(){var t=this.internal.state.toObject();return Object.keys(t).reduce(function(e,n){var r;return i({},e,((r={})[n]=t[n].toObject(),r))},{})},t.prototype.size=function(){return this.internal.props.size},t}(),y=function(t,e){var n=o(e,2),r=n[0],i=n[1],s=d.hashOf(r),a=d.hashOf(i);if(t.hashMap.has(s))throw new Error('2 pairs have the same keys: "'+r+'"');return t.hashMap=t.hashMap.add(s,a),t.inverseMap=t.inverseMap.add(a,s),t.items=t.items.merge(r),t.items=t.items.merge(i),t},v=function(){function t(t){this.internalState=t}return t.fromPairs=function(e){var n=c.fromObject({}),r=g.fromPairs([[]]),i=d.fromArray([]);return new t(e.reduce(y,{hashMap:n,inverseMap:r,items:i}))},t.prototype.get=function(t){var e=this.internalState,n=e.hashMap,r=e.items,i=d.hashOf(t);if(!this.hasHash(i))throw new Error("Could not get from SMap: key '"+t+"' does not exist");return r.getByHash(n.get(i))},t.prototype.has=function(t){var e=d.hashOf(t);return this.hasHash(e)},t.prototype.hasHash=function(t){return this.internalState.hashMap.has(t)},t.prototype.remove=function(e){var n=this.internalState,r=n.items,i=n.inverseMap,o=n.hashMap,s=d.hashOf(e);if(!o.has(s))throw new Error("Could not remove from SMap: key '"+e+"' does not exist");var a,u,f,h=o.get(s);a=r,u=o.remove(s),f=i.remove(h,s);var p,c=a.getByHash(s);if(p=s,!f.has(p)&&a.has(c)&&(a=a.remove(c)),a.hasHash(h)){var l=a.getByHash(h);(function(t,e,n){return!(e.has(t)||n.has(t))})(h,u,f)&&a.has(l)&&(a=a.remove(l))}return new t({hashMap:u,inverseMap:f,items:a})},t.prototype.add=function(t,e){var n=this.internalState,r=n.hashMap;n.items;if(r.has(d.hashOf(t)))throw new Error("Could not add to SMap: key '"+t+"' already exists");return this.set(t,e)},t.prototype.toPairs=function(){var t=this.internalState,e=t.hashMap,n=t.items;return e.toPairs().map(function(t){var e=o(t,2),r=e[0],i=e[1];return[n.getByHash(r),n.getByHash(i)]})},t.prototype.set=function(e,n){var r,i,o,s,a=this.internalState,u=a.hashMap,f=a.items,h=a.inverseMap,p=d.hashOf(e),c=d.hashOf(n);return u.has(p)&&c===(s=u.get(p))?this:(i=f.merge(n).merge(e),r=u.set(p,c),o=h.add(c,p),o=s?o.remove(s,p):o,!s||r.has(s)||o.has(s)||(i=i.remove(f.getByHash(s))),new t({hashMap:r,inverseMap:o,items:i}))},t}(),m=function(){function t(t){this.internal=t}return t.fromTriples=function(e){var n=c.fromObject({});return new t(n=e.reduce(function(t,e){t.has(e[0])||(t=t.add(e[0],g.fromPairs([[]])));var n=t.get(e[0]);if(n.has(e[1],e[2]))throw new Error("Could not add to DefaultIndex: path '"+e.join(", ")+"' already exists");var r=n.add(e[1],e[2]);return t.set(e[0],r)},n))},t.prototype.toObject=function(){return this.internal.reduce(function(t,e,n){var r;return i({},t,((r={})[n]=e.toObject(),r))},{})},t.prototype.has=function(t,e,n){return this.internal.has(t)&&(void 0===e||this.internal.get(t).has(e,n))},t.prototype.get=function(t,e){return void 0!==e?this.internal.get(t).getOne(e):this.internal.get(t)},t.prototype.from=function(t,e){if(this.internal.has(t)){var n=this.internal.get(t);if(void 0!==e){if(n.has(e))return n.from(e);throw new Error("Could not read from DefaultIndex: path '"+t+" -> "+e+"' does not exist")}return n}throw new Error("Could not read from DefaultIndex: key '"+t+"' does not exist")},t.prototype.add=function(e,n,r){var i=this.internal;i.has(e)||(i=i.add(e,g.fromPairs([[]])));var o=i.get(e);if(o.has(n,r))throw new Error("Could not add to DefaultIndex: path '"+[e,n,r].join(", ")+"' already exists");var s=o.add(n,r);return new t(i.set(e,s))},t.prototype.remove=function(t,e,n){return this.removeMany([[t,e,n]])},t.prototype.orderTriples=function(t){var e={};return t.forEach(function(t){e[t[0]]=e[t[0]]||{},e[t[0]][t[1]]=e[t[0]][t[1]]||[],e[t[0]][t[1]].push(t[2])}),e},t.prototype.removeMany=function(e){var n=this.orderTriples(e),r=this.internal,i=Object.keys(n),s=[],a={},u=function(t,e,n){return"Could not remove from DefaultIndex: path '"+[t,e,n].join(", ")+"' does not exist"};e.forEach(function(t){var e=o(t,3),n=e[0],i=e[1],s=e[2];if(!r.has(n))throw new Error(u(n,i,s));if(!r.get(n).has(i,s))throw new Error(u(n,i,s))});return i.map(function(t){return[t,n[t]]}).forEach(function(t){var e=o(t,2),n=e[0],i=e[1],u=r.get(n);0===(u=u.removeMany(i)).size()?s.push(n):a[n]=u}),new t(r=r.removeMany(s).setMany(a))},t}(),w=function(t,e){var n=e.hash,r=e.item;return Object.keys(r).forEach(function(e){var i=d.hashOf(r[e]);t=s(t,[[e,i,n]])}),t},P=e,E=function(t,e){return e.index.has(t[0],t[1])?e.index.from(t[0],t[1]):p.fromEmpty()},O=function(t,e,n){var r,i=e.reduce(function(e,r){return s(e,[E([t,r],n)])},[]);return i[0]?(r=i[0]).union.apply(r,s(i.splice(1))):p.fromEmpty()},b={onInit:function(t){t=n.reduce(t,function(t,e,r){var o,s;if(!n.isPlainObject(e))throw new Error("All items within a Collection must be plain objects");if(!("id"in e)){var a=i({},e,{id:P()});return n.omit(i({},t,((o={})[d.hashOf(a)]=a,o)),[r])}return i({},t,((s={})[r]=e,s))},{});var e=Object.keys(t).map(function(e){return{hash:e,item:t[e]}}).reduce(w,[]);return{props:{index:m.fromTriples(e),inverse:m.fromTriples(e.map(function(t){return[t[2],t[0],t[1]]}))},state:t}},onRemove:function(t,e,r,i){var o={index:[],inverse:[]};return t.forEach(function(t,i){var s=e[i];n.forEach(t,function(t,e){var n=r.inverse.get(s,e),i=[e,n,s],a=[s,e,n];o.index.push(i),o.inverse.push(a)})}),{index:r.index.removeMany(o.index),inverse:r.inverse.removeMany(o.inverse)}},onBeforeAdd:function(t,e,n,r){var o;return t.forEach(function(t){o=t.id?{continue:!0,message:null,value:t}:{continue:!0,message:null,value:i({},t,{id:P()})}}),o},onAdd:function(t,e,r,i){var o=r;return t.forEach(function(t,r){var i=e[r];o=n.reduce(t,function(t,e,n){var r=d.hashOf(e);return{index:t.index.add(n,r,i),inverse:t.inverse.add(i,n,r)}},o)}),o},API:function(t,e,r,i){var a=o(i,1)[0];return{findOne:function(r){var i,o,a=n.reduce(r,function(t,n,r){var i=[r,d.hashOf(n)];return s(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):p.fromEmpty()])},[]);return o=a.length>1?(i=a[0]).intersection.apply(i,s(a.slice(1))).first():a[0].first(),t[o]},findOneHashOrigin:function(t){var r,i=n.reduce(t,function(t,n,r){var i=[r,n];return s(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):p.fromEmpty()])},[]);return i.length>1?(r=i[0]).intersection.apply(r,s(i.slice(1))).first():i[0].first()},findOneHash:function(r){var i,o,a=n.reduce(r,function(t,n,r){var i=[r,n];return s(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):p.fromEmpty()])},[]);return o=a.length>1?(i=a[0]).intersection.apply(i,s(a.slice(1))).first():a[0].first(),t[o]},find:function(t){var r,i,o=n.reduce(t,function(t,n,r){var i=[r,d.hashOf(n)];return s(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):p.fromEmpty()])},[]);return i=o.length>1?(r=o[0]).intersection.apply(r,s(o.slice(1))):o[0],a.filterHashes(i)},findHash:function(t){var r,i,o=n.reduce(t,function(t,r,i){if(n.isArray(r))return s(t,[O(i,r,e)]);var o=[i,r];return s(t,[e.index.has(o[0],o[1])?e.index.from(o[0],o[1]):p.fromEmpty()])},[]);return i=o.length>1?(r=o[0]).intersection.apply(r,s(o.slice(1))):o[0],a.filterHashes(i)},getIndex:function(){return e.index},getMetadata:function(){return e.inverse}}}},x=function(){function t(t){this.internal=t}return t.fromArray=function(e){return new t({set:d.addPlugins({indexPlugin:b}).fromArray(e)})},t.prototype.filterHashes=function(t){return this.filter(function(e,n){return t.has(n)})},t.prototype.findOne=function(t){return this.internal.set.$("indexPlugin",[this]).findOne(t)},t.prototype.findOneHash=function(t){return this.internal.set.$("indexPlugin",[this]).findOneHash(t)},t.prototype.findOneHashOrigin=function(t){return this.internal.set.$("indexPlugin",[this]).findOneHashOrigin(t)},t.prototype.find=function(t){return this.internal.set.$("indexPlugin",[this]).find(t)},t.prototype.findHash=function(t){return this.internal.set.$("indexPlugin",[this]).findHash(t)},t.prototype.add=function(e){var n=this.internal.set.add(e);return new t(i({},this.internal,{set:n}))},t.prototype.merge=function(e){var n=this.internal.set.merge(e);return new t(i({},this.internal,{set:n}))},t.prototype.union=function(e){var n=e.internal.set,r=this.internal.set.union(n);return new t(i({},this.internal,{set:r}))},t.prototype.difference=function(e){var n=e.internal.set,r=this.internal.set.difference(n);return r===this.internal.set?this:new t({set:r})},t.prototype.has=function(t){return this.internal.set.has(t)},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.remove=function(e){var n=this.internal.set.remove(e);return new t(i({},this.internal,{set:n}))},t.prototype.removeHash=function(t){return this.removeHashes([t])},t.prototype.removeHashes=function(e){var n=this.internal.set.removeHashes(e);return new t(i({},this.internal,{set:n}))},t.prototype.getOne=function(){return this.internal.set.getOne()},t.prototype[Symbol.iterator]=function(){return this.internal.set[Symbol.iterator]()},t.prototype.map=function(e){return new t(i({},this.internal,{set:this.internal.set.map(e)}))},t.prototype.forEach=function(t){var e=this;this.internal.set.forEach(function(n,r){var i=e.getMetadata().get(r);t(n,r,i)})},t.prototype.filter=function(e){var n=this;return new t(i({},this.internal,{set:this.internal.set.filter(function(t,r){var i=n.getMetadata().get(r);return e(t,r,i)})}))},t.prototype.size=function(){return this.internal.set.size()},t.prototype.toArray=function(){return this.internal.set.toArray()},t.prototype.getByHash=function(t){return this.internal.set.getByHash(t)},t.prototype.getByIdHash=function(t){return this.internal.set.getByHash(this.internal.set.$("indexPlugin").getIndex().get("id",t))},t.prototype.getIndex=function(){return this.internal.set.$("indexPlugin").getIndex()},t.prototype.getMetadata=function(){return this.internal.set.$("indexPlugin").getMetadata()},t.prototype.changesFrom=function(t){return t.changesTo(this)},t.prototype.changesTo=function(e){var n=t.fromArray([]),r=e,i=[];return this.forEach(function(t,e,o){var s=t.id,a=r.findOneHash({id:o.getOne("id")}),u=r.findOneHashOrigin({id:o.getOne("id")});a?(u!==e&&(n=n.add({after:a,before:t,id:s,type:"edit"})),i.push(u)):n=n.add({id:s,item:t,type:"remove"})}),(r=r.removeHashes(i)).forEach(function(t){var e=t.id;n=n.add({id:e,item:t,type:"add"})}),n},t}(),A=function(){function t(e){var r,i,o=this;this.internal=e,this.nodes=((r={add:function(e){var n=o.internal,r=n.nodes,i=n.edges;if(o.nodes.hasId(e.id))throw new Error("Could not add Node to Graph: Node already exists");return new t({edges:i,nodes:r.add(e)})}.bind(this),findOne:function(t){var e=o.internal,n=e.nodes;e.edges;return n.findOne(t)}.bind(this),remove:function(e){var n=o.internal,r=n.nodes,i=n.edges;if(!r.has(e))throw new Error("Could not remove Node from Graph: Node does not exist");return new t({edges:i,nodes:r.remove(e)})}.bind(this),union:function(e){var n=o.internal,r=n.nodes;return new t({edges:n.edges,nodes:r.union(e.nodes.getAll())})}.bind(this),getAll:function(){return o.internal.nodes}.bind(this),getByHash:function(t){return o.internal.nodes.getByHash(t)}.bind(this),getByIdHash:function(t){return o.internal.nodes.getByIdHash(t)}.bind(this),update:function(e,n){var r=o.internal,i=r.nodes,s=r.edges;if(!i.has(e))throw new Error("Could not update Node from Graph: Node does not exist");return new t({edges:s,nodes:i.remove(e).add(n)})}.bind(this),updateId:function(e,n){var r=o.internal,i=r.nodes,s=r.edges,a=i.findOne({id:e});if(!a)throw new Error("Could not update Node from Graph: Node does not exist");return d.hashOf(a)===d.hashOf(n)?o:new t({edges:s,nodes:i.remove(a).add(n)})}.bind(this),has:function(t){return o.internal.nodes.has(t)}.bind(this),getId:function(t){var e=o.internal,r=e.nodes,i=(e.edges,r.findOne({id:t}));if(n.isUndefined(i))throw new Error("Could not get Node: Node Id '"+t+"' does not exist in Graph");return i}.bind(this),hasId:function(t){var e=o.internal,n=e.nodes;e.edges;return void 0!==t&&void 0!==n.findOne({id:t})}.bind(this),oneReachedById:function(t){var e=o.edges.fromId(t);if(!e.edges.isEmpty()){var n=e.edges.getAll().getOne();return o.nodes.getId(n.to)}}.bind(this),reachedById:function(e){var n=o.edges.fromId(e).internal.edges.map(function(t){return o.nodes.getId(t.to)});return new t({edges:x.fromArray([]),nodes:n})}.bind(this),find:function(e){var n=o.internal,r=n.nodes;n.edges;return new t({edges:x.fromArray([]),nodes:r.find(e)})}.bind(this),filter:function(e){var n=o.internal,r=n.nodes;n.edges;return new t({edges:x.fromArray([]),nodes:r.filter(e)})}.bind(this),forEach:function(t){var e=o.internal,n=e.nodes;e.edges;n.forEach(t)}.bind(this),isEmpty:function(){return o.internal.nodes.isEmpty()}.bind(this),getStartingNodes:function(){return o.nodes.filter(function(t,e,n){var r=n.getOne("id");return void 0===o.edges.findOneHash({to:r})})}.bind(this),removeEdgesFromNodes:function(t,e){var n=t.nodes.difference(e),r=e.nodes.getAll(),i=n,o=[];return r.forEach(function(t,e,n){o.push(n.getOne("id"))}),i=i.edges.findAndDifferenceHash({from:o})}.bind(this),topologicalSort:function(){var t=function(e,n){if(void 0===n&&(n=[]),e.nodes.isEmpty())return n;var r=e.nodes.getStartingNodes(),i=o.nodes.removeEdgesFromNodes(e,r);return t(i,s(n,[r]))};return t(o)}.bind(this),difference:function(e){var n=o.internal,r=n.nodes,i=n.edges,s=r.difference(e.nodes.getAll());return s===r?o:new t({edges:i,nodes:s})}.bind(this),size:function(){return o.internal.nodes.size()}.bind(this)})[Symbol.iterator]=function(){return o.internal.nodes[Symbol.iterator]()}.bind(this),r),this.edges=((i={union:function(e){var n=o.internal,r=n.nodes;return new t({edges:n.edges.union(e.edges.getAll()),nodes:r})}.bind(this),difference:function(e){var n=o.internal,r=n.nodes,i=n.edges,s=i.difference(e.edges.getAll());return s===i?o:new t({edges:s,nodes:r})}.bind(this),map:function(e){var n=o.internal,r=n.nodes;return new t({edges:n.edges.map(e),nodes:r})}.bind(this),filter:function(e){var n=o.internal;n.nodes;return new t({edges:n.edges.filter(e),nodes:x.fromArray([])})}.bind(this),find:function(e){var n=o.internal;n.nodes;return new t({edges:n.edges.find(e),nodes:x.fromArray([])})}.bind(this),findHash:function(e){var n=o.internal;n.nodes;return new t({edges:n.edges.findHash(e),nodes:x.fromArray([])})}.bind(this),findAndDifference:function(t){return o.edges.difference(o.edges.find(t))}.bind(this),findAndDifferenceHash:function(t){var e=o.edges.findHash(t);return o.edges.difference(e)}.bind(this),forEach:function(t){var e=o.internal;e.nodes;e.edges.forEach(t)}.bind(this),getAll:function(){return o.internal.edges}.bind(this),getByHash:function(t){return o.internal.edges.getByHash(t)}.bind(this),getByIdHash:function(t){return o.internal.edges.getByIdHash(t)}.bind(this),toggle:function(t){var e=o.internal;e.nodes,e.edges;return o.edges.hasId(t.id)?o.edges.remove(t):o.edges.add(t)}.bind(this),remove:function(e){var n=o.internal,r=n.nodes,i=n.edges;if(!i.has(e))throw new Error("Could not remove Edge from Graph: Edge does not exist");return new t({edges:i.remove(e),nodes:r})}.bind(this),add:function(e){var n=o.internal,r=n.nodes,i=n.edges;if(o.edges.hasId(e.id))throw new Error("Could not add Edge to Graph: Edge Id already exists");return new t({edges:i.add(e),nodes:r})}.bind(this),update:function(e,n){var r=o.internal,i=r.nodes,s=r.edges;if(!s.has(e))throw new Error("Could not update Edge from Graph: Edge does not exist");return new t({edges:s.remove(e).add(n),nodes:i})}.bind(this),updateId:function(e,n){var r=o.internal,i=r.nodes,s=r.edges,a=s.findOne({id:e});if(!a)throw new Error("Could not update Edge from Graph: Edge does not exist");return d.hashOf(a)===d.hashOf(n)?o:new t({edges:s.remove(a).add(n),nodes:i})}.bind(this),hasId:function(t){var e=o.internal,n=(e.nodes,e.edges);return void 0!==t&&void 0!==n.findOne({id:t})}.bind(this),fromId:function(e){var n=o.internal;n.nodes;return new t({edges:n.edges.find({from:e}),nodes:x.fromArray([])})}.bind(this)})[Symbol.iterator]=function(){return o.internal.edges[Symbol.iterator]()}.bind(this),i.findOne=function(t){var e=o.internal;e.nodes;return e.edges.findOne(t)}.bind(this),i.findOneHash=function(t){var e=o.internal;e.nodes;return e.edges.findOneHash(t)}.bind(this),i.size=function(){return o.internal.edges.size()}.bind(this),i.isEmpty=function(){return o.internal.edges.isEmpty()}.bind(this),i.getId=function(t){var e=o.internal.edges.findOne({id:t});if(n.isUndefined(e))throw new Error("Could not get Edge: Edge Id '"+t+"' does not exist in Graph");return e}.bind(this),i),this.getSignature=function(){return"@labshare/data-structures/graph"}}return t.fromObject=function(e){var n=e.nodes,r=e.edges,i=x.fromArray(n);return new t({edges:x.fromArray(r),nodes:i})},t.fromEmpty=function(){return t.fromObject({edges:[],nodes:[]})},t.prototype.toObject=function(){var t=this.internal,e=t.nodes;return{edges:t.edges.toArray(),nodes:e.toArray()}},t.prototype.union=function(t){return this.edges.union(t).nodes.union(t)},t.prototype.changesFrom=function(t){var e=this.internal,n=e.nodes;return{edges:e.edges.changesFrom(t.edges.getAll()),nodes:n.changesFrom(t.nodes.getAll())}},t.prototype.changesTo=function(t){return t.changesFrom(this)},t}();t.UUID=e,t.Collection=x,t.Graph=A,t.MultiMap=g,t.PointerMap=c,t.SMap=v,t.SSet=d,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("uuid/v4"),require("lodash"),require("object-hash")):"function"==typeof define&&define.amd?define("@labshare/data-structures",["exports","uuid/v4","lodash","object-hash"],e):e(((t=t||self).labshare=t.labshare||{},t.labshare["data-structures"]={}),t.uuidImported,t.lodash,t.objectHashImported)}(this,(function(t,e,n,r){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,s=n.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(r=s.next()).done;)o.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return o}function o(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}var a=function(t,e){var n=t.plugins,r=t.state,s=t.props,o=e.reduce((function(t,e){var o,a=n[e].onInit(r,s[e]),u=a.props,h=a.state;return{props:i({},t.props,(o={},o[e]=u,o)),state:h}}),{props:i({},s),state:i({},r)});return i({},t,o)},u=function(t,e,n,r){var s=r.plugins,o=r.state,a=r.props;if("onBeforeAdd"===t){var u={continue:!0,message:null,value:e};return 0===Object.keys(s).length&&1===e.length?{continue:!0,message:null,value:e[0]}:Object.keys(s).reduce((function(r,i){var u=s[i][t];u||(u=function(){return{continue:!0,message:null,value:e}});var h=u(e,n,a[i],o);if(!0!==h.continue)throw new Error("Plugin "+i+" did not allow insertion: "+h.message);return h}),u)}return Object.keys(s).reduce((function(r,u){var h,f=(0,s[u][t])(e,n,a[u],o);return{plugins:s,props:i({},r.props,(h={},h[u]=f,h)),state:o}}),r)},h=r;function f(t){return{fromArray:function(e,n){var r=this;JSON.parse(JSON.stringify(e));var s={plugins:t,props:n||{size:e.length},state:e.reduce((function(t,e){var n;return i({},t,((n={})[r.hashOf(e)]=e,n))}),{})},o=Object.keys(t),u=a(s,o);return new c(u)},hashOf:function(t){return h(t,{respectType:!1,algorithm:"sha1"})},fromJSON:function(e){var n=JSON.parse(e);return c.addPlugins(t).fromArray(n.state,n.props)},addPlugins:function(e){return f(i({},t,e))},removePlugins:function(e){return f(n.omit(i({},t),e))},filterPlugins:function(e){return f(i({},t)).removePlugins(n.difference(Object.keys(t),e))},getActivePlugins:function(){return Object.keys(t)}}}var d=function(t,e){return t.size()<e.size()?[t,e]:[e,t]},p=function(t,e,n,r){var i=[{set:n,hashes:[]},function(t,e,n,r,i){return n&&t.hashes.push(r),!0===i?{set:t.set.removeHashes(t.hashes)}:t}],s=[{set:r,hashes:[]},function(t,e,n,r,i){return n&&t.hashes.push(r),!0===i?{set:t.set.removeHashes(t.hashes)}:t}];return{difference:t===n?i:s,intersection:[{set:r},function(t,e,n,r){return{set:n?t.set:t.set.removeHash(r)}}],oppositeDifference:t===n?s:i,union:[{set:n},function(t,e,n,r){return{set:t.set.mergeHash(r,e)}}]}},c=function(){function t(t){var e=this;this.statePropsPlugins=t,this.getActivePlugins=function(){return Object.keys(e.statePropsPlugins.plugins)}}return t.prototype.add=function(e){var n=t.hashOf(e);if(e=u("onBeforeAdd",[e],[n],this.statePropsPlugins).value,t.hashOf(e)in this.statePropsPlugins.state)throw new Error("Value "+e+" is already contained in the set");return this.merge(e)},t.prototype.merge=function(e,n){if(e instanceof t)throw new Error("Please use union for merging two sets");var r=t.hashOf(e);return this.mergeHash(r,e)},t.prototype.mergeHash=function(e,n){var r,s=!(e in this.statePropsPlugins.state);n=u("onBeforeAdd",[n],[e],this.statePropsPlugins).value;var o={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:t.hashOf(n)in this.statePropsPlugins.state?this.statePropsPlugins.props.size:this.statePropsPlugins.props.size+1}),state:i({},this.statePropsPlugins.state,(r={},r[e]=n,r))};return s&&(o=u("onAdd",[n],[e],o)),new t(o)},t.prototype.mergeArray=function(t){return t.reduce((function(t,e){return t.merge(e)}),this)},t.prototype.remove=function(e){var r=t.hashOf(e);if(!(r in this.statePropsPlugins.state))throw new Error("There is no value "+e+" in the set.");var s={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:this.statePropsPlugins.props.size-1}),state:n.omit(this.statePropsPlugins.state,[r])};return new t(s=u("onRemove",[e],[r],s))},t.prototype.removeHash=function(t){return this.removeHashes([t])},t.prototype.removeHashes=function(e){var r=this;if(0===e.length)return this;e.forEach((function(t){if(!(t in r.statePropsPlugins.state))throw new Error("Could not remove hash from SSet: hash '"+t+"' does not exist in the set")}));var s=n.omit(this.statePropsPlugins.state,e);if(e.length>=.5*this.size()){var o=n.reduce(s,(function(t,e){return t.push(e),t}),[]);return t.addPlugins(this.statePropsPlugins.plugins).fromArray(o)}var a={plugins:this.statePropsPlugins.plugins,props:i({},this.statePropsPlugins.props,{size:this.statePropsPlugins.props.size-e.length}),state:s};return new t(a=u("onRemove",e.map((function(t){return r.statePropsPlugins.state[t]})),e,a))},t.prototype.union=function(t){return this.internalTwoSetsOperations(["union"],this,t).union},t.prototype.difference=function(t){var e=this.internalTwoSetsOperations(["difference"],this,t).difference;return e.probEquals(this)?this:e},t.prototype.symmetricDifference=function(t){var e=this.internalTwoSetsOperations(["union","intersection"],this,t),n=e.union,r=e.intersection;return this.internalTwoSetsOperations(["difference"],n,r).difference},t.prototype.intersection=function(t){return this.internalTwoSetsOperations(["intersection"],this,t).intersection},t.prototype.map=function(e){var n=t.fromArray([]);return this.forEach((function(t){return n=n.add(e(t))})),n},t.prototype.filter=function(t){var e=this,n=[];return this.forEach((function(e,r){t(e,r)||n.push(r)})),e=e.removeHashes(n)},t.prototype.size=function(){return this.statePropsPlugins.props.size},t.prototype.$=function(t,e){void 0===e&&(e=[]);var n=this.statePropsPlugins,r=n.state,i=n.props;return n.plugins[t].API(r,i[t],this,e)},t.prototype.addPlugins=function(e){var n=this.statePropsPlugins.plugins,r=t.fromArray(Object.keys(n)),s=Object.keys(e),o=t.fromArray(s);if(!r.isDisjoint(o)){var u=o.intersection(r),h=u.size()>1?"s":"",f=u.size()>1?"are":"is";throw new Error("Could not add plugin"+h+" to SSet: Plugin"+h+" '"+u.toArray().join(", ")+"' "+f+" already active")}return this.statePropsPlugins=i({},this.statePropsPlugins,{plugins:i({},this.statePropsPlugins.plugins,e)}),new t(a(this.statePropsPlugins,s))},t.prototype.removePlugins=function(e){var r=this,s=e.reduce((function(t,e){if(!(e in r.statePropsPlugins.plugins))throw new Error("Could not remove plugin from SSet: Plugin '"+e+"' does not exist in this SSet");return r.statePropsPlugins.plugins[e].onDestroy(),n.omit(t,[e])}),i({},this.statePropsPlugins.plugins));return new t(i({},this.statePropsPlugins,{plugins:s}))},t.prototype.filterPlugins=function(t){return this.removePlugins(n.difference(this.getActivePlugins(),t))},t.prototype.isSubset=function(t){return this.difference(t).isEmpty()},t.prototype.isSuperset=function(t){return t.difference(this).isEmpty()},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.hasSet=function(t){return this.isSuperset(t)},t.prototype.inSet=function(t){return this.isSubset(t)},t.prototype.has=function(e){return t.hashOf(e)in this.statePropsPlugins.state},t.prototype.getOne=function(){var t=this;return this.getSortedKeysArray().map((function(e){return t.statePropsPlugins.state[e]}))[0]},t.prototype[Symbol.iterator]=function(){return{items:this.toArray(),next:function(){return{done:0===this.items.length,value:this.items.shift()}}}},t.prototype.forEach=function(t){var e=this,n=this.getSortedKeysArray();n.forEach((function(r,i){t(e.statePropsPlugins.state[r],r,i+1===n.length)}))},t.prototype.every=function(t){var e=!0;return this.forEach((function(n){!0!==t(n)&&(e=!1)})),e},t.prototype.some=function(t){var e=!1;return this.forEach((function(n){!0===t(n)&&(e=!0)})),e},t.prototype.find=function(t){var e;return this.forEach((function(n){!0===t(n)&&(e=n)})),e},t.prototype.reduce=function(t,e){return this.forEach((function(n){e=t(e,n)})),e},t.prototype.toArray=function(){var t=[];return this.forEach((function(e){return t.push(e)})),t},t.prototype.changesTo=function(t){return{changes:{difference:this.difference(t),union:t.difference(this)},from:this,to:t}},t.prototype.changesFrom=function(t){return t.changesTo(this)},t.prototype.applyChanges=function(t){return this.union(t.union).difference(t.difference)},t.prototype.revertChanges=function(t){return this.union(t.difference).difference(t.union)},t.prototype.equals=function(t){return this===t||this.symmetricDifference(t).isEmpty()},t.prototype.probEquals=function(t){return this===t},t.prototype.toJSON=function(){return{props:i({},this.statePropsPlugins.props),state:this.toArray()}},t.prototype.isDisjoint=function(t){return this.intersection(t).isEmpty()},t.prototype.getByHash=function(t){var e=this.statePropsPlugins.state;if(t in e)return e[t];throw new Error("No item in the set corresponds to hash '"+t+"'")},t.prototype.hasHash=function(t){return t in this.statePropsPlugins.state},t.prototype.internalTwoSetsOperations=function(t,e,n){var r=s(d(e,n),2),i=r[0],a=r[1],u=p(e,0,a,i),h=t.map((function(t){return o([t],u[t])}));return i.forEach((function(t,e,n){var r=a.hasHash(e);h.forEach((function(i){i[1]=i[2](i[1],t,r,e,n)}))})),h.reduce((function(t,e){return t[e[0]]=e[1].set,t}),{})},t.prototype.getSortedKeysArray=function(){return Object.keys(this.statePropsPlugins.state).sort()},t.fromArray=f({}).fromArray,t.hashOf=f({}).hashOf,t.fromJSON=f({}).fromJSON,t.addPlugins=f({}).addPlugins,t.removePlugins=f({}).removePlugins,t.getActivePlugins=f({}).getActivePlugins,t.filterPlugins=f({}).filterPlugins,t}(),l=function(){function t(t){this.internal=t}return t.fromEmpty=function(){return new t({state:g.fromObject({})})},t.fromArray=function(e){var n=e.map((function(t){return[t,!0]}));return new t({state:g.fromPairs(n)})},t.prototype.add=function(e){if(this.internal.state.has(e))throw new Error("Could not add '"+e+"' to StringSet: Item already exists");return new t({state:this.internal.state.add(e,!0)})},t.prototype.merge=function(e){return this.internal.state.has(e)?this:new t({state:this.internal.state.add(e,!0)})},t.prototype.isEmpty=function(){return this.internal.state.isEmpty()},t.prototype.size=function(){return this.internal.state.size()},t.prototype.has=function(t){return this.internal.state.has(t)},t.prototype.remove=function(e){if(!this.internal.state.has(e))throw new Error("Could not remove from StringSet: item '"+e+"' does not exist");return new t({state:this.internal.state.remove(e)})},t.prototype.removeMany=function(e){return new t({state:this.internal.state.removeMany(e)})},t.prototype.intersection=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(t=this.internal.state).keysIntersection.apply(t,o(e.map((function(t){return t.asPointerMap()}))))},t.prototype.filter=function(e){return new t({state:this.internal.state.filter(e)})},t.prototype.forEach=function(t){this.internal.state.forEach(t)},t.prototype.toObject=function(){return this.internal.state.toObject()},t.prototype.union=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return new t({state:(e=this.internal.state).keysUnion.apply(e,o(n))})},t.prototype.first=function(){return this.internal.state.firstKey()},t.prototype.toArray=function(){return this.internal.state.keysArray()},t.prototype.asPointerMap=function(){return this.internal.state},t}(),g=function(){function t(t){this.internal=t}return t.fromObject=function(e){return new t({props:{size:Object.keys(e).length},state:e})},t.keyInEvery=function(t,e){return e.reduce((function(e,n){return!1!==e&&n.has(t)}),!0)},t.fromPairs=function(e){var n=0,r=e.reduce((function(t,e){if(n+=1,e[0]in t)throw new Error("Could not create PointerMap: Pairs contain duplicate key '"+e[0]+"'");return t[e[0]]=e[1],t}),{});return new t({props:{size:n},state:r})},t.prototype.size=function(){return this.internal.props.size},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.has=function(t,e){var n=this.internal.state;return t in n&&(!e||n[t]===e)},t.prototype.add=function(e,n){var r;if(this.has(e))throw new Error("Could not add to PointerMap: key '"+e+"' already exists");return new t({props:{size:this.internal.props.size+1},state:i({},this.internal.state,(r={},r[e]=void 0===n||n,r))})},t.prototype.keysUnion=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.reduce((function(t,e){var n=t;return e.forEach((function(t,e){n.has(t)||(n=n.add(t,e))})),n}),this);return n},t.prototype.set=function(e,n){var r,s=this.has(e);return new t({props:{size:this.internal.props.size+(s?0:1)},state:i({},this.internal.state,(r={},r[e]=n,r))})},t.prototype.setMany=function(e){var r=this,s=i({},this.internal.state),o=this.internal.props.size;return n.forEach(e,(function(t,e){var n=r.has(e);o+=n?0:1,s[e]=t})),new t({props:{size:o},state:s})},t.prototype.remove=function(t){return this.removeMany([t])},t.prototype.removeMany=function(e){var n=this,r=Object.assign({},this.internal.state);return e.forEach((function(t){if(!n.has(t))throw new Error("Could not remove from PointerMap: key '"+t+"' does not exist");delete r[t]})),new t({props:{size:this.internal.props.size-e.length},state:r})},t.prototype.get=function(t){if(!this.has(t))throw new Error("Could not get from PointerMap: key '"+t+"' does not exist");return this.internal.state[t]},t.prototype.toObject=function(){return i({},this.internal.state)},t.prototype.keysIntersection=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=(e=o([this],e)).reduce((function(t,e){return e.size()<t.size?{item:e,size:e.size()}:t}),{item:null,size:1/0});return r.item.reduce((function(n,r,i){return t.keyInEvery(i,e)?n.add(i):n}),l.fromEmpty())},t.prototype.filter=function(e,n){var r=this,i=t.fromObject({});return this.forEach((function(t){!0===e(t)&&(i=i.add(t,!!n||r.internal.state[t]))})),i},t.prototype.forEach=function(t){var e=this;Object.keys(this.internal.state).forEach((function(n){return t(n,e.internal.state[n])}))},t.prototype.firstKey=function(){var t,e=this.internal.state;return n.forEach(e,(function(e,n){return t=n,!1})),t},t.prototype.toPairs=function(){var t=this.internal,e=t.state;t.items;return Object.keys(e).map((function(t){return[t,e[t]]}))},t.prototype.keysArray=function(){var t=this.internal,e=t.state;t.items;return Object.keys(e)},t.prototype.keysSet=function(){return l.fromArray(this.keysArray())},t.prototype.reduce=function(t,e){var n=this.internal.state;return Object.keys(n).reduce((function(e,r){return t(e,n[r],r)}),e)},t}(),v=function(t,e){var n=t.state,r=t.props.size;return function(t,i){if(void 0===t)return{state:n,props:{size:r}};n.has(t)||(n=n.add(t,l.fromEmpty()));var s,o=n.get(t);if(o.has(i))throw new Error(e(t,i));return s=o.add(i),n=n.set(t,s),{props:{size:r+1},state:n}}},y=function(){function t(t){this.internal=t}return t.fromPairs=function(e){var n=g.fromObject({}),r=e.reduce((function(t,e){return v(t,(function(t,e){return"Could not create MultiMap: Pairs contain duplicate path '"+t+"' -> '"+e+"'"}))(e[0],e[1])}),{props:{size:0},state:n});return new t(i({},r))},t.prototype.add=function(e,n){return new t(i({},v(this.internal,(function(t,e){return"Could not add to MultiMap: Path '"+t+"' -> '"+e+"' already exists"}))(e,n)))},t.prototype.has=function(t,e){return this.internal.state.has(t)&&(void 0===e||this.internal.state.get(t).has(e))},t.prototype.getOne=function(t){return this.internal.state.get(t).first()},t.prototype.from=function(t){var e=this.internal.state;if(!e.has(t))throw new Error("Could not read from MultiMap: key '"+t+"' does not exist");return e.get(t)},t.prototype.remove=function(t,e){var n,r,i=this.internal;i.state,i.props.size;return void 0===e?this.removeMany(((n={})[t]=!0,n)):this.removeMany(((r={})[t]=[e],r))},t.prototype.removeMany=function(e){var n=this.internal.state,r=[],i={},o=this.size();Object.keys(e).map((function(t){return[t,e[t]]})).forEach((function(t){var e=s(t,2),a=e[0],u=e[1];if(!n.has(a))throw new Error("Could not remove from MultiMap: key '"+a+"' does not exist");if("boolean"==typeof u)o-=n.get(a).size(),r.push(a);else{var h=n.get(a);u.forEach((function(t){if(!h.has(t))throw new Error("Could not remove from MultiMap: path '"+a+"' -> '"+t+"' does not exist")})),o-=u.length;var f=h.removeMany(u);0===f.size()?r.push(a):i[a]=f}}));var a=n.removeMany(r).setMany(i);return new t({props:{size:o},state:a})},t.prototype.toObject=function(){var t=this.internal.state.toObject();return Object.keys(t).reduce((function(e,n){var r;return i({},e,((r={})[n]=t[n].toObject(),r))}),{})},t.prototype.size=function(){return this.internal.props.size},t}(),m=function(t,e){var n=s(e,2),r=n[0],i=n[1],o=c.hashOf(r),a=c.hashOf(i);if(t.hashMap.has(o))throw new Error('2 pairs have the same keys: "'+r+'"');return t.hashMap=t.hashMap.add(o,a),t.inverseMap=t.inverseMap.add(a,o),t.items=t.items.merge(r),t.items=t.items.merge(i),t},w=function(t,e){return!e.has(t)},P=function(t,e,n){return!(e.has(t)||n.has(t))},E=function(){function t(t){this.internalState=t}return t.fromPairs=function(e){var n=g.fromObject({}),r=y.fromPairs([[]]),i=c.fromArray([]);return new t(e.reduce(m,{hashMap:n,inverseMap:r,items:i}))},t.prototype.get=function(t){var e=this.internalState,n=e.hashMap,r=e.items,i=c.hashOf(t);if(!this.hasHash(i))throw new Error("Could not get from SMap: key '"+t+"' does not exist");return r.getByHash(n.get(i))},t.prototype.has=function(t){var e=c.hashOf(t);return this.hasHash(e)},t.prototype.hasHash=function(t){return this.internalState.hashMap.has(t)},t.prototype.remove=function(e){var n=this.internalState,r=n.items,i=n.inverseMap,s=n.hashMap,o=c.hashOf(e);if(!s.has(o))throw new Error("Could not remove from SMap: key '"+e+"' does not exist");var a,u,h,f=s.get(o);a=r,u=s.remove(o),h=i.remove(f,o);var d=a.getByHash(o);if(w(o,h)&&a.has(d)&&(a=a.remove(d)),a.hasHash(f)){var p=a.getByHash(f);P(f,u,h)&&a.has(p)&&(a=a.remove(p))}return new t({hashMap:u,inverseMap:h,items:a})},t.prototype.add=function(t,e){var n=this.internalState,r=n.hashMap;n.items;if(r.has(c.hashOf(t)))throw new Error("Could not add to SMap: key '"+t+"' already exists");return this.set(t,e)},t.prototype.toPairs=function(){var t=this.internalState,e=t.hashMap,n=t.items;return e.toPairs().map((function(t){var e=s(t,2),r=e[0],i=e[1];return[n.getByHash(r),n.getByHash(i)]}))},t.prototype.set=function(e,n){var r,i,s,o,a=this.internalState,u=a.hashMap,h=a.items,f=a.inverseMap,d=c.hashOf(e),p=c.hashOf(n);return u.has(d)&&p===(o=u.get(d))?this:(i=h.merge(n).merge(e),r=u.set(d,p),s=f.add(p,d),s=o?s.remove(o,d):s,!o||r.has(o)||s.has(o)||(i=i.remove(h.getByHash(o))),new t({hashMap:r,inverseMap:s,items:i}))},t}(),O=function(){function t(t){this.internal=t}return t.fromTriples=function(e){var n=g.fromObject({});return new t(n=e.reduce((function(t,e){t.has(e[0])||(t=t.add(e[0],y.fromPairs([[]])));var n=t.get(e[0]);if(n.has(e[1],e[2]))throw new Error("Could not add to DefaultIndex: path '"+e.join(", ")+"' already exists");var r=n.add(e[1],e[2]);return t.set(e[0],r)}),n))},t.prototype.toObject=function(){return this.internal.reduce((function(t,e,n){var r;return i({},t,((r={})[n]=e.toObject(),r))}),{})},t.prototype.has=function(t,e,n){return this.internal.has(t)&&(void 0===e||this.internal.get(t).has(e,n))},t.prototype.get=function(t,e){return void 0!==e?this.internal.get(t).getOne(e):this.internal.get(t)},t.prototype.from=function(t,e){if(this.internal.has(t)){var n=this.internal.get(t);if(void 0!==e){if(n.has(e))return n.from(e);throw new Error("Could not read from DefaultIndex: path '"+t+" -> "+e+"' does not exist")}return n}throw new Error("Could not read from DefaultIndex: key '"+t+"' does not exist")},t.prototype.add=function(e,n,r){var i=this.internal;i.has(e)||(i=i.add(e,y.fromPairs([[]])));var s=i.get(e);if(s.has(n,r))throw new Error("Could not add to DefaultIndex: path '"+[e,n,r].join(", ")+"' already exists");var o=s.add(n,r);return new t(i.set(e,o))},t.prototype.remove=function(t,e,n){return this.removeMany([[t,e,n]])},t.prototype.orderTriples=function(t){var e={};return t.forEach((function(t){e[t[0]]=e[t[0]]||{},e[t[0]][t[1]]=e[t[0]][t[1]]||[],e[t[0]][t[1]].push(t[2])})),e},t.prototype.removeMany=function(e){var n=this.orderTriples(e),r=this.internal,i=Object.keys(n),o=[],a={},u=function(t,e,n){return"Could not remove from DefaultIndex: path '"+[t,e,n].join(", ")+"' does not exist"};e.forEach((function(t){var e=s(t,3),n=e[0],i=e[1],o=e[2];if(!r.has(n))throw new Error(u(n,i,o));if(!r.get(n).has(i,o))throw new Error(u(n,i,o))}));return i.map((function(t){return[t,n[t]]})).forEach((function(t){var e=s(t,2),n=e[0],i=e[1],u=r.get(n);0===(u=u.removeMany(i)).size()?o.push(n):a[n]=u})),new t(r=r.removeMany(o).setMany(a))},t}(),b=function(t,e){var n=e.hash,r=e.item;return Object.keys(r).forEach((function(e){var i=c.hashOf(r[e]);t=o(t,[[e,i,n]])})),t},M=e,x=function(t,e){return e.index.has(t[0],t[1])?e.index.from(t[0],t[1]):l.fromEmpty()},A=function(t,e,n){var r,i=e.reduce((function(e,r){return o(e,[x([t,r],n)])}),[]);return i[0]?(r=i[0]).union.apply(r,o(i.splice(1))):l.fromEmpty()},S={onInit:function(t){t=n.reduce(t,(function(t,e,r){var s,o;if(!n.isPlainObject(e))throw new Error("All items within a Collection must be plain objects");if(!("id"in e)){var a=i({},e,{id:M()});return n.omit(i({},t,((s={})[c.hashOf(a)]=a,s)),[r])}return i({},t,((o={})[r]=e,o))}),{});var e=Object.keys(t).map((function(e){return{hash:e,item:t[e]}})).reduce(b,[]);return{props:{index:O.fromTriples(e),inverse:O.fromTriples(e.map((function(t){return[t[2],t[0],t[1]]})))},state:t}},onRemove:function(t,e,r,i){var s={index:[],inverse:[]};return t.forEach((function(t,i){var o=e[i];n.forEach(t,(function(t,e){var n=r.inverse.get(o,e),i=[e,n,o],a=[o,e,n];s.index.push(i),s.inverse.push(a)}))})),{index:r.index.removeMany(s.index),inverse:r.inverse.removeMany(s.inverse)}},onBeforeAdd:function(t,e,n,r){var s;return t.forEach((function(t){s=t.id?{continue:!0,message:null,value:t}:{continue:!0,message:null,value:i({},t,{id:M()})}})),s},onAdd:function(t,e,r,i){var s=r;return t.forEach((function(t,r){var i=e[r];s=n.reduce(t,(function(t,e,n){var r=c.hashOf(e);return{index:t.index.add(n,r,i),inverse:t.inverse.add(i,n,r)}}),s)})),s},API:function(t,e,r,i){var a=s(i,1)[0];return{findOne:function(r){var i,s,a=n.reduce(r,(function(t,n,r){var i=[r,c.hashOf(n)];return o(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):l.fromEmpty()])}),[]);return s=a.length>1?(i=a[0]).intersection.apply(i,o(a.slice(1))).first():a[0].first(),t[s]},findOneHashOrigin:function(t){var r,i=n.reduce(t,(function(t,n,r){var i=[r,n];return o(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):l.fromEmpty()])}),[]);return i.length>1?(r=i[0]).intersection.apply(r,o(i.slice(1))).first():i[0].first()},findOneHash:function(r){var i,s,a=n.reduce(r,(function(t,n,r){var i=[r,n];return o(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):l.fromEmpty()])}),[]);return s=a.length>1?(i=a[0]).intersection.apply(i,o(a.slice(1))).first():a[0].first(),t[s]},find:function(t){var r,i,s=n.reduce(t,(function(t,n,r){var i=[r,c.hashOf(n)];return o(t,[e.index.has(i[0],i[1])?e.index.from(i[0],i[1]):l.fromEmpty()])}),[]);return i=s.length>1?(r=s[0]).intersection.apply(r,o(s.slice(1))):s[0],a.filterHashes(i)},findHash:function(t){var r,i,s=n.reduce(t,(function(t,r,i){if(n.isArray(r))return o(t,[A(i,r,e)]);var s=[i,r];return o(t,[e.index.has(s[0],s[1])?e.index.from(s[0],s[1]):l.fromEmpty()])}),[]);return i=s.length>1?(r=s[0]).intersection.apply(r,o(s.slice(1))):s[0],a.filterHashes(i)},getIndex:function(){return e.index},getMetadata:function(){return e.inverse}}}},H=function(){function t(t){this.internal=t}return t.fromArray=function(e){return new t({set:c.addPlugins({indexPlugin:S}).fromArray(e)})},t.prototype.filterHashes=function(t){return this.filter((function(e,n){return t.has(n)}))},t.prototype.findOne=function(t){return this.internal.set.$("indexPlugin",[this]).findOne(t)},t.prototype.findOneHash=function(t){return this.internal.set.$("indexPlugin",[this]).findOneHash(t)},t.prototype.findOneHashOrigin=function(t){return this.internal.set.$("indexPlugin",[this]).findOneHashOrigin(t)},t.prototype.find=function(t){return this.internal.set.$("indexPlugin",[this]).find(t)},t.prototype.findHash=function(t){return this.internal.set.$("indexPlugin",[this]).findHash(t)},t.prototype.add=function(e){var n=this.internal.set.add(e);return new t(i({},this.internal,{set:n}))},t.prototype.merge=function(e){var n=this.internal.set.merge(e);return new t(i({},this.internal,{set:n}))},t.prototype.union=function(e){var n=e.internal.set,r=this.internal.set.union(n);return new t(i({},this.internal,{set:r}))},t.prototype.difference=function(e){var n=e.internal.set,r=this.internal.set.difference(n);return r===this.internal.set?this:new t({set:r})},t.prototype.has=function(t){return this.internal.set.has(t)},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.remove=function(e){var n=this.internal.set.remove(e);return new t(i({},this.internal,{set:n}))},t.prototype.removeHash=function(t){return this.removeHashes([t])},t.prototype.removeHashes=function(e){var n=this.internal.set.removeHashes(e);return new t(i({},this.internal,{set:n}))},t.prototype.getOne=function(){return this.internal.set.getOne()},t.prototype[Symbol.iterator]=function(){return this.internal.set[Symbol.iterator]()},t.prototype.map=function(e){return new t(i({},this.internal,{set:this.internal.set.map(e)}))},t.prototype.forEach=function(t){var e=this;this.internal.set.forEach((function(n,r){var i=e.getMetadata().get(r);t(n,r,i)}))},t.prototype.filter=function(e){var n=this;return new t(i({},this.internal,{set:this.internal.set.filter((function(t,r){var i=n.getMetadata().get(r);return e(t,r,i)}))}))},t.prototype.size=function(){return this.internal.set.size()},t.prototype.toArray=function(){return this.internal.set.toArray()},t.prototype.getByHash=function(t){return this.internal.set.getByHash(t)},t.prototype.getByIdHash=function(t){return this.internal.set.getByHash(this.internal.set.$("indexPlugin").getIndex().get("id",t))},t.prototype.getIndex=function(){return this.internal.set.$("indexPlugin").getIndex()},t.prototype.getMetadata=function(){return this.internal.set.$("indexPlugin").getMetadata()},t.prototype.changesFrom=function(t){return t.changesTo(this)},t.prototype.changesTo=function(e){var n=t.fromArray([]),r=e,i=[];return this.forEach((function(t,e,s){var o=t.id,a=r.findOneHash({id:s.getOne("id")}),u=r.findOneHashOrigin({id:s.getOne("id")});a?(u!==e&&(n=n.add({after:a,before:t,id:o,type:"edit"})),i.push(u)):n=n.add({id:o,item:t,type:"remove"})})),(r=r.removeHashes(i)).forEach((function(t){var e=t.id;n=n.add({id:e,item:t,type:"add"})})),n},t}(),z=function(){function t(e){var r,i,s=this;this.internal=e,this.nodes=((r={add:function(e){var n=s.internal,r=n.nodes,i=n.edges;if(s.nodes.hasId(e.id))throw new Error("Could not add Node to Graph: Node already exists");return new t({edges:i,nodes:r.add(e)})}.bind(this),findOne:function(t){var e=s.internal,n=e.nodes;e.edges;return n.findOne(t)}.bind(this),remove:function(e){var n=s.internal,r=n.nodes,i=n.edges;if(!r.has(e))throw new Error("Could not remove Node from Graph: Node does not exist");return new t({edges:i,nodes:r.remove(e)})}.bind(this),union:function(e){var n=s.internal,r=n.nodes;return new t({edges:n.edges,nodes:r.union(e.nodes.getAll())})}.bind(this),getAll:function(){return s.internal.nodes}.bind(this),getByHash:function(t){return s.internal.nodes.getByHash(t)}.bind(this),getByIdHash:function(t){return s.internal.nodes.getByIdHash(t)}.bind(this),update:function(e,n){var r=s.internal,i=r.nodes,o=r.edges;if(!i.has(e))throw new Error("Could not update Node from Graph: Node does not exist");return new t({edges:o,nodes:i.remove(e).add(n)})}.bind(this),updateId:function(e,n){var r=s.internal,i=r.nodes,o=r.edges,a=i.findOne({id:e});if(!a)throw new Error("Could not update Node from Graph: Node does not exist");return c.hashOf(a)===c.hashOf(n)?s:new t({edges:o,nodes:i.remove(a).add(n)})}.bind(this),has:function(t){return s.internal.nodes.has(t)}.bind(this),getId:function(t){var e=s.internal,r=e.nodes,i=(e.edges,r.findOne({id:t}));if(n.isUndefined(i))throw new Error("Could not get Node: Node Id '"+t+"' does not exist in Graph");return i}.bind(this),hasId:function(t){var e=s.internal,n=e.nodes;e.edges;return void 0!==t&&void 0!==n.findOne({id:t})}.bind(this),oneReachedById:function(t){var e=s.edges.fromId(t);if(!e.edges.isEmpty()){var n=e.edges.getAll().getOne();return s.nodes.getId(n.to)}}.bind(this),reachedById:function(e){var n=s.edges.fromId(e).internal.edges.map((function(t){return s.nodes.getId(t.to)}));return new t({edges:H.fromArray([]),nodes:n})}.bind(this),find:function(e){var n=s.internal,r=n.nodes;n.edges;return new t({edges:H.fromArray([]),nodes:r.find(e)})}.bind(this),filter:function(e){var n=s.internal,r=n.nodes;n.edges;return new t({edges:H.fromArray([]),nodes:r.filter(e)})}.bind(this),forEach:function(t){var e=s.internal,n=e.nodes;e.edges;n.forEach(t)}.bind(this),isEmpty:function(){return s.internal.nodes.isEmpty()}.bind(this),getStartingNodes:function(){return s.nodes.filter((function(t,e,n){var r=n.getOne("id");return void 0===s.edges.findOneHash({to:r})}))}.bind(this),removeEdgesFromNodes:function(t,e){var n=t.nodes.difference(e),r=e.nodes.getAll(),i=n,s=[];return r.forEach((function(t,e,n){s.push(n.getOne("id"))})),i=i.edges.findAndDifferenceHash({from:s})}.bind(this),topologicalSort:function(){var t=function(e,n){if(void 0===n&&(n=[]),e.nodes.isEmpty())return n;var r=e.nodes.getStartingNodes(),i=s.nodes.removeEdgesFromNodes(e,r);return t(i,o(n,[r]))};return t(s)}.bind(this),difference:function(e){var n=s.internal,r=n.nodes,i=n.edges,o=r.difference(e.nodes.getAll());return o===r?s:new t({edges:i,nodes:o})}.bind(this),size:function(){return s.internal.nodes.size()}.bind(this)})[Symbol.iterator]=function(){return s.internal.nodes[Symbol.iterator]()}.bind(this),r),this.edges=((i={union:function(e){var n=s.internal,r=n.nodes;return new t({edges:n.edges.union(e.edges.getAll()),nodes:r})}.bind(this),difference:function(e){var n=s.internal,r=n.nodes,i=n.edges,o=i.difference(e.edges.getAll());return o===i?s:new t({edges:o,nodes:r})}.bind(this),map:function(e){var n=s.internal,r=n.nodes;return new t({edges:n.edges.map(e),nodes:r})}.bind(this),filter:function(e){var n=s.internal;n.nodes;return new t({edges:n.edges.filter(e),nodes:H.fromArray([])})}.bind(this),find:function(e){var n=s.internal;n.nodes;return new t({edges:n.edges.find(e),nodes:H.fromArray([])})}.bind(this),findHash:function(e){var n=s.internal;n.nodes;return new t({edges:n.edges.findHash(e),nodes:H.fromArray([])})}.bind(this),findAndDifference:function(t){return s.edges.difference(s.edges.find(t))}.bind(this),findAndDifferenceHash:function(t){var e=s.edges.findHash(t);return s.edges.difference(e)}.bind(this),forEach:function(t){var e=s.internal;e.nodes;e.edges.forEach(t)}.bind(this),getAll:function(){return s.internal.edges}.bind(this),getByHash:function(t){return s.internal.edges.getByHash(t)}.bind(this),getByIdHash:function(t){return s.internal.edges.getByIdHash(t)}.bind(this),toggle:function(t){var e=s.internal;e.nodes,e.edges;return s.edges.hasId(t.id)?s.edges.remove(t):s.edges.add(t)}.bind(this),remove:function(e){var n=s.internal,r=n.nodes,i=n.edges;if(!i.has(e))throw new Error("Could not remove Edge from Graph: Edge does not exist");return new t({edges:i.remove(e),nodes:r})}.bind(this),add:function(e){var n=s.internal,r=n.nodes,i=n.edges;if(s.edges.hasId(e.id))throw new Error("Could not add Edge to Graph: Edge Id already exists");return new t({edges:i.add(e),nodes:r})}.bind(this),update:function(e,n){var r=s.internal,i=r.nodes,o=r.edges;if(!o.has(e))throw new Error("Could not update Edge from Graph: Edge does not exist");return new t({edges:o.remove(e).add(n),nodes:i})}.bind(this),updateId:function(e,n){var r=s.internal,i=r.nodes,o=r.edges,a=o.findOne({id:e});if(!a)throw new Error("Could not update Edge from Graph: Edge does not exist");return c.hashOf(a)===c.hashOf(n)?s:new t({edges:o.remove(a).add(n),nodes:i})}.bind(this),hasId:function(t){var e=s.internal,n=(e.nodes,e.edges);return void 0!==t&&void 0!==n.findOne({id:t})}.bind(this),fromId:function(e){var n=s.internal;n.nodes;return new t({edges:n.edges.find({from:e}),nodes:H.fromArray([])})}.bind(this)})[Symbol.iterator]=function(){return s.internal.edges[Symbol.iterator]()}.bind(this),i.findOne=function(t){var e=s.internal;e.nodes;return e.edges.findOne(t)}.bind(this),i.findOneHash=function(t){var e=s.internal;e.nodes;return e.edges.findOneHash(t)}.bind(this),i.size=function(){return s.internal.edges.size()}.bind(this),i.isEmpty=function(){return s.internal.edges.isEmpty()}.bind(this),i.getId=function(t){var e=s.internal.edges.findOne({id:t});if(n.isUndefined(e))throw new Error("Could not get Edge: Edge Id '"+t+"' does not exist in Graph");return e}.bind(this),i),this.getSignature=function(){return"@labshare/data-structures/graph"}}return t.fromObject=function(e){var n=e.nodes,r=e.edges,i=H.fromArray(n);return new t({edges:H.fromArray(r),nodes:i})},t.fromEmpty=function(){return t.fromObject({edges:[],nodes:[]})},t.prototype.toObject=function(){var t=this.internal,e=t.nodes;return{edges:t.edges.toArray(),nodes:e.toArray()}},t.prototype.union=function(t){return this.edges.union(t).nodes.union(t)},t.prototype.changesFrom=function(t){var e=this.internal,n=e.nodes;return{edges:e.edges.changesFrom(t.edges.getAll()),nodes:n.changesFrom(t.nodes.getAll())}},t.prototype.changesTo=function(t){return t.changesFrom(this)},t}(),j=function(){function t(){this.normalMap=new Map,this.inverseMap=new Map}return t.prototype.add=function(t,e){var n=this.normalMap.has(t)?this.normalMap.get(t):new Set;this.normalMap.set(t,n.add(e));var r=this.inverseMap.has(e)?this.inverseMap.get(e):new Set;return this.inverseMap.set(e,r.add(t)),this},t.prototype.has=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];switch(t.length){case 1:var n=t[0];return this.normalMap.has(n);case 2:var r=s(t,2),i=r[0],o=r[1];return this.normalMap.has(i)&&this.normalMap.get(i).has(o)}},t.prototype.inverseHas=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];switch(t.length){case 1:var n=t[0];return this.inverseMap.has(n);case 2:var r=s(t,2),i=r[0],o=r[1];return this.inverseMap.has(i)&&this.inverseMap.get(i).has(o)}},t.prototype.get=function(t){return this.normalMap.get(t)||new Set},t.prototype.inverseGet=function(t){return this.inverseMap.get(t)||new Set},t.prototype.delete=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];switch(e.length){case 1:var r=e[0];if(this.normalMap.has(r)){var i=this.normalMap.get(r);i.forEach((function(e){t.inverseMap.has(e)&&(t.inverseMap.get(e).delete(r),0===t.inverseMap.get(e).size&&t.inverseMap.delete(e))}))}return this.normalMap.delete(e[0]),this;case 2:var o=s(e,2),a=o[0],u=o[1];if(this.normalMap.has(a)){var h=this.normalMap.get(a);h.delete(u),0===h.size&&this.normalMap.delete(a)}if(this.inverseMap.has(u)){var f=this.inverseMap.get(u);f.delete(a),0===f.size&&this.inverseMap.delete(u)}return this}},t.prototype.inverseDelete=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];switch(e.length){case 1:var r=e[0];if(this.inverseMap.has(r)){var i=this.inverseMap.get(r);i.forEach((function(e){t.normalMap.has(e)&&(t.normalMap.get(e).delete(r),0===t.normalMap.get(e).size&&t.normalMap.delete(e))}))}return this.inverseMap.delete(e[0]),this;case 2:var o=s(e,2),a=o[0],u=o[1];if(this.inverseMap.has(a)){var h=this.inverseMap.get(a);h.delete(u),0===h.size&&this.inverseMap.delete(a)}if(this.normalMap.has(u)){var f=this.normalMap.get(u);f.delete(a),0===f.size&&this.normalMap.delete(u)}return this}},t.prototype.size=function(){var t=0;return this.normalMap.forEach((function(e){t+=e.size})),t},t.prototype.toMap=function(){return this.normalMap},t.prototype.toInverseMap=function(){return this.inverseMap},t.prototype.toArray=function(){var t=[];return this.normalMap.forEach((function(e,n){e.forEach((function(e){t.push([n,e])}))})),t},t.prototype.toInverseArray=function(){var t=[];return this.inverseMap.forEach((function(e,n){e.forEach((function(e){t.push([n,e])}))})),t},t}();t.UUID=e,t.BidirectionalTupleSet=j,t.Collection=H,t.Graph=z,t.MultiMap=y,t.PointerMap=g,t.SMap=E,t.SSet=c,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=labshare-data-structures.umd.min.js.map

4

collection/collection.d.ts

@@ -28,3 +28,3 @@ import { SSet } from '../sset/sset';

};
interface InternalState {
interface IInternalState {
set: SSet;

@@ -35,3 +35,3 @@ }

static fromArray(items: any): Collection;
constructor(internal: InternalState);
constructor(internal: IInternalState);
filterHashes(hashes: StringSet): Collection;

@@ -38,0 +38,0 @@ findOne(query: any): any;

@@ -402,2 +402,2 @@ import { SSet } from '../sset/sset';

export { ɵ0, ɵ1 };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29sbGV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ICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIFNTZXQuaGFzaE9mKHZhbHVlKV07XG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAuLi5yZXN1bHQsXG4gICAgICAgICAgICAgIHByb3BzLmluZGV4LmhhcyhhcmdzWzBdLCBhcmdzWzFdKSA/XG4gICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgU3RyaW5nU2V0LmZyb21FbXB0eSgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIFtdLFxuICAgICAgICApO1xuICAgICAgICBsZXQgZmlyc3RLZXk6IHN0cmluZztcbiAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgIGZpcnN0S2V5ID0gcmVzdWx0c1swXS5pbnRlcnNlY3Rpb24oLi4ucmVzdWx0cy5zbGljZSgxKSkuZmlyc3QoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmaXJzdEtleSA9IHJlc3VsdHNbMF0uZmlyc3QoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RhdGVbZmlyc3RLZXldO1xuICAgICAgfSxcblxuICAgICAgZmluZE9uZUhhc2hPcmlnaW4ocXVlcnkpIHtcbiAgICAgICAgICBjb25zdCByZXN1bHRzOiBTdHJpbmdTZXRbXSA9IF8ucmVkdWNlKFxuICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgYXJncyA9IFtwcm9wTmFtZSwgdmFsdWVdO1xuICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgIC4uLnJlc3VsdCxcbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5oYXMoYXJnc1swXSwgYXJnc1sxXSkgP1xuICAgICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgW10sXG4gICAgICAgICAgKTtcbiAgICAgICAgICBsZXQgZmlyc3RLZXk7XG4gICAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgZmlyc3RLZXkgPSByZXN1bHRzWzBdLmludGVyc2VjdGlvbiguLi5yZXN1bHRzLnNsaWNlKDEpKS5maXJzdCgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmaXJzdEtleSA9IHJlc3VsdHNbMF0uZmlyc3QoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZpcnN0S2V5O1xuICAgICAgfSxcblxuICAgICAgZmluZE9uZUhhc2gocXVlcnkpIHtcbiAgICAgIC8qIFRPRE86IHNlcGFyYXRlIHByb3BzIGluIGluZGV4ZWQgYW5kIG5vdC1pbmRleGVkICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIHZhbHVlXTtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgIC4uLnJlc3VsdCxcbiAgICAgICAgICAgICAgcHJvcHMuaW5kZXguaGFzKGFyZ3NbMF0sIGFyZ3NbMV0pID9cbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5mcm9tKGFyZ3NbMF0sIGFyZ3NbMV0pIDpcbiAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICBdO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgW10sXG4gICAgICAgICk7XG4gICAgICAgIGxldCBmaXJzdEtleTtcbiAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgIGZpcnN0S2V5ID0gcmVzdWx0c1swXS5pbnRlcnNlY3Rpb24oLi4ucmVzdWx0cy5zbGljZSgxKSkuZmlyc3QoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmaXJzdEtleSA9IHJlc3VsdHNbMF0uZmlyc3QoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RhdGVbZmlyc3RLZXldO1xuICAgICAgfSxcblxuICAgICAgZmluZChxdWVyeSk6IENvbGxlY3Rpb24ge1xuICAgICAgICAvKiBUT0RPOiByZWZhY3Rvci9zaW1wbGlmeSB3aXRoIGZpbmRPbmUgKi9cbiAgICAgICAgLyogUnVuIHN1Yi1xdWVyaWVzIGZvciBlYWNoIHByb3BlcnR5IGtleSAqL1xuICAgICAgICBjb25zdCByZXN1bHRzOiBTdHJpbmdTZXRbXSA9IF8ucmVkdWNlKFxuICAgICAgICAgIHF1ZXJ5LFxuICAgICAgICAgIChyLCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIFNTZXQuaGFzaE9mKHZhbHVlKV07XG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAuLi5yLFxuICAgICAgICAgICAgICBwcm9wcy5pbmRleC5oYXMoYXJnc1swXSwgYXJnc1sxXSkgP1xuICAgICAgICAgICAgICAgIHByb3BzLmluZGV4LmZyb20oYXJnc1swXSwgYXJn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gICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgYXJncyA9IFtwcm9wTmFtZSwgdmFsdWVdO1xuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgcHJvcHMuaW5kZXguaGFzKGFyZ3NbMF0sIGFyZ3NbMV0pID9cbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5mcm9tKGFyZ3NbMF0sIGFyZ3NbMV0pIDpcbiAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgW10sXG4gICAgICAgICk7XG4gICAgICAgIGxldCByZXN1bHQ6IFN0cmluZ1NldDtcbiAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdHNbMF0uaW50ZXJzZWN0aW9uKC4uLnJlc3VsdHMuc2xpY2UoMSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdHNbMF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNvbGxlY3Rpb24uZmlsdGVySGFzaGVzKHJlc3VsdCk7XG4gICAgICB9LFxuXG4gICAgICBnZXRJbmRleCgpIHtcbiAgICAgICAgcmV0dXJuIHByb3BzLmluZGV4O1xuICAgICAgfSxcblxuICAgICAgZ2V0TWV0YWRhdGEoKSB7XG4gICAgICAgIHJldHVybiBwcm9wcy5pbnZlcnNlO1xuICAgICAgfSxcblxuICAgIH07XG4gIH0sXG59O1xuXG5pbnRlcmZhY2UgSW50ZXJuYWxTdGF0ZSB7XG4gIHNldDogU1NldDtcbn1cblxuZXhwb3J0IGNsYXNzIENvbGxlY3Rpb24ge1xuICBwdWJsaWMgc3RhdGljIGZyb21BcnJheShpdGVtcykge1xuICAgIGNvbnN0IHNldCA9IFNTZX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kgd2l0aCBmaW5kT25lICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAociwgdmFsdWUsIHByb3BOYW1lKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBhcmdzID0gW3Byb3BOYW1lLCBTU2V0Lmhhc2hPZih2YWx1ZSldO1xuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgcHJvcHMuaW5kZXguaGFzKGFyZ3NbMF0sIGFyZ3NbMV0pID9cbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5mcm9tKGFyZ3NbMF0sIGFyZ3NbMV0pIDpcbiAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICBdO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgW10sXG4gICAgICAgICk7XG4gICAgICAgIGxldCByZXN1bHQ7XG4gICAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdLmludGVyc2VjdGlvbiguLi5yZXN1bHRzLnNsaWNlKDEpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb2xsZWN0aW9uLmZpbHRlckhhc2hlcyhyZXN1bHQpO1xuICAgICAgfSxcblxuICAgICAgZmluZEhhc2gocXVlcnkpOiBDb2xsZWN0aW9uIHtcbiAgICAgICAgLyogVE9ETzogcmVmYWN0b3Ivc2ltcGxpZnkgd2l0aCBmaW5kT25lICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAociwgdmFsdWUsIHByb3BOYW1lKSA9PiB7XG4gICAgICAgICAgICAvKiBhcnJheXMgd29yayBhcyBcIk9SXCIgY2xhdXNlICovXG4gICAgICAgICAgICAvKiBUT0RPOiBBZGQgdGVzdHMgKi9cbiAgICAgICAgICAgIGlmIChfLmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgICBvck9wZXJhdG9yKHByb3BOYW1lLCB2YWx1ZSwgcHJvcHMpLFxuICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIHZhbHVlXTtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgIC4uLnIsXG4gICAgICAgICAgICAgIHByb3BzLmluZGV4LmhhcyhhcmdzWzBdLCBhcmdzWzFdKSA/XG4gICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgU3RyaW5nU2V0LmZyb21FbXB0eSgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIFtdLFxuICAgICAgICApO1xuICAgICAgICBsZXQgcmVzdWx0OiBTdHJpbmdTZXQ7XG4gICAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdLmludGVyc2VjdGlvbiguLi5yZXN1bHRzLnNsaWNlKDEpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdO1xu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XNMaXN0ID0gY2hhbmdlc0xpc3QuYWRkKHtcbiAgICAgICAgICAgIGFmdGVyOiBjMkl0ZW0sXG4gICAgICAgICAgICBiZWZvcmU6IGl0ZW0sXG4gICAgICAgICAgICBpZCxcbiAgICAgICAgICAgIHR5cGU6ICdlZGl0JyxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZW1vdmVJdGVtcy5wdXNoKGMySXRlbUhhc2gpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY2hhbmdlc0xpc3QgPSBjaGFuZ2VzTGlzdC5hZGQoe1xuICAgICAgICAgIGlkLFxuICAgICAgICAgIGl0ZW0sXG4gICAgICAgICAgdHlwZTogJ3JlbW92ZScsXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0pO1xuICAgIGNvbXBhcmluZ0NvbGxlY3Rpb24gPSBjb21wYXJpbmdDb2xsZWN0aW9uLnJlbW92ZUhhc2hlcyhyZW1vdmVJdGVtcyk7XG4gICAgY29tcGFyaW5nQ29sbGVjdGlvbi5mb3JFYWNoKChpdGVtKSA9PiB7XG4gICAgICBjb25zdCBpZCA9IGl0ZW0uaWQ7XG4gICAgICBjaGFuZ2VzTGlzdCA9IGNoYW5nZXNMaXN0LmFkZCh7XG4gICAgICAgIGlkLFxuICAgICAgICBpdGVtLFxuICAgICAgICB0eXBlOiAnYWRkJyxcbiAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIGNoYW5nZXNMaXN0O1xuICB9XG59XG4iXX0=

@@ -8,3 +8,4 @@ import * as UUID from 'uuid/v4';

export { Graph } from './graph/graph';
export { BidirectionalTupleSet } from './bidirectional-tuple-set/bidirectional-tuple-set';
export { UUID };
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AbGFic2hhcmUvZGF0YS1zdHJ1Y3R1cmVzLyIsInNvdXJjZXMiOlsiaW5kZ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ICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIFNTZXQuaGFzaE9mKHZhbHVlKV07XG4gICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAuLi5yZXN1bHQsXG4gICAgICAgICAgICAgIHByb3BzLmluZGV4LmhhcyhhcmdzWzBdLCBhcmdzWzFdKSA/XG4gICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgU3RyaW5nU2V0LmZyb21FbXB0eSgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICB9LFxuICAgICAgICAgIFtdLFxuICAgICAgICApO1xuICAgICAgICBsZXQgZmlyc3RLZXk6IHN0cmluZztcbiAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgIGZpcnN0S2V5ID0gcmVzdWx0c1swXS5pbnRlcnNlY3Rpb24oLi4ucmVzdWx0cy5zbGljZSgxKSkuZmlyc3QoKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICBmaXJzdEtleSA9IHJlc3VsdHNbMF0uZmlyc3QoKTtcbiAgICAgICAgfVxuICAgICAgICByZXR1cm4gc3RhdGVbZmlyc3RLZXldO1xuICAgICAgfSxcblxuICAgICAgZmluZE9uZUhhc2hPcmlnaW4ocXVlcnkpIHtcbiAgICAgICAgICBjb25zdCByZXN1bHRzOiBTdHJpbmdTZXRbXSA9IF8ucmVkdWNlKFxuICAgICAgICAgICAgcXVlcnksXG4gICAgICAgICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgICAgY29uc3QgYXJncyA9IFtwcm9wTmFtZSwgdmFsdWVdO1xuICAgICAgICAgICAgICByZXR1cm4gW1xuICAgICAgICAgICAgICAgIC4uLnJlc3VsdCxcbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5oYXMoYXJnc1swXSwgYXJnc1sxXSkgP1xuICAgICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgW10sXG4gICAgICAgICAgKTtcbiAgICAgICAgICBsZXQgZmlyc3RLZXk7XG4gICAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgICAgZmlyc3RLZXkgPSByZXN1bHRzWzBdLmludGVyc2VjdGlvbiguLi5yZXN1bHRzLnNsaWNlKDEpKS5maXJzdCgpO1xuICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICBmaXJzdEtleSA9IHJlc3VsdHNbMF0uZmlyc3QoKTtcbiAgICAgICAgICB9XG4gICAgICAgICAgcmV0dXJuIGZpcnN0S2V5O1xuICAgICAgfSxcblxuICAgICAgZmluZE9uZUhhc2gocXVlcnkpIHtcbiAgICAgIC8qIFRPRE86IHNlcGFyYXRlIHByb3BzIGluIGluZGV4ZWQgYW5kIG5vdC1pbmRleGVkICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAocmVzdWx0LCB2YWx1ZSwgcHJvcE5hbWUpID0+IHtcbiAgICAgICAgICAgIGNvbnN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biAgICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgICAuLi5yLFxuICAgICAgICAgICAgICAgIG9yT3BlcmF0b3IocHJvcE5hbWUsIHZhbHVlLCBwcm9wcyksXG4gICAgICAgICAgICAgIF07XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgY29uc3QgYXJncyA9IFtwcm9wTmFtZSwgdmFsdWVdO1xuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgcHJvcHMuaW5kZXguaGFzKGFyZ3NbMF0sIGFyZ3NbMV0pID9cbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5mcm9tKGFyZ3NbMF0sIGFyZ3NbMV0pIDpcbiAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICBdO1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0sXG4gICAgICAgICAgW10sXG4gICAgICAgICk7XG4gICAgICAgIGxldCByZXN1bHQ6IFN0cmluZ1NldDtcbiAgICAgICAgaWYgKHJlc3VsdHMubGVuZ3RoID4gMSkge1xuICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdHNbMF0uaW50ZXJzZWN0aW9uKC4uLnJlc3VsdHMuc2xpY2UoMSkpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIHJlc3VsdCA9IHJlc3VsdHNbMF07XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIGNvbGxlY3Rpb24uZmlsdGVySGFzaGVzKHJlc3VsdCk7XG4gICAgICB9LFxuXG4gICAgICBnZXRJbmRleCgpIHtcbiAgICAgICAgcmV0dXJuIHByb3BzLmluZGV4O1xuICAgICAgfSxcblxuICAgICAgZ2V0TWV0YWRhdGEoKSB7XG4gICAgICAgIHJldHVybiBwcm9wcy5pbnZlcnNlO1xuICAgICAgfSxcblxuICAgIH07XG4gIH0sXG59O1xuXG5pbnRlcmZhY2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nN0KCk7XG4gICAgICAgIH1cbiAgICAgICAgcmV0dXJuIHN0YXRlW2ZpcnN0S2V5XTtcbiAgICAgIH0sXG5cbiAgICAgIGZpbmQocXVlcnkpOiBDb2xsZWN0aW9uIHtcbiAgICAgICAgLyogVE9ETzogcmVmYWN0b3Ivc2ltcGxpZnkgd2l0aCBmaW5kT25lICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAociwgdmFsdWUsIHByb3BOYW1lKSA9PiB7XG4gICAgICAgICAgICBjb25zdCBhcmdzID0gW3Byb3BOYW1lLCBTU2V0Lmhhc2hPZih2YWx1ZSldO1xuICAgICAgICAgICAgcmV0dXJuIFtcbiAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgcHJvcHMuaW5kZXguaGFzKGFyZ3NbMF0sIGFyZ3NbMV0pID9cbiAgICAgICAgICAgICAgICBwcm9wcy5pbmRleC5mcm9tKGFyZ3NbMF0sIGFyZ3NbMV0pIDpcbiAgICAgICAgICAgICAgICBTdHJpbmdTZXQuZnJvbUVtcHR5KCksXG4gICAgICAgICAgICBdO1xuICAgICAgICAgIH0sXG4gICAgICAgICAgW10sXG4gICAgICAgICk7XG4gICAgICAgIGxldCByZXN1bHQ7XG4gICAgICAgIGlmIChyZXN1bHRzLmxlbmd0aCA+IDEpIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdLmludGVyc2VjdGlvbiguLi5yZXN1bHRzLnNsaWNlKDEpKTtcbiAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICByZXN1bHQgPSByZXN1bHRzWzBdO1xuICAgICAgICB9XG4gICAgICAgIHJldHVybiBjb2xsZWN0aW9uLmZpbHRlckhhc2hlcyhyZXN1bHQpO1xuICAgICAgfSxcblxuICAgICAgZmluZEhhc2gocXVlcnkpOiBDb2xsZWN0aW9uIHtcbiAgICAgICAgLyogVE9ETzogcmVmYWN0b3Ivc2ltcGxpZnkgd2l0aCBmaW5kT25lICovXG4gICAgICAgIC8qIFJ1biBzdWItcXVlcmllcyBmb3IgZWFjaCBwcm9wZXJ0eSBrZXkgKi9cbiAgICAgICAgY29uc3QgcmVzdWx0czogU3RyaW5nU2V0W10gPSBfLnJlZHVjZShcbiAgICAgICAgICBxdWVyeSxcbiAgICAgICAgICAociwgdmFsdWUsIHByb3BOYW1lKSA9PiB7XG4gICAgICAgICAgICAvKiBhcnJheXMgd29yayBhcyBcIk9SXCIgY2xhdXNlICovXG4gICAgICAgICAgICAvKiBUT0RPOiBBZGQgdGVzdHMgKi9cbiAgICAgICAgICAgIGlmIChfLmlzQXJyYXkodmFsdWUpKSB7XG4gICAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgICAgLi4ucixcbiAgICAgICAgICAgICAgICBvck9wZXJhdG9yKHByb3BOYW1lLCB2YWx1ZSwgcHJvcHMpLFxuICAgICAgICAgICAgICBdO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgIGNvbnN0IGFyZ3MgPSBbcHJvcE5hbWUsIHZhbHVlXTtcbiAgICAgICAgICAgIHJldHVybiBbXG4gICAgICAgICAgICAgIC4uLnIsXG4gICAgICAgICAgICAgIHByb3BzLmluZGV4LmhhcyhhcmdzWzBdLCBhcmdzWzFdKSA/XG4gICAgICAgICAgICAgICAgcHJvcHMuaW5kZXguZnJvbShhcmdzWzBdLCBhcmdzWzFdKSA6XG4gICAgICAgICAgICAgICAgU3RyaW5nU2V0LmZyb21FbXB0eSgpLFxuICAgICAgICAgICAgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9LFxuICAgICAgICAgIFtdLFxuICAgICAgICApO1xuICAgICAgICBsZXQgcmVzdWx0OiBTdHJpbmdTZXQ7XG4gICAgICAgIGlmIChyZXN1b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xuICAgICAgaWYgKGMySXRlbSkge1xuICAgICAgICAvKiBUT0RPOiBBdm9pZCByZWhhc2hpbmcgdG8gaW1wcm92ZSBwZXJmb3JtYW5jZSAqL1xuICAgICAgICBpZiAoYzJJdGVtSGFzaCAhPT0gaGFzaCkge1xuICAgICAgICAgIGNoYW5nZXNMaXN0ID0gY2hhbmdlc0xpc3QuYWRkKHtcbiAgICAgICAgICAgIGFmdGVyOiBjMkl0ZW0sXG4gICAgICAgICAgICBiZWZvcmU6IGl0ZW0sXG4gICAgICAgICAgICBpZCxcbiAgICAgICAgICAgIHR5cGU6ICdlZGl0JyxcbiAgICAgICAgICB9KTtcbiAgICAgICAgfVxuICAgICAgICByZW1vdmVJdGVtcy5wdXNoKGMySXRlbUhhc2gpO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgY2hhbmdlc0xpc3QgPSBjaGFuZ2VzTGlzdC5hZGQoe1xuICAgICAgICAgIGlkLFxuICAgICAgICAgIGl0ZW0sXG4gICAgICAgICAgdHlwZTogJ3JlbW92ZScsXG4gICAgICAgIH0pO1xuICAgICAgfVxuICAgIH0pO1xuICAgIGNvbXBhcmluZ0NvbGxlY3Rpb24gPSBjb21wYXJpbmdDb2xsZWN0aW9uLnJlbW92ZUhhc2hlcyhyZW1vdmVJdGVtcyk7XG4gICAgY29tcGFyaW5nQ29sbGVjdGlvbi5mb3JFYWNoKChpdGVtKSA9PiB7XG4gICAgICBjb25zdCBpZCA9IGl0ZW0uaWQ7XG4gICAgICBjaGFuZ2VzTGlzdCA9IGNoYW5nZXNMaXN0LmFkZCh7XG4gICAgICAgIGlkLFxuICAgICAgICBpdGVtLFxuICAgICAgICB0eXBlOiAnYWRkJyxcbiAgICAgIH0pO1xuICAgIH0pO1xuXG4gICAgcmV0dXJuIGNoYW5nZXNMaXN0O1xuICB9XG59XG4iXX0=

@@ -8,3 +8,4 @@ import * as UUID from 'uuid/v4';

export { Graph } from './graph/graph';
export { BidirectionalTupleSet } from './bidirectional-tuple-set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cnQge0dyYXBofSBmcm9tICcuL2dyYXBoL2dyYXBoJztcbmV4cG9ydCB7QmlkaXJlY3Rpb25hbFR1cGxlU2V0fSBmcm9tICcuL2JpZGlyZWN0aW9uYWwtdHVwbGUtc2V0L2JpZGlyZWN0aW9uYWwtdHVwbGUtc2V0JztcbmV4cG9ydCB7VVVJRH07XG4iXX0=

@@ -19,3 +19,3 @@ import { Collection } from '../collection/collection';

}
interface InternalState {
interface IInternalState {
nodes: Collection;

@@ -184,3 +184,3 @@ edges: Collection;

};
constructor(internal: InternalState);
constructor(internal: IInternalState);
toObject(): IGraphObject;

@@ -187,0 +187,0 @@ union(graph2: Graph): Graph;

@@ -8,2 +8,3 @@ import * as UUID from 'uuid/v4';

export { Graph } from './graph/graph';
export { BidirectionalTupleSet } from './bidirectional-tuple-set/bidirectional-tuple-set';
export { UUID };

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"UUID":{"__symbolic":"reference","module":"uuid/v4"},"SSet":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"add":[{"__symbolic":"method"}],"merge":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"mergeHash":[{"__symbolic":"method"}],"mergeArray":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeHash":[{"__symbolic":"method"}],"removeHashes":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"difference":[{"__symbolic":"method"}],"symmetricDifference":[{"__symbolic":"method"}],"intersection":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}],"$":[{"__symbolic":"method"}],"addPlugins":[{"__symbolic":"method"}],"removePlugins":[{"__symbolic":"method"}],"filterPlugins":[{"__symbolic":"method"}],"isSubset":[{"__symbolic":"method"}],"isSuperset":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"hasSet":[{"__symbolic":"method"}],"inSet":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"every":[{"__symbolic":"method"}],"some":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"reduce":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"revertChanges":[{"__symbolic":"method"}],"equals":[{"__symbolic":"method"}],"probEquals":[{"__symbolic":"method"}],"toJSON":[{"__symbolic":"method"}],"isDisjoint":[{"__symbolic":"method"}],"getByHash":[{"__symbolic":"method"}],"hasHash":[{"__symbolic":"method"}],"internalTwoSetsOperations":[{"__symbolic":"method"}],"getSortedKeysArray":[{"__symbolic":"method"}]},"statics":{"fromArray":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"fromArray"},"hashOf":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"hashOf"},"fromJSON":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"fromJSON"},"addPlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"addPlugins"},"removePlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"removePlugins"},"getActivePlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"getActivePlugins"},"filterPlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"filterPlugins"}}},"SMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[null]}],"get":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"hasHash":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"toPairs":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}]}},"PointerMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[null]}],"size":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"keysUnion":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"setMany":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeMany":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"toObject":[{"__symbolic":"method"}],"keysIntersection":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"firstKey":[{"__symbolic":"method"}],"toPairs":[{"__symbolic":"method"}],"keysArray":[{"__symbolic":"method"}],"keysSet":[{"__symbolic":"method"}],"reduce":[{"__symbolic":"method"}]},"statics":{"fromObject":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"PointerMap"},"arguments":[{"props":{"size":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"}},"state":{"__symbolic":"reference","name":"obj"}}]}}}},"MultiMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"add":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"from":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeMany":[{"__symbolic":"method"}],"toObject":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}]}},"Collection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"filterHashes":[{"__symbolic":"method"}],"findOne":[{"__symbolic":"method"}],"findOneHash":[{"__symbolic":"method"}],"findOneHashOrigin":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"findHash":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"merge":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"difference":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeHash":[{"__symbolic":"method"}],"removeHashes":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"getByHash":[{"__symbolic":"method"}],"getByIdHash":[{"__symbolic":"method"}],"getIndex":[{"__symbolic":"method"}],"getMetadata":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}]}},"Graph":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"toObject":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}]},"statics":{"fromEmpty":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Graph"},"member":"fromObject"},"arguments":[{"edges":[],"nodes":[]}]}}}},"ɵa":{"__symbolic":"interface"}},"origins":{"UUID":"./index","SSet":"./sset/sset","SMap":"./smap/smap","PointerMap":"./pointer-map/pointer-map","MultiMap":"./multi-map/multi-map","Collection":"./collection/collection","Graph":"./graph/graph","ɵa":"./sset/sset.types"},"importAs":"@labshare/data-structures"}
{"__symbolic":"module","version":4,"metadata":{"UUID":{"__symbolic":"reference","module":"uuid/v4"},"SSet":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"add":[{"__symbolic":"method"}],"merge":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"mergeHash":[{"__symbolic":"method"}],"mergeArray":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeHash":[{"__symbolic":"method"}],"removeHashes":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"difference":[{"__symbolic":"method"}],"symmetricDifference":[{"__symbolic":"method"}],"intersection":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}],"$":[{"__symbolic":"method"}],"addPlugins":[{"__symbolic":"method"}],"removePlugins":[{"__symbolic":"method"}],"filterPlugins":[{"__symbolic":"method"}],"isSubset":[{"__symbolic":"method"}],"isSuperset":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"hasSet":[{"__symbolic":"method"}],"inSet":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"every":[{"__symbolic":"method"}],"some":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"reduce":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"applyChanges":[{"__symbolic":"method"}],"revertChanges":[{"__symbolic":"method"}],"equals":[{"__symbolic":"method"}],"probEquals":[{"__symbolic":"method"}],"toJSON":[{"__symbolic":"method"}],"isDisjoint":[{"__symbolic":"method"}],"getByHash":[{"__symbolic":"method"}],"hasHash":[{"__symbolic":"method"}],"internalTwoSetsOperations":[{"__symbolic":"method"}],"getSortedKeysArray":[{"__symbolic":"method"}]},"statics":{"fromArray":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"fromArray"},"hashOf":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"hashOf"},"fromJSON":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"fromJSON"},"addPlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"addPlugins"},"removePlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"removePlugins"},"getActivePlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"getActivePlugins"},"filterPlugins":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"SSetStaticMethods"},"arguments":[{}]},"member":"filterPlugins"}}},"SMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[null]}],"get":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"hasHash":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"toPairs":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}]}},"PointerMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[null]}],"size":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"keysUnion":[{"__symbolic":"method"}],"set":[{"__symbolic":"method"}],"setMany":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeMany":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"toObject":[{"__symbolic":"method"}],"keysIntersection":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"firstKey":[{"__symbolic":"method"}],"toPairs":[{"__symbolic":"method"}],"keysArray":[{"__symbolic":"method"}],"keysSet":[{"__symbolic":"method"}],"reduce":[{"__symbolic":"method"}]},"statics":{"fromObject":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"PointerMap"},"arguments":[{"props":{"size":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"}},"state":{"__symbolic":"reference","name":"obj"}}]}}}},"MultiMap":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"add":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"from":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeMany":[{"__symbolic":"method"}],"toObject":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}]}},"Collection":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"filterHashes":[{"__symbolic":"method"}],"findOne":[{"__symbolic":"method"}],"findOneHash":[{"__symbolic":"method"}],"findOneHashOrigin":[{"__symbolic":"method"}],"find":[{"__symbolic":"method"}],"findHash":[{"__symbolic":"method"}],"add":[{"__symbolic":"method"}],"merge":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"difference":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"isEmpty":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}],"removeHash":[{"__symbolic":"method"}],"removeHashes":[{"__symbolic":"method"}],"getOne":[{"__symbolic":"method"}],"map":[{"__symbolic":"method"}],"forEach":[{"__symbolic":"method"}],"filter":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"getByHash":[{"__symbolic":"method"}],"getByIdHash":[{"__symbolic":"method"}],"getIndex":[{"__symbolic":"method"}],"getMetadata":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}]}},"Graph":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"toObject":[{"__symbolic":"method"}],"union":[{"__symbolic":"method"}],"changesFrom":[{"__symbolic":"method"}],"changesTo":[{"__symbolic":"method"}]},"statics":{"fromEmpty":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Graph"},"member":"fromObject"},"arguments":[{"edges":[],"nodes":[]}]}}}},"BidirectionalTupleSet":{"__symbolic":"class","arity":2,"members":{"add":[{"__symbolic":"method"}],"has":[{"__symbolic":"method"}],"inverseHas":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"inverseGet":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"inverseDelete":[{"__symbolic":"method"}],"size":[{"__symbolic":"method"}],"toMap":[{"__symbolic":"method"}],"toInverseMap":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}],"toInverseArray":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"interface"}},"origins":{"UUID":"./index","SSet":"./sset/sset","SMap":"./smap/smap","PointerMap":"./pointer-map/pointer-map","MultiMap":"./multi-map/multi-map","Collection":"./collection/collection","Graph":"./graph/graph","BidirectionalTupleSet":"./bidirectional-tuple-set/bidirectional-tuple-set","ɵa":"./sset/sset.types"},"importAs":"@labshare/data-structures"}

@@ -5,3 +5,3 @@ {

"main": "bundles/labshare-data-structures.umd.js",
"version": "3.1.5",
"version": "3.2.0",
"description": "",

@@ -21,3 +21,3 @@ "contributors": [

"object-hash": "^1.3.0",
"uuid": "^3.3.2",
"uuid": "^3.4.0",
"tslib": "^1.9.0"

@@ -29,41 +29,41 @@ },

"devDependencies": {
"@angular/compiler": "^8.2.0",
"@angular/compiler-cli": "^8.2.0",
"@angular/core": "^8.2.0",
"@commitlint/cli": "^8.1.0",
"@angular/compiler": "^8.2.14",
"@angular/compiler-cli": "^8.2.14",
"@angular/core": "^8.2.14",
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^6.1.3",
"@labshare/semantic-release-config": "^1.0.0",
"@labshare/semantic-release-config": "^1.1.3",
"@ngtools/webpack": "^1.3.3",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/commit-analyzer": "^6.2.0",
"@semantic-release/exec": "^3.3.5",
"@semantic-release/git": "^7.0.16",
"@semantic-release/github": "^5.4.2",
"@semantic-release/npm": "^5.1.13",
"@semantic-release/release-notes-generator": "^7.2.1",
"@types/jasmine": "^2.5.54",
"@types/lodash": "^4.14.109",
"@semantic-release/changelog": "^3.0.6",
"@semantic-release/commit-analyzer": "^6.3.3",
"@semantic-release/exec": "^3.3.8",
"@semantic-release/git": "^7.0.18",
"@semantic-release/github": "^5.5.8",
"@semantic-release/npm": "^5.3.5",
"@semantic-release/release-notes-generator": "^7.3.5",
"@types/jasmine": "^2.8.16",
"@types/lodash": "^4.14.155",
"hard-source-webpack-plugin": "^0.10.1",
"husky": "^0.14.3",
"istanbul-instrumenter-loader": "^3.0.1",
"jasmine-core": "^3.1.0",
"karma": "^2.0.2",
"jasmine-core": "^3.5.0",
"karma": "^5.0.9",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-coverage-istanbul-reporter": "^2.0.0",
"karma-coverage": "^2.0.2",
"karma-coverage-istanbul-reporter": "^2.1.1",
"karma-jasmine": "^1.1.0",
"karma-phantomjs-launcher": "^1.0.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-typescript": "^4.1.1",
"karma-webpack": "^4.0.0-beta.0",
"karma-typescript": "^5.0.3",
"karma-webpack": "^4.0.2",
"lodash": "^4.17.15",
"ng-packagr": "^5.4.3",
"ng-packagr": "^5.7.1",
"null-loader": "^0.1.1",
"semantic-release": "^15.13.20",
"semantic-release": "^15.14.0",
"ts-loader": "^4.3.0",
"tslint": "^5.9.1",
"typedoc": "^0.15.0",
"typescript": "^3.5.3",
"webpack": "4.10.1",
"webpack-cli": "^3.2.1",
"tslint": "^5.20.1",
"typedoc": "^0.15.8",
"typescript": ">=3.4.0 <3.6.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11",
"webpack-node-externals": "^1.7.2"

@@ -70,0 +70,0 @@ },

@@ -7,2 +7,2 @@ [![Build Status](https://travis-ci.com/LabShare/data-structures.svg?branch=master)](https://travis-ci.com/LabShare/data-structures)

[Documentation](https://labshare.github.io/data-structures)
[Documentation](https://labshare.github.io/data-structures)

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 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

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 not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc