var S=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}function k(u){throw new Error('Could not dynamically require "'+u+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var E={exports:{}},O;function M(){return O||(O=1,function(u,C){(function(d){u.exports=d()})(function(){return function(){function d(c,f,i){function y(a,b){if(!f[a]){if(!c[a]){var w=typeof k=="function"&&k;if(!b&&w)return w(a,!0);if(g)return g(a,!0);var o=new Error("Cannot find module '"+a+"'");throw o.code="MODULE_NOT_FOUND",o}var e=f[a]={exports:{}};c[a][0].call(e.exports,function(r){var t=c[a][1][r];return y(t||r)},e,e.exports,d,c,f,i)}return f[a].exports}for(var g=typeof k=="function"&&k,m=0;m<i.length;m++)y(i[m]);return y}return d}()({1:[function(d,c,f){Object.defineProperty(f,"__esModule",{value:!0}),f.default=void 0;function i(o){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(o)}function y(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function g(o,e){for(var r=0;r<e.length;r++){var t=e[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(o,a(t.key),t)}}function m(o,e,r){return e&&g(o.prototype,e),Object.defineProperty(o,"prototype",{writable:!1}),o}function a(o){var e=b(o,"string");return i(e)=="symbol"?e:e+""}function b(o,e){if(i(o)!="object"||!o)return o;var r=o[Symbol.toPrimitive];if(r!==void 0){var t=r.call(o,e);if(i(t)!="object")return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(o)}f.default=function(){function o(){var e=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=r.defaultLayoutOptions,n=t===void 0?{}:t,s=r.algorithms,v=s===void 0?["layered","stress","mrtree","radial","force","disco","sporeOverlap","sporeCompaction","rectpacking"]:s,l=r.workerFactory,p=r.workerUrl;if(y(this,o),this.defaultLayoutOptions=n,this.initialized=!1,typeof p>"u"&&typeof l>"u")throw new Error("Cannot construct an ELK without both 'workerUrl' and 'workerFactory'.");var h=l;typeof p<"u"&&typeof l>"u"&&(h=function(x){return new Worker(x)});var _=h(p);if(typeof _.postMessage!="function")throw new TypeError("Created worker does not provide the required 'postMessage' function.");this.worker=new w(_),this.worker.postMessage({cmd:"register",algorithms:v}).then(function(j){return e.initialized=!0}).catch(console.err)}return m(o,[{key:"layout",value:function(r){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.layoutOptions,s=n===void 0?this.defaultLayoutOptions:n,v=t.logging,l=v===void 0?!1:v,p=t.measureExecutionTime,h=p===void 0?!1:p;return r?this.worker.postMessage({cmd:"layout",graph:r,layoutOptions:s,options:{logging:l,measureExecutionTime:h}}):Promise.reject(new Error("Missing mandatory parameter 'graph'."))}},{key:"knownLayoutAlgorithms",value:function(){return this.worker.postMessage({cmd:"algorithms"})}},{key:"knownLayoutOptions",value:function(){return this.worker.postMessage({cmd:"options"})}},{key:"knownLayoutCategories",value:function(){return this.worker.postMessage({cmd:"categories"})}},{key:"terminateWorker",value:function(){this.worker&&this.worker.terminate()}}])}();var w=function(){function o(e){var r=this;if(y(this,o),e===void 0)throw new Error("Missing mandatory parameter 'worker'.");this.resolvers={},this.worker=e,this.worker.onmessage=function(t){setTimeout(function(){r.receive(r,t)},0)}}return m(o,[{key:"postMessage",value:function(r){var t=this.id||0;this.id=t+1,r.id=t;var n=this;return new Promise(function(s,v){n.resolvers[t]=function(l,p){l?(n.convertGwtStyleError(l),v(l)):s(p)},n.worker.postMessage(r)})}},{key:"receive",value:function(r,t){var n=t.data,s=r.resolvers[n.id];s&&(delete r.resolvers[n.id],n.error?s(n.error):s(null,n.data))}},{key:"terminate",value:function(){this.worker&&this.worker.terminate()}},{key:"convertGwtStyleError",value:function(r){if(r){var t=r.__java$exception;t&&(t.cause&&t.cause.backingJsObject&&(r.cause=t.cause.backingJsObject,this.convertGwtStyleError(r.cause)),delete r.__java$exception)}}}])}()},{}],2:[function(d,c,f){var i=d("./elk-api.js").default;Object.defineProperty(c.exports,"__esModule",{value:!0}),c.exports=i,i.default=i},{"./elk-api.js":1}]},{},[2])(2)})}(E)),E.exports}var P=M();const T=L(P),q="/assets/elk-worker.min-BdOC9sib.js";export{T as E,k as a,S as c,L as g,q as w};
