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

@hpcc-js/util

Package Overview
Dependencies
Maintainers
1
Versions
156
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hpcc-js/util - npm Package Compare versions

Comparing version 0.0.72 to 0.0.73

2

dist/index.min.js

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

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t["@hpcc-js/util"]={})}(this,function(t){"use strict";function e(t,e){function r(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function r(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})}function n(t,e){function r(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,o&&(i=o[2&r[0]?"return":r[0]?"throw":"next"])&&!(i=i.call(o,r[1])).done)return i;switch(o=0,i&&(r=[0,i.value]),r[0]){case 0:case 1:i=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,o=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(i=u.trys,!(i=i.length>0&&i[i.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!i||r[1]>i[0]&&r[1]<i[3])){u.label=r[1];break}if(6===r[0]&&u.label<i[1]){u.label=i[1],i=r;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(r);break}i[2]&&u.ops.pop(),u.trys.pop();continue}r=e.call(t,u)}catch(t){r=[6,t],o=0}finally{n=i=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}var n,o,i,s,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:r(0),throw:r(1),return:r(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function o(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function i(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function u(t,e){if(0===e.length)return t;for(var r=0;r<e.length;++r){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t<0?-2*t:t}function a(t,e,r,n){var o=u(u(u(t,r),function(t){return Object.prototype.toString.call(t)}(e)),typeof e);return null===e?u(o,"null"):void 0===e?u(o,"undefined"):"object"==typeof e?-1!==n.indexOf(e)?u(o,"[Circular]"+r):(n.push(e),function(t,e,r){return Object.keys(e).sort().reduce(function(t,n){return a(t,e[n],n,r)},t)}(o,e,n)):u(o,e.toString())}function c(t){return function(t,e){for(;t.length<e;)t="0"+t;return t}(a(0,t,"",[]).toString(16),8)}function h(t,e){return void 0===e&&(e=!1),e&&M.filter(t),new F(t)}function f(t,e){if(void 0!==t&&void 0!==e){for(var r=0,n=t.split(".");r<n.length;r++){var o=n[r];if(!e.hasOwnProperty(o))return;e=e[o]}return e}}function p(t,e){var r={};for(var n in e){var o=e[n];o instanceof Array||"object"==typeof o&&(o=l(t[n],o)),n in t&&(t[n]===o||n in r&&r[n]===o)||(t[n]=o)}return t}function l(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if("object"!=typeof t)throw new Error('Destination "'+t+'" must be an object.');for(var n=0,o=e;n<o.length;n++){p(t,o[n])}return t}function d(t,e){if("string"!=typeof e)return t;if(0===e.length)return t;for(;0===t.indexOf(e);)t=t.substring(1);for(;v(t,e);)t=t.substring(0,t.length-1);return t}function v(t,e,r){var n=t.toString();("number"!=typeof r||!isFinite(r)||Math.floor(r)!==r||r>n.length)&&(r=n.length),r-=e.length;var o=n.lastIndexOf(e,r);return-1!==o&&o===r}function y(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}var g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},_=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},w=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c(_({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t){return this._cache[this._calcID(t)]=t,t},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(e()):null)},t}(),b=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return c(_({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t,e){return this._cache[this._calcID(t)]=e,e},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(t,e()):Promise.resolve(null))},t}(),m=function(){function t(t){if(this.store={},t)for(var e in t)this.set(e,t[e])}return t.prototype.set=function(t,e){var r=this.store[t];return this.store[t]=e,r},t.prototype.get=function(t){return this.store[t]},t.prototype.has=function(t){return void 0!==this.store[t]},t.prototype.remove=function(t){delete this.store[t]},t.prototype.keys=function(){var t=[];for(var e in this.store)t.push(e);return t},t.prototype.values=function(){var t=[];for(var e in this.store)t.push(this.store[e]);return t},t}(),E=function(t){function r(e){return t.call(this,e)||this}return e(r,t),r.prototype.set=function(e,r){return t.prototype.set.call(this,e.toLowerCase(),r)},r.prototype.get=function(e){return t.prototype.get.call(this,e.toLowerCase())},r.prototype.has=function(e){return t.prototype.has.call(this,e.toLowerCase())},r.prototype.remove=function(e){return t.prototype.remove.call(this,e.toLowerCase())},r}(m),S="definition",O=function(){function t(t,e,r,n){this._graph=t,this._parent=e,this._id=r,this._attrs=new m(n)}return t.prototype.className=function(){return this.constructor.name},t.prototype.id=function(){return this._id},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return this._parent},t.prototype.hasECLDefinition=function(){return void 0!==this._attrs.get(S)},t.prototype.getECLDefinition=function(){var t=/([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(this._attrs.get(S));if(t){var e=t[1],r=t[2],n=t[3];return e.replace("/./","/"),{id:this.id(),file:e,line:+r,column:+n}}throw new Error("Bad definition: "+this._attrs.get(S))},t}(),x=function(t){function r(e,r,n,o){void 0===o&&(o={});var i=t.call(this,e,r,n,o)||this;return i._subgraphs=new m,i._vertices=new m,i._edges=new m,r&&r.addSubgraph(i),i}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeSubgraph(this),this._edges.values().forEach(function(e){return t._graph.destroyEdge(e)}),this._vertices.values().forEach(function(e){return t._graph.destroyVertex(e)}),this._subgraphs.values().forEach(function(e){return t._graph.destroySubgraph(e)})},r.prototype.remove=function(){this._graph.destroySubgraph(this)},r.prototype.createSubgraph=function(t,e){return this._graph.createSubgraph(this,t,e)},r.prototype.addSubgraph=function(t){if(this._subgraphs.has(t.id()))throw new Error("Subgraph already exists");this._subgraphs.set(t.id(),t)},r.prototype.removeSubgraph=function(t){if(!this._subgraphs.has(t.id()))throw new Error("Subgraph does not exist");this._subgraphs.remove(t.id())},r.prototype.createVertex=function(t,e,r){return this._graph.createVertex(this,t,e,r)},r.prototype.addVertex=function(t){if(this._vertices.has(t.id()))throw new Error("Vertex already exists");this._vertices.set(t.id(),t)},r.prototype.removeVertex=function(t){if(!this._vertices.has(t.id()))throw new Error("Vertex does not exist");this._vertices.remove(t.id())},r.prototype.createEdge=function(t,e,r,n){return this._graph.createEdge(this,t,e,r,n)},r.prototype.addEdge=function(t){if(this._edges.has(t.id()))throw new Error("Edge already exists");this._edges.set(t.id(),t)},r.prototype.removeEdge=function(t){if(!this._edges.has(t.id()))throw new Error("Edge does not exist");this._edges.remove(t.id())},r.prototype.add=function(t){t instanceof r?this.addSubgraph(t):t instanceof D?this.addVertex(t):this.addEdge(t)},r.prototype.subgraphs=function(){return this._subgraphs.values()},r.prototype.vertices=function(){return this._vertices.values()},r.prototype.edges=function(){return this._edges.values()},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!1),this.hasECLDefinition())return this.getECLDefinition();var e=this.vertices();t&&(e=e.reverse());var r=null;return e.some(function(e){return!!(r=e.getNearestDefinition(t))}),r},r}(O),D=function(t){function r(e,r,n,o,i){var s=t.call(this,e,r,n,i)||this;return s.inEdges=[],s.outEdges=[],s._label=o,r.addVertex(s),s}return e(r,t),r.prototype.destroy=function(){var t=this;this._parent&&this._parent.removeVertex(this),this.inEdges.forEach(function(e){return t._graph.destroyEdge(e)}),this.outEdges.forEach(function(e){return t._graph.destroyEdge(e)})},r.prototype.label=function(){return this._label},r.prototype.addInEdge=function(t){this.inEdges.push(t)},r.prototype.removeInEdge=function(t){var e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)},r.prototype.addOutEdge=function(t){this.outEdges.push(t)},r.prototype.removeOutEdge=function(t){var e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)},r.prototype.getNearestDefinition=function(t){if(void 0===t&&(t=!0),this.hasECLDefinition())return this.getECLDefinition();var e=null;return this.inEdges.some(function(r){return!!(e=r.getNearestDefinition(t))}),e},r}(O),L=function(t){function r(e,r,n,o,i,s){var u=t.call(this,e,r,n,s)||this;if(!o)throw new Error("Missing source vertex");if(!i)throw new Error("Missing target vertex");return r.addEdge(u),u.source=o,u.source.addOutEdge(u),u.target=i,u.target.addInEdge(u),u}return e(r,t),r.prototype.sourceID=function(){return this.source.id()},r.prototype.targetID=function(){return this.target.id()},r.prototype.destroy=function(){this._parent&&this._parent.removeEdge(this),this.source.removeOutEdge(this),this.target.removeInEdge(this)},r.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this.hasECLDefinition()?this.getECLDefinition():this.source.getNearestDefinition(t)},r}(x),C=function(){function t(t,e){this._allSubgraphs=new m,this._allVertices=new m,this._allEdges=new m,this._attrs=new m,this._root=new x(this,null,t,e),this._allSubgraphs.set(t,this._root)}return t.prototype.className=function(){return"Graph"},t.prototype.id=function(){return this._root.id()},t.prototype.attrs=function(){return this._attrs},t.prototype.parent=function(){return null},t.prototype.remove=function(){},t.prototype.subgraphs=function(){return this._root.subgraphs()},t.prototype.vertices=function(){return this._root.vertices()},t.prototype.edges=function(){return this._root.edges()},t.prototype.createSubgraph=function(t,e,r){if(this._allSubgraphs.has(e))throw new Error("Subgraph already exists");var n=new x(this,this._allSubgraphs.get(t.id()),e,r);return this._allSubgraphs.set(e,n),n},t.prototype.destroySubgraph=function(t){var e=this._allSubgraphs.get(t.id());if(!e)throw new Error("Subgraph does not exist");this._allSubgraphs.remove(e.id()),e.destroy()},t.prototype.createVertex=function(t,e,r,n){if(this._allVertices.has(e))throw new Error("Vertex already exists");var o=new D(this,this._allSubgraphs.get(t.id()),e,r,n);return this._allVertices.set(e,o),o},t.prototype.destroyVertex=function(t){var e=this._allVertices.get(t.id());if(!e)throw new Error("Vertex does not exist");this._allVertices.remove(e.id()),e.destroy()},t.prototype.createEdge=function(t,e,r,n,o){if(this._allEdges.has(e))throw new Error("Edge already exists");var i=new L(this,this._allSubgraphs.get(t.id()),e,this._allVertices.get(r),this._allVertices.get(n),o);return this._allEdges.set(e,i),i},t.prototype.destroyEdge=function(t){var e=this._allEdges.get(t.id());if(!e)throw new Error("Edge does not exist");this._allEdges.remove(e.id()),e.destroy()},t.prototype.allSubgraph=function(t){return this._allSubgraphs.get(t)},t.prototype.allSubgraphs=function(){var t=this;return this._allSubgraphs.values().filter(function(e){return e!==t._root})},t.prototype.allVertex=function(t){return this._allVertices.get(t)},t.prototype.allVertices=function(){return this._allVertices.values()},t.prototype.allEdge=function(t){return this._allEdges.get(t)},t.prototype.allEdges=function(){return this._allEdges.values()},t.prototype.getNearestDefinition=function(t){return void 0===t&&(t=!1),this._root.getNearestDefinition(t)},t.prototype.breakpointLocations=function(t){for(var e=[],r=0,n=this._allVertices.values();r<n.length;r++){var o=n[r];if(o.hasECLDefinition()){var i=o.getECLDefinition();(i&&!t||t===i.file)&&e.push(i)}}return e.sort(function(t,e){return t.line-e.line})},t}(),k=new Function("try{return global;}catch(e){return window;}")(),j=new Function("try{return this===window;}catch(e){return false;}"),I=new Function("try{return this===global;}catch(e){return false;}"),T=new Function("try{return process.env.TRAVIS;}catch(e){return false;}"),N=function(){function t(){this.stack=[]}return t.prototype.push=function(t){return this.stack.push(t),t},t.prototype.pop=function(){return this.stack.pop()},t.prototype.top=function(){return this.stack.length?this.stack[this.stack.length-1]:void 0},t.prototype.depth=function(){return this.stack.length},t}();!function(t){t[t.debug=0]="debug",t[t.info=1]="info",t[t.notice=2]="notice",t[t.warning=3]="warning",t[t.error=4]="error",t[t.critical=5]="critical",t[t.alert=6]="alert",t[t.emergency=7]="emergency"}(t.Level||(t.Level={}));var P={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},V=function(){function e(){}return e.prototype.write=function(e,r,n,o){I?console.log("["+e+"] "+t.Level[r].toUpperCase()+" "+n+": "+o):console.log("["+e+"] %c"+t.Level[r].toUpperCase()+"%c "+n+": "+o,"color:"+P[t.Level[r]],"")},e}(),A=function(){function e(){this._levelStack=new N,this._level=t.Level.info,this._filter="",this._writer=new V}return e.Instance=function(){return this._instance||(this._instance=new this)},e.prototype.stringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r},2)},e.prototype.writer=function(t){return void 0===t?this._writer:(this._writer=t,this)},e.prototype.log=function(t,e,r){t<this._level||this._filter&&this._filter!==e||("string"!=typeof r&&(r=this.stringify(r)),this._writer.write((new Date).toISOString(),t,e,r))},e.prototype.debug=function(e,r){this.log(t.Level.debug,e,r)},e.prototype.info=function(e,r){this.log(t.Level.info,e,r)},e.prototype.notice=function(e,r){this.log(t.Level.notice,e,r)},e.prototype.warning=function(e,r){this.log(t.Level.warning,e,r)},e.prototype.error=function(e,r){this.log(t.Level.error,e,r)},e.prototype.critical=function(e,r){this.log(t.Level.critical,e,r)},e.prototype.alert=function(e,r){this.log(t.Level.alert,e,r)},e.prototype.emergency=function(e,r){this.log(t.Level.emergency,e,r)},e.prototype.level=function(t){return void 0===t?this._level:(this._level=t,this)},e.prototype.pushLevel=function(t){return this._levelStack.push(this._level),this._level=t,this},e.prototype.popLevel=function(){return this._level=this._levelStack.pop(),this},e.prototype.filter=function(t){return void 0===t?this._filter:(this._filter=t,this)},e}(),M=A.Instance(),F=function(){function t(t){this._scopeID=t}return t.prototype.debug=function(t){M.debug(this._scopeID,t)},t.prototype.info=function(t){M.info(this._scopeID,t)},t.prototype.notice=function(t){M.notice(this._scopeID,t)},t.prototype.warning=function(t){M.warning(this._scopeID,t)},t.prototype.error=function(t){M.error(this._scopeID,t)},t.prototype.critical=function(t){M.critical(this._scopeID,t)},t.prototype.alert=function(t){M.alert(this._scopeID,t)},t.prototype.emergency=function(t){M.emergency(this._scopeID,t)},t.prototype.pushLevel=function(t){return M.pushLevel(t),this},t.prototype.popLevel=function(){return M.popLevel(),this},t}(),X=h("loader"),R="function"==typeof require?"object"==typeof module&&"object"==typeof module.exports?"cjs":"amd":"iife",q=function(){function t(t,e,r){this.eventTarget=t,this.eventID=e,this.callback=r}return t.prototype.release=function(){this.eventTarget.removeObserver(this.eventID,this.callback)},t.prototype.unwatch=function(){this.release()},t}(),G=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._eventObservers={}}return t.prototype.addObserver=function(t,e){var r=this._eventObservers[t];return r||(r=[],this._eventObservers[t]=r),r.push(e),new q(this,t,e)},t.prototype.removeObserver=function(t,e){var r=this._eventObservers[t];if(r)for(var n=r.length-1;n>=0;--n)r[n]===e&&r.splice(n,1);return this},t.prototype.dispatchEvent=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this._eventObservers[t];if(n)for(var o=0,i=n;o<i.length;o++){i[o].apply(void 0,e)}return this},t.prototype._hasObserver=function(t){var e=this._eventObservers[t];for(var r in e)if(e[r])return!0;return!1},t.prototype.hasObserver=function(t){if(void 0!==t)return this._hasObserver(t);for(var e in this._eventObservers)if(this._hasObserver(e))return!0;return!1},t}(),H=function(){function t(t){this.name="",this.$={},this._children=[],this.content="",this.name=t}return t.prototype.appendAttribute=function(t,e){this.$[t]=e},t.prototype.appendContent=function(t){this.content+=t},t.prototype.appendChild=function(t){this._children.push(t)},t.prototype.children=function(t){return void 0===t?this._children:this._children.filter(function(e){return e.name===t})},t}(),U=function(){function t(){this.stack=new N}return t.prototype.walkDoc=function(t){var e=this._startXMLNode(t);if(t.attributes)for(n=0;n<t.attributes.length;++n){var r=t.attributes.item(n);this.attributes(r.nodeName,r.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(var n=0;n<t.childNodes.length;++n){var o=t.childNodes.item(n);o.nodeType===o.TEXT_NODE?this.characters(o.nodeValue):this.walkDoc(o)}this.endXMLNode(this.stack.pop())},t.prototype._startXMLNode=function(t){var e=new H(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)},t.prototype.parse=function(t){var e=(new DOMParser).parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()},t.prototype.startDocument=function(){},t.prototype.endDocument=function(){},t.prototype.startXMLNode=function(t){},t.prototype.endXMLNode=function(t){},t.prototype.attributes=function(t,e){this.stack.top().appendAttribute(t,e)},t.prototype.characters=function(t){this.stack.top().appendContent(t)},t}(),Y=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return e(r,t),r.prototype.startXMLNode=function(e){t.prototype.startXMLNode.call(this,e),e.name},r.prototype.endXMLNode=function(e){e.name,t.prototype.endXMLNode.call(this,e)},r}(U),B=function(){function t(){this._espState={},this._espStateCache={},this._events=new G,this._monitorTickCount=0}return t.prototype.clear=function(t){this._espState={},this._espStateCache={},void 0!==t&&this.set(t),this._monitorTickCount=0},t.prototype.get=function(t,e){return void 0===t?this._espState:this.has(t)?this._espState[t]:e},t.prototype.set=function(t,e,r){return void 0===r&&(r=!1),"string"==typeof t?this.setSingle(t,e,r):this.setAll(t)},t.prototype.setSingle=function(t,e,r){var n=this._espStateCache[t],o=c(e);if(n!==o){this._espStateCache[t]=o;var i=this._espState[t];this._espState[t]=e;var s={id:t,oldValue:i,newValue:e};return r||(this._events.dispatchEvent("propChanged",s),this._events.dispatchEvent("changed",[s])),s}return null},t.prototype.setAll=function(t){var e=[];for(var r in t)if(t.hasOwnProperty(r)){var n=this.setSingle(r,t[r],!0);n&&e.push(n)}if(e.length){for(var o=0,i=e;o<i.length;o++){var s=i[o];this._events.dispatchEvent("propChanged",s)}this._events.dispatchEvent("changed",e)}return e},t.prototype.has=function(t){return void 0!==this._espState[t]},t.prototype.addObserver=function(t,e,r){if(this.isCallback(e)){if("changed"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,e)}if("propChanged"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,function(t){t.id===e&&r(t)})},t.prototype.on=function(t,e,r){if(this.isCallback(e))switch(t){case"changed":this._events.addObserver(t,e)}else switch(t){case"propChanged":this._events.addObserver(t,function(t){t.id===e&&r(t)})}return this},t.prototype.isCallback=function(t){return"function"==typeof t},t.prototype.hasEventListener=function(){return this._events.hasObserver()},t.prototype.refresh=function(t){return void 0===t&&(t=!1),r(this,void 0,void 0,function(){return n(this,function(t){switch(t.label){case 0:return[4,Promise.resolve()];case 1:return t.sent(),[2,this]}})})},t.prototype._monitor=function(){var t=this;this._monitorHandle?this._monitorTickCount=0:this._monitorHandle=setTimeout(function(){(t.hasEventListener()?t.refresh(!0):Promise.resolve()).then(function(){t._monitor()}),delete t._monitorHandle},this._monitorTimeoutDuraction())},t.prototype._monitorTimeoutDuraction=function(){return++this._monitorTickCount,this._monitorTickCount<=1?0:3e4},t.prototype.watch=function(t,e){var r=this;if(void 0===e&&(e=!0),"function"!=typeof t)throw new Error("Invalid Callback");e&&setTimeout(function(){var e=r.get(),n=[];for(var o in e)e.hasOwnProperty(e)&&n.push({id:o,newValue:e[o],oldValue:void 0});t(n)},0);var n=this.addObserver("changed",t);return this._monitor(),n},t}(),J="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};(function(t,e){return e={exports:{}},t(e,e.exports),e.exports})(function(t,e){t.exports=function(){function t(t){return"function"==typeof t}function e(){var t=setTimeout;return function(){return t(r,1)}}function r(){for(var t=0;t<S;t+=2){var e=T[t],r=T[t+1];e(r),T[t]=void 0,T[t+1]=void 0}S=0}function n(){try{var t=y("vertx");return O=t.runOnLoop||t.runOnContext,function(){if(void 0!==O)return function(){O(r)};return e()}()}catch(t){return e()}}function o(t,e){var r=arguments,n=this,o=new this.constructor(s);void 0===o[P]&&_(o);var i=n._state;return i?function(){var t=r[i-1];D(function(){return g(i,o,t,n._result)})}():l(n,o,t,e),o}function i(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(s);return c(e,t),e}function s(){}function u(t){try{return t.then}catch(t){return F.error=t,F}}function a(e,r,n){r.constructor===e.constructor&&n===o&&r.constructor.resolve===i?function(t,e){e._state===A?f(t,e._result):e._state===M?p(t,e._result):l(e,void 0,function(e){return c(t,e)},function(e){return p(t,e)})}(e,r):n===F?(p(e,F.error),F.error=null):void 0===n?f(e,r):t(n)?function(t,e,r){D(function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?c(t,r):f(t,r))},function(e){n||(n=!0,p(t,e))},t._label);!n&&o&&(n=!0,p(t,o))},t)}(e,r,n):f(e,r)}function c(t,e){t===e?p(t,new TypeError("You cannot resolve a promise with itself")):!function(t){var e=typeof t;return null!==t&&("object"===e||"function"===e)}(e)?f(t,e):a(t,e,u(e))}function h(t){t._onerror&&t._onerror(t._result),d(t)}function f(t,e){t._state===V&&(t._result=e,t._state=A,0!==t._subscribers.length&&D(d,t))}function p(t,e){t._state===V&&(t._state=M,t._result=e,D(h,t))}function l(t,e,r,n){var o=t._subscribers,i=o.length;t._onerror=null,o[i]=e,o[i+A]=r,o[i+M]=n,0===i&&t._state&&D(d,t)}function d(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?g(r,n,o,i):o(i);t._subscribers.length=0}}function v(){this.error=null}function g(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,h=void 0;if(i){if((s=function(t,e){try{return t(e)}catch(t){return X.error=t,X}}(n,o))===X?(h=!0,u=s.error,s.error=null):a=!0,r===s)return void p(r,new TypeError("A promises callback cannot return that same promise."))}else s=o,a=!0;r._state!==V||(i&&a?c(r,s):h?p(r,u):e===A?f(r,s):e===M&&p(r,s))}function _(t){t[P]=R++,t._state=void 0,t._result=void 0,t._subscribers=[]}function w(t,e){this._instanceConstructor=t,this.promise=new t(s),this.promise[P]||_(this.promise),E(e)?(this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?f(this.promise,this._result):(this.length=this.length||0,this._enumerate(e),0===this._remaining&&f(this.promise,this._result))):p(this.promise,new Error("Array Methods must be provided an Array"))}function b(t){this[P]=R++,this._result=this._state=void 0,this._subscribers=[],s!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof b?function(t,e){try{e(function(e){c(t,e)},function(e){p(t,e)})}catch(e){p(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}var m=void 0;m=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var E=m,S=0,O=void 0,x=void 0,D=function(t,e){T[S]=t,T[S+1]=e,2===(S+=2)&&(x?x(r):N())};var L="undefined"!=typeof window?window:void 0,C=L||{},k=C.MutationObserver||C.WebKitMutationObserver,j="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),I="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;var T=new Array(1e3);var N=void 0;N=j?function(){return process.nextTick(r)}:k?function(){var t=0,e=new k(r),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}():I?function(){var t=new MessageChannel;return t.port1.onmessage=r,function(){return t.port2.postMessage(0)}}():void 0===L&&"function"==typeof y?n():e();var P=Math.random().toString(36).substring(16);var V=void 0,A=1,M=2,F=new v;var X=new v;var R=0;w.prototype._enumerate=function(t){for(var e=0;this._state===V&&e<t.length;e++)this._eachEntry(t[e],e)},w.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===i){var c=u(t);if(c===o&&t._state!==V)this._settledAt(t._state,e,t._result);else if("function"!=typeof c)this._remaining--,this._result[e]=t;else if(r===b){var h=new r(s);a(h,t,c),this._willSettleAt(h,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},w.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===V&&(this._remaining--,t===M?p(n,r):this._result[e]=r),0===this._remaining&&f(n,this._result)},w.prototype._willSettleAt=function(t,e){var r=this;l(t,void 0,function(t){return r._settledAt(A,e,t)},function(t){return r._settledAt(M,e,t)})};b.all=function(t){return new w(this,t).promise},b.race=function(t){var e=this;return new e(E(t)?function(r,n){for(var o=t.length,i=0;i<o;i++)e.resolve(t[i]).then(r,n)}:function(t,e){return e(new TypeError("You must pass an array to race."))})},b.resolve=i,b.reject=function(t){var e=new this(s);return p(e,t),e},b._setScheduler=function(t){x=t},b._setAsap=function(t){D=t},b._asap=D,b.prototype={constructor:b,then:o,catch:function(t){return this.then(null,t)}};return b.polyfill=function(){var t=void 0;if(void 0!==J)t=J;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=b},b.Promise=b,b}()}).polyfill();t.find=function(t,e){if(null==t)throw new TypeError('"o" is null or not defined');var r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},t.compare=function(t,e){for(var r={unchanged:[],removed:[],added:e.slice(0)},n=0,o=t;n<o.length;n++){var i=o[n],s=r.added.indexOf(i);s>=0?(r.unchanged.push(i),r.added.splice(s,1)):r.removed.push(i)}return r},t.Cache=w,t.AsyncCache=b,t.debounce=function(t,e){var r={};return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=c(n);return r[i]||(r[i]={clockStart:Date.now(),promise:t.apply(void 0,n).then(function(t){return void 0===e?r[i]=null:setTimeout(function(){r[i]=null},Math.max(e-(Date.now()-r[i].clockStart),0)),t}).catch(function(t){throw r[i]=null,t})}),r[i].promise}},t.promiseTimeout=function(t,e){var r,n=new Promise(function(e,n){r=setTimeout(function(){clearTimeout(r),n("Timed out in "+t+"ms.")},t)});return Promise.race([e,n]).then(function(t){return clearTimeout(r),t}).catch(function(t){throw clearTimeout(r),t})},t.Dictionary=m,t.DictionaryNoCase=E,t.espTime2Seconds=function(t){if(!t)return 0;if(!isNaN(Number(t)))return Number(t);var e=t.indexOf("ns");if(-1!==e)return parseFloat(t.substr(0,e))/1e9;var r=t.indexOf("ms");if(-1!==r)return parseFloat(t.substr(0,r))/1e3;var n=t.indexOf("s");if(-1!==n&&-1===t.indexOf("days"))return parseFloat(t.substr(0,n));for(var o=t.split(" days "),i=o.length>1?parseFloat(o[0]):0,s=0,u=(o.length>1?o[1]:o[0]).split(":").reverse(),a=0;a<u.length;++a)s+=parseFloat(u[a])*Math.pow(60,a);return 24*i*60*60+s},t.Graph=C,t.hashSum=c,t.dynamicImport=function(t,e){var r;switch(R){case"amd":r=new Promise(function(e,r){require([t],e,r)});case"cjs":r=Promise.resolve().then(function(){return require(t)});case"iife":default:r=new Promise(function(r,n){var o=k[e||t];o?r(o):n()})}return r.catch(function(e){return X.error("dynamicImport(["+t+"], ...) failed"),null})},t.Logging=A,t.logger=M,t.ScopedLogging=F,t.scopedLogger=h,t.inner=f,t.exists=function(t,e){return void 0!==f(t,e)},t.deepMixin=l,t.deepMixinT=function(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return l.apply(void 0,[t].concat(e))},t.safeStringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r})},t.Observable=G,t.root=k,t.isBrowser=j,t.isNode=I,t.isTravis=T,t.XMLNode=H,t.SAXStackParser=U,t.xml2json=function(t){var e=new Y;return e.parse(t),e.root},t.Stack=N,t.StateObject=B,t.trim=d,t.endsWith=v,t.join=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(t.length&&t[0].length&&"/"===t[0].charAt(0)?"/":"")+t.map(function(t){return d(t,"/")}).join("/")},t.__extends=e,t.__assign=_,t.__rest=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]]);return r},t.__decorate=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},t.__param=function(t,e){return function(r,n){e(r,n,t)}},t.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},t.__awaiter=r,t.__generator=n,t.__exportStar=function(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])},t.__values=o,t.__read=i,t.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(i(arguments[e]));return t},t.__await=s,t.__asyncGenerator=function(t,e,r){function n(t){h[t]&&(c[t]=function(e){return new Promise(function(r,n){f.push([t,e,r,n])>1||o(t,e)})})}function o(t,e){try{!function(t){t.value instanceof s?Promise.resolve(t.value.v).then(i,u):a(f[0][2],t)}(h[t](e))}catch(t){a(f[0][3],t)}}function i(t){o("next",t)}function u(t){o("throw",t)}function a(t,e){t(e),f.shift(),f.length&&o(f[0][0],f[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,h=r.apply(t,e||[]),f=[];return c={},n("next"),n("throw"),n("return"),c[Symbol.asyncIterator]=function(){return this},c},t.__asyncDelegator=function(t){function e(e,o){t[e]&&(r[e]=function(r){return(n=!n)?{value:s(t[e](r)),done:"return"===e}:o?o(r):r})}var r,n;return r={},e("next"),e("throw",function(t){throw t}),e("return"),r[Symbol.iterator]=function(){return this},r},t.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof o?o(t):t[Symbol.iterator]()},t.__makeTemplateObject=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t["@hpcc-js/util"]={})}(this,function(t){"use strict";var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])};function r(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}var n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function o(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){t.done?o(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})}function i(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=n[2&i[0]?"return":i[0]?"throw":"next"])&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[0,o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}function s(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function u(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function a(t){return this instanceof a?(this.v=t,this):new a(t)}function c(t,e){if(0===e.length)return t;for(var r=0;r<e.length;++r){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t<0?-2*t:t}function h(t,e,r,n){var o,i=c(c(c(t,r),(o=e,Object.prototype.toString.call(o))),typeof e);return null===e?c(i,"null"):void 0===e?c(i,"undefined"):"object"==typeof e?-1!==n.indexOf(e)?c(i,"[Circular]"+r):(n.push(e),function(t,e,r){return Object.keys(e).sort().reduce(function(t,n){return h(t,e[n],n,r)},t)}(i,e,n)):c(i,e.toString())}function f(t){return function(t,e){for(;t.length<e;)t="0"+t;return t}(h(0,t,"",[]).toString(16),8)}var p=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return f(n({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t){return this._cache[this._calcID(t)]=t,t},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(e()):null)},t}(),l=function(){function t(t){this._cache={},this._calcID=t}return t.hash=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return f(n({},t))},t.prototype.has=function(t){return this._calcID(t)in this._cache},t.prototype.set=function(t,e){return this._cache[this._calcID(t)]=e,e},t.prototype.get=function(t,e){var r=this._cache[this._calcID(t)];return r||(e?this.set(t,e()):Promise.resolve(null))},t}();var d=function(){function t(t){if(this.store={},t)for(var e in t)this.set(e,t[e])}return t.prototype.set=function(t,e){var r=this.store[t];return this.store[t]=e,r},t.prototype.get=function(t){return this.store[t]},t.prototype.has=function(t){return void 0!==this.store[t]},t.prototype.remove=function(t){delete this.store[t]},t.prototype.keys=function(){var t=[];for(var e in this.store)t.push(e);return t},t.prototype.values=function(){var t=[];for(var e in this.store)t.push(this.store[e]);return t},t}(),v=function(t){function e(e){return t.call(this,e)||this}return r(e,t),e.prototype.set=function(e,r){return t.prototype.set.call(this,e.toLowerCase(),r)},e.prototype.get=function(e){return t.prototype.get.call(this,e.toLowerCase())},e.prototype.has=function(e){return t.prototype.has.call(this,e.toLowerCase())},e.prototype.remove=function(e){return t.prototype.remove.call(this,e.toLowerCase())},e}(d);var y=function(){return function(t,e){this.props={},this._graph=t,this.parent=e}}(),g=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.subgraphs=[],o.vertices=[],o.edges=[],r&&r._addSubgraph(o),o._=n,o}return r(e,t),e.prototype.remove=function(t){void 0===t&&(t=!0),this._graph.removeSubgraph(this,t)},e.prototype.createSubgraph=function(t){return this._graph.createSubgraph(this,t)},e.prototype._addSubgraph=function(t){if(this.subgraphs.indexOf(t)>=0)throw new Error("Subgraph already exists");this.subgraphs.push(t)},e.prototype._removeSubgraph=function(t){var e=this.subgraphs.indexOf(t);if(e<0)throw new Error("Subgraph does not exist");this.subgraphs.splice(e,1)},e.prototype.removeAllSubgraphs=function(){for(var t=this.subgraphs.length-1;t>=0;--t)this._graph.removeSubgraph(this.subgraphs[t],!0)},e.prototype.createVertex=function(t){return this._graph.createVertex(this,t)},e.prototype._addVertex=function(t){if(this.vertices.indexOf(t)>=0)throw new Error("Vertex already exists");this.vertices.push(t)},e.prototype._removeVertex=function(t){var e=this.vertices.indexOf(t);if(e<0)throw new Error("Vertex does not exist");this.vertices.splice(e,1)},e.prototype.removeAllVertices=function(){for(var t=this.vertices.length-1;t>=0;--t)this._graph.removeVertex(this.vertices[t],!0)},e.prototype.createEdge=function(t,e,r){return this._graph.createEdge(this,t,e,r)},e.prototype._addEdge=function(t){if(this.edges.indexOf(t)>=0)throw new Error("Edge already exists");this.edges.push(t)},e.prototype._removeEdge=function(t){var e=this.edges.indexOf(t);if(e<0)throw new Error("Edge does not exist");this.edges.splice(e,1)},e.prototype._add=function(t){t instanceof e?this._addSubgraph(t):t instanceof _?this._addVertex(t):this._addEdge(t)},e}(y),_=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.inEdges=[],o.outEdges=[],r._addVertex(o),o._=n,o}return r(e,t),Object.defineProperty(e.prototype,"edges",{get:function(){return this.inEdges.concat(this.outEdges)},enumerable:!0,configurable:!0}),e.prototype.remove=function(t,e){return void 0===t&&(t=!0),this._graph.removeVertex(this,t,e)},e.prototype.addInEdge=function(t){this.inEdges.push(t)},e.prototype.removeInEdge=function(t){var e=this.inEdges.indexOf(t);if(e<0)throw new Error("In edge does not exist");this.inEdges.splice(e,1)},e.prototype.addOutEdge=function(t){this.outEdges.push(t)},e.prototype.removeOutEdge=function(t){var e=this.outEdges.indexOf(t);if(e<0)throw new Error("Out edge does not exist");this.outEdges.splice(e,1)},e}(y),b=function(t){function e(e,r,n,o,i){var s=t.call(this,e,r)||this;if(!n)throw new Error("Missing source vertex");if(!o)throw new Error("Missing target vertex");return r._addEdge(s),s.source=n,s.source.addOutEdge(s),s.target=o,s.target.addInEdge(s),s._=i,s}return r(e,t),e.prototype.remove=function(){this._graph.removeEdge(this)},e}(y),m=function(){function t(t,e){void 0===t&&(t=function(t){return""+t._}),this._allSubgraphs=[],this._allSubgraphsMap={},this._allVertices=[],this._allVerticesMap={},this._allEdges=[],this._allEdgesMap={},this.root=new g(this,null,e),this.idOf=t}return t.prototype.createSubgraph=function(t,e){var r=new g(this,t||this.root,e);return this._allSubgraphs.push(r),this._allSubgraphsMap[this.idOf(r)]=r,r},t.prototype.removeSubgraph=function(t,e){var r=this;void 0===e&&(e=!0);var n=this._allSubgraphs.indexOf(t);if(n<0)throw new Error("Subgraph does not exist");this._allSubgraphs.splice(n,1),delete this._allSubgraphsMap[this.idOf(t)],t.parent&&t.parent._removeSubgraph(t),t.edges.forEach(function(n){return e?r.removeEdge(n):t.parent._addEdge(n)}),t.vertices.forEach(function(n){return e?r.removeVertex(n,e):t.parent._addVertex(n)}),t.subgraphs.forEach(function(n){return e?r.removeSubgraph(n,e):t.parent._addSubgraph(n)})},Object.defineProperty(t.prototype,"subgraphs",{get:function(){return this._allSubgraphs},enumerable:!0,configurable:!0}),t.prototype.subgraph=function(t){return this._allSubgraphsMap[t]},t.prototype.createVertex=function(t,e){var r=new _(this,t,e);return this._allVertices.push(r),this._allVerticesMap[this.idOf(r)]=r,r},t.prototype.removeVertex=function(t,e,r){var n=this;void 0===e&&(e=!0);var o=this._allVertices.indexOf(t);if(o<0)throw new Error("Vertex does not exist");this._allVertices.splice(o,1),delete this._allVerticesMap[this.idOf(t)],t.parent&&t.parent._removeVertex(t),e||t.inEdges.forEach(function(e){t.outEdges.forEach(function(t){n.createEdge(n.root,e.source,t.target,r?r(e.source._,t.target._):void 0)})}),t.inEdges.forEach(function(t){return n.removeEdge(t)}),t.outEdges.forEach(function(t){return n.removeEdge(t)})},Object.defineProperty(t.prototype,"vertices",{get:function(){return this._allVertices},enumerable:!0,configurable:!0}),t.prototype.vertex=function(t){return this._allVerticesMap[t]},t.prototype.createEdge=function(t,e,r,n){var o=new b(this,t,e,r,n);return this._allEdges.push(o),this._allEdgesMap[this.idOf(o)]=o,o},t.prototype.removeEdge=function(t){var e=this._allEdges.indexOf(t);if(e<0)throw new Error("Edge does not exist");this._allEdges.splice(e,1),delete this._allEdgesMap[this.idOf(t)],t.parent&&t.parent._removeEdge(t),t.source.removeOutEdge(t),t.target.removeInEdge(t)},Object.defineProperty(t.prototype,"edges",{get:function(){return this._allEdges},enumerable:!0,configurable:!0}),t.prototype.edge=function(t){return this._allEdgesMap[t]},t.prototype._walk=function(t,e){for(var r=0,n=t.subgraphs;r<n.length;r++){var o=n[r];switch(e(o)){case"abort":return!0;case"stepover":break;default:if(this._walk(o,e))return!0}}for(var i=0,s=t.vertices;i<s.length;i++){if("abort"===e(s[i]))return!0}},t.prototype.walk=function(t){this._walk(this.root,t);for(var e=0,r=this._allEdges;e<r.length;e++){if("abort"===t(r[e]))return!0}},t.prototype.clone=function(){var t,e,r=new(0,this.constructor)(this.idOf,this.root._),n=(t=[],e=[],{put:function(r,n){var o=t.indexOf(r);-1===o?(t.push(r),e.push(n)):e[o]=n},get:function(r){return e[t.indexOf(r)]}});return n.put(this.root,r.root),this.walk(function(t){var e=n.get(t.parent);if(t instanceof g)n.put(t,e.createSubgraph(t._));else if(t instanceof _)n.put(t,e.createVertex(t._));else if(t instanceof b){var r=n.get(t.source),o=n.get(t.target);e.createEdge(r,o,t._)}}),r},t}();var w,O=new Function("try{return global;}catch(e){return window;}")(),E=new Function("try{return this===window;}catch(e){return false;}"),S=new Function("try{return this===global;}catch(e){return false;}"),x=new Function("try{return process.env.TRAVIS;}catch(e){return false;}"),k=function(){function t(){this.stack=[]}return t.prototype.push=function(t){return this.stack.push(t),t},t.prototype.pop=function(){return this.stack.pop()},t.prototype.top=function(){return this.stack.length?this.stack[this.stack.length-1]:void 0},t.prototype.depth=function(){return this.stack.length},t}();(w=t.Level||(t.Level={}))[w.debug=0]="debug",w[w.info=1]="info",w[w.notice=2]="notice",w[w.warning=3]="warning",w[w.error=4]="error",w[w.critical=5]="critical",w[w.alert=6]="alert",w[w.emergency=7]="emergency";var j={debug:"cyan",info:"green",notice:"grey",warning:"blue",error:"red",critical:"magenta",alert:"magenta",emergency:"magenta"},I=function(){function e(){}return e.prototype.write=function(e,r,n,o){S?console.log("["+e+"] "+t.Level[r].toUpperCase()+" "+n+": "+o):console.log("["+e+"] %c"+t.Level[r].toUpperCase()+"%c "+n+": "+o,"color:"+j[t.Level[r]],"")},e}(),D=function(){function e(){this._levelStack=new k,this._level=t.Level.info,this._filter="",this._writer=new I}return e.Instance=function(){return this._instance||(this._instance=new this)},e.prototype.stringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r},2)},e.prototype.writer=function(t){return void 0===t?this._writer:(this._writer=t,this)},e.prototype.log=function(t,e,r){t<this._level||this._filter&&this._filter!==e||("string"!=typeof r&&(r=this.stringify(r)),this._writer.write((new Date).toISOString(),t,e,r))},e.prototype.debug=function(e,r){this.log(t.Level.debug,e,r)},e.prototype.info=function(e,r){this.log(t.Level.info,e,r)},e.prototype.notice=function(e,r){this.log(t.Level.notice,e,r)},e.prototype.warning=function(e,r){this.log(t.Level.warning,e,r)},e.prototype.error=function(e,r){this.log(t.Level.error,e,r)},e.prototype.critical=function(e,r){this.log(t.Level.critical,e,r)},e.prototype.alert=function(e,r){this.log(t.Level.alert,e,r)},e.prototype.emergency=function(e,r){this.log(t.Level.emergency,e,r)},e.prototype.level=function(t){return void 0===t?this._level:(this._level=t,this)},e.prototype.pushLevel=function(t){return this._levelStack.push(this._level),this._level=t,this},e.prototype.popLevel=function(){return this._level=this._levelStack.pop(),this},e.prototype.filter=function(t){return void 0===t?this._filter:(this._filter=t,this)},e}(),L=D.Instance(),M=function(){function t(t){this._scopeID=t}return t.prototype.debug=function(t){L.debug(this._scopeID,t)},t.prototype.info=function(t){L.info(this._scopeID,t)},t.prototype.notice=function(t){L.notice(this._scopeID,t)},t.prototype.warning=function(t){L.warning(this._scopeID,t)},t.prototype.error=function(t){L.error(this._scopeID,t)},t.prototype.critical=function(t){L.critical(this._scopeID,t)},t.prototype.alert=function(t){L.alert(this._scopeID,t)},t.prototype.emergency=function(t){L.emergency(this._scopeID,t)},t.prototype.pushLevel=function(t){return L.pushLevel(t),this},t.prototype.popLevel=function(){return L.popLevel(),this},t}();function P(t,e){return void 0===e&&(e=!1),e&&L.filter(t),new M(t)}var T=P("loader"),C="function"==typeof require?"object"==typeof module&&"object"==typeof module.exports?"cjs":"amd":"iife";function V(t,e){if(void 0!==t&&void 0!==e){for(var r=0,n=t.split(".");r<n.length;r++){var o=n[r];if(!e.hasOwnProperty(o))return;e=e[o]}return e}}function A(t,e){var r={};for(var n in e){var o=e[n];o instanceof Array||"object"==typeof o&&(o=N(t[n],o)),n in t&&(t[n]===o||n in r&&r[n]===o)||(t[n]=o)}return t}function N(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if("object"!=typeof t)throw new Error('Destination "'+t+'" must be an object.');for(var n=0,o=e;n<o.length;n++){A(t,o[n])}return t}var F=function(){function t(t,e,r){this.eventTarget=t,this.eventID=e,this.callback=r}return t.prototype.release=function(){this.eventTarget.removeObserver(this.eventID,this.callback)},t.prototype.unwatch=function(){this.release()},t}(),X=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._eventObservers={}}return t.prototype.addObserver=function(t,e){var r=this._eventObservers[t];return r||(r=[],this._eventObservers[t]=r),r.push(e),new F(this,t,e)},t.prototype.removeObserver=function(t,e){var r=this._eventObservers[t];if(r)for(var n=r.length-1;n>=0;--n)r[n]===e&&r.splice(n,1);return this},t.prototype.dispatchEvent=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var n=this._eventObservers[t];if(n)for(var o=0,i=n;o<i.length;o++){i[o].apply(void 0,e)}return this},t.prototype._hasObserver=function(t){var e=this._eventObservers[t];for(var r in e)if(e[r])return!0;return!1},t.prototype.hasObserver=function(t){if(void 0!==t)return this._hasObserver(t);for(var e in this._eventObservers)if(this._hasObserver(e))return!0;return!1},t}(),R=function(){function t(t){this.name="",this.$={},this._children=[],this.content="",this.name=t}return t.prototype.appendAttribute=function(t,e){this.$[t]=e},t.prototype.appendContent=function(t){this.content+=t},t.prototype.appendChild=function(t){this._children.push(t)},t.prototype.children=function(t){return void 0===t?this._children:this._children.filter(function(e){return e.name===t})},t}(),q=function(){function t(){this.stack=new k}return t.prototype.walkDoc=function(t){var e=this._startXMLNode(t);if(t.attributes)for(var r=0;r<t.attributes.length;++r){var n=t.attributes.item(r);this.attributes(n.nodeName,n.nodeValue)}if(this.startXMLNode(e),t.childNodes)for(r=0;r<t.childNodes.length;++r){var o=t.childNodes.item(r);o.nodeType===o.TEXT_NODE?this.characters(o.nodeValue):this.walkDoc(o)}this.endXMLNode(this.stack.pop())},t.prototype._startXMLNode=function(t){var e=new R(t.nodeName);return this.stack.depth()?this.stack.top().appendChild(e):this.root=e,this.stack.push(e)},t.prototype.parse=function(t){var e=(new DOMParser).parseFromString(t,"application/xml");this.startDocument(),this.walkDoc(e),this.endDocument()},t.prototype.startDocument=function(){},t.prototype.endDocument=function(){},t.prototype.startXMLNode=function(t){},t.prototype.endXMLNode=function(t){},t.prototype.attributes=function(t,e){this.stack.top().appendAttribute(t,e)},t.prototype.characters=function(t){this.stack.top().appendContent(t)},t}(),G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.startXMLNode=function(e){t.prototype.startXMLNode.call(this,e),e.name},e.prototype.endXMLNode=function(e){e.name,t.prototype.endXMLNode.call(this,e)},e}(q);var H=function(){function t(){this._espState={},this._espStateCache={},this._events=new X,this._monitorTickCount=0}return t.prototype.clear=function(t){this._espState={},this._espStateCache={},void 0!==t&&this.set(t),this._monitorTickCount=0},t.prototype.get=function(t,e){return void 0===t?this._espState:this.has(t)?this._espState[t]:e},t.prototype.set=function(t,e,r){return void 0===r&&(r=!1),"string"==typeof t?this.setSingle(t,e,r):this.setAll(t)},t.prototype.setSingle=function(t,e,r){var n=this._espStateCache[t],o=f(e);if(n!==o){this._espStateCache[t]=o;var i=this._espState[t];this._espState[t]=e;var s={id:t,oldValue:i,newValue:e};return r||(this._events.dispatchEvent("propChanged",s),this._events.dispatchEvent("changed",[s])),s}return null},t.prototype.setAll=function(t){var e=[];for(var r in t)if(t.hasOwnProperty(r)){var n=this.setSingle(r,t[r],!0);n&&e.push(n)}if(e.length){for(var o=0,i=e;o<i.length;o++){var s=i[o];this._events.dispatchEvent("propChanged",s)}this._events.dispatchEvent("changed",e)}return e},t.prototype.has=function(t){return void 0!==this._espState[t]},t.prototype.addObserver=function(t,e,r){if(this.isCallback(e)){if("changed"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,e)}if("propChanged"!==t)throw new Error("Invalid eventID: "+t);return this._events.addObserver(t,function(t){t.id===e&&r(t)})},t.prototype.on=function(t,e,r){if(this.isCallback(e))switch(t){case"changed":this._events.addObserver(t,e)}else switch(t){case"propChanged":this._events.addObserver(t,function(t){t.id===e&&r(t)})}return this},t.prototype.isCallback=function(t){return"function"==typeof t},t.prototype.hasEventListener=function(){return this._events.hasObserver()},t.prototype.refresh=function(t){return void 0===t&&(t=!1),o(this,void 0,void 0,function(){return i(this,function(t){switch(t.label){case 0:return[4,Promise.resolve()];case 1:return t.sent(),[2,this]}})})},t.prototype._monitor=function(){var t=this;this._monitorHandle?this._monitorTickCount=0:this._monitorHandle=setTimeout(function(){(t.hasEventListener()?t.refresh(!0):Promise.resolve()).then(function(){t._monitor()}),delete t._monitorHandle},this._monitorTimeoutDuraction())},t.prototype._monitorTimeoutDuraction=function(){return++this._monitorTickCount,this._monitorTickCount<=1?0:3e4},t.prototype.watch=function(t,e){var r=this;if(void 0===e&&(e=!0),"function"!=typeof t)throw new Error("Invalid Callback");e&&setTimeout(function(){var e=r.get(),n=[];for(var o in e)e.hasOwnProperty(e)&&n.push({id:o,newValue:e[o],oldValue:void 0});t(n)},0);var n=this.addObserver("changed",t);return this._monitor(),n},t}();function U(t,e){if("string"!=typeof e)return t;if(0===e.length)return t;for(;0===t.indexOf(e);)t=t.substring(1);for(;Y(t,e);)t=t.substring(0,t.length-1);return t}function Y(t,e,r){var n=t.toString();("number"!=typeof r||!isFinite(r)||Math.floor(r)!==r||r>n.length)&&(r=n.length),r-=e.length;var o=n.lastIndexOf(e,r);return-1!==o&&o===r}var J="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var W=function(t,e){return t(e={exports:{}},e.exports),e.exports}(function(t,e){t.exports=function(){function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},r=0,n=void 0,o=void 0,i=function(t,e){p[r]=t,p[r+1]=e,2===(r+=2)&&(o?o(l):_())},s="undefined"!=typeof window?window:void 0,u=s||{},a=u.MutationObserver||u.WebKitMutationObserver,c="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),h="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function f(){var t=setTimeout;return function(){return t(l,1)}}var p=new Array(1e3);function l(){for(var t=0;t<r;t+=2){var e=p[t],n=p[t+1];e(n),p[t]=void 0,p[t+1]=void 0}r=0}var d,v,y,g,_=void 0;function b(t,e){var r=this,n=new this.constructor(O);void 0===n[w]&&N(n);var o=r._state;if(o){var s=arguments[o-1];i(function(){return V(o,n,s,r._result)})}else T(r,n,t,e);return n}function m(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(O);return D(e,t),e}c?_=function(){return process.nextTick(l)}:a?(v=0,y=new a(l),g=document.createTextNode(""),y.observe(g,{characterData:!0}),_=function(){g.data=v=++v%2}):h?((d=new MessageChannel).port1.onmessage=l,_=function(){return d.port2.postMessage(0)}):_=void 0===s?function(){try{var t=Function("return this")().require("vertx");return void 0!==(n=t.runOnLoop||t.runOnContext)?function(){n(l)}:f()}catch(t){return f()}}():f();var w=Math.random().toString(36).substring(2);function O(){}var E=void 0,S=1,x=2,k={error:null};function j(t){try{return t.then}catch(t){return k.error=t,k}}function I(e,r,n){r.constructor===e.constructor&&n===b&&r.constructor.resolve===m?function(t,e){e._state===S?M(t,e._result):e._state===x?P(t,e._result):T(e,void 0,function(e){return D(t,e)},function(e){return P(t,e)})}(e,r):n===k?(P(e,k.error),k.error=null):void 0===n?M(e,r):t(n)?function(t,e,r){i(function(t){var n=!1,o=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(r,e,function(r){n||(n=!0,e!==r?D(t,r):M(t,r))},function(e){n||(n=!0,P(t,e))},t._label);!n&&o&&(n=!0,P(t,o))},t)}(e,r,n):M(e,r)}function D(t,e){var r,n;t===e?P(t,new TypeError("You cannot resolve a promise with itself")):(n=typeof(r=e),null===r||"object"!==n&&"function"!==n?M(t,e):I(t,e,j(e)))}function L(t){t._onerror&&t._onerror(t._result),C(t)}function M(t,e){t._state===E&&(t._result=e,t._state=S,0!==t._subscribers.length&&i(C,t))}function P(t,e){t._state===E&&(t._state=x,t._result=e,i(L,t))}function T(t,e,r,n){var o=t._subscribers,s=o.length;t._onerror=null,o[s]=e,o[s+S]=r,o[s+x]=n,0===s&&t._state&&i(C,t)}function C(t){var e=t._subscribers,r=t._state;if(0!==e.length){for(var n=void 0,o=void 0,i=t._result,s=0;s<e.length;s+=3)n=e[s],o=e[s+r],n?V(r,n,o,i):o(i);t._subscribers.length=0}}function V(e,r,n,o){var i=t(n),s=void 0,u=void 0,a=void 0,c=void 0;if(i){if((s=function(t,e){try{return t(e)}catch(t){return k.error=t,k}}(n,o))===k?(c=!0,u=s.error,s.error=null):a=!0,r===s)return void P(r,new TypeError("A promises callback cannot return that same promise."))}else s=o,a=!0;r._state!==E||(i&&a?D(r,s):c?P(r,u):e===S?M(r,s):e===x&&P(r,s))}var A=0;function N(t){t[w]=A++,t._state=void 0,t._result=void 0,t._subscribers=[]}var F=function(){function t(t,r){this._instanceConstructor=t,this.promise=new t(O),this.promise[w]||N(this.promise),e(r)?(this.length=r.length,this._remaining=r.length,this._result=new Array(this.length),0===this.length?M(this.promise,this._result):(this.length=this.length||0,this._enumerate(r),0===this._remaining&&M(this.promise,this._result))):P(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===E&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var r=this._instanceConstructor,n=r.resolve;if(n===m){var o=j(t);if(o===b&&t._state!==E)this._settledAt(t._state,e,t._result);else if("function"!=typeof o)this._remaining--,this._result[e]=t;else if(r===X){var i=new r(O);I(i,t,o),this._willSettleAt(i,e)}else this._willSettleAt(new r(function(e){return e(t)}),e)}else this._willSettleAt(n(t),e)},t.prototype._settledAt=function(t,e,r){var n=this.promise;n._state===E&&(this._remaining--,t===x?P(n,r):this._result[e]=r),0===this._remaining&&M(n,this._result)},t.prototype._willSettleAt=function(t,e){var r=this;T(t,void 0,function(t){return r._settledAt(S,e,t)},function(t){return r._settledAt(x,e,t)})},t}(),X=function(){function t(e){this[w]=A++,this._result=this._state=void 0,this._subscribers=[],O!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){try{e(function(e){D(t,e)},function(e){P(t,e)})}catch(e){P(t,e)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return t.prototype.catch=function(t){return this.then(null,t)},t.prototype.finally=function(t){var e=this.constructor;return this.then(function(r){return e.resolve(t()).then(function(){return r})},function(r){return e.resolve(t()).then(function(){throw r})})},t}();return X.prototype.then=b,X.all=function(t){return new F(this,t).promise},X.race=function(t){var r=this;return e(t)?new r(function(e,n){for(var o=t.length,i=0;i<o;i++)r.resolve(t[i]).then(e,n)}):new r(function(t,e){return e(new TypeError("You must pass an array to race."))})},X.resolve=m,X.reject=function(t){var e=new this(O);return P(e,t),e},X._setScheduler=function(t){o=t},X._setAsap=function(t){i=t},X._asap=i,X.polyfill=function(){var t=void 0;if(void 0!==J)t=J;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var r=null;try{r=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===r&&!e.cast)return}t.Promise=X},X.Promise=X,X}()}),$=Object.freeze({default:W,__moduleExports:W});($&&W||$).polyfill();t.find=function(t,e){if(null==t)throw new TypeError('"o" is null or not defined');var r=t.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var n=arguments[1],o=0;o<r;){var i=t[o];if(e.call(n,i,o,t))return i;o++}},t.compare=function(t,e){for(var r={unchanged:[],removed:[],added:e.slice(0)},n=0,o=t;n<o.length;n++){var i=o[n],s=r.added.indexOf(i);s>=0?(r.unchanged.push(i),r.added.splice(s,1)):r.removed.push(i)}return r},t.Cache=p,t.AsyncCache=l,t.debounce=function(t,e){var r={};return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var i=f(n);return r[i]||(r[i]={clockStart:Date.now(),promise:t.apply(void 0,n).then(function(t){return void 0===e?r[i]=null:setTimeout(function(){r[i]=null},Math.max(e-(Date.now()-r[i].clockStart),0)),t}).catch(function(t){throw r[i]=null,t})}),r[i].promise}},t.promiseTimeout=function(t,e){var r,n=new Promise(function(e,n){r=setTimeout(function(){clearTimeout(r),n("Timed out in "+t+"ms.")},t)});return Promise.race([e,n]).then(function(t){return clearTimeout(r),t}).catch(function(t){throw clearTimeout(r),t})},t.Dictionary=d,t.DictionaryNoCase=v,t.espTime2Seconds=function(t){if(!t)return 0;if(!isNaN(Number(t)))return Number(t);var e=t.indexOf("ns");if(-1!==e)return parseFloat(t.substr(0,e))/1e9;var r=t.indexOf("ms");if(-1!==r)return parseFloat(t.substr(0,r))/1e3;var n=t.indexOf("s");if(-1!==n&&-1===t.indexOf("days"))return parseFloat(t.substr(0,n));for(var o=t.split(" days "),i=o.length>1?parseFloat(o[0]):0,s=0,u=(o.length>1?o[1]:o[0]).split(":").reverse(),a=0;a<u.length;++a)s+=parseFloat(u[a])*Math.pow(60,a);return 24*i*60*60+s},t.GraphItem=y,t.Subgraph=g,t.Vertex=_,t.Edge=b,t.Graph=m,t.hashSum=f,t.dynamicImport=function(t,e){var r;switch(C){case"amd":r=new Promise(function(e,r){require([t],e,r)});case"cjs":r=Promise.resolve().then(function(){return require(t)});case"iife":default:r=new Promise(function(r,n){var o=O[e||t];o?r(o):n()})}return r.catch(function(e){return T.error("dynamicImport(["+t+"], ...) failed"),null})},t.Logging=D,t.logger=L,t.ScopedLogging=M,t.scopedLogger=P,t.inner=V,t.exists=function(t,e){return void 0!==V(t,e)},t.deepMixin=N,t.deepMixinT=function(t){void 0===t&&(t={});for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return N.apply(void 0,[t].concat(e))},t.safeStringify=function(t){var e=[];return JSON.stringify(t,function(t,r){if("object"==typeof r&&null!==r){if(-1!==e.indexOf(r))return;e.push(r)}return r})},t.Observable=X,t.root=O,t.isBrowser=E,t.isNode=S,t.isTravis=x,t.XMLNode=R,t.SAXStackParser=q,t.xml2json=function(t){var e=new G;return e.parse(t),e.root},t.Stack=k,t.StateObject=H,t.trim=U,t.endsWith=Y,t.join=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return(t.length&&t[0].length&&"/"===t[0].charAt(0)?"/":"")+t.map(function(t){return U(t,"/")}).join("/")},t.__extends=r,t.__assign=n,t.__rest=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&(r[n[o]]=t[n[o]])}return r},t.__decorate=function(t,e,r,n){var o,i=arguments.length,s=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,r,n);else for(var u=t.length-1;u>=0;u--)(o=t[u])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},t.__param=function(t,e){return function(r,n){e(r,n,t)}},t.__metadata=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},t.__awaiter=o,t.__generator=i,t.__exportStar=function(t,e){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])},t.__values=s,t.__read=u,t.__spread=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(u(arguments[e]));return t},t.__await=a,t.__asyncGenerator=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(t,e||[]),i=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(t){o[t]&&(n[t]=function(e){return new Promise(function(r,n){i.push([t,e,r,n])>1||u(t,e)})})}function u(t,e){try{(r=o[t](e)).value instanceof a?Promise.resolve(r.value.v).then(c,h):f(i[0][2],r)}catch(t){f(i[0][3],t)}var r}function c(t){u("next",t)}function h(t){u("throw",t)}function f(t,e){t(e),i.shift(),i.length&&u(i[0][0],i[0][1])}},t.__asyncDelegator=function(t){var e,r;return e={},n("next"),n("throw",function(t){throw t}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(n,o){t[n]&&(e[n]=function(e){return(r=!r)?{value:a(t[n](e)),done:"return"===n}:o?o(e):e})}},t.__asyncValues=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):s(t)},t.__makeTemplateObject=function(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t},t.__importStar=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e},t.__importDefault=function(t){return t&&t.__esModule?t:{default:t}},Object.defineProperty(t,"__esModule",{value:!0})});
import * as tslib_1 from "tslib";
import { Dictionary } from "./dictionary";
var ATTR_DEFINITION = "definition";
var GraphItem = /** @class */ (function () {
function GraphItem(graph, parent, id, attrs) {
function GraphItem(graph, parent) {
this.props = {};
this._graph = graph;
this._parent = parent;
this._id = id;
this._attrs = new Dictionary(attrs);
this.parent = parent;
}
GraphItem.prototype.className = function () {
return this.constructor.name;
};
GraphItem.prototype.id = function () {
return this._id;
};
GraphItem.prototype.attrs = function () {
return this._attrs;
};
GraphItem.prototype.parent = function () {
return this._parent;
};
GraphItem.prototype.hasECLDefinition = function () {
return this._attrs.get(ATTR_DEFINITION) !== undefined;
};
GraphItem.prototype.getECLDefinition = function () {
var match = /([a-z]:\\(?:[-\w\.\d]+\\)*(?:[-\w\.\d]+)?|(?:\/[\w\.\-]+)+)\((\d*),(\d*)\)/.exec(this._attrs.get(ATTR_DEFINITION));
if (match) {
var _file = match[1], _row = match[2], _col = match[3];
_file.replace("/./", "/");
return {
id: this.id(),
file: _file,
line: +_row,
column: +_col
};
}
throw new Error("Bad definition: " + this._attrs.get(ATTR_DEFINITION));
};
return GraphItem;
}());
export { GraphItem };
var Subgraph = /** @class */ (function (_super) {
tslib_1.__extends(Subgraph, _super);
function Subgraph(graph, parent, id, attrs) {
if (attrs === void 0) { attrs = {}; }
var _this = _super.call(this, graph, parent, id, attrs) || this;
_this._subgraphs = new Dictionary();
_this._vertices = new Dictionary();
_this._edges = new Dictionary();
function Subgraph(graph, parent, _) {
var _this = _super.call(this, graph, parent) || this;
_this.subgraphs = [];
_this.vertices = [];
_this.edges = [];
if (parent) { // Only needed for dummy root
parent.addSubgraph(_this);
parent._addSubgraph(_this);
}
_this._ = _;
return _this;
}
Subgraph.prototype.destroy = function () {
var _this = this;
if (this._parent) {
this._parent.removeSubgraph(this);
}
this._edges.values().forEach(function (edge) { return _this._graph.destroyEdge(edge); });
this._vertices.values().forEach(function (vertex) { return _this._graph.destroyVertex(vertex); });
this._subgraphs.values().forEach(function (subgraph) { return _this._graph.destroySubgraph(subgraph); });
Subgraph.prototype.remove = function (full) {
if (full === void 0) { full = true; }
this._graph.removeSubgraph(this, full);
};
Subgraph.prototype.remove = function () {
this._graph.destroySubgraph(this);
Subgraph.prototype.createSubgraph = function (_) {
return this._graph.createSubgraph(this, _);
};
Subgraph.prototype.createSubgraph = function (id, attrs) {
return this._graph.createSubgraph(this, id, attrs);
};
Subgraph.prototype.addSubgraph = function (subgraph) {
if (this._subgraphs.has(subgraph.id())) {
Subgraph.prototype._addSubgraph = function (subgraph) {
if (this.subgraphs.indexOf(subgraph) >= 0) {
throw new Error("Subgraph already exists");
}
this._subgraphs.set(subgraph.id(), subgraph);
this.subgraphs.push(subgraph);
};
Subgraph.prototype.removeSubgraph = function (subgraph) {
if (!this._subgraphs.has(subgraph.id())) {
Subgraph.prototype._removeSubgraph = function (subgraph) {
var idx = this.subgraphs.indexOf(subgraph);
if (idx < 0) {
throw new Error("Subgraph does not exist");
}
this._subgraphs.remove(subgraph.id());
this.subgraphs.splice(idx, 1);
};
Subgraph.prototype.createVertex = function (id, label, attrs) {
return this._graph.createVertex(this, id, label, attrs);
Subgraph.prototype.removeAllSubgraphs = function () {
for (var i = this.subgraphs.length - 1; i >= 0; --i) {
this._graph.removeSubgraph(this.subgraphs[i], true);
}
};
Subgraph.prototype.addVertex = function (vertex) {
if (this._vertices.has(vertex.id())) {
Subgraph.prototype.createVertex = function (_) {
return this._graph.createVertex(this, _);
};
Subgraph.prototype._addVertex = function (vertex) {
if (this.vertices.indexOf(vertex) >= 0) {
throw new Error("Vertex already exists");
}
this._vertices.set(vertex.id(), vertex);
this.vertices.push(vertex);
};
Subgraph.prototype.removeVertex = function (vertex) {
if (!this._vertices.has(vertex.id())) {
Subgraph.prototype._removeVertex = function (vertex) {
var idx = this.vertices.indexOf(vertex);
if (idx < 0) {
throw new Error("Vertex does not exist");
}
this._vertices.remove(vertex.id());
this.vertices.splice(idx, 1);
};
Subgraph.prototype.createEdge = function (id, sourceID, targetID, attrs) {
return this._graph.createEdge(this, id, sourceID, targetID, attrs);
Subgraph.prototype.removeAllVertices = function () {
for (var i = this.vertices.length - 1; i >= 0; --i) {
this._graph.removeVertex(this.vertices[i], true);
}
};
Subgraph.prototype.addEdge = function (edge) {
if (this._edges.has(edge.id())) {
Subgraph.prototype.createEdge = function (source, target, _) {
return this._graph.createEdge(this, source, target, _);
};
Subgraph.prototype._addEdge = function (edge) {
if (this.edges.indexOf(edge) >= 0) {
throw new Error("Edge already exists");
}
this._edges.set(edge.id(), edge);
this.edges.push(edge);
};
Subgraph.prototype.removeEdge = function (edge) {
if (!this._edges.has(edge.id())) {
Subgraph.prototype._removeEdge = function (edge) {
var idx = this.edges.indexOf(edge);
if (idx < 0) {
throw new Error("Edge does not exist");
}
this._edges.remove(edge.id());
this.edges.splice(idx, 1);
};
Subgraph.prototype.add = function (item) {
Subgraph.prototype._add = function (item) {
if (item instanceof Subgraph) {
this.addSubgraph(item);
this._addSubgraph(item);
}
else if (item instanceof Vertex) {
this.addVertex(item);
this._addVertex(item);
}
else {
this.addEdge(item);
this._addEdge(item);
}
};
Subgraph.prototype.subgraphs = function () {
return this._subgraphs.values();
};
Subgraph.prototype.vertices = function () {
return this._vertices.values();
};
Subgraph.prototype.edges = function () {
return this._edges.values();
};
Subgraph.prototype.getNearestDefinition = function (backwards) {
if (backwards === void 0) { backwards = false; }
// Todo - order is incorrect...
if (this.hasECLDefinition()) {
return this.getECLDefinition();
}
var vertices = this.vertices();
if (backwards) {
vertices = vertices.reverse();
}
var retVal = null;
vertices.some(function (vertex) {
retVal = vertex.getNearestDefinition(backwards);
if (retVal) {
return true;
}
return false;
});
return retVal;
};
return Subgraph;
}(GraphItem));
export { Subgraph };
var Vertex = /** @class */ (function (_super) {
tslib_1.__extends(Vertex, _super);
function Vertex(graph, parent, id, label, attrs) {
var _this = _super.call(this, graph, parent, id, attrs) || this;
function Vertex(graph, parent, _) {
var _this = _super.call(this, graph, parent) || this;
_this.inEdges = [];
_this.outEdges = [];
_this._label = label;
parent.addVertex(_this);
parent._addVertex(_this);
_this._ = _;
return _this;
}
Vertex.prototype.destroy = function () {
var _this = this;
if (this._parent) {
this._parent.removeVertex(this);
}
this.inEdges.forEach(function (edge) { return _this._graph.destroyEdge(edge); });
this.outEdges.forEach(function (edge) { return _this._graph.destroyEdge(edge); });
Object.defineProperty(Vertex.prototype, "edges", {
get: function () {
return this.inEdges.concat(this.outEdges);
},
enumerable: true,
configurable: true
});
Vertex.prototype.remove = function (full, _) {
if (full === void 0) { full = true; }
return this._graph.removeVertex(this, full, _);
};
Vertex.prototype.label = function () {
return this._label;
};
Vertex.prototype.addInEdge = function (edge) {

@@ -195,23 +141,9 @@ this.inEdges.push(edge);

};
Vertex.prototype.getNearestDefinition = function (backwards) {
if (backwards === void 0) { backwards = true; }
if (this.hasECLDefinition()) {
return this.getECLDefinition();
}
var retVal = null;
this.inEdges.some(function (edge) {
retVal = edge.getNearestDefinition(backwards);
if (retVal) {
return true;
}
return false;
});
return retVal;
};
return Vertex;
}(GraphItem));
export { Vertex };
var Edge = /** @class */ (function (_super) {
tslib_1.__extends(Edge, _super);
function Edge(graph, parent, id, source, target, attrs) {
var _this = _super.call(this, graph, parent, id, attrs) || this;
function Edge(graph, parent, source, target, _) {
var _this = _super.call(this, graph, parent) || this;
if (!source) {

@@ -223,3 +155,3 @@ throw new Error("Missing source vertex");

}
parent.addEdge(_this);
parent._addEdge(_this);
_this.source = source;

@@ -229,144 +161,169 @@ _this.source.addOutEdge(_this);

_this.target.addInEdge(_this);
_this._ = _;
return _this;
}
Edge.prototype.sourceID = function () {
return this.source.id();
Edge.prototype.remove = function () {
this._graph.removeEdge(this);
};
Edge.prototype.targetID = function () {
return this.target.id();
};
Edge.prototype.destroy = function () {
if (this._parent) {
this._parent.removeEdge(this);
}
this.source.removeOutEdge(this);
this.target.removeInEdge(this);
};
Edge.prototype.getNearestDefinition = function (backwards) {
if (backwards === void 0) { backwards = false; }
if (this.hasECLDefinition()) {
return this.getECLDefinition();
}
return this.source.getNearestDefinition(backwards);
};
return Edge;
}(Subgraph));
}(GraphItem));
export { Edge };
var Graph = /** @class */ (function () {
function Graph(id, attrs) {
this._allSubgraphs = new Dictionary();
this._allVertices = new Dictionary();
this._allEdges = new Dictionary();
this._attrs = new Dictionary();
this._root = new Subgraph(this, null, id, attrs);
this._allSubgraphs.set(id, this._root);
function Graph(idOf, _) {
if (idOf === void 0) { idOf = function (item) { return "" + item._; }; }
this._allSubgraphs = [];
this._allSubgraphsMap = {};
this._allVertices = [];
this._allVerticesMap = {};
this._allEdges = [];
this._allEdgesMap = {};
this.root = new Subgraph(this, null, _);
this.idOf = idOf;
}
Graph.prototype.className = function () {
return "Graph";
};
Graph.prototype.id = function () {
return this._root.id();
};
Graph.prototype.attrs = function () {
return this._attrs;
};
Graph.prototype.parent = function () {
return null;
};
Graph.prototype.remove = function () {
// Do nothing ---
};
Graph.prototype.subgraphs = function () {
return this._root.subgraphs();
};
Graph.prototype.vertices = function () {
return this._root.vertices();
};
Graph.prototype.edges = function () {
return this._root.edges();
};
Graph.prototype.createSubgraph = function (parent, id, attrs) {
if (this._allSubgraphs.has(id)) {
throw new Error("Subgraph already exists");
}
var retVal = new Subgraph(this, this._allSubgraphs.get(parent.id()), id, attrs);
this._allSubgraphs.set(id, retVal);
Graph.prototype.createSubgraph = function (parent, _) {
var retVal = new Subgraph(this, parent || this.root, _);
this._allSubgraphs.push(retVal);
this._allSubgraphsMap[this.idOf(retVal)] = retVal;
return retVal;
};
Graph.prototype.destroySubgraph = function (_subgraph) {
var subgraph = this._allSubgraphs.get(_subgraph.id());
if (!subgraph) {
Graph.prototype.removeSubgraph = function (subgraph, full) {
var _this = this;
if (full === void 0) { full = true; }
var idx = this._allSubgraphs.indexOf(subgraph);
if (idx < 0) {
throw new Error("Subgraph does not exist");
}
this._allSubgraphs.remove(subgraph.id());
subgraph.destroy();
this._allSubgraphs.splice(idx, 1);
delete this._allSubgraphsMap[this.idOf(subgraph)];
if (subgraph.parent) {
subgraph.parent._removeSubgraph(subgraph);
}
subgraph.edges.forEach(function (edge) { return full ? _this.removeEdge(edge) : subgraph.parent._addEdge(edge); });
subgraph.vertices.forEach(function (vertex) { return full ? _this.removeVertex(vertex, full) : subgraph.parent._addVertex(vertex); });
subgraph.subgraphs.forEach(function (childSubgraph) { return full ? _this.removeSubgraph(childSubgraph, full) : subgraph.parent._addSubgraph(childSubgraph); });
};
Graph.prototype.createVertex = function (parent, id, label, attrs) {
if (this._allVertices.has(id)) {
throw new Error("Vertex already exists");
}
var retVal = new Vertex(this, this._allSubgraphs.get(parent.id()), id, label, attrs);
this._allVertices.set(id, retVal);
Object.defineProperty(Graph.prototype, "subgraphs", {
get: function () {
return this._allSubgraphs;
},
enumerable: true,
configurable: true
});
Graph.prototype.subgraph = function (id) {
return this._allSubgraphsMap[id];
};
Graph.prototype.createVertex = function (parent, _) {
var retVal = new Vertex(this, parent, _);
this._allVertices.push(retVal);
this._allVerticesMap[this.idOf(retVal)] = retVal;
return retVal;
};
Graph.prototype.destroyVertex = function (_vertex) {
var vertex = this._allVertices.get(_vertex.id());
if (!vertex) {
Graph.prototype.removeVertex = function (vertex, full, _) {
var _this = this;
if (full === void 0) { full = true; }
var idx = this._allVertices.indexOf(vertex);
if (idx < 0) {
throw new Error("Vertex does not exist");
}
this._allVertices.remove(vertex.id());
vertex.destroy();
this._allVertices.splice(idx, 1);
delete this._allVerticesMap[this.idOf(vertex)];
if (vertex.parent) {
vertex.parent._removeVertex(vertex);
}
if (!full) {
vertex.inEdges.forEach(function (inEdge) {
vertex.outEdges.forEach(function (outEdge) {
_this.createEdge(_this.root, inEdge.source, outEdge.target, _ ? _(inEdge.source._, outEdge.target._) : undefined);
});
});
}
vertex.inEdges.forEach(function (edge) { return _this.removeEdge(edge); });
vertex.outEdges.forEach(function (edge) { return _this.removeEdge(edge); });
};
Graph.prototype.createEdge = function (parent, id, sourceID, targetID, attrs) {
if (this._allEdges.has(id)) {
throw new Error("Edge already exists");
}
var retVal = new Edge(this, this._allSubgraphs.get(parent.id()), id, this._allVertices.get(sourceID), this._allVertices.get(targetID), attrs);
this._allEdges.set(id, retVal);
Object.defineProperty(Graph.prototype, "vertices", {
get: function () {
return this._allVertices;
},
enumerable: true,
configurable: true
});
Graph.prototype.vertex = function (id) {
return this._allVerticesMap[id];
};
Graph.prototype.createEdge = function (parent, source, target, _) {
var retVal = new Edge(this, parent, source, target, _);
this._allEdges.push(retVal);
this._allEdgesMap[this.idOf(retVal)] = retVal;
return retVal;
};
Graph.prototype.destroyEdge = function (_edge) {
var edge = this._allEdges.get(_edge.id());
if (!edge) {
Graph.prototype.removeEdge = function (edge) {
var idx = this._allEdges.indexOf(edge);
if (idx < 0) {
throw new Error("Edge does not exist");
}
this._allEdges.remove(edge.id());
edge.destroy();
this._allEdges.splice(idx, 1);
delete this._allEdgesMap[this.idOf(edge)];
if (edge.parent) {
edge.parent._removeEdge(edge);
}
edge.source.removeOutEdge(edge);
edge.target.removeInEdge(edge);
};
Graph.prototype.allSubgraph = function (id) {
return this._allSubgraphs.get(id);
Object.defineProperty(Graph.prototype, "edges", {
get: function () {
return this._allEdges;
},
enumerable: true,
configurable: true
});
Graph.prototype.edge = function (id) {
return this._allEdgesMap[id];
};
Graph.prototype.allSubgraphs = function () {
var _this = this;
return this._allSubgraphs.values().filter(function (subgraph) { return subgraph !== _this._root; });
Graph.prototype._walk = function (parent, visitor) {
for (var _i = 0, _a = parent.subgraphs; _i < _a.length; _i++) {
var subgraph = _a[_i];
switch (visitor(subgraph)) {
case "abort":
return true;
case "stepover":
break;
default:
if (this._walk(subgraph, visitor))
return true;
}
}
for (var _b = 0, _c = parent.vertices; _b < _c.length; _b++) {
var vertex = _c[_b];
if (visitor(vertex) === "abort")
return true;
}
};
Graph.prototype.allVertex = function (id) {
return this._allVertices.get(id);
Graph.prototype.walk = function (visitor) {
this._walk(this.root, visitor);
for (var _i = 0, _a = this._allEdges; _i < _a.length; _i++) {
var edge = _a[_i];
if (visitor(edge) === "abort")
return true;
}
};
Graph.prototype.allVertices = function () {
return this._allVertices.values();
};
Graph.prototype.allEdge = function (id) {
return this._allEdges.get(id);
};
Graph.prototype.allEdges = function () {
return this._allEdges.values();
};
Graph.prototype.getNearestDefinition = function (backwards) {
if (backwards === void 0) { backwards = false; }
return this._root.getNearestDefinition(backwards);
};
Graph.prototype.breakpointLocations = function (path) {
var retVal = [];
for (var _i = 0, _a = this._allVertices.values(); _i < _a.length; _i++) {
var vertex = _a[_i];
if (vertex.hasECLDefinition()) {
var definition = vertex.getECLDefinition();
if (definition && !path || path === definition.file) {
retVal.push(definition);
}
Graph.prototype.clone = function () {
var ctor = this.constructor;
var retVal = new ctor(this.idOf, this.root._);
var map = ObjMap();
map.put(this.root, retVal.root);
this.walk(function (item) {
var parent = map.get(item.parent);
if (item instanceof Subgraph) {
map.put(item, parent.createSubgraph(item._));
}
}
return retVal.sort(function (l, r) {
return l.line - r.line;
else if (item instanceof Vertex) {
map.put(item, parent.createVertex(item._));
}
else if (item instanceof Edge) {
var source = map.get(item.source);
var target = map.get(item.target);
parent.createEdge(source, target, item._);
}
});
return retVal;
};

@@ -376,2 +333,21 @@ return Graph;

export { Graph };
function ObjMap() {
var keys = [];
var values = [];
return {
put: function (key, value) {
var index = keys.indexOf(key);
if (index === -1) {
keys.push(key);
values.push(value);
}
else {
values[index] = value;
}
},
get: function (key) {
return values[keys.indexOf(key)];
}
};
}
//# sourceMappingURL=graph.js.map
{
"name": "@hpcc-js/util",
"version": "0.0.72",
"version": "0.0.73",
"description": "hpcc-js - Utilities",

@@ -29,13 +29,15 @@ "main": "dist/index.js",

"devDependencies": {
"concurrently": "3.5.0",
"es6-promise": "4.1.1",
"concurrently": "3.5.1",
"es6-promise": "4.2.4",
"rimraf": "2.6.2",
"rollup": "0.54.0",
"rollup-plugin-commonjs": "8.2.6",
"rollup-plugin-node-resolve": "3.0.0",
"tslib": "1.8.0",
"tslint": "5.8.0",
"rollup": "0.58.2",
"rollup-plugin-alias": "1.4.0",
"rollup-plugin-commonjs": "9.1.0",
"rollup-plugin-node-resolve": "3.3.0",
"rollup-plugin-postcss": "1.6.1",
"tslib": "1.9.0",
"tslint": "5.9.1",
"typedoc": "0.7.1",
"typescript": "2.8.1",
"uglify-es": "3.2.0"
"typescript": "2.8.3",
"uglify-es": "3.3.9"
},

@@ -42,0 +44,0 @@ "repository": {

@@ -1,56 +0,73 @@

import { Dictionary, StringAnyMap } from "./dictionary";
export interface IECLDefintion {
id: string;
file: string;
line: number;
column: number;
export declare class GraphItem<S, V, E> {
protected _graph: Graph<S, V, E>;
readonly parent: Subgraph<S, V, E> | null;
readonly props: {
[key: string]: any;
};
constructor(graph: Graph<S, V, E>, parent: Subgraph<S, V, E> | null);
}
export interface IGraphItem {
className(): string;
id(): string;
attrs(): Dictionary<any>;
parent(): ISubgraph | null;
getNearestDefinition(backwards?: boolean): IECLDefintion | null;
export declare class Subgraph<S, V, E> extends GraphItem<S, V, E> {
readonly subgraphs: Array<Subgraph<S, V, E>>;
readonly vertices: Array<Vertex<S, V, E>>;
readonly edges: Array<Edge<S, V, E>>;
readonly _?: S;
constructor(graph: Graph<S, V, E>, parent: Subgraph<S, V, E> | null, _?: S);
remove(full?: boolean): void;
createSubgraph(_?: S): Subgraph<S, V, E>;
_addSubgraph(subgraph: Subgraph<S, V, E>): void;
_removeSubgraph(subgraph: Subgraph<S, V, E>): void;
removeAllSubgraphs(): void;
createVertex(_?: V): Vertex<S, V, E>;
_addVertex(vertex: Vertex<S, V, E>): void;
_removeVertex(vertex: Vertex<S, V, E>): void;
removeAllVertices(): void;
createEdge(source: Vertex<S, V, E>, target: Vertex<S, V, E>, _?: E): Edge<S, V, E>;
_addEdge(edge: Edge<S, V, E>): void;
_removeEdge(edge: Edge<S, V, E>): void;
_add(item: Subgraph<S, V, E> | Vertex<S, V, E> | Edge<S, V, E>): void;
}
export interface ISubgraph extends IGraphItem {
export declare class Vertex<S, V, E> extends GraphItem<S, V, E> {
readonly inEdges: Array<Edge<S, V, E>>;
readonly outEdges: Array<Edge<S, V, E>>;
readonly edges: ReadonlyArray<Edge<S, V, E>>;
readonly _?: V;
constructor(graph: Graph<S, V, E>, parent: Subgraph<S, V, E>, _?: V);
remove(full?: boolean, _?: (source: V, target: V) => E): void;
addInEdge(edge: Edge<S, V, E>): void;
removeInEdge(edge: Edge<S, V, E>): void;
addOutEdge(edge: Edge<S, V, E>): void;
removeOutEdge(edge: Edge<S, V, E>): void;
}
export declare class Edge<S, V, E> extends GraphItem<S, V, E> {
readonly source: Vertex<S, V, E>;
readonly target: Vertex<S, V, E>;
readonly _?: E;
constructor(graph: Graph<S, V, E>, parent: Subgraph<S, V, E>, source: Vertex<S, V, E>, target: Vertex<S, V, E>, _?: E);
remove(): void;
subgraphs(): ISubgraph[];
vertices(): IVertex[];
edges(): IEdge[];
}
export interface IVertex extends IGraphItem {
label(): string;
}
export interface IEdge extends IGraphItem {
sourceID(): string;
}
export declare class Graph implements ISubgraph {
private _root;
export declare class Graph<S = undefined, V = undefined, E = undefined> {
readonly root: Subgraph<S, V, E>;
private _allSubgraphs;
private _allSubgraphsMap;
private _allVertices;
private _allVerticesMap;
private _allEdges;
private _attrs;
constructor(id: string, attrs?: StringAnyMap);
className(): string;
id(): string;
attrs(): Dictionary<any>;
parent(): ISubgraph | null;
remove(): void;
subgraphs(): ISubgraph[];
vertices(): IVertex[];
edges(): IEdge[];
createSubgraph(parent: ISubgraph, id: string, attrs?: StringAnyMap): ISubgraph;
destroySubgraph(_subgraph: ISubgraph): void;
createVertex(parent: ISubgraph, id: string, label: string, attrs?: StringAnyMap): IVertex;
destroyVertex(_vertex: IVertex): void;
createEdge(parent: ISubgraph, id: string, sourceID: string, targetID: string, attrs?: StringAnyMap): IEdge;
destroyEdge(_edge: IEdge): void;
allSubgraph(id: string): ISubgraph;
allSubgraphs(): ISubgraph[];
allVertex(id: string): IVertex;
allVertices(): IVertex[];
allEdge(id: string): IEdge;
allEdges(): IEdge[];
getNearestDefinition(backwards?: boolean): IECLDefintion | null;
breakpointLocations(path?: string): IECLDefintion[];
private _allEdgesMap;
idOf: (item: Subgraph<S, V, E> | Vertex<S, V, E> | Edge<S, V, E>) => string;
constructor(idOf?: (item: Subgraph<S, V, E> | Vertex<S, V, E> | Edge<S, V, E>) => string, _?: S);
createSubgraph(parent?: Subgraph<S, V, E>, _?: S): Subgraph<S, V, E>;
removeSubgraph(subgraph: Subgraph<S, V, E>, full?: boolean): void;
readonly subgraphs: ReadonlyArray<Subgraph<S, V, E>>;
subgraph(id: string): Subgraph<S, V, E>;
createVertex(parent: Subgraph<S, V, E>, _?: V): Vertex<S, V, E>;
removeVertex(vertex: Vertex<S, V, E>, full?: boolean, _?: (source: V, target: V) => E): void;
readonly vertices: ReadonlyArray<Vertex<S, V, E>>;
vertex(id: string): Vertex<S, V, E>;
createEdge(parent: Subgraph<S, V, E>, source: Vertex<S, V, E>, target: Vertex<S, V, E>, _?: E): Edge<S, V, E>;
removeEdge(edge: Edge<S, V, E>): void;
readonly edges: ReadonlyArray<Edge<S, V, E>>;
edge(id: string): Edge<S, V, E>;
private _walk(parent, visitor);
walk(visitor: (visitor: GraphItem<S, V, E>) => "abort" | "stepover" | void): true | undefined;
clone(): Graph<S, V, E>;
}

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

Sorry, the diff of this file is not supported yet

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