likec4 1.19.2 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__app__/react/likec4.tsx +16 -114
- package/__app__/src/chunks/{-index-overview-COSF42be.js → -index-overview-r2wnjkuP.js} +20 -19
- package/__app__/src/chunks/{likec4-CusAw_j6.js → likec4-CK8zVxjc.js} +1172 -1209
- package/__app__/src/chunks/main-DnSU4JID.js +23887 -0
- package/__app__/src/chunks/{mantine-B_6mKFFA.js → mantine-B9NZkjVg.js} +993 -981
- package/__app__/src/chunks/tanstack-router-B9I-d36d.js +3032 -0
- package/__app__/src/main.js +1 -2
- package/__app__/src/style.css +1 -1
- package/__app__/webcomponent/webcomponent.js +31797 -32401
- package/dist/chunks/prompt.cjs +1 -1
- package/dist/chunks/prompt.mjs +1 -1
- package/dist/cli/index.cjs +47 -58
- package/dist/cli/index.mjs +29 -40
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +106 -81
- package/dist/index.d.mts +106 -81
- package/dist/index.d.ts +106 -81
- package/dist/index.mjs +1 -1
- package/dist/model/index.cjs +1 -1
- package/dist/model/index.d.cts +4 -257
- package/dist/model/index.d.mts +4 -257
- package/dist/model/index.d.ts +4 -257
- package/dist/model/index.mjs +1 -1
- package/dist/shared/likec4.DBfW7tKq.cjs +1857 -0
- package/dist/shared/likec4.DCOeDSBO.mjs +1857 -0
- package/package.json +39 -39
- package/react/index.d.ts +771 -1546
- package/react/index.js +36748 -37458
- package/react/style.css +1 -1
- package/__app__/src/chunks/main-CtzxB_vG.js +0 -24136
- package/__app__/src/chunks/tanstack-router-BBWuTKWO.js +0 -2373
- package/dist/shared/likec4.-U9_Dinu.cjs +0 -1856
- package/dist/shared/likec4.CVn8U3Og.cjs +0 -9
- package/dist/shared/likec4.Cgd5VecV.mjs +0 -9
- package/dist/shared/likec4.D7BM0ZAO.mjs +0 -1856
- package/dist/shared/likec4.DJeGiAvE.d.cts +0 -1639
- package/dist/shared/likec4.DJeGiAvE.d.mts +0 -1639
- package/dist/shared/likec4.DJeGiAvE.d.ts +0 -1639
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";function i(n,e){if(typeof n>"u"||n==null)throw new Error(e??`Expected defined value, but received ${n}`);return n}function u(n,e){if(!n)throw new Error(e??"Invariant failed")}function a$1(n){throw new Error(`NonExhaustive value: ${n}`)}function f$1(n,e,t){let r=y=>n(y,...e);return t===void 0?r:Object.assign(r,{lazy:t,lazyArgs:e})}function l(n,e,t){let r=n.length-e.length;if(r===0)return n(...e);if(r===1)return f$1(n,e,t);throw new Error("Wrong number of arguments")}function At(...n){return l(Vt$1,n,$t$1)}var Vt$1=(n,e)=>n.length<e.length?n.map((t,r)=>[t,e[r]]):e.map((t,r)=>[n[r],t]),$t$1=n=>(e,t)=>({hasNext:!0,next:[e,n[t]],done:t>=n.length-1}),Jt={done:!0,hasNext:!1},Bt$1={done:!1,hasNext:!1},Kt=()=>Jt;function xt$1(n,...e){let t=n,r=e.map(j=>"lazy"in j?Xt(j):void 0),y=0;for(;y<e.length;){if(r[y]===void 0||!Gt(t)){let se=e[y];t=se(t),y+=1;continue}let j=[];for(let se=y;se<e.length;se++){let de=r[se];if(de===void 0||(j.push(de),de.isSingle))break}let re=[];for(let se of t)if(Ut$1(se,re,j))break;let{isSingle:ne}=j.at(-1);t=ne?re[0]:re,y+=j.length}return t}function Ut$1(n,e,t){if(t.length===0)return e.push(n),!1;let r=n,y=Bt$1,j=!1;for(let[re,ne]of t.entries()){let{index:se,items:de}=ne;if(de.push(r),y=ne(r,se,de),ne.index+=1,y.hasNext){if(y.hasMany??!1){for(let be of y.next)if(Ut$1(be,e,t.slice(re+1)))return!0;return j}r=y.next}if(!y.hasNext)break;y.done&&(j=!0)}return y.hasNext&&e.push(r),j}function Xt(n){let{lazy:e,lazyArgs:t}=n,r=e(...t);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function Gt(n){return typeof n=="string"||typeof n=="object"&&n!==null&&Symbol.iterator in n}function Qt(...n){return l(Zt,n)}var Zt=(n,e)=>n.length>=e;function Lt(...n){return l(tn$1,n)}function tn$1(n,e){let t=[];for(let[r,y]of n.entries()){if(!e(y,r,n))break;t.push(y)}return t}function jt$1(...n){return l(nn,n,rn$1)}var nn=(n,e)=>n.map(e),rn$1=n=>(e,t,r)=>({done:!1,hasNext:!0,next:n(e,t,r)});function ot$1(n){return typeof n=="string"}function ut$1(n){return typeof n=="function"}function Ct(n){return n!=null}function en$1(n){return n!==void 0}function st$1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var pt,zt;function on$1(){if(zt)return pt;zt=1;function n(e){if(typeof e!="function")throw new Error("mnemonist/DefaultMap.constructor: expecting a function.");this.items=new Map,this.factory=e,this.size=0}return n.prototype.clear=function(){this.items.clear(),this.size=0},n.prototype.get=function(e){var t=this.items.get(e);return typeof t>"u"&&(t=this.factory(e,this.size),this.items.set(e,t),this.size++),t},n.prototype.peek=function(e){return this.items.get(e)},n.prototype.set=function(e,t){return this.items.set(e,t),this.size=this.items.size,this},n.prototype.has=function(e){return this.items.has(e)},n.prototype.delete=function(e){var t=this.items.delete(e);return this.size=this.items.size,t},n.prototype.forEach=function(e,t){t=arguments.length>1?t:this,this.items.forEach(e,t)},n.prototype.entries=function(){return this.items.entries()},n.prototype.keys=function(){return this.items.keys()},n.prototype.values=function(){return this.items.values()},typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=n.prototype.entries),n.prototype.inspect=function(){return this.items},typeof Symbol<"u"&&(n.prototype[Symbol.for("nodejs.util.inspect.custom")]=n.prototype.inspect),n.autoIncrement=function(){var e=0;return function(){return e++}},pt=n,pt}var un$1=on$1();const sn$1=st$1(un$1);var gt,Mt;function an$1(){if(Mt)return gt;Mt=1;function n(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(n.prototype[Symbol.iterator]=function(){return this}),n.of=function(){var e=arguments,t=e.length,r=0;return new n(function(){return r>=t?{done:!0}:{done:!1,value:e[r++]}})},n.empty=function(){var e=new n(function(){return{done:!0}});return e},n.fromSequence=function(e){var t=0,r=e.length;return new n(function(){return t>=r?{done:!0}:{done:!1,value:e[t++]}})},n.is=function(e){return e instanceof n?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},gt=n,gt}var at$1={},Ft$1;function fn$2(){return Ft$1||(Ft$1=1,at$1.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",at$1.SYMBOL_SUPPORT=typeof Symbol<"u"),at$1}var yt,Nt;function ln$2(){if(Nt)return yt;Nt=1;var n=fn$2(),e=n.ARRAY_BUFFER_SUPPORT,t=n.SYMBOL_SUPPORT;return yt=function(r,y){var j,re,ne,se,de;if(!r)throw new Error("obliterator/forEach: invalid iterable.");if(typeof y!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(r)||e&&ArrayBuffer.isView(r)||typeof r=="string"||r.toString()==="[object Arguments]"){for(ne=0,se=r.length;ne<se;ne++)y(r[ne],ne);return}if(typeof r.forEach=="function"){r.forEach(y);return}if(t&&Symbol.iterator in r&&typeof r.next!="function"&&(r=r[Symbol.iterator]()),typeof r.next=="function"){for(j=r,ne=0;de=j.next(),de.done!==!0;)y(de.value,ne),ne++;return}for(re in r)r.hasOwnProperty(re)&&y(r[re],re)},yt}function cn$1(n,e,t){return n.length===0||e.length===0?[]:(t??=Object.is,xt$1(At(n,e),Lt(([r,y])=>t(r,y)),jt$1(([r,y])=>r)))}var mt={exports:{}},kt$1;function hn$1(){if(kt$1)return mt.exports;kt$1=1;var n=function(e,t){var r,y,j=1,re=0,ne=0,se=String.alphabet;function de(be,Ce,Ie){if(Ie){for(r=Ce;Ie=de(be,r),Ie<76&&Ie>65;)++r;return+be.slice(Ce-1,r)}return Ie=se&&se.indexOf(be.charAt(Ce)),Ie>-1?Ie+76:(Ie=be.charCodeAt(Ce)||0,Ie<45||Ie>127?Ie:Ie<46?65:Ie<48?Ie-1:Ie<58?Ie+18:Ie<65?Ie-11:Ie<91?Ie+11:Ie<97?Ie-37:Ie<123?Ie+5:Ie-63)}if((e+="")!=(t+="")){for(;j;)if(y=de(e,re++),j=de(t,ne++),y<76&&j<76&&y>66&&j>66&&(y=de(e,re,re),j=de(t,ne,re=r),ne=r),y!=j)return y<j?-1:1}return 0};try{mt.exports=n}catch{String.naturalCompare=n}return mt.exports}var dn$2=hn$1();const pn$2=st$1(dn$2);function Tt(n,e){return n===e?0:ot$1(n)?ot$1(e)?pn$2(n,e):1:ot$1(e)?-1:0}function tt(n){return n!=null&&typeof n=="string"}function gn$2(n){return!!n&&Array.isArray(n)&&n.length>0}function yn$2(n){const e=n.lastIndexOf(".");return e>0?n.slice(0,e):null}function mn$2(n){const e=n.lastIndexOf(".");return e>0?n.slice(e+1):n}const nt=n=>tt(n)?n:n.id;function ft(n,e){const t=nt(n);return e?nt(e).startsWith(t+"."):r=>{const y=nt(r);return t.startsWith(y+".")}}function wt$1(n,e){if(!e)return y=>wt$1(n,y);const t=nt(n),r=nt(e);return t===r||r.startsWith(t+".")||t.startsWith(r+".")}function wn$1(n,e){return e?ft(e,n):t=>ft(n,t)}function lt$1(n){return(tt(n)?n:n.id).split(".").length}function vn$1(n,e){const t=tt(n)?n:n.id,r=tt(e)?e:e.id;if(t===r)return 0;const y=lt$1(t),j=lt$1(r);if(wt$1(t,r))return Math.abs(y-j);const re=qt$1(t,r),ne=re?lt$1(re):0;return y+j-(2*ne+1)}function qt$1(n,e){const t=n.split(".");if(t.length<2)return null;const r=e.split(".");if(r.length<2)return null;let y=[];for(let j=0;j<Math.min(t.length,r.length)-1&&t[j]===r[j];j++)y.push(t[j]);return y.length===0?null:y.join(".")}function bn$1(n){const e=n.split(".");return e.pop(),e.length===0?[]:e.reduce((t,r,y)=>y===0?(t.push(r),t):(t.unshift(`${t[0]}.${r}`),t),[])}function Dt(n,e){const t=n.split(".").length,r=e.split(".").length;switch(!0){case t>r:return 1;case t<r:return-1;default:return 0}}function _n$1(n,e){return Dt(n.id,e.id)}function En$2(n){return n.map(e=>({item:e,fqn:e.id.split(".")})).sort((e,t)=>e.fqn.length-t.fqn.length).map(({item:e})=>e)}function In$1(n,e){let t=e;for(const r of n)ft(r,t)&&(t=r);return t!==e?t:null}function Sn$1(n){const e=[],t=[...n];let r;for(;r=t.shift();){let y;for(;y=In$1(t,r);)e.push(t.splice(t.indexOf(y),1)[0]);e.push(r)}return e}function Ot(n,e){if(!n||tt(n)){const r=n??"asc";return y=>Ot(y,r)}const t=e==="desc"?-1:1;return n.map(r=>({item:r,fqn:r.id.split(".")})).sort((r,y)=>{if(r.fqn.length!==y.fqn.length)return(r.fqn.length-y.fqn.length)*t;for(let j=0;j<r.fqn.length;j++){const re=Tt(r.fqn[j],y.fqn[j]);if(re!==0)return re}return 0}).map(({item:r})=>r)}function An$1(n,e,t){let r=n.get(e);return r||(r=t(e),n.set(e,r)),r}function Bn(n){return Ct(n)&&typeof n=="object"&&Symbol.iterator in n}function xn$1(n,e){const t=e??n;u(ut$1(t));function*r(y){for(const j of y)t(j)&&(yield j)}return e?r(n):r}function Un$1(n){return n?Rt(n):Rt}function*Rt(n){for(const e of n)yield*e}function Ln$1(n,e){const t=e??n;u(ut$1(t));function*r(y){for(const j of y)yield t(j)}return e?r(n):r}function jn$1(n,e){const t=e??n;u(ut$1(t));function r(y){for(const j of y)if(t(j))return!0;return!1}return e?r(n):r}function Cn$1(n){return n?Array.from(n):e=>Array.from(e)}function zn$1(n){return n?new Set(n):e=>new Set(e)}function Mn$1(n){return n?function*(){yield*Yt(n)}():Yt}function*Yt(n){const e=new Set;for(const t of n)e.has(t)||(e.add(t),yield t)}var vt$1={},Pt$1;function Fn$1(){return Pt$1||(Pt$1=1,function(n){n.intersection=function(){if(arguments.length<2)throw new Error("mnemonist/Set.intersection: needs at least two arguments.");var e=new Set,t=1/0,r=null,y,j,re=arguments.length;for(j=0;j<re;j++){if(y=arguments[j],y.size===0)return e;y.size<t&&(t=y.size,r=y)}for(var ne=r.values(),se,de,be,Ce;se=ne.next(),!se.done;){for(de=se.value,be=!0,j=0;j<re;j++)if(Ce=arguments[j],Ce!==r&&!Ce.has(de)){be=!1;break}be&&e.add(de)}return e},n.union=function(){if(arguments.length<2)throw new Error("mnemonist/Set.union: needs at least two arguments.");var e=new Set,t,r=arguments.length,y,j;for(t=0;t<r;t++)for(y=arguments[t].values();j=y.next(),!j.done;)e.add(j.value);return e},n.difference=function(e,t){if(!e.size)return new Set;if(!t.size)return new Set(e);for(var r=new Set,y=e.values(),j;j=y.next(),!j.done;)t.has(j.value)||r.add(j.value);return r},n.symmetricDifference=function(e,t){for(var r=new Set,y=e.values(),j;j=y.next(),!j.done;)t.has(j.value)||r.add(j.value);for(y=t.values();j=y.next(),!j.done;)e.has(j.value)||r.add(j.value);return r},n.isSubset=function(e,t){var r=e.values(),y;if(e===t)return!0;if(e.size>t.size)return!1;for(;y=r.next(),!y.done;)if(!t.has(y.value))return!1;return!0},n.isSuperset=function(e,t){return n.isSubset(t,e)},n.add=function(e,t){for(var r=t.values(),y;y=r.next(),!y.done;)e.add(y.value)},n.subtract=function(e,t){for(var r=t.values(),y;y=r.next(),!y.done;)e.delete(y.value)},n.intersect=function(e,t){for(var r=e.values(),y;y=r.next(),!y.done;)t.has(y.value)||e.delete(y.value)},n.disjunct=function(e,t){for(var r=e.values(),y,j=[];y=r.next(),!y.done;)t.has(y.value)&&j.push(y.value);for(r=t.values();y=r.next(),!y.done;)e.has(y.value)||e.add(y.value);for(var re=0,ne=j.length;re<ne;re++)e.delete(j[re])},n.intersectionSize=function(e,t){var r;if(e.size>t.size&&(r=e,e=t,t=r),e.size===0)return 0;if(e===t)return e.size;for(var y=e.values(),j,re=0;j=y.next(),!j.done;)t.has(j.value)&&re++;return re},n.unionSize=function(e,t){var r=n.intersectionSize(e,t);return e.size+t.size-r},n.jaccard=function(e,t){var r=n.intersectionSize(e,t);if(r===0)return 0;var y=e.size+t.size-r;return r/y},n.overlap=function(e,t){var r=n.intersectionSize(e,t);return r===0?0:r/Math.min(e.size,t.size)}}(vt$1)),vt$1}var Ht=Fn$1();function Nn$1(...n){let e=new Set;for(const t of n)for(const r of t)e.add(r);return e}function kn$1(n,...e){let t=new Set;if(n.size===0)return t;let r=e.length>1?Ht.intersection(...e):e[0];if(r.size===0)return t;for(const y of n)r.has(y)&&t.add(y);return t}function Tn$1(n,e){if(n.size===0)return new Set;if(e.size===0)return new Set(n);let t=new Set;for(const r of n)e.has(r)||t.add(r);return t}function qn(n,e){return n.size===e.size&&[...n].every(t=>e.has(t))}function On$1(n,e){if(n.size===0||e.size===0)return!1;e.size<n.size&&([n,e]=[e,n]);for(const t of n)if(e.has(t))return!0;return!1}function Rn$2(n){let e=5381;const t=n.length;u(t>0,"stringHash: empty string");for(let r=0;r<t;r++)e=e*33^n.charCodeAt(r);return(e>>>0).toString(36)}function ct$1(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var bt$1={exports:{}},Wt$1;function Yn(){return Wt$1||(Wt$1=1,function(n,e){(function(t){n.exports=t()})(function(){return function t(r,y,j){function re(de,be){if(!y[de]){if(!r[de]){var Ce=typeof ct$1=="function"&&ct$1;if(!be&&Ce)return Ce(de,!0);if(ne)return ne(de,!0);throw new Error("Cannot find module '"+de+"'")}be=y[de]={exports:{}},r[de][0].call(be.exports,function(Ie){var Oe=r[de][1][Ie];return re(Oe||Ie)},be,be.exports,t,r,y,j)}return y[de].exports}for(var ne=typeof ct$1=="function"&&ct$1,se=0;se<j.length;se++)re(j[se]);return re}({1:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){var we=t("crypto");function Te(ve,Re){Re=Vn(ve,Re);var le;return(le=Re.algorithm!=="passthrough"?we.createHash(Re.algorithm):new Jn).write===void 0&&(le.write=le.update,le.end=le.update),Qe(Re,le).dispatch(ve),le.update||le.end(""),le.digest?le.digest(Re.encoding==="buffer"?void 0:Re.encoding):(ve=le.read(),Re.encoding!=="buffer"?ve.toString(Re.encoding):ve)}(y=r.exports=Te).sha1=function(ve){return Te(ve)},y.keys=function(ve){return Te(ve,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},y.MD5=function(ve){return Te(ve,{algorithm:"md5",encoding:"hex"})},y.keysMD5=function(ve){return Te(ve,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var ke=we.getHashes?we.getHashes().slice():["sha1","md5"],Ve=(ke.push("passthrough"),["buffer","hex","binary","base64"]);function Vn(ve,Re){var le={};if(le.algorithm=(Re=Re||{}).algorithm||"sha1",le.encoding=Re.encoding||"hex",le.excludeValues=!!Re.excludeValues,le.algorithm=le.algorithm.toLowerCase(),le.encoding=le.encoding.toLowerCase(),le.ignoreUnknown=Re.ignoreUnknown===!0,le.respectType=Re.respectType!==!1,le.respectFunctionNames=Re.respectFunctionNames!==!1,le.respectFunctionProperties=Re.respectFunctionProperties!==!1,le.unorderedArrays=Re.unorderedArrays===!0,le.unorderedSets=Re.unorderedSets!==!1,le.unorderedObjects=Re.unorderedObjects!==!1,le.replacer=Re.replacer||void 0,le.excludeKeys=Re.excludeKeys||void 0,ve===void 0)throw new Error("Object argument required.");for(var ge=0;ge<ke.length;++ge)ke[ge].toLowerCase()===le.algorithm.toLowerCase()&&(le.algorithm=ke[ge]);if(ke.indexOf(le.algorithm)===-1)throw new Error('Algorithm "'+le.algorithm+'" not supported. supported values: '+ke.join(", "));if(Ve.indexOf(le.encoding)===-1&&le.algorithm!=="passthrough")throw new Error('Encoding "'+le.encoding+'" not supported. supported values: '+Ve.join(", "));return le}function Ze(ve){if(typeof ve=="function")return/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i.exec(Function.prototype.toString.call(ve))!=null}function Qe(ve,Re,le){le=le||[];function ge(ue){return Re.update?Re.update(ue,"utf8"):Re.write(ue,"utf8")}return{dispatch:function(ue){return this["_"+((ue=ve.replacer?ve.replacer(ue):ue)===null?"null":typeof ue)](ue)},_object:function(ue){var $e,Me=Object.prototype.toString.call(ue),Xr=/\[object (.*)\]/i.exec(Me);if(Xr=(Xr=Xr?Xr[1]:"unknown:["+Me+"]").toLowerCase(),0<=(Me=le.indexOf(ue)))return this.dispatch("[CIRCULAR:"+Me+"]");if(le.push(ue),ne!==void 0&&ne.isBuffer&&ne.isBuffer(ue))return ge("buffer:"),ge(ue);if(Xr==="object"||Xr==="function"||Xr==="asyncfunction")return Me=Object.keys(ue),ve.unorderedObjects&&(Me=Me.sort()),ve.respectType===!1||Ze(ue)||Me.splice(0,0,"prototype","__proto__","constructor"),ve.excludeKeys&&(Me=Me.filter(function(Zn){return!ve.excludeKeys(Zn)})),ge("object:"+Me.length+":"),$e=this,Me.forEach(function(Zn){$e.dispatch(Zn),ge(":"),ve.excludeValues||$e.dispatch(ue[Zn]),ge(",")});if(!this["_"+Xr]){if(ve.ignoreUnknown)return ge("["+Xr+"]");throw new Error('Unknown object type "'+Xr+'"')}this["_"+Xr](ue)},_array:function(ue,Zn){Zn=Zn!==void 0?Zn:ve.unorderedArrays!==!1;var Me=this;if(ge("array:"+ue.length+":"),!Zn||ue.length<=1)return ue.forEach(function(Jr){return Me.dispatch(Jr)});var Xr=[],Zn=ue.map(function(Jr){var Qn=new Jn,Qr=le.slice();return Qe(ve,Qn,Qr).dispatch(Jr),Xr=Xr.concat(Qr.slice(le.length)),Qn.read().toString()});return le=le.concat(Xr),Zn.sort(),this._array(Zn,!1)},_date:function(ue){return ge("date:"+ue.toJSON())},_symbol:function(ue){return ge("symbol:"+ue.toString())},_error:function(ue){return ge("error:"+ue.toString())},_boolean:function(ue){return ge("bool:"+ue.toString())},_string:function(ue){ge("string:"+ue.length+":"),ge(ue.toString())},_function:function(ue){ge("fn:"),Ze(ue)?this.dispatch("[native]"):this.dispatch(ue.toString()),ve.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(ue.name)),ve.respectFunctionProperties&&this._object(ue)},_number:function(ue){return ge("number:"+ue.toString())},_xml:function(ue){return ge("xml:"+ue.toString())},_null:function(){return ge("Null")},_undefined:function(){return ge("Undefined")},_regexp:function(ue){return ge("regex:"+ue.toString())},_uint8array:function(ue){return ge("uint8array:"),this.dispatch(Array.prototype.slice.call(ue))},_uint8clampedarray:function(ue){return ge("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(ue))},_int8array:function(ue){return ge("int8array:"),this.dispatch(Array.prototype.slice.call(ue))},_uint16array:function(ue){return ge("uint16array:"),this.dispatch(Array.prototype.slice.call(ue))},_int16array:function(ue){return ge("int16array:"),this.dispatch(Array.prototype.slice.call(ue))},_uint32array:function(ue){return ge("uint32array:"),this.dispatch(Array.prototype.slice.call(ue))},_int32array:function(ue){return ge("int32array:"),this.dispatch(Array.prototype.slice.call(ue))},_float32array:function(ue){return ge("float32array:"),this.dispatch(Array.prototype.slice.call(ue))},_float64array:function(ue){return ge("float64array:"),this.dispatch(Array.prototype.slice.call(ue))},_arraybuffer:function(ue){return ge("arraybuffer:"),this.dispatch(new Uint8Array(ue))},_url:function(ue){return ge("url:"+ue.toString())},_map:function(ue){return ge("map:"),ue=Array.from(ue),this._array(ue,ve.unorderedSets!==!1)},_set:function(ue){return ge("set:"),ue=Array.from(ue),this._array(ue,ve.unorderedSets!==!1)},_file:function(ue){return ge("file:"),this.dispatch([ue.name,ue.size,ue.type,ue.lastModfied])},_blob:function(){if(ve.ignoreUnknown)return ge("[blob]");throw Error(`Hashing Blob objects is currently not supported
|
|
2
|
-
(see https://github.com/puleos/object-hash/issues/26)
|
|
3
|
-
Use "options.replacer" or "options.ignoreUnknown"
|
|
4
|
-
`)},_domwindow:function(){return ge("domwindow")},_bigint:function(ue){return ge("bigint:"+ue.toString())},_process:function(){return ge("process")},_timer:function(){return ge("timer")},_pipe:function(){return ge("pipe")},_tcp:function(){return ge("tcp")},_udp:function(){return ge("udp")},_tty:function(){return ge("tty")},_statwatcher:function(){return ge("statwatcher")},_securecontext:function(){return ge("securecontext")},_connection:function(){return ge("connection")},_zlib:function(){return ge("zlib")},_context:function(){return ge("context")},_nodescript:function(){return ge("nodescript")},_httpparser:function(){return ge("httpparser")},_dataview:function(){return ge("dataview")},_signal:function(){return ge("signal")},_fsevent:function(){return ge("fsevent")},_tlswrap:function(){return ge("tlswrap")}}}function Jn(){return{buf:"",write:function(ve){this.buf+=ve},end:function(ve){this.buf+=ve},read:function(){return this.buf}}}y.writeToStream=function(ve,Re,le){return le===void 0&&(le=Re,Re={}),Qe(Re=Vn(ve,Re),le).dispatch(ve)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/fake_9a5aa49d.js","/")},{buffer:3,crypto:5,lYpoI2:11}],2:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){(function(we){var Te=typeof Uint8Array<"u"?Uint8Array:Array,ke=43,Ve=47,Vn=48,Ze=97,Qe=65,Jn=45,ve=95;function Re(le){return le=le.charCodeAt(0),le===ke||le===Jn?62:le===Ve||le===ve?63:le<Vn?-1:le<Vn+10?le-Vn+26+26:le<Qe+26?le-Qe:le<Ze+26?le-Ze+26:void 0}we.toByteArray=function(le){var ge,ue;if(0<le.length%4)throw new Error("Invalid string. Length must be a multiple of 4");var $e=le.length,$e=le.charAt($e-2)==="="?2:le.charAt($e-1)==="="?1:0,Me=new Te(3*le.length/4-$e),Xr=0<$e?le.length-4:le.length,Zn=0;function Jr(Qn){Me[Zn++]=Qn}for(ge=0;ge<Xr;ge+=4,0)Jr((16711680&(ue=Re(le.charAt(ge))<<18|Re(le.charAt(ge+1))<<12|Re(le.charAt(ge+2))<<6|Re(le.charAt(ge+3))))>>16),Jr((65280&ue)>>8),Jr(255&ue);return $e==2?Jr(255&(ue=Re(le.charAt(ge))<<2|Re(le.charAt(ge+1))>>4)):$e==1&&(Jr((ue=Re(le.charAt(ge))<<10|Re(le.charAt(ge+1))<<4|Re(le.charAt(ge+2))>>2)>>8&255),Jr(255&ue)),Me},we.fromByteArray=function(le){var ge,ue,$e,Me,Xr=le.length%3,Zn="";function Jr(Qn){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(Qn)}for(ge=0,$e=le.length-Xr;ge<$e;ge+=3)ue=(le[ge]<<16)+(le[ge+1]<<8)+le[ge+2],Zn+=Jr((Me=ue)>>18&63)+Jr(Me>>12&63)+Jr(Me>>6&63)+Jr(63&Me);switch(Xr){case 1:Zn=(Zn+=Jr((ue=le[le.length-1])>>2))+Jr(ue<<4&63)+"==";break;case 2:Zn=(Zn=(Zn+=Jr((ue=(le[le.length-2]<<8)+le[le.length-1])>>10))+Jr(ue>>4&63))+Jr(ue<<2&63)+"="}return Zn}})(y===void 0?this.base64js={}:y)}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(t,r,y){(function(j,re,ke,se,de,be,Ce,Ie,Oe){var we=t("base64-js"),Te=t("ieee754");function ke(Y,ae,Ee){if(!(this instanceof ke))return new ke(Y,ae,Ee);var Ke,qe,Kn,Hr,oi=typeof Y;if(ae==="base64"&&oi=="string")for(Y=(Hr=Y).trim?Hr.trim():Hr.replace(/^\s+|\s+$/g,"");Y.length%4!=0;)Y+="=";if(oi=="number")Ke=Zr(Y);else if(oi=="string")Ke=ke.byteLength(Y,ae);else{if(oi!="object")throw new Error("First argument needs to be a number, array or string.");Ke=Zr(Y.length)}if(ke._useTypedArrays?qe=ke._augment(new Uint8Array(Ke)):((qe=this).length=Ke,qe._isBuffer=!0),ke._useTypedArrays&&typeof Y.byteLength=="number")qe._set(Y);else if(ni(Hr=Y)||ke.isBuffer(Hr)||Hr&&typeof Hr=="object"&&typeof Hr.length=="number")for(Kn=0;Kn<Ke;Kn++)ke.isBuffer(Y)?qe[Kn]=Y.readUInt8(Kn):qe[Kn]=Y[Kn];else if(oi=="string")qe.write(Y,0,ae);else if(oi=="number"&&!ke._useTypedArrays&&!Ee)for(Kn=0;Kn<Ke;Kn++)qe[Kn]=0;return qe}function Ve(Y,ae,Ee,Ke){return ke._charsWritten=bi(function(qe){for(var Kn=[],Hr=0;Hr<qe.length;Hr++)Kn.push(255&qe.charCodeAt(Hr));return Kn}(ae),Y,Ee,Ke)}function Vn(Y,ae,Ee,Ke){return ke._charsWritten=bi(function(qe){for(var Kn,Hr,oi=[],ui=0;ui<qe.length;ui++)Hr=qe.charCodeAt(ui),Kn=Hr>>8,Hr=Hr%256,oi.push(Hr),oi.push(Kn);return oi}(ae),Y,Ee,Ke)}function Ze(Y,ae,Ee){var Ke="";Ee=Math.min(Y.length,Ee);for(var qe=ae;qe<Ee;qe++)Ke+=String.fromCharCode(Y[qe]);return Ke}function Qe(Y,ae,Ee,Kn){Kn||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae!=null,"missing offset"),Le(ae+1<Y.length,"Trying to read beyond buffer length"));var qe,Kn=Y.length;if(!(Kn<=ae))return Ee?(qe=Y[ae],ae+1<Kn&&(qe|=Y[ae+1]<<8)):(qe=Y[ae]<<8,ae+1<Kn&&(qe|=Y[ae+1])),qe}function Jn(Y,ae,Ee,Kn){Kn||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae!=null,"missing offset"),Le(ae+3<Y.length,"Trying to read beyond buffer length"));var qe,Kn=Y.length;if(!(Kn<=ae))return Ee?(ae+2<Kn&&(qe=Y[ae+2]<<16),ae+1<Kn&&(qe|=Y[ae+1]<<8),qe|=Y[ae],ae+3<Kn&&(qe+=Y[ae+3]<<24>>>0)):(ae+1<Kn&&(qe=Y[ae+1]<<16),ae+2<Kn&&(qe|=Y[ae+2]<<8),ae+3<Kn&&(qe|=Y[ae+3]),qe+=Y[ae]<<24>>>0),qe}function ve(Y,ae,Ee,Ke){if(Ke||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae!=null,"missing offset"),Le(ae+1<Y.length,"Trying to read beyond buffer length")),!(Y.length<=ae))return Ke=Qe(Y,ae,Ee,!0),32768&Ke?-1*(65535-Ke+1):Ke}function Re(Y,ae,Ee,Ke){if(Ke||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae!=null,"missing offset"),Le(ae+3<Y.length,"Trying to read beyond buffer length")),!(Y.length<=ae))return Ke=Jn(Y,ae,Ee,!0),2147483648&Ke?-1*(4294967295-Ke+1):Ke}function le(Y,ae,Ee,Ke){return Ke||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae+3<Y.length,"Trying to read beyond buffer length")),Te.read(Y,ae,Ee,23,4)}function ge(Y,ae,Ee,Ke){return Ke||(Le(typeof Ee=="boolean","missing or invalid endian"),Le(ae+7<Y.length,"Trying to read beyond buffer length")),Te.read(Y,ae,Ee,52,8)}function ue(Y,ae,Ee,Ke,qe){if(qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+1<Y.length,"trying to write beyond buffer length"),Ii(ae,65535)),qe=Y.length,!(qe<=Ee))for(var Kn=0,Hr=Math.min(qe-Ee,2);Kn<Hr;Kn++)Y[Ee+Kn]=(ae&255<<8*(Ke?Kn:1-Kn))>>>8*(Ke?Kn:1-Kn)}function $e(Y,ae,Ee,Ke,qe){if(qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+3<Y.length,"trying to write beyond buffer length"),Ii(ae,4294967295)),qe=Y.length,!(qe<=Ee))for(var Kn=0,Hr=Math.min(qe-Ee,4);Kn<Hr;Kn++)Y[Ee+Kn]=ae>>>8*(Ke?Kn:3-Kn)&255}function Me(Y,ae,Ee,Ke,qe){qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+1<Y.length,"Trying to write beyond buffer length"),xi(ae,32767,-32768)),Y.length<=Ee||ue(Y,0<=ae?ae:65535+ae+1,Ee,Ke,qe)}function Xr(Y,ae,Ee,Ke,qe){qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+3<Y.length,"Trying to write beyond buffer length"),xi(ae,2147483647,-2147483648)),Y.length<=Ee||$e(Y,0<=ae?ae:4294967295+ae+1,Ee,Ke,qe)}function Zn(Y,ae,Ee,Ke,qe){qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+3<Y.length,"Trying to write beyond buffer length"),Ei(ae,34028234663852886e22,-34028234663852886e22)),Y.length<=Ee||Te.write(Y,ae,Ee,Ke,23,4)}function Jr(Y,ae,Ee,Ke,qe){qe||(Le(ae!=null,"missing value"),Le(typeof Ke=="boolean","missing or invalid endian"),Le(Ee!=null,"missing offset"),Le(Ee+7<Y.length,"Trying to write beyond buffer length"),Ei(ae,17976931348623157e292,-17976931348623157e292)),Y.length<=Ee||Te.write(Y,ae,Ee,Ke,52,8)}y.Buffer=ke,y.SlowBuffer=ke,y.INSPECT_MAX_BYTES=50,ke.poolSize=8192,ke._useTypedArrays=function(){try{var Y=new ArrayBuffer(0),ae=new Uint8Array(Y);return ae.foo=function(){return 42},ae.foo()===42&&typeof ae.subarray=="function"}catch{return!1}}(),ke.isEncoding=function(Y){switch(String(Y).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ke.isBuffer=function(Y){return!(Y==null||!Y._isBuffer)},ke.byteLength=function(Y,ae){var Ee;switch(Y+="",ae||"utf8"){case"hex":Ee=Y.length/2;break;case"utf8":case"utf-8":Ee=mi(Y).length;break;case"ascii":case"binary":case"raw":Ee=Y.length;break;case"base64":Ee=Ci(Y).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Ee=2*Y.length;break;default:throw new Error("Unknown encoding")}return Ee},ke.concat=function(Y,ae){if(Le(ni(Y),`Usage: Buffer.concat(list, [totalLength])
|
|
5
|
-
list should be an Array.`),Y.length===0)return new ke(0);if(Y.length===1)return Y[0];if(typeof ae!="number")for(qe=ae=0;qe<Y.length;qe++)ae+=Y[qe].length;for(var Ee=new ke(ae),Ke=0,qe=0;qe<Y.length;qe++){var Kn=Y[qe];Kn.copy(Ee,Ke),Ke+=Kn.length}return Ee},ke.prototype.write=function(Y,ae,Ee,Ke){isFinite(ae)?isFinite(Ee)||(Ke=Ee,Ee=void 0):(ui=Ke,Ke=ae,ae=Ee,Ee=ui),ae=Number(ae)||0;var qe,Kn,Hr,oi,ui=this.length-ae;switch((!Ee||ui<(Ee=Number(Ee)))&&(Ee=ui),Ke=String(Ke||"utf8").toLowerCase()){case"hex":qe=function(fi,hi,si,ci){si=Number(si)||0;var ai=fi.length-si;(!ci||ai<(ci=Number(ci)))&&(ci=ai),Le((ai=hi.length)%2==0,"Invalid hex string"),ai/2<ci&&(ci=ai/2);for(var vi=0;vi<ci;vi++){var ki=parseInt(hi.substr(2*vi,2),16);Le(!isNaN(ki),"Invalid hex string"),fi[si+vi]=ki}return ke._charsWritten=2*vi,vi}(this,Y,ae,Ee);break;case"utf8":case"utf-8":Kn=this,Hr=ae,oi=Ee,qe=ke._charsWritten=bi(mi(Y),Kn,Hr,oi);break;case"ascii":case"binary":qe=Ve(this,Y,ae,Ee);break;case"base64":Kn=this,Hr=ae,oi=Ee,qe=ke._charsWritten=bi(Ci(Y),Kn,Hr,oi);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":qe=Vn(this,Y,ae,Ee);break;default:throw new Error("Unknown encoding")}return qe},ke.prototype.toString=function(Y,ae,Ee){var Ke,qe,Kn,Hr,oi=this;if(Y=String(Y||"utf8").toLowerCase(),ae=Number(ae)||0,(Ee=Ee!==void 0?Number(Ee):oi.length)===ae)return"";switch(Y){case"hex":Ke=function(ui,fi,hi){var si=ui.length;(!fi||fi<0)&&(fi=0),(!hi||hi<0||si<hi)&&(hi=si);for(var ci="",ai=fi;ai<hi;ai++)ci+=ti(ui[ai]);return ci}(oi,ae,Ee);break;case"utf8":case"utf-8":Ke=function(ui,fi,hi){var si="",ci="";hi=Math.min(ui.length,hi);for(var ai=fi;ai<hi;ai++)ui[ai]<=127?(si+=Ai(ci)+String.fromCharCode(ui[ai]),ci=""):ci+="%"+ui[ai].toString(16);return si+Ai(ci)}(oi,ae,Ee);break;case"ascii":case"binary":Ke=Ze(oi,ae,Ee);break;case"base64":qe=oi,Hr=Ee,Ke=(Kn=ae)===0&&Hr===qe.length?we.fromByteArray(qe):we.fromByteArray(qe.slice(Kn,Hr));break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":Ke=function(ui,fi,hi){for(var si=ui.slice(fi,hi),ci="",ai=0;ai<si.length;ai+=2)ci+=String.fromCharCode(si[ai]+256*si[ai+1]);return ci}(oi,ae,Ee);break;default:throw new Error("Unknown encoding")}return Ke},ke.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},ke.prototype.copy=function(Y,ae,Ee,Ke){if(ae=ae||0,(Ke=Ke||Ke===0?Ke:this.length)!==(Ee=Ee||0)&&Y.length!==0&&this.length!==0){Le(Ee<=Ke,"sourceEnd < sourceStart"),Le(0<=ae&&ae<Y.length,"targetStart out of bounds"),Le(0<=Ee&&Ee<this.length,"sourceStart out of bounds"),Le(0<=Ke&&Ke<=this.length,"sourceEnd out of bounds"),Ke>this.length&&(Ke=this.length);var qe=(Ke=Y.length-ae<Ke-Ee?Y.length-ae+Ee:Ke)-Ee;if(qe<100||!ke._useTypedArrays)for(var Kn=0;Kn<qe;Kn++)Y[Kn+ae]=this[Kn+Ee];else Y._set(this.subarray(Ee,Ee+qe),ae)}},ke.prototype.slice=function(Y,ae){var Ee=this.length;if(Y=Qr(Y,Ee,0),ae=Qr(ae,Ee,Ee),ke._useTypedArrays)return ke._augment(this.subarray(Y,ae));for(var Ke=ae-Y,qe=new ke(Ke,void 0,!0),Kn=0;Kn<Ke;Kn++)qe[Kn]=this[Kn+Y];return qe},ke.prototype.get=function(Y){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(Y)},ke.prototype.set=function(Y,ae){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(Y,ae)},ke.prototype.readUInt8=function(Y,ae){if(ae||(Le(Y!=null,"missing offset"),Le(Y<this.length,"Trying to read beyond buffer length")),!(Y>=this.length))return this[Y]},ke.prototype.readUInt16LE=function(Y,ae){return Qe(this,Y,!0,ae)},ke.prototype.readUInt16BE=function(Y,ae){return Qe(this,Y,!1,ae)},ke.prototype.readUInt32LE=function(Y,ae){return Jn(this,Y,!0,ae)},ke.prototype.readUInt32BE=function(Y,ae){return Jn(this,Y,!1,ae)},ke.prototype.readInt8=function(Y,ae){if(ae||(Le(Y!=null,"missing offset"),Le(Y<this.length,"Trying to read beyond buffer length")),!(Y>=this.length))return 128&this[Y]?-1*(255-this[Y]+1):this[Y]},ke.prototype.readInt16LE=function(Y,ae){return ve(this,Y,!0,ae)},ke.prototype.readInt16BE=function(Y,ae){return ve(this,Y,!1,ae)},ke.prototype.readInt32LE=function(Y,ae){return Re(this,Y,!0,ae)},ke.prototype.readInt32BE=function(Y,ae){return Re(this,Y,!1,ae)},ke.prototype.readFloatLE=function(Y,ae){return le(this,Y,!0,ae)},ke.prototype.readFloatBE=function(Y,ae){return le(this,Y,!1,ae)},ke.prototype.readDoubleLE=function(Y,ae){return ge(this,Y,!0,ae)},ke.prototype.readDoubleBE=function(Y,ae){return ge(this,Y,!1,ae)},ke.prototype.writeUInt8=function(Y,ae,Ee){Ee||(Le(Y!=null,"missing value"),Le(ae!=null,"missing offset"),Le(ae<this.length,"trying to write beyond buffer length"),Ii(Y,255)),ae>=this.length||(this[ae]=Y)},ke.prototype.writeUInt16LE=function(Y,ae,Ee){ue(this,Y,ae,!0,Ee)},ke.prototype.writeUInt16BE=function(Y,ae,Ee){ue(this,Y,ae,!1,Ee)},ke.prototype.writeUInt32LE=function(Y,ae,Ee){$e(this,Y,ae,!0,Ee)},ke.prototype.writeUInt32BE=function(Y,ae,Ee){$e(this,Y,ae,!1,Ee)},ke.prototype.writeInt8=function(Y,ae,Ee){Ee||(Le(Y!=null,"missing value"),Le(ae!=null,"missing offset"),Le(ae<this.length,"Trying to write beyond buffer length"),xi(Y,127,-128)),ae>=this.length||(0<=Y?this.writeUInt8(Y,ae,Ee):this.writeUInt8(255+Y+1,ae,Ee))},ke.prototype.writeInt16LE=function(Y,ae,Ee){Me(this,Y,ae,!0,Ee)},ke.prototype.writeInt16BE=function(Y,ae,Ee){Me(this,Y,ae,!1,Ee)},ke.prototype.writeInt32LE=function(Y,ae,Ee){Xr(this,Y,ae,!0,Ee)},ke.prototype.writeInt32BE=function(Y,ae,Ee){Xr(this,Y,ae,!1,Ee)},ke.prototype.writeFloatLE=function(Y,ae,Ee){Zn(this,Y,ae,!0,Ee)},ke.prototype.writeFloatBE=function(Y,ae,Ee){Zn(this,Y,ae,!1,Ee)},ke.prototype.writeDoubleLE=function(Y,ae,Ee){Jr(this,Y,ae,!0,Ee)},ke.prototype.writeDoubleBE=function(Y,ae,Ee){Jr(this,Y,ae,!1,Ee)},ke.prototype.fill=function(Y,ae,Ee){if(ae=ae||0,Ee=Ee||this.length,Le(typeof(Y=typeof(Y=Y||0)=="string"?Y.charCodeAt(0):Y)=="number"&&!isNaN(Y),"value is not a number"),Le(ae<=Ee,"end < start"),Ee!==ae&&this.length!==0){Le(0<=ae&&ae<this.length,"start out of bounds"),Le(0<=Ee&&Ee<=this.length,"end out of bounds");for(var Ke=ae;Ke<Ee;Ke++)this[Ke]=Y}},ke.prototype.inspect=function(){for(var Y=[],ae=this.length,Ee=0;Ee<ae;Ee++)if(Y[Ee]=ti(this[Ee]),Ee===y.INSPECT_MAX_BYTES){Y[Ee+1]="...";break}return"<Buffer "+Y.join(" ")+">"},ke.prototype.toArrayBuffer=function(){if(typeof Uint8Array>"u")throw new Error("Buffer.toArrayBuffer not supported in this browser");if(ke._useTypedArrays)return new ke(this).buffer;for(var Y=new Uint8Array(this.length),ae=0,Ee=Y.length;ae<Ee;ae+=1)Y[ae]=this[ae];return Y.buffer};var Qn=ke.prototype;function Qr(Y,ae,Ee){return typeof Y!="number"?Ee:ae<=(Y=~~Y)?ae:0<=Y||0<=(Y+=ae)?Y:0}function Zr(Y){return(Y=~~Math.ceil(+Y))<0?0:Y}function ni(Y){return(Array.isArray||function(ae){return Object.prototype.toString.call(ae)==="[object Array]"})(Y)}function ti(Y){return Y<16?"0"+Y.toString(16):Y.toString(16)}function mi(Y){for(var ae=[],Ee=0;Ee<Y.length;Ee++){var Ke=Y.charCodeAt(Ee);if(Ke<=127)ae.push(Y.charCodeAt(Ee));else for(var qe=Ee,Kn=(55296<=Ke&&Ke<=57343&&Ee++,encodeURIComponent(Y.slice(qe,Ee+1)).substr(1).split("%")),Hr=0;Hr<Kn.length;Hr++)ae.push(parseInt(Kn[Hr],16))}return ae}function Ci(Y){return we.toByteArray(Y)}function bi(Y,ae,Ee,Ke){for(var qe=0;qe<Ke&&!(qe+Ee>=ae.length||qe>=Y.length);qe++)ae[qe+Ee]=Y[qe];return qe}function Ai(Y){try{return decodeURIComponent(Y)}catch{return"\uFFFD"}}function Ii(Y,ae){Le(typeof Y=="number","cannot write a non-number as a number"),Le(0<=Y,"specified a negative value for writing an unsigned value"),Le(Y<=ae,"value is larger than maximum value for type"),Le(Math.floor(Y)===Y,"value has a fractional component")}function xi(Y,ae,Ee){Le(typeof Y=="number","cannot write a non-number as a number"),Le(Y<=ae,"value larger than maximum allowed value"),Le(Ee<=Y,"value smaller than minimum allowed value"),Le(Math.floor(Y)===Y,"value has a fractional component")}function Ei(Y,ae,Ee){Le(typeof Y=="number","cannot write a non-number as a number"),Le(Y<=ae,"value larger than maximum allowed value"),Le(Ee<=Y,"value smaller than minimum allowed value")}function Le(Y,ae){if(!Y)throw new Error(ae||"Failed assertion")}ke._augment=function(Y){return Y._isBuffer=!0,Y._get=Y.get,Y._set=Y.set,Y.get=Qn.get,Y.set=Qn.set,Y.write=Qn.write,Y.toString=Qn.toString,Y.toLocaleString=Qn.toString,Y.toJSON=Qn.toJSON,Y.copy=Qn.copy,Y.slice=Qn.slice,Y.readUInt8=Qn.readUInt8,Y.readUInt16LE=Qn.readUInt16LE,Y.readUInt16BE=Qn.readUInt16BE,Y.readUInt32LE=Qn.readUInt32LE,Y.readUInt32BE=Qn.readUInt32BE,Y.readInt8=Qn.readInt8,Y.readInt16LE=Qn.readInt16LE,Y.readInt16BE=Qn.readInt16BE,Y.readInt32LE=Qn.readInt32LE,Y.readInt32BE=Qn.readInt32BE,Y.readFloatLE=Qn.readFloatLE,Y.readFloatBE=Qn.readFloatBE,Y.readDoubleLE=Qn.readDoubleLE,Y.readDoubleBE=Qn.readDoubleBE,Y.writeUInt8=Qn.writeUInt8,Y.writeUInt16LE=Qn.writeUInt16LE,Y.writeUInt16BE=Qn.writeUInt16BE,Y.writeUInt32LE=Qn.writeUInt32LE,Y.writeUInt32BE=Qn.writeUInt32BE,Y.writeInt8=Qn.writeInt8,Y.writeInt16LE=Qn.writeInt16LE,Y.writeInt16BE=Qn.writeInt16BE,Y.writeInt32LE=Qn.writeInt32LE,Y.writeInt32BE=Qn.writeInt32BE,Y.writeFloatLE=Qn.writeFloatLE,Y.writeFloatBE=Qn.writeFloatBE,Y.writeDoubleLE=Qn.writeDoubleLE,Y.writeDoubleBE=Qn.writeDoubleBE,Y.fill=Qn.fill,Y.inspect=Qn.inspect,Y.toArrayBuffer=Qn.toArrayBuffer,Y}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(t,r,y){(function(j,re,we,se,de,be,Ce,Ie,Oe){var we=t("buffer").Buffer,Te=4,ke=new we(Te);ke.fill(0),r.exports={hash:function(Ve,Vn,Ze,Qe){for(var Jn=Vn(function(ue,$e){ue.length%Te!=0&&(Me=ue.length+(Te-ue.length%Te),ue=we.concat([ue,ke],Me));for(var Me,Xr=[],Zn=$e?ue.readInt32BE:ue.readInt32LE,Jr=0;Jr<ue.length;Jr+=Te)Xr.push(Zn.call(ue,Jr));return Xr}(Ve=we.isBuffer(Ve)?Ve:new we(Ve),Qe),8*Ve.length),Vn=Qe,ve=new we(Ze),Re=Vn?ve.writeInt32BE:ve.writeInt32LE,le=0;le<Jn.length;le++)Re.call(ve,Jn[le],4*le,!0);return ve}}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/helpers.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],5:[function(t,r,y){(function(j,re,we,se,de,be,Ce,Ie,Oe){var we=t("buffer").Buffer,Te=t("./sha"),ke=t("./sha256"),Ve=t("./rng"),Vn={sha1:Te,sha256:ke,md5:t("./md5")},Ze=64,Qe=new we(Ze);function Jn(ue,$e){var Me=Vn[ue=ue||"sha1"],Xr=[];return Me||ve("algorithm:",ue,"is not yet supported"),{update:function(Zn){return we.isBuffer(Zn)||(Zn=new we(Zn)),Xr.push(Zn),Zn.length,this},digest:function(Zn){var Jr=we.concat(Xr),Jr=$e?function(Qn,Qr,Zr){we.isBuffer(Qr)||(Qr=new we(Qr)),we.isBuffer(Zr)||(Zr=new we(Zr)),Qr.length>Ze?Qr=Qn(Qr):Qr.length<Ze&&(Qr=we.concat([Qr,Qe],Ze));for(var ni=new we(Ze),ti=new we(Ze),mi=0;mi<Ze;mi++)ni[mi]=54^Qr[mi],ti[mi]=92^Qr[mi];return Zr=Qn(we.concat([ni,Zr])),Qn(we.concat([ti,Zr]))}(Me,$e,Jr):Me(Jr);return Xr=null,Zn?Jr.toString(Zn):Jr}}}function ve(){var ue=[].slice.call(arguments).join(" ");throw new Error([ue,"we accept pull requests","http://github.com/dominictarr/crypto-browserify"].join(`
|
|
6
|
-
`))}Qe.fill(0),y.createHash=function(ue){return Jn(ue)},y.createHmac=Jn,y.randomBytes=function(ue,$e){if(!$e||!$e.call)return new we(Ve(ue));try{$e.call(this,void 0,new we(Ve(ue)))}catch(Me){$e(Me)}};var Re,le=["createCredentials","createCipher","createCipheriv","createDecipher","createDecipheriv","createSign","createVerify","createDiffieHellman","pbkdf2"],ge=function(ue){y[ue]=function(){ve("sorry,",ue,"is not implemented yet")}};for(Re in le)ge(le[Re])}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/index.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./md5":6,"./rng":7,"./sha":8,"./sha256":9,buffer:3,lYpoI2:11}],6:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){var we=t("./helpers");function Te(ve,Re){ve[Re>>5]|=128<<Re%32,ve[14+(Re+64>>>9<<4)]=Re;for(var le=1732584193,ge=-271733879,ue=-1732584194,$e=271733878,Me=0;Me<ve.length;Me+=16){var Xr=le,Zn=ge,Jr=ue,Qn=$e,le=Ve(le,ge,ue,$e,ve[Me+0],7,-680876936),$e=Ve($e,le,ge,ue,ve[Me+1],12,-389564586),ue=Ve(ue,$e,le,ge,ve[Me+2],17,606105819),ge=Ve(ge,ue,$e,le,ve[Me+3],22,-1044525330);le=Ve(le,ge,ue,$e,ve[Me+4],7,-176418897),$e=Ve($e,le,ge,ue,ve[Me+5],12,1200080426),ue=Ve(ue,$e,le,ge,ve[Me+6],17,-1473231341),ge=Ve(ge,ue,$e,le,ve[Me+7],22,-45705983),le=Ve(le,ge,ue,$e,ve[Me+8],7,1770035416),$e=Ve($e,le,ge,ue,ve[Me+9],12,-1958414417),ue=Ve(ue,$e,le,ge,ve[Me+10],17,-42063),ge=Ve(ge,ue,$e,le,ve[Me+11],22,-1990404162),le=Ve(le,ge,ue,$e,ve[Me+12],7,1804603682),$e=Ve($e,le,ge,ue,ve[Me+13],12,-40341101),ue=Ve(ue,$e,le,ge,ve[Me+14],17,-1502002290),le=Vn(le,ge=Ve(ge,ue,$e,le,ve[Me+15],22,1236535329),ue,$e,ve[Me+1],5,-165796510),$e=Vn($e,le,ge,ue,ve[Me+6],9,-1069501632),ue=Vn(ue,$e,le,ge,ve[Me+11],14,643717713),ge=Vn(ge,ue,$e,le,ve[Me+0],20,-373897302),le=Vn(le,ge,ue,$e,ve[Me+5],5,-701558691),$e=Vn($e,le,ge,ue,ve[Me+10],9,38016083),ue=Vn(ue,$e,le,ge,ve[Me+15],14,-660478335),ge=Vn(ge,ue,$e,le,ve[Me+4],20,-405537848),le=Vn(le,ge,ue,$e,ve[Me+9],5,568446438),$e=Vn($e,le,ge,ue,ve[Me+14],9,-1019803690),ue=Vn(ue,$e,le,ge,ve[Me+3],14,-187363961),ge=Vn(ge,ue,$e,le,ve[Me+8],20,1163531501),le=Vn(le,ge,ue,$e,ve[Me+13],5,-1444681467),$e=Vn($e,le,ge,ue,ve[Me+2],9,-51403784),ue=Vn(ue,$e,le,ge,ve[Me+7],14,1735328473),le=Ze(le,ge=Vn(ge,ue,$e,le,ve[Me+12],20,-1926607734),ue,$e,ve[Me+5],4,-378558),$e=Ze($e,le,ge,ue,ve[Me+8],11,-2022574463),ue=Ze(ue,$e,le,ge,ve[Me+11],16,1839030562),ge=Ze(ge,ue,$e,le,ve[Me+14],23,-35309556),le=Ze(le,ge,ue,$e,ve[Me+1],4,-1530992060),$e=Ze($e,le,ge,ue,ve[Me+4],11,1272893353),ue=Ze(ue,$e,le,ge,ve[Me+7],16,-155497632),ge=Ze(ge,ue,$e,le,ve[Me+10],23,-1094730640),le=Ze(le,ge,ue,$e,ve[Me+13],4,681279174),$e=Ze($e,le,ge,ue,ve[Me+0],11,-358537222),ue=Ze(ue,$e,le,ge,ve[Me+3],16,-722521979),ge=Ze(ge,ue,$e,le,ve[Me+6],23,76029189),le=Ze(le,ge,ue,$e,ve[Me+9],4,-640364487),$e=Ze($e,le,ge,ue,ve[Me+12],11,-421815835),ue=Ze(ue,$e,le,ge,ve[Me+15],16,530742520),le=Qe(le,ge=Ze(ge,ue,$e,le,ve[Me+2],23,-995338651),ue,$e,ve[Me+0],6,-198630844),$e=Qe($e,le,ge,ue,ve[Me+7],10,1126891415),ue=Qe(ue,$e,le,ge,ve[Me+14],15,-1416354905),ge=Qe(ge,ue,$e,le,ve[Me+5],21,-57434055),le=Qe(le,ge,ue,$e,ve[Me+12],6,1700485571),$e=Qe($e,le,ge,ue,ve[Me+3],10,-1894986606),ue=Qe(ue,$e,le,ge,ve[Me+10],15,-1051523),ge=Qe(ge,ue,$e,le,ve[Me+1],21,-2054922799),le=Qe(le,ge,ue,$e,ve[Me+8],6,1873313359),$e=Qe($e,le,ge,ue,ve[Me+15],10,-30611744),ue=Qe(ue,$e,le,ge,ve[Me+6],15,-1560198380),ge=Qe(ge,ue,$e,le,ve[Me+13],21,1309151649),le=Qe(le,ge,ue,$e,ve[Me+4],6,-145523070),$e=Qe($e,le,ge,ue,ve[Me+11],10,-1120210379),ue=Qe(ue,$e,le,ge,ve[Me+2],15,718787259),ge=Qe(ge,ue,$e,le,ve[Me+9],21,-343485551),le=Jn(le,Xr),ge=Jn(ge,Zn),ue=Jn(ue,Jr),$e=Jn($e,Qn)}return Array(le,ge,ue,$e)}function ke(ve,Re,le,ge,ue,$e){return Jn((Re=Jn(Jn(Re,ve),Jn(ge,$e)))<<ue|Re>>>32-ue,le)}function Ve(ve,Re,le,ge,ue,$e,Me){return ke(Re&le|~Re&ge,ve,Re,ue,$e,Me)}function Vn(ve,Re,le,ge,ue,$e,Me){return ke(Re&ge|le&~ge,ve,Re,ue,$e,Me)}function Ze(ve,Re,le,ge,ue,$e,Me){return ke(Re^le^ge,ve,Re,ue,$e,Me)}function Qe(ve,Re,le,ge,ue,$e,Me){return ke(le^(Re|~ge),ve,Re,ue,$e,Me)}function Jn(ve,Re){var le=(65535&ve)+(65535&Re);return(ve>>16)+(Re>>16)+(le>>16)<<16|65535&le}r.exports=function(ve){return we.hash(ve,Te,16)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){r.exports=function(we){for(var Te,ke=new Array(we),Ve=0;Ve<we;Ve++)!(3&Ve)&&(Te=4294967296*Math.random()),ke[Ve]=Te>>>((3&Ve)<<3)&255;return ke}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){var we=t("./helpers");function Te(Vn,Ze){Vn[Ze>>5]|=128<<24-Ze%32,Vn[15+(Ze+64>>9<<4)]=Ze;for(var Qe,Jn,ve,Re=Array(80),le=1732584193,ge=-271733879,ue=-1732584194,$e=271733878,Me=-1009589776,Xr=0;Xr<Vn.length;Xr+=16){for(var Zn=le,Jr=ge,Qn=ue,Qr=$e,Zr=Me,ni=0;ni<80;ni++){Re[ni]=ni<16?Vn[Xr+ni]:Ve(Re[ni-3]^Re[ni-8]^Re[ni-14]^Re[ni-16],1);var ti=ke(ke(Ve(le,5),(ti=ge,Jn=ue,ve=$e,(Qe=ni)<20?ti&Jn|~ti&ve:!(Qe<40)&&Qe<60?ti&Jn|ti&ve|Jn&ve:ti^Jn^ve)),ke(ke(Me,Re[ni]),(Qe=ni)<20?1518500249:Qe<40?1859775393:Qe<60?-1894007588:-899497514)),Me=$e,$e=ue,ue=Ve(ge,30),ge=le,le=ti}le=ke(le,Zn),ge=ke(ge,Jr),ue=ke(ue,Qn),$e=ke($e,Qr),Me=ke(Me,Zr)}return Array(le,ge,ue,$e,Me)}function ke(Vn,Ze){var Qe=(65535&Vn)+(65535&Ze);return(Vn>>16)+(Ze>>16)+(Qe>>16)<<16|65535&Qe}function Ve(Vn,Ze){return Vn<<Ze|Vn>>>32-Ze}r.exports=function(Vn){return we.hash(Vn,Te,20,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){function we(Ze,Qe){var Jn=(65535&Ze)+(65535&Qe);return(Ze>>16)+(Qe>>16)+(Jn>>16)<<16|65535&Jn}function Te(Ze,Qe){var Jn,ve=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),Re=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),le=new Array(64);Ze[Qe>>5]|=128<<24-Qe%32,Ze[15+(Qe+64>>9<<4)]=Qe;for(var ge,ue,$e=0;$e<Ze.length;$e+=16){for(var Me=Re[0],Xr=Re[1],Zn=Re[2],Jr=Re[3],Qn=Re[4],Qr=Re[5],Zr=Re[6],ni=Re[7],ti=0;ti<64;ti++)le[ti]=ti<16?Ze[ti+$e]:we(we(we((ue=le[ti-2],Ve(ue,17)^Ve(ue,19)^Vn(ue,10)),le[ti-7]),(ue=le[ti-15],Ve(ue,7)^Ve(ue,18)^Vn(ue,3))),le[ti-16]),Jn=we(we(we(we(ni,Ve(ue=Qn,6)^Ve(ue,11)^Ve(ue,25)),Qn&Qr^~Qn&Zr),ve[ti]),le[ti]),ge=we(Ve(ge=Me,2)^Ve(ge,13)^Ve(ge,22),Me&Xr^Me&Zn^Xr&Zn),ni=Zr,Zr=Qr,Qr=Qn,Qn=we(Jr,Jn),Jr=Zn,Zn=Xr,Xr=Me,Me=we(Jn,ge);Re[0]=we(Me,Re[0]),Re[1]=we(Xr,Re[1]),Re[2]=we(Zn,Re[2]),Re[3]=we(Jr,Re[3]),Re[4]=we(Qn,Re[4]),Re[5]=we(Qr,Re[5]),Re[6]=we(Zr,Re[6]),Re[7]=we(ni,Re[7])}return Re}var ke=t("./helpers"),Ve=function(Ze,Qe){return Ze>>>Qe|Ze<<32-Qe},Vn=function(Ze,Qe){return Ze>>>Qe};r.exports=function(Ze){return ke.hash(Ze,Te,32,!0)}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){y.read=function(we,Te,ke,Ve,$e){var Ze,Qe,Jn=8*$e-Ve-1,ve=(1<<Jn)-1,Re=ve>>1,le=-7,ge=ke?$e-1:0,ue=ke?-1:1,$e=we[Te+ge];for(ge+=ue,Ze=$e&(1<<-le)-1,$e>>=-le,le+=Jn;0<le;Ze=256*Ze+we[Te+ge],ge+=ue,le-=8);for(Qe=Ze&(1<<-le)-1,Ze>>=-le,le+=Ve;0<le;Qe=256*Qe+we[Te+ge],ge+=ue,le-=8);if(Ze===0)Ze=1-Re;else{if(Ze===ve)return Qe?NaN:1/0*($e?-1:1);Qe+=Math.pow(2,Ve),Ze-=Re}return($e?-1:1)*Qe*Math.pow(2,Ze-Ve)},y.write=function(we,Te,ke,Ve,Vn,Me){var Qe,Jn,ve=8*Me-Vn-1,Re=(1<<ve)-1,le=Re>>1,ge=Vn===23?Math.pow(2,-24)-Math.pow(2,-77):0,ue=Ve?0:Me-1,$e=Ve?1:-1,Me=Te<0||Te===0&&1/Te<0?1:0;for(Te=Math.abs(Te),isNaN(Te)||Te===1/0?(Jn=isNaN(Te)?1:0,Qe=Re):(Qe=Math.floor(Math.log(Te)/Math.LN2),Te*(Ve=Math.pow(2,-Qe))<1&&(Qe--,Ve*=2),2<=(Te+=1<=Qe+le?ge/Ve:ge*Math.pow(2,1-le))*Ve&&(Qe++,Ve/=2),Re<=Qe+le?(Jn=0,Qe=Re):1<=Qe+le?(Jn=(Te*Ve-1)*Math.pow(2,Vn),Qe+=le):(Jn=Te*Math.pow(2,le-1)*Math.pow(2,Vn),Qe=0));8<=Vn;we[ke+ue]=255&Jn,ue+=$e,Jn/=256,Vn-=8);for(Qe=Qe<<Vn|Jn,ve+=Vn;0<ve;we[ke+ue]=255&Qe,ue+=$e,Qe/=256,ve-=8);we[ke+ue-$e]|=128*Me}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/ieee754/index.js","/node_modules/gulp-browserify/node_modules/ieee754")},{buffer:3,lYpoI2:11}],11:[function(t,r,y){(function(j,re,ne,se,de,be,Ce,Ie,Oe){var we,Te,ke;function Ve(){}(j=r.exports={}).nextTick=(Te=typeof window<"u"&&window.setImmediate,ke=typeof window<"u"&&window.postMessage&&window.addEventListener,Te?function(Vn){return window.setImmediate(Vn)}:ke?(we=[],window.addEventListener("message",function(Vn){var Ze=Vn.source;Ze!==window&&Ze!==null||Vn.data!=="process-tick"||(Vn.stopPropagation(),0<we.length&&we.shift()())},!0),function(Vn){we.push(Vn),window.postMessage("process-tick","*")}):function(Vn){setTimeout(Vn,0)}),j.title="browser",j.browser=!0,j.env={},j.argv=[],j.on=Ve,j.addListener=Ve,j.once=Ve,j.off=Ve,j.removeListener=Ve,j.removeAllListeners=Ve,j.emit=Ve,j.binding=function(Vn){throw new Error("process.binding is not supported")},j.cwd=function(){return"/"},j.chdir=function(Vn){throw new Error("process.chdir is not supported")}}).call(this,t("lYpoI2"),typeof self<"u"?self:typeof window<"u"?window:{},t("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/process/browser.js","/node_modules/gulp-browserify/node_modules/process")},{buffer:3,lYpoI2:11}]},{},[1])(1)})}(bt$1)),bt$1.exports}var Pn$1=Yn();const Hn=st$1(Pn$1);function q(n){return e=>!n(e)}function c(n){return n==null}function x(n){return Array.isArray(n)}function H(...n){return l(J,n)}var J=(n,e)=>e.every(t=>t(n));function B$1(...n){return l(Q,n)}var Q=(n,e)=>e.some(t=>t(n));exports.a7=void 0,(n=>{n.isDeploymentNode=e=>"kind"in e&&!("element"in e),n.isInstance=e=>"element"in e&&!("kind"in e)})(exports.a7||(exports.a7={}));function U(n,e){return e?e+"."+n:n}var a;(n=>{n.Group="@group"})(a||(a={}));const Z$1="primary",F="rectangle";function g(n){return"element"in n}function R(n){return"expanded"in n}function E(n){return"custom"in n&&(o(n.custom.expr)||d(n.custom.expr))}function p(n){return"wildcard"in n}function _(n){return"elementKind"in n&&"isEqual"in n}function D(n){return"elementTag"in n&&"isEqual"in n}function o(n){return g(n)||p(n)||_(n)||D(n)||R(n)}function d(n){return"where"in n&&o(n.where.expr)}function C(n){return o(n)||d(n)||E(n)}function h(n){return"source"in n&&"target"in n}function w(n){return"inout"in n}function A(n){return"incoming"in n}function I(n){return"outgoing"in n}function m(n){return h(n)||w(n)||A(n)||I(n)}function O(n){return"where"in n&&m(n.where.expr)}function k(n){return"customRelation"in n}function K$1(n){return m(n)||O(n)||k(n)}exports.a8=void 0,(n=>{n.isInsideInstanceRef=e=>"deployment"in e&&"element"in e,n.isDeploymentElementRef=e=>"deployment"in e&&!("element"in e),n.isDeploymentRef=e=>!(0,n.isModelRef)(e),n.isModelRef=e=>"model"in e,n.toDeploymentRef=e=>(u((0,n.isDeploymentRef)(e),"Expected DeploymentRef"),(0,n.isInsideInstanceRef)(e)?{id:e.deployment,element:e.element}:{id:e.deployment})})(exports.a8||(exports.a8={})),exports.ab=void 0,(n=>{n.isWildcard=e=>"wildcard"in e&&e.wildcard===!0,n.isModelRef=e=>"ref"in e&&exports.a8.isModelRef(e.ref),n.isDeploymentRef=e=>"ref"in e&&exports.a8.isDeploymentRef(e.ref)})(exports.ab||(exports.ab={}));var s;(n=>{n.isDirect=e=>"source"in e&&"target"in e,n.isIncoming=e=>"incoming"in e,n.isOutgoing=e=>"outgoing"in e,n.isInOut=e=>"inout"in e,n.isWhere=e=>"where"in e})(s||(s={}));var S;(n=>{n.isFqnExpr=e=>exports.ab.isWildcard(e)||exports.ab.isModelRef(e)||exports.ab.isDeploymentRef(e),n.isRelation=e=>s.isDirect(e)||s.isIncoming(e)||s.isOutgoing(e)||s.isInOut(e)})(S||(S={}));const M=n=>"tag"in n,$=n=>"kind"in n,b=n=>"not"in n,N=n=>"and"in n,L=n=>"or"in n;function f(n){switch(!0){case M(n):{if("eq"in n.tag){const t=n.tag.eq;return r=>Array.isArray(r.tags)&&r.tags.includes(t)}const e=n.tag.neq;return t=>!Array.isArray(t.tags)||!t.tags.includes(e)}case $(n):{if("eq"in n.kind){const t=n.kind.eq;return r=>r.kind===t}const e=n.kind.neq;return t=>c(t.kind)||t.kind!==e}case b(n):{const e=f(n.not);return q(e)}case N(n):{const e=n.and.map(f);return H(e)}case L(n):{const e=n.or.map(f);return B$1(e)}default:a$1(n)}}const en="dashed",tn="normal",rn="gray";function sn(n){return"include"in n&&Array.isArray(n.include)||"exclude"in n&&Array.isArray(n.exclude)}function un(n){return"predicateId"in n}function an(n){return"style"in n&&"targets"in n&&Array.isArray(n.targets)}function on(n){return"styleId"in n}function ln$1(n){return n==="TB"||n==="BT"||n==="LR"||n==="RL"}function cn(n){return"direction"in n}function dn$1(n){return"title"in n&&"groupRules"in n&&Array.isArray(n.groupRules)}function mn$1(n){return"__parallel"in n&&x(n.__parallel)}function fn$1(n){return n.__==="deployment"}function yn$1(n){return n.__==="dynamic"}function V(n){return c(n.__)||n.__==="element"}function gn$1(n){return V(n)&&"extends"in n}function Rn$1(n){return V(n)&&"viewOf"in n}function En$1(n,e){const t=`step-${String(n).padStart(2,"0")}`;return e?`${t}.${e}`:t}function G(n){return n.startsWith("step-")}function pn$1(n){if(!G(n))throw new Error(`Invalid step edge id: ${n}`);return parseFloat(n.slice(5))}exports.i=void 0,(n=>{function e(y){return y.modelRef===1?y.id:y.modelRef??null}n.modelRef=e;function t(y){return y.deploymentRef===1?y.id:y.deploymentRef??null}n.deploymentRef=t;function r(y){return y.kind===a.Group}n.isNodesGroup=r})(exports.i||(exports.i={})),exports.k=void 0,(n=>{function e(y){return y.__==="deployment"}n.isDeployment=e;function t(y){return y.__==="dynamic"}n.isDynamic=t;function r(y){return c(y.__)||y.__==="element"}n.isElement=r})(exports.k||(exports.k={})),exports.l=void 0,(n=>{function e(y){return y.modelRef===1?y.id:y.modelRef??null}n.modelRef=e;function t(y){return y.deploymentRef===1?y.id:y.deploymentRef??null}n.deploymentRef=t;function r(y){return y.kind===a.Group}n.isNodesGroup=r})(exports.l||(exports.l={}));function Ye(...n){return l(Object.values,n)}function Pt(...n){return n.length===2?(e,...t)=>Ki(e,...n,...t):Ki(...n)}var Ki=(n,e,t,...r)=>e(n,...r)?typeof t=="function"?t(n,...r):t.onTrue(n,...r):typeof t=="function"?n:t.onFalse(n,...r);function Uo(n,e){let t=e.length-n.length;if(t===1){let[r,...y]=e;return xt$1(r,{lazy:n,lazyArgs:y})}if(t===0){let r={lazy:n,lazyArgs:e};return Object.assign(y=>xt$1(y,r),r)}throw new Error("Wrong number of arguments")}function ze(...n){return Uo(Fo,n)}function Fo(){let n=new Set;return e=>n.has(e)?Bt$1:(n.add(e),{done:!1,hasNext:!0,next:e})}function Yi(...n){return l(qo,n,Bo)}var qo=(n,e)=>e<0?[]:n.slice(0,e);function Bo(n){if(n<=0)return Kt;let e=n;return t=>(e-=1,{done:e<=0,hasNext:!0,next:t})}var Hi={asc:(n,e)=>n>e,desc:(n,e)=>n<e};function Vo(n,e){let[t,...r]=e;if(!Ko(t)){let j=dn(...r);return n(t,j)}let y=dn(t,...r);return j=>n(j,y)}function dn(n,e,...t){let r=typeof n=="function"?n:n[0],y=typeof n=="function"?"asc":n[1],{[y]:j}=Hi,re=e===void 0?void 0:dn(e,...t);return(ne,se)=>{let de=r(ne),be=r(se);return j(de,be)?1:j(be,de)?-1:re?.(ne,se)??0}}function Ko(n){if(Xi(n))return!0;if(typeof n!="object"||!Array.isArray(n))return!1;let[e,t,...r]=n;return Xi(e)&&typeof t=="string"&&t in Hi&&r.length===0}var Xi=n=>typeof n=="function"&&n.length===1;function ln(...n){return l(Yo,n)}function Yo(n,e){let t=[...n];return t.sort(e),t}function Ho(...n){return Vo(Xo,n)}var Xo=(n,e)=>[...n].sort(e);function wt(...n){return l(Jo,n)}var Jo=(n,e,t)=>n.reduce(e,t);function Ji(...n){return l(Qo,n)}function Qo(n){return[...n].reverse()}function vt(...n){return l(Zo,n)}function Zo(n,e){let t={};for(let r of e)r in n&&(t[r]=n[r]);return t}function hn(...n){return l(es,n)}function es(n,e){let t={};for(let[r,y]of Object.entries(n))e(y,r,n)&&(t[r]=y);return t}function bt(...n){return e=>xt$1(e,...n)}function Se(...n){return l(ts,n)}var ts=(n,e)=>n[e];function Qi(...n){return l(ns,n)}function ns(n,e){let t={...n};for(let[r,y]of Object.entries(t))e(y,r,n)&&delete t[r];return t}function K(...n){return l(is,n)}var is=n=>n.length===1?n[0]:void 0;function Wt(...n){return l(rs,n)}var rs=(n,e)=>{let t=[[],[]];for(let[r,y]of n.entries())e(y,r,n)?t[0].push(y):t[1].push(y);return t};function os(...n){return l(ss,n)}var ss=n=>n.at(-1);function fn(...n){return l(as,n)}function as(n,e){let t={};for(let[r,y]of n.entries()){let[j,re]=e(y,r,n);t[j]=re}return t}function it(...n){return l(cs,n)}function cs(n,e){let t={};for(let[r,y]of Object.entries(n)){let j=e(y,r,n);t[r]=j}return t}function X(n){return!!n}function us(n){return typeof n=="number"&&!Number.isNaN(n)}function ds(n){return typeof n=="boolean"}function Pe(n){return n===void 0?!0:typeof n=="string"||Array.isArray(n)?n.length===0:Object.keys(n).length===0}function ls(...n){return l(Et,n)}function Et(n,e){if(n===e||Object.is(n,e))return!0;if(typeof n!="object"||typeof e!="object"||n===null||e===null||Object.getPrototypeOf(n)!==Object.getPrototypeOf(e))return!1;if(Array.isArray(n))return hs(n,e);if(n instanceof Map)return fs(n,e);if(n instanceof Set)return ps(n,e);if(n instanceof Date)return n.getTime()===e.getTime();if(n instanceof RegExp)return n.toString()===e.toString();if(Object.keys(n).length!==Object.keys(e).length)return!1;for(let[t,r]of Object.entries(n))if(!(t in e)||!Et(r,e[t]))return!1;return!0}function hs(n,e){if(n.length!==e.length)return!1;for(let[t,r]of n.entries())if(!Et(r,e[t]))return!1;return!0}function fs(n,e){if(n.size!==e.size)return!1;for(let[t,r]of n.entries())if(!e.has(t)||!Et(r,e.get(t)))return!1;return!0}function ps(n,e){if(n.size!==e.size)return!1;let t=[...e];for(let r of n){let y=!1;for(let[j,re]of t.entries())if(Et(r,re)){y=!0,t.splice(j,1);break}if(!y)return!1}return!0}function xe(...n){return l(gs,n,ms)}var gs=(n,e)=>n.flatMap(e),ms=n=>(e,t,r)=>{let y=n(e,t,r);return Array.isArray(y)?{done:!1,hasNext:!0,hasMany:!0,next:y}:{done:!1,hasNext:!0,next:y}};function he(...n){return l(ys,n,ws)}function ys(n,e){return n.forEach(e),n}var ws=n=>(e,t,r)=>(n(e,t,r),{done:!1,hasNext:!0,next:e});function jt(...n){return l(vs,n)}var vs=(n,e)=>{let t={};for(let[r,y]of n.entries()){let j=e(y,r,n);if(j!==void 0){let{[j]:re}=t;re===void 0&&(re=[],t[j]=re),re.push(y)}}return t};function B(...n){return l(bs,n,Es)}var bs=(n,e)=>n.filter(e),Es=n=>(e,t,r)=>n(e,t,r)?{done:!1,hasNext:!0,next:e}:Bt$1;function pn(...n){return l(ks,n)}var ks=(n,e)=>{for(let t=n.length-1;t>=0;t--){let r=n[t];if(e(r,t,n))return r}};function gn(...n){return l(Ss,n)}function Ss(n,e){for(let[t,r]of n.entries())if(!e(r,t,n))return n.slice(t);return[]}function mn(...n){return l(Object.entries,n)}function Zi(...n){return l(xs,n)}var xs=(n,e)=>[...n,...e];function Ut(n){return()=>n}class yn{constructor(e,t){this.$model=e,this.$element=t,this.id=this.$element.id,this.hierarchyLevel=lt$1(this.id)}id;hierarchyLevel;get parent(){return this.$model.parent(this)}get kind(){return this.$element.kind}get shape(){return this.$element.shape??F}get color(){return this.$element.color??Z$1}get tags(){return this.$element.tags??[]}get title(){return this.$element.title}get description(){return this.$element.description}get technology(){return this.$element.technology}get links(){return this.$element.links??[]}get defaultView(){return this.scopedViews().next().value??null}isAncestorOf(e){return ft(this,e)}isDescendantOf(e){return ft(e,this)}ancestors(){return this.$model.ancestors(this)}commonAncestor(e){const t=qt$1(this.id,e.id);return t?this.$model.element(t):null}children(){return this.$model.children(this)}descendants(e){return e?Ot([...this.$model.descendants(this)],e)[Symbol.iterator]():this.$model.descendants(this)}siblings(){return this.$model.siblings(this)}*ascendingSiblings(){yield*this.siblings();for(const e of this.ancestors())yield*e.siblings()}*descendingSiblings(){for(const e of[...this.ancestors()].reverse())yield*e.siblings();yield*this.siblings()}incoming(e="all"){return this.$model.incoming(this,e)}*incomers(e="all"){const t=new Set;for(const r of this.incoming(e))t.has(r.source.id)||(t.add(r.source.id),yield r.source)}outgoing(e="all"){return this.$model.outgoing(this,e)}*outgoers(e="all"){const t=new Set;for(const r of this.outgoing(e))t.has(r.target.id)||(t.add(r.target.id),yield r.target)}cachedOutgoing=null;cachedIncoming=null;get allOutgoing(){return this.cachedOutgoing??=new Set(this.outgoing()),this.cachedOutgoing}get allIncoming(){return this.cachedIncoming??=new Set(this.incoming()),this.cachedIncoming}*views(){for(const e of this.$model.views())e.includesElement(this.id)&&(yield e)}*scopedViews(){for(const e of this.$model.views())e.isElementView()&&e.$view.viewOf===this.id&&(yield e)}isDeployed(){return X(this.deployments().next().value)}deployments(){return this.$model.deployment.instancesOf(this)}}function wn(n){return xt$1(n,jt(Se("notation")),it(bt(jt(Se("shape")),it(bt(jt(Se("color")),it(bt(jt$1(Se("kind")),ze())),mn(),jt$1(([e,t])=>({kinds:t,color:e})))),mn(),xe(([e,t])=>t.map(({color:r,kinds:y})=>({shape:e,color:r,kinds:y}))))),mn(),xe(([e,t])=>t.map(({shape:r,color:y,kinds:j})=>({title:e,shape:r,color:y,kinds:j}))),Ho(Se("shape"),Se("title"),[e=>e.kinds.length,"desc"]))}function vn(n,e){const t=[];let r=n.parent;for(;r;){const y=i(e.get(r),`Parent node ${r} not found`);t.push(y),r=y.parent}return t}function er(n,e){for(const t of e){const r=n.get(t.source),y=n.get(t.target);u(r,`Source node ${t.source} not found`),u(y,`Target node ${t.target} not found`),r.outEdges.push(t.id),y.inEdges.push(t.id);const j=vn(r,n),re=vn(y,n),ne=j.length>0&&re.length>0?os(cn$1(Ji(j),Ji(re))):null;t.parent=ne?ne.id:null;for(const se of j){if(se===ne)break;se.outEdges.push(t.id)}for(const se of re){if(se===ne)break;se.inEdges.push(t.id)}}}var Ft={exports:{}},_s=Ft.exports,tr;function $s(){return tr||(tr=1,function(n,e){(function(t,r){n.exports=r()})(_s,function(){function t(T){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(te){return typeof te}:function(te){return te&&typeof Symbol=="function"&&te.constructor===Symbol&&te!==Symbol.prototype?"symbol":typeof te},t(T)}function r(T,te){T.prototype=Object.create(te.prototype),T.prototype.constructor=T,j(T,te)}function y(T){return y=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(te){return te.__proto__||Object.getPrototypeOf(te)},y(T)}function j(T,te){return j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(W,v){return W.__proto__=v,W},j(T,te)}function re(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ne(T,te,W){return ne=re()?Reflect.construct.bind():function(v,z,P){var ie=[null];ie.push.apply(ie,z);var ce=new(Function.bind.apply(v,ie));return P&&j(ce,P.prototype),ce},ne.apply(null,arguments)}function se(T){var te=typeof Map=="function"?new Map:void 0;return se=function(W){if(W===null||(v=W,Function.toString.call(v).indexOf("[native code]")===-1))return W;var v;if(typeof W!="function")throw new TypeError("Super expression must either be null or a function");if(te!==void 0){if(te.has(W))return te.get(W);te.set(W,z)}function z(){return ne(W,arguments,y(this).constructor)}return z.prototype=Object.create(W.prototype,{constructor:{value:z,enumerable:!1,writable:!0,configurable:!0}}),j(z,W)},se(T)}function de(T){if(T===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return T}var be=function(){for(var T=arguments[0],te=1,W=arguments.length;te<W;te++)if(arguments[te])for(var v in arguments[te])T[v]=arguments[te][v];return T};function Ce(T,te,W,v){var z=T._nodes.get(te),P=null;return z?P=v==="mixed"?z.out&&z.out[W]||z.undirected&&z.undirected[W]:v==="directed"?z.out&&z.out[W]:z.undirected&&z.undirected[W]:P}function Ie(T){return t(T)==="object"&&T!==null}function Oe(T){var te;for(te in T)return!1;return!0}function we(T,te,W){Object.defineProperty(T,te,{enumerable:!1,configurable:!1,writable:!0,value:W})}function Te(T,te,W){var v={enumerable:!0,configurable:!0};typeof W=="function"?v.get=W:(v.value=W,v.writable=!1),Object.defineProperty(T,te,v)}function ke(T){return!!Ie(T)&&!(T.attributes&&!Array.isArray(T.attributes))}typeof Object.assign=="function"&&(be=Object.assign);var Ve,Vn={exports:{}},Ze=typeof Reflect=="object"?Reflect:null,Qe=Ze&&typeof Ze.apply=="function"?Ze.apply:function(T,te,W){return Function.prototype.apply.call(T,te,W)};Ve=Ze&&typeof Ze.ownKeys=="function"?Ze.ownKeys:Object.getOwnPropertySymbols?function(T){return Object.getOwnPropertyNames(T).concat(Object.getOwnPropertySymbols(T))}:function(T){return Object.getOwnPropertyNames(T)};var Jn=Number.isNaN||function(T){return T!=T};function ve(){ve.init.call(this)}Vn.exports=ve,Vn.exports.once=function(T,te){return new Promise(function(W,v){function z(ie){T.removeListener(te,P),v(ie)}function P(){typeof T.removeListener=="function"&&T.removeListener("error",z),W([].slice.call(arguments))}Qn(T,te,P,{once:!0}),te!=="error"&&function(ie,ce,_e){typeof ie.on=="function"&&Qn(ie,"error",ce,_e)}(T,z,{once:!0})})},ve.EventEmitter=ve,ve.prototype._events=void 0,ve.prototype._eventsCount=0,ve.prototype._maxListeners=void 0;var Re=10;function le(T){if(typeof T!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof T)}function ge(T){return T._maxListeners===void 0?ve.defaultMaxListeners:T._maxListeners}function ue(T,te,W,v){var z,P,ie,ce;if(le(W),(P=T._events)===void 0?(P=T._events=Object.create(null),T._eventsCount=0):(P.newListener!==void 0&&(T.emit("newListener",te,W.listener?W.listener:W),P=T._events),ie=P[te]),ie===void 0)ie=P[te]=W,++T._eventsCount;else if(typeof ie=="function"?ie=P[te]=v?[W,ie]:[ie,W]:v?ie.unshift(W):ie.push(W),(z=ge(T))>0&&ie.length>z&&!ie.warned){ie.warned=!0;var _e=new Error("Possible EventEmitter memory leak detected. "+ie.length+" "+String(te)+" listeners added. Use emitter.setMaxListeners() to increase limit");_e.name="MaxListenersExceededWarning",_e.emitter=T,_e.type=te,_e.count=ie.length,ce=_e,console&&console.warn&&console.warn(ce)}return T}function $e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Me(T,te,W){var v={fired:!1,wrapFn:void 0,target:T,type:te,listener:W},z=$e.bind(v);return z.listener=W,v.wrapFn=z,z}function Xr(T,te,W){var v=T._events;if(v===void 0)return[];var z=v[te];return z===void 0?[]:typeof z=="function"?W?[z.listener||z]:[z]:W?function(P){for(var ie=new Array(P.length),ce=0;ce<ie.length;++ce)ie[ce]=P[ce].listener||P[ce];return ie}(z):Jr(z,z.length)}function Zn(T){var te=this._events;if(te!==void 0){var W=te[T];if(typeof W=="function")return 1;if(W!==void 0)return W.length}return 0}function Jr(T,te){for(var W=new Array(te),v=0;v<te;++v)W[v]=T[v];return W}function Qn(T,te,W,v){if(typeof T.on=="function")v.once?T.once(te,W):T.on(te,W);else{if(typeof T.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof T);T.addEventListener(te,function z(P){v.once&&T.removeEventListener(te,z),W(P)})}}function Qr(T){if(typeof T!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=T}Object.defineProperty(ve,"defaultMaxListeners",{enumerable:!0,get:function(){return Re},set:function(T){if(typeof T!="number"||T<0||Jn(T))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+T+".");Re=T}}),ve.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(T){if(typeof T!="number"||T<0||Jn(T))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+T+".");return this._maxListeners=T,this},ve.prototype.getMaxListeners=function(){return ge(this)},ve.prototype.emit=function(T){for(var te=[],W=1;W<arguments.length;W++)te.push(arguments[W]);var v=T==="error",z=this._events;if(z!==void 0)v=v&&z.error===void 0;else if(!v)return!1;if(v){var P;if(te.length>0&&(P=te[0]),P instanceof Error)throw P;var ie=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw ie.context=P,ie}var ce=z[T];if(ce===void 0)return!1;if(typeof ce=="function")Qe(ce,this,te);else{var _e=ce.length,Fe=Jr(ce,_e);for(W=0;W<_e;++W)Qe(Fe[W],this,te)}return!0},ve.prototype.addListener=function(T,te){return ue(this,T,te,!1)},ve.prototype.on=ve.prototype.addListener,ve.prototype.prependListener=function(T,te){return ue(this,T,te,!0)},ve.prototype.once=function(T,te){return le(te),this.on(T,Me(this,T,te)),this},ve.prototype.prependOnceListener=function(T,te){return le(te),this.prependListener(T,Me(this,T,te)),this},ve.prototype.removeListener=function(T,te){var W,v,z,P,ie;if(le(te),(v=this._events)===void 0)return this;if((W=v[T])===void 0)return this;if(W===te||W.listener===te)--this._eventsCount==0?this._events=Object.create(null):(delete v[T],v.removeListener&&this.emit("removeListener",T,W.listener||te));else if(typeof W!="function"){for(z=-1,P=W.length-1;P>=0;P--)if(W[P]===te||W[P].listener===te){ie=W[P].listener,z=P;break}if(z<0)return this;z===0?W.shift():function(ce,_e){for(;_e+1<ce.length;_e++)ce[_e]=ce[_e+1];ce.pop()}(W,z),W.length===1&&(v[T]=W[0]),v.removeListener!==void 0&&this.emit("removeListener",T,ie||te)}return this},ve.prototype.off=ve.prototype.removeListener,ve.prototype.removeAllListeners=function(T){var te,W,v;if((W=this._events)===void 0)return this;if(W.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):W[T]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete W[T]),this;if(arguments.length===0){var z,P=Object.keys(W);for(v=0;v<P.length;++v)(z=P[v])!=="removeListener"&&this.removeAllListeners(z);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(te=W[T])=="function")this.removeListener(T,te);else if(te!==void 0)for(v=te.length-1;v>=0;v--)this.removeListener(T,te[v]);return this},ve.prototype.listeners=function(T){return Xr(this,T,!0)},ve.prototype.rawListeners=function(T){return Xr(this,T,!1)},ve.listenerCount=function(T,te){return typeof T.listenerCount=="function"?T.listenerCount(te):Zn.call(T,te)},ve.prototype.listenerCount=Zn,ve.prototype.eventNames=function(){return this._eventsCount>0?Ve(this._events):[]},typeof Symbol<"u"&&(Qr.prototype[Symbol.iterator]=function(){return this}),Qr.of=function(){var T=arguments,te=T.length,W=0;return new Qr(function(){return W>=te?{done:!0}:{done:!1,value:T[W++]}})},Qr.empty=function(){return new Qr(function(){return{done:!0}})},Qr.fromSequence=function(T){var te=0,W=T.length;return new Qr(function(){return te>=W?{done:!0}:{done:!1,value:T[te++]}})},Qr.is=function(T){return T instanceof Qr||typeof T=="object"&&T!==null&&typeof T.next=="function"};var Zr=Qr,ni={};ni.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",ni.SYMBOL_SUPPORT=typeof Symbol<"u";var ti=Zr,mi=ni,Ci=mi.ARRAY_BUFFER_SUPPORT,bi=mi.SYMBOL_SUPPORT,Ai=function(T){var te=function(W){return typeof W=="string"||Array.isArray(W)||Ci&&ArrayBuffer.isView(W)?ti.fromSequence(W):typeof W!="object"||W===null?null:bi&&typeof W[Symbol.iterator]=="function"?W[Symbol.iterator]():typeof W.next=="function"?W:null}(T);if(!te)throw new Error("obliterator: target is not iterable nor a valid iterator.");return te},Ii=Ai,xi=function(T,te){for(var W,v=arguments.length>1?te:1/0,z=v!==1/0?new Array(v):[],P=0,ie=Ii(T);;){if(P===v)return z;if((W=ie.next()).done)return P!==te&&(z.length=P),z;z[P++]=W.value}},Ei=function(T){function te(W){var v;return(v=T.call(this)||this).name="GraphError",v.message=W,v}return r(te,T),te}(se(Error)),Le=function(T){function te(W){var v;return(v=T.call(this,W)||this).name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(de(v),te.prototype.constructor),v}return r(te,T),te}(Ei),Y=function(T){function te(W){var v;return(v=T.call(this,W)||this).name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(de(v),te.prototype.constructor),v}return r(te,T),te}(Ei),ae=function(T){function te(W){var v;return(v=T.call(this,W)||this).name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(de(v),te.prototype.constructor),v}return r(te,T),te}(Ei);function Ee(T,te){this.key=T,this.attributes=te,this.clear()}function Ke(T,te){this.key=T,this.attributes=te,this.clear()}function qe(T,te){this.key=T,this.attributes=te,this.clear()}function Kn(T,te,W,v,z){this.key=te,this.attributes=z,this.undirected=T,this.source=W,this.target=v}Ee.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}},Ke.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}},qe.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}},Kn.prototype.attach=function(){var T="out",te="in";this.undirected&&(T=te="undirected");var W=this.source.key,v=this.target.key;this.source[T][v]=this,this.undirected&&W===v||(this.target[te][W]=this)},Kn.prototype.attachMulti=function(){var T="out",te="in",W=this.source.key,v=this.target.key;this.undirected&&(T=te="undirected");var z=this.source[T],P=z[v];if(P===void 0)return z[v]=this,void(this.undirected&&W===v||(this.target[te][W]=this));P.previous=this,this.next=P,z[v]=this,this.target[te][W]=this},Kn.prototype.detach=function(){var T=this.source.key,te=this.target.key,W="out",v="in";this.undirected&&(W=v="undirected"),delete this.source[W][te],delete this.target[v][T]},Kn.prototype.detachMulti=function(){var T=this.source.key,te=this.target.key,W="out",v="in";this.undirected&&(W=v="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[W][te],delete this.target[v][T]):(this.next.previous=void 0,this.source[W][te]=this.next,this.target[v][T]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};function Hr(T,te,W,v,z,P,ie){var ce,_e,Fe,Be;if(v=""+v,W===0){if(!(ce=T._nodes.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" node in the graph.'));Fe=z,Be=P}else if(W===3){if(z=""+z,!(_e=T._edges.get(z)))throw new Y("Graph.".concat(te,': could not find the "').concat(z,'" edge in the graph.'));var Ne=_e.source.key,et=_e.target.key;if(v===Ne)ce=_e.target;else{if(v!==et)throw new Y("Graph.".concat(te,': the "').concat(v,'" node is not attached to the "').concat(z,'" edge (').concat(Ne,", ").concat(et,")."));ce=_e.source}Fe=P,Be=ie}else{if(!(_e=T._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'));ce=W===1?_e.source:_e.target,Fe=z,Be=P}return[ce,Fe,Be]}var oi=[{name:function(T){return"get".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];return ce.attributes[_e]}}},{name:function(T){return"get".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z){return Hr(this,te,W,v,z)[0].attributes}}},{name:function(T){return"has".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];return ce.attributes.hasOwnProperty(_e)}}},{name:function(T){return"set".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P,ie){var ce=Hr(this,te,W,v,z,P,ie),_e=ce[0],Fe=ce[1],Be=ce[2];return _e.attributes[Fe]=Be,this.emit("nodeAttributesUpdated",{key:_e.key,type:"set",attributes:_e.attributes,name:Fe}),this}}},{name:function(T){return"update".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P,ie){var ce=Hr(this,te,W,v,z,P,ie),_e=ce[0],Fe=ce[1],Be=ce[2];if(typeof Be!="function")throw new Le("Graph.".concat(te,": updater should be a function."));var Ne=_e.attributes,et=Be(Ne[Fe]);return Ne[Fe]=et,this.emit("nodeAttributesUpdated",{key:_e.key,type:"set",attributes:_e.attributes,name:Fe}),this}}},{name:function(T){return"remove".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];return delete ce.attributes[_e],this.emit("nodeAttributesUpdated",{key:ce.key,type:"remove",attributes:ce.attributes,name:_e}),this}}},{name:function(T){return"replace".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];if(!Ie(_e))throw new Le("Graph.".concat(te,": provided attributes are not a plain object."));return ce.attributes=_e,this.emit("nodeAttributesUpdated",{key:ce.key,type:"replace",attributes:ce.attributes}),this}}},{name:function(T){return"merge".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];if(!Ie(_e))throw new Le("Graph.".concat(te,": provided attributes are not a plain object."));return be(ce.attributes,_e),this.emit("nodeAttributesUpdated",{key:ce.key,type:"merge",attributes:ce.attributes,data:_e}),this}}},{name:function(T){return"update".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie=Hr(this,te,W,v,z,P),ce=ie[0],_e=ie[1];if(typeof _e!="function")throw new Le("Graph.".concat(te,": provided updater is not a function."));return ce.attributes=_e(ce.attributes),this.emit("nodeAttributesUpdated",{key:ce.key,type:"update",attributes:ce.attributes}),this}}}],ui=[{name:function(T){return"get".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}return P.attributes[z]}}},{name:function(T){return"get".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v){var z;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>1){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var P=""+v,ie=""+arguments[1];if(!(z=Ce(this,P,ie,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(P,'" - "').concat(ie,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(z=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}return z.attributes}}},{name:function(T){return"has".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}return P.attributes.hasOwnProperty(z)}}},{name:function(T){return"set".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ce=""+v,_e=""+z;if(z=arguments[2],P=arguments[3],!(ie=Ce(this,ce,_e,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ce,'" - "').concat(_e,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(ie=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}return ie.attributes[z]=P,this.emit("edgeAttributesUpdated",{key:ie.key,type:"set",attributes:ie.attributes,name:z}),this}}},{name:function(T){return"update".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z,P){var ie;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>3){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ce=""+v,_e=""+z;if(z=arguments[2],P=arguments[3],!(ie=Ce(this,ce,_e,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ce,'" - "').concat(_e,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(ie=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}if(typeof P!="function")throw new Le("Graph.".concat(te,": updater should be a function."));return ie.attributes[z]=P(ie.attributes[z]),this.emit("edgeAttributesUpdated",{key:ie.key,type:"set",attributes:ie.attributes,name:z}),this}}},{name:function(T){return"remove".concat(T,"Attribute")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}return delete P.attributes[z],this.emit("edgeAttributesUpdated",{key:P.key,type:"remove",attributes:P.attributes,name:z}),this}}},{name:function(T){return"replace".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}if(!Ie(z))throw new Le("Graph.".concat(te,": provided attributes are not a plain object."));return P.attributes=z,this.emit("edgeAttributesUpdated",{key:P.key,type:"replace",attributes:P.attributes}),this}}},{name:function(T){return"merge".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}if(!Ie(z))throw new Le("Graph.".concat(te,": provided attributes are not a plain object."));return be(P.attributes,z),this.emit("edgeAttributesUpdated",{key:P.key,type:"merge",attributes:P.attributes,data:z}),this}}},{name:function(T){return"update".concat(T,"Attributes")},attacher:function(T,te,W){T.prototype[te]=function(v,z){var P;if(this.type!=="mixed"&&W!=="mixed"&&W!==this.type)throw new ae("Graph.".concat(te,": cannot find this type of edges in your ").concat(this.type," graph."));if(arguments.length>2){if(this.multi)throw new ae("Graph.".concat(te,": cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about."));var ie=""+v,ce=""+z;if(z=arguments[2],!(P=Ce(this,ie,ce,W)))throw new Y("Graph.".concat(te,': could not find an edge for the given path ("').concat(ie,'" - "').concat(ce,'").'))}else{if(W!=="mixed")throw new ae("Graph.".concat(te,": calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type."));if(v=""+v,!(P=this._edges.get(v)))throw new Y("Graph.".concat(te,': could not find the "').concat(v,'" edge in the graph.'))}if(typeof z!="function")throw new Le("Graph.".concat(te,": provided updater is not a function."));return P.attributes=z(P.attributes),this.emit("edgeAttributesUpdated",{key:P.key,type:"update",attributes:P.attributes}),this}}}],fi=Zr,hi=Ai,si=function(){var T=arguments,te=null,W=-1;return new fi(function(){for(var v=null;;){if(te===null){if(++W>=T.length)return{done:!0};te=hi(T[W])}if((v=te.next()).done!==!0)break;te=null}return v})},ci=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function ai(T,te,W,v){var z=!1;for(var P in te)if(P!==v){var ie=te[P];if(z=W(ie.key,ie.attributes,ie.source.key,ie.target.key,ie.source.attributes,ie.target.attributes,ie.undirected),T&&z)return ie.key}}function vi(T,te,W,v){var z,P,ie,ce=!1;for(var _e in te)if(_e!==v){z=te[_e];do{if(P=z.source,ie=z.target,ce=W(z.key,z.attributes,P.key,ie.key,P.attributes,ie.attributes,z.undirected),T&&ce)return z.key;z=z.next}while(z!==void 0)}}function ki(T,te){var W,v=Object.keys(T),z=v.length,P=0;return new Zr(function(){do if(W)W=W.next;else{if(P>=z)return{done:!0};var ie=v[P++];if(ie===te){W=void 0;continue}W=T[ie]}while(!W);return{done:!1,value:{edge:W.key,attributes:W.attributes,source:W.source.key,target:W.target.key,sourceAttributes:W.source.attributes,targetAttributes:W.target.attributes,undirected:W.undirected}}})}function oo(T,te,W,v){var z=te[W];if(z){var P=z.source,ie=z.target;return v(z.key,z.attributes,P.key,ie.key,P.attributes,ie.attributes,z.undirected)&&T?z.key:void 0}}function so(T,te,W,v){var z=te[W];if(z){var P=!1;do{if(P=v(z.key,z.attributes,z.source.key,z.target.key,z.source.attributes,z.target.attributes,z.undirected),T&&P)return z.key;z=z.next}while(z!==void 0)}}function Ri(T,te){var W=T[te];return W.next!==void 0?new Zr(function(){if(!W)return{done:!0};var v={edge:W.key,attributes:W.attributes,source:W.source.key,target:W.target.key,sourceAttributes:W.source.attributes,targetAttributes:W.target.attributes,undirected:W.undirected};return W=W.next,{done:!1,value:v}}):Zr.of({edge:W.key,attributes:W.attributes,source:W.source.key,target:W.target.key,sourceAttributes:W.source.attributes,targetAttributes:W.target.attributes,undirected:W.undirected})}function ao(T,te){if(T.size===0)return[];if(te==="mixed"||te===T.type)return typeof Array.from=="function"?Array.from(T._edges.keys()):xi(T._edges.keys(),T._edges.size);for(var W,v,z=te==="undirected"?T.undirectedSize:T.directedSize,P=new Array(z),ie=te==="undirected",ce=T._edges.values(),_e=0;(W=ce.next()).done!==!0;)(v=W.value).undirected===ie&&(P[_e++]=v.key);return P}function Ti(T,te,W,v){if(te.size!==0){for(var z,P,ie=W!=="mixed"&&W!==te.type,ce=W==="undirected",_e=!1,Fe=te._edges.values();(z=Fe.next()).done!==!0;)if(P=z.value,!ie||P.undirected===ce){var Be=P,Ne=Be.key,et=Be.attributes,Xn=Be.source,Yr=Be.target;if(_e=v(Ne,et,Xn.key,Yr.key,Xn.attributes,Yr.attributes,P.undirected),T&&_e)return Ne}}}function uo(T,te){if(T.size===0)return Zr.empty();var W=te!=="mixed"&&te!==T.type,v=te==="undirected",z=T._edges.values();return new Zr(function(){for(var P,ie;;){if((P=z.next()).done)return P;if(ie=P.value,!W||ie.undirected===v)break}return{value:{edge:ie.key,attributes:ie.attributes,source:ie.source.key,target:ie.target.key,sourceAttributes:ie.source.attributes,targetAttributes:ie.target.attributes,undirected:ie.undirected},done:!1}})}function ji(T,te,W,v,z,P){var ie,ce=te?vi:ai;if(W!=="undirected"&&(v!=="out"&&(ie=ce(T,z.in,P),T&&ie)||v!=="in"&&(ie=ce(T,z.out,P,v?void 0:z.key),T&&ie))||W!=="directed"&&(ie=ce(T,z.undirected,P),T&&ie))return ie}function co(T,te,W,v){var z=[];return ji(!1,T,te,W,v,function(P){z.push(P)}),z}function lo(T,te,W){var v=Zr.empty();return T!=="undirected"&&(te!=="out"&&W.in!==void 0&&(v=si(v,ki(W.in))),te!=="in"&&W.out!==void 0&&(v=si(v,ki(W.out,te?void 0:W.key)))),T!=="directed"&&W.undirected!==void 0&&(v=si(v,ki(W.undirected))),v}function Ui(T,te,W,v,z,P,ie){var ce,_e=W?so:oo;if(te!=="undirected"&&(z.in!==void 0&&v!=="out"&&(ce=_e(T,z.in,P,ie),T&&ce)||z.out!==void 0&&v!=="in"&&(v||z.key!==P)&&(ce=_e(T,z.out,P,ie),T&&ce))||te!=="directed"&&z.undirected!==void 0&&(ce=_e(T,z.undirected,P,ie),T&&ce))return ce}function ho(T,te,W,v,z){var P=[];return Ui(!1,T,te,W,v,z,function(ie){P.push(ie)}),P}function fo(T,te,W,v){var z=Zr.empty();return T!=="undirected"&&(W.in!==void 0&&te!=="out"&&v in W.in&&(z=si(z,Ri(W.in,v))),W.out!==void 0&&te!=="in"&&v in W.out&&(te||W.key!==v)&&(z=si(z,Ri(W.out,v)))),T!=="directed"&&W.undirected!==void 0&&v in W.undirected&&(z=si(z,Ri(W.undirected,v))),z}var po=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Di(){this.A=null,this.B=null}function $i(T,te,W,v,z){for(var P in v){var ie=v[P],ce=ie.source,_e=ie.target,Fe=ce===W?_e:ce;if(!te||!te.has(Fe.key)){var Be=z(Fe.key,Fe.attributes);if(T&&Be)return Fe.key}}}function Ni(T,te,W,v,z){if(te!=="mixed"){if(te==="undirected")return $i(T,null,v,v.undirected,z);if(typeof W=="string")return $i(T,null,v,v[W],z)}var P,ie=new Di;if(te!=="undirected"){if(W!=="out"){if(P=$i(T,null,v,v.in,z),T&&P)return P;ie.wrap(v.in)}if(W!=="in"){if(P=$i(T,ie,v,v.out,z),T&&P)return P;ie.wrap(v.out)}}if(te!=="directed"&&(P=$i(T,ie,v,v.undirected,z),T&&P))return P}function Gi(T,te,W){var v=Object.keys(W),z=v.length,P=0;return new Zr(function(){var ie=null;do{if(P>=z)return T&&T.wrap(W),{done:!0};var ce=W[v[P++]],_e=ce.source,Fe=ce.target;ie=_e===te?Fe:_e,T&&T.has(ie.key)&&(ie=null)}while(ie===null);return{done:!1,value:{neighbor:ie.key,attributes:ie.attributes}}})}function go(T,te){var W=te.name,v=te.type,z=te.direction;T.prototype[W]=function(P){if(v!=="mixed"&&this.type!=="mixed"&&v!==this.type)return[];P=""+P;var ie=this._nodes.get(P);if(ie===void 0)throw new Y("Graph.".concat(W,': could not find the "').concat(P,'" node in the graph.'));return function(ce,_e,Fe){if(ce!=="mixed"){if(ce==="undirected")return Object.keys(Fe.undirected);if(typeof _e=="string")return Object.keys(Fe[_e])}var Be=[];return Ni(!1,ce,_e,Fe,function(Ne){Be.push(Ne)}),Be}(v==="mixed"?this.type:v,z,ie)}}function mo(T,te){var W=te.name,v=te.type,z=te.direction,P=W.slice(0,-1)+"Entries";T.prototype[P]=function(ie){if(v!=="mixed"&&this.type!=="mixed"&&v!==this.type)return Zr.empty();ie=""+ie;var ce=this._nodes.get(ie);if(ce===void 0)throw new Y("Graph.".concat(P,': could not find the "').concat(ie,'" node in the graph.'));return function(_e,Fe,Be){if(_e!=="mixed"){if(_e==="undirected")return Gi(null,Be,Be.undirected);if(typeof Fe=="string")return Gi(null,Be,Be[Fe])}var Ne=Zr.empty(),et=new Di;return _e!=="undirected"&&(Fe!=="out"&&(Ne=si(Ne,Gi(et,Be,Be.in))),Fe!=="in"&&(Ne=si(Ne,Gi(et,Be,Be.out)))),_e!=="directed"&&(Ne=si(Ne,Gi(et,Be,Be.undirected))),Ne}(v==="mixed"?this.type:v,z,ce)}}function Li(T,te,W,v,z){for(var P,ie,ce,_e,Fe,Be,Ne,et=v._nodes.values(),Xn=v.type;(P=et.next()).done!==!0;){var Yr=!1;if(ie=P.value,Xn!=="undirected")for(ce in _e=ie.out){Fe=_e[ce];do Be=Fe.target,Yr=!0,Ne=z(ie.key,Be.key,ie.attributes,Be.attributes,Fe.key,Fe.attributes,Fe.undirected),Fe=Fe.next;while(Fe)}if(Xn!=="directed"){for(ce in _e=ie.undirected)if(!(te&&ie.key>ce)){Fe=_e[ce];do(Be=Fe.target).key!==ce&&(Be=Fe.source),Yr=!0,Ne=z(ie.key,Be.key,ie.attributes,Be.attributes,Fe.key,Fe.attributes,Fe.undirected),Fe=Fe.next;while(Fe)}}W&&!Yr&&(Ne=z(ie.key,null,ie.attributes,null,null,null,null))}}function yo(T){if(!Ie(T))throw new Le('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in T))throw new Le("Graph.import: serialized node is missing its key.");if("attributes"in T&&(!Ie(T.attributes)||T.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function wo(T){if(!Ie(T))throw new Le('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in T))throw new Le("Graph.import: serialized edge is missing its source.");if(!("target"in T))throw new Le("Graph.import: serialized edge is missing its target.");if("attributes"in T&&(!Ie(T.attributes)||T.attributes===null))throw new Le("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in T&&typeof T.undirected!="boolean")throw new Le("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}Di.prototype.wrap=function(T){this.A===null?this.A=T:this.B===null&&(this.B=T)},Di.prototype.has=function(T){return this.A!==null&&T in this.A||this.B!==null&&T in this.B};var Bi,vo=(Bi=255&Math.floor(256*Math.random()),function(){return Bi++}),bo=new Set(["directed","undirected","mixed"]),Wi=new Set(["domain","_events","_eventsCount","_maxListeners"]),xo={allowSelfLoops:!0,multi:!1,type:"mixed"};function Fi(T,te,W){var v=new T.NodeDataClass(te,W);return T._nodes.set(te,v),T.emit("nodeAdded",{key:te,attributes:W}),v}function Pi(T,te,W,v,z,P,ie,ce){if(!v&&T.type==="undirected")throw new ae("Graph.".concat(te,": you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead."));if(v&&T.type==="directed")throw new ae("Graph.".concat(te,": you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead."));if(ce&&!Ie(ce))throw new Le("Graph.".concat(te,': invalid attributes. Expecting an object but got "').concat(ce,'"'));if(P=""+P,ie=""+ie,ce=ce||{},!T.allowSelfLoops&&P===ie)throw new ae("Graph.".concat(te,': source & target are the same ("').concat(P,`"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`));var _e=T._nodes.get(P),Fe=T._nodes.get(ie);if(!_e)throw new Y("Graph.".concat(te,': source node "').concat(P,'" not found.'));if(!Fe)throw new Y("Graph.".concat(te,': target node "').concat(ie,'" not found.'));var Be={key:null,undirected:v,source:P,target:ie,attributes:ce};if(W)z=T._edgeKeyGenerator();else if(z=""+z,T._edges.has(z))throw new ae("Graph.".concat(te,': the "').concat(z,'" edge already exists in the graph.'));if(!T.multi&&(v?_e.undirected[ie]!==void 0:_e.out[ie]!==void 0))throw new ae("Graph.".concat(te,': an edge linking "').concat(P,'" to "').concat(ie,`" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`));var Ne=new Kn(v,z,_e,Fe,ce);T._edges.set(z,Ne);var et=P===ie;return v?(_e.undirectedDegree++,Fe.undirectedDegree++,et&&(_e.undirectedLoops++,T._undirectedSelfLoopCount++)):(_e.outDegree++,Fe.inDegree++,et&&(_e.directedLoops++,T._directedSelfLoopCount++)),T.multi?Ne.attachMulti():Ne.attach(),v?T._undirectedSize++:T._directedSize++,Be.key=z,T.emit("edgeAdded",Be),z}function Eo(T,te,W,v,z,P,ie,ce,_e){if(!v&&T.type==="undirected")throw new ae("Graph.".concat(te,": you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead."));if(v&&T.type==="directed")throw new ae("Graph.".concat(te,": you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead."));if(ce){if(_e){if(typeof ce!="function")throw new Le("Graph.".concat(te,': invalid updater function. Expecting a function but got "').concat(ce,'"'))}else if(!Ie(ce))throw new Le("Graph.".concat(te,': invalid attributes. Expecting an object but got "').concat(ce,'"'))}var Fe;if(P=""+P,ie=""+ie,_e&&(Fe=ce,ce=void 0),!T.allowSelfLoops&&P===ie)throw new ae("Graph.".concat(te,': source & target are the same ("').concat(P,`"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`));var Be,Ne,et=T._nodes.get(P),Xn=T._nodes.get(ie);if(!W&&(Be=T._edges.get(z))){if(!(Be.source.key===P&&Be.target.key===ie||v&&Be.source.key===ie&&Be.target.key===P))throw new ae("Graph.".concat(te,': inconsistency detected when attempting to merge the "').concat(z,'" edge with "').concat(P,'" source & "').concat(ie,'" target vs. ("').concat(Be.source.key,'", "').concat(Be.target.key,'").'));Ne=Be}if(Ne||T.multi||!et||(Ne=v?et.undirected[ie]:et.out[ie]),Ne){var Yr=[Ne.key,!1,!1,!1];if(_e?!Fe:!ce)return Yr;if(_e){var ei=Ne.attributes;Ne.attributes=Fe(ei),T.emit("edgeAttributesUpdated",{type:"replace",key:Ne.key,attributes:Ne.attributes})}else be(Ne.attributes,ce),T.emit("edgeAttributesUpdated",{type:"merge",key:Ne.key,attributes:Ne.attributes,data:ce});return Yr}ce=ce||{},_e&&Fe&&(ce=Fe(ce));var ii={key:null,undirected:v,source:P,target:ie,attributes:ce};if(W)z=T._edgeKeyGenerator();else if(z=""+z,T._edges.has(z))throw new ae("Graph.".concat(te,': the "').concat(z,'" edge already exists in the graph.'));var li=!1,di=!1;et||(et=Fi(T,P,{}),li=!0,P===ie&&(Xn=et,di=!0)),Xn||(Xn=Fi(T,ie,{}),di=!0),Be=new Kn(v,z,et,Xn,ce),T._edges.set(z,Be);var pi=P===ie;return v?(et.undirectedDegree++,Xn.undirectedDegree++,pi&&(et.undirectedLoops++,T._undirectedSelfLoopCount++)):(et.outDegree++,Xn.inDegree++,pi&&(et.directedLoops++,T._directedSelfLoopCount++)),T.multi?Be.attachMulti():Be.attach(),v?T._undirectedSize++:T._directedSize++,ii.key=z,T.emit("edgeAdded",ii),[z,!0,li,di]}function _i(T,te){T._edges.delete(te.key);var W=te.source,v=te.target,z=te.attributes,P=te.undirected,ie=W===v;P?(W.undirectedDegree--,v.undirectedDegree--,ie&&(W.undirectedLoops--,T._undirectedSelfLoopCount--)):(W.outDegree--,v.inDegree--,ie&&(W.directedLoops--,T._directedSelfLoopCount--)),T.multi?te.detachMulti():te.detach(),P?T._undirectedSize--:T._directedSize--,T.emit("edgeDropped",{key:te.key,attributes:z,source:W.key,target:v.key,undirected:P})}var ri=function(T){function te(v){var z;if(z=T.call(this)||this,typeof(v=be({},xo,v)).multi!="boolean")throw new Le(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "`.concat(v.multi,'".'));if(!bo.has(v.type))throw new Le(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "`.concat(v.type,'".'));if(typeof v.allowSelfLoops!="boolean")throw new Le(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "`.concat(v.allowSelfLoops,'".'));var P=v.type==="mixed"?Ee:v.type==="directed"?Ke:qe;we(de(z),"NodeDataClass",P);var ie="geid_"+vo()+"_",ce=0;return we(de(z),"_attributes",{}),we(de(z),"_nodes",new Map),we(de(z),"_edges",new Map),we(de(z),"_directedSize",0),we(de(z),"_undirectedSize",0),we(de(z),"_directedSelfLoopCount",0),we(de(z),"_undirectedSelfLoopCount",0),we(de(z),"_edgeKeyGenerator",function(){var _e;do _e=ie+ce++;while(z._edges.has(_e));return _e}),we(de(z),"_options",v),Wi.forEach(function(_e){return we(de(z),_e,z[_e])}),Te(de(z),"order",function(){return z._nodes.size}),Te(de(z),"size",function(){return z._edges.size}),Te(de(z),"directedSize",function(){return z._directedSize}),Te(de(z),"undirectedSize",function(){return z._undirectedSize}),Te(de(z),"selfLoopCount",function(){return z._directedSelfLoopCount+z._undirectedSelfLoopCount}),Te(de(z),"directedSelfLoopCount",function(){return z._directedSelfLoopCount}),Te(de(z),"undirectedSelfLoopCount",function(){return z._undirectedSelfLoopCount}),Te(de(z),"multi",z._options.multi),Te(de(z),"type",z._options.type),Te(de(z),"allowSelfLoops",z._options.allowSelfLoops),Te(de(z),"implementation",function(){return"graphology"}),z}r(te,T);var W=te.prototype;return W._resetInstanceCounters=function(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0},W.hasNode=function(v){return this._nodes.has(""+v)},W.hasDirectedEdge=function(v,z){if(this.type==="undirected")return!1;if(arguments.length===1){var P=""+v,ie=this._edges.get(P);return!!ie&&!ie.undirected}if(arguments.length===2){v=""+v,z=""+z;var ce=this._nodes.get(v);return!!ce&&ce.out.hasOwnProperty(z)}throw new Le("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},W.hasUndirectedEdge=function(v,z){if(this.type==="directed")return!1;if(arguments.length===1){var P=""+v,ie=this._edges.get(P);return!!ie&&ie.undirected}if(arguments.length===2){v=""+v,z=""+z;var ce=this._nodes.get(v);return!!ce&&ce.undirected.hasOwnProperty(z)}throw new Le("Graph.hasDirectedEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},W.hasEdge=function(v,z){if(arguments.length===1){var P=""+v;return this._edges.has(P)}if(arguments.length===2){v=""+v,z=""+z;var ie=this._nodes.get(v);return!!ie&&(ie.out!==void 0&&ie.out.hasOwnProperty(z)||ie.undirected!==void 0&&ie.undirected.hasOwnProperty(z))}throw new Le("Graph.hasEdge: invalid arity (".concat(arguments.length,", instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target."))},W.directedEdge=function(v,z){if(this.type!=="undirected"){if(v=""+v,z=""+z,this.multi)throw new ae("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");var P=this._nodes.get(v);if(!P)throw new Y('Graph.directedEdge: could not find the "'.concat(v,'" source node in the graph.'));if(!this._nodes.has(z))throw new Y('Graph.directedEdge: could not find the "'.concat(z,'" target node in the graph.'));var ie=P.out&&P.out[z]||void 0;return ie?ie.key:void 0}},W.undirectedEdge=function(v,z){if(this.type!=="directed"){if(v=""+v,z=""+z,this.multi)throw new ae("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");var P=this._nodes.get(v);if(!P)throw new Y('Graph.undirectedEdge: could not find the "'.concat(v,'" source node in the graph.'));if(!this._nodes.has(z))throw new Y('Graph.undirectedEdge: could not find the "'.concat(z,'" target node in the graph.'));var ie=P.undirected&&P.undirected[z]||void 0;return ie?ie.key:void 0}},W.edge=function(v,z){if(this.multi)throw new ae("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.edge: could not find the "'.concat(v,'" source node in the graph.'));if(!this._nodes.has(z))throw new Y('Graph.edge: could not find the "'.concat(z,'" target node in the graph.'));var ie=P.out&&P.out[z]||P.undirected&&P.undirected[z]||void 0;if(ie)return ie.key},W.areDirectedNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areDirectedNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&(z in P.in||z in P.out)},W.areOutNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areOutNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&z in P.out},W.areInNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areInNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&z in P.in},W.areUndirectedNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areUndirectedNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="directed"&&z in P.undirected},W.areNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&(z in P.in||z in P.out)||this.type!=="directed"&&z in P.undirected},W.areInboundNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areInboundNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&z in P.in||this.type!=="directed"&&z in P.undirected},W.areOutboundNeighbors=function(v,z){v=""+v,z=""+z;var P=this._nodes.get(v);if(!P)throw new Y('Graph.areOutboundNeighbors: could not find the "'.concat(v,'" node in the graph.'));return this.type!=="undirected"&&z in P.out||this.type!=="directed"&&z in P.undirected},W.inDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.inDegree: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.inDegree},W.outDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.outDegree: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.outDegree},W.directedDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.directedDegree: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.inDegree+z.outDegree},W.undirectedDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.undirectedDegree: could not find the "'.concat(v,'" node in the graph.'));return this.type==="directed"?0:z.undirectedDegree},W.inboundDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.inboundDegree: could not find the "'.concat(v,'" node in the graph.'));var P=0;return this.type!=="directed"&&(P+=z.undirectedDegree),this.type!=="undirected"&&(P+=z.inDegree),P},W.outboundDegree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.outboundDegree: could not find the "'.concat(v,'" node in the graph.'));var P=0;return this.type!=="directed"&&(P+=z.undirectedDegree),this.type!=="undirected"&&(P+=z.outDegree),P},W.degree=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.degree: could not find the "'.concat(v,'" node in the graph.'));var P=0;return this.type!=="directed"&&(P+=z.undirectedDegree),this.type!=="undirected"&&(P+=z.inDegree+z.outDegree),P},W.inDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.inDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.inDegree-z.directedLoops},W.outDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.outDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.outDegree-z.directedLoops},W.directedDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.directedDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));return this.type==="undirected"?0:z.inDegree+z.outDegree-2*z.directedLoops},W.undirectedDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.undirectedDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));return this.type==="directed"?0:z.undirectedDegree-2*z.undirectedLoops},W.inboundDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.inboundDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));var P=0,ie=0;return this.type!=="directed"&&(P+=z.undirectedDegree,ie+=2*z.undirectedLoops),this.type!=="undirected"&&(P+=z.inDegree,ie+=z.directedLoops),P-ie},W.outboundDegreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.outboundDegreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));var P=0,ie=0;return this.type!=="directed"&&(P+=z.undirectedDegree,ie+=2*z.undirectedLoops),this.type!=="undirected"&&(P+=z.outDegree,ie+=z.directedLoops),P-ie},W.degreeWithoutSelfLoops=function(v){v=""+v;var z=this._nodes.get(v);if(!z)throw new Y('Graph.degreeWithoutSelfLoops: could not find the "'.concat(v,'" node in the graph.'));var P=0,ie=0;return this.type!=="directed"&&(P+=z.undirectedDegree,ie+=2*z.undirectedLoops),this.type!=="undirected"&&(P+=z.inDegree+z.outDegree,ie+=2*z.directedLoops),P-ie},W.source=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.source: could not find the "'.concat(v,'" edge in the graph.'));return z.source.key},W.target=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.target: could not find the "'.concat(v,'" edge in the graph.'));return z.target.key},W.extremities=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.extremities: could not find the "'.concat(v,'" edge in the graph.'));return[z.source.key,z.target.key]},W.opposite=function(v,z){v=""+v,z=""+z;var P=this._edges.get(z);if(!P)throw new Y('Graph.opposite: could not find the "'.concat(z,'" edge in the graph.'));var ie=P.source.key,ce=P.target.key;if(v===ie)return ce;if(v===ce)return ie;throw new Y('Graph.opposite: the "'.concat(v,'" node is not attached to the "').concat(z,'" edge (').concat(ie,", ").concat(ce,")."))},W.hasExtremity=function(v,z){v=""+v,z=""+z;var P=this._edges.get(v);if(!P)throw new Y('Graph.hasExtremity: could not find the "'.concat(v,'" edge in the graph.'));return P.source.key===z||P.target.key===z},W.isUndirected=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.isUndirected: could not find the "'.concat(v,'" edge in the graph.'));return z.undirected},W.isDirected=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.isDirected: could not find the "'.concat(v,'" edge in the graph.'));return!z.undirected},W.isSelfLoop=function(v){v=""+v;var z=this._edges.get(v);if(!z)throw new Y('Graph.isSelfLoop: could not find the "'.concat(v,'" edge in the graph.'));return z.source===z.target},W.addNode=function(v,z){var P=function(ie,ce,_e){if(_e&&!Ie(_e))throw new Le('Graph.addNode: invalid attributes. Expecting an object but got "'.concat(_e,'"'));if(ce=""+ce,_e=_e||{},ie._nodes.has(ce))throw new ae('Graph.addNode: the "'.concat(ce,'" node already exist in the graph.'));var Fe=new ie.NodeDataClass(ce,_e);return ie._nodes.set(ce,Fe),ie.emit("nodeAdded",{key:ce,attributes:_e}),Fe}(this,v,z);return P.key},W.mergeNode=function(v,z){if(z&&!Ie(z))throw new Le('Graph.mergeNode: invalid attributes. Expecting an object but got "'.concat(z,'"'));v=""+v,z=z||{};var P=this._nodes.get(v);return P?(z&&(be(P.attributes,z),this.emit("nodeAttributesUpdated",{type:"merge",key:v,attributes:P.attributes,data:z})),[v,!1]):(P=new this.NodeDataClass(v,z),this._nodes.set(v,P),this.emit("nodeAdded",{key:v,attributes:z}),[v,!0])},W.updateNode=function(v,z){if(z&&typeof z!="function")throw new Le('Graph.updateNode: invalid updater function. Expecting a function but got "'.concat(z,'"'));v=""+v;var P=this._nodes.get(v);if(P){if(z){var ie=P.attributes;P.attributes=z(ie),this.emit("nodeAttributesUpdated",{type:"replace",key:v,attributes:P.attributes})}return[v,!1]}var ce=z?z({}):{};return P=new this.NodeDataClass(v,ce),this._nodes.set(v,P),this.emit("nodeAdded",{key:v,attributes:ce}),[v,!0]},W.dropNode=function(v){v=""+v;var z,P=this._nodes.get(v);if(!P)throw new Y('Graph.dropNode: could not find the "'.concat(v,'" node in the graph.'));if(this.type!=="undirected"){for(var ie in P.out){z=P.out[ie];do _i(this,z),z=z.next;while(z)}for(var ce in P.in){z=P.in[ce];do _i(this,z),z=z.next;while(z)}}if(this.type!=="directed")for(var _e in P.undirected){z=P.undirected[_e];do _i(this,z),z=z.next;while(z)}this._nodes.delete(v),this.emit("nodeDropped",{key:v,attributes:P.attributes})},W.dropEdge=function(v){var z;if(arguments.length>1){var P=""+arguments[0],ie=""+arguments[1];if(!(z=Ce(this,P,ie,this.type)))throw new Y('Graph.dropEdge: could not find the "'.concat(P,'" -> "').concat(ie,'" edge in the graph.'))}else if(v=""+v,!(z=this._edges.get(v)))throw new Y('Graph.dropEdge: could not find the "'.concat(v,'" edge in the graph.'));return _i(this,z),this},W.dropDirectedEdge=function(v,z){if(arguments.length<2)throw new ae("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ae("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var P=Ce(this,v=""+v,z=""+z,"directed");if(!P)throw new Y('Graph.dropDirectedEdge: could not find a "'.concat(v,'" -> "').concat(z,'" edge in the graph.'));return _i(this,P),this},W.dropUndirectedEdge=function(v,z){if(arguments.length<2)throw new ae("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ae("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");var P=Ce(this,v,z,"undirected");if(!P)throw new Y('Graph.dropUndirectedEdge: could not find a "'.concat(v,'" -> "').concat(z,'" edge in the graph.'));return _i(this,P),this},W.clear=function(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")},W.clearEdges=function(){for(var v,z=this._nodes.values();(v=z.next()).done!==!0;)v.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")},W.getAttribute=function(v){return this._attributes[v]},W.getAttributes=function(){return this._attributes},W.hasAttribute=function(v){return this._attributes.hasOwnProperty(v)},W.setAttribute=function(v,z){return this._attributes[v]=z,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:v}),this},W.updateAttribute=function(v,z){if(typeof z!="function")throw new Le("Graph.updateAttribute: updater should be a function.");var P=this._attributes[v];return this._attributes[v]=z(P),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:v}),this},W.removeAttribute=function(v){return delete this._attributes[v],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:v}),this},W.replaceAttributes=function(v){if(!Ie(v))throw new Le("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=v,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this},W.mergeAttributes=function(v){if(!Ie(v))throw new Le("Graph.mergeAttributes: provided attributes are not a plain object.");return be(this._attributes,v),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:v}),this},W.updateAttributes=function(v){if(typeof v!="function")throw new Le("Graph.updateAttributes: provided updater is not a function.");return this._attributes=v(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this},W.updateEachNodeAttributes=function(v,z){if(typeof v!="function")throw new Le("Graph.updateEachNodeAttributes: expecting an updater function.");if(z&&!ke(z))throw new Le("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var P,ie,ce=this._nodes.values();(P=ce.next()).done!==!0;)(ie=P.value).attributes=v(ie.key,ie.attributes);this.emit("eachNodeAttributesUpdated",{hints:z||null})},W.updateEachEdgeAttributes=function(v,z){if(typeof v!="function")throw new Le("Graph.updateEachEdgeAttributes: expecting an updater function.");if(z&&!ke(z))throw new Le("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");for(var P,ie,ce,_e,Fe=this._edges.values();(P=Fe.next()).done!==!0;)ce=(ie=P.value).source,_e=ie.target,ie.attributes=v(ie.key,ie.attributes,ce.key,_e.key,ce.attributes,_e.attributes,ie.undirected);this.emit("eachEdgeAttributesUpdated",{hints:z||null})},W.forEachAdjacencyEntry=function(v){if(typeof v!="function")throw new Le("Graph.forEachAdjacencyEntry: expecting a callback.");Li(!1,!1,!1,this,v)},W.forEachAdjacencyEntryWithOrphans=function(v){if(typeof v!="function")throw new Le("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");Li(!1,!1,!0,this,v)},W.forEachAssymetricAdjacencyEntry=function(v){if(typeof v!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");Li(!1,!0,!1,this,v)},W.forEachAssymetricAdjacencyEntryWithOrphans=function(v){if(typeof v!="function")throw new Le("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");Li(!1,!0,!0,this,v)},W.nodes=function(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):xi(this._nodes.keys(),this._nodes.size)},W.forEachNode=function(v){if(typeof v!="function")throw new Le("Graph.forEachNode: expecting a callback.");for(var z,P,ie=this._nodes.values();(z=ie.next()).done!==!0;)v((P=z.value).key,P.attributes)},W.findNode=function(v){if(typeof v!="function")throw new Le("Graph.findNode: expecting a callback.");for(var z,P,ie=this._nodes.values();(z=ie.next()).done!==!0;)if(v((P=z.value).key,P.attributes))return P.key},W.mapNodes=function(v){if(typeof v!="function")throw new Le("Graph.mapNode: expecting a callback.");for(var z,P,ie=this._nodes.values(),ce=new Array(this.order),_e=0;(z=ie.next()).done!==!0;)P=z.value,ce[_e++]=v(P.key,P.attributes);return ce},W.someNode=function(v){if(typeof v!="function")throw new Le("Graph.someNode: expecting a callback.");for(var z,P,ie=this._nodes.values();(z=ie.next()).done!==!0;)if(v((P=z.value).key,P.attributes))return!0;return!1},W.everyNode=function(v){if(typeof v!="function")throw new Le("Graph.everyNode: expecting a callback.");for(var z,P,ie=this._nodes.values();(z=ie.next()).done!==!0;)if(!v((P=z.value).key,P.attributes))return!1;return!0},W.filterNodes=function(v){if(typeof v!="function")throw new Le("Graph.filterNodes: expecting a callback.");for(var z,P,ie=this._nodes.values(),ce=[];(z=ie.next()).done!==!0;)v((P=z.value).key,P.attributes)&&ce.push(P.key);return ce},W.reduceNodes=function(v,z){if(typeof v!="function")throw new Le("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new Le("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");for(var P,ie,ce=z,_e=this._nodes.values();(P=_e.next()).done!==!0;)ce=v(ce,(ie=P.value).key,ie.attributes);return ce},W.nodeEntries=function(){var v=this._nodes.values();return new Zr(function(){var z=v.next();if(z.done)return z;var P=z.value;return{value:{node:P.key,attributes:P.attributes},done:!1}})},W.export=function(){var v=this,z=new Array(this._nodes.size),P=0;this._nodes.forEach(function(ce,_e){z[P++]=function(Fe,Be){var Ne={key:Fe};return Oe(Be.attributes)||(Ne.attributes=be({},Be.attributes)),Ne}(_e,ce)});var ie=new Array(this._edges.size);return P=0,this._edges.forEach(function(ce,_e){ie[P++]=function(Fe,Be,Ne){var et={key:Be,source:Ne.source.key,target:Ne.target.key};return Oe(Ne.attributes)||(et.attributes=be({},Ne.attributes)),Fe==="mixed"&&Ne.undirected&&(et.undirected=!0),et}(v.type,_e,ce)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:z,edges:ie}},W.import=function(v){var z,P,ie,ce,_e,Fe=this,Be=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(v instanceof te)return v.forEachNode(function(gi,wi){Be?Fe.mergeNode(gi,wi):Fe.addNode(gi,wi)}),v.forEachEdge(function(gi,wi,Oi,Mi,ko,_o,ro){Be?ro?Fe.mergeUndirectedEdgeWithKey(gi,Oi,Mi,wi):Fe.mergeDirectedEdgeWithKey(gi,Oi,Mi,wi):ro?Fe.addUndirectedEdgeWithKey(gi,Oi,Mi,wi):Fe.addDirectedEdgeWithKey(gi,Oi,Mi,wi)}),this;if(!Ie(v))throw new Le("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(v.attributes){if(!Ie(v.attributes))throw new Le("Graph.import: invalid attributes. Expecting a plain object.");Be?this.mergeAttributes(v.attributes):this.replaceAttributes(v.attributes)}if(v.nodes){if(ie=v.nodes,!Array.isArray(ie))throw new Le("Graph.import: invalid nodes. Expecting an array.");for(z=0,P=ie.length;z<P;z++){yo(ce=ie[z]);var Ne=ce,et=Ne.key,Xn=Ne.attributes;Be?this.mergeNode(et,Xn):this.addNode(et,Xn)}}if(v.edges){var Yr=!1;if(this.type==="undirected"&&(Yr=!0),ie=v.edges,!Array.isArray(ie))throw new Le("Graph.import: invalid edges. Expecting an array.");for(z=0,P=ie.length;z<P;z++){wo(_e=ie[z]);var ei=_e,ii=ei.source,li=ei.target,di=ei.attributes,pi=ei.undirected,yi=pi===void 0?Yr:pi;"key"in _e?(Be?yi?this.mergeUndirectedEdgeWithKey:this.mergeDirectedEdgeWithKey:yi?this.addUndirectedEdgeWithKey:this.addDirectedEdgeWithKey).call(this,_e.key,ii,li,di):(Be?yi?this.mergeUndirectedEdge:this.mergeDirectedEdge:yi?this.addUndirectedEdge:this.addDirectedEdge).call(this,ii,li,di)}}return this},W.nullCopy=function(v){var z=new te(be({},this._options,v));return z.replaceAttributes(be({},this.getAttributes())),z},W.emptyCopy=function(v){var z=this.nullCopy(v);return this._nodes.forEach(function(P,ie){var ce=be({},P.attributes);P=new z.NodeDataClass(ie,ce),z._nodes.set(ie,P)}),z},W.copy=function(v){if(typeof(v=v||{}).type=="string"&&v.type!==this.type&&v.type!=="mixed")throw new ae('Graph.copy: cannot create an incompatible copy from "'.concat(this.type,'" type to "').concat(v.type,'" because this would mean losing information about the current graph.'));if(typeof v.multi=="boolean"&&v.multi!==this.multi&&v.multi!==!0)throw new ae("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof v.allowSelfLoops=="boolean"&&v.allowSelfLoops!==this.allowSelfLoops&&v.allowSelfLoops!==!0)throw new ae("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");for(var z,P,ie=this.emptyCopy(v),ce=this._edges.values();(z=ce.next()).done!==!0;)Pi(ie,"copy",!1,(P=z.value).undirected,P.key,P.source.key,P.target.key,be({},P.attributes));return ie},W.toJSON=function(){return this.export()},W.toString=function(){return"[object Graph]"},W.inspect=function(){var v=this,z={};this._nodes.forEach(function(Fe,Be){z[Be]=Fe.attributes});var P={},ie={};this._edges.forEach(function(Fe,Be){var Ne,et=Fe.undirected?"--":"->",Xn="",Yr=Fe.source.key,ei=Fe.target.key;Fe.undirected&&Yr>ei&&(Ne=Yr,Yr=ei,ei=Ne);var ii="(".concat(Yr,")").concat(et,"(").concat(ei,")");Be.startsWith("geid_")?v.multi&&(ie[ii]===void 0?ie[ii]=0:ie[ii]++,Xn+="".concat(ie[ii],". ")):Xn+="[".concat(Be,"]: "),P[Xn+=ii]=Fe.attributes});var ce={};for(var _e in this)this.hasOwnProperty(_e)&&!Wi.has(_e)&&typeof this[_e]!="function"&&t(_e)!=="symbol"&&(ce[_e]=this[_e]);return ce.attributes=this._attributes,ce.nodes=z,ce.edges=P,we(ce,"constructor",this.constructor),ce},te}(Vn.exports.EventEmitter);typeof Symbol<"u"&&(ri.prototype[Symbol.for("nodejs.util.inspect.custom")]=ri.prototype.inspect),[{name:function(T){return"".concat(T,"Edge")},generateKey:!0},{name:function(T){return"".concat(T,"DirectedEdge")},generateKey:!0,type:"directed"},{name:function(T){return"".concat(T,"UndirectedEdge")},generateKey:!0,type:"undirected"},{name:function(T){return"".concat(T,"EdgeWithKey")}},{name:function(T){return"".concat(T,"DirectedEdgeWithKey")},type:"directed"},{name:function(T){return"".concat(T,"UndirectedEdgeWithKey")},type:"undirected"}].forEach(function(T){["add","merge","update"].forEach(function(te){var W=T.name(te),v=te==="add"?Pi:Eo;T.generateKey?ri.prototype[W]=function(z,P,ie){return v(this,W,!0,(T.type||this.type)==="undirected",null,z,P,ie,te==="update")}:ri.prototype[W]=function(z,P,ie,ce){return v(this,W,!1,(T.type||this.type)==="undirected",z,P,ie,ce,te==="update")}})}),function(T){oi.forEach(function(te){var W=te.name,v=te.attacher;v(T,W("Node"),0),v(T,W("Source"),1),v(T,W("Target"),2),v(T,W("Opposite"),3)})}(ri),function(T){ui.forEach(function(te){var W=te.name,v=te.attacher;v(T,W("Edge"),"mixed"),v(T,W("DirectedEdge"),"directed"),v(T,W("UndirectedEdge"),"undirected")})}(ri),function(T){ci.forEach(function(te){(function(W,v){var z=v.name,P=v.type,ie=v.direction;W.prototype[z]=function(ce,_e){if(P!=="mixed"&&this.type!=="mixed"&&P!==this.type)return[];if(!arguments.length)return ao(this,P);if(arguments.length===1){ce=""+ce;var Fe=this._nodes.get(ce);if(Fe===void 0)throw new Y("Graph.".concat(z,': could not find the "').concat(ce,'" node in the graph.'));return co(this.multi,P==="mixed"?this.type:P,ie,Fe)}if(arguments.length===2){ce=""+ce,_e=""+_e;var Be=this._nodes.get(ce);if(!Be)throw new Y("Graph.".concat(z,': could not find the "').concat(ce,'" source node in the graph.'));if(!this._nodes.has(_e))throw new Y("Graph.".concat(z,': could not find the "').concat(_e,'" target node in the graph.'));return ho(P,this.multi,ie,Be,_e)}throw new Le("Graph.".concat(z,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}})(T,te),function(W,v){var z=v.name,P=v.type,ie=v.direction,ce="forEach"+z[0].toUpperCase()+z.slice(1,-1);W.prototype[ce]=function(Ne,et,Xn){if(P==="mixed"||this.type==="mixed"||P===this.type){if(arguments.length===1)return Ti(!1,this,P,Xn=Ne);if(arguments.length===2){Ne=""+Ne,Xn=et;var Yr=this._nodes.get(Ne);if(Yr===void 0)throw new Y("Graph.".concat(ce,': could not find the "').concat(Ne,'" node in the graph.'));return ji(!1,this.multi,P==="mixed"?this.type:P,ie,Yr,Xn)}if(arguments.length===3){Ne=""+Ne,et=""+et;var ei=this._nodes.get(Ne);if(!ei)throw new Y("Graph.".concat(ce,': could not find the "').concat(Ne,'" source node in the graph.'));if(!this._nodes.has(et))throw new Y("Graph.".concat(ce,': could not find the "').concat(et,'" target node in the graph.'));return Ui(!1,P,this.multi,ie,ei,et,Xn)}throw new Le("Graph.".concat(ce,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))}};var _e="map"+z[0].toUpperCase()+z.slice(1);W.prototype[_e]=function(){var Ne,et=Array.prototype.slice.call(arguments),Xn=et.pop();if(et.length===0){var Yr=0;P!=="directed"&&(Yr+=this.undirectedSize),P!=="undirected"&&(Yr+=this.directedSize),Ne=new Array(Yr);var ei=0;et.push(function(ii,li,di,pi,yi,gi,wi){Ne[ei++]=Xn(ii,li,di,pi,yi,gi,wi)})}else Ne=[],et.push(function(ii,li,di,pi,yi,gi,wi){Ne.push(Xn(ii,li,di,pi,yi,gi,wi))});return this[ce].apply(this,et),Ne};var Fe="filter"+z[0].toUpperCase()+z.slice(1);W.prototype[Fe]=function(){var Ne=Array.prototype.slice.call(arguments),et=Ne.pop(),Xn=[];return Ne.push(function(Yr,ei,ii,li,di,pi,yi){et(Yr,ei,ii,li,di,pi,yi)&&Xn.push(Yr)}),this[ce].apply(this,Ne),Xn};var Be="reduce"+z[0].toUpperCase()+z.slice(1);W.prototype[Be]=function(){var Ne,et,Xn=Array.prototype.slice.call(arguments);if(Xn.length<2||Xn.length>4)throw new Le("Graph.".concat(Be,": invalid number of arguments (expecting 2, 3 or 4 and got ").concat(Xn.length,")."));if(typeof Xn[Xn.length-1]=="function"&&typeof Xn[Xn.length-2]!="function")throw new Le("Graph.".concat(Be,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));Xn.length===2?(Ne=Xn[0],et=Xn[1],Xn=[]):Xn.length===3?(Ne=Xn[1],et=Xn[2],Xn=[Xn[0]]):Xn.length===4&&(Ne=Xn[2],et=Xn[3],Xn=[Xn[0],Xn[1]]);var Yr=et;return Xn.push(function(ei,ii,li,di,pi,yi,gi){Yr=Ne(Yr,ei,ii,li,di,pi,yi,gi)}),this[ce].apply(this,Xn),Yr}}(T,te),function(W,v){var z=v.name,P=v.type,ie=v.direction,ce="find"+z[0].toUpperCase()+z.slice(1,-1);W.prototype[ce]=function(Be,Ne,et){if(P!=="mixed"&&this.type!=="mixed"&&P!==this.type)return!1;if(arguments.length===1)return Ti(!0,this,P,et=Be);if(arguments.length===2){Be=""+Be,et=Ne;var Xn=this._nodes.get(Be);if(Xn===void 0)throw new Y("Graph.".concat(ce,': could not find the "').concat(Be,'" node in the graph.'));return ji(!0,this.multi,P==="mixed"?this.type:P,ie,Xn,et)}if(arguments.length===3){Be=""+Be,Ne=""+Ne;var Yr=this._nodes.get(Be);if(!Yr)throw new Y("Graph.".concat(ce,': could not find the "').concat(Be,'" source node in the graph.'));if(!this._nodes.has(Ne))throw new Y("Graph.".concat(ce,': could not find the "').concat(Ne,'" target node in the graph.'));return Ui(!0,P,this.multi,ie,Yr,Ne,et)}throw new Le("Graph.".concat(ce,": too many arguments (expecting 1, 2 or 3 and got ").concat(arguments.length,")."))};var _e="some"+z[0].toUpperCase()+z.slice(1,-1);W.prototype[_e]=function(){var Be=Array.prototype.slice.call(arguments),Ne=Be.pop();return Be.push(function(et,Xn,Yr,ei,ii,li,di){return Ne(et,Xn,Yr,ei,ii,li,di)}),!!this[ce].apply(this,Be)};var Fe="every"+z[0].toUpperCase()+z.slice(1,-1);W.prototype[Fe]=function(){var Be=Array.prototype.slice.call(arguments),Ne=Be.pop();return Be.push(function(et,Xn,Yr,ei,ii,li,di){return!Ne(et,Xn,Yr,ei,ii,li,di)}),!this[ce].apply(this,Be)}}(T,te),function(W,v){var z=v.name,P=v.type,ie=v.direction,ce=z.slice(0,-1)+"Entries";W.prototype[ce]=function(_e,Fe){if(P!=="mixed"&&this.type!=="mixed"&&P!==this.type)return Zr.empty();if(!arguments.length)return uo(this,P);if(arguments.length===1){_e=""+_e;var Be=this._nodes.get(_e);if(!Be)throw new Y("Graph.".concat(ce,': could not find the "').concat(_e,'" node in the graph.'));return lo(P,ie,Be)}if(arguments.length===2){_e=""+_e,Fe=""+Fe;var Ne=this._nodes.get(_e);if(!Ne)throw new Y("Graph.".concat(ce,': could not find the "').concat(_e,'" source node in the graph.'));if(!this._nodes.has(Fe))throw new Y("Graph.".concat(ce,': could not find the "').concat(Fe,'" target node in the graph.'));return fo(P,ie,Ne,Fe)}throw new Le("Graph.".concat(ce,": too many arguments (expecting 0, 1 or 2 and got ").concat(arguments.length,")."))}}(T,te)})}(ri),function(T){po.forEach(function(te){go(T,te),function(W,v){var z=v.name,P=v.type,ie=v.direction,ce="forEach"+z[0].toUpperCase()+z.slice(1,-1);W.prototype[ce]=function(Ne,et){if(P==="mixed"||this.type==="mixed"||P===this.type){Ne=""+Ne;var Xn=this._nodes.get(Ne);if(Xn===void 0)throw new Y("Graph.".concat(ce,': could not find the "').concat(Ne,'" node in the graph.'));Ni(!1,P==="mixed"?this.type:P,ie,Xn,et)}};var _e="map"+z[0].toUpperCase()+z.slice(1);W.prototype[_e]=function(Ne,et){var Xn=[];return this[ce](Ne,function(Yr,ei){Xn.push(et(Yr,ei))}),Xn};var Fe="filter"+z[0].toUpperCase()+z.slice(1);W.prototype[Fe]=function(Ne,et){var Xn=[];return this[ce](Ne,function(Yr,ei){et(Yr,ei)&&Xn.push(Yr)}),Xn};var Be="reduce"+z[0].toUpperCase()+z.slice(1);W.prototype[Be]=function(Ne,et,Xn){if(arguments.length<3)throw new Le("Graph.".concat(Be,": missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array."));var Yr=Xn;return this[ce](Ne,function(ei,ii){Yr=et(Yr,ei,ii)}),Yr}}(T,te),function(W,v){var z=v.name,P=v.type,ie=v.direction,ce=z[0].toUpperCase()+z.slice(1,-1),_e="find"+ce;W.prototype[_e]=function(Ne,et){if(P==="mixed"||this.type==="mixed"||P===this.type){Ne=""+Ne;var Xn=this._nodes.get(Ne);if(Xn===void 0)throw new Y("Graph.".concat(_e,': could not find the "').concat(Ne,'" node in the graph.'));return Ni(!0,P==="mixed"?this.type:P,ie,Xn,et)}};var Fe="some"+ce;W.prototype[Fe]=function(Ne,et){return!!this[_e](Ne,et)};var Be="every"+ce;W.prototype[Be]=function(Ne,et){return!this[_e](Ne,function(Xn,Yr){return!et(Xn,Yr)})}}(T,te),mo(T,te)})}(ri);var qi=function(T){function te(W){var v=be({type:"directed"},W);if("multi"in v&&v.multi!==!1)throw new Le("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(v.type!=="directed")throw new Le('DirectedGraph.from: inconsistent "'+v.type+'" type in given options!');return T.call(this,v)||this}return r(te,T),te}(ri),Vi=function(T){function te(W){var v=be({type:"undirected"},W);if("multi"in v&&v.multi!==!1)throw new Le("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(v.type!=="undirected")throw new Le('UndirectedGraph.from: inconsistent "'+v.type+'" type in given options!');return T.call(this,v)||this}return r(te,T),te}(ri),eo=function(T){function te(W){var v=be({multi:!0},W);if("multi"in v&&v.multi!==!0)throw new Le("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");return T.call(this,v)||this}return r(te,T),te}(ri),to=function(T){function te(W){var v=be({type:"directed",multi:!0},W);if("multi"in v&&v.multi!==!0)throw new Le("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(v.type!=="directed")throw new Le('MultiDirectedGraph.from: inconsistent "'+v.type+'" type in given options!');return T.call(this,v)||this}return r(te,T),te}(ri),no=function(T){function te(W){var v=be({type:"undirected",multi:!0},W);if("multi"in v&&v.multi!==!0)throw new Le("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(v.type!=="undirected")throw new Le('MultiUndirectedGraph.from: inconsistent "'+v.type+'" type in given options!');return T.call(this,v)||this}return r(te,T),te}(ri);function Si(T){T.from=function(te,W){var v=be({},te.options,W),z=new T(v);return z.import(te),z}}return Si(ri),Si(qi),Si(Vi),Si(eo),Si(to),Si(no),ri.Graph=ri,ri.DirectedGraph=qi,ri.UndirectedGraph=Vi,ri.MultiGraph=eo,ri.MultiDirectedGraph=to,ri.MultiUndirectedGraph=no,ri.InvalidArgumentsGraphError=Le,ri.NotFoundGraphError=Y,ri.UsageGraphError=ae,ri})}(Ft)),Ft.exports}var Is=$s();const nr=st$1(Is);var rt={},bn,ir;function rr(){return ir||(ir=1,bn=function(n){return n!==null&&typeof n=="object"&&typeof n.addUndirectedEdgeWithKey=="function"&&typeof n.dropNode=="function"&&typeof n.multi=="boolean"}),bn}var ot={},En={},or;function Gs(){return or||(or=1,function(n){var e=Math.pow(2,8)-1,t=Math.pow(2,16)-1,r=Math.pow(2,32)-1,y=Math.pow(2,7)-1,j=Math.pow(2,15)-1,re=Math.pow(2,31)-1;n.getPointerArray=function(se){var de=se-1;if(de<=e)return Uint8Array;if(de<=t)return Uint16Array;if(de<=r)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},n.getSignedPointerArray=function(se){var de=se-1;return de<=y?Int8Array:de<=j?Int16Array:de<=re?Int32Array:Float64Array},n.getNumberType=function(se){return se===(se|0)?Math.sign(se)===-1?se<=127&&se>=-128?Int8Array:se<=32767&&se>=-32768?Int16Array:Int32Array:se<=255?Uint8Array:se<=65535?Uint16Array:Uint32Array:Float64Array};var ne={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};n.getMinimalRepresentation=function(se,de){var be=null,Ce=0,Ie,Oe,we,Te,ke;for(Te=0,ke=se.length;Te<ke;Te++)we=de?de(se[Te]):se[Te],Oe=n.getNumberType(we),Ie=ne[Oe.name],Ie>Ce&&(Ce=Ie,be=Oe);return be},n.isTypedArray=function(se){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(se)},n.concat=function(){var se=0,de,be,Ce;for(de=0,Ce=arguments.length;de<Ce;de++)se+=arguments[de].length;var Ie=new arguments[0].constructor(se);for(de=0,be=0;de<Ce;de++)Ie.set(arguments[de],be),be+=arguments[de].length;return Ie},n.indices=function(se){for(var de=n.getPointerArray(se),be=new de(se),Ce=0;Ce<se;Ce++)be[Ce]=Ce;return be}}(En)),En}var sr;function As(){if(sr)return ot;sr=1;var n=ln$2(),e=Gs();function t(re){return Array.isArray(re)||e.isTypedArray(re)}function r(re){if(typeof re.length=="number")return re.length;if(typeof re.size=="number")return re.size}function y(re){var ne=r(re),se=typeof ne=="number"?new Array(ne):[],de=0;return n(re,function(be){se[de++]=be}),se}function j(re){var ne=r(re),se=typeof ne=="number"?e.getPointerArray(ne):Array,de=typeof ne=="number"?new Array(ne):[],be=typeof ne=="number"?new se(ne):[],Ce=0;return n(re,function(Ie){de[Ce]=Ie,be[Ce]=Ce++}),[de,be]}return ot.isArrayLike=t,ot.guessLength=r,ot.toArray=y,ot.toArrayWithIndices=j,ot}var kn,ar;function Ds(){if(ar)return kn;ar=1;var n=As(),e=an$1();function t(r,y){if(arguments.length<2)throw new Error("mnemonist/fixed-deque: expecting an Array class and a capacity.");if(typeof y!="number"||y<=0)throw new Error("mnemonist/fixed-deque: `capacity` should be a positive number.");this.ArrayClass=r,this.capacity=y,this.items=new r(this.capacity),this.clear()}return t.prototype.clear=function(){this.start=0,this.size=0},t.prototype.push=function(r){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.push: deque capacity ("+this.capacity+") exceeded!");var y=this.start+this.size;return y>=this.capacity&&(y-=this.capacity),this.items[y]=r,++this.size},t.prototype.unshift=function(r){if(this.size===this.capacity)throw new Error("mnemonist/fixed-deque.unshift: deque capacity ("+this.capacity+") exceeded!");var y=this.start-1;return this.start===0&&(y=this.capacity-1),this.items[y]=r,this.start=y,++this.size},t.prototype.pop=function(){if(this.size!==0){this.size--;var r=this.start+this.size;return r>=this.capacity&&(r-=this.capacity),this.items[r]}},t.prototype.shift=function(){if(this.size!==0){var r=this.start;return this.size--,this.start++,this.start===this.capacity&&(this.start=0),this.items[r]}},t.prototype.peekFirst=function(){if(this.size!==0)return this.items[this.start]},t.prototype.peekLast=function(){if(this.size!==0){var r=this.start+this.size-1;return r>=this.capacity&&(r-=this.capacity),this.items[r]}},t.prototype.get=function(r){if(!(this.size===0||r>=this.capacity))return r=this.start+r,r>=this.capacity&&(r-=this.capacity),this.items[r]},t.prototype.forEach=function(r,y){y=arguments.length>1?y:this;for(var j=this.capacity,re=this.size,ne=this.start,se=0;se<re;)r.call(y,this.items[ne],se,this),ne++,se++,ne===j&&(ne=0)},t.prototype.toArray=function(){var r=this.start+this.size;if(r<this.capacity)return this.items.slice(this.start,r);for(var y=new this.ArrayClass(this.size),j=this.capacity,re=this.size,ne=this.start,se=0;se<re;)y[se]=this.items[ne],ne++,se++,ne===j&&(ne=0);return y},t.prototype.values=function(){var r=this.items,y=this.capacity,j=this.size,re=this.start,ne=0;return new e(function(){if(ne>=j)return{done:!0};var se=r[re];return re++,ne++,re===y&&(re=0),{value:se,done:!1}})},t.prototype.entries=function(){var r=this.items,y=this.capacity,j=this.size,re=this.start,ne=0;return new e(function(){if(ne>=j)return{done:!0};var se=r[re];return re++,re===y&&(re=0),{value:[ne++,se],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.inspect=function(){var r=this.toArray();return r.type=this.ArrayClass.name,r.capacity=this.capacity,Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(r,y,j){if(arguments.length<3&&(j=n.guessLength(r),typeof j!="number"))throw new Error("mnemonist/fixed-deque.from: could not guess iterable length. Please provide desired capacity as last argument.");var re=new t(y,j);if(n.isArrayLike(r)){var ne,se;for(ne=0,se=r.length;ne<se;ne++)re.items[ne]=r[ne];return re.size=se,re}return n.forEach(r,function(de){re.push(de)}),re},kn=t,kn}var cr;function Cs(){if(cr)return rt;cr=1;const n=rr(),e=Ds();function t(ne,se){let de=0;return ne.forEachInNeighbor(se,()=>{de++}),de}function r(ne,se){if(!n(ne))throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");if(ne.type==="undirected"||ne.undirectedSize!==0)throw new Error("graphology-dag/topological-sort: cannot work if graph is not directed.");if(ne.order===0)return;const de=new e(Array,ne.order),be={};let Ce=0;ne.forEachNode((we,Te)=>{const ke=ne.multi?t(ne,we):ne.inDegree(we);ke===0?de.push([we,Te,0]):(be[we]=ke,Ce+=ke)});let Ie=0;function Oe(we,Te){const ke=--be[we];Ce--,ke===0&&de.push([we,Te,Ie+1]),be[we]=ke}for(;de.size!==0;){const[we,Te,ke]=de.shift();Ie=ke,se(we,Te,ke),ne.forEachOutNeighbor(we,Oe)}if(Ce!==0)throw new Error("graphology-dag/topological-sort: given graph is not acyclic.")}function y(ne){if(!n(ne))throw new Error("graphology-dag/topological-sort: the given graph is not a valid graphology instance.");const se=new Array(ne.order);let de=0;return r(ne,be=>{se[de++]=be}),se}function j(ne,se){if(!n(ne))throw new Error("graphology-dag/topological-generations: the given graph is not a valid graphology instance.");if(ne.order===0)return;let de=0,be=[];r(ne,(Ce,Ie,Oe)=>{Oe>de&&(se(be),de=Oe,be=[]),be.push(Ce)}),se(be)}function re(ne){if(!n(ne))throw new Error("graphology-dag/topological-generations: the given graph is not a valid graphology instance.");const se=[];return j(ne,de=>{se.push(de)}),se}return rt.topologicalSort=y,rt.forEachNodeInTopologicalOrder=r,rt.topologicalGenerations=re,rt.forEachTopologicalGeneration=j,rt}var ur=Cs(),Sn,dr;function Os(){if(dr)return Sn;dr=1;const n=rr();return Sn=function(e,t,r){if(!n(e))throw new Error("graphology-dag/will-create-cycle: the given graph is not a valid graphology instance.");if(t=""+t,r=""+r,t===r)return!0;if(!e.hasNode(t)||!e.hasNode(r)||e.hasDirectedEdge(t,r))return!1;if(e.hasDirectedEdge(r,t))return!0;const y=e.outNeighbors(r);function j(re){y.push(re)}for(;y.length!==0;){const re=y.pop();if(re===t)return!0;e.forEachOutNeighbor(re,j)}return!1},Sn}var Rs=Os();const st=st$1(Rs);function lr(n){const e=[],t=[...n];let r;for(;r=t.shift();){let y=r.parent;if(y){const j=[];for(;y;){const re=t.findIndex(se=>se.id===y);if(re<0)break;const[ne]=t.splice(re,1);if(!ne)throw new Error("Invalid state, should not happen");j.unshift(ne),y=ne.parent}e.push(...j)}e.push(r)}return e}function Ns(n){return n.forEach(e=>{e.children.length>0&&(e.children=n.reduce((t,r)=>(r.parent===e.id&&t.push(r.id),t),[]))}),n}function hr(n){let e=lr([...n.nodes.values()]),t=[...n.edges];if(e.length<2||t.length===0)return{nodes:e,edges:t};const r=Oe=>i(n.nodes.get(Oe)),y=new nr({multi:!0,allowSelfLoops:!0,type:"directed"}),j=xt$1(t,jt$1((Oe,we)=>{const Te=r(Oe.source),ke=r(Oe.target),Ve=Oe.parent?r(Oe.parent):null;return{id:Oe.id,edge:Oe,parent:Ve,source:Te,target:ke}})),[re,ne]=Wt(j,({source:Oe,target:we})=>Oe.children.length===0&&we.children.length===0),se=[],de=Oe=>{y.mergeNode(Oe.source),y.mergeNode(Oe.target),se.push(Oe),st(y,Oe.source,Oe.target)||y.mergeDirectedEdge(Oe.source,Oe.target)};for(const{edge:Oe,source:we,target:Te}of re)if(de(Oe),Te.parent&&Te.parent!==Oe.parent&&xt$1(vn(Te,n.nodes),Lt(ke=>ke.inEdges.includes(Oe.id)),he(ke=>{y.mergeNode(ke.id),st(y,Oe.source,ke.id)||y.mergeDirectedEdge(Oe.source,ke.id),st(y,ke.id,Oe.target)||y.mergeDirectedEdge(ke.id,Oe.target)})),we.parent){const ke=r(we.parent);y.mergeNode(ke.id),st(y,ke.id,we.id)||y.mergeDirectedEdge(ke.id,we.id),Te.parent&&Te.parent!==we.parent&&(st(y,ke.id,Te.parent)||y.mergeDirectedEdge(ke.id,Te.parent))}for(const{edge:Oe}of ne)de(Oe);u(se.length===t.length,"Not all edges were added to the graph");const be=ur.topologicalSort(y);let Ce=[],Ie=e.slice();for(const Oe of be){const we=Ie.findIndex(Te=>Te.id===Oe);u(we>=0,`Node "${Oe}" not found`),Ce.push(...Ie.splice(we,1))}return Ie.length>0&&Ce.length>0&&(Ce=Ce.flatMap(Oe=>{if(Ie.length===0)return Oe;const we=e.slice(0,e.indexOf(Oe)).filter(Te=>Ie.includes(Te));return we.length>0?(Ie=Ie.filter(Te=>!we.includes(Te)),[...we,Oe]):Oe})),Ce.push(...Ie),{nodes:Ns(lr(Ce)),edges:se}}function xn(n){const e={id:n.id,__:n.__??"element",autoLayout:n.autoLayout,nodes:xt$1(n.nodes,jt$1(vt(["id","title","description","technology","shape","icon","children"])),fn(({id:t,icon:r,...y})=>[t,{...y,icon:X(r)?"Y":"N"}])),edges:xt$1(n.edges,jt$1(vt(["source","target","label","description","technology","dir","head","tail","line"])),fn(({source:t,target:r,...y})=>[`${t}:${r}`,y]))};return n.hash=Hn(e,{ignoreUnknown:!0,respectType:!1}),n}class fr{constructor(e){this.state=e}get Ctx(){throw new Error("Should not be called in runtime")}get elements(){return this.state.elements}get explicits(){return this.state.explicits}get final(){return this.state.final}get connections(){return this.state.connections}isEmpty(){return this.elements.size===0&&this.connections.length===0&&this.explicits.size===0&&this.final.size===0}}exports.c=void 0,(n=>{n.isInside=e=>t=>ft(e,t.source.id)&&ft(e,t.target.id),n.isDirectedBetween=(e,t)=>r=>(r.source.id===e||ft(e,r.source.id))&&(r.target.id===t||ft(t,r.target.id)),n.isAnyBetween=(e,t)=>{const r=(0,n.isDirectedBetween)(e,t),y=(0,n.isDirectedBetween)(t,e);return j=>r(j)||y(j)},n.isIncoming=e=>t=>(t.target.id===e||ft(e,t.target.id))&&!ft(e,t.source.id),n.isOutgoing=e=>t=>(t.source.id===e||ft(e,t.source.id))&&!ft(e,t.target.id),n.isAnyInOut=e=>{const t=(0,n.isIncoming)(e),r=(0,n.isOutgoing)(e);return y=>t(y)||r(y)}})(exports.c||(exports.c={}));const _n=Symbol.for("nodejs.util.inspect.custom");class pr{get style(){return{shape:F,color:Z$1,...this.$node.style}}get shape(){return this.$node.style?.shape??F}get color(){return this.$node.style?.color??Z$1}get tags(){return this.$node.tags??[]}get kind(){return this.$node.kind??null}get description(){return this.$node.description??null}get technology(){return this.$node.technology??null}get links(){return this.$node.links??[]}ancestors(){return this.$model.ancestors(this)}commonAncestor(e){const t=qt$1(this.id,e.id);return t?this.$model.node(t):null}siblings(){return this.$model.siblings(this)}isSibling(e){return this.parent===e.parent}*ascendingSiblings(){yield*this.siblings();for(const e of this.ancestors())yield*e.siblings()}*descendingSiblings(){for(const e of[...this.ancestors()].reverse())yield*e.siblings();yield*this.siblings()}incoming(e="all"){return this.$model.incoming(this,e)}outgoing(e="all"){return this.$model.outgoing(this,e)}*incomers(e="all"){const t=new Set;for(const r of this.incoming(e))t.has(r.source.id)||(t.add(r.source.id),yield r.source)}*outgoers(e="all"){const t=new Set;for(const r of this.outgoing(e))t.has(r.target.id)||(t.add(r.target.id),yield r.target)}*views(){for(const e of this.$model.views())e.isDeploymentView()&&e.includesDeployment(this.id)&&(yield e)}isDeploymentNode(){return!1}isInstance(){return!1}cachedOutgoing=null;cachedIncoming=null;get allOutgoing(){return this.cachedOutgoing??=De.from(new Set(this.outgoingModelRelationships()),new Set(this.outgoing())),this.cachedOutgoing}get allIncoming(){return this.cachedIncoming??=De.from(new Set(this.incomingModelRelationships()),new Set(this.incoming())),this.cachedIncoming}}class $n extends pr{constructor(e,t){super(),this.$model=e,this.$node=t,this.id=t.id,this.title=t.title,this.hierarchyLevel=lt$1(t.id)}id;title;hierarchyLevel;get parent(){return this.$model.parent(this)}get kind(){return this.$node.kind}children(){return this.$model.children(this)}descendants(e="desc"){return this.$model.descendants(this,e)}isDeploymentNode(){return!0}*instances(){for(const e of this.descendants("desc"))e.isInstance()&&(yield e)}onlyOneInstance(){const e=this.children();if(e.size!==1)return null;const t=K([...e]);return t?.isInstance()?t:null}_relationshipsFromInstances=null;relationshipsFromInstances(){if(this._relationshipsFromInstances)return this._relationshipsFromInstances;const{outgoing:e,incoming:t}=this._relationshipsFromInstances={outgoing:new Set,incoming:new Set};for(const r of this.instances()){for(const y of r.element.outgoing())e.add(y);for(const y of r.element.incoming())t.add(y)}return this._relationshipsFromInstances}outgoingModelRelationships(){return this.relationshipsFromInstances().outgoing.values()}incomingModelRelationships(){return this.relationshipsFromInstances().incoming.values()}internalModelRelationships(){const{outgoing:e,incoming:t}=this.relationshipsFromInstances();return kn$1(t,e)}}class In extends pr{constructor(e,t,r){super(),this.$model=e,this.$instance=t,this.element=r,this.id=t.id,this.title=t.title??r.title,this.hierarchyLevel=lt$1(t.id)}id;title;hierarchyLevel;get $node(){return this.$instance}get parent(){return i(this.$model.parent(this),`Parent of ${this.id} not found`)}get style(){const{icon:e,style:t}=this.element.$element;return{shape:this.element.shape,color:this.element.color,...e&&{icon:e},...t,...this.$instance.style}}get shape(){return this.$instance.style?.shape??this.element.shape}get color(){return this.$instance.style?.color??this.element.color}get tags(){return this.$instance.tags??[]}get kind(){return this.$instance.kind??null}get description(){return this.$instance.description??this.element.description}get technology(){return this.$instance.technology??this.element.technology}get links(){return this.$instance.links??this.element.links}isInstance(){return!0}outgoingModelRelationships(){return this.element.outgoing()}incomingModelRelationships(){return this.element.incoming()}*views(){for(const e of this.$model.views())if(e.isDeploymentView()){if(e.includesDeployment(this.id)){yield e;continue}e.includesDeployment(this.parent.id)&&this.parent.onlyOneInstance()&&(yield e)}}}class Ms{constructor(e,t){this.instance=e,this.element=t}get id(){return this.instance.id}get style(){const{icon:e,style:t}=this.element.$element;return{shape:this.element.shape,color:this.element.color,...e&&{icon:e},...t}}get shape(){return this.element.shape}get color(){return this.element.color}get title(){return this.element.title}get description(){return this.element.description}get technology(){return this.element.technology}isDeploymentNode(){return!1}isInstance(){return!1}}class gr{constructor(e,t){this.$model=e,this.$relationship=t,this.source=e.deploymentRef(t.source),this.target=e.deploymentRef(t.target);const r=qt$1(this.source.id,this.target.id);this.boundary=r?this.$model.node(r):null}boundary;source;target;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Pe(this.$relationship.title)?null:this.$relationship.title}get technology(){return Pe(this.$relationship.technology)?null:this.$relationship.technology}get description(){return Pe(this.$relationship.description)?null:this.$relationship.description}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get navigateTo(){return this.$relationship.navigateTo?this.$model.$model.view(this.$relationship.navigateTo):null}get links(){return this.$relationship.links??[]}*views(){for(const e of this.$model.views())e.includesRelation(this.id)&&(yield e)}}class De{constructor(e=new Set,t=new Set){this.model=e,this.deployment=t}static empty(){return new De}static from(e,t){return new De(new Set(e),new Set(t))}get isEmpty(){return this.model.size===0&&this.deployment.size===0}get nonEmpty(){return this.model.size>0||this.deployment.size>0}get size(){return this.model.size+this.deployment.size}intersect(e){return De.from(kn$1(this.model,e.model),kn$1(this.deployment,e.deployment))}difference(e){return De.from(Tn$1(this.model,e.model),Tn$1(this.deployment,e.deployment))}union(e){return De.from(Nn$1(this.model,e.model),Nn$1(this.deployment,e.deployment))}}class Ae{constructor(e,t,r){this.source=e,this.target=t,this.relations=r,this.id=Rn$2(`deployment:${e.id}:${t.id}`)}id;get expression(){return`${this.source.id} -> ${this.target.id}`}_boundary;get boundary(){return this._boundary??=this.source.commonAncestor(this.target),this._boundary}nonEmpty(){return this.relations.nonEmpty}[_n](e,t,r){const y=this.toString();return Object.defineProperty(y,"constructor",{value:Ae,enumerable:!1}),y}toString(){const e=[...this.relations.model].map(r=>" "+r.expression);e.length?e.unshift(" model:"):e.unshift(" model: []");const t=[...this.relations.deployment].map(r=>" "+r.expression);return t.length?t.unshift(" deployment:"):t.unshift(" deployment: []"),[this.expression,...e,...t].join(`
|
|
7
|
-
`)}hasDirectDeploymentRelation(){for(const e of this.relations.deployment)if(e.source.id===this.source.id||e.target.id===this.target.id)return!0;return!1}*values(){yield*this.relations.model,yield*this.relations.deployment}mergeWith(e){return Array.isArray(e)?e.reduce((t,r)=>t.mergeWith(r),this):(u(this.source.id===e.source.id,"Cannot merge connections with different sources"),u(this.target.id===e.target.id,"Cannot merge connections with different targets"),new Ae(this.source,this.target,this.relations.union(e.relations)))}difference(e){return new Ae(this.source,this.target,this.relations.difference(e.relations))}intersect(e){return new Ae(this.source,this.target,this.relations.intersect(e.relations))}equals(e){return u(e instanceof Ae,"Other should ne DeploymentConnectionModel"),this.id===e.id&&this.source.id===e.source.id&&this.target.id===e.target.id&&qn(this.relations.model,e.relations.model)&&qn(this.relations.deployment,e.relations.deployment)}update(e){return e&&(e={model:this.relations.model,deployment:this.relations.deployment,...e}),new Ae(this.source,this.target,e?new De(e.model??new Set,e.deployment??new Set):this.relations)}}function at(n,e){if(!e){const re=n;return ne=>at(ne,re)}const t=n.source===e.source,r=n.target===e.target;if(t&&r)return!1;const y=ft(e.source.id,n.source.id),j=ft(e.target.id,n.target.id);return y&&j||t&&j||r&&y}function Gn(n,e){let t=e;for(const r of n)at(r,t)&&(t=r);return t!==e?t:null}function Ls(n){const e=[],t=n.slice();let r;for(;r=t.shift();){let y;for(;y=Gn(t,r);){const j=t.indexOf(y);e.push(t.splice(j,1)[0])}e.push(r)}return e}const Ts=n=>n.boundary?.id?`.${n.boundary.id}`:"";function mr(n,e){if(!n||tt(n)){const t=n??"asc";return r=>yr(r,t)}return yr(n,e??"asc")}function yr(n,e){return xt$1(n,jt$1(t=>({id:Ts(t),conn:t})),Ot(e),jt$1(Se("conn")))}function wr(n,e){return n.filter(t=>at(e,t))}function vr(n,e){return n.filter(at(e))}function ct(n){const e=new Map;for(const t of n){const r=e.get(t.id);r?e.set(t.id,t.mergeWith(r)):e.set(t.id,t)}return[...e.values()]}function ut(n,e){const t=new Map([...e].map(r=>[r.id,r]));return[...n].reduce((r,y)=>{const j=t.get(y.id);if(!j)return r.push(y),r;const re=y.difference(j);return re.nonEmpty()&&r.push(re),r},[])}function An(n,e){return e?n.source===e.source&&n.target===e.target:t=>n.source===t.source&&n.target===t.target}function zs(n,e){return e?n.source===e.source:t=>n.source===t.source}function Ps(n,e){return e?n.target===e.target:t=>n.target===t.target}function Dn(n,e){if(!e){const r=n;return y=>Dn(y,r)}const t=n;return wn$1(t.source,e)&&!wn$1(t.target,e)}function Cn(n,e){if(!e){const r=n;return y=>Cn(y,r)}const t=n;return wn$1(t.target,e)&&!wn$1(t.source,e)}function qt(n,e){if(!e){const r=n;return y=>qt(y,r)}const t=n;return wn$1(t.source,e)!==wn$1(t.target,e)}function dt(n,e,t="directed"){if(n===e)return[];if(wt$1(n,e))return[];const r=kn$1(n.allOutgoing,e.allIncoming),y=r.size>0?new ee(n,e,r):null;if(t==="directed")return y?[y]:[];const j=kn$1(n.allIncoming,e.allOutgoing),re=j.size>0?new ee(e,n,j):null;return y&&re?[y,re]:y?[y]:re?[re]:[]}function oe(n,e,t="both"){if(n.allIncoming.size===0&&n.allOutgoing.size===0)return[];const r=[],y=[];for(const j of e)if(n!==j)for(const re of dt(n,j,t))re.source===n?r.push(re):y.push(re);return[...r,...y]}function We(n){return[...n].reduce((e,t,r,y)=>(r===y.length-1||e.push(...oe(t,y.slice(r+1),"both")),e),[])}const Ws={__proto__:null,findConnection:dt,findConnectionsBetween:oe,findConnectionsWithin:We};class ee{constructor(e,t,r=new Set){this.source=e,this.target=t,this.relations=r,this.id=Rn$2(`model:${e.id}:${t.id}`)}id;_boundary;get boundary(){return this._boundary??=this.source.commonAncestor(this.target)}get expression(){return`${this.source.id} -> ${this.target.id}`}get isDirect(){return this.nonEmpty()&&!this.isImplicit}get isImplicit(){return this.nonEmpty()&&jn$1(this.relations,q(An(this)))}get directRelations(){return new Set(xn$1(this.relations,An(this)))}nonEmpty(){return this.relations.size>0}mergeWith(e){return u(this.source.id===e.source.id,"Cannot merge connections with different sources"),u(this.target.id===e.target.id,"Cannot merge connections with different targets"),new ee(this.source,this.target,Nn$1(this.relations,e.relations))}difference(e){return new ee(this.source,this.target,Tn$1(this.relations,e.relations))}intersect(e){return u(e instanceof ee,"Cannot intersect connection with different type"),new ee(this.source,this.target,kn$1(this.relations,e.relations))}equals(e){return u(e instanceof ee,"Cannot merge connection with different type"),this.id===e.id&&this.source.id===e.source.id&&this.target.id===e.target.id&&qn(this.relations,e.relations)}update(e){return new ee(this.source,this.target,e)}[_n](e,t,r){const y=this.toString();return Object.defineProperty(y,"constructor",{value:ee,enumerable:!1}),y}toString(){return[this.expression,this.relations.size?" relations:":" relations: [ ]",...[...this.relations].map(e=>" "+e.expression)].join(`
|
|
8
|
-
`)}reversed(e=!1){if(!e)return new ee(this.target,this.source);const[t]=dt(this.target,this.source,"directed");return t??new ee(this.target,this.source,new Set)}}function He(n,e,t="directed"){if(n===e)return[];if(wt$1(n,e))return[];const r=n.allOutgoing.intersect(e.allIncoming),y=r.nonEmpty?[new Ae(n,e,r)]:[];return t==="directed"?y:[...y,...He(e,n,"directed")]}function fe(n,e,t="both"){if(n.allIncoming.isEmpty&&n.allOutgoing.isEmpty)return[];const r=[],y=[];for(const j of e)if(n!==j)for(const re of He(n,j,t))re.source===n?r.push(re):y.push(re);return[...r,...y]}function lt(n){return[...n].reduce((e,t,r,y)=>(r===y.length-1||e.push(...fe(t,y.slice(r+1),"both")),e),[])}const js={__proto__:null,findConnection:He,findConnectionsBetween:fe,findConnectionsWithin:lt};class br{constructor(e,t){this.memory=e,this.expression=t}excluded={elements:new Set,connections:[]};markedToMoveExplicitToImplicit=!1;_removeElement(e){this.excluded.elements.add(e)}exclude(e){if(!e)return this;if(Bn(e)){for(const t of e)this._removeElement(t);return this}return this._removeElement(e),this}_removeConnection(e){this.excluded.connections.push(e)}excludeConnections(e,t){if(ds(t)&&(u(!this.markedToMoveExplicitToImplicit,"Already marked to move explicits"),this.markedToMoveExplicitToImplicit=t),Bn(e)){for(const r of e)this._removeConnection(r);return this}return this._removeConnection(e),this}isDirty(){return this.excluded.elements.size>0||this.excluded.connections.length>0}isEmpty(){return!this.isDirty()}filterForMoveToImplicits(e){return this.markedToMoveExplicitToImplicit||this.excluded.elements.size>0?e:new Set}moveDisconnectedExplicitsToImplicits(e){let t=Tn$1(new Set(this.memory.connections.flatMap(r=>[r.source,r.target])),new Set(e.connections.flatMap(r=>[r.source,r.target])));return t=kn$1(t,e.elements),t=xt$1(t,xn$1(r=>e.explicits.has(r)&&!jn$1(e.final,wn$1(r))),zn$1()),t.size>0&&(t=this.filterForMoveToImplicits(t),e.explicits=Tn$1(e.explicits,t),e.final=Tn$1(e.final,t)),e}removeElements(e){return e.elements=Tn$1(e.elements,this.excluded.elements),e.explicits=Tn$1(e.explicits,this.excluded.elements),e.final=Tn$1(e.final,this.excluded.elements),e}removeConnections(e){const t=this.excluded.connections.reduce((y,j)=>{const re=y.get(j.id);return re?y.set(j.id,re.mergeWith(j)):y.set(j.id,j),y},new Map);let r=new Set;e.connections=e.connections.reduce((y,j)=>{const re=t.get(j.id);if(re){r.add(j.source),r.add(j.target);const ne=j.difference(re);ne.nonEmpty()&&y.push(ne)}else y.push(j);return y},[]);for(const y of e.connections)r.delete(y.source),r.delete(y.target),y.boundary&&e.elements.has(y.boundary)&&r.delete(y.boundary);return r.size===0||(r=Tn$1(r,e.explicits),e.final=Tn$1(e.final,r)),e}precommit(e){return e}postcommit(e){return u(Tn$1(e.explicits,e.elements).size===0,"Explicits must be subset of elements"),u(Tn$1(e.final,e.elements).size===0,"Final elements must be subset of elements"),e}commit(){let e=this.precommit(this.memory.mutableState());if(this.excluded.elements.size>0){const t=e.connections.filter(r=>this.excluded.elements.has(r.source)||this.excluded.elements.has(r.target)).flatMap(r=>[r,...wr(e.connections,r).map(y=>y.intersect(r))]).filter(r=>r.nonEmpty());this.excludeConnections(t)}return this.excluded.connections.length>0&&(e=this.removeConnections(e)),this.excluded.elements.size>0&&(e=this.removeElements(e)),e=this.moveDisconnectedExplicitsToImplicits(e),this.memory.update(this.postcommit(e))}}class Er{constructor(e,t){this.memory=e,this.expression=t}explicits=new Set;implicits=new Set;_ordered=new Set;_connections=[];get elements(){return this.explicits}get connections(){return this._connections}mergedConnections(){return ct([...this.memory.connections,...this._connections])}connectWithExisting(e,t){throw new Error("Method not implements, depends on the model")}_addExplicit(e){this._ordered.add(e),this.explicits.add(e),this.implicits.delete(e)}addExplicit(e){if(!e)return this;if(Bn(e)){for(const t of e)this._addExplicit(t);return this}return this._addExplicit(e),this}_addImplicit(e){this.explicits.has(e)||(this._ordered.add(e),this.implicits.add(e))}addImplicit(e){if(!e)return this;if(Bn(e)){for(const t of e)this._addImplicit(t);return this}return this._addImplicit(e),this}_addConnection(e){this._connections.push(e),this._addImplicit(e.source),this._addImplicit(e.target)}addConnections(e){if(Bn(e)){for(const t of e)this._addConnection(t);return this}return this._addConnection(e),this}isDirty(){return this.explicits.size>0||this.implicits.size>0||this._connections.length>0}isEmpty(){return!this.isDirty()}precommit(e){return e}postcommit(e){return e}processConnections(e){return e}commit(){let e=this.precommit(this.memory.mutableState()),t=new Set;if(this._connections.length>0){const[r,y]=Wt(this._connections,j=>e.final.has(j.source));e.connections=this.processConnections(ct([...e.connections,...r,...y])),t=new Set(e.connections.flatMap(j=>[j.source,j.target]))}return e.elements=Nn$1(e.elements,this._ordered,this.explicits,t,this.implicits),e.explicits=kn$1(e.elements,Nn$1(e.explicits,this.explicits)),e.final=kn$1(e.elements,Nn$1(e.final,this.explicits,t)),this.memory.update(this.postcommit(e))}}function kr(n,e="final"){const t=Sn$1(Cn$1(e==="final"?n.final:n.elements)),r=new Set(n.connections.flatMap(ne=>[ne.source,ne.target])),y=new Set(t),j=new sn$1(()=>null),re=t.reduce((ne,se,de,be)=>(ne.set(se,be.slice(de+1).filter(Ce=>ft(se,Ce)).map(Ce=>(y.delete(Ce),Ce)).reduce((Ce,Ie)=>(Ce.some(Oe=>ft(Oe,Ie))||(Ce.push(Ie),j.set(Ie,se)),Ce),[])),ne),new sn$1(()=>[]));return{root:y,connected:r,hasInOut:ne=>n.connections.some(exports.c.isAnyInOut(ne.id)),parent:ne=>j.get(ne),children:ne=>re.get(ne)}}let Us=class extends br{};B(n=>n.nonEmpty());function Fs(n){const e=new sn$1(()=>[]);for(const r of n)for(const y of r.relations.model)e.get(y).push(r);const t=new sn$1(()=>new Set);for(const[r,y]of e)Qt(y,2)&&xt$1(y,xe(j=>[{group:`$source-${j.source.id}`,conn:j},{group:`$target-${j.target.id}`,conn:j}]),jt(Se("group")),Ye(),B(Qt(2)),he(bt(jt$1(Se("conn")),mr("desc"),gn((j,re,ne)=>re===0||j.boundary===ne[re-1].boundary),he(j=>{t.get(j).add(r)}))));return t}function qs(n){n=ct(n);const e=Fs(n);for(const t of n){const{source:r,target:y}=t,j=t.relations.model;if(r.isDeploymentNode()!==y.isDeploymentNode()){const re=r.isDeploymentNode()?r:t.target;u(re.isDeploymentNode());const ne=re.internalModelRelationships(),se=kn$1(j,ne);for(const de of se)e.get(t).add(de);continue}if(r.isDeploymentNode()&&y.isDeploymentNode()){const re=Nn$1(kn$1(t.relations.model,r.internalModelRelationships()),kn$1(t.relations.model,y.internalModelRelationships()));for(const ne of re)e.get(t).add(ne)}}return xt$1(e.entries(),Ln$1(([t,r])=>t.update({model:r,deployment:null})),Cn$1())}function On(n){return ut(n,qs(n))}function Bs(n){return xt$1(n,ct,wt((e,t)=>{const{source:r,target:y,relations:j}=t;if(r.isInstance()&&y.isInstance())return e;let re=De.empty();if(r.isDeploymentNode()&&y.isDeploymentNode()){const[ne]=He(y,r,"directed");ne&&(re=j.intersect(ne.relations))}for(const ne of n)at(ne,t)&&(re=re.union(j.intersect(ne.relations)));return re.nonEmpty&&e.push(new Ae(r,y,re)),e},[]))}function Rn(n){return ut(n,Bs(n))}let Vs=class extends Er{connectWithExisting(n,e="both"){const t=this._connections.length,r=()=>this._connections.length>t;if(!Bn(n)){if(e==="in"||e==="both")for(const j of this.memory.elements)this.addConnections(He(j,n,"directed"));return(e==="out"||e==="both")&&this.addConnections(fe(n,this.memory.elements,"directed")),r()}const y=[...n];if(e==="in"||e==="both")for(const j of this.memory.elements)this.addConnections(fe(j,y,"directed"));if(e==="out"||e==="both")for(const j of y)this.addConnections(fe(j,this.memory.elements,"directed"));return r()}processConnections(n){const e=xt$1(n,On,Rn);return xt$1(e,he(({source:t,target:r,boundary:y})=>{xt$1(At([...Cn$1(t.ancestors()).reverse(),t],[...Cn$1(r.ancestors()).reverse(),r]),gn(([j,re])=>j===re),Yi(1),he(([j,re])=>{if(t===j&&r===re){this.addImplicit(y);return}j!==t&&j.isDeploymentNode()&&!j.onlyOneInstance()&&this.addImplicit(j),re!==r&&re.isDeploymentNode()&&!re.onlyOneInstance()&&this.addImplicit(re)}))})),e}},Ks=class zi extends fr{static empty(){return new zi({elements:new Set,explicits:new Set,final:new Set,connections:[]})}stageInclude(e){return new Vs(this,e)}stageExclude(e){return new Us(this,e)}mutableState(){return{elements:new Set(this.state.elements),explicits:new Set(this.state.explicits),final:new Set(this.state.final),connections:[...this.state.connections]}}update(e){return new zi({...this.state,...e})}equals(e){return e instanceof zi&&ls(this.state,e.state)}diff(e){const t=this;return{added:{elements:Cn$1(Tn$1(e.elements,t.elements)),explicits:Cn$1(Tn$1(e.explicits,t.explicits)),final:Cn$1(Tn$1(e.final,t.final)),connections:Cn$1(ut(e.connections,t.connections))},removed:{elements:Cn$1(Tn$1(t.elements,e.elements)),explicits:Cn$1(Tn$1(t.explicits,e.explicits)),final:Cn$1(Tn$1(t.final,e.final)),connections:ut(t.connections,e.connections)}}}toString(){return["final:",...[...this.final].map(e=>" "+e.id),"connections:",...this.connections.map(e=>" "+e.expression)].join(`
|
|
9
|
-
`)}[_n](e,t,r){return this.toString()}};function me(n){if(d(n)){const e=me(n.where.expr),t=f(n.where.condition);return r=>e(r)&&t(r)}if(p(n))return()=>!0;if(_(n))return n.isEqual?e=>e.kind===n.elementKind:e=>e.kind!==n.elementKind;if(D(n))return n.isEqual?({tags:e})=>!!e&&e.includes(n.elementTag):({tags:e})=>c(e)||!e.includes(n.elementTag);if(R(n))return e=>e.id===n.expanded||yn$2(e.id)===n.expanded;if(g(n)){const{element:e,isChildren:t,isDescendants:r}=n;return t||r?y=>y.id.startsWith(e+"."):y=>y.id===e}if(E(n))return me(n.custom.expr);a$1(n)}function Sr(n,e,t){xt$1(t,B(q(exports.i.isNodesGroup)),B(B$1(e)),he(r=>{r.shape=n.style.shape??r.shape,r.color=n.style.color??r.color,en$1(n.style.icon)&&(r.icon=n.style.icon),en$1(n.notation)&&(r.notation=n.notation);let y;en$1(n.style.border)&&(y={border:n.style.border}),en$1(n.style.opacity)&&(y={...y,opacity:n.style.opacity}),y&&(r.style={...r.style,...y})}))}function xr(n,e){for(const t of n){if(!an(t)||t.targets.length===0)continue;const r=t.targets.map(me);Sr(t,r,e)}return e}function Ys(n,e){let t;for(;n.parent&&(t=e.get(n.parent));){const r=t.depth??1;if(t.depth=Math.max(r,(n.depth??0)+1),t.depth===r)break;n=t}}const Hs=n=>({...n,modelRef:1});function Xs(n,e){return Nn(n.map(Hs),e)}function Nn(n,e){const t=new Map,r=new Map;e?.forEach(({id:j,parent:re,viewRule:ne,elements:se})=>{re&&i(t.get(re),`Parent group node ${re} not found`).children.push(j),t.set(j,{id:j,parent:re,kind:a.Group,title:ne.title??"",color:ne.color??"muted",shape:"rectangle",children:[],inEdges:[],outEdges:[],level:0,depth:0,description:null,technology:null,tags:null,links:null,style:{border:ne.border??"dashed",opacity:ne.opacity??0}});for(const de of se)r.set(de.id,j)}),Array.from(n).sort(_n$1).forEach(({id:j,style:re,kind:ne,title:se,color:de,shape:be,...Ce})=>{let Ie=yn$2(j),Oe=0,we;for(;Ie&&(we=t.get(Ie),!we);)Ie=yn$2(Ie);!we&&r.has(j)&&(Ie=r.get(j),we=t.get(Ie)),we&&(we.children.length==0&&(we.depth=1,Ys(we,t)),we.children.push(j),Oe=we.level+1);const Te={id:j,parent:Ie,kind:ne,title:se,level:Oe,color:de??Z$1,shape:be??F,description:null,technology:null,tags:null,links:null,children:[],inEdges:[],outEdges:[],...Ce,style:{...re}};t.set(j,Te)});const y=new Map;return e?.forEach(({id:j})=>{y.set(j,i(t.get(j)))}),n.forEach(({id:j})=>{y.set(j,i(t.get(j)))}),y}function Js(n){const{title:e,description:t=null,technology:r=null,kind:y=null,color:j=null,line:re=null,head:ne=null,tail:se=null,navigateTo:de=null}=n;return{...e&&{title:e,description:t},technology:r,kind:y,color:j,line:re,head:ne,tail:se,navigateTo:de}}function _r(n,e){const t=xt$1(n,wt((ne,se)=>(X(se.title)&&!ne.title.includes(se.title)&&ne.title.push(se.title),X(se.description)&&!ne.description.includes(se.description)&&ne.description.push(se.description),X(se.technology)&&!ne.technology.includes(se.technology)&&ne.technology.push(se.technology),X(se.kind)&&!ne.kind.includes(se.kind)&&ne.kind.push(se.kind),X(se.color)&&!ne.color.includes(se.color)&&ne.color.push(se.color),X(se.line)&&!ne.line.includes(se.line)&&ne.line.push(se.line),X(se.head)&&!ne.head.includes(se.head)&&ne.head.push(se.head),X(se.tail)&&!ne.tail.includes(se.tail)&&ne.tail.push(se.tail),X(se.navigateTo)&&!ne.navigateTo.includes(se.navigateTo)&&ne.navigateTo.push(se.navigateTo),se.tags&&ne.tags.push(...se.tags),se.links&&ne.links.push(...se.links),ne),{title:[],description:[],technology:[],kind:[],head:[],tail:[],color:[],tags:[],links:[],line:[],navigateTo:[]}));let r=K(t.technology),y=K(t.title)??(t.title.length>1?"[...]":null);const j=ze(t.tags);let re=hn({title:y??(r?`[${r}]`:null),description:K(t.description),technology:r,kind:K(t.kind),head:K(t.head),tail:K(t.tail),color:K(t.color),line:K(t.line),navigateTo:K(t.navigateTo),...gn$2(t.links)&&{links:t.links},...gn$2(j)&&{tags:j}},X);return e?{...re,...hn(Js(e),X)}:re}function Qs(n){const e=xt$1(n,xe(t=>t.tags??[]),ze(),ln(Tt));return Qt(e,1)?e:null}function Ge(n,e){const t=n.element(e.ref.deployment);if(t.isDeploymentNode()){if(e.selector==="children")return[...t.children()];if(e.selector==="expanded")return[t,...t.children()];if(e.selector==="descendants")return[...t.descendants()]}return[t]}function kt(n,e){const t=n.$model.element(e.ref.model);return e.selector==="children"?[...t.children()]:e.selector==="expanded"?[t,...t.children()]:e.selector==="descendants"?[...t.descendants()]:[t]}function Bt(n){if(exports.ab.isWildcard(n))return()=>!0;if(exports.ab.isDeploymentRef(n)){const e=n.ref.deployment;if(n.selector==="expanded"){const t=e+".";return r=>r.id===e||r.id.startsWith(t)}if(n.selector==="descendants"){const t=e+".";return r=>r.id.startsWith(t)}return n.selector==="children"?t=>yn$2(t.id)===e:t=>t.id===e}if(exports.ab.isModelRef(n)){const e=r=>ot$1(r.modelRef)?r.modelRef:us(r.modelRef)?r.id:null,t=n.ref.model;if(n.selector==="expanded"){const r=t+".";return y=>{const j=e(y);return j?j===t||j.startsWith(r):!0}}if(n.selector==="descendants"){const r=t+".";return y=>{const j=e(y);return j?j.startsWith(r):!0}}return n.selector==="children"?r=>{const y=e(r);return y?yn$2(y)===t:!0}:r=>{const y=e(r);return y?y===t:!0}}a$1(n)}function $r(n){if(n.isDeploymentNode()){const de=n.onlyOneInstance();let{title:be,kind:Ce,id:Ie,...Oe}=n.$node;const{icon:we,color:Te,shape:ke,...Ve}=n.$node.style??{};return de&&be===mn$2(n.id)&&(be=de.title),{...de&&{...$r(de),modelRef:de.element.id},title:be,...Oe,...we&&{icon:we},...Te&&{color:Te},...ke&&{shape:ke},style:{...Ve},deploymentRef:1,kind:Ce,id:Ie}}u(n.isInstance(),"Expected Instance");const e=n.$instance,t=n.element.$element,r=e.style?.icon??t.icon,y=e.style?.color??t.color,j=e.style?.shape??t.shape,re=[...t.links??[],...e.links??[]],ne={...t.metadata,...e.metadata},se=e.notation??t.notation;return{id:n.id,kind:"instance",title:e.title??t.title,description:e.description??t.description,technology:e.technology??t.technology,tags:Qs([t,e]),links:Qt(re,1)?re:null,...r&&{icon:r},...y&&{color:y},...j&&{shape:j},style:{...t.style,...e.style},deploymentRef:n.id===e.id?1:e.id,modelRef:n.id===t.id?1:t.id,...se&&{notation:se},...!Pe(ne)&&{metadata:ne}}}function Zs(n){return n.reduce((e,t)=>{const r=[...t.relations.model,...t.relations.deployment];u(Qt(r,1),"Edge must have at least one relation");const y=t.source.id,j=t.target.id,{title:re,...ne}=_r(r.map(be=>be.$relationship)),se={id:t.id,parent:t.boundary?.id??null,source:y,target:j,label:re??null,relations:r.map(be=>be.id),...ne},de=e.find(be=>be.source===j&&be.target===y);if(de&&se.label===de.label){de.dir="both";const be=de.head??se.head??tn;return de.head??=be,de.tail??=be,se.color&&(de.color??=se.color),se.line&&(de.line??=se.line),e}return e.push(se),e},[])}function ea(n){return Nn([...n.final].map($r))}function ta(n,e){for(const t of n){if(!an(t)||t.targets.length===0)continue;const r=t.targets.map(Bt);Sr(t,r,e)}return e}const na={include:n=>{const{expr:e}=n,t=n.model.element(e.ref.deployment);if(Kr(t))return n.stage.addExplicit(t),n.stage.connectWithExisting(t),n.stage;switch(!0){case e.selector==="expanded":ra(t,n);break;case e.selector==="children":ia(t,n);break;case e.selector==="descendants":oa(t,n);break;default:n.stage.addExplicit(t),n.stage.connectWithExisting(t)}return n.stage},exclude:({expr:n,stage:e,memory:t})=>{const r=Bt(n);return e.exclude([...t.elements].filter(r)),e}};function ia(n,{stage:e}){const t=[...n.children()];t.length!==0&&(e.addImplicit(n),e.addConnections(lt(t)),e.connectWithExisting(t),e.addExplicit(t))}function ra(n,{memory:e,stage:t}){const r=[...n.children()];t.addImplicit(n),t.connectWithExisting(n);let y=!1;for(const j of r)if(fe(j,e.elements).length>0){y=!0;break}y&&(t.connectWithExisting(r,"in"),t.addConnections(lt(r)),t.connectWithExisting(r,"out")),t.addImplicit(r),t.connections.length>0&&t.addExplicit(n)}function oa(n,{stage:e}){const t=j=>{const re=[];for(const ne of j.children())ne.isDeploymentNode()&&re.push(...t(ne)),re.push(ne);return e.connectWithExisting(re,"in"),e.addConnections(lt(re)),e.addImplicit(re),re},r=t(n);if(r.length===0)return;e.connectWithExisting(r,"out");const y=sa(e);r.forEach(j=>{y.has(j)&&e.addExplicit(j)})}function sa(n){return xt$1(n.mergedConnections(),On,Rn,wt((e,t)=>(e.add(t.source),e.add(t.target),e),new Set))}const aa={include:({expr:n,model:e,memory:t,stage:r,where:y})=>{const j=[...t.elements];if(exports.ab.isWildcard(n.outgoing)){for(const ne of j)if(!ne.allIncoming.isEmpty)for(const se of _t(ne)){const de=ye(He(se,ne,"directed"),y);r.addConnections(de)}return r}u(exports.ab.isDeploymentRef(n.outgoing),"Only deployment refs are supported in include");const re=Ge(e,n.outgoing);for(const ne of re){const se=ye(fe(ne,j,"directed"),y);r.addConnections(se)}return r},exclude:({expr:n,model:e,memory:t,stage:r,where:y})=>{if(exports.ab.isModelRef(n.outgoing)){const ne=Mn(e,n.outgoing);return Xe(ne,{stage:r,memory:t},y)}if(exports.ab.isWildcard(n.outgoing))return r;const j=St(Ge(e,n.outgoing)),re=xt$1(t.connections,B(j),ye(y));return r.excludeConnections(re),r}};function St(n){return B$1(n.map(e=>{const t=r=>r===e||ft(e,r);return r=>t(r.source)&&!t(r.target)}))}function Mn(n,e){const t=kt(n,e);return new Set(t.flatMap(r=>[...r.allOutgoing]))}const ca={include:({expr:n,model:e,memory:t,stage:r,where:y})=>{const j=[...t.elements];if(exports.ab.isWildcard(n.inout)){for(const ne of j){const se=[..._t(ne)],de=Ir(fe(ne,se,"both"),y);r.addConnections(de)}return r}u(exports.ab.isDeploymentRef(n.inout),"Only deployment refs are supported in include");const re=Ge(e,n.inout);for(const ne of j){const se=Ir(fe(ne,re,"both"),y);r.addConnections(se)}return r},exclude:({expr:n,model:e,memory:t,stage:r,where:y})=>{if(exports.ab.isModelRef(n.inout)){const de=kt(e,n.inout);if(de.length===0)return r;const be=Nn$1(new Set,...de.flatMap(Ce=>[Ce.allIncoming,Ce.allOutgoing]));return Xe(be,{stage:r,memory:t},y)}if(exports.ab.isWildcard(n.inout))return r;const j=Ge(e,n.inout),re=xt(j),ne=St(j),se=xt$1(t.connections,B(de=>re(de)!==ne(de)),ye(y));return r.excludeConnections(se),r}},ua={include:({expr:n,model:e,memory:t,stage:r})=>{const y=f(n.where.condition);return Ln("include",{expr:n.where.expr,model:e,stage:r,memory:t,where:y})},exclude:({expr:n,model:e,memory:t,stage:r})=>{const y=f(n.where.condition);return Ln("exclude",{expr:n.where.expr,model:e,stage:r,memory:t,where:y})}},da={include:({model:n,stage:e})=>{const t=[],r=[...n.roots()].map(y=>(y.onlyOneInstance()||t.push(...y.children()),y));return e.addExplicit(r),t.length>1&&e.addConnections(lt([...r,...t])),e},exclude:({stage:n,memory:e})=>(n.exclude(e.elements),n)};function Ln(n,{expr:e,where:t,...r}){switch(!0){case exports.ab.isModelRef(e):return;case exports.ab.isDeploymentRef(e):return na[n]({...r,expr:e,where:t});case exports.ab.isWildcard(e):return da[n]({...r,expr:e,where:t});case s.isDirect(e):return pa[n]({...r,expr:e,where:t});case s.isInOut(e):return ca[n]({...r,expr:e,where:t});case s.isOutgoing(e):return aa[n]({...r,expr:e,where:t});case s.isIncoming(e):return fa[n]({...r,expr:e,where:t});case s.isWhere(e):return ua[n]({...r,expr:e,where:t});default:a$1(e)}}function Xe(n,{stage:e,memory:t},r,y=()=>!0){if(n.size===0)return e;const j=xt$1(t.connections,B(re=>y(re)),B(re=>On$1(re.relations.model,n)),jt$1(re=>re.update({deployment:null,model:kn$1(re.relations.model,n)})),ye(r),B(re=>re.nonEmpty()));return j.length===0?e:e.excludeConnections(j)}function la(n,e){return ye(n,e).nonEmpty()}function ye(...n){if(n.length===1)return y=>ye(y,n[0]);const[e,t]=n;if(t===null)return e;if(x(e))return e.map(y=>ye(y,t)).filter(y=>y.nonEmpty());const r=ha(e.source,e.target);return e.update({model:new Set([...e.relations.model.values()].filter(y=>t(r(y)))),deployment:new Set([...e.relations.deployment.values()].filter(y=>t(r(y))))})}function Ir(n,e){return e?xt$1(n,B(t=>la(t,e))):n}function Gr(n){return vt(n,["tags","kind"])}function ha(n,e){return t=>({tags:t.tags,kind:t.kind,source:Gr(n),target:Gr(e)})}const fa={include:({expr:n,model:e,memory:t,stage:r,where:y})=>{const j=[...t.elements];if(exports.ab.isWildcard(n.incoming)){for(const ne of j){if(ne.allOutgoing.isEmpty)continue;const se=[..._t(ne)],de=ye(fe(ne,se,"directed"),y);r.addConnections(de)}return r}u(exports.ab.isDeploymentRef(n.incoming),"Only deployment refs are supported in include");const re=Ge(e,n.incoming);for(const ne of j){const se=ye(fe(ne,re,"directed"),y);r.addConnections(se)}return r},exclude:({expr:n,model:e,memory:t,stage:r,where:y})=>{if(exports.ab.isModelRef(n.incoming)){const ne=Ar(e,n.incoming);return Xe(ne,{stage:r,memory:t},y)}if(exports.ab.isWildcard(n.incoming))return r;const j=xt(Ge(e,n.incoming)),re=xt$1(t.connections,B(j),ye(y));return r.excludeConnections(re),r}};function xt(n){return B$1(n.map(e=>{const t=r=>r===e||ft(e,r);return r=>!t(r.source)&&t(r.target)}))}function Ar(n,e){const t=kt(n,e);return new Set(t.flatMap(r=>[...r.allIncoming]))}const _t=n=>{const e=new Set;for(let t of n.descendingSiblings())e.add(t);return e},pa={include:({expr:{source:n,target:e,isBidirectional:t=!1},model:r,stage:y,where:j})=>{u(!exports.ab.isModelRef(n),"Invalid source model ref in direct relation"),u(!exports.ab.isModelRef(e),"Invalid target model ref in direct relation");const re=exports.ab.isWildcard(n),ne=exports.ab.isWildcard(e),se=t?"both":"directed";let de;switch(!0){case(re&&ne):{de=lt(r.instances()).map(be=>(y.addImplicit(be.boundary),be));break}case(!re&&ne):{const be=Ge(r,n),Ce=St(be);let Ie=Ce;if(t){const Oe=xt(be);Ie=we=>Ce(we)!==Oe(we)}de=be.flatMap(Oe=>{const we=_t(Oe);return fe(Oe,we,se)}).filter(Ie);break}case(re&&!ne):{const be=Ge(r,e),Ce=xt(be);let Ie=Ce;if(t){const Oe=St(be);Ie=we=>Oe(we)!==Ce(we)}de=be.flatMap(Oe=>[..._t(Oe)].flatMap(we=>He(we,Oe,se))).filter(Ie);break}default:{u(!re,"Inferrence failed - source should be a deployment ref"),u(!ne,"Inferrence failed - target should be a deployment ref");const be=Ge(r,n),Ce=Ge(r,e),Ie=St(be),Oe=xt(Ce);de=xt$1(be,xe(we=>Or(fe(we,Ce,se),j)),B(we=>Ie(we)&&Oe(we)))}}return y.addConnections(de),exports.ab.isDeploymentRef(n)&&Ct(n.selector)&&y.addImplicit(r.element(n.ref.deployment)),exports.ab.isDeploymentRef(e)&&Ct(e.selector)&&y.addImplicit(r.element(e.ref.deployment)),y},exclude:({expr:n,model:e,memory:t,stage:r,where:y})=>{const j=Bt(n.target),re=Bt(n.source);let ne;switch(!0){case(exports.ab.isWildcard(n.source)&&exports.ab.isWildcard(n.target)):return r.excludeConnections(Or(t.connections,y)),r;case(exports.ab.isModelRef(n.source)&&exports.ab.isModelRef(n.target)):return ne=ga({source:n.source,target:n.target,expr:n,model:e}),Xe(ne,{stage:r,memory:t},y);case(exports.ab.isModelRef(n.source)&&exports.ab.isWildcard(n.target)):return ne=Mn(e,n.source),Xe(ne,{stage:r,memory:t},y);case exports.ab.isModelRef(n.source):return ne=Mn(e,n.source),Xe(ne,{stage:r,memory:t},y,be=>j(be.target));case exports.ab.isModelRef(n.target):return ne=Ar(e,n.target),Xe(ne,{stage:r,memory:t},y,be=>re(be.source));default:const se=be=>re(be.source)&&j(be.target)||n.isBidirectional===!0&&re(be.target)&&j(be.source),de=xt$1(t.connections,B(se),ye(y));return de.length===0||r.excludeConnections(de),r}}};function ga({source:n,target:e,expr:t,model:r}){const y=kt(r,n),j=kt(r,e),re=t.isBidirectional?"both":"directed",ne=[];for(const se of y)ne.push(...oe(se,j,re));return new Set(ne.flatMap(se=>[...se.relations]))}function Dr(n){return vt(n,["tags","kind"])}function Cr(n,e){return t=>({tags:t.tags,kind:t.kind,source:Dr(n),target:Dr(e)})}function ma(n,e){return e?[...Array.from(n.relations.deployment.values()).map(Cr(n.source,n.target)),...Array.from(n.relations.model.values()).map(Cr(n.source,n.target))].filter(e).length>0:!0}function Or(n,e){return e?xt$1(n,B(t=>ma(t,e))):n}let ya=class io{constructor(e){this.memory=e}static for(e){return new io(e)}step1CleanConnections(e){if(e.connections.length<2)return e;const t=xt$1(e.connections,On,Rn),r=ut(e.connections,t);if(r.length===0)return e;const y=e.stageExclude({});return y.excludeConnections(r,!0),y.commit()}step2ProcessImplicits(e){const t=Nn$1(this.memory.elements,e.elements),r=Nn$1(e.final,this.memory.explicits),y=new sn$1(()=>new Set);for(const ne of e.connections)if(ne.boundary)for(const se of ne.relations.model)y.get(se).add(ne.boundary);for(const[ne,se]of y)if(!(se.size<2))for(const de of se)t.delete(de)&&r.add(de);const j=new Set(r),re=ne=>{for(const se of j)if(ne===se||ft(ne,se))return!0;return!1};return xt$1(Tn$1(t,j),xn$1(ne=>ne.isDeploymentNode()),Cn$1(),En$2,he(ne=>{const se=[...ne.children()].filter(re).length;if(se>=2){r.add(ne);return}se===1&&jn$1(ne.siblings(),re)&&r.add(ne)})),e.update({final:r})}step3ProcessBoundaries(e){const t=new Set;for(const ne of e.connections)ne.boundary&&t.add(ne.boundary);const r=kr(e,"final"),y=e.stageExclude({}),j=ne=>!(t.has(ne)||e.explicits.has(ne)||r.hasInOut(ne)||r.root.has(ne)),re=K([...r.root]);re&&!e.explicits.has(re)&&y.exclude(re);for(const ne of e.final){const se=K(r.children(ne));se&&!r.hasInOut(se)&&j(ne)&&y.exclude(ne)}return y.isDirty()?y.commit():e}commit(){const e=this.step1CleanConnections(this.memory),t=this.step2ProcessImplicits(e);return this.step3ProcessBoundaries(t)}};function wa(n,e){let t=Ks.empty();for(const r of e)if(sn(r)){const y="include"in r?"include":"exclude",j=r.include??r.exclude;for(const re of j){let ne=y==="include"?t.stageInclude(re):t.stageExclude(re);ne=Ln(y,{expr:re,model:n,stage:ne,memory:t,where:null})??ne,t=ne.commit()}}return ya.for(t).commit()}function va(n,{docUri:e,rules:t,...r}){const y=wa(n.deployment,t),j=ea(y),re=Zs(y.connections);er(j,re);const ne=hr({nodes:j,edges:re}),se=ta(t,ne.nodes),de=pn(t,cn),be=wn(se);return xn({...r,autoLayout:{direction:de?.direction??"TB",...de?.nodeSep&&{nodeSep:de.nodeSep},...de?.rankSep&&{rankSep:de.rankSep}},edges:ne.edges,nodes:jt$1(se,Ce=>(delete Ce.notation,Ce.icon==="none"&&delete Ce.icon,Ce)),...be.length>0&&{notation:{elements:be}}})}function Tn(n){return e=>dn$1(e)?e.groupRules.flatMap(Tn(n)):sn(e)?"include"in e?e.include.filter(n):[]:[]}function Rr(n,e){const t=n.flatMap(Tn(E));if(t.length===0)return e;const r=[...e];for(const{custom:{expr:y,...j}}of t){const{border:re,opacity:ne,...se}=Qi(j,c),de=!Pe(se),be=me(y);r.forEach((Ce,Ie)=>{if(exports.i.isNodesGroup(Ce)||!be(Ce))return;de&&(Ce={...Ce,isCustomized:!0,...se});let Oe;re!==void 0&&(Oe={border:re}),ne!==void 0&&(Oe={...Oe,opacity:ne}),Oe&&(Ce={...Ce,isCustomized:!0,style:{...Ce.style,...Oe}}),r[Ie]=Ce})}return r}function ba(n,e){return n.reduce((t,r)=>{if(un(r)){const y=e.predicates[r.predicateId];return c(y)?t:t.concat(y)}if(on(r)){const y=e.styles[r.styleId];return c(y)?t:t.concat(y)}return t.push(r),t},[])}function Ea(n,e){return n.reduce((t,r)=>{if(un(r)){const y=e.dynamicPredicates[r.predicateId];return c(y)?t:t.concat(y)}if(on(r)){const y=e.styles[r.styleId];return c(y)?t:t.concat(y)}return t.push(r),t},[])}class ka{constructor(e,t){this.model=e,this.view=t}explicits=new Set;steps=[];addStep({source:e,target:t,title:r,isBackward:y,navigateTo:j,...re},ne,se){const de=se?En$1(se,ne):En$1(ne),be=this.model.element(e),Ce=this.model.element(t);this.explicits.add(be),this.explicits.add(Ce);const{title:Ie,relations:Oe,tags:we,navigateTo:Te,head:ke,tail:Ve,color:Vn,line:Ze,notation:Qe}=this.findRelations(be,Ce),Jn=X(j)&&j!==this.view.id?j:Te;this.steps.push({id:de,...re,source:be,target:Ce,title:r??Ie,relations:Oe??[],isBackward:y??!1,...Jn?{navigateTo:Jn}:{},...we?{tags:we}:{},...ke?{head:ke}:{},...Ve?{tail:Ve}:{},...Vn?{color:Vn}:{},...Ze?{line:Ze}:{},...Qe?{notation:Qe}:{}})}compute(){const{docUri:e,rules:t,steps:r,...y}=this.view;let j=1;for(const Oe of r){if(mn$1(Oe)){if(Oe.__parallel.length===0)continue;Oe.__parallel.length===1?this.addStep(Oe.__parallel[0],j):Oe.__parallel.forEach((we,Te)=>this.addStep(we,Te+1,j))}else this.addStep(Oe,j);j++}const re=Ea(t,this.model.globals());for(const Oe of re)if(sn(Oe))for(const we of Oe.include){const Te=me(we);for(const ke of this.model.elements())Te(ke)&&this.explicits.add(ke)}const ne=[...this.explicits].map(Oe=>Oe.$element),se=Xs(ne),de=this.steps.map(({source:Oe,target:we,relations:Te,title:ke,isBackward:Ve,...Vn})=>{const Ze=i(se.get(Oe.id),`Source node ${Oe.id} not found`),Qe=i(se.get(we.id),`Target node ${we.id} not found`),Jn={parent:qt$1(Oe.id,we.id),source:Oe.id,target:we.id,label:ke,relations:Te,color:rn,line:en,head:tn,...Vn};for(Ve&&(Jn.dir="back");Jn.parent&&!se.has(Jn.parent);)Jn.parent=yn$2(Jn.parent);Ze.outEdges.push(Jn.id),Qe.inEdges.push(Jn.id);for(const ve of bn$1(Jn.source)){if(ve===Jn.parent)break;se.get(ve)?.outEdges.push(Jn.id)}for(const ve of bn$1(Jn.target)){if(ve===Jn.parent)break;se.get(ve)?.inEdges.push(Jn.id)}return Jn}),be=Rr(re,xr(re,ne.map(Oe=>i(se.get(Oe.id))))),Ce=pn(re,cn),Ie=wn(be);return xn({...y,autoLayout:{direction:Ce?.direction??"LR",...Ce?.nodeSep&&{nodeSep:Ce.nodeSep},...Ce?.rankSep&&{rankSep:Ce.rankSep}},nodes:jt$1(be,Oe=>(delete Oe.notation,Oe.icon==="none"&&delete Oe.icon,Oe)),edges:de,...Ie.length>0&&{notation:{elements:Ie}}})}findRelations(e,t){const r=dt(e,t,"directed").flatMap(be=>[...be.relations]);if(r.length===0)return{title:null,tags:null,relations:null,navigateTo:null,tail:null,head:null,color:null,line:null,notation:null};const y=xt$1(r,xe(be=>be.tags),B(X),ze()),j=Qt(y,1)?y:null,re=Qt(r,1)?jt$1(r,be=>be.id):null,ne=(K(r)||r.find(be=>be.source===e&&be.target===t))?.$relationship.navigateTo??null,se=ne&&ne!==this.view.id?ne:xt$1(r,jt$1(be=>be.$relationship.navigateTo),B(X),B(be=>be!==this.view.id),ze(),K()),de=xt$1(r,wt((be,{title:Ce,$relationship:Ie})=>(X(Ce)&&be.title.add(Ce),X(Ie.tail)&&be.tail.add(Ie.tail),X(Ie.head)&&be.head.add(Ie.head),X(Ie.color)&&be.color.add(Ie.color),X(Ie.line)&&be.line.add(Ie.line),be),{tail:new Set,head:new Set,color:new Set,line:new Set,notation:new Set,title:new Set}));return{tags:j,relations:re,navigateTo:se??null,title:K([...de.title])??null,tail:K([...de.tail])??null,head:K([...de.head])??null,color:K([...de.color])??null,line:K([...de.line])??null,notation:K([...de.notation])??null}}}function Sa(n,e){return new ka(n,e).compute()}function Nr(n){switch(!0){case O(n):{const e=Nr(n.where.expr),t=f(n.where.condition);return r=>e(r)&&t(r)}case h(n):{const e=me(n.source),t=me(n.target);return r=>e(r.source)&&t(r.target)||!!n.isBidirectional&&e(r.target)&&t(r.source)}case w(n):{const e=me(n.inout);return t=>e(t.source)||e(t.target)}case A(n):{const e=me(n.incoming);return t=>e(t.target)}case I(n):{const e=me(n.outgoing);return t=>e(t.source)}default:a$1(n)}}function xa(n,e,t){const r=n.flatMap(Tn(k)),y=Array.from(t);if(r.length===0||y.length===0)return y;for(const{customRelation:{relation:j,title:re,...ne}}of r){const se=Qi(ne,c),de=Nr(j);y.forEach((be,Ce)=>{const Ie=e.find(we=>we.id===be.source),Oe=e.find(we=>we.id===be.target);!Ie||!Oe||de({source:Ie,target:Oe,...vt(be,["kind","tags"])})&&(y[Ce]={...be,...se,label:re??be.label,isCustomized:!0})})}return y}var zn,Mr;function _a(){if(Mr)return zn;Mr=1;var n=an$1(),e=ln$2();function t(){this.clear()}return t.prototype.clear=function(){this.items=[],this.size=0},t.prototype.push=function(r){return this.items.push(r),++this.size},t.prototype.pop=function(){if(this.size!==0)return this.size--,this.items.pop()},t.prototype.peek=function(){return this.items[this.size-1]},t.prototype.forEach=function(r,y){y=arguments.length>1?y:this;for(var j=0,re=this.items.length;j<re;j++)r.call(y,this.items[re-j-1],j,this)},t.prototype.toArray=function(){for(var r=new Array(this.size),y=this.size-1,j=this.size;j--;)r[j]=this.items[y-j];return r},t.prototype.values=function(){var r=this.items,y=r.length,j=0;return new n(function(){if(j>=y)return{done:!0};var re=r[y-j-1];return j++,{value:re,done:!1}})},t.prototype.entries=function(){var r=this.items,y=r.length,j=0;return new n(function(){if(j>=y)return{done:!0};var re=r[y-j-1];return{value:[j++,re],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var r=this.toArray();return Object.defineProperty(r,"constructor",{value:t,enumerable:!1}),r},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(r){var y=new t;return e(r,function(j){y.push(j)}),y},t.of=function(){return t.from(arguments)},zn=t,zn}var $a=_a();const Lr=st$1($a);class It{constructor(e,t,r=null,y=new Set){this.id=e,this.viewRule=t,this.parent=r,this.elements=y}static kind=a.Group;isEmpty(){return this.elements.size===0}update(e){return new It(this.id,this.viewRule,this.parent,e)}clone(){return new It(this.id,this.viewRule,this.parent,new Set(this.elements))}}class Tr extends br{excludeRelations(e){return xt$1(this.memory.connections,B(t=>On$1(t.relations,e)),he(t=>{this.excludeConnections(t.update(kn$1(t.relations,e)))})),this}precommit(e){if(this.excluded.elements.size>0){const t=new Set([...this.excluded.elements].flatMap(r=>[...r.incoming("direct"),...r.outgoing("direct")]));this.excludeRelations(t)}return e}postcommit(e){const t=Tn$1(this.memory.explicits,e.explicits);for(const y of t)e.explicitFirstSeenIn.delete(y);const r=Tn$1(this.memory.elements,e.elements);for(const y of r)e.lastSeenIn.delete(y);return e}}class Ia extends Tr{constructor(e,t){super(e,t),this.memory=e,this.expression=t}}class zr extends Er{connectWithExisting(e,t="both"){const r=this._connections.length,y=()=>this._connections.length>r;if(!Bn(e)){if(t==="in"||t==="both")for(const re of this.memory.elements)this.addConnections(dt(re,e,"directed"));return(t==="out"||t==="both")&&this.addConnections(oe(e,this.memory.elements,"directed")),y()}const j=[...e];if(t==="in"||t==="both")for(const re of this.memory.elements)this.addConnections(oe(re,j,"directed"));if(t==="out"||t==="both")for(const re of j)this.addConnections(oe(re,this.memory.elements,"directed"));return y()}addImplicitWithinScope(e){e&&(!this.memory.scope||ft(this.memory.scope,e))&&this.addImplicit(e)}processConnections(e){return K$1(this.expression)||xt$1(e,he(({source:t,target:r,boundary:y})=>{xt$1(At([...Cn$1(t.ancestors()).reverse(),t],[...Cn$1(r.ancestors()).reverse(),r]),gn(([j,re])=>j===re),Yi(1),he(([j,re])=>{if(j===t&&re===r){this.addImplicitWithinScope(y);return}j!==t&&this.addImplicitWithinScope(j),re!==r&&this.addImplicitWithinScope(re)}))})),e}postcommit(e){const t=Tn$1(e.explicits,this.memory.explicits);for(const r of t)e.explicitFirstSeenIn.set(r,"@root");return e}}class Ga extends zr{constructor(e,t){super(e,t),this.memory=e,this.expression=t}postcommit(e){const t=Tn$1(e.explicits,this.memory.explicits);for(const r of t)e.explicitFirstSeenIn.set(r,this.memory.activeGroupId);for(const r of[...this.explicits,...this.implicits])e.lastSeenIn.set(r,this.memory.activeGroupId);return e}}class Je extends fr{constructor(e,t){super(e),this.state=e,this.scope=t}static empty(e){return new Je({elements:new Set,explicits:new Set,final:new Set,connections:[],groups:[],explicitFirstSeenIn:new Map,lastSeenIn:new Map},e)}get groups(){return this.state.groups}get explicitFirstSeenIn(){return this.state.explicitFirstSeenIn}get lastSeenIn(){return this.state.lastSeenIn}stageInclude(e){return new zr(this,e)}stageExclude(e){return new Tr(this,e)}mutableState(){return{elements:new Set(this.state.elements),explicits:new Set(this.state.explicits),final:new Set(this.state.final),connections:[...this.state.connections],groups:this.state.groups.map(e=>e.clone()),explicitFirstSeenIn:new Map(this.state.explicitFirstSeenIn),lastSeenIn:new Map(this.state.lastSeenIn)}}update(e){return new Je({...this.state,...e},this.scope)}}class je extends Je{constructor(e,t,r){super(e,t),this.state=e,this.scope=t,this.stack=r}static enter(e,t){const r=`@gr${e.groups.length+1}`;if(e instanceof je){const re=Lr.from(e.stack),ne=e.mutableState();return ne.groups.push(new It(r,t,e.activeGroupId)),re.push(r),new je(ne,e.scope,re)}const y=e.mutableState();y.groups.push(new It(r,t,null));const j=Lr.of(r);return new je(y,e.scope,j)}get activeGroupId(){return i(this.stack.peek(),"Stack must not be empty")}mutableState(){return{...super.mutableState()}}update(e){const t={...this.state,...e};return new je(t,this.scope,this.stack)}stageInclude(e){return new Ga(this,e)}stageExclude(e){return new Ia(this,e)}leave(){const e=this.mutableState();return this.stack.pop(),this.stack.peek()?new je(e,this.scope,this.stack):new Je(e,this.scope)}}function Aa(n){return xt$1([...n],ct,wt((e,t,r,y)=>{const j=vr(y,t),re=Nn$1(...j.map(Se("relations")));let ne=kn$1(t.relations,re);if(j.length>0&&(ne=Nn$1(ne,t.directRelations)),Gn(y,t.reversed(!1))&&(ne=Nn$1(ne,t.directRelations)),ne.size<t.relations.size){const se=y.some(qt(t.source)),de=y.some(qt(t.target));se&&(ne=Nn$1(ne,zn$1(xn$1(t.relations,Dn(t.source))))),de&&(ne=Nn$1(ne,zn$1(xn$1(t.relations,Cn(t.target)))))}return ne.size>0&&e.push(t.update(ne)),e},[]))}class Fn{constructor(e){this.memory=e}static for(e){return new Fn(e)}step1CleanConnections(e){if(e.connections.length<2)return e;const t=Aa(e.connections);if(t.length===0)return e;const r=e.stageExclude({});return r.excludeConnections(t,!0),r.commit()}step2ProcessImplicits(e){const t=Nn$1(this.memory.elements,e.elements),r=Nn$1(e.final,this.memory.explicits),y=new Set(r),j=re=>{for(const ne of y)if(re===ne||ft(re,ne))return!0;return!1};return xt$1(Tn$1(t,y),Cn$1(),En$2,he(re=>{const ne=[...re.children()].filter(j).length;if(ne>=2){r.add(re);return}ne===1&&jn$1(re.siblings(),j)&&r.add(re)})),e.update({final:r})}step3ProcessBoundaries(e){const t=new Set;for(const ne of e.connections)ne.boundary&&ne.boundary!==ne.source&&ne.boundary!==ne.target&&t.add(ne.boundary);const r=kr(e,"final"),y=e.stageExclude({}),j=ne=>!(t.has(ne)||e.explicits.has(ne)||r.hasInOut(ne)||r.root.has(ne)),re=K([...r.root]);re&&!e.explicits.has(re)&&y.exclude(re);for(const ne of e.final){const se=K(r.children(ne));se&&!r.hasInOut(se)&&j(ne)&&y.exclude(ne)}return y.isDirty()?y.commit():e}commit(){const e=this.step1CleanConnections(this.memory),t=this.step2ProcessImplicits(e);return this.step3ProcessBoundaries(t)}}const Da={include:({expr:n,model:e,stage:t,where:r})=>{const y=e.element(n.expanded);r(y)&&(t.addExplicit(y),t.connectWithExisting(y));const j=[...y.children()].filter(r),re=[];for(const ne of j)t.addImplicit(ne),t.connectWithExisting(ne)&&re.push(ne);return t.addConnections(We(re)),t},exclude:({expr:n,model:e,stage:t,where:r})=>{const y=e.element(n.expanded),j=[y,...y.children()].filter(r);return t.exclude(j),t}};function pe(n,e){switch(!0){case R(e):{const t=n.element(e.expanded);return[t,...t.children()]}case g(e):{const t=n.element(e.element);let r;return e.isChildren?r=Cn$1(t.children()):e.isDescendants&&(r=Cn$1(t.descendants())),r&&r.length>0?r:[t]}case _(e):return[...xn$1(n.elements(),t=>e.isEqual===(t.kind===e.elementKind))];case D(e):return[...xn$1(n.elements(),t=>e.isEqual===t.tags.includes(e.elementTag))];default:a$1(e)}}function Vt(n,e){if(e.isEmpty()||n.length===0)return n;const t=B$1(n.map(y=>wn$1(y))),r=Cn$1(xn$1(e.elements,y=>!n.includes(y)&&t(y)));return[...n,...r]}function $t(n,{memory:e,model:t}){const r=pe(t,n);return R(n)||g(n)?n.isDescendants===!0?r:Vt(r,e):r}const Ca={include:({expr:n,model:e,stage:t,filterWhere:r})=>{const y=r(pe(e,n));if(y.length!==0)return t.addExplicit(y),t.connectWithExisting(y),t.addConnections(We(y)),t},exclude:({expr:n,model:e,stage:t,filterWhere:r})=>{const y=r(pe(e,n));return t.exclude(y),t}};function Pr(n,e){let t;return e.isChildren?t=[...n.children()]:e.isDescendants&&(t=[...n.descendants()]),t&&t.length>0?t:[n]}const Oa={include:({expr:n,model:e,stage:t,where:r})=>{const y=e.element(n.element),j=Pr(y,n).filter(r);if(j.length!==0)return t.addExplicit(j),t.connectWithExisting(j),t.addConnections(We(j)),t},exclude:({expr:n,model:e,stage:t,filterWhere:r})=>{const y=e.element(n.element),j=r(Pr(y,n));return t.exclude(j),t}},ht=()=>!0,Ra=n=>n;function Na(n){return{...n.$element,modelRef:1}}function Ma(n){return n.reduce((e,t)=>{const r=[...t.relations];u(Qt(r,1),"Edge must have at least one relation");const y=t.source.id,j=t.target.id,{title:re,...ne}=_r(r.map(de=>de.$relationship),r.find(de=>de.source.id===y&&de.target.id===j)?.$relationship),se={id:t.id,parent:t.boundary?.id??null,source:y,target:j,label:re??null,relations:r.map(de=>de.id),...ne};return e.push(se),e},[])}function La(n){return Nn([...n.final].map(Na),n.groups)}const Ta={include:({expr:{source:n,target:e,isBidirectional:t=!1},memory:r,model:y,stage:j,where:re,filterWhere:ne})=>{const se=p(n),de=p(e),be=[];switch(!0){case(se&&de&&r.isEmpty()&&re!==ht):{const Ce=xt$1(y.relationships(),xn$1(re),Cn$1(),jt$1(Ie=>new ee(Ie.source,Ie.target,new Set([Ie]))));return j.addConnections(Ce),j}case(se&&de&&!r.isEmpty()&&re!==ht):{be.push(...We(r.elements));break}case(se&&de):{be.push(...We(y.roots()));break}case(!se&&de&&re!==ht):{const Ce=pe(y,n),Ie=xt$1(Ce,xe(Oe=>xt$1(Oe,Pt(Ut(t===!0),{onTrue:we=>Nn$1(we.allIncoming,we.allOutgoing),onFalse:we=>we.allOutgoing}),xn$1(re),Mn$1(),Cn$1(),Wt(we=>we.source===Oe),([we,Te])=>Zi(xt$1(we,jt$1(ke=>new ee(Oe,ke.target,new Set([ke])))),xt$1(Te,jt$1(ke=>new ee(ke.source,Oe,new Set([ke]))))))));return j.addConnections(Ie),j}case(!se&&de):{const[Ce,Ie]=Wr(n,{memory:r,model:y}),Oe=t?"both":"directed";for(const we of Ce)be.push(...oe(we,Ie,Oe));break}case(se&&!de&&re!==ht):{const Ce=pe(y,e),Ie=xt$1(Ce,xe(Oe=>xt$1(Oe,Pt(Ut(t===!0),{onTrue:we=>Nn$1(we.allIncoming,we.allOutgoing),onFalse:we=>we.allIncoming}),xn$1(re),Cn$1(),Wt(we=>we.target===Oe),([we,Te])=>Zi(xt$1(Te,jt$1(ke=>new ee(Oe,ke.target,new Set([ke])))),xt$1(we,jt$1(ke=>new ee(ke.source,Oe,new Set([ke]))))))));return j.addConnections(Ie),j}case(se&&!de):{const[Ce,Ie]=Wr(e,{memory:r,model:y}),Oe=t?"both":"directed";for(const we of Ie)be.push(...oe(we,Ce,Oe));break}default:{u(!p(n),"Inference failed - source must be not a wildcard"),u(!p(e),"Inference failed - target must be not a wildcard");const Ce=$t(n,{memory:r,model:y}),Ie=$t(e,{memory:r,model:y}),Oe=t?"both":"directed";for(const we of Ce)be.push(...oe(we,Ie,Oe))}}return j.addConnections(ne(be)),j},exclude:({expr:{source:n,target:e,isBidirectional:t},model:r,memory:y,stage:j,where:re})=>{const ne=p(n),se=p(e);let de;switch(!0){case(ne&&se):{de=xt$1(y.connections,xe(bt(Se("relations"),xn$1(re),Cn$1())),zn$1());break}case(!ne&&se):{const be=pe(r,n);de=xt$1(be,xe(Ce=>xt$1(Ce,Pt(Ut(t===!0),{onTrue:Ie=>Nn$1(Ie.allIncoming,Ie.allOutgoing),onFalse:Ie=>Ie.allOutgoing}),xn$1(re),Cn$1())),zn$1());break}case(ne&&!se):{const be=pe(r,e);de=xt$1(be,xe(Ce=>xt$1(Ce,Pt(Ut(t===!0),{onTrue:Ie=>Nn$1(Ie.allIncoming,Ie.allOutgoing),onFalse:Ie=>Ie.allIncoming}),xn$1(re),Cn$1())),zn$1());break}default:{u(!p(n),"Inferrence failed - source must be not a wildcard"),u(!p(e),"Inferrence failed - target must be not a wildcard");const be=pe(r,n),Ce=pe(r,e);let Ie=new Set;for(const Oe of be)for(const we of Ce)wt$1(Oe,we)||(Ie=Nn$1(Ie,kn$1(Oe.allOutgoing,we.allIncoming),t?kn$1(we.allOutgoing,Oe.allIncoming):new Set));de=zn$1(xn$1(Ie,re))}}return j.excludeRelations(de),j}};function Wr(n,{memory:e,model:t}){let r=pe(t,n);if(!Qt(r,1))return[[],[]];if(R(n)||g(n)){const j=t.element(n.element??n.expanded),re=Cn$1(j.ascendingSiblings());return[Vt(r,e),Vt(re,e)]}const y=xt$1(r,jt$1(j=>j.ascendingSiblings()),Un$1(),Mn$1(),Cn$1(),j=>Vt(j,e));return[r,y]}const za={include:({expr:n,scope:e,model:t,memory:r,stage:y,filterWhere:j})=>{const re=n.incoming,ne=[];if(p(re)){if(!e)return;for(const se of e.ascendingSiblings())ne.push(...dt(se,e,"directed"))}else{const se=$t(re,{memory:r,model:t}),de=[...r.elements];de.length===0&&de.push(...ze(se.flatMap(Ce=>[...Ce.ascendingSiblings()])));const be=Pa(t,re);for(const Ce of de)ne.push(...oe(Ce,se,"directed").filter(be))}return y.addConnections(j(ne)),y},exclude:({expr:{incoming:n},model:e,scope:t,stage:r,where:y})=>{const j=[];if(p(n)){if(!t)return;j.push(...t.allIncoming)}else{const re=pe(e,n);j.push(...re.flatMap(ne=>[...ne.allIncoming]))}return r.excludeRelations(new Set(j.filter(y))),r}};function Pa(n,e){switch(!0){case _(e):case D(e):{const t=me(e);return r=>t(r.target)}case(g(e)&&e.isChildren):return B$1([...n.children(e.element)].map(t=>exports.c.isIncoming(t.id)));case(g(e)&&e.isDescendants):return B$1([exports.c.isInside(e.element),...[...n.children(e.element)].map(t=>exports.c.isIncoming(t.id))]);case R(e):return B$1([exports.c.isIncoming(e.expanded),exports.c.isInside(e.expanded)]);case g(e):return exports.c.isIncoming(e.element);default:a$1(e)}}const Wa={include:({expr:{inout:n},scope:e,model:t,memory:r,stage:y,filterWhere:j})=>{const re=[];if(p(n)){if(!e)return;re.push(...oe(e,e.ascendingSiblings()))}else{const ne=$t(n,{memory:r,model:t});let se=[...r.elements];se.length===0&&(se=ze(ne.flatMap(de=>Cn$1(de.ascendingSiblings()))));for(const de of ne)re.push(...oe(de,se))}return y.addConnections(j(re)),y},exclude:({expr:{inout:n},model:e,scope:t,stage:r,where:y})=>{const j=[];if(p(n)){if(!t)return;j.push(...t.allOutgoing),j.push(...t.allIncoming)}else{const re=pe(e,n);j.push(...re.flatMap(ne=>[...ne.allOutgoing,...ne.allIncoming]))}return r.excludeRelations(zn$1(j.filter(y))),r}},ja={include:({expr:n,scope:e,model:t,memory:r,stage:y,filterWhere:j})=>{const re=n.outgoing,ne=[];if(p(re)){if(!e)return;ne.push(...oe(e,e.ascendingSiblings(),"directed"))}else{const se=$t(re,{memory:r,model:t}),de=[...r.elements];de.length===0&&de.push(...ze(se.flatMap(Ce=>[...Ce.ascendingSiblings()])));const be=Ua(t,re);for(const Ce of se)ne.push(...oe(Ce,de,"directed").filter(be))}return y.addConnections(j(ne)),y},exclude:({expr:{outgoing:n},model:e,scope:t,stage:r,where:y})=>{const j=[];if(p(n)){if(!t)return;j.push(...t.allOutgoing)}else{const re=pe(e,n);j.push(...re.flatMap(ne=>[...ne.allOutgoing]))}return r.excludeRelations(zn$1(j.filter(y))),r}};function Ua(n,e){switch(!0){case _(e):case D(e):{const t=me(e);return r=>t(r.source)}case(g(e)&&e.isChildren):return B$1([...n.children(e.element)].map(t=>exports.c.isOutgoing(t.id)));case(g(e)&&e.isDescendants):return B$1([exports.c.isInside(e.element),...[...n.children(e.element)].map(t=>exports.c.isOutgoing(t.id))]);case R(e):return B$1([exports.c.isOutgoing(e.expanded),exports.c.isInside(e.expanded)]);case g(e):return exports.c.isOutgoing(e.element);default:a$1(e)}}const Fa={include:({scope:n,model:e,stage:t,memory:r,where:y})=>{if(!n){const de=[...e.roots()].filter(y);return de.length===0?void 0:(t.addExplicit(de),t.addConnections(We(de)),t.connectWithExisting(de),t)}const j=y(n)?n:null,re=Cn$1(xn$1(n.children(),y)),ne=re.length>0;if(!ne)if(j){if(oe(j,j.siblings()).length===0){const de=j.parent;de&&y(de)&&t.addExplicit(de)}re.push(j)}else return t;j&&t.addExplicit(j);const se=zn$1([...r.elements,...n.descendingSiblings()]);for(const de of se)t.addConnections(oe(de,re,"directed"));ne&&(t.addConnections(We(re)),t.addExplicit(re));for(const de of re)t.addConnections(oe(de,se,"directed"));return t},exclude:({scope:n,memory:e,stage:t,where:r})=>r!==ht?(t.exclude(B([...e.elements],r)),t):n?(t.exclude([n,...n.descendants()]),t):Je.empty(e.scope).stageExclude(t.expression)};function Pn(n,e,t){switch(!0){case E(n):return e==="include"?Pn(n.custom.expr,e,t):t.stage;case d(n):{const r=f(n.where.condition),y=B(r);return Pn(n.where.expr,e,{...t,where:r,filterWhere:y})}case R(n):return Da[e]({...t,expr:n})??t.stage;case g(n):return Oa[e]({...t,expr:n})??t.stage;case p(n):return Fa[e]({...t,expr:n})??t.stage;case _(n):case D(n):return Ca[e]({...t,expr:n})??t.stage;default:a$1(n)}}function Wn(n,e,t){switch(!0){case k(n):return e==="include"?Wn(n.customRelation.relation,e,t):t.stage;case O(n):{const r=f(n.where.condition),y=re=>new Set(B([...re],r)),j=re=>xt$1(re,jt$1(ne=>new ee(ne.source,ne.target,y(ne.relations))),B(ne=>ne.nonEmpty()));return Wn(n.where.expr,e,{...t,where:r,filterWhere:j})}case w(n):return Wa[e]({...t,expr:n})??t.stage;case h(n):return Ta[e]({...t,expr:n})??t.stage;case I(n):return ja[e]({...t,expr:n})??t.stage;case A(n):return za[e]({...t,expr:n})??t.stage;default:a$1(n)}}function jr(n,e,t){const r={model:n,scope:e.scope,where:ht,filterWhere:Ra};for(const y of t){if(dn$1(y)){const j=je.enter(e,y);e=jr(n,j,y.groupRules),u(e instanceof je,"processPredicates must return ActiveGroupMemory"),e=e.leave();continue}if(sn(y)){const j="include"in y?"include":"exclude",re=y.include??y.exclude;for(const ne of re){let se=j==="include"?e.stageInclude(ne):e.stageExclude(ne);switch(!0){case C(ne):se=Pn(ne,j,{...r,stage:se,memory:e})??se;break;case K$1(ne):se=Wn(ne,j,{...r,stage:se,memory:e})??se;break;default:a$1(ne)}e=se.commit()}}}return Fn.for(e).commit()}function qa(n,{docUri:e,rules:t,...r}){t=ba(t,n.globals());const y=r.viewOf?n.element(r.viewOf):null;let j=jr(n,Je.empty(y),t);j.isEmpty()&&y&&(j=j.update({final:new Set([y])})),j=Ba(j);const re=La(j),ne=Ma(j.connections);er(re,ne);const se=hr({nodes:re,edges:ne}),de=Rr(t,xr(t,se.nodes)),be=pn(t,cn),Ce=wn(de);return xn({...r,autoLayout:{direction:be?.direction??"TB",...be?.nodeSep&&{nodeSep:be.nodeSep},...be?.rankSep&&{rankSep:be.rankSep}},edges:xa(t,de,se.edges),nodes:jt$1(de,Ie=>(delete Ie.notation,Ie.icon==="none"&&delete Ie.icon,Ie)),...Ce.length>0&&{notation:{elements:Ce}}})}function Ba(n){if(n.groups.length===0)return n;const e=new sn$1(()=>new Set),t=new Map,r=re=>{for(const ne of re.ancestors()){const se=t.get(ne);if(se)return t.set(re,se),e.get(se).add(re),!0}return!1},y=re=>{for(const ne of re.descendants("asc")){const se=t.get(ne);if(se)return t.set(re,se),e.get(se).add(re),!0}return!1};if(xt$1(Sn$1([...n.explicitFirstSeenIn.keys()]),he(re=>{if(!r(re)){const ne=i(n.explicitFirstSeenIn.get(re));t.set(re,ne),e.get(ne).add(re)}})),xt$1(Sn$1([...n.lastSeenIn.keys()]),B(re=>!t.has(re)),he(re=>{if(r(re)||y(re))return;const ne=i(n.lastSeenIn.get(re));t.set(re,ne),e.get(ne).add(re)})),e.size===0)return n;let j=n.groups.map(re=>{const ne=e.get(re.id);return ne?re.update(ne):re});return n.update({groups:j})}function jn(n,e){switch(!0){case fn$1(n):return va(e,n);case yn$1(n):return Sa(e,n);case V(n):return qa(e,n);default:a$1(n)}}function Un(n,e){try{return{isSuccess:!0,view:jn(n,e)}}catch(t){return{isSuccess:!1,error:t instanceof Error?t:new Error(`Unknown error: ${t}`),view:void 0}}}function Z(n){return tt(n)?n:n.id}class Ur{constructor(e,t){this.$model=e,this.$deployments=t;for(const r of Sn$1(Ye(t.elements))){const y=this.addElement(r);for(const j of y.tags)this.#u.get(j).add(y);y.isInstance()&&this.#s.get(y.element.id).add(y)}for(const r of Ye(t.relations)){const y=this.addRelation(r);for(const j of y.tags)this.#u.get(j).add(y)}}#e=new Map;#t=new Map;#n=new sn$1(()=>new Set);#s=new sn$1(()=>new Set);#i=new Set;#r=new Map;#o=new sn$1(()=>new Set);#c=new sn$1(()=>new Set);#a=new sn$1(()=>new Set);#u=new sn$1(()=>new Set);#d=new Map;element(e){if(e instanceof $n||e instanceof In)return e;const t=Z(e);return i(this.#e.get(t),`Element ${t} not found`)}findElement(e){return this.#e.get(e)??null}node(e){const t=this.element(e);return u(t.isDeploymentNode(),`Element ${t.id} is not a deployment node`),t}findNode(e){const t=this.findElement(e);return t?(u(t.isDeploymentNode(),`Element ${t?.id} is not a deployment node`),t):null}instance(e){const t=this.element(e);return u(t.isInstance(),`Element ${t.id} is not a deployed instance`),t}findInstance(e){const t=this.findElement(e);return t?(u(t.isInstance(),`Element ${t?.id} is not a deployed instance`),t):null}roots(){return this.#i.values()}elements(){return this.#e.values()}*nodes(){for(const e of this.#e.values())e.isDeploymentNode()&&(yield e)}*instances(){for(const e of this.#e.values())e.isInstance()&&(yield e)}*instancesOf(e){const t=Z(e),r=this.#s.get(t);r&&(yield*r)}deploymentRef(e){if("element"in e){const{id:t,element:r}=e;return An$1(this.#d,`${t}@${r}`,()=>new Ms(this.instance(t),this.$model.element(r)))}return this.element(e)}relationships(){return this.#r.values()}relationship(e){return i(this.#r.get(e),`DeploymentRelationModel ${e} not found`)}findRelationship(e){return this.#r.get(e)??null}*views(){for(const e of this.$model.views())e.isDeploymentView()&&(yield e)}parent(e){const t=Z(e);return this.#t.get(t)||null}children(e){const t=Z(e);return this.#n.get(t)}*siblings(e){const t=Z(e),r=this.parent(e)?.children()??this.roots();for(const y of r)y.id!==t&&(yield y)}*ancestors(e){let t=tt(e)?e:e.id,r;for(;r=this.#t.get(t);)yield r,t=r.id}*descendants(e,t="desc"){for(const r of this.children(e))t==="asc"?(yield r,yield*this.descendants(r.id)):(yield*this.descendants(r.id),yield r)}*incoming(e,t="all"){const r=Z(e);for(const y of this.#o.get(r))switch(!0){case t==="all":case(t==="direct"&&y.target.id===r):case(t==="to-descendants"&&y.target.id!==r):yield y;break}}*outgoing(e,t="all"){const r=Z(e);for(const y of this.#c.get(r))switch(!0){case t==="all":case(t==="direct"&&y.source.id===r):case(t==="from-descendants"&&y.source.id!==r):yield y;break}}addElement(e){if(this.#e.has(e.id))throw new Error(`Element ${e.id} already exists`);const t=exports.a7.isDeploymentNode(e)?new $n(this,Object.freeze(e)):new In(this,Object.freeze(e),this.$model.element(e.element));this.#e.set(t.id,t);const r=yn$2(t.id);return r?(u(this.#e.has(r),`Parent ${r} of ${t.id} not found`),this.#t.set(t.id,this.node(r)),this.#n.get(r).add(t)):(u(t.isDeploymentNode(),`Root element ${t.id} is not a deployment node`),this.#i.add(t)),t}addRelation(e){if(this.#r.has(e.id))throw new Error(`Relation ${e.id} already exists`);const t=new gr(this,Object.freeze(e));this.#r.set(t.id,t),this.#o.get(t.target.id).add(t),this.#c.get(t.source.id).add(t);const r=t.boundary?.id??null;if(r)for(const y of[r,...bn$1(r)])this.#a.get(y).add(t);for(const y of bn$1(t.source.id)){if(y===r)break;this.#c.get(y).add(t)}for(const y of bn$1(t.target.id)){if(y===r)break;this.#o.get(y).add(t)}return t}}class Fr{constructor(e,t){this.model=e,this.$relationship=t,this.source=e.element(t.source),this.target=e.element(t.target);const r=qt$1(this.source.id,this.target.id);this.boundary=r?this.model.element(r):null}source;target;boundary;get id(){return this.$relationship.id}get expression(){return`${this.source.id} -> ${this.target.id}`}get title(){return Pe(this.$relationship.title)?null:this.$relationship.title}get technology(){return Pe(this.$relationship.technology)?null:this.$relationship.technology}get description(){return Pe(this.$relationship.description)?null:this.$relationship.description}get navigateTo(){return this.$relationship.navigateTo?this.model.view(this.$relationship.navigateTo):null}get tags(){return this.$relationship.tags??[]}get kind(){return this.$relationship.kind??null}get links(){return this.$relationship.links??[]}*views(){for(const e of this.model.views())e.includesRelation(this.id)&&(yield e)}}class qr{constructor(e,t,r,y){this.view=e,this.$edge=t,this.source=r,this.target=y}get id(){return this.$edge.id}get parent(){return this.$edge.parent?this.view.node(this.$edge.parent):null}get label(){return this.$edge.label}get description(){return this.$edge.description??null}get technology(){return this.$edge.technology??null}hasParent(){return this.$edge.parent!==null}get tags(){return this.$edge.tags??[]}get stepNumber(){return this.isStep()?pn$1(this.id):null}get navigateTo(){return this.$edge.navigateTo?this.view.$model.view(this.$edge.navigateTo):null}isStep(){return G(this.id)}*relationships(e){for(const t of this.$edge.relations)if(e){const r=this.view.$model.findRelationship(t,e);r&&(yield r)}else yield this.view.$model.relationship(t)}includesRelation(e){return this.$edge.relations.includes(e)}}class Br{constructor(e,t){this.$view=e,this.$node=t}get id(){return this.$node.id}get title(){return this.$node.title}get kind(){return this.$node.kind}get description(){return this.$node.description}get technology(){return this.$node.technology}get parent(){return this.$node.parent?this.$view.node(this.$node.parent):null}get element(){const e=exports.i.modelRef(this.$node);return e?this.$view.$model.element(e):null}get deployment(){const e=exports.i.deploymentRef(this.$node);return e?this.$view.$model.deployment.element(e):null}get shape(){return this.$node.shape}get color(){return this.$node.color}get tags(){return this.$node.tags??[]}get links(){return this.$node.links??[]}get navigateTo(){return this.$node.navigateTo?this.$view.$model.view(this.$node.navigateTo):null}*ancestors(){let e=this.parent;for(;e;)yield e,e=e.parent}*children(){for(const e of this.$node.children)yield this.$view.node(e)}*sublings(){const e=this.parent?.children()??this.$view.roots();for(const t of e)t.id!==this.id&&(yield t)}*incoming(e="all"){for(const t of this.$node.inEdges){const r=this.$view.edge(t);switch(!0){case e==="all":case(e==="direct"&&r.target.id===this.id):case(e==="to-descendants"&&r.target.id!==this.id):yield r;break}}}*incomers(e="all"){const t=new Set;for(const r of this.incoming(e))t.has(r.source.id)||(t.add(r.source.id),yield r.source)}*outgoing(e="all"){for(const t of this.$node.outEdges){const r=this.$view.edge(t);switch(!0){case e==="all":case(e==="direct"&&r.source.id===this.id):case(e==="from-descendants"&&r.source.id!==this.id):yield r;break}}}*outgoers(e="all"){const t=new Set;for(const r of this.outgoing(e))t.has(r.target.id)||(t.add(r.target.id),yield r.target)}isDiagramNode(){return"width"in this.$node&&"height"in this.$node}hasChildren(){return this.$node.children.length>0}hasParent(){return this.$node.parent!==null}hasElement(){return exports.i.modelRef(this.$node)!==null}hasDeployment(){return exports.i.deploymentRef(this.$node)!==null}hasDeployedInstance(){return this.hasElement()&&this.hasDeployment()}isGroup(){return exports.i.isNodesGroup(this.$node)}}class Vr{constructor(e,t){this.$model=e,this.$view=t;for(const r of ln(t.nodes,_n$1)){const y=new Br(this,Object.freeze(r));this.#t.set(r.id,y),r.parent||this.#e.add(y),y.hasDeployment()&&this.#i.add(y.deployment.id),y.hasElement()&&this.#s.add(y.element.id);for(const j of y.tags)An$1(this.#o,j,()=>new Set).add(y)}for(const r of t.edges){const y=new qr(this,Object.freeze(r),this.node(r.source),this.node(r.target));for(const j of y.tags)An$1(this.#o,j,()=>new Set).add(y);for(const j of r.relations)this.#r.add(j);this.#n.set(r.id,y)}}#e=new Set;#t=new Map;#n=new Map;#s=new Set;#i=new Set;#r=new Set;#o=new Map;get __(){return this.$view.__??"element"}get id(){return this.$view.id}get title(){return this.$view.title}get tags(){return this.$view.tags??[]}get links(){return this.$view.links??[]}get viewOf(){const e=this.$view;return Rn$1(e)?this.$model.element(e.viewOf):null}get includedTags(){return[...this.#o.keys()]}roots(){return this.#e.values()}*compounds(){for(const e of this.#t.values())e.hasChildren()&&(yield e)}node(e){const t=Z(e);return i(this.#t.get(t),`Node ${t} not found in view ${this.$view.id}`)}findNode(e){return this.#t.get(Z(e))??null}nodes(){return this.#t.values()}edge(e){const t=Z(e);return i(this.#n.get(t),`Edge ${t} not found in view ${this.$view.id}`)}findEdge(e){return this.#n.get(Z(e))??null}edges(){return this.#n.values()}*edgesWithRelation(e){for(const t of this.#n.values())t.includesRelation(e)&&(yield t)}*elements(){for(const e of this.#t.values())e.hasElement()&&(yield e)}includesElement(e){return this.#s.has(e)}includesDeployment(e){return this.#i.has(e)}includesRelation(e){return this.#r.has(e)}isComputed(){return!0}isDiagram(){return"bounds"in this.$view}isElementView(){return V(this.$view)}isDeploymentView(){return fn$1(this.$view)}isDynamicView(){return yn$1(this.$view)}}class Ue{constructor(e){this.$model=e;for(const r of Ye(e.elements)){const y=this.addElement(r);for(const j of y.tags)this.#u.get(j).add(y)}for(const r of Ye(e.relations)){const y=this.addRelation(r);for(const j of y.tags)this.#u.get(j).add(y)}this.deployment=new Ur(this,e.deployments);const t=xt$1(Ye(e.views),ln((r,y)=>Tt(r.title??"untitled",y.title??"untitled")));for(const r of t){const y=new Vr(this,Object.freeze(r));this.#a.set(r.id,y);for(const j of y.tags)this.#u.get(j).add(y)}}Aux;#e=new Map;#t=new Map;#n=new sn$1(()=>new Set);#s=new Set;#i=new Map;#r=new sn$1(()=>new Set);#o=new sn$1(()=>new Set);#c=new sn$1(()=>new Set);#a=new Map;#u=new sn$1(()=>new Set);deployment;static compute(e){let{views:t,...r}=e;const y=new Ue({...r,views:{}});return new Ue({...r,views:it(t,j=>jn(j,y))})}static makeCompute(e){let{views:t,...r}=e;const y=new Ue(structuredClone({...r,views:{}}));return j=>Un(j,y)}static create(e){return new Ue(e)}static fromDump(e){return new Ue(e)}get type(){return this.$model.__??"computed"}element(e){if(e instanceof yn)return e;const t=Z(e);return i(this.findElement(t),`Element ${Z(e)} not found`)}findElement(e){return this.#e.get(e)??null}roots(){return this.#s.values()}elements(){return this.#e.values()}relationships(){return this.#i.values()}relationship(e,t){if(t==="deployment")return this.deployment.relationship(e);let r=this.#i.get(e)??null;return r||t==="model"?i(r,`Model relation ${e} not found`):i(this.deployment.findRelationship(e),`No model/deployment relation ${e} not found`)}findRelationship(e,t){if(t==="deployment")return this.deployment.findRelationship(e);let r=this.#i.get(e)??null;return r||t==="model"?r:this.deployment.findRelationship(e)}views(){return this.#a.values()}view(e){return i(this.#a.get(e),`View ${e} not found`)}findView(e){return i(this.#a.get(e),`View ${e} not found`)}parent(e){const t=Z(e);return this.#t.get(t)||null}children(e){const t=Z(e);return this.#n.get(t)}*siblings(e){const t=Z(e),r=this.#t.get(t),y=r?this.#n.get(r.id).values():this.roots();for(const j of y)j.id!==t&&(yield j)}*ancestors(e){let t=Z(e),r;for(;r=this.#t.get(t);)yield r,t=r.id}*descendants(e){for(const t of this.children(e))yield t,yield*this.descendants(t.id)}*incoming(e,t="all"){const r=Z(e);for(const y of this.#r.get(r))switch(!0){case t==="all":case(t==="direct"&&y.target.id===r):case(t==="to-descendants"&&y.target.id!==r):yield y;break}}*outgoing(e,t="all"){const r=Z(e);for(const y of this.#o.get(r))switch(!0){case t==="all":case(t==="direct"&&y.source.id===r):case(t==="from-descendants"&&y.source.id!==r):yield y;break}}globals(){return{predicates:{...this.$model.globals?.predicates},dynamicPredicates:{...this.$model.globals?.dynamicPredicates},styles:{...this.$model.globals?.styles}}}addElement(e){if(this.#e.has(e.id))throw new Error(`Element ${e.id} already exists`);const t=new yn(this,Object.freeze(structuredClone(e)));this.#e.set(t.id,t);const r=yn$2(t.id);return r?(u(this.#e.has(r),`Parent ${r} of ${t.id} not found`),this.#t.set(t.id,this.element(r)),this.#n.get(r).add(t)):this.#s.add(t),t}addRelation(e){if(this.#i.has(e.id))throw new Error(`Relation ${e.id} already exists`);const t=new Fr(this,Object.freeze(structuredClone(e))),{source:r,target:y}=t;this.#i.set(t.id,t),this.#r.get(y.id).add(t),this.#o.get(r.id).add(t);const j=qt$1(r.id,y.id);if(j)for(const re of[j,...bn$1(j)])this.#c.get(re).add(t);for(const re of bn$1(e.source)){if(re===j)break;this.#o.get(re).add(t)}for(const re of bn$1(e.target)){if(re===j)break;this.#r.get(re).add(t)}return t}}function Kr(n){return n.isInstance()}exports.$=$n,exports.A=Ae,exports.B=Br,exports.C=Cn,exports.D=Dn,exports.E=rn,exports.F=Fr,exports.G=Gn,exports.H=tn,exports.I=In,exports.J=jn$1,exports.K=pn$1,exports.L=Ls,exports.M=i,exports.N=vn$1,exports.O=Ot,exports.P=Ps,exports.Q=Qt,exports.R=mn$2,exports.S=yn$2,exports.T=Tt,exports.U=Ur,exports.V=Vr,exports.W=Ws,exports.X=en,exports.Y=U,exports.Z=Z$1,exports._=nr,exports.a=Ue,exports.a0=Ye,exports.a1=gn$1,exports.a2=st,exports.a3=ur,exports.a4=V,exports.a5=En$2,exports.a6=Rn$1,exports.a9=wt$1,exports.aa=ft,exports.ac=gn$2,exports.ad=Rn$2,exports.ae=ln$1,exports.af=L,exports.ag=N,exports.b=An,exports.d=qt,exports.e=ee,exports.f=at,exports.g=gr,exports.h=ct,exports.j=js,exports.m=mr,exports.n=a$1,exports.o=u,exports.p=an$1,exports.q=qr,exports.r=ln$2,exports.s=st$1,exports.t=qt$1,exports.u=ut,exports.v=vr,exports.w=wr,exports.x=Dt,exports.y=yn,exports.z=zs;
|